## March 24, 2011

### Homotopy Type Theory, III

#### Posted by Mike Shulman

It’s a dangerous business making promises about what will happen “next time” when I don’t have “next time” written yet. I said last time that I intended to talk about the univalence axiom next, but then I realized there is more I want to say about equivalences first, and perhaps functional extensionality.

But before I get into that, I’d like to mention that Steve Awodey has written a very nice post about intensional type theory and its relation to homotopy type theory from an intensional type theorists’ point of view; read it at the HoTT blog!

Now, recall that the proposition (that is, the (-1)-type) “$f:X\to Y$ is an equivalence” was defined as

$\mathrm{IsEquiv}\left(f\right)≔{\Pi }_{y\in Y}\mathrm{IsContr}\left(\mathrm{Fiber}\left(f,y\right)\right)$

where $\mathrm{Fiber}\left(f,y\right)≔{\Sigma }_{x\in X}{\mathrm{Paths}}_{Y}\left(f\left(x\right),y\right)$. I claimed that this is equivalent to the following type (which I didn’t write down in gory detail before):

$\mathrm{IsAdjointEquiv}\left(f\right)≔{\Sigma }_{g:Y\to X}{\Sigma }_{p\in {\Pi }_{x\in X}{\mathrm{Paths}}_{X}\left(g\left(f\left(x\right)\right),x\right)}{\Sigma }_{q\in {\Pi }_{y\in Y}{\mathrm{Paths}}_{Y}\left(f\left(g\left(y\right)\right),y\right)}{\Pi }_{x\in X}{\mathrm{Paths}}_{{\mathrm{Paths}}_{Y}\left(f\left(g\left(f\left(x\right)\right)\right),f\left(x\right)\right)}\left(f\left(p\left(x\right)\right),q\left(f\left(x\right)\right)\right).$

Ugh! If you unravel this, it means that a point of $\mathrm{IsAdjointEquiv}\left(f\right)$ consists of:

1. a map $g:Y\to X$,
2. a “homotopy” $p:g\circ f\simeq {1}_{X}$,
3. a “homotopy” $q:f\circ g\simeq {1}_{Y}$, and
4. a “higher homotopy” $t:f\left(p\right)\simeq {q}_{f}$.

If all of our types were 1-types, i.e. groupoids, then this would be exactly an adjoint equivalence of groupoids: the two homotopies $p$ and $q$ are the unit and counit, and the higher homotopy asserts one triangle identity. The other triangle identity then follows; see the nLab page.

I didn’t really say anything about why these types should be equivalent, though. Suppose that we have a point of $\mathrm{IsEquiv}\left(f\right)$. This consists of, for every $y\in Y$, a point of $\mathrm{IsContr}\left(\mathrm{Fiber}\left(f,y\right)\right)$. The latter consists of a point of $\mathrm{Fiber}\left(f,y\right)$ together with a contraction to that point. Now a point of $\mathrm{Fiber}\left(f,y\right)$ consists of a point of $X$ along with a path from $f$ of that point to $y$. Call this point $g\left(y\right)$ and the path ${q}_{y}\in {\mathrm{Paths}}_{Y}\left(f\left(g\left(y\right)\right),y\right)$. In this way we extract our map $g$ and homotopy $q$.

What remains in the data is the contraction of $\mathrm{Fiber}\left(f,y\right)$ to $\left(g\left(y\right),{q}_{y}\right)$. This consists of, for every point $\left(x,r:f\left(x\right)\simeq y\right)$ of $\mathrm{Fiber}\left(f,y\right)$, a path from $\left(x,r\right)$ to $\left(g\left(y\right),{q}_{y}\right)$. Now $\mathrm{Fiber}\left(f,y\right)$ is the total space of a “fibration” (i.e. dependent type) over $X$, whose fiber over $x\in X$ is ${\mathrm{Paths}}_{Y}\left(f\left(x\right),y\right)$—and so a path $\left(x,r\right)\simeq \left(g\left(y\right),{q}_{y}\right)$ in $\mathrm{Fiber}\left(f,y\right)$ is determined by a path $a:x\simeq g\left(y\right)$ in the base space $X$, together with a path $b$ in the fiber ${\mathrm{Paths}}_{Y}\left(f\left(g\left(y\right)\right),y\right)$ from ${a}_{*}\left(r\right)$ to ${q}_{y}$, where ${a}_{*}$ denotes fiber transport along the path $a$. But fiber transport in the fibration of paths is just composition of paths, so the latter is a homotopy from $r\circ f\left({a}^{-1}\right)$ to ${q}_{y}$.

Now consider, for any $x\in X$, the point $\left(x,{1}_{f\left(x\right)}\right)\in \mathrm{Fiber}\left(f,f\left(x\right)\right)$. Then the path $a$ above can be called ${p}_{x}^{-1}:x\simeq g\left(f\left(x\right)\right)$, and $b$ goes from ${1}_{f\left(x\right)}\circ f\left({p}_{x}\right)\simeq f\left({p}_{x}\right)$ to ${q}_{f\left(x\right)}$. So we obtain exactly the data of a point of $\mathrm{IsAdjointEquiv}\left(f\right)$.

Conversely, the data of $g$ and $q$ in a point of $\mathrm{IsAdjointEquiv}\left(f\right)$ is exactly what we need to specify, for every $y\in Y$, a point of $\mathrm{Fiber}\left(f,y\right)$ (which is to say, a point of ${\Pi }_{y\in Y}\mathrm{Fiber}\left(f,y\right)$). For the rest, given any $\left(x,r\right)$ in $\mathrm{Fiber}\left(f,y\right)$, we can take $a$ to be $g\left(r\right)\circ {p}_{x}^{-1}$, and the remaining homotopy to be

$r\circ f\left({p}_{x}\circ g\left({r}^{-1}\right)\right)\simeq r\circ f\left({p}_{x}\right)\circ f\left(g\left({r}^{-1}\right)\right)\stackrel{t}{\simeq }r\circ {q}_{f\left(x\right)}\circ f\left(g\left({r}^{-1}\right)\right)\simeq {q}_{y}\circ f\left(g\left(r\right)\right)\circ f\left(g\left({r}^{-1}\right)\right)\simeq {q}_{y}.$

This gives us maps in both directions between $\mathrm{IsEquiv}\left(f\right)$ and $\mathrm{IsAdjointEquiv}\left(f\right)$. (Note that because all the above manipulations are completely formulaic, they formalize directly into type-theoretic constructions. I’m sure of this, because I’ve coded both of these maps in Coq, using Andrej Bauer’s convenient “tactics”—maybe I’ll get around to talking about Coq in a later post. In particular, operations such as composing and inverting paths, and acting on them by functions, are easily definable in terms of the rules for identity types that I mentioned in the first post.)

Thus, if either of the two types above is inhabited, so is the other. Ideally, we’d like them to actually be equivalent. Since $\mathrm{IsEquiv}\left(f\right)$ is a (-1)-type, if $\mathrm{IsAdjointEquiv}\left(f\right)$ were also a (-1)-type, having morphisms in both directions would be enough for them to be equivalent. Or we could also try to enrich the above two maps into an (adjoint) equivalence, which would then imply that $\mathrm{IsAdjointEquiv}\left(f\right)$ is a (-1)-type. I haven’t managed to get either of these approaches to work in Coq yet, but I believe that it should be true. (We will need to use functional extensionality, since the points of these two types contain functions.)

Now recall also that I disparaged the naive notion of “homotopy equivalence” which lacks the higher homotopy $t$, as not giving rise to a (-1)-type. If written out explicitly, this type would be

$\mathrm{IncoherentEquiv}\left(f\right)≔{\Sigma }_{g:Y\to X}\phantom{\rule{thickmathspace}{0ex}}\left({\Pi }_{x\in X}{\mathrm{Paths}}_{X}\left(g\left(f\left(x\right)\right),x\right)\right)\phantom{\rule{thickmathspace}{0ex}}×\phantom{\rule{thickmathspace}{0ex}}\left({\Pi }_{y\in Y}{\mathrm{Paths}}_{Y}\left(f\left(g\left(y\right)\right),y\right)\right)$

However, perhaps I didn’t emphasize enough that as soon as $f:X\to Y$ admits some choice of “homotopy equivalence data” (i.e. $\mathrm{IncoherentEquiv}\left(f\right)$ is inhabited) then $f$ is necessarily an equivalence in either of the above “coherent senses.” In fact, we can construct a map $\mathrm{IncoherentEquiv}\left(f\right)\to \mathrm{IsAdjointEquiv}\left(f\right)$ by copying the usual 2-categorical proof that any non-adjoint equivalence can be improved to an adjoint equivalence (by changing one of the natural isomorphisms). See the nLab page for a string diagram proof. Of course, in practice, this is often a convenient way to prove that a given map is an equivalence.

I also neglected to mention that Voevodsky currently refers to these equivalence as weak equivalences. I don’t, because as you can see there is nothing “weak” about them. Usually “weak” is prefixed to maps that we want to think of as equivalences, but which don’t necessarily admit inverses (even up to homotopy). But these equivalences do have homotopy inverses. (The term “h-isomorphism” was also proposed at Oberwolfach, but I prefer simply “equivalence.”)

