-
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
Trick to make Is1Cat definitionally involutive #1934
Conversation
Hmm, this might not work like it is, since we probably use in some places that |
I guess you are right that this would only apply for (2,1)-cats. We could simply add some extra coherence stating that cat_assoc_opp is left and right inverse to cat_assoc. That way cat_assoc would be a natural equivalence in another way. |
I just pushed four commits. The first one moves this trick from the tests/ folder and makes it our real definition of Second commit: I also found a way to make Third: Fourth: speed up a few things. Now the speed is unchanged within the noise. Note: I didn't need to use anywhere that the two proofs of associativity are inverse to each other. Question: Is the mild increase in complexity worth it? I'm inclined to think so. Question: Can other things simplify now that |
Yes, I agree. This isn't the only structure we have in the library with "redundant" data. I believe bundled equivalences and groups also fall into this category. I think the gain of a definitionally involutive op will be well worth it.
I would check the binary coproduct functoriality proofs. IIUC these should follow definitionally now. |
They use |
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.
Nice! I had a look at coproducts but didn't spot any obvious simplifications.
I was curious how close
is1cat_op
is to being definitionally involutive, and it turns out that the only thing that fails is associativity, because it requires usinggpd_rev
on the hom types.We could consider making a variant of
Is1Cat
without associativity and using that where possible, to avoid duplicating dual proofs. But it would add one more layer in the WildCat hierarchy, so I don't think it's a great idea.Instead, the second commit shows a trick that makes this work. It changes
Is1Cat
to have two associativity proofs, one for each direction, withis1cat_op'
just switching the two. We could defineBuild_Is1Cat
to only take one, and prove the other usinggpd_rev
, so almost no code would need to change. (And we already definecat_assoc_opp
, so this is really no different from what we've got, except that it gets moved into the data ofIs1Cat
.)In this PR, this is all done in test/WildCat/Opposite.v, but if it looks like a reasonable change, then I could make it to the main code. Then several other places with dual proofs would simplify.