Distributive laws for Lawvere theories

138
Distributive laws for Lawvere theories Eugenia Cheng University of Sheffield CT2011 1.

Transcript of Distributive laws for Lawvere theories

Page 1: Distributive laws for Lawvere theories

Distributive laws for Lawvere

theories

Eugenia Cheng

University of SheffieldCT2011

1.

Page 2: Distributive laws for Lawvere theories

Plan

1. Introduction

2.

Page 3: Distributive laws for Lawvere theories

Plan

1. Introduction

2. Lawvere theories

2.

Page 4: Distributive laws for Lawvere theories

Plan

1. Introduction

2. Lawvere theories

3. Distributive laws for monads

2.

Page 5: Distributive laws for Lawvere theories

Plan

1. Introduction

2. Lawvere theories

3. Distributive laws for monads

4. Three ways to do it

2.

Page 6: Distributive laws for Lawvere theories

Plan

1. Introduction

2. Lawvere theories

3. Distributive laws for monads

4. Three ways to do it

5. Comparison.

2.

Page 7: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

3.

Page 8: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

E.g. monoids and abelian groups rings

3.

Page 9: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

E.g. monoids and abelian groups rings

Question

What’s a distributive law for Lawvere theories?

3.

Page 10: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

E.g. monoids and abelian groups rings

Question

What’s a distributive law for Lawvere theories?

• Lawvere theories correspond to finitary monads on Set.

3.

Page 11: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

E.g. monoids and abelian groups rings

Question

What’s a distributive law for Lawvere theories?

• Lawvere theories correspond to finitary monads on Set.

• Lawvere theories are themselves monads in a certainbicategory.

3.

Page 12: Distributive laws for Lawvere theories

1. Introduction

Distributive laws give us a way of combining two or more

types of algebraic structure expressed as monads.

E.g. monoids and abelian groups rings

Question

What’s a distributive law for Lawvere theories?

• Lawvere theories correspond to finitary monads on Set.

• Lawvere theories are themselves monads in a certainbicategory.

—So we can look for distributive laws between these monads.

3.

Page 13: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

4.

Page 14: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

monadsLTs

4.

Page 15: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

monadsLTs

algebras

4.

Page 16: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

monadsLTs

algebras

4.

Page 17: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

monadsLTs

algebrasmodels

4.

Page 18: Distributive laws for Lawvere theories

1. Introduction

• A monad on V only gives algebras in V.

• A Lawvere theory gives models in any finite-product category.

monadsLTs

algebrasmodels

Example

Distributive law for monoids over abelian groupsrings internal to any finite-product category V.

4.

Page 19: Distributive laws for Lawvere theories

2. Lawvere theories

5.

Page 20: Distributive laws for Lawvere theories

2. Lawvere theories

Idea

Encapsulate an algebraic theory in a category L.

5.

Page 21: Distributive laws for Lawvere theories

2. Lawvere theories

Idea

Encapsulate an algebraic theory in a category L.

• The objects of L are the natural numbers, our arities.

• A morphism k 1 is an operation of arity k.

• A morphism k m is m operations of arity k.

5.

Page 22: Distributive laws for Lawvere theories

2. Lawvere theories

Idea

Encapsulate an algebraic theory in a category L.

• The objects of L are the natural numbers, our arities.

• A morphism k 1 is an operation of arity k.

• A morphism k m is m operations of arity k.

We use F a skeleton of FinSet (finite sets and functions).

5.

Page 23: Distributive laws for Lawvere theories

2. Lawvere theories

Idea

Encapsulate an algebraic theory in a category L.

• The objects of L are the natural numbers, our arities.

• A morphism k 1 is an operation of arity k.

• A morphism k m is m operations of arity k.

We use F a skeleton of FinSet (finite sets and functions).

Definition

A Lawvere theory is a small category L with finite products,equipped with a strict identity-on-objects functor

Fop

L.

5.

Page 24: Distributive laws for Lawvere theories

2. Lawvere theories

Idea

Encapsulate an algebraic theory in a category L.

• The objects of L are the natural numbers, our arities.

• A morphism k 1 is an operation of arity k.

• A morphism k m is m operations of arity k.

We use F a skeleton of FinSet (finite sets and functions).

Definition

A Lawvere theory is a small category L with finite products,equipped with a strict identity-on-objects functor

Fop

