[Merged by Bors] - feat(data/matrix): matrix and vector notation#2656
[Merged by Bors] - feat(data/matrix): matrix and vector notation#2656Vierkantor wants to merge 5 commits intomasterfrom
Conversation
|
Why is there still boilerplate in the PR description? I thought that we've removed it already? In any case, please remove the part after and including "Make sure you have" as this would be included in the commit message. |
Ah, my bad! I thought GitHub was having issues (the interactive buttons didn't work), so I copied the old template manually. |
jcommelin
left a comment
There was a problem hiding this comment.
Nice work! Thanks 🎉
Looks pretty good to me.
Co-authored-by: Johan Commelin <johan@commelin.net>
|
bors merge |
This PR adds notation for matrices and vectors [as discussed on Zulip a couple of months ago](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20matrices.20and.20vectors), so that `![![a, b], ![c, d]]` constructs a 2x2 matrix with rows `![a, b] : fin 2 -> α` and `![c, d]`. It also adds corresponding `simp` lemmas for all matrix operations defined in `data.matrix.basic`. These lemmas should apply only when the input already contains `![...]`. To express the `simp` lemmas nicely, I defined a function `dot_product : (v w : n -> α) -> α` which returns the sum of the entrywise product of two vectors. IMO, this makes the definitions of `matrix.mul`, `matrix.mul_vec` and `matrix.vec_mul` clearer, and it allows us to share some proofs. I could also inline `dot_product` (restoring the old situation) if the reviewers prefer. Co-authored-by: Vierkantor <Vierkantor@users.noreply.github.com> Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
|
Pull request successfully merged into master. Build succeeded: |
|
It's too late for this PR, but it looks like something goes wrong in the |
|
What could possibly go wrong if you name a file |
) This PR adds notation for matrices and vectors [as discussed on Zulip a couple of months ago](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20matrices.20and.20vectors), so that `![![a, b], ![c, d]]` constructs a 2x2 matrix with rows `![a, b] : fin 2 -> α` and `![c, d]`. It also adds corresponding `simp` lemmas for all matrix operations defined in `data.matrix.basic`. These lemmas should apply only when the input already contains `![...]`. To express the `simp` lemmas nicely, I defined a function `dot_product : (v w : n -> α) -> α` which returns the sum of the entrywise product of two vectors. IMO, this makes the definitions of `matrix.mul`, `matrix.mul_vec` and `matrix.vec_mul` clearer, and it allows us to share some proofs. I could also inline `dot_product` (restoring the old situation) if the reviewers prefer. Co-authored-by: Vierkantor <Vierkantor@users.noreply.github.com> Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
) This PR adds notation for matrices and vectors [as discussed on Zulip a couple of months ago](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20matrices.20and.20vectors), so that `![![a, b], ![c, d]]` constructs a 2x2 matrix with rows `![a, b] : fin 2 -> α` and `![c, d]`. It also adds corresponding `simp` lemmas for all matrix operations defined in `data.matrix.basic`. These lemmas should apply only when the input already contains `![...]`. To express the `simp` lemmas nicely, I defined a function `dot_product : (v w : n -> α) -> α` which returns the sum of the entrywise product of two vectors. IMO, this makes the definitions of `matrix.mul`, `matrix.mul_vec` and `matrix.vec_mul` clearer, and it allows us to share some proofs. I could also inline `dot_product` (restoring the old situation) if the reviewers prefer. Co-authored-by: Vierkantor <Vierkantor@users.noreply.github.com> Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
) This PR adds notation for matrices and vectors [as discussed on Zulip a couple of months ago](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20matrices.20and.20vectors), so that `![![a, b], ![c, d]]` constructs a 2x2 matrix with rows `![a, b] : fin 2 -> α` and `![c, d]`. It also adds corresponding `simp` lemmas for all matrix operations defined in `data.matrix.basic`. These lemmas should apply only when the input already contains `![...]`. To express the `simp` lemmas nicely, I defined a function `dot_product : (v w : n -> α) -> α` which returns the sum of the entrywise product of two vectors. IMO, this makes the definitions of `matrix.mul`, `matrix.mul_vec` and `matrix.vec_mul` clearer, and it allows us to share some proofs. I could also inline `dot_product` (restoring the old situation) if the reviewers prefer. Co-authored-by: Vierkantor <Vierkantor@users.noreply.github.com> Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
This PR adds notation for matrices and vectors as discussed on Zulip a couple of months ago, so that
![![a, b], ![c, d]]constructs a 2x2 matrix with rows![a, b] : fin 2 -> αand![c, d]. It also adds correspondingsimplemmas for all matrix operations defined indata.matrix.basic. These lemmas should apply only when the input already contains![...].To express the
simplemmas nicely, I defined a functiondot_product : (v w : n -> α) -> αwhich returns the sum of the entrywise product of two vectors. IMO, this makes the definitions ofmatrix.mul,matrix.mul_vecandmatrix.vec_mulclearer, and it allows us to share some proofs. I could also inlinedot_product(restoring the old situation) if the reviewers prefer.