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.isInt_intFloor_ofIsRat
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n : ℤ)
(d : ℕ)
:
Mathlib.Meta.NormNum.IsRat r n d → Mathlib.Meta.NormNum.IsInt ⌊r⌋ (n / ↑d)
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.isInt_intCeil_ofIsRat
{α : Type u_1}
[Field α]
[LinearOrder α]
[IsStrictOrderedRing α]
[FloorRing α]
(r : α)
(n : ℤ)
(d : ℕ)
:
Mathlib.Meta.NormNum.IsRat r n d → Mathlib.Meta.NormNum.IsInt ⌈r⌉ (-(-n / ↑d))