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.
abbreviation OAI.ExactDerandomization.Word line 9
abbrev Word := List Bool
abbreviation OAI.ExactDerandomization.Language line 10
abbrev Language := Set Word
abbreviation OAI.ExactDerandomization.CoinTape line 11
abbrev CoinTape := ℕ → Bool
inductive type OAI.ExactDerandomization.Direction line 13
inductive Direction where | left | stay | right deriving DecidableEq
inductive type OAI.ExactDerandomization.InputSymbol line 17
inductive InputSymbol where | leftMarker | bit (b : Bool) | rightMarker deriving DecidableEq
definition OAI.ExactDerandomization.Direction.move line 21
def Direction.move (d : Direction) (z : ℤ) : ℤ := match d with | .left => z - 1 | .stay => z | .right => z + 1
definition OAI.ExactDerandomization.Direction.moveInput line 27
def Direction.moveInput (d : Direction) {n : ℕ} (i : Fin (n + 2)) : Fin (n + 2) := match d with | .left => ⟨i.val - 1, lt_of_le_of_lt (Nat.sub_le _ _) i.isLt⟩ | .stay => i | .right => ⟨min (i.val + 1) (n + 1), by omega⟩
definition OAI.ExactDerandomization.readInput line 33
def readInput (x : Word) (i : Fin (x.length + 2)) : InputSymbol := if i.val = 0 then .leftMarker else match x[i.val - 1]? with | some b => .bit b | none => .rightMarker
structure OAI.ExactDerandomization.Action line 39
structure Action (q w h : ℕ) where nextState : Fin (q + 1) write : Fin w → Bool workMove : Fin w → Direction inputMove : Fin h → Direction
structure OAI.ExactDerandomization.Machine line 45
structure Machine (q w h : ℕ) where initialState : Fin (q + 1) output : Fin (q + 1) → Option Bool transition : Fin (q + 1) → (Fin h → InputSymbol) → (Fin w → Bool) → Bool → Action q w h
structure OAI.ExactDerandomization.Configuration line 51
structure Configuration (q w h n : ℕ) where state : Fin (q + 1) inputPos : Fin h → Fin (n + 2) workPos : Fin w → ℤ work : Fin w → ℤ → Bool
definition OAI.ExactDerandomization.Machine.initial line 61
def initial (M : Machine q w h) (n : ℕ) : Configuration q w h n where state := M.initialState inputPos := fun _ => ⟨0, by omega⟩ workPos := fun _ => 0 work := fun _ _ => false
definition OAI.ExactDerandomization.Machine.step line 67
def step (M : Machine q w h) (x : Word) (b : Bool) (c : Configuration q w h x.length) : Configuration q w h x.length :=
Show the remaining 9 lines
match M.output c.state with | some _ => c | none => let a := M.transition c.state (fun j => readInput x (c.inputPos j)) (fun k => c.work k (c.workPos k)) b { state := a.nextState inputPos := fun j => (a.inputMove j).moveInput (c.inputPos j) workPos := fun k => (a.workMove k).move (c.workPos k) work := fun k => Function.update (c.work k) (c.workPos k) (a.write k) }
definition OAI.ExactDerandomization.Machine.run line 79
def run (M : Machine q w h) (x : Word) (coins : CoinTape) : ℕ → Configuration q w h x.length | 0 => M.initial x.length | t + 1 => M.step x (coins t) (M.run x coins t)
definition OAI.ExactDerandomization.Machine.spaceThrough line 84
def spaceThrough (M : Machine q w h) (x : Word) (coins : CoinTape) (t : ℕ) : ℕ := ∑ k : Fin w, ((Finset.range (t + 1)).image (fun s => (M.run x coins s).workPos k)).card
definition OAI.ExactDerandomization.Machine.LogSpace line 88
def LogSpace (M : Machine q w h) : Prop := ∃ c : ℕ, 0 < c ∧ ∀ (x : Word) (coins : CoinTape) (t : ℕ), M.spaceThrough x coins t ≤ c * Nat.clog 2 (x.length + 2)
definition OAI.ExactDerandomization.Machine.Deterministic line 92
def Deterministic (M : Machine q w h) : Prop := ∀ s i v, M.transition s i v false = M.transition s i v true
definition OAI.ExactDerandomization.Machine.HaltsBy line 95
def HaltsBy (M : Machine q w h) (x : Word) (t : ℕ) : Prop := ∀ coins : CoinTape, ∃ b : Bool, M.output (M.run x coins t).state = some b
definition OAI.ExactDerandomization.Machine.Decides line 98
def Decides (M : Machine q w h) (A : Language) : Prop := ∀ x : Word, ∃ (t : ℕ) (b : Bool), (b = true ↔ x ∈ A) ∧ ∀ coins : CoinTape, M.output (M.run x coins t).state = some b
definition OAI.ExactDerandomization.Machine.extendCoins line 103
def extendCoins {t : ℕ} (bits : Fin t → Bool) : CoinTape := fun s => if hs : s < t then bits ⟨s, hs⟩ else false
definition OAI.ExactDerandomization.Machine.acceptanceProbability line 106
def acceptanceProbability (M : Machine q w h) (x : Word) (t : ℕ) : ℚ := ((Finset.univ.filter (fun bits : Fin t → Bool => M.output (M.run x (extendCoins bits) t).state = some true)).card : ℚ) / (2 : ℚ) ^ t
definition OAI.ExactDerandomization.polynomialClock line 113
def polynomialClock (c k n : ℕ) : ℕ := c * (n + 2) ^ k
definition OAI.ExactDerandomization.L line 115
def L : Set Language := {A | ∃ (q w h : ℕ) (M : Machine q w h), M.Deterministic ∧ M.LogSpace ∧ M.Decides A}
definition OAI.ExactDerandomization.RL line 119
def RL : Set Language := {A | ∃ (q w h : ℕ) (M : Machine q w h), M.LogSpace ∧ ∃ (c k : ℕ), 0 < c ∧ ∀ x : Word, M.HaltsBy x (polynomialClock c k x.length) ∧ (x ∈ A → (1 / 2 : ℚ) ≤ M.acceptanceProbability x (polynomialClock c k x.length)) ∧ (x ∉ A → M.acceptanceProbability x (polynomialClock c k x.length) = 0)}
1 more definitions are reached the same way; the full file lists them.
Comparator compares only the name and type of each definition listed here. When a theorem is configured, its proof uses the definition in OpenAI’s solution library. Read that definition as well as the one in this file when comparing the statement with the paper.