feat(LinearAlgebra/Matrix): add Sherman-Morrison formula#34875
feat(LinearAlgebra/Matrix): add Sherman-Morrison formula#34875banrovegrie wants to merge 4 commits intoleanprover-community:masterfrom
Conversation
PR summary 5bad60a0caImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
f14d92d to
b5f95bc
Compare
|
I think there's a shorter proof here along the lines of https://github.com/eric-wieser/lean-matrix-cookbook/blob/5682ac96f54bd119bd92b053962433c6940b6385/MatrixCookbook/3Inverses.lean#L131-L151 |
|
Hey @eric-wieser, thanks for pointing me to your lean-matrix-cookbook proof! I've reworked it to follow your approach: A few questions:
|
There was a problem hiding this comment.
Pull request overview
This PR adds Sherman–Morrison-style inverse and invertibility lemmas for rank-1 matrix updates to Mathlib’s matrix library, complementing the existing determinant lemma in SchurComplement.lean.
Changes:
- Added
Matrix.inv_add_vecMulVecandMatrix.inv_sub_vecMulVec, giving inverse formulas forA ± vecMulVec u vunder the standard Sherman–Morrison hypotheses. - Added
Matrix.isUnit_det_add_vecMulVec, providing an invertibility/isUnit determinant result for the rank-1 update. - Registered the new module via
public importinMathlib.lean.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Mathlib/LinearAlgebra/Matrix/ShermanMorrison.lean | Introduces Sherman–Morrison inverse lemmas (add/sub variants) and an IsUnit determinant corollary. |
| Mathlib.lean | Exposes the new Sherman–Morrison module through a top-level public import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The CI failed for possibly unrelated error. You probably want to merge master to retry CI again |
Mathlib has the matrix determinant lemma (
det_add_replicateCol_mul_replicateRowin SchurComplement.lean) but lacked the corresponding inverse formula. This PR fills that gap.Matrix.inv_add_vecMulVec: Sherman-Morrison formula for(A + uv^T)^{-1}Matrix.inv_sub_vecMulVec: subtraction variantMatrix.isUnit_det_add_vecMulVec: invertibility under the formula's hypothesesTest plan
lake buildpasses