l3lab/ntp-mathlib huggingface dataset:
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 ∂μ] := by
  by_cases hs₀ : μ s = 0
  · rw [← ae_eq_empty] at hs₀
    rw [restrict_congr_set (hs₀.union EventuallyEq.rfl), empty_union]
    exact right_mem_segment _ _ _
  · 

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → ℝ≥0∞
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hs₀ : ¬↑↑μ s = 0
⊢ ⨍⁻ (x : α) in s ∪ t, f x ∂μ ∈ [⨍⁻ (x : α) in s, f x ∂μ-[ℝ≥0∞]⨍⁻ (x : α) in t, f x ∂μ]

Next tactic:
refine'
      ⟨μ s / (μ s + μ t), μ t / (μ s + μ t), zero_le _, zero_le _, _, (laverage_union hd ht).symm⟩
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 ∂μ] := by
  by_cases hs₀ : μ s = 0
  · rw [← ae_eq_empty] at hs₀
    rw [restrict_congr_set (hs₀.union EventuallyEq.rfl), empty_union]
    exact right_mem_segment _ _ _
  · refine'
      ⟨μ s / (μ s + μ t), μ t / (μ s + μ t), zero_le _, zero_le _, _, (laverage_union hd ht).symm⟩
    

Proof state:
case neg
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → ℝ≥0∞
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hs₀ : ¬↑↑μ s = 0
⊢ ↑↑μ s / (↑↑μ s + ↑↑μ t) + ↑↑μ t / (↑↑μ s + ↑↑μ t) = 1

Next tactic:
rw [← ENNReal.add_div,
      ENNReal.div_self (add_eq_zero.not.2 fun h => hs₀ h.1) (add_ne_top.2 ⟨hsμ, htμ⟩)]
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 ∂μ) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → ℝ≥0∞
inst✝ : 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 ∂μ)

Next tactic:
simpa only [union_compl_self, restrict_univ] using
    laverage_union_mem_openSegment aedisjoint_compl_right hs.compl hs₀ hsc₀ (measure_ne_top _ _)
      (measure_ne_top _ _)
@[simp]
theorem laverage_const (μ : Measure α) [IsFiniteMeasure μ] [h : NeZero μ] (c : ℝ≥0∞) :
    ⨍⁻ _x, c ∂μ = c := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ✝ ν : Measure α
s t : Set α
f g : α → ℝ≥0∞
μ : Measure α
inst✝ : IsFiniteMeasure μ
h : NeZero μ
c : ℝ≥0∞
⊢ ⨍⁻ (_x : α), c ∂μ = c

Next tactic:
simp only [laverage, lintegral_const, measure_univ, mul_one]
theorem setLaverage_const (hs₀ : μ s ≠ 0) (hs : μ s ≠ ∞) (c : ℝ≥0∞) : ⨍⁻ _x in s, c ∂μ = c := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → ℝ≥0∞
hs₀ : ↑↑μ s ≠ 0
hs : ↑↑μ s ≠ ⊤
c : ℝ≥0∞
⊢ ⨍⁻ (_x : α) in s, c ∂μ = c

Next tactic:
simp only [setLaverage_eq, lintegral_const, Measure.restrict_apply, MeasurableSet.univ,
    univ_inter, div_eq_mul_inv, mul_assoc, ENNReal.mul_inv_cancel hs₀ hs, mul_one]
theorem lintegral_laverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    ∫⁻ _x, ⨍⁻ a, f a ∂μ ∂μ = ∫⁻ x, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ✝ ν : Measure α
s t : Set α
f✝ g : α → ℝ≥0∞
μ : Measure α
inst✝ : IsFiniteMeasure μ
f : α → ℝ≥0∞
⊢ ∫⁻ (_x : α), ⨍⁻ (a : α), f a ∂μ ∂μ = ∫⁻ (x : α), f x ∂μ

Next tactic:
obtain rfl | hμ := eq_or_ne μ 0
theorem lintegral_laverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    ∫⁻ _x, ⨍⁻ a, f a ∂μ ∂μ = ∫⁻ x, f x ∂μ := by
  obtain rfl | hμ := eq_or_ne μ 0
  · 

