Step | Hyp | Ref
| Expression |
1 | | nn0uz 12476 |
. . . . . . . 8
⊢
ℕ0 = (ℤ≥‘0) |
2 | | eucalg.2 |
. . . . . . . 8
⊢ 𝑅 = seq0((𝐸 ∘ 1st ),
(ℕ0 × {𝐴})) |
3 | | 0zd 12188 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 0 ∈ ℤ) |
4 | | eucalg.3 |
. . . . . . . . 9
⊢ 𝐴 = 〈𝑀, 𝑁〉 |
5 | | opelxpi 5588 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 〈𝑀, 𝑁〉 ∈ (ℕ0 ×
ℕ0)) |
6 | 4, 5 | eqeltrid 2842 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐴 ∈ (ℕ0 ×
ℕ0)) |
7 | | eucalgval.1 |
. . . . . . . . . 10
⊢ 𝐸 = (𝑥 ∈ ℕ0, 𝑦 ∈ ℕ0
↦ if(𝑦 = 0,
〈𝑥, 𝑦〉, 〈𝑦, (𝑥 mod 𝑦)〉)) |
8 | 7 | eucalgf 16140 |
. . . . . . . . 9
⊢ 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0) |
9 | 8 | a1i 11 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝐸:(ℕ0 ×
ℕ0)⟶(ℕ0 ×
ℕ0)) |
10 | 1, 2, 3, 6, 9 | algrf 16130 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → 𝑅:ℕ0⟶(ℕ0
× ℕ0)) |
11 | | ffvelrn 6902 |
. . . . . . 7
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
12 | 10, 11 | sylancom 591 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0)) |
13 | | 1st2nd2 7800 |
. . . . . 6
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
14 | 12, 13 | syl 17 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘𝑁) = 〈(1st ‘(𝑅‘𝑁)), (2nd ‘(𝑅‘𝑁))〉) |
15 | 14 | fveq2d 6721 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉)) |
16 | | df-ov 7216 |
. . . 4
⊢
((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ( gcd ‘〈(1st
‘(𝑅‘𝑁)), (2nd
‘(𝑅‘𝑁))〉) |
17 | 15, 16 | eqtr4di 2796 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁)))) |
18 | 4 | fveq2i 6720 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘〈𝑀, 𝑁〉) |
19 | | op2ndg 7774 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘〈𝑀, 𝑁〉) = 𝑁) |
20 | 18, 19 | syl5eq 2790 |
. . . . . . 7
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘𝐴) = 𝑁) |
21 | 20 | fveq2d 6721 |
. . . . . 6
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘(2nd ‘𝐴)) = (𝑅‘𝑁)) |
22 | 21 | fveq2d 6721 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘(2nd ‘𝐴))) = (2nd
‘(𝑅‘𝑁))) |
23 | | xp2nd 7794 |
. . . . . . . . 9
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
ℕ0) |
24 | 23 | nn0zd 12280 |
. . . . . . . 8
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈ ℤ) |
25 | | uzid 12453 |
. . . . . . . 8
⊢
((2nd ‘𝐴) ∈ ℤ → (2nd
‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
26 | 24, 25 | syl 17 |
. . . . . . 7
⊢ (𝐴 ∈ (ℕ0
× ℕ0) → (2nd ‘𝐴) ∈
(ℤ≥‘(2nd ‘𝐴))) |
27 | | eqid 2737 |
. . . . . . . 8
⊢
(2nd ‘𝐴) = (2nd ‘𝐴) |
28 | 7, 2, 27 | eucalgcvga 16143 |
. . . . . . 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 2779 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (2nd ‘(𝑅‘𝑁)) = 0) |
32 | 31 | oveq2d 7229 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ((1st ‘(𝑅‘𝑁)) gcd (2nd ‘(𝑅‘𝑁))) = ((1st ‘(𝑅‘𝑁)) gcd 0)) |
33 | | xp1st 7793 |
. . . 4
⊢ ((𝑅‘𝑁) ∈ (ℕ0 ×
ℕ0) → (1st ‘(𝑅‘𝑁)) ∈
ℕ0) |
34 | | nn0gcdid0 16080 |
. . . 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 2782 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
37 | 7 | eucalginv 16141 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → ( gcd ‘(𝐸‘𝑧)) = ( gcd ‘𝑧)) |
38 | 8 | ffvelrni 6903 |
. . . . . . 7
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (𝐸‘𝑧) ∈ (ℕ0 ×
ℕ0)) |
39 | 38 | fvresd 6737 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = ( gcd ‘(𝐸‘𝑧))) |
40 | | fvres 6736 |
. . . . . 6
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘𝑧) = ( gcd ‘𝑧)) |
41 | 37, 39, 40 | 3eqtr4d 2787 |
. . . . 5
⊢ (𝑧 ∈ (ℕ0
× ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝐸‘𝑧)) = (( gcd ↾ (ℕ0
× ℕ0))‘𝑧)) |
42 | 2, 8, 41 | alginv 16132 |
. . . 4
⊢ ((𝐴 ∈ (ℕ0
× ℕ0) ∧ 𝑁 ∈ ℕ0) → (( gcd
↾ (ℕ0 × ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
43 | 6, 42 | sylancom 591 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = (( gcd ↾ (ℕ0
× ℕ0))‘(𝑅‘0))) |
44 | 12 | fvresd 6737 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘𝑁))) |
45 | | 0nn0 12105 |
. . . . 5
⊢ 0 ∈
ℕ0 |
46 | | ffvelrn 6902 |
. . . . 5
⊢ ((𝑅:ℕ0⟶(ℕ0
× ℕ0) ∧ 0 ∈ ℕ0) → (𝑅‘0) ∈
(ℕ0 × ℕ0)) |
47 | 10, 45, 46 | sylancl 589 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) ∈ (ℕ0
× ℕ0)) |
48 | 47 | fvresd 6737 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (( gcd ↾ (ℕ0 ×
ℕ0))‘(𝑅‘0)) = ( gcd ‘(𝑅‘0))) |
49 | 43, 44, 48 | 3eqtr3d 2785 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘𝑁)) = ( gcd ‘(𝑅‘0))) |
50 | 1, 2, 3, 6 | algr0 16129 |
. . . . 5
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 𝐴) |
51 | 50, 4 | eqtrdi 2794 |
. . . 4
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (𝑅‘0) = 〈𝑀, 𝑁〉) |
52 | 51 | fveq2d 6721 |
. . 3
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = ( gcd ‘〈𝑀, 𝑁〉)) |
53 | | df-ov 7216 |
. . 3
⊢ (𝑀 gcd 𝑁) = ( gcd ‘〈𝑀, 𝑁〉) |
54 | 52, 53 | eqtr4di 2796 |
. 2
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → ( gcd ‘(𝑅‘0)) = (𝑀 gcd 𝑁)) |
55 | 36, 49, 54 | 3eqtrd 2781 |
1
⊢ ((𝑀 ∈ ℕ0
∧ 𝑁 ∈
ℕ0) → (1st ‘(𝑅‘𝑁)) = (𝑀 gcd 𝑁)) |