OAI/NumberTheory/JointDickman/Arithmetic/SieveCRT.lean
4 declarations, 0 contain sorry, 0 declared as axioms
Exact Chinese remainder counts for the sieve
- theorem
OAI.JointDickman.crt_period_sumline 13Source documentation
Uniform residue sums factor over any finite pairwise coprime family.
theorem crt_period_sum {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) [∀ i, NeZero (m i)] (hm : ∀ i, 0 < m i) (hcop : Pairwise (fun i j => (m i).Coprime (m j))) (f : ∀ i, ZMod (m i) → ℝ) : (∑ n ∈ range (∏ i, m i), ∏ i, f i (n : ZMod (m i))) = ∏ i, ∑ a : ZMod (m i), f i a := by … - theorem
OAI.JointDickman.crt_root_period_countline 39Source documentation
The simultaneous prescribed-root count is exactly the product of the local root counts, including an empty family of moduli.
theorem crt_root_period_count {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) (hm : ∀ i, 0 < m i) (hcop : Pairwise (fun i j => (m i).Coprime (m j))) (A : ∀ i, Finset (ZMod (m i))) : (∑ n ∈ range (∏ i, m i), if ∀ i, (n : ZMod (m i)) ∈ A i then (1 : ℝ) else 0) = ∏ i, ((A i).card : ℝ) := by … - theorem
OAI.JointDickman.crt_root_interval_errorline 64Source documentation
An interval intersection has at most two errors per simultaneous residue class, independent of the modulus and the interval location.
theorem crt_root_interval_error {ι : Type*} [Fintype ι] [DecidableEq ι] (m : ι → ℕ) (hm : ∀ i, 0 < m i) (hcop : Pairwise (fun i j => (m i).Coprime (m j))) (A : ∀ i, Finset (ZMod (m i))) {a b : ℕ} (hab : a ≤ b) : |(∑ n ∈ Ico a b, if ∀ i, (n : ZMod (m i)) ∈ A i then (1 : ℝ) else 0) - ((b : ℝ) - a) * ∏ i, ((A i).card : ℝ) / (m i)| ≤ 2 * ∏ i, ((A i).card : ℝ) := by … - theorem
OAI.JointDickman.prime_root_interval_errorline 93Source documentation
Specialization to a finite set of distinct primes.
theorem prime_root_interval_error (P : Finset ℕ) (hP : ∀ p ∈ P, p.Prime) (A : ∀ p : ℕ, Finset (ZMod p)) {a b : ℕ} (hab : a ≤ b) : |(∑ n ∈ Ico a b, if ∀ p ∈ P, (n : ZMod p) ∈ A p then (1 : ℝ) else 0) - ((b : ℝ) - a) * ∏ p ∈ P, ((A p).card : ℝ) / p| ≤ 2 * ∏ p ∈ P, ((A p).card : ℝ) := by …