Metamath Proof Explorer


Theorem dirith

Description: Dirichlet's theorem: there are infinitely many primes in any arithmetic progression coprime to N . Theorem 9.4.1 of Shapiro, p. 375. See https://metamath-blog.blogspot.com/2016/05/dirichlets-theorem.html for an informal exposition. This is Metamath 100 proof #48. (Contributed by Mario Carneiro, 12-May-2016)

Ref Expression
Assertion dirith N A A gcd N = 1 p | N p A

Proof

Step Hyp Ref Expression
1 simp1 N A A gcd N = 1 N
2 1 nnnn0d N A A gcd N = 1 N 0
3 2 adantr N A A gcd N = 1 p N 0
4 eqid /N = /N
5 eqid Base /N = Base /N
6 eqid ℤRHom /N = ℤRHom /N
7 4 5 6 znzrhfo N 0 ℤRHom /N : onto Base /N
8 fofn ℤRHom /N : onto Base /N ℤRHom /N Fn
9 3 7 8 3syl N A A gcd N = 1 p ℤRHom /N Fn
10 prmz p p
11 10 adantl N A A gcd N = 1 p p
12 fniniseg ℤRHom /N Fn p ℤRHom /N -1 ℤRHom /N A p ℤRHom /N p = ℤRHom /N A
13 12 baibd ℤRHom /N Fn p p ℤRHom /N -1 ℤRHom /N A ℤRHom /N p = ℤRHom /N A
14 9 11 13 syl2anc N A A gcd N = 1 p p ℤRHom /N -1 ℤRHom /N A ℤRHom /N p = ℤRHom /N A
15 simp2 N A A gcd N = 1 A
16 15 adantr N A A gcd N = 1 p A
17 4 6 zndvds N 0 p A ℤRHom /N p = ℤRHom /N A N p A
18 3 11 16 17 syl3anc N A A gcd N = 1 p ℤRHom /N p = ℤRHom /N A N p A
19 14 18 bitrd N A A gcd N = 1 p p ℤRHom /N -1 ℤRHom /N A N p A
20 19 rabbi2dva N A A gcd N = 1 ℤRHom /N -1 ℤRHom /N A = p | N p A
21 eqid Unit /N = Unit /N
22 simp3 N A A gcd N = 1 A gcd N = 1
23 4 21 6 znunit N 0 A ℤRHom /N A Unit /N A gcd N = 1
24 2 15 23 syl2anc N A A gcd N = 1 ℤRHom /N A Unit /N A gcd N = 1
25 22 24 mpbird N A A gcd N = 1 ℤRHom /N A Unit /N
26 eqid ℤRHom /N -1 ℤRHom /N A = ℤRHom /N -1 ℤRHom /N A
27 4 6 1 21 25 26 dirith2 N A A gcd N = 1 ℤRHom /N -1 ℤRHom /N A
28 20 27 eqbrtrrd N A A gcd N = 1 p | N p A