Non-dividing sets and the extremal function of Erdős problem #131
DefinitionErdos131_NonDividingA finite set is called non-dividing when no element of divides the sum of any nonempty subset of the remaining elements:
Singleton subsets are included, so a non-dividing set is in particular primitive: taking forbids for distinct . The subset is required to be nonempty because the empty sum is , which every divides; allowing would make the property unsatisfiable.
is the extremal function of the problem: the largest cardinality of a non-dividing subset of . Erdős asks for its order of growth. The known bounds are , the lower bound due to Csaba and the upper bound a consequence of the result of Pham and Zakharov on non-averaging sets; Erdős, Lev, Rauzy, Sándor and Sárközy proved the explicit bound . The correct growth rate is open.
Formalization Note. The forbidden subsets are drawn from A.erase a, so the tested element never occurs in the sum it is tested against. Membership in (A.erase a).powerset is definitionally the subset relation, and is written that way so the property is decidable, which is what allows an explicit finite witness to be checked by the Lean kernel.
import Mathlib.Tactic
import Mathlib.Data.Finset.Sort
import Mathlib.Data.ZMod.Basic
namespace Erdos131
/-!
Erdős problem #131 (Erdős, Lev, Rauzy, Sándor and Sárközy call the property
*non-dividing*).
A finite set `A` of naturals is **non-dividing** when no element of `A` divides the sum of any
nonempty subset of the *other* elements. Two modelling points.
* The forbidden subsets are drawn from `A.erase a`, so `a` itself never appears in the sum it is
tested against. Singleton subsets are included, so `NonDividing A` already forces `A` to be
primitive: `a ∣ b` is the case `S = {b}`.
* The subset must be nonempty. The empty sum is `0`, which every `a` divides, so allowing `S = ∅`
would make the property unsatisfiable.
* Membership `S ∈ (A.erase a).powerset` is definitionally `S ⊆ A.erase a`; it is written this way
so that the property is decidable, which is what lets a finite witness be checked by the kernel.
`F N` is the extremal function of the problem: the largest size of a non-dividing subset of
`{1, …, N}`. Erdős asks for its growth rate; the known bounds are
`N ^ (1/5) ≪ F N ≤ N ^ (1/4 + o(1))`, and the truth is unknown.
-/
/-- No element of `A` divides the sum of any nonempty subset of `A` not containing it. -/
def NonDividing (A : Finset ℕ) : Prop :=
∀ a ∈ A, ∀ S ∈ (A.erase a).powerset, S.Nonempty → ¬ (a ∣ ∑ x ∈ S, x)
/-- `NonDividing` is a decidable property: both quantifiers range over finite sets and
divisibility of naturals is decidable. This is what lets the kernel check an explicit witness. -/
instance (A : Finset ℕ) : Decidable (NonDividing A) := by
unfold NonDividing; infer_instance
/-- The non-dividing subsets of `{1, …, N}`. -/
def IsNDIn (N : ℕ) (A : Finset ℕ) : Prop :=
A ⊆ Finset.Icc 1 N ∧ NonDividing A
/-- `F N` is the maximal size of a non-dividing subset of `{1, …, N}`: the function Erdős
problem #131 asks us to estimate. -/
def F (N : ℕ) : ℕ :=
((Finset.Icc 1 N).powerset.filter (fun A => NonDividing A)).sup Finset.card
end Erdos131