higher inductive types in homotopy type theory
play

Higher Inductive Types in Homotopy Type Theory Steve Awodey - PowerPoint PPT Presentation

Higher Inductive Types in Homotopy Type Theory Steve Awodey Institute for Advanced Study and Carnegie Mellon University TYPES 2013 Toulouse, April 2013 Introduction A new connection has come to light between Logic and Topology in the form


  1. � The homotopy interpretation: Type dependency We still need to interpret dependent types x : A ⊢ B ( x ). The identity rules imply the following: p : Id A ( a , a ′ ) b : B ( a ) p ∗ b : B ( a ′ ) Logically, this just says “ a = a ′ & B ( a ) ⇒ B ( a ′ )”. But topologically, it is a familiar lifting property : � p ∗ b B b � a ′ A a p This is the notion of a “fibration” of spaces.

  2. � The homotopy interpretation: Type dependency Thus we continue the homotopy interpretation as follows: Dependent types x : A ⊢ B ( x ) Fibrations B � A

  3. � � � The homotopy interpretation: Type dependency Thus we continue the homotopy interpretation as follows: Dependent types x : A ⊢ B ( x ) Fibrations B � A The type B ( a ) is the fiber of B → A over the point a : A � B B ( a ) � A . 1 a

  4. The homotopy interpretation: Identity types To interpret the identity type x , y : A ⊢ Id A ( x , y ), we thus require a fibration over A × A .

  5. � The homotopy interpretation: Identity types To interpret the identity type x , y : A ⊢ Id A ( x , y ), we thus require a fibration over A × A . Take the space A I of all paths in A : A I Identity type x , y : A ⊢ Id A ( x , y ) Path space � A × A

  6. � � � The homotopy interpretation: Identity types To interpret the identity type x , y : A ⊢ Id A ( x , y ), we thus require a fibration over A × A . Take the space A I of all paths in A : A I Identity type x , y : A ⊢ Id A ( x , y ) Path space � A × A The fiber Id A ( a , b ) over a point ( a , b ) ∈ A × A is the space of paths from a to b in A . � A I Id A ( a , b ) � A × A . 1 ( a , b )

  7. � � The homotopy interpretation: Identity types The path space A I classifies homotopies ϑ : f ⇒ g between maps f , g : X → A , A I ϑ � A × A . X ( f , g )

  8. � � The homotopy interpretation: Identity types The path space A I classifies homotopies ϑ : f ⇒ g between maps f , g : X → A , A I ϑ � A × A . X ( f , g ) So given any terms x : X ⊢ f , g : A , an identity term x : X ⊢ ϑ : Id A ( f , g ) is interpreted as a homotopy between f and g .

  9. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity

  10. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity 2. Extend this to dependently typed λ -calculus with Id -types,

  11. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity 2. Extend this to dependently typed λ -calculus with Id -types, using the basic idea : p : Id X ( a , b ) ⇔ p is a path from point a to point b in the space X

  12. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity 2. Extend this to dependently typed λ -calculus with Id -types, using the basic idea : p : Id X ( a , b ) ⇔ p is a path from point a to point b in the space X This forces dependent types to be fibrations,

  13. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity 2. Extend this to dependently typed λ -calculus with Id -types, using the basic idea : p : Id X ( a , b ) ⇔ p is a path from point a to point b in the space X This forces dependent types to be fibrations, Id -types to be path spaces,

  14. The homotopy interpretation: Summary 1. There is a topological interpretation of the λ -calculus: types � spaces terms � continuous functions . . . computability � continuity 2. Extend this to dependently typed λ -calculus with Id -types, using the basic idea : p : Id X ( a , b ) ⇔ p is a path from point a to point b in the space X This forces dependent types to be fibrations, Id -types to be path spaces, and terms of Id -types to be homotopies.

  15. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories .

  16. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories . ◮ Gives a wide range of different models.

  17. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories . ◮ Gives a wide range of different models. ◮ Includes classical homotopy of spaces and simplicial sets.

  18. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories . ◮ Gives a wide range of different models. ◮ Includes classical homotopy of spaces and simplicial sets. ◮ Allows the use of standard methods from categorical logic.

  19. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories . ◮ Gives a wide range of different models. ◮ Includes classical homotopy of spaces and simplicial sets. ◮ Allows the use of standard methods from categorical logic. Theorem (Awodey & Warren 2006) “Martin-L¨ of type theory has a sound interpretation into abstract homotopy theory.”

  20. The homotopy interpretation: First theorems Instead of concrete spaces and homotopies, we use the axiomatic description provided by Quillen model categories . ◮ Gives a wide range of different models. ◮ Includes classical homotopy of spaces and simplicial sets. ◮ Allows the use of standard methods from categorical logic. Theorem (Awodey & Warren 2006) “Martin-L¨ of type theory has a sound interpretation into abstract homotopy theory.” Theorem (Gambino & Garner 2008) “The homotopy interpretation of Martin-L¨ of type theory is also complete .”

  21. 1. The homotopy interpretation: Conclusion Type theory provides a “logic of homotopy”.

  22. 2. Homotopy type theory How expressive is constructive type theory as a formal language for homotopy theory?

  23. 2. Homotopy type theory How expressive is constructive type theory as a formal language for homotopy theory? What facts, properties, and constructions from homotopy theory are logically expressible?

  24. 2. Homotopy type theory How expressive is constructive type theory as a formal language for homotopy theory? What facts, properties, and constructions from homotopy theory are logically expressible? One example: the fundamental group and its higher-dimensional analogues are logical constructions.

  25. Fundamental groupoids Let’s return to the system of identity terms of various orders: a , b : A p , q : Id A ( a , b ) α, β : Id Id A ( a , b ) ( p , q ) ϑ : Id Id Id ... ( α, β )

  26. � � � � � � � � Fundamental groupoids Let’s return to the system of identity terms of various orders: a , b : A p , q : Id A ( a , b ) α, β : Id Id A ( a , b ) ( p , q ) ϑ : Id Id Id ... ( α, β ) These can be represented suggestively as follows: p p p a a a ϑ b b a b • • • • • � α • • α β q q

  27. � Fundamental groupoids As in topology, the terms of order 0 and 1, (“points” and “paths”), p a b • • bear the structure of a groupoid .

  28. � Fundamental groupoids As in topology, the terms of order 0 and 1, (“points” and “paths”), p a b • • bear the structure of a groupoid . The laws of identity correspond to the groupoid operations : r : Id ( a , a ) reflexivity a → a s : Id ( a , b ) → Id ( b , a ) symmetry a ⇆ b t : Id ( a , b ) × Id ( b , c ) → Id ( a , c ) transitivity a → b → c

  29. � Fundamental groupoids As in topology, the terms of order 0 and 1, (“points” and “paths”), p a b • • bear the structure of a groupoid . The laws of identity correspond to the groupoid operations : r : Id ( a , a ) reflexivity a → a s : Id ( a , b ) → Id ( b , a ) symmetry a ⇆ b t : Id ( a , b ) × Id ( b , c ) → Id ( a , c ) transitivity a → b → c This was first shown by Hofmann & Streicher (1998), who gave a model of intensional type theory using groupoids as types.

  30. Fundamental groupoids But also just as in topology, the groupoid equations of associativity, inverse, and unit: p · ( q · r ) = ( p · q ) · r p − 1 · p = 1 = p · p − 1 1 · p = p = p · 1 do not hold strictly, but only “up to homotopy”.

  31. � � � � Fundamental groupoids But also just as in topology, the groupoid equations of associativity, inverse, and unit: p · ( q · r ) = ( p · q ) · r p − 1 · p = 1 = p · p − 1 1 · p = p = p · 1 do not hold strictly, but only “up to homotopy”. This means they are witnessed by terms of the next higher order: p − 1 · p , 1 � � ϑ : Id Id b • p − 1 p ϑ • • a a 1

  32. Fundamental groupoids The entire system of identity terms of all orders forms an infinite-dimensional graph, or “globular set”: A ⇔ Id A ⇔ Id Id A ⇔ Id Id Id A ⇔ . . .

  33. Fundamental groupoids The entire system of identity terms of all orders forms an infinite-dimensional graph, or “globular set”: A ⇔ Id A ⇔ Id Id A ⇔ Id Id Id A ⇔ . . . It has the structure of a (weak), infinite-dimensional, groupoid, as already occurring homotopy theory: Theorem (Lumsdaine, Garner & van den Berg, 2009) The system of identity terms of all orders over any fixed type is a weak ∞ -groupoid.

  34. Fundamental groupoids The entire system of identity terms of all orders forms an infinite-dimensional graph, or “globular set”: A ⇔ Id A ⇔ Id Id A ⇔ Id Id Id A ⇔ . . . It has the structure of a (weak), infinite-dimensional, groupoid, as already occurring homotopy theory: Theorem (Lumsdaine, Garner & van den Berg, 2009) The system of identity terms of all orders over any fixed type is a weak ∞ -groupoid. Every type has a fundamental weak ∞ -groupoid .

  35. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”.

  36. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X

  37. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X ,

  38. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X , set iff Id X ( x , y ) is a proposition for all x , y : X ,

  39. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X , set iff Id X ( x , y ) is a proposition for all x , y : X , 1-type iff Id X ( x , y ) is a set for all x , y : X ,

  40. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X , set iff Id X ( x , y ) is a proposition for all x , y : X , 1-type iff Id X ( x , y ) is a set for all x , y : X , (n+1)-type iff Id X ( x , y ) is an n -type for all x , y : X .

  41. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X , set iff Id X ( x , y ) is a proposition for all x , y : X , 1-type iff Id X ( x , y ) is a set for all x , y : X , (n+1)-type iff Id X ( x , y ) is an n -type for all x , y : X . We then let set = 0-type, and proposition = ( − 1)-type.

  42. Homotopy n -types Voevodsky has discovered that the universe of all types is naturally stratified by “homotopical dimension”. A type X is called: contractible iff � � y : X Id X ( x , y ) is inhabited, x : X A type X is called a: proposition iff Id X ( x , y ) is contractible for all x , y : X , set iff Id X ( x , y ) is a proposition for all x , y : X , 1-type iff Id X ( x , y ) is a set for all x , y : X , (n+1)-type iff Id X ( x , y ) is an n -type for all x , y : X . We then let set = 0-type, and proposition = ( − 1)-type. This corresponds to the homotopical notion of “truncation”: the level at which the fundamental groupoid becomes trivial.

  43. Machine implementation Now one can combine the following:

  44. Machine implementation Now one can combine the following: ◮ the representation of homotopy theory in constructive type theory

  45. Machine implementation Now one can combine the following: ◮ the representation of homotopy theory in constructive type theory ◮ the well-developed implementations of type theory in computational proof assistants like Coq.

  46. Machine implementation Now one can combine the following: ◮ the representation of homotopy theory in constructive type theory ◮ the well-developed implementations of type theory in computational proof assistants like Coq. Allows computer verified proofs in homotopy theory and related fields, in addition to constructive mathematics.

  47. Machine implementation Now one can combine the following: ◮ the representation of homotopy theory in constructive type theory ◮ the well-developed implementations of type theory in computational proof assistants like Coq. Allows computer verified proofs in homotopy theory and related fields, in addition to constructive mathematics. This aspect is being very actively pursued right now in the Univalent Foundations Program.

  48. A computational example A classical result states that the higher homotopy groups of a space are always abelian.

  49. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory:

  50. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory: ◮ the fundamental group π 1 ( X , b ) of a type X at basepoint b : X consists of terms of type Id X ( b , b ).

  51. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory: ◮ the fundamental group π 1 ( X , b ) of a type X at basepoint b : X consists of terms of type Id X ( b , b ). ◮ the second homotopy group π 2 ( X , b ) consists of terms of type Id Id X ( b , b ) ( r ( b ) , r ( b )).

  52. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory: ◮ the fundamental group π 1 ( X , b ) of a type X at basepoint b : X consists of terms of type Id X ( b , b ). ◮ the second homotopy group π 2 ( X , b ) consists of terms of type Id Id X ( b , b ) ( r ( b ) , r ( b )). ◮ Each of these types has a group structure, and so the second one has two group structures that are compatible.

  53. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory: ◮ the fundamental group π 1 ( X , b ) of a type X at basepoint b : X consists of terms of type Id X ( b , b ). ◮ the second homotopy group π 2 ( X , b ) consists of terms of type Id Id X ( b , b ) ( r ( b ) , r ( b )). ◮ Each of these types has a group structure, and so the second one has two group structures that are compatible. ◮ Now the Eckmann-Hilton argument shows that the two structures on π 2 ( X , b ) agree, and are abelian.

  54. A computational example A classical result states that the higher homotopy groups of a space are always abelian. We can formalize this in type theory: ◮ the fundamental group π 1 ( X , b ) of a type X at basepoint b : X consists of terms of type Id X ( b , b ). ◮ the second homotopy group π 2 ( X , b ) consists of terms of type Id Id X ( b , b ) ( r ( b ) , r ( b )). ◮ Each of these types has a group structure, and so the second one has two group structures that are compatible. ◮ Now the Eckmann-Hilton argument shows that the two structures on π 2 ( X , b ) agree, and are abelian. This argument can be formalized in Coq and verified to be correct. In this way, we can use the homotopical interpretation to verify proofs in homotopy theory.

  55. A computational example (** ** The 2-dimensional groupoid structure *) (** Horizontal composition of 2-dimensional paths. *) Definition concat2 {A} {x y z : A} {p p’ : x = y} {q q’ : y = z} (h : p = p’) (h’ : q = q’) : p @ q = p’ @ q’ := match h, h’ with idpath, idpath => 1 end. Notation ‘‘p @@ q" := (concat2 p q) (** 2-dimensional path inversion *) Definition inverse2 {A : Type} {x y : A} {p q : x = y} (h : p = q) : p^ = q^ := match h with idpath => 1 end. (** *** Whiskering *) Definition whiskerL {A : Type} {x y z : A} (p : x = y) {q r : y = z} (h : q = r) : p @ q = p @ r := 1 @@ h. Definition whiskerR {A : Type} {x y z : A} {p q : x = y} (h : p = q) (r : y = z) : p @ r = q @ r := h @@ 1. (** *** Unwhiskering, a.k.a. cancelling. *) Lemma cancelL {A} {x y z : A} (p : x = y) (q r : y = z) : (p @ q = p @ r) -> (q = r). Proof. destruct p, r. intro a. exact ((concat_1p q)^ @ a). Defined. Lemma cancelR {A} {x y z : A} (p q : x = y) (r : y = z) : (p @ r = q @ r) -> (p = q). Proof. destruct r, p. intro a. exact (a @ concat_p1 q). Defined.

  56. (** Whiskering and identity paths. *) Definition whiskerR_p1 {A : Type} {x y : A} {p q : x = y} (h : p = q) : (concat_p1 p) ^ @ whiskerR h 1 @ concat_p1 q = h := match h with idpath => match p with idpath => 1 end end. Definition whiskerR_1p {A : Type} {x y z : A} (p : x = y) (q : y = z) : whiskerR 1 q = 1 :> (p @ q = p @ q) := match q with idpath => 1 end. Definition whiskerL_p1 {A : Type} {x y z : A} (p : x = y) (q : y = z) : whiskerL p 1 = 1 :> (p @ q = p @ q) := match q with idpath => 1 end. Definition whiskerL_1p {A : Type} {x y : A} {p q : x = y} (h : p = q) : (concat_1p p) ^ @ whiskerL 1 h @ concat_1p q = h := match h with idpath => match p with idpath => 1 end end. Definition concat2_p1 {A : Type} {x y : A} {p q : x = y} (h : p = q) : h @@ 1 = whiskerR h 1 :> (p @ 1 = q @ 1) := match h with idpath => 1 end. Definition concat2_1p {A : Type} {x y : A} {p q : x = y} (h : p = q) : 1 @@ h = whiskerL 1 h :> (1 @ p = 1 @ q) := match h with idpath => 1 end.

  57. (** The interchange law for concatenation. *) Definition concat_concat2 {A : Type} {x y z : A} {p p’ p’’ : x = y} {q q’ q’’ : y = z} (a : p = p’) (b : p’ = p’’) (c : q = q’) (d : q’ = q’’) : (a @@ c) @ (b @@ d) = (a @ b) @@ (c @ d). Proof. case d. case c. case b. case a. reflexivity. Defined. (** The interchange law for whiskering. Special case of [concat_concat2]. *) Definition concat_whisker {A} {x y z : A} (p p’ : x = y) (q q’ : y = z) (a : p = p’) (b : q = q’) : (whiskerR a q) @ (whiskerL p’ b) = (whiskerL p b) @ (whiskerR a q’) := match b with idpath => match a with idpath => (concat_1p _)^ end end. (** Structure corresponding to the coherence equations of a bicategory. *) (** The "pentagonator": the 3-cell witnessing the associativity pentagon. *) Definition pentagon {A : Type} {v w x y z : A} (p : v = w) (q : w = x) (r : x = y) (s : y = z) : whiskerL p (concat_p_pp q r s) @ concat_p_pp p (q@r) s @ whiskerR (concat_p_pp p q r) s = concat_p_pp p q (r@s) @ concat_p_pp (p@q) r s. Proof. case p, q, r, s. reflexivity. Defined.

  58. (** The 3-cell witnessing the left unit triangle. *) Definition triangulator {A : Type} {x y z : A} (p : x = y) (q : y = z) : concat_p_pp p 1 q @ whiskerR (concat_p1 p) q = whiskerL p (concat_1p q). Proof. case p, q. reflexivity. Defined. (** The Eckmann-Hilton argument *) Definition eckmann_hilton {A : Type} {x:A} (p q : 1 = 1 :> (x = x)) : p @ q = q @ p := (whiskerR_p1 p @@ whiskerL_1p q)^ @ (concat_p1 _ @@ concat_p1 _) @ (concat_1p _ @@ concat_1p _) @ (concat_whisker _ _ _ _ p q) @ (concat_1p _ @@ concat_1p _)^ @ (concat_p1 _ @@ concat_p1 _)^ @ (whiskerL_1p q @@ whiskerR_p1 p).

  59. 2. Homotopy type theory: Conclusion ◮ Type theory provides a logic of homotopy.

  60. 2. Homotopy type theory: Conclusion ◮ Type theory provides a logic of homotopy. ◮ Logical methods can in principle capture a lot of homotopy theory: e.g. the fundamental ∞ -groupoid of a space is a logical construction , and the notion of n -type is logically definable .

  61. 2. Homotopy type theory: Conclusion ◮ Type theory provides a logic of homotopy. ◮ Logical methods can in principle capture a lot of homotopy theory: e.g. the fundamental ∞ -groupoid of a space is a logical construction , and the notion of n -type is logically definable . ◮ Many results have already been formalized: homotopy groups of spheres, Freudenthal suspension theorem, Postnokov towers, Eilenberg–Mac Lane spaces, ... ◮ Other areas are also being developed: ◮ Elementary mathematics: basic algebra, real numbers, cardinal arithmetic, ...

  62. 2. Homotopy type theory: Conclusion ◮ Type theory provides a logic of homotopy. ◮ Logical methods can in principle capture a lot of homotopy theory: e.g. the fundamental ∞ -groupoid of a space is a logical construction , and the notion of n -type is logically definable . ◮ Many results have already been formalized: homotopy groups of spheres, Freudenthal suspension theorem, Postnokov towers, Eilenberg–Mac Lane spaces, ... ◮ Other areas are also being developed: ◮ Elementary mathematics: basic algebra, real numbers, cardinal arithmetic, ... ◮ Foundations: quotient types, inductive types, cumulative hierarchy of sets, ...

  63. 2. Homotopy type theory: Conclusion ◮ Type theory provides a logic of homotopy. ◮ Logical methods can in principle capture a lot of homotopy theory: e.g. the fundamental ∞ -groupoid of a space is a logical construction , and the notion of n -type is logically definable . ◮ Many results have already been formalized: homotopy groups of spheres, Freudenthal suspension theorem, Postnokov towers, Eilenberg–Mac Lane spaces, ... ◮ Other areas are also being developed: ◮ Elementary mathematics: basic algebra, real numbers, cardinal arithmetic, ... ◮ Foundations: quotient types, inductive types, cumulative hierarchy of sets, ... ◮ Some new logical ideas are suggested by the homotopy interpretation: Higher inductive types, Univalence axiom.

  64. 3. Higher-dimensional inductive types (Due to Lumsdaine & Shulman, but very much work in progress.)

  65. 3. Higher-dimensional inductive types (Due to Lumsdaine & Shulman, but very much work in progress.) The natural numbers N are implemented in type theory as an inductively defined structure of type: o : N s : N → N

  66. 3. Higher-dimensional inductive types (Due to Lumsdaine & Shulman, but very much work in progress.) The natural numbers N are implemented in type theory as an inductively defined structure of type: o : N s : N → N The recursion property is captured by an elimination rule: a : X f : X → X rec( a , f ) : N → X

  67. 3. Higher-dimensional inductive types (Due to Lumsdaine & Shulman, but very much work in progress.) The natural numbers N are implemented in type theory as an inductively defined structure of type: o : N s : N → N The recursion property is captured by an elimination rule: a : X f : X → X rec( a , f ) : N → X such that: rec( a , f )( o ) = a rec( a , f )( sn ) = f (rec( a , f )( n ))

  68. � � � � Higher-dimensional inductive types This says just that ( N , o , s ) is the free structure of this type: 1 o a � X N s f rec

Recommend


More recommend