Documentation

MIPRE.TM.CookLevin.Index

The canonical index of a tableau variable #

idxOf e G T v is the index of the variable v in the described 3SAT formula: the answer index j < 4T for a cell of one of the two free tapes inside the answer block — tape 5 for j < 2T and tape 6 otherwise, position r / 2 + 3 for r = j mod 2T, the value 1 for r odd and the blank for r even — and the structured index (encodeVar) for every other variable. So the first 4T variables of the formula are exactly the two answer blocks, which is what item 1 of thm:succinct-sat needs, and decodeVar_fieldsOf_idxOf says that decoding the canonical index returns the variable. decodeVar_ans is the other half: every index below 4T decodes to the answer variable it stands for (planning/succinct-cook-levin.md, S3).

Reading an index built from a number #

theorem MIPRE.TM.CookLevin.Desc.getD_bitsOfNat {w : ℕ} (n : ℕ) {i : ℕ} (hi : i < w) :

The answer variables #

The offset of an answer index inside its block.

Equations
Instances For

    The tape code of an answer index: 5 for the first block, 6 for the second.

    Equations
    Instances For

      The cell value of an answer index: 1 for an odd offset, the blank for an even one.

      Equations
      Instances For
        theorem MIPRE.TM.CookLevin.Desc.rOf_lt (T j : ℕ) (hj : j < 4 * T) :
        rOf T j < 2 * T
        theorem MIPRE.TM.CookLevin.Desc.four_T_le_flag (e G T : ℕ) (hT : T ≤ Sof e) :
        4 * T ≤ 2 ^ flagOff e G

        4T fits below the flag bit.

        theorem MIPRE.TM.CookLevin.Desc.decodeVar_ans (e G T : ℕ) (hT : T ≤ Sof e) {j : ℕ} (hj : j < 4 * T) :
        ∃ (jt : Fin 7) (p : Pos (Sof e)), ↑jt = tapeIdx T j ∧ ↑p = rOf T j / 2 + 3 ∧ decodeVar e G (fieldsOf e G T (SAT.bitsOfNat (mOf e G) j)) = some (TabVar.cell 0 (Sum.inl jt) p (valOf T j))

        Every index below 4T decodes to the answer variable it stands for.

        The canonical index #

        def MIPRE.TM.CookLevin.Desc.IsAnsCell (e T : ℕ) (t : Fin (Sof e + 1)) (d : Tape 7 6) (p : Pos (Sof e)) (v : CellVal Interp.Sym) :

        The cell is an answer cell: at time 0 on a free tape, inside the answer block, holding 1 or the blank.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[instance_reducible]
          instance MIPRE.TM.CookLevin.Desc.instDecidableIsAnsCell (e T : ℕ) (t : Fin (Sof e + 1)) (d : Tape 7 6) (p : Pos (Sof e)) (v : CellVal Interp.Sym) :
          Decidable (IsAnsCell e T t d p v)
          Equations
          def MIPRE.TM.CookLevin.Desc.ansIdx (e T : ℕ) (d : Tape 7 6) (p : Pos (Sof e)) (v : CellVal Interp.Sym) :

          The answer index of an answer cell.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem MIPRE.TM.CookLevin.Desc.ansIdx_lt (e T : ℕ) (hT : T ≤ Sof e) {t : Fin (Sof e + 1)} {d : Tape 7 6} {p : Pos (Sof e)} {v : CellVal Interp.Sym} (h : IsAnsCell e T t d p v) :
            ansIdx e T d p v < 4 * T
            theorem MIPRE.TM.CookLevin.Desc.idxOf_lt (e G T : ℕ) (hT : T ≤ Sof e) (v : TabVar 7 6 Interp.Sym Interp.Ctl (Sof e) G) :
            idxOf e G T v < 2 ^ mOf e G
            theorem MIPRE.TM.CookLevin.Desc.decodeVar_fieldsOf_idxOf (e G T : ℕ) (hT : T ≤ Sof e) (v : TabVar 7 6 Interp.Sym Interp.Ctl (Sof e) G) :
            decodeVar e G (fieldsOf e G T (SAT.bitsOfNat (mOf e G) (idxOf e G T v))) = some v

            Decoding the canonical index returns the variable.

            theorem MIPRE.TM.CookLevin.Desc.idxOf_ans (e G T : ℕ) (hT : T ≤ Sof e) {j : ℕ} (hj : j < 4 * T) {jt : Fin 7} {p : Pos (Sof e)} (hjt : ↑jt = tapeIdx T j) (hp : ↑p = rOf T j / 2 + 3) :
            idxOf e G T (TabVar.cell 0 (Sum.inl jt) p (valOf T j)) = j

            The canonical index of the answer variable of j is j.