Blocks and the Schur complement of a partitioned matrix
DefinitionMuirheadMST_WishartBlocksBlock notation for a real matrix
with the block on the first rows and columns and the block on the last rows and columns, and the Schur complement
as used in Muirhead's treatment of the partitioned Wishart matrix.
Formalization Note The inverse is Mathlib's matrix inverse, which is for a singular ; the theorems of this mission only apply it where is invertible almost surely.
import Mathlib
/-!
Block notation for partitioned matrices, for Muirhead, *Aspects of Multivariate Statistical Theory* (1982),
§3.2.3. An `(k + l) × (k + l)` matrix `M` is split as `[[M₁₁, M₁₂], [M₂₁, M₂₂]]` with `M₁₁` of size `k × k`
(rows and columns `0, …, k-1`) and `M₂₂` of size `l × l` (rows and columns `k, …, k+l-1`).
-/
noncomputable section
namespace MuirheadMST
variable {k l : ℕ}
/-- The top-left `k × k` block `M₁₁`. -/
def block11 (M : Matrix (Fin (k + l)) (Fin (k + l)) ℝ) : Matrix (Fin k) (Fin k) ℝ :=
M.submatrix (Fin.castAdd l) (Fin.castAdd l)
/-- The top-right `k × l` block `M₁₂`. -/
def block12 (M : Matrix (Fin (k + l)) (Fin (k + l)) ℝ) : Matrix (Fin k) (Fin l) ℝ :=
M.submatrix (Fin.castAdd l) (Fin.natAdd k)
/-- The bottom-left `l × k` block `M₂₁`. -/
def block21 (M : Matrix (Fin (k + l)) (Fin (k + l)) ℝ) : Matrix (Fin l) (Fin k) ℝ :=
M.submatrix (Fin.natAdd k) (Fin.castAdd l)
/-- The bottom-right `l × l` block `M₂₂`. -/
def block22 (M : Matrix (Fin (k + l)) (Fin (k + l)) ℝ) : Matrix (Fin l) (Fin l) ℝ :=
M.submatrix (Fin.natAdd k) (Fin.natAdd k)
/-- The Schur complement `M₁₁·₂ = M₁₁ - M₁₂ M₂₂⁻¹ M₂₁` (with Mathlib's `⁻¹`, which is `0` for a singular
`M₂₂`). -/
def schur11 (M : Matrix (Fin (k + l)) (Fin (k + l)) ℝ) : Matrix (Fin k) (Fin k) ℝ :=
block11 M - block12 M * (block22 M)⁻¹ * block21 M
end MuirheadMST
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. and are arbitrary natural numbers (either may be ) and is an arbitrary real matrix with rows and columns indexed ; no symmetry, invertibility or definiteness is assumed. Every definition is a total function of .
is the matrix , (first rows and columns; empty if , equal to if ).
is the matrix (first rows, last columns).
is the matrix (last rows, first columns).
is the matrix (last rows and columns; empty if , equal to if ).
Schur complement is the matrix
with ordinary matrix products and a total inverse: is the usual inverse when and the zero matrix when , in which case . If , ; if , it is the empty matrix. No hypothesis requires or to be symmetric, positive definite or invertible.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.