OAI/Computability/UniqueGames/Machines/MachineRegularOwnerCleanup.lean
34 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Tapeline 11 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Stateline 12 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabetline 13 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.sumDecidableEqline 16Source documentation
Constructor-by-constructor equality for a fixed sum of tape alphabets.
private def sumDecidableEq {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.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.tapeDecidableEqline 29Source 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.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Tape
- instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.tapeBEqline 43Source documentation
List membership uses Boolean equality. These instances are the explicit Boolean view of the executable equality procedure above.
instance tapeBEq : BEq Tape where …
Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Tape
- instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.tapeLawfulBEqline 46 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.tapeFintypeline 50 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.coreline 57 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.localRankline 58 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.countline 59 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTapeline 60 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.rotorline 61 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.paddingline 62 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.levelline 63 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.dummyFuelline 64 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.scratchline 65 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupTapesline 68Source 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.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Tape, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.localRank, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.count, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.rotor, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.level, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.dummyFuel
- inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Labelline 70 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.entryline 76 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupEntryline 80 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.instructionline 84Source 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.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineUnaryAffineAt.scan, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.scratch, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTape, OAI.UniqueGamesTheorem.Reduction.MachineTransfer.loopAt, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupEntry, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineDrainMany.instruction, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.cleanupTapes
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.afterAdditionline 93 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapesline 96 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.stepsline 99 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_applyline 102 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_prefixline 109 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_emptyline 114 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_otherline 118 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes_scratchline 123 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.drainSteps_eqline 129 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.additionTraceAtline 135 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.traceAtline 162Source 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.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.instruction, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.Tape, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.padding, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.prefixTape, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.scratch, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOriginalBody.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.steps, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.entry, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.finalTapes
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRegularOwnerCleanup.executionAtline 182