analysis.inner_product_space.adjoint ⟷ Mathlib.Analysis.InnerProductSpace.Adjoint

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
@@ -46,11 +46,11 @@ adjoint
 
 noncomputable section
 
-open IsROrC
+open RCLike
 
 open scoped ComplexConjugate
 
-variable {π•œ E F G : Type _} [IsROrC π•œ]
+variable {π•œ E F G : Type _} [RCLike π•œ]
 
 variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
 
Diff
@@ -368,7 +368,7 @@ theorem ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric {A : E β†’L[π•œ] E} :
 
 #print LinearMap.IsSymmetric.isSelfAdjoint /-
 theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E β†’β‚—[π•œ] E).IsSymmetric) :
-    IsSelfAdjoint A := by rwa [← ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric] at hA 
+    IsSelfAdjoint A := by rwa [← ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric] at hA
 #align linear_map.is_symmetric.is_self_adjoint LinearMap.IsSymmetric.isSelfAdjoint
 -/
 
Diff
@@ -114,11 +114,11 @@ theorem adjointAux_adjointAux (A : E β†’L[π•œ] F) : adjointAux (adjointAux A) =
 theorem adjointAux_norm (A : E β†’L[π•œ] F) : β€–adjointAux Aβ€– = β€–Aβ€– :=
   by
   refine' le_antisymm _ _
-  Β· refine' ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg _) fun x => _
+  Β· refine' ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => _
     rw [adjoint_aux_apply, LinearIsometryEquiv.norm_map]
     exact to_sesq_form_apply_norm_le
   Β· nth_rw_lhs 1 [← adjoint_aux_adjoint_aux A]
-    refine' ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg _) fun x => _
+    refine' ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => _
     rw [adjoint_aux_apply, LinearIsometryEquiv.norm_map]
     exact to_sesq_form_apply_norm_le
 #align continuous_linear_map.adjoint_aux_norm ContinuousLinearMap.adjointAux_norm
Diff
@@ -445,10 +445,10 @@ theorem adjoint_toContinuousLinearMap (A : E β†’β‚—[π•œ] F) :
 #align linear_map.adjoint_to_continuous_linear_map LinearMap.adjoint_toContinuousLinearMap
 -/
 
-#print LinearMap.adjoint_eq_toClm_adjoint /-
-theorem adjoint_eq_toClm_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint = A.toContinuousLinearMap.adjoint :=
+#print LinearMap.adjoint_eq_toCLM_adjoint /-
+theorem adjoint_eq_toCLM_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint = A.toContinuousLinearMap.adjoint :=
   rfl
-#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toClm_adjoint
+#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toCLM_adjoint
 -/
 
 #print LinearMap.adjoint_inner_left /-
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 FrΓ©dΓ©ric Dupuis. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
 -/
-import Mathbin.Analysis.InnerProductSpace.Dual
-import Mathbin.Analysis.InnerProductSpace.PiL2
+import Analysis.InnerProductSpace.Dual
+import Analysis.InnerProductSpace.PiL2
 
 #align_import analysis.inner_product_space.adjoint from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
 
Diff
@@ -247,7 +247,7 @@ instance : Star (E β†’L[π•œ] E) :=
 instance : InvolutiveStar (E β†’L[π•œ] E) :=
   ⟨adjoint_adjoint⟩
 
-instance : StarSemigroup (E β†’L[π•œ] E) :=
+instance : StarMul (E β†’L[π•œ] E) :=
   ⟨adjoint_comp⟩
 
 instance : StarRing (E β†’L[π•œ] E) :=
@@ -543,7 +543,7 @@ instance : Star (E β†’β‚—[π•œ] E) :=
 instance : InvolutiveStar (E β†’β‚—[π•œ] E) :=
   ⟨adjoint_adjoint⟩
 
-instance : StarSemigroup (E β†’β‚—[π•œ] E) :=
+instance : StarMul (E β†’β‚—[π•œ] E) :=
   ⟨adjoint_comp⟩
 
 instance : StarRing (E β†’β‚—[π•œ] E) :=
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 FrΓ©dΓ©ric Dupuis. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
-
-! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.InnerProductSpace.Dual
 import Mathbin.Analysis.InnerProductSpace.PiL2
 
+#align_import analysis.inner_product_space.adjoint from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
+
 /-!
 # Adjoint of operators on Hilbert spaces
 
Diff
@@ -59,7 +59,6 @@ variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
 
 variable [InnerProductSpace π•œ E] [InnerProductSpace π•œ F] [InnerProductSpace π•œ G]
 
--- mathport name: Β«exprβŸͺ , ⟫»
 local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y
 
 /-! ### Adjoint operator -/
@@ -81,30 +80,39 @@ def adjointAux : (E β†’L[π•œ] F) β†’L⋆[π•œ] F β†’L[π•œ] E :=
 #align continuous_linear_map.adjoint_aux ContinuousLinearMap.adjointAux
 -/
 
+#print ContinuousLinearMap.adjointAux_apply /-
 @[simp]
 theorem adjointAux_apply (A : E β†’L[π•œ] F) (x : F) :
     adjointAux A x = ((toDual π•œ E).symm : NormedSpace.Dual π•œ E β†’ E) ((toSesqForm A) x) :=
   rfl
 #align continuous_linear_map.adjoint_aux_apply ContinuousLinearMap.adjointAux_apply
+-/
 