One might ask, though, is there a notion of weak equivalence in homotopy type theory? In classical homotopy theory, we define a “weak homotopy equivalence” to be one inducing an isomorphism on all homotopy groups. Can we define homotopy groups in homotopy type theory?

We definitely have a notion of “based loop space” (or rather “based loop type”), namely

${\Omega }_{x}X≔{\mathrm{Paths}}_{X}\left(x,x\right).$

So if we had an operation “${\pi }_{0}$” or “${\tau }_{\le 0}$” which reflects types into sets (i.e. 0-types), then we could define a set ${\pi }_{n}\left(X,x\right)≔{\pi }_{0}\left({\Omega }_{x}^{n}X\right)$ for any type $X$. (This is the internal-language version of categorical homotopy groups in an $\left(\infty ,1\right)$-topos.) And of course, when restricted to sets, the above notion of equivalence for types can be regarded as the familiar notion of isomorphism (= bijection). So we could define a “weak equivalence” to be a map inducing an isomorphism on ${\pi }_{n}$, for all $n$ and all basepoints.

The quantifier “for all basepoints” means that ${\pi }_{n}$ should really be not just a single set, but a set indexed by $X$. And the quantifer “for all $n$” here could be either in the metatheory or in the theory itself. But the more important point is that we shouldn’t expect to prove in homotopy type theory that every weak equivalence, in this sense, is an actual equivalence. In other words, “Whitehead’s theorem” should not be provable.

In fact, the fragment of the theory that I’ve described so far has a model in topological spaces—arbitrary topological spaces, not necessarily even of the homotopy type of CW complexes. (Probably; see this comment.) If this model has a ${\pi }_{0}$, then Whitehead’s theorem will probably fail as usual for spaces that aren’t of the homotopy type of a CW complex. This model might lead you to think that the failure of Whitehead’s theorem is a bad thing: the $\left(\infty ,1\right)$-category of all topological spaces is a pretty weird beast by $\left(\infty ,1\right)$-categorical standards, although it contains as a full sub-$\left(\infty ,1\right)$-category the prototypical $\left(\infty ,1\right)$-category of $\infty$-groupoids (modeled by CW complexes).

But actually, there are also important, interesting, and otherwise well-behaved “homotopy theories” in which Whitehead’s theorem fails. I’m thinking of non-hypercomplete $\left(\infty ,1\right)$-topoi, and this isn’t really the time to talk more about them, except to say that they include many $\left(\infty ,1\right)$-topoi of interest, including (in general) $\infty$-sheaves on topological spaces. Moreover, as $\left(\infty ,1\right)$-topoi, they have all the other good properties we might ask of an $\left(\infty ,1\right)$-category.

It took me a little while to come to terms with this. Now I think we can think of Whitehead’s theorem as a “classicality” axiom which can fail in $\left(\infty ,1\right)$-topoi, akin to the law of excluded middle and the axiom of choice (which can already fail in 1-topoi). It’s curious in that we don’t notice it until we go all the way to $\infty$. But once I got over being sad about losing Whitehead’s theorem, I got excited that the $\infty$-categorical world has displayed to us this new structure, which was totally invisible to the $n$-categorical world for all finite $n$.

Put another way, Whitehead’s theorem should be regarded as a foundational axiom of mathematics, but one which only a “natively homotopical” foundational system is subtle enough to perceive (and in particular, to allow to be violated). If we insist on building $\infty$-groupoids out of sets, then we will automatically be forced to accept Whitehead’s theorem; but if instead we define sets as particular $\infty$-groupoids, then we are allowed to explore a world where Whitehead’s theorem may fail.

Posted at March 24, 2011 10:44 PM UTC

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/2375

### Re: Homotopy Type Theory, III

another great posting full of things to think about and discuss! First, though, with respect to the definition of weak equivalence: without function extensionality (FE), there is of course a difference between $\Pi x:X\phantom{\rule{thinmathspace}{0ex}}{\mathrm{Id}}_{X}\left(g\left(f\left(x\right)\right),x\right)$ and ${\mathrm{Id}}_{{X}^{X}}\left(g\circ f,{1}_{X}\right)$. So although you used the former (weaker) notion in the writing out the type IsAdjointEquiv(f), in the “unravelled” explanation that follows you said “a “homotopy” $p:g\circ f\simeq {1}_{X}$” – which is maybe better formalized in the stronger way.

So, without FE there are indeed weak and strong notions of equivalence: roughly “pointwise equivalence”, and “intensional isomorphism”. Of course, Univalence collapses the difference.

