-- Mathlib/Probability/Kernel/Disintegration/CDFToKernel.lean
lemma setLIntegral_toKernel_univ [IsFiniteKernel κ] (hf : IsCondKernelCDF f κ ν)
    (a : α) {s : Set β} (hs : MeasurableSet s) :
    ∫⁻ b in s, hf.toKernel f (a, b) univ ∂(ν a) = κ a (s ×ˢ univ)

Proof state:
case h_directed
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ Directed (fun x1 x2 => x1 ≤ x2) fun i b => ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑i)

Tactic:
refine Monotone.directed_le fun i j hij t ↦ measure_mono (Iic_subset_Iic.mpr ?_)

Result:
case h_directed
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
i j : ℚ
hij : i ≤ j
t : β
⊢ ↑i ≤ ↑j

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
r r' : ℚ
hrr' : r ≤ r'
⊢ ↑r ≤ ↑r'

Tactic:
exact mod_cast hrr'

Result:
no goals

Proof state:
case hf
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ∀ (b : ℚ), AEMeasurable (fun b_1 => ((IsCondKernelCDF.toKernel f hf) (a, b_1)) (Iic ↑b)) ((ν a).restrict s)

Tactic:
refine fun q ↦ Measurable.aemeasurable ?_

Result:
case hf
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
q : ℚ
⊢ Measurable fun b => ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑q)

Proof state:
case h_directed
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
i j : ℚ
hij : i ≤ j
t : β
⊢ ↑i ≤ ↑j

Tactic:
exact mod_cast hij

Result:
no goals

Proof state:
case hf
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
q : ℚ
⊢ Measurable fun b => ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑q)

Tactic:
exact (Kernel.measurable_coe _ measurableSet_Iic).comp measurable_prod_mk_left

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
i j : ℚ
hij : i ≤ j
⊢ ↑i ≤ ↑j

Tactic:
exact mod_cast hij

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ∫⁻ (b : β) in s, ⨆ i, ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑i) ∂ν a = ⨆ i, (κ a) (s ×ˢ Iic ↑i)

Tactic:
rw [lintegral_iSup_directed]

Result:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ⨆ b, ∫⁻ (a_1 : β) in s, ((IsCondKernelCDF.toKernel f hf) (a, a_1)) (Iic ↑b) ∂ν a = ⨆ i, (κ a) (s ×ˢ Iic ↑i)

case hf
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ∀ (b : ℚ), AEMeasurable (fun b_1 => ((IsCondKernelCDF.toKernel f hf) (a, b_1)) (Iic ↑b)) ((ν a).restrict s)

case h_directed
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ Directed (fun x1 x2 => x1 ≤ x2) fun i b => ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑i)

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ⨆ b, ∫⁻ (a_1 : β) in s, ((IsCondKernelCDF.toKernel f hf) (a, a_1)) (Iic ↑b) ∂ν a = ⨆ i, (κ a) (s ×ˢ Iic ↑i)

Tactic:
simp_rw [setLIntegral_toKernel_Iic hf _ _ hs]

Result:
no goals

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ∫⁻ (b : β) in s, ((IsCondKernelCDF.toKernel f hf) (a, b)) (⋃ r, Iic ↑r) ∂ν a = (κ a) (⋃ i, s ×ˢ Iic ↑i)

Tactic:
simp_rw [h_dir.measure_iUnion, h_dir_prod.measure_iUnion]

Result:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : Kernel α (β × ℝ)
ν : Kernel α β
f : α × β → StieltjesFunction
inst✝ : IsFiniteKernel κ
hf : IsCondKernelCDF f κ ν
a : α
s : Set β
hs : MeasurableSet s
h_dir : Directed (fun x y => x ⊆ y) fun q => Iic ↑q
h_dir_prod : Directed (fun x y => x ⊆ y) fun q => s ×ˢ Iic ↑q
⊢ ∫⁻ (b : β) in s, ⨆ i, ((IsCondKernelCDF.toKernel f hf) (a, b)) (Iic ↑i) ∂ν a = ⨆ i, (κ a) (s ×ˢ Iic ↑i)