|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Louis (Yiyang) Liu. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Louis (Yiyang) Liu |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.MeasureTheory.Integral.Average |
| 9 | + |
| 10 | +/-! |
| 11 | +# Mean value theorem for set averages |
| 12 | +
|
| 13 | +We prove a "mean value" property for set averages. |
| 14 | +
|
| 15 | +## Main results |
| 16 | +
|
| 17 | +* `exists_eq_setAverage`: `∃ c ∈ s, f c = ⨍ x in s, f x ∂μ`. |
| 18 | +
|
| 19 | +## Notation |
| 20 | +
|
| 21 | +`⨍ x in s, f x ∂μ` is notation for `average (μ.restrict s) f`, the average value of `f` over `s` |
| 22 | +w.r.t. `μ`. |
| 23 | +
|
| 24 | +## Tags |
| 25 | +
|
| 26 | +set average, average value, mean value |
| 27 | +-/ |
| 28 | + |
| 29 | +@[expose] public section |
| 30 | + |
| 31 | +open MeasureTheory |
| 32 | + |
| 33 | +variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] |
| 34 | + {s : Set α} {f : α → ℝ} {μ : Measure α} |
| 35 | + |
| 36 | +/-- If `s` is a connected set of finite, nonzero `μ`-measure and `f : α → ℝ` is continuous on `s` |
| 37 | +and integrable on `s` w.r.t. `μ`, then `f` attains its `μ`-average on `s`. -/ |
| 38 | +theorem exists_eq_setAverage |
| 39 | + (hs : IsConnected s) |
| 40 | + (hf : ContinuousOn f s) |
| 41 | + (hint : IntegrableOn f s μ) |
| 42 | + (hμfin : μ s ≠ ⊤) |
| 43 | + (hμ0 : μ s ≠ 0) : |
| 44 | + ∃ c ∈ s, f c = ⨍ x in s, f x ∂μ := by |
| 45 | + let ave := ⨍ x in s, f x ∂μ |
| 46 | + let S₁ : Set α := {x | x ∈ s ∧ f x ≤ ave} |
| 47 | + let S₂ : Set α := {x | x ∈ s ∧ ave ≤ f x} |
| 48 | + have hS₁ : 0 < μ S₁ := measure_le_setAverage_pos hμ0 hμfin hint |
| 49 | + have hS₂ : 0 < μ S₂ := measure_setAverage_le_pos hμ0 hμfin hint |
| 50 | + rcases nonempty_of_measure_ne_zero hS₁.ne' with ⟨c₁, hc₁⟩ |
| 51 | + rcases nonempty_of_measure_ne_zero hS₂.ne' with ⟨c₂, hc₂⟩ |
| 52 | + apply hs.isPreconnected.intermediate_value hc₁.1 hc₂.1 hf |
| 53 | + grind |
0 commit comments