Posted by: Steve Awodey on March 25, 2011 12:39 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

That’s why I put “homotopy” in quotes. (-:

I’m not too bothered about that difference except at a technical level, though, because it seems to me that homotopy type theory, regarded as an $\infty$-groupoidal foundation, doesn’t really work without FE. For instance, without FE, types like $\mathrm{IsContr}$ and $\mathrm{IsProp}$ and $\mathrm{IsEquiv}$ can’t even be shown to be (-1)-types.

In fact, here’s a question: in the absence of FE, is there any way to construct a path between two functions which aren’t definitionally equal? I mean, it might happen in some model that two unequal functions are connected by a path, but could we ever prove it to be so in type theory without knowing that the functions are definitionally equal? It seems to me like the answer should be no, from intuitive semantic considerations, but I could be way off.

But if that’s the case, then I think in the absence of FE it would be perfectly reasonable to say just “isomorphism” for the stronger notion, leaving just plain “equivalence” for the weaker one.

Posted by: Mike Shulman on March 25, 2011 2:48 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

In fact, here’s a question: in the absence of FE, is there any way to construct a path between two functions which aren’t definitionally equal?

The answer is yes, but not in many cases you’d probably care about. Here is an example:

data Nat : Set where
zero : Nat
suc  : Nat -> Nat

_+_ : Nat -> Nat -> Nat
zero  + n = n
suc m + n = suc (m + n)

data Path (A : Set) (x : A) : A -> Set where
refl : Path A x x

J : {A : Set} {x : A} (P : (y : A) -> Path A x y -> Set)
-> {y : A} -> (p : Path A x y) -> P x refl -> P y p
J P refl Pxr = Pxr

cong : {A B : Set} -> (f : A -> B) -> {x y : A}
-> Path A x y -> Path B (f x) (f y)
cong f p = J (\z _ -> Path _ (f _) (f z)) p refl

lemma : (n : Nat) -> Path Nat (n + zero) n
lemma zero    = refl
lemma (suc n) = cong suc (lemma n)

path : (n : Nat) -> Path (Nat -> Nat) (\_ -> n + zero) (\_ -> n)
{- path n = refl -- error -}
path n = cong (\n _ -> n) (lemma n)


so, const (n + 0) is propositionally but not definitionally equal to const n for all n by induction on n.

Of course, for any particular (closed term) n, definitional equality should hold, so this may or may not be what you want.

Posted by: Dan Doel on March 25, 2011 6:19 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Interesting, thanks! Is there any characterization of the sorts of functions for which one can do that? Can it ever happen for functions defined in the empty context?

Posted by: Mike Shulman on March 25, 2011 7:08 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

I believe all the functions for which you can do this are of the form f <v> : A -> B, where <v> is a sequence of terms. If we can have two sequences <v> and <v'> where at least one pair of terms is propositionally equal but not definitionally equal, then it may also be the case that f <v> is propositionally equal but not definitionally equal to f <v'>. This is of course because function application provably respects propositional equality.

As for when this can happen… Assuming the above is the only way to produce function terms that are propositionally but not definitionally equal, the situations reduce to those for non-function terms. And I think only open such terms can be propositionally but not definitionally equal in normal intuitionistic type theory. So no two functions (or terms in general) definable in the empty context satisfy the condition. It’s possible I’m overlooking something, though.

Posted by: Dan Doel on March 25, 2011 12:57 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

This is actually not quite true as you can prove things like

fun x => (x + 0) = fun x => x

In Coq. Though this may not be a counter-example to what you propose, as it can be “eta-expanded” to the form which you describe.

Posted by: cody on March 28, 2011 5:02 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

How? I’ve never been able to figure out how to prove that in Agda. As far as I know, it requires extensionality for functions.

Posted by: Dan Doel on March 29, 2011 2:22 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

You can’t prove it in Coq without axioms. (Coq’s plus recurs on the first argument, just like in Agda.)

Posted by: Neel Krishnaswami on March 29, 2011 8:56 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

That seems plausible, at least. Thanks!

Posted by: Mike Shulman on March 25, 2011 6:23 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Actually, I can defend my use of the word “homotopy” better than that. In abstract homotopy theory in a model category (or category with a WFS, or category of fibrant objects) we have two types of “homotopy”. Left homotopies are maps $\mathrm{Cyl}\left(X\right)\to Y$ out of a cylinder object; right homotopies are maps $X\to \mathrm{Path}\left(Y\right)$ into a path object. If the cylinder and path object are given by multiplying and exponentiating with an interval object, $\mathrm{Cyl}\left(X\right)=X×I$ and $\mathrm{Path}\left(Y\right)={Y}^{I}$, then the two types of homotopies agree, and can also be identified with maps $I\to {Y}^{X}$ (paths between functions) if ${Y}^{X}$ exists.

In homotopy type theory, we don’t have an interval object or a cylinder object (at least, not without additional axioms), but the identity types do give us a path object. So it makes sense to say that a “homotopy” between maps $f,g:X⇉Y$ is a map $X\to \mathrm{Path}\left(Y\right)$ over $\left(f,g\right)$, which is to say a point of ${\Pi }_{x\in X}{\mathrm{Paths}}_{Y}\left(f\left(x\right),g\left(y\right)\right)$.

Posted by: Mike Shulman on March 25, 2011 6:44 AM | Permalink | PGP Sig | Reply to this

### Re: Homotopy Type Theory, III

I agree: $\mathrm{Path}\left(Y\right)={\mathrm{Id}}_{Y}$ classifies homotopies into $Y$. So without FE homotopy equivalence is a weaker notion than (propositional) isomorphism. Definitional isomorphism is even stronger, rarely occurs, and is less interesting. Univalence collapses homotopy equivalence and propositional isomorphism – which is a good thing.

Posted by: Steve Awodey on March 25, 2011 2:05 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Okay, so in pure intensional type theory I guess we actually have five notions of “sameness” for types:

• Definitional equality: $A=B$.
• Propositional equality: a path $p\in {\mathrm{Paths}}_{\mathrm{Type}}\left(A,B\right)$.
• Definitional isomorphism: A function $f:A\to B$ so that there exists $g:B\to A$ such that $gf={1}_{A}$ and $fg={1}_{B}$ definitionally.
• Propositional isomorphism: a function $f:A\to B$ so that there exists $g:B\to A$ with paths (or equality proofs) $p\in {\mathrm{Paths}}_{A\to A}\left(gf,{1}_{A}\right)$ and $q\in {\mathrm{Paths}}_{B\to B}\left(fg,{1}_{B}\right)$.
• Homotopy equivalence: a function $f:A\to B$ so that there exists $g:B\to A$ with homotopies $p\in {\Pi }_{x\in A}{\mathrm{Paths}}_{A}\left(g\left(f\left(x\right)\right),x\right)$ and $q\in {\Pi }_{y\in B}{\mathrm{Paths}}_{B}\left(f\left(g\left(y\right)\right),y\right)$.

We have implications

$\begin{array}{ccc}& & \mathrm{Prop}\mathrm{eq}\\ & ↗& & ↘\\ \mathrm{Def}\mathrm{eq}& & & & \mathrm{Prop}\mathrm{iso}& \to & \mathrm{Htpy}\mathrm{equiv}\\ & ↘& & ↗\\ & & \mathrm{Def}\mathrm{iso}\end{array}$

And

• UIP collapses definitional and propositional isomorphism, and definitional and propositional equality,
• Functional extensionality collapses propositional isomorphism and homotopy equivalence, and
• Univalence collapses homotopy equivalence, propositional isomorphism, and propositional equality.
Posted by: Mike Shulman on March 25, 2011 7:56 PM | Permalink | PGP Sig | Reply to this

### Re: Homotopy Type Theory, III

UIP collapses definitional and propositional isomorphism, and definitional and propositional equality

This doesn’t sound right. My example was Agda, which has K, but it there’s no way, to my knowledge, to use that to make $\mathrm{const}\phantom{\rule{thickmathspace}{0ex}}n$ and $\mathrm{const}\phantom{\rule{thickmathspace}{0ex}}\left(n+0\right)$ definitionallty equal.

Extensional type theory is, I think, defined by the collapsing of definitional and propositional equality (by adding an inference rule from propositional equality of two values to definitional equality thereof).

Posted by: Dan Doel on March 26, 2011 2:11 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

I guess I can never get this terminology right! I thought back here you told me I should say “UIP” instead of “extensional type theory”; now you seem to be saying the opposite. I must be confused.

Posted by: Mike Shulman on March 26, 2011 2:18 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

I think I said that I thought “unique identity proofs” was preferable to “extensional identity types.”

If we think merely about collapsing definitional and propositional equality with a rule like:

$\frac{p:{\mathrm{Id}}_{A}xy}{x=y:A}$

Then it isn’t obvious to me that we have, on this basis alone:

$\frac{{\mathrm{id}}_{1},{\mathrm{id}}_{2}:{\mathrm{Id}}_{A}xy}{{\mathrm{id}}_{1}={\mathrm{id}}_{2}:{\mathrm{Id}}_{A}xy}$

or similar.

So, I don’t think collapsing definitional/judgmental equality and propositional equality the way extensional type theory does necessitates identity proofs being unique. Many extensional type theories probably do take UIP as an additional axiom, but it is not necessary to the first rule above.

The collapse above is already enough to make type checking undecidable, too, I believe, because deciding $T\left({v}_{1}\right)=T\left({v}_{2}\right)$ requires deciding whether ${v}_{1}$ is provably equal to ${v}_{2}$ by induction, which doesn’t sound possible to me. And that’s before adding function extensionality.

Now, Agda (and OTT, I think) has unique identity proofs, but only up to propositional equality. It is equivalent to having an extra eliminator for equality:

K : (A : Type) (x : A) (P : Id A x x -> Type) (id : Id A x x) -> P refl -> P id
K A x P refl e = e


Which corresponds to adding an extra elimination and compute rule to regular intuitionistic type theory. But, this doesn’t mean that identity proofs become definitionally equal, just like squashing propositional and definitional equality together doesn’t imply that identity proofs are unique (although I’m more sure about the former).

(And the above is all you need for unrestricted dependent pattern matching. The desugaring uses K, not any definitional equality of identity proofs. Also, it’s at least a little surprising that this isn’t built-in. Id A x y is often looked at as being defined by induction, with the one constructor being refl : Id A x x. So it seems obvious that K is warranted as an induction principle of Id A x x, but it’s not derivable from J, and of course, this whole series is about models of type theory where K is wrong.)

And of course, my position in the first sentence of this post was based on the idea that “extensional identity type” suggested to me a propositional equality for which “propositional isomorphism” and “homotopy equivalence” were collapsed.

Does that clear things up?

Posted by: Dan Doel on March 26, 2011 3:52 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

extensional type theory includes both of the following rules:

$p:\mathrm{Id}\left(a,b\right)⇒a=b$ $p:\mathrm{Id}\left(a,b\right)⇒p=r\left(a\right)$

so in particular UIP follows.

Posted by: steve Awodey on March 26, 2011 1:41 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

in fact, if you’re talking about *adding* rules to the usual ones, then (as Peter Lumsdaine pointed out to me),

$p:\mathrm{Id}\left(a,b\right)⇒a=b$

implies

$p:\mathrm{Id}\left(a,b\right)⇒p=r\left(a\right)$

using $\mathrm{Id}$-Elim. So in particular, UIP follows.

Posted by: steve Awodey on March 27, 2011 4:13 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Okay. I guess I see how that’d work. Since Id A x y leads to x = y,

P z p := Id (Id A x x) p refl


is a well defined predicate for z : A and p : Id A x z, and so J gets us p = refl (after lifting) on the conditions that p : Id A x y and refl : Id (Id A x x) refl refl, the second of which is trivial.

I’ll cop to not knowing a lot about extensional type theory. So, squashing definitional and propositional equality together implies uniqueness of identity proofs, but the converse isn’t true. At least, inasmuch as Agda has unique identity proofs, which is propositionally, but not definitionally.

Posted by: Dan Doel on March 27, 2011 5:38 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

I guess there is not universal agreement on what “extensional type theory” means. (-: I would prefer it to mean what Steve said.

Posted by: Mike Shulman on March 27, 2011 4:00 AM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Since you’re comparing isEquiv and isAdjointEquiv here, I hope you won’t mind my plugging a third alternative, which André Joyal suggested in Oberwolfach.  This was what he called “homotopy isomorphism” (I rather like that term), but for now let’s call it being a “two-sided equivalence”, isTwoSidedEquiv.

A left homotopy inverse for $f:X\to Y$ is a function $g:Y\to X$, together with a homotopy $g\cdot f⇝1$, i.e. a function giving for each $x:X$ a path $g\left(f\left(x\right)\right)⇝x$.  A right homotopy inverse is defined analogously.

A two-sided equivalence structure on $f$ is just a choice of a left homotopy inverse, and of a right.

In gory syntax: for $f:X\to Y$,

$\text{RightHInv}\left(f\right)≔{\Sigma }_{g:Y\to X}{\forall }_{y:Y}{\text{Paths}}_{X}\left(x,\mathrm{gfx}\right).$ $\text{LeftHInv}\left(f\right)≔{\Sigma }_{h:Y\to X}{\forall }_{x:X}{\text{Paths}}_{X}\left(\mathrm{fhx},x\right).$ $\text{isTwoSidedEquiv}\left(f\right)≔\text{LeftInv}\left(f\right)×\text{RightInv}\left(f\right).$

So it’s quite like the naïve type-theoretic definition of “isomorphism”, which would ask for a two-sided inverse, except this allows separate choices of left and right inverse; and that extra freedom makes it a proposition! (Just as the addition of a single triangle inequality does for isAdjointEquiv.)

I’ve often found this version a little nicer to work directly with than the others, since it doesn’t require any two-dimensional reasoning.

Posted by: Peter LeFanu Lumsdaine on March 25, 2011 9:07 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

O crikey, in trying to space my syntax nicely I’ve done something horrible to the TeX — at least, my three browsers all choke on it — and, in fact, also bungled my lefts and rights a bit. Take two:

$\text{LeftHInv}\left(f\right):={\Sigma }_{g:Y\to X}{\forall }_{x:X}{\text{Paths}}_{X}\left(\mathrm{gfx},x\right).$ $\text{RightHInv}\left(f\right):={\Sigma }_{h:Y\to X}{\forall }_{y:Y}{\text{Paths}}_{X}\left(\mathrm{fhy},y\right).$ $\text{isTwoSidedEquiv}\left(f\right):=\mathrm{text}\mathrm{LeftHInv}\left(f\right)×\mathrm{text}\mathrm{RightHInv}\left(f\right).$

Or in Coq, which should be harder for parsers to mangle,

LeftHInv (f:X->Y) :=
exists (g:Y->X), forall (x:X), Paths (g (f x)) x.
RightHInv (f:X->Y) :=
exists (h:Y->X), forall (y:Y), Paths (f (h y)) y.
isTwoSidedEquiv (f:X->Y) :=
LeftHInv f * RightHInv f.

Posted by: Peter LeFanu Lumsdaine on March 25, 2011 9:19 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Thanks! I forgot entirely about that one. I took the liberty of getting rid of the “Unknown characters” in your first comment; let me now try to make it a little more readable:

$\mathrm{LeftHInv}\left(f\right)≔{\Sigma }_{g:Y\to X}{\forall }_{x:X}{\mathrm{Paths}}_{X}\left(gfx,x\right).$ $\mathrm{RightHInv}\left(f\right)≔{\Sigma }_{h:Y\to X}{\forall }_{y:Y}{\mathrm{Paths}}_{X}\left(fhy,y\right).$ $\mathrm{isTwoSidedEquiv}\left(f\right)≔\mathrm{LeftHInv}\left(f\right)\phantom{\rule{thickmathspace}{0ex}}×\phantom{\rule{thickmathspace}{0ex}}\mathrm{RightHInv}\left(f\right).$

Some iTex tips: unlike TeX, iTex interprets continuous letters as a single identifier if there is no space. So f g x produces $fgx$ while isEquiv(f) produces $\mathrm{isEquiv}\left(f\right)$ (no need for \text). You can use \; and \, for spacing, and \coloneqq for $≔$. To display formulas, you can use double dollar signs, as in plain TeX.

And if someone PGP-signs their comment, as I try to do whenever I’m writing a significant amount of iTex, you can click “PGP Sig” to view the source of their comment and see how they did the iTeX.

By the way, in case anyone gets confused by it, I think Peter’s “Coq version” is only “pseudo-Coq”; a version which actually compiles for me is

Definition LeftHInv {X Y} (f:X->Y) :=
{ g:Y->X & forall (x:X), paths (g (f x)) x }.
Definition RightHInv {X Y} (f:X->Y) :=
{ h:Y->X & forall (y:Y), paths (f (h y)) y }.
Definition isTwoSidedEquiv {X Y} (f:X->Y) :=
(LeftHInv f * RightHInv f)%type.


Have you checked formally that this definition gives a proposition and equivalent to isEquiv (not that I have any doubt, but it would be nice to have)?

Posted by: Mike Shulman on March 25, 2011 10:07 PM | Permalink | PGP Sig | Reply to this

### Re: Homotopy Type Theory, III

the following type (which I didn’t write down in gory detail before):

On my system the expression runs out of the blog’s boundaries. Here is what I can see (re-typeset using prods and sums and stackrels. what is it you do not like about them?).

$\sum _{Y\stackrel{g}{\to }X}\sum _{p\in \prod _{x\in X}{\mathrm{Paths}}_{X}\left(g\left(f\left(x\right)\right)\right)}\sum _{q\in \prod _{y\in Y}{\mathrm{Paths}}_{Y}\left(f\left(g\left(y\right)\right)\right)}\prod _{x\in X}{\mathrm{Paths}}_{{\mathrm{Paths}}_{Y}\left(f\left(g\left(f\left(x\right)\right)\right)\right)}\left[...\right]$

I’m sure of this, because I’ve coded both of these maps in $\mathrm{Coq}$

Interesting, this is beginning to answer what I asked earlier, in the first thread: what can homotopy type theory do for homotopy theory, for homotopy theorists, for people not genuinely interested in type theory as such? It seems that the formal language allows to makes quite nontrivial statements in homotopy theory accessible to formal proof and formal proof checking. Before seeing this I would have guessed that the only statements about homotopy theory that you could code in practice in homotopy type theory are rather trivial. But this seems to be far from true.

At some point I would like to see the “code” that does this. How long is it?

Put another way, Whitehead’s theorem should be regarded as a foundational axiom of mathematics, but one which only a “natively homotopical” foundational system is subtle enough to perceive (and in particular, to allow to be violated). If we insist on building ∞-groupoids out of sets, then we will automatically be forced to accept Whitehead’s theorem; but if instead we define sets as particular ∞-groupoids, then we are allowed to explore a world where Whitehead’s theorem may fail.

Thanks for saying that. That’s good.

Posted by: Urs Schreiber on March 25, 2011 9:26 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Nils Anders Danielsson and Thierry Coquand proved:
the groupoid (π n X x) is commutative for n greater than or equal to 2.
The code is here.

Bas

Posted by: Bas Spitters on March 25, 2011 10:23 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Nice! I’ve added a link to the HoTT code page. Of course, that should really be (Ω n X x), as remarked here.

Posted by: Mike Shulman on March 25, 2011 10:56 PM | Permalink | Reply to this

### Re: Homotopy Type Theory, III

Well, for one thing, in what you wrote I have a hard time seeing where the subscript on one $\Sigma$ ends and the subscript on the next one begins. I guess one could add extra spacing or parentheses. The last thing being summed over is

${\Pi }_{x\in X}{\mathrm{Paths}}_{{\mathrm{Paths}}_{Y}\left(f\left(g\left(f\left(x\right)\right)\right),f\left(x\right)\right)}\left(f\left(p\left(x\right)\right),q\left(f\left(x\right)\right)\right).$

or perhaps more cleanly

${\Pi }_{x\in X}{\mathrm{Paths}}_{{\mathrm{Paths}}_{Y}\left(fgfx,fx\right)}\left(fpx,qfx\right).$

Of course, the subscript on $\mathrm{Paths}$ can generally be inferred from the type of the arguments, so we can even just write ${\Pi }_{x\in X}\mathrm{Paths}\left(fpx,qfx\right)$.

this is beginning to answer what I asked earlier, in the first thread

Excellent! I thought you were asking what new theorems in homotopy theory can we prove this way, and I didn’t have any answers yet. But I think it’s certainly true that existing theorems in homotopy theory are much more accessible to formal proof checking this way than they would be if you tried to build homotopy theory in Coq out of, say, simplicial sets.

At some point I would like to see the “code” that does this. How long is it?

I’ve been working based on Andrej Bauer’s implementation of the basics of homotopy type theory (a more or less direct line to the proof that univalence implies function extensionality), which can be found on github here.

My own fork can be found here. Currently the only change I made to the master branch is to make “weak equivalence” into “equivalence” everywhere, and then in a new branch called “adjoint-equivalences” (click on “Switch branches” to get to it) I’ve added a couple files which implement the two maps $\mathrm{IsEquiv}\to \mathrm{IsAdjointEquiv}$ and $\mathrm{IsAdjointEquiv}\to \mathrm{IsEquiv}$, and also the adjointification map $\mathrm{IncoherentEquiv}\to \mathrm{IsAdjointEquiv}$. The definitions of the three maps can be viewed here; the first two fit on a single screen each, while the third takes two screens. They do make use of a bunch of basic lemmas and “tactics” defined in the auxiliary files.

(To anyone reading this post in the distant future: it’s quite likely that the above links will no longer work; go to homotopytypetheory.org to find the most recent code.)

Posted by: Mike Shulman on March 25, 2011 10:44 PM | Permalink | PGP Sig | Reply to this
Read the post Homotopy Type Theory, IV
Weblog: The n-Category Café
Excerpt: Voevodsky's "univalence axiom" for universes in homotopy type theory, and the equivalent principle of "equivalence induction."
Tracked: April 7, 2011 5:21 AM
Read the post Homotopy Type Theory, VI
Weblog: The n-Category Café
Excerpt: A homotopical extension of the notion of "inductive definition" allows us to construct CW complexes and mimic other constructions from homotopy theory in type theory.
Tracked: April 25, 2011 7:56 AM

Post a New Comment