Proof of Theorem fermltl
Step | Hyp | Ref
| Expression |
1 | | prmnn 12064 |
. . . 4
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℕ) |
2 | | dvdsmodexp 11757 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑃 ∈ ℕ ∧ 𝑃 ∥ 𝐴) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
3 | 2 | 3exp 1197 |
. . . 4
⊢ (𝑃 ∈ ℕ → (𝑃 ∈ ℕ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)))) |
4 | 1, 1, 3 | sylc 62 |
. . 3
⊢ (𝑃 ∈ ℙ → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
5 | 4 | adantr 274 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
6 | | coprm 12098 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝑃 gcd 𝐴) = 1)) |
7 | | prmz 12065 |
. . . . . 6
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℤ) |
8 | | gcdcom 11928 |
. . . . . 6
⊢ ((𝑃 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
9 | 7, 8 | sylan 281 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 gcd 𝐴) = (𝐴 gcd 𝑃)) |
10 | 9 | eqeq1d 2179 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝑃 gcd 𝐴) = 1 ↔ (𝐴 gcd 𝑃) = 1)) |
11 | 6, 10 | bitrd 187 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 ↔ (𝐴 gcd 𝑃) = 1)) |
12 | | simp2 993 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℤ) |
13 | 1 | 3ad2ant1 1013 |
. . . . . . . . . 10
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℕ) |
14 | 13 | phicld 12172 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ) |
15 | 14 | nnnn0d 9188 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) ∈
ℕ0) |
16 | | zexpcl 10491 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℤ ∧
(ϕ‘𝑃) ∈
ℕ0) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
17 | 12, 15, 16 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℤ) |
18 | | zq 9585 |
. . . . . . 7
⊢ ((𝐴↑(ϕ‘𝑃)) ∈ ℤ → (𝐴↑(ϕ‘𝑃)) ∈
ℚ) |
19 | 17, 18 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) ∈ ℚ) |
20 | | 1z 9238 |
. . . . . . 7
⊢ 1 ∈
ℤ |
21 | | zq 9585 |
. . . . . . 7
⊢ (1 ∈
ℤ → 1 ∈ ℚ) |
22 | 20, 21 | mp1i 10 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 1 ∈
ℚ) |
23 | | nnq 9592 |
. . . . . . 7
⊢ (𝑃 ∈ ℕ → 𝑃 ∈
ℚ) |
24 | 13, 23 | syl 14 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝑃 ∈ ℚ) |
25 | 13 | nngt0d 8922 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 0 < 𝑃) |
26 | | eulerth 12187 |
. . . . . . 7
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
27 | 1, 26 | syl3an1 1266 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) mod 𝑃) = (1 mod 𝑃)) |
28 | 19, 22, 12, 24, 25, 27 | modqmul1 10333 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((1 · 𝐴) mod 𝑃)) |
29 | | phiprm 12177 |
. . . . . . . . . 10
⊢ (𝑃 ∈ ℙ →
(ϕ‘𝑃) = (𝑃 − 1)) |
30 | 29 | 3ad2ant1 1013 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (ϕ‘𝑃) = (𝑃 − 1)) |
31 | 30 | oveq2d 5869 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑(ϕ‘𝑃)) = (𝐴↑(𝑃 − 1))) |
32 | 31 | oveq1d 5868 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
33 | 12 | zcnd 9335 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → 𝐴 ∈ ℂ) |
34 | | expm1t 10504 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℂ ∧ 𝑃 ∈ ℕ) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
35 | 33, 13, 34 | syl2anc 409 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (𝐴↑𝑃) = ((𝐴↑(𝑃 − 1)) · 𝐴)) |
36 | 32, 35 | eqtr4d 2206 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑(ϕ‘𝑃)) · 𝐴) = (𝐴↑𝑃)) |
37 | 36 | oveq1d 5868 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (((𝐴↑(ϕ‘𝑃)) · 𝐴) mod 𝑃) = ((𝐴↑𝑃) mod 𝑃)) |
38 | 33 | mulid2d 7938 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → (1 · 𝐴) = 𝐴) |
39 | 38 | oveq1d 5868 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((1 · 𝐴) mod 𝑃) = (𝐴 mod 𝑃)) |
40 | 28, 37, 39 | 3eqtr3d 2211 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ (𝐴 gcd 𝑃) = 1) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |
41 | 40 | 3expia 1200 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴 gcd 𝑃) = 1 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
42 | 11, 41 | sylbid 149 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (¬
𝑃 ∥ 𝐴 → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃))) |
43 | | dvdsdc 11760 |
. . . 4
⊢ ((𝑃 ∈ ℕ ∧ 𝐴 ∈ ℤ) →
DECID 𝑃
∥ 𝐴) |
44 | 1, 43 | sylan 281 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) →
DECID 𝑃
∥ 𝐴) |
45 | | exmiddc 831 |
. . 3
⊢
(DECID 𝑃 ∥ 𝐴 → (𝑃 ∥ 𝐴 ∨ ¬ 𝑃 ∥ 𝐴)) |
46 | 44, 45 | syl 14 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → (𝑃 ∥ 𝐴 ∨ ¬ 𝑃 ∥ 𝐴)) |
47 | 5, 42, 46 | mpjaod 713 |
1
⊢ ((𝑃 ∈ ℙ ∧ 𝐴 ∈ ℤ) → ((𝐴↑𝑃) mod 𝑃) = (𝐴 mod 𝑃)) |