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.MatchingFPRAS.Symbol line 7
abbrev Symbol := Fin 8
definition OAI.MatchingFPRAS.encodeNat line 10
def encodeNat (n : ℕ) : List Symbol := (Nat.bits n).map (fun b => if b then 2 else 1) ++ [3]
definition OAI.MatchingFPRAS.encodeInt line 13
def encodeInt (z : ℤ) : List Symbol := (if z < 0 then [5] else [4]) ++ encodeNat z.natAbs
definition OAI.MatchingFPRAS.encodeRat line 17
def encodeRat (q : ℚ) : List Symbol := encodeInt q.num ++ encodeNat q.den
structure OAI.MatchingFPRAS.RandomMachine line 20
structure RandomMachine where states : ℕ transition : Fin (states + 1) → Symbol → Bool → Option (Fin (states + 1) × Turing.TM0.Stmt Symbol)
structure OAI.MatchingFPRAS.Configuration line 25
structure Configuration (A : RandomMachine) where state : Option (Fin (A.states + 1)) tape : Turing.Tape Symbol
definition OAI.MatchingFPRAS.tick line 31
def tick (A : RandomMachine) (c : Configuration A) (bit : Bool) : Configuration A := match c.state with | none => c | some s => match A.transition s c.tape.head bit with | none => ⟨none, c.tape⟩ | some (s', action) => ⟨some s', match action with | .move d => c.tape.move d | .write a => c.tape.write a⟩
definition OAI.MatchingFPRAS.initial line 41
def initial (A : RandomMachine) (input : List Symbol) : Configuration A := ⟨some 0, Turing.Tape.mk₁ input⟩
definition OAI.MatchingFPRAS.run line 45
def run (A : RandomMachine) (input : List Symbol) {t : ℕ} (bits : Fin t → Bool) : Configuration A := (List.ofFn bits).foldl (tick A) (initial A input)
definition OAI.MatchingFPRAS.Outputs line 49
def Outputs (A : RandomMachine) (input : List Symbol) {t : ℕ} (bits : Fin t → Bool) (q : ℚ) : Prop := (run A input bits).state = none ∧ (run A input bits).tape.right₀ = Turing.ListBlank.mk (encodeRat q)
definition OAI.ContingencyTables.HasMargins line 61
def HasMargins (X : I → J → ℕ) (r : I → ℕ) (c : J → ℕ) : Prop := (∀ i, ∑ j, X i j = r i) ∧ (∀ j, ∑ i, X i j = c j)
definition OAI.ContingencyTables.Table line 64
def Table (r : I → ℕ) (c : J → ℕ) := {X : I → J → ℕ // HasMargins X r c}
definition OAI.ContingencyTables.BoundedTable line 66
def BoundedTable (r : I → ℕ) (c : J → ℕ) (b : I → J → ℕ) := {X : Table r c // ∀ i j, X.val i j ≤ b i j}
abbreviation OAI.ContingencyTables.Algorithms.Machine line 103
abbrev Machine := MatchingFPRAS.RandomMachine
definition OAI.ContingencyTables.Algorithms.encodeMatrix line 106
def encodeMatrix {m n : ℕ} (X : Fin m → Fin n → ℕ) : List Symbol := ((List.ofFn fun i => (List.ofFn fun j => MatchingFPRAS.encodeNat (X i j)).flatten)).flatten
definition OAI.ContingencyTables.Algorithms.encodeMargins line 109
def encodeMargins {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) : List Symbol := MatchingFPRAS.encodeNat m ++ MatchingFPRAS.encodeNat n ++ (List.ofFn fun i => MatchingFPRAS.encodeNat (r i)).flatten ++ (List.ofFn fun j => MatchingFPRAS.encodeNat (c j)).flatten
definition OAI.ContingencyTables.Algorithms.encodeSamplingInput line 114
def encodeSamplingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (k : ℕ) : List Symbol := encodeMargins r c ++ MatchingFPRAS.encodeNat k
definition OAI.ContingencyTables.Algorithms.encodeCountingInput line 117
def encodeCountingInput {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : List Symbol := encodeMargins r c ++ encodeMatrix b ++ MatchingFPRAS.encodeRat ε ++ MatchingFPRAS.encodeRat δ
definition OAI.ContingencyTables.Algorithms.OutputsTable line 125
def OutputsTable (A : Machine) (input : List Symbol) {t m n : ℕ} (bits : Fin t → Bool) (X : Fin m → Fin n → ℕ) : Prop := (MatchingFPRAS.run A input bits).state = none ∧ @Turing.Tape.right₀ MatchingFPRAS.Symbol (@Fin.instInhabited 8 alphabetSize_neZero) (MatchingFPRAS.run A input bits).tape = @Turing.ListBlank.mk Symbol (@Fin.instInhabited 8 alphabetSize_neZero) (encodeMatrix X)
definition OAI.ContingencyTables.Algorithms.tableMass line 132
noncomputable def tableMass (A : Machine) (input : List Symbol) (t : ℕ) {m n : ℕ} (X : Fin m → Fin n → ℕ) : ℝ := by classical exact ((Finset.univ.filter fun bits : Fin t → Bool => OutputsTable A input bits X).card : ℝ) / (2 : ℝ) ^ t
definition OAI.ContingencyTables.Algorithms.haltMass line 138
noncomputable def haltMass (A : Machine) (input : List Symbol) (t : ℕ) : ℝ := by classical exact ((Finset.univ.filter fun bits : Fin t → Bool => (MatchingFPRAS.run A input bits).state = none).card : ℝ) / (2 : ℝ) ^ t
definition OAI.ContingencyTables.Algorithms.samplingSize line 143
def samplingSize (n : ℕ) {m : ℕ} (r : Fin m → ℕ) (k : ℕ) : ℕ := m + n + Nat.clog 2 ((∑ i, r i) + 1) + k + 1
definition OAI.ContingencyTables.Algorithms.count line 176
noncomputable def count {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ) : ℕ := Fintype.card (BoundedTable r c b)
definition OAI.ContingencyTables.Algorithms.countingTime line 179
def countingTime (C d : ℕ) {m n : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ) (b : Fin m → Fin n → ℕ) (ε δ : ℚ) : ℕ := C * ((encodeCountingInput r c b ε δ).length + ⌈ε⁻¹⌉₊ + Nat.clog 2 ⌈δ⁻¹⌉₊ + 1) ^ d
1 more definitions are reached the same way; the full file lists them.