L.

Note: in Fop the object m is the product of m copies of 1.

5.

Page 25: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

6.

Page 26: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

6.

Page 27: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

6.

Page 28: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

• Lawvere theory: ab, a, a2, b, b2, aba, ab3a5, . . .

6.

Page 29: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

• Lawvere theory: ab, a, a2, b, b2, aba, ab3a5, . . .

i.e. everything in the free monad on {a, b}.

6.

Page 30: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

• Lawvere theory: ab, a, a2, b, b2, aba, ab3a5, . . .

i.e. everything in the free monad on {a, b}.

A morphism 3 2 is two 3-ary operations e.g.

(ab, a3), (a2b, abc), . . .

6.

Page 31: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

• Lawvere theory: ab, a, a2, b, b2, aba, ab3a5, . . .

i.e. everything in the free monad on {a, b}.

A morphism 3 2 is two 3-ary operations e.g.

(ab, a3), (a2b, abc), . . .

Composition: 3 2 1{ab, a3} x2y

6.

Page 32: Distributive laws for Lawvere theories

2. Lawvere theories

Note

We are allowed to forget and repeat variables.

Example2-ary operations in the theory of monoids

• (non-Σ) operads: only one i.e. ab

• Lawvere theory: ab, a, a2, b, b2, aba, ab3a5, . . .

i.e. everything in the free monad on {a, b}.

A morphism 3 2 is two 3-ary operations e.g.

(ab, a3), (a2b, abc), . . .

Composition: 3 2 1{ab, a3} x2y

︸ ︷︷ ︸

ab.ab.a3

6.

Page 33: Distributive laws for Lawvere theories

2. Lawvere theories

We have many arities for the “same” operation.

arity operation

3 a, b, c abc

4 a, b, c, d abc

5 a, b, c, d, e abc...

7.

Page 34: Distributive laws for Lawvere theories

2. Lawvere theories

We have many arities for the “same” operation.

arity operation

3 a, b, c abc

4 a, b, c, d abc

5 a, b, c, d, e abc...

These are all related by forgetting variablesi.e. via projections in Fop.

13

4

5

6...

7.

Page 35: Distributive laws for Lawvere theories

2. Lawvere theories

Generalisations

8.

Page 36: Distributive laws for Lawvere theories

2. Lawvere theories

Generalisations

• use F = FinSet instead of a skeleton

8.

Page 37: Distributive laws for Lawvere theories

2. Lawvere theories

Generalisations

• use F = FinSet instead of a skeleton

• put P = “free finite product category” 2-monadnote that FinSetop is P1—could use PA to get “typed” theory

8.

Page 38: Distributive laws for Lawvere theories

2. Lawvere theories

Generalisations

• use F = FinSet instead of a skeleton

• put P = “free finite product category” 2-monadnote that FinSetop is P1—could use PA to get “typed” theory

• could just say a Lawvere theory is any finite productcategory C

8.

Page 39: Distributive laws for Lawvere theories

2. Lawvere theories

Generalisations

• use F = FinSet instead of a skeleton

• put P = “free finite product category” 2-monadnote that FinSetop is P1—could use PA to get “typed” theory

• could just say a Lawvere theory is any finite productcategory C

• could do finite limits instead of just products.

8.

Page 40: Distributive laws for Lawvere theories

2. Lawvere theories

Models ≡ algebras

A model for L in a finite-product category C is afinite-product preserving functor

L C

9.

Page 41: Distributive laws for Lawvere theories

2. Lawvere theories

Models ≡ algebras

A model for L in a finite-product category C is afinite-product preserving functor

L C

Idea1 A ∈ C underlying data

9.

Page 42: Distributive laws for Lawvere theories

2. Lawvere theories

Models ≡ algebras

A model for L in a finite-product category C is afinite-product preserving functor

L C

Idea1 A ∈ C underlying data

k Ak

9.

Page 43: Distributive laws for Lawvere theories

2. Lawvere theories

Models ≡ algebras

A model for L in a finite-product category C is afinite-product preserving functor

L C

Idea1 A ∈ C underlying data

k Ak

operation of arity k

k

1

Ak

A

9.

Page 44: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

10.

Page 45: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

Lawvere theory monad

10.

Page 46: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

Lawvere theory monad

morphism

k 1

“k-ary

operation”

10.

Page 47: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

10.

