l3lab/ntp-mathlib huggingface dataset:
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · 

Proof state:
case empty
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
hs : ∀ i ∈ ∅, MeasurableSet (s i)
h's : Set.Pairwise (↑∅) (Disjoint on s)
hf : ∀ i ∈ ∅, IntegrableOn f (s i)
⊢ ∫ (x : α) in ⋃ i ∈ ∅, s i, f x ∂μ = ∑ i in ∅, ∫ (x : α) in s i, f x ∂μ

Next tactic:
simp
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · 

Proof state:
case insert
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : ∀ i ∈ insert a t, MeasurableSet (s i)
h's : Set.Pairwise (↑(insert a t)) (Disjoint on s)
hf : ∀ i ∈ insert a t, IntegrableOn f (s i)
⊢ ∫ (x : α) in ⋃ i ∈ insert a t, s i, f x ∂μ = ∑ i in insert a t, ∫ (x : α) in s i, f x ∂μ

Next tactic:
simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
    

Proof state:
case insert
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : MeasurableSet (s a) ∧ ∀ x ∈ t, MeasurableSet (s x)
hf : IntegrableOn f (s a) ∧ ∀ x ∈ t, IntegrableOn f (s x)
h's : Set.Pairwise (↑t) (Disjoint on s) ∧ ∀ b ∈ ↑t, a ≠ b → (Disjoint on s) a b ∧ (Disjoint on s) b a
⊢ ∫ (x : α) in s a ∪ ⋃ x ∈ t, s x, f x ∂μ = ∑ i in insert a t, ∫ (x : α) in s i, f x ∂μ

Next tactic:
rw [integral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)]
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
    rw [integral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)]
    · 

Proof state:
case insert
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : MeasurableSet (s a) ∧ ∀ x ∈ t, MeasurableSet (s x)
hf : IntegrableOn f (s a) ∧ ∀ x ∈ t, IntegrableOn f (s x)
h's : Set.Pairwise (↑t) (Disjoint on s) ∧ ∀ b ∈ ↑t, a ≠ b → (Disjoint on s) a b ∧ (Disjoint on s) b a
⊢ ∫ (x : α) in s a, f x ∂μ + ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in insert a t, ∫ (x : α) in s i, f x ∂μ

Next tactic:
rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2]
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
    rw [integral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)]
    · rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2]
    · 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : MeasurableSet (s a) ∧ ∀ x ∈ t, MeasurableSet (s x)
hf : IntegrableOn f (s a) ∧ ∀ x ∈ t, IntegrableOn f (s x)
h's : Set.Pairwise (↑t) (Disjoint on s) ∧ ∀ b ∈ ↑t, a ≠ b → (Disjoint on s) a b ∧ (Disjoint on s) b a
⊢ Disjoint (s a) (⋃ i ∈ t, s i)

Next tactic:
simp only [disjoint_iUnion_right]
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
    rw [integral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)]
    · rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2]
    · simp only [disjoint_iUnion_right]
      

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : MeasurableSet (s a) ∧ ∀ x ∈ t, MeasurableSet (s x)
hf : IntegrableOn f (s a) ∧ ∀ x ∈ t, IntegrableOn f (s x)
h's : Set.Pairwise (↑t) (Disjoint on s) ∧ ∀ b ∈ ↑t, a ≠ b → (Disjoint on s) a b ∧ (Disjoint on s) b a
⊢ ∀ i ∈ t, Disjoint (s a) (s i)

