higher inductive types in cubical type theories
play

Higher Inductive Types in Cubical Type Theories Anders M ortberg - PowerPoint PPT Presentation

Higher Inductive Types in Cubical Type Theories Anders M ortberg Carnegie Mellon University and Stockholm University EUTypes, October 8, 2018 Univalent Type Theory (UTT) Aims at providing a foundation for mathematics built on type theory


  1. Higher Inductive Types in Cubical Type Theories Anders M¨ ortberg Carnegie Mellon University and Stockholm University EUTypes, October 8, 2018

  2. Univalent Type Theory (UTT) Aims at providing a foundation for mathematics built on type theory Founded by Vladimir Voevodsky around 2006–2009 and actively developed in various proof assistants ( Agda , Coq , Lean , ...) extended with the univalence axiom (which implies both functional and propositional extensionality) Justified by semantics in spaces (Kan simplicial sets), inherently classical A. M¨ ortberg Introduction October 8, 2018 2 / 29

  3. Univalent Type Theory (UTT) Aims at providing a foundation for mathematics built on type theory Founded by Vladimir Voevodsky around 2006–2009 and actively developed in various proof assistants ( Agda , Coq , Lean , ...) extended with the univalence axiom (which implies both functional and propositional extensionality) Justified by semantics in spaces (Kan simplicial sets), inherently classical Theorem (Cohen, Coquand, Huber, M. 2015) Univalent Type Theory has a constructive model in Kan cubical sets Based on this we developed a cubical type theory in which we can prove and compute with the univalence theorem A. M¨ ortberg Introduction October 8, 2018 2 / 29

  4. Homotopy (Type Theory) vs. (Homotopy Type) Theory Type theory Homotopy theory A Type A Space p a , b : A Λ p , q : a = b a • . . . • b α , β : p = q α β Λ , Θ : α = β Θ . . . q A. M¨ ortberg Introduction October 8, 2018 3 / 29

  5. Higher Inductive Types HITs ( ∼ 2011 ) let us directly represent base topological spaces in type theory and do • synthetic homotopy theory S 1 : They also allow us to define quotient types, truncations... that should be useful for computer science applications loop N • Susp ( A ) : . . . merid a • S A. M¨ ortberg Introduction October 8, 2018 4 / 29

  6. Higher Inductive Types HITs ( ∼ 2011 ) let us directly represent base • topological spaces in type theory and do synthetic homotopy theory S 1 : They also allow us to define quotient types, truncations... that should be useful for computer science applications loop Many impressive developments with HITs using “book HoTT”: N • Blakers-Massey Susp ( A ) : Homotopy groups of (higher) spheres . . . merid a Serre spectral sequence • ... S A. M¨ ortberg Introduction October 8, 2018 4 / 29

  7. Higher Inductive Types HITs ( ∼ 2011 ) let us directly represent base • topological spaces in type theory and do synthetic homotopy theory S 1 : They also allow us to define quotient types, truncations... that should be useful for computer science applications loop N • Want : type theories and proof Susp ( A ) : assistants with native support for . . . merid a HITs, while ensuring consistency! • S A. M¨ ortberg Introduction October 8, 2018 4 / 29

  8. Cubical Agda demo https://github.com/Saizan/cubical-demo/tree/hits-transp

  9. Cubical Type Theory What makes a type theory “cubical”? A. M¨ ortberg Cubical Type Theory October 8, 2018 6 / 29

  10. Cubical Type Theory What makes a type theory “cubical”? Add a formal interval I : r, s ::= 0 | 1 | i Extend the contexts to include interval variables: Γ ::= • | Γ , x : A | Γ , i : I A. M¨ ortberg Cubical Type Theory October 8, 2018 6 / 29

  11. Interval variables i : I ⊢ A corresponds to a line: A A (0 /i ) A (1 /i ) A. M¨ ortberg Cubical Type Theory October 8, 2018 7 / 29

  12. Interval variables i : I ⊢ A corresponds to a line: A A (0 /i ) A (1 /i ) i : I , j : I ⊢ A corresponds to a square: A (1 /j ) A (0 /i )(1 /j ) A (1 /i )(1 /j ) j A (0 /i ) A A (1 /i ) i A (0 /i )(0 /j ) A (1 /i )(0 /j ) A (0 /j ) and so on... A. M¨ ortberg Cubical Type Theory October 8, 2018 7 / 29

  13. Cubical Type Theory: structural rules Proof theory Semantics Γ ⊢ J deg weakening Γ , i : I Γ Γ , i : I ⊢ J symm Γ , i : I , j : I ⊢ J Γ , j : I , i : I Γ , i : I , j : I exchange Γ , j : I , i : I ⊢ J Γ , i : I , j : I ⊢ J diag Γ , i : I Γ , i : I , j : I contraction Γ , i : I ⊢ J ( j/i ) A. M¨ ortberg Cubical Type Theory October 8, 2018 8 / 29

  14. Cubical Type Theory: additional structure on I We can also consider additional structure on I : r, s ::= 0 | 1 | i | r ∧ s | r ∨ s | ¬ r A. M¨ ortberg Cubical Type Theory October 8, 2018 9 / 29

  15. Cubical Type Theory: additional structure on I We can also consider additional structure on I : r, s ::= 0 | 1 | i | r ∧ s | r ∨ s | ¬ r Given i : I ⊢ A A ( i/i ) A (0 /i ) A (1 /i ) A ( ¬ i/i ) A (1 /i ) A (0 /i ) A ( i ∧ j/i ) A (0 /i ) A ( j/i ) A (0 /i ) A (0 /i ) A (0 /j ) Axioms: distributive lattice, de Morgan algebra, Boolean algebra... “Varieties of Cubical Sets” - Buchholtz, Morehouse (2017) A. M¨ ortberg Cubical Type Theory October 8, 2018 9 / 29

  16. Cubical Type Theory: Path types Fix I and define Path ( A ) := ( i : I ) → A We can also consider paths with fixed end-points (and more generally cubes with fixed boundaries, “extension types”): Path i A a b := ( i : I ) → A [( i = 0) �→ a, ( i = 1) �→ b ] A. M¨ ortberg Cubical Type Theory October 8, 2018 10 / 29

  17. Path types are great! Given f : A → B and p : Path A a b we can define: ap f p := λ ( i : I ) . f ( p i ) : Path B ( f a ) ( f b ) satisfying definitionally: ap id p = p ( f ◦ g ) p = ap f ( ap g p ) ap This way we get new ways for reasoning about equality: inline ap , funext, symmetry... with new definitional equalities A. M¨ ortberg Cubical Type Theory October 8, 2018 11 / 29

  18. Cubical Type Theory: fibrant types We also need to equip all types with transport operations : 1 Γ , i : I ⊢ A Γ ⊢ a : A (0 /i ) Γ ⊢ transport i A a : A (1 /i ) There are many different possibilities for how to do this! Which of these give models of Univalent Type Theory with HITs? 1 For technical reasons we need to consider more general “composition” operations... A. M¨ ortberg Cubical Type Theory October 8, 2018 12 / 29

  19. Cubical Type Theory: fibrant types We also need to equip all types with transport operations : 1 Γ , i : I ⊢ A Γ ⊢ a : A (0 /i ) Γ ⊢ transport i A a : A (1 /i ) There are many different possibilities for how to do this! Which of these give models of Univalent Type Theory with HITs? 1 BCH: substructural I (no contraction), transport for open boxes 2 CCHM: all structural rules and de Morgan (or distributive lattice) structure on I , transport for generalized open boxes 3 Cartesian: all structural rules, but no additional structure, on I and generalized transport for generalized open boxes 1 For technical reasons we need to consider more general “composition” operations... A. M¨ ortberg Cubical Type Theory October 8, 2018 12 / 29

  20. HITs in Cubical Type Theory: the circle One of the things that make the cubical setting so natural for HITs is that we can directly use interval variables: 2 Γ ⊢ Γ ⊢ r : I Γ ⊢ base : S 1 Γ ⊢ loop r : S 1 Γ ⊢ loop 0 = base : S 1 Γ ⊢ loop 1 = base : S 1 Note: loop introduces an element of S 1 , not its Id-type! 2 We also need “homogeneous compositions”, more about this later... A. M¨ ortberg Cubical Type Theory October 8, 2018 13 / 29

  21. HITs in Cubical Type Theory: the circle Elimination: Γ , x : S 1 ⊢ C Γ ⊢ l : Path i C ( loop i ) b b Γ ⊢ u : S 1 Γ ⊢ b : C ( base ) Γ ⊢ S 1 -elim x.C b l u : C ( u ) The judgmental computation rules for S 1 -elim x.C b l u by cases on u A. M¨ ortberg Cubical Type Theory October 8, 2018 14 / 29

  22. HITs in Cubical Type Theory: the circle Elimination: Γ , x : S 1 ⊢ C Γ ⊢ l : Path i C ( loop i ) b b Γ ⊢ u : S 1 Γ ⊢ b : C ( base ) Γ ⊢ S 1 -elim x.C b l u : C ( u ) The judgmental computation rules for S 1 -elim x.C b l u by cases on u Γ ⊢ S 1 -elim x.C b l base = b : C ( base ) Γ ⊢ S 1 -elim x.C b l ( loop r ) = l r : C ( loop r ) The last equation is simpler than in book HoTT because of the builtin “path-over” types (i.e. no need for apd S 1 -elim ( loop ) = l ) A. M¨ ortberg Cubical Type Theory October 8, 2018 14 / 29

  23. HITs in Cubical Type Theory: suspensions Γ ⊢ A Γ ⊢ A Γ ⊢ a : A Γ ⊢ r : I Γ ⊢ N : Susp ( A ) Γ ⊢ S : Susp ( A ) Γ ⊢ merid a r : Susp ( A ) Γ ⊢ a : A Γ ⊢ a : A Γ ⊢ merid a 0 = N : Susp ( A ) Γ ⊢ merid a 1 = S : Susp ( A ) N • . . . merid a • S A. M¨ ortberg Cubical Type Theory October 8, 2018 15 / 29

  24. HITs in Cubical Type Theory: suspensions Elimination: Γ , x : Susp ( A ) ⊢ C Γ ⊢ n : C ( N ) Γ ⊢ s : C ( S ) Γ ⊢ m : ( a : A ) → Path i C ( merid a i ) N S Γ ⊢ u : Susp ( A ) Γ ⊢ Susp-elim A x.C n s m u : C ( u ) The judgmental computation rules are defined by cases on u : Susp-elim A x.C n s m N = n Susp-elim A x.C n s m S = s Susp-elim A x.C n s m ( merid a r ) = m a r A. M¨ ortberg Cubical Type Theory October 8, 2018 16 / 29

  25. HITs in cubicaltt: suspensions, Susp ( A ) Transport: Defined by cases: trans i ( Susp ( A )) N = N trans i ( Susp ( A )) S = S trans i ( Susp ( A )) ( merid a r ) = merid ( trans i A a ) r Note: directly structurally recursive! 3 3 Transport for more complicated HITs (e.g. pushouts) is a bit more involved... A. M¨ ortberg Cubical Type Theory October 8, 2018 17 / 29

  26. Categorical Semantics On Higher Inductive Types in Cubical Type Theory Coquand, Huber, M. - LICS 2018

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend