OAI/Computability/MaxCut/Machines/MachineCopy.lean
81 declarations, 0 contain sorry, 0 declared as axioms
A certified machine for fixed symbol substitution
For a fixed table emit : Bool → List Bool, this actual finite TM2 machine
produces (input.flatMap emit).reverse in exactly 2 * input.length + 1
transitions. It has one input-pop transition and one literal-emission transition
per input symbol, followed by the final empty pop. Literal emission is a fixed
finite statement; its maximum number of pushes depends only on emit.
This is a machine primitive, not a runtime theorem for the Unique Games reduction.
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.Alphabetline 12 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkLoopline 15Source documentation
Drain one tape into two reverse-order accumulators.
def forkLoop (source left right : K) (fallback : β) (loopLabel : Λ) (exit : Option Λ) : TM2.Stmt (Alphabet (K := K) β) Λ (σ × Option β) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineCopy.Alphabet
- def
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTapesline 23 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTapes_sourceline 28 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTapes_leftline 34 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTapes_rightline 39 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTapes_selfline 44 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.update_fork_source_inline_MachineCopyline 48 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.update_fork_left_inline_MachineCopyline 62 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.update_fork_right_inline_MachineCopyline 73 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkStep_emptyline 79 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkStep_consline 95 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkTraceline 114Source documentation
Each symbol and the final empty test take one actual transition.
theorem forkTrace (source left right : K) (sourceLeft : source ≠ left) (sourceRight : source ≠ right) (leftRight : left ≠ right) (fallback : β) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K) β) Λ (σ × Option β)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineCopy.Alphabet
- def
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.forkInTimeline 141 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.drainedTapesline 161 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.restoredTapesline 164 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.copyTraceline 182 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCopy.copyInTimeline 224Source documentation
A timed witness whose stored step count is the exact two-loop trace length.
def copyInTime (source destination scratch : K) (sourceDestination : source ≠ destination) (sourceScratch : source ≠ scratch) (destinationScratch : destination ≠ scratch) (fallback : β) (firstLabel secondLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K) β) Λ (σ × Option β)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineCopy.Alphabet
- def
OAI.MaxCutGames.Reduction.MachineSubstitution.pushWordline 270Source documentation
Push a fixed word in its listed order, then execute the continuation.
def pushWord (dst : K) : List (Γ dst) → TM2.Stmt Γ Λ σ → TM2.Stmt Γ Λ σ | [], continuation => continuation | symbol :: word, continuation => .push dst (fun _ => symbol) (pushWord dst word continuation) /-- Literal pushes preserve the state and every other tape. -/ - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.stepAux_pushWordline 276Source documentation
Literal pushes preserve the state and every other tape.
theorem stepAux_pushWord (dst : K) (word : List (Γ dst)) (continuation : TM2.Stmt Γ Λ σ) (state : σ) (tapes : ∀ k, List (Γ k)) : TM2.stepAux (pushWord dst word continuation) state tapes = TM2.stepAux continuation state (Function.update tapes dst (word.reverse ++ tapes dst)) := by …Mentions: OAI.MaxCutGames.Reduction.MachineSubstitution.pushWord
- theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.statementPushBound_pushWordline 290 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.loopline 302 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.programline 308 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.machineline 313 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.maxEmissionline 325Source documentation
The fixed maximum word length bounds pushes in each emitted statement.
def maxEmission (emit : Bool → List Bool) : Nat := …
- theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.statementPushBound_leline 328 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.programPushBound_leline 338 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.tapeStacksline 348 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.runningline 351 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.emittingline 355 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.haltedline 359 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.update_input_inline_MachineSubstitutionline 362 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.update_output_inline_MachineSubstitutionline 367 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.step_emptyline 372 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.step_consline 379 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.step_emitline 389Source documentation
Emission does not depend on the register; the symbol is held in the control label.
theorem step_emit (emit : Bool → List Bool) (symbol : Bool) (input output : List Bool) (state : Option Bool) : (machine emit).step (emitting emit symbol input output state) = some (running emit input ((emit symbol).reverse ++ output) state) := by …Mentions: OAI.MaxCutGames.Reduction.MachineSubstitution.machine, OAI.MaxCutGames.Reduction.MachineSubstitution.emitting, OAI.MaxCutGames.Reduction.MachineSubstitution.running
- def
OAI.MaxCutGames.Reduction.MachineSubstitution.nextline 403 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.two_steps_consline 407 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.substitution_stepsline 417Source documentation
Exact execution, including an arbitrary initial accumulator and register.
theorem substitution_steps (emit : Bool → List Bool) (input output : List Bool) (state : Option Bool) : (next emit)^[2 * input.length + 1] (some (running emit input output state)) = some (halted emit ((input.flatMap emit).reverse ++ output)) := by …Mentions: OAI.MaxCutGames.Reduction.MachineSubstitution.next, OAI.MaxCutGames.Reduction.MachineSubstitution.running, OAI.MaxCutGames.Reduction.MachineSubstitution.halted
- theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.initList_eqline 432 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.haltList_eqline 439 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.substitution_init_stepsline 444 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.outputsInTimeline 450 - theorem
OAI.MaxCutGames.Reduction.MachineSubstitution.outputsInTime_stepsline 457 - def
OAI.MaxCutGames.Reduction.MachineSubstitution.computableInPolyTimeline 461Source documentation
A finite-machine polynomial-time certificate for reversed fixed substitution.
noncomputable def computableInPolyTime (emit : Bool → List Bool) : TM2ComputableInPolyTime (id : List Bool → List Bool) id (fun input => (input.flatMap emit).reverse) where … - def
OAI.MaxCutGames.Reduction.MachineReverse.loopline 484 - def
OAI.MaxCutGames.Reduction.MachineReverse.machineline 490 - def
OAI.MaxCutGames.Reduction.MachineReverse.tapeStacksline 501 - def
OAI.MaxCutGames.Reduction.MachineReverse.runningline 504 - def
OAI.MaxCutGames.Reduction.MachineReverse.haltedline 507 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.update_input_inline_MachineReverseline 510 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.update_output_inline_MachineReverseline 515 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.step_emptyline 521Source documentation
Popping an empty input resets the internal state to
nonebefore halting.theorem step_empty (output : List Bool) (state : Option Bool) : machine.step (running [] output state) = some (halted output) := by …Mentions: OAI.MaxCutGames.Reduction.MachineReverse.running, OAI.MaxCutGames.Reduction.MachineReverse.halted
- theorem
OAI.MaxCutGames.Reduction.MachineReverse.step_consline 529Source documentation
One transition moves the head symbol from the input onto the output.
theorem step_cons (head : Bool) (input output : List Bool) (state : Option Bool) : machine.step (running (head :: input) output state) = some (running input (head :: output) (some head)) := by … - def
OAI.MaxCutGames.Reduction.MachineReverse.nextline 537 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.reverse_stepsline 541Source documentation
An exact transition trace, with arbitrary initial accumulator and state.
theorem reverse_steps (input output : List Bool) (state : Option Bool) : next^[input.length + 1] (some (running input output state)) = some (halted (input.reverse ++ output)) := by …Mentions: OAI.MaxCutGames.Reduction.MachineReverse.next, OAI.MaxCutGames.Reduction.MachineReverse.running, OAI.MaxCutGames.Reduction.MachineReverse.halted
- theorem
OAI.MaxCutGames.Reduction.MachineReverse.initList_eqline 555 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.haltList_eqline 562 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.reverse_init_stepsline 567Source documentation
The exact trace starts and ends at the standard encoded TM2 configurations.
theorem reverse_init_steps (input : List Bool) : next^[input.length + 1] (some (initList machine input)) = some (haltList machine input.reverse) := by …Mentions: OAI.MaxCutGames.Reduction.MachineReverse.next, OAI.MaxCutGames.Reduction.MachineReverse.machine
- def
OAI.MaxCutGames.Reduction.MachineReverse.outputsInTimeline 573 - theorem
OAI.MaxCutGames.Reduction.MachineReverse.outputsInTime_stepsline 579 - def
OAI.MaxCutGames.Reduction.MachineReverse.computableInPolyTimeline 583Source documentation
Actual finite-machine polynomial-time computability, with identity encodings.
noncomputable def computableInPolyTime : TM2ComputableInPolyTime (id : List Bool → List Bool) id List.reverse where … - def
OAI.MaxCutGames.Foundations.Complexity.MachineControl.configurationline 609 - def
OAI.MaxCutGames.Foundations.Complexity.MachineControl.statementline 615 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineControl.stepAux_simulationline 630 - def
OAI.MaxCutGames.Foundations.Complexity.MachineControl.programline 657 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineControl.step_simulationline 662Source documentation
The renamed program is conjugate to the original transition function, including the halted configuration.
theorem step_simulation (labels : Λ ≃ Λ') (states : σ ≃ σ') (source : Λ → Stmt Γ Λ σ) (c : Cfg Γ Λ σ) : step (program labels states source) (configuration labels states c) = (step source c).map (configuration labels states) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineControl.program, OAI.MaxCutGames.Foundations.Complexity.MachineControl.configuration
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.Alphabetline 689 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapesline 692 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_firstline 698 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_secondline 700 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_thirdline 702 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_involutiveline 705 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.configurationline 710 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.statementline 716 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_update_firstline 733 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_update_secondline 745 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.tapes_update_thirdline 757 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.stepAux_simulationline 769 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.programline 817 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStackSwap.step_simulationline 820