OAI/Computability/MaxCut/Machines/MachineRegularOriginalBody.lean
96 declarations, 0 contain sorry, 0 declared as axioms
One actual original-vertex body of regularization
The finite code composes physical metadata preparation, expander-family materialization, all vertex rows, and seven metadata drain loops. The outer loop owns the global vertex counter and keeps it unchanged during this body.
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Tapeline 22 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Alphabetline 23 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.CoreStateline 24 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.MetaStateline 25 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.FamilyStateline 26 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Stateline 27 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Dataline 28 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTableline 29 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.degree_positiveline 31 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.readyStateline 34 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataTapeline 38 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataViewline 42 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyTapeline 47 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyViewline 51 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexViewline 56 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataView_leftline 60 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataView_rightline 63 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyView_leftline 71 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyView_rightline 74 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexView_leftline 82 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexView_rightline 84 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataStatesline 90 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyStatesline 96 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexStatesline 97 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Labelline 100 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.entryline 107 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearTapeline 109 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearEntryline 113 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearSourceline 116 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexSourceline 119 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.programline 123 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.frameline 134 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.coreFrameline 139 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfgline 142 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.initialDataline 145 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataDataline 158 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyDataline 161 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedBitsline 166 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedDataline 169 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.joinTrace_inline_MachineRegularOriginalBodyline 173 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataPlacementline 177 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataTraceline 187Source documentation
Genuine metadata trace transported with all other finite registers and private family tapes preserved.
theorem metadataTrace (H : BaseTable) (t : GraphTables.Table) (e : Fin t.darts) (output : List Bool) : (advance (TM2.step (program H)))^[MachineRegularMetadata.totalTime t e] (some (cfg H (some entry) (initialData t e output))) = some (cfg H (some (.family .start)) (metadataData t e output)) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTable, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.program, OAI.MaxCutGames.Foundations.Complexity.MachineRegularMetadata.totalTime, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfg, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.entry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.initialData, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataData
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyPlacementline 203 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyResultPlacementline 211 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyExecutionline 224 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyStepsline 229 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyTraceline 235Source documentation
Family work is performed on its physical tapes and produces the rotor from the previously computed unary cloud size.
theorem familyTrace (H : BaseTable) (t : GraphTables.Table) (e : Fin t.darts) (output : List Bool) : (advance (TM2.step (program H)))^[familySteps H t e output] (some (cfg H (some (.family .start)) (metadataData t e output))) = some (cfg H (some (.vertex (MachineRegularVertexBlock.originalEntry internalDegree degree_positive))) (familyData H t e output)) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTable, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.program, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familySteps, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfg, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.metadataData, OAI.MaxCutGames.Foundations.Complexity.MachineRegularVertexBlock.originalEntry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.degree_positive, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyData
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearMemoryline 253Source documentation
Seven real drain loops, including the complete materialized rotor.
def clearMemory (base : Tape → List Bool) : Nat → Tape → List Bool | 0 => base | k + 1 => if h : k < 7 then Function.update (clearMemory base k) (clearTape ⟨k, h⟩) [] else clearMemory base kMentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearTape
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearStepsline 258 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.identityPlacement_inline_MachineRegularOriginalBodyline 263 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.drainTraceline 266 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearPrefixTraceline 282 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearTraceline 297 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearFrameline 303 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.coreFrame_eqline 321 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedData_eqline 341 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexPlacementline 345 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexStepsline 356 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexTraceline 362Source documentation
Every internal port and the inherited original row are emitted by their actual checked row machines, using the rotor just materialized on tape 7.
theorem vertexTrace (H : BaseTable) (t : GraphTables.Table) (e : Fin t.darts) (output : List Bool) : (advance (TM2.step (program H)))^[vertexSteps H t e output] (some (cfg H (some (.vertex (MachineRegularVertexBlock.originalEntry internalDegree degree_positive))) (familyData H t e output))) = some (cfg H (clearEntry 0) (emittedData H t e output)) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTable, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.program, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.vertexSteps, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfg, OAI.MaxCutGames.Foundations.Complexity.MachineRegularVertexBlock.originalEntry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.degree_positive, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.familyData, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.clearEntry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedData
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.totalStepsline 381 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.originalTraceline 388Source documentation
Complete execution of one original-vertex iteration, including physical cleanup of all seven retained metadata fields. The global index is preserved.
theorem originalTrace (H : BaseTable) (t : GraphTables.Table) (e : Fin t.darts) (output : List Bool) : (advance (TM2.step (program H)))^[totalSteps H t e output] (some (cfg H (some entry) (initialData t e output))) = some (cfg H none (initialData t e (output ++ emittedBits H t e))) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTable, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.program, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.totalSteps, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfg, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.entry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.initialData, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedBits
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.originalExecutionline 406Source documentation
Exact execution witness. Its stored count is derived from the four actual phases; a polynomial estimate is supplied separately.
noncomputable def originalExecution (H : BaseTable) (t : GraphTables.Table) (e : Fin t.darts) (output : List Bool) : StateTransition.EvalsToInTime (TM2.step (program H)) (cfg H (some entry) (initialData t e output)) (some (cfg H none (initialData t e (output ++ emittedBits H t e)))) (totalSteps H t e output) where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.BaseTable, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.program, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.cfg, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.entry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.initialData, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.emittedBits, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.totalSteps
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Tapeline 424 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Stateline 425 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabetline 426 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.sumDecidableEq_inline_MachineRegularOwnerCleanupline 429Source documentation
Constructor-by-constructor equality for a fixed sum of tape alphabets.
private def sumDecidableEq_inline_MachineRegularOwnerCleanup {A B : Type} (left : DecidableEq A) (right : DecidableEq B) : DecidableEq (A ⊕ B) | .inl a, .inl b => match left a b with | .isTrue h => .isTrue (congrArg (Sum.inl : A → A ⊕ B) h) | .isFalse h => .isFalse (fun e => h (Sum.inl.inj e)) | .inr a, .inr b => match right a b with | .isTrue h => .isTrue (congrArg (Sum.inr : B → A ⊕ B) h) | .isFalse h => .isFalse (fun e => h (Sum.inr.inj e)) | .inl _, .inr _ => .isFalse (by intro h; cases h) | .inr _, .inl _ => .isFalse (by intro h; cases h) /-- Every equality decision is explicitly assembled from fixed finite leaves. - instance
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.tapeDecidableEqline 442Source documentation
Every equality decision is explicitly assembled from fixed finite leaves. There is no classical decision or recursive typeclass search on the tape sum.
instance tapeDecidableEq : DecidableEq Tape := …
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Tape
- instance
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.tapeBEqline 456Source documentation
List membership uses Boolean equality in Lean 4.33. These instances are the explicit Boolean view of the executable equality procedure above.
instance tapeBEq : BEq Tape where …
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Tape
- instance
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.tapeLawfulBEqline 459 - instance
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.tapeFintypeline 463 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.coreline 470 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.localRankline 471 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.countline 472 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTapeline 473 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.rotorline 474 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.paddingline 475 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.levelline 476 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.dummyFuelline 477 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.scratchline 478 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupTapesline 481Source documentation
Every name is distinct, so the exact drain cost uses the entry lengths.
def cleanupTapes : List Tape := [localRank, count, rotor, padding, level, dummyFuel]
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.localRank, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.count, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.rotor, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.level, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.dummyFuel
- inductive
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Labelline 483 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.entryline 489 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupEntryline 491 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.instructionline 495Source documentation
Coefficient one, no seed: the destination already contains its offset.
def instruction (labels : Label → Λ) (exit : Option Λ) : Label → TM2.Stmt Alphabet Λ State | .scan => MachineUnaryAffineAt.scan padding scratch prefixTape 1 (labels .scan) (labels .restore) | .restore => Reduction.MachineTransfer.loopAt scratch padding id false (labels .restore) (cleanupEntry labels exit) | .drain l => MachineDrainMany.instruction cleanupTapes (fun l => labels (.drain l)) exit lMentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Label, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.State, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryAffineAt.scan, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.scratch, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTape, OAI.MaxCutGames.Reduction.MachineTransfer.loopAt, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupEntry, OAI.MaxCutGames.Foundations.Complexity.MachineDrainMany.instruction, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupTapes
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.afterAdditionline 504 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapesline 507 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.stepsline 510 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_applyline 513 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_prefixline 520 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_emptyline 525 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_otherline 529 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_scratchline 534 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.drainSteps_eqline 540 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.additionTraceAtline 546 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.traceAtline 573Source documentation
Complete physical addition followed by the six exact drain loops. No phase run or precomputed sum word is supplied as a hypothesis.
theorem traceAt (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt Alphabet Λ State) (code : ∀ l, program (labels l) = instruction labels exit l) (base : Tape → List Bool) (d o : Nat) (paddingWord : base padding = encodeWord d) (prefixWord : base prefixTape = encodeWord o) (scratchEmpty : base scratch = []) (ambient : MachineRegularOriginalBody.State) (register : Option Bool) : (advance (TM2.step program))^[steps base d] (some ⟨some (labels entry), (ambient, register), base⟩) = some ⟨exit, (ambient, none), finalTapes base d o⟩ := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Label, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.State, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.instruction, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.MaxCutGames.Foundations.Complexity.encodeWord, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.scratch, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalBody.State, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.steps, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.entry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOwnerCleanup.executionAtline 593