Skip to content

Conversation

@jdchristensen
Copy link
Collaborator

The changes here make Coq-HoTT build with Rocq PR rocq-prover/rocq#21164

Each commit is independent, and in all but the last case, these are simplifications that are good to have anyways. (The last case is a minor change, so not a big deal.)

@ppedrot @tabareau

Comment on lines +31 to +33
(** Because [IsTrunc] is cumulative, we can use only one universe variable here. *)
#[export] Instance istrunc_truncation@{i} (n : trunc_index) (A : Type@{i})
: IsTrunc@{i} n (Trunc@{i} n A).
Copy link
Collaborator Author

@jdchristensen jdchristensen Oct 20, 2025

Choose a reason for hiding this comment

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

We decided to make IsTrunc (really, IsTrunc_internal) cumulative, but this extra flexibility makes it harder for Rocq to choose universe variables optimally. E.g. with the original version of istrunc_truncation, there is not a unique choice of j, since anything smaller than the desired j will work. With this change, there is no longer the flexibility to choose j, making it easier for Rocq, but then Rocq can fail to find a solution in other situations. It's a bit of a dilemma, and we might end up making different design decisions once we have algebraic universes.

@jdchristensen
Copy link
Collaborator Author

This would supercede #2317 . @tabareau, let me know if you think it looks good. @Alizter , do you want to give this a quick check?

@tabareau / @ppedrot: I'd be curious what the bench results are for Coq-HoTT with the Rocq PR.

@tabareau
Copy link

Looks good to me. If the change is backward compatible, maybe you can merge now so that we can easily run a bench for Rocq PR#21164 ?

@jdchristensen
Copy link
Collaborator Author

@tabareau I'll wait a few hours in case @Alizter has any comments, but will merge then if I haven't heard anything.

@Alizter
Copy link
Collaborator

Alizter commented Oct 21, 2025

I had a look this morning, no comments from me. LGTM

@jdchristensen jdchristensen merged commit cf42af7 into HoTT:master Oct 21, 2025
22 checks passed
@jdchristensen jdchristensen deleted the trunc-universes branch October 21, 2025 13:28
@tabareau
Copy link

tabareau commented Oct 22, 2025

@jdchristensen I have updated the Rocq PR rocq-prover/rocq#21164 to handle cumulative inductive type properly, so you can revert last commit HoTTBookExercises: make build with Rocq PR#21164

@jdchristensen
Copy link
Collaborator Author

@tabareau Thanks, I'll do that. Just out of curiosity, do you know if the other commits in this PR are still needed? I think they are fine to keep, but I wonder if cumulativity was also the issue in those places.

@ppedrot
Copy link
Contributor

ppedrot commented Oct 22, 2025

It's not clear to me that the last commit in #21164 is a good idea, for now I'd just wait for this PR to converge before partially reverting stuff or fixing it further.

@jdchristensen
Copy link
Collaborator Author

jdchristensen commented Oct 22, 2025

@tabareau @ppedrot Ok, I'll wait. I have already checked that with the current state of #21164 in Rocq, no changes at all are needed in Coq-HoTT for it to build (i.e. this PR can be fully reverted). So the last commit in #21164 fixes several independent glitches that occurred in Coq-HoTT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants