The Next 700 Syntactic Models of Type Theory Simon Boulier 1 - - PowerPoint PPT Presentation

the next 700 syntactic models of type theory
SMART_READER_LITE
LIVE PREVIEW

The Next 700 Syntactic Models of Type Theory Simon Boulier 1 - - PowerPoint PPT Presentation

. . . . . . . . . . . . . . The Next 700 Syntactic Models of Type Theory Simon Boulier 1 Pierre-Marie Pdrot 2 Nicolas Tabareau 1 CPP 17th January 2017 Pdrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models


slide-1
SLIDE 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Next 700 Syntactic Models of Type Theory

Simon Boulier1 Pierre-Marie Pédrot2 Nicolas Tabareau1

1INRIA, 2University of Ljubljana

CPP 17th January 2017

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 1 / 22

slide-2
SLIDE 2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A Beginner’s Tale

Historical recollection of a younger self using Coq: — I need to prove that Πx. f x = g x implies f = g to... — Nay, can’t do that. — Right, I’d also like to have Πe1 e2 : p = q. e1 = e2. How... — Nope, not possible either. — Fine. And what about ΠA B : Prop. (A ↔ B) → A = B? — Sigh.

Are you kidding me? This has to be obviously true!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 2 / 22

slide-3
SLIDE 3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A Beginner’s Tale

Historical recollection of a younger self using Coq: — I need to prove that Πx. f x = g x implies f = g to... — Nay, can’t do that. — Right, I’d also like to have Πe1 e2 : p = q. e1 = e2. How... — Nope, not possible either. — Fine. And what about ΠA B : Prop. (A ↔ B) → A = B? — Sigh.

Are you kidding me? This has to be obviously true!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 2 / 22

slide-4
SLIDE 4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What You’re Usually Told

If you ask why, generally you get something along the lines of: “That’s very simple to disprove. Let’s consider the split comprehension category where the Grothendieck fjbration is the well-known blue-haired syzygetic Kardashian functor and the cartesian structure is canonically given by the algebra morphisms

  • f hyper-loremipsum ω-potatoids. It is trivially a

counter-model.”

(Obviously up to my brain’s isomorphisms. Any resemblance to nLab is purely coincidental.)

We propose something that anybody can understand instead.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 3 / 22

slide-5
SLIDE 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What You’re Usually Told

If you ask why, generally you get something along the lines of: “That’s very simple to disprove. Let’s consider the split comprehension category where the Grothendieck fjbration is the well-known blue-haired syzygetic Kardashian functor and the cartesian structure is canonically given by the algebra morphisms

  • f hyper-loremipsum ω-potatoids. It is trivially a

counter-model.”

(Obviously up to my brain’s isomorphisms. Any resemblance to nLab is purely coincidental.)

We propose something that anybody can understand instead.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 3 / 22

slide-6
SLIDE 6

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What You’re Usually Told

If you ask why, generally you get something along the lines of: “That’s very simple to disprove. Let’s consider the split comprehension category where the Grothendieck fjbration is the well-known blue-haired syzygetic Kardashian functor and the cartesian structure is canonically given by the algebra morphisms

  • f hyper-loremipsum ω-potatoids. It is trivially a

counter-model.”

(Obviously up to my brain’s isomorphisms. Any resemblance to nLab is purely coincidental.)

We propose something that anybody∗ can understand instead.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 3 / 22

slide-7
SLIDE 7

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Proofs-as-programs to the rescue

What is a model?

Takes syntax as input. Interprets it into some low-level language. Must preserve the meaning of the source. Refjnes the behaviour of under-specifjed structures. Luckily we’re computer scientists in here.

« Oh yes, we call that a compiler... »

(Thanks, Curry-Howard!)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 4 / 22

slide-8
SLIDE 8

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Proofs-as-programs to the rescue

What is a model?

Takes syntax as input. Interprets it into some low-level language. Must preserve the meaning of the source. Refjnes the behaviour of under-specifjed structures. Luckily we’re computer scientists in here.

« Oh yes, we call that a compiler... »

(Thanks, Curry-Howard!)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 4 / 22

slide-9
SLIDE 9

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Proofs-as-programs to the rescue

What is a model?

Takes syntax as input. Interprets it into some low-level language. Must preserve the meaning of the source. Refjnes the behaviour of under-specifjed structures. Luckily we’re computer scientists in here.

« Oh yes, we call that a compiler... »

(Thanks, Curry-Howard!)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 4 / 22

slide-10
SLIDE 10

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Syntactic Models

I don’t understand crazy category theory. But I understand well type-theory! And I know how to write program translations.

Let’s write models as compilers from type theory into itself!

;

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 5 / 22

slide-11
SLIDE 11

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Syntactic Models

I don’t understand crazy category theory. But I understand well type-theory! And I know how to write program translations.

Let’s write models as compilers from type theory into itself!

Type Theory Type Theory + Axiom X

compilation of X ...

  • f Y
  • f Z

;

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 5 / 22

slide-12
SLIDE 12

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Syntactic Models II

Defjne [·] on the syntax and derive the type interpretation [ [·] ] from it s.t. ⊢ M : A implies ⊢ [M] : [ [A] ] Obviously, that’s subtle. The correctness of lies in the meta (Darn, Gödel!) The translation must preserve typing (Not easy) In particular, it must preserve conversion (Argh!) Yet, a lot of nice consequences. Does not require non-type-theoretical foundations (monism) Can be implemented in your favourite proof assistant Easy to show (relative) consistency, look at False Easier to understand computationally

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 6 / 22

slide-13
SLIDE 13

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Syntactic Models II

Defjne [·] on the syntax and derive the type interpretation [ [·] ] from it s.t. ⊢ M : A implies ⊢ [M] : [ [A] ] Obviously, that’s subtle. The correctness of [·] lies in the meta (Darn, Gödel!) The translation must preserve typing (Not easy) In particular, it must preserve conversion (Argh!) Yet, a lot of nice consequences. Does not require non-type-theoretical foundations (monism) Can be implemented in your favourite proof assistant Easy to show (relative) consistency, look at False Easier to understand computationally

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 6 / 22

slide-14
SLIDE 14

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Syntactic Models II

Defjne [·] on the syntax and derive the type interpretation [ [·] ] from it s.t. ⊢ M : A implies ⊢ [M] : [ [A] ] Obviously, that’s subtle. The correctness of [·] lies in the meta (Darn, Gödel!) The translation must preserve typing (Not easy) In particular, it must preserve conversion (Argh!) Yet, a lot of nice consequences. Does not require non-type-theoretical foundations (monism) Can be implemented in your favourite proof assistant Easy to show (relative) consistency, look at [ [False] ] Easier to understand computationally

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 6 / 22

slide-15
SLIDE 15

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

In The Remainder of This Talk

700 Syntactic Models You Probably Didn't Know Provide the Most Striking Counter-Examples to Type Theory

The 578th Will Shock You!

(Just kidding. I don’t want doctors to hate me.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 7 / 43571

slide-16
SLIDE 16

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

In The Remainder of This Talk

700 Syntactic Models You Probably Didn't Know Provide the Most Striking Counter-Examples to Type Theory

The 578th Will Shock You!

(Just kidding. I don’t want doctors to hate me.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 7 / 43571

slide-17
SLIDE 17

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

In The Remainder of This Talk

700 Syntactic Models You Probably Didn't Know Provide the Most Striking Counter-Examples to Type Theory

The 578th Will Shock You!

(Just kidding. I don’t want doctors to hate me.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 7 / 43571

slide-18
SLIDE 18

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where the Wild Things Are

— What is fully specifjed in type theory? Inductive types, because of dependent elimination. — What is not fully specifjed in type theory? Everything else! Functions: only specifjed w.r.t.

  • reduction

Co-inductive types: only specifjed w.r.t. projections Universes: only specifjed w.r.t. rhs of a colon ... Let’s joyfully refjne the intensional behaviour of random stufg in there.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 8 / 22

slide-19
SLIDE 19

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where the Wild Things Are

— What is fully specifjed in type theory? Inductive types, because of dependent elimination. — What is not fully specifjed in type theory? Everything else! Functions: only specifjed w.r.t. β-reduction Co-inductive types: only specifjed w.r.t. projections Universes: only specifjed w.r.t. rhs of a colon ... Let’s joyfully refjne the intensional behaviour of random stufg in there.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 8 / 22

slide-20
SLIDE 20

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality

First target: functions. The only thing you know about them: (λx : A. M) N ≡ M{x := N} Let’s take advantage of this by mangling functions. x x x A M x A M true M N M N x A B x A B bool A A Obviously M A implies M A .

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 9 / 22

slide-21
SLIDE 21

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality

First target: functions. The only thing you know about them: (λx : A. M) N ≡ M{x := N} Let’s take advantage of this by mangling functions. [x] := x [λx : A. M] := (λx : [ [A] ]. [M], true) [M N] := [M].π1 [N] [□] := □ [Πx : A. B] := (Πx : [ [A] ]. [ [B] ]) × bool [. . .] := . . . [ [A] ] := [A] Obviously M A implies M A .

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 9 / 22

slide-22
SLIDE 22

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality

First target: functions. The only thing you know about them: (λx : A. M) N ≡ M{x := N} Let’s take advantage of this by mangling functions. [x] := x [λx : A. M] := (λx : [ [A] ]. [M], true) [M N] := [M].π1 [N] [□] := □ [Πx : A. B] := (Πx : [ [A] ]. [ [B] ]) × bool [. . .] := . . . [ [A] ] := [A] Obviously Γ ⊢ M : A implies [ [Γ] ] ⊢ [M] : [ [A] ].

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 9 / 22

slide-23
SLIDE 23

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Through The Looking Glass

Now, we interpret everything through the [·] translation. We call the source theory all terms that have some type [ [A] ] Given M : [ [A] ] we can extend the source with a constant M• : A [M•] := M Conversion is extended the same way: M ≡source N := [M] ≡target [N]

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 10 / 22

slide-24
SLIDE 24

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality II

Syntactically, this means that you can extend the source theory with Γ, x : A ⊢ M : B Γ ⊢ λ′x : A. M : Πx : A. B defjned as: [λ′x : A. M] := (λx : [ [A] ]. [M], false) Rembember: [λx : A. M] := (λx : [ [A] ]. [M], true) [M N] := [M].π1 [N] Clearly this new abstraction has the same behaviour as the original one. x A M N M x N

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 11 / 22

slide-25
SLIDE 25

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality II

Syntactically, this means that you can extend the source theory with Γ, x : A ⊢ M : B Γ ⊢ λ′x : A. M : Πx : A. B defjned as: [λ′x : A. M] := (λx : [ [A] ]. [M], false) Rembember: [λx : A. M] := (λx : [ [A] ]. [M], true) [M N] := [M].π1 [N] Clearly this new abstraction has the same behaviour as the original one. [(λ′x : A. M) N] ≡ [M{x := N}]

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 11 / 22

slide-26
SLIDE 26

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality III

Now, it is easy to see how to negate functional extensionality. Consider: Σ(f g : 1 → 1). (Πi : 1. f i = g i) ∧ f ̸= g This is translated into something that is essentially: f g bool i f i g i f g

(The actual translation is a little noisier, but this does not change the idea.)

Take f x x and g x x , and voilá!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 12 / 22

slide-27
SLIDE 27

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality III

Now, it is easy to see how to negate functional extensionality. Consider: Σ(f g : 1 → 1). (Πi : 1. f i = g i) ∧ f ̸= g This is translated into something that is essentially: Σ(f g : (1 → 1) × bool). (Πi : 1. f.π1 i = g.π1 i) ∧ f ̸= g

(The actual translation is a little noisier, but this does not change the idea.)

Take f x x and g x x , and voilá!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 12 / 22

slide-28
SLIDE 28

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Functional Extensionality III

Now, it is easy to see how to negate functional extensionality. Consider: Σ(f g : 1 → 1). (Πi : 1. f i = g i) ∧ f ̸= g This is translated into something that is essentially: Σ(f g : (1 → 1) × bool). (Πi : 1. f.π1 i = g.π1 i) ∧ f ̸= g

(The actual translation is a little noisier, but this does not change the idea.)

Take f := [λx : 1. x] and g := [λ′x : 1. x], and voilá!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 12 / 22

slide-29
SLIDE 29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where We Cheated

We did not explicit the rules of the source theory. In particular, it is clear that the model invalidates

  • rules.

x A M x M x A M x true M It’s much harder to negate extensionality while preserving .

(Dialectica does that.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 13 / 22

slide-30
SLIDE 30

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where We Cheated

We did not explicit the rules of the source theory. In particular, it is clear that the model invalidates η-rules. [λx : A. M x] ̸≡ [M] ≡ ≡ (λx : [ [A] ]. [M].π1 x, true) ̸≡ [M] It’s much harder to negate extensionality while preserving η.

(Dialectica does that.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 13 / 22

slide-31
SLIDE 31

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stream extensionality

We can use a very similar trick to intentionalize steams. Idea: [ [stream A] ] := (stream [ [A] ]) × bool This interprets all negative co-inductive properties (“co-pattern style”). And there is no reasonable η-rule on cofjxpoints anyway. Then just as easily we show that: f g stream bisimilar f g f g

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 14 / 22

slide-32
SLIDE 32

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stream extensionality

We can use a very similar trick to intentionalize steams. Idea: [ [stream A] ] := (stream [ [A] ]) × bool This interprets all negative co-inductive properties (“co-pattern style”). And there is no reasonable η-rule on cofjxpoints anyway. Then just as easily we show that: Σ(f g : stream 1). (bisimilar 1 f g) ∧ f ̸= g

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 14 / 22

slide-33
SLIDE 33

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Type Extensionality

Once again, the same trick can be applied to types. [x] := x [λx : A. M] := λx : [ [A] ]. [M] [M N] := [M] [N] [□i] := (□i × bool, true) [Πx : A. B] := ((Πx : [ [A] ]. [ [B] ]), true) [ [A] ] := [A].π1 “New types are a pair of a type and a boolean!” Tricky fjxpoint:

i i i

bool true

i

bool

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 15 / 22

slide-34
SLIDE 34

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Type Extensionality

Once again, the same trick can be applied to types. [x] := x [λx : A. M] := λx : [ [A] ]. [M] [M N] := [M] [N] [□i] := (□i × bool, true) [Πx : A. B] := ((Πx : [ [A] ]. [ [B] ]), true) [ [A] ] := [A].π1 “New types are a pair of a type and a boolean!” Tricky fjxpoint: [□i] : [ [□i+1] ] ⇔ (□i × bool, true) : □i+1 × bool

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 15 / 22

slide-35
SLIDE 35

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Propositional Extensionality

You can translate an impredicative universe alike: [∗] := (∗ × bool, true) It is still an impredicative universe! It is then easy to show: P Q P Q P Q P Q bool P Q P Q Take for instance True and its evil twin True : True True true True True false

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 16 / 22

slide-36
SLIDE 36

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Negating Propositional Extensionality

You can translate an impredicative universe alike: [∗] := (∗ × bool, true) It is still an impredicative universe! It is then easy to show: [ [Σ(P Q : ∗). (P ↔ Q) ∧ P ̸= Q] ] ∼ Σ(P Q : ∗ × bool). (P.π1 ↔ Q.π1) ∧ P ̸= Q Take for instance True and its evil twin True†: [True] := (True, true) [True†] := (True, false)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 16 / 22

slide-37
SLIDE 37

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where Will They Stop?

This shows that universes are “amorphous” in type theory The only thing that matters is [ [·] ] in the translation! We simply used a projection here Let’s do way much better (or worse, depends on your beliefs).

Let’s turn Coq into Python!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 17 / 22

slide-38
SLIDE 38

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where Will They Stop?

This shows that universes are “amorphous” in type theory The only thing that matters is [ [·] ] in the translation! We simply used a projection here Let’s do way much better (or worse, depends on your beliefs).

Let’s turn Coq into Python!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 17 / 22

slide-39
SLIDE 39

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Where Will They Stop?

This shows that universes are “amorphous” in type theory The only thing that matters is [ [·] ] in the translation! We simply used a projection here Let’s do way much better (or worse, depends on your beliefs).

Let’s turn Coq into Python!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 17 / 22

slide-40
SLIDE 40

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Basilisk

Idea: if A : □ then [A] : TYPE, the type of inductive-recursive codes!

Inductive TYPE := | U : TYPE | Pi : Π (A : TYPE), (Elt A → TYPE) → TYPE | . . . with Elt (A : TYPE) := match A with | U ⇒ TYPE | Pi A B ⇒ Π (x : Elt A), Elt (B x) | . . . end. (Note: We need to stratify a bit to make this work.)

x A B Pi A x A B A Elt A

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 18 / 22

slide-41
SLIDE 41

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Basilisk

Idea: if A : □ then [A] : TYPE, the type of inductive-recursive codes!

Inductive TYPE := | U : TYPE | Pi : Π (A : TYPE), (Elt A → TYPE) → TYPE | . . . with Elt (A : TYPE) := match A with | U ⇒ TYPE | Pi A B ⇒ Π (x : Elt A), Elt (B x) | . . . end. (Note: We need to stratify a bit to make this work.)

[□] := U [Πx : A. B] := Pi [A] (λx : [ [A] ]. [B]) [ [A] ] := Elt [A]

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 18 / 22

slide-42
SLIDE 42

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Behold! This allows defjnitions by case-analysis on types!

For instance, it is now possible to defjne: f : ΠA : □. A → A (∼ ΠA : TYPE. Elt A → Elt A) f bool : bool → bool is negation f A is identity otherwise Morally it is the most anti-parametric thing one can do. Abstractly:

Type theory is compatible with ad-hoc polymorphism.

(Yes, this surprised me as well.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 19 / 22

slide-43
SLIDE 43

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Behold! This allows defjnitions by case-analysis on types!

For instance, it is now possible to defjne: f : ΠA : □. A → A (∼ ΠA : TYPE. Elt A → Elt A) f bool : bool → bool is negation f A is identity otherwise Morally it is the most anti-parametric thing one can do. Abstractly:

Type theory is compatible with ad-hoc polymorphism.

(Yes, this surprised me as well.)

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 19 / 22

slide-44
SLIDE 44

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What else

We have a soundness proof in Coq for most of the previous translations. Based on Siles’s defjnition of De Bruijn implementaton of CC “Deep embedding“ Shows that the model preserve consistency in a easy way There is also an experimental plugin to translate terms automagically. https://github.com/CoqHott/Program-translations-CC-omega

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 20 / 22

slide-45
SLIDE 45

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

We’ve described a simple class of models Rooted in computer science POV Suffjcient to negate a lot of extensionality principles

Functions Co-inductive types Universes

Implemented them! We advocate for this kind of models A few more instances from the literature Stay tuned!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 21 / 22

slide-46
SLIDE 46

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

We’ve described a simple class of models Rooted in computer science POV Suffjcient to negate a lot of extensionality principles

Functions Co-inductive types Universes

Implemented them! We advocate for this kind of models A few more instances from the literature Stay tuned!

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 21 / 22

slide-47
SLIDE 47

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Scribitur ad narrandum, non ad probandum

Thanks for your attention.

Pédrot & al. (INRIA & U. Ljubljana) The Next 700 Syntactic Models 17/01/2017 22 / 22