Theorem: ProbabilityTheory.IndepFun.integral_mul_of_integrable
File: Mathlib/Probability/Integration.lean

tactic: let pos : ℝ → ℝ := fun x => max x 0
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: let neg : ℝ → ℝ := fun x => max (-x) 0
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have posm : Measurable pos := measurable_id'.max measurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have negm : Measurable neg := measurable_id'.neg.max measurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: let Xp := pos ∘ X
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: let Xm := neg ∘ X
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: let Yp := pos ∘ Y
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: let Ym := neg ∘ Y
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hXpm : X = Xp - Xm := funext fun ω => (max_zero_sub_max_neg_zero_eq_self (X ω)).symm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hYpm : Y = Yp - Ym := funext fun ω => (max_zero_sub_max_neg_zero_eq_self (Y ω)).symm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hp1 : 0 ≤ Xm := fun ω => le_max_right _ _
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hp2 : 0 ≤ Xp := fun ω => le_max_right _ _
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hp3 : 0 ≤ Ym := fun ω => le_max_right _ _
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hp4 : 0 ≤ Yp := fun ω => le_max_right _ _
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hm1 : AEMeasurable Xm μ := hX.1.aemeasurable.neg.max aemeasurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hm2 : AEMeasurable Xp μ := hX.1.aemeasurable.max aemeasurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hm3 : AEMeasurable Ym μ := hY.1.aemeasurable.neg.max aemeasurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hm4 : AEMeasurable Yp μ := hY.1.aemeasurable.max aemeasurable_const
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hv1 : Integrable Xm μ := hX.neg_part
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hv2 : Integrable Xp μ := hX.pos_part
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hv3 : Integrable Ym μ := hY.neg_part
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hv4 : Integrable Yp μ := hY.pos_part
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hi1 : IndepFun Xm Ym μ := hXY.comp negm negm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hi2 : IndepFun Xp Ym μ := hXY.comp posm negm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hi3 : IndepFun Xm Yp μ := hXY.comp negm posm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hi4 : IndepFun Xp Yp μ := hXY.comp posm posm
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl1 : Integrable (Xm * Ym) μ := hi1.integrable_mul hv1 hv3
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl2 : Integrable (Xp * Ym) μ := hi2.integrable_mul hv2 hv3
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl3 : Integrable (Xm * Yp) μ := hi3.integrable_mul hv1 hv4
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl4 : Integrable (Xp * Yp) μ := hi4.integrable_mul hv2 hv4
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl5 : Integrable (Xp * Yp - Xm * Yp) μ := hl4.sub hl3
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
hl4 : Integrable (Xp * Yp)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: have hl6 : Integrable (Xp * Ym - Xm * Ym) μ := hl2.sub hl1
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
hl4 : Integrable (Xp * Yp)
hl5 : Integrable (Xp * Yp - Xm * Yp)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: rw [hXpm, hYpm, mul_sub, sub_mul, sub_mul]
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
hl4 : Integrable (Xp * Yp)
hl5 : Integrable (Xp * Yp - Xm * Yp)
hl6 : Integrable (Xp * Ym - Xm * Ym)
⊢ integral μ (X * Y) = integral μ X * integral μ Y

tactic: rw [integral_sub' hl5 hl6, integral_sub' hl4 hl3, integral_sub' hl2 hl1, integral_sub' hv2 hv1,
  integral_sub' hv4 hv3, hi1.integral_mul_of_nonneg hp1 hp3 hm1 hm3,
  hi2.integral_mul_of_nonneg hp2 hp3 hm2 hm3, hi3.integral_mul_of_nonneg hp1 hp4 hm1 hm4,
  hi4.integral_mul_of_nonneg hp2 hp4 hm2 hm4]
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
hl4 : Integrable (Xp * Yp)
hl5 : Integrable (Xp * Yp - Xm * Yp)
hl6 : Integrable (Xp * Ym - Xm * Ym)
⊢ integral μ (Xp * Yp - Xm * Yp - (Xp * Ym - Xm * Ym)) = integral μ (Xp - Xm) * integral μ (Yp - Ym)

tactic: ring
state_before: Ω : Type u_1
mΩ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
f g : Ω → ℝ≥0∞
X Y : Ω → ℝ
hXY : IndepFun X Y
hX : Integrable X
hY : Integrable Y
pos : ℝ → ℝ := fun x => max x 0
neg : ℝ → ℝ := fun x => max (-x) 0
posm : Measurable pos
negm : Measurable neg
Xp : Ω → ℝ := pos ∘ X
Xm : Ω → ℝ := neg ∘ X
Yp : Ω → ℝ := pos ∘ Y
Ym : Ω → ℝ := neg ∘ Y
hXpm : X = Xp - Xm
hYpm : Y = Yp - Ym
hp1 : 0 ≤ Xm
hp2 : 0 ≤ Xp
hp3 : 0 ≤ Ym
hp4 : 0 ≤ Yp
hm1 : AEMeasurable Xm
hm2 : AEMeasurable Xp
hm3 : AEMeasurable Ym
hm4 : AEMeasurable Yp
hv1 : Integrable Xm
hv2 : Integrable Xp
hv3 : Integrable Ym
hv4 : Integrable Yp
hi1 : IndepFun Xm Ym
hi2 : IndepFun Xp Ym
hi3 : IndepFun Xm Yp
hi4 : IndepFun Xp Yp
hl1 : Integrable (Xm * Ym)
hl2 : Integrable (Xp * Ym)
hl3 : Integrable (Xm * Yp)
hl4 : Integrable (Xp * Yp)
hl5 : Integrable (Xp * Yp - Xm * Yp)
hl6 : Integrable (Xp * Ym - Xm * Ym)
⊢ integral μ Xp * integral μ Yp - integral μ Xm * integral μ Yp -
      (integral μ Xp * integral μ Ym - integral μ Xm * integral μ Ym) =
    ((∫ (a : Ω), Xp a ∂μ) - ∫ (a : Ω), Xm a ∂μ) * ((∫ (a : Ω), Yp a ∂μ) - ∫ (a : Ω), Ym a ∂μ)