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_3}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โ)
:
theorem
Rat.isInt_intFloor
{R : Type u_3}
[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_3}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โ)
:
theorem
Rat.isInt_intCeil
{R : Type u_3}
[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))
theorem
Rat.isNat_intFract_of_isNat
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โ)
:
Mathlib.Meta.NormNum.IsNat r m โ Mathlib.Meta.NormNum.IsNat (Int.fract r) 0
theorem
Rat.isNat_intFract_of_isInt
{R : Type u_2}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โค)
:
Mathlib.Meta.NormNum.IsInt r m โ Mathlib.Meta.NormNum.IsNat (Int.fract r) 0
theorem
Rat.isNNRat_intFract_of_isNNRat
{ฮฑ : Type u_1}
[Field ฮฑ]
[LinearOrder ฮฑ]
[IsStrictOrderedRing ฮฑ]
[FloorRing ฮฑ]
(r : ฮฑ)
(n d : โ)
:
Mathlib.Meta.NormNum.IsNNRat r n d โ Mathlib.Meta.NormNum.IsNNRat (Int.fract r) (n % d) d
theorem
Rat.isRat_intFract_of_isRat_negOfNat
{ฮฑ : Type u_1}
[Field ฮฑ]
[LinearOrder ฮฑ]
[IsStrictOrderedRing ฮฑ]
[FloorRing ฮฑ]
(r : ฮฑ)
(n d : โ)
:
Mathlib.Meta.NormNum.IsRat r (Int.negOfNat n) d โ Mathlib.Meta.NormNum.IsRat (Int.fract r) (-โn % โd) d
theorem
Rat.isNat_round
{R : Type u_3}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โ)
:
Mathlib.Meta.NormNum.IsNat r m โ Mathlib.Meta.NormNum.IsNat (round r) m
theorem
Rat.isInt_round
{R : Type u_3}
[Ring R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(m : โค)
:
Mathlib.Meta.NormNum.IsInt r m โ Mathlib.Meta.NormNum.IsInt (round r) m
theorem
Rat.IsRat.isInt_round
{R : Type u_3}
[Field R]
[LinearOrder R]
[IsStrictOrderedRing R]
[FloorRing R]
(r : R)
(n : โค)
(d : โ)
(res : โค)
(hres : round (โn / โd) = res)
:
Mathlib.Meta.NormNum.IsRat r n d โ Mathlib.Meta.NormNum.IsInt (round r) res