Proof state:
case inl
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g f : α → ℝ≥0∞
inst✝ : IsFiniteMeasure 0
⊢ ∫⁻ (_x : α), ⨍⁻ (a : α), f a ∂0 ∂0 = ∫⁻ (x : α), f x ∂0

Next tactic:
simp
theorem lintegral_laverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → ℝ≥0∞) :
    ∫⁻ _x, ⨍⁻ a, f a ∂μ ∂μ = ∫⁻ x, f x ∂μ := by
  obtain rfl | hμ := eq_or_ne μ 0
  · simp
  · 

Proof state:
case inr
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ✝ ν : Measure α
s t : Set α
f✝ g : α → ℝ≥0∞
μ : Measure α
inst✝ : IsFiniteMeasure μ
f : α → ℝ≥0∞
hμ : μ ≠ 0
⊢ ∫⁻ (_x : α), ⨍⁻ (a : α), f a ∂μ ∂μ = ∫⁻ (x : α), f x ∂μ

Next tactic:
rw [lintegral_const, laverage_eq,
      ENNReal.div_mul_cancel (measure_univ_ne_zero.2 hμ) (measure_ne_top _ _)]
@[simp]
theorem average_zero : ⨍ _, (0 : E) ∂μ = 0 := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → E
⊢ ⨍ (x : α), 0 ∂μ = 0

Next tactic:
rw [average, integral_zero]
@[simp]
theorem average_zero_measure (f : α → E) : ⨍ x, f x ∂(0 : Measure α) = 0 := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g f : α → E
⊢ ⨍ (x : α), f x ∂0 = 0

Next tactic:
rw [average, smul_zero, integral_zero_measure]
theorem average_eq (f : α → E) : ⨍ x, f x ∂μ = (μ univ).toReal⁻¹ • ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g f : α → E
⊢ ⨍ (x : α), f x ∂μ = (ENNReal.toReal (↑↑μ univ))⁻¹ • ∫ (x : α), f x ∂μ

