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.MaxCutGames.BinaryFormula.Literal line 7
structure Literal where name : Nat positive : Bool deriving DecidableEq
definition OAI.MaxCutGames.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.MaxCutGames.BinaryFormula.Clause line 15
abbrev Clause := Vector Literal 3
structure OAI.MaxCutGames.BinaryFormula.Formula line 22
structure Formula where clauses : List Clause
definition OAI.MaxCutGames.BinaryFormula.Formula.Satisfiable line 25
def Formula.Satisfiable (F : Formula) : Prop := ∃ assignment : Nat → Bool, ∀ clause ∈ F.clauses, clause.eval assignment = true
definition OAI.MaxCutGames.BinaryEncoding.bitsValue line 34
def bitsValue : List Bool → Nat | [] => 0 | b :: bits => Nat.bit b (bitsValue bits)
definition OAI.MaxCutGames.BinaryEncoding.frame line 39
def frame : List Bool → List Bool | [] => [false] | b :: bits => true :: b :: frame bits
definition OAI.MaxCutGames.BinaryEncoding.parseFrame line 43
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.MaxCutGames.BinaryEncoding.nameBits line 50
def nameBits (name : Nat) : List Bool := frame name.bits
definition OAI.MaxCutGames.BinaryEncoding.parseName line 53
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.MaxCutGames.BinaryEncoding.parseLiteral line 58
def parseLiteral : List Bool → Option (Literal × List Bool) | sign :: input => do let (name, rest) ← parseName input return (⟨name, sign⟩, rest) | [] => none
definition OAI.MaxCutGames.BinaryEncoding.parseClause line 64
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.MaxCutGames.BinaryEncoding.parseClauses line 71
def parseClauses : Nat → List Bool → Option (List Clause × List Bool) | 0, _ => none | _ + 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.MaxCutGames.BinaryEncoding.decodeFormula line 80
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.OptimalMaxCut.alphaGW line 91
noncomputable def alphaGW : ℝ := sInf ((fun ρ : ℝ => 2 * Real.arccos ρ / (Real.pi * (1 - ρ))) '' Set.Ico (-1 : ℝ) 1)
definition OAI.OptimalMaxCut.binary3SAT line 96
def binary3SAT (input : List Bool) : Prop := ∃ formula, MaxCutGames.BinaryEncoding.decodeFormula input = some formula ∧ formula.Satisfiable
structure OAI.OptimalMaxCut.Graph line 101
structure Graph where vertices : ℕ adj : Fin vertices → Fin vertices → Bool symmetric : ∀ u v, adj u v = adj v u loopless : ∀ u, adj u u = false
definition OAI.OptimalMaxCut.Graph.cutSize line 108
def Graph.cutSize (G : Graph) (cut : Fin G.vertices → Bool) : ℕ := ∑ u : Fin G.vertices, ∑ v : Fin G.vertices, if u < v ∧ G.adj u v = true ∧ cut u ≠ cut v then 1 else 0
definition OAI.OptimalMaxCut.Graph.maxCut line 113
def Graph.maxCut (G : Graph) : ℕ := (Finset.univ.image G.cutSize).sup id
structure OAI.OptimalMaxCut.ScaledGraph line 118
structure ScaledGraph where graph : Graph scale : ℕ scale_pos : 0 < scale
definition OAI.OptimalMaxCut.ScaledGraph.bits line 125
def ScaledGraph.bits (G : ScaledGraph) : List Bool := MaxCutGames.BinaryEncoding.nameBits G.graph.vertices ++ MaxCutGames.BinaryEncoding.nameBits G.scale ++ (List.finRange G.graph.vertices).flatMap (fun u => (List.finRange G.graph.vertices).map (fun v => G.graph.adj u v))
structure OAI.OptimalMaxCut.GapReduction line 133
structure GapReduction (α : ℝ) where
Show the remaining 13 lines
yesBound : ℚ noBound : ℚ yes_pos : 0 < yesBound no_nonneg : 0 ≤ noBound gap : (noBound : ℝ) < α * (yesBound : ℝ) construct : List Bool → ScaledGraph computation : Turing.TM2ComputableInPolyTime (id : List Bool → List Bool) ScaledGraph.bits construct finiteAlphabet : ∀ k, Finite (computation.tm.Γ k) completeness : ∀ input, binary3SAT input → (yesBound : ℝ) ≤ ((construct input).graph.maxCut : ℝ) / (construct input).scale soundness : ∀ input, ¬ binary3SAT input → ((construct input).graph.maxCut : ℝ) / (construct input).scale ≤ (noBound : ℝ)