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.UniqueGames.BinaryFormula.Literal line 7
structure Literal where name : Nat positive : Bool deriving DecidableEq
definition OAI.UniqueGames.BinaryFormula.Literal.eval line 12
def Literal.eval (literal : Literal) (assignment : Nat → Bool) : Bool := if literal.positive then assignment literal.name else !(assignment literal.name)
abbreviation OAI.UniqueGames.BinaryFormula.Clause line 15
abbrev Clause := Vector Literal 3
structure OAI.UniqueGames.BinaryFormula.Formula line 20
structure Formula where clauses : List Clause
definition OAI.UniqueGames.BinaryFormula.Formula.Satisfiable line 23
def Formula.Satisfiable (F : Formula) : Prop := ∃ assignment : Nat → Bool, ∀ clause ∈ F.clauses, clause.eval assignment = true
definition OAI.UniqueGames.BinaryEncoding.bitsValue line 32
def bitsValue : List Bool → Nat | [] => 0 | b :: bits => Nat.bit b (bitsValue bits)
definition OAI.UniqueGames.BinaryEncoding.frame line 36
def frame : List Bool → List Bool | [] => [false] | b :: bits => true :: b :: frame bits
definition OAI.UniqueGames.BinaryEncoding.parseFrame line 40
def parseFrame : List Bool → Option (List Bool × List Bool) | false :: rest => some ([], rest) | true :: b :: rest => do let (bits, trailing) ← parseFrame rest return (b :: bits, trailing) | _ => none
definition OAI.UniqueGames.BinaryEncoding.nameBits line 47
def nameBits (name : Nat) : List Bool := frame name.bits
definition OAI.UniqueGames.BinaryEncoding.parseName line 49
def parseName (input : List Bool) : Option (Nat × List Bool) := do let (digits, rest) ← parseFrame input let name := bitsValue digits if digits = name.bits then some (name, rest) else none
definition OAI.UniqueGames.BinaryEncoding.parseLiteral line 54
def parseLiteral : List Bool → Option (Literal × List Bool) | sign :: input => do let (name, rest) ← parseName input return (⟨name, sign⟩, rest) | [] => none
definition OAI.UniqueGames.BinaryEncoding.parseClause line 60
def parseClause (input : List Bool) : Option (Clause × List Bool) := do let (a, input) ← parseLiteral input let (b, input) ← parseLiteral input let (c, rest) ← parseLiteral input return (#v[a, b, c], rest)
definition OAI.UniqueGames.BinaryEncoding.parseClauses line 66
def parseClauses : Nat → List Bool → Option (List Clause × List Bool) | 0, _ => none | _fuel + 1, false :: rest => some ([], rest) | fuel + 1, true :: input => do let (clause, input) ← parseClause input let (clauses, rest) ← parseClauses fuel input return (clause :: clauses, rest) | _ + 1, [] => none
definition OAI.UniqueGames.BinaryEncoding.decodeFormula line 75
def decodeFormula (input : List Bool) : Option Formula := do let (clauses, rest) ← parseClauses (input.length + 1) input if rest = [] then some ⟨clauses⟩ else none
definition OAI.VertexCover.ThreeSAT line 83
def ThreeSAT (input : List Bool) : Prop := ∃ formula, UniqueGames.BinaryEncoding.decodeFormula input = some formula ∧ formula.Satisfiable
structure OAI.VertexCover.ExplicitGraph line 87
structure ExplicitGraph where n : ℕ edges : List (Fin n × Fin n) increasing : ∀ e ∈ edges, e.1 < e.2 nodup : edges.Nodup
definition OAI.VertexCover.ExplicitGraph.Cover line 95
def Cover (G : ExplicitGraph) (S : Finset (Fin G.n)) : Prop := ∀ e ∈ G.edges, e.1 ∈ S ∨ e.2 ∈ S
definition OAI.VertexCover.ExplicitGraph.coverNumber line 101
noncomputable def coverNumber (G : ExplicitGraph) : ℕ := Nat.find (show ∃ k : ℕ, ∃ S : Finset (Fin G.n), G.Cover S ∧ S.card = k from ⟨G.n, Finset.univ, by simp [Cover], by simp⟩)
definition OAI.VertexCover.ExplicitGraph.bits line 105
def bits (G : ExplicitGraph) : List Bool := let names := [G.n] ++ List.range G.n ++ [G.edges.length] ++ G.edges.flatMap (fun e => [e.1.val, e.2.val]) names.flatMap UniqueGames.BinaryEncoding.nameBits
definition OAI.VertexCover.FiniteAlphabet line 112
def FiniteAlphabet (M : Turing.FinTM2) : Prop := ∀ k, Finite (M.Γ k)
structure OAI.VertexCover.GapReduction line 114
structure GapReduction (m : ℕ) where
Show the remaining 10 lines
construct : List Bool → ExplicitGraph computation : Turing.TM2ComputableInPolyTime (id : List Bool → List Bool) ExplicitGraph.bits construct finiteAlphabet : FiniteAlphabet computation.tm completeness : ∀ input, ThreeSAT input → ((construct input).coverNumber : ℝ) < (1 / 2 + 1 / (m : ℝ)) * (construct input).n soundness : ∀ input, ¬ ThreeSAT input → (1 - 1 / (m : ℝ)) * (construct input).n < ((construct input).coverNumber : ℝ)
definition OAI.VertexCover.natListBits line 126
def natListBits (L : List ℕ) : List Bool := (L.length :: L).flatMap UniqueGames.BinaryEncoding.nameBits
structure OAI.VertexCover.Approximation line 129
structure Approximation (α : ℝ) where run : ExplicitGraph → List ℕ computation : Turing.TM2ComputableInPolyTime ExplicitGraph.bits natListBits run finiteAlphabet : FiniteAlphabet computation.tm nodup : ∀ G, (run G).Nodup vertices : ∀ G, ∀ v ∈ run G, v < G.n covers : ∀ G, ∀ e ∈ G.edges, e.1.val ∈ run G ∨ e.2.val ∈ run G quality : ∀ G, ((run G).length : ℝ) ≤ α * (G.coverNumber : ℝ)
structure OAI.VertexCover.ThreeSATDecision line 138
structure ThreeSATDecision where run : List Bool → Bool computation : Turing.TM2ComputableInPolyTime (id : List Bool → List Bool) (fun b : Bool => [b]) run finiteAlphabet : FiniteAlphabet computation.tm correct : ∀ input, run input = true ↔ ThreeSAT input