Floor Function for Rational Numbers #
Summary #
We define the FloorRing
instance on ℚ
. Some technical lemmas relating floor
to integer
division and modulo arithmetic are derived as well as some simple inequalities.
Tags #
rat, rationals, ℚ, floor
@[simp]
theorem
Rat.floor_cast
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(x : ℚ)
:
@[simp]
theorem
Rat.ceil_cast
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(x : ℚ)
:
@[simp]
theorem
Rat.round_cast
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(x : ℚ)
:
@[simp]
theorem
Rat.cast_fract
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(x : ℚ)
:
theorem
Rat.isNat_intFloor
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : ℕ)
:
theorem
Rat.isInt_intFloor
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : ℤ)
:
theorem
Rat.isNat_intFloor_ofIsNNRat
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n d : ℕ)
:
Mathlib.Meta.NormNum.IsNNRat r n d → Mathlib.Meta.NormNum.IsNat ⌊r⌋ (n / d)
theorem
Rat.isInt_intFloor_ofIsRat_neg
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n d : ℕ)
:
Mathlib.Meta.NormNum.IsRat r (Int.negOfNat n) d → Mathlib.Meta.NormNum.IsInt ⌊r⌋ (Int.negOfNat (-(-↑n / ↑d)).toNat)
theorem
Rat.isNat_intCeil
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : ℕ)
:
theorem
Rat.isInt_intCeil
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : ℤ)
:
theorem
Rat.isNat_intCeil_ofIsNNRat
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n d : ℕ)
:
Mathlib.Meta.NormNum.IsNNRat r n d → Mathlib.Meta.NormNum.IsNat ⌈r⌉ (-(-↑n / ↑d)).toNat
theorem
Rat.isInt_intCeil_ofIsRat_neg
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n d : ℕ)
:
Mathlib.Meta.NormNum.IsRat r (Int.negOfNat n) d → Mathlib.Meta.NormNum.IsInt ⌈r⌉ (Int.negOfNat (n / d))