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 #
Equations
- Rat.commRing = let __spread.0 := Rat.addCommGroup; let __spread.1 := Rat.commMonoid; CommRing.mk ⋯
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.
Miscellaneous lemmas #
theorem
Rat.divInt_div_divInt_cancel_left
{x : ℤ}
(hx : x ≠ 0)
(n : ℤ)
(d : ℤ)
:
Rat.divInt n x / Rat.divInt d x = Rat.divInt n d
theorem
Rat.divInt_div_divInt_cancel_right
{x : ℤ}
(hx : x ≠ 0)
(n : ℤ)
(d : ℤ)
:
Rat.divInt x n / Rat.divInt x d = Rat.divInt d n
@[simp]
theorem
Rat.divInt_pow
(num : ℕ)
(den : ℤ)
(n : ℕ)
:
Rat.divInt (↑num) den ^ n = Rat.divInt (↑num ^ n) (den ^ n)
@[deprecated Rat.natCast_eq_divInt]
Alias of Rat.natCast_eq_divInt
.