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(linear_algebra/matrix/nonsingular_inverse): 2×2 block triangular matrices are invertible iff their diagonal is #18849

Closed
wants to merge 13 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Apr 21, 2023


Open in Gitpod

It's not clear to me whether it is easier to prove these results first, then combine the results to prove the contents of #18843; or to recover the lemmas in this PR as a special case of those. Unfortunately the invertible API makes this all rather unpleasant.

In #19156 I was able to prove the general results in terms of these results; I needed to add a substantial amount of invertible boilerplate, but I think the result is more mathematically interesting than proving the general result with a pile of algebra and deriving special cases from it. So I think this PR should go ahead, and #18843 can be abandoned in favor of #19156

… matrices are invertible iff their diagonal is

This follows the pattern used for `submatrix` and `diagonal` of setting up
```lean
invertible (from_blocks A B 0 D) ≃ invertible A × invertible D
```
and using it to prove
```lean
is_unit (from_blocks A B 0 D) ↔ is_unit A ∧ is_unit D
```

These results fall out as the special case of the general formula; though my hope is that they can also be used to prove it.
@eric-wieser eric-wieser added WIP Work in progress blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. awaiting-CI The author would like to see what CI has to say before doing more work. labels Apr 21, 2023
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Apr 21, 2023
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Apr 21, 2023
@eric-wieser eric-wieser added awaiting-CI The author would like to see what CI has to say before doing more work. t-algebra Algebra (groups, rings, fields etc) labels Apr 24, 2023
@github-actions github-actions bot added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Apr 24, 2023
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Apr 26, 2023
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Apr 27, 2023
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Apr 28, 2023
@eric-wieser eric-wieser removed the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Apr 29, 2023
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Jun 5, 2023
@eric-wieser eric-wieser added the wait-requested-on #port-comments requests that a port waits on this PR. label Jun 6, 2023
def invertible_of_from_blocks_zero₁₂_invertible
(A : matrix m m α) (C : matrix n m α) (D : matrix n n α)
[invertible (from_blocks A 0 C D)] : invertible A × invertible D :=
{ fst := invertible_of_right_inverse _ (⅟(from_blocks A 0 C D)).to_blocks₁₁ $ begin
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose here again a symmetry argument is too much work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes; combined with the fact that this is a definition, and the version derived with a symmetry argument is probably going to end up carrying data that doesn't quite match.

/-- `invertible_of_from_blocks_zero₂₁_invertible` and `from_blocks_zero₂₁_invertible` form
an equivalence. -/
def from_blocks_zero₂₁_invertible_equiv (A : matrix m m α) (B : matrix m n α) (D : matrix n n α) :
invertible (from_blocks A B 0 D) ≃ invertible A × invertible D :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose iff wouldn't work here because the two sides aren't Prop-valued? Showing an equiv between two subsingletons seems overly complicated...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, exactly. The iff version is spelt with is_unit, but it's easiest to derive it from this result.

Comment on lines 158 to 164
/-- When lowered to a prop, `matrix.from_blocks_zero₂₁_invertible_equiv` forms an `iff`. -/
@[simp] lemma is_unit_from_blocks_zero₂₁ {A : matrix m m α} {B : matrix m n α} {D : matrix n n α} :
is_unit (from_blocks A B 0 D) ↔ is_unit A ∧ is_unit D :=
by simp only [← nonempty_invertible_iff_is_unit, ←nonempty_prod,
(from_blocks_zero₂₁_invertible_equiv _ _ _).nonempty_congr]

/-- When lowered to a prop, `matrix.from_blocks_zero₁₂_invertible_equiv` forms an `iff`. -/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would write the docstrings so that these are the "main theorems". At least these are the ones I'd be looking for from a mathematician's point of view, and the _equiv forms feel more like implementation details.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, done.

Copy link
Collaborator

@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.

Nice results overall. It seems you really had to fight with invertible here...

bors d+

@bors
Copy link

bors bot commented Jun 9, 2023

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

@leanprover-community-bot-assistant leanprover-community-bot-assistant added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Jun 9, 2023
@eric-wieser
Copy link
Member Author

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jun 9, 2023
bors bot pushed a commit that referenced this pull request Jun 9, 2023
… matrices are invertible iff their diagonal is (#18849)
@bors
Copy link

bors bot commented Jun 9, 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(linear_algebra/matrix/nonsingular_inverse): 2×2 block triangular matrices are invertible iff their diagonal is [Merged by Bors] - feat(linear_algebra/matrix/nonsingular_inverse): 2×2 block triangular matrices are invertible iff their diagonal is Jun 9, 2023
@bors bors bot closed this Jun 9, 2023
@bors bors bot deleted the eric-wieser/block-triangular-inv branch June 9, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-algebra Algebra (groups, rings, fields etc) wait-requested-on #port-comments requests that a port waits on this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants