Documentation

Mathlib.Data.NNRat.Floor

Floor Function for Non-negative Rational Numbers #

Summary #

We define the FloorSemiring instance on ℚ≥0, and relate its operators to NNRat.cast.

Note that we cannot talk about Int.fract, which currently only works for rings.

Tags #

nnrat, rationals, ℚ≥0, floor

@[simp]
theorem NNRat.coe_floor (q : ℚ≥0) :
q⌋₊ = q
@[simp]
theorem NNRat.coe_ceil (q : ℚ≥0) :
q⌉₊ = q
theorem NNRat.floor_natCast_div_natCast (n d : ) :
n / d⌋₊ = n / d

norm_num extension for Nat.ceil #

theorem Mathlib.Meta.NormNum.IsInt.natCeil {R : Type u_1} [Ring R] [LinearOrder R] [IsStrictOrderedRing R] [FloorSemiring R] (r : R) (m : ) :
IsInt r (Int.negOfNat m)IsNat r⌉₊ 0
theorem Mathlib.Meta.NormNum.IsNNRat.natCeil {R : Type u_1} [Semifield R] [LinearOrder R] [IsStrictOrderedRing R] [FloorSemiring R] (r : R) (n d : ) (h : IsNNRat r n d) (res : ) (hres : n / d⌉₊ = res) :
theorem Mathlib.Meta.NormNum.IsRat.natCeil {R : Type u_1} [Field R] [LinearOrder R] [IsStrictOrderedRing R] [FloorSemiring R] (r : R) (n d : ) (h : IsRat r (Int.negOfNat n) d) :