OAI/Computability/MaxCut/Machines/MachineFixedDivMod.lean
65 declarations, 0 contain sorry, 0 declared as axioms
The two actual division phases of the expander-row program. Static state
conjugation connects the fixed-divisor machine to the common emitter state.
Only the concrete statement placement equations are premises; no phase trace
or whole-row execution is assumed. Each phase has exactly n + 2 transitions.
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabetline 15 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Stateline 16 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.residueline 18 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.nextResidueline 21 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.nextResidue_residueline 24 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanLoopline 30 - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterline 44Source documentation
Each emitter is a fixed finite statement indexed by one of the
dresidues.def emitter (d : Nat) (positive : 0 < d) (remainder : K) (exit : Option Λ) (r : Fin d) : TM2.Stmt (Alphabet (K := K)) Λ (State σ d) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanPushBoundline 51 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterPushBoundline 57 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.tapesline 65Source documentation
Three designated tapes, with the complete surrounding tape family retained.
abbrev tapes (source quotient remainder : K) (base : K → List Bool) (input quotientWord remainderWord : List Bool) : K → List Bool := … - def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.unaryTapesline 69 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.unaryTapes_sourceline 74 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.unaryTapes_quotientline 82 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.unaryTapes_remainderline 89 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.unaryTapes_otherline 96 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.update_source_inline_MachineFixedDivModline 104 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.update_quotient_inline_MachineFixedDivModline 122 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.update_remainder_inline_MachineFixedDivModline 136 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanAux_trueline 142 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanAux_falseline 158 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanStep_succline 173Source documentation
A scan transition updates the actual quotient and finite residue of the already-processed count. The count itself is a proof index, not machine state.
theorem scanStep_succ (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanStep_zeroline 200 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterStepline 223 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.trace_fromCountline 249Source documentation
The general invariant starts at the finite residue and unary quotient of
k, then scansnadditional input bits. It is an actual execution theorem.theorem trace_fromCount (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.divModTraceline 287Source documentation
Exact unary quotient and remainder, with both output counters initially zero.
theorem divModTrace (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.divModFromTapesline 309Source documentation
Caller-frame form: the only initial tape hypotheses are the three unary prefixes.
theorem divModFromTapes (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.divModInTimeline 336 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanTrace_fromCountline 361Source documentation
Stop just before emission, retaining the final finite residue as actual control.
theorem scanTrace_fromCount (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterWithFinishline 395Source documentation
A fixed table on finite ambient control may retain the residue before local reset.
def emitterWithFinish [Fintype σ] (d : Nat) (positive : 0 < d) (remainder : K) (exit : Option Λ) (finish : σ → Fin d → σ) (r : Fin d) : TM2.Stmt (Alphabet (K := K)) Λ (State σ d) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterWithFinishPushBoundline 403 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterWithFinishStepline 411 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.divModTraceWithFinishline 438Source documentation
The callback is a fixed finite-control table, applied in the existing emitter transition.
theorem divModTraceWithFinish [Fintype σ] (d : Nat) (positive : 0 < d) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (scanLabel : Λ) (emitterLabel : Fin d → Λ) (exit : Option Λ) (finish : σ → Fin d → σ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State σ d)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.divModFromTapesWithFinishline 466 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tapeline 503 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape.enumListline 510 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape.enumList_getElem?_ctorIdx_eqline 514 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape.enumList_nodupline 518 - instance
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.(instance at line 520)line 520 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Labelline 524 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Ambientline 542 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Stateline 543 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionStatesline 548Source documentation
The residue and the emitter's unit field are just permuted; no tape is read or written by this static change of finite state coordinates.
def divisionStates (ρ : Type) (d : Nat) : MachineFixedDivMod.State (Ambient ρ d × Unit) (degree d) ≃ State ρ d where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Ambient, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.firstFinishline 555 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.secondFinishline 559 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.affinePlanline 563 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.firstPlanline 568 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.secondPlanline 572 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.outputPlanline 576 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.lookupTapeline 580 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.dirtyTapeline 587 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.statementline 599Source documentation
Every branch is a concrete finite TM2 statement. The fixed table
His evaluated only on finite control values, never on an unbounded tape value.def statement {d : Nat} (positive : 0 < d) (H : Table (cloudSize d) d) (ports : Tape → K) (labels : Label d → Λ) (exit : Option Λ) : Label d → TM2.Stmt (fun _ : K => Bool) Λ (State ρ d) | .initialize => .push (ports .quotientFirst) (fun _ => false) (.push (ports .quotientSecond) (fun _ => false) (.push (ports .remainderFirst) (fun _ => false) (.push (ports .remainderSecond) (fun _ => false) (.load (fun s => (s.1, none)) (.goto fun _ => labels (.firstEmit (PCP.AlphabetTable.Emitter.labelAt 3 _ 0 .entry))))))) | .firstEmit l => PCP.AlphabetTable.Emitter.statement (firstPlan ρ d) (fun _ => ports .inputVertex) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Label, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.State, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Emitter.labelAt, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Emitter.statement, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.firstPlan
- def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.programline 664 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.controlStatement_inverse_inline_MachineExpanderRowDivisionline 682 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.transportedDivision_inline_MachineExpanderRowDivisionline 691Source documentation
Pull the actual target program into division-state coordinates, derive its trace from its concrete statements, then transport every actual transition back.
private theorem transportedDivision_inline_MachineExpanderRowDivision {K Λ σ τ : Type} [DecidableEq K] [Fintype σ] (q : Nat) (positive : 0 < q) (source quotient remainder : K) (sourceQuotient : source ≠ quotient) (sourceRemainder : source ≠ remainder) (quotientRemainder : quotient ≠ remainder) (states : MachineFixedDivMod.State σ q ≃ τ) (scanLabel : Λ) (emitterLabel : Fin q → Λ) (exit : Option Λ) (finish : σ → Fin q → σ) (target : Λ → TM2.Stmt (fun _ : K => Bool) Λ τ) (atScan : target scanLabel = MachineControl.statement id states (MachineFixedDivMod.scanLoop q positive source quotient scanLabel emitterLabel)) (atEmitter : ∀ r, target (emitterLabel r) = MachineControl.statement id states (MachineFixedDivMod.emitterWithFinish q positive remainder exit finish r)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.State, OAI.MaxCutGames.Foundations.Complexity.MachineControl.statement, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.scanLoop, OAI.MaxCutGames.Foundations.Complexity.MachineFixedDivMod.emitterWithFinish
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionStates_applyline 750 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionStateline 755Source documentation
The common row state at a division boundary, with its local residue reset.
def divisionState {d : Nat} (positive : 0 < d) (ambient : ρ) (control : Control d) (register : Option Bool) : State ρ d := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionOutputline 760 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.firstDivisionTraceline 767Source documentation
Exact first lookup-result division, including the receiveFirst control update.
theorem firstDivisionTrace {d : Nat} (positive : 0 < d) (H : Table (cloudSize d) d) (ports : Tape → K) (portsInjective : Function.Injective ports) (labels : Label d → Λ) (exit : Option Λ) (target : Λ → TM2.Stmt (fun _ : K => Bool) Λ (State ρ d)) (atProgram : ∀ label, target (labels label) = statement positive H ports labels exit label) (base : K → List Bool) (n : Nat) (sourceSuffix quotientSuffix remainderSuffix : List Bool) (sourceInput : base (ports .lookupOutput) = encodeWord n ++ sourceSuffix) (quotientInput : base (ports .quotientFirst) = encodeWord 0 ++ quotientSuffix) (remainderInput : base (ports .remainderFirst) = encodeWord 0 ++ remainderSuffix) (ambient : ρ) (control : Control d) (register : Option Bool) : (MachineComposition.advance (TM2.step target))^[n + 2] …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Label, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.State, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.statement, OAI.MaxCutGames.Foundations.Complexity.encodeWord, OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.secondDivisionTraceline 809Source documentation
Exact second division, including receiveSecond and the actual output-emitter entry label.
theorem secondDivisionTrace {d : Nat} (positive : 0 < d) (H : Table (cloudSize d) d) (ports : Tape → K) (portsInjective : Function.Injective ports) (labels : Label d → Λ) (exit : Option Λ) (target : Λ → TM2.Stmt (fun _ : K => Bool) Λ (State ρ d)) (atProgram : ∀ label, target (labels label) = statement positive H ports labels exit label) (base : K → List Bool) (n : Nat) (sourceSuffix quotientSuffix remainderSuffix : List Bool) (sourceInput : base (ports .lookupOutput) = encodeWord n ++ sourceSuffix) (quotientInput : base (ports .quotientSecond) = encodeWord 0 ++ quotientSuffix) (remainderInput : base (ports .remainderSecond) = encodeWord 0 ++ remainderSuffix) (ambient : ρ) (control : Control d) (register : Option Bool) : (MachineComposition.advance (TM2.step target))^[n + 2] …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.Label, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.State, OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.statement, OAI.MaxCutGames.Foundations.Complexity.encodeWord, OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionOutput_sourceline 853 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionOutput_quotientline 865 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionOutput_remainderline 874 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.divisionOutput_otherline 881 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.firstDivisionInTimeline 891 - def
OAI.MaxCutGames.Foundations.Complexity.MachineExpanderRow.secondDivisionInTimeline 915