analysis.matrixMathlib.Analysis.Matrix

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -649,9 +649,9 @@ theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
 -/
 
-section IsROrC
+section RCLike
 
-variable [IsROrC α]
+variable [RCLike α]
 
 #print Matrix.frobenius_nnnorm_mul /-
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
@@ -661,12 +661,12 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
   refine' NNReal.rpow_le_rpow _ one_half_pos.le
   refine' Finset.sum_le_sum fun i hi => Finset.sum_le_sum fun j hj => _
   rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
-    mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
+    mul_div_cancel₀ (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
   dsimp only
   have :=
     @nnnorm_inner_le_nnnorm α _ _ _ _ ((PiLp.equiv 2 fun i => α).symm fun j => star (A i j))
       ((PiLp.equiv 2 fun i => α).symm fun k => B k j)
-  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
+  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, RCLike.inner_apply, starRingEnd_apply,
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
@@ -702,7 +702,7 @@ def frobeniusNormedAlgebra [DecidableEq m] [NormedField R] [NormedAlgebra R α]
 #align matrix.frobenius_normed_algebra Matrix.frobeniusNormedAlgebra
 -/
 
-end IsROrC
+end RCLike
 
 end frobenius
 
Diff
@@ -289,66 +289,66 @@ section SeminormedAddCommGroup
 
 variable [SeminormedAddCommGroup α]
 
-#print Matrix.linfty_op_norm_def /-
-theorem linfty_op_norm_def (A : Matrix m n α) :
+#print Matrix.linfty_opNorm_def /-
+theorem linfty_opNorm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
-#align matrix.linfty_op_norm_def Matrix.linfty_op_norm_def
+#align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
 -/
 
-#print Matrix.linfty_op_nnnorm_def /-
-theorem linfty_op_nnnorm_def (A : Matrix m n α) :
+#print Matrix.linfty_opNNNorm_def /-
+theorem linfty_opNNNorm_def (A : Matrix m n α) :
     ‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ :=
-  Subtype.ext <| linfty_op_norm_def A
-#align matrix.linfty_op_nnnorm_def Matrix.linfty_op_nnnorm_def
+  Subtype.ext <| linfty_opNorm_def A
+#align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def
 -/
 
-#print Matrix.linfty_op_nnnorm_col /-
+#print Matrix.linfty_opNNNorm_col /-
 @[simp]
-theorem linfty_op_nnnorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ :=
+theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ :=
   by
   rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
   simp
-#align matrix.linfty_op_nnnorm_col Matrix.linfty_op_nnnorm_col
+#align matrix.linfty_op_nnnorm_col Matrix.linfty_opNNNorm_col
 -/
 
-#print Matrix.linfty_op_norm_col /-
+#print Matrix.linfty_opNorm_col /-
 @[simp]
-theorem linfty_op_norm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
-  congr_arg coe <| linfty_op_nnnorm_col v
-#align matrix.linfty_op_norm_col Matrix.linfty_op_norm_col
+theorem linfty_opNorm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
+  congr_arg coe <| linfty_opNNNorm_col v
+#align matrix.linfty_op_norm_col Matrix.linfty_opNorm_col
 -/
 
-#print Matrix.linfty_op_nnnorm_row /-
+#print Matrix.linfty_opNNNorm_row /-
 @[simp]
-theorem linfty_op_nnnorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_op_nnnorm_def]
-#align matrix.linfty_op_nnnorm_row Matrix.linfty_op_nnnorm_row
+theorem linfty_opNNNorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_op_nnnorm_def]
+#align matrix.linfty_op_nnnorm_row Matrix.linfty_opNNNorm_row
 -/
 
-#print Matrix.linfty_op_norm_row /-
+#print Matrix.linfty_opNorm_row /-
 @[simp]
-theorem linfty_op_norm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
-  (congr_arg coe <| linfty_op_nnnorm_row v).trans <| by simp [NNReal.coe_sum]
-#align matrix.linfty_op_norm_row Matrix.linfty_op_norm_row
+theorem linfty_opNorm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
+  (congr_arg coe <| linfty_opNNNorm_row v).trans <| by simp [NNReal.coe_sum]
+#align matrix.linfty_op_norm_row Matrix.linfty_opNorm_row
 -/
 
-#print Matrix.linfty_op_nnnorm_diagonal /-
+#print Matrix.linfty_opNNNorm_diagonal /-
 @[simp]
-theorem linfty_op_nnnorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ :=
+theorem linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ :=
   by
   rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
   congr 1 with i : 1
   refine' (Finset.sum_eq_single_of_mem _ (Finset.mem_univ i) fun j hj hij => _).trans _
   · rw [diagonal_apply_ne' _ hij, nnnorm_zero]
   · rw [diagonal_apply_eq]
-#align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_op_nnnorm_diagonal
+#align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_opNNNorm_diagonal
 -/
 
-#print Matrix.linfty_op_norm_diagonal /-
+#print Matrix.linfty_opNorm_diagonal /-
 @[simp]
-theorem linfty_op_norm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
-  congr_arg coe <| linfty_op_nnnorm_diagonal v
-#align matrix.linfty_op_norm_diagonal Matrix.linfty_op_norm_diagonal
+theorem linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
+  congr_arg coe <| linfty_opNNNorm_diagonal v
+#align matrix.linfty_op_norm_diagonal Matrix.linfty_opNorm_diagonal
 -/
 
 end SeminormedAddCommGroup
@@ -358,8 +358,8 @@ section NonUnitalSeminormedRing
 variable [NonUnitalSeminormedRing α]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (k j) -/
-#print Matrix.linfty_op_nnnorm_mul /-
-theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
+#print Matrix.linfty_opNNNorm_mul /-
+theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
   by
   simp_rw [linfty_op_nnnorm_def, Matrix.mul_apply]
   calc
@@ -374,27 +374,27 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
         Finset.sum_le_sum fun j hj => mul_le_mul_of_nonneg_left (Finset.le_sup hj) (zero_le _))
     _ ≤ (finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
-#align matrix.linfty_op_nnnorm_mul Matrix.linfty_op_nnnorm_mul
+#align matrix.linfty_op_nnnorm_mul Matrix.linfty_opNNNorm_mul
 -/
 
-#print Matrix.linfty_op_norm_mul /-
-theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
-  linfty_op_nnnorm_mul _ _
-#align matrix.linfty_op_norm_mul Matrix.linfty_op_norm_mul
+#print Matrix.linfty_opNorm_mul /-
+theorem linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
+  linfty_opNNNorm_mul _ _
+#align matrix.linfty_op_norm_mul Matrix.linfty_opNorm_mul
 -/
 
-#print Matrix.linfty_op_nnnorm_mulVec /-
-theorem linfty_op_nnnorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ :=
+#print Matrix.linfty_opNNNorm_mulVec /-
+theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ :=
   by
   rw [← linfty_op_nnnorm_col (A.mul_vec v), ← linfty_op_nnnorm_col v]
   exact linfty_op_nnnorm_mul A (col v)
-#align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_op_nnnorm_mulVec
+#align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_opNNNorm_mulVec
 -/
 
-#print Matrix.linfty_op_norm_mulVec /-
-theorem linfty_op_norm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
-  linfty_op_nnnorm_mulVec _ _
-#align matrix.linfty_op_norm_mul_vec Matrix.linfty_op_norm_mulVec
+#print Matrix.linfty_opNorm_mulVec /-
+theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
+  linfty_opNNNorm_mulVec _ _
+#align matrix.linfty_op_norm_mul_vec Matrix.linfty_opNorm_mulVec
 -/
 
 end NonUnitalSeminormedRing
@@ -407,16 +407,16 @@ the norm of a matrix. -/
 protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
     NonUnitalSeminormedRing (Matrix n n α) :=
   { Matrix.linftyOpSeminormedAddCommGroup, Matrix.instNonUnitalRing with
-    norm_hMul := linfty_op_norm_mul }
+    norm_hMul := linfty_opNorm_mul }
 #align matrix.linfty_op_non_unital_semi_normed_ring Matrix.linftyOpNonUnitalSemiNormedRing
 -/
 
-#print Matrix.linfty_op_normOneClass /-
+#print Matrix.linfty_opNormOneClass /-
 /-- The `L₁-L∞` norm preserves one on non-empty matrices. Note this is safe as an instance, as it
 carries no data. -/
-instance linfty_op_normOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
-    NormOneClass (Matrix n n α) where norm_one := (linfty_op_norm_diagonal _).trans norm_one
-#align matrix.linfty_op_norm_one_class Matrix.linfty_op_normOneClass
+instance linfty_opNormOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
+    NormOneClass (Matrix n n α) where norm_one := (linfty_opNorm_diagonal _).trans norm_one
+#align matrix.linfty_op_norm_one_class Matrix.linfty_opNormOneClass
 -/
 
 #print Matrix.linftyOpSemiNormedRing /-
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
 -/
-import Mathbin.Analysis.NormedSpace.Basic
-import Mathbin.Analysis.NormedSpace.PiLp
-import Mathbin.Analysis.InnerProductSpace.PiL2
+import Analysis.NormedSpace.Basic
+import Analysis.NormedSpace.PiLp
+import Analysis.InnerProductSpace.PiL2
 
 #align_import analysis.matrix from "leanprover-community/mathlib"@"5d0c76894ada7940957143163d7b921345474cbc"
 
Diff
@@ -584,7 +584,7 @@ instance frobenius_normedStarGroup [StarAddMonoid α] [NormedStarGroup α] :
 theorem frobenius_norm_row (v : m → α) : ‖row v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
   by
   rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
-  simp only [row_apply, Real.rpow_two, PiLp.equiv_symm_apply]
+  simp only [row_apply, Real.rpow_two, WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_norm_row Matrix.frobenius_norm_row
 -/
 
@@ -600,7 +600,7 @@ theorem frobenius_nnnorm_row (v : m → α) : ‖row v‖₊ = ‖(PiLp.equiv 2
 theorem frobenius_norm_col (v : n → α) : ‖col v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
   by
   simp_rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
-  simp only [col_apply, Real.rpow_two, PiLp.equiv_symm_apply]
+  simp only [col_apply, Real.rpow_two, WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_norm_col Matrix.frobenius_norm_col
 -/
 
@@ -666,7 +666,7 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
   have :=
     @nnnorm_inner_le_nnnorm α _ _ _ _ ((PiLp.equiv 2 fun i => α).symm fun j => star (A i j))
       ((PiLp.equiv 2 fun i => α).symm fun k => B k j)
-  simpa only [PiLp.equiv_symm_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
+  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
Diff
@@ -407,7 +407,7 @@ the norm of a matrix. -/
 protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
     NonUnitalSeminormedRing (Matrix n n α) :=
   { Matrix.linftyOpSeminormedAddCommGroup, Matrix.instNonUnitalRing with
-    norm_mul := linfty_op_norm_mul }
+    norm_hMul := linfty_op_norm_mul }
 #align matrix.linfty_op_non_unital_semi_normed_ring Matrix.linftyOpNonUnitalSemiNormedRing
 -/
 
@@ -687,7 +687,7 @@ def frobeniusNormedRing [DecidableEq m] : NormedRing (Matrix m m α) :=
   {
     Matrix.frobeniusSeminormedAddCommGroup with
     norm := Norm.norm
-    norm_mul := frobenius_norm_mul }
+    norm_hMul := frobenius_norm_mul }
 #align matrix.frobenius_normed_ring Matrix.frobeniusNormedRing
 -/
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.matrix
-! leanprover-community/mathlib commit 5d0c76894ada7940957143163d7b921345474cbc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.NormedSpace.Basic
 import Mathbin.Analysis.NormedSpace.PiLp
 import Mathbin.Analysis.InnerProductSpace.PiL2
 
+#align_import analysis.matrix from "leanprover-community/mathlib"@"5d0c76894ada7940957143163d7b921345474cbc"
+
 /-!
 # Matrices as a normed space
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
 
 ! This file was ported from Lean 3 source module analysis.matrix
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
+! leanprover-community/mathlib commit 5d0c76894ada7940957143163d7b921345474cbc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Analysis.InnerProductSpace.PiL2
 /-!
 # Matrices as a normed space
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we provide the following non-instances for norms on matrices:
 
 * The elementwise norm:
Diff
@@ -64,91 +64,126 @@ section SeminormedAddCommGroup
 
 variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
 
+#print Matrix.seminormedAddCommGroup /-
 /-- Seminormed group instance (using sup norm of sup norm) for matrices over a seminormed group. Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 protected def seminormedAddCommGroup : SeminormedAddCommGroup (Matrix m n α) :=
   Pi.seminormedAddCommGroup
 #align matrix.seminormed_add_comm_group Matrix.seminormedAddCommGroup
+-/
 
 attribute [local instance] Matrix.seminormedAddCommGroup
 
+#print Matrix.norm_le_iff /-
 theorem norm_le_iff {r : ℝ} (hr : 0 ≤ r) {A : Matrix m n α} : ‖A‖ ≤ r ↔ ∀ i j, ‖A i j‖ ≤ r := by
   simp [pi_norm_le_iff_of_nonneg hr]
 #align matrix.norm_le_iff Matrix.norm_le_iff
+-/
 
+#print Matrix.nnnorm_le_iff /-
 theorem nnnorm_le_iff {r : ℝ≥0} {A : Matrix m n α} : ‖A‖₊ ≤ r ↔ ∀ i j, ‖A i j‖₊ ≤ r := by
   simp [pi_nnnorm_le_iff]
 #align matrix.nnnorm_le_iff Matrix.nnnorm_le_iff
+-/
 
+#print Matrix.norm_lt_iff /-
 theorem norm_lt_iff {r : ℝ} (hr : 0 < r) {A : Matrix m n α} : ‖A‖ < r ↔ ∀ i j, ‖A i j‖ < r := by
   simp [pi_norm_lt_iff hr]
 #align matrix.norm_lt_iff Matrix.norm_lt_iff
+-/
 
+#print Matrix.nnnorm_lt_iff /-
 theorem nnnorm_lt_iff {r : ℝ≥0} (hr : 0 < r) {A : Matrix m n α} : ‖A‖₊ < r ↔ ∀ i j, ‖A i j‖₊ < r :=
   by simp [pi_nnnorm_lt_iff hr]
 #align matrix.nnnorm_lt_iff Matrix.nnnorm_lt_iff
+-/
 
+#print Matrix.norm_entry_le_entrywise_sup_norm /-
 theorem norm_entry_le_entrywise_sup_norm (A : Matrix m n α) {i : m} {j : n} : ‖A i j‖ ≤ ‖A‖ :=
   (norm_le_pi_norm (A i) j).trans (norm_le_pi_norm A i)
 #align matrix.norm_entry_le_entrywise_sup_norm Matrix.norm_entry_le_entrywise_sup_norm
+-/
 
+#print Matrix.nnnorm_entry_le_entrywise_sup_nnnorm /-
 theorem nnnorm_entry_le_entrywise_sup_nnnorm (A : Matrix m n α) {i : m} {j : n} : ‖A i j‖₊ ≤ ‖A‖₊ :=
   (nnnorm_le_pi_nnnorm (A i) j).trans (nnnorm_le_pi_nnnorm A i)
 #align matrix.nnnorm_entry_le_entrywise_sup_nnnorm Matrix.nnnorm_entry_le_entrywise_sup_nnnorm
+-/
 
+#print Matrix.nnnorm_map_eq /-
 @[simp]
 theorem nnnorm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖₊ = ‖a‖₊) :
     ‖A.map f‖₊ = ‖A‖₊ := by simp_rw [Pi.nnnorm_def, Matrix.map_apply, hf]
 #align matrix.nnnorm_map_eq Matrix.nnnorm_map_eq
+-/
 
+#print Matrix.norm_map_eq /-
 @[simp]
 theorem norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ = ‖a‖) : ‖A.map f‖ = ‖A‖ :=
   (congr_arg (coe : ℝ≥0 → ℝ) <| nnnorm_map_eq A f fun a => Subtype.ext <| hf a : _)
 #align matrix.norm_map_eq Matrix.norm_map_eq
