Documentation

MIPRE.TM.CookLevin.FieldFml

The fields of a literal, as formulas #

For a literal whose m index bits are the input bits b .. b + m, the formulas computing its fields (litFields): the flag, the structured fields as slices of the input, and the answer decoding (j < 2T, r = j or j - 2T, p = r / 2 + 3, v from the parity of r), multiplexed by the flag. evalFields_litFields says that they compute exactly fieldsOf on the index (planning/succinct-cook-levin.md, S3).

Input slices #

The input bits b .. b + m as a bit string.

Equations
Instances For
    @[simp]
    theorem MIPRE.TM.CookLevin.Desc.length_ibOf (b m : ℕ) (x : ℕ → Bool) :
    List.length (ibOf b m x) = m
    theorem MIPRE.TM.CookLevin.Desc.range'_drop_take (s n off w : ℕ) (h : off + w ≤ n) :
    List.take w (List.drop off (List.range' s n)) = List.range' (s + off) w
    theorem MIPRE.TM.CookLevin.Desc.bitsOf_field_ibOf (b m off w : ℕ) (h : off + w ≤ m) (x : ℕ → Bool) :
    SAT.Fml.bitsOf (SAT.Fml.field (b + off) w) x = List.take w (List.drop off (ibOf b m x))
    theorem MIPRE.TM.CookLevin.Desc.val_field_ibOf (b m off w : ℕ) (h : off + w ≤ m) (x : ℕ → Bool) :
    SAT.Fml.val (SAT.Fml.field (b + off) w) x = bitField (ibOf b m x) off w
    theorem MIPRE.TM.CookLevin.Desc.getD_ibOf (b m i : ℕ) (h : i < m) (x : ℕ → Bool) :
    List.getD (ibOf b m x) i false = x (b + i)

    Multiplexed fields and constants #

    if s then as else bs, bitwise.

    Equations
    Instances For
      @[simp]
      theorem MIPRE.TM.CookLevin.Desc.val_cst (w c : ℕ) (x : ℕ → Bool) :
      SAT.Fml.val (cst w c) x = c % 2 ^ w

      The fields of a literal #

      The fields of a literal as formulas.

      Instances For

        The values of the field formulas.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The low m - 1 bits, the value j of an answer index.

          Equations
          Instances For

            r = j or j - 2T.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              p = r / 2 + 3, on W bits.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                The field formulas of the literal with base b.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Lengths #

                  theorem MIPRE.TM.CookLevin.Desc.length_rF (e G T b : ℕ) :
                  (rF e G T b).length = flagOff e G

                  Values #

                  theorem MIPRE.TM.CookLevin.Desc.eval_flagF (e G b : ℕ) (x : ℕ → Bool) :
                  SAT.Fml.eval x (flagF e G b) = List.getD (ibOf b (mOf e G) x) (flagOff e G) false
                  theorem MIPRE.TM.CookLevin.Desc.val_jF (e G b : ℕ) (x : ℕ → Bool) :
                  SAT.Fml.val (jF e G b) x = bitField (ibOf b (mOf e G) x) 0 (flagOff e G)
                  theorem MIPRE.TM.CookLevin.Desc.fourT_lt (e G T : ℕ) (hT : T ≤ Sof e) :
                  4 * T < 2 ^ flagOff e G

                  The answer bound: 4T < 2^{m-1}, from T ≤ S.

                  theorem MIPRE.TM.CookLevin.Desc.eval_lt2TF (e G T b : ℕ) (x : ℕ → Bool) (hT : T ≤ Sof e) :
                  SAT.Fml.eval x (lt2TF e G T b) = true ↔ bitField (ibOf b (mOf e G) x) 0 (flagOff e G) < 2 * T
                  theorem MIPRE.TM.CookLevin.Desc.val_rF (e G T b : ℕ) (x : ℕ → Bool) (hT : T ≤ Sof e) :
                  SAT.Fml.val (rF e G T b) x = if bitField (ibOf b (mOf e G) x) 0 (flagOff e G) < 2 * T then bitField (ibOf b (mOf e G) x) 0 (flagOff e G) else bitField (ibOf b (mOf e G) x) 0 (flagOff e G) - 2 * T
                  theorem MIPRE.TM.CookLevin.Desc.val_pAnsF (e G T b : ℕ) (x : ℕ → Bool) (hT : T ≤ Sof e) :
                  SAT.Fml.val (pAnsF e G T b) x = ((if bitField (ibOf b (mOf e G) x) 0 (flagOff e G) < 2 * T then bitField (ibOf b (mOf e G) x) 0 (flagOff e G) else bitField (ibOf b (mOf e G) x) 0 (flagOff e G) - 2 * T) / 2 + 3) % 2 ^ W e
                  theorem MIPRE.TM.CookLevin.Desc.eval_ansOkF (e G T b : ℕ) (x : ℕ → Bool) (hT : T ≤ Sof e) :
                  SAT.Fml.eval x ((flagF e G b).not.and (SAT.Fml.ltConst (jF e G b) (nbits (flagOff e G) (4 * T)))) = (!SAT.Fml.eval x (flagF e G b) && decide (bitField (ibOf b (mOf e G) x) 0 (flagOff e G) < 4 * T))
                  theorem MIPRE.TM.CookLevin.Desc.length_dAns (e G T b : ℕ) :
                  (muxList (lt2TF e G T b) (cst 4 5) (cst 4 6)).length = 4
                  theorem MIPRE.TM.CookLevin.Desc.length_vAns (e G T b : ℕ) :
                  (muxList ((rF e G T b).headD (SAT.Fml.const false)) (cst 3 1) (cst 3 5)).length = 3
                  theorem MIPRE.TM.CookLevin.Desc.evalFields_litFields (e G T b : ℕ) (x : ℕ → Bool) (hT : T ≤ Sof e) :
                  evalFields (litFields e G T b) x = fieldsOf e G T (ibOf b (mOf e G) x)

                  The field formulas compute the fields of the index.