computational higher dimensional type
play

Computational Higher-dimensional Type Carlo Angiuli Theory Evan - PowerPoint PPT Presentation

Computational Higher-dimensional Type Carlo Angiuli Theory Evan Cavallo Favonia & RedPRL Bob Harper Jon Sterling 2017.07.04 @ INI Todd Wilson 1 Computational Types programs/ realizers computation 2 Computational Types


  1. Computational Higher-dimensional Type Carlo Angiuli Theory Evan Cavallo Favonia & RedPRL Bob Harper Jon Sterling 2017.07.04 @ INI Todd Wilson 1

  2. Computational Types programs/ realizers computation 2

  3. Computational Types programs/ computational computational <----- realizers type theory type theory computation theory of computation 2

  4. Computational Types programs/ computational computational <----- realizers type theory type theory computation theory of computation meaning Martin-Löf <---- explanation type theory pre-mathematical in M-L's work 2

  5. Computational Types We use an un(i)typed lambda calculus as in Nuprl. 3

  6. Computational Types We use an un(i)typed lambda calculus as in Nuprl. A ≐ B type => A evals to A', B evals to B', A' and B' recognize the same values 3

  7. Computational Types We use an un(i)typed lambda calculus as in Nuprl. A ≐ B type => A evals to A', B evals to B', A' and B' recognize the same values M ≐ N ∈ A => A ≐ A type, A evals to A', M to M', N to N', A' views N' and M' as the same value 3

  8. Computational Types We use an un(i)typed lambda calculus as in Nuprl. A ≐ B type => A evals to A', B evals to B', A' and B' recognize the same values M ≐ N ∈ A => A ≐ A type, A evals to A', M to M', N to N', A' views N' and M' as the same value Ex: "bool type" because "bool" evals to "bool" & exactly "true" and "false" are in "bool" 3

  9. Computational Types We use an un(i)typed lambda calculus as in Nuprl. A ≐ B type => A evals to A', B evals to B', A' and B' recognize the same values M ≐ N ∈ A => A ≐ A type, A evals to A', M to M', N to N', A' views N' and M' as the same value Ex: "bool type" because "bool" evals to "bool" & exactly "true" and "false" are in "bool" Ex: "if(true;false,42) ∈ bool" because "if(true;false,42)" evals to "false" and "false" is in "bool". 3

  10. Go Higher-Dimensional The Book HoTT and the CCHM system have higher-dim. interpretations Can we do the same? 4

  11. Go Higher-Dimensional The Book HoTT and the CCHM system have higher-dim. interpretations Can we do the same? realizers/programs higher-dim. (dims & Kan) interesting spaces universes + univalence 4

  12. Potential Benefits 5

  13. Potential Benefits 1. ≐ is closer to equational reasoning in standard math functional extensionality full universal properties (ex: eta for natural numbers) ... 5

  14. Potential Benefits 1. ≐ is closer to equational reasoning in standard math functional extensionality full universal properties (ex: eta for natural numbers) ... 2. adding more theorems cannot break computation realizers & proof theory separated perfect for programming 5

  15. Clarification #0 computational type theory IS NOT "extensional type theory" 6

  16. Clarification #0 computational type theory IS NOT "extensional type theory" Realizers can be a model of "ETT", a model of "ITT", or potentially a model of HoTT. You can collect your favorite theorems as rules in your favorite theory 6

  17. Clarification #1 computational type theory IS NOT operational sem. + canonicity 7

  18. Clarification #1 computational type theory IS NOT operational sem. + canonicity most formal type theories (defined by rules) want decidable type-checking 7

  19. Clarification #1 computational type theory IS NOT operational sem. + canonicity most formal type theories (defined by rules) want decidable type-checking f ≐ g ∈ nat -> nat not decidable in general but can be proved by induction in CTT (as proving a theorem about realizers) 7

  20. Clarification #2 most formal type theories want decidable type-checking => undecidable rules were ruled out computational type theory is fine with "undecidable rules" => ask users for guidance in practice (can be interactive & tactic-based) 8

  21. Cubical Realizers higher-dimensional programming [Angiuli, Harper & Wilson] 9

  22. Cubical Realizers higher-dimensional programming [Angiuli, Harper & Wilson] with dim expr r := 0 | 1 | x 9

  23. Circle base loop{x} 10

  24. Circle base loop{x} S1 value 10

  25. Circle base value base loop{x} S1 value 10

  26. Circle base value dim loop{r} expr base loop{x} value loop{x} loop{0} ↦ base S1 value loop{1} ↦ base 10

  27. Circle M ↦ M' ---------------------- S1elim(a.A, M, B, u.L) ↦ S1elim(a.A, M', B, w.L) base loop{x} S1 value 11

  28. Circle M ↦ M' ---------------------- S1elim(a.A, M, B, u.L) ↦ S1elim(a.A, M', B, w.L) base S1elim(a.A, base, B, w._) loop{x} ↦ B S1 value 11

  29. Circle M ↦ M' ---------------------- S1elim(a.A, M, B, u.L) ↦ S1elim(a.A, M', B, w.L) base S1elim(a.A, base, B, w._) loop{x} ↦ B S1 value S1elim(a.A, loop{x}, _, w.L) ↦ L<x/w> 11

  30. Kan: Coercions A<0/x> A<1/x> M coe{0->1} (x.A, M) 12

  31. Kan: Coercions A<0/x> A<1/x> M coe{0->1} (x.A, M) coe{r->r'}(x.A, M) ∈ A<r'/x> ∈ A<r/x> 12

  32. Kan: Homogeneous Comp. N1 N2 y x M 13

  33. Kan: Homogeneous Comp. N1 N2 y x M hcom{r->r'}(A, M) [x -> (y.N1, y.N2)] adjacency: needs exact equality ( ≐ ) 13

  34. Kan: Homogeneous Comp. N1 N2 y x M hcom{r->r'}(A, M) [x -> (y.N1, y.N2)] adjacency: needs exact equality ( ≐ ) note: we forbid empty systems 13

  35. Kan Circle coe{r->r'}(_.S1, M) ↦ M 14

  36. Kan Circle coe{r->r'}(_.S1, M) ↦ M hcom{r->r}(S1, M)... ↦ M 14

  37. Kan Circle coe{r->r'}(_.S1, M) ↦ M hcom{r->r}(S1, M)... ↦ M r != r' ri is 0 or 1 (the first) ---------------------------------- hcom{r->r'}(S1, M)...[ri -> (y.N_0, y.N_1)]... ↦ N_ri<r'/y> 14

  38. Kan Circle coe{r->r'}(_.S1, M) ↦ M hcom{r->r}(S1, M)... ↦ M r != r' ri is 0 or 1 (the first) ---------------------------------- hcom{r->r'}(S1, M)...[ri -> (y.N_0, y.N_1)]... ↦ N_ri<r'/y> r != r' ri != 0 ri != 1 formal --------------------------- composition hcom{r->r'}(S1, M)... value 14

  39. Kan Circle S1elim needs to handle new values 15

  40. Kan Circle S1elim needs to handle new values r != r' ri != 0 ri != 1 ------------------------------------------ S1elim(a.A, hcom{r->r'}(S1, M)..., B, w.L) ↦ com{r->r'}(z.A[hcom{r->z}(...).../a], S1elim(M, B, w.L))... (using the definable heterogeneous comp.) 15

  41. Cubical Stability Dimension substs. do not commute with evaluation! 16

  42. Cubical Stability Dimension substs. do not commute with evaluation! S1elim(a.A, loop{x}, B, w.L) |---------> L<x/w> -----> <0/x> L<0/w> 16

  43. Cubical Stability Dimension substs. do not commute with evaluation! S1elim(a.A, |---------> L<x/w> loop{x}, B, w.L) -----> ---> <0/x> <0/x> S1elim(a.A, |--> B L<0/w> <=??=> base, B, w.L) 16

  44. Cubical Stability Dimension substs. do not commute with evaluation! S1elim(a.A, |---------> L<x/w> loop{x}, B, w.L) -----> ---> <0/x> <0/x> S1elim(a.A, |--> B L<0/w> <=??=> base, B, w.L) Judgments for cubically stable types, memberships, values, etc 16

  45. Cubical Type Theory stability: consider every substitution 17

  46. Cubical Type Theory stability: consider every substitution A ≐ B type => under any further substitution ψ ... A ψ and B ψ stably* eval to A' and B', stably* recognizing the same stable* values and having stably* equal Kan structures (*see our arXiv & POPL papers for details) 17

  47. Cubical Type Theory stability: consider every substitution A ≐ B type => under any further substitution ψ ... A ψ and B ψ stably* eval to A' and B', stably* recognizing the same stable* values and having stably* equal Kan structures M ≐ N ∈ A => A ≐ A type and A evals to A', M and N stably* eval to M' and N', A' stably* views N' and M' as the same value (*see our arXiv & POPL papers for details) 17

  48. Comparison with CCHM based on realizability (closer to standard math equality) no connections no empty systems (handled by coe) 18

  49. Current Progress Done: dependent functions dependent pairs strict bools "weak" bools circle ... univalence for strict isomorphisms 19

  50. Current Progress Done: dependent functions dependent pairs strict bools "weak" bools circle ... univalence for strict isomorphisms Still working: Univalence & Kan universes 19

  51. RedPRL a proof assistant based on cubical realizability incorporates recent advances such as dependent subgoals (inspired by Spiwack's work) still nascent, changing everyday https://github.com/RedPRL/sml-redprl 20

  52. RedPRL Example p a b connection p {_}a "p(x /\ y)" a {_}a 21

  53. Conclusion Cubical extension of Nuprl realizers Canonicity on points (diff. from CCHM) Still working on Kan universes RedPRL (to be) an implementation 22

Recommend


More recommend