OAI/Computability/UniqueGames/Machines/PoweringMachineRow.lean
40 declarations, 0 contain sorry, 0 declared as axioms
Finite tape program for a powered relation row
The radius, address count, and powered alphabet size are fixed machine parameters. The machine consumes live base predicate bits and endpoint-match bits. Its finite register selects the first matching address, looks up the two fixed powered labels, and conjoins the bounded list of base predicates.
Both input and output bits use the graph-table unary natural-word codec. The theorems below describe actual TM2 transitions, not assumed execution costs. Producing this input block from live graph rotor lookups is a separate frontend composition obligation; no graph table occurs in the machine's finite transition function.
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.Fieldline 29 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputSizeline 31 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.fieldEquivline 33 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputEquivline 37 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.packDataline 41Source documentation
Proof-level organization of exactly the finite bits physically read.
def packData {t S : Nat} (data : Fin t → Field S → Bool) : Buffer (inputSize t S) := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.Field, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.packData_inputEquivline 44 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.basePredicateline 49 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.leftMatchesline 53 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rightMatchesline 57 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.firstMatchline 62Source documentation
The scan order is the fixed increasing finite-index order.
def firstMatch {S : Nat} (mask : Fin S → Bool) : Option (Fin S) := … - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.firstMatch_specline 65 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.firstMatch_noneline 72 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.edgeAcceptline 78Source documentation
labelAtis a fixed finite lookup table determined by the reduction parameters, for exampledecodeLabel a (allAddresses.get i).def edgeAccept {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) (k : Fin t) (a b : Fin q) : Bool := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.edgeAccept_of_matchesline 84 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rowAcceptline 92 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rowAccept_eq_trueline 96 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rowBlockline 103Source documentation
Every powered-label pair is written in the canonical row-major order.
def rowBlock {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) : Buffer (q * q) := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rowBlock_atline 109 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBitline 116 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBitsline 118 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBits_appendline 122 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBits_graphWordsline 128 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBits_length_leline 135 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.readEncodedSlotsline 149Source documentation
Read one zero-delimited unary Boolean field for each fixed register slot. The second pop occurs exactly when the value is one.
def readEncodedSlots (src : K) : List (Fin N) → TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N) → TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N) | [], next => next | i :: slots, next => .pop src (fun state head => (state.1, Function.update state.2 i (head.getD false))) (.branch (fun state => state.2 i) (.pop src (fun state _ => state) (readEncodedSlots src slots next)) (readEncodedSlots src slots next)) variable [DecidableEq K] - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.stepAux_readEncodedSlotsline 162 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.stepAux_readEncodedAllline 181 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.statementPushBound_readEncodedSlotsline 197 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.writeEncodedSlotsline 207Source documentation
The delimiter is pushed first, then the optional unary one; writing slots in reverse order gives the canonical field order on the destination stack.
def writeEncodedSlots {M : Nat} (dst : K) (emit : σ → Buffer M) : List (Fin M) → TM2.Stmt (fun _ : K => Bool) Λ σ → TM2.Stmt (fun _ : K => Bool) Λ σ | [], next => next | i :: slots, next => .push dst (fun _ => false) (.branch (fun state => emit state i) (.push dst (fun _ => true) (writeEncodedSlots dst emit slots next)) (writeEncodedSlots dst emit slots next)) - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.stepAux_writeEncodedSlotsline 215 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.statementPushBound_writeEncodedSlotsline 232 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodedBlockStmtline 249 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodedBlockAtline 256 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.statementPushBound_encodedBlockAtline 260 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.stepAux_encodedBlockStmtline 269 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.stepAux_encodedBlockAtline 284 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.step_encodedBlockAtline 295 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.rowAtline 312 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.machineline 317 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.machine_statementPushBoundline 328 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.machineInTimeline 336Source documentation
The input predicate/match block is consumed. The exact unary predicate row is prepended; the remaining input, old output, and ambient register are accounted for in the actual transition witness.
def machineInTime {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) (suffix : List Bool) (register : Buffer (inputSize t S)) (tapes : Bool → List Bool) (hinput : tapes false = encodeBits (List.ofFn bits) ++ suffix) : StateTransition.EvalsToInTime (machine (t := t) labelAt).step …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.inputSize, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.encodeBits, OAI.UniqueGamesTheorem.Foundations.Complexity.PoweringMachineRow.machine