+-/
 
+#print Matrix.nnnorm_transpose /-
 @[simp]
 theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by simp_rw [Pi.nnnorm_def];
   exact Finset.sup_comm _ _ _
 #align matrix.nnnorm_transpose Matrix.nnnorm_transpose
+-/
 
+#print Matrix.norm_transpose /-
 @[simp]
 theorem norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖ :=
   congr_arg coe <| nnnorm_transpose A
 #align matrix.norm_transpose Matrix.norm_transpose
+-/
 
+#print Matrix.nnnorm_conjTranspose /-
 @[simp]
 theorem nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
     ‖Aᴴ‖₊ = ‖A‖₊ :=
   (nnnorm_map_eq _ _ nnnorm_star).trans A.nnnorm_transpose
 #align matrix.nnnorm_conj_transpose Matrix.nnnorm_conjTranspose
+-/
 
+#print Matrix.norm_conjTranspose /-
 @[simp]
 theorem norm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) : ‖Aᴴ‖ = ‖A‖ :=
   congr_arg coe <| nnnorm_conjTranspose A
 #align matrix.norm_conj_transpose Matrix.norm_conjTranspose
+-/
 
 instance [StarAddMonoid α] [NormedStarGroup α] : NormedStarGroup (Matrix m m α) :=
   ⟨norm_conjTranspose⟩
 
+#print Matrix.nnnorm_col /-
 @[simp]
 theorem nnnorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by simp [Pi.nnnorm_def]
 #align matrix.nnnorm_col Matrix.nnnorm_col
+-/
 
+#print Matrix.norm_col /-
 @[simp]
 theorem norm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
   congr_arg coe <| nnnorm_col v
 #align matrix.norm_col Matrix.norm_col
+-/
 
+#print Matrix.nnnorm_row /-
 @[simp]
 theorem nnnorm_row (v : n → α) : ‖row v‖₊ = ‖v‖₊ := by simp [Pi.nnnorm_def]
 #align matrix.nnnorm_row Matrix.nnnorm_row
+-/
 
+#print Matrix.norm_row /-
 @[simp]
 theorem norm_row (v : n → α) : ‖row v‖ = ‖v‖ :=
   congr_arg coe <| nnnorm_row v
 #align matrix.norm_row Matrix.norm_row
+-/
 
+#print Matrix.nnnorm_diagonal /-
 @[simp]
 theorem nnnorm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖₊ = ‖v‖₊ :=
   by
@@ -162,11 +197,14 @@ theorem nnnorm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖₊ = 
   · refine' Eq.trans_le _ (Finset.le_sup (Finset.mem_univ i))
     rw [diagonal_apply_eq]
 #align matrix.nnnorm_diagonal Matrix.nnnorm_diagonal
+-/
 
+#print Matrix.norm_diagonal /-
 @[simp]
 theorem norm_diagonal [DecidableEq n] (v : n → α) : ‖diagonal v‖ = ‖v‖ :=
   congr_arg coe <| nnnorm_diagonal v
 #align matrix.norm_diagonal Matrix.norm_diagonal
+-/
 
 /-- Note this is safe as an instance as it carries no data. -/
 @[nolint fails_quickly]
@@ -175,12 +213,14 @@ instance [Nonempty n] [DecidableEq n] [One α] [NormOneClass α] : NormOneClass
 
 end SeminormedAddCommGroup
 
+#print Matrix.normedAddCommGroup /-
 /-- Normed group instance (using sup norm of sup norm) for matrices over a normed group.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 protected def normedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) :=
   Pi.normedAddCommGroup
 #align matrix.normed_add_comm_group Matrix.normedAddCommGroup
+-/
 
 section NormedSpace
 
@@ -188,12 +228,14 @@ attribute [local instance] Matrix.seminormedAddCommGroup
 
 variable [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α]
 
+#print Matrix.normedSpace /-
 /-- Normed space instance (using sup norm of sup norm) for matrices over a normed space.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 protected def normedSpace : NormedSpace R (Matrix m n α) :=
   Pi.normedSpace
 #align matrix.normed_space Matrix.normedSpace
+-/
 
 end NormedSpace
 
@@ -210,6 +252,7 @@ $L^\infty$ spaces.
 
 section LinftyOp
 
+#print Matrix.linftyOpSeminormedAddCommGroup /-
 /-- Seminormed group instance (using sup norm of L1 norm) for matrices over a seminormed group. Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -218,7 +261,9 @@ protected def linftyOpSeminormedAddCommGroup [SeminormedAddCommGroup α] :
     SeminormedAddCommGroup (Matrix m n α) :=
   (by infer_instance : SeminormedAddCommGroup (m → PiLp 1 fun j : n => α))
 #align matrix.linfty_op_seminormed_add_comm_group Matrix.linftyOpSeminormedAddCommGroup
+-/
 
+#print Matrix.linftyOpNormedAddCommGroup /-
 /-- Normed group instance (using sup norm of L1 norm) for matrices over a normed ring.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -227,7 +272,9 @@ protected def linftyOpNormedAddCommGroup [NormedAddCommGroup α] :
     NormedAddCommGroup (Matrix m n α) :=
   (by infer_instance : NormedAddCommGroup (m → PiLp 1 fun j : n => α))
 #align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup
+-/
 
+#print Matrix.linftyOpNormedSpace /-
 /-- Normed space instance (using sup norm of L1 norm) for matrices over a normed space.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -236,42 +283,56 @@ protected def linftyOpNormedSpace [NormedField R] [SeminormedAddCommGroup α] [N
     NormedSpace R (Matrix m n α) :=
   (by infer_instance : NormedSpace R (m → PiLp 1 fun j : n => α))
 #align matrix.linfty_op_normed_space Matrix.linftyOpNormedSpace
+-/
 
 section SeminormedAddCommGroup
 
 variable [SeminormedAddCommGroup α]
 
+#print Matrix.linfty_op_norm_def /-
 theorem linfty_op_norm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_op_norm_def
+-/
 
+#print Matrix.linfty_op_nnnorm_def /-
 theorem linfty_op_nnnorm_def (A : Matrix m n α) :
     ‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ :=
   Subtype.ext <| linfty_op_norm_def A
 #align matrix.linfty_op_nnnorm_def Matrix.linfty_op_nnnorm_def
+-/
 
+#print Matrix.linfty_op_nnnorm_col /-
 @[simp]
 theorem linfty_op_nnnorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ :=
   by
   rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
   simp
 #align matrix.linfty_op_nnnorm_col Matrix.linfty_op_nnnorm_col
+-/
 
+#print Matrix.linfty_op_norm_col /-
 @[simp]
 theorem linfty_op_norm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
   congr_arg coe <| linfty_op_nnnorm_col v
 #align matrix.linfty_op_norm_col Matrix.linfty_op_norm_col
+-/
 
+#print Matrix.linfty_op_nnnorm_row /-
 @[simp]
 theorem linfty_op_nnnorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_op_nnnorm_def]
 #align matrix.linfty_op_nnnorm_row Matrix.linfty_op_nnnorm_row
+-/
 
+#print Matrix.linfty_op_norm_row /-
 @[simp]
 theorem linfty_op_norm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
   (congr_arg coe <| linfty_op_nnnorm_row v).trans <| by simp [NNReal.coe_sum]
 #align matrix.linfty_op_norm_row Matrix.linfty_op_norm_row
+-/
 
+#print Matrix.linfty_op_nnnorm_diagonal /-
 @[simp]
 theorem linfty_op_nnnorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ :=
   by
