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.
inductive type OAI.RationalHitting.Formula line 9
inductive Formula (n : ℕ) where | var : Fin n → Formula n | const : ℚ → Formula n | add : Formula n → Formula n → Formula n | mul : Formula n → Formula n → Formula n | inv : Formula n → Formula n deriving DecidableEq
definition OAI.RationalHitting.Formula.size line 19
def size {n : ℕ} : Formula n → ℕ | .var _ | .const _ => 1 | .add f g | .mul f g => f.size + g.size + 1 | .inv f => f.size + 1
inductive type OAI.RationalHitting.Formula.Eval line 26
inductive Eval {n : ℕ} {R : Type u} [Ring R] (c : ℚ →+* R) (X : Fin n → R) : Formula n → R → Prop where | var (i) : Eval c X (.var i) (X i) | const (a) : Eval c X (.const a) (c a) | add {f g a b} : Eval c X f a → Eval c X g b → Eval c X (.add f g) (a + b) | mul {f g a b} : Eval c X f a → Eval c X g b → Eval c X (.mul f g) (a * b) | inv {f a b} : Eval c X f a → a * b = 1 → b * a = 1 → Eval c X (.inv f) b
abbreviation OAI.RationalHitting.Mat line 36
abbrev Mat (d : ℕ) := Matrix (Fin d) (Fin d) ℚ
abbreviation OAI.RationalHitting.Tuple line 37
abbrev Tuple (n d : ℕ) := Fin n → Mat d
definition OAI.RationalHitting.Evaluates line 39
def Evaluates {n d : ℕ} (f : Formula n) (X : Tuple n d) (v : Mat d) : Prop := f.Eval (algebraMap ℚ (Mat d)) X v
definition OAI.RationalHitting.Admissible line 42
def Admissible {n : ℕ} (f : Formula n) : Prop := ∃ d, 0 < d ∧ ∃ (X : Tuple n d), ∃ v, Evaluates f X v
definition OAI.RationalHitting.Nonzero line 45
def Nonzero {n : ℕ} (f : Formula n) : Prop := ∃ d, 0 < d ∧ ∃ (X : Tuple n d), ∃ v, Evaluates f X v ∧ v ≠ 0
structure OAI.RationalHitting.Output line 49
structure Output (n : ℕ) where dimension : ℕ dimension_pos : 0 < dimension tuples : List (Tuple n dimension)
definition OAI.RationalHitting.encodeNat line 56
def encodeNat (a : ℕ) : List Bool := let ds := (Nat.digits 2 a).map (fun b => b != 0) List.replicate ds.length true ++ [false] ++ ds
definition OAI.RationalHitting.encodeRat line 62
def encodeRat (a : ℚ) : List Bool := [decide (a.num < 0)] ++ encodeNat a.num.natAbs ++ encodeNat a.den
definition OAI.RationalHitting.encodeTuple line 65
def encodeTuple {n d : ℕ} (X : Tuple n d) : List Bool := (List.finRange n).flatMap fun i => (List.finRange d).flatMap fun j => (List.finRange d).flatMap fun k => encodeRat (X i j k)
definition OAI.RationalHitting.encodeOutput line 70
def encodeOutput {n : ℕ} (H : Output n) : List Bool := encodeNat H.dimension ++ encodeNat H.tuples.length ++ H.tuples.flatMap encodeTuple
abbreviation OAI.RationalHitting.Alphabet line 75
abbrev Alphabet := Fin 4
abbreviation OAI.RationalHitting.Machine line 76
abbrev Machine (m : ℕ) := Turing.TM0.Machine Alphabet (Fin (m + 1))
abbreviation OAI.RationalHitting.Config line 77
abbrev Config (m : ℕ) := Turing.TM0.Cfg Alphabet (Fin (m + 1))
definition OAI.RationalHitting.tapeBit line 79
def tapeBit (b : Bool) : Alphabet := if b then 2 else 1
definition OAI.RationalHitting.unaryInput line 81
def unaryInput (n s : ℕ) : List Alphabet := List.replicate n 2 ++ [1] ++ List.replicate s 2
definition OAI.RationalHitting.run line 85
def run {m : ℕ} (G : Machine m) : ℕ → Config m → Option (Config m) | 0, a => some a | t + 1, a => (Turing.TM0.step G a).bind (run G t)
definition OAI.RationalHitting.OutputsWithin line 89
def OutputsWithin {m n : ℕ} (G : Machine m) (s bound : ℕ) (H : Output n) : Prop := ∃ t ≤ bound, ∃ a : Config m, run G t (Turing.TM0.init (unaryInput n s)) = some a ∧ Turing.TM0.step G a = none ∧ a.Tape.right₀ = Turing.ListBlank.mk ((encodeOutput H).map tapeBit)
definition OAI.RationalHitting.Hits line 95
def Hits {n : ℕ} (s : ℕ) (H : Output n) : Prop := ∀ f : Formula n, f.size ≤ s → Admissible f → Nonzero f → ∃ X ∈ H.tuples, ∃ v, Evaluates f X v ∧ IsUnit v