Skip to content

Commit 1d6104e

Browse files
committed
refactor(MeasureTheory/Integral/MeanValue): enhance documentation and proof clarity; golf
1 parent 279879e commit 1d6104e

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

Mathlib/MeasureTheory/Integral/IntervalIntegral/MeanValue.lean

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ We prove versions of the first mean value theorem for interval integrals.
1515
1616
## Main results
1717
18-
* `exists_eq_const_mul_intervalIntegral_of_ae_nonneg`:
18+
* `exists_eq_const_mul_intervalIntegral_of_ae_nonneg` (a.e. nonnegativity of `g` on `s`):
1919
`∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x ∂μ) = f c * (∫ x in a..b, g x ∂μ)`.
20-
* `exists_eq_const_mul_intervalIntegral_of_nonneg'`:
20+
* `exists_eq_const_mul_intervalIntegral_of_nonneg` (pointwise nonnegativity of `g` on `s`):
2121
`∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x ∂μ) = f c * (∫ x in a..b, g x ∂μ)`.
22-
* `exists_eq_const_mul_intervalIntegral_of_nonneg`:
23-
`∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x) = f c * (∫ x in a..b, g x)`.
2422
2523
## References
2624
@@ -52,32 +50,30 @@ theorem exists_eq_const_mul_intervalIntegral_of_ae_nonneg
5250
∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x ∂μ) = f c * (∫ x in a..b, g x ∂μ) := by
5351
by_cases h : a = b
5452
· subst h
55-
refine ⟨a, by simp, by simp⟩
53+
exact ⟨a, by simp, by simp⟩
5654
wlog hab : a < b generalizing a b
5755
· simp only [not_lt] at hab
5856
obtain ⟨c, c_in_uIcc, that⟩ :=
5957
this (by rwa [uIcc_comm]) hg.symm (by rwa [uIoc_comm]) (by aesop) (lt_of_le_of_ne' hab h)
60-
refine ⟨c, by rwa [uIcc_comm], by simpa [integral_symm b a]⟩
58+
exact ⟨c, by rwa [uIcc_comm], by simpa [integral_symm b a]⟩
6159
let s := Ι a b
6260
have hs : s = Ioc a b := uIoc_of_le hab.le
6361
have hs' : s ⊆ [[a, b]] := uIoc_subset_uIcc
6462
have hs_conn : IsConnected s := by simpa [hs] using isConnected_Ioc hab
65-
have hs_meas : MeasurableSet s := measurableSet_uIoc
66-
have hf' : ContinuousOn f s := hf.mono hs'
67-
have hg' : IntegrableOn g s μ := by rwa [← intervalIntegrable_iff]
6863
have hfg : IntegrableOn (fun x ↦ f x * g x) s μ := by
6964
rw [← intervalIntegrable_iff]
7065
exact hg.continuousOn_smul hf
71-
obtain ⟨c, hc, h⟩ := exists_eq_const_mul_setIntegral_of_ae_nonneg hs_conn hs_meas hf' hg' hfg hg0
66+
obtain ⟨c, hc, h⟩ := exists_eq_const_mul_setIntegral_of_ae_nonneg
67+
hs_conn measurableSet_uIoc (hf.mono hs') (by rwa [← intervalIntegrable_iff]) hfg hg0
7268
have h' : ∫ (x : ℝ) in a..b, f x * g x ∂μ = f c * ∫ (x : ℝ) in a..b, g x ∂μ := by
73-
simp_rw [integral_of_le hab.le]; rwa [← hs]
74-
refine ⟨c, mem_of_subset_of_mem hs' hc, h'⟩
69+
simpa [intervalIntegral.integral_of_le hab.le, hs] using h
70+
exact ⟨c, mem_of_subset_of_mem hs' hc, h'⟩
7571

7672
/-- **First mean value theorem for interval integrals (arbitrary measure, nonnegativity).**
7773
Let `f g : ℝ → ℝ` and let `μ` be a measure on `ℝ`. Assume that `f` is continuous on `uIcc a b`,
7874
that `g` is interval integrable on `a..b` w.r.t. `μ`, and that `g ≥ 0` on `Ι a b`. Then
7975
`∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x ∂μ) = f c * (∫ x in a..b, g x ∂μ)`. -/
80-
theorem exists_eq_const_mul_intervalIntegral_of_nonneg'
76+
theorem exists_eq_const_mul_intervalIntegral_of_nonneg
8177
(hf : ContinuousOn f (uIcc a b)) (hg : IntervalIntegrable g μ a b)
8278
(hg0 : ∀ x ∈ Ι a b, 0 ≤ g x) :
8379
∃ c ∈ uIcc a b, (∫ x in a..b, f x * g x ∂μ) = f c * (∫ x in a..b, g x ∂μ) := by

0 commit comments

Comments
 (0)