OAI/Computability/UniqueGames/Machines/PoweringMachineLoop.lean
41 declarations, 0 contain sorry, 0 declared as axioms
Actual finite-control preparation and enumeration for the powered-table
machine. The degree and radius determine a fixed multiplier B = 2*d^t.
Only the input vertex count varies at runtime, and it is stored on unary
tapes. The header machine consumes a cloned first input field, preserving
its unread suffix, and writes the three fields needed by the outer loop.
The row enumeration lemmas specify the canonical suffix invariant used with
MachineCountedLoop. They do not stand in for the caller's per-row machine
traces, which must be supplied by the actual walk and relation evaluator.
- inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderTapeline 20 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumListline 24 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumList_getElem?_ctorIdx_eqline 26 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumList_nodupline 30 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.(instance at line 32)line 32 - inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderLabelline 36 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumListline 40 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumList_getElem?_ctorIdx_eqline 42 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumList_nodupline 46 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.(instance at line 48)line 48 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderAlphabetline 52 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderStateline 53 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.pushTrueline 56Source documentation
A syntactic chain of a fixed number of true-bit pushes.
def pushTrue {K Λ σ : Type} (destination : K) : Nat → TM2.Stmt (fun _ : K => Bool) Λ σ → TM2.Stmt (fun _ : K => Bool) Λ σ | 0, next => next | count + 1, next => pushTrue destination count (.push destination (fun _ => true) next) - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.stepAux_pushTrueline 61 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.pushTrue_pushBoundline 73 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerProgramline 83Source documentation
Each true bit from the first input field contributes one counter bit, one vertex-header bit, and
Bdart-header bits. No numeric register is used.def headerProgram {σ : Type} (B : Nat) : HeaderLabel → TM2.Stmt HeaderAlphabet HeaderLabel (HeaderState σ) | .initialize => .push .counter (fun _ => false) (.push .vertices (fun _ => false) (.push .darts (fun _ => false) (.load (fun state => (state.1, none)) (.goto fun _ => .scan)))) | .scan => .pop .source (fun state head => (state.1, head)) (.branch (fun state => state.2.getD false) (.push .counter (fun _ => true) (.push .vertices (fun _ => true) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderAlphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.HeaderState
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerMachineline 99 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.initialTapesline 110 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanTapesline 114 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.finalTapesline 120 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanConfigurationline 126 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.finalConfigurationline 131 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.initializeStepline 135 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanStep_zeroline 145 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanStep_succline 156 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanTraceline 174Source documentation
The loop consumes precisely the unary field, including its delimiter.
theorem scanTrace {σ : Type} (B remaining processed : Nat) (suffix : List Bool) (ambient : σ) (register : Option Bool) : (MachineComposition.advance (TM2.step (headerProgram B)))^[remaining + 1] (some (scanConfiguration B remaining processed suffix ambient register)) = some (finalConfiguration B (processed + remaining) suffix ambient) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineComposition.advance, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerProgram, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.scanConfiguration, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.finalConfiguration
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerTraceline 191 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerInTimeline 204Source documentation
A genuine finite TM2 execution certificate for the header phase.
def headerInTime {σ : Type} (B n : Nat) (suffix : List Bool) (ambient : σ) (register : Option Bool) : StateTransition.EvalsToInTime (TM2.step (headerProgram B)) ⟨some .initialize, (ambient, register), initialTapes n suffix⟩ (some (finalConfiguration B n suffix ambient)) (n + 2) where …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.headerProgram, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.initialTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.finalConfiguration
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.remainingRowsline 215Source documentation
Completed rows at guard remainder
rare precisely verticesr,...,n-1. This is a semantic description of the output tape, not a machine instruction.def remainingRows (rowBlock : Nat → List Bool) (n r : Nat) : List Bool := …
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.remainingRows_topline 218 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.remainingRows_stepline 221 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.rowBaseline 228 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.VertexBodyTracesline 235Source documentation
A per-vertex body certificate must actually execute in the combined program, preserve the remaining unary vertex counter and caller frame, and prepend precisely that vertex's ordered block of rows.
def VertexBodyTraces (counter output : K) (guardLabel bodyLabel : Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (σ × Option Bool)) (base : K → List Bool) (suffix : List Bool) (ambient : σ) (rowBlock : Nat → List Bool) (cost : Nat → Nat) (n : Nat) : Prop := … - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.vertexBodyTraces_to_countedline 248 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.vertexLoopInTimeline 264Source documentation
Derives the complete outer enumeration trace from the actual row-body traces. Descending cursor order and prepending produce canonical ascending vertex order on the output tape. The zero delimiter is retained for cleanup.
def vertexLoopInTime (counter output : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (σ × Option Bool)) (atGuard : program guardLabel = MachineUnaryCounter.guard counter bodyLabel exitLabel) (base : K → List Bool) (suffix : List Bool) (ambient : σ) (rowBlock : Nat → List Bool) (cost : Nat → Nat) (n bodyBound : Nat) (bodies : VertexBodyTraces counter output guardLabel bodyLabel program base suffix ambient rowBlock cost n) (bounded : ∀ r, r < n → cost r ≤ bodyBound) : StateTransition.EvalsToInTime (TM2.step program) ⟨some guardLabel, (ambient, none), MachineUnaryCounter.counterTapes counter base n suffix⟩ (some ⟨some exitLabel, (ambient, none), …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryCounter.guard, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.VertexBodyTraces, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.vertexLoop_outputline 288Source documentation
The output field is exactly the completed canonical row stream.
theorem vertexLoop_output (counter output : K) (different : output ≠ counter) (base : K → List Bool) (suffix : List Bool) (rowBlock : Nat → List Bool) (n : Nat) : MachineUnaryCounter.counterTapes counter (rowBase output base rowBlock n 0) 0 suffix output = remainingRows rowBlock n 0 ++ base output := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryCounter.counterTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.rowBase, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.remainingRows
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.varyingRowBaseline 296Source documentation
Lookup scan suffixes and other work tapes may evolve between vertices. Only the output field is replaced by the prescribed canonical row suffix.
def varyingRowBase (output : K) (base : Nat → K → List Bool) (rowBlock : Nat → List Bool) (n r : Nat) : K → List Bool := … - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.VaryingVertexBodyTracesline 300 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.varyingVertexBodyTraces_to_countedline 313 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.vertexLoopInTime_varyingline 328Source documentation
The outer loop with a varying work-tape frame. Actual row-body traces determine that frame; no cleanup of accumulated lookup suffixes is assumed.
def vertexLoopInTime_varying (counter output : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (σ × Option Bool)) (atGuard : program guardLabel = MachineUnaryCounter.guard counter bodyLabel exitLabel) (base : Nat → K → List Bool) (suffix : List Bool) (ambient : Nat → σ) (rowBlock : Nat → List Bool) (cost : Nat → Nat) (n bodyBound : Nat) (bodies : VaryingVertexBodyTraces counter output guardLabel bodyLabel program base suffix ambient rowBlock cost n) (bounded : ∀ r, r < n → cost r ≤ bodyBound) : StateTransition.EvalsToInTime (TM2.step program) ⟨some guardLabel, (ambient n, none), MachineUnaryCounter.counterTapes counter (base n) n suffix⟩ (some ⟨some exitLabel, (ambient 0, none), …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryCounter.guard, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.VaryingVertexBodyTraces, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineLoop.vertexLoop_varying_outputline 351