Proof of Theorem fermltl
Step | Hyp | Ref
| Expression |
1 | | prmnn 12036 |
. . . 4
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℕ) |
2 | | dvdsmodexp 11729 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑃 ∈ ℕ ∧ 𝑃 ∥ 𝐴) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
3 | 2 | 3exp 1191 |
. . . 4
⊢ (𝑃 ∈ ℕ → (𝑃 ∈ ℕ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)))) |
4 | 1, 1, 3 | sylc 62 |
. . 3
⊢ (𝑃 ∈ ℙ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
5 | 4 | adantr 274 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
6 | | coprm 12070 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝑃 gcd 𝐴) = 1)) |
7 | | prmz 12037 |
. . . . . 6
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℤ) |
8 | | gcdcom 11900 |
. . . . . 6
⊢ ((𝑃 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
9 | 7, 8 | sylan 281 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
10 | 9 | eqeq1d 2173 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝑃 gcd 𝐴) = 1 ↔ (𝐴 gcd 𝑃) = 1)) |
11 | 6, 10 | bitrd 187 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝐴 gcd 𝑃) = 1)) |
12 | | simp2 987 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℤ) |
13 | 1 | 3ad2ant1 1007 |
. . . . . . . . . 10
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℕ) |
14 | 13 | phicld 12144 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ) |
15 | 14 | nnnn0d 9161 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ0) |
16 | | zexpcl 10464 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℤ ∧
(ϕ‘𝑃) ∈
ℕ0) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
17 | 12, 15, 16 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
18 | | zq 9558 |
. . . . . . 7
⊢ ((𝐴↑(ϕ‘𝑃)) ∈ ℤ → (𝐴↑(ϕ‘𝑃)) ∈
ℚ) |
19 | 17, 18 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℚ) |
20 | | 1z 9211 |
. . . . . . 7
⊢ 1 ∈
ℤ |
21 | | zq 9558 |
. . . . . . 7
⊢ (1 ∈
ℤ → 1 ∈ ℚ) |
22 | 20, 21 | mp1i 10 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 1 ∈
ℚ) |
23 | | nnq 9565 |
. . . . . . 7
⊢ (𝑃 ∈ ℕ → 𝑃 ∈
ℚ) |
24 | 13, 23 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℚ) |
25 | 13 | nngt0d 8895 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 0 < 𝑃) |
26 | | eulerth 12159 |
. . . . . . 7
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
27 | 1, 26 | syl3an1 1260 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
28 | 19, 22, 12, 24, 25, 27 | modqmul1 10306 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((1 · 𝐴) mod 𝑃)) |
29 | | phiprm 12149 |
. . . . . . . . . 10
⊢ (𝑃 ∈ ℙ →
(ϕ‘𝑃) = (𝑃 − 1)) |
30 | 29 | 3ad2ant1 1007 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) = (𝑃 − 1)) |
31 | 30 | oveq2d 5855 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) = (𝐴↑(𝑃 − 1))) |
32 | 31 | oveq1d 5854 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
33 | 12 | zcnd 9308 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℂ) |
34 | | expm1t 10477 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℂ ∧ 𝑃 ∈ ℕ) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
35 | 33, 13, 34 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
36 | 32, 35 | eqtr4d 2200 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = (𝐴↑𝑃)) |
37 | 36 | oveq1d 5854 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((𝐴↑𝑃) mod 𝑃)) |
38 | 33 | mulid2d 7911 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (1 · 𝐴) = 𝐴) |
39 | 38 | oveq1d 5854 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((1 · 𝐴) mod 𝑃) = (𝐴 mod 𝑃)) |
40 | 28, 37, 39 | 3eqtr3d 2205 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
41 | 40 | 3expia 1194 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴 gcd 𝑃) = 1 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
42 | 11, 41 | sylbid 149 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
43 | | dvdsdc 11732 |
. . . 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 𝑃)) |