l3lab/ntp-mathlib huggingface dataset:
theorem isSFiniteKernel_sum_of_denumerable [Denumerable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  let e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
  refine' ⟨⟨fun n => seq (κs (e n).1) (e n).2, inferInstance, _⟩⟩
  have hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n)) := by
    simp_rw [kernel_sum_seq]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Denumerable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n))
⊢ kernel.sum κs = kernel.sum fun n => seq (κs (e n).1) (e n).2

Next tactic:
ext a s hs
theorem isSFiniteKernel_sum_of_denumerable [Denumerable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  let e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
  refine' ⟨⟨fun n => seq (κs (e n).1) (e n).2, inferInstance, _⟩⟩
  have hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n)) := by
    simp_rw [kernel_sum_seq]
  ext a s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Denumerable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n))
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑((kernel.sum κs) a) s = ↑↑((kernel.sum fun n => seq (κs (e n).1) (e n).2) a) s

Next tactic:
rw [hκ_eq]
theorem isSFiniteKernel_sum_of_denumerable [Denumerable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  let e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
  refine' ⟨⟨fun n => seq (κs (e n).1) (e n).2, inferInstance, _⟩⟩
  have hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n)) := by
    simp_rw [kernel_sum_seq]
  ext a s hs
  rw [hκ_eq]
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Denumerable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n))
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑((kernel.sum fun n => kernel.sum (seq (κs n))) a) s = ↑↑((kernel.sum fun n => seq (κs (e n).1) (e n).2) a) s

Next tactic:
simp_rw [kernel.sum_apply' _ _ hs]
theorem isSFiniteKernel_sum_of_denumerable [Denumerable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  let e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
  refine' ⟨⟨fun n => seq (κs (e n).1) (e n).2, inferInstance, _⟩⟩
  have hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n)) := by
    simp_rw [kernel_sum_seq]
  ext a s hs
  rw [hκ_eq]
  simp_rw [kernel.sum_apply' _ _ hs]
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Denumerable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n))
a : α
s : Set β
hs : MeasurableSet s
⊢ ∑' (n : ι) (n_1 : ℕ), ↑↑((seq (κs n) n_1) a) s =
    ∑' (n : ℕ), ↑↑((seq (κs ((Denumerable.eqv (ι × ℕ)).symm n).1) ((Denumerable.eqv (ι × ℕ)).symm n).2) a) s

