-
Notifications
You must be signed in to change notification settings - Fork 323
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: Matrix.fromRows
and Matrix.fromColumns
multiplied by vectors
#10379
Conversation
@[simp] | ||
lemma fromRows_mulVec (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (v : n → R) : | ||
fromRows A₁ A₂ *ᵥ v = Sum.elim (A₁ *ᵥ v) (A₂ *ᵥ v) := by | ||
ext (_ | _) <;> rfl | ||
|
||
@[simp] | ||
lemma vecMul_fromColumns (B₁ : Matrix m n₁ R) (B₂ : Matrix m n₂ R) (v : m → R) : | ||
v ᵥ* Matrix.fromColumns B₁ B₂ = Sum.elim (v ᵥ* B₁) (v ᵥ* B₂) := by | ||
ext (_ | _) <;> rfl |
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.
Can you also add the ones where the Sum.elim
is on the LHS (and the rows/columns are swapped)?
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 didn't know how to prove the other two.
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.
Where do you get stuck? The proof should be trivial still.
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 committed a sorried lemma. Either provide a proof, or delete it from this PR.
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 pushed a proof; can you add the other lemma?
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!
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Matrix.fromRows_mulVec
and Matrix.vecMul_fromColumns
Matrix.fromRows
and Matrix.fromColumns
multiplied by vectors
bors merge Thanks for this! |
#10379) Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.E2.9C.94.20sumType_zeroFun_dotProduct Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Pull request successfully merged into master. Build succeeded: |
Matrix.fromRows
and Matrix.fromColumns
multiplied by vectorsMatrix.fromRows
and Matrix.fromColumns
multiplied by vectors
#10379) Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.E2.9C.94.20sumType_zeroFun_dotProduct Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
#10379) Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.E2.9C.94.20sumType_zeroFun_dotProduct Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Zulip discussion:
https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/.E2.9C.94.20sumType_zeroFun_dotProduct