l3lab/ntp-mathlib huggingface dataset:
theorem norm_comp_le (g : W₂ →A[𝕜] V) : ‖f.comp g‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by
  rw [norm_def, max_le_iff]
  constructor
  · calc
      ‖f.comp g 0‖ = ‖f (g 0)‖ := by simp
      _ = ‖f.contLinear (g 0) + f 0‖ := by rw [f.decomp]; 

Proof state:
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f : V →A[𝕜] W
g : W₂ →A[𝕜] V
⊢ ‖(⇑(contLinear f) + Function.const V (f 0)) (g 0)‖ =
    ‖(contLinear f) (g 0) + (⇑(contLinear f) + Function.const V (f 0)) 0‖

Next tactic:
simp
theorem norm_comp_le (g : W₂ →A[𝕜] V) : ‖f.comp g‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by
  rw [norm_def, max_le_iff]
  constructor
  · calc
      ‖f.comp g 0‖ = ‖f (g 0)‖ := by simp
      _ = ‖f.contLinear (g 0) + f 0‖ := by rw [f.decomp]; simp
      _ ≤ ‖f.contLinear‖ * ‖g 0‖ + ‖f 0‖ :=
        ((norm_add_le _ _).trans (add_le_add_right (f.contLinear.le_op_norm _) _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ :=
        add_le_add_right
          (mul_le_mul f.norm_contLinear_le g.norm_image_zero_le (norm_nonneg _) (norm_nonneg _)) _
  · 

Proof state:
case right
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f : V →A[𝕜] W
g : W₂ →A[𝕜] V
⊢ ‖contLinear (comp f g)‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖

Next tactic:
calc
      ‖(f.comp g).contLinear‖ ≤ ‖f.contLinear‖ * ‖g.contLinear‖ :=
        (g.comp_contLinear f).symm ▸ f.contLinear.op_norm_comp_le _
      _ ≤ ‖f‖ * ‖g‖ :=
        (mul_le_mul f.norm_contLinear_le g.norm_contLinear_le (norm_nonneg _) (norm_nonneg _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by rw [le_add_iff_nonneg_right]; apply norm_nonneg
theorem norm_comp_le (g : W₂ →A[𝕜] V) : ‖f.comp g‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by
  rw [norm_def, max_le_iff]
  constructor
  · calc
      ‖f.comp g 0‖ = ‖f (g 0)‖ := by simp
      _ = ‖f.contLinear (g 0) + f 0‖ := by rw [f.decomp]; simp
      _ ≤ ‖f.contLinear‖ * ‖g 0‖ + ‖f 0‖ :=
        ((norm_add_le _ _).trans (add_le_add_right (f.contLinear.le_op_norm _) _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ :=
        add_le_add_right
          (mul_le_mul f.norm_contLinear_le g.norm_image_zero_le (norm_nonneg _) (norm_nonneg _)) _
  · calc
      ‖(f.comp g).contLinear‖ ≤ ‖f.contLinear‖ * ‖g.contLinear‖ :=
        (g.comp_contLinear f).symm ▸ f.contLinear.op_norm_comp_le _
      _ ≤ ‖f‖ * ‖g‖ :=
        (mul_le_mul f.norm_contLinear_le g.norm_contLinear_le (norm_nonneg _) (norm_nonneg _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by 

Proof state:
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f : V →A[𝕜] W
g : W₂ →A[𝕜] V
⊢ ‖f‖ * ‖g‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖

Next tactic:
rw [le_add_iff_nonneg_right]
theorem norm_comp_le (g : W₂ →A[𝕜] V) : ‖f.comp g‖ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by
  rw [norm_def, max_le_iff]
  constructor
  · calc
      ‖f.comp g 0‖ = ‖f (g 0)‖ := by simp
      _ = ‖f.contLinear (g 0) + f 0‖ := by rw [f.decomp]; simp
      _ ≤ ‖f.contLinear‖ * ‖g 0‖ + ‖f 0‖ :=
        ((norm_add_le _ _).trans (add_le_add_right (f.contLinear.le_op_norm _) _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ :=
        add_le_add_right
          (mul_le_mul f.norm_contLinear_le g.norm_image_zero_le (norm_nonneg _) (norm_nonneg _)) _
  · calc
      ‖(f.comp g).contLinear‖ ≤ ‖f.contLinear‖ * ‖g.contLinear‖ :=
        (g.comp_contLinear f).symm ▸ f.contLinear.op_norm_comp_le _
      _ ≤ ‖f‖ * ‖g‖ :=
        (mul_le_mul f.norm_contLinear_le g.norm_contLinear_le (norm_nonneg _) (norm_nonneg _))
      _ ≤ ‖f‖ * ‖g‖ + ‖f 0‖ := by rw [le_add_iff_nonneg_right]; 

Proof state:
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f : V →A[𝕜] W
g : W₂ →A[𝕜] V
⊢ 0 ≤ ‖f 0‖

Next tactic:
apply norm_nonneg
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    

Proof state:
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ f : V →A[𝕜] W
⊢ (fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1)
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => (f 0, contLinear f),
                map_add' :=
                  (_ :
                    ∀ (x x_1 : V →A[𝕜] W),
                      (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
            map_smul' :=
              (_ :
                ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                  AddHom.toFun
                      { toFun := fun f => (f 0, contLinear f),
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : V →A[𝕜] W),
                              (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                      (x • x_1) =
                    AddHom.toFun
                      { toFun := fun f => (f 0, contLinear f),
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : V →A[𝕜] W),
                              (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                      (x • x_1)) }.toAddHom
        f) =
    f

Next tactic:
ext
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    

Proof state:
case h
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ f : V →A[𝕜] W
x✝ : V
⊢ ((fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => (f 0, contLinear f),
                  map_add' :=
                    (_ :
                      ∀ (x x_1 : V →A[𝕜] W),
                        (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
              map_smul' :=
                (_ :
                  ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                    AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1) =
                      AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1)) }.toAddHom
          f))
      x✝ =
    f x✝

Next tactic:
rw [f.decomp]
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    

Proof state:
case h
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ f : V →A[𝕜] W
x✝ : V
⊢ ((fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => (f 0, contLinear f),
                  map_add' :=
                    (_ :
                      ∀ (x x_1 : V →A[𝕜] W),
                        (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
              map_smul' :=
                (_ :
                  ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                    AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1) =
                      AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1)) }.toAddHom
          f))
      x✝ =
    (⇑(contLinear f) + Function.const V (f 0)) x✝

Next tactic:
simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
    

Proof state:
case h
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ f : V →A[𝕜] W
x✝ : V
⊢ (contLinear f) x✝ + (const 𝕜 V (f 0)) x✝ = (contLinear f) x✝ + Function.const V (f 0) x✝

Next tactic:
rw [ContinuousAffineMap.coe_const, Function.const_apply]
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
    rw [ContinuousAffineMap.coe_const, Function.const_apply]
  right_inv := by 

Proof state:
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f : V →A[𝕜] W
⊢ Function.RightInverse (fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1)
    {
          toAddHom :=
            { toFun := fun f => (f 0, contLinear f),
              map_add' :=
                (_ :
                  ∀ (x x_1 : V →A[𝕜] W),
                    (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
          map_smul' :=
            (_ :
              ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                AddHom.toFun
                    { toFun := fun f => (f 0, contLinear f),
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : V →A[𝕜] W),
                            (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                    (x • x_1) =
                  AddHom.toFun
                    { toFun := fun f => (f 0, contLinear f),
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : V →A[𝕜] W),
                            (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                    (x • x_1)) }.toAddHom.toFun

Next tactic:
rintro ⟨v, f⟩
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
    rw [ContinuousAffineMap.coe_const, Function.const_apply]
  right_inv := by rintro ⟨v, f⟩; 

Proof state:
case mk
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ : V →A[𝕜] W
v : W
f : V →L[𝕜] W
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun f => (f 0, contLinear f),
              map_add' :=
                (_ :
                  ∀ (x x_1 : V →A[𝕜] W),
                    (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
          map_smul' :=
            (_ :
              ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                AddHom.toFun
                    { toFun := fun f => (f 0, contLinear f),
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : V →A[𝕜] W),
                            (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                    (x • x_1) =
                  AddHom.toFun
                    { toFun := fun f => (f 0, contLinear f),
                      map_add' :=
                        (_ :
                          ∀ (x x_2 : V →A[𝕜] W),
                            (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                    (x • x_1)) }.toAddHom
      ((fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1) (v, f)) =
    (v, f)

Next tactic:
ext
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
    rw [ContinuousAffineMap.coe_const, Function.const_apply]
  right_inv := by rintro ⟨v, f⟩; ext <;> 

Proof state:
case mk.a
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ : V →A[𝕜] W
v : W
f : V →L[𝕜] W
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => (f 0, contLinear f),
                map_add' :=
                  (_ :
                    ∀ (x x_1 : V →A[𝕜] W),
                      (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
            map_smul' :=
              (_ :
                ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                  AddHom.toFun
                      { toFun := fun f => (f 0, contLinear f),
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : V →A[𝕜] W),
                              (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                      (x • x_1) =
                    AddHom.toFun
                      { toFun := fun f => (f 0, contLinear f),
                        map_add' :=
                          (_ :
                            ∀ (x x_2 : V →A[𝕜] W),
                              (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                      (x • x_1)) }.toAddHom
        ((fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1) (v, f))).1 =
    (v, f).1

Next tactic:
simp
/-- The space of affine maps between two normed spaces is linearly isometric to the product of the
codomain with the space of linear maps, by taking the value of the affine map at `(0 : V)` and the
linear part. -/
def toConstProdContinuousLinearMap : (V →A[𝕜] W) ≃ₗᵢ[𝕜] W × (V →L[𝕜] W) where
  toFun f := ⟨f 0, f.contLinear⟩
  invFun p := p.2.toContinuousAffineMap + const 𝕜 V p.1
  left_inv f := by
    ext
    rw [f.decomp]
    -- Porting note: previously `simp` closed the goal, but now we need to rewrite:
    simp only [coe_add, ContinuousLinearMap.coe_toContinuousAffineMap, Pi.add_apply]
    rw [ContinuousAffineMap.coe_const, Function.const_apply]
  right_inv := by rintro ⟨v, f⟩; ext <;> 

Proof state:
case mk.a.h
𝕜 : Type u_1
R : Type u_2
V : Type u_3
W : Type u_4
W₂ : Type u_5
P : Type u_6
Q : Type u_7
Q₂ : Type u_8
inst✝¹⁶ : NormedAddCommGroup V
inst✝¹⁵ : MetricSpace P
inst✝¹⁴ : NormedAddTorsor V P
inst✝¹³ : NormedAddCommGroup W
inst✝¹² : MetricSpace Q
inst✝¹¹ : NormedAddTorsor W Q
inst✝¹⁰ : NormedAddCommGroup W₂
inst✝⁹ : MetricSpace Q₂
inst✝⁸ : NormedAddTorsor W₂ Q₂
inst✝⁷ : NormedField R
inst✝⁶ : NormedSpace R V
inst✝⁵ : NormedSpace R W
inst✝⁴ : NormedSpace R W₂
inst✝³ : NontriviallyNormedField 𝕜
inst✝² : NormedSpace 𝕜 V
inst✝¹ : NormedSpace 𝕜 W
inst✝ : NormedSpace 𝕜 W₂
f✝ : V →A[𝕜] W
v : W
f : V →L[𝕜] W
x✝ : V
⊢ (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => (f 0, contLinear f),
                  map_add' :=
                    (_ :
                      ∀ (x x_1 : V →A[𝕜] W),
                        (fun f => (f 0, contLinear f)) (x + x_1) = (fun f => (f 0, contLinear f)) (x + x_1)) },
              map_smul' :=
                (_ :
                  ∀ (x : 𝕜) (x_1 : V →A[𝕜] W),
                    AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1) =
                      AddHom.toFun
                        { toFun := fun f => (f 0, contLinear f),
                          map_add' :=
                            (_ :
                              ∀ (x x_2 : V →A[𝕜] W),
                                (fun f => (f 0, contLinear f)) (x + x_2) = (fun f => (f 0, contLinear f)) (x + x_2)) }
                        (x • x_1)) }.toAddHom
          ((fun p => ContinuousLinearMap.toContinuousAffineMap p.2 + const 𝕜 V p.1) (v, f))).2
      x✝ =
    (v, f).2 x✝

Next tactic:
simp