Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem #3276

Closed
wants to merge 28 commits into from

Conversation

semorrison
Copy link
Collaborator

@semorrison semorrison commented Jul 3, 2020

The Cayley-Hamilton theorem, following the proof at http://drorbn.net/AcademicPensieve/2015-12/CayleyHamilton.pdf.


This PR is currently stacked on top of #3275, but the only new file here is linear_algebra/cayley_hamilton.lean if you want to see what it looks like.

Now blocked by #3352, arising from review suggestions.

@semorrison semorrison added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jul 3, 2020
@semorrison
Copy link
Collaborator Author

I'm looking forward to someone constructing eigenvectors now! :-)

@semorrison semorrison added awaiting-review The author would like community review of the PR and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Jul 9, 2020
@semorrison semorrison changed the title feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem (deps #3275) feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem Jul 9, 2020
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
@robertylewis robertylewis added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jul 9, 2020
@semorrison semorrison changed the title feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem (deps #3352) Jul 10, 2020
@semorrison semorrison added blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jul 10, 2020
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
src/linear_algebra/cayley_hamilton.lean Outdated Show resolved Hide resolved
semorrison and others added 4 commits July 10, 2020 14:34
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
@jcommelin jcommelin removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jul 10, 2020
semorrison and others added 4 commits July 10, 2020 07:07
#3333)

As discussed on [zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/import.20refactor.20and.20library_search), #3235 had the unfortunate effect of making `library_search` and `#where` and various other things unavailable in many places in mathlib.

This PR makes an effort to import `tactic.basic` as early as possible, while otherwise reducing unnecessary imports. 

1. import `tactic.basic` "as early as possible" (i.e. in any file that `tactic.basic` doesn't depend on, and which imports any tactic strictly between `tactic.core` and `tactic.basic`, just `import tactic.basic` itself
2. add `tactic.finish`, `tactic.tauto` and `tactic.norm_cast` to tactic.basic (doesn't requires adding any dependencies)
3. delete various unnecessary imports




Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Other changes:

* rename `injective.prod` to `injective.prod_map`;
* add `surjective.prod_map`;
* redefine `sigma.map` without pattern matching;
* rename `sigma_map_injective` to `injective.sigma_map`;
* add `surjective.sigma_map`;
* add `injective.sum_map` and `surjective.sum_map`;
* rename `embedding.prod_congr` to `embedding.prod_map`;
* rename `embedding.sum_congr` to `embedding.sum_map`;
* delete `embedding.sigma_congr_right`, add more
  general `embedding.sigma_map`.
Remove the unnecessary assumption that `A` is commutative in `matrix n n A ≃ₐ[R] (A ⊗[R] matrix n n R)`.

(This didn't cause a problem for Cayley-Hamilton, but @alexjbest and Bassem Safieldeen [realised it's not necessary](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Tensor.20product.20of.20matrices).)



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
A refactor of `algebra/homology` so homology and cohomology are handled uniformly, and factor out a file `image_to_kernel_map.lean` which gains some extra lemmas (which will be useful for talking about exact sequences).



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
@jcommelin jcommelin changed the title feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem (deps #3352) feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem Jul 10, 2020
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jul 10, 2020
bors bot pushed a commit that referenced this pull request Jul 10, 2020
)

The Cayley-Hamilton theorem, following the proof at http://drorbn.net/AcademicPensieve/2015-12/CayleyHamilton.pdf.





Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Johan Commelin <johan@commelin.net>
@bors
Copy link

bors bot commented Jul 10, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem [Merged by Bors] - feat(linear_algebra/cayley_hamilton): the Cayley-Hamilton theorem Jul 10, 2020
@bors bors bot closed this Jul 10, 2020
@bors bors bot deleted the cayley_hamilton_squashed branch July 10, 2020 07:36
-- is sent to zero, because the evaluation function puts the polynomial variable
-- to the right of any coefficients, so everything telescopes.
apply_fun (λ p, p.eval M) at h,
rw eval_mul_X_sub_C at h,
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason not to write rwa [eval_mul_X_sub_C, mat_poly_equiv_smul_one] at h, instead of those three lines? Is that because of the narrative in the comments?

Copy link
Member

Choose a reason for hiding this comment

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

I think that this proof was indeed un-golfed for readability reasons.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder whether we should care about the fact that mathcomp people always point out how their proof is only three lines long.

Maybe we can add a comment below our proof saying:

theorem char_poly_map_eval_self (M : matrix n n R) :
  ((char_poly M).map (algebra_map R (matrix n n R))).eval M = 0 :=
begin
  have h : (mat_poly_equiv ((char_poly M) • 1)).eval M = (mat_poly_equiv  (adjugate (char_matrix M) * (char_matrix M))).eval M := congr_arg _ (congr_arg _ (adjugate_mul _).symm),
  simpa only [mat_poly_equiv.map_mul, mat_poly_equiv_char_matrix, eval_mul_X_sub_C, mat_poly_equiv_smul_one] using h,
end

Copy link
Member

@jcommelin jcommelin Jul 10, 2020

Choose a reason for hiding this comment

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

Sounds good to me.
How about by simpa ... using ...?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, on Scott's screen you could use

by simpa only [mat_poly_equiv.map_mul, mat_poly_equiv_char_matrix, eval_mul_X_sub_C, mat_poly_equiv_smul_one] using (congr_arg _ (congr_arg _ (adjugate_mul _).symm) : (mat_poly_equiv ((char_poly M) • 1)).eval M = (mat_poly_equiv  (adjugate (char_matrix M) * (char_matrix M))).eval M)

cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
…anprover-community#3276)

The Cayley-Hamilton theorem, following the proof at http://drorbn.net/AcademicPensieve/2015-12/CayleyHamilton.pdf.





Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
Co-authored-by: Johan Commelin <johan@commelin.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants