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: Matrix.fromRows and Matrix.fromColumns multiplied by vectors #10379

Closed
wants to merge 7 commits into from

Conversation

madvorak
Copy link
Collaborator

@madvorak madvorak commented Feb 9, 2024

Comment on lines 147 to 155
@[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
Copy link
Member

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)?

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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?

Copy link
Collaborator Author

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>
@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes t-algebra Algebra (groups, rings, fields, etc) and removed awaiting-review labels Feb 9, 2024
@madvorak madvorak changed the title feat: Matrix.fromRows_mulVec and Matrix.vecMul_fromColumns feat: Matrix.fromRows and Matrix.fromColumns multiplied by vectors Feb 9, 2024
@madvorak madvorak added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes labels Feb 9, 2024
@eric-wieser
Copy link
Member

bors merge

Thanks for this!

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Feb 9, 2024
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Feb 9, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Matrix.fromRows and Matrix.fromColumns multiplied by vectors [Merged by Bors] - feat: Matrix.fromRows and Matrix.fromColumns multiplied by vectors Feb 9, 2024
@mathlib-bors mathlib-bors bot closed this Feb 9, 2024
@mathlib-bors mathlib-bors bot deleted the matrixfrom branch February 9, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants