Basics for the Rational Numbers #
Summary #
We define the integral domain structure on ℚ
and prove basic lemmas about it.
The definition of the field structure on ℚ
will be done in Mathlib.Data.Rat.Basic
once the
Field
class has been defined.
Main Definitions #
Rat.divInt n d
constructs a rational numberq = n / d
fromn d : ℤ
.
Notations #
/.
is infix notation forRat.divInt
.
Alias of Rat.num_intCast
.
Alias of Rat.den_intCast
.
Define a (dependent) function or prove ∀ r : ℚ, p r
by dealing with rational
numbers of the form n /. d
with 0 < d
and coprime n
, d
.
Equations
- Rat.numDenCasesOn x✝ x = match x✝, x with | { num := n, den := d, den_nz := h, reduced := c }, H => Eq.mpr ⋯ (H n d ⋯ c)
Instances For
Define a (dependent) function or prove ∀ r : ℚ, p r
by dealing with rational
numbers of the form n /. d
with d ≠ 0
.
Equations
- Rat.numDenCasesOn' a H = Rat.numDenCasesOn a fun (n : ℤ) (d : ℕ) (h : 0 < d) (x : Nat.Coprime (Int.natAbs n) d) => H n d ⋯
Instances For
Define a (dependent) function or prove ∀ r : ℚ, p r
by dealing with rational
numbers of the form mk' n d
with d ≠ 0
.
Equations
- Rat.numDenCasesOn'' a H = Rat.numDenCasesOn a fun (n : ℤ) (d : ℕ) (h : 0 < d) (h' : Nat.Coprime (Int.natAbs n) d) => Eq.mpr ⋯ (H n d ⋯ h')
Instances For
Alias of Rat.divInt_neg
.
Alias of Rat.divInt_eq_iff
.
Alias of Rat.mul_eq_mkRat
.
Alias of Rat.div_def'
.
At this point in the import hierarchy we have not defined the Field
typeclass.
Instead we'll instantiate CommRing
and CommGroupWithZero
at this point.
The Rat.instField
instance and any field-specific lemmas can be found in Mathlib.Data.Rat.Basic
.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Rat.addLeftCancelSemigroup = inferInstance
Equations
- Rat.addRightCancelSemigroup = inferInstance
Equations
- Rat.addCommSemigroup = inferInstance
Alias of Rat.intCast_eq_divInt
.
Alias of Rat.intCast_div_eq_divInt
.
Alias of Rat.natCast_eq_divInt
.