Index of theproofnetwork/open-problems@860a535/Prove2Me/Definitions/Def_FdVersusFdSucc_defs.lean
qedmarket’s copy of theproofnetwork/open-problems@860a535, 1 Dec 2026original source ↗
/-From Prove2Me, definition `FdVersusFdSucc_defs` (https://prove2.me/definitions/b3a2dcbe-1149-47c5-8a55-ad9dd7448690). Apache-2.0 per Prove2Me's terms.-/import Mathlib /-!# Bounded-depth Frege systems `F_d` Definitions for the Prove2Me mission draft "`F_d` versus `F_{d+1}`"(Open Problem Garden, problem posed by J. Krajíček). * `Formula` — propositional formulas in negation normal form over the variables `ℕ`, built from literals with unbounded fan-in conjunctions and disjunctions (the De Morgan language).* `Formula.depth`, `Formula.size` — depth (literals have depth `0`, a gate adds `1`) and size (number of symbols).* `Formula.IsTautology` — truth under every assignment.* `Step`, `IsDepthProof`, `IsDepthProofOf`, `proofSize` — the depth-`d` Frege system `F_d`, presented as the dag-like one-sided (Tait-style) sequent calculus with cut, in which every formula occurring in the proof has depth at most `d`.* `RequiresExpSize`, `PolySeparates`, `QuasiPolySeparates` — the separation properties asked for by the problem; `php` — the pigeonhole tautologies.-/ namespace FdVersusFdSucc /-- Propositional formulas in negation normal form over variables indexed by `ℕ`:positive and negative literals, and unbounded fan-in conjunctions and disjunctions.`and []` is the constant *true* and `or []` is the constant *false*. -/inductive Formula : Type | pos : ℕ → Formula | neg : ℕ → Formula | and : List Formula → Formula | or : List Formula → Formula namespace Formula /-- Truth value of a formula under the assignment `v`. -/def eval (v : ℕ → Bool) : Formula → Bool | pos i => v i | neg i => !v i | and As => As.attach.all fun ⟨A, _⟩ => eval v A | or As => As.attach.any fun ⟨A, _⟩ => eval v A /-- The (De Morgan) negation of a formula, again in negation normal form. -/def dual : Formula → Formula | pos i => neg i | neg i => pos i | and As => or (As.attach.map fun ⟨A, _⟩ => dual A) | or As => and (As.attach.map fun ⟨A, _⟩ => dual A) /-- Depth: literals have depth `0`; a conjunction or disjunction has depth one more than themaximal depth of its arguments (so a clause has depth `1` and a CNF has depth `2`). -/def depth : Formula → ℕ | pos _ => 0 | neg _ => 0 | and As => (As.attach.map fun ⟨A, _⟩ => depth A).foldr max 0 + 1 | or As => (As.attach.map fun ⟨A, _⟩ => depth A).foldr max 0 + 1 /-- Size: the number of symbols (literals and connectives) in the formula. -/def size : Formula → ℕ | pos _ => 1 | neg _ => 1 | and As => (As.attach.map fun ⟨A, _⟩ => size A).sum + 1 | or As => (As.attach.map fun ⟨A, _⟩ => size A).sum + 1 /-- A tautology is a formula true under every assignment. -/def IsTautology (A : Formula) : Prop := ∀ v : ℕ → Bool, A.eval v = true end Formula open Formula /-- A sequent is a finite list of formulas, read disjunctively. -/abbrev Sequent : Type := List Formula /-- `Step prev Γ`: the sequent `Γ` follows by one inference rule from sequents occurring in`prev` (the earlier lines of the proof). The rules are those of the one-sided sequentcalculus:* axiom: `Γ` contains a complementary pair of literals `pᵢ, ¬pᵢ`;* `∧`-introduction: from `A, Γ` for every `A ∈ As` infer `⋀As, Γ` (with `As = []` this is the axiom for the constant *true*);* `∨`-introduction: from `A, Γ` for some `A ∈ As` infer `⋁As, Γ`;* weakening (which also covers exchange and contraction): from `Γ` infer any `Δ` that contains every member of `Γ`;* cut: from `A, Γ` and `¬A, Γ` infer `Γ`. -/inductive Step (prev : List Sequent) : Sequent → Prop | ax (Γ : Sequent) (i : ℕ) : pos i ∈ Γ → neg i ∈ Γ → Step prev Γ | andI (Γ : Sequent) (As : List Formula) : (∀ A ∈ As, (A :: Γ) ∈ prev) → Step prev (and As :: Γ) | orI (Γ : Sequent) (As : List Formula) (A : Formula) : A ∈ As → (A :: Γ) ∈ prev → Step prev (or As :: Γ) | weaken (Γ Δ : Sequent) : Γ ∈ prev → Γ ⊆ Δ → Step prev Δ | cut (Γ : Sequent) (A : Formula) : (A :: Γ) ∈ prev → (A.dual :: Γ) ∈ prev → Step prev Γ /-- `IsDepthProof d π`: the list of sequents `π` is a proof in the depth-`d` Frege system`F_d`, i.e. every line follows from earlier lines by one rule of `Step` (proofs aredag-like: a line may be used any number of times), and every formula occurring in `π` hasdepth at most `d`. -/def IsDepthProof (d : ℕ) (π : List Sequent) : Prop := (∀ (i : ℕ) (h : i < π.length), Step (π.take i) π[i]) ∧ ∀ Γ ∈ π, ∀ A ∈ Γ, A.depth ≤ d /-- `IsDepthProofOf d π A`: `π` is an `F_d`-proof of the formula `A`, i.e. a depth-`d` proofcontaining the one-formula sequent `A` as one of its lines. -/def IsDepthProofOf (d : ℕ) (π : List Sequent) (A : Formula) : Prop := IsDepthProof d π ∧ [A] ∈ π /-- The size of a proof: the total number of symbols in all formulas of all its lines. -/def proofSize (π : List Sequent) : ℕ := (π.map fun Γ => (Γ.map Formula.size).sum).sum /-- `RequiresExpSize d τ`: the formulas `τ m` require exponential-size proofs in `F_d`:there is `ε > 0` such that for all sufficiently large `m`, every `F_d`-proof of `τ m` hassize at least `2^(size(τ m)^ε)`. -/def RequiresExpSize (d : ℕ) (τ : ℕ → Formula) : Prop := ∃ ε : ℝ, 0 < ε ∧ ∀ᶠ m in Filter.atTop, ∀ π, IsDepthProofOf d π (τ m) → (2 : ℝ) ^ (((τ m).size : ℝ) ^ ε) ≤ (proofSize π : ℝ) /-- `PolySeparates k d τ`: the sequence `τ 0, τ 1, …` is a family of tautologies of depth atmost `k` and of unbounded size (`m ≤ size(τ m)`), which have polynomial-size `F_{d+1}`-proofs(there is `C` such that every `τ m` has an `F_{d+1}`-proof of size at most`C · size(τ m)^C`) but require exponential-size `F_d`-proofs (`RequiresExpSize d τ`). -/def PolySeparates (k d : ℕ) (τ : ℕ → Formula) : Prop := (∀ m, (τ m).IsTautology) ∧ (∀ m, (τ m).depth ≤ k) ∧ (∀ m, m ≤ (τ m).size) ∧ (∃ C : ℕ, ∀ m, ∃ π, IsDepthProofOf (d + 1) π (τ m) ∧ proofSize π ≤ C * (τ m).size ^ C) ∧ RequiresExpSize d τ /-- `QuasiPolySeparates k d τ`: as `PolySeparates k d τ`, but the `F_{d+1}`-proofs are onlyrequired to have quasi-polynomial size: there is `C` such that every `τ m` has an`F_{d+1}`-proof of size at most `2^(C · (log₂ size(τ m))^C)`. -/def QuasiPolySeparates (k d : ℕ) (τ : ℕ → Formula) : Prop := (∀ m, (τ m).IsTautology) ∧ (∀ m, (τ m).depth ≤ k) ∧ (∀ m, m ≤ (τ m).size) ∧ (∃ C : ℕ, ∀ m, ∃ π, IsDepthProofOf (d + 1) π (τ m) ∧ (proofSize π : ℝ) ≤ (2 : ℝ) ^ ((C : ℝ) * Real.logb 2 ((τ m).size : ℝ) ^ C)) ∧ RequiresExpSize d τ /-- The propositional variable `p_{i,j}` ("pigeon `i` sits in hole `j`"), encoded as thevariable with index `Nat.pair i j`. -/def phpVar (i j : ℕ) : ℕ := Nat.pair i j /-- The pigeonhole principle `PHP^{n+1}_n` as a depth-2 formula in negation normal form:either some pigeon `i ≤ n` sits in no hole `j < n`, or two distinct pigeons `i < i' ≤ n`share a hole `j < n`:`⋁_{i ≤ n} ⋀_{j < n} ¬p_{i,j} ∨ ⋁_{j < n} ⋁_{i < i' ≤ n} (p_{i,j} ∧ p_{i',j})`. -/def php (n : ℕ) : Formula := or ((List.range (n + 1)).map (fun i => and ((List.range n).map fun j => neg (phpVar i j))) ++ (List.range n).flatMap fun j => (List.range (n + 1)).flatMap fun i => ((List.range (n + 1)).filter fun i' => i < i').map fun i' => and [pos (phpVar i j), pos (phpVar i' j)]) end FdVersusFdSucc