Skip to content

Commit d3a9d9c

Browse files
committed
chore: Let gcongr know about Nat.cast_lt (#15879)
From LeanAPAP
1 parent abe811a commit d3a9d9c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Mathlib/Computability/AkraBazzi/AkraBazzi.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ lemma rpow_p_mul_one_sub_smoothingFn_le :
10531053
case bn_gt_one =>
10541054
calc 1 = b i * (b i)⁻¹ := by rw [mul_inv_cancel₀ (by positivity)]
10551055
_ ≤ b i * ⌈(b i)⁻¹⌉₊ := by gcongr; exact Nat.le_ceil _
1056-
_ < b i * n := by gcongr; rw [Nat.cast_lt]; exact hn
1056+
_ < b i * n := by gcongr
10571057
case le => calc b i * n ≤ 1 * n := by have := R.b_lt_one i; gcongr
10581058
_ = n := by rw [one_mul]
10591059
positivity
@@ -1149,7 +1149,7 @@ lemma rpow_p_mul_one_add_smoothingFn_ge :
11491149
case bn_gt_one =>
11501150
calc 1 = b i * (b i)⁻¹ := by rw [mul_inv_cancel₀ (by positivity)]
11511151
_ ≤ b i * ⌈(b i)⁻¹⌉₊ := by gcongr; exact Nat.le_ceil _
1152-
_ < b i * n := by gcongr; rw [Nat.cast_lt]; exact hn
1152+
_ < b i * n := by gcongr
11531153
case le => calc b i * n ≤ 1 * n := by have := R.b_lt_one i; gcongr
11541154
_ = n := by rw [one_mul]
11551155
positivity

Mathlib/Data/Nat/Cast/Order/Basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ variable [CharZero α] {m n : ℕ}
6969
theorem strictMono_cast : StrictMono (Nat.cast : ℕ → α) :=
7070
mono_cast.strictMono_of_injective cast_injective
7171

72+
@[gcongr]
73+
lemma _root_.GCongr.natCast_lt_natCast {a b : ℕ} (h : a < b) : (a : α) < b := strictMono_cast h
74+
7275
/-- `Nat.cast : ℕ → α` as an `OrderEmbedding` -/
7376
@[simps! (config := .asFn)]
7477
def castOrderEmbedding : ℕ ↪o α :=

0 commit comments

Comments
 (0)