The rational numbers form a linear ordered field #
This file constructs the order on ℚ
and proves that ℚ
is a discrete, linearly ordered
commutative ring.
ℚ
is in fact a linearly ordered field, but this fact is located in Data.Rat.Field
instead of
here because we need the order on ℚ
to define ℚ≥0
, which we itself need to define Field
.
Tags #
rat, rationals, field, ℚ, numerator, denominator, num, denom, order, ordering
@[simp]
@[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
Equations
- Rat.linearOrder = LinearOrder.mk ⋯ inferInstance inferInstance inferInstance Rat.linearOrder.proof_5 Rat.linearOrder.proof_6 Rat.linearOrder.proof_7
Extra instances to short-circuit type class resolution #
These also prevent non-computable instances being used to construct these instances non-computably.
Equations
- Rat.instDistribLattice = inferInstance
Equations
- Rat.instSemilatticeInf = inferInstance
Equations
- Rat.instSemilatticeSup = inferInstance
Miscellaneous lemmas #
Equations
- Rat.instLinearOrderedCommRing = let __spread.0 := Rat.linearOrder; let __spread.1 := Rat.commRing; LinearOrderedCommRing.mk ⋯
Equations
- Rat.instLinearOrderedRing = inferInstance
Equations
- Rat.instLinearOrderedSemiring = inferInstance
Equations
- Rat.instOrderedSemiring = inferInstance
Equations
- Rat.instLinearOrderedAddCommGroup = inferInstance
Equations
- Rat.instOrderedAddCommGroup = inferInstance
Equations
- Rat.instOrderedCancelAddCommMonoid = inferInstance
Equations
- Rat.instOrderedAddCommMonoid = inferInstance
@[deprecated Rat.num_nonneg]
Alias of Rat.num_nonneg
.
@[deprecated Rat.num_pos]
Alias of Rat.num_pos
.