Lemmas about the Rational Numbers #
@[simp]
@[reducible, inline, deprecated Rat.num_divInt_den (since := "2025-08-22")]
Equations
Instances For
@[reducible, inline, deprecated Rat.divInt_eq_divInt_iff (since := "2025-08-22")]
Equations
Instances For
Define a (dependent) function or prove ∀ r : Rat, p r
by dealing with rational
numbers of the form n /. d
with 0 < d
and coprime n
, d
.
Equations
- { num := n, den := d, den_nz := h, reduced := c }.numDenCasesOn x✝ = ⋯.mpr (x✝ n d ⋯ c)
Instances For
def
Rat.numDenCasesOn'
{C : Rat → Sort u}
(a : Rat)
(H : (n : Int) → (d : Nat) → d ≠ 0 → C (divInt n ↑d))
:
C a
Define a (dependent) function or prove ∀ r : Rat, p r
by dealing with rational
numbers of the form n /. d
with d ≠ 0
.
Equations
- a.numDenCasesOn' H = a.numDenCasesOn fun (n : Int) (d : Nat) (h : 0 < d) (x : n.natAbs.Coprime d) => H n d ⋯
Instances For
def
Rat.numDenCasesOn''
{C : Rat → Sort u}
(a : Rat)
(H :
(n : Int) →
(d : Nat) → (nz : d ≠ 0) → (red : n.natAbs.Coprime d) → C { num := n, den := d, den_nz := nz, reduced := red })
:
C a
Define a (dependent) function or prove ∀ r : Rat, p r
by dealing with rational
numbers of the form mk' n d
with d ≠ 0
.
Equations
- a.numDenCasesOn'' H = a.numDenCasesOn fun (n : Int) (d : Nat) (h : 0 < d) (h' : n.natAbs.Coprime d) => ⋯.mpr (H n d ⋯ h')
Instances For
@[reducible, inline, deprecated Rat.num_ofNat (since := "2025-08-22")]
Equations
Instances For
@[reducible, inline, deprecated Rat.den_ofNat (since := "2025-08-22")]
Equations
Instances For
ofScientific
#
@[simp]
Rat.ofScientific
applied to numeric literals is the same as a scientific literal.
≤
and <
#
intCast
#
@[reducible, inline, deprecated Rat.den_intCast (since := "2025-08-22")]
Equations
Instances For
@[reducible, inline, deprecated Rat.num_intCast (since := "2025-08-22")]
Equations
Instances For
The following lemmas are later subsumed by e.g. Int.cast_add
and Int.cast_mul
in Mathlib
but it is convenient to have these earlier, for users who only need Int
and Rat
.