Step | Hyp | Ref
| Expression |
1 | | nn0uz 12549 |
. . . . . . . 8
⊢
ℕ0 = (ℤ≥‘0) |
2 | | eucalg.2 |
. . . . . . . 8
⊢ 𝑅 = seq0((𝐸 ∘ 1st ),
(ℕ0 × {𝐴})) |
3 | | 0zd 12261 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 0 ∈ ℤ) |
4 | | eucalg.3 |
. . . . . . . . 9
⊢ 𝐴 = 〈𝑀, 𝑁〉 |
5 | | opelxpi 5617 |
. . . . . . . . 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 16216 |
. . . . . . . . 9
⊢ 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0) |
9 | 8 | a1i 11 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0)) |
10 | 1, 2, 3, 6, 9 | algrf 16206 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝑅:ℕ0⟶(ℕ0
× ℕ0)) |
11 | | ffvelrn 6941 |
. . . . . . 7
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
12 | 10, 11 | sylancom 587 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
13 | | 1st2nd2 7843 |
. . . . . 6
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
14 | 12, 13 | syl 17 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
15 | 14 | fveq2d 6760 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉)) |
16 | | df-ov 7258 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉) |
17 | 15, 16 | eqtr4di 2797 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁)))) |
18 | 4 | fveq2i 6759 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘〈𝑀, 𝑁〉) |
19 | | op2ndg 7817 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘〈𝑀, 𝑁〉) = 𝑁) |
20 | 18, 19 | eqtrid 2790 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘𝐴) = 𝑁) |
21 | 20 | fveq2d 6760 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘(2nd ‘𝐴)) = (𝑅‘𝑁)) |
22 | 21 | fveq2d 6760 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = (2nd
‘(𝑅‘𝑁))) |
23 | | xp2nd 7837 |
. . . . . . . . 9
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
ℕ0) |
24 | 23 | nn0zd 12353 |
. . . . . . . 8
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈ ℤ) |
25 | | uzid 12526 |
. . . . . . . 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 16219 |
. . . . . . 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 7271 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ((1st ‘(𝑅‘𝑁)) gcd 0)) |
33 | | xp1st 7836 |
. . . 4
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (1st ‘(𝑅‘𝑁)) ∈
ℕ0) |
34 | | nn0gcdid0 16156 |
. . . 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 16217 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → ( gcd ‘(𝐸‘𝑧)) = ( gcd ‘𝑧)) |
38 | 8 | ffvelrni 6942 |
. . . . . . 7
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (𝐸‘𝑧) ∈ (ℕ0 ×
ℕ0)) |
39 | 38 | fvresd 6776 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = ( gcd ‘(𝐸‘𝑧))) |
40 | | fvres 6775 |
. . . . . 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 16208 |
. . . 4
⊢ ((𝐴 ∈ (ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (( gcd
↾ (ℕ0 × ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
43 | 6, 42 | sylancom 587 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
44 | 12 | fvresd 6776 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
45 | | 0nn0 12178 |
. . . . 5
⊢ 0 ∈
ℕ0 |
46 | | ffvelrn 6941 |
. . . . 5
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 0 ∈ ℕ0) → (𝑅‘0) ∈
(ℕ0 × ℕ0)) |
47 | 10, 45, 46 | sylancl 585 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) ∈ (ℕ0
× ℕ0)) |
48 | 47 | fvresd 6776 |
. . 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 16205 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 𝐴) |
51 | 50, 4 | eqtrdi 2795 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 〈𝑀, 𝑁〉) |
52 | 51 | fveq2d 6760 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = ( gcd ‘〈𝑀, 𝑁〉)) |
53 | | df-ov 7258 |
. . 3
⊢ (𝑀 gcd 𝑁) = ( gcd ‘〈𝑀, 𝑁〉) |
54 | 52, 53 | eqtr4di 2797 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = (𝑀 gcd 𝑁)) |
55 | 36, 49, 54 | 3eqtrd 2782 |
1
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = (𝑀 gcd 𝑁)) |