OAI/Computability/UniqueGames/Machines/MachineRepeat.lean
51 declarations, 0 contain sorry, 0 declared as axioms
A fixed finite TM2 interpreter for a unary number of runs of a fixed
certified machine. The counter is data on a separate tape. Every body run is
lifted from an actual TM2OutputsInTime witness, and all transfers are executed
by the checked finite transfer loops.
- inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.ExtraTapeline 15 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.ExtraTape.enumListline 19 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.ExtraTape.enumList_getElem?_ctorIdx_eqline 21 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.ExtraTape.enumList_nodupline 25 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.(instance at line 27)line 27 - inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Phaseline 30 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Phase.enumListline 34 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Phase.enumList_getElem?_ctorIdx_eqline 37 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Phase.enumList_nodupline 41 - instance
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.(instance at line 43)line 43 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Tapeline 47 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Symbolsline 48 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Labelline 49 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.Stateline 50 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.extraTapesline 52 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.auxProgramline 58 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.programline 79 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.machineline 83 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputTapesline 101 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputTapes_inputline 104 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputTapes_counterline 108 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputConfigline 111 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.embeddedline 115 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.temporaryTapesline 120 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.temporaryConfigline 123 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputTapes_update_inputline 127 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputTapes_update_counterline 139 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.oneStepline 148 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.parseStep_trueline 156 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.parseStep_falseline 165 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.parseTraceline 174 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.guardStep_someline 200 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.guardStep_noneline 209 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.bodyExecutionline 217Source documentation
Lift the actual certified body run while preserving the remaining counter.
def bodyExecution (counter : List (M.Γ M.k₀)) (word : List (M.Γ M.k₀)) (result : List (M.Γ M.k₁)) (budget : Nat) (run : TM2OutputsInTime M word (some result) budget) : StateTransition.EvalsToInTime (machine M input output).step (embedded M counter (initList M word)) (some (embedded M counter (haltList M result))) budget := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.machine, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.embedded
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.bodyToTemp_tapesline 227 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.tempToBody_tapesline 243 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.finalToTemp_tapesline 255 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.tempToOutput_tapesline 267 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.bodyToTempline 278 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.tempToBodyline 294 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.finalToTempline 309 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.tempToOutputline 321 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.bodyReturnline 335Source documentation
Transfer the literal body output back to the input, preserving its order.
def bodyReturn (result : List (M.Γ M.k₁)) (counter : List (M.Γ M.k₀)) : StateTransition.EvalsToInTime (machine M input output).step (embedded M counter (haltList M result)) (some (inputConfig M .guard (result.map (fun b => input.symm (output b))) counter)) (2*(result.length+1)) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.machine, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.embedded, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputConfig
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.finishline 348Source documentation
Zero remaining iterations still run the actual final transfers and halt with every tape other than the designated output empty.
def finish (word : List (M.Γ M.k₀)) : StateTransition.EvalsToInTime (machine M input output).step (inputConfig M .guard word []) (some (haltList (machine M input output) word)) (2*word.length+3) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.machine, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputConfig
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopBudgetline 362Source documentation
Running time after the parser: actual body budgets, two transfers per body result, one guard per iteration, and the final transfer and empty guard.
def loopBudget : Nat → (Nat → List Bool) → (Nat → Nat) → Nat | 0, words, _ => 2*(words 0).length+3 | count+1, words, budgets => budgets 0 + 2*(words 1).length+3 + loopBudget count (fun i => words (i+1)) (fun i => budgets (i+1)) - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopExecutionline 367 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.inputConfig_initline 405 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.executeSequenceline 417 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopBudget_eq_sumline 444Source documentation
Explicit sum form of the actual repeat budget.
theorem loopBudget_eq_sum (count : Nat) (words : Nat → List Bool) (budgets : Nat → Nat) : loopBudget count words budgets = (∑ i ∈ Finset.range count, (budgets i + 2*(words (i+1)).length+3)) + 2*(words count).length+3 := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopBudget
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.executeSequenceSumline 456Source documentation
The sum of supplied body budgets and explicit linear transfer overheads.
def executeSequenceSum (count : Nat) (words : Nat → List Bool) (budgets : Nat → Nat) (runs : ∀ i, i < count → TM2OutputsInTime M ((words i).map input.symm) (some ((words (i+1)).map output.symm)) (budgets i)) : TM2OutputsInTime (machine M input output) ((encodeWord count ++ words 0).map input.symm) (some ((words count).map input.symm)) (count+1 + ((∑ i ∈ Finset.range count, (budgets i+2*(words (i+1)).length+3)) + 2*(words count).length+3)) := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.machine, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopBudget_leline 470Source documentation
A uniform bound along the executed sequence is enough to bound the actual repeat runtime. No polynomial growth of an arbitrary iteration is asserted.
theorem loopBudget_le (count : Nat) (words : Nat → List Bool) (budgets : Nat → Nat) (bodyBound lengthBound : Nat) (hb : ∀i, i<count → budgets i ≤ bodyBound) (hl : ∀i, i≤count → (words i).length ≤ lengthBound) : loopBudget count words budgets ≤ count*(bodyBound+2*lengthBound+3)+2*lengthBound+3 := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineRepeat.loopBudget