Skip to content

Commit d5277c9

Browse files
committed
perf(NormedSpace/OperatorNorm): fix simp call and clean up porting notes (#9658)
We clean up some porting notes and speed up this file.
1 parent 09b44c1 commit d5277c9

1 file changed

Lines changed: 6 additions & 32 deletions

File tree

Mathlib/Analysis/NormedSpace/OperatorNorm.lean

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ theorem op_norm_comp_le (f : E →SL[σ₁₂] F) : ‖h.comp f‖ ≤ ‖h‖ *
394394
exact h.le_op_norm_of_le (f.le_op_norm x)⟩
395395
#align continuous_linear_map.op_norm_comp_le ContinuousLinearMap.op_norm_comp_le
396396

397-
-- Porting note: restatement of `op_norm_comp_le` for linear maps.
398-
/-- The operator norm is submultiplicative. -/
399-
theorem op_norm_comp_le' (h : Eₗ →L[𝕜] Fₗ) (f : E →L[𝕜] Eₗ) : ‖h.comp f‖ ≤ ‖h‖ * ‖f‖ :=
400-
op_norm_comp_le h f
401-
402397
theorem op_nnnorm_comp_le [RingHomIsometric σ₁₃] (f : E →SL[σ₁₂] F) : ‖h.comp f‖₊ ≤ ‖h‖₊ * ‖f‖₊ :=
403398
op_norm_comp_le h f
404399
#align continuous_linear_map.op_nnnorm_comp_le ContinuousLinearMap.op_nnnorm_comp_le
@@ -409,12 +404,10 @@ instance toSemiNormedRing : SeminormedRing (E →L[𝕜] E) :=
409404
norm_mul := fun f g => op_norm_comp_le f g }
410405
#align continuous_linear_map.to_semi_normed_ring ContinuousLinearMap.toSemiNormedRing
411406

412-
-- Porting FIXME: replacing `(algebra : Algebra 𝕜 (E →L[𝕜] E))` with
413-
-- just `algebra` below causes a massive timeout.
414407
/-- For a normed space `E`, continuous linear endomorphisms form a normed algebra with
415408
respect to the operator norm. -/
416409
instance toNormedAlgebra : NormedAlgebra 𝕜 (E →L[𝕜] E) :=
417-
{ (algebra : Algebra 𝕜 (E →L[𝕜] E)) with
410+
{ algebra with
418411
norm_smul_le := by
419412
intro c f
420413
apply op_norm_smul_le c f}
@@ -682,12 +675,10 @@ def mkContinuousOfExistsBound₂ (f : E →ₛₗ[σ₁₃] F →ₛₗ[σ₂₃
682675
{ toFun := fun x => (f x).mkContinuousOfExistsBound <| let ⟨C, hC⟩ := h; ⟨C * ‖x‖, hC x⟩
683676
map_add' := fun x y => by
684677
ext z
685-
rw [ContinuousLinearMap.add_apply, mkContinuousOfExistsBound_apply,
686-
mkContinuousOfExistsBound_apply, mkContinuousOfExistsBound_apply, map_add, add_apply]
678+
simp
687679
map_smul' := fun c x => by
688680
ext z
689-
rw [ContinuousLinearMap.smul_apply, mkContinuousOfExistsBound_apply,
690-
mkContinuousOfExistsBound_apply, map_smulₛₗ, smul_apply] } <|
681+
simp } <|
691682
let ⟨C, hC⟩ := h; ⟨max C 0, norm_mkContinuous₂_aux f C hC⟩
692683

693684
/-- Create a bilinear map (represented as a map `E →L[𝕜] F →L[𝕜] G`) from the corresponding linear
@@ -734,10 +725,8 @@ def flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : F →SL[σ₂₃] E →SL
734725
‖f‖ fun y x => (f.le_op_norm₂ x y).trans_eq <| by simp only [mul_right_comm]
735726
#align continuous_linear_map.flip ContinuousLinearMap.flip
736727

737-
-- Porting note: in mathlib3, in the proof `norm_nonneg (flip f)` was just `norm_nonneg _`,
738-
-- but this causes a defeq error now.
739728
private theorem le_norm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f‖ ≤ ‖flip f‖ :=
740-
f.op_norm_le_bound₂ (norm_nonneg (flip f)) fun x y => by
729+
f.op_norm_le_bound₂ (norm_nonneg _) fun x y => by
741730
rw [mul_right_comm]
742731
exact (flip f).le_op_norm₂ y x
743732

@@ -960,7 +949,6 @@ variable (M₁ : Type u₁) [SeminormedAddCommGroup M₁] [NormedSpace 𝕜 M₁
960949

961950
variable {Eₗ} (𝕜)
962951

963-
set_option maxHeartbeats 400000 in
964952
/-- `ContinuousLinearMap.prodMap` as a continuous linear map. -/
965953
def prodMapL : (M₁ →L[𝕜] M₂) × (M₃ →L[𝕜] M₄) →L[𝕜] M₁ × M₃ →L[𝕜] M₂ × M₄ :=
966954
ContinuousLinearMap.copy
@@ -981,22 +969,8 @@ def prodMapL : (M₁ →L[𝕜] M₂) × (M₃ →L[𝕜] M₄) →L[𝕜] M₁
981969
apply funext
982970
rintro ⟨φ, ψ⟩
983971
refine' ContinuousLinearMap.ext fun ⟨x₁, x₂⟩ => _
984-
-- Porting note: mathport suggested:
985-
-- ```
986-
-- simp only [add_apply, coe_comp', coe_fst', Function.comp_apply, compL_apply, flip_apply,
987-
-- coe_snd', inl_apply, inr_apply, Prod.mk_add_mk, add_zero, zero_add, coe_prodMap'
988-
-- Prod_map, Prod.mk.inj_iff, eq_self_iff_true, and_self_iff]
989-
-- rfl
990-
-- ```
991-
-- Frustratingly, in `mathlib3` we can use:
992-
-- ```
993-
-- dsimp -- ⊢ (⇑φ x.fst, ⇑ψ x.snd) = (⇑φ x.fst + 0, 0 + ⇑ψ x.snd)
994-
-- simp
995-
-- ```
996-
-- Here neither `dsimp` or `simp` seem to make progress.
997-
repeat first | rw [add_apply] | rw [comp_apply] | rw [flip_apply] | rw [compL_apply]
998-
simp only [coe_prodMap', Prod_map, coe_fst', inl_apply, coe_snd', inr_apply, Prod.mk_add_mk,
999-
add_zero, zero_add])
972+
dsimp
973+
simp)
1000974
#align continuous_linear_map.prod_mapL ContinuousLinearMap.prodMapL
1001975

1002976
variable {M₁ M₂ M₃ M₄}

0 commit comments

Comments
 (0)