Step | Hyp | Ref
| Expression |
1 | | nn0uz 12620 |
. . . . . . . 8
⊢
ℕ0 = (ℤ≥‘0) |
2 | | eucalg.2 |
. . . . . . . 8
⊢ 𝑅 = seq0((𝐸 ∘ 1st ),
(ℕ0 × {𝐴})) |
3 | | 0zd 12331 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 0 ∈ ℤ) |
4 | | eucalg.3 |
. . . . . . . . 9
⊢ 𝐴 = 〈𝑀, 𝑁〉 |
5 | | opelxpi 5626 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 〈𝑀, 𝑁〉 ∈ (ℕ0 ×
ℕ0)) |
6 | 4, 5 | eqeltrid 2843 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐴 ∈ (ℕ0 ×
ℕ0)) |
7 | | eucalgval.1 |
. . . . . . . . . 10
⊢ 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0
↦ if(𝑦 = 0,
〈𝑥, 𝑦〉, 〈𝑦, (𝑥 mod 𝑦)〉)) |
8 | 7 | eucalgf 16288 |
. . . . . . . . 9
⊢ 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0) |
9 | 8 | a1i 11 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0)) |
10 | 1, 2, 3, 6, 9 | algrf 16278 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝑅:ℕ0⟶(ℕ0
× ℕ0)) |
11 | | ffvelrn 6959 |
. . . . . . 7
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
12 | 10, 11 | sylancom 588 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
13 | | 1st2nd2 7870 |
. . . . . 6
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
14 | 12, 13 | syl 17 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
15 | 14 | fveq2d 6778 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉)) |
16 | | df-ov 7278 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉) |
17 | 15, 16 | eqtr4di 2796 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁)))) |
18 | 4 | fveq2i 6777 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘〈𝑀, 𝑁〉) |
19 | | op2ndg 7844 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘〈𝑀, 𝑁〉) = 𝑁) |
20 | 18, 19 | eqtrid 2790 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘𝐴) = 𝑁) |
21 | 20 | fveq2d 6778 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘(2nd ‘𝐴)) = (𝑅‘𝑁)) |
22 | 21 | fveq2d 6778 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = (2nd
‘(𝑅‘𝑁))) |
23 | | xp2nd 7864 |
. . . . . . . . 9
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
ℕ0) |
24 | 23 | nn0zd 12424 |
. . . . . . . 8
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈ ℤ) |
25 | | uzid 12597 |
. . . . . . . 8
⊢
((2nd ‘𝐴) ∈ ℤ → (2nd
‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
26 | 24, 25 | syl 17 |
. . . . . . 7
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
27 | | eqid 2738 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘𝐴) |
28 | 7, 2, 27 | eucalgcvga 16291 |
. . . . . . 7
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → ((2nd ‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴)) → (2nd ‘(𝑅‘(2nd
‘𝐴))) =
0)) |
29 | 26, 28 | mpd 15 |
. . . . . 6
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = 0) |
30 | 6, 29 | syl 17 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = 0) |
31 | 22, 30 | eqtr3d 2780 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘𝑁)) = 0) |
32 | 31 | oveq2d 7291 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ((1st ‘(𝑅‘𝑁)) gcd 0)) |
33 | | xp1st 7863 |
. . . 4
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (1st ‘(𝑅‘𝑁)) ∈
ℕ0) |
34 | | nn0gcdid0 16228 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) ∈ ℕ0 →
((1st ‘(𝑅‘𝑁)) gcd 0) = (1st ‘(𝑅‘𝑁))) |
35 | 12, 33, 34 | 3syl 18 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd 0) = (1st ‘(𝑅‘𝑁))) |
36 | 17, 32, 35 | 3eqtrrd 2783 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
37 | 7 | eucalginv 16289 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → ( gcd ‘(𝐸‘𝑧)) = ( gcd ‘𝑧)) |
38 | 8 | ffvelrni 6960 |
. . . . . . 7
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (𝐸‘𝑧) ∈ (ℕ0 ×
ℕ0)) |
39 | 38 | fvresd 6794 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = ( gcd ‘(𝐸‘𝑧))) |
40 | | fvres 6793 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘𝑧) = ( gcd ‘𝑧)) |
41 | 37, 39, 40 | 3eqtr4d 2788 |
. . . . 5
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = (( gcd ↾ (ℕ0
× ℕ0))‘𝑧)) |
42 | 2, 8, 41 | alginv 16280 |
. . . 4
⊢ ((𝐴 ∈ (ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (( gcd
↾ (ℕ0 × ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
43 | 6, 42 | sylancom 588 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
44 | 12 | fvresd 6794 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
45 | | 0nn0 12248 |
. . . . 5
⊢ 0 ∈
ℕ0 |
46 | | ffvelrn 6959 |
. . . . 5
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 0 ∈ ℕ0) → (𝑅‘0) ∈
(ℕ0 × ℕ0)) |
47 | 10, 45, 46 | sylancl 586 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) ∈ (ℕ0
× ℕ0)) |
48 | 47 | fvresd 6794 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘0)) = ( gcd ‘(𝑅‘0))) |
49 | 43, 44, 48 | 3eqtr3d 2786 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘0))) |
50 | 1, 2, 3, 6 | algr0 16277 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 𝐴) |
51 | 50, 4 | eqtrdi 2794 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 〈𝑀, 𝑁〉) |
52 | 51 | fveq2d 6778 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = ( gcd ‘〈𝑀, 𝑁〉)) |
53 | | df-ov 7278 |
. . 3
⊢ (𝑀 gcd 𝑁) = ( gcd ‘〈𝑀, 𝑁〉) |
54 | 52, 53 | eqtr4di 2796 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = (𝑀 gcd 𝑁)) |
55 | 36, 49, 54 | 3eqtrd 2782 |
1
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = (𝑀 gcd 𝑁)) |