Theorem: MeasureTheory.integral_union_eq_left_of_ae
File: Mathlib/MeasureTheory/Integral/SetIntegral.lean

tactic: have ht : IntegrableOn f t μ := by apply integrableOn_zero.congr_fun_ae; symm; exact ht_eq
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: by_cases H : IntegrableOn f (s ∪ t) μ
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: swap
state_before: case pos
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

case neg
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : ¬IntegrableOn f (s ∪ t)
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: let f' := H.1.mk f
state_before: case pos
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: calc
  (∫ x : α in s ∪ t, f x ∂μ) = ∫ x : α in s ∪ t, f' x ∂μ := integral_congr_ae H.1.ae_eq_mk
  _ = ∫ x in s, f' x ∂μ := by
    apply
      integral_union_eq_left_of_ae_aux _ H.1.stronglyMeasurable_mk (H.congr_fun_ae H.1.ae_eq_mk)
    filter_upwards [ht_eq,
      ae_mono (Measure.restrict_mono (subset_union_right s t) le_rfl) H.1.ae_eq_mk] with x hx h'x
    rw [← h'x, hx]
  _ = ∫ x in s, f x ∂μ :=
    integral_congr_ae
      (ae_mono (Measure.restrict_mono (subset_union_left s t) le_rfl) H.1.ae_eq_mk.symm)
state_before: case pos
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
f' : α → E := AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t)))
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: apply integrableOn_zero.congr_fun_ae
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
⊢ IntegrableOn f t

tactic: symm
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
⊢ (fun x => 0) =ᵐ[Measure.restrict μ t] f

tactic: exact ht_eq
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
⊢ f =ᵐ[Measure.restrict μ t] fun x => 0

tactic: rw [integral_undef H, integral_undef]
state_before: case neg
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : ¬IntegrableOn f (s ∪ t)
⊢ (∫ (x : α) in s ∪ t, f x ∂μ) = ∫ (x : α) in s, f x ∂μ

tactic: simpa [integrableOn_union, ht] using H
state_before: case neg
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : ¬IntegrableOn f (s ∪ t)
⊢ ¬Integrable fun x => f x

tactic: apply
  integral_union_eq_left_of_ae_aux _ H.1.stronglyMeasurable_mk (H.congr_fun_ae H.1.ae_eq_mk)
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
f' : α → E := AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t)))
⊢ (∫ (x : α) in s ∪ t, f' x ∂μ) = ∫ (x : α) in s, f' x ∂μ

tactic: filter_upwards [ht_eq,
  ae_mono (Measure.restrict_mono (subset_union_right s t) le_rfl) H.1.ae_eq_mk] with x hx h'x
state_before: α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
f' : α → E := AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t)))
⊢ ∀ᵐ (x : α) ∂Measure.restrict μ t,
    AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t))) x = 0

tactic: rw [← h'x, hx]
state_before: case h
α : Type u_1
β : Type ?u.82166
E : Type u_2
F : Type ?u.82172
inst✝³ : MeasurableSpace α
inst✝² : NormedAddCommGroup E
f g : α → E
s t : Set α
μ ν : Measure α
l l' : Filter α
inst✝¹ : CompleteSpace E
inst✝ : NormedSpace ℝ E
ht_eq : ∀ᵐ (x : α) ∂Measure.restrict μ t, f x = 0
ht : IntegrableOn f t
H : IntegrableOn f (s ∪ t)
f' : α → E := AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t)))
x : α
hx : f x = 0
h'x : f x = AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t))) x
⊢ AEStronglyMeasurable.mk f (_ : AEStronglyMeasurable f (Measure.restrict μ (s ∪ t))) x = 0