Step | Hyp | Ref
| Expression |
1 | | eqeq2 2180 |
. 2
⊢
((ϕ‘(𝑀 /
𝑁)) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁)) ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
2 | | eqeq2 2180 |
. 2
⊢ (0 =
if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0 ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
3 | | nndivdvds 11758 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) → (𝑁 ∥ 𝑀 ↔ (𝑀 / 𝑁) ∈ ℕ)) |
4 | 3 | biimpa 294 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℕ) |
5 | | dfphi2 12174 |
. . . 4
⊢ ((𝑀 / 𝑁) ∈ ℕ → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
6 | 4, 5 | syl 14 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
7 | | 0z 9223 |
. . . . . 6
⊢ 0 ∈
ℤ |
8 | 4 | nnzd 9333 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℤ) |
9 | | fzofig 10388 |
. . . . . 6
⊢ ((0
∈ ℤ ∧ (𝑀 /
𝑁) ∈ ℤ) →
(0..^(𝑀 / 𝑁)) ∈ Fin) |
10 | 7, 8, 9 | sylancr 412 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (0..^(𝑀 / 𝑁)) ∈ Fin) |
11 | | elfzoelz 10103 |
. . . . . . . . . 10
⊢ (𝑦 ∈ (0..^(𝑀 / 𝑁)) → 𝑦 ∈ ℤ) |
12 | 11 | adantl 275 |
. . . . . . . . 9
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → 𝑦 ∈ ℤ) |
13 | 8 | adantr 274 |
. . . . . . . . 9
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑀 / 𝑁) ∈ ℤ) |
14 | 12, 13 | gcdcld 11923 |
. . . . . . . 8
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑦 gcd (𝑀 / 𝑁)) ∈
ℕ0) |
15 | 14 | nn0zd 9332 |
. . . . . . 7
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑦 gcd (𝑀 / 𝑁)) ∈ ℤ) |
16 | | 1zzd 9239 |
. . . . . . 7
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → 1 ∈
ℤ) |
17 | | zdceq 9287 |
. . . . . . 7
⊢ (((𝑦 gcd (𝑀 / 𝑁)) ∈ ℤ ∧ 1 ∈ ℤ)
→ DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
18 | 15, 16, 17 | syl2anc 409 |
. . . . . 6
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
19 | 18 | ralrimiva 2543 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → ∀𝑦 ∈ (0..^(𝑀 / 𝑁))DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
20 | 10, 19 | ssfirab 6911 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ∈ Fin) |
21 | | eqid 2170 |
. . . . . 6
⊢ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} = {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} |
22 | | eqid 2170 |
. . . . . 6
⊢ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} |
23 | | eqid 2170 |
. . . . . 6
⊢ (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) = (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) |
24 | 21, 22, 23 | hashgcdlem 12192 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
25 | 24 | 3expa 1198 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
26 | 20, 25 | fihasheqf1od 10724 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}) = (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁})) |
27 | 6, 26 | eqtr2d 2204 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁))) |
28 | | simprr 527 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) = 𝑁) |
29 | | elfzoelz 10103 |
. . . . . . . . . . . . 13
⊢ (𝑥 ∈ (0..^𝑀) → 𝑥 ∈ ℤ) |
30 | 29 | ad2antrl 487 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑥 ∈ ℤ) |
31 | | nnz 9231 |
. . . . . . . . . . . . 13
⊢ (𝑀 ∈ ℕ → 𝑀 ∈
ℤ) |
32 | 31 | ad2antrr 485 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑀 ∈ ℤ) |
33 | | gcddvds 11918 |
. . . . . . . . . . . 12
⊢ ((𝑥 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
34 | 30, 32, 33 | syl2anc 409 |
. . . . . . . . . . 11
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
35 | 34 | simprd 113 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) ∥ 𝑀) |
36 | 28, 35 | eqbrtrrd 4013 |
. . . . . . . . 9
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑁 ∥ 𝑀) |
37 | 36 | expr 373 |
. . . . . . . 8
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → ((𝑥 gcd 𝑀) = 𝑁 → 𝑁 ∥ 𝑀)) |
38 | 37 | con3d 626 |
. . . . . . 7
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → (¬ 𝑁 ∥ 𝑀 → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
39 | 38 | impancom 258 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (𝑥 ∈ (0..^𝑀) → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
40 | 39 | ralrimiv 2542 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
41 | | rabeq0 3444 |
. . . . 5
⊢ ({𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅ ↔ ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
42 | 40, 41 | sylibr 133 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅) |
43 | 42 | fveq2d 5500 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) =
(♯‘∅)) |
44 | | hash0 10731 |
. . 3
⊢
(♯‘∅) = 0 |
45 | 43, 44 | eqtrdi 2219 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0) |
46 | | dvdsdc 11760 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ 𝑀 ∈ ℤ) →
DECID 𝑁
∥ 𝑀) |
47 | 31, 46 | sylan2 284 |
. . 3
⊢ ((𝑁 ∈ ℕ ∧ 𝑀 ∈ ℕ) →
DECID 𝑁
∥ 𝑀) |
48 | 47 | ancoms 266 |
. 2
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
DECID 𝑁
∥ 𝑀) |
49 | 1, 2, 27, 45, 48 | ifbothdadc 3557 |
1
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
(♯‘{𝑥 ∈
(0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0)) |