-- Mathlib/MeasureTheory/Measure/Prod.lean
theorem Measurable.lintegral_prod_right' [SFinite ν] :
    ∀ {f : α × β → ℝ≥0∞}, Measurable f → Measurable fun x => ∫⁻ y, f (x, y) ∂ν

Proof state:
case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
⊢ ∀ ⦃f g : α × β → ℝ≥0∞⦄,
    Disjoint (support f) (support g) →
      Measurable f →
        Measurable g →
          (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) f →
            (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) g →
              (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f + g)

Tactic:
rintro f g - hf - h2f h2g

Result:
case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
f g : α × β → ℝ≥0∞
hf : Measurable f
h2f : Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν
h2g : Measurable fun x => ∫⁻ (y : β), g (x, y) ∂ν
⊢ Measurable fun x => ∫⁻ (y : β), (f + g) (x, y) ∂ν

Proof state:
case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f : ℕ → α × β → ℝ≥0∞
hf : ∀ (n : ℕ), Measurable (f n)
h2f : Monotone f
h3f : ∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)
this : ∀ (x : α), Monotone fun n y => f n (x, y)
⊢ Measurable fun x => ⨆ n, ∫⁻ (a : β), (f n ∘ Prod.mk x) a ∂ν

Tactic:
exact .iSup h3f

Result:
no goals

Proof state:
case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f g : α × β → ℝ≥0∞
hf : Measurable f
h2f : Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν
h2g : Measurable fun x => ∫⁻ (y : β), g (x, y) ∂ν
⊢ Measurable fun x => ∫⁻ (a : β), (f ∘ Prod.mk x) a ∂ν + ∫⁻ (a : β), g (x, a) ∂ν

Tactic:
exact h2f.add h2g

Result:
no goals

Proof state:
case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f : ℕ → α × β → ℝ≥0∞
hf : ∀ (n : ℕ), Measurable (f n)
h2f : Monotone f
h3f : ∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)
⊢ Measurable fun x => ∫⁻ (y : β), (fun x => ⨆ n, f n x) (x, y) ∂ν

Tactic:
have : ∀ x, Monotone fun n y => f n (x, y) := fun x i j hij y => h2f hij (x, y)

Result:
case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f : ℕ → α × β → ℝ≥0∞
hf : ∀ (n : ℕ), Measurable (f n)
h2f : Monotone f
h3f : ∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)
this : ∀ (x : α), Monotone fun n y => f n (x, y)
⊢ Measurable fun x => ∫⁻ (y : β), (fun x => ⨆ n, f n x) (x, y) ∂ν

Proof state:
case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f : ℕ → α × β → ℝ≥0∞
hf : ∀ (n : ℕ), Measurable (f n)
h2f : Monotone f
h3f : ∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)
this : ∀ (x : α), Monotone fun n y => f n (x, y)
⊢ Measurable fun x => ∫⁻ (y : β), (fun x => ⨆ n, f n x) (x, y) ∂ν

Tactic:
conv => enter [1, x]; erw [lintegral_iSup (fun n => (hf n).comp m) (this x)]

Result:
case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m : ∀ {α : Type u_1} {β : Type u_2} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α}, Measurable (Prod.mk x)
f : ℕ → α × β → ℝ≥0∞
hf : ∀ (n : ℕ), Measurable (f n)
h2f : Monotone f
h3f : ∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)
this : ∀ (x : α), Monotone fun n y => f n (x, y)
⊢ Measurable fun x => ⨆ n, ∫⁻ (a : β), (f n ∘ Prod.mk x) a ∂ν

Proof state:
case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
f g : α × β → ℝ≥0∞
hf : Measurable f
h2f : Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν
h2g : Measurable fun x => ∫⁻ (y : β), g (x, y) ∂ν
⊢ Measurable fun x => ∫⁻ (y : β), (f + g) (x, y) ∂ν

Tactic:
simp only [Pi.add_apply]

Result:
case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
f g : α × β → ℝ≥0∞
hf : Measurable f
h2f : Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν
h2g : Measurable fun x => ∫⁻ (y : β), g (x, y) ∂ν
⊢ Measurable fun x => ∫⁻ (y : β), f (x, y) + g (x, y) ∂ν

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
⊢ ∀ {f : α × β → ℝ≥0∞}, Measurable f → Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν

Tactic:
refine Measurable.ennreal_induction (P := fun f => Measurable fun (x : α) => ∫⁻ y, f (x, y) ∂ν)
  ?_ ?_ ?_

Result:
case refine_1
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
⊢ ∀ (c : ℝ≥0∞) ⦃s : Set (α × β)⦄,
    MeasurableSet s → (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (s.indicator fun x => c)

case refine_2
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
⊢ ∀ ⦃f g : α × β → ℝ≥0∞⦄,
    Disjoint (support f) (support g) →
      Measurable f →
        Measurable g →
          (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) f →
            (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) g →
              (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f + g)

case refine_3
α : Type u_1
β : Type u_2
inst✝² : MeasurableSpace α
inst✝¹ : MeasurableSpace β
ν : Measure β
inst✝ : SFinite ν
m :
  ∀ {α : Type ?u.7641} {β : Type ?u.7640} {m : MeasurableSpace α} {mβ : MeasurableSpace β} {x : α},
    Measurable (Prod.mk x)
⊢ ∀ ⦃f : ℕ → α × β → ℝ≥0∞⦄,
    (∀ (n : ℕ), Measurable (f n)) →
      Monotone f →
        (∀ (n : ℕ), (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) (f n)) →
          (fun f => Measurable fun x => ∫⁻ (y : β), f (x, y) ∂ν) fun x => ⨆ n, f n x