-
Notifications
You must be signed in to change notification settings - Fork 193
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
Smallness #1867
Smallness #1867
Conversation
Signed-off-by: Ali Caglayan <[email protected]>
Here's an idea for how to organize things. Rename the folder PropResizing to Smallness or some more general name. Have Smallness/Core.v give just the most basic definitions, e.g. things that can go through with minimal dependencies (e.g. a subset of Basics.Overture Basics.Tactics Basics.Trunc, which are what PropResizing.v depends on). Change the contents of PropResizing to use What do you think, @Alizter? (I'm also hoping we can reduce the number of files in the theories folder, putting things in appropriate subfolders.) |
@jdchristensen That sounds sensible, I will try to do that. |
I had a go at turning IsLocallySmall into an inductive type but I am having trouble proving it is a hprop. I can get an inversion based proof to the end, but too many universes get introduced. I will hold off on that for now. |
(I won't repeat it all. See above.) A further expansion of this idea would be to have a top-level folder Other related files are Spaces/BAut.v and Spaces/BAut/*, as well as Modalities/ReflectiveSubuniverse.v. The latter should stay where it is, but I'm not sure about the BAut material. It might make sense to have it in Universes/ as well, so it is alongside ObjectClassifier.v. Or it could stay in Spaces/. Of course, Types/Universe.v is related, but would remain where it is. |
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
I've pushed some commits moving things around like you've suggested. I'll continue to work on Smallness when have the time. |
Thanks, I think this is good. I've updated STYLE.md to reflect the current situation, and also wrote it assuming that Smallness.v would be moved there. Should we do that now? |
Yes, I will move |
When you move the PropResizing stuff, can you update STYLE.md to stay in sync? |
BTW, one of my students will be using universes and propresizing a fair bit, so it might be nice to get at least part of this PR merged soon. |
@jdchristensen In that case, I'll see if I can make some progress with this. |
Maybe Spaces/Universe.v should move to Universes/Automorphisms.v, or something like that? It depends on BAut.v and BAut/Rigid.v, so this would suggest that maybe those should move to the new Universes/ folder. It might still make sense to leave the Spaces/BAut/ folder in the current location with the other files in contains, since those are about specific spaces? Or maybe everything should move to Universes/? |
Signed-off-by: Ali Caglayan <[email protected]>
I've pushed a commit using
I don't really know where to put these. Edit: For now I've put them in PropResizing. |
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
I'm still unsure about Alternatively, we just leave |
BAut/ really only contains three things: BAut Bool, BAut Cantor and a file about Rigid types. The file about Rigid types is general theory, while the other two are particular spaces. So I propose:
I also think we should rename Universes/Universe.v to Universes/Automorphisms.v. I think it was a good idea to move the things in PropResizing/ to MetaTheory. |
Coq is giving me some weird behaviour with the Require Import Basics.Overture.
Definition test@{i j|} `{PropResizing} (P : Type@{j}) `{IsHProp P} : Type@{i}.
Proof.
exact (smalltype@{i j} P).
Fail Defined.
(* Universe HoTT.PropResizing.ImpredicativeTruncation.1105 is unbound. *)
Restart.
pose (T := smalltype@{i j} P).
(* T := smalltype@{HoTT.PropResizing.ImpredicativeTruncation.1093
HoTT.PropResizing.ImpredicativeTruncation.1094} P *)
exact T.
Fail Defined.
(* Universe HoTT.PropResizing.ImpredicativeTruncation.1107 is unbound. *)
Restart.
pose (T := @smalltype@{i j} P (issmall_hprop@{i j} P _)).
(* T := smalltype@{i j} P : Type@{i} *)
exact T.
Defined. This is with 8.19.1. If I write |
@jdchristensen Does |
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
I get the same failures on 8.20. I'm not really sure why fresh universes are introduced. |
No, it doesn't.
Is this a bug in Coq? I'm trying to make a minimal version in vanilla Coq, but am having trouble. During typeclass search, Coq is failing to use hypotheses in the local context to resolve goals. |
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.
This LGTM. I'm puzzled by the universe issues in typeclass search, and so we should definitely figure them out, but I'm ok with merging this and leaving that as a separate task. There is also more to import from my Smallness.v file, but it depends on the join construction, which is part of another PR.
Could |
Yes, setting |
Signed-off-by: Ali Caglayan <[email protected]>
I've fixed the variance by putting a |
This reverts commit 18c6a48.
Actually, that broke some things, so I've reverted. Unfortunately, I am out of time today, but it is something to do with the variance. |
The default variance looks correct to me:
If However, I do see how this flexibility causes Coq to be unsure of what to do. When it is looking for an instance to prove (** Note: making [IsSmall] Cumulative makes the following two not necessary, but also means that Coq can't guess universe variables as well in other spots in the file. *) If we get rid of this flexibility, then we need to reintroduce the |
I'd lean towards removing the cumulativity. Since this is all about tracking universe levels, it's probably best to be explicit. And having typeclass inference work well will simplify many things. |
I'm making good progress and will push something soon. |
It turns out that I only ever needed cumulativity in the universe j, while it is the cumulativity in the universe i that caused Coq problems. So by marking i as invariant (=i), we end up with the best of both worlds: typeclass inference works well, and we don't need to do any manual lifting. This LGTM. |
I'd like to get this out to my students, so I'm going to merge. Feel free to make another PR if you spot any things that can still be improved. |
@jdchristensen This is the stuff from Smallness.v that doesn't rely on the join construction. When we finish the join construction, we can think about adding the other results in.
TODO:
islocally_small
orislocallysmall
? I think the latter.IsLocallySmall
be an inductive type? Experience fromIsTrunc
suggests that this might be a good idea. (Edit: Probably not)IsLocallySmall
andIsSmall
typeclasses?