+#print ContinuousLinearMap.adjointAux_inner_left /-
 theorem adjointAux_inner_left (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺadjointAux A y, x⟫ = βŸͺy, A x⟫ := by
   simp only [adjoint_aux_apply, to_dual_symm_apply, to_sesq_form_apply_coe, coe_comp',
     innerSL_apply_coe]
 #align continuous_linear_map.adjoint_aux_inner_left ContinuousLinearMap.adjointAux_inner_left
+-/
 
+#print ContinuousLinearMap.adjointAux_inner_right /-
 theorem adjointAux_inner_right (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺx, adjointAux A y⟫ = βŸͺA x, y⟫ :=
   by rw [← inner_conj_symm, adjoint_aux_inner_left, inner_conj_symm]
 #align continuous_linear_map.adjoint_aux_inner_right ContinuousLinearMap.adjointAux_inner_right
+-/
 
 variable [CompleteSpace F]
 
+#print ContinuousLinearMap.adjointAux_adjointAux /-
 theorem adjointAux_adjointAux (A : E β†’L[π•œ] F) : adjointAux (adjointAux A) = A :=
   by
   ext v
   refine' ext_inner_left π•œ fun w => _
   rw [adjoint_aux_inner_right, adjoint_aux_inner_left]
 #align continuous_linear_map.adjoint_aux_adjoint_aux ContinuousLinearMap.adjointAux_adjointAux
+-/
 
+#print ContinuousLinearMap.adjointAux_norm /-
 @[simp]
 theorem adjointAux_norm (A : E β†’L[π•œ] F) : β€–adjointAux Aβ€– = β€–Aβ€– :=
   by
@@ -117,6 +125,7 @@ theorem adjointAux_norm (A : E β†’L[π•œ] F) : β€–adjointAux Aβ€– = β€–Aβ€– :=
     rw [adjoint_aux_apply, LinearIsometryEquiv.norm_map]
     exact to_sesq_form_apply_norm_le
 #align continuous_linear_map.adjoint_aux_norm ContinuousLinearMap.adjointAux_norm
+-/
 
 #print ContinuousLinearMap.adjoint /-
 /-- The adjoint of a bounded operator from Hilbert space E to Hilbert space F. -/
@@ -126,25 +135,31 @@ def adjoint : (E β†’L[π•œ] F) ≃ₗᡒ⋆[π•œ] F β†’L[π•œ] E :=
 #align continuous_linear_map.adjoint ContinuousLinearMap.adjoint
 -/
 
--- mathport name: adjoint
 scoped[InnerProduct] postfix:1000 "†" => ContinuousLinearMap.adjoint
 
+#print ContinuousLinearMap.adjoint_inner_left /-
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_left (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺ(A†) y, x⟫ = βŸͺy, A x⟫ :=
   adjointAux_inner_left A x y
 #align continuous_linear_map.adjoint_inner_left ContinuousLinearMap.adjoint_inner_left
+-/
 
+#print ContinuousLinearMap.adjoint_inner_right /-
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_right (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺx, (A†) y⟫ = βŸͺA x, y⟫ :=
   adjointAux_inner_right A x y
 #align continuous_linear_map.adjoint_inner_right ContinuousLinearMap.adjoint_inner_right
+-/
 
+#print ContinuousLinearMap.adjoint_adjoint /-
 /-- The adjoint is involutive -/
 @[simp]
 theorem adjoint_adjoint (A : E β†’L[π•œ] F) : A†† = A :=
   adjointAux_adjointAux A
 #align continuous_linear_map.adjoint_adjoint ContinuousLinearMap.adjoint_adjoint
+-/
 
+#print ContinuousLinearMap.adjoint_comp /-
 /-- The adjoint of the composition of two operators is the composition of the two adjoints
 in reverse order. -/
 @[simp]
@@ -154,31 +169,41 @@ theorem adjoint_comp (A : F β†’L[π•œ] G) (B : E β†’L[π•œ] F) : (A ∘L B)† =
   refine' ext_inner_left π•œ fun w => _
   simp only [adjoint_inner_right, ContinuousLinearMap.coe_comp', Function.comp_apply]
 #align continuous_linear_map.adjoint_comp ContinuousLinearMap.adjoint_comp
+-/
 
+#print ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left /-
 theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– ^ 2 = re βŸͺ(A† * A) x, x⟫ :=
   by
   have h : βŸͺ(A† * A) x, x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_left]; rfl
   rw [h, ← inner_self_eq_norm_sq _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
+-/
 
+#print ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_left /-
 theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_left, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_left ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_left
+-/
 
+#print ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right /-
 theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– ^ 2 = re βŸͺx, (A† * A) x⟫ :=
   by
   have h : βŸͺx, (A† * A) x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_right]; rfl
   rw [h, ← inner_self_eq_norm_sq _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_right ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right
+-/
 
+#print ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_right /-
 theorem apply_norm_eq_sqrt_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– = Real.sqrt (re βŸͺx, (A† * A) x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_right, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_right ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_right
+-/
 
+#print ContinuousLinearMap.eq_adjoint_iff /-
 /-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `βŸͺA x, y⟫ = βŸͺx, B y⟫`
 for all `x` and `y`. -/
 theorem eq_adjoint_iff (A : E β†’L[π•œ] F) (B : F β†’L[π•œ] E) : A = B† ↔ βˆ€ x y, βŸͺA x, y⟫ = βŸͺx, B y⟫ :=
@@ -187,7 +212,9 @@ theorem eq_adjoint_iff (A : E β†’L[π•œ] F) (B : F β†’L[π•œ] E) : A = B† ↔
   ext x
   exact ext_inner_right π•œ fun y => by simp only [adjoint_inner_left, h x y]
 #align continuous_linear_map.eq_adjoint_iff ContinuousLinearMap.eq_adjoint_iff
+-/
 
+#print ContinuousLinearMap.adjoint_id /-
 @[simp]
 theorem adjoint_id : (ContinuousLinearMap.id π•œ E).adjoint = ContinuousLinearMap.id π•œ E :=
   by
@@ -195,7 +222,9 @@ theorem adjoint_id : (ContinuousLinearMap.id π•œ E).adjoint = ContinuousLinearM
   rw [eq_adjoint_iff]
   simp
 #align continuous_linear_map.adjoint_id ContinuousLinearMap.adjoint_id
+-/
 
+#print Submodule.adjoint_subtypeL /-
 theorem Submodule.adjoint_subtypeL (U : Submodule π•œ E) [CompleteSpace U] :
     U.subtypeL† = orthogonalProjection U := by
   symm
@@ -205,11 +234,14 @@ theorem Submodule.adjoint_subtypeL (U : Submodule π•œ E) [CompleteSpace U] :
     orthogonalProjection_mem_subspace_eq_self]
   rfl
 #align submodule.adjoint_subtypeL Submodule.adjoint_subtypeL
+-/
 
+#print Submodule.adjoint_orthogonalProjection /-
 theorem Submodule.adjoint_orthogonalProjection (U : Submodule π•œ E) [CompleteSpace U] :
     (orthogonalProjection U : E β†’L[π•œ] U)† = U.subtypeL := by
   rw [← U.adjoint_subtypeL, adjoint_adjoint]
 #align submodule.adjoint_orthogonal_projection Submodule.adjoint_orthogonalProjection
+-/
 
 /-- `E β†’L[π•œ] E` is a star algebra with the adjoint as the star operation. -/
 instance : Star (E β†’L[π•œ] E) :=
@@ -227,14 +259,18 @@ instance : StarRing (E β†’L[π•œ] E) :=
 instance : StarModule π•œ (E β†’L[π•œ] E) :=
   ⟨LinearIsometryEquiv.map_smulβ‚›β‚— adjoint⟩
 
+#print ContinuousLinearMap.star_eq_adjoint /-
 theorem star_eq_adjoint (A : E β†’L[π•œ] E) : star A = A† :=
   rfl
 #align continuous_linear_map.star_eq_adjoint ContinuousLinearMap.star_eq_adjoint
+-/
 
+#print ContinuousLinearMap.isSelfAdjoint_iff' /-
 /-- A continuous linear operator is self-adjoint iff it is equal to its adjoint. -/
 theorem isSelfAdjoint_iff' {A : E β†’L[π•œ] E} : IsSelfAdjoint A ↔ A.adjoint = A :=
   Iff.rfl
 #align continuous_linear_map.is_self_adjoint_iff' ContinuousLinearMap.isSelfAdjoint_iff'
+-/
 
 instance : CstarRing (E β†’L[π•œ] E) :=
   ⟨by
@@ -267,6 +303,7 @@ variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
 
 variable [CompleteSpace E'] [CompleteSpace F']
 
+#print ContinuousLinearMap.isAdjointPair_inner /-
 -- Todo: Generalize this to `is_R_or_C`.
 theorem isAdjointPair_inner (A : E' β†’L[ℝ] F') :
     LinearMap.IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ)
@@ -274,6 +311,7 @@ theorem isAdjointPair_inner (A : E' β†’L[ℝ] F') :
   fun x y => by
   simp only [sesqFormOfInner_apply_apply, adjoint_inner_left, to_linear_map_eq_coe, coe_coe]
 #align continuous_linear_map.is_adjoint_pair_inner ContinuousLinearMap.isAdjointPair_inner
+-/
 
 end Real
 
@@ -288,15 +326,20 @@ open ContinuousLinearMap
 
 variable [CompleteSpace E] [CompleteSpace F]
 
+#print IsSelfAdjoint.adjoint_eq /-
 theorem adjoint_eq {A : E β†’L[π•œ] E} (hA : IsSelfAdjoint A) : A.adjoint = A :=
   hA
 #align is_self_adjoint.adjoint_eq IsSelfAdjoint.adjoint_eq
+-/
 
+#print IsSelfAdjoint.isSymmetric /-
 /-- Every self-adjoint operator on an inner product space is symmetric. -/
 theorem isSymmetric {A : E β†’L[π•œ] E} (hA : IsSelfAdjoint A) : (A : E β†’β‚—[π•œ] E).IsSymmetric :=
   fun x y => by rw_mod_cast [← A.adjoint_inner_right, hA.adjoint_eq]
 #align is_self_adjoint.is_symmetric IsSelfAdjoint.isSymmetric
+-/
 
+#print IsSelfAdjoint.conj_adjoint /-
 /-- Conjugating preserves self-adjointness -/
 theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[π•œ] F) :
     IsSelfAdjoint (S ∘L T ∘L S.adjoint) :=
@@ -305,7 +348,9 @@ theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.conj_adjoint IsSelfAdjoint.conj_adjoint
+-/
 
+#print IsSelfAdjoint.adjoint_conj /-
 /-- Conjugating preserves self-adjointness -/
 theorem adjoint_conj {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : F β†’L[π•œ] E) :
     IsSelfAdjoint (S.adjoint ∘L T ∘L S) :=
@@ -314,23 +359,31 @@ theorem adjoint_conj {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : F β†’L[
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.adjoint_conj IsSelfAdjoint.adjoint_conj
+-/
 
+#print ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric /-
 theorem ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric {A : E β†’L[π•œ] E} :
     IsSelfAdjoint A ↔ (A : E β†’β‚—[π•œ] E).IsSymmetric :=
   ⟨fun hA => hA.IsSymmetric, fun hA =>
     ext fun x => ext_inner_right π•œ fun y => (A.adjoint_inner_left y x).symm β–Έ (hA x y).symm⟩
 #align continuous_linear_map.is_self_adjoint_iff_is_symmetric ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric
+-/
 
+#print LinearMap.IsSymmetric.isSelfAdjoint /-
 theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E β†’β‚—[π•œ] E).IsSymmetric) :
     IsSelfAdjoint A := by rwa [← ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric] at hA 
 #align linear_map.is_symmetric.is_self_adjoint LinearMap.IsSymmetric.isSelfAdjoint
+-/
 
+#print orthogonalProjection_isSelfAdjoint /-
 /-- The orthogonal projection is self-adjoint. -/
 theorem orthogonalProjection_isSelfAdjoint (U : Submodule π•œ E) [CompleteSpace U] :
     IsSelfAdjoint (U.subtypeL ∘L orthogonalProjection U) :=
   (orthogonalProjection_isSymmetric U).IsSelfAdjoint
 #align orthogonal_projection_is_self_adjoint orthogonalProjection_isSelfAdjoint
+-/
 
+#print IsSelfAdjoint.conj_orthogonalProjection /-
 theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U : Submodule π•œ E)
     [CompleteSpace U] :
     IsSelfAdjoint
@@ -340,6 +393,7 @@ theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U
   nth_rw 1 [← (orthogonalProjection_isSelfAdjoint U).adjoint_eq]
   refine' hT.adjoint_conj _
 #align is_self_adjoint.conj_orthogonal_projection IsSelfAdjoint.conj_orthogonalProjection
+-/
 
 end IsSelfAdjoint
 
@@ -349,19 +403,25 @@ variable [CompleteSpace E]
 
 variable {T : E β†’β‚—[π•œ] E}
 
+#print LinearMap.IsSymmetric.toSelfAdjoint /-
 /-- The **Hellinger--Toeplitz theorem**: Construct a self-adjoint operator from an everywhere
   defined symmetric operator.-/
 def IsSymmetric.toSelfAdjoint (hT : IsSymmetric T) : selfAdjoint (E β†’L[π•œ] E) :=
   ⟨⟨T, hT.Continuous⟩, ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr hT⟩
 #align linear_map.is_symmetric.to_self_adjoint LinearMap.IsSymmetric.toSelfAdjoint
+-/
 
+#print LinearMap.IsSymmetric.coe_toSelfAdjoint /-
 theorem IsSymmetric.coe_toSelfAdjoint (hT : IsSymmetric T) : (hT.toSelfAdjoint : E β†’β‚—[π•œ] E) = T :=
   rfl
 #align linear_map.is_symmetric.coe_to_self_adjoint LinearMap.IsSymmetric.coe_toSelfAdjoint
+-/
 
+#print LinearMap.IsSymmetric.toSelfAdjoint_apply /-
 theorem IsSymmetric.toSelfAdjoint_apply (hT : IsSymmetric T) {x : E} : hT.toSelfAdjoint x = T x :=
   rfl
 #align linear_map.is_symmetric.to_self_adjoint_apply LinearMap.IsSymmetric.toSelfAdjoint_apply
+-/
 
 end LinearMap
 
@@ -381,29 +441,38 @@ def adjoint : (E β†’β‚—[π•œ] F) ≃ₗ⋆[π•œ] F β†’β‚—[π•œ] E :=
 #align linear_map.adjoint LinearMap.adjoint
 -/
 
+#print LinearMap.adjoint_toContinuousLinearMap /-
 theorem adjoint_toContinuousLinearMap (A : E β†’β‚—[π•œ] F) :
     A.adjoint.toContinuousLinearMap = A.toContinuousLinearMap.adjoint :=
   rfl
 #align linear_map.adjoint_to_continuous_linear_map LinearMap.adjoint_toContinuousLinearMap
+-/
 
+#print LinearMap.adjoint_eq_toClm_adjoint /-
 theorem adjoint_eq_toClm_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint = A.toContinuousLinearMap.adjoint :=
   rfl
 #align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toClm_adjoint
+-/
 
+#print LinearMap.adjoint_inner_left /-
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_left (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺadjoint A y, x⟫ = βŸͺy, A x⟫ :=
   by
   rw [← coe_to_continuous_linear_map A, adjoint_eq_to_clm_adjoint]
   exact ContinuousLinearMap.adjoint_inner_left _ x y
 #align linear_map.adjoint_inner_left LinearMap.adjoint_inner_left
+-/
 
+#print LinearMap.adjoint_inner_right /-
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_right (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺx, adjoint A y⟫ = βŸͺA x, y⟫ :=
   by
   rw [← coe_to_continuous_linear_map A, adjoint_eq_to_clm_adjoint]
   exact ContinuousLinearMap.adjoint_inner_right _ x y
 #align linear_map.adjoint_inner_right LinearMap.adjoint_inner_right
+-/
 
+#print LinearMap.adjoint_adjoint /-
 /-- The adjoint is involutive -/
 @[simp]
 theorem adjoint_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint.adjoint = A :=
@@ -412,7 +481,9 @@ theorem adjoint_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint.adjoint = A :=
   refine' ext_inner_left π•œ fun w => _
   rw [adjoint_inner_right, adjoint_inner_left]
 #align linear_map.adjoint_adjoint LinearMap.adjoint_adjoint
+-/
 
+#print LinearMap.adjoint_comp /-
 /-- The adjoint of the composition of two operators is the composition of the two adjoints
 in reverse order. -/
 @[simp]
@@ -422,7 +493,9 @@ theorem adjoint_comp (A : F β†’β‚—[π•œ] G) (B : E β†’β‚—[π•œ] F) : (A βˆ˜β‚— B
   refine' ext_inner_left π•œ fun w => _
   simp only [adjoint_inner_right, LinearMap.coe_comp, Function.comp_apply]
 #align linear_map.adjoint_comp LinearMap.adjoint_comp
+-/
 
+#print LinearMap.eq_adjoint_iff /-
 /-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `βŸͺA x, y⟫ = βŸͺx, B y⟫`
 for all `x` and `y`. -/
 theorem eq_adjoint_iff (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
@@ -432,7 +505,9 @@ theorem eq_adjoint_iff (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
   ext x
   exact ext_inner_right π•œ fun y => by simp only [adjoint_inner_left, h x y]
 #align linear_map.eq_adjoint_iff LinearMap.eq_adjoint_iff
+-/
 
+#print LinearMap.eq_adjoint_iff_basis /-
 /-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `βŸͺA x, y⟫ = βŸͺx, B y⟫`
 for all basis vectors `x` and `y`. -/
 theorem eq_adjoint_iff_basis {ι₁ : Type _} {ΞΉβ‚‚ : Type _} (b₁ : Basis ι₁ π•œ E) (bβ‚‚ : Basis ΞΉβ‚‚ π•œ F)
@@ -443,14 +518,18 @@ theorem eq_adjoint_iff_basis {ι₁ : Type _} {ΞΉβ‚‚ : Type _} (b₁ : Basis ΞΉ
   refine' Basis.ext b₁ fun i₁ => _
   exact ext_inner_right_basis bβ‚‚ fun iβ‚‚ => by simp only [adjoint_inner_left, h i₁ iβ‚‚]
 #align linear_map.eq_adjoint_iff_basis LinearMap.eq_adjoint_iff_basis
+-/
 
+#print LinearMap.eq_adjoint_iff_basis_left /-
 theorem eq_adjoint_iff_basis_left {ΞΉ : Type _} (b : Basis ΞΉ π•œ E) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
     A = B.adjoint ↔ βˆ€ i y, βŸͺA (b i), y⟫ = βŸͺb i, B y⟫ :=
   by
   refine' ⟨fun h x y => by rw [h, adjoint_inner_left], fun h => Basis.ext b fun i => _⟩
   exact ext_inner_right π•œ fun y => by simp only [h i, adjoint_inner_left]
 #align linear_map.eq_adjoint_iff_basis_left LinearMap.eq_adjoint_iff_basis_left
+-/
 
+#print LinearMap.eq_adjoint_iff_basis_right /-
 theorem eq_adjoint_iff_basis_right {ΞΉ : Type _} (b : Basis ΞΉ π•œ F) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
     A = B.adjoint ↔ βˆ€ i x, βŸͺA x, b i⟫ = βŸͺx, B (b i)⟫ :=
   by
@@ -458,6 +537,7 @@ theorem eq_adjoint_iff_basis_right {ΞΉ : Type _} (b : Basis ΞΉ π•œ F) (A : E 
   ext x
   refine' ext_inner_right_basis b fun i => by simp only [h i, adjoint_inner_left]
 #align linear_map.eq_adjoint_iff_basis_right LinearMap.eq_adjoint_iff_basis_right
+-/
 
 /-- `E β†’β‚—[π•œ] E` is a star algebra with the adjoint as the star operation. -/
 instance : Star (E β†’β‚—[π•œ] E) :=
@@ -475,18 +555,24 @@ instance : StarRing (E β†’β‚—[π•œ] E) :=
 instance : StarModule π•œ (E β†’β‚—[π•œ] E) :=
   ⟨LinearEquiv.map_smulβ‚›β‚— adjoint⟩
 
+#print LinearMap.star_eq_adjoint /-
 theorem star_eq_adjoint (A : E β†’β‚—[π•œ] E) : star A = A.adjoint :=
   rfl
 #align linear_map.star_eq_adjoint LinearMap.star_eq_adjoint
+-/
 
+#print LinearMap.isSelfAdjoint_iff' /-
 /-- A continuous linear operator is self-adjoint iff it is equal to its adjoint. -/
 theorem isSelfAdjoint_iff' {A : E β†’β‚—[π•œ] E} : IsSelfAdjoint A ↔ A.adjoint = A :=
   Iff.rfl
 #align linear_map.is_self_adjoint_iff' LinearMap.isSelfAdjoint_iff'
+-/
 
+#print LinearMap.isSymmetric_iff_isSelfAdjoint /-
 theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔ IsSelfAdjoint A := by
   rw [is_self_adjoint_iff', is_symmetric, ← LinearMap.eq_adjoint_iff]; exact eq_comm
 #align linear_map.is_symmetric_iff_is_self_adjoint LinearMap.isSymmetric_iff_isSelfAdjoint
+-/
 
 section Real
 
@@ -498,27 +584,34 @@ variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
 
 variable [FiniteDimensional ℝ E'] [FiniteDimensional ℝ F']
 
+#print LinearMap.isAdjointPair_inner /-
 -- Todo: Generalize this to `is_R_or_C`.
 theorem isAdjointPair_inner (A : E' β†’β‚—[ℝ] F') :
     IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ) (sesqFormOfInner : F' β†’β‚—[ℝ] F' β†’β‚—[ℝ] ℝ) A
       A.adjoint :=
   fun x y => by simp only [sesqFormOfInner_apply_apply, adjoint_inner_left]
 #align linear_map.is_adjoint_pair_inner LinearMap.isAdjointPair_inner
+-/
 
 end Real
 
+#print LinearMap.isSymmetric_adjoint_mul_self /-
 /-- The Gram operator T†T is symmetric. -/
 theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
   simp only [mul_apply, adjoint_inner_left, adjoint_inner_right]
 #align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetric_adjoint_mul_self
+-/
 
+#print LinearMap.re_inner_adjoint_mul_self_nonneg /-
 /-- The Gram operator T†T is a positive operator. -/
 theorem re_inner_adjoint_mul_self_nonneg (T : E β†’β‚—[π•œ] E) (x : E) : 0 ≀ re βŸͺx, (T.adjoint * T) x⟫ :=
   by
   simp only [mul_apply, adjoint_inner_right, inner_self_eq_norm_sq_to_K]
   norm_cast; exact sq_nonneg _
 #align linear_map.re_inner_adjoint_mul_self_nonneg LinearMap.re_inner_adjoint_mul_self_nonneg
+-/
 
+#print LinearMap.im_inner_adjoint_mul_self_eq_zero /-
 @[simp]
 theorem im_inner_adjoint_mul_self_eq_zero (T : E β†’β‚—[π•œ] E) (x : E) :
     im βŸͺx, LinearMap.adjoint T (T x)⟫ = 0 :=
@@ -526,6 +619,7 @@ theorem im_inner_adjoint_mul_self_eq_zero (T : E β†’β‚—[π•œ] E) (x : E) :
   simp only [mul_apply, adjoint_inner_right, inner_self_eq_norm_sq_to_K]
   norm_cast
 #align linear_map.im_inner_adjoint_mul_self_eq_zero LinearMap.im_inner_adjoint_mul_self_eq_zero
+-/
 
 end LinearMap
 
@@ -535,6 +629,7 @@ variable {m n : Type _} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
 
 open scoped ComplexConjugate
 
+#print Matrix.toEuclideanLin_conjTranspose_eq_adjoint /-
 /-- The adjoint of the linear map associated to a matrix is the linear map associated to the
 conjugate transpose of that matrix. -/
 theorem toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
@@ -545,6 +640,7 @@ theorem toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
   simp_rw [EuclideanSpace.inner_eq_star_dotProduct, pi_Lp_equiv_to_euclidean_lin, to_lin'_apply,
     star_mul_vec, conj_transpose_conj_transpose, dot_product_mul_vec]
 #align matrix.to_euclidean_lin_conj_transpose_eq_adjoint Matrix.toEuclideanLin_conjTranspose_eq_adjoint
+-/
 
 end Matrix
 
Diff
@@ -245,20 +245,17 @@ instance : CstarRing (E β†’L[π•œ] E) :=
       calc
         β€–A† * Aβ€– ≀ β€–A†‖ * β€–Aβ€– := op_norm_comp_le _ _
         _ = β€–Aβ€– * β€–Aβ€– := by rw [LinearIsometryEquiv.norm_map]
-        
     Β· rw [← sq, ← Real.sqrt_le_sqrt_iff (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)]
       refine' op_norm_le_bound _ (Real.sqrt_nonneg _) fun x => _
       have :=
         calc
           re βŸͺ(A† * A) x, x⟫ ≀ β€–(A† * A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
           _ ≀ β€–A† * Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_op_norm _ _) (norm_nonneg _)
-          
       calc
         β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
         _ ≀ Real.sqrt (β€–A† * Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
         _ = Real.sqrt β€–A† * Aβ€– * β€–xβ€– := by
-          rw [mul_assoc, Real.sqrt_mul (norm_nonneg _), Real.sqrt_mul_self (norm_nonneg _)]
-        ⟩
+          rw [mul_assoc, Real.sqrt_mul (norm_nonneg _), Real.sqrt_mul_self (norm_nonneg _)]⟩
 
 section Real
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
 
 ! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
+! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.InnerProductSpace.PiL2
 /-!
 # Adjoint of operators on Hilbert spaces
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Given an operator `A : E β†’L[π•œ] F`, where `E` and `F` are Hilbert spaces, its adjoint
 `adjoint A : F β†’L[π•œ] E` is the unique operator such that `βŸͺx, A y⟫ = βŸͺadjoint A x, y⟫` for all
 `x` and `y`.
Diff
@@ -68,6 +68,7 @@ namespace ContinuousLinearMap
 
 variable [CompleteSpace E] [CompleteSpace G]
 
+#print ContinuousLinearMap.adjointAux /-
 /-- The adjoint, as a continuous conjugate-linear map.  This is only meant as an auxiliary
 definition for the main definition `adjoint`, where this is bundled as a conjugate-linear isometric
 equivalence. -/
@@ -75,6 +76,7 @@ def adjointAux : (E β†’L[π•œ] F) β†’L⋆[π•œ] F β†’L[π•œ] E :=
   (ContinuousLinearMap.compSL _ _ _ _ _ ((toDual π•œ E).symm : NormedSpace.Dual π•œ E β†’L⋆[π•œ] E)).comp
     (toSesqForm : (E β†’L[π•œ] F) β†’L[π•œ] F β†’L⋆[π•œ] NormedSpace.Dual π•œ E)
 #align continuous_linear_map.adjoint_aux ContinuousLinearMap.adjointAux
+-/
 
 @[simp]
 theorem adjointAux_apply (A : E β†’L[π•œ] F) (x : F) :
@@ -113,11 +115,13 @@ theorem adjointAux_norm (A : E β†’L[π•œ] F) : β€–adjointAux Aβ€– = β€–Aβ€– :=
     exact to_sesq_form_apply_norm_le
 #align continuous_linear_map.adjoint_aux_norm ContinuousLinearMap.adjointAux_norm
 
+#print ContinuousLinearMap.adjoint /-
 /-- The adjoint of a bounded operator from Hilbert space E to Hilbert space F. -/
 def adjoint : (E β†’L[π•œ] F) ≃ₗᡒ⋆[π•œ] F β†’L[π•œ] E :=
   LinearIsometryEquiv.ofSurjective { adjointAux with norm_map' := adjointAux_norm } fun A =>
     ⟨adjointAux A, adjointAux_adjointAux A⟩
 #align continuous_linear_map.adjoint ContinuousLinearMap.adjoint
+-/
 
 -- mathport name: adjoint
 scoped[InnerProduct] postfix:1000 "†" => ContinuousLinearMap.adjoint
@@ -297,7 +301,7 @@ theorem isSymmetric {A : E β†’L[π•œ] E} (hA : IsSelfAdjoint A) : (A : E β†’β‚—[
 theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[π•œ] F) :
     IsSelfAdjoint (S ∘L T ∘L S.adjoint) :=
   by
-  rw [is_self_adjoint_iff'] at hT⊒
+  rw [is_self_adjoint_iff'] at hT ⊒
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.conj_adjoint IsSelfAdjoint.conj_adjoint
@@ -306,7 +310,7 @@ theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[
 theorem adjoint_conj {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : F β†’L[π•œ] E) :
     IsSelfAdjoint (S.adjoint ∘L T ∘L S) :=
   by
-  rw [is_self_adjoint_iff'] at hT⊒
+  rw [is_self_adjoint_iff'] at hT ⊒
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.adjoint_conj IsSelfAdjoint.adjoint_conj
@@ -318,7 +322,7 @@ theorem ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric {A : E β†’L[π•œ] E} :
 #align continuous_linear_map.is_self_adjoint_iff_is_symmetric ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric
 
 theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E β†’β‚—[π•œ] E).IsSymmetric) :
-    IsSelfAdjoint A := by rwa [← ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric] at hA
+    IsSelfAdjoint A := by rwa [← ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric] at hA 
 #align linear_map.is_symmetric.is_self_adjoint LinearMap.IsSymmetric.isSelfAdjoint
 
 /-- The orthogonal projection is self-adjoint. -/
@@ -367,6 +371,7 @@ variable [FiniteDimensional π•œ E] [FiniteDimensional π•œ F] [FiniteDimensiona
 
 attribute [local instance 20] FiniteDimensional.complete
 
+#print LinearMap.adjoint /-
 /-- The adjoint of an operator from the finite-dimensional inner product space E to the finite-
 dimensional inner product space F. -/
 def adjoint : (E β†’β‚—[π•œ] F) ≃ₗ⋆[π•œ] F β†’β‚—[π•œ] E :=
@@ -374,15 +379,16 @@ def adjoint : (E β†’β‚—[π•œ] F) ≃ₗ⋆[π•œ] F β†’β‚—[π•œ] E :=
         ContinuousLinearMap.adjoint.toLinearEquiv).trans
     LinearMap.toContinuousLinearMap.symm
 #align linear_map.adjoint LinearMap.adjoint
+-/
 
 theorem adjoint_toContinuousLinearMap (A : E β†’β‚—[π•œ] F) :
     A.adjoint.toContinuousLinearMap = A.toContinuousLinearMap.adjoint :=
   rfl
 #align linear_map.adjoint_to_continuous_linear_map LinearMap.adjoint_toContinuousLinearMap
 
-theorem adjoint_eq_to_clm_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint = A.toContinuousLinearMap.adjoint :=
+theorem adjoint_eq_toClm_adjoint (A : E β†’β‚—[π•œ] F) : A.adjoint = A.toContinuousLinearMap.adjoint :=
   rfl
-#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_to_clm_adjoint
+#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toClm_adjoint
 
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_left (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺadjoint A y, x⟫ = βŸͺy, A x⟫ :=
Diff
@@ -48,7 +48,7 @@ noncomputable section
 
 open IsROrC
 
-open ComplexConjugate
+open scoped ComplexConjugate
 
 variable {π•œ E F G : Type _} [IsROrC π•œ]
 
@@ -527,7 +527,7 @@ namespace Matrix
 
 variable {m n : Type _} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
 
-open ComplexConjugate
+open scoped ComplexConjugate
 
 /-- The adjoint of the linear map associated to a matrix is the linear map associated to the
 conjugate transpose of that matrix. -/
Diff
@@ -151,10 +151,7 @@ theorem adjoint_comp (A : F β†’L[π•œ] G) (B : E β†’L[π•œ] F) : (A ∘L B)† =
 theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– ^ 2 = re βŸͺ(A† * A) x, x⟫ :=
   by
-  have h : βŸͺ(A† * A) x, x⟫ = βŸͺA x, A x⟫ :=
-    by
-    rw [← adjoint_inner_left]
-    rfl
+  have h : βŸͺ(A† * A) x, x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_left]; rfl
   rw [h, ← inner_self_eq_norm_sq _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
 
@@ -166,10 +163,7 @@ theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
 theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
     β€–A xβ€– ^ 2 = re βŸͺx, (A† * A) x⟫ :=
   by
-  have h : βŸͺx, (A† * A) x⟫ = βŸͺA x, A x⟫ :=
-    by
-    rw [← adjoint_inner_right]
-    rfl
+  have h : βŸͺx, (A† * A) x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_right]; rfl
   rw [h, ← inner_self_eq_norm_sq _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_right ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right
 
@@ -484,10 +478,8 @@ theorem isSelfAdjoint_iff' {A : E β†’β‚—[π•œ] E} : IsSelfAdjoint A ↔ A.adjoin
   Iff.rfl
 #align linear_map.is_self_adjoint_iff' LinearMap.isSelfAdjoint_iff'
 
-theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔ IsSelfAdjoint A :=
-  by
-  rw [is_self_adjoint_iff', is_symmetric, ← LinearMap.eq_adjoint_iff]
-  exact eq_comm
+theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔ IsSelfAdjoint A := by
+  rw [is_self_adjoint_iff', is_symmetric, ← LinearMap.eq_adjoint_iff]; exact eq_comm
 #align linear_map.is_symmetric_iff_is_self_adjoint LinearMap.isSymmetric_iff_isSelfAdjoint
 
 section Real
@@ -518,8 +510,7 @@ theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adj
 theorem re_inner_adjoint_mul_self_nonneg (T : E β†’β‚—[π•œ] E) (x : E) : 0 ≀ re βŸͺx, (T.adjoint * T) x⟫ :=
   by
   simp only [mul_apply, adjoint_inner_right, inner_self_eq_norm_sq_to_K]
-  norm_cast
-  exact sq_nonneg _
+  norm_cast; exact sq_nonneg _
 #align linear_map.re_inner_adjoint_mul_self_nonneg LinearMap.re_inner_adjoint_mul_self_nonneg
 
 @[simp]
Diff
@@ -330,7 +330,7 @@ theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E 
 /-- The orthogonal projection is self-adjoint. -/
 theorem orthogonalProjection_isSelfAdjoint (U : Submodule π•œ E) [CompleteSpace U] :
     IsSelfAdjoint (U.subtypeL ∘L orthogonalProjection U) :=
-  (orthogonalProjectionIsSymmetric U).IsSelfAdjoint
+  (orthogonalProjection_isSymmetric U).IsSelfAdjoint
 #align orthogonal_projection_is_self_adjoint orthogonalProjection_isSelfAdjoint
 
 theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U : Submodule π•œ E)
@@ -510,9 +510,9 @@ theorem isAdjointPair_inner (A : E' β†’β‚—[ℝ] F') :
 end Real
 
 /-- The Gram operator T†T is symmetric. -/
-theorem isSymmetricAdjointMulSelf (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
+theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
   simp only [mul_apply, adjoint_inner_left, adjoint_inner_right]
-#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetricAdjointMulSelf
+#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetric_adjoint_mul_self
 
 /-- The Gram operator T†T is a positive operator. -/
 theorem re_inner_adjoint_mul_self_nonneg (T : E β†’β‚—[π•œ] E) (x : E) : 0 ≀ re βŸͺx, (T.adjoint * T) x⟫ :=
Diff
@@ -330,7 +330,7 @@ theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E 
 /-- The orthogonal projection is self-adjoint. -/
 theorem orthogonalProjection_isSelfAdjoint (U : Submodule π•œ E) [CompleteSpace U] :
     IsSelfAdjoint (U.subtypeL ∘L orthogonalProjection U) :=
-  (orthogonalProjection_isSymmetric U).IsSelfAdjoint
+  (orthogonalProjectionIsSymmetric U).IsSelfAdjoint
 #align orthogonal_projection_is_self_adjoint orthogonalProjection_isSelfAdjoint
 
 theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U : Submodule π•œ E)
@@ -510,9 +510,9 @@ theorem isAdjointPair_inner (A : E' β†’β‚—[ℝ] F') :
 end Real
 
 /-- The Gram operator T†T is symmetric. -/
-theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
+theorem isSymmetricAdjointMulSelf (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
   simp only [mul_apply, adjoint_inner_left, adjoint_inner_right]
-#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetric_adjoint_mul_self
+#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetricAdjointMulSelf
 
 /-- The Gram operator T†T is a positive operator. -/
 theorem re_inner_adjoint_mul_self_nonneg (T : E β†’β‚—[π•œ] E) (x : E) : 0 ≀ re βŸͺx, (T.adjoint * T) x⟫ :=
Diff
@@ -371,7 +371,7 @@ namespace LinearMap
 
 variable [FiniteDimensional π•œ E] [FiniteDimensional π•œ F] [FiniteDimensional π•œ G]
 
-attribute [local instance] FiniteDimensional.complete
+attribute [local instance 20] FiniteDimensional.complete
 
 /-- The adjoint of an operator from the finite-dimensional inner product space E to the finite-
 dimensional inner product space F. -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
 
 ! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! leanprover-community/mathlib commit 9f0d61b4475e3c3cba6636ab51cdb1f3949d2e1d
+! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -52,6 +52,8 @@ open ComplexConjugate
 
 variable {π•œ E F G : Type _} [IsROrC π•œ]
 
+variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
+
 variable [InnerProductSpace π•œ E] [InnerProductSpace π•œ F] [InnerProductSpace π•œ G]
 
 -- mathport name: Β«exprβŸͺ , ⟫»
@@ -259,7 +261,11 @@ instance : CstarRing (E β†’L[π•œ] E) :=
 
 section Real
 
-variable {E' : Type _} {F' : Type _} [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
+variable {E' : Type _} {F' : Type _}
+
+variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
+
+variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
 
 variable [CompleteSpace E'] [CompleteSpace F']
 
@@ -486,7 +492,11 @@ theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔
 
 section Real
 
-variable {E' : Type _} {F' : Type _} [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
+variable {E' : Type _} {F' : Type _}
+
+variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
+
+variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
 
 variable [FiniteDimensional ℝ E'] [FiniteDimensional ℝ F']
 
Diff
@@ -264,12 +264,12 @@ variable {E' : Type _} {F' : Type _} [InnerProductSpace ℝ E'] [InnerProductSpa
 variable [CompleteSpace E'] [CompleteSpace F']
 
 -- Todo: Generalize this to `is_R_or_C`.
-theorem isAdjointPairInner (A : E' β†’L[ℝ] F') :
+theorem isAdjointPair_inner (A : E' β†’L[ℝ] F') :
     LinearMap.IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ)
       (sesqFormOfInner : F' β†’β‚—[ℝ] F' β†’β‚—[ℝ] ℝ) A (A†) :=
   fun x y => by
   simp only [sesqFormOfInner_apply_apply, adjoint_inner_left, to_linear_map_eq_coe, coe_coe]
-#align continuous_linear_map.is_adjoint_pair_inner ContinuousLinearMap.isAdjointPairInner
+#align continuous_linear_map.is_adjoint_pair_inner ContinuousLinearMap.isAdjointPair_inner
 
 end Real
 
@@ -491,11 +491,11 @@ variable {E' : Type _} {F' : Type _} [InnerProductSpace ℝ E'] [InnerProductSpa
 variable [FiniteDimensional ℝ E'] [FiniteDimensional ℝ F']
 
 -- Todo: Generalize this to `is_R_or_C`.
-theorem isAdjointPairInner (A : E' β†’β‚—[ℝ] F') :
+theorem isAdjointPair_inner (A : E' β†’β‚—[ℝ] F') :
     IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ) (sesqFormOfInner : F' β†’β‚—[ℝ] F' β†’β‚—[ℝ] ℝ) A
       A.adjoint :=
   fun x y => by simp only [sesqFormOfInner_apply_apply, adjoint_inner_left]
-#align linear_map.is_adjoint_pair_inner LinearMap.isAdjointPairInner
+#align linear_map.is_adjoint_pair_inner LinearMap.isAdjointPair_inner
 
 end Real
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
 
 ! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! leanprover-community/mathlib commit 3fc0b254310908f70a1a75f01147d52e53e9f8a2
+! leanprover-community/mathlib commit 9f0d61b4475e3c3cba6636ab51cdb1f3949d2e1d
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -530,15 +530,14 @@ open ComplexConjugate
 
 /-- The adjoint of the linear map associated to a matrix is the linear map associated to the
 conjugate transpose of that matrix. -/
-theorem conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
-    toLin' A.conjTranspose =
-      @LinearMap.adjoint _ (EuclideanSpace π•œ n) (EuclideanSpace π•œ m) _ _ _ _ _ (toLin' A) :=
+theorem toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
+    A.conjTranspose.toEuclideanLin = A.toEuclideanLin.adjoint :=
   by
-  rw [@LinearMap.eq_adjoint_iff _ (EuclideanSpace π•œ m) (EuclideanSpace π•œ n)]
+  rw [LinearMap.eq_adjoint_iff]
   intro x y
-  convert dot_product_assoc (conj ∘ (id x : m β†’ π•œ)) y A using 1
-  simp [dot_product, mul_vec, RingHom.map_sum, ← starRingEnd_apply, mul_comm]
-#align matrix.conj_transpose_eq_adjoint Matrix.conjTranspose_eq_adjoint
+  simp_rw [EuclideanSpace.inner_eq_star_dotProduct, pi_Lp_equiv_to_euclidean_lin, to_lin'_apply,
+    star_mul_vec, conj_transpose_conj_transpose, dot_product_mul_vec]
+#align matrix.to_euclidean_lin_conj_transpose_eq_adjoint Matrix.toEuclideanLin_conjTranspose_eq_adjoint
 
 end Matrix
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
 
 ! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! leanprover-community/mathlib commit 17ef379e997badd73e5eabb4d38f11919ab3c4b3
+! leanprover-community/mathlib commit 3fc0b254310908f70a1a75f01147d52e53e9f8a2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -86,7 +86,7 @@ theorem adjointAux_inner_left (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺadjointA
 #align continuous_linear_map.adjoint_aux_inner_left ContinuousLinearMap.adjointAux_inner_left
 
 theorem adjointAux_inner_right (A : E β†’L[π•œ] F) (x : E) (y : F) : βŸͺx, adjointAux A y⟫ = βŸͺA x, y⟫ :=
-  by rw [← inner_conj_sym, adjoint_aux_inner_left, inner_conj_sym]
+  by rw [← inner_conj_symm, adjoint_aux_inner_left, inner_conj_symm]
 #align continuous_linear_map.adjoint_aux_inner_right ContinuousLinearMap.adjointAux_inner_right
 
 variable [CompleteSpace F]
Diff
@@ -324,7 +324,7 @@ theorem LinearMap.IsSymmetric.isSelfAdjoint {A : E β†’L[π•œ] E} (hA : (A : E 
 /-- The orthogonal projection is self-adjoint. -/
 theorem orthogonalProjection_isSelfAdjoint (U : Submodule π•œ E) [CompleteSpace U] :
     IsSelfAdjoint (U.subtypeL ∘L orthogonalProjection U) :=
-  (orthogonalProjectionIsSymmetric U).IsSelfAdjoint
+  (orthogonalProjection_isSymmetric U).IsSelfAdjoint
 #align orthogonal_projection_is_self_adjoint orthogonalProjection_isSelfAdjoint
 
 theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U : Submodule π•œ E)
@@ -500,9 +500,9 @@ theorem isAdjointPairInner (A : E' β†’β‚—[ℝ] F') :
 end Real
 
 /-- The Gram operator T†T is symmetric. -/
-theorem isSymmetricAdjointMulSelf (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
+theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (T.adjoint * T) := fun x y => by
   simp only [mul_apply, adjoint_inner_left, adjoint_inner_right]
-#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetricAdjointMulSelf
+#align linear_map.is_symmetric_adjoint_mul_self LinearMap.isSymmetric_adjoint_mul_self
 
 /-- The Gram operator T†T is a positive operator. -/
 theorem re_inner_adjoint_mul_self_nonneg (T : E β†’β‚—[π•œ] E) (x : E) : 0 ≀ re βŸͺx, (T.adjoint * T) x⟫ :=
Diff
@@ -252,7 +252,7 @@ instance : CstarRing (E β†’L[π•œ] E) :=
           
       calc
         β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
-        _ ≀ Real.sqrt (β€–A† * Aβ€– * β€–xβ€– * β€–xβ€–) := Real.sqrt_le_sqrt this
+        _ ≀ Real.sqrt (β€–A† * Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
         _ = Real.sqrt β€–A† * Aβ€– * β€–xβ€– := by
           rw [mul_assoc, Real.sqrt_mul (norm_nonneg _), Real.sqrt_mul_self (norm_nonneg _)]
         ⟩

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -234,7 +234,7 @@ theorem norm_adjoint_comp_self (A : E β†’L[π•œ] F) :
         _ ≀ β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_opNorm _ _) (norm_nonneg _)
     calc
       β€–A xβ€– = √(re βŸͺ(A† ∘L A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
-      _ ≀ √(β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
+      _ ≀ √(β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := Real.sqrt_le_sqrt this
       _ = βˆšβ€–A† ∘L Aβ€– * β€–xβ€– := by
         simp_rw [mul_assoc, Real.sqrt_mul (norm_nonneg _) (β€–xβ€– * β€–xβ€–),
           Real.sqrt_mul_self (norm_nonneg x)]
feat: add notation for Real.sqrt (#12056)

This adds the notation √r for Real.sqrt r. The precedence is such that √x⁻¹ is parsed as √(x⁻¹); not because this is particularly desirable, but because it's the default and the choice doesn't really matter.

This is extracted from #7907, which adds a more general nth root typeclass. The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot. This PR also won't rot as quickly, as it does not forbid writing x.sqrt as that PR does.

While perhaps claiming √ for Real.sqrt is greedy; it:

  • Is far more common thatn NNReal.sqrt and Nat.sqrt
  • Is far more interesting to mathlib than sqrt on Float
  • Can be overloaded anyway, so this does not prevent downstream code using the notation on their own types.
  • Will be replaced by a more general typeclass in a future PR.

Zulip

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -148,7 +148,7 @@ theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] F) (x : E) :
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
 
 theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] F) (x : E) :
-    β€–A xβ€– = Real.sqrt (re βŸͺ(A† ∘L A) x, x⟫) := by
+    β€–A xβ€– = √(re βŸͺ(A† ∘L A) x, x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_left, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_left ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_left
 
@@ -159,7 +159,7 @@ theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] F) (x : E) :
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_right ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right
 
 theorem apply_norm_eq_sqrt_inner_adjoint_right (A : E β†’L[π•œ] F) (x : E) :
-    β€–A xβ€– = Real.sqrt (re βŸͺx, (A† ∘L A) x⟫) := by
+    β€–A xβ€– = √(re βŸͺx, (A† ∘L A) x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_right, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_right ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_right
 
@@ -233,9 +233,9 @@ theorem norm_adjoint_comp_self (A : E β†’L[π•œ] F) :
         re βŸͺ(A† ∘L A) x, x⟫ ≀ β€–(A† ∘L A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
         _ ≀ β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_opNorm _ _) (norm_nonneg _)
     calc
-      β€–A xβ€– = Real.sqrt (re βŸͺ(A† ∘L A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
-      _ ≀ Real.sqrt (β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
-      _ = Real.sqrt β€–A† ∘L Aβ€– * β€–xβ€– := by
+      β€–A xβ€– = √(re βŸͺ(A† ∘L A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
+      _ ≀ √(β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
+      _ = βˆšβ€–A† ∘L Aβ€– * β€–xβ€– := by
         simp_rw [mul_assoc, Real.sqrt_mul (norm_nonneg _) (β€–xβ€– * β€–xβ€–),
           Real.sqrt_mul_self (norm_nonneg x)]
 
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
@@ -42,11 +42,11 @@ adjoint
 
 noncomputable section
 
-open IsROrC
+open RCLike
 
 open scoped ComplexConjugate
 
-variable {π•œ E F G : Type*} [IsROrC π•œ]
+variable {π•œ E F G : Type*} [RCLike π•œ]
 variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
 variable [InnerProductSpace π•œ E] [InnerProductSpace π•œ F] [InnerProductSpace π•œ G]
 
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -47,9 +47,7 @@ open IsROrC
 open scoped ComplexConjugate
 
 variable {π•œ E F G : Type*} [IsROrC π•œ]
-
 variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
-
 variable [InnerProductSpace π•œ E] [InnerProductSpace π•œ F] [InnerProductSpace π•œ G]
 
 local notation "βŸͺ" x ", " y "⟫" => @inner π•œ _ _ x y
@@ -319,7 +317,6 @@ end IsSelfAdjoint
 namespace LinearMap
 
 variable [CompleteSpace E]
-
 variable {T : E β†’β‚—[π•œ] E}
 
 /-- The **Hellinger--Toeplitz theorem**: Construct a self-adjoint operator from an everywhere
perf(InnerProduct.Adjoint): speed up elaboration in two proofs (#11300)

For as yet un-completely diagnosed reasons, unitary.star_mul_self_of_mem hu for (hu : u ∈ unitary (H β†’L[π•œ] H)) elaborates slowly thanks to [1.068378s] βœ… ContinuousLinearMap.comp (ContinuousLinearMap.adjoint u) u =?= star ?a * ?b. This PR pulls out the statements into have's which speeds up the proofs significantly. #11299 documents the issue for future investigation.

Diff
@@ -545,11 +545,15 @@ lemma _root_.LinearIsometryEquiv.star_eq_symm (e : H ≃ₗᡒ[π•œ] H) :
 
 theorem norm_map_of_mem_unitary {u : H β†’L[π•œ] H} (hu : u ∈ unitary (H β†’L[π•œ] H)) (x : H) :
     β€–u xβ€– = β€–xβ€– :=
-  u.norm_map_iff_adjoint_comp_self.mpr (unitary.star_mul_self_of_mem hu) x
+  -- Elaborates faster with this broken out #11299
+  have := unitary.star_mul_self_of_mem hu
+  u.norm_map_iff_adjoint_comp_self.mpr this x
 
 theorem inner_map_map_of_mem_unitary {u : H β†’L[π•œ] H} (hu : u ∈ unitary (H β†’L[π•œ] H)) (x y : H) :
     βŸͺu x, u y⟫_π•œ = βŸͺx, y⟫_π•œ :=
-  u.inner_map_map_iff_adjoint_comp_self.mpr (unitary.star_mul_self_of_mem hu) x y
+  -- Elaborates faster with this broken out #11299
+  have := unitary.star_mul_self_of_mem hu
+  u.inner_map_map_iff_adjoint_comp_self.mpr this x y
 
 end ContinuousLinearMap
 
feat: unitary operators on a Hilbert space coincide with linear isometric equivalences (#10858)

This constructs a group isomorphism unitary (H β†’L[π•œ] H) ≃⋆ (H ≃ₗᡒ[π•œ] H) where H is a Hilbert space. In addition, several lemmas are provided for convenience concerning unitary operators.

Diff
@@ -506,6 +506,99 @@ theorem im_inner_adjoint_mul_self_eq_zero (T : E β†’β‚—[π•œ] E) (x : E) :
 
 end LinearMap
 
+section Unitary
+
+variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace π•œ H] [CompleteSpace H]
+
+namespace ContinuousLinearMap
+
+variable {K : Type*} [NormedAddCommGroup K] [InnerProductSpace π•œ K] [CompleteSpace K]
+
+theorem inner_map_map_iff_adjoint_comp_self (u : H β†’L[π•œ] K) :
+    (βˆ€ x y : H, βŸͺu x, u y⟫_π•œ = βŸͺx, y⟫_π•œ) ↔ adjoint u ∘L u = 1 := by
+  refine ⟨fun h ↦ ext fun x ↦ ?_, fun h ↦ ?_⟩
+  Β· refine ext_inner_right π•œ fun y ↦ ?_
+    simpa [star_eq_adjoint, adjoint_inner_left] using h x y
+  Β· simp [← adjoint_inner_left, ← comp_apply, h]
+
+theorem norm_map_iff_adjoint_comp_self (u : H β†’L[π•œ] K) :
+    (βˆ€ x : H, β€–u xβ€– = β€–xβ€–) ↔ adjoint u ∘L u = 1 := by
+  rw [LinearMap.norm_map_iff_inner_map_map u, u.inner_map_map_iff_adjoint_comp_self]
+
+@[simp]
+lemma _root_.LinearIsometryEquiv.adjoint_eq_symm (e : H ≃ₗᡒ[π•œ] K) :
+    adjoint (e : H β†’L[π•œ] K) = e.symm :=
+  let e' := (e : H β†’L[π•œ] K)
+  calc
+    adjoint e' = adjoint e' ∘L (e' ∘L e.symm) := by
+      convert (adjoint e').comp_id.symm
+      ext
+      simp [e']
+    _ = e.symm := by
+      rw [← comp_assoc, norm_map_iff_adjoint_comp_self e' |>.mp e.norm_map]
+      exact (e.symm : K β†’L[π•œ] H).id_comp
+
+@[simp]
+lemma _root_.LinearIsometryEquiv.star_eq_symm (e : H ≃ₗᡒ[π•œ] H) :
+    star (e : H β†’L[π•œ] H) = e.symm :=
+  e.adjoint_eq_symm
+
+theorem norm_map_of_mem_unitary {u : H β†’L[π•œ] H} (hu : u ∈ unitary (H β†’L[π•œ] H)) (x : H) :
+    β€–u xβ€– = β€–xβ€– :=
+  u.norm_map_iff_adjoint_comp_self.mpr (unitary.star_mul_self_of_mem hu) x
+
+theorem inner_map_map_of_mem_unitary {u : H β†’L[π•œ] H} (hu : u ∈ unitary (H β†’L[π•œ] H)) (x y : H) :
+    βŸͺu x, u y⟫_π•œ = βŸͺx, y⟫_π•œ :=
+  u.inner_map_map_iff_adjoint_comp_self.mpr (unitary.star_mul_self_of_mem hu) x y
+
+end ContinuousLinearMap
+
+namespace unitary
+
+theorem norm_map (u : unitary (H β†’L[π•œ] H)) (x : H) : β€–(u : H β†’L[π•œ] H) xβ€– = β€–xβ€– :=
+  u.val.norm_map_of_mem_unitary u.property x
+
+theorem inner_map_map (u : unitary (H β†’L[π•œ] H)) (x y : H) :
+    βŸͺ(u : H β†’L[π•œ] H) x, (u : H β†’L[π•œ] H) y⟫_π•œ = βŸͺx, y⟫_π•œ :=
+  u.val.inner_map_map_of_mem_unitary u.property x y
+
+/-- The unitary elements of continuous linear maps on a Hilbert space coincide with the linear
+isometric equivalences on that Hilbert space. -/
+noncomputable def linearIsometryEquiv : unitary (H β†’L[π•œ] H) ≃* (H ≃ₗᡒ[π•œ] H) where
+  toFun u :=
+    { (u : H β†’L[π•œ] H) with
+      norm_map' := norm_map u
+      invFun := ↑(star u)
+      left_inv := fun x ↦ congr($(star_mul_self u).val x)
+      right_inv := fun x ↦ congr($(mul_star_self u).val x) }
+  invFun e :=
+    { val := e
+      property := by
+        let e' : (H β†’L[π•œ] H)Λ£ :=
+          { val := (e : H β†’L[π•œ] H)
+            inv := (e.symm : H β†’L[π•œ] H)
+            val_inv := by ext; simp
+            inv_val := by ext; simp }
+        exact IsUnit.mem_unitary_of_star_mul_self ⟨e', rfl⟩ <|
+          (e : H β†’L[π•œ] H).norm_map_iff_adjoint_comp_self.mp e.norm_map }
+  left_inv u := Subtype.ext rfl
+  right_inv e := LinearIsometryEquiv.ext fun x ↦ rfl
+  map_mul' u v := by ext; rfl
+
+@[simp]
+lemma linearIsometryEquiv_coe_apply (u : unitary (H β†’L[π•œ] H)) :
+    linearIsometryEquiv u = (u : H β†’L[π•œ] H) :=
+  rfl
+
+@[simp]
+lemma linearIsometryEquiv_coe_symm_apply (e : H ≃ₗᡒ[π•œ] H) :
+    linearIsometryEquiv.symm e = (e : H β†’L[π•œ] H) :=
+  rfl
+
+end unitary
+
+end Unitary
+
 section Matrix
 
 open Matrix LinearMap
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -311,7 +311,7 @@ theorem conj_orthogonalProjection {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (U
       (U.subtypeL ∘L orthogonalProjection U ∘L T ∘L U.subtypeL ∘L orthogonalProjection U) := by
   rw [← ContinuousLinearMap.comp_assoc]
   nth_rw 1 [← (orthogonalProjection_isSelfAdjoint U).adjoint_eq]
-  refine' hT.adjoint_conj _
+  exact hT.adjoint_conj _
 #align is_self_adjoint.conj_orthogonal_projection IsSelfAdjoint.conj_orthogonalProjection
 
 end IsSelfAdjoint
@@ -443,7 +443,7 @@ theorem eq_adjoint_iff_basis_right {ΞΉ : Type*} (b : Basis ΞΉ π•œ F) (A : E β†’
     A = LinearMap.adjoint B ↔ βˆ€ i x, βŸͺA x, b i⟫ = βŸͺx, B (b i)⟫ := by
   refine' ⟨fun h x y => by rw [h, adjoint_inner_left], fun h => _⟩
   ext x
-  refine' ext_inner_right_basis b fun i => by simp only [h i, adjoint_inner_left]
+  exact ext_inner_right_basis b fun i => by simp only [h i, adjoint_inner_left]
 #align linear_map.eq_adjoint_iff_basis_right LinearMap.eq_adjoint_iff_basis_right
 
 /-- `E β†’β‚—[π•œ] E` is a star algebra with the adjoint as the star operation. -/
chore: rename op_norm to opNorm (#10185)

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

Diff
@@ -100,11 +100,11 @@ theorem adjointAux_adjointAux (A : E β†’L[π•œ] F) : adjointAux (adjointAux A) =
 @[simp]
 theorem adjointAux_norm (A : E β†’L[π•œ] F) : β€–adjointAux Aβ€– = β€–Aβ€– := by
   refine' le_antisymm _ _
-  Β· refine' ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg _) fun x => _
+  Β· refine' ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => _
     rw [adjointAux_apply, LinearIsometryEquiv.norm_map]
     exact toSesqForm_apply_norm_le
   Β· nth_rw 1 [← adjointAux_adjointAux A]
-    refine' ContinuousLinearMap.op_norm_le_bound _ (norm_nonneg _) fun x => _
+    refine' ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) fun x => _
     rw [adjointAux_apply, LinearIsometryEquiv.norm_map]
     exact toSesqForm_apply_norm_le
 #align continuous_linear_map.adjoint_aux_norm ContinuousLinearMap.adjointAux_norm
@@ -226,14 +226,14 @@ theorem norm_adjoint_comp_self (A : E β†’L[π•œ] F) :
     β€–ContinuousLinearMap.adjoint A ∘L Aβ€– = β€–Aβ€– * β€–Aβ€– := by
   refine' le_antisymm _ _
   Β· calc
-      β€–A† ∘L Aβ€– ≀ β€–A†‖ * β€–Aβ€– := op_norm_comp_le _ _
+      β€–A† ∘L Aβ€– ≀ β€–A†‖ * β€–Aβ€– := opNorm_comp_le _ _
       _ = β€–Aβ€– * β€–Aβ€– := by rw [LinearIsometryEquiv.norm_map]
   Β· rw [← sq, ← Real.sqrt_le_sqrt_iff (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)]
-    refine' op_norm_le_bound _ (Real.sqrt_nonneg _) fun x => _
+    refine' opNorm_le_bound _ (Real.sqrt_nonneg _) fun x => _
     have :=
       calc
         re βŸͺ(A† ∘L A) x, x⟫ ≀ β€–(A† ∘L A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
-        _ ≀ β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_op_norm _ _) (norm_nonneg _)
+        _ ≀ β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_opNorm _ _) (norm_nonneg _)
     calc
       β€–A xβ€– = Real.sqrt (re βŸͺ(A† ∘L A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
       _ ≀ Real.sqrt (β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
fix: Clm -> CLM, Cle -> CLE (#10018)

Rename

  • Complex.equivRealProdClm β†’ Complex.equivRealProdCLM;
    • TODO: should this one use CLE?
  • Complex.reClm β†’ Complex.reCLM;
  • Complex.imClm β†’ Complex.imCLM;
  • Complex.conjLie β†’ Complex.conjLIE;
  • Complex.conjCle β†’ Complex.conjCLE;
  • Complex.ofRealLi β†’ Complex.ofRealLI;
  • Complex.ofRealClm β†’ Complex.ofRealCLM;
  • fderivInnerClm β†’ fderivInnerCLM;
  • LinearPMap.adjointDomainMkClm β†’ LinearPMap.adjointDomainMkCLM;
  • LinearPMap.adjointDomainMkClmExtend β†’ LinearPMap.adjointDomainMkCLMExtend;
  • IsROrC.reClm β†’ IsROrC.reCLM;
  • IsROrC.imClm β†’ IsROrC.imCLM;
  • IsROrC.conjLie β†’ IsROrC.conjLIE;
  • IsROrC.conjCle β†’ IsROrC.conjCLE;
  • IsROrC.ofRealLi β†’ IsROrC.ofRealLI;
  • IsROrC.ofRealClm β†’ IsROrC.ofRealCLM;
  • MeasureTheory.condexpL1Clm β†’ MeasureTheory.condexpL1CLM;
  • algebraMapClm β†’ algebraMapCLM;
  • WeakDual.CharacterSpace.toClm β†’ WeakDual.CharacterSpace.toCLM;
  • BoundedContinuousFunction.evalClm β†’ BoundedContinuousFunction.evalCLM;
  • ContinuousMap.evalClm β†’ ContinuousMap.evalCLM;
  • TrivSqZeroExt.fstClm β†’ TrivSqZeroExt.fstClm;
  • TrivSqZeroExt.sndClm β†’ TrivSqZeroExt.sndCLM;
  • TrivSqZeroExt.inlClm β†’ TrivSqZeroExt.inlCLM;
  • TrivSqZeroExt.inrClm β†’ TrivSqZeroExt.inrCLM

and related theorems.

Diff
@@ -373,18 +373,18 @@ theorem adjoint_toContinuousLinearMap (A : E β†’β‚—[π•œ] F) :
   rfl
 #align linear_map.adjoint_to_continuous_linear_map LinearMap.adjoint_toContinuousLinearMap
 
-theorem adjoint_eq_toClm_adjoint (A : E β†’β‚—[π•œ] F) :
+theorem adjoint_eq_toCLM_adjoint (A : E β†’β‚—[π•œ] F) :
     haveI := FiniteDimensional.complete π•œ E
     haveI := FiniteDimensional.complete π•œ F
     LinearMap.adjoint A = ContinuousLinearMap.adjoint (LinearMap.toContinuousLinearMap A) :=
   rfl
-#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toClm_adjoint
+#align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toCLM_adjoint
 
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_left (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺadjoint A y, x⟫ = βŸͺy, A x⟫ := by
   haveI := FiniteDimensional.complete π•œ E
   haveI := FiniteDimensional.complete π•œ F
-  rw [← coe_toContinuousLinearMap A, adjoint_eq_toClm_adjoint]
+  rw [← coe_toContinuousLinearMap A, adjoint_eq_toCLM_adjoint]
   exact ContinuousLinearMap.adjoint_inner_left _ x y
 #align linear_map.adjoint_inner_left LinearMap.adjoint_inner_left
 
@@ -392,7 +392,7 @@ theorem adjoint_inner_left (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺadjoint A
 theorem adjoint_inner_right (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺx, adjoint A y⟫ = βŸͺA x, y⟫ := by
   haveI := FiniteDimensional.complete π•œ E
   haveI := FiniteDimensional.complete π•œ F
-  rw [← coe_toContinuousLinearMap A, adjoint_eq_toClm_adjoint]
+  rw [← coe_toContinuousLinearMap A, adjoint_eq_toCLM_adjoint]
   exact ContinuousLinearMap.adjoint_inner_right _ x y
 #align linear_map.adjoint_inner_right LinearMap.adjoint_inner_right
 
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
@@ -514,7 +514,7 @@ variable {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
 variable [FiniteDimensional π•œ E] [FiniteDimensional π•œ F]
 variable (v₁ : OrthonormalBasis n π•œ E) (vβ‚‚ : OrthonormalBasis m π•œ F)
 
-/- the linear map associated to the conjugate transpose of a matrix corresponding to two
+/-- The linear map associated to the conjugate transpose of a matrix corresponding to two
 orthonormal bases is the adjoint of the linear map associated to the matrix. -/
 lemma Matrix.toLin_conjTranspose (A : Matrix m n π•œ) :
     toLin vβ‚‚.toBasis v₁.toBasis Aα΄΄ = adjoint (toLin v₁.toBasis vβ‚‚.toBasis A) := by
feat(Analysis/InnerProductSpace/Adjoint): add norm_adjoint_comp_self (#9569)

This is a non-square version of norm_star_mul_self

Diff
@@ -143,25 +143,25 @@ theorem adjoint_comp (A : F β†’L[π•œ] G) (B : E β†’L[π•œ] F) : (A ∘L B)† =
   simp only [adjoint_inner_right, ContinuousLinearMap.coe_comp', Function.comp_apply]
 #align continuous_linear_map.adjoint_comp ContinuousLinearMap.adjoint_comp
 
-theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
-    β€–A xβ€– ^ 2 = re βŸͺ(A† * A) x, x⟫ := by
-  have h : βŸͺ(A† * A) x, x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_left]; rfl
+theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] F) (x : E) :
+    β€–A xβ€– ^ 2 = re βŸͺ(A† ∘L A) x, x⟫ := by
+  have h : βŸͺ(A† ∘L A) x, x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_left]; rfl
   rw [h, ← inner_self_eq_norm_sq (π•œ := π•œ) _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
 
-theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
-    β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by
+theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] F) (x : E) :
+    β€–A xβ€– = Real.sqrt (re βŸͺ(A† ∘L A) x, x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_left, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_left ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_left
 
-theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
-    β€–A xβ€– ^ 2 = re βŸͺx, (A† * A) x⟫ := by
-  have h : βŸͺx, (A† * A) x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_right]; rfl
+theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] F) (x : E) :
+    β€–A xβ€– ^ 2 = re βŸͺx, (A† ∘L A) x⟫ := by
+  have h : βŸͺx, (A† ∘L A) x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_right]; rfl
   rw [h, ← inner_self_eq_norm_sq (π•œ := π•œ) _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_right ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right
 
-theorem apply_norm_eq_sqrt_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
-    β€–A xβ€– = Real.sqrt (re βŸͺx, (A† * A) x⟫) := by
+theorem apply_norm_eq_sqrt_inner_adjoint_right (A : E β†’L[π•œ] F) (x : E) :
+    β€–A xβ€– = Real.sqrt (re βŸͺx, (A† ∘L A) x⟫) := by
   rw [← apply_norm_sq_eq_inner_adjoint_right, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_right ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_right
 
@@ -222,26 +222,27 @@ theorem isSelfAdjoint_iff' {A : E β†’L[π•œ] E} : IsSelfAdjoint A ↔ Continuous
   Iff.rfl
 #align continuous_linear_map.is_self_adjoint_iff' ContinuousLinearMap.isSelfAdjoint_iff'
 
-instance : CstarRing (E β†’L[π•œ] E) :=
-  ⟨by
-    intro A
-    rw [star_eq_adjoint]
-    refine' le_antisymm _ _
-    Β· calc
-        β€–A† * Aβ€– ≀ β€–A†‖ * β€–Aβ€– := op_norm_comp_le _ _
-        _ = β€–Aβ€– * β€–Aβ€– := by rw [LinearIsometryEquiv.norm_map]
-    Β· rw [← sq, ← Real.sqrt_le_sqrt_iff (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)]
-      refine' op_norm_le_bound _ (Real.sqrt_nonneg _) fun x => _
-      have :=
-        calc
-          re βŸͺ(A† * A) x, x⟫ ≀ β€–(A† * A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
-          _ ≀ β€–A† * Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_op_norm _ _) (norm_nonneg _)
+theorem norm_adjoint_comp_self (A : E β†’L[π•œ] F) :
+    β€–ContinuousLinearMap.adjoint A ∘L Aβ€– = β€–Aβ€– * β€–Aβ€– := by
+  refine' le_antisymm _ _
+  Β· calc
+      β€–A† ∘L Aβ€– ≀ β€–A†‖ * β€–Aβ€– := op_norm_comp_le _ _
+      _ = β€–Aβ€– * β€–Aβ€– := by rw [LinearIsometryEquiv.norm_map]
+  Β· rw [← sq, ← Real.sqrt_le_sqrt_iff (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)]
+    refine' op_norm_le_bound _ (Real.sqrt_nonneg _) fun x => _
+    have :=
       calc
-        β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
-        _ ≀ Real.sqrt (β€–A† * Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
-        _ = Real.sqrt β€–A† * Aβ€– * β€–xβ€– := by
-          simp_rw [mul_assoc, Real.sqrt_mul (norm_nonneg _) (β€–xβ€– * β€–xβ€–),
-            Real.sqrt_mul_self (norm_nonneg x)] ⟩
+        re βŸͺ(A† ∘L A) x, x⟫ ≀ β€–(A† ∘L A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
+        _ ≀ β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_op_norm _ _) (norm_nonneg _)
+    calc
+      β€–A xβ€– = Real.sqrt (re βŸͺ(A† ∘L A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
+      _ ≀ Real.sqrt (β€–A† ∘L Aβ€– * β€–xβ€– * β€–xβ€–) := (Real.sqrt_le_sqrt this)
+      _ = Real.sqrt β€–A† ∘L Aβ€– * β€–xβ€– := by
+        simp_rw [mul_assoc, Real.sqrt_mul (norm_nonneg _) (β€–xβ€– * β€–xβ€–),
+          Real.sqrt_mul_self (norm_nonneg x)]
+
+instance : CstarRing (E β†’L[π•œ] E) where
+  norm_star_mul_self := norm_adjoint_comp_self _
 
 theorem isAdjointPair_inner (A : E β†’L[π•œ] F) :
     LinearMap.IsAdjointPair (sesqFormOfInner : E β†’β‚—[π•œ] E →ₗ⋆[π•œ] π•œ)
feat: relate Matrix.conjTranspose to LinearMap.adjoint (#9471)
Diff
@@ -505,20 +505,44 @@ theorem im_inner_adjoint_mul_self_eq_zero (T : E β†’β‚—[π•œ] E) (x : E) :
 
 end LinearMap
 
-namespace Matrix
+section Matrix
+
+open Matrix LinearMap
 
 variable {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
+variable [FiniteDimensional π•œ E] [FiniteDimensional π•œ F]
+variable (v₁ : OrthonormalBasis n π•œ E) (vβ‚‚ : OrthonormalBasis m π•œ F)
+
+/- the linear map associated to the conjugate transpose of a matrix corresponding to two
+orthonormal bases is the adjoint of the linear map associated to the matrix. -/
+lemma Matrix.toLin_conjTranspose (A : Matrix m n π•œ) :
+    toLin vβ‚‚.toBasis v₁.toBasis Aα΄΄ = adjoint (toLin v₁.toBasis vβ‚‚.toBasis A) := by
+  refine eq_adjoint_iff_basis vβ‚‚.toBasis v₁.toBasis _ _ |>.mpr fun i j ↦ ?_
+  simp_rw [toLin_self]
+  simp [sum_inner, inner_smul_left, inner_sum, inner_smul_right,
+    orthonormal_iff_ite.mp v₁.orthonormal, orthonormal_iff_ite.mp vβ‚‚.orthonormal]
+
+/-- The matrix associated to the adjoint of a linear map corresponding to two orthonormal bases
+is the conjugate tranpose of the matrix associated to the linear map. -/
+lemma LinearMap.toMatrix_adjoint (f : E β†’β‚—[π•œ] F) :
+    toMatrix vβ‚‚.toBasis v₁.toBasis (adjoint f) = (toMatrix v₁.toBasis vβ‚‚.toBasis f)α΄΄ :=
+  toLin vβ‚‚.toBasis v₁.toBasis |>.injective <| by simp [toLin_conjTranspose]
+
+/-- The star algebra equivalence between the linear endomorphisms of finite-dimensional inner
+product space and square matrices induced by the choice of an orthonormal basis. -/
+@[simps]
+def LinearMap.toMatrixOrthonormal : (E β†’β‚—[π•œ] E) ≃⋆ₐ[π•œ] Matrix n n π•œ :=
+  { LinearMap.toMatrix v₁.toBasis v₁.toBasis with
+    map_mul' := LinearMap.toMatrix_mul v₁.toBasis
+    map_star' := LinearMap.toMatrix_adjoint v₁ v₁ }
 
 open scoped ComplexConjugate
 
 /-- The adjoint of the linear map associated to a matrix is the linear map associated to the
 conjugate transpose of that matrix. -/
-theorem toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
-    Matrix.toEuclideanLin A.conjTranspose = LinearMap.adjoint (Matrix.toEuclideanLin A) := by
-  rw [LinearMap.eq_adjoint_iff]
-  intro x y
-  simp_rw [EuclideanSpace.inner_eq_star_dotProduct, piLp_equiv_toEuclideanLin, toLin'_apply,
-    star_mulVec, conjTranspose_conjTranspose, dotProduct_mulVec]
+theorem Matrix.toEuclideanLin_conjTranspose_eq_adjoint (A : Matrix m n π•œ) :
+    Matrix.toEuclideanLin A.conjTranspose = LinearMap.adjoint (Matrix.toEuclideanLin A) :=
+  A.toLin_conjTranspose (EuclideanSpace.basisFun n π•œ) (EuclideanSpace.basisFun m π•œ)
 #align matrix.to_euclidean_lin_conj_transpose_eq_adjoint Matrix.toEuclideanLin_conjTranspose_eq_adjoint
 
 end Matrix
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
@@ -40,8 +40,6 @@ adjoint
 
 -/
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 noncomputable section
 
 open IsROrC
chore(Analysis/InnerProductSpace): LinearMap.isAdjointPair_inner generalization to isROrC (#8309)

I forgot in the previous PR (#8295) that there are two versions of the adjoint.

Diff
@@ -477,26 +477,13 @@ theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔
   exact eq_comm
 #align linear_map.is_symmetric_iff_is_self_adjoint LinearMap.isSymmetric_iff_isSelfAdjoint
 
-section Real
-
-variable {E' : Type*} {F' : Type*}
-
-variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
-
-variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
-
-variable [FiniteDimensional ℝ E'] [FiniteDimensional ℝ F']
-
--- Todo: Generalize this to `IsROrC`.
-theorem isAdjointPair_inner (A : E' β†’β‚—[ℝ] F') :
-    IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ) (sesqFormOfInner : F' β†’β‚—[ℝ] F' β†’β‚—[ℝ] ℝ) A
+theorem isAdjointPair_inner (A : E β†’β‚—[π•œ] F) :
+    IsAdjointPair (sesqFormOfInner : E β†’β‚—[π•œ] E →ₗ⋆[π•œ] π•œ) (sesqFormOfInner : F β†’β‚—[π•œ] F →ₗ⋆[π•œ] π•œ) A
       (LinearMap.adjoint A) := by
   intro x y
   simp only [sesqFormOfInner_apply_apply, adjoint_inner_left]
 #align linear_map.is_adjoint_pair_inner LinearMap.isAdjointPair_inner
 
-end Real
-
 /-- The Gram operator T†T is symmetric. -/
 theorem isSymmetric_adjoint_mul_self (T : E β†’β‚—[π•œ] E) : IsSymmetric (LinearMap.adjoint T * T) := by
   intro x y
chore(InnerProductSpace/Adjoint): isAdjointPair_inner for IsROrC (#8295)
Diff
@@ -245,26 +245,13 @@ instance : CstarRing (E β†’L[π•œ] E) :=
           simp_rw [mul_assoc, Real.sqrt_mul (norm_nonneg _) (β€–xβ€– * β€–xβ€–),
             Real.sqrt_mul_self (norm_nonneg x)] ⟩
 
-section Real
-
-variable {E' : Type*} {F' : Type*}
-
-variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
-
-variable [InnerProductSpace ℝ E'] [InnerProductSpace ℝ F']
-
-variable [CompleteSpace E'] [CompleteSpace F']
-
--- Todo: Generalize this to `IsROrC`.
-theorem isAdjointPair_inner (A : E' β†’L[ℝ] F') :
-    LinearMap.IsAdjointPair (sesqFormOfInner : E' β†’β‚—[ℝ] E' β†’β‚—[ℝ] ℝ)
-      (sesqFormOfInner : F' β†’β‚—[ℝ] F' β†’β‚—[ℝ] ℝ) A (A†) := by
+theorem isAdjointPair_inner (A : E β†’L[π•œ] F) :
+    LinearMap.IsAdjointPair (sesqFormOfInner : E β†’β‚—[π•œ] E →ₗ⋆[π•œ] π•œ)
+      (sesqFormOfInner : F β†’β‚—[π•œ] F →ₗ⋆[π•œ] π•œ) A (A†) := by
   intro x y
   simp only [sesqFormOfInner_apply_apply, adjoint_inner_left, coe_coe]
 #align continuous_linear_map.is_adjoint_pair_inner ContinuousLinearMap.isAdjointPair_inner
 
-end Real
-
 end ContinuousLinearMap
 
 /-! ### Self-adjoint operators -/
feat (NormedSpace.Dual): make Dual reducible (#6998)

Following LinearAlgebra.Dual this makes NormedSpace.Dual reducible.

Diff
@@ -65,10 +65,12 @@ namespace ContinuousLinearMap
 
 variable [CompleteSpace E] [CompleteSpace G]
 
+-- Note: made noncomputable to stop excess compilation
+-- leanprover-community/mathlib4#7103
 /-- The adjoint, as a continuous conjugate-linear map. This is only meant as an auxiliary
 definition for the main definition `adjoint`, where this is bundled as a conjugate-linear isometric
 equivalence. -/
-def adjointAux : (E β†’L[π•œ] F) β†’L⋆[π•œ] F β†’L[π•œ] E :=
+noncomputable def adjointAux : (E β†’L[π•œ] F) β†’L⋆[π•œ] F β†’L[π•œ] E :=
   (ContinuousLinearMap.compSL _ _ _ _ _ ((toDual π•œ E).symm : NormedSpace.Dual π•œ E β†’L⋆[π•œ] E)).comp
     (toSesqForm : (E β†’L[π•œ] F) β†’L[π•œ] F β†’L⋆[π•œ] NormedSpace.Dual π•œ E)
 #align continuous_linear_map.adjoint_aux ContinuousLinearMap.adjointAux
chore: update/remove heart beat bumps (#6860)

We clean up heart beat bumps after #6474.

Diff
@@ -222,7 +222,6 @@ theorem isSelfAdjoint_iff' {A : E β†’L[π•œ] E} : IsSelfAdjoint A ↔ Continuous
   Iff.rfl
 #align continuous_linear_map.is_self_adjoint_iff' ContinuousLinearMap.isSelfAdjoint_iff'
 
-set_option maxHeartbeats 300000 in -- Porting note: Added to prevent timeout.
 instance : CstarRing (E β†’L[π•œ] E) :=
   ⟨by
     intro A
feat: generalize some lemmas from a normed space to a TVS (#5771)
  • Generalize FiniteDimensional.complete, Submodule.complete_of_finiteDimensional from a normed space over π•œ to a uniform additive commutative group that is a TVS over π•œ.
  • Generalize Submodule.closed_of_finiteDimensional, LinearMap.closedEmbedding_of_injective, closedEmbedding_smul_left isClosedMap_smul_left, and ContinuousLinearMap.exists_right_inverse_of_surjective from a normed space to a TVS.
  • Rename finiteDimensional_of_isCompact_closed_ballβ‚€ to finiteDimensional_of_isCompact_closedBallβ‚€.

Co-authored-by: ADedecker <anatolededecker@gmail.com>

Diff
@@ -356,48 +356,59 @@ namespace LinearMap
 
 variable [FiniteDimensional π•œ E] [FiniteDimensional π•œ F] [FiniteDimensional π•œ G]
 
-section synthOrder
-
-/- porting note: Lean correctly determines that there is no good synthesization order for this
-instance, but in this case it is only a local instance with low priority so we circumvent the
-check. In addition, note that this instance is not actually needed for the *statement* of
-`LinearMap.adjoint`. -/
-set_option synthInstance.checkSynthOrder false
-attribute [local instance 20] FiniteDimensional.complete
+/- Porting note: Lean can't use `FiniteDimensional.complete` since it was generalized to topological
+vector spaces. Use local instances instead. -/
 
 /-- The adjoint of an operator from the finite-dimensional inner product space `E` to the
 finite-dimensional inner product space `F`. -/
 def adjoint : (E β†’β‚—[π•œ] F) ≃ₗ⋆[π•œ] F β†’β‚—[π•œ] E :=
+  have := FiniteDimensional.complete π•œ E
+  have := FiniteDimensional.complete π•œ F
+  /- Note: Instead of the two instances above, the following works:
+    ```
+      have := FiniteDimensional.complete π•œ
+      have := FiniteDimensional.complete π•œ
+    ```
+    But removing one of the `have`s makes it fail. The reason is that `E` and `F` don't live
+    in the same universe, so the first `have` can no longer be used for `F` after its universe
+    metavariable has been assigned to that of `E`!
+  -/
   ((LinearMap.toContinuousLinearMap : (E β†’β‚—[π•œ] F) ≃ₗ[π•œ] E β†’L[π•œ] F).trans
       ContinuousLinearMap.adjoint.toLinearEquiv).trans
     LinearMap.toContinuousLinearMap.symm
 #align linear_map.adjoint LinearMap.adjoint
 
 theorem adjoint_toContinuousLinearMap (A : E β†’β‚—[π•œ] F) :
+    haveI := FiniteDimensional.complete π•œ E
+    haveI := FiniteDimensional.complete π•œ F
     LinearMap.toContinuousLinearMap (LinearMap.adjoint A) =
       ContinuousLinearMap.adjoint (LinearMap.toContinuousLinearMap A) :=
   rfl
 #align linear_map.adjoint_to_continuous_linear_map LinearMap.adjoint_toContinuousLinearMap
 
 theorem adjoint_eq_toClm_adjoint (A : E β†’β‚—[π•œ] F) :
+    haveI := FiniteDimensional.complete π•œ E
+    haveI := FiniteDimensional.complete π•œ F
     LinearMap.adjoint A = ContinuousLinearMap.adjoint (LinearMap.toContinuousLinearMap A) :=
   rfl
 #align linear_map.adjoint_eq_to_clm_adjoint LinearMap.adjoint_eq_toClm_adjoint
 
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_left (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺadjoint A y, x⟫ = βŸͺy, A x⟫ := by
+  haveI := FiniteDimensional.complete π•œ E
+  haveI := FiniteDimensional.complete π•œ F
   rw [← coe_toContinuousLinearMap A, adjoint_eq_toClm_adjoint]
   exact ContinuousLinearMap.adjoint_inner_left _ x y
 #align linear_map.adjoint_inner_left LinearMap.adjoint_inner_left
 
 /-- The fundamental property of the adjoint. -/
 theorem adjoint_inner_right (A : E β†’β‚—[π•œ] F) (x : E) (y : F) : βŸͺx, adjoint A y⟫ = βŸͺA x, y⟫ := by
+  haveI := FiniteDimensional.complete π•œ E
+  haveI := FiniteDimensional.complete π•œ F
   rw [← coe_toContinuousLinearMap A, adjoint_eq_toClm_adjoint]
   exact ContinuousLinearMap.adjoint_inner_right _ x y
 #align linear_map.adjoint_inner_right LinearMap.adjoint_inner_right
 
-end synthOrder
-
 /-- The adjoint is involutive. -/
 @[simp]
 theorem adjoint_adjoint (A : E β†’β‚—[π•œ] F) : LinearMap.adjoint (LinearMap.adjoint A) = A := by
refactor(Algebra/Star/*): Allow for star operation on non-associative algebras (#6562)

Typically a * operation on a mathematical structure R equipped with a multiplication is an involutive anti-automorphism i.e.

βˆ€ r s : R, star (r * s) = star s * star r

Currently mathlib defines a class StarSemigroup to be a semigroup satisfying this property. However, the requirement for the multiplication to be associative is unnecessarily restrictive. There are important classes of star-algebra which are not associative (e.g. JB*-algebras).

This PR removes the requirement for a StarSemigroup to be a semigroup, merely requiring it to have a multiplication.

I've changed the name from StarSemigroup to StarMul since it's no longer a semigroup.

Zulip discussion

Previously opened as a mathlib PR https://github.com/leanprover-community/mathlib/pull/17949

Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -204,7 +204,7 @@ instance : Star (E β†’L[π•œ] E) :=
 instance : InvolutiveStar (E β†’L[π•œ] E) :=
   ⟨adjoint_adjoint⟩
 
-instance : StarSemigroup (E β†’L[π•œ] E) :=
+instance : StarMul (E β†’L[π•œ] E) :=
   ⟨adjoint_comp⟩
 
 instance : StarRing (E β†’L[π•œ] E) :=
@@ -455,7 +455,7 @@ instance : Star (E β†’β‚—[π•œ] E) :=
 instance : InvolutiveStar (E β†’β‚—[π•œ] E) :=
   ⟨adjoint_adjoint⟩
 
-instance : StarSemigroup (E β†’β‚—[π•œ] E) :=
+instance : StarMul (E β†’β‚—[π•œ] E) :=
   ⟨adjoint_comp⟩
 
 instance : StarRing (E β†’β‚—[π•œ] E) :=
chore: tidy various files (#6393)
Diff
@@ -40,6 +40,7 @@ adjoint
 
 -/
 
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 noncomputable section
 
@@ -142,9 +143,8 @@ theorem adjoint_comp (A : F β†’L[π•œ] G) (B : E β†’L[π•œ] F) : (A ∘L B)† =
   simp only [adjoint_inner_right, ContinuousLinearMap.coe_comp', Function.comp_apply]
 #align continuous_linear_map.adjoint_comp ContinuousLinearMap.adjoint_comp
 
--- Porting note: Originally `β€–A xβ€– ^ 2`. But this didn't work because the exponent was `2 : ℝ`.
 theorem apply_norm_sq_eq_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
-    HPow.hPow β€–A xβ€– 2 = re βŸͺ(A† * A) x, x⟫ := by
+    β€–A xβ€– ^ 2 = re βŸͺ(A† * A) x, x⟫ := by
   have h : βŸͺ(A† * A) x, x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_left]; rfl
   rw [h, ← inner_self_eq_norm_sq (π•œ := π•œ) _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_left ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_left
@@ -154,9 +154,8 @@ theorem apply_norm_eq_sqrt_inner_adjoint_left (A : E β†’L[π•œ] E) (x : E) :
   rw [← apply_norm_sq_eq_inner_adjoint_left, Real.sqrt_sq (norm_nonneg _)]
 #align continuous_linear_map.apply_norm_eq_sqrt_inner_adjoint_left ContinuousLinearMap.apply_norm_eq_sqrt_inner_adjoint_left
 
--- Porting note: Originally `β€–A xβ€– ^ 2`. But this didn't work because the exponent was `2 : ℝ`.
 theorem apply_norm_sq_eq_inner_adjoint_right (A : E β†’L[π•œ] E) (x : E) :
-    HPow.hPow β€–A xβ€– 2 = re βŸͺx, (A† * A) x⟫ := by
+    β€–A xβ€– ^ 2 = re βŸͺx, (A† * A) x⟫ := by
   have h : βŸͺx, (A† * A) x⟫ = βŸͺA x, A x⟫ := by rw [← adjoint_inner_right]; rfl
   rw [h, ← inner_self_eq_norm_sq (π•œ := π•œ) _]
 #align continuous_linear_map.apply_norm_sq_eq_inner_adjoint_right ContinuousLinearMap.apply_norm_sq_eq_inner_adjoint_right
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
@@ -47,7 +47,7 @@ open IsROrC
 
 open scoped ComplexConjugate
 
-variable {π•œ E F G : Type _} [IsROrC π•œ]
+variable {π•œ E F G : Type*} [IsROrC π•œ]
 
 variable [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G]
 
@@ -247,7 +247,7 @@ instance : CstarRing (E β†’L[π•œ] E) :=
 
 section Real
 
-variable {E' : Type _} {F' : Type _}
+variable {E' : Type*} {F' : Type*}
 
 variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
 
@@ -428,7 +428,7 @@ theorem eq_adjoint_iff (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
 
 /-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `βŸͺA x, y⟫ = βŸͺx, B y⟫`
 for all basis vectors `x` and `y`. -/
-theorem eq_adjoint_iff_basis {ι₁ : Type _} {ΞΉβ‚‚ : Type _} (b₁ : Basis ι₁ π•œ E) (bβ‚‚ : Basis ΞΉβ‚‚ π•œ F)
+theorem eq_adjoint_iff_basis {ι₁ : Type*} {ΞΉβ‚‚ : Type*} (b₁ : Basis ι₁ π•œ E) (bβ‚‚ : Basis ΞΉβ‚‚ π•œ F)
     (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
     A = LinearMap.adjoint B ↔ βˆ€ (i₁ : ι₁) (iβ‚‚ : ΞΉβ‚‚), βŸͺA (b₁ i₁), bβ‚‚ iβ‚‚βŸ« = βŸͺb₁ i₁, B (bβ‚‚ iβ‚‚)⟫ := by
   refine' ⟨fun h x y => by rw [h, adjoint_inner_left], fun h => _⟩
@@ -436,13 +436,13 @@ theorem eq_adjoint_iff_basis {ι₁ : Type _} {ΞΉβ‚‚ : Type _} (b₁ : Basis ΞΉ
   exact ext_inner_right_basis bβ‚‚ fun iβ‚‚ => by simp only [adjoint_inner_left, h i₁ iβ‚‚]
 #align linear_map.eq_adjoint_iff_basis LinearMap.eq_adjoint_iff_basis
 
-theorem eq_adjoint_iff_basis_left {ΞΉ : Type _} (b : Basis ΞΉ π•œ E) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
+theorem eq_adjoint_iff_basis_left {ΞΉ : Type*} (b : Basis ΞΉ π•œ E) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
     A = LinearMap.adjoint B ↔ βˆ€ i y, βŸͺA (b i), y⟫ = βŸͺb i, B y⟫ := by
   refine' ⟨fun h x y => by rw [h, adjoint_inner_left], fun h => Basis.ext b fun i => _⟩
   exact ext_inner_right π•œ fun y => by simp only [h i, adjoint_inner_left]
 #align linear_map.eq_adjoint_iff_basis_left LinearMap.eq_adjoint_iff_basis_left
 
-theorem eq_adjoint_iff_basis_right {ΞΉ : Type _} (b : Basis ΞΉ π•œ F) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
+theorem eq_adjoint_iff_basis_right {ΞΉ : Type*} (b : Basis ΞΉ π•œ F) (A : E β†’β‚—[π•œ] F) (B : F β†’β‚—[π•œ] E) :
     A = LinearMap.adjoint B ↔ βˆ€ i x, βŸͺA x, b i⟫ = βŸͺx, B (b i)⟫ := by
   refine' ⟨fun h x y => by rw [h, adjoint_inner_left], fun h => _⟩
   ext x
@@ -481,7 +481,7 @@ theorem isSymmetric_iff_isSelfAdjoint (A : E β†’β‚—[π•œ] E) : IsSymmetric A ↔
 
 section Real
 
-variable {E' : Type _} {F' : Type _}
+variable {E' : Type*} {F' : Type*}
 
 variable [NormedAddCommGroup E'] [NormedAddCommGroup F']
 
@@ -524,7 +524,7 @@ end LinearMap
 
 namespace Matrix
 
-variable {m n : Type _} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
+variable {m n : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n]
 
 open scoped ComplexConjugate
 
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,15 +2,12 @@
 Copyright (c) 2021 FrΓ©dΓ©ric Dupuis. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: FrΓ©dΓ©ric Dupuis, Heather Macbeth
-
-! This file was ported from Lean 3 source module analysis.inner_product_space.adjoint
-! 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.InnerProductSpace.Dual
 import Mathlib.Analysis.InnerProductSpace.PiL2
 
+#align_import analysis.inner_product_space.adjoint from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
+
 /-!
 # Adjoint of operators on Hilbert spaces
 
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊒ -> some_tactic at h ⊒
  • some_tactic at h -> some_tactic at h
Diff
@@ -292,7 +292,7 @@ theorem isSymmetric {A : E β†’L[π•œ] E} (hA : IsSelfAdjoint A) : (A : E β†’β‚—[
 /-- Conjugating preserves self-adjointness. -/
 theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[π•œ] F) :
     IsSelfAdjoint (S ∘L T ∘L ContinuousLinearMap.adjoint S) := by
-  rw [isSelfAdjoint_iff'] at hT⊒
+  rw [isSelfAdjoint_iff'] at hT ⊒
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.conj_adjoint IsSelfAdjoint.conj_adjoint
@@ -300,7 +300,7 @@ theorem conj_adjoint {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : E β†’L[
 /-- Conjugating preserves self-adjointness. -/
 theorem adjoint_conj {T : E β†’L[π•œ] E} (hT : IsSelfAdjoint T) (S : F β†’L[π•œ] E) :
     IsSelfAdjoint (ContinuousLinearMap.adjoint S ∘L T ∘L S) := by
-  rw [isSelfAdjoint_iff'] at hT⊒
+  rw [isSelfAdjoint_iff'] at hT ⊒
   simp only [hT, adjoint_comp, adjoint_adjoint]
   exact ContinuousLinearMap.comp_assoc _ _ _
 #align is_self_adjoint.adjoint_conj IsSelfAdjoint.adjoint_conj
feat: port MeasureTheory.Function.L2Space (#4737)

Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -239,7 +239,7 @@ instance : CstarRing (E β†’L[π•œ] E) :=
       refine' op_norm_le_bound _ (Real.sqrt_nonneg _) fun x => _
       have :=
         calc
-          re βŸͺ(A† * A) x, x⟫ ≀ β€–(A† * A) xβ€– * β€–xβ€– := re_inner_le_norm π•œ _ _
+          re βŸͺ(A† * A) x, x⟫ ≀ β€–(A† * A) xβ€– * β€–xβ€– := re_inner_le_norm _ _
           _ ≀ β€–A† * Aβ€– * β€–xβ€– * β€–xβ€– := mul_le_mul_of_nonneg_right (le_op_norm _ _) (norm_nonneg _)
       calc
         β€–A xβ€– = Real.sqrt (re βŸͺ(A† * A) x, x⟫) := by rw [apply_norm_eq_sqrt_inner_adjoint_left]
feat: port Analysis.InnerProductSpace.Adjoint (#4476)

Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>

Dependencies 12 + 916

917 files ported (98.7%)
405716 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