OAI/Computability/MaxCut/Machines/EmitRows.lean
82 declarations, 0 contain sorry, 0 declared as axioms
The actual alphabet-reduction row template. The old predicate and the loop flag are finite registers. All unbounded quantities reside in five preserved unary tapes. The fixed event/slot/orientation order is retained without deduplication.
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.Contextline 18 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.RowCommandline 19 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.relationBitsline 21 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.vector_list_ofFn_inline_EmitRowsline 26 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.bitValues_ofFn_inline_EmitRowsline 31 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.relationBits_valuesline 40 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowCommandsline 49Source documentation
Two actual affine fields followed by the 4096 stored relation entries.
def rowCommands (q : Nat) (event : AlphabetGraph.LocalEvent (Fin q)) (slot : Fin 6) (orientation : Bool) : List (RowCommand q) := …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetGraph.LocalEvent, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.RowCommand
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowContextline 58 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowValuesline 62 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.encodedRow_inline_EmitRowsline 68 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowCommands_bitsline 76Source documentation
The executable command semantics equals the precise stored row, including the orientation-specific tail, reverse index, and every predicate bit.
theorem rowCommands_bits {q : Nat} (input : GenericGraphTables.Table q) (edge : Fin input.darts) (event : AlphabetGraph.LocalEvent (Fin q)) (slot : Fin 6) (orientation : Bool) : (rowCommands q event slot orientation).flatMap (commandBits (rowValues input edge) (rowContext input edge)) = encodeWords (GraphTables.rowWords (Table.rowFromDart input (((edge, event), slot), orientation))) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetGraph.LocalEvent, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowCommands, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowValues, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowContext, OAI.MaxCutGames.Foundations.PCP.GraphTables.rowWords, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Table.rowFromDart
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommandsline 109Source documentation
One old dart emits every local event, then all six slots, false orientation before true. These loops are fixed by q and form part of the finite template.
def blockCommands (q : Nat) : List (RowCommand q) := …
Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.RowCommand
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockWordsline 114 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.tableWords_eq_blocksline 121 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.headerCommandsline 134Source documentation
Headers use only the preserved n and m tapes; all relation registers may still have their initial values.
def headerCommands (q : Nat) (σ : Type) : List (Command 2 σ (Addresses.fieldBound q)) := …
Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Addresses.fieldBound
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.headerCommands_bitsline 140 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.headerCommands_lengthline 154 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.headerInTimeline 158 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.encodeWords_flatMap_inline_EmitRowsline 183 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommands_bitsline 189 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowCommands_length_leline 196 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.flatMap_length_le_inline_EmitRowsline 204 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommands_length_leline 215 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockInTimeline 229Source documentation
Actual execution of all rows belonging to one old dart. The finite relation register is supplied by the checked row parser; only code equations are assumed about the enclosing program. The trace restores the five operand tapes.
def blockInTime {K Λ : Type} [DecidableEq K] {q : Nat} (input : GenericGraphTables.Table q) (edge : Fin input.darts) (sources : Fin 5 → K) (scratch output : K) (sourceScratch : ∀ i, sources i ≠ scratch) (sourceOutput : ∀ i, sources i ≠ output) (scratchOutput : scratch ≠ output) (labels : Label (blockCommands q).length (Addresses.fieldBound q) → Λ) (exit : Option Λ) (p : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State (Context q))) …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommands, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Addresses.fieldBound, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.Context
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommandsInline 259Source documentation
Preserve additional finite parser/driver registers through a projection.
def blockCommandsIn {σ : Type} (q : Nat) (context : σ → Context q) : List (Command 5 σ (Addresses.fieldBound q)) := …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.Context, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Addresses.fieldBound
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockCommandsIn_bitsline 263 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockInTimeAmbientline 272 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabetline 316 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.finishline 319Source documentation
Reset both the ambient finite state and the drain register before exiting.
def finish (initial : σ) (exit : Option Λ) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.instructionline 325Source documentation
A concrete instruction for each of the n drain phases and the final reset.
def instruction {n : Nat} (selected : Fin n → K) (labels : Fin (n + 1) → Λ) (initial : σ) (exit : Option Λ) (phase : Fin (n + 1)) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.instruction_drainline 334 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.instruction_finishline 342 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapesline 348Source documentation
Actual tape family after the selected stacks have been drained in order.
def clearTapes : {n : Nat} → (Fin n → K) → (K → List Bool) → K → List Bool | 0, _, base => base | n + 1, selected, base => clearTapes (fun i : Fin n => selected i.succ) (Function.update base (selected 0) []) /-- Exact number of transitions, including the final state-reset transition. -/ - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.actualCostline 354Source documentation
Exact number of transitions, including the final state-reset transition.
def actualCost : {n : Nat} → (Fin n → K) → (K → List Bool) → Nat | 0, _, _ => 1 | n + 1, selected, base => actualCost (fun i : Fin n => selected i.succ) (Function.update base (selected 0) []) + ((base (selected 0)).length + 1) - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapes_applyline 360 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapes_selectedline 373 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapes_unselectedline 377 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.actualCost_leline 383 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.cleanupTraceline 401Source documentation
The trace is derived solely from the actual drain instructions and final reset instruction. No execution of the entire cleanup is assumed.
theorem cleanupTrace {n : Nat} (selected : Fin n → K) (labels : Fin (n + 1) → Λ) (initial : σ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.cleanupInTimeline 427Source documentation
Actual cleanup execution, bounded using the original selected-stack lengths.
def cleanupInTime {n : Nat} (selected : Fin n → K) (labels : Fin (n + 1) → Λ) (initial : σ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.programline 444Source documentation
Concrete n+1-label program, terminating after resetting the finite state.
def program {n : Nat} (selected : Fin n → K) (initial : σ) : Fin (n + 1) → TM2.Stmt (Alphabet (K := K)) (Fin (n + 1)) (σ × Option Bool) := …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.machineline 449Source documentation
A bundled finite machine. Its input/output tapes are designated explicitly.
def machine [Fintype K] [Fintype σ] {n : Nat} (selected : Fin n → K) (input output : K) (initial : σ) : FinTM2 where … - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.machineInTimeline 461 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapes_outputOnlyline 474Source documentation
Enumerating exactly the nonoutput stacks yields the standard final tape family. Repeated selected stacks are permitted.
theorem clearTapes_outputOnly {n : Nat} (selected : Fin n → K) (output : K) (base : K → List Bool) (excludesOutput : ∀ i, selected i ≠ output) (coversOther : ∀ k, k ≠ output → ∃ i, selected i = k) : clearTapes selected base = fun k => if k = output then base output else [] := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.clearTapes
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.machineHaltInTimeline 488Source documentation
Full cleanup reaches
haltList, with all nonoutput stacks empty and the machine's actual initial finite state restored.def machineHaltInTime [Fintype K] [Fintype σ] {n : Nat} (selected : Fin n → K) (input output : K) (initial : σ) (base : K → List Bool) (ambient : σ) (register : Option Bool) (excludesOutput : ∀ i, selected i ≠ output) (coversOther : ∀ k, k ≠ output → ∃ i, selected i = k) : StateTransition.EvalsToInTime (machine selected input output initial).step ⟨some (0 : Fin (n + 1)), (ambient, register), base⟩ (some (haltList (machine selected input output initial) (base output))) ((∑ i, (base (selected i)).length) + n + 1) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Cleanup.machine
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.headerPlanline 514 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.rowPlanline 515 - inductive
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.Labelline 517 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.headerEntryline 529 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.rowEntryline 532 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.clearNextline 535 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.programline 538 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machineline 574Source documentation
Every state component is finite; the q-dependent relation register is enumerated by the explicit vector/function equivalence of the parser.
def machine (q : Nat) : FinTM2 := by …
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program_setupline 587 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program_guardline 591 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program_headLookupline 594 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program_compareline 598 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program_incrementline 601 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.inputBitsline 621 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixWordsline 625Source documentation
The output headers are included even before the first old row is read.
def prefixWords (input : GenericGraphTables.Table q) (e : Nat) : List Nat := …
Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBitsline 630 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorWordsline 633 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorBitsline 636 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixWords_zeroline 639 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBits_zeroline 645 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixWords_succline 651 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBits_succline 664 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBits_reverse_succline 671 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixWords_fullline 678 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBits_fullline 688Source documentation
At the terminal guard the stored prefix is the complete concrete output encoding.
theorem prefixBits_full (input : GenericGraphTables.Table q) : prefixBits input input.darts = GraphTables.tableBits (Table.build input) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.prefixBits, OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Table.build
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorBits_zeroline 693 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorWords_succline 698 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorBits_succline 709 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.cursorBits_fullline 717 - structure
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Readyline 726Source documentation
Guard-to-guard tape contract. Only scan and indexScan may contain residues.
structure Ready (input : GenericGraphTables.Table q) (e : Nat) (base : Tape → List Bool) : Prop where …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.of_agreeline 745Source documentation
Changing only lookup residues preserves the complete loop contract.
theorem Ready.of_agree {input : GenericGraphTables.Table q} {e : Nat} {base next : Tape → List Bool} (ready : Ready input e base) (agree : ∀ tape, tape ≠ .scan → tape ≠ .indexScan → next tape = base tape) : Ready input e next where …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.update_scanline 765 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.update_indexScanline 772 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.counter_succline 779 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.counter_at_endline 786 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.cursor_at_endline 791 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready.reversed_at_endline 795