OAI/Computability/MaxCut/Machines/MachineClone100.lean
90 declarations, 0 contain sorry, 0 declared as axioms
A finite-state validator for the concrete ordinary-binary formula encoding. It checks clause and literal framing, canonical name payloads, and the unique terminal formula marker. The last-digit register starts at true for each name, so the empty payload is accepted as zero while a nonempty payload must end in one. Every bit following the terminal formula marker causes rejection.
- def
OAI.MaxCutGames.Explicit.MachineClone100.indicesline 15 - def
OAI.MaxCutGames.Explicit.MachineClone100.triplesline 18 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.triples_lengthline 20 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.triples_nonemptyline 23 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.equation_wordsline 28 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.body_wordsline 36 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.input_words_eqline 42 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.input_bits_eqline 51 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.serialized_polynomial_inline_MachineClone100line 57 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.size_boundline 70 - def
OAI.MaxCutGames.Explicit.MachineClone100.computationline 82 - theorem
OAI.MaxCutGames.Explicit.MachineClone100.finiteAlphabetline 87 - def
OAI.MaxCutGames.Explicit.MachineClone100.fullRunInTimeline 90 - inductive
OAI.MaxCutGames.BinaryValidatorMachine.Modeline 108 - def
OAI.MaxCutGames.BinaryValidatorMachine.afterNameline 117 - def
OAI.MaxCutGames.BinaryValidatorMachine.nextModeline 120 - def
OAI.MaxCutGames.BinaryValidatorMachine.runline 130 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_rejectline 134 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_done_iffline 139 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.finalDigit_true_iff_inline_MachineBinaryValidatorMachineline 144 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_frameline 162Source documentation
A valid framed payload advances exactly to the next literal or clause.
theorem run_frame (slot : Fin 3) (bits rest : List Bool) (last : Bool) (valid : BinaryNameMachine.finalDigit bits (some last) = some true) : run (.name slot last) (frame bits ++ rest) = run (afterName slot) rest := by …Mentions: OAI.MaxCutGames.BinaryNameMachine.finalDigit, OAI.MaxCutGames.BinaryValidatorMachine.run, OAI.MaxCutGames.BinaryValidatorMachine.afterName
- theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_nameline 174 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_literalline 179 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_clauseline 184 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_clausesline 188 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_formulaline 195 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.frame_inverseline 199Source documentation
Any accepting name phase consumes a complete frame with a valid last digit.
theorem frame_inverse (slot : Fin 3) (last : Bool) (input : List Bool) (accepted : run (.name slot last) input = .done) : ∃ bits rest, input = frame bits ++ rest ∧ BinaryNameMachine.finalDigit bits (some last) = some true ∧ run (afterName slot) rest = .done := by …Mentions: OAI.MaxCutGames.BinaryValidatorMachine.run, OAI.MaxCutGames.BinaryNameMachine.finalDigit, OAI.MaxCutGames.BinaryValidatorMachine.afterName
- theorem
OAI.MaxCutGames.BinaryValidatorMachine.name_inverseline 229 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.literal_inverseline 238 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.clause_inverseline 249 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.clauses_inverse_aux_inline_MachineBinaryValidatorMachineline 262 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.run_clause_iffline 291Source documentation
Exact language recognition, including rejection of incomplete, padded, or trailing input.
theorem run_clause_iff (input : List Bool) : run .clause input = .done ↔ ∃ formula, input = formulaBits formula := by … - def
OAI.MaxCutGames.BinaryValidatorMachine.acceptsline 301 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.accepts_eq_decodeline 303 - abbrev
OAI.MaxCutGames.BinaryValidatorMachine.Alphabetline 325 - abbrev
OAI.MaxCutGames.BinaryValidatorMachine.Stateline 326 - def
OAI.MaxCutGames.BinaryValidatorMachine.instructionline 330Source documentation
Every nonempty pop performs exactly one finite DFA transition. The empty pop emits the final acceptance bit, resets control, and halts.
def instruction : TM2.Stmt Alphabet Unit State := …
Mentions: OAI.MaxCutGames.BinaryValidatorMachine.Alphabet, OAI.MaxCutGames.BinaryValidatorMachine.State
- abbrev
OAI.MaxCutGames.BinaryValidatorMachine.machineline 338 - def
OAI.MaxCutGames.BinaryValidatorMachine.tapesline 349 - def
OAI.MaxCutGames.BinaryValidatorMachine.cfgline 353 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.tapes_inputline 357 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.tapes_outputline 360 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.update_input_inline_MachineBinaryValidatorMachineline 363 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.update_output_inline_MachineBinaryValidatorMachineline 368 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.step_emptyline 373 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.step_consline 380 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.runTraceline 390Source documentation
Exact execution on every word, including malformed, noncanonical, and trailing input. Rejection drains the entire input through a finite sink state.
theorem runTrace (input output : List Bool) (mode : Mode) (register : Option Bool) : (advance machine.step)^[input.length + 1] (some (cfg (some ()) input output mode register)) = some (cfg none [] (decide (run mode input = .done) :: output) .clause) := by …Mentions: OAI.MaxCutGames.BinaryValidatorMachine.Mode, OAI.MaxCutGames.BinaryValidatorMachine.cfg, OAI.MaxCutGames.BinaryValidatorMachine.run
- theorem
OAI.MaxCutGames.BinaryValidatorMachine.initList_eqline 404 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.haltList_eqline 411 - theorem
OAI.MaxCutGames.BinaryValidatorMachine.validatorTraceline 419Source documentation
A total raw-bit validator with the exact same answer as the binary codec.
theorem validatorTrace (input : List Bool) : (advance machine.step)^[input.length + 1] (some (initList machine input)) = some (haltList machine [(BinaryEncoding.decodeFormula input).isSome]) := by …Mentions: OAI.MaxCutGames.BinaryValidatorMachine.machine, OAI.MaxCutGames.BinaryEncoding.decodeFormula
- def
OAI.MaxCutGames.BinaryValidatorMachine.outputsInTimeline 431 - def
OAI.MaxCutGames.BinaryValidatorMachine.computableInPolyTimeline 440Source documentation
The polynomial certificate supplies the explicit machine above. There is no assumed parser, verifier, or runtime hypothesis.
noncomputable def computableInPolyTime : TM2ComputableInPolyTime (id : List Bool → List Bool) (id : List Bool → List Bool) (fun input => [(BinaryEncoding.decodeFormula input).isSome]) where … - theorem
OAI.MaxCutGames.BinaryValidatorMachine.machine_finiteAlphabetline 454 - inductive
OAI.MaxCutGames.BinaryTotalInputMachine.Labelline 477 - abbrev
OAI.MaxCutGames.BinaryTotalInputMachine.Label.enumListline 484 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.Label.enumList_getElem?_ctorIdx_eqline 486 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.Label.enumList_nodupline 490 - instance
OAI.MaxCutGames.BinaryTotalInputMachine.(instance at line 492)line 492 - abbrev
OAI.MaxCutGames.BinaryTotalInputMachine.Alphabetline 496 - abbrev
OAI.MaxCutGames.BinaryTotalInputMachine.Stateline 497 - def
OAI.MaxCutGames.BinaryTotalInputMachine.rejectedWordline 499 - def
OAI.MaxCutGames.BinaryTotalInputMachine.instructionline 503Source 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.MaxCutGames.BinaryTotalInputMachine.Label, OAI.MaxCutGames.BinaryTotalInputMachine.Alphabet, OAI.MaxCutGames.BinaryTotalInputMachine.State
- abbrev
OAI.MaxCutGames.BinaryTotalInputMachine.machineline 517 - def
OAI.MaxCutGames.BinaryTotalInputMachine.tapesline 528 - def
OAI.MaxCutGames.BinaryTotalInputMachine.cfgline 533 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.tapes_inputline 537 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.tapes_outputline 540 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.tapes_savedline 543 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.update_input_inline_MachineBinaryTotalInputMachineline 546 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.update_output_inline_MachineBinaryTotalInputMachineline 552 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.update_saved_inline_MachineBinaryTotalInputMachineline 558 - def
OAI.MaxCutGames.BinaryTotalInputMachine.afterScanline 564 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.step_scan_emptyline 566 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.step_scan_consline 573 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.scanTraceline 583Source 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.MaxCutGames.BinaryTotalInputMachine.cfg, OAI.MaxCutGames.BinaryTotalInputMachine.afterScan
- theorem
OAI.MaxCutGames.BinaryTotalInputMachine.restoreTraceline 599 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.drainTraceline 611 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.step_rejectOutputline 622 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.joinTrace_inline_MachineBinaryTotalInputMachineline 632 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.acceptedTraceline 636 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.rejectedTraceline 647 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.initList_eqline 662 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.haltList_eqline 669 - def
OAI.MaxCutGames.BinaryTotalInputMachine.stepsline 676 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.steps_leline 679 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.totalTraceline 684Source 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.MaxCutGames.BinaryTotalInputMachine.steps, OAI.MaxCutGames.BinaryTotalInputMachine.machine, OAI.MaxCutGames.BinaryEncoding.formulaBits, OAI.MaxCutGames.BinaryLanguage.totalParsed
- def
OAI.MaxCutGames.BinaryTotalInputMachine.outputsInTimeline 706 - def
OAI.MaxCutGames.BinaryTotalInputMachine.computableInPolyTimeline 716Source 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.MaxCutGames.BinaryEncoding.formulaBits, OAI.MaxCutGames.BinaryLanguage.totalParsed
- theorem
OAI.MaxCutGames.BinaryTotalInputMachine.machine_finiteAlphabetline 730 - theorem
OAI.MaxCutGames.BinaryTotalInputMachine.computation_finiteAlphabetline 734