Page 48: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

10.

Page 49: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

morphism

k m

“m operations

of arity k”

10.

Page 50: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

morphism

k m

“m operations

of arity k”

m elements of T ([k])

10.

Page 51: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

morphism

k m

“m operations

of arity k”

m elements of T ([k])

i.e. [m] T ([k]) ∈ Set

10.

Page 52: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

morphism

k m

“m operations

of arity k”

m elements of T ([k])

i.e. [m] T ([k]) ∈ Set

i.e. [m] [k] ∈ KlT

10.

Page 53: Distributive laws for Lawvere theories

2. Lawvere theories

Lawvere theories vs monads

set of k elements

Lawvere theory monad

morphism

k 1

“k-ary

operation”

element of T ([k])

i.e. 1 T ([k]) ∈ Set

morphism

k m

“m operations

of arity k”

m elements of T ([k])

i.e. [m] T ([k]) ∈ Set

i.e. [m] [k] ∈ KlT

Idea

Lawvere theories are related to monads via the Kleisli category.

10.

Page 54: Distributive laws for Lawvere theories

2. Lawvere theories

Definition

Monad T on Set Lawvere theory LT

LT = full subcategory of (KlT )op

whose objects are finite sets.

11.

Page 55: Distributive laws for Lawvere theories

2. Lawvere theories

Definition

Monad T on Set Lawvere theory LT

LT = full subcategory of (KlT )op

whose objects are finite sets.

Lawvere theory L monad TL on Set

TLX =

n∈Fop

L(n, 1) × Xn.

11.

Page 56: Distributive laws for Lawvere theories

2. Lawvere theories

Definition

Monad T on Set Lawvere theory LT

LT = full subcategory of (KlT )op

whose objects are finite sets.

Lawvere theory L monad TL on Set

TLX =

n∈Fop

L(n, 1) × Xn.

Theorem

This gives a correspondence between Lawvere theories andfinitary monads on Set.

11.

Page 57: Distributive laws for Lawvere theories

3. Distributive laws for monads

12.

Page 58: Distributive laws for Lawvere theories

3. Distributive laws for monadsIdea

Given monads S and T on C, can we make TS into a monad?

12.

Page 59: Distributive laws for Lawvere theories

3. Distributive laws for monadsIdea

Given monads S and T on C, can we make TS into a monad?

TSTS TTSS TS? µT µS

12.

Page 60: Distributive laws for Lawvere theories

3. Distributive laws for monadsIdea

Given monads S and T on C, can we make TS into a monad?

TSTS TTSS TS? µT µS

Definition (Beck)

A distributive law of monads S over T consists of a naturaltransformation

λ : ST ⇒ TS

satisfying some axioms.

12.

Page 61: Distributive laws for Lawvere theories

3. Distributive laws for monadsIdea

Given monads S and T on C, can we make TS into a monad?

TSTS TTSS TS? µT µS

Definition (Beck)

A distributive law of monads S over T consists of a naturaltransformation

λ : ST ⇒ TS

satisfying some axioms.

• Formal theory of monads (Street)Do this inside any bicategory, not just Cat.

12.

Page 62: Distributive laws for Lawvere theories

3. Distributive laws for monadsIdea

Given monads S and T on C, can we make TS into a monad?

TSTS TTSS TS? µT µS

Definition (Beck)

A distributive law of monads S over T consists of a naturaltransformation

λ : ST ⇒ TS

satisfying some axioms.

• Formal theory of monads (Street)Do this inside any bicategory, not just Cat.

• Iterated distributive laws (Cheng)Combine n monads with distributive laws andYang-Baxter condition.

12.

Page 63: Distributive laws for Lawvere theories

3. Distributive laws for monads

Examples

monoid + abelian group ring

horizontalcomposition

+verticalcomposition

2-category

13.

Page 64: Distributive laws for Lawvere theories

3. Distributive laws for monads

Examples

monoid + abelian group ring

horizontalcomposition

+verticalcomposition

2-category

Or combining more structures:

0-composition+

1-composition+...+

(n − 1)-composition

n-category

13.

Page 65: Distributive laws for Lawvere theories

3. Distributive laws for monads

A point of view

• The monad TS says we can express all structure as“S-structure followed by T -structure”.

14.

Page 66: Distributive laws for Lawvere theories

3. Distributive laws for monads

