Skip to content

feat(LinearAlgebra/Eigenspace/Matrix): a scalar is in the spectrum iff it's an eigenvalue#39635

Open
SnirBroshi wants to merge 12 commits into
leanprover-community:masterfrom
SnirBroshi:feature/matrix/mem-spectrum-iff-mulvec
Open

feat(LinearAlgebra/Eigenspace/Matrix): a scalar is in the spectrum iff it's an eigenvalue#39635
SnirBroshi wants to merge 12 commits into
leanprover-community:masterfrom
SnirBroshi:feature/matrix/mem-spectrum-iff-mulvec

Conversation

@SnirBroshi

Copy link
Copy Markdown
Collaborator

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

PR summary 6bdb86423a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ hasEigenvalue_iff_exists_map_eq_smul
+ isUnit_iff_forall_mulVec_eq_zero
+ mem_spectrum_iff_exists_mulVec_eq_smul
+ mem_spectrum_of_map_eq_smul
+ mem_spectrum_of_mulVec_eq_smul

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.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 6bdb864).

  • +5 new declarations
  • −0 removed declarations
+Matrix.isUnit_iff_forall_mulVec_eq_zero
+Matrix.mem_spectrum_iff_exists_mulVec_eq_smul
+Matrix.mem_spectrum_of_mulVec_eq_smul
+Module.End.hasEigenvalue_iff_exists_map_eq_smul
+Module.End.mem_spectrum_of_map_eq_smul

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 6bdb86423a
Reference commit e2361c1beb

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label May 21, 2026
Comment thread Mathlib/LinearAlgebra/Eigenspace/Matrix.lean Outdated
Comment thread Mathlib/LinearAlgebra/Eigenspace/Matrix.lean
@SnirBroshi SnirBroshi requested a review from themathqueen June 29, 2026 02:24
Comment thread Mathlib/LinearAlgebra/Eigenspace/Basic.lean Outdated
Comment thread Mathlib/LinearAlgebra/Eigenspace/Matrix.lean Outdated
@SnirBroshi SnirBroshi requested a review from themathqueen June 29, 2026 12:57
Comment thread Mathlib/LinearAlgebra/Eigenspace/Basic.lean Outdated
@themathqueen themathqueen added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 30, 2026
@SnirBroshi SnirBroshi removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 4, 2026
@SnirBroshi SnirBroshi requested a review from themathqueen July 4, 2026 02:40
IsUnit f ↔ ∀ v, f v = 0 → v = 0 := by
simp_rw [← spectrum.zero_notMem_iff K, ← hasEigenvalue_iff_mem_spectrum,
hasEigenvalue_iff_exists_map_eq_smul, zero_smul]
grind only

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.

This is a weird detour, going through spectrum to show this.

This is actually a one-liner, and doesn't need Field, only DivisonRing:

theorem isUnit_iff_forall_map_eq_zero [FiniteDimensional K V] {f : End K V} :
    IsUnit f ↔ ∀ v, f v = 0 → v = 0 :=
  f.isUnit_iff_ker_eq_bot.trans f.ker_eq_bot'

given that, I think just remove this? Or perhaps move to another PR if you think it's necessary?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, but you were the one who asked me to add this in the first place

I think mem_spectrum_of_map_eq_smul is also unnecessary

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looking back at it maybe I misunderstood and you only asked for a linear map version of mem_spectrum_of_mulVec_eq_smul and not all three

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.

Sorry, I should've been clearer. I think mem_spectrum_of_map_eq_smul could be useful (just like the matrix version)?

@themathqueen themathqueen added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 5, 2026
@SnirBroshi SnirBroshi removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 5, 2026
@SnirBroshi SnirBroshi requested a review from themathqueen July 5, 2026 23:33
simp_rw [← spectrum_toLin', ← hasEigenvalue_iff_mem_spectrum,
hasEigenvalue_iff_exists_map_eq_smul, toLin'_apply]

theorem isUnit_iff_forall_mulVec_eq_zero {K : Type*} [Field K] {A : Matrix n n K} :

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.

I don't think this belongs in this file now (not using anything about spectrum anymore)


alias ⟨_, HasEigenvalue.of_mem_spectrum⟩ := hasEigenvalue_iff_mem_spectrum

theorem mem_spectrum_of_map_eq_smul {f : End R M} {v : M} {a : R} (h0 : v ≠ 0) (h : f v = a • v) :

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.

to keep things consistent with the files, can you use \mu instead of a for the eigenvalue (here and below, and also for the matrix lemmas)?

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

Labels

t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants