Skip to content

Commit 66464ac

Browse files
committed
chore(Data): deprecate toReal_eq_toReal, count_eq_of_nodup and smul_mat_cons (#28484)
1 parent 96d8298 commit 66464ac

File tree

13 files changed

+16
-25
lines changed

13 files changed

+16
-25
lines changed

Archive/Wiedijk100Theorems/BallotProblem.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ theorem ballot_problem :
356356
rw [ENNReal.toReal_div, ← Nat.cast_add, ← Nat.cast_add, ENNReal.toReal_natCast,
357357
ENNReal.toReal_sub_of_le, ENNReal.toReal_natCast, ENNReal.toReal_natCast]
358358
exacts [Nat.cast_le.2 qp.le, ENNReal.natCast_ne_top _]
359-
rwa [ENNReal.toReal_eq_toReal (measure_lt_top _ _).ne] at this
359+
rwa [ENNReal.toReal_eq_toReal_iff' (measure_lt_top _ _).ne] at this
360360
simp only [Ne, ENNReal.div_eq_top, tsub_eq_zero_iff_le, Nat.cast_le, not_le,
361361
add_eq_zero, Nat.cast_eq_zero, ENNReal.add_eq_top, ENNReal.natCast_ne_top, or_self_iff,
362362
not_false_iff, and_true]

Mathlib/Data/ENNReal/Real.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ theorem toReal_top_mul (a : ℝ≥0∞) : ENNReal.toReal (∞ * a) = 0 := by
347347
rw [mul_comm]
348348
exact toReal_mul_top _
349349

350-
theorem toReal_eq_toReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toReal = b.toReal ↔ a = b := by
351-
lift a to ℝ≥0 using ha
352-
lift b to ℝ≥0 using hb
353-
simp only [coe_inj, NNReal.coe_inj, coe_toReal]
350+
@[deprecated (since := "2025-11-07")] alias toReal_eq_toReal := toReal_eq_toReal_iff'
354351

355352
protected theorem trichotomy (p : ℝ≥0∞) : p = 0 ∨ p = ∞ ∨ 0 < p.toReal := by
356353
simpa only [or_iff_not_imp_left] using toReal_pos

Mathlib/Data/List/Dedup.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ theorem replicate_dedup {x : α} : ∀ {k}, k ≠ 0 → (replicate k x).dedup =
171171
replicate_dedup n.succ_ne_zero]
172172

173173
theorem count_dedup (l : List α) (a : α) : l.dedup.count a = if a ∈ l then 1 else 0 := by
174-
simp_rw [count_eq_of_nodup <| nodup_dedup l, mem_dedup]
174+
simp_rw [List.Nodup.count <| nodup_dedup l, mem_dedup]
175175

176176
theorem Perm.dedup {l₁ l₂ : List α} (p : l₁ ~ l₂) : dedup l₁ ~ dedup l₂ :=
177177
perm_iff_count.2 fun a =>

Mathlib/Data/List/FinRange.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ theorem pairwise_le_finRange (n : ℕ) : Pairwise (· ≤ ·) (finRange n) := by
5151

5252
@[simp]
5353
lemma count_finRange {n : ℕ} (a : Fin n) : count a (finRange n) = 1 := by
54-
simp [count_eq_of_nodup (nodup_finRange n)]
54+
simp [List.Nodup.count (nodup_finRange n)]
5555

5656
theorem get_finRange {n : ℕ} {i : ℕ} (h) :
5757
(finRange n).get ⟨i, h⟩ = ⟨i, length_finRange (n := n) ▸ h⟩ := by

Mathlib/Data/List/Nodup.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,7 @@ theorem count_eq_one_of_mem [DecidableEq α] {a : α} {l : List α} (d : Nodup l
155155
count a l = 1 :=
156156
_root_.le_antisymm (nodup_iff_count_le_one.1 d a) (Nat.succ_le_of_lt (count_pos_iff.2 h))
157157

158-
theorem count_eq_of_nodup [DecidableEq α] {a : α} {l : List α} (d : Nodup l) :
159-
count a l = if a ∈ l then 1 else 0 := by
160-
split_ifs with h
161-
· exact count_eq_one_of_mem d h
162-
· exact count_eq_zero_of_not_mem h
158+
@[deprecated (since := "2025-11-07")] alias count_eq_of_nodup := Nodup.count
163159

164160
theorem Nodup.of_append_left : Nodup (l₁ ++ l₂) → Nodup l₁ :=
165161
Nodup.sublist (sublist_append_left l₁ l₂)

Mathlib/LinearAlgebra/Matrix/Notation.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,7 @@ variable [NonUnitalNonAssocSemiring α]
365365
theorem smul_mat_empty {m' : Type*} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
366366
empty_eq _
367367

368-
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
369-
x • vecCons v A = vecCons (x • v) (x • A) := by
370-
ext i
371-
refine Fin.cases ?_ ?_ i <;> simp
368+
@[deprecated (since := "2025-11-07")] alias smul_mat_cons := smul_cons
372369

373370
end SMul
374371

Mathlib/MeasureTheory/Function/ConditionalExpectation/Real.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ theorem eLpNorm_one_condExp_le_eLpNorm (f : α → ℝ) : eLpNorm (μ[f|m]) 1 μ
7070
exact abs_le_abs hx₁ hx₂
7171
_ = eLpNorm f 1 μ := by
7272
rw [eLpNorm_one_eq_lintegral_enorm, eLpNorm_one_eq_lintegral_enorm,
73-
← ENNReal.toReal_eq_toReal (hasFiniteIntegral_iff_enorm.mp integrable_condExp.2).ne
73+
← ENNReal.toReal_eq_toReal_iff' (hasFiniteIntegral_iff_enorm.mp integrable_condExp.2).ne
7474
(hasFiniteIntegral_iff_enorm.mp hf.2).ne,
7575
← integral_norm_eq_lintegral_enorm
7676
(stronglyMeasurable_condExp.mono hm).aestronglyMeasurable,

Mathlib/MeasureTheory/Function/L2Space.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ theorem integral_inner_eq_sq_eLpNorm (f : α →₂[μ] E) :
152152
private theorem norm_sq_eq_re_inner (f : α →₂[μ] E) : ‖f‖ ^ 2 = RCLike.re ⟪f, f⟫ := by
153153
have h_two : (2 : ℝ≥0∞).toReal = 2 := by simp
154154
rw [inner_def, integral_inner_eq_sq_eLpNorm, norm_def, ← ENNReal.toReal_pow, RCLike.ofReal_re,
155-
ENNReal.toReal_eq_toReal (ENNReal.pow_ne_top (Lp.eLpNorm_ne_top f)) _]
155+
ENNReal.toReal_eq_toReal_iff' (ENNReal.pow_ne_top (Lp.eLpNorm_ne_top f)) _]
156156
· rw [← ENNReal.rpow_natCast, eLpNorm_eq_eLpNorm' two_ne_zero ENNReal.ofNat_ne_top, eLpNorm', ←
157157
ENNReal.rpow_mul, one_div, h_two]
158158
simp [enorm_eq_nnnorm]

Mathlib/MeasureTheory/Integral/Layercake.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ theorem Integrable.integral_eq_integral_meas_lt
520520
have rhs_finite : ∫⁻ (t : ℝ) in Set.Ioi 0, μ {a | t < f a} < ∞ := by simp only [← key, lhs_finite]
521521
have rhs_integrand_finite : ∀ (t : ℝ), t > 0 → μ {a | t < f a} < ∞ :=
522522
fun t ht ↦ measure_gt_lt_top f_intble ht
523-
convert (ENNReal.toReal_eq_toReal lhs_finite.ne rhs_finite.ne).mpr key
523+
convert (ENNReal.toReal_eq_toReal_iff' lhs_finite.ne rhs_finite.ne).mpr key
524524
· exact integral_eq_lintegral_of_nonneg_ae f_nn f_intble.aestronglyMeasurable
525525
· have aux := @integral_eq_lintegral_of_nonneg_ae _ _ ((volume : Measure ℝ).restrict (Set.Ioi 0))
526526
(fun t ↦ μ.real {a : α | t < f a}) ?_ ?_

Mathlib/Probability/Distributions/Exponential.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ lemma lintegral_exponentialPDF_eq_antiDeriv {r : ℝ} (hr : 0 < r) (x : ℝ) :
146146
simp only [exponentialPDF_eq]
147147
rw [setLIntegral_congr_fun measurableSet_Icc (g := fun x ↦ ENNReal.ofReal (r * rexp (-(r * x))))
148148
(by intro a ha; simp [ha.1])]
149-
rw [← ENNReal.toReal_eq_toReal _ ENNReal.ofReal_ne_top, ← integral_eq_lintegral_of_nonneg_ae
150-
(Eventually.of_forall fun _ ↦ le_of_lt (mul_pos hr (exp_pos _)))]
149+
rw [← ENNReal.toReal_eq_toReal_iff' _ ENNReal.ofReal_ne_top,
150+
← integral_eq_lintegral_of_nonneg_ae (Eventually.of_forall fun _ ↦ le_of_lt
151+
(mul_pos hr (exp_pos _)))]
151152
· have : ∫ a in uIoc 0 x, r * rexp (-(r * a)) = ∫ a in 0..x, r * rexp (-(r * a)) := by
152153
rw [intervalIntegral.intervalIntegral_eq_integral_uIoc, smul_eq_mul, if_pos h, one_mul]
153154
rw [integral_Icc_eq_integral_Ioc, ← uIoc_of_le h, this]

0 commit comments

Comments
 (0)