The lines of the Lean statement that state the theorem, then the definitions in the file that it uses.
Local definitions the statement names, followed through the definitions they name in turn. The match is by name in the source text, so a name reached only through notation can be missed; the full file is below.
structure OAI.UniformKServer.RationalMetric line 12
structure RationalMetric (n : ℕ) where distance : Fin n → Fin n → ℚ nonneg : ∀ x y, 0 ≤ distance x y eq_zero : ∀ x y, distance x y = 0 ↔ x = y symm : ∀ x y, distance x y = distance y x triangle : ∀ x y z, distance x z ≤ distance x y + distance y z
abbreviation OAI.UniformKServer.Configuration line 19
abbrev Configuration (n k : ℕ) := Fin k → Fin n
abbreviation OAI.UniformKServer.History line 20
abbrev History (n k : ℕ) := List (Fin n × Fin k)
definition OAI.UniformKServer.serve line 22
def serve {n k : ℕ} (s : Configuration n k) (r : Fin n) (j : Fin k) : Configuration n k := Function.update s j r
definition OAI.UniformKServer.costAlong line 25
def costAlong {n k : ℕ} (d : RationalMetric n) : Configuration n k → History n k → ℝ | _, [] => 0 | s, (r, j) :: h => (d.distance (s j) r : ℝ) + costAlong d (serve s r j) h
definition OAI.UniformKServer.offlineCost line 31
noncomputable def offlineCost {n k : ℕ} (d : RationalMetric n) (s : Configuration n k) (w : List (Fin n)) : ℝ := sInf {c | ∃ h : History n k, h.map Prod.fst = w ∧ c = costAlong d s h}
inductive type OAI.UniformKServer.HeadMove line 35
inductive HeadMove where | left | stay | right deriving DecidableEq
structure OAI.UniformKServer.BitTape line 39
structure BitTape where left : List (Option Bool) head : Option Bool right : List (Option Bool)
definition OAI.UniformKServer.BitTape.blank line 46
def blank : BitTape := ⟨[], none, []⟩
definition OAI.UniformKServer.BitTape.ofWord line 48
def ofWord (w : List Bool) : BitTape := match w with | [] => blank | b :: bs => ⟨[], some b, bs.map some⟩
definition OAI.UniformKServer.BitTape.shift line 53
def shift (T : BitTape) : HeadMove → BitTape | .stay => T | .left => match T.left with | [] => ⟨[], none, T.head :: T.right⟩ | a :: as => ⟨as, a, T.head :: T.right⟩ | .right => match T.right with | [] => ⟨T.head :: T.left, none, []⟩ | a :: as => ⟨T.head :: T.left, a, as⟩
structure OAI.UniformKServer.BitAction line 64
structure BitAction (q m : ℕ) where control : Fin q inputMove : HeadMove write : Fin m → Option Bool workMove : Fin m → HeadMove emit : Option Bool yield : Bool
structure OAI.UniformKServer.BitMachine line 72
structure BitMachine where controls : ℕ tapes : ℕ start : Fin controls transition : Fin controls → Option Bool → (Fin tapes → Option Bool) → Bool → BitAction controls tapes
structure OAI.UniformKServer.MachineState line 79
structure MachineState (M : BitMachine) where control : Fin M.controls input : BitTape work : Fin M.tapes → BitTape outputRev : List Bool yielded : Bool
definition OAI.UniformKServer.BitMachine.initial line 88
def initial (M : BitMachine) (input : List Bool) : MachineState M := ⟨M.start, BitTape.ofWord input, fun _ => BitTape.blank, [], false⟩
definition OAI.UniformKServer.BitMachine.step line 91
def step (M : BitMachine) (s : MachineState M) (coin : Bool) : MachineState M := if s.yielded then s else let a := M.transition s.control s.input.head (fun i => (s.work i).head) coin { control := a.control input := s.input.shift a.inputMove work := fun i => ({s.work i with head := a.write i}).shift (a.workMove i) outputRev := match a.emit with | none => s.outputRev | some b => b :: s.outputRev yielded := a.yield }
definition OAI.UniformKServer.BitMachine.run line 102
def run (M : BitMachine) (s : MachineState M) (coins : List Bool) : MachineState M := coins.foldl M.step s
definition OAI.UniformKServer.BitMachine.install line 107
def install (M : BitMachine) (s : MachineState M) (input : List Bool) : MachineState M := {s with input := BitTape.ofWord input, outputRev := [], yielded := false}
definition OAI.UniformKServer.natCode line 115
def natCode (a : ℕ) : List Bool := List.replicate a.bits.length true ++ [false] ++ a.bits
definition OAI.UniformKServer.rationalCode line 118
def rationalCode (a : ℚ) : List Bool := (a.num < 0) :: (natCode a.num.natAbs ++ natCode a.den)
definition OAI.UniformKServer.instanceCode line 121
def instanceCode {n k : ℕ} (d : RationalMetric n) (s : Configuration n k) : List Bool := natCode n ++ natCode k ++ (List.ofFn fun x : Fin n => (List.ofFn fun y : Fin n => rationalCode (d.distance x y)).flatten).flatten ++ (List.ofFn fun j : Fin k => natCode ((s j).val + 1)).flatten
definition OAI.UniformKServer.bitValue line 127
def bitValue : List Bool → ℕ | [] => 0 | b :: bs => (if b then 1 else 0) + 2 * bitValue bs
definition OAI.UniformKServer.outputValue line 131
def outputValue {M : BitMachine} (s : MachineState M) : ℕ := bitValue s.outputRev.reverse
definition OAI.UniformKServer.polynomialBudget line 136
def polynomialBudget (c e x : ℕ) : ℕ := c * (x + 1)^e
6 more definitions are reached the same way; the full file lists them.