Lemmas on Int.floor, Int.ceil and Int.fract #
This file contains basic results on the integer-valued floor and ceiling functions, as well as the fractional part operator.
TODO #
LinearOrder can be relaxed to PartialOrder in many lemmas.
Tags #
rounding, floor, ceil
theorem Mathlib.Meta.Positivity.int_floor_nonneg {α : Type u_1} [Ring α] [LinearOrder α] [FloorRing α] {a : α} (ha : 0 ≤ a) :
theorem Mathlib.Meta.Positivity.int_floor_nonneg_of_pos {α : Type u_1} [Ring α] [LinearOrder α] [FloorRing α] {a : α} (ha : 0 < a) :
Extension for the positivity tactic: Int.floor is nonnegative if its input is.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem Mathlib.Meta.Positivity.nat_ceil_pos {α : Type u_1} [Semiring α] [LinearOrder α] [FloorSemiring α] {a : α} :
Extension for the positivity tactic: Nat.ceil is positive if its input is.
Instances For
theorem Mathlib.Meta.Positivity.int_ceil_pos {α : Type u_1} [Ring α] [LinearOrder α] [FloorRing α] {a : α} :
Extension for the positivity tactic: Int.ceil is positive/nonnegative if its input is.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Floor rings #
Floor #
@[simp]
@[simp]
@[simp]
@[simp]
theorem Int.floor_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Int.sub_one_lt_floor {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.floor_add_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (z : ℤ) :
@[simp]
theorem Int.floor_add_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.floor_intCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (z : ℤ) (a : R) :
@[simp]
theorem Int.floor_add_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) :
@[simp]
theorem Int.floor_add_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Int.floor_natCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) (a : R) :
@[simp]
theorem Int.floor_ofNat_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) [n.AtLeastTwo] (a : R) :
@[simp]
theorem Int.floor_sub_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (z : ℤ) :
@[simp]
theorem Int.floor_sub_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) :
@[simp]
theorem Int.floor_sub_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.floor_sub_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
theorem Int.floor_div_natCast {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] (a : k) (n : ℕ) :
Fractional part #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Int.fract_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Int.fract_add_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (m : ℤ) :
@[simp]
theorem Int.fract_add_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (m : ℕ) :
@[simp]
theorem Int.fract_add_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.fract_add_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Int.fract_intCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (m : ℤ) (a : R) :
@[simp]
theorem Int.fract_natCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) (a : R) :
@[simp]
theorem Int.fract_one_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.fract_ofNat_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) [n.AtLeastTwo] (a : R) :
@[simp]
theorem Int.fract_sub_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (m : ℤ) :
@[simp]
theorem Int.fract_sub_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) :
@[simp]
theorem Int.fract_sub_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.fract_sub_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
theorem Int.fract_add_le {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
theorem Int.fract_add_fract_le {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
@[simp]
theorem Int.fract_nonneg {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
theorem Int.fract_pos {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} [IsOrderedAddMonoid R] :
The fractional part of a is positive if and only if a ≠ ⌊a⌋.
theorem Int.fract_lt_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
theorem Int.abs_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} [IsOrderedAddMonoid R] :
@[simp]
theorem Int.abs_one_sub_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} [IsOrderedAddMonoid R] :
@[simp]
theorem Int.floor_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
theorem Int.fract_eq_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] {a b : R} :
@[simp]
theorem Int.fract_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.fract_fract_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
@[simp]
theorem Int.fract_add_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
@[simp]
theorem Int.fract_fract_sub {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
@[simp]
theorem Int.fract_sub_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
theorem Int.fract_fract_add_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
theorem Int.fract_fract_sub_fract {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a b : R) :
theorem Int.fract_neg {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] {x : R} (hx : fract x ≠ 0) :
theorem Int.fract_div_mul_self_mem_Ico {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] (a b : k) (ha : 0 < a) :
theorem Int.sub_floor_div_mul_nonneg {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {b : k} (a : k) (hb : 0 < b) :
theorem Int.sub_floor_div_mul_lt {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {b : k} (a : k) (hb : 0 < b) :
theorem Int.fract_div_natCast_eq_div_natCast_mod {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {m n : ℕ} :
theorem Int.fract_div_intCast_eq_div_intCast_mod {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {m : ℤ} {n : ℕ} :
Ceil #
theorem Int.ceil_nonneg_of_neg_one_lt {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} (ha : -1 < a) :
@[simp]
@[simp]
@[simp]
theorem Int.ceil_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] (n : ℕ) [n.AtLeastTwo] :
theorem Int.floor_neg {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} [IsOrderedAddMonoid R] :
theorem Int.ceil_neg {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] {a : R} [IsOrderedAddMonoid R] :
@[simp]
theorem Int.ceil_add_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (z : ℤ) :
@[simp]
theorem Int.ceil_intCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (z : ℤ) (a : R) :
@[simp]
theorem Int.ceil_add_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) :
@[simp]
theorem Int.ceil_natCast_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) (a : R) :
@[simp]
theorem Int.ceil_add_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.ceil_one_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.ceil_add_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
@[simp]
theorem Int.ceil_ofNat_add {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (n : ℕ) [n.AtLeastTwo] (a : R) :
@[simp]
theorem Int.ceil_sub_intCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (z : ℤ) :
@[simp]
theorem Int.ceil_sub_natCast {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) :
@[simp]
theorem Int.ceil_sub_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
@[simp]
theorem Int.ceil_sub_ofNat {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) (n : ℕ) [n.AtLeastTwo] :
theorem Int.ceil_lt_add_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] (a : R) :
theorem Int.div_two_lt_floor {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {a : k} (ha : 1 ≤ a) :
theorem Int.ceil_lt_two_mul {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {a : k} (ha : 2⁻¹ < a) :
theorem Int.ceil_le_two_mul {k : Type u_4} [Field k] [LinearOrder k] [IsOrderedRing k] [FloorRing k] {a : k} (ha : 2⁻¹ ≤ a) :
Intervals #
theorem Int.map_floor {F : Type u_1} {R : Type u_2} {S : Type u_3} [Ring R] [LinearOrder R] [Ring S] [LinearOrder S] [FloorRing R] [FloorRing S] [FunLike F R S] [RingHomClass F R S] (f : F) (hf : StrictMono ⇑f) (a : R) :
theorem Int.map_ceil {F : Type u_1} {R : Type u_2} {S : Type u_3} [Ring R] [LinearOrder R] [Ring S] [LinearOrder S] [FloorRing R] [FloorRing S] [FunLike F R S] [RingHomClass F R S] (f : F) (hf : StrictMono ⇑f) (a : R) :
theorem Int.map_fract {F : Type u_1} {R : Type u_2} {S : Type u_3} [Ring R] [LinearOrder R] [Ring S] [LinearOrder S] [FloorRing R] [FloorRing S] [FunLike F R S] [RingHomClass F R S] (f : F) (hf : StrictMono ⇑f) (a : R) :
theorem Nat.ceil_lt_add_one_of_gt_neg_one {R : Type u_2} [Ring R] [LinearOrder R] [FloorRing R] [IsOrderedAddMonoid R] {a : R} (ha : -1 < a) :
a variant of Nat.ceil_lt_add_one with its condition 0 ≤ a generalized to -1 < a
A floor ring as a floor semiring #
There exists at most one FloorRing structure on a given linear ordered ring.
Extension for the positivity tactic: Int.fract is always nonnegative.
Equations
- One or more equations did not get rendered due to their size.