Proof of Theorem wilthlem1
Step | Hyp | Ref
| Expression |
1 | | elfzelz 13185 |
. . . . . . . . . 10
⊢ (𝑁 ∈ (1...(𝑃 − 1)) → 𝑁 ∈ ℤ) |
2 | 1 | adantl 481 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ ℤ) |
3 | | peano2zm 12293 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → (𝑁 − 1) ∈
ℤ) |
4 | 2, 3 | syl 17 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 − 1) ∈ ℤ) |
5 | 4 | zcnd 12356 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 − 1) ∈ ℂ) |
6 | 2 | peano2zd 12358 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 + 1) ∈ ℤ) |
7 | 6 | zcnd 12356 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 + 1) ∈ ℂ) |
8 | 5, 7 | mulcomd 10927 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 − 1) · (𝑁 + 1)) = ((𝑁 + 1) · (𝑁 − 1))) |
9 | 2 | zcnd 12356 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ ℂ) |
10 | | ax-1cn 10860 |
. . . . . . 7
⊢ 1 ∈
ℂ |
11 | | subsq 13854 |
. . . . . . 7
⊢ ((𝑁 ∈ ℂ ∧ 1 ∈
ℂ) → ((𝑁↑2)
− (1↑2)) = ((𝑁 +
1) · (𝑁 −
1))) |
12 | 9, 10, 11 | sylancl 585 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁↑2) − (1↑2)) = ((𝑁 + 1) · (𝑁 − 1))) |
13 | 9 | sqvald 13789 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁↑2) = (𝑁 · 𝑁)) |
14 | | sq1 13840 |
. . . . . . . 8
⊢
(1↑2) = 1 |
15 | 14 | a1i 11 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (1↑2) =
1) |
16 | 13, 15 | oveq12d 7273 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁↑2) − (1↑2)) = ((𝑁 · 𝑁) − 1)) |
17 | 8, 12, 16 | 3eqtr2d 2784 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 − 1) · (𝑁 + 1)) = ((𝑁 · 𝑁) − 1)) |
18 | 17 | breq2d 5082 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ ((𝑁 − 1) · (𝑁 + 1)) ↔ 𝑃 ∥ ((𝑁 · 𝑁) − 1))) |
19 | | fz1ssfz0 13281 |
. . . . . 6
⊢
(1...(𝑃 − 1))
⊆ (0...(𝑃 −
1)) |
20 | | simpr 484 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ (1...(𝑃 − 1))) |
21 | 19, 20 | sselid 3915 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ (0...(𝑃 − 1))) |
22 | 21 | biantrurd 532 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ ((𝑁 · 𝑁) − 1) ↔ (𝑁 ∈ (0...(𝑃 − 1)) ∧ 𝑃 ∥ ((𝑁 · 𝑁) − 1)))) |
23 | 18, 22 | bitrd 278 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ ((𝑁 − 1) · (𝑁 + 1)) ↔ (𝑁 ∈ (0...(𝑃 − 1)) ∧ 𝑃 ∥ ((𝑁 · 𝑁) − 1)))) |
24 | | simpl 482 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈ ℙ) |
25 | | euclemma 16346 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ (𝑁 − 1) ∈ ℤ ∧
(𝑁 + 1) ∈ ℤ)
→ (𝑃 ∥ ((𝑁 − 1) · (𝑁 + 1)) ↔ (𝑃 ∥ (𝑁 − 1) ∨ 𝑃 ∥ (𝑁 + 1)))) |
26 | 24, 4, 6, 25 | syl3anc 1369 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ ((𝑁 − 1) · (𝑁 + 1)) ↔ (𝑃 ∥ (𝑁 − 1) ∨ 𝑃 ∥ (𝑁 + 1)))) |
27 | | prmnn 16307 |
. . . . 5
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℕ) |
28 | | fzm1ndvds 15959 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ¬ 𝑃 ∥ 𝑁) |
29 | 27, 28 | sylan 579 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ¬ 𝑃 ∥ 𝑁) |
30 | | eqid 2738 |
. . . . 5
⊢ ((𝑁↑(𝑃 − 2)) mod 𝑃) = ((𝑁↑(𝑃 − 2)) mod 𝑃) |
31 | 30 | prmdiveq 16415 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ ℤ ∧ ¬
𝑃 ∥ 𝑁) → ((𝑁 ∈ (0...(𝑃 − 1)) ∧ 𝑃 ∥ ((𝑁 · 𝑁) − 1)) ↔ 𝑁 = ((𝑁↑(𝑃 − 2)) mod 𝑃))) |
32 | 24, 2, 29, 31 | syl3anc 1369 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 ∈ (0...(𝑃 − 1)) ∧ 𝑃 ∥ ((𝑁 · 𝑁) − 1)) ↔ 𝑁 = ((𝑁↑(𝑃 − 2)) mod 𝑃))) |
33 | 23, 26, 32 | 3bitr3rd 309 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 = ((𝑁↑(𝑃 − 2)) mod 𝑃) ↔ (𝑃 ∥ (𝑁 − 1) ∨ 𝑃 ∥ (𝑁 + 1)))) |
34 | 24, 27 | syl 17 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈ ℕ) |
35 | | 1zzd 12281 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 1 ∈
ℤ) |
36 | | moddvds 15902 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑁 ∈ ℤ ∧ 1 ∈
ℤ) → ((𝑁 mod
𝑃) = (1 mod 𝑃) ↔ 𝑃 ∥ (𝑁 − 1))) |
37 | 34, 2, 35, 36 | syl3anc 1369 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 mod 𝑃) = (1 mod 𝑃) ↔ 𝑃 ∥ (𝑁 − 1))) |
38 | | elfznn 13214 |
. . . . . . . 8
⊢ (𝑁 ∈ (1...(𝑃 − 1)) → 𝑁 ∈ ℕ) |
39 | 38 | adantl 481 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ ℕ) |
40 | 39 | nnred 11918 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈ ℝ) |
41 | 34 | nnrpd 12699 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈
ℝ+) |
42 | 39 | nnnn0d 12223 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ∈
ℕ0) |
43 | 42 | nn0ge0d 12226 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 0 ≤ 𝑁) |
44 | | elfzle2 13189 |
. . . . . . . 8
⊢ (𝑁 ∈ (1...(𝑃 − 1)) → 𝑁 ≤ (𝑃 − 1)) |
45 | 44 | adantl 481 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 ≤ (𝑃 − 1)) |
46 | | prmz 16308 |
. . . . . . . 8
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
ℤ) |
47 | | zltlem1 12303 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 < 𝑃 ↔ 𝑁 ≤ (𝑃 − 1))) |
48 | 1, 46, 47 | syl2anr 596 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 < 𝑃 ↔ 𝑁 ≤ (𝑃 − 1))) |
49 | 45, 48 | mpbird 256 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑁 < 𝑃) |
50 | | modid 13544 |
. . . . . 6
⊢ (((𝑁 ∈ ℝ ∧ 𝑃 ∈ ℝ+)
∧ (0 ≤ 𝑁 ∧ 𝑁 < 𝑃)) → (𝑁 mod 𝑃) = 𝑁) |
51 | 40, 41, 43, 49, 50 | syl22anc 835 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 mod 𝑃) = 𝑁) |
52 | 34 | nnred 11918 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈ ℝ) |
53 | | prmuz2 16329 |
. . . . . . . 8
⊢ (𝑃 ∈ ℙ → 𝑃 ∈
(ℤ≥‘2)) |
54 | 24, 53 | syl 17 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈
(ℤ≥‘2)) |
55 | | eluz2gt1 12589 |
. . . . . . 7
⊢ (𝑃 ∈
(ℤ≥‘2) → 1 < 𝑃) |
56 | 54, 55 | syl 17 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 1 < 𝑃) |
57 | | 1mod 13551 |
. . . . . 6
⊢ ((𝑃 ∈ ℝ ∧ 1 <
𝑃) → (1 mod 𝑃) = 1) |
58 | 52, 56, 57 | syl2anc 583 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (1 mod 𝑃) = 1) |
59 | 51, 58 | eqeq12d 2754 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 mod 𝑃) = (1 mod 𝑃) ↔ 𝑁 = 1)) |
60 | 37, 59 | bitr3d 280 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ (𝑁 − 1) ↔ 𝑁 = 1)) |
61 | 35 | znegcld 12357 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → -1 ∈
ℤ) |
62 | | moddvds 15902 |
. . . . 5
⊢ ((𝑃 ∈ ℕ ∧ 𝑁 ∈ ℤ ∧ -1 ∈
ℤ) → ((𝑁 mod
𝑃) = (-1 mod 𝑃) ↔ 𝑃 ∥ (𝑁 − -1))) |
63 | 34, 2, 61, 62 | syl3anc 1369 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 mod 𝑃) = (-1 mod 𝑃) ↔ 𝑃 ∥ (𝑁 − -1))) |
64 | 34 | nncnd 11919 |
. . . . . . . . . 10
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 𝑃 ∈ ℂ) |
65 | 64 | mulid2d 10924 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (1 · 𝑃) = 𝑃) |
66 | 65 | oveq2d 7271 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (-1 + (1 · 𝑃)) = (-1 + 𝑃)) |
67 | | neg1cn 12017 |
. . . . . . . . 9
⊢ -1 ∈
ℂ |
68 | | addcom 11091 |
. . . . . . . . 9
⊢ ((-1
∈ ℂ ∧ 𝑃
∈ ℂ) → (-1 + 𝑃) = (𝑃 + -1)) |
69 | 67, 64, 68 | sylancr 586 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (-1 + 𝑃) = (𝑃 + -1)) |
70 | | negsub 11199 |
. . . . . . . . 9
⊢ ((𝑃 ∈ ℂ ∧ 1 ∈
ℂ) → (𝑃 + -1) =
(𝑃 −
1)) |
71 | 64, 10, 70 | sylancl 585 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 + -1) = (𝑃 − 1)) |
72 | 66, 69, 71 | 3eqtrd 2782 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (-1 + (1 · 𝑃)) = (𝑃 − 1)) |
73 | 72 | oveq1d 7270 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((-1 + (1 ·
𝑃)) mod 𝑃) = ((𝑃 − 1) mod 𝑃)) |
74 | | neg1rr 12018 |
. . . . . . . 8
⊢ -1 ∈
ℝ |
75 | 74 | a1i 11 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → -1 ∈
ℝ) |
76 | | modcyc 13554 |
. . . . . . 7
⊢ ((-1
∈ ℝ ∧ 𝑃
∈ ℝ+ ∧ 1 ∈ ℤ) → ((-1 + (1 ·
𝑃)) mod 𝑃) = (-1 mod 𝑃)) |
77 | 75, 41, 35, 76 | syl3anc 1369 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((-1 + (1 ·
𝑃)) mod 𝑃) = (-1 mod 𝑃)) |
78 | | peano2rem 11218 |
. . . . . . . 8
⊢ (𝑃 ∈ ℝ → (𝑃 − 1) ∈
ℝ) |
79 | 52, 78 | syl 17 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 − 1) ∈ ℝ) |
80 | | nnm1nn0 12204 |
. . . . . . . . 9
⊢ (𝑃 ∈ ℕ → (𝑃 − 1) ∈
ℕ0) |
81 | 34, 80 | syl 17 |
. . . . . . . 8
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 − 1) ∈
ℕ0) |
82 | 81 | nn0ge0d 12226 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → 0 ≤ (𝑃 − 1)) |
83 | 52 | ltm1d 11837 |
. . . . . . 7
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 − 1) < 𝑃) |
84 | | modid 13544 |
. . . . . . 7
⊢ ((((𝑃 − 1) ∈ ℝ ∧
𝑃 ∈
ℝ+) ∧ (0 ≤ (𝑃 − 1) ∧ (𝑃 − 1) < 𝑃)) → ((𝑃 − 1) mod 𝑃) = (𝑃 − 1)) |
85 | 79, 41, 82, 83, 84 | syl22anc 835 |
. . . . . 6
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑃 − 1) mod 𝑃) = (𝑃 − 1)) |
86 | 73, 77, 85 | 3eqtr3d 2786 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (-1 mod 𝑃) = (𝑃 − 1)) |
87 | 51, 86 | eqeq12d 2754 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑁 mod 𝑃) = (-1 mod 𝑃) ↔ 𝑁 = (𝑃 − 1))) |
88 | | subneg 11200 |
. . . . . 6
⊢ ((𝑁 ∈ ℂ ∧ 1 ∈
ℂ) → (𝑁 −
-1) = (𝑁 +
1)) |
89 | 9, 10, 88 | sylancl 585 |
. . . . 5
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 − -1) = (𝑁 + 1)) |
90 | 89 | breq2d 5082 |
. . . 4
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ (𝑁 − -1) ↔ 𝑃 ∥ (𝑁 + 1))) |
91 | 63, 87, 90 | 3bitr3rd 309 |
. . 3
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑃 ∥ (𝑁 + 1) ↔ 𝑁 = (𝑃 − 1))) |
92 | 60, 91 | orbi12d 915 |
. 2
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → ((𝑃 ∥ (𝑁 − 1) ∨ 𝑃 ∥ (𝑁 + 1)) ↔ (𝑁 = 1 ∨ 𝑁 = (𝑃 − 1)))) |
93 | 33, 92 | bitrd 278 |
1
⊢ ((𝑃 ∈ ℙ ∧ 𝑁 ∈ (1...(𝑃 − 1))) → (𝑁 = ((𝑁↑(𝑃 − 2)) mod 𝑃) ↔ (𝑁 = 1 ∨ 𝑁 = (𝑃 − 1)))) |