OAI/Computability/UniqueGames/Machines/MachineUnaryMultiply.lean
30 declarations, 0 contain sorry, 0 declared as axioms
An actual five-stack unary multiplication subroutine. Both isolated input fields are preserved. The product field prefixes the previous output stack; the counter and scratch return empty and all other stacks are framed.
- inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Labelline 19 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label.enumListline 23 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label.enumList_getElem?_ctorIdx_eqline 26 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label.enumList_nodupline 30 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.(instance at line 32)line 32 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Alphabetline 38 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Stateline 39 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.transitionline 41 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.payloadline 42 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.emitterLabelline 44 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.statementline 51Source documentation
Slots 0 and 1 contain the operands, 2 the output, 3 the counter, and 4 the reusable empty scratch. The code is independent of operand values.
def statement (slots : Fin 5 ↪ K) (labels : Label → Λ) (exit : Option Λ) : Label → TM2.Stmt (Alphabet (K := K)) Λ (State σ) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.programline 68 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.machineline 71 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.resultTapesline 82 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.resultTapes_outputline 85 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.resultTapes_otherline 89 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.bodyStepsline 93 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.stepsline 94 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.output_encodeWordline 96 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.prepend_payloadline 106 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.loopBaseline 111Source documentation
The accumulator is indexed by the remaining number of outer iterations.
def loopBase (slots : Fin 5 ↪ K) (base : K → List Bool) (a b r : ℕ) : K → List Bool := …
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.bodyTraceline 114 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.totalSteps_eqline 172 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.multiplyTraceline 178Source documentation
Exact execution in any ambient program containing the nine declared statements. The body traces are derived from the actual copy transducer.
theorem multiplyTrace (slots : Fin 5 ↪ K) (labels : Label → Λ) (exit : Option Λ) (p : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.multiplyInTimeline 254Source documentation
A time witness with the exact transition count, including restoration of the operand delimiter and removal of the counter delimiter.
def multiplyInTime (slots : Fin 5 ↪ K) (labels : Label → Λ) (exit : Option Λ) (p : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.timePolynomialline 270 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.steps_le_timePolynomialline 273 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.multiplyFrameline 285Source documentation
Both input stacks, both restored work stacks, and every unrelated stack are preserved because only the output stack differs at the actual endpoint.
theorem multiplyFrame (slots : Fin 5 ↪ K) (base : K → List Bool) (a b : ℕ) (k : K) (hk : k ≠ slots 2) : resultTapes slots base (a * b) k = base k := resultTapes_other slots base _ k hkMentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.resultTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.resultTapes_other
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.programTraceline 291Source documentation
The fixed finite program realizes the trace without any caller-code or abstract-computability hypothesis.
theorem programTrace (slots : Fin 5 ↪ K) (base : K → List Bool) (a b : ℕ) (operandA : base (slots 0) = encodeWord a) (operandB : base (slots 1) = encodeWord b) (counterEmpty : base (slots 3) = []) (scratchEmpty : base (slots 4) = []) (ambient : σ) (register : Option Bool) : (MachineComposition.advance (TM2.step (program (σ := σ) slots)))^[steps a b] …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineComposition.advance, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.program, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.steps
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.programInPolynomialTimeline 304Source documentation
The fixed program's genuine execution fits a quadratic polynomial in the combined lengths of its two encoded operand fields.
def programInPolynomialTime (slots : Fin 5 ↪ K) (base : K → List Bool) (a b : ℕ) (operandA : base (slots 0) = encodeWord a) (operandB : base (slots 1) = encodeWord b) (counterEmpty : base (slots 3) = []) (scratchEmpty : base (slots 4) = []) (ambient : σ) (register : Option Bool) : StateTransition.EvalsToInTime (TM2.step (program (σ := σ) slots)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryMultiply.program