Documentation

Mathlib.LinearAlgebra.Matrix.SchurComplement

2×2 block matrices and the Schur complement #

This file proves properties of 2×2 block matrices [A B; C D] that relate to the Schur complement D - C*A⁻¹*B.

Some of the results here generalize to 2×2 matrices in a category, rather than just a ring. A few results in this direction can be found in the file CateogryTheory.Preadditive.Biproducts, especially the declarations CategoryTheory.Biprod.gaussian and CategoryTheory.Biprod.isoElim. Compare with Matrix.invertibleOfFromBlocks₁₁Invertible.

Main results #

theorem Matrix.fromBlocks_eq_of_invertible₁₁ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype l] [Fintype m] [Fintype n] [DecidableEq l] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix l m α) (D : Matrix l n α) [Invertible A] :
Matrix.fromBlocks A B C D = Matrix.fromBlocks 1 0 (C * A) 1 * Matrix.fromBlocks A 0 0 (D - C * A * B) * Matrix.fromBlocks 1 (A * B) 0 1

LDU decomposition of a block matrix with an invertible top-left corner, using the Schur complement.

theorem Matrix.fromBlocks_eq_of_invertible₂₂ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype l] [Fintype m] [Fintype n] [DecidableEq l] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix l m α) (B : Matrix l n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] :
Matrix.fromBlocks A B C D = Matrix.fromBlocks 1 (B * D) 0 1 * Matrix.fromBlocks (A - B * D * C) 0 0 D * Matrix.fromBlocks 1 0 (D * C) 1

LDU decomposition of a block matrix with an invertible bottom-right corner, using the Schur complement.

Block triangular matrices #

def Matrix.fromBlocksZero₂₁Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) [Invertible A] [Invertible D] :

