l3lab/ntp-mathlib huggingface dataset:
theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    ∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ := by
  by_cases hf : Integrable f μ
  · 

Proof state:
case pos
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
α : Type u_3
m : MeasurableSpace α
μ ν : Measure α
E : Type u_4
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : HaveLebesgueDecomposition μ ν
hμν : μ ≪ ν
inst✝ : SigmaFinite μ
f : α → E
hf : Integrable f
⊢ ∫ (x : α), ENNReal.toReal (rnDeriv μ ν x) • f x ∂ν = ∫ (x : α), f x ∂μ

Next tactic:
rw [← integral_univ, ← withDensityᵥ_apply ((integrable_rnDeriv_smul_iff hμν).mpr hf) .univ,
      ← integral_univ, ← withDensityᵥ_apply hf .univ, withDensityᵥ_rnDeriv_smul hμν hf]
theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    ∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ := by
  by_cases hf : Integrable f μ
  · rw [← integral_univ, ← withDensityᵥ_apply ((integrable_rnDeriv_smul_iff hμν).mpr hf) .univ,
      ← integral_univ, ← withDensityᵥ_apply hf .univ, withDensityᵥ_rnDeriv_smul hμν hf]
  · 

Proof state:
case neg
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
α : Type u_3
m : MeasurableSpace α
μ ν : Measure α
E : Type u_4
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : HaveLebesgueDecomposition μ ν
hμν : μ ≪ ν
inst✝ : SigmaFinite μ
f : α → E
hf : ¬Integrable f
⊢ ∫ (x : α), ENNReal.toReal (rnDeriv μ ν x) • f x ∂ν = ∫ (x : α), f x ∂μ

Next tactic:
rw [integral_undef hf, integral_undef]
theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    ∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ := by
  by_cases hf : Integrable f μ
  · rw [← integral_univ, ← withDensityᵥ_apply ((integrable_rnDeriv_smul_iff hμν).mpr hf) .univ,
      ← integral_univ, ← withDensityᵥ_apply hf .univ, withDensityᵥ_rnDeriv_smul hμν hf]
  · rw [integral_undef hf, integral_undef]
    

Proof state:
case neg
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
α : Type u_3
m : MeasurableSpace α
μ ν : Measure α
E : Type u_4
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : HaveLebesgueDecomposition μ ν
hμν : μ ≪ ν
inst✝ : SigmaFinite μ
f : α → E
hf : ¬Integrable f
⊢ ¬Integrable fun x => ENNReal.toReal (rnDeriv μ ν x) • f x

Next tactic:
contrapose! hf
theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    ∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ := by
  by_cases hf : Integrable f μ
  · rw [← integral_univ, ← withDensityᵥ_apply ((integrable_rnDeriv_smul_iff hμν).mpr hf) .univ,
      ← integral_univ, ← withDensityᵥ_apply hf .univ, withDensityᵥ_rnDeriv_smul hμν hf]
  · rw [integral_undef hf, integral_undef]
    contrapose! hf
    

Proof state:
case neg
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
α : Type u_3
m : MeasurableSpace α
μ ν : Measure α
E : Type u_4
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : CompleteSpace E
inst✝¹ : HaveLebesgueDecomposition μ ν
hμν : μ ≪ ν
inst✝ : SigmaFinite μ
f : α → E
hf : Integrable fun x => ENNReal.toReal (rnDeriv μ ν x) • f x
⊢ Integrable f

Next tactic:
exact (integrable_rnDeriv_smul_iff hμν).mp hf
theorem tendstoInMeasure_iff_norm [SeminormedAddCommGroup E] {l : Filter ι} {f : ι → α → E}
    {g : α → E} :
    TendstoInMeasure μ f l g ↔
      ∀ (ε) (hε : 0 < ε), Tendsto (fun i => μ { x | ε ≤ ‖f i x - g x‖ }) l (𝓝 0) := by
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : SeminormedAddCommGroup E
l : Filter ι
f : ι → α → E
g : α → E
⊢ TendstoInMeasure μ f l g ↔ ∀ (ε : ℝ), 0 < ε → Tendsto (fun i => ↑↑μ {x | ε ≤ ‖f i x - g x‖}) l (𝓝 0)

Next tactic:
simp_rw [TendstoInMeasure, dist_eq_norm]
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
⊢ TendstoInMeasure μ f' l g'

Next tactic:
intro ε hε
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
⊢ Tendsto (fun i => ↑↑μ {x | ε ≤ dist (f' i x) (g' x)}) l (𝓝 0)

