Documentation

LeanPool.RunsOfMultiples.Alt.Lower

Runs of multiples: the lower bound via the "matching construction" #

This file formalises §3 ("A matching construction") of docs/first-missing-multiple.pdf.

For y ≥ 2 let

S_y is the set of integers ∏_{p ≤ √y} p ^ u_p * ∏_{√y < p ≤ y} p ^ v_p with 0 ≤ u_p ≤ H and ∑ v_p ≤ m. We represent exponent vectors as finsupps ℕ →₀ ℕ and the number as f.prod (· ^ ·). The small-prime part ranges over smallExp y H (Finset.finsupp), the large-prime part over largeExp y m: finsupps supported on insert 1 (large y) with total sum exactly m, the coordinate at 1 being a slack variable (1 ^ v = 1), so that these give exactly the products with ∑ v_p ≤ m (stars and bars with a slack variable; Finset.card_finsuppAntidiag_nat_eq_choose).

The good elements (u_p ≤ H - L, ∑ v_p ≤ m - 1) have all first y multiples in S_y, at least a quarter of S_y is good, and |S_y| ≤ (H + 1) ^ q * C(2m, m) ≤ exp (C y / log y). The padding step is the same as in RunsOfMultiples.Replication (replicate).

Primes p with p ≤ √y, i.e. p * p ≤ y.

Equations
Instances For

    Primes p with √y < p ≤ y.

    Equations
    Instances For

      m = π(y) - π(√y).

      Equations
      Instances For

        L = ⌊log₂ y⌋.

        Equations
        Instances For

          Index set for the large-prime exponents, with a slack coordinate at 1.

          Equations
          Instances For
            noncomputable def RunsOfMultiples.Alt.pw (f : ℕ →₀ ℕ) :

            The number with exponent vector f.

            Equations
            Instances For
              noncomputable def RunsOfMultiples.Alt.smallExp (y e : ℕ) :

              Small-prime exponent vectors with all entries ≤ e.

              Equations
              Instances For
                noncomputable def RunsOfMultiples.Alt.largeExp (y k : ℕ) :

                Large-prime exponent vectors (plus slack at 1) with total sum k.

                Equations
                Instances For
                  noncomputable def RunsOfMultiples.Alt.smallPart (y e : ℕ) :

                  Small parts ∏_{p ≤ √y} p ^ u_p, u_p ≤ e.

                  Equations
                  Instances For
                    noncomputable def RunsOfMultiples.Alt.largePart (y k : ℕ) :

                    Large parts ∏_{√y < p ≤ y} p ^ v_p, ∑ v_p ≤ k.

                    Equations
                    Instances For
                      noncomputable def RunsOfMultiples.Alt.Sy (y : ℕ) :

                      The block S_y.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        noncomputable def RunsOfMultiples.Alt.Gy (y : ℕ) :

                        The good elements of S_y: u_p ≤ H - L, ∑ v_p ≤ m - 1.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Basic facts #

                          theorem RunsOfMultiples.Alt.pw_add (f g : ℕ →₀ ℕ) :
                          pw (f + g) = pw f * pw g
                          theorem RunsOfMultiples.Alt.pw_pos (f : ℕ →₀ ℕ) (hf : ∀ p ∈ f.support, 0 < p) :
                          0 < pw f

                          Unique factorisation: the parts and their product are injective #

                          theorem RunsOfMultiples.Alt.prime_dvd_pw {f : ℕ →₀ ℕ} {p : ℕ} (hp : Nat.Prime p) (h : p ∣ pw f) :
                          ∃ r ∈ f.support, p ∣ r
                          theorem RunsOfMultiples.Alt.prime_dvd_smallPart {y e a p : ℕ} (ha : a ∈ smallPart y e) (hp : Nat.Prime p) (h : p ∣ a) :
                          theorem RunsOfMultiples.Alt.prime_dvd_largePart {y k a p : ℕ} (ha : a ∈ largePart y k) (hp : Nat.Prime p) (h : p ∣ a) :
                          theorem RunsOfMultiples.Alt.coprime_parts {y e k a b : ℕ} (ha : a ∈ smallPart y e) (hb : b ∈ largePart y k) :
                          theorem RunsOfMultiples.Alt.smallPart_pos {y e a : ℕ} (ha : a ∈ smallPart y e) :
                          0 < a
                          theorem RunsOfMultiples.Alt.largePart_pos {y k b : ℕ} (hb : b ∈ largePart y k) :
                          0 < b
                          theorem RunsOfMultiples.Alt.mul_injOn_parts (y e k : ℕ) :
                          Set.InjOn (fun (x : ℕ × ℕ) => x.1 * x.2) ↑(smallPart y e ×ˢ largePart y k)
                          theorem RunsOfMultiples.Alt.card_Sy (y : ℕ) :
                          (Sy y).card = (HH y + 1) ^ qq y * (mm y + mm y).choose (mm y)

                          |S_y| = (H + 1) ^ q * C(2m, m) (equation (9)).

                          theorem RunsOfMultiples.Alt.card_Gy (y : ℕ) :
                          (Gy y).card = (HH y - LL y + 1) ^ qq y * (mm y + (mm y - 1)).choose (mm y - 1)

                          At least a quarter of S_y is good #

                          theorem RunsOfMultiples.Alt.bernoulli_aux (q L : ℕ) :
                          (2 * q * L + 1) ^ q ≤ 2 * (2 * q * L - L + 1) ^ q

                          Bernoulli: (H + 1) ^ q ≤ 2 (H - L + 1) ^ q for H = 2 q L.

                          theorem RunsOfMultiples.Alt.choose_le_two_mul (m : ℕ) :
                          (m + m).choose m ≤ 2 * (m + (m - 1)).choose (m - 1)

                          C(2m, m) = 2 C(2m - 1, m - 1) (for m ≥ 1; for m = 0 both sides are 1).

                          At least a quarter of S_y is good.

                          Good elements have their first y multiples in S_y #

                          theorem RunsOfMultiples.Alt.factorization_mem_smallExp {y j : ℕ} (hj1 : 1 ≤ j) (hjy : j ≤ y) (h : ∀ (p : ℕ), Nat.Prime p → p ∣ j → p * p ≤ y) :

                          If 1 ≤ j ≤ y has no prime factor > √y, its exponent vector lies in smallExp y L: each small-prime exponent of j is at most L = ⌊log₂ y⌋.

                          theorem RunsOfMultiples.Alt.decomp {y j : ℕ} (hj1 : 1 ≤ j) (hjy : j ≤ y) :
                          ∃ (js : ℕ) (jl : ℕ), j = js * jl ∧ js.factorization ∈ smallExp y (LL y) ∧ 1 ≤ js ∧ jl ∈ slack y

                          Every 1 ≤ j ≤ y is js * jl with js having small-prime exponents ≤ L and jl ∈ {1} ∪ (√y, y] (at most one prime factor > √y, counted with multiplicity).

                          theorem RunsOfMultiples.Alt.add_mem_smallExp {y : ℕ} {g e : ℕ →₀ ℕ} (hg : g ∈ smallExp y (LL y)) (he : e ∈ smallExp y (HH y - LL y)) :
                          g + e ∈ smallExp y (HH y)
                          theorem RunsOfMultiples.Alt.add_single_mem_largeExp {y k x c : ℕ} {f : ℕ →₀ ℕ} (hf : f ∈ largeExp y k) (hx : x ∈ slack y) :
                          f + Finsupp.single x c ∈ largeExp y (k + c)
                          theorem RunsOfMultiples.Alt.mem_largePart_iff {y k b : ℕ} :
                          b ∈ largePart y k ↔ ∃ (v : ℕ →₀ ℕ), v.support ⊆ large y ∧ ∑ p ∈ large y, v p ≤ k ∧ pw v = b

                          Sanity check of the slack encoding: largePart y k is exactly the set of ∏_{√y < p ≤ y} p ^ v_p with ∑ v_p ≤ k, as in (8).

                          theorem RunsOfMultiples.Alt.mul_mem_Sy {y a j : ℕ} (ha : a ∈ Gy y) (hj1 : 1 ≤ j) (hjy : j ≤ y) :
                          j * a ∈ Sy y

                          If a is good and 1 ≤ j ≤ y, then j a ∈ S_y.

                          theorem RunsOfMultiples.Alt.Gy_subset_Sy {y : ℕ} (hy : 1 ≤ y) :
                          Gy y ⊆ Sy y
                          theorem RunsOfMultiples.Alt.pos_of_mem_Sy {y a : ℕ} (ha : a ∈ Sy y) :
                          0 < a

                          Size of S_y: log |S_y| = O(y / log y) (upper half of (12)) #

                          theorem RunsOfMultiples.Alt.HH_add_one_le {y : ℕ} (hy : 2 ≤ y) :
                          HH y + 1 ≤ y ^ 4
                          noncomputable def RunsOfMultiples.Alt.C₃ :

                          The constant in |S_y| ≤ exp (C₃ y / log y).

                          Equations
                          Instances For
                            theorem RunsOfMultiples.Alt.card_Sy_le_exp {y : ℕ} (hy : 2 ≤ y) :
                            ↑(Sy y).card ≤ Real.exp (C₃ * (↑y / Real.log ↑y))

                            |S_y| ≤ (H + 1) ^ q * 4 ^ m ≤ exp (C₃ y / log y), using q ≤ √y, H + 1 ≤ y ^ 4 and Chebyshev's bound for m ≤ π(y).

                            theorem RunsOfMultiples.Alt.block_alt :
                            ∃ (δ : ℝ), 0 < δ ∧ ∃ (C₂ : ℝ), 0 < C₂ ∧ ∀ (y : ℕ), 2 ≤ y → ∃ (B : Finset ℕ) (G : Finset ℕ), (∀ a ∈ B, 0 < a) ∧ G ⊆ B ∧ (∀ a ∈ G, ∀ (j : ℕ), 1 ≤ j → j ≤ y → j * a ∈ B) ∧ 0 < B.card ∧ δ * ↑B.card ≤ ↑G.card ∧ ↑B.card ≤ Real.exp (C₂ * (↑y / Real.log ↑y))

                            The block of §3: B = S_y, G = good elements, |G| ≥ |B| / 4, |B| ≤ exp (C₃ y / log y). Same shape as RunsOfMultiples.block.

                            Padding to every n (end of §3) #

                            y = ⌊ε log n log log n⌋ with ε = 1 / (2 C₂), so |S_y| ≤ exp (L / 2) ≤ n / 2; take ⌊n / |S_y|⌋ disjoint dilates M ^ i • S_y and pad (replicate from RunsOfMultiples.Replication). The argument below is the one of lower_bound, applied to the block block_alt of §3.

                            theorem RunsOfMultiples.lower_bound_alt :
                            ∃ (c : ℝ), 0 < c ∧ ∃ (N : ℕ), ∀ (n : ℕ), N ≤ n → ∃ (S : Finset ℕ), (∀ a ∈ S, 0 < a) ∧ S.card = n ∧ c * ↑n * Real.log ↑n * Real.log (Real.log ↑n) ≤ ↑(∑ a ∈ S, kVal S a)

                            Lower bound (alternative construction, §3).