@@ -281,11 +342,14 @@ theorem linfty_op_nnnorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v
   · rw [diagonal_apply_ne' _ hij, nnnorm_zero]
   · rw [diagonal_apply_eq]
 #align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_op_nnnorm_diagonal
+-/
 
+#print Matrix.linfty_op_norm_diagonal /-
 @[simp]
 theorem linfty_op_norm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
   congr_arg coe <| linfty_op_nnnorm_diagonal v
 #align matrix.linfty_op_norm_diagonal Matrix.linfty_op_norm_diagonal
+-/
 
 end SeminormedAddCommGroup
 
@@ -294,6 +358,7 @@ section NonUnitalSeminormedRing
 variable [NonUnitalSeminormedRing α]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (k j) -/
+#print Matrix.linfty_op_nnnorm_mul /-
 theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
   by
   simp_rw [linfty_op_nnnorm_def, Matrix.mul_apply]
@@ -310,48 +375,62 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
     _ ≤ (finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
 #align matrix.linfty_op_nnnorm_mul Matrix.linfty_op_nnnorm_mul
+-/
 
+#print Matrix.linfty_op_norm_mul /-
 theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
   linfty_op_nnnorm_mul _ _
 #align matrix.linfty_op_norm_mul Matrix.linfty_op_norm_mul
+-/
 
+#print Matrix.linfty_op_nnnorm_mulVec /-
 theorem linfty_op_nnnorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ :=
   by
   rw [← linfty_op_nnnorm_col (A.mul_vec v), ← linfty_op_nnnorm_col v]
   exact linfty_op_nnnorm_mul A (col v)
 #align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_op_nnnorm_mulVec
+-/
 
+#print Matrix.linfty_op_norm_mulVec /-
 theorem linfty_op_norm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
   linfty_op_nnnorm_mulVec _ _
 #align matrix.linfty_op_norm_mul_vec Matrix.linfty_op_norm_mulVec
+-/
 
 end NonUnitalSeminormedRing
 
+#print Matrix.linftyOpNonUnitalSemiNormedRing /-
 /-- Seminormed non-unital ring instance (using sup norm of L1 norm) for matrices over a semi normed
 non-unital ring. Not declared as an instance because there are several natural choices for defining
 the norm of a matrix. -/
 @[local instance]
 protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
     NonUnitalSeminormedRing (Matrix n n α) :=
-  { Matrix.linftyOpSeminormedAddCommGroup, Matrix.nonUnitalRing with
+  { Matrix.linftyOpSeminormedAddCommGroup, Matrix.instNonUnitalRing with
     norm_mul := linfty_op_norm_mul }
 #align matrix.linfty_op_non_unital_semi_normed_ring Matrix.linftyOpNonUnitalSemiNormedRing
+-/
 
+#print Matrix.linfty_op_normOneClass /-
 /-- The `L₁-L∞` norm preserves one on non-empty matrices. Note this is safe as an instance, as it
 carries no data. -/
 instance linfty_op_normOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
     NormOneClass (Matrix n n α) where norm_one := (linfty_op_norm_diagonal _).trans norm_one
 #align matrix.linfty_op_norm_one_class Matrix.linfty_op_normOneClass
+-/
 
+#print Matrix.linftyOpSemiNormedRing /-
 /-- Seminormed ring instance (using sup norm of L1 norm) for matrices over a semi normed ring.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 @[local instance]
 protected def linftyOpSemiNormedRing [SeminormedRing α] [DecidableEq n] :
     SeminormedRing (Matrix n n α) :=
-  { Matrix.linftyOpNonUnitalSemiNormedRing, Matrix.ring with }
+  { Matrix.linftyOpNonUnitalSemiNormedRing, Matrix.instRing with }
 #align matrix.linfty_op_semi_normed_ring Matrix.linftyOpSemiNormedRing
+-/
 
+#print Matrix.linftyOpNonUnitalNormedRing /-
 /-- Normed non-unital ring instance (using sup norm of L1 norm) for matrices over a normed
 non-unital ring. Not declared as an instance because there are several natural choices for defining
 the norm of a matrix. -/
@@ -360,7 +439,9 @@ protected def linftyOpNonUnitalNormedRing [NonUnitalNormedRing α] :
     NonUnitalNormedRing (Matrix n n α) :=
   { Matrix.linftyOpNonUnitalSemiNormedRing with }
 #align matrix.linfty_op_non_unital_normed_ring Matrix.linftyOpNonUnitalNormedRing
+-/
 
+#print Matrix.linftyOpNormedRing /-
 /-- Normed ring instance (using sup norm of L1 norm) for matrices over a normed ring.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -368,7 +449,9 @@ matrix. -/
 protected def linftyOpNormedRing [NormedRing α] [DecidableEq n] : NormedRing (Matrix n n α) :=
   { Matrix.linftyOpSemiNormedRing with }
 #align matrix.linfty_op_normed_ring Matrix.linftyOpNormedRing
+-/
 
+#print Matrix.linftyOpNormedAlgebra /-
 /-- Normed algebra instance (using sup norm of L1 norm) for matrices over a normed algebra. Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -377,6 +460,7 @@ protected def linftyOpNormedAlgebra [NormedField R] [SeminormedRing α] [NormedA
     [DecidableEq n] : NormedAlgebra R (Matrix n n α) :=
   { Matrix.linftyOpNormedSpace with }
 #align matrix.linfty_op_normed_algebra Matrix.linftyOpNormedAlgebra
+-/
 
 end LinftyOp
 
@@ -391,6 +475,7 @@ section frobenius
 
 open scoped Matrix BigOperators
 
+#print Matrix.frobeniusSeminormedAddCommGroup /-
 /-- Seminormed group instance (using frobenius norm) for matrices over a seminormed group. Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -399,7 +484,9 @@ def frobeniusSeminormedAddCommGroup [SeminormedAddCommGroup α] :
     SeminormedAddCommGroup (Matrix m n α) :=
   (by infer_instance : SeminormedAddCommGroup (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
 #align matrix.frobenius_seminormed_add_comm_group Matrix.frobeniusSeminormedAddCommGroup
+-/
 
+#print Matrix.frobeniusNormedAddCommGroup /-
 /-- Normed group instance (using frobenius norm) for matrices over a normed group.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -407,7 +494,9 @@ matrix. -/
 def frobeniusNormedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Matrix m n α) :=
   (by infer_instance : NormedAddCommGroup (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
 #align matrix.frobenius_normed_add_comm_group Matrix.frobeniusNormedAddCommGroup
+-/
 
+#print Matrix.frobeniusNormedSpace /-
 /-- Normed space instance (using frobenius norm) for matrices over a normed space.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -416,85 +505,113 @@ def frobeniusNormedSpace [NormedField R] [SeminormedAddCommGroup α] [NormedSpac
     NormedSpace R (Matrix m n α) :=
   (by infer_instance : NormedSpace R (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
 #align matrix.frobenius_normed_space Matrix.frobeniusNormedSpace
+-/
 
 section SeminormedAddCommGroup
 
 variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/
+#print Matrix.frobenius_nnnorm_def /-
 theorem frobenius_nnnorm_def (A : Matrix m n α) :
     ‖A‖₊ = (∑ (i) (j), ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) := by
   simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two]
 #align matrix.frobenius_nnnorm_def Matrix.frobenius_nnnorm_def
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (i j) -/
+#print Matrix.frobenius_norm_def /-
 theorem frobenius_norm_def (A : Matrix m n α) :
     ‖A‖ = (∑ (i) (j), ‖A i j‖ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) :=
   (congr_arg coe (frobenius_nnnorm_def A)).trans <| by simp [NNReal.coe_sum]
 #align matrix.frobenius_norm_def Matrix.frobenius_norm_def
+-/
 
+#print Matrix.frobenius_nnnorm_map_eq /-
 @[simp]
 theorem frobenius_nnnorm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖₊ = ‖a‖₊) :
     ‖A.map f‖₊ = ‖A‖₊ := by simp_rw [frobenius_nnnorm_def, Matrix.map_apply, hf]
 #align matrix.frobenius_nnnorm_map_eq Matrix.frobenius_nnnorm_map_eq
+-/
 
+#print Matrix.frobenius_norm_map_eq /-
 @[simp]
 theorem frobenius_norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ = ‖a‖) :
     ‖A.map f‖ = ‖A‖ :=
   (congr_arg (coe : ℝ≥0 → ℝ) <| frobenius_nnnorm_map_eq A f fun a => Subtype.ext <| hf a : _)
 #align matrix.frobenius_norm_map_eq Matrix.frobenius_norm_map_eq
+-/
 
+#print Matrix.frobenius_nnnorm_transpose /-
 @[simp]
 theorem frobenius_nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by
   rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]; rfl
 #align matrix.frobenius_nnnorm_transpose Matrix.frobenius_nnnorm_transpose
+-/
 
+#print Matrix.frobenius_norm_transpose /-
 @[simp]
 theorem frobenius_norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖ :=
   congr_arg coe <| frobenius_nnnorm_transpose A
 #align matrix.frobenius_norm_transpose Matrix.frobenius_norm_transpose
+-/
 
+#print Matrix.frobenius_nnnorm_conjTranspose /-
 @[simp]
 theorem frobenius_nnnorm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
     ‖Aᴴ‖₊ = ‖A‖₊ :=
   (frobenius_nnnorm_map_eq _ _ nnnorm_star).trans A.frobenius_nnnorm_transpose
 #align matrix.frobenius_nnnorm_conj_transpose Matrix.frobenius_nnnorm_conjTranspose
+-/
 
+#print Matrix.frobenius_norm_conjTranspose /-
 @[simp]
 theorem frobenius_norm_conjTranspose [StarAddMonoid α] [NormedStarGroup α] (A : Matrix m n α) :
     ‖Aᴴ‖ = ‖A‖ :=
   congr_arg coe <| frobenius_nnnorm_conjTranspose A
 #align matrix.frobenius_norm_conj_transpose Matrix.frobenius_norm_conjTranspose
+-/
 
+#print Matrix.frobenius_normedStarGroup /-
 instance frobenius_normedStarGroup [StarAddMonoid α] [NormedStarGroup α] :
     NormedStarGroup (Matrix m m α) :=
   ⟨frobenius_norm_conjTranspose⟩
 #align matrix.frobenius_normed_star_group Matrix.frobenius_normedStarGroup
+-/
 
+#print Matrix.frobenius_norm_row /-
 @[simp]
 theorem frobenius_norm_row (v : m → α) : ‖row v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
   by
   rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
   simp only [row_apply, Real.rpow_two, PiLp.equiv_symm_apply]
 #align matrix.frobenius_norm_row Matrix.frobenius_norm_row
+-/
 
+#print Matrix.frobenius_nnnorm_row /-
 @[simp]
 theorem frobenius_nnnorm_row (v : m → α) : ‖row v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ :=
   Subtype.ext <| frobenius_norm_row v
 #align matrix.frobenius_nnnorm_row Matrix.frobenius_nnnorm_row
+-/
 
+#print Matrix.frobenius_norm_col /-
 @[simp]
 theorem frobenius_norm_col (v : n → α) : ‖col v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
   by
   simp_rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
   simp only [col_apply, Real.rpow_two, PiLp.equiv_symm_apply]
 #align matrix.frobenius_norm_col Matrix.frobenius_norm_col
+-/
 
+#print Matrix.frobenius_nnnorm_col /-
 @[simp]
 theorem frobenius_nnnorm_col (v : n → α) : ‖col v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ :=
   Subtype.ext <| frobenius_norm_col v
 #align matrix.frobenius_nnnorm_col Matrix.frobenius_nnnorm_col
+-/
 
+#print Matrix.frobenius_nnnorm_diagonal /-
 @[simp]
 theorem frobenius_nnnorm_diagonal [DecidableEq n] (v : n → α) :
     ‖diagonal v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ :=
@@ -510,15 +627,19 @@ theorem frobenius_nnnorm_diagonal [DecidableEq n] (v : n → α) :
     intro h
     exact finset.mem_map.not.mp his ⟨i.1, Finset.mem_univ _, Prod.ext rfl h⟩
 #align matrix.frobenius_nnnorm_diagonal Matrix.frobenius_nnnorm_diagonal
+-/
 
+#print Matrix.frobenius_norm_diagonal /-
 @[simp]
 theorem frobenius_norm_diagonal [DecidableEq n] (v : n → α) :
     ‖diagonal v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
   (congr_arg coe <| frobenius_nnnorm_diagonal v : _).trans rfl
 #align matrix.frobenius_norm_diagonal Matrix.frobenius_norm_diagonal
+-/
 
 end SeminormedAddCommGroup
 
+#print Matrix.frobenius_nnnorm_one /-
 theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α] :
     ‖(1 : Matrix n n α)‖₊ = NNReal.sqrt (Fintype.card n) * ‖(1 : α)‖₊ :=
   by
@@ -526,11 +647,13 @@ theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α
   simp_rw [PiLp.nnnorm_equiv_symm_const ENNReal.two_ne_top, NNReal.sqrt_eq_rpow]
   simp only [ENNReal.toReal_div, ENNReal.one_toReal, ENNReal.toReal_bit0]
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
+-/
 
 section IsROrC
 
 variable [IsROrC α]
 
+#print Matrix.frobenius_nnnorm_mul /-
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
   by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
@@ -547,11 +670,15 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
+-/
 
+#print Matrix.frobenius_norm_mul /-
 theorem frobenius_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
   frobenius_nnnorm_mul A B
 #align matrix.frobenius_norm_mul Matrix.frobenius_norm_mul
+-/
 
+#print Matrix.frobeniusNormedRing /-
 /-- Normed ring instance (using frobenius norm) for matrices over `ℝ` or `ℂ`.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -562,7 +689,9 @@ def frobeniusNormedRing [DecidableEq m] : NormedRing (Matrix m m α) :=
     norm := Norm.norm
     norm_mul := frobenius_norm_mul }
 #align matrix.frobenius_normed_ring Matrix.frobeniusNormedRing
+-/
 
+#print Matrix.frobeniusNormedAlgebra /-
 /-- Normed algebra instance (using frobenius norm) for matrices over `ℝ` or `ℂ`.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -571,6 +700,7 @@ def frobeniusNormedAlgebra [DecidableEq m] [NormedField R] [NormedAlgebra R α]
     NormedAlgebra R (Matrix m m α) :=
   { Matrix.frobeniusNormedSpace with }
 #align matrix.frobenius_normed_algebra Matrix.frobeniusNormedAlgebra
+-/
 
 end IsROrC
 
Diff
@@ -309,7 +309,6 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
         Finset.sum_le_sum fun j hj => mul_le_mul_of_nonneg_left (Finset.le_sup hj) (zero_le _))
     _ ≤ (finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
-    
 #align matrix.linfty_op_nnnorm_mul Matrix.linfty_op_nnnorm_mul
 
 theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
Diff
@@ -525,7 +525,7 @@ theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α
   by
   refine' (frobenius_nnnorm_diagonal _).trans _
   simp_rw [PiLp.nnnorm_equiv_symm_const ENNReal.two_ne_top, NNReal.sqrt_eq_rpow]
-  simp only [ENNReal.toReal_div, ENNReal.one_toReal, [anonymous]]
+  simp only [ENNReal.toReal_div, ENNReal.one_toReal, ENNReal.toReal_bit0]
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
 
 section IsROrC
Diff
@@ -49,7 +49,7 @@ of a matrix.
 
 noncomputable section
 
-open BigOperators NNReal Matrix
+open scoped BigOperators NNReal Matrix
 
 namespace Matrix
 
@@ -390,7 +390,7 @@ When the matrix is over the real or complex numbers, this norm is submultiplicat
 
 section frobenius
 
-open Matrix BigOperators
+open scoped Matrix BigOperators
 
 /-- Seminormed group instance (using frobenius norm) for matrices over a seminormed group. Not
 declared as an instance because there are several natural choices for defining the norm of a
Diff
@@ -108,9 +108,7 @@ theorem norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ =
 #align matrix.norm_map_eq Matrix.norm_map_eq
 
 @[simp]
-theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ :=
-  by
-  simp_rw [Pi.nnnorm_def]
+theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by simp_rw [Pi.nnnorm_def];
   exact Finset.sup_comm _ _ _
 #align matrix.nnnorm_transpose Matrix.nnnorm_transpose
 
@@ -448,10 +446,8 @@ theorem frobenius_norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, 
 #align matrix.frobenius_norm_map_eq Matrix.frobenius_norm_map_eq
 
 @[simp]
-theorem frobenius_nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ :=
-  by
-  rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]
-  rfl
+theorem frobenius_nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by
+  rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]; rfl
 #align matrix.frobenius_nnnorm_transpose Matrix.frobenius_nnnorm_transpose
 
 @[simp]
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
 
 ! This file was ported from Lean 3 source module analysis.matrix
-! leanprover-community/mathlib commit 17ef379e997badd73e5eabb4d38f11919ab3c4b3
+! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -546,7 +546,7 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
     mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
   dsimp only
   have :=
-    @nnnorm_inner_le_nnnorm α _ _ _ ((PiLp.equiv 2 fun i => α).symm fun j => star (A i j))
+    @nnnorm_inner_le_nnnorm α _ _ _ _ ((PiLp.equiv 2 fun i => α).symm fun j => star (A i j))
       ((PiLp.equiv 2 fun i => α).symm fun k => B k j)
   simpa only [PiLp.equiv_symm_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
Diff
@@ -291,9 +291,9 @@ theorem linfty_op_norm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v
 
 end SeminormedAddCommGroup
 
-section NonUnitalSemiNormedRing
+section NonUnitalSeminormedRing
 
-variable [NonUnitalSemiNormedRing α]
+variable [NonUnitalSeminormedRing α]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (k j) -/
 theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ :=
@@ -328,21 +328,21 @@ theorem linfty_op_norm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mul
   linfty_op_nnnorm_mulVec _ _
 #align matrix.linfty_op_norm_mul_vec Matrix.linfty_op_norm_mulVec
 
-end NonUnitalSemiNormedRing
+end NonUnitalSeminormedRing
 
 /-- Seminormed non-unital ring instance (using sup norm of L1 norm) for matrices over a semi normed
 non-unital ring. Not declared as an instance because there are several natural choices for defining
 the norm of a matrix. -/
 @[local instance]
-protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSemiNormedRing α] :
-    NonUnitalSemiNormedRing (Matrix n n α) :=
+protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
+    NonUnitalSeminormedRing (Matrix n n α) :=
   { Matrix.linftyOpSeminormedAddCommGroup, Matrix.nonUnitalRing with
     norm_mul := linfty_op_norm_mul }
 #align matrix.linfty_op_non_unital_semi_normed_ring Matrix.linftyOpNonUnitalSemiNormedRing
 
 /-- The `L₁-L∞` norm preserves one on non-empty matrices. Note this is safe as an instance, as it
 carries no data. -/
-instance linfty_op_normOneClass [SemiNormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
+instance linfty_op_normOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
     NormOneClass (Matrix n n α) where norm_one := (linfty_op_norm_diagonal _).trans norm_one
 #align matrix.linfty_op_norm_one_class Matrix.linfty_op_normOneClass
 
@@ -350,8 +350,8 @@ instance linfty_op_normOneClass [SemiNormedRing α] [NormOneClass α] [Decidable
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 @[local instance]
-protected def linftyOpSemiNormedRing [SemiNormedRing α] [DecidableEq n] :
-    SemiNormedRing (Matrix n n α) :=
+protected def linftyOpSemiNormedRing [SeminormedRing α] [DecidableEq n] :
+    SeminormedRing (Matrix n n α) :=
   { Matrix.linftyOpNonUnitalSemiNormedRing, Matrix.ring with }
 #align matrix.linfty_op_semi_normed_ring Matrix.linftyOpSemiNormedRing
 
@@ -376,7 +376,7 @@ protected def linftyOpNormedRing [NormedRing α] [DecidableEq n] : NormedRing (M
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
 @[local instance]
-protected def linftyOpNormedAlgebra [NormedField R] [SemiNormedRing α] [NormedAlgebra R α]
+protected def linftyOpNormedAlgebra [NormedField R] [SeminormedRing α] [NormedAlgebra R α]
     [DecidableEq n] : NormedAlgebra R (Matrix n n α) :=
   { Matrix.linftyOpNormedSpace with }
 #align matrix.linfty_op_normed_algebra Matrix.linftyOpNormedAlgebra
Diff
@@ -564,7 +564,7 @@ matrix. -/
 def frobeniusNormedRing [DecidableEq m] : NormedRing (Matrix m m α) :=
   {
     Matrix.frobeniusSeminormedAddCommGroup with
-    norm := HasNorm.norm
+    norm := Norm.norm
     norm_mul := frobenius_norm_mul }
 #align matrix.frobenius_normed_ring Matrix.frobeniusNormedRing
 
Diff
@@ -307,8 +307,8 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
     _ = finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * ∑ k, ‖B j k‖₊ := by
       simp_rw [@Finset.sum_comm _ m n, Finset.mul_sum]
     _ ≤ finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * finset.univ.sup fun i => ∑ j, ‖B i j‖₊ :=
-      Finset.sup_mono_fun fun i hi =>
-        Finset.sum_le_sum fun j hj => mul_le_mul_of_nonneg_left (Finset.le_sup hj) (zero_le _)
+      (Finset.sup_mono_fun fun i hi =>
+        Finset.sum_le_sum fun j hj => mul_le_mul_of_nonneg_left (Finset.le_sup hj) (zero_le _))
     _ ≤ (finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
     
Diff
@@ -245,7 +245,7 @@ variable [SeminormedAddCommGroup α]
 
 theorem linfty_op_norm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
-  simp [Pi.norm_def, PiLp.nnnorm_eq_sum Ennreal.one_ne_top]
+  simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_op_norm_def
 
 theorem linfty_op_nnnorm_def (A : Matrix m n α) :
@@ -528,8 +528,8 @@ theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α
     ‖(1 : Matrix n n α)‖₊ = NNReal.sqrt (Fintype.card n) * ‖(1 : α)‖₊ :=
   by
   refine' (frobenius_nnnorm_diagonal _).trans _
-  simp_rw [PiLp.nnnorm_equiv_symm_const Ennreal.two_ne_top, NNReal.sqrt_eq_rpow]
-  simp only [Ennreal.toReal_div, Ennreal.one_toReal, Ennreal.toReal_bit0]
+  simp_rw [PiLp.nnnorm_equiv_symm_const ENNReal.two_ne_top, NNReal.sqrt_eq_rpow]
+  simp only [ENNReal.toReal_div, ENNReal.one_toReal, [anonymous]]
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
 
 section IsROrC

Changes in mathlib4

mathlib3
mathlib4
chore: reformat deprecation warnings on one line, if possible (#12335)

Occasionally, remove a "deprecated by" or "deprecated since", to fit the line length.

This is desirable (to me) because

  • it's more compact: I don't see a good reason for these declarations taking up more space than needed; as I understand it, deprecated lemmas are not supposed to be used in mathlib anyway
  • putting the date on the same line as the attribute makes it easier to discover un-dated deprecations; they also ease writing a tool to replace these by a machine-readable version using leanprover/lean4#3968
Diff
@@ -272,18 +272,14 @@ theorem linfty_opNorm_def (A : Matrix m n α) :
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
 
-@[deprecated]
-alias linfty_op_norm_def :=
-  linfty_opNorm_def -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_def := linfty_opNorm_def -- 2024-02-02
 
 theorem linfty_opNNNorm_def (A : Matrix m n α) :
     ‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ :=
   Subtype.ext <| linfty_opNorm_def A
 #align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def
 
-@[deprecated]
-alias linfty_op_nnnorm_def :=
-  linfty_opNNNorm_def -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_def := linfty_opNNNorm_def -- 2024-02-02
 
 @[simp, nolint simpNF] -- Porting note: linter times out
 theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
@@ -291,35 +287,27 @@ theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
   simp
 #align matrix.linfty_op_nnnorm_col Matrix.linfty_opNNNorm_col
 
-@[deprecated]
-alias linfty_op_nnnorm_col :=
-  linfty_opNNNorm_col -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_col := linfty_opNNNorm_col -- 2024-02-02
 
 @[simp]
 theorem linfty_opNorm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
   congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_col v
 #align matrix.linfty_op_norm_col Matrix.linfty_opNorm_col
 
-@[deprecated]
-alias linfty_op_norm_col :=
-  linfty_opNorm_col -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_col := linfty_opNorm_col -- 2024-02-02
 
 @[simp]
 theorem linfty_opNNNorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_opNNNorm_def]
 #align matrix.linfty_op_nnnorm_row Matrix.linfty_opNNNorm_row
 
-@[deprecated]
-alias linfty_op_nnnorm_row :=
-  linfty_opNNNorm_row -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_row := linfty_opNNNorm_row -- 2024-02-02
 
 @[simp]
 theorem linfty_opNorm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
   (congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_row v).trans <| by simp [NNReal.coe_sum]
 #align matrix.linfty_op_norm_row Matrix.linfty_opNorm_row
 
-@[deprecated]
-alias linfty_op_norm_row :=
-  linfty_opNorm_row -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_row := linfty_opNorm_row -- deprecated on 2024-02-02
 
 @[simp]
 theorem linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ := by
@@ -330,18 +318,14 @@ theorem linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v
   · rw [diagonal_apply_eq]
 #align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_opNNNorm_diagonal
 
-@[deprecated]
-alias linfty_op_nnnorm_diagonal :=
-  linfty_opNNNorm_diagonal -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_diagonal := linfty_opNNNorm_diagonal -- 2024-02-02
 
 @[simp]
 theorem linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
   congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_diagonal v
 #align matrix.linfty_op_norm_diagonal Matrix.linfty_opNorm_diagonal
 
-@[deprecated]
-alias linfty_op_norm_diagonal :=
-  linfty_opNorm_diagonal -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_diagonal := linfty_opNorm_diagonal -- deprecated on 2024-02-02
 
 end SeminormedAddCommGroup
 
@@ -368,34 +352,26 @@ theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
       rfl
 #align matrix.linfty_op_nnnorm_mul Matrix.linfty_opNNNorm_mul
 
-@[deprecated]
-alias linfty_op_nnnorm_mul :=
-  linfty_opNNNorm_mul -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_mul := linfty_opNNNorm_mul -- deprecated on 2024-02-02
 
 theorem linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
   linfty_opNNNorm_mul _ _
 #align matrix.linfty_op_norm_mul Matrix.linfty_opNorm_mul
 
-@[deprecated]
-alias linfty_op_norm_mul :=
-  linfty_opNorm_mul -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_mul := linfty_opNorm_mul -- deprecated on 2024-02-02
 
 theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
   rw [← linfty_opNNNorm_col (A *ᵥ v), ← linfty_opNNNorm_col v]
   exact linfty_opNNNorm_mul A (col v)
 #align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_opNNNorm_mulVec
 
-@[deprecated]
-alias linfty_op_nnnorm_mulVec :=
-  linfty_opNNNorm_mulVec -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_mulVec := linfty_opNNNorm_mulVec -- deprecated on 2024-02-02
 
 theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖ ≤ ‖A‖ * ‖v‖ :=
   linfty_opNNNorm_mulVec _ _
 #align matrix.linfty_op_norm_mul_vec Matrix.linfty_opNorm_mulVec
 
-@[deprecated]
-alias linfty_op_norm_mulVec :=
-  linfty_opNorm_mulVec -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_mulVec := linfty_opNorm_mulVec -- deprecated on 2024-02-02
 
 end NonUnitalSeminormedRing
 
@@ -501,17 +477,13 @@ lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
     nnnorm_one, mul_one] at hN
   exact hN
 
-@[deprecated]
-alias linfty_op_nnnorm_eq_op_nnnorm :=
-  linfty_opNNNorm_eq_opNNNorm -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_eq_op_nnnorm := linfty_opNNNorm_eq_opNNNorm -- 2024-02-02
 
 lemma linfty_opNorm_eq_opNorm (A : Matrix m n α) :
     ‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖ :=
   congr_arg NNReal.toReal (linfty_opNNNorm_eq_opNNNorm A)
 
-@[deprecated]
-alias linfty_op_norm_eq_op_norm :=
-  linfty_opNorm_eq_opNorm -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_eq_op_norm := linfty_opNorm_eq_opNorm -- 2024-02-02
 
 variable [DecidableEq n]
 
@@ -520,17 +492,13 @@ variable [DecidableEq n]
   rw [linfty_opNNNorm_eq_opNNNorm]
   simp only [← toLin'_apply', toLin'_toMatrix']
 
-@[deprecated]
-alias linfty_op_nnnorm_toMatrix :=
-  linfty_opNNNorm_toMatrix -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_nnnorm_toMatrix := linfty_opNNNorm_toMatrix -- 2024-02-02
 
 @[simp] lemma linfty_opNorm_toMatrix (f : (n → α) →L[α] (m → α)) :
     ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖ = ‖f‖ :=
   congr_arg NNReal.toReal (linfty_opNNNorm_toMatrix f)
 
-@[deprecated]
-alias linfty_op_norm_toMatrix :=
-  linfty_opNorm_toMatrix -- deprecated on 2024-02-02
+@[deprecated] alias linfty_op_norm_toMatrix := linfty_opNorm_toMatrix -- 2024-02-02
 
 end
 
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -691,9 +691,9 @@ theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α
   simp only [ENNReal.toReal_div, ENNReal.one_toReal, ENNReal.toReal_ofNat]
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
 
-section IsROrC
+section RCLike
 
-variable [IsROrC α]
+variable [RCLike α]
 
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
@@ -704,7 +704,7 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
   have :=
     @nnnorm_inner_le_nnnorm α _ _ _ _ ((WithLp.equiv 2 <| _ → α).symm fun j => star (A i j))
       ((WithLp.equiv 2 <| _ → α).symm fun k => B k j)
-  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
+  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, RCLike.inner_apply, starRingEnd_apply,
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
@@ -733,7 +733,7 @@ def frobeniusNormedAlgebra [DecidableEq m] [NormedField R] [NormedAlgebra R α]
   { Matrix.frobeniusNormedSpace, Matrix.instAlgebra with }
 #align matrix.frobenius_normed_algebra Matrix.frobeniusNormedAlgebra
 
-end IsROrC
+end RCLike
 
 end frobenius
 
chore: Make Finset.preimage not depend on Finset.sum (#11601)

and Data.Finset.LocallyFinite not depend on Finset.sum too

Diff
@@ -358,7 +358,7 @@ theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
       Finset.sup_mono_fun fun i _hi =>
         Finset.sum_le_sum fun k _hk => nnnorm_sum_le_of_le _ fun j _hj => nnnorm_mul_le _ _
     _ = Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * ∑ k, ‖B j k‖₊ := by
-      simp_rw [@Finset.sum_comm _ m n, Finset.mul_sum]
+      simp_rw [@Finset.sum_comm m, Finset.mul_sum]
     _ ≤ Finset.univ.sup fun i => ∑ j, ‖A i j‖₊ * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       refine Finset.sup_mono_fun fun i _hi => ?_
       gcongr with j hj
@@ -697,7 +697,7 @@ variable [IsROrC α]
 
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
-  rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum]
+  rw [← NNReal.mul_rpow, @Finset.sum_comm _ _ m, Finset.sum_mul_sum]
   gcongr with i _ j
   rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
     mul_div_cancel₀ (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -700,7 +700,7 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
   rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum]
   gcongr with i _ j
   rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
-    mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
+    mul_div_cancel₀ (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
   have :=
     @nnnorm_inner_le_nnnorm α _ _ _ _ ((WithLp.equiv 2 <| _ → α).symm fun j => star (A i j))
       ((WithLp.equiv 2 <| _ → α).symm fun k => B k j)
chore: classify new theorem / theorem porting notes (#11432)

Classifies by adding issue number #10756 to porting notes claiming anything equivalent to:

  • "added theorem"
  • "added theorems"
  • "new theorem"
  • "new theorems"
  • "added lemma"
  • "new lemma"
  • "new lemmas"
Diff
@@ -76,10 +76,10 @@ protected def seminormedAddCommGroup : SeminormedAddCommGroup (Matrix m n α) :=
 
 attribute [local instance] Matrix.seminormedAddCommGroup
 
--- Porting note: new (along with all the uses of this lemma below)
+-- Porting note (#10756): new theorem (along with all the uses of this lemma below)
 theorem norm_def (A : Matrix m n α) : ‖A‖ = ‖fun i j => A i j‖ := rfl
 
--- Porting note: new  (along with all the uses of this lemma below)
+-- Porting note (#10756): new theorem (along with all the uses of this lemma below)
 theorem nnnorm_def (A : Matrix m n α) : ‖A‖₊ = ‖fun i j => A i j‖₊ := rfl
 
 theorem norm_le_iff {r : ℝ} (hr : 0 ≤ r) {A : Matrix m n α} : ‖A‖ ≤ r ↔ ∀ i j, ‖A i j‖ ≤ r := by
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -466,6 +466,7 @@ private theorem norm_unitOf (a : α) : ‖unitOf a‖₊ = 1 := by
   · rw [← nnnorm_eq_zero] at h
     rw [nnnorm_smul, nnnorm_inv, nnnorm_norm, mul_inv_cancel h]
 
+set_option tactic.skipAssignedInstances false in
 private theorem mul_unitOf (a : α) : a * unitOf a = algebraMap _ _ (‖a‖₊ : ℝ)  := by
   simp [unitOf]
   split_ifs with h
@@ -491,12 +492,12 @@ lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
   classical
   let x : n → α := fun j => unitOf (A i j)
   have hxn : ‖x‖₊ = 1 := by
-    simp_rw [Pi.nnnorm_def, norm_unitOf, Finset.sup_const Finset.univ_nonempty]
+    simp_rw [x, Pi.nnnorm_def, norm_unitOf, Finset.sup_const Finset.univ_nonempty]
   specialize hN x
   rw [hxn, mul_one, Pi.nnnorm_def, Finset.sup_le_iff] at hN
   replace hN := hN i (Finset.mem_univ _)
   dsimp [mulVec, dotProduct] at hN
-  simp_rw [mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq,
+  simp_rw [x, mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq,
     nnnorm_one, mul_one] at hN
   exact hN
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -76,10 +76,10 @@ protected def seminormedAddCommGroup : SeminormedAddCommGroup (Matrix m n α) :=
 
 attribute [local instance] Matrix.seminormedAddCommGroup
 
--- porting note: new (along with all the uses of this lemma below)
+-- Porting note: new (along with all the uses of this lemma below)
 theorem norm_def (A : Matrix m n α) : ‖A‖ = ‖fun i j => A i j‖ := rfl
 
--- porting note: new  (along with all the uses of this lemma below)
+-- Porting note: new  (along with all the uses of this lemma below)
 theorem nnnorm_def (A : Matrix m n α) : ‖A‖₊ = ‖fun i j => A i j‖₊ := rfl
 
 theorem norm_le_iff {r : ℝ} (hr : 0 ≤ r) {A : Matrix m n α} : ‖A‖ ≤ r ↔ ∀ i j, ‖A i j‖ ≤ r := by
@@ -267,7 +267,7 @@ variable [SeminormedAddCommGroup α]
 
 theorem linfty_opNorm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
-  -- porting note: added
+  -- Porting note: added
   change ‖fun i => (WithLp.equiv 1 _).symm (A i)‖ = _
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
@@ -585,7 +585,7 @@ variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
 
 theorem frobenius_nnnorm_def (A : Matrix m n α) :
     ‖A‖₊ = (∑ i, ∑ j, ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) := by
-  -- porting note: added, along with `WithLp.equiv_symm_pi_apply` below
+  -- Porting note: added, along with `WithLp.equiv_symm_pi_apply` below
   change ‖(WithLp.equiv 2 _).symm fun i => (WithLp.equiv 2 _).symm fun j => A i j‖₊ = _
   simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two,
     WithLp.equiv_symm_pi_apply]
@@ -610,7 +610,7 @@ theorem frobenius_norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, 
 @[simp]
 theorem frobenius_nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by
   rw [frobenius_nnnorm_def, frobenius_nnnorm_def, Finset.sum_comm]
-  simp_rw [Matrix.transpose_apply]  -- porting note: added
+  simp_rw [Matrix.transpose_apply]  -- Porting note: added
 #align matrix.frobenius_nnnorm_transpose Matrix.frobenius_nnnorm_transpose
 
 @[simp]
@@ -683,10 +683,10 @@ end SeminormedAddCommGroup
 theorem frobenius_nnnorm_one [DecidableEq n] [SeminormedAddCommGroup α] [One α] :
     ‖(1 : Matrix n n α)‖₊ = NNReal.sqrt (Fintype.card n) * ‖(1 : α)‖₊ := by
   refine' (frobenius_nnnorm_diagonal _).trans _
-  -- porting note: change to erw, since `fun x => 1` no longer matches `Function.const`
+  -- Porting note: change to erw, since `fun x => 1` no longer matches `Function.const`
   erw [PiLp.nnnorm_equiv_symm_const ENNReal.two_ne_top]
   simp_rw [NNReal.sqrt_eq_rpow]
-  -- porting note: added `ENNReal.toReal_ofNat`
+  -- Porting note: added `ENNReal.toReal_ofNat`
   simp only [ENNReal.toReal_div, ENNReal.one_toReal, ENNReal.toReal_ofNat]
 #align matrix.frobenius_nnnorm_one Matrix.frobenius_nnnorm_one
 
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -496,8 +496,8 @@ lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
   rw [hxn, mul_one, Pi.nnnorm_def, Finset.sup_le_iff] at hN
   replace hN := hN i (Finset.mem_univ _)
   dsimp [mulVec, dotProduct] at hN
-  simp_rw [mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq, nnnorm_one,
-    mul_one] at hN
+  simp_rw [mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq,
+    nnnorm_one, mul_one] at hN
   exact hN
 
 @[deprecated]
Deprecate allowing auto-replacement (#10302)

Following these Zulip discussions, I realised that my deprecation script produced a deprecation syntax that did not allow for auto-replacement in Sébastien's #10185.

This PR fixes the deprecation statements, allowing self-correction: 119 times I replaced

@[deprecated xxx] --> @[deprecated].

Diff
@@ -272,7 +272,7 @@ theorem linfty_opNorm_def (A : Matrix m n α) :
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
 
-@[deprecated linfty_opNorm_def]
+@[deprecated]
 alias linfty_op_norm_def :=
   linfty_opNorm_def -- deprecated on 2024-02-02
 
@@ -281,7 +281,7 @@ theorem linfty_opNNNorm_def (A : Matrix m n α) :
   Subtype.ext <| linfty_opNorm_def A
 #align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def
 
-@[deprecated linfty_opNNNorm_def]
+@[deprecated]
 alias linfty_op_nnnorm_def :=
   linfty_opNNNorm_def -- deprecated on 2024-02-02
 
@@ -291,7 +291,7 @@ theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
   simp
 #align matrix.linfty_op_nnnorm_col Matrix.linfty_opNNNorm_col
 
-@[deprecated linfty_opNNNorm_col]
+@[deprecated]
 alias linfty_op_nnnorm_col :=
   linfty_opNNNorm_col -- deprecated on 2024-02-02
 
@@ -300,7 +300,7 @@ theorem linfty_opNorm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
   congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_col v
 #align matrix.linfty_op_norm_col Matrix.linfty_opNorm_col
 
-@[deprecated linfty_opNorm_col]
+@[deprecated]
 alias linfty_op_norm_col :=
   linfty_opNorm_col -- deprecated on 2024-02-02
 
@@ -308,7 +308,7 @@ alias linfty_op_norm_col :=
 theorem linfty_opNNNorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_opNNNorm_def]
 #align matrix.linfty_op_nnnorm_row Matrix.linfty_opNNNorm_row
 
-@[deprecated linfty_opNNNorm_row]
+@[deprecated]
 alias linfty_op_nnnorm_row :=
   linfty_opNNNorm_row -- deprecated on 2024-02-02
 
@@ -317,7 +317,7 @@ theorem linfty_opNorm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
   (congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_row v).trans <| by simp [NNReal.coe_sum]
 #align matrix.linfty_op_norm_row Matrix.linfty_opNorm_row
 
-@[deprecated linfty_opNorm_row]
+@[deprecated]
 alias linfty_op_norm_row :=
   linfty_opNorm_row -- deprecated on 2024-02-02
 
@@ -330,7 +330,7 @@ theorem linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v
   · rw [diagonal_apply_eq]
 #align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_opNNNorm_diagonal
 
-@[deprecated linfty_opNNNorm_diagonal]
+@[deprecated]
 alias linfty_op_nnnorm_diagonal :=
   linfty_opNNNorm_diagonal -- deprecated on 2024-02-02
 
@@ -339,7 +339,7 @@ theorem linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖
   congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_diagonal v
 #align matrix.linfty_op_norm_diagonal Matrix.linfty_opNorm_diagonal
 
-@[deprecated linfty_opNorm_diagonal]
+@[deprecated]
 alias linfty_op_norm_diagonal :=
   linfty_opNorm_diagonal -- deprecated on 2024-02-02
 
@@ -368,7 +368,7 @@ theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
       rfl
 #align matrix.linfty_op_nnnorm_mul Matrix.linfty_opNNNorm_mul
 
-@[deprecated linfty_opNNNorm_mul]
+@[deprecated]
 alias linfty_op_nnnorm_mul :=
   linfty_opNNNorm_mul -- deprecated on 2024-02-02
 
@@ -376,7 +376,7 @@ theorem linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖
   linfty_opNNNorm_mul _ _
 #align matrix.linfty_op_norm_mul Matrix.linfty_opNorm_mul
 
-@[deprecated linfty_opNorm_mul]
+@[deprecated]
 alias linfty_op_norm_mul :=
   linfty_opNorm_mul -- deprecated on 2024-02-02
 
@@ -385,7 +385,7 @@ theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v
   exact linfty_opNNNorm_mul A (col v)
 #align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_opNNNorm_mulVec
 
-@[deprecated linfty_opNNNorm_mulVec]
+@[deprecated]
 alias linfty_op_nnnorm_mulVec :=
   linfty_opNNNorm_mulVec -- deprecated on 2024-02-02
 
@@ -393,7 +393,7 @@ theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖
   linfty_opNNNorm_mulVec _ _
 #align matrix.linfty_op_norm_mul_vec Matrix.linfty_opNorm_mulVec
 
-@[deprecated linfty_opNorm_mulVec]
+@[deprecated]
 alias linfty_op_norm_mulVec :=
   linfty_opNorm_mulVec -- deprecated on 2024-02-02
 
@@ -500,7 +500,7 @@ lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
     mul_one] at hN
   exact hN
 
-@[deprecated linfty_opNNNorm_eq_opNNNorm]
+@[deprecated]
 alias linfty_op_nnnorm_eq_op_nnnorm :=
   linfty_opNNNorm_eq_opNNNorm -- deprecated on 2024-02-02
 
@@ -508,7 +508,7 @@ lemma linfty_opNorm_eq_opNorm (A : Matrix m n α) :
     ‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖ :=
   congr_arg NNReal.toReal (linfty_opNNNorm_eq_opNNNorm A)
 
-@[deprecated linfty_opNorm_eq_opNorm]
+@[deprecated]
 alias linfty_op_norm_eq_op_norm :=
   linfty_opNorm_eq_opNorm -- deprecated on 2024-02-02
 
@@ -519,7 +519,7 @@ variable [DecidableEq n]
   rw [linfty_opNNNorm_eq_opNNNorm]
   simp only [← toLin'_apply', toLin'_toMatrix']
 
-@[deprecated linfty_opNNNorm_toMatrix]
+@[deprecated]
 alias linfty_op_nnnorm_toMatrix :=
   linfty_opNNNorm_toMatrix -- deprecated on 2024-02-02
 
@@ -527,7 +527,7 @@ alias linfty_op_nnnorm_toMatrix :=
     ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖ = ‖f‖ :=
   congr_arg NNReal.toReal (linfty_opNNNorm_toMatrix f)
 
-@[deprecated linfty_opNorm_toMatrix]
+@[deprecated]
 alias linfty_op_norm_toMatrix :=
   linfty_opNorm_toMatrix -- deprecated on 2024-02-02
 
chore: Matrix.mulVec and Matrix.vecMul get infix notation (#10297)

Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20mul_vec.20and.20vec_mul

Co-authored-by: Martin Dvorak <mdvorak@ista.ac.at>

Diff
@@ -380,8 +380,8 @@ theorem linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖
 alias linfty_op_norm_mul :=
   linfty_opNorm_mul -- deprecated on 2024-02-02
 
-theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
-  rw [← linfty_opNNNorm_col (A.mulVec v), ← linfty_opNNNorm_col v]
+theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
+  rw [← linfty_opNNNorm_col (A *ᵥ v), ← linfty_opNNNorm_col v]
   exact linfty_opNNNorm_mul A (col v)
 #align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_opNNNorm_mulVec
 
@@ -389,7 +389,7 @@ theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec
 alias linfty_op_nnnorm_mulVec :=
   linfty_opNNNorm_mulVec -- deprecated on 2024-02-02
 
-theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
+theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A *ᵥ v‖ ≤ ‖A‖ * ‖v‖ :=
   linfty_opNNNorm_mulVec _ _
 #align matrix.linfty_op_norm_mul_vec Matrix.linfty_opNorm_mulVec
 
chore(NormedSpace/Basic): move some theorems to NormedSpace.Real (#10206)

This way we don't switch between general normed spaces and real normed spaces back and forth throughout the file.

Diff
@@ -3,7 +3,6 @@ Copyright (c) 2021 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
 -/
-import Mathlib.Analysis.NormedSpace.Basic
 import Mathlib.Analysis.NormedSpace.PiLp
 import Mathlib.Analysis.InnerProductSpace.PiL2
 
chore: rename op_norm to opNorm (#10185)

Co-authored-by: adomani <adomani@gmail.com>

Diff
@@ -266,51 +266,83 @@ section SeminormedAddCommGroup
 
 variable [SeminormedAddCommGroup α]
 
-theorem linfty_op_norm_def (A : Matrix m n α) :
+theorem linfty_opNorm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
   -- porting note: added
   change ‖fun i => (WithLp.equiv 1 _).symm (A i)‖ = _
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
-#align matrix.linfty_op_norm_def Matrix.linfty_op_norm_def
+#align matrix.linfty_op_norm_def Matrix.linfty_opNorm_def
 
-theorem linfty_op_nnnorm_def (A : Matrix m n α) :
+@[deprecated linfty_opNorm_def]
+alias linfty_op_norm_def :=
+  linfty_opNorm_def -- deprecated on 2024-02-02
+
+theorem linfty_opNNNorm_def (A : Matrix m n α) :
     ‖A‖₊ = (Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ :=
-  Subtype.ext <| linfty_op_norm_def A
-#align matrix.linfty_op_nnnorm_def Matrix.linfty_op_nnnorm_def
+  Subtype.ext <| linfty_opNorm_def A
+#align matrix.linfty_op_nnnorm_def Matrix.linfty_opNNNorm_def
+
+@[deprecated linfty_opNNNorm_def]
+alias linfty_op_nnnorm_def :=
+  linfty_opNNNorm_def -- deprecated on 2024-02-02
 
 @[simp, nolint simpNF] -- Porting note: linter times out
-theorem linfty_op_nnnorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
-  rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
+theorem linfty_opNNNorm_col (v : m → α) : ‖col v‖₊ = ‖v‖₊ := by
+  rw [linfty_opNNNorm_def, Pi.nnnorm_def]
   simp
-#align matrix.linfty_op_nnnorm_col Matrix.linfty_op_nnnorm_col
+#align matrix.linfty_op_nnnorm_col Matrix.linfty_opNNNorm_col
+
+@[deprecated linfty_opNNNorm_col]
+alias linfty_op_nnnorm_col :=
+  linfty_opNNNorm_col -- deprecated on 2024-02-02
 
 @[simp]
-theorem linfty_op_norm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
-  congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_op_nnnorm_col v
-#align matrix.linfty_op_norm_col Matrix.linfty_op_norm_col
+theorem linfty_opNorm_col (v : m → α) : ‖col v‖ = ‖v‖ :=
+  congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_col v
+#align matrix.linfty_op_norm_col Matrix.linfty_opNorm_col
+
+@[deprecated linfty_opNorm_col]
+alias linfty_op_norm_col :=
+  linfty_opNorm_col -- deprecated on 2024-02-02
 
 @[simp]
-theorem linfty_op_nnnorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_op_nnnorm_def]
-#align matrix.linfty_op_nnnorm_row Matrix.linfty_op_nnnorm_row
+theorem linfty_opNNNorm_row (v : n → α) : ‖row v‖₊ = ∑ i, ‖v i‖₊ := by simp [linfty_opNNNorm_def]
+#align matrix.linfty_op_nnnorm_row Matrix.linfty_opNNNorm_row
+
+@[deprecated linfty_opNNNorm_row]
+alias linfty_op_nnnorm_row :=
+  linfty_opNNNorm_row -- deprecated on 2024-02-02
 
 @[simp]
-theorem linfty_op_norm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
-  (congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_op_nnnorm_row v).trans <| by simp [NNReal.coe_sum]
-#align matrix.linfty_op_norm_row Matrix.linfty_op_norm_row
+theorem linfty_opNorm_row (v : n → α) : ‖row v‖ = ∑ i, ‖v i‖ :=
+  (congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_row v).trans <| by simp [NNReal.coe_sum]
+#align matrix.linfty_op_norm_row Matrix.linfty_opNorm_row
+
+@[deprecated linfty_opNorm_row]
+alias linfty_op_norm_row :=
+  linfty_opNorm_row -- deprecated on 2024-02-02
 
 @[simp]
-theorem linfty_op_nnnorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ := by
-  rw [linfty_op_nnnorm_def, Pi.nnnorm_def]
+theorem linfty_opNNNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖₊ = ‖v‖₊ := by
+  rw [linfty_opNNNorm_def, Pi.nnnorm_def]
   congr 1 with i : 1
   refine' (Finset.sum_eq_single_of_mem _ (Finset.mem_univ i) fun j _hj hij => _).trans _
   · rw [diagonal_apply_ne' _ hij, nnnorm_zero]
   · rw [diagonal_apply_eq]
-#align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_op_nnnorm_diagonal
+#align matrix.linfty_op_nnnorm_diagonal Matrix.linfty_opNNNorm_diagonal
+
+@[deprecated linfty_opNNNorm_diagonal]
+alias linfty_op_nnnorm_diagonal :=
+  linfty_opNNNorm_diagonal -- deprecated on 2024-02-02
 
 @[simp]
-theorem linfty_op_norm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
-  congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_op_nnnorm_diagonal v
-#align matrix.linfty_op_norm_diagonal Matrix.linfty_op_norm_diagonal
+theorem linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖ :=
+  congr_arg ((↑) : ℝ≥0 → ℝ) <| linfty_opNNNorm_diagonal v
+#align matrix.linfty_op_norm_diagonal Matrix.linfty_opNorm_diagonal
+
+@[deprecated linfty_opNorm_diagonal]
+alias linfty_op_norm_diagonal :=
+  linfty_opNorm_diagonal -- deprecated on 2024-02-02
 
 end SeminormedAddCommGroup
 
@@ -319,8 +351,8 @@ section NonUnitalSeminormedRing
 variable [NonUnitalSeminormedRing α]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (k j) -/
-theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
-  simp_rw [linfty_op_nnnorm_def, Matrix.mul_apply]
+theorem linfty_opNNNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
+  simp_rw [linfty_opNNNorm_def, Matrix.mul_apply]
   calc
     (Finset.univ.sup fun i => ∑ k, ‖∑ j, A i j * B j k‖₊) ≤
         Finset.univ.sup fun i => ∑ k, ∑ j, ‖A i j‖₊ * ‖B j k‖₊ :=
@@ -335,20 +367,36 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
     _ ≤ (Finset.univ.sup fun i => ∑ j, ‖A i j‖₊) * Finset.univ.sup fun i => ∑ j, ‖B i j‖₊ := by
       simp_rw [← Finset.sum_mul, ← NNReal.finset_sup_mul]
       rfl
-#align matrix.linfty_op_nnnorm_mul Matrix.linfty_op_nnnorm_mul
+#align matrix.linfty_op_nnnorm_mul Matrix.linfty_opNNNorm_mul
 
-theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
-  linfty_op_nnnorm_mul _ _
-#align matrix.linfty_op_norm_mul Matrix.linfty_op_norm_mul
+@[deprecated linfty_opNNNorm_mul]
+alias linfty_op_nnnorm_mul :=
+  linfty_opNNNorm_mul -- deprecated on 2024-02-02
 
-theorem linfty_op_nnnorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
-  rw [← linfty_op_nnnorm_col (A.mulVec v), ← linfty_op_nnnorm_col v]
-  exact linfty_op_nnnorm_mul A (col v)
-#align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_op_nnnorm_mulVec
+theorem linfty_opNorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
+  linfty_opNNNorm_mul _ _
+#align matrix.linfty_op_norm_mul Matrix.linfty_opNorm_mul
 
-theorem linfty_op_norm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
-  linfty_op_nnnorm_mulVec _ _
-#align matrix.linfty_op_norm_mul_vec Matrix.linfty_op_norm_mulVec
+@[deprecated linfty_opNorm_mul]
+alias linfty_op_norm_mul :=
+  linfty_opNorm_mul -- deprecated on 2024-02-02
+
+theorem linfty_opNNNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖A.mulVec v‖₊ ≤ ‖A‖₊ * ‖v‖₊ := by
+  rw [← linfty_opNNNorm_col (A.mulVec v), ← linfty_opNNNorm_col v]
+  exact linfty_opNNNorm_mul A (col v)
+#align matrix.linfty_op_nnnorm_mul_vec Matrix.linfty_opNNNorm_mulVec
+
+@[deprecated linfty_opNNNorm_mulVec]
+alias linfty_op_nnnorm_mulVec :=
+  linfty_opNNNorm_mulVec -- deprecated on 2024-02-02
+
+theorem linfty_opNorm_mulVec (A : Matrix l m α) (v : m → α) : ‖Matrix.mulVec A v‖ ≤ ‖A‖ * ‖v‖ :=
+  linfty_opNNNorm_mulVec _ _
+#align matrix.linfty_op_norm_mul_vec Matrix.linfty_opNorm_mulVec
+
+@[deprecated linfty_opNorm_mulVec]
+alias linfty_op_norm_mulVec :=
+  linfty_opNorm_mulVec -- deprecated on 2024-02-02
 
 end NonUnitalSeminormedRing
 
@@ -359,14 +407,14 @@ the norm of a matrix. -/
 protected def linftyOpNonUnitalSemiNormedRing [NonUnitalSeminormedRing α] :
     NonUnitalSeminormedRing (Matrix n n α) :=
   { Matrix.linftyOpSeminormedAddCommGroup, Matrix.instNonUnitalRing with
-    norm_mul := linfty_op_norm_mul }
+    norm_mul := linfty_opNorm_mul }
 #align matrix.linfty_op_non_unital_semi_normed_ring Matrix.linftyOpNonUnitalSemiNormedRing
 
 /-- The `L₁-L∞` norm preserves one on non-empty matrices. Note this is safe as an instance, as it
 carries no data. -/
-instance linfty_op_normOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
-    NormOneClass (Matrix n n α) where norm_one := (linfty_op_norm_diagonal _).trans norm_one
-#align matrix.linfty_op_norm_one_class Matrix.linfty_op_normOneClass
+instance linfty_opNormOneClass [SeminormedRing α] [NormOneClass α] [DecidableEq n] [Nonempty n] :
+    NormOneClass (Matrix n n α) where norm_one := (linfty_opNorm_diagonal _).trans norm_one
+#align matrix.linfty_op_norm_one_class Matrix.linfty_opNormOneClass
 
 /-- Seminormed ring instance (using sup norm of L1 norm) for matrices over a semi normed ring.  Not
 declared as an instance because there are several natural choices for defining the norm of a
@@ -434,10 +482,10 @@ For a matrix over a field, the norm defined in this section agrees with the oper
 section
 variable [NontriviallyNormedField α] [NormedAlgebra ℝ α]
 
-lemma linfty_op_nnnorm_eq_op_nnnorm (A : Matrix m n α) :
+lemma linfty_opNNNorm_eq_opNNNorm (A : Matrix m n α) :
     ‖A‖₊ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖₊ := by
-  rw [ContinuousLinearMap.op_nnnorm_eq_of_bounds _ (linfty_op_nnnorm_mulVec _) fun N hN => ?_]
-  rw [linfty_op_nnnorm_def]
+  rw [ContinuousLinearMap.opNNNorm_eq_of_bounds _ (linfty_opNNNorm_mulVec _) fun N hN => ?_]
+  rw [linfty_opNNNorm_def]
   refine Finset.sup_le fun i _ => ?_
   cases isEmpty_or_nonempty n
   · simp
@@ -453,20 +501,36 @@ lemma linfty_op_nnnorm_eq_op_nnnorm (A : Matrix m n α) :
     mul_one] at hN
   exact hN
 
-lemma linfty_op_norm_eq_op_norm (A : Matrix m n α) :
+@[deprecated linfty_opNNNorm_eq_opNNNorm]
+alias linfty_op_nnnorm_eq_op_nnnorm :=
+  linfty_opNNNorm_eq_opNNNorm -- deprecated on 2024-02-02
+
+lemma linfty_opNorm_eq_opNorm (A : Matrix m n α) :
     ‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖ :=
-  congr_arg NNReal.toReal (linfty_op_nnnorm_eq_op_nnnorm A)
+  congr_arg NNReal.toReal (linfty_opNNNorm_eq_opNNNorm A)
+
+@[deprecated linfty_opNorm_eq_opNorm]
+alias linfty_op_norm_eq_op_norm :=
+  linfty_opNorm_eq_opNorm -- deprecated on 2024-02-02
 
 variable [DecidableEq n]
 
-@[simp] lemma linfty_op_nnnorm_toMatrix (f : (n → α) →L[α] (m → α)) :
+@[simp] lemma linfty_opNNNorm_toMatrix (f : (n → α) →L[α] (m → α)) :
     ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖₊ = ‖f‖₊ := by
-  rw [linfty_op_nnnorm_eq_op_nnnorm]
+  rw [linfty_opNNNorm_eq_opNNNorm]
   simp only [← toLin'_apply', toLin'_toMatrix']
 
-@[simp] lemma linfty_op_norm_toMatrix (f : (n → α) →L[α] (m → α)) :
+@[deprecated linfty_opNNNorm_toMatrix]
+alias linfty_op_nnnorm_toMatrix :=
+  linfty_opNNNorm_toMatrix -- deprecated on 2024-02-02
+
+@[simp] lemma linfty_opNorm_toMatrix (f : (n → α) →L[α] (m → α)) :
     ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖ = ‖f‖ :=
-  congr_arg NNReal.toReal (linfty_op_nnnorm_toMatrix f)
+  congr_arg NNReal.toReal (linfty_opNNNorm_toMatrix f)
+
+@[deprecated linfty_opNorm_toMatrix]
+alias linfty_op_norm_toMatrix :=
+  linfty_opNorm_toMatrix -- deprecated on 2024-02-02
 
 end
 
feat: BoundedSMul for matrix norms (#9817)

This provides the fact that the norm of scaling a matrix of quaternions by a quaternion is bounded by the product of the norms.

Diff
@@ -19,6 +19,7 @@ In this file we provide the following non-instances for norms on matrices:
   * `Matrix.seminormedAddCommGroup`
   * `Matrix.normedAddCommGroup`
   * `Matrix.normedSpace`
+  * `Matrix.boundedSMul`
 
 * The Frobenius norm:
 
@@ -27,12 +28,14 @@ In this file we provide the following non-instances for norms on matrices:
   * `Matrix.frobeniusNormedSpace`
   * `Matrix.frobeniusNormedRing`
   * `Matrix.frobeniusNormedAlgebra`
+  * `Matrix.frobeniusBoundedSMul`
 
 * The $L^\infty$ operator norm:
 
   * `Matrix.linftyOpSeminormedAddCommGroup`
   * `Matrix.linftyOpNormedAddCommGroup`
   * `Matrix.linftyOpNormedSpace`
+  * `Matrix.linftyOpBoundedSMul`
   * `Matrix.linftyOpNonUnitalSemiNormedRing`
   * `Matrix.linftyOpSemiNormedRing`
   * `Matrix.linftyOpNonUnitalNormedRing`
@@ -196,6 +199,11 @@ section NormedSpace
 
 attribute [local instance] Matrix.seminormedAddCommGroup
 
+/-- This applies to the sup norm of sup norm. -/
+protected theorem boundedSMul [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
+    [BoundedSMul R α] : BoundedSMul R (Matrix m n α) :=
+  Pi.instBoundedSMul
+
 variable [NormedField R] [SeminormedAddCommGroup α] [NormedSpace R α]
 
 /-- Normed space instance (using sup norm of sup norm) for matrices over a normed space.  Not
@@ -238,6 +246,13 @@ protected def linftyOpNormedAddCommGroup [NormedAddCommGroup α] :
   (by infer_instance : NormedAddCommGroup (m → PiLp 1 fun j : n => α))
 #align matrix.linfty_op_normed_add_comm_group Matrix.linftyOpNormedAddCommGroup
 
+/-- This applies to the sup norm of L1 norm. -/
+@[local instance]
+protected theorem linftyOpBoundedSMul
+    [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α] [BoundedSMul R α] :
+    BoundedSMul R (Matrix m n α) :=
+  (by infer_instance : BoundedSMul R (m → PiLp 1 fun j : n => α))
+
 /-- Normed space instance (using sup norm of L1 norm) for matrices over a normed space.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
@@ -485,6 +500,13 @@ def frobeniusNormedAddCommGroup [NormedAddCommGroup α] : NormedAddCommGroup (Ma
   (by infer_instance : NormedAddCommGroup (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
 #align matrix.frobenius_normed_add_comm_group Matrix.frobeniusNormedAddCommGroup
 
+/-- This applies to the frobenius norm. -/
+@[local instance]
+theorem frobeniusBoundedSMul [SeminormedRing R] [SeminormedAddCommGroup α] [Module R α]
+    [BoundedSMul R α] :
+    BoundedSMul R (Matrix m n α) :=
+  (by infer_instance : BoundedSMul R (PiLp 2 fun i : m => PiLp 2 fun j : n => α))
+
 /-- Normed space instance (using frobenius norm) for matrices over a normed space.  Not
 declared as an instance because there are several natural choices for defining the norm of a
 matrix. -/
chore: Relocate big operator lemmas (#9383)

A bunch of lemmas in Algebra.BigOperators.Ring were not about rings. This PR moves them along with some lemmas from Data.Fintype.BigOperators to their correct place.

I create a new file with the content from #6605 to avoid importing Fin material in finset files as a result.

From LeanAPAP

Diff
@@ -611,11 +611,10 @@ variable [IsROrC α]
 
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
-  rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum, Finset.sum_product]
+  rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum]
   gcongr with i _ j
   rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
     mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
-  dsimp only
   have :=
     @nnnorm_inner_le_nnnorm α _ _ _ _ ((WithLp.equiv 2 <| _ → α).symm fun j => star (A i j))
       ((WithLp.equiv 2 <| _ → α).symm fun k => B k j)
feat: provide the ℓ² operator norm on matrices (#9474)

This adds the (unique) C⋆-norm on matrices Matrix n n 𝕜 with IsROrC 𝕜 within the scope Matrix.L2OpNorm. This norm coincides with the operator norm induced by the ℓ² norm (i.e., the norm on Matrix m n 𝕜 obtained by pulling back the norm from EuclideanSpace 𝕜 n →L[𝕜] EuclideanSpace 𝕜 m). Where possible, we state results for rectangular matrices.

Diff
@@ -41,6 +41,10 @@ In this file we provide the following non-instances for norms on matrices:
 
 These are not declared as instances because there are several natural choices for defining the norm
 of a matrix.
+
+The norm induced by the identification of `Matrix m n 𝕜` with
+`EuclideanSpace n 𝕜 →L[𝕜] EuclideanSpace m 𝕜` (i.e., the ℓ² operator norm) can be found in
+`Analysis.NormedSpace.Star.Matrix`. It is separated to avoid extraneous imports in this file.
 -/
 
 noncomputable section
feat(Analysis/Matrix): linfty_op_nnnorm agrees with the operator norm (#9476)

The witness used in the proof is inspired by https://math.stackexchange.com/a/1119933/1896. Trying to weaken the field assumption used in the proof is largely meaningless, since we can't even state the theorem without it.

Diff
@@ -386,6 +386,71 @@ protected def linftyOpNormedAlgebra [NormedField R] [SeminormedRing α] [NormedA
   { Matrix.linftyOpNormedSpace, Matrix.instAlgebra with }
 #align matrix.linfty_op_normed_algebra Matrix.linftyOpNormedAlgebra
 
+
+section
+variable [NormedDivisionRing α] [NormedAlgebra ℝ α] [CompleteSpace α]
+
+/-- Auxiliary construction; an element of norm 1 such that `a * unitOf a = ‖a‖`. -/
+private def unitOf (a : α) : α := by classical exact if a = 0 then 1 else ‖a‖ • a⁻¹
+
+private theorem norm_unitOf (a : α) : ‖unitOf a‖₊ = 1 := by
+  rw [unitOf]
+  split_ifs with h
+  · simp
+  · rw [← nnnorm_eq_zero] at h
+    rw [nnnorm_smul, nnnorm_inv, nnnorm_norm, mul_inv_cancel h]
+
+private theorem mul_unitOf (a : α) : a * unitOf a = algebraMap _ _ (‖a‖₊ : ℝ)  := by
+  simp [unitOf]
+  split_ifs with h
+  · simp [h]
+  · rw [mul_smul_comm, mul_inv_cancel h, Algebra.algebraMap_eq_smul_one]
+
+end
+
+/-!
+For a matrix over a field, the norm defined in this section agrees with the operator norm on
+`ContinuousLinearMap`s between function types (which have the infinity norm).
+-/
+section
+variable [NontriviallyNormedField α] [NormedAlgebra ℝ α]
+
+lemma linfty_op_nnnorm_eq_op_nnnorm (A : Matrix m n α) :
+    ‖A‖₊ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖₊ := by
+  rw [ContinuousLinearMap.op_nnnorm_eq_of_bounds _ (linfty_op_nnnorm_mulVec _) fun N hN => ?_]
+  rw [linfty_op_nnnorm_def]
+  refine Finset.sup_le fun i _ => ?_
+  cases isEmpty_or_nonempty n
+  · simp
+  classical
+  let x : n → α := fun j => unitOf (A i j)
+  have hxn : ‖x‖₊ = 1 := by
+    simp_rw [Pi.nnnorm_def, norm_unitOf, Finset.sup_const Finset.univ_nonempty]
+  specialize hN x
+  rw [hxn, mul_one, Pi.nnnorm_def, Finset.sup_le_iff] at hN
+  replace hN := hN i (Finset.mem_univ _)
+  dsimp [mulVec, dotProduct] at hN
+  simp_rw [mul_unitOf, ← map_sum, nnnorm_algebraMap, ← NNReal.coe_sum, NNReal.nnnorm_eq, nnnorm_one,
+    mul_one] at hN
+  exact hN
+
+lemma linfty_op_norm_eq_op_norm (A : Matrix m n α) :
+    ‖A‖ = ‖ContinuousLinearMap.mk (Matrix.mulVecLin A)‖ :=
+  congr_arg NNReal.toReal (linfty_op_nnnorm_eq_op_nnnorm A)
+
+variable [DecidableEq n]
+
+@[simp] lemma linfty_op_nnnorm_toMatrix (f : (n → α) →L[α] (m → α)) :
+    ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖₊ = ‖f‖₊ := by
+  rw [linfty_op_nnnorm_eq_op_nnnorm]
+  simp only [← toLin'_apply', toLin'_toMatrix']
+
+@[simp] lemma linfty_op_norm_toMatrix (f : (n → α) →L[α] (m → α)) :
+    ‖LinearMap.toMatrix' (↑f : (n → α) →ₗ[α] (m → α))‖ = ‖f‖ :=
+  congr_arg NNReal.toReal (linfty_op_nnnorm_toMatrix f)
+
+end
+
 end LinftyOp
 
 /-! ### The Frobenius norm
chore(*): drop $/<| before fun (#9361)

Subset of #9319

Diff
@@ -432,7 +432,7 @@ variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
 theorem frobenius_nnnorm_def (A : Matrix m n α) :
     ‖A‖₊ = (∑ i, ∑ j, ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) := by
   -- porting note: added, along with `WithLp.equiv_symm_pi_apply` below
-  change ‖(WithLp.equiv 2 _).symm <| fun i => (WithLp.equiv 2 _).symm <| fun j => A i j‖₊ = _
+  change ‖(WithLp.equiv 2 _).symm fun i => (WithLp.equiv 2 _).symm fun j => A i j‖₊ = _
   simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two,
     WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_nnnorm_def Matrix.frobenius_nnnorm_def
feat: golf using gcongr throughout the library (#8752)

Following on from previous gcongr golfing PRs #4702 and #4784.

This is a replacement for #7901: this round of golfs, first introduced there, there exposed some performance issues in gcongr, hopefully fixed by #8731, and I am opening a new PR so that the performance can be checked against current master rather than master at the time of #7901.

Diff
@@ -543,8 +543,7 @@ variable [IsROrC α]
 theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
   rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum, Finset.sum_product]
-  refine' NNReal.rpow_le_rpow _ one_half_pos.le
-  refine' Finset.sum_le_sum fun i _ => Finset.sum_le_sum fun j _ => _
+  gcongr with i _ j
   rw [← NNReal.rpow_le_rpow_iff one_half_pos, ← NNReal.rpow_mul,
     mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
   dsimp only
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -43,9 +43,6 @@ These are not declared as instances because there are several natural choices fo
 of a matrix.
 -/
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
-
 noncomputable section
 
 open scoped BigOperators NNReal Matrix
refactor: remove PiLp.equiv (#6501)

This removes the (PiLp.equiv 2 fun i => α i) abbreviation, replacing it with its implementation (WithLp.equiv 2 (∀ i, α i)). The same thing is done for PiLp.linearEquiv.

Diff
@@ -253,7 +253,7 @@ variable [SeminormedAddCommGroup α]
 theorem linfty_op_norm_def (A : Matrix m n α) :
     ‖A‖ = ((Finset.univ : Finset m).sup fun i : m => ∑ j : n, ‖A i j‖₊ : ℝ≥0) := by
   -- porting note: added
-  change ‖fun i => (PiLp.equiv 1 _).symm (A i)‖ = _
+  change ‖fun i => (WithLp.equiv 1 _).symm (A i)‖ = _
   simp [Pi.norm_def, PiLp.nnnorm_eq_sum ENNReal.one_ne_top]
 #align matrix.linfty_op_norm_def Matrix.linfty_op_norm_def
 
@@ -434,10 +434,10 @@ variable [SeminormedAddCommGroup α] [SeminormedAddCommGroup β]
 
 theorem frobenius_nnnorm_def (A : Matrix m n α) :
     ‖A‖₊ = (∑ i, ∑ j, ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ) := by
-  -- porting note: added, along with `PiLp.equiv_symm_apply` below
-  change ‖(PiLp.equiv 2 _).symm <| fun i => (PiLp.equiv 2 _).symm <| fun j => A i j‖₊ = _
+  -- porting note: added, along with `WithLp.equiv_symm_pi_apply` below
+  change ‖(WithLp.equiv 2 _).symm <| fun i => (WithLp.equiv 2 _).symm <| fun j => A i j‖₊ = _
   simp_rw [PiLp.nnnorm_eq_of_L2, NNReal.sq_sqrt, NNReal.sqrt_eq_rpow, NNReal.rpow_two,
-    PiLp.equiv_symm_apply]
+    WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_nnnorm_def Matrix.frobenius_nnnorm_def
 
 theorem frobenius_norm_def (A : Matrix m n α) :
@@ -485,30 +485,30 @@ instance frobenius_normedStarGroup [StarAddMonoid α] [NormedStarGroup α] :
 #align matrix.frobenius_normed_star_group Matrix.frobenius_normedStarGroup
 
 @[simp]
-theorem frobenius_norm_row (v : m → α) : ‖row v‖ = ‖(PiLp.equiv 2 _).symm v‖ := by
+theorem frobenius_norm_row (v : m → α) : ‖row v‖ = ‖(WithLp.equiv 2 _).symm v‖ := by
   rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
-  simp only [row_apply, Real.rpow_two, PiLp.equiv_symm_apply]
+  simp only [row_apply, Real.rpow_two, WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_norm_row Matrix.frobenius_norm_row
 
 @[simp]
-theorem frobenius_nnnorm_row (v : m → α) : ‖row v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ :=
+theorem frobenius_nnnorm_row (v : m → α) : ‖row v‖₊ = ‖(WithLp.equiv 2 _).symm v‖₊ :=
   Subtype.ext <| frobenius_norm_row v
 #align matrix.frobenius_nnnorm_row Matrix.frobenius_nnnorm_row
 
 @[simp]
-theorem frobenius_norm_col (v : n → α) : ‖col v‖ = ‖(PiLp.equiv 2 _).symm v‖ := by
+theorem frobenius_norm_col (v : n → α) : ‖col v‖ = ‖(WithLp.equiv 2 _).symm v‖ := by
   simp_rw [frobenius_norm_def, Fintype.sum_unique, PiLp.norm_eq_of_L2, Real.sqrt_eq_rpow]
-  simp only [col_apply, Real.rpow_two, PiLp.equiv_symm_apply]
+  simp only [col_apply, Real.rpow_two, WithLp.equiv_symm_pi_apply]
 #align matrix.frobenius_norm_col Matrix.frobenius_norm_col
 
 @[simp]
-theorem frobenius_nnnorm_col (v : n → α) : ‖col v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ :=
+theorem frobenius_nnnorm_col (v : n → α) : ‖col v‖₊ = ‖(WithLp.equiv 2 _).symm v‖₊ :=
   Subtype.ext <| frobenius_norm_col v
 #align matrix.frobenius_nnnorm_col Matrix.frobenius_nnnorm_col
 
 @[simp]
 theorem frobenius_nnnorm_diagonal [DecidableEq n] (v : n → α) :
-    ‖diagonal v‖₊ = ‖(PiLp.equiv 2 _).symm v‖₊ := by
+    ‖diagonal v‖₊ = ‖(WithLp.equiv 2 _).symm v‖₊ := by
   simp_rw [frobenius_nnnorm_def, ← Finset.sum_product', Finset.univ_product_univ,
     PiLp.nnnorm_eq_of_L2]
   let s := (Finset.univ : Finset n).map ⟨fun i : n => (i, i), fun i j h => congr_arg Prod.fst h⟩
@@ -523,7 +523,7 @@ theorem frobenius_nnnorm_diagonal [DecidableEq n] (v : n → α) :
 
 @[simp]
 theorem frobenius_norm_diagonal [DecidableEq n] (v : n → α) :
-    ‖diagonal v‖ = ‖(PiLp.equiv 2 _).symm v‖ :=
+    ‖diagonal v‖ = ‖(WithLp.equiv 2 _).symm v‖ :=
   (congr_arg ((↑) : ℝ≥0 → ℝ) <| frobenius_nnnorm_diagonal v : _).trans rfl
 #align matrix.frobenius_norm_diagonal Matrix.frobenius_norm_diagonal
 
@@ -552,9 +552,9 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B
     mul_div_cancel' (1 : ℝ) two_ne_zero, NNReal.rpow_one, NNReal.mul_rpow]
   dsimp only
   have :=
-    @nnnorm_inner_le_nnnorm α _ _ _ _ ((PiLp.equiv 2 fun _ => α).symm fun j => star (A i j))
-      ((PiLp.equiv 2 fun _ => α).symm fun k => B k j)
-  simpa only [PiLp.equiv_symm_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
+    @nnnorm_inner_le_nnnorm α _ _ _ _ ((WithLp.equiv 2 <| _ → α).symm fun j => star (A i j))
+      ((WithLp.equiv 2 <| _ → α).symm fun k => B k j)
+  simpa only [WithLp.equiv_symm_pi_apply, PiLp.inner_apply, IsROrC.inner_apply, starRingEnd_apply,
     Pi.nnnorm_def, PiLp.nnnorm_eq_of_L2, star_star, nnnorm_star, NNReal.sqrt_eq_rpow,
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -116,9 +116,8 @@ theorem norm_map_eq (A : Matrix m n α) (f : α → β) (hf : ∀ a, ‖f a‖ =
 #align matrix.norm_map_eq Matrix.norm_map_eq
 
 @[simp]
-theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ := by
-  simp_rw [Pi.nnnorm_def]
-  exact Finset.sup_comm _ _ _
+theorem nnnorm_transpose (A : Matrix m n α) : ‖Aᵀ‖₊ = ‖A‖₊ :=
+  Finset.sup_comm _ _ _
 #align matrix.nnnorm_transpose Matrix.nnnorm_transpose
 
 @[simp]
refactor(Data/Matrix): Eliminate notation in favor of HMul (#6487)

The main difficulty here is that * has a slightly difference precedence to . notably around smul and neg.

The other annoyance is that ↑U ⬝ A ⬝ ↑U⁻¹ : Matrix m m 𝔸 now has to be written U.val * A * (U⁻¹).val in order to typecheck.

A downside of this change to consider: if you have a goal of A * (B * C) = (A * B) * C, mul_assoc now gives the illusion of matching, when in fact Matrix.mul_assoc is needed. Previously the distinct symbol made it easy to avoid this mistake.

On the flipside, there is now no need to rewrite by Matrix.mul_eq_mul all the time (indeed, the lemma is now removed).

Diff
@@ -304,7 +304,7 @@ section NonUnitalSeminormedRing
 variable [NonUnitalSeminormedRing α]
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:107:6: warning: expanding binder group (k j) -/
-theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
+theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [linfty_op_nnnorm_def, Matrix.mul_apply]
   calc
     (Finset.univ.sup fun i => ∑ k, ‖∑ j, A i j * B j k‖₊) ≤
@@ -322,7 +322,7 @@ theorem linfty_op_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
       rfl
 #align matrix.linfty_op_nnnorm_mul Matrix.linfty_op_nnnorm_mul
 
-theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
+theorem linfty_op_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
   linfty_op_nnnorm_mul _ _
 #align matrix.linfty_op_norm_mul Matrix.linfty_op_norm_mul
 
@@ -544,7 +544,7 @@ section IsROrC
 
 variable [IsROrC α]
 
-theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
+theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖₊ ≤ ‖A‖₊ * ‖B‖₊ := by
   simp_rw [frobenius_nnnorm_def, Matrix.mul_apply]
   rw [← NNReal.mul_rpow, @Finset.sum_comm _ n m, Finset.sum_mul_sum, Finset.sum_product]
   refine' NNReal.rpow_le_rpow _ one_half_pos.le
@@ -560,7 +560,7 @@ theorem frobenius_nnnorm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝
     NNReal.rpow_two] using this
 #align matrix.frobenius_nnnorm_mul Matrix.frobenius_nnnorm_mul
 
-theorem frobenius_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A ⬝ B‖ ≤ ‖A‖ * ‖B‖ :=
+theorem frobenius_norm_mul (A : Matrix l m α) (B : Matrix m n α) : ‖A * B‖ ≤ ‖A‖ * ‖B‖ :=
   frobenius_nnnorm_mul A B
 #align matrix.frobenius_norm_mul Matrix.frobenius_norm_mul
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -52,7 +52,7 @@ open scoped BigOperators NNReal Matrix
 
 namespace Matrix
 
-variable {R l m n α β : Type _} [Fintype l] [Fintype m] [Fintype n]
+variable {R l m n α β : Type*} [Fintype l] [Fintype m] [Fintype n]
 
 /-! ### The elementwise supremum norm -/
 
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -43,7 +43,7 @@ These are not declared as instances because there are several natural choices fo
 of a matrix.
 -/
 
-local macro_rules | `($x ^ $y)   => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 
 noncomputable section
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Heather Macbeth. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Heather Macbeth, Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.matrix
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.NormedSpace.Basic
 import Mathlib.Analysis.NormedSpace.PiLp
 import Mathlib.Analysis.InnerProductSpace.PiL2
 
+#align_import analysis.matrix from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
+
 /-!
 # Matrices as a normed space
 
feat: port Analysis.NormedSpace.MatrixExponential (#5381)
Diff
@@ -390,7 +390,7 @@ matrix. -/
 @[local instance]
 protected def linftyOpNormedAlgebra [NormedField R] [SeminormedRing α] [NormedAlgebra R α]
     [DecidableEq n] : NormedAlgebra R (Matrix n n α) :=
-  { Matrix.linftyOpNormedSpace, Matrix.instAlgebraMatrixSemiring with }
+  { Matrix.linftyOpNormedSpace, Matrix.instAlgebra with }
 #align matrix.linfty_op_normed_algebra Matrix.linftyOpNormedAlgebra
 
 end LinftyOp
@@ -584,7 +584,7 @@ matrix. -/
 @[local instance]
 def frobeniusNormedAlgebra [DecidableEq m] [NormedField R] [NormedAlgebra R α] :
     NormedAlgebra R (Matrix m m α) :=
-  { Matrix.frobeniusNormedSpace, Matrix.instAlgebraMatrixSemiring with }
+  { Matrix.frobeniusNormedSpace, Matrix.instAlgebra with }
 #align matrix.frobenius_normed_algebra Matrix.frobeniusNormedAlgebra
 
 end IsROrC
feat: port Analysis.Matrix (#4490)

Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Dependencies 12 + 909

910 files ported (98.7%)
403879 lines ported (98.6%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file