The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.NNRat.Floor

16 declarations. Mathlib docs · Source

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

norm_num extension for Nat.ceil

instance NNRat.instFloorSemiring E0 #

FloorSemiring ℚ≥0

theorem NNRat.floor_coe E0 #

∀ (q : ℚ≥0), ⌊↑q⌋₊ = ⌊q⌋₊

theorem NNRat.ceil_coe E0 #

∀ (q : ℚ≥0), ⌈↑q⌉₊ = ⌈q⌉₊

theorem NNRat.coe_floor E0 #

∀ (q : ℚ≥0), ↑⌊q⌋₊ = ⌊↑q⌋

theorem NNRat.coe_ceil E0 #

∀ (q : ℚ≥0), ↑⌈q⌉₊ = ⌈↑q⌉

theorem NNRat.floor_def E0 #

∀ (q : ℚ≥0), ⌊q⌋₊ = q.num / q.den

theorem NNRat.floor_cast E0 #

∀ {K : Type u_1} [inst : Semifield K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] [inst_3 : FloorSemiring K]
  (x : ℚ≥0), ⌊↑x⌋₊ = ⌊x⌋₊

theorem NNRat.ceil_cast E0 #

∀ {K : Type u_1} [inst : Semifield K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] [inst_3 : FloorSemiring K]
  (x : ℚ≥0), ⌈↑x⌉₊ = ⌈x⌉₊

theorem NNRat.intFloor_cast E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] [inst_3 : FloorRing K] (x : ℚ≥0),
  ⌊↑x⌋ = ⌊↑x⌋

theorem NNRat.intCeil_cast E0 #

∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] [IsStrictOrderedRing K] [inst_3 : FloorRing K] (x : ℚ≥0),
  ⌈↑x⌉ = ⌈↑x⌉

theorem NNRat.floor_natCast_div_natCast E1 #

∀ (n d : ℕ), ⌊↑n / ↑d⌋₊ = n / d

theorem Mathlib.Meta.NormNum.IsNat.natCeil E1 #

∀ {R : Type u_1} [inst : Semiring R] [inst_1 : LinearOrder R] [inst_2 : FloorSemiring R] (r : R) (m : ℕ),
  Mathlib.Meta.NormNum.IsNat r m → Mathlib.Meta.NormNum.IsNat ⌈r⌉₊ m

theorem Mathlib.Meta.NormNum.IsInt.natCeil E1 #

∀ {R : Type u_1} [inst : Ring R] [inst_1 : LinearOrder R] [IsStrictOrderedRing R] [inst_3 : FloorSemiring R] (r : R)
  (m : ℕ), Mathlib.Meta.NormNum.IsInt r (Int.negOfNat m) → Mathlib.Meta.NormNum.IsNat ⌈r⌉₊ 0

theorem Mathlib.Meta.NormNum.IsNNRat.natCeil E1 #

∀ {R : Type u_1} [inst : Semifield R] [inst_1 : LinearOrder R] [IsStrictOrderedRing R] [inst_3 : FloorSemiring R]
  (r : R) (n d : ℕ),
  Mathlib.Meta.NormNum.IsNNRat r n d → ∀ (res : ℕ), ⌈↑n / ↑d⌉₊ = res → Mathlib.Meta.NormNum.IsNat ⌈r⌉₊ res

theorem Mathlib.Meta.NormNum.IsRat.natCeil E1 #

∀ {R : Type u_1} [inst : Field R] [inst_1 : LinearOrder R] [IsStrictOrderedRing R] [inst_3 : FloorSemiring R] (r : R)
  (n d : ℕ), Mathlib.Meta.NormNum.IsRat r (Int.negOfNat n) d → Mathlib.Meta.NormNum.IsNat ⌈r⌉₊ 0

def Mathlib.Meta.NormNum.evalNatCeil E1 #

Mathlib.Meta.NormNum.NormNumExt

norm_num extension for Nat.ceil