Skip to content

Commit 2d8021f

Browse files
committed
chore(Probability): shorten proof of condExp_indep_eq (leanprover-community#37731)
This PR golfs three proofs by replacing bespoke local calculations with existing lemmas and `simp`. * In `Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean`, simplify the `ℝ ≃L[ℝ] ℝ¹` bookkeeping in `integral_eq_of_hasDerivAt_off_countable_of_le` and replace two local `rfl` helpers with `simp [F', e]`. * In `Mathlib/Probability/ConditionalExpectation.lean`, replace two hand-written `funext` equalities with direct continuity statements obtained by composing `continuous_integral` and `continuous_setIntegral` with `Submodule.subtypeL`. * In `Mathlib/MeasureTheory/Integral/MeanInequalities.lean`, replace a manual proof of the pointwise bound used in `lintegral_rpow_add_lt_top_of_lintegral_rpow_lt_top` with the existing lemma `ENNReal.rpow_add_le_mul_rpow_add_rpow`. All changes are proof golfing only; theorem statements are unchanged. No theorem statements are changed.
1 parent 12052ed commit 2d8021f

3 files changed

Lines changed: 8 additions & 36 deletions

File tree

Mathlib/MeasureTheory/Integral/DivergenceTheorem.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,7 @@ theorem integral_eq_of_hasDerivAt_off_countable_of_le [CompleteSpace E] (f f' :
376376
(Hd : ∀ x ∈ Ioo a b \ s, HasDerivAt f (f' x) x) (Hi : IntervalIntegrable f' volume a b) :
377377
∫ x in a..b, f' x = f b - f a := by
378378
set e : ℝ ≃L[ℝ] ℝ¹ := (ContinuousLinearEquiv.funUnique (Fin 1) ℝ ℝ).symm
379-
have e_symm : ∀ x, e.symm x = x 0 := fun x => rfl
380379
set F' : ℝ → ℝ →L[ℝ] E := fun x => smulRight (1 : ℝ →L[ℝ] ℝ) (f' x)
381-
have hF' : ∀ x y, F' x y = y • f' x := fun x y => rfl
382380
calc
383381
∫ x in a..b, f' x = ∫ x in Icc a b, f' x := by
384382
rw [intervalIntegral.integral_of_le hle, setIntegral_congr_set Ioc_ae_eq_Icc]
@@ -393,7 +391,7 @@ theorem integral_eq_of_hasDerivAt_off_countable_of_le [CompleteSpace E] (f f' :
393391
(fun _ => F') s hs a b hle (fun _ => Hc) (fun x hx _ => Hd x hx) _ ?_ ?_
394392
· exact fun x y => (OrderIso.funUnique (Fin 1) ℝ).symm.le_iff_le
395393
· exact (volume_preserving_funUnique (Fin 1) ℝ).symm _
396-
· intro x; rw [Fin.sum_univ_one, hF', e_symm, Pi.single_eq_same, one_smul]
394+
· simp [F', e]
397395
· rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hle] at Hi
398396
exact Hi.congr_set_ae Ioc_ae_eq_Icc.symm
399397
_ = f b - f a := by

Mathlib/MeasureTheory/Integral/MeanInequalities.lean

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,29 +263,11 @@ theorem lintegral_mul_prod_norm_pow_le {α ι : Type*} [MeasurableSpace α] {μ
263263
theorem lintegral_rpow_add_lt_top_of_lintegral_rpow_lt_top {p : ℝ} {f g : α → ℝ≥0∞}
264264
(hf : AEMeasurable f μ) (hf_top : (∫⁻ a, f a ^ p ∂μ) < ⊤) (hg_top : (∫⁻ a, g a ^ p ∂μ) < ⊤)
265265
(hp1 : 1 ≤ p) : (∫⁻ a, (f + g) a ^ p ∂μ) < ⊤ := by
266-
have hp0_lt : 0 < p := lt_of_lt_of_le zero_lt_one hp1
267-
have hp0 : 0 ≤ p := le_of_lt hp0_lt
268266
calc
269267
(∫⁻ a : α, (f a + g a) ^ p ∂μ) ≤
270268
∫⁻ a, (2 : ℝ≥0∞) ^ (p - 1) * f a ^ p + (2 : ℝ≥0∞) ^ (p - 1) * g a ^ p ∂μ := by
271269
refine lintegral_mono fun a => ?_
272-
dsimp only
273-
have h_zero_lt_half_rpow : (0 : ℝ≥0∞) < (1 / 2 : ℝ≥0∞) ^ p := by
274-
rw [← ENNReal.zero_rpow_of_pos hp0_lt]
275-
exact ENNReal.rpow_lt_rpow (by simp) hp0_lt
276-
have h_rw : (1 / 2 : ℝ≥0∞) ^ p * (2 : ℝ≥0∞) ^ (p - 1) = 1 / 2 := by
277-
rw [sub_eq_add_neg, ENNReal.rpow_add _ _ two_ne_zero ENNReal.coe_ne_top, ← mul_assoc, ←
278-
ENNReal.mul_rpow_of_nonneg _ _ hp0, one_div,
279-
ENNReal.inv_mul_cancel two_ne_zero ENNReal.coe_ne_top, ENNReal.one_rpow, one_mul,
280-
ENNReal.rpow_neg_one]
281-
rw [← ENNReal.mul_le_mul_iff_right h_zero_lt_half_rpow.ne']
282-
· rw [mul_add, ← mul_assoc, ← mul_assoc, h_rw, ← ENNReal.mul_rpow_of_nonneg _ _ hp0, mul_add]
283-
refine
284-
ENNReal.rpow_arith_mean_le_arith_mean2_rpow (1 / 2 : ℝ≥0∞) (1 / 2 : ℝ≥0∞) (f a) (g a) ?_
285-
hp1
286-
rw [ENNReal.div_add_div_same, one_add_one_eq_two,
287-
ENNReal.div_self two_ne_zero ENNReal.coe_ne_top]
288-
· finiteness
270+
simpa [mul_add] using ENNReal.rpow_add_le_mul_rpow_add_rpow (f a) (g a) hp1
289271
_ < ⊤ := by
290272
rw [lintegral_add_left', lintegral_const_mul'' _ (hf.pow_const p),
291273
lintegral_const_mul' _ _ (by finiteness), ENNReal.add_lt_top]

Mathlib/Probability/ConditionalExpectation.lean

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,12 @@ theorem condExp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
6060
rw [memLp_one_iff_integrable] at huint hvint
6161
rw [integral_add' huint hvint, smul_add, hu_eq, hv_eq,
6262
integral_add' huint.integrableOn hvint.integrableOn]
63-
· have heq₁ : (fun f : lpMeas E ℝ m₁ 1 μ => ∫ x, (f : Ω → E) x ∂μ) =
64-
(fun f : Lp E 1 μ => ∫ x, f x ∂μ) ∘ Submodule.subtypeL _ := by
65-
refine funext fun f => integral_congr_ae ?_
66-
simp_rw [Submodule.coe_subtypeL', Submodule.coe_subtype]; norm_cast
67-
have heq₂ : (fun f : lpMeas E ℝ m₁ 1 μ => ∫ x in s, (f : Ω → E) x ∂μ) =
68-
(fun f : Lp E 1 μ => ∫ x in s, f x ∂μ) ∘ Submodule.subtypeL _ := by
69-
refine funext fun f => integral_congr_ae (ae_restrict_of_ae ?_)
70-
simp_rw [Submodule.coe_subtypeL', Submodule.coe_subtype]
71-
exact Eventually.of_forall fun _ => (by trivial)
72-
refine isClosed_eq (Continuous.const_smul ?_ _) ?_
73-
· rw [heq₁]
74-
exact continuous_integral.comp (ContinuousLinearMap.continuous _)
75-
· rw [heq₂]
76-
exact (continuous_setIntegral _).comp (ContinuousLinearMap.continuous _)
63+
· have h_integral : Continuous fun f : lpMeas E ℝ m₁ 1 μ => ∫ x, (f : Ω → E) x ∂μ := by
64+
simpa using continuous_integral.comp (ContinuousLinearMap.continuous (Submodule.subtypeL _))
65+
have h_setIntegral : Continuous fun f : lpMeas E ℝ m₁ 1 μ => ∫ x in s, (f : Ω → E) x ∂μ := by
66+
simpa using (continuous_setIntegral s).comp
67+
(ContinuousLinearMap.continuous (Submodule.subtypeL _))
68+
exact isClosed_eq (Continuous.const_smul h_integral _) h_setIntegral
7769
· intro u v huv _ hueq
7870
rwa [← integral_congr_ae huv, ←
7971
(setIntegral_congr_ae (hle₂ _ hms) _ : ∫ x in s, u x ∂μ = ∫ x in s, v x ∂μ)]

0 commit comments

Comments
 (0)