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] - feat(logic/basic, logic/function/basic): make cast the simp-normal form of eq.mp and eq.mpr, add lemmas #6834

Closed
wants to merge 8 commits into from

Conversation

eric-wieser
Copy link
Member

This adds the fact that eq.rec, eq.mp, eq.mpr, and cast are bijective, as well as some simp lemmas that follow from their injectivity.


Open in Gitpod

@eric-wieser
Copy link
Member Author

The failure is a bit odd; it's on this line:

exact ⟨j, rfl, j', g, (by simp)⟩,

And it gets stuck at the goal

⊢ _ = _ ∧ _ = _

@gebner
Copy link
Member

gebner commented Mar 23, 2021

Should the simp lemmas be restricted to Type*? For Prop, they're completely trivial.

Another option is to give them a lower priority, so that eq_self_iff_true can trigger first.

@gebner
Copy link
Member

gebner commented Mar 23, 2021

The failure is a bit odd; it's on this line:

by simp is really overkill here. heq.rfl also works.

@gebner
Copy link
Member

gebner commented Mar 23, 2021

Another idea here would be to make cast the simp-normal form. That is, add lemmas eq.mp h x = cast h x etc.

@eric-wieser
Copy link
Member Author

Good point about the lemmas being trivial for Prop. The simp normal form is a good idea too, but I have no idea what file that would go in. Should it go in core lean?

@gebner
Copy link
Member

gebner commented Mar 23, 2021

The simp normal form is a good idea too, but I have no idea what file that would go in. Should it go in core lean?

There is no reason to put it in core. I would put them into logic/basic or logic/function/basic.

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 24, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 24, 2021
@eric-wieser eric-wieser changed the title feat(logic/function/basic): add some lemmas to escape DTT pain feat(logic/basic, logic/function/basic): make cast the simp-normal form of eq.mp and eq.mpr, add lemmas Mar 24, 2021
@eric-wieser eric-wieser added the awaiting-review The author would like community review of the PR label Mar 24, 2021
Comment on lines +619 to +624
lemma eq_mp_bijective {α β : Sort*} (h : α = β) : function.bijective (eq.mp h) :=
eq_rec_on_bijective h

lemma eq_mpr_bijective {α β : Sort*} (h : α = β) : function.bijective (eq.mpr h) :=
eq_rec_on_bijective h.symm

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I just remove these, now that mp and mpr are rewritten into cast by simp?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't remove them. One can't be sure that simp will be able to reach every eq.mp.

@gebner
Copy link
Member

gebner commented Mar 25, 2021

bors r+

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Mar 25, 2021
bors bot pushed a commit that referenced this pull request Mar 25, 2021
…form of `eq.mp` and `eq.mpr`, add lemmas (#6834)

This adds the fact that `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` are bijective, as well as some simp lemmas that follow from their injectivity.
@bors
Copy link

bors bot commented Mar 25, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(logic/basic, logic/function/basic): make cast the simp-normal form of eq.mp and eq.mpr, add lemmas [Merged by Bors] - feat(logic/basic, logic/function/basic): make cast the simp-normal form of eq.mp and eq.mpr, add lemmas Mar 25, 2021
@bors bors bot closed this Mar 25, 2021
@bors bors bot deleted the eric-wieser/eq_rec_on_bijective branch March 25, 2021 14:46
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
…form of `eq.mp` and `eq.mpr`, add lemmas (#6834)

This adds the fact that `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` are bijective, as well as some simp lemmas that follow from their injectivity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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