-
Notifications
You must be signed in to change notification settings - Fork 297
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
Conversation
I'm looking forward to someone constructing eigenvectors now! :-) |
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
…mathlib into polynomial_algebra
…unity/mathlib into cayley_hamilton_squashed
Co-authored-by: Johan Commelin <johan@commelin.net>
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
#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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
) 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>
Pull request successfully merged into master. Build succeeded: |
-- 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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ...
?
There was a problem hiding this comment.
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)
…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>
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 islinear_algebra/cayley_hamilton.lean
if you want to see what it looks like.Now blocked by #3352, arising from review suggestions.