Skip to content
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

🌌 Make the Universe Strict #367

Closed
wants to merge 3 commits into from
Closed

🌌 Make the Universe Strict #367

wants to merge 3 commits into from

Conversation

mmcqd
Copy link
Collaborator

@mmcqd mmcqd commented Apr 30, 2022

This PR does away with ElIn and ElOut, and makes ElStable code definitionally equal to unfold_el code, and closes #189.

I initially tried removing ElStable entirely, but found that this solution was the simplest, as there are several places where we rely on something being a code.

The main complication this introduces is that pattern matching on a type requires also matching on its code, because they're now equal. The only place we don't have to do this is when matching on the goal in a tactic, because we have still have intro_implicit_connectives and elim_implicit_connectives, which now unfold an ElStable but do not add ElIn or ElOut. Perhaps ElStable should no longer be an "implicit connective" and we should instead be pattern matching on codes in tactics as a matter of consistency?

Having multiple representations of definitionally equal types in the core theory initially felt awkward to me, but @TOTBWF pointed out to me that this is sort of like an eta law for the universe. The main difference is that we're not usually pattern matching on "a variable at function type or a lambda" but we match on types pretty regularly.

This is a non-trivial change to cooltt, so please let me know if this implementation is a Bad Idea and needs to be reworked.

@jonsterling
Copy link
Collaborator

Thanks for this work, and I'm very sorry that your code has not received an official review after all this time!

I am thinking about the definitional equality issue you mentioned... Let me ponder it a little bit.

Copy link
Collaborator

@jonsterling jonsterling left a comment

Choose a reason for hiding this comment

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

My concern about making ElStable definitionally equal to its unfolding is exactly the thing you point out --- in parts of the implementation, we rely on something being a code. Unfortunately, it is not reasonable for these parts of the code to not be stable under definitional equivalence. To put it another way, an important invariant of an implementation of type theory is that if you replace equals by equals, things continue to work --- but this change will violate that.

Thus I think that something a bit more elaborate will be required in order to maintain the necessary invariants.

@jonsterling
Copy link
Collaborator

Let me continue reviewing this actually, I misunderstood some of it.

@jonsterling jonsterling closed this Jul 3, 2022
@jonsterling
Copy link
Collaborator

Closing, as we have discussed some new design.

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.

Consider returning to strict universes
2 participants