File: Mathlib/MeasureTheory/Integral/Average.lean

full_name: MeasureTheory.laverage
code: /-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ`, denoted `⨍⁻ x, f x ∂μ`.

It is equal to `(μ univ)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `μ` is an infinite measure. If
`μ` is a probability measure, then the average of any function is equal to its integral.

For the average on a set, use `⨍⁻ x in s, f x ∂μ`, defined as `⨍⁻ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
noncomputable def laverage (f : α → ℝ≥0∞) 
goal: ℝ≥0∞

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍⁻_,_∂__1»
code: /-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ`.

It is equal to `(μ univ)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `μ` is an infinite measure. If
`μ` is a probability measure, then the average of any function is equal to its integral.

For the average on a set, use `⨍⁻ x in s, f x ∂μ`, defined as `⨍⁻ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍⁻ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => laverage μ r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍⁻_,__1»
code: /-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. to the standard measure.

It is equal to `(volume univ)⁻¹ * ∫⁻ x, f x`, so it takes value zero if the space has infinite
measure. In a probability space, the average of any function is equal to its integral.

For the average on a set, use `⨍⁻ x in s, f x`, defined as `⨍⁻ x, f x ∂(volume.restrict s)`. -/
notation3 "⨍⁻ "(...)", "r:60:(scoped f => laverage volume f) => r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍⁻_In_,_∂__1»
code: /-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. a measure `μ` on a set `s`.

It is equal to `(μ s)⁻¹ * ∫⁻ x, f x ∂μ`, so it takes value zero if `s` has infinite measure. If `s`
has measure `1`, then the average of any function is equal to its integral.

For the average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍⁻ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => laverage (Measure.restrict μ s) r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍⁻_In_,__1»
code: /-- Average value of an `ℝ≥0∞`-valued function `f` w.r.t. to the standard measure on a set `s`.

It is equal to `(volume s)⁻¹ * ∫⁻ x, f x`, so it takes value zero if `s` has infinite measure. If
`s` has measure `1`, then the average of any function is equal to its integral. -/
notation3 (prettyPrint := false)
  "⨍⁻ "(...)" in "s", "r:60:(scoped f => laverage Measure.restrict volume s f) => r
goal: Lean.Macro

full_name: MeasureTheory.laverage_zero
code: @[simp]
theorem laverage_zero : ⨍⁻ _x, (0 : ℝ≥0∞) ∂μ = 0 
goal: ⨍⁻ (_x : α), 0 ∂μ = 0

full_name: MeasureTheory.laverage_zero_measure
code: @[simp]
theorem laverage_zero_measure (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂(0 : Measure α) = 0 
goal: ⨍⁻ (x : α), f x ∂0 = 0

full_name: MeasureTheory.laverage_eq'
code: theorem laverage_eq' (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂(μ univ)⁻¹ • μ 
goal: ⨍⁻ (x : α), f x ∂μ = ∫⁻ (x : α), f x ∂(μ Set.univ)⁻¹ • μ

full_name: MeasureTheory.laverage_eq
code: theorem laverage_eq (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂μ = (∫⁻ x, f x ∂μ) / μ univ 
goal: ⨍⁻ (x : α), f x ∂μ = (∫⁻ (x : α), f x ∂μ) / μ Set.univ

full_name: MeasureTheory.laverage_eq_lintegral
code: theorem laverage_eq_lintegral [IsProbabilityMeasure μ] (f : α → ℝ≥0∞) :
    ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ 
goal: ⨍⁻ (x : α), f x ∂μ = ∫⁻ (x : α), f x ∂μ

full_name: MeasureTheory.measure_mul_laverage
code: @[simp]
theorem measure_mul_laverage [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    μ univ * ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ 
goal: μ Set.univ * ⨍⁻ (x : α), f x ∂μ = ∫⁻ (x : α), f x ∂μ

full_name: MeasureTheory.setLaverage_eq
code: theorem setLaverage_eq (f : α → ℝ≥0∞) (s : Set α) :
    ⨍⁻ x in s, f x ∂μ = (∫⁻ x in s, f x ∂μ) / μ s 
goal: ⨍⁻ (x : α) in s, f x ∂μ = (∫⁻ (x : α) in s, f x ∂μ) / μ s

full_name: MeasureTheory.setLaverage_eq'
code: theorem setLaverage_eq' (f : α → ℝ≥0∞) (s : Set α) :
    ⨍⁻ x in s, f x ∂μ = ∫⁻ x, f x ∂(μ s)⁻¹ • μ.restrict s 
goal: ⨍⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α), f x ∂(μ s)⁻¹ • μ.restrict s

full_name: MeasureTheory.laverage_congr
code: theorem laverage_congr {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : ⨍⁻ x, f x ∂μ = ⨍⁻ x, g x ∂μ 
goal: ⨍⁻ (x : α), f x ∂μ = ⨍⁻ (x : α), g x ∂μ

full_name: MeasureTheory.setLaverage_congr
code: theorem setLaverage_congr (h : s =ᵐ[μ] t) : ⨍⁻ x in s, f x ∂μ = ⨍⁻ x in t, f x ∂μ 
goal: ⨍⁻ (x : α) in s, f x ∂μ = ⨍⁻ (x : α) in t, f x ∂μ

full_name: MeasureTheory.setLaverage_congr_fun
code: theorem setLaverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
    ⨍⁻ x in s, f x ∂μ = ⨍⁻ x in s, g x ∂μ 
goal: ⨍⁻ (x : α) in s, f x ∂μ = ⨍⁻ (x : α) in s, g x ∂μ

full_name: MeasureTheory.laverage_lt_top
code: theorem laverage_lt_top (hf : ∫⁻ x, f x ∂μ ≠ ∞) : ⨍⁻ x, f x ∂μ < ∞ 
goal: ⨍⁻ (x : α), f x ∂μ < ⊤

full_name: MeasureTheory.setLaverage_lt_top
code: theorem setLaverage_lt_top : ∫⁻ x in s, f x ∂μ ≠ ∞ → ⨍⁻ x in s, f x ∂μ < ∞ 
goal: ∫⁻ (x : α) in s, f x ∂μ ≠ ⊤ → ⨍⁻ (x : α) in s, f x ∂μ < ⊤

full_name: MeasureTheory.laverage_add_measure
code: theorem laverage_add_measure :
    ⨍⁻ x, f x ∂(μ + ν) =
      μ univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂μ + ν univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂ν 
goal: ⨍⁻ (x : α), f x ∂(μ + ν) =
  μ Set.univ / (μ Set.univ + ν Set.univ) * ⨍⁻ (x : α), f x ∂μ +
    ν Set.univ / (μ Set.univ + ν Set.univ) * ⨍⁻ (x : α), f x ∂ν

full_name: MeasureTheory.measure_mul_setLaverage
code: theorem measure_mul_setLaverage (f : α → ℝ≥0∞) (h : μ s ≠ ∞) :
    μ s * ⨍⁻ x in s, f x ∂μ = ∫⁻ x in s, f x ∂μ 
goal: μ s * ⨍⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α) in s, f x ∂μ

full_name: MeasureTheory.laverage_union
code: theorem laverage_union (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) :
    ⨍⁻ x in s ∪ t, f x ∂μ =
      μ s / (μ s + μ t) * ⨍⁻ x in s, f x ∂μ + μ t / (μ s + μ t) * ⨍⁻ x in t, f x ∂μ 
goal: ⨍⁻ (x : α) in s ∪ t, f x ∂μ = μ s / (μ s + μ t) * ⨍⁻ (x : α) in s, f x ∂μ + μ t / (μ s + μ t) * ⨍⁻ (x : α) in t, f x ∂μ

full_name: MeasureTheory.laverage_union_mem_openSegment
code: theorem laverage_union_mem_openSegment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hs₀ : μ s ≠ 0) (ht₀ : μ t ≠ 0) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) :
    ⨍⁻ x in s ∪ t, f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ x in s, f x ∂μ) (⨍⁻ x in t, f x ∂μ) 
goal: ⨍⁻ (x : α) in s ∪ t, f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ (x : α) in s, f x ∂μ) (⨍⁻ (x : α) in t, f x ∂μ)

full_name: MeasureTheory.laverage_union_mem_segment
code: theorem laverage_union_mem_segment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) :
    ⨍⁻ x in s ∪ t, f x ∂μ ∈ [⨍⁻ x in s, f x ∂μ -[ℝ≥0∞] ⨍⁻ x in t, f x ∂μ] 
goal: ⨍⁻ (x : α) in s ∪ t, f x ∂μ ∈ [⨍⁻ (x : α) in s, f x ∂μ-[ℝ≥0∞]⨍⁻ (x : α) in t, f x ∂μ]

full_name: MeasureTheory.laverage_mem_openSegment_compl_self
code: theorem laverage_mem_openSegment_compl_self [IsFiniteMeasure μ] (hs : NullMeasurableSet s μ)
    (hs₀ : μ s ≠ 0) (hsc₀ : μ sᶜ ≠ 0) :
    ⨍⁻ x, f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ x in s, f x ∂μ) (⨍⁻ x in sᶜ, f x ∂μ) 
goal: ⨍⁻ (x : α), f x ∂μ ∈ openSegment ℝ≥0∞ (⨍⁻ (x : α) in s, f x ∂μ) (⨍⁻ (x : α) in sᶜ, f x ∂μ)

