OAI/Computability/MaxCut/Machines/MachineUnaryMultiply.lean
72 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Labelline 18 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label.enumListline 22 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label.enumList_getElem?_ctorIdx_eqline 25 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label.enumList_nodupline 29 - instance
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.(instance at line 31)line 31 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Alphabetline 35 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Stateline 36 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.transitionline 38 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.payloadline 39 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.emitterLabelline 41 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.statementline 48Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.programline 65 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.machineline 68 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.resultTapesline 79 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.resultTapes_outputline 82 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.resultTapes_otherline 86 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.bodyStepsline 90 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.stepsline 91 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.output_encodeWord_inline_MachineUnaryMultiplyline 93 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.prepend_payload_inline_MachineUnaryMultiplyline 103 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.loopBaseline 108Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.bodyTrace_inline_MachineUnaryMultiplyline 111 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.totalSteps_eq_inline_MachineUnaryMultiplyline 169 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.multiplyTraceline 175Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.multiplyInTimeline 251Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Label, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.timePolynomialline 267 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.steps_le_timePolynomialline 270 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.multiplyFrameline 282Source 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.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.resultTapes, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.resultTapes_other
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.programTraceline 288Source 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.MaxCutGames.Foundations.Complexity.encodeWord, OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.program, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.steps
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.programInPolynomialTimeline 301Source 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.MaxCutGames.Foundations.Complexity.encodeWord, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryMultiply.program
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.Alphabetline 328 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.finishline 330 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.loopline 335Source documentation
A fixed finite statement; arithmetic is performed by the physical unary tapes.
def loop (source destination : K) (loopLabel : Λ) (exit : Option Λ) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.loopPushBoundline 345 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.unaryTapesline 350Source documentation
A caller's tape frame with the two unary prefixes and their unread suffixes.
def unaryTapes (source destination : K) (base : K → List Bool) (a b : Nat) (sourceSuffix destinationSuffix : List Bool) : K → List Bool := … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.unaryTapes_sourceline 355 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.unaryTapes_destinationline 361 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.unaryTapes_otherline 367 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.update_source_inline_MachineUnaryAddAtline 374 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.update_destination_inline_MachineUnaryAddAtline 387 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.stepAux_trueline 397 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.stepAux_falseline 407Source documentation
The zero branch restores the delimiter, clears the register, and exits.
theorem stepAux_false (source destination : K) (distinct : source ≠ destination) (loopLabel : Λ) (exit : Option Λ) (base : K → List Bool) (input output : List Bool) (ambient : σ) (register : Option Bool) : TM2.stepAux (loop source destination loopLabel exit) (ambient, register) (tapesAt source destination base (false :: input) output) = ⟨exit, (ambient, none), tapesAt source destination base (false :: input) output⟩ := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.loop
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.stepAux_succline 415 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.stepAux_zeroline 426 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.step_succline 438 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.step_zeroline 452 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.addTraceline 467Source documentation
Exactly
apositive-bit transitions followed by the delimiter transition.theorem addTrace (source destination : K) (distinct : source ≠ destination) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.addFromTapesline 492Source documentation
The same actual execution from a caller's supplied tape configuration.
theorem addFromTapes (source destination : K) (distinct : source ≠ destination) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.Alphabet
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.addInTimeline 513Source documentation
A composable time witness whose stored transition count is exactly
a + 1.def addInTime (source destination : K) (distinct : source ≠ destination) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAddAt.addInTime_stepsline 531 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.Labelline 555 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.Alphabetline 560 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.Stateline 561 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlotsline 567Source documentation
Multiplication uses radix, accumulator, output, counter, and scratch, skipping the independently preserved digit stack.
def multiplySlots (slots : Fin 6 ↪ K) : Fin 5 ↪ K := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlots_zeroline 570 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlots_oneline 571 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlots_twoline 572 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlots_threeline 573 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.multiplySlots_fourline 574 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.statementline 578 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.programline 590 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.machineline 593 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.resultTapesline 604 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.resultTapes_outputline 607 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.resultTapes_otherline 611 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.stepsline 615 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.radixStepTraceline 619Source documentation
A concrete Horner execution. Caller hypotheses identify the finite code, not an assumed execution or arithmetic oracle.
theorem radixStepTrace (slots : Fin 6 ↪ K) (labels : Label → Λ) (exit : Option Λ) (p : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.Label, OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.radixStepInTimeline 703 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.timePolynomialline 721 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.steps_le_timePolynomialline 724 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.programTraceline 735 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRadixStep.programInPolynomialTimeline 747