Triangularize matrices over an algebraically closed field - #410
Merged
Conversation
Adds RealRooted/Mathlib/LinearAlgebra/Matrix/Triangularize.lean: - `Matrix.exists_mulVec_eq_smul`: a matrix over an algebraically closed field has an eigenvector (charpoly root -> singular pencil -> kernel vector); - `Matrix.exists_unitsConj_blockTriangular`: every square matrix over an algebraically closed field is conjugate to an upper triangular matrix, the triangular shape witnessed by an injective height function `b : m -> N`, so no linear order on the index type is required. The induction conjugates by `1.updateCol i0 v` (invertible since its determinant is `v i0`, via `cramer_one`) to clear the eigencolumn, then splits the index type with `Equiv.sumCompl` and recurses on the complement block; all block bookkeeping is `Matrix.fromBlocks` algebra plus `submatrix_mul_equiv`. This is the missing keystone for the compound eigenvalue theorem (#405 item 3) and, downstream, Gantmacher-Krein (#394). Mathlib currently has no matrix-level triangularization; the file mirrors the Mathlib tree for upstreaming. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 21, 2026
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 free
to 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.
The missing keystone for #405 item 3 (and, downstream, #394).
New file
RealRooted/Mathlib/LinearAlgebra/Matrix/Triangularize.lean:Matrix.exists_mulVec_eq_smul: a matrix over an algebraically closed fieldhas an eigenvector — charpoly root → singular pencil (
spectrum.mem_iff+isUnit_iff_isUnit_det) → kernel vector (exists_mulVec_eq_zero_iff);Matrix.exists_unitsConj_blockTriangular: every square matrix over analgebraically closed field is conjugate to an upper triangular matrix,
with the triangular shape witnessed by an injective height function
b : m → ℕ— index-type agnostic, no linear order needed.Proof: classical induction on
Fintype.card. Conjugating by1.updateCol i₀ v(invertible: its determinant isv i₀viacramer_one)clears the eigencolumn;
Equiv.sumComplsplits the index type; the complementblock recurses; all bookkeeping is
fromBlocksalgebra +submatrix_mul_equiv.Mathlib has no matrix-level triangularization (
Eigenspace/Triangularizablestops at flags of invariant subspaces), so the file mirrors the Mathlib tree
for upstreaming.
Together with #409 (
charpoly_compound_of_blockTriangular,charpoly_compound_conj) this makes #405 item 3 a pure assembly step:triangularize, take compounds, read off the diagonal.
Sorry-free, no warnings.
🤖 Generated with Claude Code