-
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] - chore(data/sum): Add trivial simp lemmas #5112
Conversation
Given the objections on Zulip, the |
@sum.elim α β _ inl inr = id := | ||
funext $ λ x, sum.cases_on x (λ _, rfl) (λ _, rfl) | ||
|
||
lemma comp_elim {α β γ δ : Sort*} (f : γ → δ) (g : α → γ) (h : β → γ): |
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.
This would also be fine as a simp lemma, but I'm not sure if we actually want this to always simplify to the right-hand side.
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.
Yeah, I left this one out because the decision of which way to simplify felt subjective.
@gebner, do you agree with @fpvandoorn that only |
Yes. The only one I'm a bit antsy about is |
bors r+ |
Wait, now I'm confused. @fpvandoorn is asking me to remove the |
Ah, missed that comment. bors r- |
✌️ fpvandoorn can now approve this pull request. To approve and merge a pull request, simply reply with |
Canceled. |
I think all of them are safe tbh. |
My comment was based on Gabriel's remark that the simp lemmas could be dangerous (and their limited use). If Gabriel is happy with them, so am I. bors merge |
Pull request successfully merged into master. Build succeeded: |
Discussed here: https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there.20code.20for.20X.3F/topic/sum.2Eelim.20%28f.20.E2.88.98.20sum.2Einl%29.20%28f.20.E2.88.98.20sum.2Einr%29.20.3D.20f/near/217891929
@rwbarton points out that
sum.elim_comp_inl_inr
is shorter asext (_|_); refl
, but that's hard to use as a subexpression.