Skip to content

[Merged by Bors] - feat: column and row partitioned matrices#6052

Closed
MohanadAhmed wants to merge 14 commits intomasterfrom
MohanadAhmed/ColRowPartitionedMats
Closed

[Merged by Bors] - feat: column and row partitioned matrices#6052
MohanadAhmed wants to merge 14 commits intomasterfrom
MohanadAhmed/ColRowPartitionedMats

Conversation

@MohanadAhmed
Copy link
Copy Markdown
Collaborator

This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as A = fromColumns A₁ A₂ the concatenation of two matrices with the same column indices can be expressed as B = fromRows B₁ B₂.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas fromColumns_mul_fromRows_eq_one_comm and equiv_compl_fromColumns_mul_fromRows_eq_one_comm deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the Invertible type which can only be applied to square matrices (with the same index type for rows and columns).


Open in Gitpod

@MohanadAhmed MohanadAhmed changed the title Column and Row Partitioned Matrices feat : Mathlib.Data.Matrix.columnRowPartitioned Column and Row Partitioned Matrices Jul 22, 2023
@MohanadAhmed MohanadAhmed requested a review from Vierkantor July 27, 2023 13:11
@Vierkantor Vierkantor self-assigned this Jul 28, 2023
@Vierkantor Vierkantor changed the title feat : Mathlib.Data.Matrix.columnRowPartitioned Column and Row Partitioned Matrices feat: column and row partitioned matrices Jul 31, 2023
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Sorry for taking a while to get around to your review. Overall I like the structure of your work, there are just a few things that we need to fill in and clean up.

I propose some extra lemmas that will noticeably change your proofs, so I will look at the style of proofs next time.

exact ⟨(fun h => ⟨fun i j => (h i).1 j, fun _ _ => (h _).2 _⟩),
(fun h => (fun _ => ⟨(h.1 _), (h.2 _)⟩))⟩

lemma fromRows_toRows (A : Matrix (M₁ ⊕ M₂) N R) : A = fromRows A.toRows₁ A.toRows₂ := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would move this to be right after fromColumns_toColumns, so that each column result is followed by the corresponding result on rows.

Comment on lines +34 to +35
/-- Concatenate together two matrices A₁[M₁ × N] and A₂[M₂ × N] with the same columns (N) to get a
bigger matrix indexed by [(M₁ ⊕ M₂) × N] -/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with the A₁[M₁ × N] notation, maybe you have a reference for it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I just meant the matrix is of rows $M_1$ and columns $N$.

@Vierkantor Vierkantor 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 Jul 31, 2023
@MohanadAhmed MohanadAhmed added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jul 31, 2023
@MohanadAhmed MohanadAhmed added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Aug 1, 2023
@github-actions github-actions bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Aug 1, 2023
Copy link
Copy Markdown
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

I went through and cleaned up the proofs. If you're happy with the changes, then this looks ready to me.

Thanks!

bors d+

@bors
Copy link
Copy Markdown

bors bot commented Aug 2, 2023

✌️ MohanadAhmed can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Aug 2, 2023
- Rfl proofs of simp lemmas.
- ext combined with simp for partitioned matrix equalities
- pass arguments into simp when they are not simp lemmas i.e. mul_apply

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@MohanadAhmed
Copy link
Copy Markdown
Collaborator Author

✌️ MohanadAhmed can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

bors r+

bors bot pushed a commit that referenced this pull request Aug 2, 2023
This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as `A = fromColumns A₁ A₂` the concatenation of two matrices with the same column indices can be expressed as `B = fromRows B₁ B₂`.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas `fromColumns_mul_fromRows_eq_one_comm` and `equiv_compl_fromColumns_mul_fromRows_eq_one_comm` deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the `Invertible` type which can only be applied to square matrices (with the same index type for rows and columns).
@bors
Copy link
Copy Markdown

bors bot commented Aug 2, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: column and row partitioned matrices [Merged by Bors] - feat: column and row partitioned matrices Aug 2, 2023
@bors bors bot closed this Aug 2, 2023
@bors bors bot deleted the MohanadAhmed/ColRowPartitionedMats branch August 2, 2023 14:42
kim-em pushed a commit that referenced this pull request Aug 3, 2023
This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as `A = fromColumns A₁ A₂` the concatenation of two matrices with the same column indices can be expressed as `B = fromRows B₁ B₂`.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas `fromColumns_mul_fromRows_eq_one_comm` and `equiv_compl_fromColumns_mul_fromRows_eq_one_comm` deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the `Invertible` type which can only be applied to square matrices (with the same index type for rows and columns).
kim-em pushed a commit that referenced this pull request Aug 3, 2023
This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as `A = fromColumns A₁ A₂` the concatenation of two matrices with the same column indices can be expressed as `B = fromRows B₁ B₂`.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas `fromColumns_mul_fromRows_eq_one_comm` and `equiv_compl_fromColumns_mul_fromRows_eq_one_comm` deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the `Invertible` type which can only be applied to square matrices (with the same index type for rows and columns).
kim-em pushed a commit that referenced this pull request Aug 14, 2023
This file provides the basic definitions of matrices composed from columns and rows. The concatenation of two matrices with the same row indices can be expressed as `A = fromColumns A₁ A₂` the concatenation of two matrices with the same column indices can be expressed as `B = fromRows B₁ B₂`.

We then provide a few lemmas that deal with the products of these with each other and with block matrices. Two particular lemmas `fromColumns_mul_fromRows_eq_one_comm` and `equiv_compl_fromColumns_mul_fromRows_eq_one_comm` deal with the case of matrix multiplication that gives one as a result. This gives a crude (but usable) replacement for the `Invertible` type which can only be applied to square matrices (with the same index type for rows and columns).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants