Skip to content

Commit 8b01025

Browse files
chore: deprecate Nat.le_div_iff_mul_le' and Nat.div_lt_iff_lt_mul' (#18721)
These duplicate the unprimed lemmas exactly (except in the names of the arguments).
1 parent d25464f commit 8b01025

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

Mathlib/Combinatorics/SetFamily/Intersecting.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ theorem Intersecting.is_max_iff_card_eq (hs : (s : Set α).Intersecting) :
173173
theorem Intersecting.exists_card_eq (hs : (s : Set α).Intersecting) :
174174
∃ t, s ⊆ t ∧ 2 * #t = Fintype.card α ∧ (t : Set α).Intersecting := by
175175
have := hs.card_le
176-
rw [mul_comm, ← Nat.le_div_iff_mul_le' Nat.two_pos] at this
176+
rw [mul_comm, ← Nat.le_div_iff_mul_le Nat.two_pos] at this
177177
revert hs
178178
refine s.strongDownwardInductionOn ?_ this
179179
rintro s ih _hcard hs
@@ -182,7 +182,7 @@ theorem Intersecting.exists_card_eq (hs : (s : Set α).Intersecting) :
182182
push_neg at h
183183
obtain ⟨t, ht, hst⟩ := h
184184
refine (ih ?_ (_root_.ssubset_iff_subset_ne.2 hst) ht).imp fun u => And.imp_left hst.1.trans
185-
rw [Nat.le_div_iff_mul_le' Nat.two_pos, mul_comm]
185+
rw [Nat.le_div_iff_mul_le Nat.two_pos, mul_comm]
186186
exact ht.card_le
187187

188188
end Set

Mathlib/Combinatorics/SimpleGraph/Regularity/Bound.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ theorem hundred_div_ε_pow_five_le_m [Nonempty α] (hPα : #P.parts * 16 ^ #P.pa
119119
(hPε : 100 ≤ (4 : ℝ) ^ #P.parts * ε ^ 5) : 100 / ε ^ 5 ≤ m :=
120120
(div_le_of_le_mul₀ (eps_pow_five_pos hPε).le (by positivity) hPε).trans <| by
121121
norm_cast
122-
rwa [Nat.le_div_iff_mul_le' (stepBound_pos (P.parts_nonempty <|
122+
rwa [Nat.le_div_iff_mul_le (stepBound_pos (P.parts_nonempty <|
123123
univ_nonempty.ne_empty).card_pos), stepBound, mul_left_comm, ← mul_pow]
124124

125125
theorem hundred_le_m [Nonempty α] (hPα : #P.parts * 16 ^ #P.parts ≤ card α)

Mathlib/Computability/Primrec.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ theorem nat_div : Primrec₂ ((· / ·) : ℕ → ℕ → ℕ) := by
690690
if H : k = 0 then simp [H, eq_comm]
691691
else
692692
have : q * k ≤ a ∧ a < (q + 1) * k ↔ q = a / k := by
693-
rw [le_antisymm_iff, ← (@Nat.lt_succ _ q), Nat.le_div_iff_mul_le' (Nat.pos_of_ne_zero H),
694-
Nat.div_lt_iff_lt_mul' (Nat.pos_of_ne_zero H)]
693+
rw [le_antisymm_iff, ← (@Nat.lt_succ _ q), Nat.le_div_iff_mul_le (Nat.pos_of_ne_zero H),
694+
Nat.div_lt_iff_lt_mul (Nat.pos_of_ne_zero H)]
695695
simpa [H, zero_lt_iff, eq_comm (b := q)]
696696

697697
theorem nat_mod : Primrec₂ ((· % ·) : ℕ → ℕ → ℕ) :=

Mathlib/Data/Nat/Choose/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ theorem choose_le_middle (r n : ℕ) : choose n r ≤ choose n (n / 2) := by
295295
· apply choose_le_middle_of_le_half_left a
296296
· rw [← choose_symm b]
297297
apply choose_le_middle_of_le_half_left
298-
rw [div_lt_iff_lt_mul' Nat.zero_lt_two] at h
299-
rw [le_div_iff_mul_le' Nat.zero_lt_two, Nat.mul_sub_right_distrib, Nat.sub_le_iff_le_add,
298+
rw [div_lt_iff_lt_mul Nat.zero_lt_two] at h
299+
rw [le_div_iff_mul_le Nat.zero_lt_two, Nat.mul_sub_right_distrib, Nat.sub_le_iff_le_add,
300300
← Nat.sub_le_iff_le_add', Nat.mul_two, Nat.add_sub_cancel]
301301
exact le_of_lt h
302302
· rw [choose_eq_zero_of_lt b]

Mathlib/Data/Nat/Defs.lean

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,11 @@ lemma div_le_iff_le_mul_add_pred (hb : 0 < b) : a / b ≤ c ↔ a ≤ b * c + (b
412412
lemma div_lt_self' (a b : ℕ) : (a + 1) / (b + 2) < a + 1 :=
413413
Nat.div_lt_self (Nat.succ_pos _) (Nat.succ_lt_succ (Nat.succ_pos _))
414414

415+
@[deprecated le_div_iff_mul_le (since := "2024-11-06")]
415416
lemma le_div_iff_mul_le' (hb : 0 < b) : a ≤ c / b ↔ a * b ≤ c := le_div_iff_mul_le hb
416417

417-
lemma div_lt_iff_lt_mul' (hb : 0 < b) : a / b < c ↔ a < c * b := by
418-
simp only [← Nat.not_le, le_div_iff_mul_le' hb]
418+
@[deprecated div_lt_iff_lt_mul (since := "2024-11-06")]
419+
lemma div_lt_iff_lt_mul' (hb : 0 < b) : a / b < c ↔ a < c * b := div_lt_iff_lt_mul hb
419420

420421
lemma one_le_div_iff (hb : 0 < b) : 1 ≤ a / b ↔ b ≤ a := by rw [le_div_iff_mul_le hb, Nat.one_mul]
421422

@@ -425,7 +426,7 @@ lemma div_lt_one_iff (hb : 0 < b) : a / b < 1 ↔ a < b := by
425426
@[gcongr]
426427
protected lemma div_le_div_right (h : a ≤ b) : a / c ≤ b / c :=
427428
(c.eq_zero_or_pos.elim fun hc ↦ by simp [hc]) fun hc ↦
428-
(le_div_iff_mul_le' hc).2 <| Nat.le_trans (Nat.div_mul_le_self _ _) h
429+
(le_div_iff_mul_le hc).2 <| Nat.le_trans (Nat.div_mul_le_self _ _) h
429430

430431
lemma lt_of_div_lt_div (h : a / c < b / c) : a < b :=
431432
Nat.lt_of_not_le fun hab ↦ Nat.not_le_of_lt h <| Nat.div_le_div_right hab
@@ -475,7 +476,7 @@ protected lemma mul_div_mul_comm (hba : b ∣ a) (hdc : d ∣ c) : a * c / (b *
475476

476477
lemma eq_zero_of_le_div (hn : 2 ≤ n) (h : m ≤ m / n) : m = 0 :=
477478
eq_zero_of_mul_le hn <| by
478-
rw [Nat.mul_comm]; exact (Nat.le_div_iff_mul_le' (Nat.lt_of_lt_of_le (by decide) hn)).1 h
479+
rw [Nat.mul_comm]; exact (Nat.le_div_iff_mul_le (Nat.lt_of_lt_of_le (by decide) hn)).1 h
479480

480481
lemma div_mul_div_le_div (a b c : ℕ) : a / c * b / a ≤ b / c := by
481482
obtain rfl | ha := Nat.eq_zero_or_pos a
@@ -1151,7 +1152,7 @@ protected theorem div_le_div {a b c d : ℕ} (h1 : a ≤ b) (h2 : d ≤ c) (h3 :
11511152
-- Moved to Batteries
11521153

11531154
lemma lt_mul_div_succ (a : ℕ) (hb : 0 < b) : a < b * (a / b + 1) := by
1154-
rw [Nat.mul_comm, ← Nat.div_lt_iff_lt_mul' hb]
1155+
rw [Nat.mul_comm, ← Nat.div_lt_iff_lt_mul hb]
11551156
exact lt_succ_self _
11561157

11571158
-- TODO: Batteries claimed this name but flipped the order of multiplication

Mathlib/NumberTheory/Bertrand.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ theorem centralBinom_factorization_small (n : ℕ) (n_large : 2 < n)
132132
· exact Finset.range_subset.2 (add_le_add_right (Nat.div_le_self _ _) _)
133133
intro x hx h2x
134134
rw [Finset.mem_range, Nat.lt_succ_iff] at hx h2x
135-
rw [not_le, div_lt_iff_lt_mul' three_pos, mul_comm x] at h2x
135+
rw [not_le, div_lt_iff_lt_mul three_pos, mul_comm x] at h2x
136136
replace no_prime := not_exists.mp no_prime x
137137
rw [← and_assoc, not_and', not_and_or, not_lt] at no_prime
138138
cases' no_prime hx with h h

0 commit comments

Comments
 (0)