Top Banner
RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal alculating limits and colimits compositional
24

RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy

CT2007, Faro, Portugal

Calculating limits and colimits compositionally

Page 2: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

In Computer Science:

The state spaces of systems are often described by finite limits or colimits in a category E, parametrized by a graph G which describes the geometry of the system.

It is desirable that there is also an algebraic description, so that the limit or colimit is described by an expression, rather than geometrically.

This goes back to the beginnings of computer science, where - a program may be described either by a flow chart (goto’s), or program text (while) (Böhm-Jacopini) - a language may be specified by an automaton or an expression (Kleene)

And of course it is present in inumerable areas of computer science (Petri nets versus process algebras, wysiwig versus markup, graph versus term rewriting, etc etc) and mathematics.

Page 3: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

In Category Theory:

Finite limits and colimits are parametrized by graphs, ie geometrically.

In this lecture we show that they can also be described by expressions in an algebra.

As an application we show Kleene’s theorem.

Page 4: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

What algebra?

Assume now E has finite colimits.

What is the algebra in which finite colimits in E can be described by expressions?

Answer: cospan(E).

The operations and equations of the algebra?

Answer: symmetric monoidal category in which each object has a commutative separable algebra structure.

We call such a wscc category

Page 5: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

=

=

(Carboni, Walters, Cartesian bicategories I, JPAA 1987)

Page 6: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Cospan(E) has a wscc structure:Composition is pushout.The monoidal structure is the sum.

Multiplication of A is the cospan A+A A A;

Comultiplication ∆ is the cospan A A A+A.

1

1

Each arrow f : A B of E is represented in cospan by A B B

To avoid confusion between calculations in E and cospan(E) I will always write cospan calculations in a blue rectangle.

f 1

Cospan(E)

Page 7: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Before stating the theorem let’s look at an example:How is a coequalizer in E given as an expression in this algebra?

Consider f, g : A B; the coequalizer of f and g is the centre of the cospan

A A+A B+B B

f+g

f

g

Page 8: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

f+gA A+A B+B B

A A+A B+B B

A B+B B

f+g1 11

pushout

coequal(f,g)

Page 9: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

The Theorem

Let Graph be the category of finite graphs, let |E| be the underlying graph of E.Consider Graph/|E|, the category with objects diagrams in E, and morphisms compatible graph morphisms.

Then colim is a functor

colim : Graph/|E| E.

Consider Cspn(Graph/|E|) the full subcategory of cospan(Graph/|E|) with objects being discrete diagrams in E.

Theorem Colim extends to a functor colim : Cspn(Graph/|E|) cospan(E)

which preserves the wscc structure.

Page 10: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Theorem. Colim extends to a functor colim : Cspn(Graph/|E|) cospan(E)

which preserves the wscc structure.

Remarks.

Cspn(Graph/|E|) is the result of freely adding wscc structure to the graph |E|. (Rosebrugh,Sabadini, Walters - CT04)

This means that diagrams in E may be written as expressions in the wscc structure of Cspn(Graph/|E|) with constants being the arrows of E.

Then colim preserves wscc expressions, so the colimit of any diagram may be written as an expression in cospan(E).

Page 11: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Example of coequalizers

The diagram A B is given the by evaluation in Cspn(Graph/|E|) of expression

f

g

f+g

A A+A B+B B

Hence colim(f,g : A B) = coequal(f,g) is given by evaluating the same expression in cospan(E).

NoteIn Cspn(Graph/|E|) : A A+A is the cospan of diagrams

A A AA

And f+g is the disjoint union f two arrows

Page 12: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Example

The diagram A

B

C

is given by the following expression in Cspn(Graph/|E|):

0 B+B B+A+A+B+B B+A+A+B+B+B

B+A+B+A+B+C B+A+A+B+B+C B+B+C C 0

g

f

h

k

Note η= ! ε= !

B+ η+η B+A+A+B+

B+A+f+g+h+k twist B+ε+ +C ε+C

h

f

g

k

Hence the colimit is given by the same expression in evaluated in cospan(E)

Page 13: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Proof of Theorem

The main point to check in showing that colim is a monoidal functor is (a special case of) the following:

Consider a diagram D of diagrams in E parametrized by a graph G;i.e. a graph morphism D : G Graph/|E|. We can do two things1) Calculate first the colimit of D in Graph/|E| to obtain a diagram

in E of which we may then take the colimit in E, that is calculate colimE(colimGraph/|E|(D))2) Calculate the colimit of

G Graph/|E| E, that is, calculate colimE(colimE ○ D).

Lemma colimE(colimGraph/|E|(D)) = colimE(colimE ○ D).

D colim

Page 14: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Lemma colimE(colimGraph/|E|(D)) = colimE(colimE ○ D).

Sketch of proof Suffices to show a bijection cocones : colimGraph/|E|(D) X

cocones : colimE ○ D X

But it is not hard to show that both of these are equivalent to a “compatible family” of cocones

D(g) X (g in G).

Page 15: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Very special caseTo show a bijection cocones : colimGraph/|E|(D) X

cocones : colimE ○ D X

Diagram of diagrams is:

Then colimGraph/|E|(D) is

And a cocone to X consists of 3 arrows A X, B X, C X

Further colimE ○ D is

And a cocone to X also consists of 3 arrows A X, B X, C X

