linear_algebra.matrix.ldl ⟷ Mathlib.LinearAlgebra.Matrix.LDL

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
@@ -33,7 +33,7 @@ decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a d
 -/
 
 
-variable {π•œ : Type _} [IsROrC π•œ]
+variable {π•œ : Type _} [RCLike π•œ]
 
 variable {n : Type _} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
@@ -123,7 +123,7 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL
   Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne.def, not_false_iff, mul_mul_apply]
     rw [conj_transpose, transpose_map, transpose_transpose, dot_product_mul_vec,
       (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm,
-      mul_vec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← IsROrC.star_def, ←
+      mul_vec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← RCLike.star_def, ←
       star_dot_product_star, dot_product_comm, star_star]
     rfl
 #align LDL.diag_eq_lower_inv_conj LDL.diag_eq_lowerInv_conj
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Alexander Bentkamp. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
 -/
-import Mathbin.Analysis.InnerProductSpace.GramSchmidtOrtho
-import Mathbin.LinearAlgebra.Matrix.PosDef
+import Analysis.InnerProductSpace.GramSchmidtOrtho
+import LinearAlgebra.Matrix.PosDef
 
 #align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Alexander Bentkamp. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
-
-! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.InnerProductSpace.GramSchmidtOrtho
 import Mathbin.LinearAlgebra.Matrix.PosDef
 
+#align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
+
 /-! # LDL decomposition
 
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
Diff
@@ -65,7 +65,7 @@ theorem LDL.lowerInv_eq_gramSchmidtBasis :
           (@gramSchmidtBasis π•œ (n β†’ π•œ) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
             (Pi.basisFun π•œ n)))α΅€ :=
   by
-  ext (i j)
+  ext i j
   rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis]
   rfl
 #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis
@@ -118,7 +118,7 @@ theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j =
 by some lower triangular matrix and get a diagonal matrix. -/
 theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL.lowerInv hS)ᴴ :=
   by
-  ext (i j)
+  ext i j
   by_cases hij : i = j
   Β·
     simpa only [hij, LDL.diag, diagonal_apply_eq, LDL.diagEntries, Matrix.mul_assoc,
Diff
@@ -48,6 +48,7 @@ open scoped Matrix
 
 variable {S : Matrix n n π•œ} [Fintype n] (hS : S.PosDef)
 
+#print LDL.lowerInv /-
 /-- The inverse of the lower triangular matrix `L` of the LDL-decomposition. It is obtained by
 applying Gram-Schmidt-Orthogonalization w.r.t. the inner product induced by `Sα΅€` on the standard
 basis vectors `pi.basis_fun`. -/
@@ -55,7 +56,9 @@ noncomputable def LDL.lowerInv : Matrix n n π•œ :=
   @gramSchmidt π•œ (n β†’ π•œ) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
     (Pi.basisFun π•œ n)
 #align LDL.lower_inv LDL.lowerInv
+-/
 
+#print LDL.lowerInv_eq_gramSchmidtBasis /-
 theorem LDL.lowerInv_eq_gramSchmidtBasis :
     LDL.lowerInv hS =
       ((Pi.basisFun π•œ n).toMatrix
@@ -66,7 +69,9 @@ theorem LDL.lowerInv_eq_gramSchmidtBasis :
   rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis]
   rfl
 #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis
+-/
 
+#print LDL.invertibleLowerInv /-
 noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) :=
   by
   rw [LDL.lowerInv_eq_gramSchmidtBasis]
@@ -76,29 +81,39 @@ noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) :=
         (Pi.basisFun π•œ n))
   infer_instance
 #align LDL.invertible_lower_inv LDL.invertibleLowerInv
+-/
 
+#print LDL.lowerInv_orthogonal /-
 theorem LDL.lowerInv_orthogonal {i j : n} (hβ‚€ : i β‰  j) :
     βŸͺLDL.lowerInv hS i, Sα΅€.mulVec (LDL.lowerInv hS j)βŸ«β‚‘ = 0 :=
   @gramSchmidt_orthogonal π•œ _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ hβ‚€
 #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal
+-/
 
