Skip to content

Commit

Permalink
feat(data/nat/basic): add one_le_div_iff (#12461)
Browse files Browse the repository at this point in the history
Couldn't find these.
  • Loading branch information
kbuzzard committed Mar 7, 2022
1 parent 2675b5c commit 3f353db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/data/nat/basic.lean
Expand Up @@ -800,6 +800,12 @@ le_div_iff_mul_le x y k0
theorem div_lt_iff_lt_mul' {x y : ℕ} {k : ℕ} (k0 : 0 < k) : x / k < y ↔ x < y * k :=
lt_iff_lt_of_le_iff_le $ le_div_iff_mul_le' k0

lemma one_le_div_iff {a b : ℕ} (hb : 0 < b) : 1 ≤ a / b ↔ b ≤ a :=
by rw [le_div_iff_mul_le _ _ hb, one_mul]

lemma div_lt_one_iff {a b : ℕ} (hb : 0 < b) : a / b < 1 ↔ a < b :=
lt_iff_lt_of_le_iff_le $ one_le_div_iff hb

protected theorem div_le_div_right {n m : ℕ} (h : n ≤ m) {k : ℕ} : n / k ≤ m / k :=
(nat.eq_zero_or_pos k).elim (λ k0, by simp [k0]) $ λ hk,
(le_div_iff_mul_le' hk).2 $ le_trans (nat.div_mul_le_self _ _) h
Expand Down

0 comments on commit 3f353db

Please sign in to comment.