Next tactic:
exact fun i hi => (h's.2 i hi (ne_of_mem_of_not_mem hi hat).symm).1
theorem integral_finset_biUnion {ι : Type*} (t : Finset ι) {s : ι → Set α}
    (hs : ∀ i ∈ t, MeasurableSet (s i)) (h's : Set.Pairwise (↑t) (Disjoint on s))
    (hf : ∀ i ∈ t, IntegrableOn f (s i) μ) :
    ∫ x in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ x in s i, f x ∂μ := by
  induction' t using Finset.induction_on with a t hat IH hs h's
  · simp
  · simp only [Finset.coe_insert, Finset.forall_mem_insert, Set.pairwise_insert,
      Finset.set_biUnion_insert] at hs hf h's ⊢
    rw [integral_union _ _ hf.1 (integrableOn_finset_iUnion.2 hf.2)]
    · rw [Finset.sum_insert hat, IH hs.2 h's.1 hf.2]
    · simp only [disjoint_iUnion_right]
      exact fun i hi => (h's.2 i hi (ne_of_mem_of_not_mem hi hat).symm).1
    · 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s✝ t✝ : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ι : Type u_5
s : ι → Set α
a : ι
t : Finset ι
hat : a ∉ t
IH :
  (∀ i ∈ t, MeasurableSet (s i)) →
    Set.Pairwise (↑t) (Disjoint on s) →
      (∀ i ∈ t, IntegrableOn f (s i)) → ∫ (x : α) in ⋃ i ∈ t, s i, f x ∂μ = ∑ i in t, ∫ (x : α) in s i, f x ∂μ
hs : MeasurableSet (s a) ∧ ∀ x ∈ t, MeasurableSet (s x)
hf : IntegrableOn f (s a) ∧ ∀ x ∈ t, IntegrableOn f (s x)
h's : Set.Pairwise (↑t) (Disjoint on s) ∧ ∀ b ∈ ↑t, a ≠ b → (Disjoint on s) a b ∧ (Disjoint on s) b a
⊢ MeasurableSet (⋃ i ∈ t, s i)

Next tactic:
exact Finset.measurableSet_biUnion _ hs.2
theorem integral_fintype_iUnion {ι : Type*} [Fintype ι] {s : ι → Set α}
    (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s))
    (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ x in ⋃ i, s i, f x ∂μ = ∑ i, ∫ x in s i, f x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : NormedSpace ℝ E
ι : Type u_5
inst✝ : Fintype ι
s : ι → Set α
hs : ∀ (i : ι), MeasurableSet (s i)
h's : Pairwise (Disjoint on s)
hf : ∀ (i : ι), IntegrableOn f (s i)
⊢ ∫ (x : α) in ⋃ i, s i, f x ∂μ = ∑ i : ι, ∫ (x : α) in s i, f x ∂μ

Next tactic:
convert integral_finset_biUnion Finset.univ (fun i _ => hs i) _ fun i _ => hf i
theorem integral_fintype_iUnion {ι : Type*} [Fintype ι] {s : ι → Set α}
    (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s))
    (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ x in ⋃ i, s i, f x ∂μ = ∑ i, ∫ x in s i, f x ∂μ := by
  convert integral_finset_biUnion Finset.univ (fun i _ => hs i) _ fun i _ => hf i
  · 

Proof state:
case h.e'_2.h.e'_6.h.e'_4.h.e'_3.h
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : NormedSpace ℝ E
ι : Type u_5
inst✝ : Fintype ι
s : ι → Set α
hs : ∀ (i : ι), MeasurableSet (s i)
h's : Pairwise (Disjoint on s)
hf : ∀ (i : ι), IntegrableOn f (s i)
x✝ : ι
⊢ s x✝ = ⋃ (_ : x✝ ∈ Finset.univ), s x✝

Next tactic:
simp
theorem integral_fintype_iUnion {ι : Type*} [Fintype ι] {s : ι → Set α}
    (hs : ∀ i, MeasurableSet (s i)) (h's : Pairwise (Disjoint on s))
    (hf : ∀ i, IntegrableOn f (s i) μ) : ∫ x in ⋃ i, s i, f x ∂μ = ∑ i, ∫ x in s i, f x ∂μ := by
  convert integral_finset_biUnion Finset.univ (fun i _ => hs i) _ fun i _ => hf i
  · simp
  · 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : NormedSpace ℝ E
ι : Type u_5
inst✝ : Fintype ι
s : ι → Set α
hs : ∀ (i : ι), MeasurableSet (s i)
h's : Pairwise (Disjoint on s)
hf : ∀ (i : ι), IntegrableOn f (s i)
⊢ Set.Pairwise (↑Finset.univ) (Disjoint on fun i => s i)

Next tactic:
simp [pairwise_univ, h's]
theorem integral_empty : ∫ x in ∅, f x ∂μ = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
⊢ ∫ (x : α) in ∅, f x ∂μ = 0

Next tactic:
rw [Measure.restrict_empty, integral_zero_measure]
theorem integral_univ : ∫ x in univ, f x ∂μ = ∫ x, f x ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
⊢ ∫ (x : α) in univ, f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [Measure.restrict_univ]
theorem integral_add_compl₀ (hs : NullMeasurableSet s μ) (hfi : Integrable f μ) :
    ((∫ x in s, f x ∂μ) + ∫ x in sᶜ, f x ∂μ) = ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : NullMeasurableSet s
hfi : Integrable f
⊢ ∫ (x : α) in s, f x ∂μ + ∫ (x : α) in sᶜ, f x ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [← integral_union_ae (@disjoint_compl_right (Set α) _ _).aedisjoint hs.compl hfi.integrableOn
      hfi.integrableOn,
    union_compl_self, integral_univ]
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
⊢ ∫ (x : α), indicator s f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
by_cases hfi : IntegrableOn f s μ
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  by_cases hfi : IntegrableOn f s μ; 

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : IntegrableOn f s
⊢ ∫ (x : α), indicator s f x ∂μ = ∫ (x : α) in s, f x ∂μ
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : ¬IntegrableOn f s
⊢ ∫ (x : α), indicator s f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
swap
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  by_cases hfi : IntegrableOn f s μ; swap
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : ¬IntegrableOn f s
⊢ ∫ (x : α), indicator s f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
rwa [integral_undef, integral_undef]
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  by_cases hfi : IntegrableOn f s μ; swap
  · rwa [integral_undef, integral_undef]
    

Proof state:
case neg
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : ¬IntegrableOn f s
⊢ ¬Integrable fun x => indicator s f x

Next tactic:
rwa [integrable_indicator_iff hs]
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  by_cases hfi : IntegrableOn f s μ; swap
  · rwa [integral_undef, integral_undef]
    rwa [integrable_indicator_iff hs]
  

Proof state:
case pos
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : IntegrableOn f s
⊢ ∫ (x : α), indicator s f x ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
calc
    ∫ x, indicator s f x ∂μ = (∫ x in s, indicator s f x ∂μ) + ∫ x in sᶜ, indicator s f x ∂μ :=
      (integral_add_compl hs (hfi.integrable_indicator hs)).symm
    _ = (∫ x in s, f x ∂μ) + ∫ x in sᶜ, 0 ∂μ :=
      (congr_arg₂ (· + ·) (integral_congr_ae (indicator_ae_eq_restrict hs))
        (integral_congr_ae (indicator_ae_eq_restrict_compl hs)))
    _ = ∫ x in s, f x ∂μ := by simp
/-- For a function `f` and a measurable set `s`, the integral of `indicator s f`
over the whole space is equal to `∫ x in s, f x ∂μ` defined as `∫ x, f x ∂(μ.restrict s)`. -/
theorem integral_indicator (hs : MeasurableSet s) :
    ∫ x, indicator s f x ∂μ = ∫ x in s, f x ∂μ := by
  by_cases hfi : IntegrableOn f s μ; swap
  · rwa [integral_undef, integral_undef]
    rwa [integrable_indicator_iff hs]
  calc
    ∫ x, indicator s f x ∂μ = (∫ x in s, indicator s f x ∂μ) + ∫ x in sᶜ, indicator s f x ∂μ :=
      (integral_add_compl hs (hfi.integrable_indicator hs)).symm
    _ = (∫ x in s, f x ∂μ) + ∫ x in sᶜ, 0 ∂μ :=
      (congr_arg₂ (· + ·) (integral_congr_ae (indicator_ae_eq_restrict hs))
        (integral_congr_ae (indicator_ae_eq_restrict_compl hs)))
    _ = ∫ x in s, f x ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
hs : MeasurableSet s
hfi : IntegrableOn f s
⊢ ∫ (x : α) in s, f x ∂μ + ∫ (x : α) in sᶜ, 0 ∂μ = ∫ (x : α) in s, f x ∂μ

Next tactic:
simp
theorem set_integral_indicator (ht : MeasurableSet t) :
    ∫ x in s, t.indicator f x ∂μ = ∫ x in s ∩ t, f x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α
inst✝¹ : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝ : NormedSpace ℝ E
ht : MeasurableSet t
⊢ ∫ (x : α) in s, indicator t f x ∂μ = ∫ (x : α) in s ∩ t, f x ∂μ

Next tactic:
rw [integral_indicator ht, Measure.restrict_restrict ht, Set.inter_comm]
theorem ofReal_set_integral_one_of_measure_ne_top {α : Type*} {m : MeasurableSpace α}
    {μ : Measure α} {s : Set α} (hs : μ s ≠ ∞) : ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = μ s :=
  calc
    ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = ENNReal.ofReal (∫ _ in s, ‖(1 : ℝ)‖ ∂μ) := by
      

Proof state:
α✝ : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α✝
inst✝¹ : NormedAddCommGroup E
f g : α✝ → E
s✝ t : Set α✝
μ✝ ν : Measure α✝
l l' : Filter α✝
inst✝ : NormedSpace ℝ E
α : Type u_5
m : MeasurableSpace α
μ : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
⊢ ENNReal.ofReal (∫ (x : α) in s, 1 ∂μ) = ENNReal.ofReal (∫ (x : α) in s, ‖1‖ ∂μ)

Next tactic:
simp only [norm_one]
theorem ofReal_set_integral_one_of_measure_ne_top {α : Type*} {m : MeasurableSpace α}
    {μ : Measure α} {s : Set α} (hs : μ s ≠ ∞) : ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = μ s :=
  calc
    ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = ENNReal.ofReal (∫ _ in s, ‖(1 : ℝ)‖ ∂μ) := by
      simp only [norm_one]
    _ = ∫⁻ _ in s, 1 ∂μ := by
      

Proof state:
α✝ : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α✝
inst✝¹ : NormedAddCommGroup E
f g : α✝ → E
s✝ t : Set α✝
μ✝ ν : Measure α✝
l l' : Filter α✝
inst✝ : NormedSpace ℝ E
α : Type u_5
m : MeasurableSpace α
μ : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
⊢ ENNReal.ofReal (∫ (x : α) in s, ‖1‖ ∂μ) = ∫⁻ (x : α) in s, 1 ∂μ

Next tactic:
rw [ofReal_integral_norm_eq_lintegral_nnnorm (integrableOn_const.2 (Or.inr hs.lt_top))]
theorem ofReal_set_integral_one_of_measure_ne_top {α : Type*} {m : MeasurableSpace α}
    {μ : Measure α} {s : Set α} (hs : μ s ≠ ∞) : ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = μ s :=
  calc
    ENNReal.ofReal (∫ _ in s, (1 : ℝ) ∂μ) = ENNReal.ofReal (∫ _ in s, ‖(1 : ℝ)‖ ∂μ) := by
      simp only [norm_one]
    _ = ∫⁻ _ in s, 1 ∂μ := by
      rw [ofReal_integral_norm_eq_lintegral_nnnorm (integrableOn_const.2 (Or.inr hs.lt_top))]
      

Proof state:
α✝ : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝² : MeasurableSpace α✝
inst✝¹ : NormedAddCommGroup E
f g : α✝ → E
s✝ t : Set α✝
μ✝ ν : Measure α✝
l l' : Filter α✝
inst✝ : NormedSpace ℝ E
α : Type u_5
m : MeasurableSpace α
μ : Measure α
s : Set α
hs : ↑↑μ s ≠ ⊤
⊢ ∫⁻ (x : α) in s, ↑‖1‖₊ ∂μ = ∫⁻ (x : α) in s, 1 ∂μ

Next tactic:
simp only [nnnorm_one, ENNReal.coe_one]
theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : IntegrableOn f s μ)
    (hg : IntegrableOn g sᶜ μ) :
    ∫ x, s.piecewise f g x ∂μ = (∫ x in s, f x ∂μ) + ∫ x in sᶜ, g x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : NormedSpace ℝ E
inst✝ : DecidablePred fun x => x ∈ s
hs : MeasurableSet s
hf : IntegrableOn f s
hg : IntegrableOn g sᶜ
⊢ ∫ (x : α), piecewise s f g x ∂μ = ∫ (x : α) in s, f x ∂μ + ∫ (x : α) in sᶜ, g x ∂μ

Next tactic:
rw [← Set.indicator_add_compl_eq_piecewise,
    integral_add' (hf.integrable_indicator hs) (hg.integrable_indicator hs.compl),
    integral_indicator hs, integral_indicator hs.compl]
theorem tendsto_set_integral_of_monotone {ι : Type*} [Countable ι] [SemilatticeSup ι]
    {s : ι → Set α} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s)
    (hfi : IntegrableOn f (⋃ n, s n) μ) :
    Tendsto (fun i => ∫ a in s i, f a ∂μ) atTop (𝓝 (∫ a in ⋃ n, s n, f a ∂μ)) := by
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace α
inst✝³ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝² : NormedSpace ℝ E
ι : Type u_5
inst✝¹ : Countable ι
inst✝ : SemilatticeSup ι
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n)
⊢ Tendsto (fun i => ∫ (a : α) in s i, f a ∂μ) atTop (𝓝 (∫ (a : α) in ⋃ n, s n, f a ∂μ))

Next tactic:
have hfi' : (∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂μ) < ∞ := hfi.2
theorem tendsto_set_integral_of_monotone {ι : Type*} [Countable ι] [SemilatticeSup ι]
    {s : ι → Set α} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s)
    (hfi : IntegrableOn f (⋃ n, s n) μ) :
    Tendsto (fun i => ∫ a in s i, f a ∂μ) atTop (𝓝 (∫ a in ⋃ n, s n, f a ∂μ)) := by
  have hfi' : (∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂μ) < ∞ := hfi.2
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace α
inst✝³ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝² : NormedSpace ℝ E
ι : Type u_5
inst✝¹ : Countable ι
inst✝ : SemilatticeSup ι
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
hfi : IntegrableOn f (⋃ n, s n)
hfi' : ∫⁻ (x : α) in ⋃ n, s n, ↑‖f x‖₊ ∂μ < ⊤
⊢ Tendsto (fun i => ∫ (a : α) in s i, f a ∂μ) atTop (𝓝 (∫ (a : α) in ⋃ n, s n, f a ∂μ))

Next tactic:
set S := ⋃ i, s i
theorem tendsto_set_integral_of_monotone {ι : Type*} [Countable ι] [SemilatticeSup ι]
    {s : ι → Set α} (hsm : ∀ i, MeasurableSet (s i)) (h_mono : Monotone s)
    (hfi : IntegrableOn f (⋃ n, s n) μ) :
    Tendsto (fun i => ∫ a in s i, f a ∂μ) atTop (𝓝 (∫ a in ⋃ n, s n, f a ∂μ)) := by
  have hfi' : (∫⁻ x in ⋃ n, s n, ‖f x‖₊ ∂μ) < ∞ := hfi.2
  set S := ⋃ i, s i
  

Proof state:
α : Type u_1
β : Type u_2
E : Type u_3
F : Type u_4
inst✝⁴ : MeasurableSpace α
inst✝³ : NormedAddCommGroup E
f g : α → E
s✝ t : Set α
μ ν : Measure α
l l' : Filter α
inst✝² : NormedSpace ℝ E
ι : Type u_5
inst✝¹ : Countable ι
inst✝ : SemilatticeSup ι
s : ι → Set α
hsm : ∀ (i : ι), MeasurableSet (s i)
h_mono : Monotone s
S : Set α := ⋃ i, s i
hfi : IntegrableOn f S
hfi' : ∫⁻ (x : α) in S, ↑‖f x‖₊ ∂μ < ⊤
⊢ Tendsto (fun i => ∫ (a : α) in s i, f a ∂μ) atTop (𝓝 (∫ (a : α) in S, f a ∂μ))

Next tactic:
have hSm : MeasurableSet S := MeasurableSet.iUnion hsm