2×2 block matrices and the Schur complement #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
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 the file cateogry_theory.preadditive.biproducts
,
especially the declarations category_theory.biprod.gaussian
and category_theory.biprod.iso_elim
.
Compare with matrix.invertible_of_from_blocks₁₁_invertible
.
Main results #
matrix.det_from_blocks₁₁
,matrix.det_from_blocks₂₂
: determinant of a block matrix in terms of the Schur complement.matrix.inv_of_from_blocks_zero₂₁_eq
,matrix.inv_of_from_blocks_zero₁₂_eq
: the inverse of a block triangular matrix.matrix.is_unit_from_blocks_zero₂₁
,matrix.is_unit_from_blocks_zero₁₂
: invertibility of a block triangular matrix.matrix.det_one_add_mul_comm
: the Weinstein–Aronszajn identity.matrix.schur_complement_pos_semidef_iff
: If a matrixA
is positive definite, then[A B; Bᴴ D]
is postive semidefinite if and only ifD - Bᴴ A⁻¹ B
is postive semidefinite.
LDU decomposition of a block matrix with an invertible top-left corner, using the Schur complement.
LDU decomposition of a block matrix with an invertible bottom-right corner, using the Schur complement.
Block triangular matrices #
An upper-block-triangular matrix is invertible if its diagonal is.
Equations
- A.from_blocks_zero₂₁_invertible B D = (matrix.from_blocks A B 0 D).invertible_of_left_inverse (matrix.from_blocks (⅟ A) (-((⅟ A).mul B).mul (⅟ D)) 0 (⅟ D)) _
A lower-block-triangular matrix is invertible if its diagonal is.
Equations
- A.from_blocks_zero₁₂_invertible C D = (matrix.from_blocks A 0 C D).invertible_of_left_inverse (matrix.from_blocks (⅟ A) 0 (-((⅟ D).mul C).mul (⅟ A)) (⅟ D)) _
Both diagonal entries of an invertible upper-block-triangular matrix are invertible (by reading off the diagonal entries of the inverse).
Equations
- A.invertible_of_from_blocks_zero₂₁_invertible B D = (A.invertible_of_left_inverse (⅟ (matrix.from_blocks A B 0 D)).to_blocks₁₁ _, D.invertible_of_right_inverse (⅟ (matrix.from_blocks A B 0 D)).to_blocks₂₂ _)
Both diagonal entries of an invertible lower-block-triangular matrix are invertible (by reading off the diagonal entries of the inverse).
Equations
- A.invertible_of_from_blocks_zero₁₂_invertible C D = (A.invertible_of_right_inverse (⅟ (matrix.from_blocks A 0 C D)).to_blocks₁₁ _, D.invertible_of_left_inverse (⅟ (matrix.from_blocks A 0 C D)).to_blocks₂₂ _)
invertible_of_from_blocks_zero₂₁_invertible
and from_blocks_zero₂₁_invertible
form
an equivalence.
Equations
- A.from_blocks_zero₂₁_invertible_equiv B D = {to_fun := λ (_x : invertible (matrix.from_blocks A B 0 D)), A.invertible_of_from_blocks_zero₂₁_invertible B D, inv_fun := λ (i : invertible A × invertible D), let _inst : invertible A := i.fst, _inst_1 : invertible D := i.snd in A.from_blocks_zero₂₁_invertible B D, left_inv := _, right_inv := _}
invertible_of_from_blocks_zero₁₂_invertible
and from_blocks_zero₁₂_invertible
form
an equivalence.
Equations
- A.from_blocks_zero₁₂_invertible_equiv C D = {to_fun := λ (_x : invertible (matrix.from_blocks A 0 C D)), A.invertible_of_from_blocks_zero₁₂_invertible C D, inv_fun := λ (i : invertible A × invertible D), let _inst : invertible A := i.fst, _inst_1 : invertible D := i.snd in A.from_blocks_zero₁₂_invertible C D, left_inv := _, right_inv := _}
An upper block-triangular matrix is invertible iff both elements of its diagonal are.
This is a propositional form of matrix.from_blocks_zero₂₁_invertible_equiv
.
A lower block-triangular matrix is invertible iff both elements of its diagonal are.
This is a propositional form of matrix.from_blocks_zero₁₂_invertible_equiv
forms an iff
.
An expression for the inverse of an upper block-triangular matrix, when either both elements of diagonal are invertible, or both are not.
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 #
A block matrix is invertible if the bottom right corner and the corresponding schur complement is.
Equations
- A.from_blocks₂₂_invertible B C D = (let _inst : invertible 1 := invertible_one, _inst_1 : invertible 1 := invertible_one in ((1.from_blocks_zero₂₁_invertible (B.mul (⅟ D)) 1).matrix_mul ((A - (B.mul (⅟ D)).mul C).from_blocks_zero₂₁_invertible 0 D)).matrix_mul (1.from_blocks_zero₁₂_invertible ((⅟ D).mul C) 1)).copy' (matrix.from_blocks A B C D) (matrix.from_blocks (⅟ (A - (B.mul (⅟ D)).mul C)) (-((⅟ (A - (B.mul (⅟ D)).mul C)).mul B).mul (⅟ D)) (-((⅟ D).mul C).mul (⅟ (A - (B.mul (⅟ D)).mul C))) (⅟ D + ((((⅟ D).mul C).mul (⅟ (A - (B.mul (⅟ D)).mul C))).mul B).mul (⅟ D))) _ _
A block matrix is invertible if the top left corner and the corresponding schur complement is.
Equations
- A.from_blocks₁₁_invertible B C D = let _inst : invertible (matrix.from_blocks D C B A) := D.from_blocks₂₂_invertible C B A, iDCBA : invertible ((matrix.from_blocks D C B A).submatrix ⇑(equiv.sum_comm m n) ⇑(equiv.sum_comm m n)) := (matrix.from_blocks D C B A).submatrix_equiv_invertible (equiv.sum_comm m n) (equiv.sum_comm m n) in iDCBA.copy' (matrix.from_blocks A B C D) (matrix.from_blocks (⅟ A + ((((⅟ A).mul B).mul (⅟ (D - (C.mul (⅟ A)).mul B))).mul C).mul (⅟ A)) (-((⅟ A).mul B).mul (⅟ (D - (C.mul (⅟ A)).mul B))) (-((⅟ (D - (C.mul (⅟ A)).mul B)).mul C).mul (⅟ A)) (⅟ (D - (C.mul (⅟ A)).mul B))) _ _
If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement.
Equations
- A.invertible_of_from_blocks₂₂_invertible B C D = ((A - (B.mul (⅟ D)).mul C).invertible_of_from_blocks_zero₁₂_invertible 0 D).fst
If a block matrix is invertible and so is its bottom left element, then so is the corresponding Schur complement.
Equations
- A.invertible_of_from_blocks₁₁_invertible B C D = let iABCD' : invertible ((matrix.from_blocks A B C D).submatrix ⇑(equiv.sum_comm n m) ⇑(equiv.sum_comm n m)) := (matrix.from_blocks A B C D).submatrix_equiv_invertible (equiv.sum_comm n m) (equiv.sum_comm n m), iDCBA : invertible (matrix.from_blocks D C B A) := iABCD'.copy (matrix.from_blocks D C B A) _ in D.invertible_of_from_blocks₂₂_invertible C B A
matrix.invertible_of_from_blocks₂₂_invertible
and matrix.from_blocks₂₂_invertible
as an
equivalence.
Equations
- A.invertible_equiv_from_blocks₂₂_invertible B C D = {to_fun := λ (iABCD : invertible (matrix.from_blocks A B C D)), A.invertible_of_from_blocks₂₂_invertible B C D, inv_fun := λ (i_schur : invertible (A - (B.mul (⅟ D)).mul C)), A.from_blocks₂₂_invertible B C D, left_inv := _, right_inv := _}
matrix.invertible_of_from_blocks₁₁_invertible
and matrix.from_blocks₁₁_invertible
as an
equivalence.
Equations
- A.invertible_equiv_from_blocks₁₁_invertible B C D = {to_fun := λ (iABCD : invertible (matrix.from_blocks A B C D)), A.invertible_of_from_blocks₁₁_invertible B C D, inv_fun := λ (i_schur : invertible (D - (C.mul (⅟ A)).mul B)), A.from_blocks₁₁_invertible B C D, left_inv := _, right_inv := _}
If the bottom-left element of a block matrix is invertible, then the whole matrix is invertible iff the corresponding schur complement is.
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
#
Determinant of a 2×2 block matrix, expanded around an invertible top left element in terms of the Schur complement.
Determinant of a 2×2 block matrix, expanded around an invertible bottom right element in terms of the Schur complement.
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.
A special case of the Matrix determinant lemma for when A = I
.
TODO: show this more generally.