Documentation

Mathlib.Data.Rat.Field

Field Structure on the Rational Numbers #

Summary #

We put the (discrete) field structure on the type of rational numbers that was defined in Mathlib.Data.Rat.Defs.

Main Definitions #

Implementation notes #

We have to define the field structure in a separate file to avoid cyclic imports: the Field class contains a map from (see Field's docstring for the rationale), so we have a dependency Rat.FieldFieldRat that is reflected in the import hierarchy Mathlib.Data.Rat.Basic → Mathlib.Algebra.Field.DefsStd.Data.Rat.

Tags #

rat, rationals, field, ℚ, numerator, denominator, num, denom

Equations
  • One or more equations did not get rendered due to their size.
Equations
@[simp]
theorem NNRat.coe_inv (q : ℚ≥0) :
q⁻¹ = (q)⁻¹
@[simp]
theorem NNRat.coe_div (p : ℚ≥0) (q : ℚ≥0) :
(p / q) = p / q
theorem NNRat.inv_def (q : ℚ≥0) :
q⁻¹ = NNRat.divNat q.den q.num
theorem NNRat.div_def (p : ℚ≥0) (q : ℚ≥0) :
p / q = NNRat.divNat (p.num * q.den) (p.den * q.num)