Next tactic:
rw [average_eq', integral_smul_measure, ENNReal.toReal_inv]
theorem average_eq_integral [IsProbabilityMeasure μ] (f : α → E) : ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsProbabilityMeasure μ
f : α → E
⊢ ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [average, measure_univ, inv_one, one_smul]
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsFiniteMeasure μ
f : α → E
⊢ ENNReal.toReal (↑↑μ univ) • ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rcases eq_or_ne μ 0 with hμ | hμ
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  rcases eq_or_ne μ 0 with hμ | hμ
  · 

Proof state:
case inl
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsFiniteMeasure μ
f : α → E
hμ : μ = 0
⊢ ENNReal.toReal (↑↑μ univ) • ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [hμ, integral_zero_measure, average_zero_measure, smul_zero]
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  rcases eq_or_ne μ 0 with hμ | hμ
  · rw [hμ, integral_zero_measure, average_zero_measure, smul_zero]
  · 

Proof state:
case inr
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsFiniteMeasure μ
f : α → E
hμ : μ ≠ 0
⊢ ENNReal.toReal (↑↑μ univ) • ⨍ (x : α), f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [average_eq, smul_inv_smul₀]
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  rcases eq_or_ne μ 0 with hμ | hμ
  · rw [hμ, integral_zero_measure, average_zero_measure, smul_zero]
  · rw [average_eq, smul_inv_smul₀]
    

Proof state:
case inr.hc
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsFiniteMeasure μ
f : α → E
hμ : μ ≠ 0
⊢ ENNReal.toReal (↑↑μ univ) ≠ 0

Next tactic:
refine' (ENNReal.toReal_pos _ <| measure_ne_top _ _).ne'
@[simp]
theorem measure_smul_average [IsFiniteMeasure μ] (f : α → E) :
    (μ univ).toReal • ⨍ x, f x ∂μ = ∫ x, f x ∂μ := by
  rcases eq_or_ne μ 0 with hμ | hμ
  · rw [hμ, integral_zero_measure, average_zero_measure, smul_zero]
  · rw [average_eq, smul_inv_smul₀]
    refine' (ENNReal.toReal_pos _ <| measure_ne_top _ _).ne'
    

Proof state:
case inr.hc
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : CompleteSpace E
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g : α → E
inst✝ : IsFiniteMeasure μ
f : α → E
hμ : μ ≠ 0
⊢ ↑↑μ univ ≠ 0

Next tactic:
rwa [Ne.def, measure_univ_eq_zero]
theorem setAverage_eq (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = (μ s).toReal⁻¹ • ∫ x in s, f x ∂μ := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t : Set α
f✝ g f : α → E
s : Set α
⊢ ⨍ (x : α) in s, f x ∂μ = (ENNReal.toReal (↑↑μ s))⁻¹ • ∫ (x : α) in s, f x ∂μ

Next tactic:
rw [average_eq, restrict_apply_univ]
theorem setAverage_eq' (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = ∫ x, f x ∂(μ s)⁻¹ • μ.restrict s := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t : Set α
f✝ g f : α → E
s : Set α
⊢ ⨍ (x : α) in s, f x ∂μ = ∫ (x : α), f x ∂(↑↑μ s)⁻¹ • Measure.restrict μ s

Next tactic:
simp only [average_eq', restrict_apply_univ]
theorem average_congr {f g : α → E} (h : f =ᵐ[μ] g) : ⨍ x, f x ∂μ = ⨍ x, g x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f✝ g✝ f g : α → E
h : f =ᶠ[ae μ] g
⊢ ⨍ (x : α), f x ∂μ = ⨍ (x : α), g x ∂μ

Next tactic:
simp only [average_eq, integral_congr_ae h]
theorem setAverage_congr (h : s =ᵐ[μ] t) : ⨍ x in s, f x ∂μ = ⨍ x in t, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → E
h : s =ᶠ[ae μ] t
⊢ ⨍ (x : α) in s, f x ∂μ = ⨍ (x : α) in t, f x ∂μ

Next tactic:
simp only [setAverage_eq, set_integral_congr_set_ae h, measure_congr h]
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 ∂μ := by 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s t : Set α
f g : α → E
hs : MeasurableSet s
h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x
⊢ ⨍ (x : α) in s, f x ∂μ = ⨍ (x : α) in s, g x ∂μ

Next tactic:
simp only [average_eq, set_integral_congr_ae hs h]
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 ∂ν := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : NormedSpace ℝ F
inst✝² : CompleteSpace F
μ ν✝ : Measure α
s t : Set α
f✝ g : α → E
inst✝¹ : IsFiniteMeasure μ
ν : Measure α
inst✝ : IsFiniteMeasure ν
f : α → E
hμ : Integrable f
hν : Integrable f
⊢ ⨍ (x : α), f x ∂(μ + ν) =
    (ENNReal.toReal (↑↑μ univ) / (ENNReal.toReal (↑↑μ univ) + ENNReal.toReal (↑↑ν univ))) • ⨍ (x : α), f x ∂μ +
      (ENNReal.toReal (↑↑ν univ) / (ENNReal.toReal (↑↑μ univ) + ENNReal.toReal (↑↑ν univ))) • ⨍ (x : α), f x ∂ν

Next tactic:
simp only [div_eq_inv_mul, mul_smul, measure_smul_average, ← smul_add,
    ← integral_add_measure hμ hν, ← ENNReal.toReal_add (measure_ne_top μ _) (measure_ne_top ν _)]
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 ∂ν := by
  simp only [div_eq_inv_mul, mul_smul, measure_smul_average, ← smul_add,
    ← integral_add_measure hμ hν, ← ENNReal.toReal_add (measure_ne_top μ _) (measure_ne_top ν _)]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : CompleteSpace E
inst✝⁴ : NormedAddCommGroup F
inst✝³ : NormedSpace ℝ F
inst✝² : CompleteSpace F
μ ν✝ : Measure α
s t : Set α
f✝ g : α → E
inst✝¹ : IsFiniteMeasure μ
ν : Measure α
inst✝ : IsFiniteMeasure ν
f : α → E
hμ : Integrable f
hν : Integrable f
⊢ ⨍ (x : α), f x ∂(μ + ν) = (ENNReal.toReal (↑↑μ univ + ↑↑ν univ))⁻¹ • ∫ (x : α), f x ∂(μ + ν)

Next tactic:
rw [average_eq, Measure.add_apply]
theorem measure_smul_setAverage (f : α → E) {s : Set α} (h : μ s ≠ ∞) :
    (μ s).toReal • ⨍ x in s, f x ∂μ = ∫ x in s, f x ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t : Set α
f✝ g f : α → E
s : Set α
h : ↑↑μ s ≠ ⊤
⊢ ENNReal.toReal (↑↑μ s) • ⨍ (x : α) in s, f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
haveI := Fact.mk h.lt_top
theorem measure_smul_setAverage (f : α → E) {s : Set α} (h : μ s ≠ ∞) :
    (μ s).toReal • ⨍ x in s, f x ∂μ = ∫ x in s, f x ∂μ := by
  haveI := Fact.mk h.lt_top
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t : Set α
f✝ g f : α → E
s : Set α
h : ↑↑μ s ≠ ⊤
this : Fact (↑↑μ s < ⊤)
⊢ ENNReal.toReal (↑↑μ s) • ⨍ (x : α) in s, f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
rw [← measure_smul_average, restrict_apply_univ]
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 ∂μ := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g 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 ∂μ =
    (ENNReal.toReal (↑↑μ s) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in s, f x ∂μ +
      (ENNReal.toReal (↑↑μ t) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in t, f x ∂μ

Next tactic:
haveI := Fact.mk hsμ.lt_top
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 ∂μ := by
  haveI := Fact.mk hsμ.lt_top; 

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g f : α → E
s t : Set α
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hfs : IntegrableOn f s
hft : IntegrableOn f t
this : Fact (↑↑μ s < ⊤)
⊢ ⨍ (x : α) in s ∪ t, f x ∂μ =
    (ENNReal.toReal (↑↑μ s) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in s, f x ∂μ +
      (ENNReal.toReal (↑↑μ t) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in t, f x ∂μ

Next tactic:
haveI := Fact.mk htμ.lt_top
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 ∂μ := by
  haveI := Fact.mk hsμ.lt_top; haveI := Fact.mk htμ.lt_top
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g f : α → E
s t : Set α
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hfs : IntegrableOn f s
hft : IntegrableOn f t
this✝ : Fact (↑↑μ s < ⊤)
this : Fact (↑↑μ t < ⊤)
⊢ ⨍ (x : α) in s ∪ t, f x ∂μ =
    (ENNReal.toReal (↑↑μ s) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in s, f x ∂μ +
      (ENNReal.toReal (↑↑μ t) / (ENNReal.toReal (↑↑μ s) + ENNReal.toReal (↑↑μ t))) • ⨍ (x : α) in t, f x ∂μ

Next tactic:
rw [restrict_union₀ hd ht, average_add_measure hfs hft, restrict_apply_univ, restrict_apply_univ]
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 ∂μ) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g 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 ∂μ)

Next tactic:
replace hs₀ : 0 < (μ s).toReal
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 ∂μ) := by
  replace hs₀ : 0 < (μ s).toReal; 

Proof state:
case hs₀
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g 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
⊢ 0 < ENNReal.toReal (↑↑μ s)
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g f : α → E
s t : Set α
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
ht₀ : ↑↑μ t ≠ 0
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hfs : IntegrableOn f s
hft : IntegrableOn f t
hs₀ : 0 < ENNReal.toReal (↑↑μ s)
⊢ ⨍ (x : α) in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ (x : α) in s, f x ∂μ) (⨍ (x : α) in t, f x ∂μ)

Next tactic:
exact ENNReal.toReal_pos hs₀ hsμ
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 ∂μ) := by
  replace hs₀ : 0 < (μ s).toReal; exact ENNReal.toReal_pos hs₀ hsμ
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
m0 : MeasurableSpace α
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : CompleteSpace E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
inst✝ : CompleteSpace F
μ ν : Measure α
s✝ t✝ : Set α
f✝ g f : α → E
s t : Set α
hd : AEDisjoint μ s t
ht : NullMeasurableSet t
ht₀ : ↑↑μ t ≠ 0
hsμ : ↑↑μ s ≠ ⊤
htμ : ↑↑μ t ≠ ⊤
hfs : IntegrableOn f s
hft : IntegrableOn f t
hs₀ : 0 < ENNReal.toReal (↑↑μ s)
⊢ ⨍ (x : α) in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ (x : α) in s, f x ∂μ) (⨍ (x : α) in t, f x ∂μ)

Next tactic:
replace ht₀ : 0 < (μ t).toReal