-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b9c094
commit 7f154cd
Showing
5 changed files
with
107 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Mathlib.Algebra.Order.Floor | ||
|
||
namespace Nat | ||
variable {α : Type*} [LinearOrderedField α] [FloorSemiring α] {a b : α} | ||
|
||
lemma ceil_lt_mul (ha : 0 ≤ a) (hb : 1 < b) (h : (b - 1)⁻¹ ≤ a) : ⌈a⌉₊ < b * a := by | ||
rw [← sub_pos] at hb | ||
calc | ||
⌈a⌉₊ < a + 1 := ceil_lt_add_one ha | ||
_ = a + (b - 1) * (b - 1)⁻¹ := by rw [mul_inv_cancel₀]; positivity | ||
_ ≤ a + (b - 1) * a := by gcongr; positivity | ||
_ = b * a := by rw [sub_one_mul, add_sub_cancel] | ||
|
||
lemma ceil_lt_two_mul (ha : 1 ≤ a) : ⌈a⌉₊ < 2 * a := | ||
ceil_lt_mul (by positivity) one_lt_two (by norm_num; exact ha) | ||
|
||
end Nat | ||
|
||
namespace Int | ||
variable {α : Type*} [LinearOrderedField α] [FloorRing α] {a b : α} | ||
|
||
lemma ceil_lt_mul (hb : 1 < b) (ha : (b - 1)⁻¹ ≤ a) : ⌈a⌉ < b * a := by | ||
rw [← sub_pos] at hb | ||
calc | ||
⌈a⌉ < a + 1 := ceil_lt_add_one _ | ||
_ = a + (b - 1) * (b - 1)⁻¹ := by rw [mul_inv_cancel₀]; positivity | ||
_ ≤ a + (b - 1) * a := by gcongr; positivity | ||
_ = b * a := by rw [sub_one_mul, add_sub_cancel] | ||
|
||
lemma ceil_lt_two_mul (ha : 1 ≤ a) : ⌈a⌉ < 2 * a := ceil_lt_mul one_lt_two (by norm_num; exact ha) | ||
|
||
end Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/-! | ||
# TODO | ||
Rename `one_le_mul_of_one_le_of_one_le` to `one_le_mul₀` | ||
-/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Mathlib.Analysis.SpecialFunctions.Log.Basic | ||
|
||
namespace Real | ||
variable {x : ℝ} | ||
|
||
lemma log_le_self (hx : 0 ≤ x) : log x ≤ x := by | ||
obtain rfl | hx := hx.eq_or_lt | ||
· simp | ||
· exact (log_le_sub_one_of_pos hx).trans (by linarith) | ||
|
||
end Real |