Coherence and normalisation-by-evaluation for bicategorical - - PowerPoint PPT Presentation

coherence and normalisation by evaluation for
SMART_READER_LITE
LIVE PREVIEW

Coherence and normalisation-by-evaluation for bicategorical - - PowerPoint PPT Presentation

Coherence and normalisation-by-evaluation for bicategorical cartesian closed structure Marcelo Fiore : and Philip Saville* : University of Cambridge Department of Computer Science and Technology *University of Edinburgh School of Informatics 1


slide-1
SLIDE 1

Coherence and normalisation-by-evaluation for bicategorical cartesian closed structure

Marcelo Fiore: and Philip Saville*

:University of Cambridge

Department of Computer Science and Technology

*University of Edinburgh

School of Informatics

1 / 27

slide-2
SLIDE 2

Cartesian closed bicategories:

  • Generalised species and cartesian distributors

(linear logic, higher category theory)

(Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

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

  • ‘STLC with explicit substitution and invertible βη-rewrites’

(free cartesian closed bicategory)

(Fiore & S., LICS 2019)

2 / 27

slide-3
SLIDE 3

Cartesian closed bicategories:

  • Generalised species and cartesian distributors

(linear logic, higher category theory)

(Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

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

  • ‘STLC with explicit substitution and invertible βη-rewrites’

(free cartesian closed bicategory)

(Fiore & S., LICS 2019)

In the paper: two proofs of coherence ù ‘all (pasting) diagrams commute’

2 / 27

slide-4
SLIDE 4

Cartesian closed bicategories:

  • Generalised species and cartesian distributors

(linear logic, higher category theory)

(Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

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

  • ‘STLC with explicit substitution and invertible βη-rewrites’

(free cartesian closed bicategory)

(Fiore & S., LICS 2019)

In the paper: two proofs of coherence ù ‘all (pasting) diagrams commute’ Consequences:

2 / 27

slide-5
SLIDE 5

Cartesian closed bicategories:

  • Generalised species and cartesian distributors

(linear logic, higher category theory)

(Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

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

  • ‘STLC with explicit substitution and invertible βη-rewrites’

(free cartesian closed bicategory)

(Fiore & S., LICS 2019)

In the paper: two proofs of coherence ù ‘all (pasting) diagrams commute’ Consequences:

  • 1. Modulo ” there is at most one rewrite t ùβη t1

2 / 27

slide-6
SLIDE 6

Cartesian closed bicategories:

  • Generalised species and cartesian distributors

(linear logic, higher category theory)

(Fiore, Gambino, Hyland, Winskel), (Fiore & Joyal)

  • Categorical algebra (operads)

(Gambino & Joyal)

  • Game semantics (concurrent games)

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

  • ‘STLC with explicit substitution and invertible βη-rewrites’

(free cartesian closed bicategory)

(Fiore & S., LICS 2019)

In the paper: two proofs of coherence ù ‘all (pasting) diagrams commute’ Consequences:

  • 1. Modulo ” there is at most one rewrite t ùβη t1
  • 2. Constructions in cc-bicategories simplify to STLC

2 / 27

slide-7
SLIDE 7

Cartesian closed bicategories

3 / 27

slide-8
SLIDE 8

Composition by universal property ñ 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

4 / 27

slide-9
SLIDE 9

Composition by universal property ñ 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

4 / 27

slide-10
SLIDE 10

Bicategories

5 / 27

slide-11
SLIDE 11

Bicategories

  • Objects X, Y , Z, . . .

5 / 27

slide-12
SLIDE 12

Bicategories

  • Objects X, Y , Z, . . .
  • Morphisms (1-cells) f : X Ñ Y

5 / 27

slide-13
SLIDE 13

Bicategories

  • Objects X, Y , Z, . . .
  • Morphisms (1-cells) f : X Ñ Y
  • 2-cells X

Y

f óα f 1

5 / 27

slide-14
SLIDE 14

Bicategories

  • Objects X, Y , Z, . . .
  • Morphisms (1-cells) f : X Ñ Y
  • 2-cells X

Y

f óα f 1

  • Invertible 2-cells witnessing the axioms

ph ˝ gq ˝ f

ah,g,f

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

lf

ù ñ f g ˝ IdX

rg

ù ñ g .

5 / 27

slide-15
SLIDE 15

Bicategories

  • Objects X, Y , Z, . . .
  • Morphisms (1-cells) f : X Ñ Y
  • 2-cells X

Y

f óα f 1

  • Invertible 2-cells witnessing the axioms

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.

5 / 27

slide-16
SLIDE 16

Bicategories

  • Objects X, Y , Z, . . .
  • Morphisms (1-cells) f : X Ñ Y
  • 2-cells X

Y

f óα f 1

  • Invertible 2-cells witnessing the axioms

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. ù ‘Monoidal category with many objects’

5 / 27

slide-17
SLIDE 17

Bicategories everywhere (not all cartesian closed!)

  • 1. Monoidal category = one-object bicategory
  • 2. 2-category = bicategory with a, l, r all id
  • 3. SpanpCq
  • 4. Proof-relevant relations
  • 5. Profunctors (distributors)
  • 6. Polynomial functors (W-types, ornaments, containers, . . . )
  • 7. Concurrent games

6 / 27

slide-18
SLIDE 18

Cartesian closed bicategories

Bicategories B equipped with

7 / 27

slide-19
SLIDE 19

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

BpX, A1 ˆ A2q BpX, A1q ˆ BpX, A2q » BpX, A “

⊲ Bq

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

7 / 27

slide-20
SLIDE 20

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

BpX, A1 ˆ A2q BpX, A1q ˆ BpX, A2q

pπ1˝´,π2˝´q

% »

x´,“y

(pairing)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

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

7 / 27

slide-21
SLIDE 21

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

BpX, A1 ˆ A2q BpX, A1q ˆ BpX, A2q

pπ1˝´,π2˝´q

% »

x´,“y

(pairing)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

πi ˝ xf1, f2y

ù ñ fi g

ù ñ xπ1 ˝ g, π2 ˝ gy

7 / 27

slide-22
SLIDE 22

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

BpX, A1 ˆ A2q BpX, A1q ˆ BpX, A2q

pπ1˝´,π2˝´q

% »

x´,“y

(pairing)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

πi ˝ xf1, f2y

ù ñ fi g

ù ñ xπ1 ˝ g, π2 ˝ gy evalA,B ˝ pλf ˆ Aq

ù ñ f g

ù ñ λpevalA,B ˝ pg ˆ Aqq

7 / 27

slide-23
SLIDE 23

Cartesian closed bicategories

Bicategories B equipped with families of equivalences

BpX, A1 ˆ A2q BpX, A1q ˆ BpX, A2q

pπ1˝´,π2˝´q

% »

x´,“y

(pairing)

BpX, A “

⊲ Bq

BpX ˆ A, Bq

evalA,B˝p´ˆAq

% »

λ

(currying)

πi ˝ xf1, f2y

ù ñ fi g

ù ñ xπ1 ˝ g, π2 ˝ gy πi ˝ xπ1 ˝ g, π2 ˝ gy πi ˝ g πi ˝ g

βˆ

i

id πi˝ηˆ

7 / 27

slide-24
SLIDE 24

Coherence

8 / 27

slide-25
SLIDE 25

coherence Mac Lane-style

"all diagrams commute" proof theory, rewriting theory

coherence-by-strictification

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

9 / 27

slide-26
SLIDE 26

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) use an internal language (2) prove normalisation by semantic argument

9 / 27

slide-27
SLIDE 27

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) use an internal language (2) prove normalisation by semantic argument

in the paper

9 / 27

slide-28
SLIDE 28

coherence “denotational semantics”

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

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

9 / 27

slide-29
SLIDE 29

Theorem (Coherence of cc-bicategories)

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.

10 / 27

slide-30
SLIDE 30

Theorem (Coherence of cc-bicategories)

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. Consequence 1: modulo ” there is at most one rewrite t ùβη t1

10 / 27

slide-31
SLIDE 31

Theorem (Coherence of cc-bicategories)

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. Consequence 1: modulo ” there is at most one rewrite t ùβη t1 Consequence 2: can use STLC for constructions in cc-bicategories

10 / 27

slide-32
SLIDE 32

Theorem (Coherence of cc-bicategories)

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. Consequence 1: modulo ” there is at most one rewrite t ùβη t1 Consequence 2: can use STLC for constructions in cc-bicategories

11 / 27

slide-33
SLIDE 33

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, Hilken, Hirschowitz

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

12 / 27

slide-34
SLIDE 34

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, Hilken, Hirschowitz

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

Features

12 / 27

slide-35
SLIDE 35

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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 / 27

slide-36
SLIDE 36

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • STLC embeds as explicit-substitution free fragment

12 / 27

slide-37
SLIDE 37

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • STLC embeds as explicit-substitution free fragment
  • Free property for syntactic model

Γ A

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

12 / 27

slide-38
SLIDE 38

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • 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

embedding of STLC

12 / 27

slide-39
SLIDE 39

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • 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

embedding of STLC

ù Coherence: modulo ” there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

12 / 27

slide-40
SLIDE 40

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • 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

embedding of STLC

ù Coherence: modulo ” there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

12 / 27

slide-41
SLIDE 41

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

ps

(Fiore & S., 2019)

Judgements c.f. Seely, 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
  • 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

embedding of STLC

by coherence, must be unique ù Coherence: modulo ” there exists at most one rewrite τ such that Γ $ τ : t ñ t1 : A.

12 / 27

slide-42
SLIDE 42

Theorem (Coherence of cc-bicategories)

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. Consequence 1: modulo ” there is at most one rewrite t ùβη t1 Consequence 2: can use STLC for constructions in cc-bicategories

13 / 27

slide-43
SLIDE 43

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

14 / 27

slide-44
SLIDE 44

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

14 / 27

slide-45
SLIDE 45

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

15 / 27

slide-46
SLIDE 46

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

15 / 27

slide-47
SLIDE 47

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

15 / 27

slide-48
SLIDE 48

˚ 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 laws (i.e. triangle + pentagon)

16 / 27

slide-49
SLIDE 49

˚ 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 laws (i.e. triangle + pentagon)

with coherence theorem ù can just use STLC!

16 / 27

slide-50
SLIDE 50

˚ 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 laws (i.e. triangle + pentagon)

with coherence theorem ù can just use STLC!

  • 1. prove ˚ in STLC

16 / 27

slide-51
SLIDE 51

˚ 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 laws (i.e. triangle + pentagon)

with coherence theorem ù can just use STLC!

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

16 / 27

slide-52
SLIDE 52

˚ 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 laws (i.e. triangle + pentagon)

with coherence theorem ù can just use STLC!

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

16 / 27

slide-53
SLIDE 53

Normalisation-by-evaluation

17 / 27

slide-54
SLIDE 54

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

18 / 27

slide-55
SLIDE 55

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

18 / 27

slide-56
SLIDE 56

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

18 / 27

slide-57
SLIDE 57

Normalisation-by-evaluation, categorically (Fiore 2002)

19 / 27

slide-58
SLIDE 58

Normalisation-by-evaluation, categorically (Fiore 2002)

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

19 / 27

slide-59
SLIDE 59

Normalisation-by-evaluation, categorically (Fiore 2002)

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

19 / 27

slide-60
SLIDE 60

Normalisation-by-evaluation, categorically (Fiore 2002)

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;

19 / 27

slide-61
SLIDE 61

Normalisation-by-evaluation, categorically (Fiore 2002)

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:

19 / 27

slide-62
SLIDE 62

Normalisation-by-evaluation, categorically (Fiore 2002)

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:

19 / 27

slide-63
SLIDE 63

Normalisation-by-evaluation, categorically (Fiore 2002)

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 cartesian closed glueing category GpC, sq

19 / 27

slide-64
SLIDE 64

Normalisation-by-evaluation, categorically (Fiore 2002)

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 cartesian closed glueing category GpC, sq
  • 2. pick an interpretation e´ in GpC, sq

19 / 27

slide-65
SLIDE 65

Normalisation-by-evaluation, categorically (Fiore 2002)

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 cartesian closed glueing category GpC, sq
  • 2. pick an interpretation e´ in GpC, sq
  • 3. define quote and unquote as maps in this category

19 / 27

slide-66
SLIDE 66

Strategy:

  • 1. define a cartesian closed glueing category GpC, sq
  • 2. pick an interpretation e´ in GpC, sq
  • 3. define quote and unquote as maps in this category

20 / 27

slide-67
SLIDE 67

The glued CCC GpC, sq

Objects

C ccc, s : BaseTypes Ñ ObC

P

p

ù ñ Cps´, Xq

functor Con Ñ Set

  • nat. trans

P C

21 / 27

slide-68
SLIDE 68

The glued CCC 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

21 / 27

slide-69
SLIDE 69

The glued CCC 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"

21 / 27

slide-70
SLIDE 70

The glued CCC 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"

22 / 27

slide-71
SLIDE 71

The glued CCC 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"

ù for every type A, neutsA

ù ù ù ñ Cps´, sAq normsA

ù ù ù ñ Cps´, sAq , .

  • P GpC, sq

22 / 27

slide-72
SLIDE 72

Strategy:

  • 1. define a cartesian closed glueing category GpC, sq
  • 2. pick an interpretation e´ in GpC, sq
  • 3. define quote and unquote as maps in this category

23 / 27

slide-73
SLIDE 73

Interpretation e in the glued CCC GpC, sq

C any ccc s : BaseTypes Ñ ObC

24 / 27

slide-74
SLIDE 74

Interpretation e in the glued CCC GpC, sq

C any ccc s : BaseTypes Ñ ObC

eA Cps´, sAq

νA

24 / 27

slide-75
SLIDE 75

Interpretation e in the glued CCC GpC, sq

C any ccc s : BaseTypes Ñ ObC

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

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

24 / 27

slide-76
SLIDE 76

Interpretation e in the glued CCC GpC, sq

C any ccc s : BaseTypes Ñ ObC

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 βη

24 / 27

slide-77
SLIDE 77

Interpretation e in the glued CCC GpC, sq

C any ccc s : BaseTypes Ñ ObC

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 βη

24 / 27

slide-78
SLIDE 78

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´

25 / 27

slide-79
SLIDE 79

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

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

25 / 27

slide-80
SLIDE 80

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

normΓ

t

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

Define nfptq :“ normΓ

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

25 / 27

slide-81
SLIDE 81

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

normΓ

t

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

Define nfptq :“ normΓ

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

25 / 27

slide-82
SLIDE 82

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

normΓ

t

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

Define nfptq :“ normΓ

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

25 / 27

slide-83
SLIDE 83

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

normΓ

t

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

Define nfptq :“ normΓ

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

25 / 27

slide-84
SLIDE 84

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

normΓ

t

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

Define nfptq :“ normΓ

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

25 / 27

slide-85
SLIDE 85

Normalising pΓ $ t : Aq

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

pxi : Aiqi

neutsΓpΓq CpsΓ, sΓq eΓpΓq CpsΓ, sΓq

idsΓ

eApΓq CpsΓ, sAq

sΓ $ t : A

normsApΓq

nfptq

CpsΓ, sAq

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.

25 / 27

slide-86
SLIDE 86

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

normsps

A

Bps´, sAq

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

wt

qA

26 / 27

slide-87
SLIDE 87

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

normsps

A

Bps´, sAq

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

wt

qA

26 / 27

slide-88
SLIDE 88

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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

26 / 27

slide-89
SLIDE 89

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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

– depends on t – depends on t1

26 / 27

slide-90
SLIDE 90

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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τ – depends on t – depends on t1

condition on 2-cells in glueing bicat

26 / 27

slide-91
SLIDE 91

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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τ – depends on t – depends on t1

since normsps

A is

is a discrete category

26 / 27

slide-92
SLIDE 92

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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 t nfptq t1 nfpt1q

τ – –

syntactic model

26 / 27

slide-93
SLIDE 93

Proving coherence (this paper)

STLC neutrals inside Λˆ,Ñ

ps

neutsps

Γ

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

STLC normals inside Λˆ,Ñ

ps

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 t nfptq t1 nfpt1q

τ – –

syntactic model ù if τ : t ñ t1 exists, it’s unique (modulo ”)

26 / 27

slide-94
SLIDE 94

Coherence for cc-bicategorical structure

27 / 27

slide-95
SLIDE 95

Coherence for cc-bicategorical structure

ù cc-Bicategories are coherent

27 / 27

slide-96
SLIDE 96

Coherence for cc-bicategorical structure

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

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

27 / 27

slide-97
SLIDE 97

Coherence for cc-bicategorical structure

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

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

Coherence via normalisation-by-evaluation

ù 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. sums, dependent products, notions of initial algebra. . .

27 / 27

slide-98
SLIDE 98

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,

PhD thesis, 2020