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
  • One or more equations did not get rendered due to their size.

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
Equations
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)
theorem NNRat.num_inv_of_ne_zero {q : ℚ≥0} (hq : q 0) :
q⁻¹.num = q.den
theorem NNRat.den_inv_of_ne_zero {q : ℚ≥0} (hq : q 0) :
q⁻¹.den = q.num
@[simp]
theorem NNRat.num_div_den (q : ℚ≥0) :
q.num / q.den = q
Equations
  • One or more equations did not get rendered due to their size.