Next tactic:
change (∑' i, ∑' m, seq (κs i) m a s) = ∑' n, (fun im : ι × ℕ => seq (κs im.fst) im.snd a s) (e n)
theorem isSFiniteKernel_sum_of_denumerable [Denumerable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  let e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
  refine' ⟨⟨fun n => seq (κs (e n).1) (e n).2, inferInstance, _⟩⟩
  have hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n)) := by
    simp_rw [kernel_sum_seq]
  ext a s hs
  rw [hκ_eq]
  simp_rw [kernel.sum_apply' _ _ hs]
  change (∑' i, ∑' m, seq (κs i) m a s) = ∑' n, (fun im : ι × ℕ => seq (κs im.fst) im.snd a s) (e n)
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Denumerable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
e : ℕ ≃ ι × ℕ := (Denumerable.eqv (ι × ℕ)).symm
hκ_eq : kernel.sum κs = kernel.sum fun n => kernel.sum (seq (κs n))
a : α
s : Set β
hs : MeasurableSet s
⊢ ∑' (i : ι) (m : ℕ), ↑↑((seq (κs i) m) a) s = ∑' (n : ℕ), (fun im => ↑↑((seq (κs im.1) im.2) a) s) (e n)

Next tactic:
rw [e.tsum_eq (fun im : ι × ℕ => seq (κs im.fst) im.snd a s),
    tsum_prod' ENNReal.summable fun _ => ENNReal.summable]
theorem isSFiniteKernel_sum [Countable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
⊢ IsSFiniteKernel (kernel.sum κs)

Next tactic:
cases fintypeOrInfinite ι
theorem isSFiniteKernel_sum [Countable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  cases fintypeOrInfinite ι
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
val✝ : Fintype ι
⊢ IsSFiniteKernel (kernel.sum κs)

Next tactic:
rw [sum_fintype]
theorem isSFiniteKernel_sum [Countable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  cases fintypeOrInfinite ι
  · rw [sum_fintype]
    

Proof state:
case inl
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
val✝ : Fintype ι
⊢ IsSFiniteKernel (∑ i : ι, κs i)

Next tactic:
exact IsSFiniteKernel.finset_sum Finset.univ fun i _ => hκs i
theorem isSFiniteKernel_sum [Countable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  cases fintypeOrInfinite ι
  · rw [sum_fintype]
    exact IsSFiniteKernel.finset_sum Finset.univ fun i _ => hκs i
  

Proof state:
case inr
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
val✝ : Infinite ι
⊢ IsSFiniteKernel (kernel.sum κs)

Next tactic:
cases nonempty_denumerable ι
theorem isSFiniteKernel_sum [Countable ι] {κs : ι → kernel α β}
    (hκs : ∀ n, IsSFiniteKernel (κs n)) : IsSFiniteKernel (kernel.sum κs) := by
  cases fintypeOrInfinite ι
  · rw [sum_fintype]
    exact IsSFiniteKernel.finset_sum Finset.univ fun i _ => hκs i
  cases nonempty_denumerable ι
  

Proof state:
case inr.intro
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
κs : ι → ↥(kernel α β)
hκs : ∀ (n : ι), IsSFiniteKernel (κs n)
val✝¹ : Infinite ι
val✝ : Denumerable ι
⊢ IsSFiniteKernel (kernel.sum κs)

Next tactic:
exact isSFiniteKernel_sum_of_denumerable hκs
/-- Kernel which to `a` associates the dirac measure at `f a`. This is a Markov kernel. -/
noncomputable def deterministic (f : α → β) (hf : Measurable f) : kernel α β where
  val a := Measure.dirac (f a)
  property := by
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
⊢ (fun a => Measure.dirac (f a)) ∈ kernel α β

Next tactic:
refine' Measure.measurable_of_measurable_coe _ fun s hs => _
/-- Kernel which to `a` associates the dirac measure at `f a`. This is a Markov kernel. -/
noncomputable def deterministic (f : α → β) (hf : Measurable f) : kernel α β where
  val a := Measure.dirac (f a)
  property := by
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
s : Set β
hs : MeasurableSet s
⊢ Measurable fun b => ↑↑(Measure.dirac (f b)) s

Next tactic:
simp_rw [Measure.dirac_apply' _ hs]
/-- Kernel which to `a` associates the dirac measure at `f a`. This is a Markov kernel. -/
noncomputable def deterministic (f : α → β) (hf : Measurable f) : kernel α β where
  val a := Measure.dirac (f a)
  property := by
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    simp_rw [Measure.dirac_apply' _ hs]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
s : Set β
hs : MeasurableSet s
⊢ Measurable fun b => Set.indicator s 1 (f b)

Next tactic:
exact measurable_one.indicator (hf hs)
theorem deterministic_apply' {f : α → β} (hf : Measurable f) (a : α) {s : Set β}
    (hs : MeasurableSet s) : deterministic f hf a s = s.indicator (fun _ => 1) (f a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑((deterministic f hf) a) s = Set.indicator s (fun x => 1) (f a)

Next tactic:
rw [deterministic]
theorem deterministic_apply' {f : α → β} (hf : Measurable f) (a : α) {s : Set β}
    (hs : MeasurableSet s) : deterministic f hf a s = s.indicator (fun _ => 1) (f a) := by
  rw [deterministic]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑({ val := fun a => Measure.dirac (f a), property := (_ : Measurable fun a => Measure.dirac (f a)) } a) s =
    Set.indicator s (fun x => 1) (f a)

Next tactic:
change Measure.dirac (f a) s = s.indicator 1 (f a)
theorem deterministic_apply' {f : α → β} (hf : Measurable f) (a : α) {s : Set β}
    (hs : MeasurableSet s) : deterministic f hf a s = s.indicator (fun _ => 1) (f a) := by
  rw [deterministic]
  change Measure.dirac (f a) s = s.indicator 1 (f a)
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
a : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑(Measure.dirac (f a)) s = Set.indicator s 1 (f a)

Next tactic:
simp_rw [Measure.dirac_apply' _ hs]
instance isMarkovKernel_deterministic {f : α → β} (hf : Measurable f) :
    IsMarkovKernel (deterministic f hf) :=
  ⟨fun a => by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
a : α
⊢ IsProbabilityMeasure ((deterministic f hf) a)

Next tactic:
rw [deterministic_apply hf]
instance isMarkovKernel_deterministic {f : α → β} (hf : Measurable f) :
    IsMarkovKernel (deterministic f hf) :=
  ⟨fun a => by rw [deterministic_apply hf]; 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : α → β
hf : Measurable f
a : α
⊢ IsProbabilityMeasure (Measure.dirac (f a))

Next tactic:
infer_instance
theorem lintegral_deterministic' {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    (hf : Measurable f) : ∫⁻ x, f x ∂kernel.deterministic g hg a = f (g a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
g : α → β
a : α
hg : Measurable g
hf : Measurable f
⊢ ∫⁻ (x : β), f x ∂(deterministic g hg) a = f (g a)

Next tactic:
rw [kernel.deterministic_apply, lintegral_dirac' _ hf]
@[simp]
theorem lintegral_deterministic {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    [MeasurableSingletonClass β] : ∫⁻ x, f x ∂kernel.deterministic g hg a = f (g a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
g : α → β
a : α
hg : Measurable g
inst✝ : MeasurableSingletonClass β
⊢ ∫⁻ (x : β), f x ∂(deterministic g hg) a = f (g a)

Next tactic:
rw [kernel.deterministic_apply, lintegral_dirac (g a) f]
theorem set_lintegral_deterministic' {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    (hf : Measurable f) {s : Set β} (hs : MeasurableSet s) [Decidable (g a ∈ s)] :
    ∫⁻ x in s, f x ∂kernel.deterministic g hg a = if g a ∈ s then f (g a) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
g : α → β
a : α
hg : Measurable g
hf : Measurable f
s : Set β
hs : MeasurableSet s
inst✝ : Decidable (g a ∈ s)
⊢ ∫⁻ (x : β) in s, f x ∂(deterministic g hg) a = if g a ∈ s then f (g a) else 0

Next tactic:
rw [kernel.deterministic_apply, set_lintegral_dirac' hf hs]
@[simp]
theorem set_lintegral_deterministic {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    [MeasurableSingletonClass β] (s : Set β) [Decidable (g a ∈ s)] :
    ∫⁻ x in s, f x ∂kernel.deterministic g hg a = if g a ∈ s then f (g a) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
g : α → β
a : α
hg : Measurable g
inst✝¹ : MeasurableSingletonClass β
s : Set β
inst✝ : Decidable (g a ∈ s)
⊢ ∫⁻ (x : β) in s, f x ∂(deterministic g hg) a = if g a ∈ s then f (g a) else 0

Next tactic:
rw [kernel.deterministic_apply, set_lintegral_dirac f s]
theorem integral_deterministic' {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    (hf : StronglyMeasurable f) : ∫ x, f x ∂kernel.deterministic g hg a = f (g a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
inst✝ : CompleteSpace E
f : β → E
g : α → β
a : α
hg : Measurable g
hf : StronglyMeasurable f
⊢ ∫ (x : β), f x ∂(deterministic g hg) a = f (g a)

Next tactic:
rw [kernel.deterministic_apply, integral_dirac' _ _ hf]
@[simp]
theorem integral_deterministic {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    [MeasurableSingletonClass β] : ∫ x, f x ∂kernel.deterministic g hg a = f (g a) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : β → E
g : α → β
a : α
hg : Measurable g
inst✝ : MeasurableSingletonClass β
⊢ ∫ (x : β), f x ∂(deterministic g hg) a = f (g a)

Next tactic:
rw [kernel.deterministic_apply, integral_dirac _ (g a)]
theorem set_integral_deterministic' {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    (hf : StronglyMeasurable f) {s : Set β} (hs : MeasurableSet s) [Decidable (g a ∈ s)] :
    ∫ x in s, f x ∂kernel.deterministic g hg a = if g a ∈ s then f (g a) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : β → E
g : α → β
a : α
hg : Measurable g
hf : StronglyMeasurable f
s : Set β
hs : MeasurableSet s
inst✝ : Decidable (g a ∈ s)
⊢ ∫ (x : β) in s, f x ∂(deterministic g hg) a = if g a ∈ s then f (g a) else 0

Next tactic:
rw [kernel.deterministic_apply, set_integral_dirac' hf _ hs]
@[simp]
theorem set_integral_deterministic {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    [MeasurableSingletonClass β] (s : Set β) [Decidable (g a ∈ s)] :
    ∫ x in s, f x ∂kernel.deterministic g hg a = if g a ∈ s then f (g a) else 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
f : β → E
g : α → β
a : α
hg : Measurable g
inst✝¹ : MeasurableSingletonClass β
s : Set β
inst✝ : Decidable (g a ∈ s)
⊢ ∫ (x : β) in s, f x ∂(deterministic g hg) a = if g a ∈ s then f (g a) else 0

Next tactic:
rw [kernel.deterministic_apply, set_integral_dirac f _ s]
@[simp]
lemma const_zero : kernel.const α (0 : Measure β) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
⊢ const α 0 = 0

Next tactic:
ext x s _
@[simp]
lemma const_zero : kernel.const α (0 : Measure β) = 0 := by
  ext x s _; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
x : α
s : Set β
a✝ : MeasurableSet s
⊢ ↑↑((const α 0) x) s = ↑↑(0 x) s

Next tactic:
simp [kernel.const_apply]
lemma sum_const [Countable ι] (μ : ι → Measure β) :
    kernel.sum (fun n ↦ const α (μ n)) = const α (Measure.sum μ) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
μ : ι → Measure β
⊢ (kernel.sum fun n => const α (μ n)) = const α (Measure.sum μ)

Next tactic:
ext x s hs
lemma sum_const [Countable ι] (μ : ι → Measure β) :
    kernel.sum (fun n ↦ const α (μ n)) = const α (Measure.sum μ) := by
  ext x s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
μ : ι → Measure β
x : α
s : Set β
hs : MeasurableSet s
⊢ ↑↑((kernel.sum fun n => const α (μ n)) x) s = ↑↑((const α (Measure.sum μ)) x) s

Next tactic:
rw [const_apply, Measure.sum_apply _ hs, kernel.sum_apply' _ _ hs]
lemma sum_const [Countable ι] (μ : ι → Measure β) :
    kernel.sum (fun n ↦ const α (μ n)) = const α (Measure.sum μ) := by
  ext x s hs
  rw [const_apply, Measure.sum_apply _ hs, kernel.sum_apply' _ _ hs]
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
inst✝ : Countable ι
μ : ι → Measure β
x : α
s : Set β
hs : MeasurableSet s
⊢ ∑' (n : ι), ↑↑((const α (μ n)) x) s = ∑' (i : ι), ↑↑(μ i) s

Next tactic:
simp only [const_apply]
instance isSFiniteKernel_const {μβ : Measure β} [SFinite μβ] :
    IsSFiniteKernel (const α μβ) :=
  ⟨fun n ↦ const α (sFiniteSeq μβ n), fun n ↦ inferInstance, by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
μβ : Measure β
inst✝ : SFinite μβ
⊢ const α μβ = kernel.sum fun n => const α (sFiniteSeq μβ n)

Next tactic:
rw [sum_const, sum_sFiniteSeq]
@[simp]
theorem lintegral_const {f : β → ℝ≥0∞} {μ : Measure β} {a : α} :
    ∫⁻ x, f x ∂kernel.const α μ a = ∫⁻ x, f x ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
μ : Measure β
a : α
⊢ ∫⁻ (x : β), f x ∂(const α μ) a = ∫⁻ (x : β), f x ∂μ

Next tactic:
rw [kernel.const_apply]
@[simp]
theorem set_lintegral_const {f : β → ℝ≥0∞} {μ : Measure β} {a : α} {s : Set β} :
    ∫⁻ x in s, f x ∂kernel.const α μ a = ∫⁻ x in s, f x ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
f : β → ℝ≥0∞
μ : Measure β
a : α
s : Set β
⊢ ∫⁻ (x : β) in s, f x ∂(const α μ) a = ∫⁻ (x : β) in s, f x ∂μ

Next tactic:
rw [kernel.const_apply]
@[simp]
theorem integral_const {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f : β → E} {μ : Measure β} {a : α} : ∫ x, f x ∂kernel.const α μ a = ∫ x, f x ∂μ := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : β → E
μ : Measure β
a : α
⊢ ∫ (x : β), f x ∂(const α μ) a = ∫ (x : β), f x ∂μ

Next tactic:
rw [kernel.const_apply]
@[simp]
theorem set_integral_const {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f : β → E} {μ : Measure β} {a : α} {s : Set β} :
    ∫ x in s, f x ∂kernel.const α μ a = ∫ x in s, f x ∂μ := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
E : Type u_4
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
f : β → E
μ : Measure β
a : α
s : Set β
⊢ ∫ (x : β) in s, f x ∂(const α μ) a = ∫ (x : β) in s, f x ∂μ

Next tactic:
rw [kernel.const_apply]
/-- Kernel given by the restriction of the measures in the image of a kernel to a set. -/
protected noncomputable def restrict (κ : kernel α β) (hs : MeasurableSet s) : kernel α β where
  val a := (κ a).restrict s
  property := by
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ✝ : ↥(kernel α β)
s t : Set β
κ : ↥(kernel α β)
hs : MeasurableSet s
⊢ (fun a => Measure.restrict (κ a) s) ∈ kernel α β

Next tactic:
refine' Measure.measurable_of_measurable_coe _ fun t ht => _
/-- Kernel given by the restriction of the measures in the image of a kernel to a set. -/
protected noncomputable def restrict (κ : kernel α β) (hs : MeasurableSet s) : kernel α β where
  val a := (κ a).restrict s
  property := by
    refine' Measure.measurable_of_measurable_coe _ fun t ht => _
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ✝ : ↥(kernel α β)
s t✝ : Set β
κ : ↥(kernel α β)
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
⊢ Measurable fun b => ↑↑(Measure.restrict (κ b) s) t

Next tactic:
simp_rw [Measure.restrict_apply ht]
/-- Kernel given by the restriction of the measures in the image of a kernel to a set. -/
protected noncomputable def restrict (κ : kernel α β) (hs : MeasurableSet s) : kernel α β where
  val a := (κ a).restrict s
  property := by
    refine' Measure.measurable_of_measurable_coe _ fun t ht => _
    simp_rw [Measure.restrict_apply ht]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ✝ : ↥(kernel α β)
s t✝ : Set β
κ : ↥(kernel α β)
hs : MeasurableSet s
t : Set β
ht : MeasurableSet t
⊢ Measurable fun b => ↑↑(κ b) (t ∩ s)

Next tactic:
exact kernel.measurable_coe κ (ht.inter hs)
theorem restrict_apply' (κ : kernel α β) (hs : MeasurableSet s) (a : α) (ht : MeasurableSet t) :
    kernel.restrict κ hs a t = (κ a) (t ∩ s) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ✝ : ↥(kernel α β)
s t : Set β
κ : ↥(kernel α β)
hs : MeasurableSet s
a : α
ht : MeasurableSet t
⊢ ↑↑((kernel.restrict κ hs) a) t = ↑↑(κ a) (t ∩ s)

Next tactic:
rw [restrict_apply κ hs a, Measure.restrict_apply ht]
@[simp]
theorem restrict_univ : kernel.restrict κ MeasurableSet.univ = κ := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
s t : Set β
⊢ kernel.restrict κ (_ : MeasurableSet Set.univ) = κ

Next tactic:
ext1 a
@[simp]
theorem restrict_univ : kernel.restrict κ MeasurableSet.univ = κ := by
  ext1 a
  

Proof state:
case h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ : ↥(kernel α β)
s t : Set β
a : α
⊢ (kernel.restrict κ (_ : MeasurableSet Set.univ)) a = κ a

Next tactic:
rw [kernel.restrict_apply, Measure.restrict_univ]
@[simp]
theorem lintegral_restrict (κ : kernel α β) (hs : MeasurableSet s) (a : α) (f : β → ℝ≥0∞) :
    ∫⁻ b, f b ∂kernel.restrict κ hs a = ∫⁻ b in s, f b ∂κ a := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
κ✝ : ↥(kernel α β)
s t : Set β
κ : ↥(kernel α β)
hs : MeasurableSet s
a : α
f : β → ℝ≥0∞
⊢ ∫⁻ (b : β), f b ∂(kernel.restrict κ hs) a = ∫⁻ (b : β) in s, f b ∂κ a

Next tactic:
rw [restrict_apply]