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

Fundamental theorem of identity types #614

Merged
merged 3 commits into from
Nov 11, 2021

Conversation

felixwellen
Copy link
Collaborator

A basic characterization of the identity type. This can be used to compute identity types.

@mortberg
Copy link
Collaborator

mortberg commented Nov 1, 2021

Nice! I seem to recall that Egbert used this theorem to derive Omega(S1) = Z. Would such a proof be substantially different in any way or is it just a refactoring?

@felixwellen
Copy link
Collaborator Author

felixwellen commented Nov 1, 2021

I guess there will be no substantial difference. The theorem is also not so far from encode-decode, but I haven't thought about the exact relation (to which version...) for some time. For me, the fundamental theorem is just easier to remember/think about because it looks more like a universal property.

@mortberg
Copy link
Collaborator

mortberg commented Nov 1, 2021

I guess there will be no substantial difference. The theorem is also not so far from encode-decode, but I haven't thought about the exact relation (to which version...) for some time. For me, the fundamental theorem is just easier to remember/think about because it looks more like a universal property.

Right, I guess what I'm really asking is exactly how it relates to encode-decode.

@felixwellen
Copy link
Collaborator Author

Ok, let's say we fix x:A then code(y) should certainly be Eq(x,y). The map
encode : (y:A) -> x=y -> code(y)
should be given by
encode(relf) := reflEq x : code(x)=Eq(x,x)
(assuming with have this ingredient of the fundamental theorem).
And decode : (y : A) -> code(y) -> x = y we can define by projecting from the contractibilty proof for Sigma(y:A) Eq(x,y) (the second ingredient of the theorem).
Now, if you unpack the contractability of Sigma(y:A) Eq(x,y), that means

  • there is a center, but that's just given by relfEq x
  • any other thing in the sigma-type is equal to that, which can be rewritten as:
    transport in Eq(x,_) (along some p:x==y) (some q : Eq(x,y)) == (x,reflEq x)
    So p is decode y q and then (without thinking through all details) this looks like Lemma 8.9.1 in the HoTT-Book.

isEquivFromIsContr : {A : Type ℓ} {B : Type ℓ′}
→ (f : A → B) → isContr A → isContr B
→ isEquiv f
isEquivFromIsContr f isContrA isContrB =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, can't one prove that this is an equivalence directly? I feel like it might be easier, but I might be wrong in which case this proof is fine...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made a direct proof. It avoids isoToEquiv, but it doesn't look better. But that might be due to me avoiding cubical primitives...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note there is also a isContr→Equiv in Foundations.Equiv.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but I thought that might be a bit awkward to use to show, that some particular function is an equivalence.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I guess my proof would look nicer, if I use that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, it does look better.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that looks good!

@mortberg
Copy link
Collaborator

Ok, let's say we fix x:A then code(y) should certainly be Eq(x,y). The map encode : (y:A) -> x=y -> code(y) should be given by encode(relf) := reflEq x : code(x)=Eq(x,x) (assuming with have this ingredient of the fundamental theorem). And decode : (y : A) -> code(y) -> x = y we can define by projecting from the contractibilty proof for Sigma(y:A) Eq(x,y) (the second ingredient of the theorem). Now, if you unpack the contractability of Sigma(y:A) Eq(x,y), that means

* there is a center, but that's just given by `relfEq x`

* any other thing in the sigma-type is equal to that, which can be rewritten as:
  `transport in Eq(x,_) (along some p:x==y) (some q : Eq(x,y)) == (x,reflEq x)`
  So `p` is `decode y q` and then (without thinking through all details) this looks like Lemma 8.9.1 in the HoTT-Book.

Thanks! This was helpful :-)

I would be happy to merge this once the question about this one proof has been answered

@mortberg mortberg merged commit b1d105a into agda:master Nov 11, 2021
@felixwellen felixwellen deleted the fundamental-theorem branch December 20, 2021 11:01
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.

3 participants