Step | Hyp | Ref
| Expression |
1 | | nn0uz 9500 |
. . . . . . . 8
⊢
ℕ0 = (ℤ≥‘0) |
2 | | eucalg.2 |
. . . . . . . 8
⊢ 𝑅 = seq0((𝐸 ∘ 1st ),
(ℕ0 × {𝐴})) |
3 | | 0zd 9203 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 0 ∈ ℤ) |
4 | | eucalg.3 |
. . . . . . . . 9
⊢ 𝐴 = 〈𝑀, 𝑁〉 |
5 | | opelxpi 4636 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 〈𝑀, 𝑁〉 ∈ (ℕ0 ×
ℕ0)) |
6 | 4, 5 | eqeltrid 2253 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐴 ∈ (ℕ0 ×
ℕ0)) |
7 | | eucalgval.1 |
. . . . . . . . . 10
⊢ 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0
↦ if(𝑦 = 0,
〈𝑥, 𝑦〉, 〈𝑦, (𝑥 mod 𝑦)〉)) |
8 | 7 | eucalgf 11987 |
. . . . . . . . 9
⊢ 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0) |
9 | 8 | a1i 9 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0)) |
10 | 1, 2, 3, 6, 9 | algrf 11977 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝑅:ℕ0⟶(ℕ0
× ℕ0)) |
11 | | ffvelrn 5618 |
. . . . . . 7
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
12 | 10, 11 | sylancom 417 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
13 | | 1st2nd2 6143 |
. . . . . 6
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
14 | 12, 13 | syl 14 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
15 | 14 | fveq2d 5490 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉)) |
16 | | df-ov 5845 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉) |
17 | 15, 16 | eqtr4di 2217 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁)))) |
18 | 4 | fveq2i 5489 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘〈𝑀, 𝑁〉) |
19 | | op2ndg 6119 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘〈𝑀, 𝑁〉) = 𝑁) |
20 | 18, 19 | syl5eq 2211 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘𝐴) = 𝑁) |
21 | 20 | fveq2d 5490 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘(2nd ‘𝐴)) = (𝑅‘𝑁)) |
22 | 21 | fveq2d 5490 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = (2nd
‘(𝑅‘𝑁))) |
23 | | xp2nd 6134 |
. . . . . . . . 9
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
ℕ0) |
24 | 23 | nn0zd 9311 |
. . . . . . . 8
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈ ℤ) |
25 | | uzid 9480 |
. . . . . . . 8
⊢
((2nd ‘𝐴) ∈ ℤ → (2nd
‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
26 | 24, 25 | syl 14 |
. . . . . . 7
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
27 | | eqid 2165 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘𝐴) |
28 | 7, 2, 27 | eucalgcvga 11990 |
. . . . . . 7
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → ((2nd ‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴)) → (2nd ‘(𝑅‘(2nd
‘𝐴))) =
0)) |
29 | 26, 28 | mpd 13 |
. . . . . 6
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = 0) |
30 | 6, 29 | syl 14 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = 0) |
31 | 22, 30 | eqtr3d 2200 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘𝑁)) = 0) |
32 | 31 | oveq2d 5858 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ((1st ‘(𝑅‘𝑁)) gcd 0)) |
33 | | xp1st 6133 |
. . . 4
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (1st ‘(𝑅‘𝑁)) ∈
ℕ0) |
34 | | nn0gcdid0 11914 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) ∈ ℕ0 →
((1st ‘(𝑅‘𝑁)) gcd 0) = (1st ‘(𝑅‘𝑁))) |
35 | 12, 33, 34 | 3syl 17 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd 0) = (1st ‘(𝑅‘𝑁))) |
36 | 17, 32, 35 | 3eqtrrd 2203 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
37 | 7 | eucalginv 11988 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → ( gcd ‘(𝐸‘𝑧)) = ( gcd ‘𝑧)) |
38 | 8 | ffvelrni 5619 |
. . . . . . 7
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (𝐸‘𝑧) ∈ (ℕ0 ×
ℕ0)) |
39 | | fvres 5510 |
. . . . . . 7
⊢ ((𝐸‘𝑧) ∈ (ℕ0 ×
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = ( gcd ‘(𝐸‘𝑧))) |
40 | 38, 39 | syl 14 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = ( gcd ‘(𝐸‘𝑧))) |
41 | | fvres 5510 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘𝑧) = ( gcd ‘𝑧)) |
42 | 37, 40, 41 | 3eqtr4d 2208 |
. . . . 5
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = (( gcd ↾ (ℕ0
× ℕ0))‘𝑧)) |
43 | 2, 8, 42 | alginv 11979 |
. . . 4
⊢ ((𝐴 ∈ (ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (( gcd
↾ (ℕ0 × ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
44 | 6, 43 | sylancom 417 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
45 | | fvres 5510 |
. . . 4
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
46 | 12, 45 | syl 14 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
47 | | 0nn0 9129 |
. . . . 5
⊢ 0 ∈
ℕ0 |
48 | | ffvelrn 5618 |
. . . . 5
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 0 ∈ ℕ0) → (𝑅‘0) ∈
(ℕ0 × ℕ0)) |
49 | 10, 47, 48 | sylancl 410 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) ∈ (ℕ0
× ℕ0)) |
50 | | fvres 5510 |
. . . 4
⊢ ((𝑅‘0) ∈
(ℕ0 × ℕ0) → (( gcd ↾
(ℕ0 × ℕ0))‘(𝑅‘0)) = ( gcd ‘(𝑅‘0))) |
51 | 49, 50 | syl 14 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘0)) = ( gcd ‘(𝑅‘0))) |
52 | 44, 46, 51 | 3eqtr3d 2206 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘0))) |
53 | 1, 2, 3, 6, 9 | ialgr0 11976 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 𝐴) |
54 | 53, 4 | eqtrdi 2215 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 〈𝑀, 𝑁〉) |
55 | 54 | fveq2d 5490 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = ( gcd ‘〈𝑀, 𝑁〉)) |
56 | | df-ov 5845 |
. . 3
⊢ (𝑀 gcd 𝑁) = ( gcd ‘〈𝑀, 𝑁〉) |
57 | 55, 56 | eqtr4di 2217 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = (𝑀 gcd 𝑁)) |
58 | 36, 52, 57 | 3eqtrd 2202 |
1
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = (𝑀 gcd 𝑁)) |