Casts for Rational Numbers #
Summary #
We define the canonical injection from ℚ into an arbitrary division ring and prove various casting lemmas showing the well-behavedness of this injection.
Notations #
/.
is infix notation forrat.mk
.
Tags #
rat, rationals, field, ℚ, numerator, denominator, num, denom, cast, coercion, casting
@[protected, instance]
Construct the canonical injection from ℚ
into an arbitrary
division ring. If the field has positive characteristic p
,
we define 1 / p = 1 / 0 = 0
for consistency with our
division by zero convention.
@[simp]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp, norm_cast]
@[simp]
@[simp]
@[simp]
@[simp, norm_cast]
@[simp, norm_cast]
theorem
ring_hom.map_rat_cast
{k : Type u_1}
{k' : Type u_2}
[division_ring k]
[char_zero k]
[division_ring k']
(f : k →+* k')
(r : ℚ) :
@[protected, instance]
@[ext]
theorem
monoid_with_zero_hom.ext_rat
{M : Type u_1}
[group_with_zero M]
{f g : monoid_with_zero_hom ℚ M}
(same_on_int : f.comp (int.cast_ring_hom ℚ).to_monoid_with_zero_hom = g.comp (int.cast_ring_hom ℚ).to_monoid_with_zero_hom) :
f = g
If f
and g
agree on the integers then they are equal φ
.
See note [partially-applied ext lemmas] for why comp
is used here.