Theorem: MeasureTheory.Lp.boundedContinuousFunction_dense
File: Mathlib/MeasureTheory/Function/ContinuousMapDense.lean

tactic: rw [AddSubgroup.eq_top_iff']
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
⊢ AddSubgroup.topologicalClosure (boundedContinuousFunction E p μ) = ⊤

tactic: intro f
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
⊢ ∀ (x : { x // x ∈ Lp E p }), x ∈ AddSubgroup.topologicalClosure (boundedContinuousFunction E p μ)

tactic: refine' mem_closure_iff_frequently.mpr _
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
⊢ f ∈ AddSubgroup.topologicalClosure (boundedContinuousFunction E p μ)

tactic: rw [Metric.nhds_basis_closedBall.frequently_iff]
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
⊢ ∃ᶠ (x : { x // x ∈ Lp E p }) in 𝓝 f, x ∈ ↑(boundedContinuousFunction E p μ)

tactic: intro ε hε
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
⊢ ∀ (i : ℝ), 0 < i → ∃ x, x ∈ Metric.closedBall f i ∧ x ∈ ↑(boundedContinuousFunction E p μ)

tactic: have A : ENNReal.ofReal ε ≠ 0 := by simp only [Ne.def, ENNReal.ofReal_eq_zero, not_le, hε]
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
⊢ ∃ x, x ∈ Metric.closedBall f ε ∧ x ∈ ↑(boundedContinuousFunction E p μ)

tactic: obtain ⟨g, hg, g_mem⟩ :
    ∃ g : α →ᵇ E, snorm ((f : α → E) - (g : α → E)) p μ ≤ ENNReal.ofReal ε ∧ Memℒp g p μ :=
  (Lp.memℒp f).exists_boundedContinuous_snorm_sub_le hp A
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
⊢ ∃ x, x ∈ Metric.closedBall f ε ∧ x ∈ ↑(boundedContinuousFunction E p μ)

tactic: refine' ⟨g_mem.toLp _, _, ⟨g, rfl⟩⟩
state_before: case intro.intro
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ ∃ x, x ∈ Metric.closedBall f ε ∧ x ∈ ↑(boundedContinuousFunction E p μ)

tactic: simp only [dist_eq_norm, Metric.mem_closedBall']
state_before: case intro.intro
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ Memℒp.toLp (↑g) g_mem ∈ Metric.closedBall f ε

tactic: rw [Lp.norm_def]
state_before: case intro.intro
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ ‖f - Memℒp.toLp (↑g) g_mem‖ ≤ ε

tactic: have key : snorm ((f : α → E) - (g : α → E)) p μ = snorm (f - Memℒp.toLp (↑g) g_mem) p μ := by
  apply snorm_congr_ae
  filter_upwards [coeFn_sub f (g_mem.toLp g), g_mem.coeFn_toLp] with x hx h'x
  simp only [hx, Pi.sub_apply, sub_right_inj, h'x]
state_before: case intro.intro
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ ENNReal.toReal (snorm (↑↑(f - Memℒp.toLp (↑g) g_mem)) p μ) ≤ ε

tactic: simpa only [key] using ENNReal.toReal_le_of_le_ofReal hε.le hg
state_before: case intro.intro
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
key : snorm (↑↑f - ↑g) p μ = snorm (↑↑(f - Memℒp.toLp (↑g) g_mem)) p μ
⊢ ENNReal.toReal (snorm (↑↑(f - Memℒp.toLp (↑g) g_mem)) p μ) ≤ ε

tactic: simp only [Ne.def, ENNReal.ofReal_eq_zero, not_le, hε]
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
⊢ ENNReal.ofReal ε ≠ 0

tactic: apply snorm_congr_ae
state_before: α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ snorm (↑↑f - ↑g) p μ = snorm (↑↑(f - Memℒp.toLp (↑g) g_mem)) p μ

tactic: filter_upwards [coeFn_sub f (g_mem.toLp g), g_mem.coeFn_toLp] with x hx h'x
state_before: case hfg
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
⊢ ↑↑f - ↑g =ᵐ[μ] ↑↑(f - Memℒp.toLp (↑g) g_mem)

tactic: simp only [hx, Pi.sub_apply, sub_right_inj, h'x]
state_before: case h
α : Type u_1
inst✝⁷ : MeasurableSpace α
inst✝⁶ : TopologicalSpace α
inst✝⁵ : NormalSpace α
inst✝⁴ : BorelSpace α
E : Type u_2
inst✝³ : NormedAddCommGroup E
μ : Measure α
p : ℝ≥0∞
inst✝² : NormedSpace ℝ E
inst✝¹ : SecondCountableTopologyEither α E
_i : Fact (1 ≤ p)
hp : p ≠ ⊤
inst✝ : Measure.WeaklyRegular μ
f : { x // x ∈ Lp E p }
ε : ℝ
hε : 0 < ε
A : ENNReal.ofReal ε ≠ 0
g : α →ᵇ E
hg : snorm (↑↑f - ↑g) p μ ≤ ENNReal.ofReal ε
g_mem : Memℒp (↑g) p
x : α
hx : ↑↑(f - Memℒp.toLp (↑g) g_mem) x = (↑↑f - ↑↑(Memℒp.toLp (↑g) g_mem)) x
h'x : ↑↑(Memℒp.toLp (↑g) g_mem) x = ↑g x
⊢ (↑↑f - ↑g) x = ↑↑(f - Memℒp.toLp (↑g) g_mem) x