The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V06. Rings, fields and ordered algebra

Mathlib.Algebra.Ring.Rat

14 declarations. Mathlib docs · Source

The rational numbers are a commutative ring

This file contains the commutative ring instance on the rational numbers.

See note [foundational algebra order theory].

Instances

Extra instances to short-circuit type class resolution

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

Miscellaneous lemmas

instance Rat.commRing E0 #

CommRing ℚ

instance Rat.commGroupWithZero E0 #

CommGroupWithZero ℚ

instance Rat.isDomain E0 #

IsDomain ℚ

instance Rat.instCharZero E0 #

CharZero ℚ

The characteristic of ℚ is 0.

instance Rat.commSemiring E0 #

CommSemiring ℚ

instance Rat.semiring E0 #

Semiring ℚ

theorem Rat.divInt_div_divInt_cancel_left E1 #

∀ {x : ℤ}, x ≠ 0 → ∀ (n d : ℤ), Rat.divInt n x / Rat.divInt d x = Rat.divInt n d

theorem Rat.divInt_div_divInt_cancel_right E1 #

∀ {x : ℤ}, x ≠ 0 → ∀ (n d : ℤ), Rat.divInt x n / Rat.divInt x d = Rat.divInt d n

theorem Rat.num_div_den E1 #

∀ (r : ℚ), ↑r.num / ↑r.den = r

theorem Rat.divInt_pow E0 #

∀ (num : ℕ) (den : ℤ) (n : ℕ), Rat.divInt (↑num) den ^ n = Rat.divInt (↑num ^ n) (den ^ n)

theorem Rat.mkRat_pow E0 #

∀ (num den n : ℕ), mkRat (↑num) den ^ n = mkRat (↑num ^ n) (den ^ n)

theorem Rat.natCast_eq_divInt E1 #

∀ (n : ℕ), ↑n = Rat.divInt (↑n) 1

theorem Rat.mul_den_eq_num E0 #

∀ (q : ℚ), q * ↑q.den = ↑q.num

theorem Rat.den_mul_eq_num E0 #

∀ (q : ℚ), ↑q.den * q = ↑q.num