The rational numbers possess a linear order #
This file constructs the order on ℚ
and proves various facts relating the order to
ring structure on ℚ
. This only uses unbundled type classes, eg CovariantClass
,
relating the order structure and algebra structure on ℚ
.
For the bundled LinearOrderedCommRing
instance on ℚ
, see Algebra.Order.Ring.Rat
.
Tags #
rat, rationals, field, ℚ, numerator, denominator, num, denom, order, ordering
@[simp]
Equations
- NNRatCast.toOfScientific = { ofScientific := fun (m : ℕ) (b : Bool) (d : ℕ) => ↑⟨Rat.ofScientific m b d, ⋯⟩ }
@[simp]
theorem
NNRat.cast_ofScientific
{K : Type u_1}
[NNRatCast K]
(m : ℕ)
(s : Bool)
(e : ℕ)
:
↑(OfScientific.ofScientific m s e) = OfScientific.ofScientific m s e
Casting a scientific literal via ℚ≥0
is the same as casting directly.
theorem
Rat.divInt_le_divInt
{a b c d : ℤ}
(b0 : 0 < b)
(d0 : 0 < d)
:
Rat.divInt a b ≤ Rat.divInt c d ↔ a * d ≤ c * b
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.