OAI/Computability/MaxCut/Machines/Input.lean
82 declarations, 0 contain sorry, 0 declared as axioms
Serialization boundaries and direct row lookup for the shared executable fixed-alphabet graph codec. The alphabet is a fixed parameter. Rows remain in their stored order, including repeated darts and loops. Word offsets are fixed; bit offsets are represented by actual encoded prefixes because unary fields have data-dependent lengths. These are data identities, not runtime certificates.
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowWidthline 32 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowOffsetline 35Source documentation
Offset measured in natural-word fields, including the two header fields.
def rowOffset (q e : Nat) : Nat := 2 + rowWidth q * e
Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowWidth
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowsWords_splitline 38Source documentation
Exact decomposition before, at, and after a selected stored row.
theorem rowsWords_split (rows : List (DartRow q n m)) (e : Nat) (he : e < rows.length) : rows.flatMap rowWords = (rows.take e).flatMap rowWords ++ (rowWords rows[e] ++ (rows.drop (e + 1)).flatMap rowWords) := by … - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowsBits_splitline 49Source documentation
The unary serialization keeps exactly the same row boundaries, with separate encoded prefixes rather than an assumed constant bit offset.
theorem rowsBits_split (rows : List (DartRow q n m)) (e : Nat) (he : e < rows.length) : encodeWords (rows.flatMap rowWords) = encodeWords ((rows.take e).flatMap rowWords) ++ (encodeWords (rowWords rows[e]) ++ encodeWords ((rows.drop (e + 1)).flatMap rowWords)) := by … - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowsBits_append_splitline 59Source documentation
A selected row can be followed by an arbitrary caller-owned suffix.
theorem rowsBits_append_split (rows : List (DartRow q n m)) (e : Nat) (he : e < rows.length) (suffix : List Bool) : encodeWords (rows.flatMap rowWords) ++ suffix = encodeWords ((rows.take e).flatMap rowWords) ++ (encodeWords (rowWords rows[e]) ++ (encodeWords ((rows.drop (e + 1)).flatMap rowWords) ++ suffix)) := by … - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.prefixWordsline 68 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.suffixWordsline 71 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.prefixWords_lengthline 74 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_at_rowline 79 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableBits_at_rowline 88 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableBits_headerline 95Source documentation
Removing precisely the two encoded header words exposes the stored rows.
theorem tableBits_header (table : Table q) : tableBits table = encodeWord table.vertices ++ (encodeWord table.darts ++ encodeWords ((rowList table).flatMap rowWords)) := by … - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_drop_rowline 100 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_take_rowline 107 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_get_tailline 113 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_get_reverseline 118 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_drop_relationline 123 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.relationWords_getline 129 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_get_relationline 134 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.tableWords_get_predicateline 144 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.rowOffset_lt_lengthline 151 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Input.relationOffset_lt_lengthline 159 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Alphabetline 179 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Portsline 181 - inductive
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Labelline 183 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Label.enumListline 188 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Label.enumList_getElem?_ctorIdx_eqline 191 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Label.enumList_nodupline 195 - instance
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.(instance at line 197)line 197 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.statementline 201 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.resultTapesline 220 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.resultTapes_otherline 229 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.setupInTimeline 237Source documentation
Actual program placement is the only execution premise. Header values and unread row bits specify the input, and every auxiliary role starts empty.
def setupInTime (ports : Ports K) (distinct : Function.Injective ports) (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Ports, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.tableSetupInTimeline 329Source documentation
Specialization to the checked graph-table codec. The bound follows from the actual copy and delimiter-scan traces above.
def tableSetupInTime {q : Nat} (ports : Ports K) (distinct : Function.Injective ports) (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Ports, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.programline 356 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Setup.machineline 360Source documentation
This stage itself has only seven tapes and nine control labels.
def machine : FinTM2 where …
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Alphabetline 388 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Stateline 389 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.relationEquivline 392Source documentation
The relation register is a finite tuple of bits, with no unbounded storage.
def relationEquiv (q : Nat) : RelationTable q ≃ (Fin (q * q) → Bool) where …
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.relationFintypeline 399Source documentation
Executable enumeration used when assembling the finite machine state.
@[instance_reducible] def relationFintype (q : Nat) : Fintype (RelationTable q) := …
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.stateFintypeline 402 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.readSlotline 408Source documentation
Read one encoded Boolean into a fixed slot of the finite relation register.
def readSlot (source : K) (i : Fin (q * q)) (next : TM2.Stmt (Alphabet (K := K)) Λ (State σ q)) : …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.State
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.stepAux_readSlotline 418 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.readSlotsline 428 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.indexedWordsline 434 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.fillSlotsline 437 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.fillSlots_preserves_correctline 443 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.fillSlots_memline 455 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.fillSlots_finRangeline 468 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.indexedWords_finRangeline 475 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.stepAux_readSlotsline 488Source documentation
Each stored register bit is obtained from its actual serialized field.
theorem stepAux_readSlots (source : K) (indices : List (Fin (q * q))) (relation : RelationTable q) (next : TM2.Stmt (Alphabet (K := K)) Λ (State σ q)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.State
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.readRelationline 505Source documentation
Fixed finite program fragment; it can be inserted before any continuation.
def readRelation (source : K) (next : TM2.Stmt (Alphabet (K := K)) Λ (State σ q)) : …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.State
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.stepAux_readRelationline 510 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.stepAux_readRelation_fromTapesline 521 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.readSlots_pushBoundline 535 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.readRelation_pushBoundline 545 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.parserline 551 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.parser_pushBoundline 556 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.parserStepline 561 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.parserTraceline 576Source documentation
One transition executes the fixed chain of
q*qslot readers.theorem parserTrace (source : K) (readLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ q)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.State
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.parserInTimeline 588 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Bufferline 622 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.emptyBufferline 624 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.readSlotsline 630 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.fillline 640Source documentation
Proof-level description of the finite register updates.
def fill (slots : List (Fin N)) (bits buffer : Buffer N) : Buffer N := …
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.fill_applyline 643 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.fill_allline 654 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.stepAux_readSlotsline 662Source documentation
The input symbols are physically popped; the remaining suffix is exact.
theorem stepAux_readSlots (src : K) (slots : List (Fin N)) (next : TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N)) (ambient : σ) (bits buffer : Buffer N) (tapes : K → List Bool) (suffix : List Bool) : TM2.stepAux (readSlots src slots next) (ambient, buffer) (Function.update tapes src (slots.map bits ++ suffix)) = TM2.stepAux next (ambient, fill slots bits buffer) (Function.update tapes src suffix) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer, OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.readSlots, OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.fill
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.stepAux_readAllline 678 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.statementPushBound_readSlotsline 692 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.writeSlotsline 702Source documentation
The slot list is a fixed part of the syntax; each instruction reads only the finite internal state. Push order is reversed on the stack.
def writeSlots {M : Nat} (dst : K) (emit : σ → Buffer M) : List (Fin M) → TM2.Stmt (fun _ : K => Bool) Λ σ → TM2.Stmt (fun _ : K => Bool) Λ σ | [], next => next | i :: slots, next => .push dst (fun state => emit state i) (writeSlots dst emit slots next)Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.stepAux_writeSlotsline 707 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.statementPushBound_writeSlotsline 722 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.blockStmtline 740Source documentation
Read a fixed block, write its fixed finite transformation, reset the local register, and execute the next finite statement.
def blockStmt (src dst : K) (F : Buffer N → Buffer M) (next : TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N)) : TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer
- def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.finishAtline 747 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.blockMapAtline 752 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.statementPushBound_blockStmtline 756 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.statementPushBound_blockMapAtline 763 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.stepAux_blockStmtline 771 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.stepAux_blockMapAtline 787Source documentation
The suffix and all unmentioned tapes are preserved, and the local register is reset, in the actual transition semantics.
theorem stepAux_blockMapAt (src dst : K) (F : Buffer N → Buffer M) (exit : Option Λ) (hne : src ≠ dst) (bits : Buffer N) (suffix : List Bool) (state : σ × Buffer N) (tapes : K → List Bool) (hinput : tapes src = List.ofFn bits ++ suffix) : TM2.stepAux (blockMapAt src dst F exit) state tapes = { l := exit, var := (state.1, emptyBuffer N), …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer, OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.blockMapAt, OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.emptyBuffer
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.step_blockMapAtline 799Source documentation
Placement in an arbitrary program gives one actual TM2 transition.
theorem step_blockMapAt (src dst : K) (F : Buffer N → Buffer M) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N)) (label : Λ) (hprogram : program label = blockMapAt src dst F exit) (hne : src ≠ dst) (bits : Buffer N) (suffix : List Bool) (state : σ × Buffer N) (tapes : K → List Bool) (hinput : tapes src = List.ofFn bits ++ suffix) : TM2.step program { l := some label, var := state, stk := tapes } = …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer, OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.blockMapAt
- def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.machineline 818Source documentation
The fixed block map is also a concrete machine with two Boolean tapes and a finite register, independently of any ambient placement.
def machine {N M : Nat} (F : Buffer N → Buffer M) : FinTM2 where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.Buffer
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedBlockMap.machine_statementPushBoundline 829