Lean / anthropics/formal-math / Solution.lean
Lean reader

vp-vnp/Solution.lean

56 lines7 declarationsno sorryimports Statement Paper.Approximate

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports Statement, Paper.Approximate, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. /-
  2. Copyright (c) 2026 Anthropic, PBC. All rights reserved.
  3. Released under Apache 2.0 license as described in the file LICENSE.
  4. SPDX-License-Identifier: Apache-2.0
  5. -/
  6. import Statement
  7. import Paper.Approximate
  8. /-!
  9. # Proofs of the statements, each from the theorem of the paper with that statement
  10. -/
  11. namespace Solution
  12. open Statement
  13. universe u
  14. /-- The classes of the statement are those of the proof. -/
  15. def toNc {F : Type u} [CommSemiring F] (f : Family F) : Nc.Family F := { X := f.vars, fin := f.fin, poly := f.poly }
  16. /-- And conversely. -/
  17. def ofNc {F : Type u} [CommSemiring F] (f : Nc.Family F) : Family F := { vars := f.X, fin := f.fin, poly := f.poly }
  18. /-- The main theorem (Theorem thm:allfields). -/
  19. theorem mainTheorem : MainTheorem.{u} := by
  20. obtain ⟨c, hc, h⟩ := Paper.thm_allfields.{u}
  21. refine ⟨c, hc, fun p => ?_⟩
  22. by_cases hp : p = 0 ∨ p.Prime
  23. · exact h p hp
  24. · exact ⟨0, fun F _ _ => absurd (CharP.char_is_prime_or_zero F p).symm hp⟩
  25. /-- VP is a proper subset of VNP over every field (Corollary cor:allclasses). -/
  26. theorem separation : Separation.{u} := fun F _ =>
  27. ⟨fun f hf => ((Paper.cor_allclasses F).1 (hf : toNc f ∈ Nc.VP F) : toNc f ∈ Nc.VNP F),
  28. fun h => (Paper.cor_allclasses F).2 fun g hg => (h (a := ofNc g) hg : ofNc g ∈ VP F)⟩
  29. /-- The main theorem for approximate circuits (Theorem thm:approx). -/
  30. theorem mainTheoremApprox : MainTheoremApprox.{u} := by
  31. obtain ⟨c, hc, h⟩ := Paper.thm_approx.{u}.1
  32. refine ⟨c, hc, fun p => ?_⟩
  33. by_cases hp : p = 0 ∨ p.Prime
  34. · exact h p hp
  35. · exact ⟨0, fun F _ _ => absurd (CharP.char_is_prime_or_zero F p).symm hp⟩
  36. /-- Over every field VNP is not contained in the closure of VP (Theorem thm:approx). -/
  37. theorem separationClosure : SeparationClosure.{u} := fun F _ h =>
  38. Paper.thm_approx.{u}.2 F fun g hg => (h (a := ofNc g) hg : ofNc g ∈ VPBar F)
  39. /-- The special case in the main text of the paper: the real numbers and the permanent (Theorem thm:main). -/
  40. theorem permanent_over_real : ∃ c : ℝ, 0 < c ∧ ∃ m₀ : ℕ, ∀ m ≥ m₀, ∀ s : ℕ,
  41. Computes (perm ℝ m) s → Beyond c m s :=
  42. Paper.thm_main
  43. end Solution