Next tactic:
suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
this : (fun i => ↑↑μ {x | ε ≤ dist (f' i x) (g' x)}) =ᶠ[l] fun i => ↑↑μ {x | ε ≤ dist (f i x) (g x)}
⊢ Tendsto (fun i => ↑↑μ {x | ε ≤ dist (f' i x) (g' x)}) l (𝓝 0)

Next tactic:
rw [tendsto_congr' this]
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
this : (fun i => ↑↑μ {x | ε ≤ dist (f' i x) (g' x)}) =ᶠ[l] fun i => ↑↑μ {x | ε ≤ dist (f i x) (g x)}
⊢ Tendsto (fun i => ↑↑μ {x | ε ≤ dist (f i x) (g x)}) l (𝓝 0)

Next tactic:
exact h_tendsto ε hε
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
⊢ (fun i => ↑↑μ {x | ε ≤ dist (f' i x) (g' x)}) =ᶠ[l] fun i => ↑↑μ {x | ε ≤ dist (f i x) (g x)}

Next tactic:
filter_upwards [h_left] with i h_ae_eq
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  filter_upwards [h_left] with i h_ae_eq
  

Proof state:
case h
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
i : ι
h_ae_eq : f i =ᵐ[μ] f' i
⊢ ↑↑μ {x | ε ≤ dist (f' i x) (g' x)} = ↑↑μ {x | ε ≤ dist (f i x) (g x)}

Next tactic:
refine' measure_congr _
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  filter_upwards [h_left] with i h_ae_eq
  refine' measure_congr _
  

Proof state:
case h
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
i : ι
h_ae_eq : f i =ᵐ[μ] f' i
⊢ {x | ε ≤ dist (f' i x) (g' x)} =ᵐ[μ] {x | ε ≤ dist (f i x) (g x)}

Next tactic:
filter_upwards [h_ae_eq, h_right] with x hxf hxg
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  filter_upwards [h_left] with i h_ae_eq
  refine' measure_congr _
  filter_upwards [h_ae_eq, h_right] with x hxf hxg
  

Proof state:
case h
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
i : ι
h_ae_eq : f i =ᵐ[μ] f' i
x : α
hxf : f i x = f' i x
hxg : g x = g' x
⊢ setOf (fun x => ε ≤ dist (f' i x) (g' x)) x = setOf (fun x => ε ≤ dist (f i x) (g x)) x

Next tactic:
rw [eq_iff_iff]
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  filter_upwards [h_left] with i h_ae_eq
  refine' measure_congr _
  filter_upwards [h_ae_eq, h_right] with x hxf hxg
  rw [eq_iff_iff]
  

Proof state:
case h
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
i : ι
h_ae_eq : f i =ᵐ[μ] f' i
x : α
hxf : f i x = f' i x
hxg : g x = g' x
⊢ setOf (fun x => ε ≤ dist (f' i x) (g' x)) x ↔ setOf (fun x => ε ≤ dist (f i x) (g x)) x

Next tactic:
change ε ≤ dist (f' i x) (g' x) ↔ ε ≤ dist (f i x) (g x)
protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g' := by
  intro ε hε
  suffices
    (fun i => μ { x | ε ≤ dist (f' i x) (g' x) }) =ᶠ[l] fun i => μ { x | ε ≤ dist (f i x) (g x) } by
    rw [tendsto_congr' this]
    exact h_tendsto ε hε
  filter_upwards [h_left] with i h_ae_eq
  refine' measure_congr _
  filter_upwards [h_ae_eq, h_right] with x hxf hxg
  rw [eq_iff_iff]
  change ε ≤ dist (f' i x) (g' x) ↔ ε ≤ dist (f i x) (g x)
  

Proof state:
case h
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝ : Dist E
l : Filter ι
f f' : ι → α → E
g g' : α → E
h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i
h_right : g =ᵐ[μ] g'
h_tendsto : TendstoInMeasure μ f l g
ε : ℝ
hε : 0 < ε
i : ι
h_ae_eq : f i =ᵐ[μ] f' i
x : α
hxf : f i x = f' i x
hxg : g x = g' x
⊢ ε ≤ dist (f' i x) (g' x) ↔ ε ≤ dist (f i x) (g x)

Next tactic:
rw [hxg, hxf]
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
⊢ TendstoInMeasure μ f atTop g

Next tactic:
refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  

Proof state:
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0∞
hδ : δ > 0
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ δ

Next tactic:
by_cases hδi : δ = ∞
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · 

Proof state:
case pos
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0∞
hδ : δ > 0
hδi : δ = ⊤
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ δ

Next tactic:
simp only [hδi, imp_true_iff, le_top, exists_const]
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  

Proof state:
case neg
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0∞
hδ : δ > 0
hδi : ¬δ = ⊤
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ δ

Next tactic:
lift δ to ℝ≥0 using hδi
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  

Proof state:
case neg.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : ↑δ > 0
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  

Proof state:
case neg.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
t : Set α
left✝ : MeasurableSet t
ht : ↑↑μ t ≤ ENNReal.ofReal ↑δ
hunif : TendstoUniformlyOn (fun n => f n) g atTop tᶜ
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
rw [ENNReal.ofReal_coe_nnreal] at ht
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
  rw [ENNReal.ofReal_coe_nnreal] at ht
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
t : Set α
left✝ : MeasurableSet t
ht : ↑↑μ t ≤ ↑δ
hunif : TendstoUniformlyOn (fun n => f n) g atTop tᶜ
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
rw [Metric.tendstoUniformlyOn_iff] at hunif
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
  rw [ENNReal.ofReal_coe_nnreal] at ht
  rw [Metric.tendstoUniformlyOn_iff] at hunif
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
t : Set α
left✝ : MeasurableSet t
ht : ↑↑μ t ≤ ↑δ
hunif : ∀ ε > 0, ∀ᶠ (n : ℕ) in atTop, ∀ x ∈ tᶜ, dist (g x) (f n x) < ε
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
obtain ⟨N, hN⟩ := eventually_atTop.1 (hunif ε hε)
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
  rw [ENNReal.ofReal_coe_nnreal] at ht
  rw [Metric.tendstoUniformlyOn_iff] at hunif
  obtain ⟨N, hN⟩ := eventually_atTop.1 (hunif ε hε)
  

Proof state:
case neg.intro.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
t : Set α
left✝ : MeasurableSet t
ht : ↑↑μ t ≤ ↑δ
hunif : ∀ ε > 0, ∀ᶠ (n : ℕ) in atTop, ∀ x ∈ tᶜ, dist (g x) (f n x) < ε
N : ℕ
hN : ∀ b ≥ N, ∀ x ∈ tᶜ, dist (g x) (f b x) < ε
⊢ ∃ N, ∀ n ≥ N, ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
refine' ⟨N, fun n hn => _⟩
/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g := by
  refine' fun ε hε => ENNReal.tendsto_atTop_zero.mpr fun δ hδ => _
  by_cases hδi : δ = ∞
  · simp only [hδi, imp_true_iff, le_top, exists_const]
  lift δ to ℝ≥0 using hδi
  rw [gt_iff_lt, ENNReal.coe_pos, ← NNReal.coe_pos] at hδ
  obtain ⟨t, _, ht, hunif⟩ := tendstoUniformlyOn_of_ae_tendsto' hf hg hfg hδ
  rw [ENNReal.ofReal_coe_nnreal] at ht
  rw [Metric.tendstoUniformlyOn_iff] at hunif
  obtain ⟨N, hN⟩ := eventually_atTop.1 (hunif ε hε)
  refine' ⟨N, fun n hn => _⟩
  

Proof state:
case neg.intro.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
E : Type u_3
m : MeasurableSpace α
μ : Measure α
inst✝¹ : MetricSpace E
f : ℕ → α → E
g : α → E
inst✝ : IsFiniteMeasure μ
hf : ∀ (n : ℕ), StronglyMeasurable (f n)
hg : StronglyMeasurable g
hfg : ∀ᵐ (x : α) ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))
ε : ℝ
hε : 0 < ε
δ : ℝ≥0
hδ : 0 < ↑δ
t : Set α
left✝ : MeasurableSet t
ht : ↑↑μ t ≤ ↑δ
hunif : ∀ ε > 0, ∀ᶠ (n : ℕ) in atTop, ∀ x ∈ tᶜ, dist (g x) (f n x) < ε
N : ℕ
hN : ∀ b ≥ N, ∀ x ∈ tᶜ, dist (g x) (f b x) < ε
n : ℕ
hn : n ≥ N
⊢ ↑↑μ {x | ε ≤ dist (f n x) (g x)} ≤ ↑δ

Next tactic:
suffices : { x : α | ε ≤ dist (f n x) (g x) } ⊆ t