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

feat(data/matrix/companion): Companion matrix #15047

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pbazin
Copy link
Collaborator

@pbazin pbazin commented Jun 29, 2022

Defines the companion matrix of a polynomial. companion_eq_to_matrix_lmul_root provides a more abstract definition, from which it should be easier to prove some stuff (e.g. minimal polynomial) about the companion matrix.

Edit : minimal polynomial of the companion matrix now proved.


Open in Gitpod

src/data/matrix/companion.lean Outdated Show resolved Hide resolved
src/data/matrix/companion.lean Show resolved Hide resolved
src/data/matrix/companion.lean Show resolved Hide resolved
@YaelDillies YaelDillies changed the title feat(data/matrix/companion.lean): define companion matrix feat(data/matrix/companion): Companion matrix Jul 14, 2022
@semorrison
Copy link
Collaborator

Is this meant to be labelled awaiting-review? If you don't label it, it won't appear on the #queue.

/-- The companion matrix of a polynomial. -/
def companion [ring R] (P : R[X]) : matrix (fin P.nat_degree) (fin P.nat_degree) R :=
if h : P.nat_degree = 0 then 0 else
λ i j, if j = fin.last' h then -P.coeff i else if (j : ℕ) + 1 = i then 1 else 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
λ i j, if j = fin.last' h then -P.coeff i else if (j : ℕ) + 1 = i then 1 else 0
of (λ i j, if j = fin.last' h then -P.coeff i else if (j : ℕ) + 1 = i then 1 else 0)

@semorrison semorrison added the not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 label Jul 16, 2023
@semorrison semorrison added too-late This PR was ready too late for inclusion in mathlib3 and removed not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 labels Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
too-late This PR was ready too late for inclusion in mathlib3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants