[Merged by Bors] - feat(Data/Matrix,LinearAlgebra/Matrix): generalize basic lemmas to rectangular matrices #45927
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 512 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.373
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #45927"
general
weight: 0.35
eric-wieser
Generalize 40 square-matrix (
Matrix n n) lemmas in place to rectangular matrices:Analysis-
InnerProductSpace/PiL2:inner_matrix_row_row,inner_matrix_col_col-
Normed-
Lp/PiLp:PiLp.basis_toMatrix_basisFun_mul-
Module/FiniteDimension:Module.Basis.continuous_toMatrixCombinatorics/SimpleGraph/AdjMatrix:SimpleGraph.adjMatrix_mul_apply,SimpleGraph.mul_adjMatrix_applyData/Matrix-
Basis:Matrix.single_neg,Matrix.single_mulVec_eq-
Block:Matrix.comp_diagonal-
Mul:Matrix.vecMulVec_zero,Matrix.vecMulVec_ne_zero,Matrix.vecMulVec_eq_zero,Matrix.mul_mul_apply,Matrix.submatrix_mul_transpose_submatrix-
PEquiv:PEquiv.toMatrix_toPEquiv_eqLinearAlgebra-
AffineSpace/Matrix:AffineBasis.toMatrix_vecMul_coords,AffineBasis.toMatrix_mul_toMatrix-
Matrix-
Basis:Module.Basis.coePiBasisFun.toMatrix_eq_transpose,Module.Basis.toMatrix_smul,basis_toMatrix_basisFun_mul,Module.Basis.toMatrix_reindex,Module.Basis.toMatrix_map-
Defs:Matrix.map_smul',Matrix.map_op_smul'-
Integer:Matrix.map_mul_natCast,Matrix.map_mul_intCast,Matrix.map_mul_ratCast-
NonsingularInverse:Matrix.right_inv_eq_left_inv-
RowCol:Matrix.replicateRow_mul_replicateCol,Matrix.replicateRow_mul_replicateCol_apply-
SemiringInverse:Matrix.isAddUnit_mul-
Symmetric:Matrix.isSymm_mul_transpose_self,Matrix.isSymm_transpose_mul_self-
ToLin:Matrix.ker_toLin'_eq_bot_iff,LinearMap.toMatrix_eq_toMatrix',LinearMap.toMatrix_singleton-
Transvection:Matrix.TransvectionStruct.sumInl_toMatrix_prod_mul,Matrix.TransvectionStruct.mul_sumInl_toMatrix_prodRingTheory/Trace/Basic:Algebra.traceMatrix_of_matrix_vecMul,Algebra.traceMatrix_of_matrix_mulVecFound using a (small) Gemini 4 Carbon swarm, asked to write metaprograms to spot accidental square specializations with trivial fixes.
---
<!-- Your PR title will become the first line of the commit message.
In this box, the text above the
---(if not empty) will be appendedto the commit message, and can be used to give additional context or
details. Please leave a blank newline before the
---, otherwise GitHubwill format the text above it as a title.
For details on the "pull request lifecycle" in mathlib, please see:
https://leanprover-community.github.io/contribute/index.html
In particular, note that most reviewers will only notice your PR
if it passes the continuous integration checks.
Please ask for help on https://leanprover.zulipchat.com if needed.
When merging, all the commits will be squashed into a single commit
listing all co-authors.
Co-authors in the squash commit are gathered from two sources:
First, all authors of commits to this PR branch are included. Thus,
one way to add co-authors is to include at least one commit authored by
each co-author among the commits in the pull request. If necessary, you
may create empty commits to indicate co-authorship, using commands like so:
git commit --author="Author Name <author@email.com>" --allow-empty -m "add Author Name as coauthor"
Second, co-authors can also be listed in lines at the very bottom of
the commit message (that is, directly before the
---) using the following format:Co-authored-by: Author Name <author@email.com>
If you are moving or deleting declarations, please include these lines
at the bottom of the commit message (before the
---, and also beforeany "Co-authored-by" lines) using the following format:
Moves:
Deletions:
Any other comments you want to keep out of the PR commit should go
below the
---, and placed outside this HTML comment, or else theywill be invisible to reviewers.
If this PR depends on other PRs, please list them below this comment,
using the following format:
-->