Density of a union of arithmetic progressions as an Euler product
ProvedSubnormalCover.hasSum_smooth_reciprocalsLet be positive integers, let be any positive common multiple of them, and let be a finite set of primes containing every prime factor of every . Sun's Lemma 3.4 (eq. (3.7)) asserts that the asymptotic density of equals , where runs over the positive integers divisible by some and having all prime factors in ; equivalently, that series converges with sum , where is the density. Formalization note. Mathlib has no asymptotic-density API, so the density is written in the exact finite form (independent of which positive common multiple is chosen), the Euler factor is moved to the right-hand side as (well defined because every is prime, so ), and the conclusion is phrased as an unconditional HasSum over the subtype , which additionally asserts (unordered) summability.
import Mathlib
namespace SubnormalCover
theorem hasSum_smooth_reciprocals {k : ℕ} (n : Fin k → ℕ) (hn : ∀ i, 0 < n i)
(N : ℕ) (hN : 0 < N) (hdvd : ∀ i, n i ∣ N)
(P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (hsub : ∀ i, (n i).primeFactors ⊆ P) :
HasSum (fun m : {m : ℕ // 0 < m ∧ m.primeFactors ⊆ P ∧ ∃ i, n i ∣ m} =>
(1 : ℝ) / ((m : ℕ) : ℝ))
((((Finset.range N).filter fun x => ∃ i, n i ∣ x).card : ℝ) / (N : ℝ)
* ∏ p ∈ P, ((p : ℝ) / ((p : ℝ) - 1))) := by
sorry
end SubnormalCoverRead-back
What the Lean code literally says, in plain math · claude-opus-5
Setting. Fix an implicit natural number (possibly ) and:
- a family of natural numbers indexed by , with the hypothesis for every (so is permitted; the need not be distinct);
- a natural number with , and the hypothesis for every ;
- a finite set , with the hypothesis that every is prime (hence , so and ), and the hypothesis that for every the set of prime factors of is contained in . Here is Mathlib's finite set of primes dividing , with . Note is not required to consist only of primes that actually divide some ; it may be strictly larger, or (if all ) empty.
Assertion. Consider the set of natural numbers
i.e. the positive -smooth integers that are divisible by at least one of the . The claim is that the family of real numbers is unconditionally summable with sum equal to a specified value (HasSum: the net of finite partial sums, indexed by the finite subsets of directed by inclusion, converges in to that value). The asserted value is
where the counting set is the initial segment of of length (it includes ), the count and are cast from into before dividing (so this is genuine real division, not truncated natural division, and by hypothesis), and the finite product is taken in over the members of with and real (each , so no factor has zero denominator). The empty product is .
Degenerate cases silently allowed.
- : all three hypotheses on the are vacuous, (the existential over an empty index set is false), and the left side is the empty sum ; on the right the filter condition also fails for every , giving numerator and hence value . The statement is then trivially true.
- : since every divides and , the numerator on the right is at least ; note because of the explicit constraint .
- : the hypothesis together with forces every ; then when , the sum is , the numerator is , and the empty product is .
- precisely when some ; membership in requires only some index with , not all.
- Nothing asserts that is infinite or finite;
HasSumcovers both, and over a finite index set it is just the finite sum.
Confirmed by the mission captain (proposal self-audit).