OAI/Computability/MaxCut/Machines/MachineRhsLoad.lean
61 declarations, 0 contain sorry, 0 declared as axioms
Execute all fixed outcome rows after the existing RHS loader. A single dispatcher freezes the loaded finite RHS vector into labels. Every row is an actual address-edge phase; no row-run or whole-loop execution is assumed. Program definitions contain only fixed templates, literal permutations, and tape/label placement. Numeric names, radix, and capacity occur only in tapes and the semantic correctness hypotheses.
- abbrev
OAI.MaxCutGames.Reduction.MachineRhsLoad.Stateline 11 - abbrev
OAI.MaxCutGames.Reduction.MachineRhsLoad.Alphabetline 12 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.rhsline 14 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.setRhsline 16 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.rhs_setRhsline 19 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.setRhs_setRhsline 22 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.setRhs_sameline 25 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.fillline 27 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.fill_applyline 30 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.fill_allline 43 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.finishline 51 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.peekChainline 56 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.statementline 64 - def
OAI.MaxCutGames.Reduction.MachineRhsLoad.readRhsline 67 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.stepAux_peekChainline 70 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.stepAux_statementline 81 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.readRhs_of_unaryline 88 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.loadStepline 98Source documentation
One actual transition loads every RHS register while preserving all tapes, caller registers, and the existing optional head register.
theorem loadStep (field : Fin k → K) (entry : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State k σ)) …Mentions: OAI.MaxCutGames.Reduction.MachineRhsLoad.Alphabet, OAI.MaxCutGames.Reduction.MachineRhsLoad.State
- def
OAI.MaxCutGames.Reduction.MachineRhsLoad.loadInTimeline 109 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.peekChain_pushBoundline 125 - theorem
OAI.MaxCutGames.Reduction.MachineRhsLoad.statement_pushBoundline 132 - structure
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Specline 150 - structure
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Valuesline 156Source documentation
Numeric interpretations are proof-side data, separate from the program.
structure Values (width : Nat) where …
- abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Rhsline 162 - abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Rowline 163 - abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Stateline 164 - abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Alphabetline 165 - abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.LocalLabelline 169 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.localMainline 173 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.localInstructionline 178 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.payloadline 183 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowResultline 187 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCostline 192 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCostsline 199Source documentation
Exact per-row costs at their actual accumulated output frames.
def rowCosts (slots : MachineAddressEdge.Tape q width ↪ K) (B C : Nat) (values : Spec q width → Values width) : List (Spec q width) → (K → List Bool) → List Nat | [], _ => [] | row :: rows, base => rowCost slots B C values row base :: rowCosts slots B C values rows (rowResult slots B C values row base)Mentions: OAI.MaxCutGames.Reduction.MachineAddressEdge.Tape, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Spec, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Values, OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCost, OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowResult
- theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCosts_lengthline 206 - structure
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Invariantline 214 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Invariant.appendedline 228 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.appended_nilline 239 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.sequence_resultline 243 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.sequence_stepsline 255 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.sequenceInstructionline 264 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.sequenceTraceline 272Source documentation
The generic finite-sequence local obligation is discharged by the concrete edge program, including its address arithmetic and capacity restoration.
theorem sequenceTrace (slots : MachineAddressEdge.Tape q width ↪ K) (rows : List (Spec q width)) (place : MachineFiniteSequence.Label (LocalLabel slots) rows → Λ) (exit : Option Λ) (P : Λ → TM2.Stmt (Alphabet (K := K)) Λ (MachineAddressEdge.State σ)) …Mentions: OAI.MaxCutGames.Reduction.MachineAddressEdge.Tape, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Spec, OAI.MaxCutGames.Reduction.MachineOutcomeRows.LocalLabel, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Alphabet, OAI.MaxCutGames.Reduction.MachineAddressEdge.State
- def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.selectedline 299 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.selected_lengthline 302 - abbrev
OAI.MaxCutGames.Reduction.MachineOutcomeRows.Labelline 305 - instance
OAI.MaxCutGames.Reduction.MachineOutcomeRows.localLabelFintypeline 308 - instance
OAI.MaxCutGames.Reduction.MachineOutcomeRows.localLabelDecidableEqline 311 - instance
OAI.MaxCutGames.Reduction.MachineOutcomeRows.labelFintypeline 322 - instance
OAI.MaxCutGames.Reduction.MachineOutcomeRows.labelDecidableEqline 325 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.sequenceEntryline 328 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.dispatcherline 336Source documentation
Reuse the RHS vector already loaded by
MachineRhsLoad; dispatch takes one real transition, and resets only the optional temporary bit.def dispatcher (slots : MachineAddressEdge.Tape q width ↪ K) : (rows : List (Row k q width)) → (Label slots rows → Λ) → Option Λ → TM2.Stmt (Alphabet (K := K)) Λ (State k σ) …Mentions: OAI.MaxCutGames.Reduction.MachineAddressEdge.Tape, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Row, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Label, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Alphabet, OAI.MaxCutGames.Reduction.MachineOutcomeRows.State
- def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.instructionline 344 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.programline 351 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.dispatcherStepline 355 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.phaseTraceline 368 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.phaseInTimeline 390 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.emitted_outputline 407 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.exact_row_countline 416 - def
OAI.MaxCutGames.Reduction.MachineOutcomeRows.timePolynomialline 424Source documentation
Sum of fixed row polynomials; the additional constant is the dispatcher. This proof-side polynomial contains no runtime input field values.
noncomputable def timePolynomial (rows : List (Spec q width)) : Polynomial Nat := …
- theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCosts_sum_leline 428 - theorem
OAI.MaxCutGames.Reduction.MachineOutcomeRows.phaseCost_le_timePolynomialline 459Source documentation
The actual dispatcher-and-rows count is bounded by a fixed polynomial in explicit tape and digit magnitudes, using the checked edge arithmetic bound.
theorem phaseCost_le_timePolynomial (slots : MachineAddressEdge.Tape q width ↪ K) (rows : List (Spec q width)) (base : K → List Bool) (B C : Nat) (values : Spec q width → Values width) (M : Nat) (clean : MachineAddressEdge.Clean slots base) (fieldsBound : ∀ j, (base (MachineAddressEdge.addressSlots slots (.field j))).length ≤ M) (radixBound : B ≤ M) (capacityBound : C ≤ M) (valuesBound : ∀ row ∈ rows, (encodeWords (values row).left).length ≤ M ∧ (encodeWords (values row).right).length ≤ M ∧ (∀ i, i < width → MachineTemplateAddress.digits (values row).left i ≤ M) ∧ (∀ i, i < width → MachineTemplateAddress.digits (values row).right i ≤ M)) : (rowCosts slots B C values rows base).sum + 1 ≤ (timePolynomial rows).eval M := by …Mentions: OAI.MaxCutGames.Reduction.MachineAddressEdge.Tape, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Spec, OAI.MaxCutGames.Reduction.MachineOutcomeRows.Values, OAI.MaxCutGames.Reduction.MachineAddressEdge.Clean, OAI.MaxCutGames.Reduction.MachineAddressEdge.addressSlots, OAI.MaxCutGames.Reduction.MachineTemplateAddress.digits, OAI.MaxCutGames.Reduction.MachineOutcomeRows.rowCosts, OAI.MaxCutGames.Reduction.MachineOutcomeRows.timePolynomial