Skip to content

Commit 4d3be31

Browse files
committed
chore(Probability): Eliminate non-terminal simp (leanprover-community#34943)
1 parent af53ecf commit 4d3be31

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Mathlib/Probability/Distributions/Exponential.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ lemma exp_neg_integrableOn_Ioc {b x : ℝ} (hb : 0 < b) :
135135
simp only [neg_mul_eq_neg_mul]
136136
exact (exp_neg_integrableOn_Ioi _ hb).mono_set Ioc_subset_Ioi_self
137137

138-
-- TODO: non-terminal simp followed by positivity
139-
set_option linter.flexible false in
140138
lemma lintegral_exponentialPDF_eq_antiDeriv {r : ℝ} (hr : 0 < r) (x : ℝ) :
141139
∫⁻ y in Iic x, exponentialPDF r y
142140
= ENNReal.ofReal (if 0 ≤ x then 1 - exp (-(r * x)) else 0) := by
@@ -159,7 +157,8 @@ lemma lintegral_exponentialPDF_eq_antiDeriv {r : ℝ} (hr : 0 < r) (x : ℝ) :
159157
rw [integral_Icc_eq_integral_Ioc, ← uIoc_of_le h, this]
160158
rw [intervalIntegral.integral_eq_sub_of_hasDeriv_right_of_le h
161159
(f := fun a ↦ -1 * rexp (-(r * a))) _ _]
162-
· rw [ENNReal.toReal_ofReal_eq_iff.2 (by simp; positivity)]
160+
· rw [ENNReal.toReal_ofReal_eq_iff.2
161+
(sub_nonneg.2 (Real.exp_le_one_iff.2 <| by nlinarith))]
163162
norm_num; ring
164163
· simp only [intervalIntegrable_iff, uIoc_of_le h]
165164
exact Integrable.const_mul (exp_neg_integrableOn_Ioc hr) _

0 commit comments

Comments
 (0)