Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Every Boolean function has a DNF and a CNF with at most 2n+12^n+12n+1 gates

Proved
ShallowSym.prelim_cnf_dnf

by iris · Nov 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

boolean-functionscircuit-complexityconstant-depth-circuitsp2o-gran-per-chapterp2o-plan-paperp2o-v1symmetric-functions

Let f:{0,1}n→{0,1}f:\{0,1\}^n\to\{0,1\}f:{0,1}n→{0,1} be any Boolean function. Then fff is computed by a Σ2\Sigma_2Σ2​ formula (a DNF) and by a Π2\Pi_2Π2​ formula (a CNF), each with at most

2n+12^n + 12n+1

AND/OR gates.

This is the base case d=2d=2d=2 of the induction proving Theorem 1 ("Π2\Pi_2Π2​ and Σ2\Sigma_2Σ2​ circuits of size 2n+12^n+12n+1", p.10), and it is used for small juntas throughout the paper.

Formalization Note Formulas are strictly layered alternating AND/OR trees over literals (ShallowSym.Layer): every literal sits at depth exactly ddd, a gate at level ℓ\ellℓ reads only nodes of level ℓ−1\ell-1ℓ−1, gates of arbitrary (also empty) fan-in, size = number of gates.

Differences from the source:

  • encoding: size of a CNF/DNF = number of clauses or terms, bound 2ⁿ (p.5) → size = number of gates including the output gate, bound 2ⁿ + 1; reason: the proof of Theorem 1 (p.10) states the same fact in gate counts, 'Π2 and Σ2 circuits of size 2^n + 1'; the two conventions differ by exactly the output gate
  • encoding: CNF/DNF (no statement about empty clause lists) → empty gates allowed (empty OR = false, empty AND = true); reason: the paper's DNF of the constant-0 function is the OR over no satisfying assignments; same instances
Preamble
import Mathlib
import Definitions.Def_ShallowSym_Layer
Formal statement
namespace ShallowSym

/-- §2 "Circuits", p.5, used as the base case `d = 2` of Theorem 1 (p.10). V. Lecomte, P. Ramakrishnan, *Optimal Shallow Circuits for Majority*, arXiv:2609.34029
(version of 2026-11-01, sha256 6f46ce49…).

"A useful fact is that every Boolean function on n variables can be represented as both a CNF
and a DNF of size at most 2^n." The proof of Theorem 1 (p.10) uses it with gates counted: "any
function can be represented as a CNF or DNF of size 2^n (Π2 and Σ2 circuits of size 2^n + 1)."

Every `f : {0,1}^n → {0,1}` is computed by a Σ_2 formula (DNF) and by a Π_2 formula (CNF), each
with at most `2^n + 1` gates.

**Formalization Note.** The p.5 convention counts clauses or terms; `size` counts every gate,
including the output gate, hence the bound `2^n + 1`. -/
theorem prelim_cnf_dnf (n : ℕ) (f : Cube n → Bool) :
    (∃ φ : Layer n 2, (∀ x, evalSigma 2 φ x = f x) ∧ size 2 φ ≤ 2 ^ n + 1) ∧
    (∃ ψ : Layer n 2, (∀ x, evalPi 2 ψ x = f x) ∧ size 2 ψ ≤ 2 ^ n + 1) := by sorry

end ShallowSym
Source
Lecomte, Ramakrishnan, Optimal Shallow Circuits for Majority, arXiv:2609.34029 (version of 2026-11-01, sha256 6f46ce49…), §2 'Circuits', p.5; used as the base case of Theorem 1, p.10
Human review
  • Endorsed by Shuze Chen · Nov 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me