-
Notifications
You must be signed in to change notification settings - Fork 200
Adapt to Coq#19611 #2127
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
Closed
Closed
Adapt to Coq#19611 #2127
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ah, I figured out what is special about these uses of strip_truncations. The goal is non-dependent, so Coq isn't able to guess which truncation to apply to the domain. If we replace them with
strip_reflections(addingRequire Import Modalities.ReflectiveSubuniverse.to the top of the file), then those three lines are the only changes that need making.Even better would be for
strip_truncationsto first tryTrunc_rec, the non-dependent eliminator. I'll see if I can do this, but it won't be right away. @Alizter , if you have a chance, feel free to take a look.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.
Hmm, no, that explanation is not correct. The same universe issue happens whether you use
Trunc_indorTrunc_rec, but things work out ok with eitherO_indorO_rec. Somehow the cumulativity of our truncations is causing Coq to generate a free universe variable. That kind of thing has happened to us here and there with other lemmas involving cumulative inductives, but I can't figure out why the update to Coq is causing it to happen just in this file when we usestrip_truncations, but not everywhere else that uses that tactic. E.g. Rings/Ideal.v uses it a lot, without issues.If any Coq developers have any insight into this, it would be very helpful.
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.
Is there a way in Ltac to find out the universe arguments in a term
t? E.g. something likeunify t identifier@{?u}that would instantiate a "universe evaru" that we could use later?Uh oh!
There was an error while loading. Please reload this page.
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.
For things like this you should use Ltac2's
Constr.Unsafe.kind: theConstant (constant, instance)constructor has the name of the constant and the universe instance. I'm not sure if there are useful operations on instances (cc @SkySkimmer ?), though, other than exact reuse? I guess you can define instance extension and whatnot in Gallina (Definition extend@{i j} : dummy@{i} -> dummy@{j})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 don't think using Unsafe would make the proof particularly cleaner.
Uh oh!
There was an error while loading. Please reload this page.
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 would like the
strip_truncationstactic to operate on a goal of the formTrunc@{u} X -> YusingTrunc_ind@{u _}. The way it works now, it seems to useTrunc_ind@{v _}(probably with a<=constraint onv), which is valid sinceTruncis cumulative, but which generates an unwanted universe variable. (In some cases, Coq later identifies this universe variable withu, but in Matrix.v, it seems to be leaving it free, which is causing problems.) So if some trick can be done in one place to makestrip_truncationswork this way, it would make proofs cleaner. Unfortunately, I don't understand @JasonGross 's comment well enough to try this.Alternatively, can a universe variable be passed into a tactic? E.g. could we have
strip_truncations@{i j}orstrip_truncations i jwhich tells it which universe variables to use?