Theorem: BoundedContinuousFunction.tietze_extension_step
File: Mathlib/Topology/TietzeExtension.lean

tactic: have h3 : (0 : ℝ) < 3 := by norm_num1
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have h23 : 0 < (2 / 3 : ℝ) := by norm_num1
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: rcases eq_or_ne f 0 with (rfl | hf)
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: replace hf : 0 < ‖f‖ := norm_pos_iff.2 hf
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : f ≠ 0
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have hf3 : -‖f‖ / 3 < ‖f‖ / 3 := (div_lt_div_right h3).2 (Left.neg_lt_self hf)
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have hc₁ : IsClosed (e '' (f ⁻¹' Iic (-‖f‖ / 3))) :=
  he.isClosedMap _ (isClosed_Iic.preimage f.continuous)
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have hc₂ : IsClosed (e '' (f ⁻¹' Ici (‖f‖ / 3))) :=
  he.isClosedMap _ (isClosed_Ici.preimage f.continuous)
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have hd : Disjoint (e '' (f ⁻¹' Iic (-‖f‖ / 3))) (e '' (f ⁻¹' Ici (‖f‖ / 3))) := by
  refine' disjoint_image_of_injective he.inj (Disjoint.preimage _ _)
  rwa [Iic_disjoint_Ici, not_le]
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: rcases exists_bounded_mem_Icc_of_closed_of_le hc₁ hc₂ hd hf3.le with ⟨g, hg₁, hg₂, hgf⟩
state_before: case inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: refine' ⟨g, _, _⟩
state_before: case inr.intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
⊢ ∃ g, ‖g‖ ≤ ‖f‖ / 3 ∧ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: norm_num1
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
⊢ 0 < 3

tactic: norm_num1
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
⊢ 0 < 2 / 3

tactic: use 0
state_before: case inl
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
⊢ ∃ g, ‖g‖ ≤ ‖0‖ / 3 ∧ dist (compContinuous g e) 0 ≤ 2 / 3 * ‖0‖

tactic: simp
state_before: case inl
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
⊢ ‖0‖ ≤ ‖0‖ / 3 ∧ dist (compContinuous 0 e) 0 ≤ 2 / 3 * ‖0‖

tactic: refine' disjoint_image_of_injective he.inj (Disjoint.preimage _ _)
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
⊢ Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))

tactic: rwa [Iic_disjoint_Ici, not_le]
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
⊢ Disjoint (Iic (-‖f‖ / 3)) (Ici (‖f‖ / 3))

tactic: refine' (norm_le <| div_nonneg hf.le h3.le).mpr fun y => _
state_before: case inr.intro.intro.intro.refine'_1
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
⊢ ‖g‖ ≤ ‖f‖ / 3

tactic: simpa [abs_le, neg_div] using hgf y
state_before: case inr.intro.intro.intro.refine'_1
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
y : Y
⊢ ‖↑g y‖ ≤ ‖f‖ / 3

tactic: refine' (dist_le <| mul_nonneg h23.le hf.le).mpr fun x => _
state_before: case inr.intro.intro.intro.refine'_2
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
⊢ dist (compContinuous g e) f ≤ 2 / 3 * ‖f‖

tactic: have hfx : -‖f‖ ≤ f x ∧ f x ≤ ‖f‖ := by
  simpa only [Real.norm_eq_abs, abs_le] using f.norm_coe_le_norm x
state_before: case inr.intro.intro.intro.refine'_2
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: cases' le_total (f x) (-‖f‖ / 3) with hle₁ hle₁
state_before: case inr.intro.intro.intro.refine'_2
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: simpa only [Real.norm_eq_abs, abs_le] using f.norm_coe_le_norm x
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
⊢ -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖

tactic: calc
  |g (e x) - f x| = -‖f‖ / 3 - f x := by
    rw [hg₁ (mem_image_of_mem _ hle₁), Function.const_apply,
      abs_of_nonneg (sub_nonneg.2 hle₁)]
  _ ≤ 2 / 3 * ‖f‖ := by linarith
state_before: case inr.intro.intro.intro.refine'_2.inl
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : ↑f x ≤ -‖f‖ / 3
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: rw [hg₁ (mem_image_of_mem _ hle₁), Function.const_apply,
  abs_of_nonneg (sub_nonneg.2 hle₁)]
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : ↑f x ≤ -‖f‖ / 3
⊢ abs (↑g (↑e x) - ↑f x) = -‖f‖ / 3 - ↑f x

tactic: linarith
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : ↑f x ≤ -‖f‖ / 3
⊢ -‖f‖ / 3 - ↑f x ≤ 2 / 3 * ‖f‖

tactic: cases' le_total (f x) (‖f‖ / 3) with hle₂ hle₂
state_before: case inr.intro.intro.intro.refine'_2.inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : -‖f‖ / 3 ≤ ↑f x
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: simp only [neg_div] at *
state_before: case inr.intro.intro.intro.refine'_2.inr.inl
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : -‖f‖ / 3 ≤ ↑f x
hle₂ : ↑f x ≤ ‖f‖ / 3
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: calc
  dist (g (e x)) (f x) ≤ |g (e x)| + |f x| := dist_le_norm_add_norm _ _
  _ ≤ ‖f‖ / 3 + ‖f‖ / 3 := (add_le_add (abs_le.2 <| hgf _) (abs_le.2 ⟨hle₁, hle₂⟩))
  _ = 2 / 3 * ‖f‖ := by linarith
state_before: case inr.intro.intro.intro.refine'_2.inr.inl
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
g : Y →ᵇ ℝ
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₂ : ↑f x ≤ ‖f‖ / 3
hf3 : -(‖f‖ / 3) < ‖f‖ / 3
hc₁ : IsClosed ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3))))
hc₂ : IsClosed ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3)))) ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hg₁ : EqOn (↑g) (Function.const Y (-(‖f‖ / 3))) ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3))))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-(‖f‖ / 3)) (‖f‖ / 3)
hle₁ : -(‖f‖ / 3) ≤ ↑f x
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: linarith
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
g : Y →ᵇ ℝ
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₂ : ↑f x ≤ ‖f‖ / 3
hf3 : -(‖f‖ / 3) < ‖f‖ / 3
hc₁ : IsClosed ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3))))
hc₂ : IsClosed ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3)))) ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hg₁ : EqOn (↑g) (Function.const Y (-(‖f‖ / 3))) ((fun a => ↑e a) '' (↑f ⁻¹' Iic (-(‖f‖ / 3))))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) ((fun a => ↑e a) '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-(‖f‖ / 3)) (‖f‖ / 3)
hle₁ : -(‖f‖ / 3) ≤ ↑f x
⊢ ‖f‖ / 3 + ‖f‖ / 3 = 2 / 3 * ‖f‖

tactic: calc
  |g (e x) - f x| = f x - ‖f‖ / 3 := by
    rw [hg₂ (mem_image_of_mem _ hle₂), abs_sub_comm, Function.const_apply,
      abs_of_nonneg (sub_nonneg.2 hle₂)]
  _ ≤ 2 / 3 * ‖f‖ := by linarith
state_before: case inr.intro.intro.intro.refine'_2.inr.inr
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : -‖f‖ / 3 ≤ ↑f x
hle₂ : ‖f‖ / 3 ≤ ↑f x
⊢ dist (↑(compContinuous g e) x) (↑f x) ≤ 2 / 3 * ‖f‖

tactic: rw [hg₂ (mem_image_of_mem _ hle₂), abs_sub_comm, Function.const_apply,
  abs_of_nonneg (sub_nonneg.2 hle₂)]
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : -‖f‖ / 3 ≤ ↑f x
hle₂ : ‖f‖ / 3 ≤ ↑f x
⊢ abs (↑g (↑e x) - ↑f x) = ↑f x - ‖f‖ / 3

tactic: linarith
state_before: X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : NormalSpace Y
f : X →ᵇ ℝ
e : C(X, Y)
he : ClosedEmbedding ↑e
h3 : 0 < 3
h23 : 0 < 2 / 3
hf : 0 < ‖f‖
hf3 : -‖f‖ / 3 < ‖f‖ / 3
hc₁ : IsClosed (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hc₂ : IsClosed (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hd : Disjoint (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3))) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
g : Y →ᵇ ℝ
hg₁ : EqOn (↑g) (Function.const Y (-‖f‖ / 3)) (↑e '' (↑f ⁻¹' Iic (-‖f‖ / 3)))
hg₂ : EqOn (↑g) (Function.const Y (‖f‖ / 3)) (↑e '' (↑f ⁻¹' Ici (‖f‖ / 3)))
hgf : ∀ (x : Y), ↑g x ∈ Icc (-‖f‖ / 3) (‖f‖ / 3)
x : X
hfx : -‖f‖ ≤ ↑f x ∧ ↑f x ≤ ‖f‖
hle₁ : -‖f‖ / 3 ≤ ↑f x
hle₂ : ‖f‖ / 3 ≤ ↑f x
⊢ ↑f x - ‖f‖ / 3 ≤ 2 / 3 * ‖f‖