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] - chore(linear_algebra): fix/add coe_fn simp lemmas #7015

Closed
wants to merge 1 commit into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Apr 3, 2021

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

Open in Gitpod

* 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`.
@urkud urkud added awaiting-review The author would like community review of the PR easy < 20s of review time. See the lifecycle page for guidelines. labels Apr 3, 2021

@[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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@[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

Copy link
Collaborator

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?

Copy link
Member

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.

Copy link
Collaborator

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

Copy link
Member Author

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.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

Bors d+

@bors
Copy link

bors bot commented Apr 3, 2021

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

@bryangingechen bryangingechen 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 Apr 3, 2021
@urkud
Copy link
Member Author

urkud commented Apr 3, 2021

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 Apr 3, 2021
bors bot pushed a commit that referenced this pull request Apr 3, 2021
* 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`.
@bors
Copy link

bors bot commented Apr 3, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(linear_algebra): fix/add coe_fn simp lemmas [Merged by Bors] - chore(linear_algebra): fix/add coe_fn simp lemmas Apr 3, 2021
@bors bors bot closed this Apr 3, 2021
@bors bors bot deleted the coe-simp branch April 3, 2021 19:27
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. easy < 20s of review time. See the lifecycle page for guidelines. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants