Theorem: ProbabilityTheory.kernel.measurable_rnDerivAux
File: Mathlib/Probability/Kernel/RadonNikodym.lean

tactic: simp_rw [rnDerivAux]
state_before: α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
⊢ Measurable fun p => rnDerivAux κ η p.1 p.2
state_after: α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
⊢ Measurable fun p =>
    if hα : Countable α then ((∂κ p.1/∂η p.1) p.2).toReal else density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ

tactic: split_ifs with hα
state_before: α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
⊢ Measurable fun p =>
    if hα : Countable α then ((∂κ p.1/∂η p.1) p.2).toReal else density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ
state_after: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable fun p => ((∂κ p.1/∂η p.1) p.2).toReal

case neg
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : ¬Countable α
⊢ Measurable fun p => density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ

tactic: refine Measurable.ennreal_toReal ?_
state_before: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable fun p => ((∂κ p.1/∂η p.1) p.2).toReal
state_after: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable fun p => (∂κ p.1/∂η p.1) p.2

tactic: change Measurable ((fun q : γ × α ↦ (κ q.2).rnDeriv (η q.2) q.1) ∘ Prod.swap)
state_before: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable fun p => (∂κ p.1/∂η p.1) p.2
state_after: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable ((fun q => (∂κ q.2/∂η q.2) q.1) ∘ Prod.swap)

tactic: refine (measurable_from_prod_countable' (fun a ↦ ?_) ?_).comp measurable_swap
state_before: case pos
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ Measurable ((fun q => (∂κ q.2/∂η q.2) q.1) ∘ Prod.swap)
state_after: case pos.refine_1
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a : α
⊢ Measurable fun x => (∂κ (x, a).2/∂η (x, a).2) (x, a).1

case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ ∀ (y y' : α) (x : γ),
    y' ∈ measurableAtom y → (∂κ (x, y').2/∂η (x, y').2) (x, y').1 = (∂κ (x, y).2/∂η (x, y).2) (x, y).1

tactic: exact Measure.measurable_rnDeriv (κ a) (η a)
state_before: case pos.refine_1
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a : α
⊢ Measurable fun x => (∂κ (x, a).2/∂η (x, a).2) (x, a).1
state_after: no goals

tactic: intro a a' c ha'_mem_a
state_before: case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
⊢ ∀ (y y' : α) (x : γ),
    y' ∈ measurableAtom y → (∂κ (x, y').2/∂η (x, y').2) (x, y').1 = (∂κ (x, y).2/∂η (x, y).2) (x, y).1
state_after: case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
⊢ (∂κ (c, a').2/∂η (c, a').2) (c, a').1 = (∂κ (c, a).2/∂η (c, a).2) (c, a).1

tactic: have h_eq : ∀ κ : kernel α γ, κ a' = κ a := fun κ ↦ by
  ext s hs
  exact mem_of_mem_measurableAtom ha'_mem_a
    (kernel.measurable_coe κ hs (measurableSet_singleton (κ a s))) rfl
state_before: case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
⊢ (∂κ (c, a').2/∂η (c, a').2) (c, a').1 = (∂κ (c, a).2/∂η (c, a).2) (c, a).1
state_after: case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
h_eq : ∀ (κ : ↥(kernel α γ)), κ a' = κ a
⊢ (∂κ (c, a').2/∂η (c, a').2) (c, a').1 = (∂κ (c, a).2/∂η (c, a).2) (c, a).1

tactic: rw [h_eq κ, h_eq η]
state_before: case pos.refine_2
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
h_eq : ∀ (κ : ↥(kernel α γ)), κ a' = κ a
⊢ (∂κ (c, a').2/∂η (c, a').2) (c, a').1 = (∂κ (c, a).2/∂η (c, a).2) (c, a).1
state_after: no goals

tactic: ext s hs
state_before: α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝¹ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ✝ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
κ : ↥(kernel α γ)
⊢ κ a' = κ a
state_after: case h
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝¹ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ✝ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
κ : ↥(kernel α γ)
s : Set γ
hs : MeasurableSet s
⊢ (κ a') s = (κ a) s

tactic: exact mem_of_mem_measurableAtom ha'_mem_a
  (kernel.measurable_coe κ hs (measurableSet_singleton (κ a s))) rfl
state_before: case h
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝¹ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ✝ η : ↥(kernel α γ)
hα : Countable α
a a' : α
c : γ
ha'_mem_a : a' ∈ measurableAtom a
κ : ↥(kernel α γ)
s : Set γ
hs : MeasurableSet s
⊢ (κ a') s = (κ a) s
state_after: no goals

tactic: have := hαγ.countableOrCountablyGenerated.resolve_left hα
state_before: case neg
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : ¬Countable α
⊢ Measurable fun p => density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ
state_after: case neg
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : ¬Countable α
this : MeasurableSpace.CountablyGenerated γ
⊢ Measurable fun p => density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ

tactic: exact measurable_density _ η MeasurableSet.univ
state_before: case neg
α : Type u_1
γ : Type u_2
mα : MeasurableSpace α
mγ : MeasurableSpace γ
κ✝ η✝ : ↥(kernel α γ)
hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ
κ η : ↥(kernel α γ)
hα : ¬Countable α
this : MeasurableSpace.CountablyGenerated γ
⊢ Measurable fun p => density (map κ (fun a => (a, ())) ⋯) η p.1 p.2 univ
state_after: no goals