Total nonnegativity is closed under products (via Cauchy–Binet) - #403
Merged
Conversation
Adds Matrix.IsTotallyNonnegRect.mul and Matrix.IsTotallyNonneg.mul in the Mathlib mirror tree, so they are upstream-shaped. The proof is four lines: the existing Matrix.det_submatrix_mul_eq_sum_powersetCard expands a minor of a product as a sum over intermediate column sets, each intermediate selection is the increasing enumeration of a subset and so strictly monotone, hence every summand is a product of two nonnegative minors. This is step 2 of the decomposition recorded in issue #394, and it turned out to be immediate because Cauchy-Binet was already present and sorry-free in this repo (Determinant/CauchyBinet.lean), contrary to the earlier assessment there which only checked Mathlib. Placed in its own file rather than appended to Mathlib/LinearAlgebra/Matrix/TotallyNonneg.lean purely because that file is a `module` while Determinant/CauchyBinet.lean is not, and a `module` cannot import a non-`module`; the file header records that they belong together when upstreaming. No sorry and no axiom; the full RealRooted target builds with zero warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2 of #394's decomposition. Adds, in the Mathlib mirror tree so it is upstream-shaped:
No
sorry, noaxiom; fullRealRootedtarget builds with zero warnings (9002 jobs).It was four lines, because Cauchy–Binet was already here
Matrix.det_submatrix_mul_eq_sum_powersetCard(Determinant/CauchyBinet.lean, sorry-free) expands a minor of a product as a sum over intermediate column sets. Each intermediate selection isSet.powersetCard.ofFinEmbEquiv.symm s, anOrderEmbedding, hence strictly monotone — so every summand is a product of two nonnegative minors andFinset.sum_nonnegfinishes.This corrects the assessment in #394, which said Mathlib lacks Cauchy–Binet and treated it as work to be done. That is true of Mathlib but not of this repo, which already had it. Only checking Mathlib was an oversight.
File placement
It sits in
Mathlib/LinearAlgebra/Matrix/TotallyNonneg/Mul.leanrather than being appended toTotallyNonneg.leanfor one mechanical reason:TotallyNonneg.leanis amodule(withpublic import) whileDeterminant/CauchyBinet.leanis not, and amodulecannot import a non-module. Converting either file was the more invasive option. The header records that the two belong together when upstreaming.🤖 Generated with Claude Code