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 15972 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) → (𝑁 ∥ 𝑀 ↔ (𝑀 / 𝑁) ∈ ℕ)) |
4 | 3 | biimpa 477 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑀 / 𝑁) ∈ ℕ) |
5 | | dfphi2 16475 |
. . . 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 16489 |
. . . . 5
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
11 | 10 | 3expa 1117 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑁 ∥ 𝑀) → (𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
12 | | ovex 7308 |
. . . . . 6
⊢
(0..^(𝑀 / 𝑁)) ∈ V |
13 | 12 | rabex 5256 |
. . . . 5
⊢ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ∈ V |
14 | 13 | f1oen 8761 |
. . . 4
⊢ ((𝑧 ∈ {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ↦ (𝑧 · 𝑁)):{𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1}–1-1-onto→{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} → {𝑦 ∈ (0..^(𝑀 / 𝑁)) ∣ (𝑦 gcd (𝑀 / 𝑁)) = 1} ≈ {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) |
15 | | hasheni 14062 |
. . . 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 770 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) = 𝑁) |
19 | | elfzoelz 13387 |
. . . . . . . . . . . . 13
⊢ (𝑥 ∈ (0..^𝑀) → 𝑥 ∈ ℤ) |
20 | 19 | ad2antrl 725 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑥 ∈ ℤ) |
21 | | nnz 12342 |
. . . . . . . . . . . . 13
⊢ (𝑀 ∈ ℕ → 𝑀 ∈
ℤ) |
22 | 21 | ad2antrr 723 |
. . . . . . . . . . . 12
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑀 ∈ ℤ) |
23 | | gcddvds 16210 |
. . . . . . . . . . . 12
⊢ ((𝑥 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
24 | 20, 22, 23 | syl2anc 584 |
. . . . . . . . . . 11
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → ((𝑥 gcd 𝑀) ∥ 𝑥 ∧ (𝑥 gcd 𝑀) ∥ 𝑀)) |
25 | 24 | simprd 496 |
. . . . . . . . . 10
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → (𝑥 gcd 𝑀) ∥ 𝑀) |
26 | 18, 25 | eqbrtrrd 5098 |
. . . . . . . . 9
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ (𝑥 ∈ (0..^𝑀) ∧ (𝑥 gcd 𝑀) = 𝑁)) → 𝑁 ∥ 𝑀) |
27 | 26 | expr 457 |
. . . . . . . 8
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → ((𝑥 gcd 𝑀) = 𝑁 → 𝑁 ∥ 𝑀)) |
28 | 27 | con3d 152 |
. . . . . . 7
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ 𝑥 ∈ (0..^𝑀)) → (¬ 𝑁 ∥ 𝑀 → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
29 | 28 | impancom 452 |
. . . . . 6
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (𝑥 ∈ (0..^𝑀) → ¬ (𝑥 gcd 𝑀) = 𝑁)) |
30 | 29 | ralrimiv 3102 |
. . . . 5
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
31 | | rabeq0 4318 |
. . . . 5
⊢ ({𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅ ↔ ∀𝑥 ∈ (0..^𝑀) ¬ (𝑥 gcd 𝑀) = 𝑁) |
32 | 30, 31 | sylibr 233 |
. . . 4
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → {𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁} = ∅) |
33 | 32 | fveq2d 6778 |
. . 3
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) =
(♯‘∅)) |
34 | | hash0 14082 |
. . 3
⊢
(♯‘∅) = 0 |
35 | 33, 34 | eqtrdi 2794 |
. 2
⊢ (((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) ∧ ¬
𝑁 ∥ 𝑀) → (♯‘{𝑥 ∈ (0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = 0) |
36 | 1, 2, 17, 35 | ifbothda 4497 |
1
⊢ ((𝑀 ∈ ℕ ∧ 𝑁 ∈ ℕ) →
(♯‘{𝑥 ∈
(0..^𝑀) ∣ (𝑥 gcd 𝑀) = 𝑁}) = if(𝑁 ∥ 𝑀, (ϕ‘(𝑀 / 𝑁)), 0)) |