OAI/Computability/UniqueGames/Machines/MachineExpanderRowEmitLemmas.lean
40 declarations, 0 contain sorry, 0 declared as axioms
Actual lookup and reversal phases of the expander row program
The Boolean phase selector chooses the first or second occurrence of the same preserving lookup. The selected word is proved to be the actual stored reverse index of the supplied graph row. All execution facts follow from the concrete program statements; no phase execution is assumed.
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.emitStepsline 13Source documentation
One scaled scan/restore, one bounded offset, the delimiter, and final jump.
def emitSteps (n : Nat) : Nat := 3 * (n + 1) + 6
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.affinePlan_bitsline 15 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.affinePlan_stepsline 26 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.emittedWordline 34Source documentation
Every tape except the accumulator is literally retained.
def emittedWord {K : Type} [DecidableEq K] (target : K) (base : K → List Bool) (value : Nat) : K → List Bool := … - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.emittedWord_targetline 38 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.emittedWord_otherline 43 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.program_firstEmitline 51 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.program_secondEmitline 57 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.program_outputEmitline 63 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.firstEmitTraceAtline 75Source documentation
The code premise identifies concrete statements in a caller's program; it does not assume any phase execution.
theorem firstEmitTraceAt (positive : 0 < d) (H : Table (cloudSize d) d) (ports : Tape → K) (portsInjective : Function.Injective ports) (labels : Label d → Λ) (exit : Option Λ) (target : Λ → TM2.Stmt (fun _ : K => Bool) Λ (State ρ d)) (atLabels : ∀ l, target (labels l) = statement positive H ports labels exit l) (n : Nat) (base : K → List Bool) (source : base (ports .inputVertex) = encodeWord n) (scratch : base (ports .emitScratch) = []) (ambient : Ambient ρ d × Fin (degree d)) : (MachineComposition.advance (TM2.step target))^[emitSteps n] (some ⟨some (labels (.firstEmit (Emitter.labelAt 3 _ 0 .entry))), ((ambient, ()), none), base⟩) = …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.Tape, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.Label, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.State, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.statement, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.Ambient, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineComposition.advance, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.emitSteps
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.secondEmitTraceAtline 106 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.outputEmitTraceAtline 137 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.firstEmitInTimeAtline 168 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.secondEmitInTimeAtline 186 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.outputEmitInTimeAtline 204 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.firstEmitTraceline 224 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.secondEmitTraceline 236 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.outputEmitTraceline 248 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.firstEmitInTimeline 260 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.secondEmitInTimeline 272 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.outputEmitInTimeline 284 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseLabelline 311 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.scanPhaseLabelline 315 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseLabelline 318 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhasePortline 321 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseAddressline 324 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseAddress_eq_rowIndexline 327 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupTape_injectiveline 335 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapesline 340Source documentation
The exact cleaned tape state produced by either lookup.
def lookupResultTapes (ports : Tape → K) (base : K → List Bool) (value : Nat) (indexSuffix : List Bool) : K → List Bool := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.Tape
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_indexline 345 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_workline 353 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_outputline 359 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_otherline 366Source documentation
Every tape outside the query, work, and lookup-output roles is retained.
theorem lookupResultTapes_other (ports : Tape → K) (base : K → List Bool) (value : Nat) (indexSuffix : List Bool) (p : K) (hi : p ≠ ports .queryIndex) (hw : p ≠ ports .lookupWork) (ho : p ≠ ports .lookupOutput) : lookupResultTapes ports base value indexSuffix p = base p := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.Tape, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_tableline 373 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes_restoreline 379 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseTraceline 406Source documentation
Actual first/second lookup execution on a stored graph row. The selected reverse index is obtained from
rotationWords_getElem?, not a caller premise.theorem lookupPhaseTrace : (advance (TM2.step target))^[MachinePreservingLookupClean.steps (rotationWords G) (rowIndex v (degree d) x).val] (some ⟨some (labels (lookupPhaseLabel second (.run .copyFirst))), (ambient, register), base⟩) = some ⟨some (labels (scanPhaseLabel second)), (ambient, none), lookupResultTapes ports base (reverseIndex G (rowIndex v (degree d) x)).val indexSuffix⟩ := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachinePreservingLookupClean.steps, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.scanPhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseInTimeline 430Source documentation
A linear bound in the original encoded table length for the same actual phase. This includes the copy, restore, lookup, and residual cleanup.
def lookupPhaseInTime : StateTransition.EvalsToInTime (TM2.step target) ⟨some (labels (lookupPhaseLabel second (.run .copyFirst))), (ambient, register), base⟩ (some ⟨some (labels (scanPhaseLabel second)), (ambient, none), lookupResultTapes ports base (reverseIndex G (rowIndex v (degree d) x)).val indexSuffix⟩) (6 * (encodeWords (rotationWords G)).length + 4) where …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.scanPhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupResultTapes, OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWords
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseTraceline 458Source documentation
The reversal consumes the reverse query word and prepends its forward encoding to the index tape, retaining every other tape and finite state.
theorem reversePhaseTrace : (advance (TM2.step target))^[(base (ports .queryReverse)).length + 1] (some ⟨some (labels (reversePhaseLabel second)), (ambient, register), base⟩) = some ⟨some (labels (lookupPhaseLabel second (.run .copyFirst))), (ambient, none), Reduction.MachineTransfer.tapesAt (ports .queryReverse) (ports .queryIndex) base [] ((base (ports .queryReverse)).reverse ++ base (ports .queryIndex))⟩ := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseLabel, OAI.UniqueGamesTheorem.Reduction.MachineTransfer.tapesAt
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseInTimeline 474 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseTrace_unaryline 488Source documentation
Reversing an actual emitted unary field takes exactly
index + 2steps. This includes consuming the field's delimiter and leaving the reversal loop.theorem reversePhaseTrace_unary (index : Nat) (suffix : List Bool) (queryWord : base (ports .queryReverse) = (encodeWord index).reverse) (indexWord : base (ports .queryIndex) = suffix) : (advance (TM2.step target))^[index + 2] (some ⟨some (labels (reversePhaseLabel second)), (ambient, register), base⟩) = some ⟨some (labels (lookupPhaseLabel second (.run .copyFirst))), (ambient, none), Reduction.MachineTransfer.tapesAt (ports .queryReverse) (ports .queryIndex) base [] (encodeWord index ++ suffix)⟩ := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.encodeWord, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.reversePhaseLabel, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineExpanderRow.lookupPhaseLabel, OAI.UniqueGamesTheorem.Reduction.MachineTransfer.tapesAt