OAI/Computability/MaxCut/Machines/MachineSequential.lean
73 declarations, 0 contain sorry, 0 declared as axioms
A concrete sequential composition of two finite TM2 programs. The first output is transferred to a temporary stack and then to the second input. Both loops execute actual transitions and reset their shared register on exit. Static renaming changes neither a stack word nor the number of executed transitions.
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.Tapeline 17 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.Symbolsline 18 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.Labelline 21 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.Registerline 22 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.Stateline 23 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstStatesline 25 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondStatesline 32 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondLabelsline 39 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.bridgeLabelline 45 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstStatementline 48 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondStatementline 53 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.programline 61 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.machineline 77 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstConfigurationline 104 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondConfigurationline 110 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstStepline 119 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondStepline 149 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstConfiguration_initline 174 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondConfiguration_haltline 190 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.temporaryTapesline 207 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.temporaryConfigurationline 213 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstTransfer_tapesline 218 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondTransfer_tapesline 237 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.firstTransferline 260 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.secondTransferline 281 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.executeline 299Source documentation
An execution of each component yields an actual execution of the combined machine. The two transfer loops add exactly twice the intermediate length plus two.
def execute (first second : FinTM2) (relabel : first.Γ first.k₁ → second.Γ second.k₀) (fallback : second.Γ second.k₀) (input : List (first.Γ first.k₀)) (middle : List (first.Γ first.k₁)) (output : List (second.Γ second.k₁)) (firstBudget secondBudget : Nat) (runFirst : TM2OutputsInTime first input (some middle) firstBudget) (runSecond : TM2OutputsInTime second (middle.map relabel) (some output) secondBudget) : TM2OutputsInTime (machine first second relabel fallback) input (some output) (firstBudget + 2 * (middle.length + 1) + secondBudget) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineSequential.machine
- def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.composeline 332Source documentation
General sequential composition with an explicit symbol of the intermediate alphabet to totalize the bridge's unused empty-register expression. Its time polynomial uses the transition-derived output-length bound of the first machine.
noncomputable def compose {α β γ αΓ βΓ γΓ : Type} {ea : α → List αΓ} {eb : β → List βΓ} {ec : γ → List γΓ} {f : α → β} {g : β → γ} (first : TM2ComputableInPolyTime ea eb f) (second : TM2ComputableInPolyTime eb ec g) (fallback : βΓ) : TM2ComputableInPolyTime ea ec (fun a => g (f a)) := by … - def
OAI.MaxCutGames.Foundations.Complexity.MachineSequential.composeBitsline 379 - def
OAI.MaxCutGames.Reduction.MachineTransducer.tapeStacksline 395 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.update_input_inline_MachineTransducerline 398 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.update_output_inline_MachineTransducerline 403 - def
OAI.MaxCutGames.Reduction.MachineTransducer.outputline 411Source documentation
The semantic output, with the control state updated after each input bit.
def output (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) : Q → List Bool → List Bool | _, [] => [] | state, symbol :: input => emit state symbol ++ output transition emit (transition state symbol) input - def
OAI.MaxCutGames.Reduction.MachineTransducer.loopline 417 - def
OAI.MaxCutGames.Reduction.MachineTransducer.programline 424 - def
OAI.MaxCutGames.Reduction.MachineTransducer.machineline 432 - def
OAI.MaxCutGames.Reduction.MachineTransducer.maxEmissionline 445Source documentation
A finite maximum depending only on the fixed emission table.
noncomputable def maxEmission (emit : Q → Bool → List Bool) : Nat := …
- theorem
OAI.MaxCutGames.Reduction.MachineTransducer.emission_leline 448 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.statementPushBound_leline 453 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.programPushBound_leline 462 - def
OAI.MaxCutGames.Reduction.MachineTransducer.runningline 473 - def
OAI.MaxCutGames.Reduction.MachineTransducer.emittingline 478 - def
OAI.MaxCutGames.Reduction.MachineTransducer.haltedline 483 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.step_emptyline 488Source documentation
The final empty pop also restores the initial finite control state.
theorem step_empty (initial : Q) (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) (state : Q) (accumulator : List Bool) (register : Option Bool) : (machine initial transition emit).step (running initial transition emit state [] accumulator register) = some (halted initial transition emit accumulator) := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransducer.machine, OAI.MaxCutGames.Reduction.MachineTransducer.running, OAI.MaxCutGames.Reduction.MachineTransducer.halted
- theorem
OAI.MaxCutGames.Reduction.MachineTransducer.step_consline 499 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.step_emitline 512Source documentation
Emission reads the old state from its label and installs its successor state.
theorem step_emit (initial : Q) (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) (oldState : Q) (symbol : Bool) (input accumulator : List Bool) (state : Q × Option Bool) : (machine initial transition emit).step (emitting initial transition emit oldState symbol input accumulator state) = some (running initial transition emit (transition oldState symbol) input ((emit oldState symbol).reverse ++ accumulator) state.2) := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransducer.machine, OAI.MaxCutGames.Reduction.MachineTransducer.emitting, OAI.MaxCutGames.Reduction.MachineTransducer.running
- def
OAI.MaxCutGames.Reduction.MachineTransducer.nextline 530 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.two_steps_consline 535 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.transduce_stepsline 549Source documentation
Exact execution from any finite control state, accumulator, and symbol register.
theorem transduce_steps (initial : Q) (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) (state : Q) (input accumulator : List Bool) (register : Option Bool) : (next initial transition emit)^[2 * input.length + 1] (some (running initial transition emit state input accumulator register)) = some (halted initial transition emit ((output transition emit state input).reverse ++ accumulator)) := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransducer.next, OAI.MaxCutGames.Reduction.MachineTransducer.running, OAI.MaxCutGames.Reduction.MachineTransducer.halted, OAI.MaxCutGames.Reduction.MachineTransducer.output
- theorem
OAI.MaxCutGames.Reduction.MachineTransducer.initList_eqline 566 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.haltList_eqline 575 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.transduce_init_stepsline 582 - def
OAI.MaxCutGames.Reduction.MachineTransducer.outputsInTimeline 590 - theorem
OAI.MaxCutGames.Reduction.MachineTransducer.outputsInTime_stepsline 598 - def
OAI.MaxCutGames.Reduction.MachineTransducer.reversedComputableInPolyTimeline 603Source documentation
Reversed transducer output in polynomial
2 * X + 1time.noncomputable def reversedComputableInPolyTime (initial : Q) (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) : TM2ComputableInPolyTime (id : List Bool → List Bool) id (fun input => (output transition emit initial input).reverse) where …Mentions: OAI.MaxCutGames.Reduction.MachineTransducer.output
- def
OAI.MaxCutGames.Reduction.MachineTransducer.computableInPolyTimeline 624Source documentation
Forward transducer output, using the checked actual reversal composition.
noncomputable def computableInPolyTime (initial : Q) (transition : Q → Bool → Q) (emit : Q → Bool → List Bool) : TM2ComputableInPolyTime (id : List Bool → List Bool) id (output transition emit initial) := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransducer.output
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.Alphabetline 641 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.Stateline 642 - def
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.scanLoopline 644 - def
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.emitterline 653 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.tapesline 659 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.update_source_inline_MachineTransducerCopyline 663 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.update_scratch_inline_MachineTransducerCopyline 678 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.update_output_inline_MachineTransducerCopyline 690 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.scanStep_emptyline 696 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.scanStep_consline 714 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.emitterStepline 732 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.twoSteps_consline 753 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.scanTraceline 779 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.restoreTapesline 813 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.transduceCopyTraceline 832 - def
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.transduceCopyInTimeline 878 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.scanLoop_pushBoundline 904 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineTransducerCopy.emitter_pushBoundline 910