Skip to content

Commit 3273871

Browse files
committed
chore(NumberTheory): add ModEq and Filter version of Dirichlet's theorem (#31139)
We add versions of Dirichlet's theorem phrased in terms of naturals and filters, rather than ZMod, for convenience. Since these do not mention ZMod, the usual convention is to avoid use of `NeZero` and instead use an explicit hypothesis.
1 parent 7ebc956 commit 3273871

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Mathlib/NumberTheory/LSeries/PrimesInAP.lean

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,16 +485,36 @@ theorem forall_exists_prime_gt_and_eq_mod (ha : IsUnit a) (n : ℕ) :
485485
exact ⟨p, hp₂.gt, Set.mem_setOf.mp hp₁⟩
486486

487487
/-- **Dirichlet's Theorem** on primes in arithmetic progression: if `q` is a positive
488-
integer and `a : ℤ` is coürime to `q`, then there are infinitely many prime numbers `p`
488+
integer and `a : ℤ` is coprime to `q`, then there are infinitely many prime numbers `p`
489489
such that `p ≡ a mod q`. -/
490-
theorem forall_exists_prime_gt_and_modEq (n : ℕ) {a : ℤ} (h : IsCoprime a q) :
490+
theorem forall_exists_prime_gt_and_zmodEq (n : ℕ) {q : ℕ} {a : ℤ} (hq : q ≠ 0) (h : IsCoprime a q) :
491491
∃ p > n, p.Prime ∧ p ≡ a [ZMOD q] := by
492+
have : NeZero q := ⟨hq⟩
492493
have : IsUnit (a : ZMod q) := by
493494
rwa [ZMod.coe_int_isUnit_iff_isCoprime, isCoprime_comm]
494495
obtain ⟨p, hpn, hpp, heq⟩ := forall_exists_prime_gt_and_eq_mod this n
495496
refine ⟨p, hpn, hpp, ?_⟩
496497
simpa [← ZMod.intCast_eq_intCast_iff] using heq
497498

499+
/-- **Dirichlet's Theorem** on primes in arithmetic progression: if `q` is a positive
500+
integer and `a : ℕ` is coprime to `q`, then there are infinitely many prime numbers `p`
501+
such that `p ≡ a mod q`. -/
502+
theorem forall_exists_prime_gt_and_modEq (n : ℕ) {q a : ℕ} (hq : q ≠ 0) (h : a.Coprime q) :
503+
∃ p > n, p.Prime ∧ p ≡ a [MOD q] := by
504+
simpa using forall_exists_prime_gt_and_zmodEq n (q := q) (a := a) hq (by simpa)
505+
506+
open Filter in
507+
lemma frequently_atTop_prime_and_modEq_one {q a : ℕ} (hq : q ≠ 0) (h : a.Coprime q) :
508+
∃ᶠ p in atTop, p.Prime ∧ p ≡ a [MOD q] := by
509+
rw [frequently_atTop]
510+
intro n
511+
obtain ⟨p, hn, hp, ha⟩ := forall_exists_prime_gt_and_modEq n hq h
512+
exact ⟨p, hn.le, hp, ha⟩
513+
514+
lemma infinite_setOf_prime_and_modEq_one {q a : ℕ} (hq : q ≠ 0) (h : a.Coprime q) :
515+
Set.Infinite {p : ℕ | p.Prime ∧ p ≡ a [MOD q]} :=
516+
frequently_atTop_iff_infinite.1 (frequently_atTop_prime_and_modEq_one hq h)
517+
498518
end Nat
499519

500520
end DirichletsTheorem

0 commit comments

Comments
 (0)