+#print LDL.diagEntries /-
 /-- The entries of the diagonal matrix `D` of the LDL decomposition. -/
 noncomputable def LDL.diagEntries : n β†’ π•œ := fun i =>
   βŸͺstar (LDL.lowerInv hS i), S.mulVec (star (LDL.lowerInv hS i))βŸ«β‚‘
 #align LDL.diag_entries LDL.diagEntries
+-/
 
+#print LDL.diag /-
 /-- The diagonal matrix `D` of the LDL decomposition. -/
 noncomputable def LDL.diag : Matrix n n π•œ :=
   Matrix.diagonal (LDL.diagEntries hS)
 #align LDL.diag LDL.diag
+-/
 
+#print LDL.lowerInv_triangular /-
 theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by
   rw [←
     @gramSchmidt_triangular π•œ (n β†’ π•œ) _ (_ : _) (inner_product_space.of_matrix hS.transpose) n _ _ _
       i j hij (Pi.basisFun π•œ n),
     Pi.basisFun_repr, LDL.lowerInv]
 #align LDL.lower_inv_triangular LDL.lowerInv_triangular
+-/
 
+#print LDL.diag_eq_lowerInv_conj /-
 /-- Inverse statement of **LDL decomposition**: we can conjugate a positive definite matrix
 by some lower triangular matrix and get a diagonal matrix. -/
 theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL.lowerInv hS)ᴴ :=
@@ -115,12 +130,16 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL
       star_dot_product_star, dot_product_comm, star_star]
     rfl
 #align LDL.diag_eq_lower_inv_conj LDL.diag_eq_lowerInv_conj
+-/
 
+#print LDL.lower /-
 /-- The lower triangular matrix `L` of the LDL decomposition. -/
 noncomputable def LDL.lower :=
   (LDL.lowerInv hS)⁻¹
 #align LDL.lower LDL.lower
+-/
 
+#print LDL.lower_conj_diag /-
 /-- **LDL decomposition**: any positive definite matrix `S` can be
 decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a diagonal matrix.  -/
 theorem LDL.lower_conj_diag : LDL.lower hS ⬝ LDL.diag hS ⬝ (LDL.lower hS)ᴴ = S :=
@@ -130,4 +149,5 @@ theorem LDL.lower_conj_diag : LDL.lower hS ⬝ LDL.diag hS ⬝ (LDL.lower hS)ᴴ
     Matrix.mul_inv_eq_iff_eq_mul_of_invertible]
   exact LDL.diag_eq_lowerInv_conj hS
 #align LDL.lower_conj_diag LDL.lower_conj_diag
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
 
 ! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! leanprover-community/mathlib commit 46b633fd842bef9469441c0209906f6dddd2b4f5
+! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.LinearAlgebra.Matrix.PosDef
 
 /-! # LDL decomposition
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file proves the LDL-decomposition of matricies: Any positive definite matrix `S` can be
 decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a diagonal matrix.
 
Diff
@@ -37,7 +37,6 @@ variable {π•œ : Type _} [IsROrC π•œ]
 
 variable {n : Type _} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
--- mathport name: Β«exprβŸͺ , βŸ«β‚‘Β»
 local notation "βŸͺ" x ", " y "βŸ«β‚‘" => @inner π•œ _ _ ((PiLp.equiv 2 _).symm x) ((PiLp.equiv _ _).symm y)
 
 open Matrix
Diff
@@ -42,7 +42,7 @@ local notation "βŸͺ" x ", " y "βŸ«β‚‘" => @inner π•œ _ _ ((PiLp.equiv 2 _).symm
 
 open Matrix
 
-open Matrix
+open scoped Matrix
 
 variable {S : Matrix n n π•œ} [Fintype n] (hS : S.PosDef)
 
Diff
@@ -61,7 +61,7 @@ theorem LDL.lowerInv_eq_gramSchmidtBasis :
             (Pi.basisFun π•œ n)))α΅€ :=
   by
   ext (i j)
-  rw [LDL.lowerInv, Basis.CoePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis]
+  rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis]
   rfl
 #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
 
 ! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! 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.
 -/
