Proof of Theorem fermltl
Step | Hyp | Ref
| Expression |
1 | | prmnn 12042 |
. . . 4
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℕ) |
2 | | dvdsmodexp 11735 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑃 ∈ ℕ ∧ 𝑃 ∥ 𝐴) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
3 | 2 | 3exp 1192 |
. . . 4
⊢ (𝑃 ∈ ℕ → (𝑃 ∈ ℕ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)))) |
4 | 1, 1, 3 | sylc 62 |
. . 3
⊢ (𝑃 ∈ ℙ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
5 | 4 | adantr 274 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
6 | | coprm 12076 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝑃 gcd 𝐴) = 1)) |
7 | | prmz 12043 |
. . . . . 6
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℤ) |
8 | | gcdcom 11906 |
. . . . . 6
⊢ ((𝑃 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
9 | 7, 8 | sylan 281 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
10 | 9 | eqeq1d 2174 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝑃 gcd 𝐴) = 1 ↔ (𝐴 gcd 𝑃) = 1)) |
11 | 6, 10 | bitrd 187 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝐴 gcd 𝑃) = 1)) |
12 | | simp2 988 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℤ) |
13 | 1 | 3ad2ant1 1008 |
. . . . . . . . . 10
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℕ) |
14 | 13 | phicld 12150 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ) |
15 | 14 | nnnn0d 9167 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ0) |
16 | | zexpcl 10470 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℤ ∧
(ϕ‘𝑃) ∈
ℕ0) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
17 | 12, 15, 16 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
18 | | zq 9564 |
. . . . . . 7
⊢ ((𝐴↑(ϕ‘𝑃)) ∈ ℤ → (𝐴↑(ϕ‘𝑃)) ∈
ℚ) |
19 | 17, 18 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℚ) |
20 | | 1z 9217 |
. . . . . . 7
⊢ 1 ∈
ℤ |
21 | | zq 9564 |
. . . . . . 7
⊢ (1 ∈
ℤ → 1 ∈ ℚ) |
22 | 20, 21 | mp1i 10 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 1 ∈
ℚ) |
23 | | nnq 9571 |
. . . . . . 7
⊢ (𝑃 ∈ ℕ → 𝑃 ∈
ℚ) |
24 | 13, 23 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℚ) |
25 | 13 | nngt0d 8901 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 0 < 𝑃) |
26 | | eulerth 12165 |
. . . . . . 7
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
27 | 1, 26 | syl3an1 1261 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
28 | 19, 22, 12, 24, 25, 27 | modqmul1 10312 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((1 · 𝐴) mod 𝑃)) |
29 | | phiprm 12155 |
. . . . . . . . . 10
⊢ (𝑃 ∈ ℙ →
(ϕ‘𝑃) = (𝑃 − 1)) |
30 | 29 | 3ad2ant1 1008 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) = (𝑃 − 1)) |
31 | 30 | oveq2d 5858 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) = (𝐴↑(𝑃 − 1))) |
32 | 31 | oveq1d 5857 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
33 | 12 | zcnd 9314 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℂ) |
34 | | expm1t 10483 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℂ ∧ 𝑃 ∈ ℕ) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
35 | 33, 13, 34 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
36 | 32, 35 | eqtr4d 2201 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = (𝐴↑𝑃)) |
37 | 36 | oveq1d 5857 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((𝐴↑𝑃) mod 𝑃)) |
38 | 33 | mulid2d 7917 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (1 · 𝐴) = 𝐴) |
39 | 38 | oveq1d 5857 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((1 · 𝐴) mod 𝑃) = (𝐴 mod 𝑃)) |
40 | 28, 37, 39 | 3eqtr3d 2206 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
41 | 40 | 3expia 1195 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴 gcd 𝑃) = 1 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
42 | 11, 41 | sylbid 149 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
43 | | dvdsdc 11738 |
. . . 4
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ) →
DECID 𝑃
∥ 𝐴) |
44 | 1, 43 | sylan 281 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) →
DECID 𝑃
∥ 𝐴) |
45 | | exmiddc 826 |
. . 3
⊢
(DECID 𝑃 ∥ 𝐴 → (𝑃 ∥ 𝐴 ∨ ¬ 𝑃 ∥ 𝐴)) |
46 | 44, 45 | syl 14 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 ∨ ¬ 𝑃 ∥ 𝐴)) |
47 | 5, 42, 46 | mpjaod 708 |
1
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |