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

computational higher dimensional type
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1

Carlo Angiuli Evan Cavallo Favonia Bob Harper Jon Sterling Todd Wilson

Computational Higher-dimensional Type Theory & RedPRL

2017.07.04 @ INI

slide-2
SLIDE 2

2

Computational Types

programs/ realizers computation

slide-3
SLIDE 3

2

Computational Types

programs/ realizers computation computational type theory computational type theory theory of computation <-----

slide-4
SLIDE 4

2

Computational Types

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

slide-5
SLIDE 5

3

We use an un(i)typed lambda calculus as in Nuprl.

Computational Types

slide-6
SLIDE 6

3

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

Computational Types

slide-7
SLIDE 7

3

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

Computational Types

slide-8
SLIDE 8

3

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"

Computational Types

slide-9
SLIDE 9

3

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".

Computational Types

slide-10
SLIDE 10

4

Go Higher-Dimensional

The Book HoTT and the CCHM system have higher-dim. interpretations

Can we do the same?

slide-11
SLIDE 11

4

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

slide-12
SLIDE 12

5

Potential Benefits

slide-13
SLIDE 13

5

Potential Benefits

  • 1. ≐ is closer to equational

reasoning in standard math

functional extensionality full universal properties (ex: eta for natural numbers) ...

slide-14
SLIDE 14

5

Potential Benefits

  • 1. ≐ is closer to equational

reasoning in standard math

  • 2. adding more theorems

cannot break computation

functional extensionality full universal properties (ex: eta for natural numbers) ... realizers & proof theory separated perfect for programming

slide-15
SLIDE 15

6

Clarification #0

computational type theory IS NOT "extensional type theory"

slide-16
SLIDE 16

6

Clarification #0

computational type theory IS NOT "extensional type theory"

You can collect your favorite theorems as rules in your favorite theory Realizers can be a model of "ETT", a model of "ITT",

  • r potentially a model of HoTT.
slide-17
SLIDE 17

7

Clarification #1

computational type theory IS NOT

  • perational sem. + canonicity
slide-18
SLIDE 18

7

Clarification #1

computational type theory IS NOT

  • perational sem. + canonicity

most formal type theories (defined by rules) want decidable type-checking

slide-19
SLIDE 19

7

Clarification #1

computational type theory IS NOT

  • perational 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)

slide-20
SLIDE 20

8

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)

slide-21
SLIDE 21

9

Cubical Realizers

higher-dimensional programming [Angiuli, Harper & Wilson]

slide-22
SLIDE 22

9

Cubical Realizers

higher-dimensional programming [Angiuli, Harper & Wilson]

with dim expr r := 0 | 1 | x

slide-23
SLIDE 23

10

Circle

base loop{x}

slide-24
SLIDE 24

10

Circle

base loop{x} S1 value

slide-25
SLIDE 25

10

Circle

base loop{x} base value S1 value

slide-26
SLIDE 26

10

loop{r}

Circle

dim expr

loop{x} value loop{0} ↦ base loop{1} ↦ base base loop{x} base value S1 value

slide-27
SLIDE 27

11

Circle

base loop{x} M ↦ M'

  • S1elim(a.A, M, B, u.L)

↦ S1elim(a.A, M', B, w.L) S1 value

slide-28
SLIDE 28

11

Circle

S1elim(a.A, base, B, w._) ↦ B base loop{x} M ↦ M'

  • S1elim(a.A, M, B, u.L)

↦ S1elim(a.A, M', B, w.L) S1 value

slide-29
SLIDE 29

11

Circle

S1elim(a.A, base, B, w._) ↦ B base loop{x} S1elim(a.A, loop{x}, _, w.L) ↦ L<x/w> M ↦ M'

  • S1elim(a.A, M, B, u.L)

↦ S1elim(a.A, M', B, w.L) S1 value

slide-30
SLIDE 30

12

Kan: Coercions

coe{0->1} (x.A, M) M A<0/x> A<1/x>

slide-31
SLIDE 31

12

coe{r->r'}(x.A, M) ∈ A<r'/x>

Kan: Coercions

coe{0->1} (x.A, M) M A<0/x> A<1/x> A<r/x> ∈

slide-32
SLIDE 32

13

Kan: Homogeneous Comp.

M x y N1 N2

slide-33
SLIDE 33

13

hcom{r->r'}(A, M) [x -> (y.N1, y.N2)]

Kan: Homogeneous Comp.

M x y N1 N2 adjacency: needs exact equality (≐)

slide-34
SLIDE 34

13

hcom{r->r'}(A, M) [x -> (y.N1, y.N2)]

Kan: Homogeneous Comp.

M x y N1 N2 adjacency: needs exact equality (≐) note: we forbid empty systems

slide-35
SLIDE 35

14

Kan Circle

coe{r->r'}(_.S1, M) ↦ M

slide-36
SLIDE 36

14

Kan Circle

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

slide-37
SLIDE 37

14

Kan Circle

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>

coe{r->r'}(_.S1, M) ↦ M

slide-38
SLIDE 38

14

Kan Circle

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

  • hcom{r->r'}(S1, M)... value

coe{r->r'}(_.S1, M) ↦ M formal composition

slide-39
SLIDE 39

15

Kan Circle

S1elim needs to handle new values

slide-40
SLIDE 40

15

Kan Circle

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.)

S1elim needs to handle new values

slide-41
SLIDE 41

16

Cubical Stability

Dimension substs. do not commute with evaluation!

slide-42
SLIDE 42

16

Cubical Stability

S1elim(a.A, loop{x}, B, w.L) |---------> L<x/w>

  • ---->

<0/x> L<0/w>

Dimension substs. do not commute with evaluation!

slide-43
SLIDE 43

16

Cubical Stability

S1elim(a.A, loop{x}, B, w.L) S1elim(a.A, base, B, w.L) |---------> L<x/w> |--> B

  • -->

<0/x>

  • ---->

<0/x> L<0/w>

Dimension substs. do not commute with evaluation!

<=??=>

slide-44
SLIDE 44

16

Cubical Stability

S1elim(a.A, loop{x}, B, w.L) S1elim(a.A, base, B, w.L) |---------> L<x/w> |--> B

  • -->

<0/x>

  • ---->

<0/x> L<0/w>

Dimension substs. do not commute with evaluation!

<=??=> Judgments for cubically stable types, memberships, values, etc

slide-45
SLIDE 45

17

stability: consider every substitution

Cubical Type Theory

slide-46
SLIDE 46

17

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

Cubical Type Theory

(*see our arXiv & POPL papers for details)

slide-47
SLIDE 47

17

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

Cubical Type Theory

(*see our arXiv & POPL papers for details)

slide-48
SLIDE 48

18

Comparison with CCHM

no connections no empty systems based on realizability

(closer to standard math equality) (handled by coe)

slide-49
SLIDE 49

19

Current Progress

dependent functions dependent pairs strict bools "weak" bools circle ... univalence for strict isomorphisms

Done:

slide-50
SLIDE 50

19

Current Progress

dependent functions dependent pairs strict bools "weak" bools circle ... univalence for strict isomorphisms Univalence & Kan universes

Done: Still working:

slide-51
SLIDE 51

20

RedPRL

a proof assistant based on cubical realizability incorporates recent advances such as dependent subgoals still nascent, changing everyday

https://github.com/RedPRL/sml-redprl (inspired by Spiwack's work)

slide-52
SLIDE 52

21

RedPRL Example

connection "p(x /\ y)" p p {_}a {_}a b a a

slide-53
SLIDE 53

22

Conclusion

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

slide-54
SLIDE 54

22

Conclusion

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

Acknowledgements

Our work is strongly influenced by the BCH and CCHM papers, work by Licata and Brunerie, and many inspiring discussions within the HoTT community.