Step |
Hyp |
Ref |
Expression |
1 |
|
eucalgval.1 |
⊢ 𝐸 = ( 𝑥 ∈ ℕ0 , 𝑦 ∈ ℕ0 ↦ if ( 𝑦 = 0 , 〈 𝑥 , 𝑦 〉 , 〈 𝑦 , ( 𝑥 mod 𝑦 ) 〉 ) ) |
2 |
1
|
eucalgval |
⊢ ( 𝑋 ∈ ( ℕ0 × ℕ0 ) → ( 𝐸 ‘ 𝑋 ) = if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) ) |
3 |
2
|
adantr |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 𝐸 ‘ 𝑋 ) = if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) ) |
4 |
|
simpr |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) |
5 |
|
iftrue |
⊢ ( ( 2nd ‘ 𝑋 ) = 0 → if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) = 𝑋 ) |
6 |
5
|
eqeq2d |
⊢ ( ( 2nd ‘ 𝑋 ) = 0 → ( ( 𝐸 ‘ 𝑋 ) = if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) ↔ ( 𝐸 ‘ 𝑋 ) = 𝑋 ) ) |
7 |
|
fveq2 |
⊢ ( ( 𝐸 ‘ 𝑋 ) = 𝑋 → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( 2nd ‘ 𝑋 ) ) |
8 |
6 7
|
syl6bi |
⊢ ( ( 2nd ‘ 𝑋 ) = 0 → ( ( 𝐸 ‘ 𝑋 ) = if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( 2nd ‘ 𝑋 ) ) ) |
9 |
|
eqeq2 |
⊢ ( ( 2nd ‘ 𝑋 ) = 0 → ( ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( 2nd ‘ 𝑋 ) ↔ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = 0 ) ) |
10 |
8 9
|
sylibd |
⊢ ( ( 2nd ‘ 𝑋 ) = 0 → ( ( 𝐸 ‘ 𝑋 ) = if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = 0 ) ) |
11 |
3 10
|
syl5com |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( ( 2nd ‘ 𝑋 ) = 0 → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = 0 ) ) |
12 |
11
|
necon3ad |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 → ¬ ( 2nd ‘ 𝑋 ) = 0 ) ) |
13 |
4 12
|
mpd |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ¬ ( 2nd ‘ 𝑋 ) = 0 ) |
14 |
13
|
iffalsed |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → if ( ( 2nd ‘ 𝑋 ) = 0 , 𝑋 , 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) = 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) |
15 |
3 14
|
eqtrd |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 𝐸 ‘ 𝑋 ) = 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) |
16 |
15
|
fveq2d |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( 2nd ‘ 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) ) |
17 |
|
fvex |
⊢ ( 2nd ‘ 𝑋 ) ∈ V |
18 |
|
fvex |
⊢ ( mod ‘ 𝑋 ) ∈ V |
19 |
17 18
|
op2nd |
⊢ ( 2nd ‘ 〈 ( 2nd ‘ 𝑋 ) , ( mod ‘ 𝑋 ) 〉 ) = ( mod ‘ 𝑋 ) |
20 |
16 19
|
eqtrdi |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( mod ‘ 𝑋 ) ) |
21 |
|
1st2nd2 |
⊢ ( 𝑋 ∈ ( ℕ0 × ℕ0 ) → 𝑋 = 〈 ( 1st ‘ 𝑋 ) , ( 2nd ‘ 𝑋 ) 〉 ) |
22 |
21
|
adantr |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → 𝑋 = 〈 ( 1st ‘ 𝑋 ) , ( 2nd ‘ 𝑋 ) 〉 ) |
23 |
22
|
fveq2d |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( mod ‘ 𝑋 ) = ( mod ‘ 〈 ( 1st ‘ 𝑋 ) , ( 2nd ‘ 𝑋 ) 〉 ) ) |
24 |
|
df-ov |
⊢ ( ( 1st ‘ 𝑋 ) mod ( 2nd ‘ 𝑋 ) ) = ( mod ‘ 〈 ( 1st ‘ 𝑋 ) , ( 2nd ‘ 𝑋 ) 〉 ) |
25 |
23 24
|
eqtr4di |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( mod ‘ 𝑋 ) = ( ( 1st ‘ 𝑋 ) mod ( 2nd ‘ 𝑋 ) ) ) |
26 |
20 25
|
eqtrd |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) = ( ( 1st ‘ 𝑋 ) mod ( 2nd ‘ 𝑋 ) ) ) |
27 |
|
xp1st |
⊢ ( 𝑋 ∈ ( ℕ0 × ℕ0 ) → ( 1st ‘ 𝑋 ) ∈ ℕ0 ) |
28 |
27
|
adantr |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 1st ‘ 𝑋 ) ∈ ℕ0 ) |
29 |
28
|
nn0red |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 1st ‘ 𝑋 ) ∈ ℝ ) |
30 |
|
xp2nd |
⊢ ( 𝑋 ∈ ( ℕ0 × ℕ0 ) → ( 2nd ‘ 𝑋 ) ∈ ℕ0 ) |
31 |
30
|
adantr |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ 𝑋 ) ∈ ℕ0 ) |
32 |
|
elnn0 |
⊢ ( ( 2nd ‘ 𝑋 ) ∈ ℕ0 ↔ ( ( 2nd ‘ 𝑋 ) ∈ ℕ ∨ ( 2nd ‘ 𝑋 ) = 0 ) ) |
33 |
31 32
|
sylib |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( ( 2nd ‘ 𝑋 ) ∈ ℕ ∨ ( 2nd ‘ 𝑋 ) = 0 ) ) |
34 |
33
|
ord |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( ¬ ( 2nd ‘ 𝑋 ) ∈ ℕ → ( 2nd ‘ 𝑋 ) = 0 ) ) |
35 |
13 34
|
mt3d |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ 𝑋 ) ∈ ℕ ) |
36 |
35
|
nnrpd |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ 𝑋 ) ∈ ℝ+ ) |
37 |
|
modlt |
⊢ ( ( ( 1st ‘ 𝑋 ) ∈ ℝ ∧ ( 2nd ‘ 𝑋 ) ∈ ℝ+ ) → ( ( 1st ‘ 𝑋 ) mod ( 2nd ‘ 𝑋 ) ) < ( 2nd ‘ 𝑋 ) ) |
38 |
29 36 37
|
syl2anc |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( ( 1st ‘ 𝑋 ) mod ( 2nd ‘ 𝑋 ) ) < ( 2nd ‘ 𝑋 ) ) |
39 |
26 38
|
eqbrtrd |
⊢ ( ( 𝑋 ∈ ( ℕ0 × ℕ0 ) ∧ ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 ) → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) < ( 2nd ‘ 𝑋 ) ) |
40 |
39
|
ex |
⊢ ( 𝑋 ∈ ( ℕ0 × ℕ0 ) → ( ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) ≠ 0 → ( 2nd ‘ ( 𝐸 ‘ 𝑋 ) ) < ( 2nd ‘ 𝑋 ) ) ) |