full_name: MeasureTheory.laverage_const
code: @[simp]
theorem laverage_const (μ : Measure α) [IsFiniteMeasure μ] [h : NeZero μ] (c : ℝ≥0∞) :
    ⨍⁻ _x, c ∂μ = c 
goal: ⨍⁻ (_x : α), c ∂μ = c

full_name: MeasureTheory.setLaverage_const
code: theorem setLaverage_const (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : ℝ≥0∞) : ⨍⁻ _x in s, c ∂μ = c 
goal: ⨍⁻ (_x : α) in s, c ∂μ = c

full_name: MeasureTheory.laverage_one
code: theorem laverage_one [IsFiniteMeasure μ] [NeZero μ] : ⨍⁻ _x, (1 : ℝ≥0∞) ∂μ = 1 
goal: ⨍⁻ (_x : α), 1 ∂μ = 1

full_name: MeasureTheory.setLaverage_one
code: theorem setLaverage_one (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) : ⨍⁻ _x in s, (1 : ℝ≥0∞) ∂μ = 1 
goal: ⨍⁻ (_x : α) in s, 1 ∂μ = 1

full_name: MeasureTheory.lintegral_laverage
code: theorem lintegral_laverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    ∫⁻ _x, ⨍⁻ a, f a ∂μ ∂μ = ∫⁻ x, f x ∂μ 
goal: ∫⁻ (_x : α), ⨍⁻ (a : α), f a ∂μ ∂μ = ∫⁻ (x : α), f x ∂μ

full_name: MeasureTheory.setLintegral_setLaverage
code: theorem setLintegral_setLaverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) (s : Set α) :
    ∫⁻ _x in s, ⨍⁻ a in s, f a ∂μ ∂μ = ∫⁻ x in s, f x ∂μ 
goal: ∫⁻ (_x : α) in s, ⨍⁻ (a : α) in s, f a ∂μ ∂μ = ∫⁻ (x : α) in s, f x ∂μ

full_name: MeasureTheory.average
code: /-- Average value of a function `f` w.r.t. a measure `μ`, denoted `⨍ x, f x ∂μ`.

It is equal to `(μ univ).toReal⁻¹ • ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable or
if `μ` is an infinite measure. If `μ` is a probability measure, then the average of any function is
equal to its integral.

For the average on a set, use `⨍ x in s, f x ∂μ`, defined as `⨍ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
noncomputable def average (f : α → E) 
goal: E

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍_,_∂__1»
code: /-- Average value of a function `f` w.r.t. a measure `μ`.

