Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e336caf

Browse files
committed
chore(algebra/floor): add a trivial lemma (#9098)
* add `nat_ceil_eq_zero`; * add `@[simp]` to `nat_ceil_le`.
1 parent 796efae commit e336caf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/algebra/floor.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def nat_ceil (a : α) : ℕ := int.to_nat ⌈a⌉
359359

360360
notation `⌈` x `⌉₊` := nat_ceil x
361361

362-
theorem nat_ceil_le : ⌈a⌉₊ ≤ n ↔ a ≤ n :=
362+
@[simp] theorem nat_ceil_le : ⌈a⌉₊ ≤ n ↔ a ≤ n :=
363363
by rw [nat_ceil, int.to_nat_le, ceil_le]; refl
364364

365365
theorem lt_nat_ceil : n < ⌈a⌉₊ ↔ (n : α) < a :=
@@ -375,6 +375,9 @@ show (⌈((n : ℤ) : α)⌉).to_nat = n, by rw [ceil_coe]; refl
375375

376376
@[simp] theorem nat_ceil_zero : ⌈(0 : α)⌉₊ = 0 := nat_ceil_coe 0
377377

378+
@[simp] theorem nat_ceil_eq_zero : ⌈a⌉₊ = 0 ↔ a ≤ 0 :=
379+
by simp [← nonpos_iff_eq_zero]
380+
378381
theorem nat_ceil_add_nat {a : α} (a_nonneg : 0 ≤ a) (n : ℕ) : ⌈a + n⌉₊ = ⌈a⌉₊ + n :=
379382
begin
380383
change int.to_nat (⌈a + (n:ℤ)⌉) = int.to_nat ⌈a⌉ + n,

0 commit comments

Comments
 (0)