Step | Hyp | Ref
| Expression |
1 | | eqeq2 2750 |
. 2
⊢
((ϕ‘(𝑀 /
𝑁)) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁)) ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
2 | | eqeq2 2750 |
. 2
⊢ (0 =
if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0) → ((♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0 ↔ (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0))) |
3 | | nndivdvds 15900 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) → (𝑁 ∥ 𝑀 ↔ (𝑀 / 𝑁) ∈ ℕ)) |
4 | 3 | biimpa 476 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℕ) |
5 | | dfphi2 16403 |
. . . 4
⊢ ((𝑀 / 𝑁) ∈ ℕ → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
6 | 4, 5 | syl 17 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (ϕ‘(𝑀 / 𝑁)) = (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1})) |
7 | | eqid 2738 |
. . . . . 6
⊢ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} = {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} |
8 | | eqid 2738 |
. . . . . 6
⊢ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} |
9 | | eqid 2738 |
. . . . . 6
⊢ (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) = (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)) |
10 | 7, 8, 9 | hashgcdlem 16417 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
11 | 10 | 3expa 1116 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
12 | | ovex 7288 |
. . . . . 6
⊢
(0..^(𝑀 / 𝑁)) ∈ V |
13 | 12 | rabex 5251 |
. . . . 5
⊢ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ∈ V |
14 | 13 | f1oen 8716 |
. . . 4
⊢ ((𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} → {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ≈ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
15 | | hasheni 13990 |
. . . 4
⊢ ({𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ≈ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} → (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}) = (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁})) |
16 | 11, 14, 15 | 3syl 18 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}) = (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁})) |
17 | 6, 16 | eqtr2d 2779 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = (ϕ‘(𝑀 / 𝑁))) |
18 | | simprr 769 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) = 𝑁) |
19 | | elfzoelz 13316 |
. . . . . . . . . . . . 13
⊢ (𝑥 ∈ (0..^𝑀) → 𝑥 ∈ ℤ) |
20 | 19 | ad2antrl 724 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑥 ∈ ℤ) |
21 | | nnz 12272 |
. . . . . . . . . . . . 13
⊢ (𝑀 ∈ ℕ → 𝑀 ∈
ℤ) |
22 | 21 | ad2antrr 722 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑀 ∈ ℤ) |
23 | | gcddvds 16138 |
. . . . . . . . . . . 12
⊢ ((𝑥 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
24 | 20, 22, 23 | syl2anc 583 |
. . . . . . . . . . 11
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
25 | 24 | simprd 495 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) ∥ 𝑀) |
26 | 18, 25 | eqbrtrrd 5094 |
. . . . . . . . 9
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑁 ∥ 𝑀) |
27 | 26 | expr 456 |
. . . . . . . 8
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → ((𝑥 gcd 𝑀) = 𝑁 → 𝑁 ∥ 𝑀)) |
28 | 27 | con3d 152 |
. . . . . . 7
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → (¬ 𝑁 ∥ 𝑀 → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
29 | 28 | impancom 451 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (𝑥 ∈ (0..^𝑀) → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
30 | 29 | ralrimiv 3106 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
31 | | rabeq0 4315 |
. . . . 5
⊢ ({𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅ ↔ ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
32 | 30, 31 | sylibr 233 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅) |
33 | 32 | fveq2d 6760 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) =
(♯‘∅)) |
34 | | hash0 14010 |
. . 3
⊢
(♯‘∅) = 0 |
35 | 33, 34 | eqtrdi 2795 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0) |
36 | 1, 2, 17, 35 | ifbothda 4494 |
1
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
(♯‘{𝑥 ∈
(0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0)) |