-
Notifications
You must be signed in to change notification settings - Fork 297
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
Conversation
…ck matrices with an invertible corner
… 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.
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 |
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 suppose here again a symmetry argument is too much work?
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.
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 := |
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 suppose iff
wouldn't work here because the two sides aren't Prop
-valued? Showing an equiv
between two subsingletons seems overly complicated...
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.
Yes, exactly. The iff
version is spelt with is_unit
, but it's easiest to derive it from this result.
/-- 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`. -/ |
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 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.
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.
Good idea, done.
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.
Nice results overall. It seems you really had to fight with invertible
here...
bors d+
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge |
… matrices are invertible iff their diagonal is (#18849)
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. If you want to switch to GitHub's built-in merge queue, visit their help page. |
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 theinvertible
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