OAI/Computability/UniqueGames/Machines/MachineLazyRows.lean
56 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.Labelline 16 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.Stateline 17 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.addressIndexline 21Source documentation
Tape roles: tail, old reverse, relation, scratch, divided copy, quotient, new reverse, accumulated output, row buffer.
def addressIndex : Fin 5 → Fin 9 := ![1, 3, 4, 5, 6]
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.addressIndex_injectiveline 23 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.fieldsline 27 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexInstructionline 31Source documentation
The program depends on the fixed degree and tape placement, never on input-dependent vertices, reverse indices, or predicate values.
def reindexInstruction (d : Nat) (positive : 0 < d) (c b : Nat) (tape : Fin 9 → K) (labels : Label d → Λ) (exit : Option Λ) : Label d → TM2.Stmt (fun _ : K => Bool) Λ (State A d) | .inl stage => MachinePortReindex.instruction d positive c b (tape ∘ addressIndex) (fun stage => labels (.inl stage)) (some (labels (.inr .relationRead))) stage | .inr stage => MachineTableRows.routine (fields tape) (tape 8) (tape 7) (tape 3) (fun stage => labels (.inr stage)) exit stageMentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachinePortReindex.instruction, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.addressIndex, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTableRows.routine, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.fields
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.instructionline 40 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexRowBitsline 45 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexMappedTapesline 49 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexResultTapesline 53 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexStepsline 58 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowBitsline 62 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.mappedTapesline 65 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.resultTapesline 68 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.stepsline 73 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexRowTraceline 76 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowTraceline 140Source documentation
Lazy specialization of the shared physical mapper/emitter execution.
theorem rowTrace (d : Nat) (positive : 0 < d) (tape : Fin 9 → K) (distinct : Function.Injective tape) (labels : Label d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (State A d)) (atLabels : ∀ l, program (labels l) = instruction d positive tape labels exit l) (base : K → List Bool) (v j : Nat) (relation : RelationTable) (tailWord : base (tape 0) = encodeWord v) (reverseWord : base (tape 1) = encodeWord j) (relationWord : base (tape 2) = encodeWords (relationWords relation)) (scratchEmpty : base (tape 3) = []) (workEmpty : base (tape 4) = []) (quotientEmpty : base (tape 5) = []) (newReverseEmpty : base (tape 6) = []) (rowEmpty : base (tape 8) = []) (ambient : A) : (advance (TM2.step program))^[steps d v j relation (base (tape 7))] …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.instruction, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.steps
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowBits_eq_moveRowline 162Source documentation
The body emits exactly the moving row of the actual lazy table.
theorem rowBits_eq_moveRow {n d : Nat} (table : PCP.PortTables.Table n d) (v : Fin n) (p : Fin d) : rowBits d v.val (PCP.PreprocessingLazyWords.row table v p).reverseIndex.val (PCP.PreprocessingLazyWords.row table v p).relation = encodeWords (rowWords (moveRow table v p)) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.PCP.PortTables.Table, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowBits, OAI.UniqueGamesTheorem.Foundations.PCP.PreprocessingLazyWords.row, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.machineline 172Source documentation
A concrete machine for this stored-field phase, with nine Boolean tapes and a finite residue register. It does not assume a whole-row runtime.
def machine (d : Nat) (positive : 0 < d) : FinTM2 where …
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.Bufferline 183 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.StreamStateline 184 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamCleanline 186 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.relationStateEquivline 190Source documentation
Only finite register coordinates change; all tapes remain fixed.
def relationStateEquiv (A : Type) (d : Nat) : MachineRegularOriginalRow.State (A × Fin d) ≃ StreamState A d where …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOriginalRow.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.StreamState
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRelationCopyline 197 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRelationCopy_stepline 202 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.bodyIndexline 227 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.bodyIndex_injectiveline 229 - inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.StreamLabelline 234 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamInstructionline 240 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.inputRowBitsline 258 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRowStepsline 261 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamResultTapesline 266 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.joinTraceline 271 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRowTraceline 275 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.VertexLabelline 463 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexInstructionline 465 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.recordsInputline 475 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.recordsOutputline 478 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamFrameline 481 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexStepsline 486 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.recordsInput_eq_codecline 492 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamFrame_afterRowline 501 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexSuffixTraceline 520Source documentation
Every port executes its actual loader, mapper, emitter, and cleanup. The trace is proved from the concrete program, with no per-row run premise.
theorem vertexSuffixTrace {n m : Nat} (d : Nat) (positive : 0 < d) (c b : Nat) (tape : Fin 10 → K) (distinct : Function.Injective tape) (labels : VertexLabel d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (StreamState A d)) (atLabels : ∀ l, program (labels l) = vertexInstruction d positive c b tape labels exit l) (base : K → List Bool) (rows : Fin d → DartRow n m) (empty : ∀ i : Fin 10, i ≠ 7 → i ≠ 9 → base (tape i) = []) (ambient : A) (remaining : Nat) (i : Fin (d + 1)) (count : i.val + remaining = d) (output : List Bool) : (advance (TM2.step program))^[vertexSteps d c b ((List.ofFn rows).drop i.val) output] (some ⟨some (labels (i, none)), streamClean d positive ambient, streamFrame tape base ((List.ofFn rows).drop i.val) output⟩) = some ⟨exit, streamClean d positive ambient, …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.VertexLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.StreamState, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexInstruction, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexSteps, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamClean, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamFrame
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexTraceline 604 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.encodeWords_flatMapline 620 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.recordsOutput_lazyline 627Source documentation
The computed moving-row block is exactly the actual lazy table's codec.
theorem recordsOutput_lazy {n d : Nat} (table : PCP.PortTables.Table n d) (v : Fin n) : recordsOutput d (2 * d) d (List.ofFn (PCP.PreprocessingLazyWords.row table v)) = encodeWords ((List.ofFn (moveRow table v)).flatMap rowWords) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.PCP.PortTables.Table, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.recordsOutput, OAI.UniqueGamesTheorem.Foundations.PCP.PreprocessingLazyWords.row, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.valueBoundline 642 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowSizeBoundline 643 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowCostBoundline 644 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexValue_leline 647 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.reindexRowBits_length_leline 656 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRowSteps_leline 667Source documentation
The bound comes from all loader, mapper, emitter, and cleanup transitions.
theorem streamRowSteps_le {n m : Nat} (d c b : Nat) (r : DartRow n m) (output : List Bool) : streamRowSteps d c b r.tail.val r.reverseIndex.val r.relation output ≤ rowCostBound c b n m + 2 * output.length := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamRowSteps, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.rowCostBound
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexSteps_le_capacityline 679 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexSteps_leline 704 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexInTimeline 712Source documentation
Timed execution for the concrete fixed-degree old-row loop. The natural bound is polynomial in vertex count, dart count, and accumulated output size.
def vertexInTime {n m : Nat} (d : Nat) (positive : 0 < d) (c b : Nat) (tape : Fin 10 → K) (distinct : Function.Injective tape) (labels : VertexLabel d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (StreamState A d)) (atLabels : ∀ l, program (labels l) = vertexInstruction d positive c b tape labels exit l) (base : K → List Bool) (rows : Fin d → DartRow n m) (empty : ∀ i : Fin 10, i ≠ 7 → i ≠ 9 → base (tape i) = []) (ambient : A) (output : List Bool) : StateTransition.EvalsToInTime (TM2.step program) ⟨some (labels (0, none)), streamClean d positive ambient, streamFrame tape base (List.ofFn rows) output⟩ (some ⟨exit, streamClean d positive ambient, …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.VertexLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.StreamState, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexInstruction, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamClean, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.streamFrame
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineLazyRows.vertexMachineline 733