OAI/Computability/UniqueGames/Machines/MachineBinaryTotalInputMachine.lean
37 declarations, 0 contain sorry, 0 declared as axioms
Total raw-input preprocessing for the ordinary binary formula codec. The machine copies each input bit onto a reverse stack while running the finite validator. Accepted words are restored verbatim; rejected words are drained and replaced by the fixed contradictory formula. All three stack alphabets and all control/register types are finite.
- inductive
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Labelline 26 - abbrev
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Label.enumListline 33 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Label.enumList_getElem?_ctorIdx_eqline 35 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Label.enumList_nodupline 39 - instance
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.(instance at line 41)line 41 - abbrev
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Alphabetline 45 - abbrev
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Stateline 46 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.rejectedWordline 48 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.instructionline 52Source documentation
Stack zero is the input, one the output, and two the reversed input. Branches inspect only the finite validator state and the popped symbol.
def instruction : Label → TM2.Stmt Alphabet Label State | .scan => .pop 0 (fun state head => (state.1, head)) (.branch (fun state => state.2.isSome) (.push 2 (fun state => state.2.getD false) (.load (fun state => (nextMode state.1 (state.2.getD false), none)) (.goto fun _ => .scan))) (.branch (fun state => decide (state.1 = .done)) (.load (fun _ => (.clause, none)) (.goto fun _ => .restore)) (.load (fun _ => (.clause, none)) (.goto fun _ => .drain)))) | .restore => loopAt 2 1 id false .restore none | .drain => MachineDrain.drain 2 .drain (some .rejectOutput) …Mentions: OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Label, OAI.UniqueGamesTheorem.BinaryTotalInputMachine.Alphabet, OAI.UniqueGamesTheorem.BinaryTotalInputMachine.State
- abbrev
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.machineline 66 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.tapesline 77 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.cfgline 82 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.tapes_inputline 86 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.tapes_outputline 89 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.tapes_savedline 92 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.update_inputline 95 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.update_outputline 101 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.update_savedline 107 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.afterScanline 113 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.step_scan_emptyline 115 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.step_scan_consline 122 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.scanTraceline 132Source documentation
The finite DFA reads every bit, including all bits in its rejection sink. The trace also records the physical reversed copy needed by the second phase.
theorem scanTrace (input output saved : List Bool) (mode : Mode) (register : Option Bool) : (advance machine.step)^[input.length + 1] (some (cfg (some .scan) input output saved mode register)) = some (cfg (some (afterScan (run mode input))) [] output (input.reverse ++ saved)) := by …Mentions: OAI.UniqueGamesTheorem.BinaryTotalInputMachine.cfg, OAI.UniqueGamesTheorem.BinaryTotalInputMachine.afterScan
- theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.restoreTraceline 148 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.drainTraceline 160 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.step_rejectOutputline 171 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.joinTraceline 181 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.acceptedTraceline 185 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.rejectedTraceline 196 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.initList_eqline 211 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.haltList_eqline 218 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.stepsline 225 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.steps_leline 228 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.totalTraceline 233Source documentation
Full correspondence on every raw word, with no validity premise.
theorem totalTrace (input : List Bool) : (advance machine.step)^[steps input] (some (initList machine input)) = some (haltList machine (BinaryEncoding.formulaBits (BinaryLanguage.totalParsed input))) := by …Mentions: OAI.UniqueGamesTheorem.BinaryTotalInputMachine.steps, OAI.UniqueGamesTheorem.BinaryTotalInputMachine.machine, OAI.UniqueGamesTheorem.BinaryEncoding.formulaBits, OAI.UniqueGamesTheorem.BinaryLanguage.totalParsed
- def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.outputsInTimeline 255 - def
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.computableInPolyTimeline 265Source documentation
The certificate contains the displayed total machine and its linear trace; it assumes no execution, parser-cost, or malformed-input premise.
noncomputable def computableInPolyTime : TM2ComputableInPolyTime (id : List Bool → List Bool) BinaryEncoding.formulaBits BinaryLanguage.totalParsed where …Mentions: OAI.UniqueGamesTheorem.BinaryEncoding.formulaBits, OAI.UniqueGamesTheorem.BinaryLanguage.totalParsed
- theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.machine_finiteAlphabetline 279 - theorem
OAI.UniqueGamesTheorem.BinaryTotalInputMachine.computation_finiteAlphabetline 283