l3lab/ntp-mathlib huggingface dataset:
lemma compProd_apply [SFinite μ] [IsSFiniteKernel κ] {s : Set (α × β)} (hs : MeasurableSet s) :
    (μ ⊗ₘ κ) s = ∫⁻ a, κ a (Prod.mk a ⁻¹' s) ∂μ := by
  simp_rw [compProd, kernel.compProd_apply _ _ _ hs, kernel.const_apply, kernel.prodMkLeft_apply']
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : SFinite μ
inst✝ : IsSFiniteKernel κ
s : Set (α × β)
hs : MeasurableSet s
⊢ ∫⁻ (b : α), ↑↑(κ b) {c | (b, c) ∈ s} ∂μ = ∫⁻ (a : α), ↑↑(κ a) (Prod.mk a ⁻¹' s) ∂μ

Next tactic:
rfl
lemma compProd_congr [SFinite μ] [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (h : κ =ᵐ[μ] η) : μ ⊗ₘ κ = μ ⊗ₘ η := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
inst✝ : IsSFiniteKernel η
h : ⇑κ =ᶠ[ae μ] ⇑η
⊢ μ ⊗ₘ κ = μ ⊗ₘ η

Next tactic:
ext s hs
lemma compProd_congr [SFinite μ] [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (h : κ =ᵐ[μ] η) : μ ⊗ₘ κ = μ ⊗ₘ η := by
  ext s hs
  

Proof state:
case h
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
inst✝ : IsSFiniteKernel η
h : ⇑κ =ᶠ[ae μ] ⇑η
s : Set (α × β)
hs : MeasurableSet s
⊢ ↑↑(μ ⊗ₘ κ) s = ↑↑(μ ⊗ₘ η) s

Next tactic:
have : (fun a ↦ κ a (Prod.mk a ⁻¹' s)) =ᵐ[μ] fun a ↦ η a (Prod.mk a ⁻¹' s) := by
    filter_upwards [h] with a ha using by rw [ha]
lemma compProd_congr [SFinite μ] [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (h : κ =ᵐ[μ] η) : μ ⊗ₘ κ = μ ⊗ₘ η := by
  ext s hs
  have : (fun a ↦ κ a (Prod.mk a ⁻¹' s)) =ᵐ[μ] fun a ↦ η a (Prod.mk a ⁻¹' s) := by
    

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
inst✝ : IsSFiniteKernel η
h : ⇑κ =ᶠ[ae μ] ⇑η
s : Set (α × β)
hs : MeasurableSet s
⊢ (fun a => ↑↑(κ a) (Prod.mk a ⁻¹' s)) =ᶠ[ae μ] fun a => ↑↑(η a) (Prod.mk a ⁻¹' s)

Next tactic:
filter_upwards [h] with a ha using by rw [ha]
lemma compProd_congr [SFinite μ] [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (h : κ =ᵐ[μ] η) : μ ⊗ₘ κ = μ ⊗ₘ η := by
  ext s hs
  have : (fun a ↦ κ a (Prod.mk a ⁻¹' s)) =ᵐ[μ] fun a ↦ η a (Prod.mk a ⁻¹' s) := by
    filter_upwards [h] with a ha using by 

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
inst✝ : IsSFiniteKernel η
h : ⇑κ =ᶠ[ae μ] ⇑η
s : Set (α × β)
hs : MeasurableSet s
a : α
ha : κ a = η a
⊢ ↑↑(κ a) (Prod.mk a ⁻¹' s) = ↑↑(η a) (Prod.mk a ⁻¹' s)

Next tactic:
rw [ha]
lemma compProd_congr [SFinite μ] [IsSFiniteKernel κ] [IsSFiniteKernel η]
    (h : κ =ᵐ[μ] η) : μ ⊗ₘ κ = μ ⊗ₘ η := by
  ext s hs
  have : (fun a ↦ κ a (Prod.mk a ⁻¹' s)) =ᵐ[μ] fun a ↦ η a (Prod.mk a ⁻¹' s) := by
    filter_upwards [h] with a ha using by rw [ha]
  

Proof state:
case h
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
inst✝ : IsSFiniteKernel η
h : ⇑κ =ᶠ[ae μ] ⇑η
s : Set (α × β)
hs : MeasurableSet s
this : (fun a => ↑↑(κ a) (Prod.mk a ⁻¹' s)) =ᶠ[ae μ] fun a => ↑↑(η a) (Prod.mk a ⁻¹' s)
⊢ ↑↑(μ ⊗ₘ κ) s = ↑↑(μ ⊗ₘ η) s

Next tactic:
rw [compProd_apply hs, lintegral_congr_ae this, compProd_apply hs]
lemma lintegral_compProd [SFinite μ] [IsSFiniteKernel κ]
    {f : α × β → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ x, f x ∂(μ ⊗ₘ κ) = ∫⁻ a, ∫⁻ b, f (a, b) ∂(κ a) ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : SFinite μ
inst✝ : IsSFiniteKernel κ
f : α × β → ℝ≥0∞
hf : Measurable f
⊢ ∫⁻ (x : α × β), f x ∂μ ⊗ₘ κ = ∫⁻ (a : α), ∫⁻ (b : β), f (a, b) ∂κ a ∂μ

Next tactic:
rw [compProd, kernel.lintegral_compProd _ _ _ hf]
lemma lintegral_compProd [SFinite μ] [IsSFiniteKernel κ]
    {f : α × β → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ x, f x ∂(μ ⊗ₘ κ) = ∫⁻ a, ∫⁻ b, f (a, b) ∂(κ a) ∂μ := by
  rw [compProd, kernel.lintegral_compProd _ _ _ hf]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : SFinite μ
inst✝ : IsSFiniteKernel κ
f : α × β → ℝ≥0∞
hf : Measurable f
⊢ ∫⁻ (b : α), ∫⁻ (c : β), f (b, c) ∂(kernel.prodMkLeft Unit κ) ((), b) ∂(kernel.const Unit μ) () =
    ∫⁻ (a : α), ∫⁻ (b : β), f (a, b) ∂κ a ∂μ

Next tactic:
simp
lemma set_lintegral_compProd [SFinite μ] [IsSFiniteKernel κ]
    {f : α × β → ℝ≥0∞} (hf : Measurable f)
    {s : Set α} (hs : MeasurableSet s) {t : Set β} (ht : MeasurableSet t) :
    ∫⁻ x in s ×ˢ t, f x ∂(μ ⊗ₘ κ) = ∫⁻ a in s, ∫⁻ b in t, f (a, b) ∂(κ a) ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : SFinite μ
inst✝ : IsSFiniteKernel κ
f : α × β → ℝ≥0∞
hf : Measurable f
s : Set α
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
⊢ ∫⁻ (x : α × β) in s ×ˢ t, f x ∂μ ⊗ₘ κ = ∫⁻ (a : α) in s, ∫⁻ (b : β) in t, f (a, b) ∂κ a ∂μ

Next tactic:
rw [compProd, kernel.set_lintegral_compProd _ _ _ hf hs ht]
lemma set_lintegral_compProd [SFinite μ] [IsSFiniteKernel κ]
    {f : α × β → ℝ≥0∞} (hf : Measurable f)
    {s : Set α} (hs : MeasurableSet s) {t : Set β} (ht : MeasurableSet t) :
    ∫⁻ x in s ×ˢ t, f x ∂(μ ⊗ₘ κ) = ∫⁻ a in s, ∫⁻ b in t, f (a, b) ∂(κ a) ∂μ := by
  rw [compProd, kernel.set_lintegral_compProd _ _ _ hf hs ht]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : SFinite μ
inst✝ : IsSFiniteKernel κ
f : α × β → ℝ≥0∞
hf : Measurable f
s : Set α
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
⊢ ∫⁻ (x : α) in s, ∫⁻ (y : β) in t, f (x, y) ∂(kernel.prodMkLeft Unit κ) ((), x) ∂(kernel.const Unit μ) () =
    ∫⁻ (a : α) in s, ∫⁻ (b : β) in t, f (a, b) ∂κ a ∂μ

Next tactic:
simp
lemma integrable_compProd_iff [SFinite μ] [IsSFiniteKernel κ] {E : Type*} [NormedAddCommGroup E]
    {f : α × β → E} (hf : AEStronglyMeasurable f (μ ⊗ₘ κ)) :
    Integrable f (μ ⊗ₘ κ) ↔
      (∀ᵐ x ∂μ, Integrable (fun y => f (x, y)) (κ x)) ∧
        Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂(κ x)) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
E : Type u_3
inst✝ : NormedAddCommGroup E
f : α × β → E
hf : AEStronglyMeasurable f (μ ⊗ₘ κ)
⊢ Integrable f ↔ (∀ᵐ (x : α) ∂μ, Integrable fun y => f (x, y)) ∧ Integrable fun x => ∫ (y : β), ‖f (x, y)‖ ∂κ x

Next tactic:
rw [Measure.compProd, ProbabilityTheory.integrable_compProd_iff hf]
lemma integrable_compProd_iff [SFinite μ] [IsSFiniteKernel κ] {E : Type*} [NormedAddCommGroup E]
    {f : α × β → E} (hf : AEStronglyMeasurable f (μ ⊗ₘ κ)) :
    Integrable f (μ ⊗ₘ κ) ↔
      (∀ᵐ x ∂μ, Integrable (fun y => f (x, y)) (κ x)) ∧
        Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂(κ x)) μ := by
  rw [Measure.compProd, ProbabilityTheory.integrable_compProd_iff hf]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝² : SFinite μ
inst✝¹ : IsSFiniteKernel κ
E : Type u_3
inst✝ : NormedAddCommGroup E
f : α × β → E
hf : AEStronglyMeasurable f (μ ⊗ₘ κ)
⊢ ((∀ᵐ (x : α) ∂(kernel.const Unit μ) (), Integrable fun y => f (x, y)) ∧
      Integrable fun x => ∫ (y : β), ‖f (x, y)‖ ∂(kernel.prodMkLeft Unit κ) ((), x)) ↔
    (∀ᵐ (x : α) ∂μ, Integrable fun y => f (x, y)) ∧ Integrable fun x => ∫ (y : β), ‖f (x, y)‖ ∂κ x

Next tactic:
rfl
lemma integral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
    {f : α × β → E} (hf : Integrable f (μ ⊗ₘ κ)) :
    ∫ x, f x ∂(μ ⊗ₘ κ) = ∫ a, ∫ b, f (a, b) ∂(κ a) ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝⁴ : SFinite μ
inst✝³ : IsSFiniteKernel κ
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : α × β → E
hf : Integrable f
⊢ ∫ (x : α × β), f x ∂μ ⊗ₘ κ = ∫ (a : α), ∫ (b : β), f (a, b) ∂κ a ∂μ

Next tactic:
rw [compProd, ProbabilityTheory.integral_compProd hf]
lemma integral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
    {f : α × β → E} (hf : Integrable f (μ ⊗ₘ κ)) :
    ∫ x, f x ∂(μ ⊗ₘ κ) = ∫ a, ∫ b, f (a, b) ∂(κ a) ∂μ := by
  rw [compProd, ProbabilityTheory.integral_compProd hf]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝⁴ : SFinite μ
inst✝³ : IsSFiniteKernel κ
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : α × β → E
hf : Integrable f
⊢ ∫ (x : α), ∫ (y : β), f (x, y) ∂(kernel.prodMkLeft Unit κ) ((), x) ∂(kernel.const Unit μ) () =
    ∫ (a : α), ∫ (b : β), f (a, b) ∂κ a ∂μ

Next tactic:
simp
lemma set_integral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
    {s : Set α} (hs : MeasurableSet s) {t : Set β} (ht : MeasurableSet t)
    {f : α × β → E} (hf : IntegrableOn f (s ×ˢ t) (μ ⊗ₘ κ))  :
    ∫ x in s ×ˢ t, f x ∂(μ ⊗ₘ κ) = ∫ a in s, ∫ b in t, f (a, b) ∂(κ a) ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝⁴ : SFinite μ
inst✝³ : IsSFiniteKernel κ
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
s : Set α
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
f : α × β → E
hf : IntegrableOn f (s ×ˢ t)
⊢ ∫ (x : α × β) in s ×ˢ t, f x ∂μ ⊗ₘ κ = ∫ (a : α) in s, ∫ (b : β) in t, f (a, b) ∂κ a ∂μ

Next tactic:
rw [compProd, ProbabilityTheory.set_integral_compProd hs ht hf]
lemma set_integral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
    {s : Set α} (hs : MeasurableSet s) {t : Set β} (ht : MeasurableSet t)
    {f : α × β → E} (hf : IntegrableOn f (s ×ˢ t) (μ ⊗ₘ κ))  :
    ∫ x in s ×ˢ t, f x ∂(μ ⊗ₘ κ) = ∫ a in s, ∫ b in t, f (a, b) ∂(κ a) ∂μ := by
  rw [compProd, ProbabilityTheory.set_integral_compProd hs ht hf]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝⁴ : SFinite μ
inst✝³ : IsSFiniteKernel κ
E : Type u_3
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
s : Set α
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
f : α × β → E
hf : IntegrableOn f (s ×ˢ t)
⊢ ∫ (x : α) in s, ∫ (y : β) in t, f (x, y) ∂(kernel.prodMkLeft Unit κ) ((), x) ∂(kernel.const Unit μ) () =
    ∫ (a : α) in s, ∫ (b : β) in t, f (a, b) ∂κ a ∂μ

Next tactic:
simp
lemma dirac_compProd_apply [MeasurableSingletonClass α] {a : α} [IsSFiniteKernel κ]
    {s : Set (α × β)} (hs : MeasurableSet s) :
    (Measure.dirac a ⊗ₘ κ) s = κ a (Prod.mk a ⁻¹' s) := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : MeasurableSingletonClass α
a : α
inst✝ : IsSFiniteKernel κ
s : Set (α × β)
hs : MeasurableSet s
⊢ ↑↑(dirac a ⊗ₘ κ) s = ↑↑(κ a) (Prod.mk a ⁻¹' s)

Next tactic:
rw [compProd_apply hs, lintegral_dirac]
lemma dirac_unit_compProd (κ : kernel Unit β) [IsSFiniteKernel κ] :
    Measure.dirac () ⊗ₘ κ = (κ ()).map (Prod.mk ()) := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ✝ η : ↥(kernel α β)
κ : ↥(kernel Unit β)
inst✝ : IsSFiniteKernel κ
⊢ dirac () ⊗ₘ κ = map (Prod.mk ()) (κ ())

Next tactic:
ext s hs
lemma dirac_unit_compProd (κ : kernel Unit β) [IsSFiniteKernel κ] :
    Measure.dirac () ⊗ₘ κ = (κ ()).map (Prod.mk ()) := by
  ext s hs; 

Proof state:
case h
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ✝ η : ↥(kernel α β)
κ : ↥(kernel Unit β)
inst✝ : IsSFiniteKernel κ
s : Set (Unit × β)
hs : MeasurableSet s
⊢ ↑↑(dirac () ⊗ₘ κ) s = ↑↑(map (Prod.mk ()) (κ ())) s

Next tactic:
rw [dirac_compProd_apply hs, Measure.map_apply measurable_prod_mk_left hs]
lemma dirac_unit_compProd_const (μ : Measure β) [IsFiniteMeasure μ] :
    Measure.dirac () ⊗ₘ kernel.const Unit μ = μ.map (Prod.mk ()) := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ✝ : Measure α
κ η : ↥(kernel α β)
μ : Measure β
inst✝ : IsFiniteMeasure μ
⊢ dirac () ⊗ₘ kernel.const Unit μ = map (Prod.mk ()) μ

Next tactic:
rw [dirac_unit_compProd, kernel.const_apply]
@[simp]
lemma snd_dirac_unit_compProd_const (μ : Measure β) [IsFiniteMeasure μ] :
    snd (Measure.dirac () ⊗ₘ kernel.const Unit μ) = μ := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ✝ : Measure α
κ η : ↥(kernel α β)
μ : Measure β
inst✝ : IsFiniteMeasure μ
⊢ snd (dirac () ⊗ₘ kernel.const Unit μ) = μ

Next tactic:
rw [dirac_unit_compProd_const, snd, map_map measurable_snd measurable_prod_mk_left]
@[simp]
lemma snd_dirac_unit_compProd_const (μ : Measure β) [IsFiniteMeasure μ] :
    snd (Measure.dirac () ⊗ₘ kernel.const Unit μ) = μ := by
  rw [dirac_unit_compProd_const, snd, map_map measurable_snd measurable_prod_mk_left]
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ✝ : Measure α
κ η : ↥(kernel α β)
μ : Measure β
inst✝ : IsFiniteMeasure μ
⊢ map (Prod.snd ∘ Prod.mk ()) μ = μ

Next tactic:
simp
instance : SFinite (μ ⊗ₘ κ) := by 

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
⊢ SFinite (μ ⊗ₘ κ)

Next tactic:
rw [compProd]
instance : SFinite (μ ⊗ₘ κ) := by rw [compProd]; 

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
⊢ SFinite ((kernel.const Unit μ ⊗ₖ kernel.prodMkLeft Unit κ) ())

Next tactic:
infer_instance
instance [IsFiniteMeasure μ] [IsFiniteKernel κ] : IsFiniteMeasure (μ ⊗ₘ κ) := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteKernel κ
⊢ IsFiniteMeasure (μ ⊗ₘ κ)

Next tactic:
rw [compProd]
instance [IsFiniteMeasure μ] [IsFiniteKernel κ] : IsFiniteMeasure (μ ⊗ₘ κ) := by
  rw [compProd]; 

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteKernel κ
⊢ IsFiniteMeasure ((kernel.const Unit μ ⊗ₖ kernel.prodMkLeft Unit κ) ())

Next tactic:
infer_instance
instance [IsProbabilityMeasure μ] [IsMarkovKernel κ] : IsProbabilityMeasure (μ ⊗ₘ κ) := by
  

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : IsProbabilityMeasure μ
inst✝ : IsMarkovKernel κ
⊢ IsProbabilityMeasure (μ ⊗ₘ κ)

Next tactic:
rw [compProd]
instance [IsProbabilityMeasure μ] [IsMarkovKernel κ] : IsProbabilityMeasure (μ ⊗ₘ κ) := by
  rw [compProd]; 

Proof state:
α : Type u_1
β : Type u_2
mα : MeasurableSpace α
mβ : MeasurableSpace β
μ : Measure α
κ η : ↥(kernel α β)
inst✝¹ : IsProbabilityMeasure μ
inst✝ : IsMarkovKernel κ
⊢ IsProbabilityMeasure ((kernel.const Unit μ ⊗ₖ kernel.prodMkLeft Unit κ) ())

Next tactic:
infer_instance
theorem isGenericPoint_iff_specializes : IsGenericPoint x S ↔ ∀ y, x ⤳ y ↔ y ∈ S := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
⊢ IsGenericPoint x S ↔ ∀ (y : α), x ⤳ y ↔ y ∈ S

Next tactic:
simp only [specializes_iff_mem_closure, IsGenericPoint, Set.ext_iff]
theorem disjoint_iff (h : IsGenericPoint x S) (hU : IsOpen U) : Disjoint S U ↔ x ∉ U := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
h : IsGenericPoint x S
hU : IsOpen U
⊢ Disjoint S U ↔ x ∉ U

Next tactic:
rw [h.mem_open_set_iff hU, ← not_disjoint_iff_nonempty_inter, Classical.not_not]
theorem mem_closed_set_iff (h : IsGenericPoint x S) (hZ : IsClosed Z) : x ∈ Z ↔ S ⊆ Z := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
h : IsGenericPoint x S
hZ : IsClosed Z
⊢ x ∈ Z ↔ S ⊆ Z

Next tactic:
rw [← h.def, hZ.closure_subset_iff, singleton_subset_iff]
protected theorem image (h : IsGenericPoint x S) {f : α → β} (hf : Continuous f) :
    IsGenericPoint (f x) (closure (f '' S)) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
h : IsGenericPoint x S
f : α → β
hf : Continuous f
⊢ IsGenericPoint (f x) (closure (f '' S))

Next tactic:
rw [isGenericPoint_def, ← h.def, ← image_singleton, closure_image_closure hf]
theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x ∈ S) :
    IsGenericPoint x S ↔ ∀ Z : Set α, IsClosed Z → x ∈ Z → S ⊆ Z := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
hS : IsClosed S
hxS : x ∈ S
⊢ IsGenericPoint x S ↔ ∀ (Z : Set α), IsClosed Z → x ∈ Z → S ⊆ Z

Next tactic:
have : closure {x} ⊆ S := closure_minimal (singleton_subset_iff.2 hxS) hS
theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x ∈ S) :
    IsGenericPoint x S ↔ ∀ Z : Set α, IsClosed Z → x ∈ Z → S ⊆ Z := by
  have : closure {x} ⊆ S := closure_minimal (singleton_subset_iff.2 hxS) hS
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
x y : α
S U Z : Set α
hS : IsClosed S
hxS : x ∈ S
this : closure {x} ⊆ S
⊢ IsGenericPoint x S ↔ ∀ (Z : Set α), IsClosed Z → x ∈ Z → S ⊆ Z

Next tactic:
simp_rw [IsGenericPoint, subset_antisymm_iff, this, true_and_iff, closure, subset_sInter_iff,
    mem_setOf_eq, and_imp, singleton_subset_iff]
theorem genericPoint_spec [QuasiSober α] [IrreducibleSpace α] :
    IsGenericPoint (genericPoint α) ⊤ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : QuasiSober α
inst✝ : IrreducibleSpace α
⊢ IsGenericPoint (genericPoint α) ⊤

Next tactic:
simpa using (IrreducibleSpace.isIrreducible_univ α).genericPoint_spec
theorem genericPoint_specializes [QuasiSober α] [IrreducibleSpace α] (x : α) : genericPoint α ⤳ x :=
  (IsIrreducible.genericPoint_spec _).specializes (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : QuasiSober α
inst✝ : IrreducibleSpace α
x : α
⊢ x ∈ closure univ

Next tactic:
simp
/-- The closed irreducible subsets of a sober space bijects with the points of the space. -/
noncomputable def irreducibleSetEquivPoints [QuasiSober α] [T0Space α] :
    { s : Set α | IsIrreducible s ∧ IsClosed s } ≃o α where
  toFun s := s.prop.1.genericPoint
  invFun x := ⟨closure ({x} : Set α), isIrreducible_singleton.closure, isClosed_closure⟩
  left_inv s := Subtype.eq <| Eq.trans s.prop.1.genericPoint_spec <|
    closure_eq_iff_isClosed.mpr s.2.2
  right_inv x := isIrreducible_singleton.closure.genericPoint_spec.eq
      (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : QuasiSober α
inst✝ : T0Space α
x : α
⊢ IsGenericPoint x (closure (closure {x}))

Next tactic:
rw [closure_closure]
/-- The closed irreducible subsets of a sober space bijects with the points of the space. -/
noncomputable def irreducibleSetEquivPoints [QuasiSober α] [T0Space α] :
    { s : Set α | IsIrreducible s ∧ IsClosed s } ≃o α where
  toFun s := s.prop.1.genericPoint
  invFun x := ⟨closure ({x} : Set α), isIrreducible_singleton.closure, isClosed_closure⟩
  left_inv s := Subtype.eq <| Eq.trans s.prop.1.genericPoint_spec <|
    closure_eq_iff_isClosed.mpr s.2.2
  right_inv x := isIrreducible_singleton.closure.genericPoint_spec.eq
      (by rw [closure_closure]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : QuasiSober α
inst✝ : T0Space α
x : α
⊢ IsGenericPoint x (closure {x})

Next tactic:
exact isGenericPoint_closure
/-- The closed irreducible subsets of a sober space bijects with the points of the space. -/
noncomputable def irreducibleSetEquivPoints [QuasiSober α] [T0Space α] :
    { s : Set α | IsIrreducible s ∧ IsClosed s } ≃o α where
  toFun s := s.prop.1.genericPoint
  invFun x := ⟨closure ({x} : Set α), isIrreducible_singleton.closure, isClosed_closure⟩
  left_inv s := Subtype.eq <| Eq.trans s.prop.1.genericPoint_spec <|
    closure_eq_iff_isClosed.mpr s.2.2
  right_inv x := isIrreducible_singleton.closure.genericPoint_spec.eq
      (by rw [closure_closure]; exact isGenericPoint_closure)
  map_rel_iff' := by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
inst✝¹ : QuasiSober α
inst✝ : T0Space α
⊢ ∀ {a b : ↑{s | IsIrreducible s ∧ IsClosed s}},
    { toFun := fun s => IsIrreducible.genericPoint (_ : IsIrreducible ↑s),
            invFun := fun x =>
              { val := closure {x}, property := (_ : IsIrreducible (closure {x}) ∧ IsClosed (closure {x})) },
            left_inv :=
              (_ :
                ∀ (s : ↑{s | IsIrreducible s ∧ IsClosed s}),
                  (fun x =>
                        { val := closure {x}, property := (_ : IsIrreducible (closure {x}) ∧ IsClosed (closure {x})) })
                      ((fun s => IsIrreducible.genericPoint (_ : IsIrreducible ↑s)) s) =
                    s),
            right_inv := (_ : ∀ (x : α), IsIrreducible.genericPoint (_ : IsIrreducible (closure {x})) = x) }
          a ≤
        { toFun := fun s => IsIrreducible.genericPoint (_ : IsIrreducible ↑s),
            invFun := fun x =>
              { val := closure {x}, property := (_ : IsIrreducible (closure {x}) ∧ IsClosed (closure {x})) },
            left_inv :=
              (_ :
                ∀ (s : ↑{s | IsIrreducible s ∧ IsClosed s}),
                  (fun x =>
                        { val := closure {x}, property := (_ : IsIrreducible (closure {x}) ∧ IsClosed (closure {x})) })
                      ((fun s => IsIrreducible.genericPoint (_ : IsIrreducible ↑s)) s) =
                    s),
            right_inv := (_ : ∀ (x : α), IsIrreducible.genericPoint (_ : IsIrreducible (closure {x})) = x) }
          b ↔
      a ≤ b

Next tactic:
rintro ⟨s, hs⟩ ⟨t, ht⟩