Coherence for cartesian closed bicategories, via - - PowerPoint PPT Presentation

coherence for cartesian closed bicategories via
SMART_READER_LITE
LIVE PREVIEW

Coherence for cartesian closed bicategories, via - - PowerPoint PPT Presentation

Coherence for cartesian closed bicategories, via normalisation-by-evaluation Marcelo Fiore : and Philip Saville* : University of Cambridge Department of Computer Science and Technology *University of Edinburgh School of Informatics 1 / 41


slide-1
SLIDE 1

Coherence for cartesian closed bicategories, via normalisation-by-evaluation

Marcelo Fiore: and Philip Saville*

:University of Cambridge

Department of Computer Science and Technology *University of Edinburgh School of Informatics

1 / 41

slide-2
SLIDE 2

Cartesian closed bicategories

Cartesian closed categories ‘up to isomorphism’. Examples:

  • Generalised species and cartesian distributors

particularly for applications in higher category theory (Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

(Yamada & Abramsky, Winskel et al., Paquet)

2 / 41

slide-3
SLIDE 3

Coherence

3 / 41

slide-4
SLIDE 4

Internal monoids

In a category with finite products: 1 e Ý Ñ M

m

Ð Ý M ˆ M Unit law 1 ˆ M M ˆ 1 M ˆ M M

e ˆ M M ˆ e – – m

  • Assoc. law

pM ˆ Mq ˆ M M ˆ pM ˆ Mq M ˆ M M ˆ M M

– M ˆ m m m ˆ M m

4 / 41

slide-5
SLIDE 5

Internal monoids

In a category with finite products: 1 e Ý Ñ M

m

Ð Ý M ˆ M In Set: monoids In Cat: strict monoidal categories Unit law 1 ˆ M M ˆ 1 M ˆ M M

e ˆ M M ˆ e – – m

  • Assoc. law

pM ˆ Mq ˆ M M ˆ pM ˆ Mq M ˆ M M ˆ M M

– M ˆ m m m ˆ M m

4 / 41

slide-6
SLIDE 6

Internal pseudomonoids

In Cat: 1 e Ý Ñ M

m

Ð Ý M ˆ M Unit 2-cells 1 ˆ M M ˆ 1 M ˆ M M

e ˆ M M ˆ e » » m

  • Assoc. 2-cell

pM ˆ Mq ˆ M M ˆ pM ˆ Mq M ˆ M M ˆ M M

» M ˆ m m m ˆ M m λ

α

ρ

– data

5 / 41

slide-7
SLIDE 7

Internal pseudomonoids

In Cat: 1 e Ý Ñ M

m

Ð Ý M ˆ M Unit 2-cells 1 ˆ M M ˆ 1 M ˆ M M

e ˆ M M ˆ e » » m

  • Assoc. 2-cell

pM ˆ Mq ˆ M M ˆ pM ˆ Mq M ˆ M M ˆ M M

» M ˆ m m m ˆ M m λ

α

ρ

– + triangle and pentagon laws ù monoidal category data

5 / 41

slide-8
SLIDE 8

Internal pseudomonoids

In Cat: 1 e Ý Ñ M

m

Ð Ý M ˆ M ...likewise in any fp-bicategory Unit 2-cells 1 ˆ M M ˆ 1 M ˆ M M

e ˆ M M ˆ e » » m

  • Assoc. 2-cell

pM ˆ Mq ˆ M M ˆ pM ˆ Mq M ˆ M M ˆ M M

» M ˆ m m m ˆ M m λ

α

ρ

– + triangle and pentagon laws ù monoidal category data

5 / 41

slide-9
SLIDE 9

In a CCC every rX ñ Xs becomes a monoid: ´ 1

IdX

Ý Ý Ñ rX ñ Xs

˝

Ð Ý rX ñ Xs ˆ rX ñ Xs ¯ ? In a cc-bicategory every rX ñ Xs becomes a pseudomonoid: ´ 1

IdX

Ý Ý Ñ rX ñ Xs

˝

Ð Ý rX ñ Xs ˆ rX ñ Xs ¯

need to check coherence laws (i.e. triangle + pentagon)

6 / 41

slide-10
SLIDE 10

coherence Mac Lane-style

"all diagrams commute" proof theory, rewriting theory

coherence-by-strictification

B » B 2-cat. universal algebra, Yoneda embedding

7 / 41

slide-11
SLIDE 11

coherence Mac Lane-style

"all diagrams commute" proof theory, rewriting theory

coherence-by-strictification

B » B 2-cat. universal algebra, Yoneda embedding

“denotational semantics”

(1) construct an internal language (2) prove normalisation by semantic argument

7 / 41

slide-12
SLIDE 12

coherence “denotational semantics”

(1) construct an internal language (2) prove normalisation by semantic argument

‚ builds on categorical & type-theoretic intuition ‚ once set up about as hard as categorical proof

7 / 41

slide-13
SLIDE 13

Cartesian closed bicategories

8 / 41

slide-14
SLIDE 14

Composition by UMP ñ bicategory

In a category C with pullbacks:

  • 1. objects: objects of C,
  • 2. 1-cells A ù B: spans pA Ð X Ñ Bq,
  • 3. 2-cells: commutative squares

X A B Y

h

Composition defined by pullback: X ˆB Y X Y A B C

x

9 / 41

slide-15
SLIDE 15

Composition by UMP ñ bicategory

In a category C with pullbacks:

  • 1. objects: objects of C,
  • 2. 1-cells A ù B: spans pA Ð X Ñ Bq,
  • 3. 2-cells: commutative squares

X A B Y

h

Composition defined by pullback: ù associative up to iso X ˆB Y X Y A B C

x

9 / 41

slide-16
SLIDE 16

Bicategories

10 / 41

slide-17
SLIDE 17

Bicategories

  • Objects X P obpBq,

10 / 41

slide-18
SLIDE 18

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

10 / 41

slide-19
SLIDE 19

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

1-cells X

f

Ý Ñ Y 2-cells X Y

f

óα

f 1

10 / 41

slide-20
SLIDE 20

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

1-cells X

f

Ý Ñ Y 2-cells X Y

f

óα

f 1

X Y

f f 1 óα óα1 f 2

10 / 41

slide-21
SLIDE 21

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

1-cells X

f

Ý Ñ Y 2-cells X Y

f

óα

f 1

  • Identities IdX : X Ñ X and composition

BpY , Zq ˆ BpX, Y q

˝X,Y ,Z

Ý Ý Ý Ý Ñ BpX, Zq

10 / 41

slide-22
SLIDE 22

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

1-cells X

f

Ý Ñ Y 2-cells X Y

f

óα

f 1

  • Identities IdX : X Ñ X and composition

BpY , Zq ˆ BpX, Y q

˝X,Y ,Z

Ý Ý Ý Ý Ñ BpX, Zq X Y Z

f óα f 1 g óβ g1

10 / 41

slide-23
SLIDE 23

Bicategories

  • Objects X P obpBq,
  • Hom-categories

` BpX, Y q, ‚, id ˘ :

1-cells X

f

Ý Ñ Y 2-cells X Y

f

óα

f 1

  • Identities IdX : X Ñ X and composition

BpY , Zq ˆ BpX, Y q

˝X,Y ,Z

Ý Ý Ý Ý Ñ BpX, Zq

  • Invertible 2-cells

ph ˝ gq ˝ f

ah,g,f

ù ù ù ñ h ˝ pg ˝ f q IdX ˝ f

lf

ù ñ f g ˝ IdX

rg

ù ñ g subject to a triangle law and pentagon law.

10 / 41

slide-24
SLIDE 24

Cartesian closed bicategories

Bicategories B equipped with

11 / 41

slide-25
SLIDE 25

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

B ` X, śn

i“1Ai

˘ śn

i“1 BpX, Aiq

» BpX, A “

⊲ Bq

BpX ˆ A, Bq » NB: Differ from the ‘cartesian bicategories’ of Carboni and Walters!

11 / 41

slide-26
SLIDE 26

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

B ` X, śn

i“1Ai

˘ śn

i“1 BpX, Aiq pπ1˝´,...,πn˝´q

% »

x´,...,“y

(tupling)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

NB: Differ from the ‘cartesian bicategories’ of Carboni and Walters!

11 / 41

slide-27
SLIDE 27

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

B ` X, śn

i“1Ai

˘ śn

i“1 BpX, Aiq pπ1˝´,...,πn˝´q

% »

x´,...,“y

(tupling)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

πi ˝ xf1, . . . , fny

ù ñ fi g

ù ñ xg ˝ π1, . . . , g ˝ πny

11 / 41

slide-28
SLIDE 28

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

B ` X, śn

i“1Ai

˘ śn

i“1 BpX, Aiq pπ1˝´,...,πn˝´q

% »

x´,...,“y

(tupling)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

πi ˝ xf1, . . . , fny

ù ñ fi g

ù ñ xg ˝ π1, . . . , g ˝ πny evalA,B ˝ pλf ˆ Aq

ù ñ f g

ù ñ λpevalA,B ˝ pg ˆ Aqq

11 / 41

slide-29
SLIDE 29

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

12 / 41

slide-30
SLIDE 30

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

12 / 41

slide-31
SLIDE 31

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution

x1 : A1, . . . , xn : An $ t : B p∆ $ ui : Aiqi“1.,n ∆ $ t txi ÞÑ uiu : B

x1 : A1, . . . , xn : An $ τ : t ñ t1 : B p∆ $ σi : ui ñ u1

i : Aiqi“1,...,n

∆ $ τ txi ÞÑ σiu : t txi ÞÑ uiu ñ t1 xi ÞÑ u1

i

( : B

ù binds the variables x1, . . . , xn

12 / 41

slide-32
SLIDE 32

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites

12 / 41

slide-33
SLIDE 33

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites
  • STLC embeds as explicit-substitution free fragment

12 / 41

slide-34
SLIDE 34

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites
  • STLC embeds as explicit-substitution free fragment
  • Free property for syntactic model

Γ A

Γ$t:A óΓ $ τ : t ñ t1 : A Γ$t1:A

12 / 41

slide-35
SLIDE 35

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites
  • STLC embeds as explicit-substitution free fragment
  • Free property for syntactic model

ù A logic of program transformations (modulo equations) there exists a rewrite t ñ t1 iff t “βη t1

12 / 41

slide-36
SLIDE 36

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites
  • STLC embeds as explicit-substitution free fragment
  • Free property for syntactic model

ù A logic of program transformations (modulo equations) there exists a rewrite t ñ t1 iff t “βη t1

12 / 41

slide-37
SLIDE 37

The internal language for cc-bicategories, Λˆ,Ñ

ps

Judgements c.f. Hilken, Hirschowitz

Terms Γ $ t : A (1-cells) Rewrites Γ $ τ : t ñ t1 : A (2-cells) Equations Γ $ τ ” τ 1 : t ñ t1 : A

Features

  • Weak composition enforced by explicit substitution
  • Usual STLC operations on terms and rewrites
  • STLC embeds as explicit-substitution free fragment
  • Free property for syntactic model

ù A logic of program transformations (modulo equations) there exists a rewrite t ñ t1 iff t “βη t1 ù coherence of cc-bicategories = coherence property of 2-cells

12 / 41

slide-38
SLIDE 38

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

13 / 41

slide-39
SLIDE 39

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

Corollary

For any f , f 1 : X Ñ Y in the free cc-bicategory on a graph, there exists at most one 2-cell τ : f ñ f 1.

13 / 41

slide-40
SLIDE 40

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

Corollary

For any f , f 1 : X Ñ Y in the free cc-bicategory on a graph, there exists at most one 2-cell τ : f ñ f 1. ù can use STLC for constructions in cc-bicategories!

13 / 41

slide-41
SLIDE 41

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

Corollary

For any f , f 1 : X Ñ Y in the free cc-bicategory on a graph, there exists at most one 2-cell τ : f ñ f 1. ù can use STLC for constructions in cc-bicategories!

  • 1. prove result in STLC

13 / 41

slide-42
SLIDE 42

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

Corollary

For any f , f 1 : X Ñ Y in the free cc-bicategory on a graph, there exists at most one 2-cell τ : f ñ f 1. ù can use STLC for constructions in cc-bicategories!

  • 1. prove result in STLC
  • 2. βη-equalities ù 2-cells

13 / 41

slide-43
SLIDE 43

Theorem (Coherence)

For any t and t1 in Λˆ,Ñ

ps

, there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

Corollary

For any f , f 1 : X Ñ Y in the free cc-bicategory on a graph, there exists at most one 2-cell τ : f ñ f 1. ù can use STLC for constructions in cc-bicategories!

  • 1. prove result in STLC
  • 2. βη-equalities ù 2-cells
  • 3. coherence guaranteed

13 / 41

slide-44
SLIDE 44

Normalisation-by-evaluation

14 / 41

slide-45
SLIDE 45

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

´ quote

15 / 41

slide-46
SLIDE 46

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

´ nfp´q quote

15 / 41

slide-47
SLIDE 47

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables defined by mutual induction

´ nfp´q quote unquote

15 / 41

slide-48
SLIDE 48

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables

´ nfp´q quote unquote

For $ λx.t : A “

⊲ B, get t : A Ñ B.

15 / 41

slide-49
SLIDE 49

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables

´ nfp´q quote unquote

For $ λx.t : A “

⊲ B, get t : A Ñ B. For fresh x:

unquotepxq : A

15 / 41

slide-50
SLIDE 50

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables

´ nfp´q quote unquote

For $ λx.t : A “

⊲ B, get t : A Ñ B. For fresh x:

tpunquotepxqq : B

15 / 41

slide-51
SLIDE 51

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables

´ nfp´q quote unquote

For $ λx.t : A “

⊲ B, get t : A Ñ B. For fresh x:

quoteptpunquotepxqqq : B

15 / 41

slide-52
SLIDE 52

Normalisation-by-evaluation

Aim: find canonical representatives within each βη-equivalence class Strategy:

Syntax

βη-equivalent terms t, t1, t2, . . .

Semantics

t “ t1 “ t2 “ . . .

Normal terms

nfptq “ quoteptq “ . . . (long-βη)

Neutral terms

includes variables

´ nfp´q quote unquote

For $ λx.t : A “

⊲ B, get t : A Ñ B. For fresh x:

nfpλx.tq :“ λx.quoteptpunquotepxqqq : A “

⊲ B

15 / 41

slide-53
SLIDE 53

Normalisation-by-evaluation, categorically

16 / 41

slide-54
SLIDE 54

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set

17 / 41

slide-55
SLIDE 55

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations

17 / 41

slide-56
SLIDE 56

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A

s any interpretation of base types;

17 / 41

slide-57
SLIDE 57

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A s´ : neutsA ñ Cps´, sAq s´ : normsA ñ Cps´, sAq

s any interpretation of base types; C any CCC

17 / 41

slide-58
SLIDE 58

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A s´ : neutsA ñ Cps´, sAq s´ : normsA ñ Cps´, sAq

s any interpretation of base types; C any CCC

Strategy:

17 / 41

slide-59
SLIDE 59

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A s´ : neutsA ñ Cps´, sAq s´ : normsA ñ Cps´, sAq

s any interpretation of base types; C any CCC

Strategy:

  • 1. define a glueing category G

17 / 41

slide-60
SLIDE 60

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A s´ : neutsA ñ Cps´, sAq s´ : normsA ñ Cps´, sAq

s any interpretation of base types; C any CCC

Strategy:

  • 1. define a glueing category G
  • 2. pick an interpretation e´ in G

17 / 41

slide-61
SLIDE 61

Normalisation-by-evaluation, categorically (Fiore)

Syntax as indexed presheaves over a category of contexts Con: neutsA : Γ ÞÑ tneutral terms t such that Γ $ t : Au normsA : Γ ÞÑ tnormal terms t such that Γ $ t : Au + : Con Ñ Set syntax glued to semantics by natural transformations pΓ $ t : Aq ÞÑ sΓ $ t : A s´ : neutsA ñ Cps´, sAq s´ : normsA ñ Cps´, sAq

s any interpretation of base types; C any CCC

Strategy:

  • 1. define a glueing category G
  • 2. pick an interpretation e´ in G
  • 3. define quote and unquote as maps in this category

17 / 41

slide-62
SLIDE 62

The glued category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

18 / 41

slide-63
SLIDE 63

The glued category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

Morphisms P P1 Cps´, Xq Cps´, X 1q

arrow X Ñ X 1

  • nat. trans P ñ P1

κ p p1 k ˝ p´q

18 / 41

slide-64
SLIDE 64

The glued category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

Morphisms P P1 Cps´, Xq Cps´, X 1q

arrow X Ñ X 1

  • nat. trans P ñ P1

κ p p1 k ˝ p´q

"syntax" "semantics" "interpretation"

18 / 41

slide-65
SLIDE 65

The category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

Morphisms P P1 Cps´, Xq Cps´, X 1q

κ p p1 k ˝ p´q

"syntax" "semantics" "interpretation"

19 / 41

slide-66
SLIDE 66

The category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

Morphisms P P1 Cps´, Xq Cps´, X 1q

κ p p1 k ˝ p´q

"syntax" "semantics" "interpretation"

ù Cartesian closed, with a strict CCC-functor GpC, sq Ñ C

19 / 41

slide-67
SLIDE 67

The category GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

Morphisms P P1 Cps´, Xq Cps´, X 1q

κ p p1 k ˝ p´q

"syntax" "semantics" "interpretation"

ù Cartesian closed, with a strict CCC-functor GpC, sq Ñ C ù for every type A, neutsA

ù ù ù ñ Cps´, sAq normsA

ù ù ù ñ Cps´, sAq , .

  • P GpC, sq

19 / 41

slide-68
SLIDE 68

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘

20 / 41

slide-69
SLIDE 69

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘ eA :“ ` eA

νA

ù ñ Cps´, sAq ˘

by strict preservation

20 / 41

slide-70
SLIDE 70

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘ eA C ` s´, sAq ˘

νA

20 / 41

slide-71
SLIDE 71

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘ eΓ eA C ` s´, sΓ ˘ C ` s´, sA ˘

νΓ eΓ$t:A νA sΓ$t:A˝p´q

20 / 41

slide-72
SLIDE 72

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘ eΓ eA C ` s´, sΓ ˘ C ` s´, sA ˘

νΓ eΓ$t:A νA sΓ$t:A˝p´q

neutsA eA C ` s´, sA ˘ C ` s´, sA ˘

quoteA s´ νA preserves βη

20 / 41

slide-73
SLIDE 73

Interpretation in the glued category GpC, sq

C any ccc s : BaseTypes Ñ ObC

e : BaseTypes Ñ ObpGpC, sqq β ÞÑ ` neutsβ

ù ù ù ñ Cps´, sβq ˘ eΓ eA C ` s´, sΓ ˘ C ` s´, sA ˘

νΓ eΓ$t:A νA sΓ$t:A˝p´q

neutsA eA C ` s´, sA ˘ C ` s´, sA ˘

quoteA s´ νA preserves βη

eA normsA C ` s´, sA ˘ C ` s´, sA ˘

unquoteA νA s´ preserves βη

20 / 41

slide-74
SLIDE 74

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

neutsΓ Cps´, sΓq eΓ Cps´, sΓq eA Cps´, sAq normsA Cps´, sAq

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

21 / 41

slide-75
SLIDE 75

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

neutsΓ Cps´, sΓq eΓ Cps´, sΓq eA Cps´, sAq normsA Cps´, sAq

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

ù recall nfpλx.tq :“ λx.quoteptpunquotepxqqq

21 / 41

slide-76
SLIDE 76

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

neutsΓ Cps´, sΓq eΓ Cps´, sΓq eA Cps´, sAq normsA Cps´, sAq

normt unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

ù recall nfpλx.tq :“ λx.quoteptpunquotepxqqq

21 / 41

slide-77
SLIDE 77

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

22 / 41

slide-78
SLIDE 78

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-79
SLIDE 79

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-80
SLIDE 80

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-81
SLIDE 81

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-82
SLIDE 82

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-83
SLIDE 83

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-84
SLIDE 84

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

22 / 41

slide-85
SLIDE 85

Normalising pΓ $ t : Aq

neutsΓ :“ Πpxi:AiqPΓ neutsAi unquoteΓ :“ Πpxi:AiqPΓ unquoteAi

pxi : Aiqi pxi : Aiqi neutsΓpΓq eΓpΓq CpsΓ, sΓq idsΓ eApΓq CpsΓ, sAq sΓ $ t : A sΓ $ t : A normsApΓq nfptq

normΓ

t

unquoteΓ quoteA s´ νA νΓ eΓ $ t : A sΓ $ t : A ˝ p´q s´

Define nfptq :“ normΓ

t ppΓ $ xi : Aiqi“1,...,nq.

Since sΓ $ nfptq : A “ sΓ $ t : A in every model, nfptq “βη t.

22 / 41

slide-86
SLIDE 86

Normalisation-by-evaluation for Λˆ,Ñ

ps

23 / 41

slide-87
SLIDE 87

Strategy

  • 1. define a glueing bicategory G
  • 2. pick an interpretation e´ in G
  • 3. define quote and unquote as maps in this bicategory

24 / 41

slide-88
SLIDE 88

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

25 / 41

slide-89
SLIDE 89

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Set

neutsps

A pΓq, normsps A pΓq sets of terms 25 / 41

slide-90
SLIDE 90

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories 25 / 41

slide-91
SLIDE 91

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù st snfptq

25 / 41

slide-92
SLIDE 92

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù st snfptq

depends on t –

25 / 41

slide-93
SLIDE 93

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù st snfptq st1 snfpt1q

depends on t – – depends on t1

25 / 41

slide-94
SLIDE 94

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù st snfptq st1 snfpt1q

sτ depends on t – – depends on t1

25 / 41

slide-95
SLIDE 95

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù st snfptq st1 snfpt1q

sτ depends on t – – depends on t1

25 / 41

slide-96
SLIDE 96

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù t nfptq t1 nfpt1q

τ – depends on t – depends on t1

25 / 41

slide-97
SLIDE 97

Strategy

ù re-use universal properties

(quote, unquote, GpC, sq,. . . bicategorically)

ù use embedding of STLC into Λˆ,Ñ

ps

neutsps

A :“ neutsSTLC A

inside Λˆ,Ñ

ps

normsps

A :“ normsSTLC A

inside Λˆ,Ñ

ps

+ : Con Ñ Cat

neutsps

A pΓq, normsps A pΓq sets of terms as discrete categories

ù If τ exists, it’s unique t nfptq t1 nfpt1q

τ – depends on t – depends on t1

25 / 41

slide-98
SLIDE 98

The glued cc-bicategory GpB, sq

B any cc-bicat s any interpretation of base types

Want: for every type A, neutsps

A s´

ù ù ù ñ Bps´, sAq normsps

A s´

ù ù ù ñ Bps´, sAq , .

  • P GpB, sq

26 / 41

slide-99
SLIDE 99

The glued cc-bicategory GpB, sq

Objects

B cc-bicat, s : BaseTypes Ñ ObB

P

pp,pq

ù ù ù ñ Bps´, Xq

pseudofunctor Con Ñ Cat pseudo

  • nat. trans.

P B

27 / 41

slide-100
SLIDE 100

The glued cc-bicategory GpB, sq

Objects

B cc-bicat, s : BaseTypes Ñ ObB

P

pp,pq

ù ù ù ñ Bps´, Xq

pseudofunctor Con Ñ Cat pseudo

  • nat. trans.

P B

1-cells P P1 Bps´, Xq Bps´, X 1q

arrow X Ñ X 1 pseudo nat. trans. P ñ P1 κ p p1 k ˝ p´q wk

27 / 41

slide-101
SLIDE 101

The glued cc-bicategory GpB, sq

Objects

B cc-bicat, s : BaseTypes Ñ ObB

P

pp,pq

ù ù ù ñ Bps´, Xq

pseudofunctor Con Ñ Cat pseudo

  • nat. trans.

P B

1-cells P P1 Bps´, Xq Bps´, X 1q

arrow X Ñ X 1 pseudo nat. trans. P ñ P1 κ p p1 k ˝ p´q wk

"syntax" "semantics" "interpretation"

27 / 41

slide-102
SLIDE 102

The glued cc-bicategory GpB, sq

Objects

B cc-bicat, s : BaseTypes Ñ ObB

P

pp,pq

ù ù ù ñ Bps´, Xq

pseudofunctor Con Ñ Cat pseudo

  • nat. trans.

P B

1-cells P P1 Bps´, Xq Bps´, X 1q

κ p p1 k ˝ p´q wk

"syntax" "semantics" "interpretation"

2-cells P P1 Bps´, Xq Bps´, X 1q

κ κ1 k ˝ p´q k1 ˝ p´q

ó Θ ó ξ ˝ p´q

27 / 41

slide-103
SLIDE 103

The glued cc-bicategory GpB, sq

P P1 Bps´, Xq Bps´, X 1q

κ ó Θ κ1 wk1

k1˝p´q

= P P1 Bps´, Xq Bps´, X 1q

κ wk

k˝p´q ó ξ ˝ p´q k1˝p´q

28 / 41

slide-104
SLIDE 104

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘

29 / 41

slide-105
SLIDE 105

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘ eA :“ ` eA

νA

ù ñ Bps´, sAq ˘

by strict preservation

29 / 41

slide-106
SLIDE 106

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘ eA B ` s´, sA ˘

νA

29 / 41

slide-107
SLIDE 107

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘ eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

29 / 41

slide-108
SLIDE 108

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘ eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

neutsps

A

eA B ` s´, sΓ ˘ B ` s´, sA ˘

quoteA s´ qA

νA preserves βη mod –

29 / 41

slide-109
SLIDE 109

Interpretation in GpB, sq

B any cc-bicat s : BaseTypes Ñ ObB

e : BaseTypes Ñ ObpGpB, sqq β ÞÑ ` neutsps

β s´

ù ù ù ñ Bps´, sβq ˘ eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

neutsps

A

eA B ` s´, sΓ ˘ B ` s´, sA ˘

quoteA s´ qA

νA preserves βη mod –

eA normsps

A

B ` s´, sΓ ˘ B ` s´, sA ˘

unquoteA νA uA

s´ preserves βη mod –

29 / 41

slide-110
SLIDE 110

neutsps

Γ

Bps´, sΓq eΓ Bps´, sΓq eA Bps´, sAq normsps

A

Bps´, sAq

unquoteΓ quoteA s´ eΓ $ t : A sΓ $ t : A ˝ p´q s´ uΓ

wt

qA

30 / 41

slide-111
SLIDE 111

neutsps

Γ

Bps´, sΓq eΓ Bps´, sΓq eA Bps´, sAq normsps

A

Bps´, sAq

normt unquoteΓ quoteA s´ eΓ $ t : A sΓ $ t : A ˝ p´q s´ uΓ

wt

qA

30 / 41

slide-112
SLIDE 112

neutsps

Γ

Bps´, sΓq eΓ Bps´, sΓq eA Bps´, sAq normsps

A

Bps´, sAq

normt unquoteΓ quoteA s´ eΓ $ t : A sΓ $ t : A ˝ p´q s´ uΓ

wt

qA

– Instantiate at Γ, pass in variables ù st – snfptq

30 / 41

slide-113
SLIDE 113

neutsps

Γ

Bps´, sΓq eΓ Bps´, sΓq eA Bps´, sAq normsps

A

Bps´, sAq

normt unquoteΓ quoteA s´ eΓ $ t : A sΓ $ t : A ˝ p´q s´ uΓ

wt

qA

– Instantiate at Γ, pass in variables ù st – snfptq st snfptq st1 snfpt1q

– –

30 / 41

slide-114
SLIDE 114

neutsps

Γ

Bps´, sΓq eΓ Bps´, sΓq eA Bps´, sAq normsps

A

Bps´, sAq

normt unquoteΓ quoteA s´ eΓ $ t : A sΓ $ t : A ˝ p´q s´ uΓ

wt

qA

– Instantiate at Γ, pass in variables ù st – snfptq st snfptq st1 snfpt1q

sτ – –

30 / 41

slide-115
SLIDE 115

Proving coherence

31 / 41

slide-116
SLIDE 116

Interpreting pΓ $ τ : t ñ t1 : Aq in GpB, sq

eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

32 / 41

slide-117
SLIDE 117

Interpreting pΓ $ τ : t ñ t1 : Aq in GpB, sq

eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt1

νΓ eΓ$t1:A νA sΓ$t1:A˝p´q

32 / 41

slide-118
SLIDE 118

Interpreting pΓ $ τ : t ñ t1 : Aq in GpB, sq

eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt

νΓ eΓ$t:A νA sΓ$t:A˝p´q

eΓ eA B ` s´, sΓ ˘ B ` s´, sA ˘

wt1

νΓ eΓ$t1:A νA sΓ$t1:A˝p´q

eΓ eA

eΓ$t:A ó eτ eΓ$t1:A

Bps´, sΓq Bps´, sAq

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

32 / 41

slide-119
SLIDE 119

Cylinder condition for pΓ $ τ : t ñ t1 : Aq

eΓ eA Bps´, sΓq Bps´, sAq

eΓ$t:A ó eτ eΓ$t1:A wt1

sΓ$t1:A˝p´q

= eΓ eA Bps´, sΓq Bps´, sAq

eΓ$t:A wt

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

33 / 41

slide-120
SLIDE 120

neutsps

Γ

eΓ eA normsps

A

Bps´, sΓq Bps´, sAq

unquoteΓ s´ uΓ

wt

eΓ$t:A quoteA s´ qA

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

= neutsps

Γ

eΓ eA normsps

A

Bps´, sΓq Bps´, sAq

unquoteΓ s´ uΓ

eΓ$t:A ó eτ eΓ$t1:A quoteA s´ qA

wt1

sΓ$t1:A˝p´q

34 / 41

slide-121
SLIDE 121

Bps´, sΓq Bps´, sAq

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

= Bps´, sΓq Bps´, sAq neutsps

Γ

eΓ eA normsps

A

Bps´, sΓq Bps´, sAq

s´ w´1

t

sΓ$t:A˝p´q uΓ

s´ qA

unquoteΓ

s´ uΓ

eΓ$t:A ó eτ eΓ$t1:A

quoteA

s´ qA

wt1

sΓ$t1:A˝p´q

35 / 41

slide-122
SLIDE 122

BpsΓ, sΓq BpsΓ, sAq

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

= BpsΓ, sΓq BpsΓ, sAq neutsps

Γ pΓq

eΓpΓq eApΓq normsps

A pΓq

BpsΓ, sΓq BpsΓ, sAq

s´ w´1

t

sΓ$t:A˝p´q uΓ

s´ qA

s´ uΓ

eΓ$t:A ó eτ eΓ$t1:A s´ qA

wt1

sΓ$t1:A˝p´q

36 / 41

slide-123
SLIDE 123

In HompCon, Catq neutsps

Γ

eΓ eA normsps

A unquoteΓ eΓ$t:A ó eτ eΓ$t1:A quoteA

37 / 41

slide-124
SLIDE 124

In Cat neutsps

Γ p∆q

eΓp∆q eAp∆q normsps

A p∆q unquoteΓ eΓ$t:A ó eτ eΓ$t1:A quoteA

a set!

37 / 41

slide-125
SLIDE 125

In Cat neutsps

Γ p∆q

eΓp∆q eAp∆q normsps

A p∆q unquoteΓ eΓ$t:A ó eτ eΓ$t1:A quoteA

a set!

Composite can only be the identity

37 / 41

slide-126
SLIDE 126

BpsΓ, sΓq BpsΓ, sAq

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

= BpsΓ, sΓq BpsΓ, sAq neutsps

Γ pΓq

eΓpΓq eApΓq normsps

A pΓq

BpsΓ, sΓq BpsΓ, sAq

s´ w´1

t

sΓ$t:A˝p´q uΓ

s´ qA

s´ uΓ

eΓ$t:A ó eτ eΓ$t1:A s´ qA

wt1

sΓ$t1:A˝p´q

independent of τ!

38 / 41

slide-127
SLIDE 127

idsΓ P BpsΓ, sΓq BpsΓ, sAq ù sτ

sΓ$t:A˝p´q ó sτ ˝ p´q sΓ$t1:A˝p´q

= BpsΓ, sΓq BpsΓ, sAq neutsps

Γ pΓq

eΓpΓq eApΓq normsps

A pΓq

BpsΓ, sΓq BpsΓ, sAq

s´ w´1

t

sΓ$t:A˝p´q uΓ

s´ qA

s´ uΓ

eΓ$t:A ó eτ eΓ$t1:A s´ qA

wt1

sΓ$t1:A˝p´q

independent of τ!

38 / 41

slide-128
SLIDE 128

Proposition

For any cc-bicategory B and interpretation s : BaseTypes Ñ ObB of base types, the interpretation sΓ $ τ : t ñ t1 : A depends only on t and t1.

39 / 41

slide-129
SLIDE 129

Proposition

For any cc-bicategory B and interpretation s : BaseTypes Ñ ObB of base types, the interpretation sΓ $ τ : t ñ t1 : A depends only on t and t1. ù For any derivable τ, τ 1 : t ñ1: A, sΓ $ τ : t ñ t1 : A “ sΓ $ τ 1 : t ñ t1 : A

39 / 41

slide-130
SLIDE 130

Proposition

For any cc-bicategory B and interpretation s : BaseTypes Ñ ObB of base types, the interpretation sΓ $ τ : t ñ t1 : A depends only on t and t1. ù For any derivable τ, τ 1 : t ñ1: A, sΓ $ τ : t ñ t1 : A “ sΓ $ τ 1 : t ñ t1 : A

Corollary

For any derivable τ, τ 1 : t ñ1: A, Γ $ τ ” τ 1 : t ñ t1 : A is derivable.

39 / 41

slide-131
SLIDE 131

40 / 41

slide-132
SLIDE 132

Coherence

ù cc-Bicategories are coherent

40 / 41

slide-133
SLIDE 133

Coherence

ù cc-Bicategories are coherent ù “Suffices” to work in a CCC

  • 1. prove result in STLC
  • 2. βη-equalities ù 2-cells
  • 3. axioms guaranteed

40 / 41

slide-134
SLIDE 134

Coherence

ù cc-Bicategories are coherent ù “Suffices” to work in a CCC

  • 1. prove result in STLC
  • 2. βη-equalities ù 2-cells
  • 3. axioms guaranteed

Strategy

ù Coherence as a normalisation property ù Normalisation proven semantically ù If you work with universal properties enough . . . higher-categorical proof builds on categorical proof Future work: extend this to other structures

e.g. Kan extensions, monads, dependent products,. . .

40 / 41

slide-135
SLIDE 135

Further reading

  • A type theory for cartesian closed bicategories, LICS 2019
  • Relative full completeness for bicategorical cartesian closed

structure, FoSSaCS 2020

  • Cartesian closed bicategories: type theory and coherence

41 / 41

slide-136
SLIDE 136

1 / 3

slide-137
SLIDE 137

cc-Bicategories

1-cells evalA,B : pA “

⊲ Bq ˆ A Ñ B

Adjoint equivalences BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

2 / 3

slide-138
SLIDE 138

Rules for exponentials

explicit weakening by x free variable in context

px : Aq eval tu tincxu , xu ñ t : B u ñ λx.t : A “

⊲ B ǫ ‚ eval tp´q tincxu , xu e:px . ´q eval

f : A “

⊲ B, x : A $ evalpf , xq : B

Γ, x : A $ t : B

lam

Γ $ λx.t : A “

⊲ B

Γ, x : A $ t : B

ǫ-intro (β-rule)

Γ, x : A $ ǫt : eval tpλx.tq tincxu , xu ñ t : B Γ, x : A $ t : B Γ $ u : A “

⊲ B

Γ, x : A $ α : eval tu tincxu , xu ñ t : B

e:px . αq-intro

Γ $ e:px . αq : u ñ λx.t : A “

⊲ B

+ three equational rules ù η-rule derivable

3 / 3