Documentation

Mathlib.Combinatorics.Schnirelmann

Schnirelmann density #

We define the Schnirelmann density of a set A of natural numbers as $inf_{n > 0} |A โˆฉ {1,...,n}| / n$. As this density is very sensitive to changes in small values, we must exclude 0 from the infimum, and from the intersection.

Main statements #

Implementation notes #

Despite the definition being noncomputable, we include a decidable instance argument, since this makes the definition easier to use in explicit cases. Further, we use Finset.Ioc rather than a set intersection since the set is finite by construction, which reduces the proof obligations later that would arise with Nat.card.

TODO #

References #

noncomputable def schnirelmannDensity (A : Set โ„•) [DecidablePred fun (x : โ„•) => x โˆˆ A] :

The Schnirelmann density is defined as the infimum of |A โˆฉ {1, ..., n}| / n as n ranges over the positive naturals.

Instances For
    theorem schnirelmannDensity_nonneg {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] :
    theorem schnirelmannDensity_le_div {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {n : โ„•} (hn : n โ‰  0) :
    schnirelmannDensity A โ‰ค โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n
    theorem schnirelmannDensity_mul_le_card_filter {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {n : โ„•} :
    schnirelmannDensity A * โ†‘n โ‰ค โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card

    For any natural n, the Schnirelmann density multiplied by n is bounded by |A โˆฉ {1, ..., n}|. Note this property fails for the natural density.

    theorem schnirelmannDensity_le_of_le {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {x : โ„} (n : โ„•) (hn : n โ‰  0) (hx : โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n โ‰ค x) :

    To show the Schnirelmann density is upper bounded by x, it suffices to show |A โˆฉ {1, ..., n}| / n โ‰ค x, for any chosen positive value of n.

    We provide n explicitly here to make this lemma more easily usable in apply or refine. This lemma is analogous to ciInf_le_of_le.

    theorem schnirelmannDensity_le_one {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] :
    theorem schnirelmannDensity_le_of_notMem {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {k : โ„•} (hk : k โˆ‰ A) :

    If k is omitted from the set, its Schnirelmann density is upper bounded by 1 - kโปยน.

    theorem schnirelmannDensity_eq_zero_of_one_notMem {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] (h : 1 โˆ‰ A) :

    The Schnirelmann density of a set not containing 1 is 0.

    theorem schnirelmannDensity_le_of_subset {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {B : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ B] (h : A โІ B) :

    The Schnirelmann density is increasing with the set.

    theorem schnirelmannDensity_eq_one_iff {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] :
    schnirelmannDensity A = 1 โ†” {0}แถœ โІ A

    The Schnirelmann density of A is 1 if and only if A contains all the positive naturals.

    theorem schnirelmannDensity_eq_one_iff_of_zero_mem {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] (hA : 0 โˆˆ A) :
    schnirelmannDensity A = 1 โ†” A = Set.univ

    The Schnirelmann density of A containing 0 is 1 if and only if A is the naturals.

    theorem le_schnirelmannDensity_iff {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {x : โ„} :
    x โ‰ค schnirelmannDensity A โ†” โˆ€ (n : โ„•), 0 < n โ†’ x โ‰ค โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n
    theorem schnirelmannDensity_lt_iff {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {x : โ„} :
    schnirelmannDensity A < x โ†” โˆƒ (n : โ„•), 0 < n โˆง โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n < x
    theorem schnirelmannDensity_le_iff_forall {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {x : โ„} :
    schnirelmannDensity A โ‰ค x โ†” โˆ€ (ฮต : โ„), 0 < ฮต โ†’ โˆƒ (n : โ„•), 0 < n โˆง โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n < x + ฮต
    theorem schnirelmannDensity_congr' {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {B : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ B] (h : โˆ€ n > 0, n โˆˆ A โ†” n โˆˆ B) :
    @[simp]
    theorem schnirelmannDensity_insert_zero {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] [DecidablePred fun (x : โ„•) => x โˆˆ insert 0 A] :

    The Schnirelmann density is unaffected by adding 0.

    theorem schnirelmannDensity_diff_singleton_zero {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] [DecidablePred fun (x : โ„•) => x โˆˆ A \ {0}] :

    The Schnirelmann density is unaffected by removing 0.

    theorem schnirelmannDensity_congr {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {B : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ B] (h : A = B) :
    theorem exists_of_schnirelmannDensity_eq_zero {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] {ฮต : โ„} (hฮต : 0 < ฮต) (hA : schnirelmannDensity A = 0) :
    โˆƒ (n : โ„•), 0 < n โˆง โ†‘{a โˆˆ Finset.Ioc 0 n | a โˆˆ A}.card / โ†‘n < ฮต

    If the Schnirelmann density is 0, there is a positive natural for which |A โˆฉ {1, ..., n}| / n < ฮต, for any positive ฮต. Note this cannot be improved to โˆƒแถ  n : โ„• in atTop, as can be seen by A = {1}แถœ.

    theorem schnirelmannDensity_finset (A : Finset โ„•) :
    schnirelmannDensity โ†‘A = 0

    The Schnirelmann density of any finset is 0.

    theorem schnirelmannDensity_finite {A : Set โ„•} [DecidablePred fun (x : โ„•) => x โˆˆ A] (hA : A.Finite) :

    The Schnirelmann density of any finite set is 0.

    theorem schnirelmannDensity_setOf_mod_eq_one {m : โ„•} (hm : m โ‰  1) :
    schnirelmannDensity {n : โ„• | n % m = 1} = (โ†‘m)โปยน

    The Schnirelmann density of the set of naturals which are 1 mod m is mโปยน, for any m โ‰  1.

    Note that if m = 1, this set is empty.