OAI/Computability/MaxCut/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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderTapeline 20 - abbrev
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumListline 24 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumList_getElem?_ctorIdx_eqline 27 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderTape.enumList_nodupline 31 - instance
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.(instance at line 33)line 33 - inductive
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderLabelline 37 - abbrev
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumListline 41 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumList_getElem?_ctorIdx_eqline 43 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderLabel.enumList_nodupline 47 - instance
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.(instance at line 49)line 49 - abbrev
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderAlphabetline 53 - abbrev
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderStateline 54 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.pushTrueline 57Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.stepAux_pushTrueline 62 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.pushTrue_pushBoundline 74 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerProgramline 84Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderLabel, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderAlphabet, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.HeaderState
- def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerMachineline 100 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.initialTapesline 111 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanTapesline 115 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.finalTapesline 121 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanConfigurationline 127 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.finalConfigurationline 132 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.initializeStepline 136 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanStep_zeroline 146 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanStep_succline 157 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanTraceline 175Source 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.MaxCutGames.Foundations.Complexity.MachineComposition.advance, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerProgram, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.scanConfiguration, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.finalConfiguration
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerTraceline 192 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerInTimeline 205Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.headerProgram, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.initialTapes, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.finalConfiguration
- def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.remainingRowsline 216Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.remainingRows_topline 219 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.remainingRows_stepline 222 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.rowBaseline 229 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.VertexBodyTracesline 236Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.vertexBodyTraces_to_countedline 249 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.vertexLoopInTimeline 265Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guard, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.VertexBodyTraces, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.vertexLoop_outputline 289Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.rowBase, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.remainingRows
- def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.varyingRowBaseline 297Source 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.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.VaryingVertexBodyTracesline 301 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.varyingVertexBodyTraces_to_countedline 314 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.vertexLoopInTime_varyingline 329Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guard, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.VaryingVertexBodyTraces, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineLoop.vertexLoop_varying_outputline 352