47
String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS, Université Paris Denis Diderot Hopf-in-Lux Luxembourg 17 July 2009 1

String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

String diagrams

a functorial semantics of proofs and programs

Paul-André Melliès

CNRS, Université Paris Denis Diderot

Hopf-in-Lux

Luxembourg 17 July 2009

1

Page 2: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Connecting 2-dimensional cobordism and logic

2

Page 3: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Part 1

Categories as monads

3

Page 4: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Starting point: categories as monads

Depending on the bicategory, the point of view federates:

Enriched categories a bicategory ofV-matrices

Internal categories a bicategory of spans

Algebra a bicategory of comodules

The last connection appears in Marcelo Aguiar’s PhD thesis

4

Page 5: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory−−→Cat(B)

– the 0-cells are the monads (A, s) of the bicategory B

– the 1-cells

( f , f̃ ) : (A, s) // (B, t)

are the pairs consisting of a 1-cell

f : A −→ B

and of a 2-cell

f̃ : f ⊗ s ⇒ t ⊗ f : A −→ B

5

Page 6: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory−−→Cat(B)

Diagrammatically:

Af

//

s

��

B

t

��

f̃⇒

A f// B

satisfying the equalities below:

6

Page 7: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory−−→Cat(B)

Af

//

s

��

id

''

B

t

��

η ⇒ f̃ ⇒

Af

// B

=

Af

//

id

''

B

id

''

t

��

η ⇒

Af

// B

Af

//

s

��

s��������������

B

t

��

A µ ⇒

s��???????????? f̃ ⇒

Af

// B

=

Af

//

s��������������

f̃ ⇒

B

t

��

t���������������

A f //

t��???????????? B

t��>>>>>>>>>>>>>

µ ⇒

A f//

f̃ ⇒

B

7

Page 8: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

An alternative formulation in string diagrams

= =

f

f

f

f

f

f

f

f s s

tt

s s

t t

8

Page 9: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory←−−Cat(B)

Same definition, except that the direction of the 2-cell changes:

Af

//

s

��

B

t

��

f̃⇐

A f// B

A kind of “fibration without its functor”

9

Page 10: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The 2-cells of the bicategory−−→Cat(B)

– the 2-cells

θ : f ⇒ g : s −→ t

are the 2-cells

θ : f ⇒ t ⊗ g : A −→ B

such that the diagram of 2-cells commute:

f ⊗ sf̃

+3

�

t ⊗ f θ +3 t ⊗ t ⊗ g

µ

��

t ⊗ g ⊗ sg̃

+3 t ⊗ t ⊗ gµ

+3 t ⊗ g

Reduced form

10

Page 11: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

An alternative formulation in string diagrams

=

g

f

g

f

t

s

t

t

s

Reduced form11

Page 12: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The 2-cells of the bicategory−−→Cat(B)

– the 2-cells

θ : f ⇒ g : s −→ t

are the 2-cells

θ : f ⊗ s⇒ t ⊗ g : A −→ B

making the diagram of 2-cells commute:

f ⊗ s ⊗ sf̃

+3

�

t ⊗ f ⊗ s θ +3 t ⊗ t ⊗ g

µ

��

t ⊗ g ⊗ sg̃

+3 t ⊗ t ⊗ gµ

+3 t ⊗ g

Non reduced form

12

Page 13: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Alternative formulation in string diagrams

=

g

f

g

f

t

sss s

t

Non reduced form13

Page 14: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

From the reduced form to the non reduced form(and conversely)

= =

f

g

f

gg

f

g

fs

tt

s

tt

14

Page 15: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

First equation

= = =

g

f

g

f

g

f

g

f s

t t

s

t

s s

t

15

Page 16: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Second equation

= =

f

g

f

gg

f

t t t

16

Page 17: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Property of the non reduced form

= =

f

g g

f

g

f s s

t t

s

t

s s s

17

Page 18: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Illustration: internal categories

Given a category C with finite limits...

the bicategory−−→Cat(Span) has

– the same 0-cells as the category C,

– the 1-cells are the spans,

– the 2-cells are morphisms between spans.

Fact: a monad in Span is an internal category in C

18

Page 19: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Part 2

Modules between categories

categories seen as rings with several objects

19

Page 20: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Representation principle

Every monad (in the bicategorical sense)

t : A −→ A

induces a monad (in the categorical sense)

B(X, t) : B(X,A) −→ B(X,A)

defined by post-composition

Xf

// A 7→ Xf

// A t // A

for every 0-cell X of the bicategory B.

20

Page 21: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Representation principle (dual)

Dually, every monad (in the bicategorical sense)

t : A −→ A

induces a monad (in the categorical sense)

B(t,X) : B(A,X) −→ B(A,X)

defined this time by pre-composition:

Af

// X 7→ A t // Af

// X

for every 0-cell X of the bicategory B.

21

Page 22: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Representation principle (on both sides)

Every pair of monads (in the bicategorical sense)

s : A −→ A t : B −→ B

induces a monad (in the categorical sense)

B(s, t) : B(A,B) −→ B(A,B)

defined by pre- and post- composition:

Af

// B 7→

Af

// B

t��

A

s

OO

Bfor every 0-cell X of the bicategory B.

22

Page 23: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,
Page 24: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory Module(B)

– the 0-cells are the monads (A, s) of the bicategory B

– the 1-cells

(A, s) // (B, t)

are the algebras of the monad

B(s, t) : B(A,B) −→ B(A,B).

So, they are pairs ( f , φ) consisting of a 1-cell

Af

// B

23

Page 25: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

and a 2-cell

Af

// B

t

��

⇓ φ

A

s

OO

f// B

in the bicategory B, satisfying the coherence diagrams:

Page 26: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory Module(B)

Af

// Bt

��==============

t

��

A

s??�������������� µ

⇒⇓ φ µ

⇐ B

t����������������

A f//

s

OO

s

__>>>>>>>>>>>>>>

B

=

Af

// Bt

��5555555555555

⇓ φ

A

sDD�������������

f // B

t��

⇓ φ

A f//

s

ZZ6666666666666

B

24

Page 27: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Af

// B

id

zz

t

��

η⇒

⇓ φ η⇐

A f//

s

OO

id

::

B

=

Af

// B

id

yy

⇓ id

A f//

id

99

B

Page 28: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory Module(B)

– the 2-cells

(A, s)

( f ,φ)

%%

(g,ψ)

99⇓ θ (B, t)

are the morphisms of B(s, t)-algèbres in the category B(A,B).

25

Page 29: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,
Page 30: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory Module(B)

In other words, a 2-cell

(A, s)

( f ,φ)

%%

(g,ψ)

99⇓ θ (B, t) is a 2-cell A

f

""

g

<<⇓ θ B

26

Page 31: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

satisfying the equality:

A

f

��

B

t

��

⇓ φ

A

f

��

g

@@

s

OO

⇓ θ B

=

A

f

��

g

@@⇓ θ B

t

��

⇓ ψ

A

g

@@

s

OO

B

Page 32: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

The bicategory Module(B)

The composite of the two 1-cells

(A, s)( f ,φ)

// (B, t)(g,ψ)

// (C,u)

is defined as the co-equalizer of the 2-cells described by the twodifferent ways to compose:

B t // B

g

��,,,,,,,,,,,,,,,,,,,,,,,

⇓�φ

A

f

II�����������������������

f

::ttttttttttttttttttttttttttttttttttttttttt g⊗ f// C

B t //

g

$$JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ B

g

��,,,,,,,,,,,,,,,,,,,,,,,

ψ� ⇓

A

f

II����������������������� g⊗ f// C

27

Page 33: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

We make the hypothesis(1) that the category B(A,B) has coequalizers, for every A,B,(2) the horizontal composition ⊗ in B preserves these co-equalizers.

Page 34: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Part 3

Game cobordism

28

Page 35: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Dialogue categories

A symmetric monoidal category C equipped with a functor

¬ : Cop−→ C

and a natural bijection

ϕA,B,C : C(A ⊗ B , ¬C) � C(A , ¬ ( B ⊗ C ) )

¬

CBA

⊗ �

¬

CBA

29

Page 36: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Cobordism

30

Page 37: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Frobenius objects

A Frobenius object F is a monoid and a comonoid satisfying

m

d

=m

d

=m

d

an alternative formulation of cobordism

31

Page 38: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Frobenius objects

Equivalently, a Frobenius object F is a monoid with an isomorphism

S : F −→ F∗

to its dual object F∗ such that

S

FFF

• =

S

FFF

32

Page 39: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Lax dualities in a 3-dimensional category

LL⇒

ε

η

L

L

η

εR

R

⇒RR

33

Page 40: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

satisfying two coherence properties (a)

η

η

L

L

R

R

is the identity 3-cell on the unit η of the 2-adjunction L a R,

34

Page 41: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

satisfying two coherence properties (b)

ε

ε

L

L

R

R

is the identity 3-cell on the counit ε of the 2-adjunction L a R.

35

Page 42: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Pseudo Frobenius objects

A pseudo Frobenius object in the bicategory of modules

m

d

�m

d

�m

d

is the same thing as a ∗-autonomous category... when the two mod-ules m and e are functors.

An observation by Brian Day and Ross Street (2003)

36

Page 43: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Lax Frobenius objects

Relax the self-duality equivalence

C � Cop

into an adjunction

C

L%%

⊥ Cop

R

dd

this connects game semantics and quantum groups

37

Page 44: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Game semantics in ribbon diagrams

=

C opC opC opC opC opC op

S

C (x, y) C (x,¬ y)

Idea: replace the elementary particles by the game boards

38

Page 45: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Game semantics in ribbon diagrams

=

C opC opC opC opC opC op

C (x,¬ y)C (x,¬ y)

Idea: replace the elementary particles by the game boards

39

Page 46: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Game semantics in ribbon diagrams

=

C opC opC opC opC opC op

C (x, y)C (x,¬ y)

Idea: replace the elementary particles by the game boards

40

Page 47: String diagrams - Bienvenue à l'IRIFmellies/tensorial-logic/hopf-in-lux... · 2016-02-06 · String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS,

Conclusion

Logic = Data Structure + Duality

This point of view is accessible thanks to 2-dimensional algebra

41