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
theorem
Rat.cast_mk_of_ne_zero
{α : Type u_1}
[inst : DivisionRing α]
(a : ℤ)
(b : ℤ)
(b0 : ↑b ≠ 0)
:
↑(Rat.divInt a b) = ↑a / ↑b
@[simp]
@[simp]
theorem
Rat.cast_injective
{α : Type u_1}
[inst : DivisionRing α]
[inst : CharZero α]
:
Function.Injective Rat.cast
@[simp]
@[simp]
@[simp]
Coercion ℚ → α→ α
as a RingHom
.
Equations
- One or more equations did not get rendered due to their size.
@[simp]
theorem
Rat.coe_cast_hom
{α : Type u_1}
[inst : DivisionRing α]
[inst : CharZero α]
:
↑(Rat.castHom α) = Rat.cast
@[simp]
theorem
Rat.cast_mk
{α : Type u_1}
[inst : DivisionRing α]
[inst : CharZero α]
(a : ℤ)
(b : ℤ)
:
↑(Rat.divInt a b) = ↑a / ↑b
theorem
Rat.cast_pos_of_pos
{K : Type u_1}
[inst : LinearOrderedField K]
{r : ℚ}
(hr : 0 < r)
:
0 < ↑r
@[simp]
Coercion from ℚ
as an order embedding.
Equations
- Rat.castOrderEmbedding = OrderEmbedding.ofStrictMono Rat.cast (_ : StrictMono Rat.cast)
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
map_ratCast
{F : Type u_3}
{α : Type u_1}
{β : Type u_2}
[inst : DivisionRing α]
[inst : DivisionRing β]
[inst : RingHomClass F α β]
(f : F)
(q : ℚ)
:
↑f ↑q = ↑q
@[simp]
theorem
eq_ratCast
{F : Type u_2}
{k : Type u_1}
[inst : DivisionRing k]
[inst : RingHomClass F ℚ k]
(f : F)
(r : ℚ)
:
↑f r = ↑r
theorem
MonoidWithZeroHom.ext_rat'
{F : Type u_2}
{M₀ : Type u_1}
[inst : MonoidWithZero M₀]
[inst : MonoidWithZeroHomClass F ℚ M₀]
{f : F}
{g : F}
(h : ∀ (m : ℤ), ↑f ↑m = ↑g ↑m)
:
f = g
If f
and g
agree on the integers then they are equal φ
.
theorem
MonoidWithZeroHom.ext_rat
{M₀ : Type u_1}
[inst : MonoidWithZero M₀]
{f : ℚ →*₀ M₀}
{g : ℚ →*₀ M₀}
(h : MonoidWithZeroHom.comp f ↑(Int.castRingHom ℚ) = MonoidWithZeroHom.comp g ↑(Int.castRingHom ℚ))
:
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.
theorem
MonoidWithZeroHom.ext_rat_on_pnat
{F : Type u_2}
{M₀ : Type u_1}
[inst : MonoidWithZero M₀]
[inst : MonoidWithZeroHomClass F ℚ M₀]
{f : F}
{g : F}
(same_on_neg_one : ↑f (-1) = ↑g (-1))
(same_on_pnat : ∀ (n : ℕ), 0 < n → ↑f ↑n = ↑g ↑n)
:
f = g
Positive integer values of a morphism φ
and its value on -1
completely determine φ
.
theorem
RingHom.ext_rat
{F : Type u_2}
{R : Type u_1}
[inst : Semiring R]
[inst : RingHomClass F ℚ R]
(f : F)
(g : F)
:
f = g
Any two ring homomorphisms from ℚ
to a semiring are equal. If the codomain is a division ring,
then this lemma follows from eq_ratCast
.
@[simp]
@[simp]