-
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(algebra/invertible): add a missing lemma inv_of_eq_left_inv
#8179
Conversation
add "inv_of_eq_left_inv"
lemma inv_of_eq_left_inv [monoid α] {a b : α} [invertible a] (hac : b * a = 1) : ⅟a = b := | ||
(left_inv_eq_right_inv hac (mul_inv_of_self _)).symm |
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.
For other reviewers: is this version better or worse?
lemma inv_of_eq_left_inv [monoid α] {a b : α} [invertible a] (hac : b * a = 1) : ⅟a = b := | |
(left_inv_eq_right_inv hac (mul_inv_of_self _)).symm | |
lemma left_inv_eq_inv_of [monoid α] {a b : α} [invertible b] (hac : a * b = 1) : a = ⅟b := | |
left_inv_eq_right_inv hac (mul_inv_of_self _) |
My thoughts were that it doesn't swap a
and b
, but that's perhaps not important.
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.
Eric, I think that your version is better. I can get close to a proof of this: in my opinion, the eq_comm
at the end of the code below, almost certifies that there two sides should not be swapped!
lemma inv_mul_injective [monoid α] (a : α) [invertible a] : function.injective ((*) a) :=
λ b c bc, by simpa using congr_arg ((*) (⅟ a)) bc
lemma mul_inv_injective [monoid α] (a : α) [invertible a] : function.injective (flip (*) a) :=
λ b c bc, have h : b * a * ⅟ a= c * a * ⅟ a := congr_arg (flip (*) (⅟ a)) bc,
by simpa [mul_assoc] using h
lemma invertible.mul_eq_mul_iff_left [monoid α] (a : α) {b c : α} [invertible a] :
a * b = a * c ↔ b = c :=
⟨λ h, inv_mul_injective a h, congr_arg ((*) a)⟩
lemma invertible.mul_eq_mul_iff_right [monoid α] (a : α) {b c : α} [invertible a] :
b * a = c * a ↔ b = c :=
⟨λ h, mul_inv_injective a h, congr_arg (flip (*) a)⟩
lemma inv_of_eq_left_inv [monoid α] {a b : α} [invertible a] : b * a = 1 ↔ ⅟a = b :=
by { rw [← invertible.mul_eq_mul_iff_right (⅟ a)], simp [eq_comm] }
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 am following the format of the existing "inv_of_eq_right_inv"
lemma inv_of_eq_right_inv [monoid α] {a b : α} [invertible a] (hac : a * b = 1) : ⅟a = b := left_inv_eq_right_inv (inv_of_mul_self _) hac
Should we change them both together (which may produce further problems) or stick to the current format.
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 think it's useful if the conclusion is of the form ⅟ foo = bar
. That's the direction we will typically want to rw
in. And for the rest, the statement should be the dual of inv_of_eq_right_inv
. I don't have a strong opinion on whether or not to swap the a
and the b
in the statement.
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, Johan. Then how about stick to my current format which is the dual of the existing one and approving the PR?
@jcommelin
bors r+ I don't think it's worth spending any more time thinking about which version is best, since there's so little difference anyway. Let's just put in the version you suggested. Thanks for the contribution! |
…8179) add "inv_of_eq_left_inv"
Pull request successfully merged into master. Build succeeded: |
inv_of_eq_left_inv
inv_of_eq_left_inv
…8179) add "inv_of_eq_left_inv"
add "inv_of_eq_left_inv"