We have just proved that A+B+C = A+(B+C).

B CA

A B C

A B+C

Page 16: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Lemma limE(colimGraph/|E|(D)) = limE(limE ○ D).

The meaning of the lemma is that one can form the colimit of a composed diagram knowing the colimits of the parts.

Just as in the special case this implies a variety of “associativities”, which arise from the fact that a diagram may be decomposed in various ways.

There is a similar result for limits, which however also involves colimits of diagrams.

Limits may be calculated compositionally in span(E).

Page 17: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Example of theorem

A general diagram may be written in Cspn(Graph/|E|) by an expression of the following form:

Σ(arrows) d1

d0

Σ(domains)

Σ(codomains)

Σ(all vertices)

Evaluated in cospan(E) this translates into the coequalizer of two arrows of E given by the top and bottom rows. The two arrows are Σ(domains) Σ(codomains) Σ(all objects)and Σ(domains) Σ(all objects);

the classical formula for colimits in terms of sums and coequalizers.

Σ(arrows)

Page 18: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Limits and colimits of monoidal diagrams

Systems in computer science are ususally not constructed from parts with “one input” and “one output”, like arrows in a graph. Components have multiple inputs and outputs, i.e. they are arrows in a monoidal graph.

Definition A monoidal graph consists of a set V of vertices, and a set A of arcs and two functions d0,d1:A V* (the free monoid on V). There is an obvious notion then of monoidal diagram in a monoidal category.

Definition Let E be a category with finite colimits, regarded as a monoidal category with sum as tensor. The colimit of a monoidal diagram is an object C with a family (qi :Ai C) (Ai objects of the diagram) such that for any arrow in the diagram f:A1+A2+…Am B1+B2+ … Bn

(q1| q2| q3 … |qn) f = (q1| q2| q3 … |qm), and is universal such.

Page 19: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Monoidal colimits are also calculable compositionally, in the algebra cospan(E). We look at one example only.

Example Consider the monoidal diagram in Sets with three objects A,B,C and one arrow f : A+C B+C. It is convienient to draw this as a “flow chart”:

A

C

Bf

This diagram is given by an expression in Cspn(MonGraph/|E|) as follows:

A A+C+C B+C+C B

where the centre of the cospan f^ is the monoidal diagram with four objects A,B,C,C and one arrow f : A+C B+C.

A+ η f^+C B+ ε

Page 20: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Example A Bf^

So the colimit can be calculated in cospan(Sets) as:

A A+C+C B+C+C BA+ η f^+C B+ ε

Or in Sets as:

A A+C+C B+C+C B

A+C B+C+C B+C

colim

pushout

inc A+ f+C B+C+Cinc

B+

The pullback of the resulting cospan is the partial function obtained by iterating f

The colimit consists of orbits of A+B+C under f

Page 21: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Kleene Theorem: the languages recognized by finite state automata are the closure of singletons under union concatenation and *

The category E we consider is P(Σ*)-Cat, categories enriched in Σ languages.There is a wscc functor

Cspn(Graph/ Σ) Cspn(Graph/P(Σ*)-Cat) cospan(P(Σ*)-Cat)

which takes a labelled graph (with input and output states) to the (P(Σ*)- category whose homs are the languages traced out from the domain to the codomain. This is already a Kleene type theorem since the left-and side is generated as a wscc category by single labelled edges, and hence the image on the right-hand side is also generated as a wscc category by singleton languages.

However it is not the classical Kleene theorem, since the right hand side does not consist of single languages and the wscc operations are not the Kleene operations. Further the functor does not lose internal states.

CT04 colim

Page 22: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

To obtain a theorem closer to the classical Kleene theorem we compose with a further wscc functor

cospan(P(Σ*)-Cat) corel(P(Σ*)-Cat)

which uses the bijective-on-objects fully-faithful factorization to obtain from a cospan of P(Σ*) categories a corelation of P(Σ*) categories.

The final composite

Cspn(Graph/ Σ) corel(P(Σ*)-Cat)

takes a labelled graph with initial and final states to the category with objects only the initial and final states, and homs the languages traced out.

To finish a proof of the classical Kleene theorem we need to show that the wscc operations in corel, at the level of languages (homs), may be expressed in terms of union, concatenation and *.

Φ

Page 23: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

To show that the wscc operations in corel, at the level of languages (homs), may be expressed in terms of union, concatenation and *.

Clearly the tensor does not change the languages.The problem is the composition.But in a wscc category the general composition reduces to considering the very special case of the colimit identifying two objects in a category.

This amounts to the particular problem of passing from the category

toa b

c

d

a

c

b

d

But the category generated by the right-hand side has hom (aUbUcUd)*.

This proof is very close to one of the usual proofs of Kleene (if you strip the superstructure). The superstructure has the advantage of suggesting needed generalizations, e.g. to parallelism.

Page 24: RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.

Comments:

The theorem we have described concerns calculating colimits as objects, not as functors. So we have not shown the compositionality of morphisms. We believe this is connected with the algebra of span and cospan as monoidal bicategories rather than categories. We have made an initial progress in understanding this question, by considering a very special case, where we identify the role of “2-separable object”.

A universal property of the monoidal 2-category of cospans of finite linear orders and surjections,M. Menni, N. Sabadini, R. F. C. Waltershttp://arxiv.org/abs/0706.1393v1