A point of view

• The monad TS says we can express all structure as“S-structure followed by T -structure”.

• The distributive law ST TS says “if we had it theother way round we could switch it over”.

14.

Page 67: Distributive laws for Lawvere theories

3. Distributive laws for monads

A point of view

• The monad TS says we can express all structure as“S-structure followed by T -structure”.

• The distributive law ST TS says “if we had it theother way round we could switch it over”.

For Lawvere theories

We want a way of combining A and B to give BA

corresponding to a distributive law of monads

TATB TBTA

14.

Page 68: Distributive laws for Lawvere theories

3. Distributive laws for monads

A point of view

• The monad TS says we can express all structure as“S-structure followed by T -structure”.

• The distributive law ST TS says “if we had it theother way round we could switch it over”.

For Lawvere theories

We want a way of combining A and B to give BA

corresponding to a distributive law of monads

TATB TBTA

withTBTA = TBA

14.

Page 69: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop.

—Rosebrugh and Wood, Distributive laws andfactorization (JPAA 2002)

15.

Page 70: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop.

—Rosebrugh and Wood, Distributive laws andfactorization (JPAA 2002)

2. Profunctors internal to Mon.

—Lack, Composing props (TAC 2004)

—Akhvlediani, Composing Lawvere theories (CT2010)

15.

Page 71: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop.

—Rosebrugh and Wood, Distributive laws andfactorization (JPAA 2002)

2. Profunctors internal to Mon.

—Lack, Composing props (TAC 2004)

—Akhvlediani, Composing Lawvere theories (CT2010)

3. Kleisli bicategory of P on profunctors

—Hyland, Distributive laws (CLP 2010)

15.

Page 72: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

16.

Page 73: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

16.

Page 74: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

For example: × and +

The composite 3-ary operation a(b + c) can be expressed as

16.

Page 75: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

For example: × and +

The composite 3-ary operation a(b + c) can be expressed as

3 1

2ab, ac x + y

16.

Page 76: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

For example: × and +

The composite 3-ary operation a(b + c) can be expressed as

3 1

2ab, ac x + y

3ab, ac, ab2c x + y

16.

Page 77: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

For example: × and +

The composite 3-ary operation a(b + c) can be expressed as

3 1

2ab, ac x + y

3ab, ac, ab2c x + y

p1, p2

16.

Page 78: Distributive laws for Lawvere theories

4. Three ways to do it

1. Factorisation systems over Fop

In the composite theory BA every morphism can beexpressed as a composite

∈A ∈B

For example: × and +

The composite 3-ary operation a(b + c) can be expressed as

3 1

2ab, ac x + y

3ab, ac, ab2c x + y

p1, p2

—factorisations are only unique up to morphisms in Fop.

16.

Page 79: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

17.

Page 80: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

17.

Page 81: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

It is the pullback

obFobF

A

17.

Page 82: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

It is the pullback

obFobF

A B

obF

17.

Page 83: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

It is the pullback

obFobF

A B

obF

.

17.

Page 84: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

It is the pullback

obFobF

A B

obF

.composable pairs

k∈A

l∈B

m

17.

Page 85: Distributive laws for Lawvere theories

4. Three ways to do it

Appealing fact (Rosebrugh and Wood)

Strict factorisation systems are distributive laws in Span.

• A and B are categories i.e. monads in Span.

• AB BA makes BA into a monad in Spani.e. a category.

It is the pullback

obFobF

A B

obF

.composable pairs

k∈A

l∈B

m

The distributive law tells us how to re-express a pair

k∈B

l∈A

m as k∈A

l′∈B

m

17.

Page 86: Distributive laws for Lawvere theories

4. Three ways to do it

RW define distributive laws over I for I a groupoid—ensures equivalence relation on composable pairs.

18.

Page 87: Distributive laws for Lawvere theories

4. Three ways to do it

RW define distributive laws over I for I a groupoid—ensures equivalence relation on composable pairs.

However instead we can generate an equivalence relation.

18.

Page 88: Distributive laws for Lawvere theories

4. Three ways to do it

RW define distributive laws over I for I a groupoid—ensures equivalence relation on composable pairs.

However instead we can generate an equivalence relation.

Idea

18.

Page 89: Distributive laws for Lawvere theories

4. Three ways to do it

RW define distributive laws over I for I a groupoid—ensures equivalence relation on composable pairs.

