l3lab/ntp-mathlib huggingface dataset:
set_option autoImplicit true in
theorem mono (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') : AEStronglyMeasurable' m' f μ := by
  obtain ⟨f', hf'_meas, hff'⟩ := hf; 

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝ : TopologicalSpace β
f g : α → β
m' : MeasurableSpace α
hm : m ≤ m'
f' : α → β
hf'_meas : StronglyMeasurable f'
hff' : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m' f μ

Next tactic:
exact ⟨f', hf'_meas.mono hm, hff'⟩
theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ)
    (hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : Add β
inst✝ : ContinuousAdd β
hf : AEStronglyMeasurable' m f μ
hg : AEStronglyMeasurable' m g μ
⊢ AEStronglyMeasurable' m (f + g) μ

Next tactic:
rcases hf with ⟨f', h_f'_meas, hff'⟩
theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ)
    (hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by
  rcases hf with ⟨f', h_f'_meas, hff'⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : Add β
inst✝ : ContinuousAdd β
hg : AEStronglyMeasurable' m g μ
f' : α → β
h_f'_meas : StronglyMeasurable f'
hff' : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m (f + g) μ

Next tactic:
rcases hg with ⟨g', h_g'_meas, hgg'⟩
theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ)
    (hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by
  rcases hf with ⟨f', h_f'_meas, hff'⟩
  rcases hg with ⟨g', h_g'_meas, hgg'⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : Add β
inst✝ : ContinuousAdd β
f' : α → β
h_f'_meas : StronglyMeasurable f'
hff' : f =ᵐ[μ] f'
g' : α → β
h_g'_meas : StronglyMeasurable g'
hgg' : g =ᵐ[μ] g'
⊢ AEStronglyMeasurable' m (f + g) μ

Next tactic:
exact ⟨f' + g', h_f'_meas.add h_g'_meas, hff'.add hgg'⟩
theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (-f) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f : α → β
hfm : AEStronglyMeasurable' m f μ
⊢ AEStronglyMeasurable' m (-f) μ

Next tactic:
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (-f) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m (-f) μ

Next tactic:
refine' ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => _⟩
theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (-f) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  refine' ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => _⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
x : α
hx : f x = f' x
⊢ (-f) x = (-f') x

Next tactic:
simp_rw [Pi.neg_apply]
theorem neg [AddGroup β] [TopologicalAddGroup β] {f : α → β} (hfm : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (-f) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  refine' ⟨-f', hf'_meas.neg, hf_ae.mono fun x hx => _⟩
  simp_rw [Pi.neg_apply]
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
x : α
hx : f x = f' x
⊢ -f x = -f' x

Next tactic:
rw [hx]
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
    (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g✝ : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g : α → β
hfm : AEStronglyMeasurable' m f μ
hgm : AEStronglyMeasurable' m g μ
⊢ AEStronglyMeasurable' m (f - g) μ

Next tactic:
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
    (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g✝ : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g : α → β
hgm : AEStronglyMeasurable' m g μ
f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m (f - g) μ

Next tactic:
rcases hgm with ⟨g', hg'_meas, hg_ae⟩
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
    (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  rcases hgm with ⟨g', hg'_meas, hg_ae⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g✝ : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
g' : α → β
hg'_meas : StronglyMeasurable g'
hg_ae : g =ᵐ[μ] g'
⊢ AEStronglyMeasurable' m (f - g) μ

Next tactic:
refine' ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => _)⟩
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
    (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  rcases hgm with ⟨g', hg'_meas, hg_ae⟩
  refine' ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => _)⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g✝ : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
g' : α → β
hg'_meas : StronglyMeasurable g'
hg_ae : g =ᵐ[μ] g'
x : α
hx1 : g x = g' x
hx2 : f x = f' x
⊢ (f - g) x = (f' - g') x

Next tactic:
simp_rw [Pi.sub_apply]
theorem sub [AddGroup β] [TopologicalAddGroup β] {f g : α → β} (hfm : AEStronglyMeasurable' m f μ)
    (hgm : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f - g) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  rcases hgm with ⟨g', hg'_meas, hg_ae⟩
  refine' ⟨f' - g', hf'_meas.sub hg'_meas, hf_ae.mp (hg_ae.mono fun x hx1 hx2 => _)⟩
  simp_rw [Pi.sub_apply]
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f✝ g✝ : α → β
inst✝¹ : AddGroup β
inst✝ : TopologicalAddGroup β
f g f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
g' : α → β
hg'_meas : StronglyMeasurable g'
hg_ae : g =ᵐ[μ] g'
x : α
hx1 : g x = g' x
hx2 : f x = f' x
⊢ f x - g x = f' x - g' x

Next tactic:
rw [hx1, hx2]
theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (c • f) μ := by
  

Proof state:
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : SMul 𝕜 β
inst✝ : ContinuousConstSMul 𝕜 β
c : 𝕜
hf : AEStronglyMeasurable' m f μ
⊢ AEStronglyMeasurable' m (c • f) μ

Next tactic:
rcases hf with ⟨f', h_f'_meas, hff'⟩
theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (c • f) μ := by
  rcases hf with ⟨f', h_f'_meas, hff'⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : SMul 𝕜 β
inst✝ : ContinuousConstSMul 𝕜 β
c : 𝕜
f' : α → β
h_f'_meas : StronglyMeasurable f'
hff' : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m (c • f) μ

Next tactic:
refine' ⟨c • f', h_f'_meas.const_smul c, _⟩
theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (c • f) μ := by
  rcases hf with ⟨f', h_f'_meas, hff'⟩
  refine' ⟨c • f', h_f'_meas.const_smul c, _⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝² : TopologicalSpace β
f g : α → β
inst✝¹ : SMul 𝕜 β
inst✝ : ContinuousConstSMul 𝕜 β
c : 𝕜
f' : α → β
h_f'_meas : StronglyMeasurable f'
hff' : f =ᵐ[μ] f'
⊢ c • f =ᵐ[μ] c • f'

Next tactic:
exact EventuallyEq.fun_comp hff' fun x => c • x
theorem const_inner {𝕜 β} [IsROrC 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β}
    (hfm : AEStronglyMeasurable' m f μ) (c : β) :
    AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
  

Proof state:
α : Type u_1
β✝ : Type u_2
𝕜✝ : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : TopologicalSpace β✝
f✝ g : α → β✝
𝕜 : Type u_4
β : Type u_5
inst✝² : IsROrC 𝕜
inst✝¹ : NormedAddCommGroup β
inst✝ : InnerProductSpace 𝕜 β
f : α → β
hfm : AEStronglyMeasurable' m f μ
c : β
⊢ AEStronglyMeasurable' m (fun x => inner c (f x)) μ

Next tactic:
rcases hfm with ⟨f', hf'_meas, hf_ae⟩
theorem const_inner {𝕜 β} [IsROrC 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β}
    (hfm : AEStronglyMeasurable' m f μ) (c : β) :
    AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  

Proof state:
case intro.intro
α : Type u_1
β✝ : Type u_2
𝕜✝ : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : TopologicalSpace β✝
f✝ g : α → β✝
𝕜 : Type u_4
β : Type u_5
inst✝² : IsROrC 𝕜
inst✝¹ : NormedAddCommGroup β
inst✝ : InnerProductSpace 𝕜 β
f : α → β
c : β
f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
⊢ AEStronglyMeasurable' m (fun x => inner c (f x)) μ

Next tactic:
refine'
    ⟨fun x => (inner c (f' x) : 𝕜), (@stronglyMeasurable_const _ _ m _ c).inner hf'_meas,
      hf_ae.mono fun x hx => _⟩
theorem const_inner {𝕜 β} [IsROrC 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β}
    (hfm : AEStronglyMeasurable' m f μ) (c : β) :
    AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  refine'
    ⟨fun x => (inner c (f' x) : 𝕜), (@stronglyMeasurable_const _ _ m _ c).inner hf'_meas,
      hf_ae.mono fun x hx => _⟩
  

Proof state:
case intro.intro
α : Type u_1
β✝ : Type u_2
𝕜✝ : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : TopologicalSpace β✝
f✝ g : α → β✝
𝕜 : Type u_4
β : Type u_5
inst✝² : IsROrC 𝕜
inst✝¹ : NormedAddCommGroup β
inst✝ : InnerProductSpace 𝕜 β
f : α → β
c : β
f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
x : α
hx : f x = f' x
⊢ (fun x => inner c (f x)) x = (fun x => inner c (f' x)) x

Next tactic:
dsimp only
theorem const_inner {𝕜 β} [IsROrC 𝕜] [NormedAddCommGroup β] [InnerProductSpace 𝕜 β] {f : α → β}
    (hfm : AEStronglyMeasurable' m f μ) (c : β) :
    AEStronglyMeasurable' m (fun x => (inner c (f x) : 𝕜)) μ := by
  rcases hfm with ⟨f', hf'_meas, hf_ae⟩
  refine'
    ⟨fun x => (inner c (f' x) : 𝕜), (@stronglyMeasurable_const _ _ m _ c).inner hf'_meas,
      hf_ae.mono fun x hx => _⟩
  dsimp only
  

Proof state:
case intro.intro
α : Type u_1
β✝ : Type u_2
𝕜✝ : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝³ : TopologicalSpace β✝
f✝ g : α → β✝
𝕜 : Type u_4
β : Type u_5
inst✝² : IsROrC 𝕜
inst✝¹ : NormedAddCommGroup β
inst✝ : InnerProductSpace 𝕜 β
f : α → β
c : β
f' : α → β
hf'_meas : StronglyMeasurable f'
hf_ae : f =ᵐ[μ] f'
x : α
hx : f x = f' x
⊢ inner c (f x) = inner c (f' x)

Next tactic:
rw [hx]
theorem continuous_comp {γ} [TopologicalSpace γ] {f : α → β} {g : β → γ} (hg : Continuous g)
    (hf : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (g ∘ f) μ :=
  ⟨fun x => g (hf.mk _ x),
    @Continuous.comp_stronglyMeasurable _ _ _ m _ _ _ _ hg hf.stronglyMeasurable_mk,
    hf.ae_eq_mk.mono fun x hx => by 

Proof state:
α : Type u_1
β : Type u_2
𝕜 : Type u_3
m m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace β
f✝ g✝ : α → β
γ : Type u_4
inst✝ : TopologicalSpace γ
f : α → β
g : β → γ
hg : Continuous g
hf : AEStronglyMeasurable' m f μ
x : α
hx : f x = mk f hf x
⊢ (g ∘ f) x = (fun x => g (mk f hf x)) x

Next tactic:
rw [Function.comp_apply, hx]
theorem aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim {α β} {m m0 m0' : MeasurableSpace α}
    [TopologicalSpace β] (hm0 : m0 ≤ m0') {μ : Measure α} {f : α → β}
    (hf : AEStronglyMeasurable' m f (μ.trim hm0)) : AEStronglyMeasurable' m f μ := by
  

Proof state:
α : Type u_1
β : Type u_2
m m0 m0' : MeasurableSpace α
inst✝ : TopologicalSpace β
hm0 : m0 ≤ m0'
μ : Measure α
f : α → β
hf : AEStronglyMeasurable' m f (Measure.trim μ hm0)
⊢ AEStronglyMeasurable' m f μ

Next tactic:
obtain ⟨g, hg_meas, hfg⟩ := hf
theorem aeStronglyMeasurable'_of_aeStronglyMeasurable'_trim {α β} {m m0 m0' : MeasurableSpace α}
    [TopologicalSpace β] (hm0 : m0 ≤ m0') {μ : Measure α} {f : α → β}
    (hf : AEStronglyMeasurable' m f (μ.trim hm0)) : AEStronglyMeasurable' m f μ := by
  obtain ⟨g, hg_meas, hfg⟩ := hf; 

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
m m0 m0' : MeasurableSpace α
inst✝ : TopologicalSpace β
hm0 : m0 ≤ m0'
μ : Measure α
f g : α → β
hg_meas : StronglyMeasurable g
hfg : f =ᵐ[Measure.trim μ hm0] g
⊢ AEStronglyMeasurable' m f μ

Next tactic:
exact ⟨g, hg_meas, ae_eq_of_ae_eq_trim hfg⟩
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  

Proof state:
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
⊢ AEStronglyMeasurable' m₂ f μ

Next tactic:
have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    filter_upwards [hf.ae_eq_mk] with x hx
    by_cases hxs : x ∈ s
    · simp [hxs, hx]
    · simp [hxs]
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    

Proof state:
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
⊢ Set.indicator s (mk f hf) =ᵐ[μ] f

Next tactic:
refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    

Proof state:
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
⊢ Set.indicator s (mk f hf) =ᵐ[μ] Set.indicator s f

Next tactic:
filter_upwards [hf.ae_eq_mk] with x hx
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    filter_upwards [hf.ae_eq_mk] with x hx
    

Proof state:
case h
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
x : α
hx : f x = mk f hf x
⊢ Set.indicator s (mk f hf) x = Set.indicator s f x

Next tactic:
by_cases hxs : x ∈ s
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    filter_upwards [hf.ae_eq_mk] with x hx
    by_cases hxs : x ∈ s
    · 

Proof state:
case pos
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
x : α
hx : f x = mk f hf x
hxs : x ∈ s
⊢ Set.indicator s (mk f hf) x = Set.indicator s f x

Next tactic:
simp [hxs, hx]
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    filter_upwards [hf.ae_eq_mk] with x hx
    by_cases hxs : x ∈ s
    · simp [hxs, hx]
    · 

Proof state:
case neg
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
x : α
hx : f x = mk f hf x
hxs : x ∉ s
⊢ Set.indicator s (mk f hf) x = Set.indicator s f x

Next tactic:
simp [hxs]
/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ := by
  have h_ind_eq : s.indicator (hf.mk f) =ᵐ[μ] f := by
    refine'
      Filter.EventuallyEq.trans _ (indicator_ae_eq_of_restrict_compl_ae_eq_zero (hm _ hs_m) hf_zero)
    filter_upwards [hf.ae_eq_mk] with x hx
    by_cases hxs : x ∈ s
    · simp [hxs, hx]
    · simp [hxs]
  

Proof state:
α : Type u_1
E : Type u_2
m m₂ m0 : MeasurableSpace α
μ : Measure α
inst✝¹ : TopologicalSpace E
inst✝ : Zero E
hm : m ≤ m0
s : Set α
f : α → E
hs_m : MeasurableSet s
hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t)
hf : AEStronglyMeasurable' m f μ
hf_zero : f =ᵐ[Measure.restrict μ sᶜ] 0
h_ind_eq : Set.indicator s (mk f hf) =ᵐ[μ] f
⊢ AEStronglyMeasurable' m₂ f μ

Next tactic:
suffices : StronglyMeasurable[m₂] (s.indicator (hf.mk f))