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(linear_algebra): fix/add coe_fn
simp lemmas
#7015
Conversation
* move `@[simp]` from `linear_map.comp_apply` to new `linear_map.coe_comp`; * rename `linear_map.comp_coe` to `linear_map.coe_comp`, swap LHS&RHS; * add `linear_map.coe_proj`, move `@[simp]` from `linear_map.proj_apply`.
|
||
@[norm_cast] | ||
lemma comp_coe : (f : M₂ → M₃) ∘ (g : M → M₂) = f.comp g := rfl | ||
@[simp, norm_cast] lemma coe_comp : (f.comp g : M → M₃) = f ∘ g := rfl |
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.
@[simp, norm_cast] lemma coe_comp : (f.comp g : M → M₃) = f ∘ g := rfl | |
@[simp, norm_cast] lemma coe_comp : ⇑(f.comp g) = f ∘ g := rfl |
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.
Why is using the arrow preferred over an explicit type annotation?
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.
The main reasons are:
- It's shorter
- we do that elsewhere
- It matches what the goal view shows and what doc-gen shows
It doesn't actually make any difference to lean.
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 prefer the explicit type annotation basically because I might be browsing the code outside of an editor or even if I am in the editor, if I'm looking at this lemma I might be too lazy to click around to see what the coercion is.
(Ultimately I don't think this is a big deal, so Yury should just go with whichever he wants.)
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-wieser "Arrows" version doesn't work with the current state of leanprover-community/lean#557 (I hope, it will be fixed), so I'll leave it as is.
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.
Bors d+
✌️ urkud can now approve this pull request. To approve and merge a pull request, simply reply with |
bors merge |
* move `@[simp]` from `linear_map.comp_apply` to new `linear_map.coe_comp`; * rename `linear_map.comp_coe` to `linear_map.coe_comp`, swap LHS&RHS; * add `linear_map.coe_proj`, move `@[simp]` from `linear_map.proj_apply`.
Pull request successfully merged into master. Build succeeded: |
coe_fn
simp lemmascoe_fn
simp lemmas
@[simp]
fromlinear_map.comp_apply
to newlinear_map.coe_comp
;linear_map.comp_coe
tolinear_map.coe_comp
, swap LHS&RHS;linear_map.coe_proj
, move@[simp]
fromlinear_map.proj_apply
.