However instead we can generate an equivalence relation.

Idea

Our original pullbackB ⊗ A

A B

obFobF obF

ignored the fact that Fop is in both A and B.

18.

Page 90: Distributive laws for Lawvere theories

4. Three ways to do it

RW define distributive laws over I for I a groupoid—ensures equivalence relation on composable pairs.

However instead we can generate an equivalence relation.

Idea

Our original pullbackB ⊗ A

A B

obFobF obF

ignored the fact that Fop is in both A and B.

So we want a coequaliser

B ⊗ Fop ⊗ A B ⊗ A B ⊗Fop Aabsorb F

op into A

absorb Fop into B

—looks like bimodules.

18.

Page 91: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

19.

Page 92: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span)

19.

Page 93: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span) ≃ Prof.

19.

Page 94: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span) ≃ Prof.

Aside on profunctors

19.

Page 95: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span) ≃ Prof.

Aside on profunctors

Given categories C and D, a profunctor CF

D is a functor

Dop × C

FSet.

19.

Page 96: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span) ≃ Prof.

Aside on profunctors

Given categories C and D, a profunctor CF

D is a functor

Dop × C

FSet.

A monad CA

C ∈ Prof corresponds to a category A

equipped with an identity-on-objects functor

C A.

19.

Page 97: Distributive laws for Lawvere theories

4. Three ways to do it

Definition 1

A distributive law of Lawvere theories A over B is a factorisationsystem over Fop on the composite B ⊗ A in Span.

≡ a distributive law of A over B expressed as monads in

Bim(Span) ≃ Prof.

Aside on profunctors

Given categories C and D, a profunctor CF

D is a functor

Dop × C

FSet.

A monad CA

C ∈ Prof corresponds to a category A

equipped with an identity-on-objects functor

C A.

So Lawvere theories arise as particular monads on Fop.

19.

Page 98: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

20.

Page 99: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

20.

Page 100: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

20.

Page 101: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

Definition 2

A distributive law of Lawvere theories A over B is adistributive law in the bicategory Prof(Mon).

20.

Page 102: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

Definition 2

A distributive law of Lawvere theories A over B is adistributive law in the bicategory Prof(Mon).

Theorem

Such a distributive law makes B⊗FopA into a Lawvere theory.

i.e. if A and B are finite-product categories, so is B ⊗Fop A.

20.

Page 103: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

Definition 2

A distributive law of Lawvere theories A over B is adistributive law in the bicategory Prof(Mon).

Theorem

Such a distributive law makes B⊗FopA into a Lawvere theory.

i.e. if A and B are finite-product categories, so is B ⊗Fop A.

A ⊗Fop B

λB ⊗F

op A

20.

Page 104: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

Definition 2

A distributive law of Lawvere theories A over B is adistributive law in the bicategory Prof(Mon).

Theorem

Such a distributive law makes B⊗FopA into a Lawvere theory.

i.e. if A and B are finite-product categories, so is B ⊗Fop A.

A ⊗Fop B

λB ⊗F

op A

Proof • Bare hands, or

20.

Page 105: Distributive laws for Lawvere theories

4. Three ways to do it

2. Prof(Mon) —internal profunctors in monoids

A monad C C is now a monoidal category A equippedwith an identity-on-objects monoidal functor C A.

So again Lawvere theories arise as particular monads on Fop.

Definition 2

A distributive law of Lawvere theories A over B is adistributive law in the bicategory Prof(Mon).

Theorem

Such a distributive law makes B⊗FopA into a Lawvere theory.

i.e. if A and B are finite-product categories, so is B ⊗Fop A.

A ⊗Fop B

λB ⊗F

op A

Proof • Bare hands, or

• The free finite-product category 2-monad on Prof.20.

Page 106: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

21.

Page 107: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

21.

Page 108: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

21.

Page 109: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

• A monad in ProfP is a profunctor 1 P1

21.

Page 110: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

• A monad in ProfP is a profunctor 1 P1

i.e. P1op × 1 Set

21.

Page 111: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

• A monad in ProfP is a profunctor 1 P1

i.e. P1op × 1 Set

i.e. FinSet Set a finitary monad.

21.

Page 112: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

• A monad in ProfP is a profunctor 1 P1

i.e. P1op × 1 Set

i.e. FinSet Set a finitary monad.

