Skip to content

feat(LinearAlgebra): basis flag lemmas and genEigenspace map - #39829

Open
or4nge19 wants to merge 6 commits into
leanprover-community:masterfrom
or4nge19:Triangularizable
Open

feat(LinearAlgebra): basis flag lemmas and genEigenspace map#39829
or4nge19 wants to merge 6 commits into
leanprover-community:masterfrom
or4nge19:Triangularizable

Conversation

@or4nge19

@or4nge19 or4nge19 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Part 1/3 of #39139.
Introduces basis flag lemmas and intertwining genEigenspace map, using directly available constructors, ie introducing none (so improving on #39139)

Co-authored-by: kuotsanhsu learningstud@gmail.com


Open in Gitpod

or4nge19 and others added 6 commits May 20, 2026 21:58
API/lemmas for working with finite bases and flags and add a lemma about images of generalized eigenspaces.

Part 1/4 of leanprover-community#39139
Part 1 only needs flag/mkFinCons lemmas in Basis.Flag; the complement
basis constructor is proved inline in the triangularization PR via
existing mkFinCons.

Co-Authored-By: Cursor <cursoragent@cursor.com>
Co-Authored-By: Cursor <cursoragent@cursor.com>
Co-Authored-By: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added large-import Automatically added label for PRs with a significant increase in transitive imports t-algebra Algebra (groups, rings, fields, etc) labels May 25, 2026
@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

PR summary 9d846ddeb4

Import changes exceeding 2%

% File
+3.85% Mathlib.LinearAlgebra.Basis.Flag

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.LinearAlgebra.Basis.Flag 986 1024 +38 (+3.85%)
Import changes for all files
Files Import difference
Mathlib.LinearAlgebra.Basis.Flag 38

Declarations diff

+ flag_map
+ map_flag_le_mkFinCons_flag_succ
+ map_genEigenspace_le
+ mapsTo_genEigenspace_of_comp
+ mem_flag_iff_repr_eq_zero
+ span_singleton_le_mkFinCons_flag_succ

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

Comment on lines +126 to +138
theorem mem_flag_iff_repr_eq_zero [Nontrivial R] (b : Basis (Fin n) R M) {k : Fin (n + 1)} {x : M} :
x ∈ b.flag k ↔ ∀ i : Fin n, k ≤ i.castSucc → b.repr x i = 0 := by
constructor
· intro hx i hi
have hmem : x ∈ LinearMap.ker (b.coord i) := b.flag_le_ker_coord hi hx
simpa [Module.Basis.coord_apply] using (LinearMap.mem_ker.mp hmem)
· intro h
rw [← b.sum_repr x]
exact Submodule.sum_mem _ fun i _ => by
by_cases hi : i.castSucc < k
· exact Submodule.smul_mem _ _ (b.self_mem_flag hi)
· rw [h i (le_of_not_gt hi), zero_smul]
exact Submodule.zero_mem _

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golf in one-line, and no need for Nontrivial, you can also move this out of the commring section

Suggested change
theorem mem_flag_iff_repr_eq_zero [Nontrivial R] (b : Basis (Fin n) R M) {k : Fin (n + 1)} {x : M} :
x ∈ b.flag k ↔ ∀ i : Fin n, k ≤ i.castSucc → b.repr x i = 0 := by
constructor
· intro hx i hi
have hmem : x ∈ LinearMap.ker (b.coord i) := b.flag_le_ker_coord hi hx
simpa [Module.Basis.coord_apply] using (LinearMap.mem_ker.mp hmem)
· intro h
rw [← b.sum_repr x]
exact Submodule.sum_mem _ fun i _ => by
by_cases hi : i.castSucc < k
· exact Submodule.smul_mem _ _ (b.self_mem_flag hi)
· rw [h i (le_of_not_gt hi), zero_smul]
exact Submodule.zero_mem _
theorem mem_flag_iff_repr_eq_zero (b : Basis (Fin n) R M) {k : Fin (n + 1)} {x : M} :
x ∈ b.flag k ↔ ∀ i : Fin n, k ≤ i.castSucc → b.repr x i = 0 := by
simp [flag, Basis.mem_span_image, Finsupp.support_subset_iff]

Comment on lines +106 to +119
obtain ⟨l, hl, hx⟩ := (mem_genEigenspace (f := f) (μ := μ) (k := k)).mp hx
apply (mem_genEigenspace (f := g) (μ := μ) (k := k)).mpr
refine ⟨l, hl, ?_⟩
rw [LinearMap.mem_ker] at hx ⊢
have hsub (x : M) : (g - μ • 1) (φ x) = φ ((f - μ • 1) x) := by
have hfg : g (φ x) = φ (f x) := LinearMap.congr_fun hφ x
simp [LinearMap.sub_apply, hfg]
have hpow (l : ℕ) (x : M) :
((g - μ • 1) ^ l) (φ x) = φ (((f - μ • 1) ^ l) x) := by
induction l with
| zero => simp
| succ l ih =>
rw [pow_succ', pow_succ', Module.End.mul_apply, Module.End.mul_apply, ih, hsub]
rw [hpow, hx, map_zero]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
obtain ⟨l, hl, hx⟩ := (mem_genEigenspace (f := f) (μ := μ) (k := k)).mp hx
apply (mem_genEigenspace (f := g) (μ := μ) (k := k)).mpr
refine ⟨l, hl, ?_⟩
rw [LinearMap.mem_ker] at hx ⊢
have hsub (x : M) : (g - μ • 1) (φ x) = φ ((f - μ • 1) x) := by
have hfg : g (φ x) = φ (f x) := LinearMap.congr_fun hφ x
simp [LinearMap.sub_apply, hfg]
have hpow (l : ℕ) (x : M) :
((g - μ • 1) ^ l) (φ x) = φ (((f - μ • 1) ^ l) x) := by
induction l with
| zero => simp
| succ l ih =>
rw [pow_succ', pow_succ', Module.End.mul_apply, Module.End.mul_apply, ih, hsub]
rw [hpow, hx, map_zero]
obtain ⟨l, hl, hx⟩ := mem_genEigenspace.mp hx
refine mem_genEigenspace.mpr ⟨l, hl, ?_⟩
simp only [LinearMap.mem_ker, Module.End.pow_apply] at hx ⊢
suffices (⇑φ).Semiconj ⇑(f - μ • 1) ⇑(g - μ • 1) by rw [← this.iterate_right, hx, map_zero]
intro; simpa using congr($hφ _).symm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants