Basics for the Rational Numbers #
Summary #
We define the integral domain structure on ℚ and prove basic lemmas about it.
The definition of the field structure on ℚ will be done in Mathlib/Algebra/Field/Rat.lean
once the Field class has been defined.
Main Definitions #
Rat.divInt n dconstructs a rational numberq = n / dfromn d : ℤ.
Notation #
/.is infix notation forRat.divInt.
@[deprecated Rat.intCast_eq_zero_iff (since := "2025-10-24")]
Alias of Rat.intCast_eq_zero_iff.
@[deprecated Rat.natCast_eq_zero_iff (since := "2025-10-24")]
Alias of Rat.natCast_eq_zero_iff.
@[deprecated Rat.intCast_eq_one_iff (since := "2025-10-24")]
Alias of Rat.intCast_eq_one_iff.
@[deprecated Rat.natCast_eq_one_iff (since := "2025-10-24")]
Alias of Rat.natCast_eq_one_iff.
@[simp]
theorem
Rat.lift_binop_eq
(f : ℚ → ℚ → ℚ)
(f₁ f₂ : ℤ → ℤ → ℤ → ℤ → ℤ)
(fv :
∀ {n₁ : ℤ} {d₁ : ℕ} {h₁ : d₁ ≠ 0} {c₁ : n₁.natAbs.Coprime d₁} {n₂ : ℤ} {d₂ : ℕ} {h₂ : d₂ ≠ 0}
{c₂ : n₂.natAbs.Coprime d₂},
f { num := n₁, den := d₁, den_nz := h₁, reduced := c₁ } { num := n₂, den := d₂, den_nz := h₂, reduced := c₂ } = divInt (f₁ n₁ (↑d₁) n₂ ↑d₂) (f₂ n₁ (↑d₁) n₂ ↑d₂))
(f0 : ∀ {n₁ d₁ n₂ d₂ : ℤ}, d₁ ≠ 0 → d₂ ≠ 0 → f₂ n₁ d₁ n₂ d₂ ≠ 0)
(a b c d : ℤ)
(b0 : b ≠ 0)
(d0 : d ≠ 0)
(H : ∀ {n₁ d₁ n₂ d₂ : ℤ}, a * d₁ = n₁ * b → c * d₂ = n₂ * d → f₁ n₁ d₁ n₂ d₂ * f₂ a b c d = f₁ a b c d * f₂ n₁ d₁ n₂ d₂)
:
@[deprecated Rat.inv_divInt (since := "2025-08-25")]
Alias of Rat.inv_divInt.
@[deprecated Rat.inv_def (since := "2025-08-25")]
Alias of Rat.inv_def.