Metamath Proof Explorer


Definition df-denom

Description: The canonical denominator of a rational is the denominator of the rational's reduced fraction representation (no common factors, denominator positive). (Contributed by Stefan O'Rear, 13-Sep-2014)

Ref Expression
Assertion df-denom denom = ( 𝑦 ∈ ℚ ↦ ( 2nd ‘ ( 𝑥 ∈ ( ℤ × ℕ ) ( ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) ) = 1 ∧ 𝑦 = ( ( 1st𝑥 ) / ( 2nd𝑥 ) ) ) ) ) )

Detailed syntax breakdown

Step Hyp Ref Expression
0 cdenom denom
1 vy 𝑦
2 cq
3 c2nd 2nd
4 vx 𝑥
5 cz
6 cn
7 5 6 cxp ( ℤ × ℕ )
8 c1st 1st
9 4 cv 𝑥
10 9 8 cfv ( 1st𝑥 )
11 cgcd gcd
12 9 3 cfv ( 2nd𝑥 )
13 10 12 11 co ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) )
14 c1 1
15 13 14 wceq ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) ) = 1
16 1 cv 𝑦
17 cdiv /
18 10 12 17 co ( ( 1st𝑥 ) / ( 2nd𝑥 ) )
19 16 18 wceq 𝑦 = ( ( 1st𝑥 ) / ( 2nd𝑥 ) )
20 15 19 wa ( ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) ) = 1 ∧ 𝑦 = ( ( 1st𝑥 ) / ( 2nd𝑥 ) ) )
21 20 4 7 crio ( 𝑥 ∈ ( ℤ × ℕ ) ( ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) ) = 1 ∧ 𝑦 = ( ( 1st𝑥 ) / ( 2nd𝑥 ) ) ) )
22 21 3 cfv ( 2nd ‘ ( 𝑥 ∈ ( ℤ × ℕ ) ( ( ( 1st𝑥 ) gcd ( 2nd𝑥 ) ) = 1 ∧ 𝑦 = ( ( 1st𝑥 ) / ( 2nd𝑥 ) ) ) ) )
23 1 2 22 cmpt ( 𝑦 ∈ ℚ ↦ ( 2nd ‘ ( 𝑥 ∈ ( ℤ × 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