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, e.g. 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
@[implicit_reducible]
theorem
NNRatCast.toOfScientific_def
{K : Type u_1}
[NNRatCast K]
(m : ℕ)
(b : Bool)
(d : ℕ)
:
OfScientific.ofScientific m b d = ↑⟨OfScientific.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.
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Miscellaneous lemmas #
@[deprecated Rat.num_lt_denom_iff (since := "2026-02-24")]
Alias of Rat.num_lt_denom_iff.