Theorem: exists_extension_norm_eq
File: Mathlib/Analysis/NormedSpace/HahnBanach/Extension.lean

tactic: letI : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: letI : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower _ _ _
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: letI : NormedSpace ℝ F := NormedSpace.restrictScalars _ 𝕜 _
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: let fr := reClm.comp (f.restrictScalars ℝ)
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: rcases Real.exists_extension_norm_eq (p.restrictScalars ℝ) fr with ⟨g, ⟨hextends, hnormeq⟩⟩
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: refine' ⟨g.extendTo𝕜, _⟩
state_before: case intro.intro
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
⊢ ∃ g, (∀ (x : { x // x ∈ p }), ↑g ↑x = ↑f x) ∧ ‖g‖ = ‖f‖

tactic: refine' ⟨h, le_antisymm _ _⟩
state_before: case intro.intro
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
h : ∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x
⊢ (∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x) ∧ ‖ContinuousLinearMap.extendTo𝕜 g‖ = ‖f‖

tactic: intro x
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
⊢ ∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x

tactic: rw [ContinuousLinearMap.extendTo𝕜_apply, ← Submodule.coe_smul, hextends, hextends]
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
⊢ ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x

tactic: have : (fr x : 𝕜) - I * ↑(fr (I • x)) = (re (f x) : 𝕜) - (I : 𝕜) * re (f ((I : 𝕜) • x)) := by
  rfl
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
⊢ ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑f x

tactic: rw [this]
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝² : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝¹ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this✝ : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
this : ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))
⊢ ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑f x

tactic: apply ext
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝² : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝¹ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this✝ : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
this : ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))
⊢ ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x))) = ↑f x

tactic: rfl
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
⊢ ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))

tactic: simp only [add_zero, Algebra.id.smul_eq_mul, I_re, ofReal_im, AddMonoidHom.map_add, zero_sub,
  I_im', MulZeroClass.zero_mul, ofReal_re, eq_self_iff_true, sub_zero, mul_neg, ofReal_neg,
  mul_re, MulZeroClass.mul_zero, sub_neg_eq_add, ContinuousLinearMap.map_smul]
state_before: case hre
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝² : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝¹ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this✝ : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
this : ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))
⊢ ↑re (↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))) = ↑re (↑f x)

tactic: simp only [Algebra.id.smul_eq_mul, I_re, ofReal_im, AddMonoidHom.map_add, zero_sub, I_im',
  MulZeroClass.zero_mul, ofReal_re, mul_neg, mul_im, zero_add, ofReal_neg, mul_re,
  sub_neg_eq_add, ContinuousLinearMap.map_smul]
state_before: case him
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝² : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝¹ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this✝ : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
x : { x // x ∈ p }
this : ↑(↑fr x) - I * ↑(↑fr (I • x)) = ↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))
⊢ ↑im (↑(↑re (↑f x)) - I * ↑(↑re (↑f (I • x)))) = ↑im (↑f x)

tactic: calc
  ‖g.extendTo𝕜‖ = ‖g‖ := g.norm_extendTo𝕜
  _ = ‖fr‖ := hnormeq
  _ ≤ ‖reClm‖ * ‖f‖ := (ContinuousLinearMap.op_norm_comp_le _ _)
  _ = ‖f‖ := by rw [reClm_norm, one_mul]
state_before: case intro.intro.refine'_1
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
h : ∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x
⊢ ‖ContinuousLinearMap.extendTo𝕜 g‖ ≤ ‖f‖

tactic: rw [reClm_norm, one_mul]
state_before: 𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
h : ∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x
⊢ ‖reClm‖ * ‖f‖ = ‖f‖

tactic: exact f.op_norm_le_bound g.extendTo𝕜.op_norm_nonneg fun x => h x ▸ g.extendTo𝕜.le_op_norm x
state_before: case intro.intro.refine'_2
𝕜 : Type u_1
inst✝² : IsROrC 𝕜
F : Type u_2
inst✝¹ : SeminormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : Subspace 𝕜 F
f : { x // x ∈ p } →L[𝕜] 𝕜
this✝¹ : Module ℝ F := RestrictScalars.module ℝ 𝕜 F
this✝ : IsScalarTower ℝ 𝕜 F := RestrictScalars.isScalarTower ℝ 𝕜 F
this : NormedSpace ℝ F := NormedSpace.restrictScalars ℝ 𝕜 F
fr : { x // x ∈ p } →L[ℝ] ℝ := ContinuousLinearMap.comp reClm (ContinuousLinearMap.restrictScalars ℝ f)
g : F →L[ℝ] ℝ
hextends : ∀ (x : { x // x ∈ Submodule.restrictScalars ℝ p }), ↑g ↑x = ↑fr x
hnormeq : ‖g‖ = ‖fr‖
h : ∀ (x : { x // x ∈ p }), ↑(ContinuousLinearMap.extendTo𝕜 g) ↑x = ↑f x
⊢ ‖f‖ ≤ ‖ContinuousLinearMap.extendTo𝕜 g‖