internal parametricity for cubical type theory
play

Internal Parametricity for Cubical Type Theory Evan Cavallo Robert - PowerPoint PPT Presentation

Internal Parametricity for Cubical Type Theory Evan Cavallo Robert Harper Carnegie Mellon University CSL 2020 JAN 16 0 Mar n-Lf type theory Mar n-Lf 82: judgments explained by as speci fi ca ons on untyped programs ( A ,


  1. Internal Parametricity for Cubical Type Theory Evan Cavallo Robert Harper Carnegie Mellon University CSL 2020 · JAN 16 0

  2. Mar � n-Löf type theory Mar � n-Löf ’82: judgments explained by as speci fi ca � ons on untyped programs ( A , B , M , N ) e.g. “ M ∈ nat ” is “ M computes a natural number” follow work of Angiuli, Favonia, & Harper ’18 on computa � onal cubical type theory CSL 2020 · JAN 16 1

  3. Cubical type theories coercion opera � on ensures everything respects paths univalence: type paths are equivalences CSL 2020 · JAN 16 2

  4. Cubical type theories intervals might be given by: De Morgan cubes structural Cohen, Coquand, Huber, & Mörtberg 2015 Cartesian cubes Angiuli, Favonia, & Harper 2018 Angiuli, Brunerie, Coquand, Favonia, Licata, & Harper 2018 no contrac � on Substructural cubes (diagonals) Bezem, Coquand, & Huber 2013&2017 CSL 2020 · JAN 16 3

  5. Cartesian cubical type theory CSL 2020 · JAN 16 4

  6. Cartesian cubical type theory CSL 2020 · JAN 16 4

  7. Higher induc � ve types combine induc � ve de fi ni � ons and quo � ents CSL 2020 · JAN 16 5

  8. Higher induc � ve types de fi ne higher-dimensional objects ( synthe � c homotopy theory ) CSL 2020 · JAN 16 6

  9. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) CSL 2020 · JAN 16 7

  10. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? CSL 2020 · JAN 16 7

  11. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? 2-d CSL 2020 · JAN 16 7

  12. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? 2-d ▰ is the associator an isomorphism? 3-d CSL 2020 · JAN 16 7

  13. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? 2-d ▰ is the associator an isomorphism? 3-d ▰ Mac Lane's pentagon? 4-d CSL 2020 · JAN 16 7

  14. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? 2-d ▰ is the associator an isomorphism? 3-d ▰ Mac Lane's pentagon? 4-d (van Doorn 2018, Brunerie 2018) CSL 2020 · JAN 16 7

  15. Higher induc � ve types when combined, require >1-d reasoning e.g., smash product (HoTT Book §6.8) ▰ associa � ve? 2-d ▰ is the associator an isomorphism? 3-d ▰ Mac Lane's pentagon? 4-d (van Doorn 2018, Brunerie 2018) can we avoid this complexity? CSL 2020 · JAN 16 7

  16. Parametricity “Parametric” func � ons are uniform in type variables: Contrast with “ad-hoc” polymorphic func � ons: Restrict ourselves to write only parametric func � ons Parametric func � ons sa � sfy many proper � es “automa � cally” CSL 2020 · JAN 16 8

  17. Reynolds’ abstrac � on theorem (’83) Def: A family of (set-theore � c) func � ons is parametric when it acts on rela � ons. e.g. , Abstrac � on theorem : the denota � on of any term in simply-typed λ -calculus (with ×, bool) is parametric. Key idea: λ -calculus has a rela � onal interpreta � on . CSL 2020 · JAN 16 9

  18. Reynolds’ abstrac � on theorem (’83) Def: A family of (set-theore � c) func � ons is parametric when it acts on rela � ons. e.g. , “theorems for free” (Wadler ’89) CSL 2020 · JAN 16 10

  19. Internal parametricity (Bernardy & Moulin ’12) Make rela � onal interp. visible inside type theory CSL 2020 · JAN 16 11

  20. Internal parametricity (Bernardy & Moulin ’12) Make rela � onal interp. visible inside type theory cubical type theory parametric type theory construc � ons act on construc � ons act on isomorphisms rela � ons equal over iso x . A related by rel x . A univalence: rela � vity: CSL 2020 · JAN 16 11

  21. Parametric Cubical Type Theory bridge dimensions path dimensions substructural structural CSL 2020 · JAN 16 12

  22. Parametric Cubical Type Theory bridge dimensions path dimensions substructural structural Use parametricity to prove results about HITs Use good proper � es of cubical type theory to get be � er results from / simplify internal parametricity Compare and contrast internal parametricity and cubical type theory CSL 2020 · JAN 16 12

  23. Parametric Cubical Type Theory CSL 2020 · JAN 16 13

  24. Parametric Cubical Type Theory CSL 2020 · JAN 16 13

  25. Parametric Cubical Type Theory CSL 2020 · JAN 16 13

  26. Parametric Cubical Type Theory CSL 2020 · JAN 16 13

  27. Parametric Cubical Type Theory CSL 2020 · JAN 16 13

  28. Internal parametricity: a ffi ne dimensions CSL 2020 · JAN 16 14

  29. Internal parametricity: a ffi ne dimensions CSL 2020 · JAN 16 14

  30. Internal parametricity: a ffi ne dimensions CSL 2020 · JAN 16 14

  31. Internal parametricity: Bridge-types CSL 2020 · JAN 16 15

  32. Internal parametricity: “rela � vity” Forward: Backward: ▰ Parallels structural Glue / V CSL 2020 · JAN 16 16

  33. Internal parametricity: func � on types paths: func � on extensionality bridges: rela � onal interpreta � on (di ff erence invisible for paths because of coercion ) CSL 2020 · JAN 16 17

  34. Internal parametricity: func � on types Forward: Backward: CSL 2020 · JAN 16 18

  35. Internal parametricity: func � on types Forward: Backward: CSL 2020 · JAN 16 18

  36. Internal parametricity: func � on types Forward: Backward: “case analysis for interval terms” CSL 2020 · JAN 16 18

  37. Internal parametricity: func � on types Stability of abstrac � on under subs � tu � on relies on absence of diagonals: CSL 2020 · JAN 16 19

  38. Internal parametricity: func � on types Stability of abstrac � on under subs � tu � on relies on absence of diagonals: CSL 2020 · JAN 16 19

  39. Internal parametricity: func � on types Stability of abstrac � on under subs � tu � on relies on absence of diagonals: CSL 2020 · JAN 16 19

  40. Internal parametricity: func � on types Stability of abstrac � on under subs � tu � on relies on absence of diagonals: CSL 2020 · JAN 16 19

  41. Cubical equality for internal parametricity Func � on extensionality & univalence ▰ ▰ ▰ CSL 2020 · JAN 16 20

  42. Internal parametricity for cubical equality Mo � va � ng example: smash product ▰ In the paper: any map is constant or the polymorphic iden � ty. ▰ Implies any non-constant map is an isomorphism. ▰ Key: scales to characterize maps CSL 2020 · JAN 16 21

  43. Conclusions Combine internal parametricity & cubical type theory ▰ Parametricity is especially useful for cubical type theory because it contains induc � ve types with complex algebraic proper � es ▰ As with ordinary type theory, using cubical equality smooths rough edges Push internal parametricity further ▰ Bridge-discrete types for iden � ty extension lemma Theories with interval variables ▰ When are di ff erent kinds of intervals appropriate? CSL 2020 · JAN 16 22

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