It is equal to `(μ univ).toReal⁻¹ • ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable or
if `μ` is an infinite measure. If `μ` is a probability measure, then the average of any function is
equal to its integral.

For the average on a set, use `⨍ x in s, f x ∂μ`, defined as `⨍ x, f x ∂(μ.restrict s)`. For the
average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍ "(...)", "r:60:(scoped f => f)" ∂"μ:70 => average μ r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍_,__1»
code: /-- Average value of a function `f` w.r.t. to the standard measure.

It is equal to `(volume univ).toReal⁻¹ * ∫ x, f x`, so it takes value zero if `f` is not integrable
or if the space has infinite measure. In a probability space, the average of any function is equal
to its integral.

For the average on a set, use `⨍ x in s, f x`, defined as `⨍ x, f x ∂(volume.restrict s)`. -/
notation3 "⨍ "(...)", "r:60:(scoped f => average volume f) => r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍_In_,_∂__1»
code: /-- Average value of a function `f` w.r.t. a measure `μ` on a set `s`.

It is equal to `(μ s).toReal⁻¹ * ∫ x, f x ∂μ`, so it takes value zero if `f` is not integrable on
`s` or if `s` has infinite measure. If `s` has measure `1`, then the average of any function is
equal to its integral.

For the average w.r.t. the volume, one can omit `∂volume`. -/
notation3 "⨍ "(...)" in "s", "r:60:(scoped f => f)" ∂"μ:70 => average (Measure.restrict μ s) r
goal: Lean.Macro

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Integral_Average___macroRules_MeasureTheory_term⨍_In_,__1»
code: /-- Average value of a function `f` w.r.t. to the standard measure on a set `s`.

It is equal to `(volume s).toReal⁻¹ * ∫ x, f x`, so it takes value zero `f` is not integrable on `s`
or if `s` has infinite measure. If `s` has measure `1`, then the average of any function is equal to
its integral. -/
notation3 "⨍ "(...)" in "s", "r:60:(scoped f => average (Measure.restrict volume s) f) => r
goal: Lean.Macro

full_name: MeasureTheory.average_zero
code: @[simp]
theorem average_zero : ⨍ _, (0 : E) ∂μ = 0 
goal: ⨍ (x : α), 0 ∂μ = 0

full_name: MeasureTheory.average_zero_measure
code: @[simp]
theorem average_zero_measure (f : α → E) : ⨍ x, f x ∂(0 : Measure α) = 0 
goal: ⨍ (x : α), f x ∂0 = 0

full_name: MeasureTheory.average_neg
code: @[simp]
theorem average_neg (f : α → E) : ⨍ x, -f x ∂μ = -⨍ x, f x ∂μ 
goal: ⨍ (x : α), -f x ∂μ = -⨍ (x : α), f x ∂μ

full_name: MeasureTheory.average_eq'
code: theorem average_eq' (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂(μ univ)⁻¹ • μ 
goal: ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂(μ Set.univ)⁻¹ • μ

full_name: MeasureTheory.average_eq
code: theorem average_eq (f : α → E) : ⨍ x, f x ∂μ = (μ univ).toReal⁻¹ • ∫ x, f x ∂μ 
goal: ⨍ (x : α), f x ∂μ = (μ Set.univ).toReal⁻¹ • ∫ (x : α), f x ∂μ

full_name: MeasureTheory.average_eq_integral
code: theorem average_eq_integral [IsProbabilityMeasure μ] (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂μ 
goal: ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

full_name: MeasureTheory.measure_smul_average
code: @[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ 
goal: (μ Set.univ).toReal • ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

full_name: MeasureTheory.setAverage_eq
code: theorem setAverage_eq (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ x in s, f x ∂μ 
goal: ⨍ (x : α) in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ (x : α) in s, f x ∂μ

full_name: MeasureTheory.setAverage_eq'
code: theorem setAverage_eq' (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = ∫ x, f x ∂(μ s)⁻¹ • μ.restrict s 
goal: ⨍ (x : α) in s, f x ∂μ = ∫ (x : α), f x ∂(μ s)⁻¹ • μ.restrict s

full_name: MeasureTheory.average_congr
code: theorem average_congr {f g : α → E} (h : f =ᵐ[μ] g) : ⨍ x, f x ∂μ = ⨍ x, g x ∂μ 
goal: ⨍ (x : α), f x ∂μ = ⨍ (x : α), g x ∂μ

full_name: MeasureTheory.setAverage_congr
code: theorem setAverage_congr (h : s =ᵐ[μ] t) : ⨍ x in s, f x ∂μ = ⨍ x in t, f x ∂μ 
goal: ⨍ (x : α) in s, f x ∂μ = ⨍ (x : α) in t, f x ∂μ

full_name: MeasureTheory.setAverage_congr_fun
code: theorem setAverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
    ⨍ x in s, f x ∂μ = ⨍ x in s, g x ∂μ 
goal: ⨍ (x : α) in s, f x ∂μ = ⨍ (x : α) in s, g x ∂μ

full_name: MeasureTheory.average_add_measure
code: theorem average_add_measure [IsFiniteMeasure μ] {ν : Measure α} [IsFiniteMeasure ν] {f : α → E}
    (hμ : Integrable f μ) (hν : Integrable f ν) :
    ⨍ x, f x ∂(μ + ν) =
      ((μ univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂μ +
        ((ν univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂ν 
goal: ⨍ (x : α), f x ∂(μ + ν) =
  ((μ Set.univ).toReal / ((μ Set.univ).toReal + (ν Set.univ).toReal)) • ⨍ (x : α), f x ∂μ +
    ((ν Set.univ).toReal / ((μ Set.univ).toReal + (ν Set.univ).toReal)) • ⨍ (x : α), f x ∂ν

full_name: MeasureTheory.average_pair
code: theorem average_pair {f : α → E} {g : α → F} (hfi : Integrable f μ) (hgi : Integrable g μ) :
    ⨍ x, (f x, g x) ∂μ = (⨍ x, f x ∂μ, ⨍ x, g x ∂μ) 
goal: ⨍ (x : α), (f x, g x) ∂μ = (⨍ (x : α), f x ∂μ, ⨍ (x : α), g x ∂μ)

full_name: MeasureTheory.measure_smul_setAverage
code: theorem measure_smul_setAverage (f : α → E) {s : Set α} (h : μ s ≠ ∞) :
    (μ s).toReal • ⨍ x in s, f x ∂μ = ∫ x in s, f x ∂μ 
goal: (μ s).toReal • ⨍ (x : α) in s, f x ∂μ = ∫ (x : α) in s, f x ∂μ

full_name: MeasureTheory.average_union
code: theorem average_union {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
    ⨍ x in s ∪ t, f x ∂μ =
      ((μ s).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in s, f x ∂μ +
        ((μ t).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in t, f x ∂μ 
goal: ⨍ (x : α) in s ∪ t, f x ∂μ =
  ((μ s).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ (x : α) in s, f x ∂μ +
    ((μ t).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ (x : α) in t, f x ∂μ

full_name: MeasureTheory.average_union_mem_openSegment
code: theorem average_union_mem_openSegment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t)
    (ht : NullMeasurableSet t μ) (hs₀ : μ s ≠ 0) (ht₀ : μ t ≠ 0) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞)
    (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
    ⨍ x in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ x in s, f x ∂μ) (⨍ x in t, f x ∂μ) 
goal: ⨍ (x : α) in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ (x : α) in s, f x ∂μ) (⨍ (x : α) in t, f x ∂μ)

full_name: MeasureTheory.average_union_mem_segment
code: theorem average_union_mem_segment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t)
    (ht : NullMeasurableSet t μ) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ)
    (hft : IntegrableOn f t μ) :
    ⨍ x in s ∪ t, f x ∂μ ∈ [⨍ x in s, f x ∂μ -[ℝ] ⨍ x in t, f x ∂μ] 
goal: ⨍ (x : α) in s ∪ t, f x ∂μ ∈ [⨍ (x : α) in s, f x ∂μ-[ℝ]⨍ (x : α) in t, f x ∂μ]

full_name: MeasureTheory.average_mem_openSegment_compl_self
code: theorem average_mem_openSegment_compl_self [IsFiniteMeasure μ] {f : α → E} {s : Set α}
    (hs : NullMeasurableSet s μ) (hs₀ : μ s ≠ 0) (hsc₀ : μ sᶜ ≠ 0) (hfi : Integrable f μ) :
    ⨍ x, f x ∂μ ∈ openSegment ℝ (⨍ x in s, f x ∂μ) (⨍ x in sᶜ, f x ∂μ) 
goal: ⨍ (x : α), f x ∂μ ∈ openSegment ℝ (⨍ (x : α) in s, f x ∂μ) (⨍ (x : α) in sᶜ, f x ∂μ)

full_name: MeasureTheory.average_const
code: @[simp]
theorem average_const (μ : Measure α) [IsFiniteMeasure μ] [h : NeZero μ] (c : E) :
    ⨍ _x, c ∂μ = c 
goal: ⨍ (_x : α), c ∂μ = c

full_name: MeasureTheory.setAverage_const
code: theorem setAverage_const {s : Set α} (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : E) :
    ⨍ _ in s, c ∂μ = c 
goal: ⨍ (x : α) in s, c ∂μ = c

full_name: MeasureTheory.integral_average
code: theorem integral_average (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) :
    ∫ _, ⨍ a, f a ∂μ ∂μ = ∫ x, f x ∂μ 
goal: ∫ (x : α), ⨍ (a : α), f a ∂μ ∂μ = ∫ (x : α), f x ∂μ

full_name: MeasureTheory.setIntegral_setAverage
code: theorem setIntegral_setAverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) (s : Set α) :
    ∫ _ in s, ⨍ a in s, f a ∂μ ∂μ = ∫ x in s, f x ∂μ 
goal: ∫ (x : α) in s, ⨍ (a : α) in s, f a ∂μ ∂μ = ∫ (x : α) in s, f x ∂μ

full_name: MeasureTheory.integral_sub_average
code: theorem integral_sub_average (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) :
    ∫ x, f x - ⨍ a, f a ∂μ ∂μ = 0 
goal: ∫ (x : α), f x - ⨍ (a : α), f a ∂μ ∂μ = 0

full_name: MeasureTheory.setAverage_sub_setAverage
code: theorem setAverage_sub_setAverage (hs : μ s ≠ ∞) (f : α → E) :
    ∫ x in s, f x - ⨍ a in s, f a ∂μ ∂μ = 0 
goal: ∫ (x : α) in s, f x - ⨍ (a : α) in s, f a ∂μ ∂μ = 0

full_name: MeasureTheory.integral_average_sub
code: theorem integral_average_sub [IsFiniteMeasure μ] (hf : Integrable f μ) :
    ∫ x, ⨍ a, f a ∂μ - f x ∂μ = 0 
goal: ∫ (x : α), ⨍ (a : α), f a ∂μ - f x ∂μ = 0

full_name: MeasureTheory.setIntegral_setAverage_sub
code: theorem setIntegral_setAverage_sub (hs : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    ∫ x in s, ⨍ a in s, f a ∂μ - f x ∂μ = 0 
goal: ∫ (x : α) in s, ⨍ (a : α) in s, f a ∂μ - f x ∂μ = 0

full_name: MeasureTheory.ofReal_average
code: theorem ofReal_average {f : α → ℝ} (hf : Integrable f μ) (hf₀ : 0 ≤ᵐ[μ] f) :
    ENNReal.ofReal (⨍ x, f x ∂μ) = (∫⁻ x, ENNReal.ofReal (f x) ∂μ) / μ univ 
goal: ENNReal.ofReal (⨍ (x : α), f x ∂μ) = (∫⁻ (x : α), ENNReal.ofReal (f x) ∂μ) / μ Set.univ

full_name: MeasureTheory.ofReal_setAverage
code: theorem ofReal_setAverage {f : α → ℝ} (hf : IntegrableOn f s μ) (hf₀ : 0 ≤ᵐ[μ.restrict s] f) :
    ENNReal.ofReal (⨍ x in s, f x ∂μ) = (∫⁻ x in s, ENNReal.ofReal (f x) ∂μ) / μ s 
goal: ENNReal.ofReal (⨍ (x : α) in s, f x ∂μ) = (∫⁻ (x : α) in s, ENNReal.ofReal (f x) ∂μ) / μ s

full_name: MeasureTheory.toReal_laverage
code: theorem toReal_laverage {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf' : ∀ᵐ x ∂μ, f x ≠ ∞) :
    (⨍⁻ x, f x ∂μ).toReal = ⨍ x, (f x).toReal ∂μ 
goal: (⨍⁻ (x : α), f x ∂μ).toReal = ⨍ (x : α), (f x).toReal ∂μ

full_name: MeasureTheory.toReal_setLaverage
code: theorem toReal_setLaverage {f : α → ℝ≥0∞} (hf : AEMeasurable f (μ.restrict s))
    (hf' : ∀ᵐ x ∂μ.restrict s, f x ≠ ∞) :
    (⨍⁻ x in s, f x ∂μ).toReal = ⨍ x in s, (f x).toReal ∂μ 
goal: (⨍⁻ (x : α) in s, f x ∂μ).toReal = ⨍ (x : α) in s, (f x).toReal ∂μ

full_name: MeasureTheory.measure_le_setAverage_pos
code: /-- **First moment method**. An integrable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_setAverage_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    0 < μ ({x ∈ s | f x ≤ ⨍ a in s, f a ∂μ}) 
goal: 0 < μ {x | x ∈ s ∧ f x ≤ ⨍ (a : α) in s, f a ∂μ}

full_name: MeasureTheory.measure_setAverage_le_pos
code: /-- **First moment method**. An integrable function is greater than its mean on a set of positive
measure. -/
theorem measure_setAverage_le_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    0 < μ ({x ∈ s | ⨍ a in s, f a ∂μ ≤ f x}) 
goal: 0 < μ {x | x ∈ s ∧ ⨍ (a : α) in s, f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_le_setAverage
code: /-- **First moment method**. The minimum of an integrable function is smaller than its mean. -/
theorem exists_le_setAverage (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    ∃ x ∈ s, f x ≤ ⨍ a in s, f a ∂μ 
goal: ∃ x ∈ s, f x ≤ ⨍ (a : α) in s, f a ∂μ

full_name: MeasureTheory.exists_setAverage_le
code: /-- **First moment method**. The maximum of an integrable function is greater than its mean. -/
theorem exists_setAverage_le (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    ∃ x ∈ s, ⨍ a in s, f a ∂μ ≤ f x 
goal: ∃ x ∈ s, ⨍ (a : α) in s, f a ∂μ ≤ f x

full_name: MeasureTheory.measure_le_average_pos
code: /-- **First moment method**. An integrable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_average_pos (hμ : μ ≠ 0) (hf : Integrable f μ) :
    0 < μ {x | f x ≤ ⨍ a, f a ∂μ} 
goal: 0 < μ {x | f x ≤ ⨍ (a : α), f a ∂μ}

full_name: MeasureTheory.measure_average_le_pos
code: /-- **First moment method**. An integrable function is greater than its mean on a set of positive
measure. -/
theorem measure_average_le_pos (hμ : μ ≠ 0) (hf : Integrable f μ) :
    0 < μ {x | ⨍ a, f a ∂μ ≤ f x} 
goal: 0 < μ {x | ⨍ (a : α), f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_le_average
code: /-- **First moment method**. The minimum of an integrable function is smaller than its mean. -/
theorem exists_le_average (hμ : μ ≠ 0) (hf : Integrable f μ) : ∃ x, f x ≤ ⨍ a, f a ∂μ 
goal: ∃ x, f x ≤ ⨍ (a : α), f a ∂μ

full_name: MeasureTheory.exists_average_le
code: /-- **First moment method**. The maximum of an integrable function is greater than its mean. -/
theorem exists_average_le (hμ : μ ≠ 0) (hf : Integrable f μ) : ∃ x, ⨍ a, f a ∂μ ≤ f x 
goal: ∃ x, ⨍ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.exists_not_mem_null_le_average
code: /-- **First moment method**. The minimum of an integrable function is smaller than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_le_average (hμ : μ ≠ 0) (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ⨍ a, f a ∂μ 
goal: ∃ x ∉ N, f x ≤ ⨍ (a : α), f a ∂μ

full_name: MeasureTheory.exists_not_mem_null_average_le
code: /-- **First moment method**. The maximum of an integrable function is greater than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_average_le (hμ : μ ≠ 0) (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ⨍ a, f a ∂μ ≤ f x 
goal: ∃ x ∉ N, ⨍ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.measure_le_integral_pos
code: /-- **First moment method**. An integrable function is smaller than its integral on a set of
positive measure. -/
theorem measure_le_integral_pos (hf : Integrable f μ) : 0 < μ {x | f x ≤ ∫ a, f a ∂μ} 
goal: 0 < μ {x | f x ≤ ∫ (a : α), f a ∂μ}

full_name: MeasureTheory.measure_integral_le_pos
code: /-- **First moment method**. An integrable function is greater than its integral on a set of
positive measure. -/
theorem measure_integral_le_pos (hf : Integrable f μ) : 0 < μ {x | ∫ a, f a ∂μ ≤ f x} 
goal: 0 < μ {x | ∫ (a : α), f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_le_integral
code: /-- **First moment method**. The minimum of an integrable function is smaller than its integral. -/
theorem exists_le_integral (hf : Integrable f μ) : ∃ x, f x ≤ ∫ a, f a ∂μ 
goal: ∃ x, f x ≤ ∫ (a : α), f a ∂μ

full_name: MeasureTheory.exists_integral_le
code: /-- **First moment method**. The maximum of an integrable function is greater than its integral. -/
theorem exists_integral_le (hf : Integrable f μ) : ∃ x, ∫ a, f a ∂μ ≤ f x 
goal: ∃ x, ∫ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.exists_not_mem_null_le_integral
code: /-- **First moment method**. The minimum of an integrable function is smaller than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_le_integral (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ∫ a, f a ∂μ 
goal: ∃ x ∉ N, f x ≤ ∫ (a : α), f a ∂μ

full_name: MeasureTheory.exists_not_mem_null_integral_le
code: /-- **First moment method**. The maximum of an integrable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_integral_le (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ∫ a, f a ∂μ ≤ f x 
goal: ∃ x ∉ N, ∫ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.measure_le_setLaverage_pos
code: /-- **First moment method**. A measurable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_setLaverage_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞)
    (hf : AEMeasurable f (μ.restrict s)) : 0 < μ {x ∈ s | f x ≤ ⨍⁻ a in s, f a ∂μ} 
goal: 0 < μ {x | x ∈ s ∧ f x ≤ ⨍⁻ (a : α) in s, f a ∂μ}

full_name: MeasureTheory.measure_setLaverage_le_pos
code: /-- **First moment method**. A measurable function is greater than its mean on a set of positive
measure. -/
theorem measure_setLaverage_le_pos (hμ : μ s ≠ 0) (hs : NullMeasurableSet s μ)
    (hint : ∫⁻ a in s, f a ∂μ ≠ ∞) : 0 < μ {x ∈ s | ⨍⁻ a in s, f a ∂μ ≤ f x} 
goal: 0 < μ {x | x ∈ s ∧ ⨍⁻ (a : α) in s, f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_le_setLaverage
code: /-- **First moment method**. The minimum of a measurable function is smaller than its mean. -/
theorem exists_le_setLaverage (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : AEMeasurable f (μ.restrict s)) :
    ∃ x ∈ s, f x ≤ ⨍⁻ a in s, f a ∂μ 
goal: ∃ x ∈ s, f x ≤ ⨍⁻ (a : α) in s, f a ∂μ

full_name: MeasureTheory.exists_setLaverage_le
code: /-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_setLaverage_le (hμ : μ s ≠ 0) (hs : NullMeasurableSet s μ)
    (hint : ∫⁻ a in s, f a ∂μ ≠ ∞) : ∃ x ∈ s, ⨍⁻ a in s, f a ∂μ ≤ f x 
goal: ∃ x ∈ s, ⨍⁻ (a : α) in s, f a ∂μ ≤ f x

full_name: MeasureTheory.measure_laverage_le_pos
code: /-- **First moment method**. A measurable function is greater than its mean on a set of positive
measure. -/
theorem measure_laverage_le_pos (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) :
    0 < μ {x | ⨍⁻ a, f a ∂μ ≤ f x} 
goal: 0 < μ {x | ⨍⁻ (a : α), f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_laverage_le
code: /-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_laverage_le (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ⨍⁻ a, f a ∂μ ≤ f x 
goal: ∃ x, ⨍⁻ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.exists_not_mem_null_laverage_le
code: /-- **First moment method**. The maximum of a measurable function is greater than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_laverage_le (hμ : μ ≠ 0) (hint : ∫⁻ a : α, f a ∂μ ≠ ∞) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ⨍⁻ a, f a ∂μ ≤ f x 
goal: ∃ x ∉ N, ⨍⁻ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.measure_le_laverage_pos
code: /-- **First moment method**. A measurable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_laverage_pos (hμ : μ ≠ 0) (hf : AEMeasurable f μ) :
    0 < μ {x | f x ≤ ⨍⁻ a, f a ∂μ} 
goal: 0 < μ {x | f x ≤ ⨍⁻ (a : α), f a ∂μ}

full_name: MeasureTheory.exists_le_laverage
code: /-- **First moment method**. The minimum of a measurable function is smaller than its mean. -/
theorem exists_le_laverage (hμ : μ ≠ 0) (hf : AEMeasurable f μ) : ∃ x, f x ≤ ⨍⁻ a, f a ∂μ 
goal: ∃ x, f x ≤ ⨍⁻ (a : α), f a ∂μ

full_name: MeasureTheory.exists_not_mem_null_le_laverage
code: /-- **First moment method**. The minimum of a measurable function is smaller than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_le_laverage (hμ : μ ≠ 0) (hf : AEMeasurable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ⨍⁻ a, f a ∂μ 
goal: ∃ x ∉ N, f x ≤ ⨍⁻ (a : α), f a ∂μ

full_name: MeasureTheory.measure_le_lintegral_pos
code: /-- **First moment method**. A measurable function is smaller than its integral on a set f
positive measure. -/
theorem measure_le_lintegral_pos (hf : AEMeasurable f μ) : 0 < μ {x | f x ≤ ∫⁻ a, f a ∂μ} 
goal: 0 < μ {x | f x ≤ ∫⁻ (a : α), f a ∂μ}

full_name: MeasureTheory.measure_lintegral_le_pos
code: /-- **First moment method**. A measurable function is greater than its integral on a set f
positive measure. -/
theorem measure_lintegral_le_pos (hint : ∫⁻ a, f a ∂μ ≠ ∞) : 0 < μ {x | ∫⁻ a, f a ∂μ ≤ f x} 
goal: 0 < μ {x | ∫⁻ (a : α), f a ∂μ ≤ f x}

full_name: MeasureTheory.exists_le_lintegral
code: /-- **First moment method**. The minimum of a measurable function is smaller than its integral. -/
theorem exists_le_lintegral (hf : AEMeasurable f μ) : ∃ x, f x ≤ ∫⁻ a, f a ∂μ 
goal: ∃ x, f x ≤ ∫⁻ (a : α), f a ∂μ

full_name: MeasureTheory.exists_lintegral_le
code: /-- **First moment method**. The maximum of a measurable function is greater than its integral. -/
theorem exists_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ∫⁻ a, f a ∂μ ≤ f x 
goal: ∃ x, ∫⁻ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.exists_not_mem_null_le_lintegral
code: /-- **First moment method**. The minimum of a measurable function is smaller than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_le_lintegral (hf : AEMeasurable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ∫⁻ a, f a ∂μ 
goal: ∃ x ∉ N, f x ≤ ∫⁻ (a : α), f a ∂μ

full_name: MeasureTheory.exists_not_mem_null_lintegral_le
code: /-- **First moment method**. The maximum of a measurable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ∫⁻ a, f a ∂μ ≤ f x 
goal: ∃ x ∉ N, ∫⁻ (a : α), f a ∂μ ≤ f x

full_name: MeasureTheory.tendsto_integral_smul_of_tendsto_average_norm_sub
code: /-- If the average of a function `f` along a sequence of sets `aₙ` converges to `c` (more precisely,
we require that `⨍ y in a i, ‖f y - c‖ ∂μ` tends to `0`), then the integral of `gₙ • f` also tends
to `c` if `gₙ` is supported in `aₙ`, has integral converging to one and supremum at most `K / μ aₙ`.
-/
theorem tendsto_integral_smul_of_tendsto_average_norm_sub
    {ι : Type*} {a : ι → Set α} {l : Filter ι} {f : α → E} {c : E} {g : ι → α → ℝ} (K : ℝ)
    (hf : Tendsto (fun i ↦ ⨍ y in a i, ‖f y - c‖ ∂μ) l (𝓝 0))
    (f_int : ∀ᶠ i in l, IntegrableOn f (a i) μ)
    (hg : Tendsto (fun i ↦ ∫ y, g i y ∂μ) l (𝓝 1))
    (g_supp : ∀ᶠ i in l, Function.support (g i) ⊆ a i)
    (g_bound : ∀ᶠ i in l, ∀ x, |g i x| ≤ K / (μ (a i)).toReal) :
    Tendsto (fun i ↦ ∫ y, g i y • f y ∂μ) l (𝓝 c) 
goal: Filter.Tendsto (fun i => ∫ (y : α), g i y • f y ∂μ) l (𝓝 c)