An upper-block-triangular matrix is invertible if its diagonal is.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def Matrix.fromBlocksZero₁₂Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible D] :

    A lower-block-triangular matrix is invertible if its diagonal is.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Matrix.invOf_fromBlocks_zero₂₁_eq {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) [Invertible A] [Invertible D] [Invertible (Matrix.fromBlocks A B 0 D)] :
      theorem Matrix.invOf_fromBlocks_zero₁₂_eq {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible D] [Invertible (Matrix.fromBlocks A 0 C D)] :
      def Matrix.invertibleOfFromBlocksZero₂₁Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) [Invertible (Matrix.fromBlocks A B 0 D)] :

      Both diagonal entries of an invertible upper-block-triangular matrix are invertible (by reading off the diagonal entries of the inverse).

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Matrix.invertibleOfFromBlocksZero₁₂Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) [Invertible (Matrix.fromBlocks A 0 C D)] :

        Both diagonal entries of an invertible lower-block-triangular matrix are invertible (by reading off the diagonal entries of the inverse).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Matrix.fromBlocksZero₂₁InvertibleEquiv {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) :

          invertibleOfFromBlocksZero₂₁Invertible and Matrix.fromBlocksZero₂₁Invertible form an equivalence.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Matrix.fromBlocksZero₁₂InvertibleEquiv {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) :

            invertibleOfFromBlocksZero₁₂Invertible and Matrix.fromBlocksZero₁₂Invertible form an equivalence.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem Matrix.isUnit_fromBlocks_zero₂₁ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] {A : Matrix m m α} {B : Matrix m n α} {D : Matrix n n α} :

              An upper block-triangular matrix is invertible iff both elements of its diagonal are.

              This is a propositional form of Matrix.fromBlocksZero₂₁InvertibleEquiv.

              @[simp]
              theorem Matrix.isUnit_fromBlocks_zero₁₂ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] {A : Matrix m m α} {C : Matrix n m α} {D : Matrix n n α} :

              A lower block-triangular matrix is invertible iff both elements of its diagonal are.

              This is a propositional form of Matrix.fromBlocksZero₁₂InvertibleEquiv forms an iff.

              theorem Matrix.inv_fromBlocks_zero₂₁_of_isUnit_iff {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) (hAD : IsUnit A IsUnit D) :

              An expression for the inverse of an upper block-triangular matrix, when either both elements of diagonal are invertible, or both are not.

              theorem Matrix.inv_fromBlocks_zero₁₂_of_isUnit_iff {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) (hAD : IsUnit A IsUnit D) :

              An expression for the inverse of a lower block-triangular matrix, when either both elements of diagonal are invertible, or both are not.

              2×2 block matrices #

              General 2×2 block matrices #

              def Matrix.fromBlocks₂₂Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] [Invertible (A - B * D * C)] :

              A block matrix is invertible if the bottom right corner and the corresponding schur complement is.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def Matrix.fromBlocks₁₁Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible (D - C * A * B)] :

                A block matrix is invertible if the top left corner and the corresponding schur complement is.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Matrix.invOf_fromBlocks₂₂_eq {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] [Invertible (A - B * D * C)] [Invertible (Matrix.fromBlocks A B C D)] :
                  (Matrix.fromBlocks A B C D) = Matrix.fromBlocks ((A - B * D * C)) (-((A - B * D * C) * B * D)) (-(D * C * (A - B * D * C))) (D + D * C * (A - B * D * C) * B * D)
                  theorem Matrix.invOf_fromBlocks₁₁_eq {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible (D - C * A * B)] [Invertible (Matrix.fromBlocks A B C D)] :
                  (Matrix.fromBlocks A B C D) = Matrix.fromBlocks (A + A * B * (D - C * A * B) * C * A) (-(A * B * (D - C * A * B))) (-((D - C * A * B) * C * A)) (D - C * A * B)
                  def Matrix.invertibleOfFromBlocks₂₂Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] [Invertible (Matrix.fromBlocks A B C D)] :
                  Invertible (A - B * D * C)

                  If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Matrix.invertibleOfFromBlocks₁₁Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible (Matrix.fromBlocks A B C D)] :
                    Invertible (D - C * A * B)

                    If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement.

                    Equations
                    Instances For
                      def Matrix.invertibleEquivFromBlocks₂₂Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] :

                      Matrix.invertibleOfFromBlocks₂₂Invertible and Matrix.fromBlocks₂₂Invertible as an equivalence.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Matrix.invertibleEquivFromBlocks₁₁Invertible {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] :

                        Matrix.invertibleOfFromBlocks₁₁Invertible and Matrix.fromBlocks₁₁Invertible as an equivalence.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Matrix.isUnit_fromBlocks_iff_of_invertible₂₂ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α} {D : Matrix n n α} [Invertible D] :
                          IsUnit (Matrix.fromBlocks A B C D) IsUnit (A - B * D * C)

                          If the bottom-left element of a block matrix is invertible, then the whole matrix is invertible iff the corresponding schur complement is.

                          theorem Matrix.isUnit_fromBlocks_iff_of_invertible₁₁ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α} {D : Matrix n n α} [Invertible A] :
                          IsUnit (Matrix.fromBlocks A B C D) IsUnit (D - C * A * B)

                          If the top-right element of a block matrix is invertible, then the whole matrix is invertible iff the corresponding schur complement is.

                          Lemmas about Matrix.det #

                          theorem Matrix.det_fromBlocks₁₁ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] :

                          Determinant of a 2×2 block matrix, expanded around an invertible top left element in terms of the Schur complement.

                          @[simp]
                          theorem Matrix.det_fromBlocks_one₁₁ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) :
                          theorem Matrix.det_fromBlocks₂₂ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) [Invertible D] :

                          Determinant of a 2×2 block matrix, expanded around an invertible bottom right element in terms of the Schur complement.

                          @[simp]
                          theorem Matrix.det_fromBlocks_one₂₂ {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) :
                          theorem Matrix.det_one_add_mul_comm {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m n α) (B : Matrix n m α) :
                          Matrix.det (1 + A * B) = Matrix.det (1 + B * A)

                          The Weinstein–Aronszajn identity. Note the 1 on the LHS is of shape m×m, while the 1 on the RHS is of shape n×n.

                          theorem Matrix.det_mul_add_one_comm {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m n α) (B : Matrix n m α) :
                          Matrix.det (A * B + 1) = Matrix.det (B * A + 1)

                          Alternate statement of the Weinstein–Aronszajn identity

                          theorem Matrix.det_one_sub_mul_comm {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] (A : Matrix m n α) (B : Matrix n m α) :
                          Matrix.det (1 - A * B) = Matrix.det (1 - B * A)
                          theorem Matrix.det_one_add_col_mul_row {m : Type u_2} {α : Type u_4} [Fintype m] [DecidableEq m] [CommRing α] (u : mα) (v : mα) :

                          A special case of the Matrix determinant lemma for when A = I.

                          theorem Matrix.det_add_col_mul_row {m : Type u_2} {α : Type u_4} [Fintype m] [DecidableEq m] [CommRing α] {A : Matrix m m α} (hA : IsUnit (Matrix.det A)) (u : mα) (v : mα) :

                          The Matrix determinant lemma

                          TODO: show the more general version without hA : IsUnit A.det as (A + col u * row v).det = A.det + v ⬝ᵥ (adjugate A) *ᵥ u.

                          theorem Matrix.det_add_mul {m : Type u_2} {n : Type u_3} {α : Type u_4} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing α] {A : Matrix m m α} (U : Matrix m n α) (V : Matrix n m α) (hA : IsUnit (Matrix.det A)) :
                          Matrix.det (A + U * V) = Matrix.det A * Matrix.det (1 + V * A⁻¹ * U)

                          A generalization of the Matrix determinant lemma

                          Lemmas about and and other StarOrderedRings #

                          theorem Matrix.schur_complement_eq₁₁ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (x : m𝕜) (y : n𝕜) [Invertible A] (hA : Matrix.IsHermitian A) :
                          theorem Matrix.schur_complement_eq₂₂ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (x : m𝕜) (y : n𝕜) [Invertible D] (hD : Matrix.IsHermitian D) :
                          theorem Matrix.IsHermitian.fromBlocks₁₁ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : Matrix.IsHermitian A) :
                          theorem Matrix.IsHermitian.fromBlocks₂₂ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (hD : Matrix.IsHermitian D) :
                          theorem Matrix.PosSemidef.fromBlocks₁₁ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (hA : Matrix.PosDef A) [Invertible A] :
                          theorem Matrix.PosSemidef.fromBlocks₂₂ {m : Type u_2} {n : Type u_3} {𝕜 : Type u_5} [CommRing 𝕜] [PartialOrder 𝕜] [StarOrderedRing 𝕜] [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜) (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (hD : Matrix.PosDef D) [Invertible D] :