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

@[implicit_reducible]
instance Rat.instField :
Field โ„š

Extra instances to short-circuit type class resolution #

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

@[implicit_reducible]
theorem Rat.inv_nonneg {a : โ„š} (ha : 0 โ‰ค a) :
theorem Rat.div_nonneg {a b : โ„š} (ha : 0 โ‰ค a) (hb : 0 โ‰ค b) :
0 โ‰ค a / b
@[implicit_reducible]
@[implicit_reducible]
@[implicit_reducible]
instance NNRat.instZPow :
Pow โ„šโ‰ฅ0 โ„ค
@[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)
@[simp]
theorem NNRat.num_div_den (q : โ„šโ‰ฅ0) :
โ†‘q.num / โ†‘q.den = q