@@ -50,13 +50,14 @@ variable {S : Matrix n n π•œ} [Fintype n] (hS : S.PosDef)
 applying Gram-Schmidt-Orthogonalization w.r.t. the inner product induced by `Sα΅€` on the standard
 basis vectors `pi.basis_fun`. -/
 noncomputable def LDL.lowerInv : Matrix n n π•œ :=
-  @gramSchmidt π•œ (n β†’ π•œ) _ (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun π•œ n)
+  @gramSchmidt π•œ (n β†’ π•œ) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
+    (Pi.basisFun π•œ n)
 #align LDL.lower_inv LDL.lowerInv
 
 theorem LDL.lowerInv_eq_gramSchmidtBasis :
     LDL.lowerInv hS =
       ((Pi.basisFun π•œ n).toMatrix
-          (@gramSchmidtBasis π•œ (n β†’ π•œ) _ (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
+          (@gramSchmidtBasis π•œ (n β†’ π•œ) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
             (Pi.basisFun π•œ n)))α΅€ :=
   by
   ext (i j)
@@ -69,18 +70,14 @@ noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) :=
   rw [LDL.lowerInv_eq_gramSchmidtBasis]
   haveI :=
     Basis.invertibleToMatrix (Pi.basisFun π•œ n)
-      (@gramSchmidtBasis π•œ (n β†’ π•œ) _ (inner_product_space.of_matrix hS.transpose) n _ _ _
+      (@gramSchmidtBasis π•œ (n β†’ π•œ) _ (_ : _) (inner_product_space.of_matrix hS.transpose) n _ _ _
         (Pi.basisFun π•œ n))
   infer_instance
 #align LDL.invertible_lower_inv LDL.invertibleLowerInv
 
 theorem LDL.lowerInv_orthogonal {i j : n} (hβ‚€ : i β‰  j) :
     βŸͺLDL.lowerInv hS i, Sα΅€.mulVec (LDL.lowerInv hS j)βŸ«β‚‘ = 0 :=
-  show
-    @inner π•œ (n β†’ π•œ) (InnerProductSpace.ofMatrix hS.transpose).toHasInner (LDL.lowerInv hS i)
-        (LDL.lowerInv hS j) =
-      0
-    by apply gramSchmidt_orthogonal _ _ hβ‚€
+  @gramSchmidt_orthogonal π•œ _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ hβ‚€
 #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal
 
 /-- The entries of the diagonal matrix `D` of the LDL decomposition. -/
@@ -95,8 +92,8 @@ noncomputable def LDL.diag : Matrix n n π•œ :=
 
 theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j = 0 := by
   rw [←
-    @gramSchmidt_triangular π•œ (n β†’ π•œ) _ (inner_product_space.of_matrix hS.transpose) n _ _ _ i j hij
-      (Pi.basisFun π•œ n),
+    @gramSchmidt_triangular π•œ (n β†’ π•œ) _ (_ : _) (inner_product_space.of_matrix hS.transpose) n _ _ _
+      i j hij (Pi.basisFun π•œ n),
     Pi.basisFun_repr, LDL.lowerInv]
 #align LDL.lower_inv_triangular LDL.lowerInv_triangular
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
 
 ! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! 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.
 -/
@@ -37,9 +37,8 @@ variable {π•œ : Type _} [IsROrC π•œ]
 
 variable {n : Type _} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
--- mathport name: Β«exprβŸͺ , ⟫»
-local notation "βŸͺ" x ", " y "⟫" =>
-  @inner π•œ (n β†’ π•œ) (PiLp.innerProductSpace fun _ => π•œ).toHasInner x y
+-- mathport name: Β«exprβŸͺ , βŸ«β‚‘Β»
+local notation "βŸͺ" x ", " y "βŸ«β‚‘" => @inner π•œ _ _ ((PiLp.equiv 2 _).symm x) ((PiLp.equiv _ _).symm y)
 
 open Matrix
 
@@ -51,8 +50,7 @@ variable {S : Matrix n n π•œ} [Fintype n] (hS : S.PosDef)
 applying Gram-Schmidt-Orthogonalization w.r.t. the inner product induced by `Sα΅€` on the standard
 basis vectors `pi.basis_fun`. -/
 noncomputable def LDL.lowerInv : Matrix n n π•œ :=
-  @gramSchmidt π•œ (n β†’ π•œ) _ (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ fun k =>
-    Pi.basisFun π•œ n k
+  @gramSchmidt π•œ (n β†’ π•œ) _ (InnerProductSpace.ofMatrix hS.transpose) n _ _ _ (Pi.basisFun π•œ n)
 #align LDL.lower_inv LDL.lowerInv
 
 theorem LDL.lowerInv_eq_gramSchmidtBasis :
@@ -77,7 +75,7 @@ noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) :=
 #align LDL.invertible_lower_inv LDL.invertibleLowerInv
 
 theorem LDL.lowerInv_orthogonal {i j : n} (hβ‚€ : i β‰  j) :
-    βŸͺLDL.lowerInv hS i, Sα΅€.mulVec (LDL.lowerInv hS j)⟫ = 0 :=
+    βŸͺLDL.lowerInv hS i, Sα΅€.mulVec (LDL.lowerInv hS j)βŸ«β‚‘ = 0 :=
   show
     @inner π•œ (n β†’ π•œ) (InnerProductSpace.ofMatrix hS.transpose).toHasInner (LDL.lowerInv hS i)
         (LDL.lowerInv hS j) =
@@ -87,7 +85,7 @@ theorem LDL.lowerInv_orthogonal {i j : n} (hβ‚€ : i β‰  j) :
 
 /-- The entries of the diagonal matrix `D` of the LDL decomposition. -/
 noncomputable def LDL.diagEntries : n β†’ π•œ := fun i =>
-  βŸͺstar (LDL.lowerInv hS i), S.mulVec (star (LDL.lowerInv hS i))⟫
+  βŸͺstar (LDL.lowerInv hS i), S.mulVec (star (LDL.lowerInv hS i))βŸ«β‚‘
 #align LDL.diag_entries LDL.diagEntries
 
 /-- The diagonal matrix `D` of the LDL decomposition. -/
@@ -109,12 +107,12 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL
   ext (i j)
   by_cases hij : i = j
   Β·
-    simpa only [hij, LDL.diag, diagonal_apply_eq, LDL.diagEntries, Matrix.mul_assoc, inner,
-      Pi.star_apply, IsROrC.star_def, starRingEnd_self_apply]
+    simpa only [hij, LDL.diag, diagonal_apply_eq, LDL.diagEntries, Matrix.mul_assoc,
+      EuclideanSpace.inner_piLp_equiv_symm, star_star]
   Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne.def, not_false_iff, mul_mul_apply]
     rw [conj_transpose, transpose_map, transpose_transpose, dot_product_mul_vec,
       (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm,
-      mul_vec_transpose, EuclideanSpace.inner_eq_star_dotProduct, ← IsROrC.star_def, ←
+      mul_vec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← IsROrC.star_def, ←
       star_dot_product_star, dot_product_comm, star_star]
     rfl
 #align LDL.diag_eq_lower_inv_conj LDL.diag_eq_lowerInv_conj
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
 
 ! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! leanprover-community/mathlib commit 0fc5496584478976b86f17941b3ff25ad7c4ebd6
+! leanprover-community/mathlib commit 3fc0b254310908f70a1a75f01147d52e53e9f8a2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -113,7 +113,7 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL
       Pi.star_apply, IsROrC.star_def, starRingEnd_self_apply]
   Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne.def, not_false_iff, mul_mul_apply]
     rw [conj_transpose, transpose_map, transpose_transpose, dot_product_mul_vec,
-      (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_sym,
+      (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm,
       mul_vec_transpose, EuclideanSpace.inner_eq_star_dotProduct, ← IsROrC.star_def, ←
       star_dot_product_star, dot_product_comm, star_star]
     rfl

Changes in mathlib4

mathlib3
mathlib4
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -105,7 +105,7 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.low
   Β· simp only [diag, diagEntries, EuclideanSpace.inner_piLp_equiv_symm, star_star, hij,
     diagonal_apply_eq, Matrix.mul_assoc]
     rfl
-  Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne.def, not_false_iff, mul_mul_apply]
+  Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne, not_false_iff, mul_mul_apply]
     rw [conjTranspose, transpose_map, transpose_transpose, dotProduct_mulVec,
       (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm,
       mulVec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← RCLike.star_def, ←
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
@@ -30,7 +30,7 @@ decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a d
 -/
 
 
-variable {π•œ : Type*} [IsROrC π•œ]
+variable {π•œ : Type*} [RCLike π•œ]
 variable {n : Type*} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
 section set_options
@@ -108,7 +108,7 @@ theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.low
   Β· simp only [LDL.diag, hij, diagonal_apply_ne, Ne.def, not_false_iff, mul_mul_apply]
     rw [conjTranspose, transpose_map, transpose_transpose, dotProduct_mulVec,
       (LDL.lowerInv_orthogonal hS fun h : j = i => hij h.symm).symm, ← inner_conj_symm,
-      mulVec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← IsROrC.star_def, ←
+      mulVec_transpose, EuclideanSpace.inner_piLp_equiv_symm, ← RCLike.star_def, ←
       star_dotProduct_star, dotProduct_comm, star_star]
     rfl
 #align LDL.diag_eq_lower_inv_conj LDL.diag_eq_lowerInv_conj
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
@@ -31,7 +31,6 @@ decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a d
 
 
 variable {π•œ : Type*} [IsROrC π•œ]
-
 variable {n : Type*} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
 section set_options
chore: Matrix.mulVec and Matrix.vecMul get infix notation (#10297)

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

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

Diff
@@ -77,13 +77,13 @@ noncomputable instance LDL.invertibleLowerInv : Invertible (LDL.lowerInv hS) :=
 #align LDL.invertible_lower_inv LDL.invertibleLowerInv
 
 theorem LDL.lowerInv_orthogonal {i j : n} (hβ‚€ : i β‰  j) :
-    βŸͺLDL.lowerInv hS i, Sα΅€.mulVec (LDL.lowerInv hS j)βŸ«β‚‘ = 0 :=
+    βŸͺLDL.lowerInv hS i, Sα΅€ *α΅₯ LDL.lowerInv hS jβŸ«β‚‘ = 0 :=
   @gramSchmidt_orthogonal π•œ _ _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) _ _ _ _ _ _ _ hβ‚€
 #align LDL.lower_inv_orthogonal LDL.lowerInv_orthogonal
 
 /-- The entries of the diagonal matrix `D` of the LDL decomposition. -/
 noncomputable def LDL.diagEntries : n β†’ π•œ := fun i =>
-  βŸͺstar (LDL.lowerInv hS i), S.mulVec (star (LDL.lowerInv hS i))βŸ«β‚‘
+  βŸͺstar (LDL.lowerInv hS i), S *α΅₯ star (LDL.lowerInv hS i)βŸ«β‚‘
 #align LDL.diag_entries LDL.diagEntries
 
 /-- The diagonal matrix `D` of the LDL decomposition. -/
refactor: remove PiLp.equiv (#6501)

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

Diff
@@ -38,7 +38,8 @@ section set_options
 
 set_option linter.uppercaseLean3 false
 set_option quotPrecheck false
-local notation "βŸͺ" x ", " y "βŸ«β‚‘" => @inner π•œ _ _ ((PiLp.equiv 2 _).symm x) ((PiLp.equiv _ _).symm y)
+local notation "βŸͺ" x ", " y "βŸ«β‚‘" =>
+  @inner π•œ _ _ ((WithLp.equiv 2 _).symm x) ((WithLp.equiv _ _).symm y)
 
 open Matrix
 
refactor(LinearAlgebra/Matrix/PosDef): Generalize to StarOrderedRing (#6489)

I assume this is mathematically sound, though right now we can't generalize many dependencies due to the reliance of InnerProductSpace.

Diff
@@ -42,7 +42,7 @@ local notation "βŸͺ" x ", " y "βŸ«β‚‘" => @inner π•œ _ _ ((PiLp.equiv 2 _).symm
 
 open Matrix
 
-open scoped Matrix
+open scoped Matrix ComplexOrder
 
 variable {S : Matrix n n π•œ} [Fintype n] (hS : S.PosDef)
 
refactor(Data/Matrix): Eliminate ⬝ notation in favor of HMul (#6487)

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

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

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

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

Diff
@@ -99,7 +99,7 @@ theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j =
 
 /-- Inverse statement of **LDL decomposition**: we can conjugate a positive definite matrix
 by some lower triangular matrix and get a diagonal matrix. -/
-theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL.lowerInv hS)ᴴ := by
+theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS * S * (LDL.lowerInv hS)α΄΄ := by
   ext i j
   by_cases hij : i = j
   Β· simp only [diag, diagEntries, EuclideanSpace.inner_piLp_equiv_symm, star_star, hij,
@@ -120,7 +120,7 @@ noncomputable def LDL.lower :=
 
 /-- **LDL decomposition**: any positive definite matrix `S` can be
 decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a diagonal matrix.  -/
-theorem LDL.lower_conj_diag : LDL.lower hS ⬝ LDL.diag hS ⬝ (LDL.lower hS)ᴴ = S := by
+theorem LDL.lower_conj_diag : LDL.lower hS * LDL.diag hS * (LDL.lower hS)α΄΄ = S := by
   rw [LDL.lower, conjTranspose_nonsing_inv, Matrix.mul_assoc,
     Matrix.inv_mul_eq_iff_eq_mul_of_invertible (LDL.lowerInv hS),
     Matrix.mul_inv_eq_iff_eq_mul_of_invertible]
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
@@ -30,9 +30,9 @@ decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a d
 -/
 
 
-variable {π•œ : Type _} [IsROrC π•œ]
+variable {π•œ : Type*} [IsROrC π•œ]
 
-variable {n : Type _} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
+variable {n : Type*} [LinearOrder n] [IsWellOrder n (Β· < Β·)] [LocallyFiniteOrderBot n]
 
 section set_options
 
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) 2022 Alexander Bentkamp. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Alexander Bentkamp
-
-! This file was ported from Lean 3 source module linear_algebra.matrix.ldl
-! 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.GramSchmidtOrtho
 import Mathlib.LinearAlgebra.Matrix.PosDef
 
+#align_import linear_algebra.matrix.ldl from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5"
+
 /-! # LDL decomposition
 
 This file proves the LDL-decomposition of matrices: Any positive definite matrix `S` can be
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -64,7 +64,7 @@ theorem LDL.lowerInv_eq_gramSchmidtBasis :
             (Pi.basisFun π•œ n)))α΅€ := by
   letI := NormedAddCommGroup.ofMatrix hS.transpose
   letI := InnerProductSpace.ofMatrix hS.transpose
-  ext (i j)
+  ext i j
   rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis]
   rfl
 #align LDL.lower_inv_eq_gram_schmidt_basis LDL.lowerInv_eq_gramSchmidtBasis
@@ -103,7 +103,7 @@ theorem LDL.lowerInv_triangular {i j : n} (hij : i < j) : LDL.lowerInv hS i j =
 /-- Inverse statement of **LDL decomposition**: we can conjugate a positive definite matrix
 by some lower triangular matrix and get a diagonal matrix. -/
 theorem LDL.diag_eq_lowerInv_conj : LDL.diag hS = LDL.lowerInv hS ⬝ S ⬝ (LDL.lowerInv hS)ᴴ := by
-  ext (i j)
+  ext i j
   by_cases hij : i = j
   Β· simp only [diag, diagEntries, EuclideanSpace.inner_piLp_equiv_symm, star_star, hij,
     diagonal_apply_eq, Matrix.mul_assoc]
chore: tidy various files (#5233)
Diff
@@ -13,7 +13,7 @@ import Mathlib.LinearAlgebra.Matrix.PosDef
 
 /-! # LDL decomposition
 
-This file proves the LDL-decomposition of matricies: Any positive definite matrix `S` can be
+This file proves the LDL-decomposition of matrices: Any positive definite matrix `S` can be
 decomposed as `S = LDLα΄΄` where `L` is a lower-triangular matrix and `D` is a diagonal matrix.
 
 ## Main definitions
feat: port LinearAlgebra.Matrix.LDL (#5061)

Dependencies 12 + 996

997 files ported (98.8%)
435640 lines ported (98.7%)
Show graph

The unported dependencies are

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