-
Notifications
You must be signed in to change notification settings - Fork 47
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
fix missing type-level equivalence in contra #1183
Conversation
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.
Could the commit / PR titles and descriptions be more precise? It reads "fix contra" but then it seems to be mostly adding a type level equivalence, so I'm a bit lost.
classical/contra.v
Outdated
Definition equivT_LR {S T} '(EquivT S_T _) : S -> T := S_T. | ||
Definition equivT_RL {S T} '(EquivT _ T_S) : T -> S := T_S. |
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 usual style in mathcomp rather seems to be something like
Definition equivT_LR {S T} '(EquivT S_T _) : S -> T := S_T. | |
Definition equivT_RL {S T} '(EquivT _ T_S) : T -> S := T_S. | |
Definition equivT_LR {S T} (eq : equivT S T) : S -> T := let: EquivT S_T _ := eq in S_T. | |
Definition equivT_RL {S T} (eq : equivT S T) : T -> S := let: EquivT _ T_S := eq in T_S. |
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.
Should I also change l.75?
classical/contra.v
Outdated
(******************************************************************************) | ||
|
||
Variant equivT S T := EquivT of S -> T & T -> S. | ||
Notation "S <--> T" := (equivT S T) (at level 95, no associativity). |
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.
Since this notation is used only on the three lines below (it is not exported), I'd rather remove it to avoid modifying the parser just for that.
the following line |
I think I remember asking [at]ggonthier, who said that the issues have not been fixed yet. |
I changed the PR title and description, I will do the commit messages when I squash. IS that better? |
Not really, this still doesn't tell what this type level equivalence is useful for, what problem it fixes (why it was "missing in the inference algorithm", could you give an example) and why it is defined here. |
It was part of the code from [at]ggonthier I ported to define the |
Ok, thanks for the explanation! It would probably have made more sense to put it in #1173 then, but let's merge. |
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.
We merge it because otherwise contra
will not work as expected but we'll issue about the lack of examples in the doc.
Motivation for this change
The type-level equivalence was missing from the inference algorithm for contra.
Checklist
CHANGELOG_UNRELEASED.md
Reference: How to document
Reminder to reviewers