Documentation

Mathlib.NumberTheory.SelbergSieve

The Selberg Sieve #

We set up the working assumptions of the Selberg sieve, define the notion of an upper bound sieve and show that every upper bound sieve yields an upper bound on the size of the sifted set. We also define the Λ² sieve and prove that Λ² sieves are upper bound sieves. We then diagonalise the main term of the Λ² sieve.

We mostly follow the treatment outlined by Heath-Brown in the notes to an old graduate course. One minor notational difference is that we write $\nu(n)$ in place of $\frac{\omega(n)}{n}$.

Results #

References #

structure BoundingSieve :

We set up a sieve problem as follows. Take a finite set of natural numbers A, whose elements are weighted by a sequence a n. Also take a finite set of primes P, represented by a squarefree natural number. These are the primes that we will sift from our set A. Suppose we can approximate ∑ n ∈ {k ∈ A | d ∣ k}, a n = ν d * X + R d, where X is an approximation to the total size of A and ν is a multiplicative arithmetic function such that 0 < ν p < 1 for all primes p ∣ P.

Then a sieve-type theorem will give us an upper (or lower) bound on the size of the sifted sum ∑ n ∈ {k ∈ support | k.Coprime P}, a n, obtained by removing any elements of A that are a multiple of a prime in P.

  • support : Finset

    The set of natural numbers that is to be sifted. The fundamental lemma yields an upper bound on the size of this set after the multiples of small primes have been removed.

  • prodPrimes :

    The finite set of prime numbers whose multiples are to be sifted from support. We work with their product because it lets us treat nu as a multiplicative arithmetic function. It also plays well with Moebius inversion.

  • prodPrimes_squarefree : Squarefree self.prodPrimes
  • weights :

    A sequence representing how much each element of support should be weighted.

  • weights_nonneg (n : ) : 0 self.weights n
  • totalMass :

    An approximation to ∑ i in support, weights i, i.e. the size of the unsifted set. A bad approximation will yield a weak statement in the final theorem.

  • nu d is an approximation to the proportion of elements of support that are a multiple of d

  • nu_mult : self.nu.IsMultiplicative
  • nu_pos_of_prime (p : ) : Nat.Prime pp self.prodPrimes0 < self.nu p
  • nu_lt_one_of_prime (p : ) : Nat.Prime pp self.prodPrimesself.nu p < 1
Instances For
    structure SelbergSieveextends BoundingSieve :

    The Selberg upper bound sieve in particular introduces a parameter called the level which gives the user control over the size of the error term.

    Instances For

      Extension for the positivity tactic: BoundingSieve.weights.

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

        Lemmas about $P$.

        Lemmas about $\nu$.

        theorem BoundingSieve.prod_primeFactors_nu {s : BoundingSieve} {d : } (hd : d s.prodPrimes) :
        pd.primeFactors, s.nu p = s.nu d
        theorem BoundingSieve.nu_ne_zero {s : BoundingSieve} {d : } (hd : d s.prodPrimes) :
        s.nu d 0
        theorem BoundingSieve.nu_lt_one_of_dvd_prodPrimes {s : BoundingSieve} {d : } (hdP : d s.prodPrimes) (hd_ne_one : d 1) :
        s.nu d < 1

        The weight of all the elements that are a multiple of d.

        Equations
        Instances For

          The remainder term in the approximation A_d = ν (d) X + R_d. This is the degree to which nu fails to approximate the proportion of the weight that is a multiple of d.

          Equations
          Instances For

            The weight of all the elements that are not a multiple of any of our finite set of primes.

            Equations
            Instances For
              def BoundingSieve.mainSum {s : BoundingSieve} (muPlus : ) :

              X * mainSum μ⁺ is the main term in the upper bound on sifted_sum.

              Equations
              Instances For
                def BoundingSieve.errSum {s : BoundingSieve} (muPlus : ) :

                errSum μ⁺ is the error term in the upper bound on sifted_sum.

                Equations
                Instances For
                  @[deprecated BoundingSieve.siftedSum_eq_sum_support_mul_ite (since := "2025-07-27")]

                  Alias of BoundingSieve.siftedSum_eq_sum_support_mul_ite.

                  A sequence of coefficients $\mu^{+}$ is upper Moebius if $\mu * \zeta ≤ \mu^{+} * \zeta$. These coefficients then yield an upper bound on the sifted sum.

                  Equations
                  Instances For