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

Simplify Embedding-into-hLevel→hLevel #1107

Merged

Conversation

MatthiasHu
Copy link
Contributor

This small PR simplifies the proofs of Embedding-into-hLevel→hLevel and the two special cases for isProp and isSet.

Embedding-into-hLevel→hLevel was unnecessarily defined by case distinction. The reason is probably the definition of isOfHLevel by three instead of two cases:

isOfHLevel : HLevel Type ℓ Type ℓ
isOfHLevel 0 A = isContr A
isOfHLevel 1 A = isProp A
isOfHLevel (suc (suc n)) A = (x y : A) isOfHLevel (suc n) (x ≡ y)

I assume there are good reasons for this definition of isOfHLevel, but I suppose it was not intended to spark unnecessary case distinctions in places like Embedding-into-hLevel→hLevel.

@mortberg
Copy link
Collaborator

I have no clue why this was so complicated and I like the new simpler version. Maybe @aljungstrom knows more? (It could have had something to do with attempts to optimize things...)

@felixwellen
Copy link
Collaborator

Does not take longer than usual to type check on my machine. So there can't be any dramatic efficiency difference.

@felixwellen
Copy link
Collaborator

Ahno, now I get it. You did not change the definition of isOfHLevel.

@felixwellen
Copy link
Collaborator

I would guess that is just about having definitional equalities between isOfHLevel 0 and isContr and isOfHLevel 1 and isProp, where isContr and isProp are defined like in the HoTT-Book. isSet then also fits in definitionally.

@MatthiasHu
Copy link
Contributor Author

You did not change the definition of isOfHLevel.

Correct.

The three-cases definition of isOfHLevel was introduced and discussed here: #68

@felixwellen felixwellen merged commit 7549445 into agda:master May 13, 2024
1 check passed
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.

None yet

3 participants