Step | Hyp | Ref
| Expression |
1 | | eqeq2 2175 |
. 2
⊢
((ϕ‘(𝑀 /
𝑁)) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁)) ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
2 | | eqeq2 2175 |
. 2
⊢ (0 =
if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0 ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
3 | | nndivdvds 11736 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) → (𝑁 ∥ 𝑀 ↔ (𝑀 / 𝑁) ∈ ℕ)) |
4 | 3 | biimpa 294 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℕ) |
5 | | dfphi2 12152 |
. . . 4
⊢ ((𝑀 / 𝑁) ∈ ℕ → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
6 | 4, 5 | syl 14 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
7 | | 0z 9202 |
. . . . . 6
⊢ 0 ∈
ℤ |
8 | 4 | nnzd 9312 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℤ) |
9 | | fzofig 10367 |
. . . . . 6
⊢ ((0
∈ ℤ ∧ (𝑀 /
𝑁) ∈ ℤ) →
(0..^(𝑀 / 𝑁)) ∈ Fin) |
10 | 7, 8, 9 | sylancr 411 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (0..^(𝑀 / 𝑁)) ∈ Fin) |
11 | | elfzoelz 10082 |
. . . . . . . . . 10
⊢ (𝑦 ∈ (0..^(𝑀 / 𝑁)) → 𝑦 ∈ ℤ) |
12 | 11 | adantl 275 |
. . . . . . . . 9
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → 𝑦 ∈ ℤ) |
13 | 8 | adantr 274 |
. . . . . . . . 9
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑀 / 𝑁) ∈ ℤ) |
14 | 12, 13 | gcdcld 11901 |
. . . . . . . 8
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑦 gcd (𝑀 / 𝑁)) ∈
ℕ0) |
15 | 14 | nn0zd 9311 |
. . . . . . 7
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → (𝑦 gcd (𝑀 / 𝑁)) ∈ ℤ) |
16 | | 1zzd 9218 |
. . . . . . 7
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → 1 ∈
ℤ) |
17 | | zdceq 9266 |
. . . . . . 7
⊢ (((𝑦 gcd (𝑀 / 𝑁)) ∈ ℤ ∧ 1 ∈ ℤ)
→ DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
18 | 15, 16, 17 | syl2anc 409 |
. . . . . 6
⊢ ((((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) ∧ 𝑦 ∈ (0..^(𝑀 / 𝑁))) → DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
19 | 18 | ralrimiva 2539 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → ∀𝑦 ∈ (0..^(𝑀 / 𝑁))DECID (𝑦 gcd (𝑀 / 𝑁)) = 1) |
20 | 10, 19 | ssfirab 6899 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ∈ Fin) |
21 | | eqid 2165 |
. . . . . 6
⊢ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} = {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} |
22 | | eqid 2165 |
. . . . . 6
⊢ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} |
23 | | eqid 2165 |
. . . . . 6
⊢ (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) = (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) |
24 | 21, 22, 23 | hashgcdlem 12170 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
25 | 24 | 3expa 1193 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
26 | 20, 25 | fihasheqf1od 10703 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}) = (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁})) |
27 | 6, 26 | eqtr2d 2199 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁))) |
28 | | simprr 522 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) = 𝑁) |
29 | | elfzoelz 10082 |
. . . . . . . . . . . . 13
⊢ (𝑥 ∈ (0..^𝑀) → 𝑥 ∈ ℤ) |
30 | 29 | ad2antrl 482 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑥 ∈ ℤ) |
31 | | nnz 9210 |
. . . . . . . . . . . . 13
⊢ (𝑀 ∈ ℕ → 𝑀 ∈
ℤ) |
32 | 31 | ad2antrr 480 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑀 ∈ ℤ) |
33 | | gcddvds 11896 |
. . . . . . . . . . . 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 4006 |
. . . . . . . . 9
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑁 ∥ 𝑀) |
37 | 36 | expr 373 |
. . . . . . . 8
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → ((𝑥 gcd 𝑀) = 𝑁 → 𝑁 ∥ 𝑀)) |
38 | 37 | con3d 621 |
. . . . . . 7
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → (¬ 𝑁 ∥ 𝑀 → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
39 | 38 | impancom 258 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (𝑥 ∈ (0..^𝑀) → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
40 | 39 | ralrimiv 2538 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
41 | | rabeq0 3438 |
. . . . 5
⊢ ({𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅ ↔ ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
42 | 40, 41 | sylibr 133 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅) |
43 | 42 | fveq2d 5490 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) =
(♯‘∅)) |
44 | | hash0 10710 |
. . 3
⊢
(♯‘∅) = 0 |
45 | 43, 44 | eqtrdi 2215 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0) |
46 | | dvdsdc 11738 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ 𝑀 ∈ ℤ) →
DECID 𝑁
∥ 𝑀) |
47 | 31, 46 | sylan2 284 |
. . 3
⊢ ((𝑁 ∈ ℕ ∧ 𝑀 ∈ ℕ) →
DECID 𝑁
∥ 𝑀) |
48 | 47 | ancoms 266 |
. 2
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
DECID 𝑁
∥ 𝑀) |
49 | 1, 2, 27, 45, 48 | ifbothdadc 3551 |
1
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
(♯‘{𝑥 ∈
(0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0)) |