statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
fract_eq_fract {a b : α} : fract a = fract b ↔ ∃ z : ℤ, a - b = z
⟨λ h, ⟨⌊a⌋ - ⌊b⌋, begin unfold fract at h, rw [int.cast_sub, sub_eq_sub_iff_sub_eq_sub.1 h], end⟩, begin rintro ⟨z, hz⟩, refine fract_eq_iff.2 ⟨fract_nonneg _, fract_lt_one _, z + ⌊b⌋, _⟩, rw [eq_add_of_sub_eq hz, add_comm, int.cast_add], exact add_sub_sub_cancel _ _ _, end⟩
lemma
int.fract_eq_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_add", "int.cast_sub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_eq_self {a : α} : fract a = a ↔ 0 ≤ a ∧ a < 1
fract_eq_iff.trans $ and.assoc.symm.trans $ and_iff_left ⟨0, by simp⟩
lemma
int.fract_eq_self
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_fract (a : α) : fract (fract a) = fract a
fract_eq_self.2 ⟨fract_nonneg _, fract_lt_one _⟩
lemma
int.fract_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_add (a b : α) : ∃ z : ℤ, fract (a + b) - fract a - fract b = z
⟨⌊a⌋ + ⌊b⌋ - ⌊a + b⌋, by { unfold fract, simp [sub_eq_add_neg], abel }⟩
lemma
int.fract_add
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_neg {x : α} (hx : fract x ≠ 0) : fract (-x) = 1 - fract x
begin rw fract_eq_iff, split, { rw [le_sub_iff_add_le, zero_add], exact (fract_lt_one x).le, }, refine ⟨sub_lt_self _ (lt_of_le_of_ne' (fract_nonneg x) hx), -⌊x⌋ - 1, _⟩, simp only [sub_sub_eq_add_sub, cast_sub, cast_neg, cast_one, sub_left_inj], conv in (-x) {rw ← floor_add_fract x}, simp [-floor_add...
lemma
int.fract_neg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "lt_of_le_of_ne'" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_neg_eq_zero {x : α} : fract (-x) = 0 ↔ fract x = 0
begin simp only [fract_eq_iff, le_refl, zero_lt_one, tsub_zero, true_and], split; rintros ⟨z, hz⟩; use [-z]; simp [← hz], end
lemma
int.fract_neg_eq_zero
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "tsub_zero", "zero_lt_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_mul_nat (a : α) (b : ℕ) : ∃ z : ℤ, fract a * b - fract (a * b) = z
begin induction b with c hc, use 0, simp, rcases hc with ⟨z, hz⟩, rw [nat.succ_eq_add_one, nat.cast_add, mul_add, mul_add, nat.cast_one, mul_one, mul_one], rcases fract_add (a * c) a with ⟨y, hy⟩, use z - y, rw [int.cast_sub, ←hz, ←hy], abel end
lemma
int.fract_mul_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_sub", "mul_one", "nat.cast_add", "nat.cast_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_fract (s : set α) : fract ⁻¹' s = ⋃ m : ℤ, (λ x, x - m) ⁻¹' (s ∩ Ico (0 : α) 1)
begin ext x, simp only [mem_preimage, mem_Union, mem_inter_iff], refine ⟨λ h, ⟨⌊x⌋, h, fract_nonneg x, fract_lt_one x⟩, _⟩, rintro ⟨m, hms, hm0, hm1⟩, obtain rfl : ⌊x⌋ = m, from floor_eq_iff.2 ⟨sub_nonneg.1 hm0, sub_lt_iff_lt_add'.1 hm1⟩, exact hms end
lemma
int.preimage_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
image_fract (s : set α) : fract '' s = ⋃ m : ℤ, (λ x, x - m) '' s ∩ Ico 0 1
begin ext x, simp only [mem_image, mem_inter_iff, mem_Union], split, { rintro ⟨y, hy, rfl⟩, exact ⟨⌊y⌋, ⟨y, hy, rfl⟩, fract_nonneg y, fract_lt_one y⟩ }, { rintro ⟨m, ⟨y, hys, rfl⟩, h0, h1⟩, obtain rfl : ⌊y⌋ = m, from floor_eq_iff.2 ⟨sub_nonneg.1 h0, sub_lt_iff_lt_add'.1 h1⟩, exact ⟨y, hys, rfl⟩ } en...
lemma
int.image_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_div_mul_self_mem_Ico (a b : k) (ha : 0 < a) : fract (b/a) * a ∈ Ico 0 a
⟨(zero_le_mul_right ha).2 (fract_nonneg (b/a)), (mul_lt_iff_lt_one_left ha).2 (fract_lt_one (b/a))⟩
lemma
int.fract_div_mul_self_mem_Ico
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "mul_lt_iff_lt_one_left", "zero_le_mul_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_div_mul_self_add_zsmul_eq (a b : k) (ha : a ≠ 0) : fract (b/a) * a + ⌊b/a⌋ • a = b
by rw [zsmul_eq_mul, ← add_mul, fract_add_floor, div_mul_cancel b ha]
lemma
int.fract_div_mul_self_add_zsmul_eq
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "div_mul_cancel", "zsmul_eq_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sub_floor_div_mul_nonneg (a : k) (hb : 0 < b) : 0 ≤ a - ⌊a / b⌋ * b
sub_nonneg_of_le $ (le_div_iff hb).1 $ floor_le _
lemma
int.sub_floor_div_mul_nonneg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "le_div_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sub_floor_div_mul_lt (a : k) (hb : 0 < b) : a - ⌊a / b⌋ * b < b
sub_lt_iff_lt_add.2 $ by { rw [←one_add_mul, ←div_lt_iff hb, add_comm], exact lt_floor_add_one _ }
lemma
int.sub_floor_div_mul_lt
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_div_nat_cast_eq_div_nat_cast_mod {m n : ℕ} : fract ((m : k) / n) = ↑(m % n) / n
begin rcases n.eq_zero_or_pos with rfl | hn, { simp, }, have hn' : 0 < (n : k), { norm_cast, assumption, }, refine fract_eq_iff.mpr ⟨by positivity, _, m / n, _⟩, { simpa only [div_lt_one hn', nat.cast_lt] using m.mod_lt hn, }, { rw [sub_eq_iff_eq_add', ← mul_right_inj' hn'.ne.symm, mul_div_cancel' _ hn'.ne.sy...
lemma
int.fract_div_nat_cast_eq_div_nat_cast_mod
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "div_lt_one", "mul_div_cancel'", "mul_right_inj'", "nat.cast_add", "nat.cast_lt" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_div_int_cast_eq_div_int_cast_mod {m : ℤ} {n : ℕ} : fract ((m : k) / n) = ↑(m % n) / n
begin rcases n.eq_zero_or_pos with rfl | hn, { simp, }, replace hn : 0 < (n : k), { norm_cast, assumption, }, have : ∀ {l : ℤ} (hl : 0 ≤ l), fract ((l : k) / n) = ↑(l % n) / n, { intros, obtain ⟨l₀, rfl | rfl⟩ := l.eq_coe_or_neg, { rw [cast_coe_nat, ← coe_nat_mod, cast_coe_nat, fract_div_nat_cast_eq_div...
lemma
int.fract_div_int_cast_eq_div_int_cast_mod
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "add_div", "mul_div_cancel" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
gc_ceil_coe : galois_connection ceil (coe : ℤ → α)
floor_ring.gc_ceil_coe
lemma
int.gc_ceil_coe
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "galois_connection" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_le : ⌈a⌉ ≤ z ↔ a ≤ z
gc_ceil_coe a z
lemma
int.ceil_le
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
floor_neg : ⌊-a⌋ = -⌈a⌉
eq_of_forall_le_iff (λ z, by rw [le_neg, ceil_le, le_floor, int.cast_neg, le_neg])
lemma
int.floor_neg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "eq_of_forall_le_iff", "int.cast_neg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_neg : ⌈-a⌉ = -⌊a⌋
eq_of_forall_ge_iff (λ z, by rw [neg_le, ceil_le, le_floor, int.cast_neg, neg_le])
lemma
int.ceil_neg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "eq_of_forall_ge_iff", "int.cast_neg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_ceil : z < ⌈a⌉ ↔ (z : α) < a
lt_iff_lt_of_le_iff_le ceil_le
lemma
int.lt_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "lt_iff_lt_of_le_iff_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_one_le_ceil_iff : z + 1 ≤ ⌈a⌉ ↔ (z : α) < a
by rw [← lt_ceil, add_one_le_iff]
lemma
int.add_one_le_ceil_iff
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
one_le_ceil_iff : 1 ≤ ⌈a⌉ ↔ 0 < a
by rw [← zero_add (1 : ℤ), add_one_le_ceil_iff, cast_zero]
lemma
int.one_le_ceil_iff
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_le_floor_add_one (a : α) : ⌈a⌉ ≤ ⌊a⌋ + 1
by { rw [ceil_le, int.cast_add, int.cast_one], exact (lt_floor_add_one a).le }
lemma
int.ceil_le_floor_add_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_add", "int.cast_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_ceil (a : α) : a ≤ ⌈a⌉
gc_ceil_coe.le_u_l a
lemma
int.le_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_int_cast (z : ℤ) : ⌈(z : α)⌉ = z
eq_of_forall_ge_iff $ λ a, by rw [ceil_le, int.cast_le]
lemma
int.ceil_int_cast
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "eq_of_forall_ge_iff", "int.cast_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_nat_cast (n : ℕ) : ⌈(n : α)⌉ = n
eq_of_forall_ge_iff $ λ a, by rw [ceil_le, ← cast_coe_nat, cast_le]
lemma
int.ceil_nat_cast
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "eq_of_forall_ge_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_mono : monotone (ceil : α → ℤ)
gc_ceil_coe.monotone_l
lemma
int.ceil_mono
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "monotone" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_add_int (a : α) (z : ℤ) : ⌈a + z⌉ = ⌈a⌉ + z
by rw [←neg_inj, neg_add', ←floor_neg, ←floor_neg, neg_add', floor_sub_int]
lemma
int.ceil_add_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_add_nat (a : α) (n : ℕ) : ⌈a + n⌉ = ⌈a⌉ + n
by rw [← int.cast_coe_nat, ceil_add_int]
lemma
int.ceil_add_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_coe_nat" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_add_one (a : α) : ⌈a + 1⌉ = ⌈a⌉ + 1
by { convert ceil_add_int a (1 : ℤ), exact cast_one.symm }
lemma
int.ceil_add_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_sub_int (a : α) (z : ℤ) : ⌈a - z⌉ = ⌈a⌉ - z
eq.trans (by rw [int.cast_neg, sub_eq_add_neg]) (ceil_add_int _ _)
lemma
int.ceil_sub_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_neg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_sub_nat (a : α) (n : ℕ) : ⌈a - n⌉ = ⌈a⌉ - n
by convert ceil_sub_int a n using 1; simp
lemma
int.ceil_sub_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_sub_one (a : α) : ⌈a - 1⌉ = ⌈a⌉ - 1
by rw [eq_sub_iff_add_eq, ← ceil_add_one, sub_add_cancel]
lemma
int.ceil_sub_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_lt_add_one (a : α) : (⌈a⌉ : α) < a + 1
by { rw [← lt_ceil, ← int.cast_one, ceil_add_int], apply lt_add_one }
lemma
int.ceil_lt_add_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_one", "lt_add_one" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_add_le (a b : α) : ⌈a + b⌉ ≤ ⌈a⌉ + ⌈b⌉
begin rw [ceil_le, int.cast_add], exact add_le_add (le_ceil _) (le_ceil _), end
lemma
int.ceil_add_le
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_add_ceil_le (a b : α) : ⌈a⌉ + ⌈b⌉ ≤ ⌈a + b⌉ + 1
begin rw [←le_sub_iff_add_le, ceil_le, int.cast_sub, int.cast_add, int.cast_one, le_sub_comm], refine (ceil_lt_add_one _).le.trans _, rw [le_sub_iff_add_le', ←add_assoc, add_le_add_iff_right], exact le_ceil _, end
lemma
int.ceil_add_ceil_le
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_add", "int.cast_one", "int.cast_sub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_pos : 0 < ⌈a⌉ ↔ 0 < a
by rw [lt_ceil, cast_zero]
lemma
int.ceil_pos
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_zero : ⌈(0 : α)⌉ = 0
by rw [← cast_zero, ceil_int_cast]
lemma
int.ceil_zero
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_one : ⌈(1 : α)⌉ = 1
by rw [← cast_one, ceil_int_cast]
lemma
int.ceil_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_nonneg (ha : 0 ≤ a) : 0 ≤ ⌈a⌉
by exact_mod_cast ha.trans (le_ceil a)
lemma
int.ceil_nonneg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_eq_iff : ⌈a⌉ = z ↔ ↑z - 1 < a ∧ a ≤ z
by rw [←ceil_le, ←int.cast_one, ←int.cast_sub, ←lt_ceil, int.sub_one_lt_iff, le_antisymm_iff, and.comm]
lemma
int.ceil_eq_iff
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.sub_one_lt_iff" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_eq_zero_iff : ⌈a⌉ = 0 ↔ a ∈ Ioc (-1 : α) 0
by simp [ceil_eq_iff]
lemma
int.ceil_eq_zero_iff
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_eq_on_Ioc (z : ℤ) : ∀ a ∈ set.Ioc (z - 1 : α) z, ⌈a⌉ = z
λ a ⟨h₀, h₁⟩, ceil_eq_iff.mpr ⟨h₀, h₁⟩
lemma
int.ceil_eq_on_Ioc
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ioc" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_eq_on_Ioc' (z : ℤ) : ∀ a ∈ set.Ioc (z - 1 : α) z, (⌈a⌉ : α) = z
λ a ha, by exact_mod_cast ceil_eq_on_Ioc z a ha
lemma
int.ceil_eq_on_Ioc'
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ioc" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
floor_le_ceil (a : α) : ⌊a⌋ ≤ ⌈a⌉
cast_le.1 $ (floor_le _).trans $ le_ceil _
lemma
int.floor_le_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
floor_lt_ceil_of_lt {a b : α} (h : a < b) : ⌊a⌋ < ⌈b⌉
cast_lt.1 $ (floor_le a).trans_lt $ h.trans_le $ le_ceil b
lemma
int.floor_lt_ceil_of_lt
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_ceil_singleton (m : ℤ) : (ceil : α → ℤ) ⁻¹' {m} = Ioc (m - 1) m
ext $ λ x, ceil_eq_iff
lemma
int.preimage_ceil_singleton
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
fract_eq_zero_or_add_one_sub_ceil (a : α) : fract a = 0 ∨ fract a = a + 1 - (⌈a⌉ : α)
begin cases eq_or_ne (fract a) 0 with ha ha, { exact or.inl ha, }, right, suffices : (⌈a⌉ : α) = ⌊a⌋ + 1, { rw [this, ← self_sub_fract], abel, }, norm_cast, rw ceil_eq_iff, refine ⟨_, _root_.le_of_lt $ by simp⟩, rw [cast_add, cast_one, add_tsub_cancel_right, ← self_sub_fract a, sub_lt_self_iff], exact ha....
lemma
int.fract_eq_zero_or_add_one_sub_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "add_tsub_cancel_right", "eq_or_ne" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_eq_add_one_sub_fract (ha : fract a ≠ 0) : (⌈a⌉ : α) = a + 1 - fract a
by { rw (or_iff_right ha).mp (fract_eq_zero_or_add_one_sub_ceil a), abel, }
lemma
int.ceil_eq_add_one_sub_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "or_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_sub_self_eq (ha : fract a ≠ 0) : (⌈a⌉ : α) - a = 1 - fract a
by { rw (or_iff_right ha).mp (fract_eq_zero_or_add_one_sub_ceil a), abel, }
lemma
int.ceil_sub_self_eq
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "or_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Ioo {a b : α} : ((coe : ℤ → α) ⁻¹' (set.Ioo a b)) = set.Ioo ⌊a⌋ ⌈b⌉
by { ext, simp [floor_lt, lt_ceil] }
lemma
int.preimage_Ioo
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ioo" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Ico {a b : α} : ((coe : ℤ → α) ⁻¹' (set.Ico a b)) = set.Ico ⌈a⌉ ⌈b⌉
by { ext, simp [ceil_le, lt_ceil] }
lemma
int.preimage_Ico
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ico" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Ioc {a b : α} : ((coe : ℤ → α) ⁻¹' (set.Ioc a b)) = set.Ioc ⌊a⌋ ⌊b⌋
by { ext, simp [floor_lt, le_floor] }
lemma
int.preimage_Ioc
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ioc" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Icc {a b : α} : ((coe : ℤ → α) ⁻¹' (set.Icc a b)) = set.Icc ⌈a⌉ ⌊b⌋
by { ext, simp [ceil_le, le_floor] }
lemma
int.preimage_Icc
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Icc" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Ioi : ((coe : ℤ → α) ⁻¹' (set.Ioi a)) = set.Ioi ⌊a⌋
by { ext, simp [floor_lt] }
lemma
int.preimage_Ioi
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ioi" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Ici : ((coe : ℤ → α) ⁻¹' (set.Ici a)) = set.Ici ⌈a⌉
by { ext, simp [ceil_le] }
lemma
int.preimage_Ici
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Ici" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Iio : ((coe : ℤ → α) ⁻¹' (set.Iio a)) = set.Iio ⌈a⌉
by { ext, simp [lt_ceil] }
lemma
int.preimage_Iio
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Iio" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
preimage_Iic : ((coe : ℤ → α) ⁻¹' (set.Iic a)) = set.Iic ⌊a⌋
by { ext, simp [le_floor] }
lemma
int.preimage_Iic
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "set.Iic" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round (x : α) : ℤ
if 2 * fract x < 1 then ⌊x⌋ else ⌈x⌉
def
round
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
`round` rounds a number to the nearest integer. `round (1 / 2) = 1`
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_zero : round (0 : α) = 0
by simp [round]
lemma
round_zero
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_one : round (1 : α) = 1
by simp [round]
lemma
round_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_nat_cast (n : ℕ) : round (n : α) = n
by simp [round]
lemma
round_nat_cast
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_int_cast (n : ℤ) : round (n : α) = n
by simp [round]
lemma
round_int_cast
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_add_int (x : α) (y : ℤ) : round (x + y) = round x + y
by rw [round, round, int.fract_add_int, int.floor_add_int, int.ceil_add_int, ← apply_ite2, if_t_t]
lemma
round_add_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "apply_ite2", "int.ceil_add_int", "int.floor_add_int", "int.fract_add_int", "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_add_one (a : α) : round (a + 1) = round a + 1
by { convert round_add_int a 1, exact int.cast_one.symm }
lemma
round_add_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_add_int" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_sub_int (x : α) (y : ℤ) : round (x - y) = round x - y
by { rw [sub_eq_add_neg], norm_cast, rw [round_add_int, sub_eq_add_neg] }
lemma
round_sub_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_add_int" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_sub_one (a : α) : round (a - 1) = round a - 1
by { convert round_sub_int a 1, exact int.cast_one.symm }
lemma
round_sub_one
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_sub_int" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_add_nat (x : α) (y : ℕ) : round (x + y) = round x + y
by rw [round, round, fract_add_nat, int.floor_add_nat, int.ceil_add_nat, ← apply_ite2, if_t_t]
lemma
round_add_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "apply_ite2", "int.ceil_add_nat", "int.floor_add_nat", "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_sub_nat (x : α) (y : ℕ) : round (x - y) = round x - y
by { rw [sub_eq_add_neg, ← int.cast_coe_nat], norm_cast, rw [round_add_int, sub_eq_add_neg] }
lemma
round_sub_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_coe_nat", "round", "round_add_int" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_int_add (x : α) (y : ℤ) : round ((y : α) + x) = y + round x
by { rw [add_comm, round_add_int, add_comm] }
lemma
round_int_add
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_add_int" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_nat_add (x : α) (y : ℕ) : round ((y : α) + x) = y + round x
by { rw [add_comm, round_add_nat, add_comm] }
lemma
round_nat_add
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_add_nat" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
abs_sub_round_eq_min (x : α) : |x - round x| = min (fract x) (1 - fract x)
begin simp_rw [round, min_def_lt, two_mul, ← lt_tsub_iff_left], cases lt_or_ge (fract x) (1 - fract x) with hx hx, { rw [if_pos hx, if_pos hx, self_sub_floor, abs_fract], }, { have : 0 < fract x, { replace hx : 0 < fract x + fract x := lt_of_lt_of_le zero_lt_one (tsub_le_iff_left.mp hx), simpa only [←...
lemma
abs_sub_round_eq_min
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "abs_sub_comm", "lt_tsub_iff_left", "min_def_lt", "round", "two_mul", "zero_lt_mul_left", "zero_lt_one", "zero_lt_two" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_le (x : α) (z : ℤ) : |x - round x| ≤ |x - z|
begin rw [abs_sub_round_eq_min, min_le_iff], rcases le_or_lt (z : α) x with hx | hx; [left, right], { conv_rhs { rw [abs_eq_self.mpr (sub_nonneg.mpr hx), ← fract_add_floor x, add_sub_assoc], }, simpa only [le_add_iff_nonneg_right, sub_nonneg, cast_le] using le_floor.mpr hx, }, { rw abs_eq_neg_self.mpr (sub_...
lemma
round_le
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "abs_sub_round_eq_min", "min_le_iff", "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_eq (x : α) : round x = ⌊x + 1 / 2⌋
begin simp_rw [round, (by simp only [lt_div_iff', two_pos] : 2 * fract x < 1 ↔ fract x < 1 / 2)], cases lt_or_ge (fract x) (1 / 2) with hx hx, { conv_rhs { rw [← fract_add_floor x, add_assoc, add_left_comm, floor_int_add], }, rw [if_pos hx, self_eq_add_right, floor_eq_iff, cast_zero, zero_add], split; lin...
lemma
round_eq
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "lt_div_iff'", "round" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_two_inv : round (2⁻¹ : α) = 1
by simp only [round_eq, ← one_div, add_halves', floor_one]
lemma
round_two_inv
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "add_halves'", "one_div", "round", "round_eq" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_neg_two_inv : round (-2⁻¹ : α) = 0
by simp only [round_eq, ← one_div, add_left_neg, floor_zero]
lemma
round_neg_two_inv
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "one_div", "round", "round_eq" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
round_eq_zero_iff {x : α} : round x = 0 ↔ x ∈ Ico (-(1 / 2)) ((1 : α)/2)
begin rw [round_eq, floor_eq_zero_iff, add_mem_Ico_iff_left], norm_num, end
lemma
round_eq_zero_iff
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "round", "round_eq" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
abs_sub_round (x : α) : |x - round x| ≤ 1 / 2
begin rw [round_eq, abs_sub_le_iff], have := floor_le (x + 1 / 2), have := lt_floor_add_one (x + 1 / 2), split; linarith end
lemma
abs_sub_round
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "abs_sub_le_iff", "round", "round_eq" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
abs_sub_round_div_nat_cast_eq {m n : ℕ} :
|(m : α) / n - round ((m : α) / n)| = ↑(min (m % n) (n - m % n)) / n := begin rcases n.eq_zero_or_pos with rfl | hn, { simp, }, have hn' : 0 < (n : α), { norm_cast, assumption, }, rw [abs_sub_round_eq_min, nat.cast_min, ← min_div_div_right hn'.le, fract_div_nat_cast_eq_div_nat_cast_mod, nat.cast_sub (m.mod_lt...
lemma
abs_sub_round_div_nat_cast_eq
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "abs_sub_round_eq_min", "div_self", "min_div_div_right", "nat.cast_min", "nat.cast_sub", "round", "sub_div" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
floor_congr (h : ∀ n : ℕ, (n : α) ≤ a ↔ (n : β) ≤ b) : ⌊a⌋₊ = ⌊b⌋₊
begin have h₀ : 0 ≤ a ↔ 0 ≤ b := by simpa only [cast_zero] using h 0, obtain ha | ha := lt_or_le a 0, { rw [floor_of_nonpos ha.le, floor_of_nonpos (le_of_not_le $ h₀.not.mp ha.not_le)] }, exact (le_floor $ (h _).1 $ floor_le ha).antisymm (le_floor $ (h _).2 $ floor_le $ h₀.1 ha), end
lemma
nat.floor_congr
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_congr (h : ∀ n : ℕ, a ≤ n ↔ b ≤ n) : ⌈a⌉₊ = ⌈b⌉₊
(ceil_le.2 $ (h _).2 $ le_ceil _).antisymm $ ceil_le.2 $ (h _).1 $ le_ceil _
lemma
nat.ceil_congr
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_floor (f : F) (hf : strict_mono f) (a : α) : ⌊f a⌋₊ = ⌊a⌋₊
floor_congr $ λ n, by rw [←map_nat_cast f, hf.le_iff_le]
lemma
nat.map_floor
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_ceil (f : F) (hf : strict_mono f) (a : α) : ⌈f a⌉₊ = ⌈a⌉₊
ceil_congr $ λ n, by rw [←map_nat_cast f, hf.le_iff_le]
lemma
nat.map_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
floor_congr (h : ∀ n : ℤ, (n : α) ≤ a ↔ (n : β) ≤ b) : ⌊a⌋ = ⌊b⌋
(le_floor.2 $ (h _).1 $ floor_le _).antisymm $ le_floor.2 $ (h _).2 $ floor_le _
lemma
int.floor_congr
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
ceil_congr (h : ∀ n : ℤ, a ≤ n ↔ b ≤ n) : ⌈a⌉ = ⌈b⌉
(ceil_le.2 $ (h _).2 $ le_ceil _).antisymm $ ceil_le.2 $ (h _).1 $ le_ceil _
lemma
int.ceil_congr
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_floor (f : F) (hf : strict_mono f) (a : α) : ⌊f a⌋ = ⌊a⌋
floor_congr $ λ n, by rw [←map_int_cast f, hf.le_iff_le]
lemma
int.map_floor
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_ceil (f : F) (hf : strict_mono f) (a : α) : ⌈f a⌉ = ⌈a⌉
ceil_congr $ λ n, by rw [←map_int_cast f, hf.le_iff_le]
lemma
int.map_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_fract (f : F) (hf : strict_mono f) (a : α) : fract (f a) = f (fract a)
by simp_rw [fract, map_sub, map_int_cast, map_floor _ hf]
lemma
int.map_fract
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "map_int_cast", "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_round (f : F) (hf : strict_mono f) (a : α) : round (f a) = round a
by simp_rw [round_eq, ←map_floor _ hf, map_add, one_div, map_inv₀, map_bit0, map_one]
lemma
int.map_round
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "map_bit0", "map_inv₀", "map_one", "one_div", "round", "round_eq", "strict_mono" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
_root_.floor_ring.to_floor_semiring : floor_semiring α
{ floor := λ a, ⌊a⌋.to_nat, ceil := λ a, ⌈a⌉.to_nat, floor_of_neg := λ a ha, int.to_nat_of_nonpos (int.floor_nonpos ha.le), gc_floor := λ a n ha, by rw [int.le_to_nat_iff (int.floor_nonneg.2 ha), int.le_floor, int.cast_coe_nat], gc_ceil := λ a n, by rw [int.to_nat_le, int.ceil_le, int.cast_coe_nat] }
instance
floor_ring.to_floor_semiring
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "floor_semiring", "int.cast_coe_nat", "int.ceil_le", "int.floor_nonpos", "int.le_floor", "int.le_to_nat_iff", "int.to_nat_le", "int.to_nat_of_nonpos" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
int.floor_to_nat (a : α) : ⌊a⌋.to_nat = ⌊a⌋₊
rfl
lemma
int.floor_to_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
int.ceil_to_nat (a : α) : ⌈a⌉.to_nat = ⌈a⌉₊
rfl
lemma
int.ceil_to_nat
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.floor_int : (nat.floor : ℤ → ℕ) = int.to_nat
rfl
lemma
nat.floor_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "nat.floor" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.ceil_int : (nat.ceil : ℤ → ℕ) = int.to_nat
rfl
lemma
nat.ceil_int
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "nat.ceil" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.cast_floor_eq_int_floor (ha : 0 ≤ a) : (⌊a⌋₊ : ℤ) = ⌊a⌋
by rw [←int.floor_to_nat, int.to_nat_of_nonneg (int.floor_nonneg.2 ha)]
lemma
nat.cast_floor_eq_int_floor
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.to_nat_of_nonneg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.cast_floor_eq_cast_int_floor (ha : 0 ≤ a) : (⌊a⌋₊ : α) = ⌊a⌋
by rw [←nat.cast_floor_eq_int_floor ha, int.cast_coe_nat]
lemma
nat.cast_floor_eq_cast_int_floor
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_coe_nat" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.cast_ceil_eq_int_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : ℤ) = ⌈a⌉
by { rw [←int.ceil_to_nat, int.to_nat_of_nonneg (int.ceil_nonneg ha)] }
lemma
nat.cast_ceil_eq_int_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.ceil_nonneg", "int.to_nat_of_nonneg" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat.cast_ceil_eq_cast_int_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : α) = ⌈a⌉
by rw [←nat.cast_ceil_eq_int_ceil ha, int.cast_coe_nat]
lemma
nat.cast_ceil_eq_cast_int_ceil
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "int.cast_coe_nat" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
subsingleton_floor_ring {α} [linear_ordered_ring α] : subsingleton (floor_ring α)
begin refine ⟨λ H₁ H₂, _⟩, have : H₁.floor = H₂.floor := funext (λ a, H₁.gc_coe_floor.u_unique H₂.gc_coe_floor $ λ _, rfl), have : H₁.ceil = H₂.ceil := funext (λ a, H₁.gc_ceil_coe.l_unique H₂.gc_ceil_coe $ λ _, rfl), cases H₁, cases H₂, congr; assumption end
lemma
subsingleton_floor_ring
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "floor_ring", "linear_ordered_ring" ]
There exists at most one `floor_ring` structure on a given linear ordered ring.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
int_floor_nonneg [linear_ordered_ring α] [floor_ring α] {a : α} (ha : 0 ≤ a) : 0 ≤ ⌊a⌋
int.floor_nonneg.2 ha
lemma
tactic.int_floor_nonneg
algebra.order
src/algebra/order/floor.lean
[ "data.int.lemmas", "data.set.intervals.group", "data.set.lattice", "tactic.abel", "tactic.linarith", "tactic.positivity" ]
[ "floor_ring", "linear_ordered_ring" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83