OAI/Computability/UniqueGames/Machines/PoweringMachineFinish.lean
20 declarations, 0 contain sorry, 0 declared as axioms
Physical output headers followed by complete work-tape cleanup
The finite program first copies the dart-count word onto the existing row output, then copies the vertex-count word, and finally drains every tape except the output. Both unary header values are read from physical tapes; they do not parameterize the program. Header sources and their unread suffixes are restored by the two copies before cleanup. The final configuration contains the full encoded header and rows on the output tape and empty words on every other tape.
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Alphabetline 25 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Labelline 27 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.copyInstructionline 31 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.instructionline 39Source documentation
The labels contain two fixed affine copies and one fixed list of drains.
def instruction (enumeration : Fin N ≃ K) (headerV headerD output scratch : K) (labels : Label enumeration output → Λ) : Label enumeration output → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.programline 52Source documentation
Actual finite control, independent of both runtime header values.
def program (enumeration : Fin N ≃ K) (headerV headerD output scratch : K) : Label enumeration output → TM2.Stmt (Alphabet (K := K)) (Label enumeration output) (σ × Option Bool) := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.afterDline 57 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.afterHeadersline 60 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.afterHeaders_outputline 63 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.afterHeaders_otherline 67 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.copyStepsline 71 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.copySteps_eqline 73 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.stepsline 78Source documentation
Exact cleanup cost is computed on the actual post-copy tape contents.
def steps (enumeration : Fin N ≃ K) (output : K) (base : K → List Bool) (n m : Nat) : Nat := …
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.budgetline 82 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.trace_transline 86 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.traceAtline 92Source documentation
Exact execution inside any ambient program containing these instructions. The only data premises describe physical header words and an empty scratch tape.
theorem traceAt (enumeration : Fin N ≃ K) (headerV headerD output scratch : K) (hvs : headerV ≠ scratch) (hvo : headerV ≠ output) (hds : headerD ≠ scratch) (hdo : headerD ≠ output) (hso : scratch ≠ output) (labels : Label enumeration output → Λ) (target : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.Alphabet
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.traceline 142Source documentation
The standalone program satisfies the trace with no code or execution premise.
theorem trace (enumeration : Fin N ≃ K) (headerV headerD output scratch : K) (hvs : headerV ≠ scratch) (hvo : headerV ≠ output) (hds : headerD ≠ scratch) (hdo : headerD ≠ output) (hso : scratch ≠ output) (base : K → List Bool) (n m : Nat) (suffixV suffixD : List Bool) (wordV : base headerV = encodeWord n ++ suffixV) (wordD : base headerD = encodeWord m ++ suffixD) (scratchEmpty : base scratch = []) (ambient : σ) (register : Option Bool) : (advance (TM2.step (program enumeration headerV headerD output scratch)))^[ steps enumeration output base n m] (some ⟨some (.inl .seed), (ambient, register), base⟩) = some ⟨none, (ambient, none), MachineDrainMany.haltTapes output (encodeWords [n, m] ++ base output)⟩ := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.program, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.steps, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineDrainMany.haltTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.steps_le_budgetline 158 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.afterHeaders_length_leline 164 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.steps_le_uniformline 178Source documentation
A uniform pre-cleanup stack bound gives a linear finishing budget.
theorem steps_le_uniform (enumeration : Fin N ≃ K) (output : K) (base : K → List Bool) (n m bound : Nat) (bounded : ∀ k, (base k).length ≤ bound) : steps enumeration output base n m ≤ 2 * (n + m) + 6 + N * (bound + n + m + 3) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.steps
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.executionline 193Source documentation
A bounded execution witness, obtained from the physical trace above.
def execution (enumeration : Fin N ≃ K) (headerV headerD output scratch : K) (hvs : headerV ≠ scratch) (hvo : headerV ≠ output) (hds : headerD ≠ scratch) (hdo : headerD ≠ output) (hso : scratch ≠ output) (base : K → List Bool) (n m : Nat) (suffixV suffixD : List Bool) (wordV : base headerV = encodeWord n ++ suffixV) (wordD : base headerD = encodeWord m ++ suffixD) (scratchEmpty : base scratch = []) (ambient : σ) (register : Option Bool) : StateTransition.EvalsToInTime (TM2.step (program enumeration headerV headerD output scratch)) ⟨some (.inl .seed), (ambient, register), base⟩ (some ⟨none, (ambient, none), MachineDrainMany.haltTapes output (encodeWords [n, m] ++ base output)⟩) (budget enumeration output base n m) where …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.program, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineDrainMany.haltTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineFinish.budget