Theorem: ProbabilityTheory.kernel.setIntegral_density_of_measurableSet
File: Mathlib/Probability/Kernel/Disintegration/Density.lean

tactic: suffices ∫ x in A, density κ ν a x s ∂(ν a) = ∫ x in A, densityProcess κ ν n a x s ∂(ν a) by
  exact this ▸ setIntegral_densityProcess hκν _ _ hs hA
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = ((κ a) (A ×ˢ s)).toReal
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a

tactic: suffices ∫ x in A, density κ ν a x s ∂(ν a)
    = limsup (fun i ↦ ∫ x in A, densityProcess κ ν i a x s ∂(ν a)) atTop by
  rw [this, ← limsup_const (α := ℕ) (f := atTop) (∫ x in A, densityProcess κ ν n a x s ∂(ν a)),
    limsup_congr]
  simp only [eventually_atTop]
  refine ⟨n, fun m hnm ↦ ?_⟩
  rw [setIntegral_densityProcess_of_le hκν hnm _ hs hA,
    setIntegral_densityProcess hκν _ _ hs hA]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop

tactic: have h := tendsto_setIntegral_densityProcess hκν a hs A
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
h :
  Tendsto (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop (𝓝 (∫ (x : γ) in A, density κ ν a x s ∂ν a))
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop

tactic: rw [h.limsup_eq]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
h :
  Tendsto (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop (𝓝 (∫ (x : γ) in A, density κ ν a x s ∂ν a))
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
state_after: no goals

tactic: exact this ▸ setIntegral_densityProcess hκν _ _ hs hA
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = ((κ a) (A ×ˢ s)).toReal
state_after: no goals

tactic: rw [this, ← limsup_const (α := ℕ) (f := atTop) (∫ x in A, densityProcess κ ν n a x s ∂(ν a)),
  limsup_congr]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
⊢ ∫ (x : γ) in A, density κ ν a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
⊢ ∀ᶠ (a_1 : ℕ) in atTop,
    ∫ (x : γ) in A, densityProcess κ ν a_1 a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a

tactic: simp only [eventually_atTop]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
⊢ ∀ᶠ (a_1 : ℕ) in atTop,
    ∫ (x : γ) in A, densityProcess κ ν a_1 a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
⊢ ∃ a_1, ∀ b ≥ a_1, ∫ (x : γ) in A, densityProcess κ ν b a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a

tactic: refine ⟨n, fun m hnm ↦ ?_⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
⊢ ∃ a_1, ∀ b ≥ a_1, ∫ (x : γ) in A, densityProcess κ ν b a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
m : ℕ
hnm : m ≥ n
⊢ ∫ (x : γ) in A, densityProcess κ ν m a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a

tactic: rw [setIntegral_densityProcess_of_le hκν hnm _ hs hA,
  setIntegral_densityProcess hκν _ _ hs hA]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
inst✝¹ : CountablyGenerated γ
κ : ↥(kernel α (γ × β))
ν : ↥(kernel α γ)
hκν : fst κ ≤ ν
inst✝ : IsFiniteKernel ν
n : ℕ
a : α
s : Set β
hs : MeasurableSet s
A : Set γ
hA : MeasurableSet A
this : ∫ (x : γ) in A, density κ ν a x s ∂ν a = limsup (fun i => ∫ (x : γ) in A, densityProcess κ ν i a x s ∂ν a) atTop
m : ℕ
hnm : m ≥ n
⊢ ∫ (x : γ) in A, densityProcess κ ν m a x s ∂ν a = ∫ (x : γ) in A, densityProcess κ ν n a x s ∂ν a
state_after: no goals