/- Copyright (c) 2026 Anthropic, PBC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. SPDX-License-Identifier: Apache-2.0 -/ import Mathlib /-! # Superpolynomial lower bounds for the permanent and the Hamiltonian cycle polynomial Definitions and statements, using Mathlib only. The proofs are in Solution.lean. -/ open MvPolynomial universe u namespace Statement /-- `f` has an arithmetic circuit with at most `s` gates: a list of `s` polynomials contains `f`, and each of them is a variable, a constant, or the sum or product of two earlier ones (possibly the same one). Variables and constants count as gates. -/ def Computes {R : Type u} {V : Type} [CommSemiring R] (f : MvPolynomial V R) (s : ℕ) : Prop := ∃ l : ℕ → MvPolynomial V R, (∀ k < s, (∃ v : V, l k = X v) ∨ (∃ a : R, l k = C a) ∨ (∃ i < k, ∃ j < k, l k = l i + l j) ∨ (∃ i < k, ∃ j < k, l k = l i * l j)) ∧ ∃ k < s, l k = f /-- The permanent of the generic `m × m` matrix. -/ noncomputable def perm (F : Type u) [CommSemiring F] (m : ℕ) : MvPolynomial (Fin m × Fin m) F := ∑ σ : Equiv.Perm (Fin m), ∏ i, X (σ i, i) open Classical in /-- The Hamiltonian cycle polynomial: the sum over the permutations with a single cycle through all points. -/ noncomputable def hc (F : Type u) [CommSemiring F] (m : ℕ) : MvPolynomial (Fin m × Fin m) F := ∑ σ : Equiv.Perm (Fin m) with σ.IsCycleOn Set.univ, ∏ i, X (i, σ i) /-- More than `m ^ (c * (log₂ m) ^ (1/3))` gates. -/ def Beyond (c : ℝ) (m s : ℕ) : Prop := (m : ℝ) ^ (c * Real.logb 2 m ^ (1 / 3 : ℝ)) < s /-- **Main theorem.** There is an absolute constant `c > 0`, and for each characteristic `p` an `m₀`, such that over every field of characteristic `p` and for every `m ≥ m₀` every circuit for `hc m`, and for `perm m` if `p ≠ 2`, has more than `m ^ (c * (log₂ m) ^ (1/3))` gates. -/ def MainTheorem : Prop := ∃ c : ℝ, 0 < c ∧ ∀ p : ℕ, ∃ m₀ : ℕ, ∀ (F : Type u) [Field F] [CharP F p], ∀ m ≥ m₀, ∀ s : ℕ, (Computes (hc F m) s → Beyond c m s) ∧ (p ≠ 2 → Computes (perm F m) s → Beyond c m s) /-! ### Approximate circuits -/ /-- `f` is approximated by a circuit with at most `s` gates: a circuit over the Laurent series in `ε` computes some `q = f + ε * g`, where the coefficients of `g` are power series in `ε`. Here `a.coeff i` is the coefficient of `ε ^ i` in the series `a`. -/ def Approximates {F : Type u} {V : Type} [Field F] (f : MvPolynomial V F) (s : ℕ) : Prop := ∃ q : MvPolynomial V (LaurentSeries F), Computes q s ∧ ∀ (d : V →₀ ℕ) (i : ℤ), i ≤ 0 → (coeff d q).coeff i = if i = 0 then coeff d f else 0 /-- **Main theorem, approximate form.** The same bound, for circuits that only approximate. -/ def MainTheoremApprox : Prop := ∃ c : ℝ, 0 < c ∧ ∀ p : ℕ, ∃ m₀ : ℕ, ∀ (F : Type u) [Field F] [CharP F p], ∀ m ≥ m₀, ∀ s : ℕ, (Approximates (hc F m) s → Beyond c m s) ∧ (p ≠ 2 → Approximates (perm F m) s → Beyond c m s) /-! ### Valiant's classes -/ /-- A family of polynomials, with finitely many variables for every `n`. -/ structure Family (F : Type u) [CommSemiring F] where /-- the variables of the `n`-th polynomial -/ vars : ℕ → Type /-- finitely many -/ [fin : ∀ n, Fintype (vars n)] /-- the `n`-th polynomial -/ poly : ∀ n, MvPolynomial (vars n) F attribute [instance] Family.fin /-- VP: the number of variables, the degree and the circuit size are polynomially bounded in `n`. -/ def VP (F : Type u) [CommSemiring F] : Set (Family F) := {f | ∃ a : ℕ, ∀ n, Fintype.card (f.vars n) ≤ n ^ a + a ∧ (f.poly n).totalDegree ≤ n ^ a + a ∧ Computes (f.poly n) (n ^ a + a)} /-- The closure of VP: the same with approximating circuits. -/ def VPBar (F : Type u) [Field F] : Set (Family F) := {f | ∃ a : ℕ, ∀ n, Fintype.card (f.vars n) ≤ n ^ a + a ∧ (f.poly n).totalDegree ≤ n ^ a + a ∧ Approximates (f.poly n) (n ^ a + a)} /-- VNP: the families `f n = ∑ g n (x, e)`, as polynomials, the sum over all vectors `e` of `r n` bits, for some family `g` in VP. -/ def VNP (F : Type u) [CommSemiring F] : Set (Family F) := {f | ∃ (r : ℕ → ℕ) (g : ∀ n, MvPolynomial (f.vars n ⊕ Fin (r n)) F), ({ vars := fun n => f.vars n ⊕ Fin (r n), poly := g } : Family F) ∈ VP F ∧ ∀ n, f.poly n = ∑ e : Fin (r n) → Bool, aeval (Sum.elim X fun i => if e i then 1 else 0) (g n)} /-- **VP ≠ VNP**: over every field VP is a proper subset of VNP. -/ def Separation : Prop := ∀ (F : Type u) [Field F], VP F ⊂ VNP F /-- Over every field VNP is not contained in the closure of VP. -/ def SeparationClosure : Prop := ∀ (F : Type u) [Field F], ¬ VNP F ⊆ VPBar F end Statement