Proof of Theorem fermltl
Step | Hyp | Ref
| Expression |
1 | | prmnn 16379 |
. . . 4
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℕ) |
2 | | dvdsmodexp 15971 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑃 ∈ ℕ ∧ 𝑃 ∥ 𝐴) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
3 | 2 | 3exp 1118 |
. . . 4
⊢ (𝑃 ∈ ℕ → (𝑃 ∈ ℕ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)))) |
4 | 1, 1, 3 | sylc 65 |
. . 3
⊢ (𝑃 ∈ ℙ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
5 | 4 | adantr 481 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
6 | | coprm 16416 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝑃 gcd 𝐴) = 1)) |
7 | | prmz 16380 |
. . . . . 6
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℤ) |
8 | | gcdcom 16220 |
. . . . . 6
⊢ ((𝑃 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
9 | 7, 8 | sylan 580 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
10 | 9 | eqeq1d 2740 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝑃 gcd 𝐴) = 1 ↔ (𝐴 gcd 𝑃) = 1)) |
11 | 6, 10 | bitrd 278 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝐴 gcd 𝑃) = 1)) |
12 | | simp2 1136 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℤ) |
13 | 1 | 3ad2ant1 1132 |
. . . . . . . . . 10
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℕ) |
14 | 13 | phicld 16473 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ) |
15 | 14 | nnnn0d 12293 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ0) |
16 | | zexpcl 13797 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℤ ∧
(ϕ‘𝑃) ∈
ℕ0) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
17 | 12, 15, 16 | syl2anc 584 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
18 | 17 | zred 12426 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℝ) |
19 | | 1red 10976 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 1 ∈
ℝ) |
20 | 13 | nnrpd 12770 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈
ℝ+) |
21 | | eulerth 16484 |
. . . . . . 7
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
22 | 1, 21 | syl3an1 1162 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
23 | | modmul1 13644 |
. . . . . 6
⊢ ((((𝐴↑(ϕ‘𝑃)) ∈ ℝ ∧ 1 ∈
ℝ) ∧ (𝐴 ∈
ℤ ∧ 𝑃 ∈
ℝ+) ∧ ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((1 · 𝐴) mod 𝑃)) |
24 | 18, 19, 12, 20, 22, 23 | syl221anc 1380 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((1 · 𝐴) mod 𝑃)) |
25 | | phiprm 16478 |
. . . . . . . . . 10
⊢ (𝑃 ∈ ℙ →
(ϕ‘𝑃) = (𝑃 − 1)) |
26 | 25 | 3ad2ant1 1132 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) = (𝑃 − 1)) |
27 | 26 | oveq2d 7291 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) = (𝐴↑(𝑃 − 1))) |
28 | 27 | oveq1d 7290 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
29 | 12 | zcnd 12427 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℂ) |
30 | | expm1t 13811 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℂ ∧ 𝑃 ∈ ℕ) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
31 | 29, 13, 30 | syl2anc 584 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
32 | 28, 31 | eqtr4d 2781 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = (𝐴↑𝑃)) |
33 | 32 | oveq1d 7290 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((𝐴↑𝑃) mod 𝑃)) |
34 | 29 | mulid2d 10993 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (1 · 𝐴) = 𝐴) |
35 | 34 | oveq1d 7290 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((1 · 𝐴) mod 𝑃) = (𝐴 mod 𝑃)) |
36 | 24, 33, 35 | 3eqtr3d 2786 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
37 | 36 | 3expia 1120 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴 gcd 𝑃) = 1 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
38 | 11, 37 | sylbid 239 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
39 | 5, 38 | pm2.61d 179 |
1
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |