Documentation

Mathlib.Algebra.Field.Rat

The rational numbers form a field #

This file contains the field instance on the rational numbers.

See note [foundational algebra order theory].

Tags #

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

Equations

    Extra instances to short-circuit type class resolution #

    These also prevent non-computable instances being used to construct these instances non-computably.

    theorem Rat.inv_nonneg {a : } (ha : 0 a) :
    theorem Rat.div_nonneg {a b : } (ha : 0 a) (hb : 0 b) :
    0 a / b
    theorem Rat.zpow_nonneg {a : } (ha : 0 a) (n : ) :
    0 a ^ n
    Equations
      Equations
        Equations
          @[simp]
          theorem NNRat.coe_inv (q : ℚ≥0) :
          q⁻¹ = (↑q)⁻¹
          @[simp]
          theorem NNRat.coe_div (p q : ℚ≥0) :
          ↑(p / q) = p / q
          @[simp]
          theorem NNRat.coe_zpow (p : ℚ≥0) (n : ) :
          ↑(p ^ n) = p ^ n
          theorem NNRat.div_def (p q : ℚ≥0) :
          p / q = divNat (p.num * q.den) (p.den * q.num)
          theorem NNRat.num_inv_of_ne_zero {q : ℚ≥0} (hq : q 0) :
          theorem NNRat.den_inv_of_ne_zero {q : ℚ≥0} (hq : q 0) :
          @[simp]
          theorem NNRat.num_div_den (q : ℚ≥0) :
          q.num / q.den = q