Definition 3

21.

Page 113: Distributive laws for Lawvere theories

4. Three ways to do it

3. Free finite-product category 2-monad approach.

• Let P be the free finite-product category 2-monad on Cat.

• P extends to Prof via a distributive law.

• Let ProfP be the Kleisli bicategory for the extended P.

Then monads on 1 in ProfP are precisely Lawvere theories.

• A monad in ProfP is a profunctor 1 P1

i.e. P1op × 1 Set

i.e. FinSet Set a finitary monad.

Definition 3

A distributive law of Lawvere theories A over B is a distributivelaw in the bicategory ProfP.

21.

Page 114: Distributive laws for Lawvere theories

5. Comparison

22.

Page 115: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

22.

Page 116: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

Idea

22.

Page 117: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

Idea

Compare

• Finitary monads Set Set in CAT

22.

Page 118: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

Idea

Compare

• Finitary monads Set Set in CAT

• Lawvere theories as

1. monads F F in Prof

2. monads F F in Prof(Mon)

3. monads 1 1 in ProfP.

22.

Page 119: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

Idea

Compare

• Finitary monads Set Set in CAT

• Lawvere theories as

1. monads F F in Prof

2. monads F F in Prof(Mon)

3. monads 1 1 in ProfP.

SetT

Set

22.

Page 120: Distributive laws for Lawvere theories

5. Comparison

ClaimThese three methods all give the same answer as a distributivelaw between the associated monads.

Idea

Compare

• Finitary monads Set Set in CAT

• Lawvere theories as

1. monads F F in Prof

2. monads F F in Prof(Mon)

3. monads 1 1 in ProfP.

SetT

Set

FI∗

SetT∗

SetI∗

F

22.

Page 121: Distributive laws for Lawvere theories

5. Comparison

23.

Page 122: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

23.

Page 123: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

23.

Page 124: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

23.

Page 125: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

23.

Page 126: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

23.

Page 127: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)

23.

Page 128: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)f+f

23.

Page 129: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)f+f

equivalence

23.

Page 130: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)f+f

equivalence

Prof(P1, P1)

forgetful

23.

Page 131: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)f+f

equivalence

Prof(P1, P1)

forgetful

forgetfulf+f

23.

Page 132: Distributive laws for Lawvere theories

5. Comparison

Key points

24.

Page 133: Distributive laws for Lawvere theories

5. Comparison

Key points

• The functors send T to LT .

24.

Page 134: Distributive laws for Lawvere theories

5. Comparison

Key points

• The functors send T to LT .

• By pseudo-functoriality distributive laws map todistributive laws, and

LT ◦ LS∼= LTS

24.

Page 135: Distributive laws for Lawvere theories

5. Comparison

Key points

• The functors send T to LT .

• By pseudo-functoriality distributive laws map todistributive laws, and

LT ◦ LS∼= LTS

• Moreover the functors are full and faithful, so givenLawvere theories on the right, any distributive lawbetween them corresponds to one on the left.

So we have three equivalent notions of distributive laws for

Lawvere theories, which correspond to distributive laws

between the associated monads.

24.

Page 136: Distributive laws for Lawvere theories

5. Comparison

Prof(F, F)

ProfP(1, 1)

Prof(Mon)(F, F)

Monads

Lawvere theories

id-on-objects functors

F −→ A

id-on-objects

monoidal functors

F −→ A

CATf (Set,Set)

equivalence

f+f ≃

Prof(P1, P1)

forgetful

forgetfulf+f

25.

Page 137: Distributive laws for Lawvere theories

5. Comparison

Key points

• The functors are monoidal, and send T to LT .

• By pseudo-functoriality distributive laws map todistributive laws, and

LT ◦ LS∼= LTS

• Moreover the functors are full and faithful, so givenLawvere theories on the right, any distributive lawbetween them corresponds to one on the left.

26.

Page 138: Distributive laws for Lawvere theories

5. Comparison

Key points

• The functors are monoidal, and send T to LT .

• By pseudo-functoriality distributive laws map todistributive laws, and

LT ◦ LS∼= LTS

• Moreover the functors are full and faithful, so givenLawvere theories on the right, any distributive lawbetween them corresponds to one on the left.

So we have three equivalent notions of distributive laws for

Lawvere theories, which correspond to distributive laws

between the associated monads.

26.