-- Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean
theorem _root_.exists_stronglyMeasurable_limit_of_tendsto_ae [PseudoMetrizableSpace β]
    {f : ℕ → α → β} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
    (h_ae_tendsto : ∀ᵐ x ∂μ, ∃ l : β, Tendsto (fun n => f n x) atTop (𝓝 l)) :
    ∃ f_lim : α → β, StronglyMeasurable f_lim ∧
      ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Tactic:
have Hg : AEStronglyMeasurable g μ := aestronglyMeasurable_of_tendsto_ae _ hf hg

Result:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Tactic:
obtain ⟨g, _, hg⟩ :
  ∃ g : α → β, Measurable g ∧ ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x)) :=
  measurable_limit_of_tendsto_metrizable_ae (fun n => (hf n).aemeasurable) h_ae_tendsto

Result:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Tactic:
borelize β

Result:
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
x : α
hx : Tendsto (fun n => f n x) atTop (𝓝 (g x))
h'x : g x = AEStronglyMeasurable.mk g Hg x
⊢ Tendsto (fun n => f n x) atTop (𝓝 (AEStronglyMeasurable.mk g Hg x))

Tactic:
rwa [h'x] at hx

Result:
no goals

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
⊢ ∃ f_lim, StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

Tactic:
refine ⟨Hg.mk g, Hg.stronglyMeasurable_mk, ?_⟩

Result:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
⊢ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (AEStronglyMeasurable.mk g Hg x))

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
⊢ ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (AEStronglyMeasurable.mk g Hg x))

Tactic:
filter_upwards [hg, Hg.ae_eq_mk] with x hx h'x

Result:
case h
α : Type u_1
β : Type u_2
inst✝¹ : TopologicalSpace β
m₀ : MeasurableSpace α
μ : Measure α
inst✝ : PseudoMetrizableSpace β
f : ℕ → α → β
hf : ∀ (n : ℕ), AEStronglyMeasurable (f n) μ
h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Tendsto (fun n => f n x) atTop (𝓝 l)
this✝¹ : MeasurableSpace β := borel β
this✝ : BorelSpace β
g : α → β
left✝ : Measurable g
hg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Hg : AEStronglyMeasurable g μ
x : α
hx : Tendsto (fun n => f n x) atTop (𝓝 (g x))
h'x : g x = AEStronglyMeasurable.mk g Hg x
⊢ Tendsto (fun n => f n x) atTop (𝓝 (AEStronglyMeasurable.mk g Hg x))