Physics, Topology, Logic and Computation: A Rosetta Stone

In physics, Feynman diagrams are used to reason about quantum processes. In the 1980s, it became clear that underlying these diagrams is a powerful analogy between quantum physics and topology: namely, a linear operator behaves very much like a "cobo…

Authors: John C. Baez, Mike Stay

Physics, Topology, Logic and Computation: A Rosetta Stone
Physics, T opology , Logic and Computation : A Rosetta Stone John C. Baez Department of Mathematics, Univ ersity of California Riv erside, California 92521, USA Mike Stay Computer Science Department, Univ ersity of Auckland and Google, 1600 Amphitheatre Pkwy Mountain V ie w , California 94 043, USA email: baez@math.ucr . edu, stay@google.com March 2, 2009 Abstract In physics, Feyn man diagrams are used to reason about quantum processes. In t he 1980s, it became clear that underlying these diagrams is a po werful analogy between quantum physics and topology . Namely , a lin- ear operator behav es very much like a ‘cobordism’: a manifold representing spacetime, going between two manifolds representing space. This led to a burst of wo rk on topological quantum field theory and ‘quan- tum topology’. But this was just the beginning : similar diagrams can be used t o reason about logic, where they represent proofs, and computation, where they represent programs. W ith the rise of interest in quantum cryptography and quantum computation, it became clear that there is extensi ve network of analogies between physics, topology , logic and computation. In this expository paper , we make some of t hese analogies pre- cise using the concept of ‘closed symmetric monoidal category ’. W e assume no prior kno wledge of category theory , proof theory or computer science. 1 Introd uction Category theor y is a very gen eral formalism, but there is a certain specia l way that physicists u se categories which turn s out to have clo se analog ues in top ology , lo gic an d compu tation. A category has ob jects and mo r- phisms , which represent things and ways to go between things . In phy sics, the objects are often physica l systems , and th e mor phisms are pr ocesses tu rning a state of one p hysical system into a state o f ano ther system — per- haps th e same one. In q uantum ph ysics we often form alize this by taking Hilb ert sp a ces as objec ts, and linear operators as morp hisms. 1 Sometime aro und 1949, Feynman [ 57] realized that in qua ntum field theo ry it is u seful to d raw linear ope r- ators as diagrams: This lets us r eason with them p ictorially . W e can warp a pictur e without changin g the operator it stands f or: all that matters is the to polog y , not the geo metry . In the 1970 s, Penrose realized th at gen eralizations of Feynman diagrams arise throughout quantum theo ry , and might even lead to revisions in ou r und erstanding of spac e- time [78]. In the 1 980s, it becam e clear that und erlying th ese d iagrams is a powerful analogy b etween quan - tum p hysics and topo logy! Namely , a linea r operato r behaves very much like a ‘co bordism’ — that is, an n -dimen sional manifold going between manifo lds of one dimension less : String th eory exploits this analogy by replacing the Feynm an diagr ams of ordina ry quan tum field theory with 2-dimen sional cobordisms, which represent the worldsheets traced out by string s with the passage of time. The analogy between o perator s and cobordisms is also impo rtant in loop q uantum gravity and — m ost of all — the more purely mathematical discipline of ‘topological quantum field theory’. Meanwhile, q uite separately , logicians ha d begun using categories where the objects rep resent pr opo sitions and the m orphisms repre sent pr oofs . The idea is that a pr oof is a pr ocess going from o ne pro position (the hypoth esis) to another (the conclusion ). Later, c omputer scien tists started using categories wh ere the objects represent da ta typ e s an d the mo rphisms r epresent pr ograms . They also started using ‘flow c harts’ to d escribe progr ams. Abstractly , these are very much like Feynman diagram s! The logic ians and co mputer scientists were n ev er very far fr om each other . Indeed , the ‘Curr y–Howard correspo ndence’ relating proof s to p rogram s has been well-known at least sin ce the early 1970s, with roo ts stretching back earlier [35, 52]. But, it is on ly in the 1990 s that the log icians and computer scientists bumped into the p hysicists and topolog ists. One reason is the rise of interest in q uantum cryptogr aphy and quan tum computatio n [ 28]. W ith th is, p eople began to think of q uantum pro cesses as forms of inform ation processing, and ap ply ideas fro m comp uter science. It was then realized that the loose a nalogy between flow charts and Feynman diagrams could be m ade more precise and powerful with the aid of category theory [3]. By now ther e is an extensiv e network of in terlocking an alogies between phy sics, to pology , logic and com- puter science. They su ggest that research in the area of co mmon overlap is actually trying to build a ne w scien ce: 2 a general science o f systems and pr ocesses . Building this science will b e very di ffi cult. There are goo d reasons for this, but als o bad on es. On e bad reason is that di ff erent fields use di ff erent terminolog y and notation . The origina l Rosetta Sto ne, crea ted in 196 BC, co ntains versions of the same text in three lan guages: de- motic Egyptian, hierogly phic script and classical Greek. Its rediscovery by Napoleon ’ s sold iers let mo dern Egypto logists decipher the h ieroglyp hs. Eventually this led to a vast increase in our u nderstand ing of Egyptian culture. At present, the d eductive systems in mathematical logic loo k like hieroglyp hs to mo st physicists. Similarly , quantum field theory is Greek to most comp uter scientists, and so on. So, there is a need fo r a new Rosetta Stone to aid resear chers attempting to translate be tween fields. T able 1 shows our guess as to what this Rosetta Ston e might look like. Category Theory Physics T opolo gy Logic Computation object system manifold propo sition data type morph ism process cobord ism proof progr am T able 1: The Rosetta Ston e (pocket version) The rest of th is paper expa nds on this table by comparing h ow categories are used in physics, topolo gy , logic, and compu tation. Unfor tunately , th ese di ff eren t field s f ocus on slightly d i ff erent kinds of categories. Thoug h most physicists don’t k now it, quan tum physics ha s long made use of ‘com pact symm etric monoid al categories’. Knot theory uses ‘compa ct braided mono idal categories’, which are sligh tly more gen eral. Ho wever , it became clear in the 1990 ’ s that these m ore gen eral gad gets are useful in physics to o. L ogic and com puter science used to focu s on ‘cartesian closed cate gor ies’ — where ‘cartesian’ can be seen, roughly , as an antonym of ‘quantum’ . Howe ver , than ks to work on linear logic and quantum comp utation, some logicians and computer scientists have dropp ed the ir insistence on cartesiann ess: now they study mo re gen eral sorts of ‘closed symmetric monoid al categories’. In Section 2 we explain these concep ts, how they illuminate the a nalogy betwee n physics and topolog y , and how to work with them using string diagrams. W e assume no prior knowledge of category theo ry , only a willing ness to learn som e. In Section 3 w e explain how closed symmetric monoidal categories co rrespon d to a small fragment of ordinar y pro positional lo gic, which also happen s to be a frag ment of Girard’ s ‘linear logic’ [43]. I n Section 4 we explain how clo sed sym metric mon oidal categor ies corr espond to a simp le mod el of com putation. Each of these sections starts with some b ackgro und ma terial. In Section 5, we conclude by presenting a larger v ersion of the Rosetta Stone. Our treatment of all fou r subjects — physics, topology , logic and compu tation — is bound to seem sketchy , narrowly focu sed an d idiosyncra tic to prac titioners of these su bjects. Our excuse is that we wish to empha- size cer tain an alogies while saying no mor e than absolutely n ecessary . T o ma ke up for th is, we inclu de m any referenc es for those who wish to dig deep er . 3 2 The Analogy B etween Physics and T opology 2.1 Backgroun d Currently our be st theor ies of physics are gene ral relativity and the Standard Model of particle physics. T he first describes gravity without taking qu antum theory into acco unt; th e second describ es all the other fo rces takin g quantum theory into acco unt, but igno res gravity . So, our world-v iew is d eeply schizop hrenic. The field where physicists stru ggle to solve this prob lem is called qua ntum gravity , since it is widely believed that the solution requires treating gravity in a way that takes quantum theory into account. Physics T opolo gy Hilbert space ( n − 1 )-dimen sional manifo ld (system) (space) operator between cobord ism between Hilbert spaces ( n − 1)-d imensiona l manifo lds (process) (spacetime) composition of operator s composition of cobord isms identity opera tor identity cobo rdism T able 2: Analo gy between physics and topology Nobody is sure how to do th is, but there is a strikin g similarity b etween two of th e ma in approach es: string theory and loop quantu m gravity . Both rely on the analogy between physics and topology s hown in T able 2. On the left we have a basic ingredient of quantum theory: the category Hilb whose objects are Hilb ert spaces, used to describe ph ysical systems , and wh ose morph isms ar e lin ear op erators, used to describe physical pr ocesses . On the right we have a basic stru cture in di ff ere ntial topology : the ca tegory n Cob. Her e the objects are ( n − 1)- dimensiona l m anifolds, used to describe space , an d wh ose morphisms are n - dimension al cobord isms, used to describe spacetime . As we shall see, Hilb a nd n Cob share many structural fea tures. M oreover , both are very di ff eren t from the more familiar category Set, who se objects ar e sets and wh ose morp hisms are fun ctions. Elsewhere we have argued at great length that this is importan t f or better under standing quantu m gravity [10] and even th e found ations of quantu m theory [11]. The id ea is that if Hilb is m ore like n Cob than Set, may be we sho uld stop thinking of a qu antum p rocess a s a fu nction f rom one set o f states to anoth er . Instead , maybe we should think of it as resembling a ‘spacetime’ going between spaces of dimension one less. This idea sound s strange, but the simplest example is something very practical, used by physicists e very day: a Feynman diagram. This is a 1-d imensiona l g raph g oing between 0-dim ensional collection s of points, with edges and vertices labelled in certain ways. Feynm an diagrams are topo logical entities, b ut they describe linear operator s. String th eory uses 2 -dimensio nal cobordisms equipped with extra structur e — strin g worldsheets — to do a similar job . Loop qu antum gravity uses 2 d g eneralization s of Feynman diagram s called ‘spin f oams’ [9]. T opolog ical quantum field theory uses h igher-dimension al c obord isms [13]. I n each case, p rocesses a re described by morphisms in a special sort of category: a ‘co mpact symmetric monoidal category’. In wh at fo llows, we shall n ot d well on puzzles f rom quan tum theory or qua ntum gravity . Instead we take a di ff erent tack, simply explainin g som e basic concepts fro m category theory and showing how Set, Hilb, n Cob 4 and categories of tangles give examples. A rec urring theme, howe ver , is th at Set is very di ff erent fro m the other examples. T o h elp the reade r safely navigate th e sea of jargon , h ere is a ch art of the concepts we shall explain in th is section: categories monoid al cate gor ies R R R R R R R R R R R R R R braided monoid al cate gor ies Q Q Q Q Q Q Q Q Q Q Q Q Q closed monoid al categories Q Q Q Q Q Q Q Q Q Q Q Q Q symmetric monoid al cate gor ies Q Q Q Q Q Q Q Q Q Q Q Q closed braided monoid al categories Q Q Q Q Q Q Q Q Q Q Q Q Q compact monoid al categories cartesian categories closed symmetric monoid al categories m m m m m m m m m m m m m Q Q Q Q Q Q Q Q Q Q Q Q compact braided monoid al categories cartesian closed categories compact symmetric monoid al categories The category Set is cartesian closed, while Hilb and n Cob are compact s ymm etric monoid al. 2.2 Categories Category theory was born ar ound 19 45, with Eilenberg and Mac Lane [40] d efining ‘ categories’, ‘functo rs’ between categories, and ‘natural transformations’ between functo rs. By no w there are many intro duction s to the subject [34, 72, 75], including some a vailable for free online [20, 46]. No netheless, we begin at the beginnin g: Definition 1 A cate g ory C con sists of: • a collectio n of objects , where if X is an object of C we write X ∈ C , and • fo r every pair of ob jects ( X , Y ) , a set ho m( X , Y ) of morphisms fr om X to Y . W e call this set hom( X , Y ) a homset . If f ∈ hom( X , Y ) , then we write f : X → Y . such tha t: • fo r every ob ject X ther e is an identity mo rphism 1 X : X → X ; 5 • mo rphisms ar e co mposable: g iv e n f : X → Y and g : Y → Z , there is a composite morphism g f : X → Z ; sometimes also written g ◦ f . • a n ide n tity morph ism is both a left and a rig ht unit for composition : if f : X → Y , th e n f 1 X = f = 1 Y f ; and • co mposition is associative : ( hg ) f = h ( g f ) w henever either side is well-defined. Definition 2 W e say a morphism f : X → Y is an isomo rphism if it has an inver se— that is, there exists a nother morphism g : Y → X such that g f = 1 X and f g = 1 Y . A category is the simplest framework whe re we can talk about s ystems (objects) and pr ocesses (morph isms). T o v isualize these, we can use ‘ Feynman diagr ams’ of a very primitive sort. In ap plications to lin ear alge bra, these diag rams are of ten called ‘spin networks’, but category theo rists call them ‘string diagram s’, and that is the term we will use. T he term ‘string’ here has little to do with string theory: instead, the i dea is that objects of our category l abel ‘ strings’ or ‘wires’: X and morphisms f : X → Y label ‘black boxes’ with an i npu t wire of type X and an outpu t wire of type Y : f X Y W e c ompose two m orph isms b y co nnecting the o utput of one black box to the input of the next. So, the composite of f : X → Y and g : Y → Z looks like this: f g X Y Z Associativity of compo sition is then implicit: 6 f g h X Y Z W is o ur n otation f or b oth h ( g f ) and ( hg ) f . Similarly , if we draw th e iden tity m orphism 1 X : X → X as a piec e of wire of type X : X then the left and right unit laws are also i mplicit. There are coun tless examples of categories, b ut we will focus on four: • Set: the category where objects are sets. • Hilb: the category where objects are finite-dimension al Hilbert spaces. • n Cob: the category where morphisms are n -dimension al cobo rdisms. • T ang k : the category where morphisms are k -codime nsional tangles. As we shall see, all four are closed symmetric monoidal categories, at least when k is big enough. Howev er, th e most familiar of the lot, namely Set, is the odd man out: it is ‘car tesian’. T radition ally , mathem atics h as been fou nded o n the category Set, wh ere the ob jects ar e sets an d the mor- phisms are functio ns . So, when we s tudy systems and processes in physics, it is tempting to specify a system by giving it s set of states, and a pro cess by gi ving a function from states of one system to states of another . Howe ver , in quantum physics we do s ometh ing subtly di ff erent: we use cate gorie s where objects are Hilbert spaces an d morph isms a re bound ed line ar operators . W e specify a system by giving a Hilbe rt space, but this Hilbert sp ace is not rea lly the set of states of the system: a state is actually a ray in Hilb ert spac e. Similarly , a bound ed linear opera tor is not precisely a function from states of one system to states of another . In the day-to-day pr actice o f quan tum ph ysics, what really matters is not sets of states and function s between them, but Hilbert space and operato rs. One of th e virtues o f category theory is th at it f rees us fr om the ‘Set- centric’ view o f trad itional mathema tics and lets us view quan tum phy sics o n its own terms. As we shall see, this sheds new l ight on the qu andaries that ha ve alw ays plagu ed our understanding of the quantum realm [11]. 7 T o av oid technical issues that would take us far afield, we w ill take Hilb to be the category where objects are finite- dimensiona l Hilbert spaces and morph isms are linear operators ( automatically boun ded in this case) . Finite-dimensio nal Hilbert spaces su ffi c e fo r some p urposes; infinite-dime nsional ones are o ften impor tant, but treating them correctly would require some significant extensions of the ideas we want to explain here. In physics we also use categories wh ere the objects represent choices of space , and the m orph isms represent choices of spacetime . The simplest is n Co b, where the ob jects are ( n − 1) -dimension a l manifold s , and the morph isms are n-dimensiona l cobor disms . Glossing over some subtleties that a caref ul treatment would discuss [81], a cobo rdism f : X → Y is an n -d imensiona l manifold whose boun dary is th e disjoin t un ion of the ( n − 1)- dimensiona l manifo lds X an d Y . Here are a coup le of cobordisms in the case n = 2: X Y f   Y Z g   W e compo se them by gluing the ‘output’ of one to the ‘inpu t’ of the other . So, in the above example g f : X → Z looks like this: X Z g f   Another kind of category impor tant in physics has objects r epresenting co llections of particles , an d mo r- phisms r epresenting th eir worldlin es and interactions . Feynman diagr ams are the classic exam ple, but in these diagrams the ‘edges’ ar e no t taken litera lly as particle trajectories. An examp le with closer ties to to pology is T ang k . V er y rou ghly speaking , an object in T ang k is a collection o f poin ts in a k -dimension al cube, while a morphism is a ‘ tangle’: a c ollection of arc s and c ircles sm oothly embedd ed in a ( k + 1)-d imensional cube, such th at th e circles lie in the interio r o f th e cube, while the arcs touch the b oundar y of the cube only at its top an d b ottom, and only at their endpoin ts. A bit mor e precisely , tangles are ‘isoto py c lasses’ of such embedd ed ar cs an d circles: this equiv alence relation means that only the to polog y of th e tangle matters, not its g eometry . W e comp ose tangles by attaching one cube to another top to bottom. More precise definitio ns can be f ound in many sources, at least f or k = 2 , which gives tangles in a 3- dimensiona l cube [42, 58, 81, 89, 97, 10 1]. But sin ce a pictur e is worth a thousand words, here is a p icture of a 8 morph ism in T ang 2 : X Y f   Note th at we can think of a morphism in T ang k as a 1-dimension al cobord ism emb edded in a k - dimensiona l cube . This is why T ang k and n Cob behave similarly in some respects. Here are two composable morphisms in T ang 1 : X Y f   Y Z g   and here is their composite: X Z g f   Since only the tangle’ s topolo gy matter s, we are free to squash this rectang le in to a square if we want, but we do not need to. It is often useful to consider tangles that are decorated in various ways. For example, in an ‘oriented’ tangle, each arc a nd circle is eq uipped with a n orien tation. W e can ind icate this b y drawing a little arrow on each curve in th e tan gle. In applications to physics, these curves re present worldlin es of particles, and the arrows 9 say wheth er each par ticle is go ing forwards or backwards in time , following Feynman’ s idea that an tiparticles are particles g oing backwards in time. W e can also co nsider ‘fram ed’ tan gles. Here each curve is r eplaced by a ‘r ibbon’ . In ap plications to phy sics, this keep s track of how each p article twists. Th is is especially importan t for fer mions, where a 2 π twist acts nontr ivially . Math ematically , the b est-behaved tangles are bo th fram ed and oriented [13, 89], an d these are what we should use to define T an g k . Th e category n Cob also h as a framed oriented version. Howe ver , these details will barely matter in what is to come. It is di ffi cult to d o m uch with categories with out d iscussing the map s b etween them. A map b etween ca te- gories is called a ‘functor ’: Definition 3 A functor F : C → D fr om a cate gory C to a c a te gory D is a map sending: • a ny object X ∈ C to an object F ( X ) ∈ D , • a ny morphism f : X → Y in C to a morph ism F ( f ): F ( X ) → F ( Y ) in D, in such a way that: • F pres erves identit ies : for any object X ∈ C , F (1 X ) = 1 F ( X ) ; • F pres erves c o mposition : fo r any pair of morphisms f : X → Y , g : Y → Z in C , F ( g f ) = F ( g ) F ( f ) . In the sections to come, we will see that fun ctors and natural transfor mations are useful for putting extra structure on cate gories. Her e is a rather di ff erent use for functors: we can think of a functor F : C → D as gi ving a p icture, o r ‘repr esentation’, of C in D . The idea is that F can map ob jects and mor phisms of some ‘ab stract’ category C to objects and mor phisms of a more ‘concrete’ category D . For example, consider an abstract gro up G . This is the same as a category with one object and with a ll morph isms invertible. The object is uninteresting , so we can ju st ca ll it • , but th e morph isms are the elements of G , a nd we comp ose them by multiply ing them. From this perspective, a repr esentatio n o f G on a finite- dimensiona l Hilbert space is the sam e as a fu nctor F : G → Hilb. Similarly , an action o f G on a set is the same as a functor F : G → Set. Both no tions are ways of making an abstract group more concrete. Ever sin ce Lawvere’ s 1963 thesis on fun ctorial sem antics [69], the id ea of functo rs as rep resentations has become pervasi ve. Howe ver, the termin ology v aries from field to field. Following Lawv ere, logicians often call the category C a ‘ theory ’, and call the fun ctor F : C → D a ‘ model’ of th is theo ry . Other mathem aticians might call F a n ‘algebra’ of the theory . In this work, the default choice of D is usually the category Set. In phy sics, it is th e fu nctor F : C → D th at is called the ‘th eory’. Here the d efault ch oice of D is either th e category we are calling Hilb or a similar c ategory of infinite- dimensiona l Hilb ert spaces. For example, both ‘confo rmal field theor ies’ [85] and topological quantum field theories [8] can be seen as functors of this sort. If we think of functor s as models, natur al transformatio ns are maps between models: Definition 4 Give n two functors F , F ′ : C → D , a natural t ransformation α : F ⇒ F ′ assigns to every object X in C a morphism α X : F ( X ) → F ′ ( X ) such that for any mo rphism f : X → Y in C , th e equ ation α Y F ( f ) = F ′ ( f ) α X 10 holds in D . In other wor ds, this squar e commutes: F ( X ) F ( Y ) F ′ ( X ) F ′ ( Y ) ✲ F ( f ) ❄ α X ❄ α Y ✲ F ′ ( f ) (Going acr oss an d then down equals going down and then acr oss.) Definition 5 A nat ural isomorphism between functors F , F ′ : C → D is a na tural transformation α : F ⇒ F ′ such tha t α X is an isomorphism for every X ∈ C . For example, supp ose F , F ′ : G → Hilb are functo rs wh ere G is a gr oup, thou ght o f as a category with o ne object, say • . Then, as a lready mentioned , F and F ′ are secretly ju st representatio ns of G on th e Hilbert spaces F ( • ) an d F ′ ( • ). A natu ral transform ation α : F ⇒ F ′ is then the same as an intertwining operat o r from one representatio n to anoth er: that is, a linear oper ator A : F ( • ) → F ′ ( • ) satisfying A F ( g ) = F ′ ( g ) A for all group elements g . 2.3 Monoidal Categories In physics, it is often useful to think of two systems s itting side by side as forming a single system. In to pology , the disjoint union of two manif olds is ag ain a m anifold in its own r ight. In logic, th e con junction of two statement is again a statemen t. In progra mming we can combin e two data types into a single ‘pr oduct type’. The conce pt of ‘mono idal category ’ unifies all these examples in a single framew ork. A mo noidal catego ry C has a fun ctor ⊗ : C × C → C that takes two o bjects X and Y and p uts them together to giv e a new object X ⊗ Y . T o make this precise, we need the cartesian produ ct of cate gor ies: Definition 6 Th e cartesian product C × C ′ of cate gories C an d C ′ is the cate gory wh e r e: • a n object is a p air ( X , X ′ ) consisting of an object X ∈ C and an object X ′ ∈ C ′ ; • a morphism fr om ( X , X ′ ) to ( Y , Y ′ ) is a pair ( f , f ′ ) consisting of a mo rphism f : X → Y and a morphism f ′ : X ′ → Y ′ ; • co mposition is done componentwise: ( g , g ′ )( f , f ′ ) = ( g f , g ′ f ′ ) ; • id entity morphisms ar e d efined compon e n twise: 1 ( X , X ′ ) = (1 X , 1 X ′ ) . 11 Mac Lane [7 1] defined mono idal categories in 196 3. The su btlety of th e definition lies in the fact th at ( X ⊗ Y ) ⊗ Z and X ⊗ ( Y ⊗ Z ) are not usually e qual. In stead, we sh ould spec ify a n isom orphism b etween them , called the ‘associator ’. Similarly , while a monoidal category has a ‘unit object’ I , it is not usually true that I ⊗ X and X ⊗ I equal X . Instead, we sho uld specif y isomor phisms I ⊗ X  X and X ⊗ I  X . T o be m anageab le, all these isomorphisms must then satisfy certain equations: Definition 7 A monoidal categ ory co nsists of: • a category C , • a tensor product functor ⊗ : C × C → C , • a unit object I ∈ C , • a n atural isomorph ism ca lled the associa tor , assigning to each triple of o bjects X , Y , Z ∈ C an isomor- phism a X , Y , Z : ( X ⊗ Y ) ⊗ Z ∼ → X ⊗ ( Y ⊗ Z ) , • n atural isomo rphisms called the le f t and right unito rs , assigning to each object X ∈ C isomorph isms l X : I ⊗ X ∼ → X r X : X ⊗ I ∼ → X , such tha t: • fo r all X , Y ∈ C the triang le equation ho lds: ( X ⊗ I ) ⊗ Y X ⊗ ( I ⊗ Y ) X ⊗ Y ✲ a X , I , Y ◗ ◗ ◗ ◗ s r X ⊗ 1 Y ✑ ✑ ✑ ✑ ✰ 1 X ⊗ l Y 12 • fo r all W , X , Y , Z ∈ C , the pentagon equat ion holds: (( W ⊗ X ) ⊗ Y ) ⊗ Z ( W ⊗ ( X ⊗ Y )) ⊗ Z ( W ⊗ X ) ⊗ ( Y ⊗ Z ) W ⊗ (( X ⊗ Y ) ⊗ Z ) W ⊗ ( X ⊗ ( Y ⊗ Z ))         ✠ a W ⊗ X , Y , Z ❍ ❍ ❍ ❍ ❍ ❍ ❍ ❥ a W , X , Y ⊗ 1 Z ❄ a W , X ⊗ Y , Z ❅ ❅ ❅ ❅ ❅ ❅ ❅ ❅ ❘ a W , X , Y ⊗ Z ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✙ 1 W ⊗ a X , Y , Z When we have a tensor p roduct of fou r objects, there ar e fiv e ways to pa renthesize it, a nd at first g lance the associator lets us build two isomorp hisms fr om W ⊗ ( X ⊗ ( Y ⊗ Z ) ) to (( W ⊗ X ) ⊗ Y ) ⊗ Z . But, the pentagon equation says th ese isomorp hisms are equ al. When we ha ve tenso r produ cts of even m ore objects there are even more ways to parenth esize them , and even mor e isomorphisms between them built fr om the associator . However , Mac Lane sh owed that the p entagon identity im plies these isom orph isms are all the sam e. Similarly , if we also assume the triang le e quation, all isom orph isms with the same source and target built fro m the associator, left and right unit laws are eq ual. In a mono idal category we can do p rocesses in ‘pa rallel’ as well as in ‘series’. Doing p rocesses in series is just co mposition o f morph isms, which works in any category . But in a mono idal category we can also tensor morph isms f : X → Y and f ′ : X ′ → Y ′ and obtain a ‘parallel process’ f ⊗ f ′ : X ⊗ X ′ → Y ⊗ Y ′ . W e can draw this in various ways: f X Y f ′ X ′ Y ′ = f ⊗ f ′ X Y X ′ Y ′ = f ⊗ f ′ X ⊗ X ′ Y ⊗ Y ′ More genera lly , we can dr aw any morph ism f : X 1 ⊗ · · · ⊗ X n → Y 1 ⊗ · · · ⊗ Y m 13 as a black box with n input wires and m output wires: f X 1 X 2 X 3 Y 1 Y 2 W e draw the unit object I as a blank space. So, for example, we draw a morphism f : I → X as follows: f X By composing and tensoring morphisms, we can build up elabor ate pictures resembling Feynman diagra ms: f g h j X 1 X 2 X 3 X 4 Y 1 Y 2 Y 3 Y 4 Z The laws governin g a monoid al category allow us to ne glect associators and unitors when drawing such pictures, without getting in trouble. The reason is that Mac Lane’ s Cohe rence Theorem say s any mon oidal category is ‘equiv alent’, in a suitable sense, to one where all associators and unitors are identity morphisms [71]. W e can also defor m the picture in a wid e variety of ways witho ut ch anging the m orphism it de scribes. For example, the abov e morphism equals this one: f g h j X 1 X 2 X 3 X 4 Y 1 Y 2 Y 3 Y 4 Z 14 Everyone who uses string diagrams for calculation s in monoidal cate gor ies starts by worrying about the rules of the game: pr ecisely ho w can we defo rm these p ictures withou t chang ing the mor phisms they describe? In stead of stating the r ules precisely — which gets a bit technical — we u rge yo u to explore for yourself what is allowed and what is not. For example, show that we can slide black boxes up and down like this: f g X 1 Y 1 X 2 Y 2 = f g X 1 Y 1 X 2 Y 2 = f g X 1 Y 1 X 2 Y 2 For a fo rmal tre atment of the rules governin g string diagram s, try the original pap ers by Joyal and Street [55] and the book by Y etter [101]. Now let us turn to examp les. Here it is cr ucial to re alize tha t the sam e categor y can often be equip ped with di ff erent tensor products, resulting in di ff erent monoid al categories: • There is a way to make Set into a mo noidal category where X ⊗ Y is the cartesian product X × Y and the un it ob ject is any o ne-elemen t set. Note that th is tensor p roduct is not strictly associative, since ( x , ( y , z )) , (( x , y ) , z ) , but th ere’ s a natural iso morph ism ( X × Y ) × Z  X × ( Y × Z ) , and this is our associator . Similar consideration s give the left an d right u nitors. I n this mono idal category , the tensor produ ct of f : X → Y and f ′ : X ′ → Y ′ is the function f × f ′ : X × X ′ → Y × Y ′ ( x , x ′ ) 7→ ( f ( x ) , f ′ ( x ′ )) . There is also a way to make Set into a mo noidal c ategory whe re X ⊗ Y is the disjoint union o f X and Y , which we sha ll denote by X + Y . Her e the un it object is the emp ty set. Ag ain, as indeed with all these examples, the a ssociativ e law an d left / rig ht u nit laws h old only up to natur al isomo rphism. In this monoid al cate gor y , the te nsor product of f : X → Y and f ′ : X ′ → Y ′ is the function f + f ′ : X + X ′ → Y + Y ′ x 7→ ( f ( x ) i f x ∈ X , f ′ ( x ) if x ∈ X ′ . However , in what follows, when we speak o f Set as a monoidal cate gory , we alway s use th e cartesian pr oduct! • There is a way to make Hilb in to a mo noidal category with the usual tensor produc t of Hilb ert spaces: C n ⊗ C m  C nm . In this case the unit object I can be tak en to be a 1-dimen sional Hilber t space, for examp le C . There is also a way to make Hilb into a m onoid al category where th e tensor product is the d irect sum: C n ⊕ C m  C n + m . In this case the unit object is the zero-dime nsional Hilbert space, { 0 } . However , in what follo ws, when we spea k o f Hilb as a monoidal ca te gory , we always use th e usua l tensor pr oduct! 15 • The tensor p rodu ct of ob jects and morph isms i n n Cob is given by disjoint unio n. For example, the tensor produ ct of these two morph isms: X Y f   X ′ Y ′ f ′   is this: X ⊗ X ′ Y ⊗ Y ′ f ⊗ f ′   • The categor y T ang k is mon oidal when k ≥ 1, where the th e tensor pro duct is given by d isjoint union. For example, gi ven these tw o tangles: X Y f   X ′ Y ′ f ′   their tensor prod uct look s like t his: X ⊗ X ′ Y ⊗ Y ′ f ⊗ f ′   The example of Set with its car tesian p roduc t is d i ff erent from our other three ma in examples, b ecause the cartesian product of sets X × X ′ comes equipp ed with func tions called ‘projections’ to the sets X a nd X ′ : X X × X ′ X ′ ✛ p ✲ p ′ 16 Our othe r main examp les lack this featu re — th ough Hilb m ade into a mono idal category using ⊕ has projectio ns. Also, e very set has a unique function to the one-eleme nt set: ! X : X → I . Again, our other main examples lack this f eature, though Hilb made into a m onoida l cate gory using ⊕ has it. A fascinating featur e of quantu m mecha nics is th at we make Hilb into a mono idal category using ⊗ instead o f ⊕ , ev en though the latter approach would lead to a cate gor y more lik e Set. W e can isola te the special f eatures of the c artesian produ ct of sets and its pr ojections, obtaining a d efinition that applies to any category: Definition 8 Give n ob jects X and X ′ in some cate gory , we say an object X × X ′ equippe d with morphisms X X × X ′ X ′ ✛ p ✲ p ′ is a cartesian product (or simply product ) of X and X ′ if for any object Q and morphisms Q X X ′   ✠ f ❅ ❅ ❘ f ′ ther e e xists a uniqu e morphism g : Q → X × X ′ making the following diagram commute: Q X X × X ′ X ′     ✠ f ❅ ❅ ❅ ❅ ❘ f ′ ❄ g ✛ p ✲ p ′ (That is, f = pg and f ′ = p ′ g.) W e say a ca te gory has binary products if every pair o f objects has a pr odu ct. The pro duct may n ot exist, and it may not be uniq ue, but when it exists it is uniq ue up to a cano nical iso- morph ism. This justifies o ur speaking of ‘the’ produ ct of o bjects X and Y when it exists, and den oting it as X × Y . The definition of cartesian product, while absolutely fundamen tal, is a bit scary at fi rst sight. T o illustrate its power , let us do something with it: combin e tw o mo rphisms f : X → Y and f ′ : X ′ → Y ′ into a single morp hism f × f ′ : X × X ′ → Y × Y ′ . The definition of cartesian produ ct says ho w to build a morp hism o f this sort out of a pair of mor phisms: n amely , morph isms from X × X ′ to Y an d Y ′ . If we take these to be f p and f ′ p ′ , we obtain f × f ′ : X × X ′ Y Y × Y ′ Y ′     ✠ f p ❅ ❅ ❅ ❅ ❘ f ′ p ′ ❄ f × f ′ ✛ p ✲ p ′ Next, let us isolate the special features of the one-element set: 17 Definition 9 A n objec t 1 in a category C is t erminal if for an y object Q ∈ C ther e exists a u nique mo rphism fr om Q to 1 , which we d enote as ! Q : Q → 1 . Again, a terminal object may n ot exist a nd m ay n ot b e unique , but it is unique u p to a ca nonical isomorp hism. This is why we can speak of ‘the’ terminal object of a category , a nd denote it by a specific symbol, 1. W e have introduced the conce pt of binary produ cts. One can also talk about n -ar y produ cts for other v alues of n , b ut a category with binary produc ts has n -ary pr oducts for all n ≥ 1, s ince we can construct these as iterated binary prod ucts. Th e case n = 1 is tri vial, since the product of one objec t is just that object it self (up to canonical isomorph ism). The rem aining case is n = 0 . The zer o-ary produ ct of ob jects, if it exists, is just th e te rminal object. So, we make the following definition: Definition 10 A cate gory has finite products if it h as binary pr oducts and a termina l object. A category with fin ite prod ucts can alw ays be made into a monoidal category by choo sing a specific p roduct X × Y to be the tensor prod uct X ⊗ Y , and choosing a specific terminal object to be the unit object. It takes a bit of work to sho w this! A monoidal category of this form is called cartesian . In a cartesian catego ry , we can ‘duplicate and d elete informatio n’. I n g eneral, the definition of cartesian produ cts gives a way to take two m orphisms f 1 : Q → X and f 2 : Q → Y and c ombine th em in to a single morph ism from Q to X × Y . If we take Q = X = Y and take f 1 and f 2 to be the iden tity , we obtain the dia g onal or duplication morphism: ∆ X : X → X × X . In th e category Set o ne can check that this m aps any elem ent x ∈ X to the p air ( x , x ). In gener al, we can draw the diagonal as follows: ∆ X X X Similarly , we call the uniqu e map to the terminal object ! X : X → 1 the deletion morphism, and draw it as follows: ! X Note that we draw the unit object as an empty s pace. 18 A fu ndamen tal fact about cartesian ca tegories is that duplicating somethin g and then deleting either c opy is the same as doing nothing at all! In string diagrams, this says: ! ∆ X X X = X = ! ∆ X X X W e leave the proo f as an e xercise for the reader . Many of the puzzling featur es of quantum theory come from the noncartesiann ess of the u sual tensor product in Hilb. For e xamp le, in a cartesian category , e very morphism g X X ′ is actually of the form f X f ′ X ′ In the case o f Set, this say s that every point of the set X × X ′ comes fro m a point o f X an d a point of X ′ . In physics, this would say that ev ery state g of the combined sy stem X ⊗ X ′ is built by combin ing states of the systems X and X ′ . Bell’ s theorem [19] says that is not tru e in quantum theor y . The reason is that quan tum th eory uses the noncar tesian mon oidal cate gory Hilb! Also, in quantum theory we cann ot free ly dup licate or delete information. W ootters and Zurek [100] proved a p recise theorem to this e ff ect, focused on duplicatio n: the ‘no-c loning the orem’. One can also p rove a ‘no- deletion theorem’. A gain, these results rely on the noncartesian tensor produ ct in Hilb. 2.4 Braided Monoidal Categories In physics, there is often a process that lets us ‘switch’ two systems by moving them around each other . In topolog y , ther e is a tangle that describes the process of switching two points: 19 In lo gic, we can switch the or der of two statemen ts in a co njunctio n: the statement ‘ X and Y ’ is iso morph ic to ‘ Y an d X ’. In com putation, there is a simple pro gram that switches the order of two piec es of data. A mon oidal category in which we can do this sort of thing is called ‘braided’: Definition 11 A braided monoidal ca t egory consists of: • a mon oidal cate gory C , • a na tural isomorph ism called the bra iding that assigns to every pair of objects X , Y ∈ C an isomorphism b X , Y : X ⊗ Y → Y ⊗ X , such tha t the hexago n equatio ns hold: X ⊗ ( Y ⊗ Z ) ( X ⊗ Y ) ⊗ Z ( Y ⊗ X ) ⊗ Z ( Y ⊗ Z ) ⊗ X Y ⊗ ( Z ⊗ X ) Y ⊗ ( X ⊗ Z ) ( X ⊗ Y ) ⊗ Z X ⊗ ( Y ⊗ Z ) X ⊗ ( Z ⊗ Y ) Z ⊗ ( X ⊗ Y ) ( Z ⊗ X ) ⊗ Y ( X ⊗ Z ) ⊗ Y ✲ a − 1 X , Y , Z ❄ b X , Y ⊗ Z ✲ b X , Y ⊗ 1 Z ❄ a Y , X , Z ✛ a − 1 Y , Z , X ✛ 1 Y ⊗ b X , Z ✲ a X , Y , Z ❄ b X ⊗ Y , Z ✲ 1 X ⊗ b Y , Z ❄ a − 1 X , Z , Y ✛ a Z , X , Y ✛ b X , Z ⊗ 1 Y The first hexagon equation says that switching the object X p ast Y ⊗ Z all at once is the s ame as switching it past Y and then past Z ( with some associators thrown in to move the parenthe ses). The second one is similar: it says switching X ⊗ Y past Z all at o nce is the same as doing it in two s teps. In string diagram s, we draw the braiding b X , Y : X ⊗ Y → Y ⊗ X like this: X Y 20 W e draw its in verse b − 1 X , Y like this: Y X This is a nice notation, because it makes the equations saying that b X , Y and b − 1 X , Y are inv erses ‘topologically tru e’: X X Y Y = X Y = Y Y X X Here are the hexagon equations as string diagrams: X X Y ⊗ Z Y ⊗ Z = X Y Z Y X Z X ⊗ Y X ⊗ Y Z Z = Y Z X Y X Z 21 For practice, we urge you to prove the follo wing equations: f g X X ′ Y Y ′ = g f X X ′ Y Y ′ Z X Y X Y Z = Y Z X X Y Z If you get stuck , here are some hints. The first equation fo llows from the natu rality of the braid ing. The second is called the Y a ng–Baxte r equation and follows from a combina tion of naturality and th e hexagon equation s [56]. Next, here are some examples. T here can be many di ff erent ways to gi ve a mo noidal category a braiding, or none. Howe ver , most of our fa vorite examples come with well-known ‘ standard’ braidin gs: • Any cartesian category auto matically becom es braided , and in Set with its cartesian pro duct, this standard braiding is given by: b X , Y : X × Y → Y × X ( x , y ) 7→ ( y , x ) . • In Hilb with its usual tensor pro duct, the standard braiding is gi ven by: b X , Y : X ⊗ Y → Y ⊗ X x ⊗ y 7→ y ⊗ x . • The mo noidal category n Cob has a standard braid ing where b X , Y is di ff eo morph ic to the disjoint u nion of 22 cylinders X × [0 , 1] and Y × [0 , 1] . For 2Cob this braiding looks as follo ws when X and Y are circles: X ⊗ Y Y ⊗ X b X , Y   • The monoid al category T an g k has a stand ard br aiding wh en k ≥ 2. For k = 2 th is lo oks as follows when X and Y are each a single point: X ⊗ Y Y ⊗ X b X , Y   The example of T ang k illustrates an imp ortant pattern. T ang 0 is just a c ategory , because in 0 -dimension al space we can only do processes in ‘series’: that is, co mpose morphisms. T ang 1 is a mono idal category , becau se in 1 -dimensio nal space we can also do p rocesses in ‘parallel’ : that is, tensor mo rphisms. T an g 2 is a braided monoid al category , because in 2-d imensional space there is r oom to move one object aroun d another . Next we shall see what happens when space has 3 or more dimensions! 2.5 Symmetric Monoidal Categories Sometimes switching two objects and switching them ag ain is the same as d oing nothing at all. Indeed, this situation is very familiar . So, the first braided monoid al categories to be d iscovered were ‘symmetric’ ones [71]: Definition 12 A symmetr ic mono idal ca tegory is a braided mon oidal c a te gory whe re the braiding satisfies b X , Y = b − 1 Y , X . So, in a symmetric mono idal cate gory , X Y Y X = X Y 23 or equiv alently: X Y = Y X Any cartesian category auto matically b ecomes a symmetric monoid al category , so Set is symmetr ic. It is also easy to check that Hilb, n Cob are symmetric monoid al categories. So is T ang k for k ≥ 3. Interestingly , T ang k ‘stabilizes’ at k = 3 : incre asing the value of k beyond this value merely gi ves a category equiv alent to T ang 3 . Th e reason is that we can already untie all knots in 4-d imensiona l space; addin g extra dimensions has no real e ff ect. In fact, T ang k for k ≥ 3 is eq uiv alent to 1Cob. T his is part of a conjec tured larger pattern called the ‘Periodic T able’ of n -categories [13]. A p iece of this is sho wn in T able 3. An n -category has not only morphisms goin g between objects, but 2-morphisms going between morphisms, 3-mor phisms g oing between 2-morp hisms an d so on up to n -morphisms. In topology we can use n -categories to describe tangled higher-dimensional surfaces [14], and in physics we can use them to describe not just particles but also strings and higher -dim ensional membrane s [13, 15]. The Rosetta Stone w e are describing concern s only the n = 1 c olumn o f the Period ic T ab le. So, it is p robab ly just a fragm ent of a larger, still buried n -categorical Rosetta Stone. n = 0 n = 1 n = 2 k = 0 sets categories 2-categories k = 1 monoid s monoid al monoid al categories 2-categories k = 2 commutative braided braided monoid s monoid al monoid al categories 2-categories k = 3 ‘’ symmetric sylleptic monoid al monoid al categories 2-categories k = 4 ‘’ ‘’ symme tric monoid al 2-categories k = 5 ‘’ ‘’ ‘’ k = 6 ‘’ ‘’ ‘’ T able 3: Th e Periodic T able: con jectured descriptions of ( n + k )-categories with only one j -m orphism for j < k . 24 2.6 Clos ed Categories In quantum me chanics, one can encode a linear operato r f : X → Y into a quantum state using a technique called ‘gate teleportatio n’ [47]. In topology , ther e is a way to take any tangle f : X → Y an d bend the input back around to make it part of the outp ut. In logic, we ca n take a proof that goes from some assumptio n X to some co nclusion Y and tur n it into a proof that goes from n o assum ptions to the conclusion ‘ X implies Y ’. In compu ter science, we can take any pr ogram that takes inpu t of type X an d pro duces outpu t of ty pe Y , and think of it as a piece of data of a new type: a ‘fu nction type’. The und erlying concept that unifies all these examp les is the concept of a ‘closed category’. Giv en obje cts X and Y in any ca tegory C , ther e is a set of morph isms fro m X to Y , de noted hom( X , Y ). I n a c losed c ategory there is also an object o f m orph isms from X to Y , wh ich we d enote by X ⊸ Y . (Many o ther notations are also used.) In this situation we speak o f an ‘internal ho m’, since th e object X ⊸ Y liv es in side C , instead of ‘outside’, in the category of sets . Closed categories were intro duced in 1966, by Eilen berg and Kelly [3 9]. While these authors were able to define a closed structure for any category , it turn s out that the in ternal hom is most easily under stood fo r monoid al categories. Th e re ason is that wh en our category has a tensor product, it is closed precisely when morph isms from X ⊗ Y to Z are in natu ral one-to- one correspo ndence with morp hisms fro m Y to X ⊸ Z . In other words, it is closed when we ha ve a natural isomorphism hom( X ⊗ Y , Z )  h om( Y , X ⊸ Z ) f 7→ ˜ f For example, in the category Set, if we take X ⊗ Y to b e the cartesian produ ct X × Y , then X ⊸ Z is just th e set of function s from X to Z , and we hav e a one-to-o ne corr esponde nce b etween • functio ns f that eat elements of X × Y and spit out elements of Z and • functio ns ˜ f th at eat elements of Y and spit o ut function s from X to Z . This correspon dence goes as follows: ˜ f ( x )( y ) = f ( x , y ) . Before consider ing othe r examples, we should m ake th e definition of ‘closed mon oidal category ’ comp letely precise. For this we must no te that for any cate gory C , there is a functor hom: C op × C → Set . Definition 13 The opposite catego r y C op of a category C ha s the same objects as C , but a morp hism f : x → y in C op is a morphism f : y → x in C , and th e c omposite g f in C op is the composite f g in C . Definition 14 F or an y category C , th e hom functor hom: C op × C → Set 25 sends a ny object ( X , Y ) ∈ C op × C to the set hom( X , Y ) , and sends any morph ism ( f , g ) ∈ C op × C to the function hom( f , g ): hom( X , Y ) → hom( X ′ , Y ′ ) h 7→ gh f when f : X ′ → X and g : Y → Y ′ ar e morphisms in C . Definition 15 A monoidal ca te gory C is left closed if ther e is an internal hom functor ⊸ : C op × C → C together with a natu ral isomorphism c called currying th at assigns to any o bjects X , Y , Z ∈ C a bijectio n c X , Y , Z : hom( X ⊗ Y , Z ) ∼ → hom( X , Y ⊸ Z ) It is right clo sed if ther e is a n internal hom functor as ab ove and a na tural isomorph ism c X , Y , Z : hom( X ⊗ Y , Z ) ∼ → hom( Y , X ⊸ Z ) . The term ‘cu rrying ’ is ma inly used in comp uter science, after the work o f Curry [35]. In the rest o f this section we o nly consider right closed mon oidal categories. Lu ckily , there is no real di ff e rence b etween left and right closed for a braided monoidal category , as the braiding gi ves an isomorphism X ⊗ Y  Y ⊗ X . All our examples of mon oidal categories are closed, but we s hall see that, yet again, Set is di ff erent from the rest: • The car tesian categor y Set is c losed, wh ere X ⊸ Y is just the set of fu nctions from X to Y . I n Set or any other car tesian closed ca tegory , the internal hom X ⊸ Y is usually den oted Y X . T o m inimize the n umber of di ff eren t notation s and emph asize an alogies betwee n d i ff erent contexts, we sha ll n ot d o this: we shall always use X ⊸ Y . T o treat Set as left closed, we define the curried version of f : X × Y → Z as above: ˜ f ( x )( y ) = f ( x , y ) . T o treat it as right closed, we instead define it by ˜ f ( y )( x ) = f ( x , y ) . This looks a bit awkward, b ut it will be nice for string diagrams. • The symmetr ic mon oidal category Hilb with its u sual tensor p roduct is clo sed, wher e X ⊸ Y is the set of linear op erators from X to Y , made into a Hilbert sp ace in a standard way . I n this case we have an isomorph ism X ⊸ Y  X ∗ ⊗ Y where X ∗ is th e d ual of the Hilber t space X , that is, the set of linear o perators f : X → C , made into a Hilbert space in the usual way . • The mono idal cate gory T ang k ( k ≥ 1) is closed . A s with Hilb, we have X ⊸ Y  X ∗ ⊗ Y where X ∗ is the orienta tion-reversed version of X . 26 • The symmetric mono idal category n Cob is also closed; again X ⊸ Y  X ∗ ⊗ Y where X ∗ is the ( n − 1)-manifold X with its o rientation re versed. Except for Set, all these examples are actually ‘compact’ . Th is basically means that X ⊸ Y is isomorp hic to X ∗ ⊗ Y , wh ere X ∗ is some object called the ‘dual’ of X . But to make this precise, we need to define the ‘dual’ of an object in an arbitrary monoidal category . T o do this, let us gen eralize f rom the case of Hilb. As alr eady mentione d, each o bject X ∈ Hilb has a d ual X ∗ consisting of all linear operator s f : X → I , where the unit object I is just C . There is thus a linear ope rator e X : X ⊗ X ∗ → I x ⊗ f 7→ f ( x ) called the co unit of X . Furthermo re, the space of all linear o perators fro m X to Y ∈ Hilb ca n be ide ntified with X ∗ ⊗ Y . So, th ere is also a linear operator called the unit of X : i X : I → X ∗ ⊗ X c 7→ c 1 X sending any complex number c to the correspon ding multiple of the identity ope rator . The significance of th e unit and counit becom e clearer if we borrow some ideas from Feynman. In phy sics, if X is the Hilber t space o f in ternal states o f som e particle, X ∗ is the Hilbert spac e for th e cor respond ing antiparticle. Feynman r ealized th at it is enlighten ing to th ink o f an tiparticles as particles goin g backwards in time. So, we draw a wire lab elled by X ∗ as a wire labelled b y X , but with an arr ow pointing ‘ba ckwards in time’ : that is, up instead of down: X ∗ = X (Here we should admit that most physicists use th e opposite convention, where time marches up the page. Since we read from top to bottom, we prefer to let time run down the page .) If we draw X ∗ as X going backwards in time, we can draw the unit as a cap : X X and the counit as a cup : X X In Feynman diagrams, these describe the cr eation and a nnihilatio n of virtual particle-antiparticle pairs! 27 It then turns out that the unit and counit satisfy two equations, the zig-zag equations : X X = X X X = X V er ifying th ese is a fu n exercise in lin ear a lgebra, which we leave to the read er . If we write th ese e quations as commutative diagrams, we need to include some associators and unitors, and they become a bit intimidating: X ⊗ I X ⊗ ( X ∗ ⊗ X ) ( X ⊗ X ∗ ) ⊗ X X I ⊗ X I ⊗ X ∗ ( X ∗ ⊗ X ) ⊗ X ∗ X ∗ ⊗ ( X ⊗ X ∗ ) X ∗ X ∗ ⊗ I ✲ 1 X ⊗ i X ❄ r X ✲ a − 1 X , X ∗ , X ❄ e X ⊗ 1 X ✛ l X ✲ i X ⊗ 1 X ❄ l X ✲ a X ∗ , X , X ∗ ❄ 1 X ∗ ⊗ e X ✛ r X ∗ But, they really just say that zig-zags in string diagrams can be straightened out. This is particular ly vi vid in examples like T ang k and n Cob. F or example, in 2Cob, taking X to be the circle, the unit looks like this: I X ∗ ⊗ X i X   28 while the counit looks like this: X ⊗ X ∗ I e X   In this case, the zig-zag identities say we can straighten a wiggly piece of pipe. Now we are read y for some definitions: Definition 16 Given objects X ∗ and X in a monoid al cate gory , we ca ll X ∗ a right dual o f X , and X a le f t dual of X ∗ , if ther e ar e morphisms i X : I → X ∗ ⊗ X and e X : X ⊗ X ∗ → I , called the unit a nd counit r espectively , satisfying the zig-zag equations. One can show tha t the left o r righ t dual o f a n o bject is unique u p to canonical isomor phism. So, we usu ally speak of ‘the’ right or left dual of an object, when it exists. Definition 17 A monoidal ca te gory C is compact if every objec t X ∈ C has both a left dual and a righ t dual. Often th e term ‘au tonomo us’ is used instead o f ‘compac t’ he re. Many authors reserve the term ‘comp act’ f or the case where C is symmetric or at least braid ed; then left duals are the same as right duals, and things s implify [42]. T o add to the confu sion, compact symmetric monoidal categories are often called simply ‘co mpact closed categories’. A partial explanation fo r the last piece of term inology is that any co mpact mono idal category is au tomatically closed! For this, we define the intern al hom on objects by X ⊸ Y = X ∗ ⊗ Y . W e must then show that the ∗ oper ation e xtend s naturally to a fu nctor ∗ : C → C , so th at ⊸ is actually a functor . Finally , we must check that there is a natura l is omo rphism hom( X ⊗ Y , Z )  ho m( Y , X ∗ ⊗ Z ) In terms of string diagrams, this isomorphism takes any morph ism f X Y Z 29 and bends back the input wire labelled X to make it an output: f X Y Z Now , in a compac t monoidal category , we have: X Z = X ⊸ Z But in gener al, closed mono idal categories don ’t allow arrows poin ting up! So fo r these, drawing th e intern al hom is more of a challenge. W e can u se the same style of notation as long as we add a decora tion — a clasp — that binds two strings together: X Z : = X ⊸ Z Only when our closed monoidal category happens to be compact can we eliminate the clasp. Suppose we are working in a closed monoidal category . Since we draw a morphism f : X ⊗ Y → Z like this: f X Y Z we can draw its curried version ˜ f : Y → X ⊸ Z by bending do wn the input wire labelled X to make it part of the output: f X Y Z Note that where we bent back the wire labelled X , a cap like this appeared: X X 30 Closed monoidal categories don’t really have a cap unless they are compact. So , we drew a b ubble en closing f and the cap, to k eep us from doing any illegal manipulations. In the comp act case, both the bubble and the clasp are unnecessary , so we can draw ˜ f like this: f X Y Z An important special case of curry ing gi ves the name of a mo rphism f : X → Y , p f q : I → X ⊸ Y . This is obtained by curryin g the morp hism f r x : I ⊗ X → Y . In string diagrams, we draw p f q as fo llows: f X Y In the category Set , th e unit object is the one -element set, 1. So, a mo rphism from this o bject to a set Q picks out a point of Q . I n particular, the name p f q : 1 → X ⊸ Y picks out the element of X ⊸ Y corr espond ing to the function f : X → Y . More genera lly , in any cartesian closed category the unit object is the terminal object 1, and a m orphism from 1 to an o bject Q is called a point of Q . So, even in th is case, we can say the n ame of a morph ism f : X → Y is a point of X ⊸ Y . Something similar works for Hilb, thou gh this examp le is compact rather than cartesian. In Hilb, th e unit object I is just C . So, a nonzero morp hism from I to any Hilbert space Q pick s out a nonzero vector in Q , which we can normalize to obtain a state in Q : tha t is, a u nit vector . In particular, the na me of a non zero m orph ism f : X → Y gives a state of X ∗ ⊗ Y . This method of enco ding oper ators as states is t he basis of ‘gate teleporta tion’ [47]. Currying is a bijection, so we can also uncurry : c − 1 X , Y , Z : hom( Y , X ⊸ Z ) ∼ → hom( X ⊗ Y , Z ) g 7→ g e . Since we draw a morphism g : Y → X ⊸ Z like this: g X Y Z 31 we draw its ‘uncurried’ v ersion g e : X ⊗ Y → Z by ben ding the output X up to become an input: g X Y Z Again, we must put a bubble around the ‘cup’ formed when we bend do wn the wire labelled Y , unless we are in a compact monoidal category . A good example of uncurrying is the ev aluatio n morp hism: ev X , Y : X ⊗ ( X ⊸ Y ) → Y . This is obtained by uncurr ying the identity 1 X ⊸ Y : ( X ⊸ Y ) → ( X ⊸ Y ) . In Set, ev X , Y takes any func tion fr om X to Y and evaluates it at any element of X to give an element of Y . In terms of string diagrams, the ev aluation morphism looks lik e this: ev X X Y Y = X X Y Y In any closed mono idal category , we can recover a morph ism from its n ame using e valuation. More pr ecisely , this diagram commutes: X ⊗ I X X ⊗ ( X ⊸ Y ) Y ❄ 1 X ⊗ p f q ✛ r − 1 ❄ f ✲ ev X , Y 32 Or , in terms of string diagrams: f X X Y Y = f X Y W e leave the proo f of this as an exercise. In gen eral, one must use t he n aturality of currying. In th e special case of a compact monoidal category , th ere is a nice picture proof! Simply pop the bubbles and remove th e clasp: f X X Y Y = f X Y The result then follows from one of the zig-zag identities. In o ur rap id introd uction to string diag rams, we have not had tim e to illustrate h ow these diagr ams becom e a powerful tool for solving concrete prob lems. So, here are some starting po ints for further study: • Representation s of Lie group s play a fundam ental role in q uantum physics, especially gau ge field theory . Every Lie gro up has a comp act symm etric mono idal categor y o f finite-dim ensional re presentation s. I n his book Group Theory , Cvitanovic [36 ] de velops de tailed string diagram descrip tions of these representation categories for the classical Lie group s SU( n ), SO( n ), SU( n ) and also the more exotic ‘ exceptional’ Lie group s. His bo ok also illustrates how this techno logy can be u sed to simplif y di ffi cult calculations in gauge field theory . • Quantum group s are a gener alization of gro ups which show up in 2d and 3d phy sics. The big di ff erence is that a quantum g roup has compact braided mon oidal categor y of finite-d imensional r epresentatio ns. Kau ff man’ s Knots an d Physics [59] is an excellent intro duction to h ow quantum g roups show u p in knot theory an d ph ysics; it is packed with strin g diagrams. For mo re d etails on quan tum group s an d b raided monoid al cate gor ies, see the book by Kassel [58]. 33 • Kau ff man and Lins [ 60] h av e written a beau tiful strin g diagram treatm ent o f the category of re presen- tations o f the simplest qu antum gro up, S U q (2). They a lso use it to construct so me famous 3 -manifo ld in variants associated to 3d and 4d topological quantum field theories: the Wit ten– Reshetikhin–Turae v , T uraev–V ir o and Cran e–Y etter inv ariants. In this example, string diag rams ar e of ten called ‘ q -def ormed spin networks’ [91]. For generalization s to other quantum groups, see the mor e adv anced texts by T uraev [97] and by Bakalov and Kirillov [16]. The key ingr edient is a special class of compact braide d mon oidal categories called ‘modular tensor categories’. • K ock [64] has written a nice introdu ction to 2d top ological q uantum field theories which u ses d iagram- matic methods to work with 2Cob. • Abramsky , Coecke and collaborators [2, 3, 4, 30, 32, 33] h ave d eveloped string diagrams as a tool for understan ding quantum co mputation . Th e easiest introduction is Coecke’ s ‘ Kindergarten q uantum me - chanics’ [31]. 2.7 Dagger Categories Our discussion would b e sadly incomp lete witho ut an im portant admission: n othing we have don e so far with Hilbert spaces used th e inner pr oduct! So, we have not yet touched on the es sence o f quantum theory . Everything we have said ab out Hilb app lies equ ally we ll to V ect: the ca tegory of fin ite-dimension al vector spaces a nd linear operators. Bo th Hilb and V ect are comp act sym metric monoidal categories. In fact, these compact symmetric monoida l categories are ‘equiv alent’ in a certain precise sense [72]. So, wh at makes Hilb di ff er ent? In terms of ca tegory theory , the special thing is that we ca n take the Hilber t space adjoin t o f any linear ope rator f : X → Y between finite-d imensiona l Hilb ert spaces, getting an op erator f † : Y → X . This ability to ‘reverse’ morphisms makes Hilb into a ‘dagger category’: Definition 18 A dagge r ca tegory is a ca tegory C such that fo r any morph ism f : X → Y in C there is a specified morphism f † : Y → X such that ( g f ) † = f † g † for every p a ir of co mposable morphisms f an d g , and ( f † ) † = f for every mo rphism f . Equiv alently , a d agger category is on e equ ipped with a f unctor † : C → C op that is the identity o n ob jects a nd satisfies ( f † ) † = f f or ev ery morphism. In fact, all our fa vorite e xamples of categories can be made into dagger categories, except for Set: • There is no way to make Set into a dagger category , since there is a function from the empty set to the 1-element set, but none the other way arou nd. • The category Hilb becomes a dagger category as follows. Giv en any m orphism f : X → Y in Hilb, there is a morp hism f † : Y → X , the Hilbert space a djoint of f , defined by h f † ψ, φ i = h ψ, f φ i for all φ ∈ X , ψ ∈ Y . 34 • For any k , the catego ry T an g k becomes a da gger category wh ere we obta in f † : Y → X by reflecting f : X → Y in th e vertical dir ection, and then switchin g the directio n of th e little arrows den oting the orientation s of arcs and circles. • For any n , the category n Cob becomes a dagger categor y where we o btain f † : Y → X by switching th e input and output of f : X → Y , and then switching the orientation of each conn ected com ponen t of f . Again, a picture speaks a thousand words: X Y f   Y X f †   In application s t o phy sics, this dagger operation amounts to ‘switching the future and the past’. In all the dagge r categor ies above, th e dag ger structure interacts in a nice way with th e mon oidal structure and also, when it exists, the br aiding. One ca n write a list of axioms ch aracterizing how th is works [2, 3, 87]. So, it seems that th e ability to ‘re verse’ morph isms is another w ay in which categories of a quantum fl av or di ff er from the category of sets an d function s. This has im portant implicatio ns for the fou ndations of quantu m theory [11] and also f or topo logical quantum field theor y [13], wher e dagger categories seem to b e part o f larger story in volving ‘ n -categories with du als’ [14]. Howe ver , this stor y is still poor ly u nderstoo d — ther e is much mo re work to be done. 3 Logic 3.1 Backgroun d Symmetric m onoida l closed categories show up not on ly in p hysics a nd topo logy , b ut also in logic. W e would like to e xplain how . T o set the stage, it seems worthwh ile to sk etch a few ideas from 20th-century logic. Modern logicians stud y many systems of r easoning beside ordinary classical logic. Of course, ev en classical logic comes in various degrees of strength. First there is the ‘p ropo sitional calculu s’, which allows us to reason with abstract proposition s X , Y , Z , . . . and these logical conne ctiv es: and ∧ or ∨ implies ⇒ not ¬ true ⊤ false ⊥ Then ther e is the ‘ predicate calc ulus’, which also allo ws variables like x , y , z , . . . , pred icates like P ( x ) an d Q ( x , y , z ), and the symbols ‘for all’ ( ∀ ) and ‘there exists’ ( ∃ ), which a llow us to quantify over v ariables. There are also highe r-order system s t hat allo w us to quantify over predicates, and so on. T o keep things simple, we mainly 35 confine our selves to the prop ositional calculus in what follo ws. But even here , there are many alternati ves to the ‘classical’ version! The m ost-studied of these alter native systems are weaker than cla ssical log ic: th ey make it hard er or ev en impossible to prove thing s we normally take fo r granted. One reason is tha t some logicians deny that certain familiar principles are actually v alid. But there are also subtler reasons. One is that studyin g systems with rules of lesser streng th a llows fo r a fine-grain ed study of precisely which methods of reason ing a re needed to prove which results. Another reason — th e one that co ncerns us mo st here — is that d roppin g f amiliar ru les and then adding them back in one at at time sheds light on the connectio n between logic and category theory . For exam ple, a round 1907 Bro uwer [49] began ad vocating ‘intuition ism’. As pa rt of th is, he raised d oubts about th e law of excluded mid dle, which am ounts to a rule saying th at from ¬¬ X we can deduce X . One prob lem with this prin ciple is that proo fs using it a re not ‘co nstructive’. For examp le, we may p rove by contr adiction that some eq uation has a solution, but still have no clue how to constru ct the solutio n. For Brouwer , this me ant the principle was in valid. Anyone wh o feels the law of exclud ed midd le is inv alid is duty-bou nd to study intuition istic log ic. But, there is another reason for studying this system. Namely: we d o not really lose anything by dropping the la w of excluded middle! Instead , we g ain a fine-g rained distinction : the distinction betwe en a direct proo f of X and a proof by co ntradiction , which yields merely ¬¬ X . If we do n ot care abou t this distinction we are fre e to igno re it, b ut there is no harm in having it around. In the 1930’ s, this idea was made precise by G ¨ odel [45] and Gentzen [94]. T hey sho wed that we can embed classical logic in intuitionistic log ic. I n fact, they foun d a map sending any form ula X of the propo sitional calculus to a new formu la X ◦ , such that X is provable classically if and o nly if X ◦ is p rovable intuition istically . (More impressiv ely , this map also works for the predicate calculus.) Later , yet ano ther reason for being intere sted in intuitionistic logic becam e apparent: its conn ection to cate- gory theory . In its very simplest f orm, this con nection works as follows. Suppose we have a set of pro positions X , Y , Z , . . . obeying the laws of the in tuitionistic prop ositional calculus. W e can create a ca tegory C wh ere these propo sitions are objects and th ere is a t most one morphism from any object X to any object Y : a single morp hism when X implies Y , and none oth erwise! A category with at most one m orphism from any ob ject to any o ther is called a pr eorder . In the proposition al calculus, we often treat two p ropo sitions as equal when th ey both imply each other . If we do this, we get a special sor t of p reord er: one wh ere isomo rphic objects are au tomatically equ al. This sp ecial sort of p reorde r is called a part ially ordered set , or poset fo r short. Posets aboun d in logic, precisely becau se they o ff er a simple framework for understand ing implication . If we start from a set of propositions obeying the intuitionistic pro positional calculus, the resulting category C is better than a m ere poset. It is also ca rtesian, with X ∧ Y as th e produ ct of X an d Y , and ⊤ as the ter minal object! T o see th is, note tha t any proposition Q has a uniqu e morphism to X ∧ Y wh enever it has m orphisms to X an d to Y . This is simply a fancy way of sayin g that Q implies X ∧ Y when it implies X and implies Y . It is also easy to see that ⊤ is terminal: anythin g implies the truth. Even better , the category C is cartesian closed, with X ⇒ Y as th e internal hom. The reason is that X ∧ Y implies Z i ff Y imp lies X ⇒ Z . This automatically yields the basic property of the internal hom: hom( X ⊗ Y , Z )  ho m( Y , X ⊸ Z ) . 36 Indeed , if the reader is puzzled b y the di ff erence be tween ‘ X implies Y ’ and X ⇒ Y , we can now explain this more clearly: the former inv olves the homset hom( X , Y ) (which has one elemen t wh en X implies Y an d none otherwise), while the latter is the internal hom, an object in C . So, C is a cartesian closed poset. But, it also h as one more nice p roper ty , thanks to the pr esence of ∨ and ⊥ W e ha ve seen that ∧ and ⊤ make the category C cartesian; ∨ and ⊥ satisfy e xactly analogou s rules, but with the implications turned around , so they make C op cartesian. And that is all! In pa rticular, negation gi ves no thing more, since we can d efine ¬ X to be X ⇒ ⊥ , and all its in tuitionistically valid prop erties then fo llow . So, th e kin d o f category we get fr om the in tuitionistic propo sitional calculu s b y taking p ropo sitions as o bjects and imp lications a s mo rphisms is precisely a Heyting algebra : a cartesian closed poset C su ch that C op is also cartesian. Heyting, a student of Bro uwer, intro duced Heyting algebras in intuitionistic lo gic before categories were ev en inv ented. So, he used very d i ff erent langu age to d efine them. But, th e categor y-theor etic appr oach to Heyting algebr as illustrates the co nnection between car tesian clo sed ca tegories an d logic. It also gives mor e evidence that dro pping the la w of excluded middle is an interesting thing to try . Since we have explained the b asics of carte sian closed c ategories, but not said what happ ens when th e opposite of such a category is a lso cartesian , in the sectio ns to come we will take a drastic step and lim it our discussion of logic ev en further . W e will neglect ∨ and ⊥ , an d concentr ate only on the frag ment of the propo sitional calculus in volving ∧ , ⊤ an d ⇒ . Even here, it tu rns out, there are in teresting things to say — a nd inter esting ways to mod ify the usual r ules. This will be th e main su bject of the sections to come. But to set th e stage , we need to say a bit about pro of theory . Proof th eory is the bran ch of math ematical logic that treats p roofs as m athematical entities worth y of study in their own right. It lets us dig deeper into th e p ropo sitional calculus by studying n ot merely whether or n ot some assumptio n X implies some co nclusion Y , but the w hole set o f pr oofs leadin g from X to Y . This am ounts to studying not just posets (or preo rders), b ut cate gor ies t hat allow many morphisms fro m one object to another . In Hilbe rt’ s appr oach to pr oof, there were many axiom s a nd just o ne rule to deduce n ew theorem s: modus ponen s , which says that f rom X and ‘ X implies Y ’ we can deduce Y . Most of mod ern pr oof theory focuses on another app roach, the ‘ sequent calcu lus’, du e to Ge ntzen [94]. In this appro ach there are few axioms but many inference rules. An excellent introd uction to th e sequen t calcu lus is the b ook Pr oofs an d T ypes b y Girard, L afont and T ay - lor , freely av ailable o nline [44]. Here we shall content ourselves with so me sketchy r emarks. A ‘seq uent’ is something like this: X 1 , . . . , X m ⊢ Y 1 , . . . , Y n where X i and Y i are propo sitions. W e r ead this sequent as saying that all the propo sitions X i , taken toge ther , can be used to prove a t least one of the pro positions Y i . T his strange-soundin g convention giv es the seq uent calculus a nice symmetry , as we shall soon see. In the sequent calculus, an ‘infe rence rule’ is s ometh ing that produces new sequents from old. For e xamp le, here is the left weakening r ule: X 1 , . . . , X m ⊢ Y 1 , . . . , Y n X 1 , . . . , X m , A ⊢ Y 1 , . . . , Y n 37 This says that from th e sequ ent above the lin e we can ge t the sequen t below the line: we can throw in the extra assumption A without har m. Thanks to th e strange-soun ding conv ention we mentioned , th is rule has a mirror-image version called right weakening : X 1 , . . . , X m ⊢ Y 1 , . . . , Y n X 1 , . . . , X m ⊢ Y 1 , . . . , Y n , A In fact, Gentzen’ s whole setup has this mirror symmetry ! For example, his rule called l eft contra ction : X 1 , . . . , X m , A , A ⊢ Y 1 , . . . , Y n X 1 , . . . , X m , A ⊢ Y 1 , . . . , Y n has a mirror partner called right contraction : X 1 , . . . , X m ⊢ Y 1 , . . . , Y n , A , A X 1 , . . . , X m ⊢ Y 1 , . . . , Y n , A Similarly , this rule for ‘and’ X 1 , . . . , X m , A ⊢ Y 1 , . . . , Y n X 1 , . . . , X m , A ∧ B ⊢ Y 1 , . . . , Y n has a mirror partner for ‘or’: X 1 , . . . , X m ⊢ Y 1 , . . . , Y n , A X 1 , . . . , X m ⊢ Y 1 , . . . , Y n , A ∨ B Logicians now re alize that this mirr or sym metry can be un derstood in terms o f the duality between a category and its opposite. Gentzen used sequents t o write inferen ce rules for the classical propositional calculus, and also the classical predicate calculus. Now , in these form s of logic we ha ve X 1 , . . . , X m ⊢ Y 1 , . . . , Y n if and only if we hav e X 1 ∧ · · · ∧ X m ⊢ Y 1 ∨ · · · ∨ Y n . So, why d id Gentzen u se sequ ents with a list of propo sitions on each side of th e ⊢ symbo l, instead just a sing le propo sition? T he reason is that this let him u se only inference rules having the ‘subform ula p roper ty’. T his says that e very propo sition in the sequent above th e line appear s as part of some proposition in the sequent belo w the line. So, a p roof built from su ch in ference r ules becomes a ‘tree’ wh ere all the p ropo sitions furth er up the tree are subform ulas of those below . This idea ha s powerful co nsequen ces. For example, in 19 36 Gentzen was able prove the consistency of Peano’ s axioms of arithme tic! His proof essentially used induc tion on trees (Readers familiar with G ¨ odel’ s second in completen ess theorem should be reassure d that this sort o f induction can not itself b e car ried ou t in Peano arithmetic.) The most famous rule lac king the subfor mula property is the ‘cut rule ’: 38 X 1 , . . . , X m ⊢ Y 1 , . . . , Y k , A X m + 1 , . . . , X n , A ⊢ Y k + 1 , . . . , Y ℓ X 1 , . . . , X n ⊢ Y 1 , . . . , Y ℓ From the tw o s equ ents on top, the cut r ule gives us the sequent below . Note t hat the intermediate step A do es not appear i n the sequen t below . I t is ‘cut out’. So, the cut rule lac ks the subformu la pr operty . But, one of Gentzen’ s great achievements was to show that any pro of in the classical prop ositional ( or even predica te) calculus that can be done with the cut rule can also be done without it. This is called ‘c ut elimination’. Gentzen also wrote down inference ru les suitable for the intuitio nistic p ropo sitional and pred icate calcu li. These rules lack the mirro r symmetry of th e classical case. But in the 1 980s, th is symm etry was restored b y Girard’ s inv ention of ‘linear logic’ [43]. Linear logic lets us keep track o f how m any times we u se a given prem ise to reach a given conclu sion. T o accomplish this, Girar d introdu ced so me new logical co nnectives! For starters, he introdu ced ‘line ar’ conn ec- ti ves called ⊗ and ⊸ , and a logical co nstant called I . These act a bit like ∧ , ⇒ and ⊤ . Howe ver , they satisfy rules corr espondin g to a s ymm etric mon oidal category instead of a cartesian closed cate gory . I n particular , from X we can prove neither X ⊗ X no r I . So, we canno t freely ‘duplicate’ and ‘delete’ p roposition s using these ne w connectives. Th is is reflected in the fact that linear logic drops Gentzen’ s contrac tion and weakening rules. By itself, this mig ht seem u nbearab ly restricti ve. Howe ver , Gi rard also kept the conne ctiv es ∧ , ⇒ an d ⊤ in his system, still satisfying th e usual rules. And, he introdu ced an oper ation ca lled the ‘expon ential’, !, which takes a proposition X and turn s it into an ‘ arbitrary stock of copies of X ’. So, for example, from ! X we can prove 1, and X , and X ⊗ X , and X ⊗ X ⊗ X , and so on . Full-fledged linear logic has even more connectives tha n we have described here. It seem s baro que and peculiar at first glance. I t also comes i n both classical and intuitio nistic versions! But, just a s classical logic can be embedd ed in in tuitionistic logic, in tu itionistic logic can be embedde d in intu itionistic linear logic [4 3]. So, we do not lose any deductiv e po wer . Instead, we gain the ability to make e ven more fine-grained distinctions. In what follows, we discuss the fragm ent of intuitio nistic line ar logic in volving o nly ⊗ , ⊸ and I . This is called ‘multiplicative in tuititionistic linear logic’ [48, 82]. It turns out to be the system of logic suitable for closed symmetric monoid al categories — nothing more or less. 3.2 Proofs as Morphisms In Section 2 we described categories with various amounts of extra structur e, starting f rom categories pu re and simple, an d work ing ou r way u p to monoid al categories, braided mono idal categories, symm etric mon oidal categories, an d so o n. Our trea tment on ly scratch ed th e surface o f an enormo usly rich tax onom y . In fact, e ach kind of category with e xtra structure correspo nds to a system o f logic with its o wn infere nce rules! T o see this, we will think of pr opo sitions as objects in som e category , and pr oofs as giving morp hisms . Suppose X and Y are pro positions. Th en, we can think of a pro of starting from the as sumptio n X a nd leading to the conclusio n Y as giving a m orphism f : X → Y . (In Sec tion 3 .3 we shall see that a morphism is actually an equiv alence class of proofs — b ut for now let us gloss over this iss ue.) Let us write X ⊢ Y when, startin g f rom the assumption X , the re is a proo f lea ding to the conclu sion Y . An inference rule is a way to get new p roofs fr om o ld. For exam ple, in almost ev ery system o f logic , if there is a proof leading from X to Y , an d a proof leading from Y to Z , then there is a proof leading from X to Z . W e wr ite this inference rule as follows: 39 X ⊢ Y Y ⊢ Z X ⊢ Z W e ca n call this cut rule , since it lets u s ‘ cut o ut’ th e intermed iate step Y . It is a special case of Gentzen ’ s cut rule, m entioned in th e previous section. It sho uld r emind u s o f co mposition o f m orph isms in a categor y: if we have a morph ism f : X → Y and a morphism g : Y → Z , we get a morph ism g f : X → Z . Also, in almost e very system of logic there is a proof leading from X to X . W e can write this as an inferen ce rule that starts with nothing and concludes the existence of a pro of of X from X : X ⊢ X This r ule should r emind us of how every object in category has an identity morphism: for any ob ject X , we automatically get a morphism 1 X : X → X . In deed, this rule is sometimes called the identity rule . If we pur sue this line of though t, we can take the definition o f a closed symmetric monoid al category and extract a collection of infere nce rules. Ea ch rule is a w ay to get new morphisms from old in a closed symm etric monoid al category . T here are various su perficially di ff erent but ultim ately equiv alent ways to list th ese rules. Here is one: X ⊢ X (i) X ⊢ Y Y ⊢ Z X ⊢ Z ( ◦ ) W ⊢ X Y ⊢ Z W ⊗ Y ⊢ X ⊗ Z ( ⊗ ) W ⊢ ( X ⊗ Y ) ⊗ Z W ⊢ X ⊗ ( Y ⊗ Z ) (a) X ⊢ I ⊗ Y X ⊢ Y (l) X ⊢ Y ⊗ I X ⊢ Y (r) W ⊢ X ⊗ Y W ⊢ Y ⊗ X (b) X ⊗ Y ⊢ Z Y ⊢ X ⊸ Z (c) Double lines mean th at the in verse rule also holds. W e ha ve g iv en each rule a name, written to the r ight in paren- theses. As already explained , rules (i) and ( ◦ ) come from the presence of identity m orphisms and compo sition in any category . Ru les ( ⊗ ), (a), ( l), an d (r) come fr om tensoring , the associator, and the left an d righ t unitors in a monoidal category . Rule (b) comes from the braiding in a braided monoidal category , and rule (c) comes from curryin g in a closed mon oidal category . Now for the b ig question: what does all this mea n in terms of logic? Th ese ru les d escribe a sma ll fragment o f the propositional calculu s. T o see this, we should read the connective ⊗ as ‘and’, the connectiv e ⊸ as ‘implies’, and the proposition I as ‘tru e’. In this interpretation, rule (c) says we can turn a proof leading fro m the assumption ‘ Y and X ’ to the conclu- sion Z into a proof leading fro m X to ‘ Y implies Z ’ . I t also says we can d o the reverse. This is true in classical, intuitionistic and lin ear log ic, and so are all th e other rules. Rules (a) and (b) say that ‘a nd’ is associativ e and commutative. Rule (l) say s that any p roof leadin g from the assumption X to th e conclu sion ‘true an d Y ’ c an be conv erted to a proof leading from X to Y , a nd vice versa. Rule (r) is similar . What do we do with these rules? W e use them to build ‘deductions’. He re is an easy example: (i) X ⊸ Y ⊢ X ⊸ Y (c − 1 ) X ⊗ ( X ⊸ Y ) ⊢ Y 40 First we use the identity rule, and then the in verse of the cu rrying rule. At th e end, we obtain X ⊗ ( X ⊸ Y ) ⊢ Y . This should remind us of the ev aluation morphisms we ha ve in a closed monoidal cate gor y: ev X , Y : X ⊗ ( X ⊸ Y ) → Y . In terms of lo gic, the poin t is that we can pr ove Y from X and ‘ X imp lies Y ’. This fact comes in han dy so often that we may wish to abbreviate the above deduction as an extra in ference rule — a r ule d erived from our ba sic list: (ev) X ⊗ ( X ⊸ Y ) ⊢ Y This rule is called modus ponens . In gen eral, a de duction is a tree built from inferen ce rules. Branches arise when we u se the ( ◦ ) or ( ⊗ ) rules. Here is an example: (i) ( A ⊗ B ) ⊗ C ⊢ ( A ⊗ B ) ⊗ C (a) ( A ⊗ B ) ⊗ C ⊢ A ⊗ ( B ⊗ C ) A ⊗ ( B ⊗ C ) ⊢ D ( ◦ ) ( A ⊗ B ) ⊗ C ⊢ D Again we can abbreviate this dedu ction as a derived rule. In fact, this rule is rev ersible: A ⊗ ( B ⊗ C ) ⊢ D ( α ) ( A ⊗ B ) ⊗ C ⊢ D For a more substantial example, suppose we want to show ( X ⊸ Y ) ⊗ ( Y ⊸ Z ) ⊢ X ⊸ Z . The deduction leading to this will not ev en fit on the page unless we use our abbreviations: (ev) X ⊗ ( X ⊸ Y ) ⊢ Y (i) Y ⊸ Z ⊢ Y ⊸ Z ( ⊗ ) ( X ⊗ ( X ⊸ Y )) ⊗ ( Y ⊸ Z ) ⊢ Y ⊗ ( Y ⊸ Z ) (ev) Y ⊗ ( Y ⊸ Z ) ⊢ Z ( X ⊗ ( X ⊸ Y )) ⊗ ( Y ⊸ Z ) ⊢ Z ( α − 1 ) X ⊗ (( X ⊸ Y ) ⊗ ( Y ⊸ Z )) ⊢ Z (c) ( X ⊸ Y ) ⊗ ( Y ⊸ Z ) ⊢ X ⊸ Z Since each o f the rules used in this d eduction came from a way to get new mo rphisms fr om old in a clo sed monoid al category (we never used the b raiding) , it follows that in every such ca tegory we h av e internal com- position morphisms: • X , Y , Z : ( X ⊸ Y ) ⊗ ( Y ⊸ Z ) → X ⊸ Z . These play the same role for the internal hom that ordinar y comp osition ◦ : hom( X , Y ) × ho m( Y , Z ) → h om( X , Z ) plays for the ordinary hom. W e can go ahead making further dedu ctions in this system of logic, b ut the really interesting thing i s what it omits. For starters, it omits th e conn ectiv e ‘or’ and th e prop osition ‘false’. It also o mits two inf erence rules we normally take for granted — namely , contraction : 41 X ⊢ Y ( ∆ ) X ⊢ Y ⊗ Y and weakening : X ⊢ Y (!) X ⊢ I which are closely related to duplica tion and deletion in a cartesian category . Omitting these rules is a distinctiv e feature of lin ear logic [4 3]. The word ‘linear’ should remind us of the category Hilb. As noted in Section 2.3, this category with its usual ten sor prod uct is noncartesian , so it does no t permit du plication an d deletion. Bu t, what does omitting these rules mean in terms of logic? Ordinary logic deals w ith propo sitions, so we have been think ing of th e above system of logic in the same way . Lin ear lo gic deals n ot ju st with p ropo sitions, but also other resources — for example, physical thin gs! Unlike p ropo sitions in ordina ry logic, we typ ically can’t duplica te or delete these other resou rces. In classical logic, if we know that a prop osition X is true, we c an use X as many or as few times as w e like when tr ying to prove some p ropo sition Y . But if we have a cup of milk, we ca n’t u se it to m ake ca ke an d th en use it again to make butter . Nor can we make it disappear without a trace: even if we pour it down the dr ain, it must go somewhere. In fact, these ideas are familiar in chemistry . Con sider the follo wing resources: H 2 = one molecule of hydrog en O 2 = one molecule of oxygen H 2 O = one molecule of water W e can burn hy drogen , combin ing one molecule of oxy gen with two of hyd rogen to obtain two molecu les of water . A ca tegory theorist might describe this reaction as a morphism: f : O 2 ⊗ ( H 2 ⊗ H 2 ) → H 2 O ⊗ H 2 O . A linear logician might write: O 2 ⊗ ( H 2 ⊗ H 2 ) ⊢ H 2 O ⊗ H 2 O to indicate the existence of such a morphism. But, we cann ot duplicate or delete molecules, so for e xamp le H 2 6⊢ H 2 ⊗ H 2 and H 2 6⊢ I where I is the unit for the tensor pr oduct: no t iodine, b ut ‘no mo lecules at all’. In shor t, o rdinary chemica l re actions are mo rphisms in a sy mmetric mono idal categor y where objects ar e collections of molecules. As ch emists nor mally conceive of it, th is ca tegory is not closed. So , it ob eys an even more limited system of lo gic th an the o ne we have been discussing, a sy stem lack ing the c onnective ⊸ . T o get a closed category — in fact a compact one — we need to remember one of the grea t discoveries of 20th-centu ry physics: a n timatter . This lets us define Y ⊸ Z to be ‘ anti- Y and Z ’: Y ⊸ Z = Y ∗ ⊗ Z . Then the currying rule holds: 42 Y ⊗ X ⊢ Z X ⊢ Y ∗ ⊗ Z Most chemists don’t think abou t antimatter v ery often — but particle physicists do. They don’t use the notation of linear log ic or categor y th eory , but they know p erfectly well that since a neutrino and a n eutron can collid e and turn into a proton and an electron: ν ⊗ n ⊢ p ⊗ e , then a neutron can turn into a antineutrino together with a proton and an electron: n ⊢ ν ∗ ⊗ ( p ⊗ e ) . This is an instance of the currying rule, rule (c). 3.3 Logical Theories fr om Categories W e have sketched how di ff ere nt systems of logic n aturally arise fr om di ff erent type s of categories. T o illustrate this id ea, we introdu ced a system of logic with inf erence rules comin g f rom ways to get n ew morp hisms f rom old in a closed symmetric mon oidal ca te gory . One cou ld substitute many other types of cate gor ies here, and get other systems of logic. T o tig hten the con nection between pro of th eory and category theo ry , we shall now descr ibe a recip e to ge t a log ical theo ry from a ny closed symmetric m onoidal category . For this, we shall n ow use X ⊢ Y to d enote the set of pro ofs — or actually , eq uiv alence c lasses of p roofs — leadin g from the assumption X to the con clusion Y . This is a c hange of viewpoint. Pre viou sly we would write X ⊢ Y whe n this set of proofs was n onemp ty; otherwise we would write X 6⊢ Y . The advantage of treating X ⊢ Y as a set is that this set is precisely what a category theorist w ould call hom( X , Y ): a ho mset in a category . If we let X ⊢ Y stand for a homset, an infere nce rule becom es a fun ction from a p rodu ct of homsets to a single homset. For e xamp le, the cu t rule X ⊢ Y Y ⊢ Z ( ◦ ) X ⊢ Z becomes another way of talking about the composition function ◦ X , Y , Z : hom( X , Y ) × hom( Y , Z ) → hom( X , Z ) , while the identity rule (i) X ⊢ X becomes another way of talking about the function i X : 1 → ho m( X , X ) that send s th e single elem ent o f th e set 1 to the id entity m orphism o f X . (Note: the set 1 is a zer o-fold p roduc t of homsets.) Next, if we let inference rules be certain functions from products of homsets to homsets, deductions become more complicated function s of the same sort built from these basic ones. For example, this deduction: 43 (i) X ⊗ I ⊢ X ⊗ I (r) X ⊗ I ⊢ X (i) Y ⊢ Y ( ⊗ ) ( X ⊗ I ) ⊗ Y ⊢ X ⊗ Y specifies a fu nction from 1 to hom(( X ⊗ I ) ⊗ Y , X ⊗ Y ), built from the b asic fu nctions ind icated by the labels a t each step. This deduction : (i) ( X ⊗ I ) ⊗ Y ⊢ ( X ⊗ I ) ⊗ Y (a) ( X ⊗ I ) ⊗ Y ⊢ X ⊗ ( I ⊗ Y ) (i) I ⊗ Y ⊢ I ⊗ Y (r) I ⊗ Y ⊢ Y (i) X ⊢ X ( ⊗ ) X ⊗ ( I ⊗ Y ) ⊢ X ⊗ Y ( ◦ ) ( X ⊗ I ) ⊗ Y ⊢ X ⊗ Y giv es another function from 1 to hom(( X ⊗ I ) ⊗ Y , X ⊗ Y ). If we think of dedu ctions as gi ving functions this w ay , the question arises when two su ch function s are equal. In the example just mentioned, the triang le equation in the definition of monoidal category (Definition 7): ( X ⊗ I ) ⊗ Y X ⊗ ( I ⊗ Y ) X ⊗ Y ✲ a X , I , Y ◗ ◗ ◗ ◗ s r X ⊗ 1 Y ✑ ✑ ✑ ✑ ✰ 1 X ⊗ l Y says these two functio ns ar e eq ual. Indeed, th e triangle equ ation is precisely the statement th at these two function s agree! (W e leave this as an e xercise for the reader .) So: ev en thoug h two ded uctions ma y look quite di ff erent, th ey may give the same f unction f rom a produ ct of h omsets to a h omset if we deman d that these are hom sets in a closed sym metric monoid al category . This is why we think of X ⊸ Y as a set of eq u ivalence cla sses of pro ofs, r ather than proo fs: it is forced on u s by our desire to use categor y theory . W e could get ar ound this by using a 2-category with proofs as mo rphisms an d ‘equiv alences b etween proo fs’ as 2-morp hisms [8 4]. Th is would lead us further to the right in the Periodic T able (T able 3). But let us restrain ourselves and make s ome definitio ns formalizing what we hav e done so far . From now on we shall call the objects X , Y , . . . ‘proposition s’, ev en though we hav e seen they may repre sent more general resources. Also, purely for the s ake of brevity , we use the term ‘pro of ’ to mean ‘equiv alence class of proo fs’. T he equivalence relation must be coar se e nough to make the eq uations in the f ollowing definitio ns hold: Definition 19 A closed monoidal theo ry consists of the fo llowing: • A collection o f propositions . The collection must co ntain a pr oposition I , and if X and Y a re pr oposition s, then so ar e X ⊗ Y and X ⊸ Y . • F or every pair o f p r opositions X , Y , a set X ⊢ Y of proofs lead ing fr om X to Y . If f ∈ X ⊢ Y , the n we write f : X → Y . • Certain fu nctions, written as inference rules : 44 X ⊢ X (i) X ⊢ Y Y ⊢ Z X ⊢ Z ( ◦ ) W ⊢ X Y ⊢ Z W ⊗ Y ⊢ X ⊗ Z ( ⊗ ) W ⊢ ( X ⊗ Y ) ⊗ Z W ⊢ X ⊗ ( Y ⊗ Z ) (a) X ⊢ I ⊗ Y X ⊢ Y (l) X ⊢ Y ⊗ I X ⊢ Y (r) X ⊗ Y ⊢ Z Y ⊢ X ⊸ Z (c) A doub le lin e means that the function is invertible . So, for example, fo r e a ch triple X , Y , Z we ha ve a function ◦ X , Y , Z : ( X ⊢ Y ) × ( Y ⊢ Z ) → ( X ⊢ Z ) and a bijection c X , Y , Z : ( X ⊗ Y ⊢ Z ) → ( Y ⊢ X ⊸ Z ) . • Certain eq u ations that mu st b e obeyed b y the inference rules. The inference rules ( ◦ ) and (i) must obey equation s describing associa tivity an d the left and right un it laws. Rule ( ⊗ ) must obe y a n equation saying it is a fu nctor . Rules (a) , (l) , (r) , and ( c) must obey eq uations saying they a r e natural transformation s. Rules (a) , (l) , (r) and ( ⊗ ) must a lso o bey the triangle and pentagon eq uations. Definition 20 A closed braided monoidal theory is a closed mo noida l theory with this add itio nal in fer ence rule: W ⊢ X ⊗ Y W ⊢ Y ⊗ X (b) W e demand th a t this rule give a n atural transformation satisfying the hexa gon equations. Definition 21 A closed symmetric monoidal theory is a closed braided mo noidal theory wher e the rule (b) is its own in verse . These a re ju st th e usual d efinitions of various kind s of closed category — mono idal, bra ided mo noidal and symmetric mon oidal — written in a ne w s tyle. This new style lets us build su ch ca te gories fr om logical systems . T o do this, we take the ob jects to be proposition s and the morphisms to be equiv alence classes of proofs, where the equiv alence relation is generated by the equations listed in the definitions abov e. Howe ver , the fu ll advantages of this style only appear when we dig deeper into proof theory , and generalize the expressions we ha ve been considering: X ⊢ Y to ‘sequents’ like this: X 1 , . . . , X n ⊢ Y . Loosely , we can think of such a sequen t as meaning X 1 ⊗ · · · ⊗ X n ⊢ Y . 45 The ad vantage of sequents is that they let u s use inferen ce rules that — except f or th e cut rule and the identity rule — hav e the ‘subform ula property’ mention ed near the end of Section 3.1. Formulated in terms of these inference rules, the logic of closed symmetric monoidal categories goes by the name of ‘multiplicativ e i ntuitio nistic linear logic’ , or MILL for short [48, 82]. There is a ‘cut elimination ’ theo- rem for MILL , which say s th at with a suitable ch oice o f other infer ence rules, the cu t ru le be comes red undan t: any p roof that can be d one with it can b e don e without it. This is rema rkable, since th e cut rule corresponds to composition of morphisms in a category . One conseq uence is th at in the free symmetric monoida l closed category on any set of o bjects, the set o f mo rphisms b etween any two objects is finite . Ther e is also a d ecision proced ure to tell when two morphisms ar e equal. For details, see T rimble’ s thesis [95] and the papers by Jay [54] and Solovie v [90]. Also s ee K elly and Mac Lane’ s coh erence th eorem for closed symmetric monoida l categories [61], and the related theorem for compact symmetric monoid al categories [62]. MILL is just one o f many closely related systems of logic. Most inclu de extra f eatures, but som e subtract features. Here are just a fe w examples: • Algebraic theo ries. In h is famous th esis, Lawvere [69] defined an algebra ic theory to b e a cartesian category w here every object is an n -fold cartesian power X × · · · × X ( n ≥ 0) of a specific ob ject X . He showed h ow such categorie s regarded as logical theor ies o f a simple sor t — the so rt that had previously been studied in ‘un iv ersal alg ebra’ [2 5]. This work in itiated the categorical approa ch to logic whic h we have be en sketching here. Cro le’ s book [34] giv es a gentle introd uction to algebra ic theor ies as well as some richer log ical systems. More gener ally , we can think of any cartesian catego ry as a generalized algebraic theory . • Intuition istic line ar logic (IL L). I LL supp lements MILL with the operations familiar f rom intuition istic logic, as well a s an operation ! turning any pro position (or resource ) X into an ‘indefinite stock of copies o f X ’. Again there is a nice categor y-theor etic interpretation. Bierman ’ s thesis [23] gives a goo d overview , including a proof of c ut elimin ation for ILL and a pro of of the r esult, originally due to Girar d, that intuitionistic logic can be be embedd ed in ILL. • Linear logic (LL). For full-fledged linear logic, the online re view ar ticle by Di Cosmo and Miller [37] is a good place to start. For mo re, try the origin al paper by Gira rd [43] a nd the b ook by Troelstra [96]. Blute and Scott’ s re view article [24] serves as a Rosetta Stone for linear logic and cate gory theor y , and so do the lectures notes by Schalk [82]. • Intuition istic Logic (I L). La mbek and Sco tt’ s classic bo ok [ 67] is still an excellent intr oductio n to intu- itionistic logic and c artesian clo sed categories. The onlin e review article by Moschovakis [ 77] con tains many suggestions for further reading. T o conclu de, let us say precisely what an ‘infer ence rule’ amoun ts to in the setup we ha ve describ ed. W e have said it gives a function fro m a pro duct of h omsets to a hom set. While true, th is is not the last word o n the subject. After a ll, in stead of tr eating the pro positions appear ing in an inferen ce rule as fixed , we can tr eat them as variab le . Then an in ference rule is really a ‘schema’ for ge tting new proof s from old. How do we formalize this idea? First we must rea lize th at X ⊢ Y is not just a set: it is a set depen ding in a fun ctorial way o n X and Y . As noted in Definition 14, there is a functor, the ‘hom functor’ hom: C op × C → Set , 46 sending ( X , Y ) to the hom set hom( X , Y ) = X ⊢ Y . T o look like logicians, let us write this func tor as ⊢ . V ie wed in this ligh t, most of our inf erence rules are na tural tr ansforma tions . For example, ru le (a) is a natural transformatio n between two functors from C op × C 3 to Set, namely the functors ( W , X , Y , Z ) 7→ W ⊢ ( X ⊗ Y ) ⊗ Z and ( W , X , Y , Z ) 7→ W ⊢ X ⊗ ( Y ⊗ Z ) . This natural transformation turns any proof f : W → ( X ⊗ Y ) ⊗ Z into the proof a X , Y , Z f : W → X ⊗ ( Y ⊗ Z ) . The fact that this tr ansforma tion is natural means that it chan ges in a sy stematic way as we vary W , X , Y an d Z . The commuting square in the definition of natural transforma tion, Definition 4, makes this precise. Rules (l), (r), ( b) and (c) g iv e na tural tran sformation s in a very similar way . The ( ⊗ ) rule gives a natur al transform ation between two functors from C op × C × C op × C to Set, namely ( W , X , Y , Z ) 7→ ( W ⊢ X ) × ( Y ⊢ Z ) and ( W , X , Y , Z ) 7→ W ⊗ Y ⊢ X ⊗ Z . This natural transformation sends any element ( f , g ) ∈ h om( W , X ) × hom( Y , Z ) to f ⊗ g . The identity an d cut r ules ar e di ff erent: they do n ot gi ve na tural transformation s, be cause the top line of these rules ha s a di ff er ent numbe r of variables than the bo ttom line! Rule (i) says that f or each X ∈ C there is a function i X : 1 → X ⊢ X picking out the identity mo rphism 1 X . What would it mean f or this to be n atural in X ? Rule ( ◦ ) says that for each triple X , Y , Z ∈ C ther e is a function ◦ : ( X ⊢ Y ) × ( Y ⊢ Z ) → X ⊢ Z . What would it mean for this to be natural in X , Y and Z ? T he answer to both question s in volves a generalization of natural transforma tions called ‘din atural’ transformations [71]. As noted in Definition 4, a natural transformatio n α : F ⇒ G be tween two fun ctors F , G : C → D m akes certain squares in D co mmute. If in fact C = C op 1 × C 2 , then we actually obtain commutin g cubes in D . Namely , the natural transfo rmation α assigns to each object ( X 1 , X 2 ) a mo rphism α X 1 , X 2 such that for any mo rphism ( f 1 : Y 1 → X 1 , f 2 : X 2 → Y 2 ) in C , th is cube commutes: 47 G ( Y 1 , X 2 ) G ( Y 1 , Y 2 ) F ( Y 1 , X 2 ) F ( Y 1 , Y 2 ) G ( X 1 , X 2 ) G ( X 1 , Y 2 ) F ( X 1 , X 2 ) F ( X 1 , Y 2 ) ✲ G (1 Y 1 , f 2 ) ❄ G ( f 1 , 1 Y 2 ) ❄ F ( f 1 , 1 X 2 ) ✲ F (1 Y 1 , f 2 )       ✒ α Y 1 , X 2 G ( f 1 , 1 X 2 ) ❄ ❄ F ( f 1 , 1 Y 2 )       ✒ α Y 1 , Y 2 G (1 X 1 , f 2 ) ✲ ✲ F (1 X 1 , f 2 )       ✒ α X 1 , X 2       ✒ α X 1 , Y 2 If C 1 = C 2 , we c an choo se a single obje ct X and a single morph ism f : X → Y an d u se it in both slots. As shown in Figure 1, there are then two paths from one corner of th e cube to t he antipodal corner that only in volve α for repeated arguments: that is, α X , X and α Y , Y , but not α X , Y or α Y , X . These paths give a commu ting hexagon. This motiv ates the following: Definition 22 A dinatural transformation α : F ⇒ G between functo rs F , G : C op × C → D assign s to every object X in C a mo rphism α X : F ( X , X ) → G ( X , X ) in D such that for every morphism f : X → Y in C , the hexagon in F igur e 1 com m u tes. In the case of the identity rule, this commuting hexago n f ollows f rom the fact that the id entity morphism is a left and right unit for com position: see Figure 2. For the cut rule, this co mmuting hexagon says that comp osition is associativ e: see Figure 3. So, in genera l, the sort of logical theory we are discussing inv olves: • A category C of prop ositions and proofs. • A functor ⊢ : C op × C → Set sen ding any p air of prop ositions to the set of proof s leading f rom o ne to the other . • A set of dina tural transformations d escribing inferenc e rules. 48 G ( Y , X ) G ( Y , Y ) F ( Y , X ) F ( Y , Y ) G ( X , X ) G ( X , Y ) F ( X , X ) F ( X , Y ) ❄ G ( f , 1 Y ) ❄ F ( f , 1 X ) ✲ F (1 Y , f )      ✒ α Y , Y ✲ G (1 X , f )      ✒ α X , X Figure 1: A natu ral transfor mation between f unctors F , G : C op × C → D gives a comm uting cu be in D fo r any morph ism f : X → Y , and th ere are two paths around the cube that only in v olve α for repeated arguments. Y ⊢ Y 1 Y 1 • 1 • X ⊢ X 1 X X ⊢ Y f ◦ 1 X = 1 Y ◦ f 1 • ❄ −◦ f ❄ 1 1 ✲ 1 1    ✒ i Y ✲ f ◦−    ✒ i X Figure 2: Dinaturality o f th e (i) rule, where f : X → Y . Here • ∈ 1 denotes the o ne elemen t of the one-elem ent set. 49 X ⊢ Z h ◦ ( f ◦ g ) ( X ⊢ W ) × ( Y ⊢ Z ) ( g , h ) ( X ⊢ Y ) × ( Y ⊢ Z ) ( f ◦ g , h ) X ⊢ Z ( h ◦ f ) ◦ g X ⊢ Z ( h ◦ f ) ◦ g = h ◦ ( f ◦ g ) ( X ⊢ W ) × ( W ⊢ Z ) ( g , h ◦ f ) ❄ 1 X ⊢ Z ❄ (1 X ⊢ W , −◦ f ) ✲ ( f ◦− , 1 Y ⊢ Z ) ✑ ✑ ✑ ✑ ✑ ✑ ✸ ◦ ✲ 1 X ⊢ Z ✑ ✑ ✑ ✑ ✑ ✑ ✸ ◦ Figure 3: Dinaturality of the cut rule, where f : W → Y , g : X → W , h : Y → Z . 4 Computation 4.1 Backgroun d In the 193 0s, while T uring was developing what are n ow called ‘T uring machines’ as a mo del for compu tation, Church and his stud ent Kleene were developing a di ff erent model, called the ‘ lambda calculus’ [29, 63]. While a T uring machin e can be seen as an idealized, simplified m odel of co mputer hardwar e , the lambda ca lculus is more like a simple model of softwar e . By now th e are many carefu l treatments of the lam bda calculu s in the literatur e, fro m Baren dregt’ s magis- terial tome [1 7] to th e classic category -theoretic tr eatment o f Lambek an d Scott [6 7], to Hindley and Seldin’ s user-friendly introductio n [5 1] and Selinger’ s elegant free online notes [86]. So, we shall content ourselves with a quick sketch. Poetically speaking, the lambda calculus describes a uni verse where ev erythin g is a program and ev erythin g is data: pr ograms are data . More p rosaically , everything is a ‘ λ -ter m’, o r ‘term’ for short. Th ese are defined inductively: • V ariables: there is a coun table s et of ‘variables’ x , y , z , . . . which are all terms. • Application: if f and t are terms, we can ‘apply’ f to t and obtain a term f ( t ). • Lambda-abstrac t ion: if x is a variable and t is a term, there is a term ( λ x . t ). 50 Let us explain th e meaning of applicatio n and lambd a-abstraction . Ap plication is simple. Since ‘pro grams are data’, we ca n think of a ny term either as a p rogr am or a piece of data. Since we can apply pro grams to data and get ne w data, we can apply any term f to any other term t and ge t a new term f ( t ). Lambda- abstraction is more interesting. W e think of ( λ x . t ) as the program that, given x as input, returns t as output. For example, consider ( λ x . x ( x )) . This program takes an y program x as input and returns x ( x ) as output. In other words, it applies any prog ram to itself. So , we have ( λ x . x ( x ))( s ) = s ( s ) for any term s . More gen erally , if we apply ( λ x . t ) to any term s , we sh ould get ba ck t , but with s substituted for each free occurre nce of the variable x . This fact is codified in a rule called beta reduction : ( λ x . t )( s ) = t [ s / x ] where t [ s / x ] is the term we get by taking t and sub stituting s for each f ree occurre nce o f x . But b ew are: th is rule is not an e quation in the u sual mathema tical sense. Instead, it is a ‘rewrite rule’: given the term on the left, we are allowed to rewrite it and get th e term o n th e rig ht. Starting with a term and repeated ly app lying rewrite rules is how we take a progra m and let it run! There are two other re write rules in the lambda calculus. If x is a variable and t is a term, the term ( λ x . t ( x ) ) stands for the pro gram that, gi ven x as inp ut, returns t ( x ) as outp ut. But th is is just a fancy way of talking about the progra m t . So, the lambda calculus has a re write rule called eta reduction , saying ( λ x . t ( x ) ) = t . The th ird rewrite rule is alpha c o n version . This allows us to r eplace a boun d variable in a term by ano ther variable. For example: ( λ x . x ( x )) = ( λ y . y ( y )) since x is ‘b ound ’ in the left-h and expression b y its ap pearance in ‘ λ x ’. In oth er words, x is just a d ummy variable; its name is irrelevant, so we can replace it with y . On the other hand, ( λ x . y ( x )) , ( λ x . z ( x )) . W e cann ot replace the variable y by the variable z here, since th is variable is ‘free’, not bo und. Some ca re must be taken to make the notions of free and bound variables precise, but we shall gloss over this issue, referring the reader to the references above for details. The lambda calculus is a very simple for malism. Amazin gly , starting from just this, Church and Kleene were able to build up Boolean logic, th e n atural nu mbers, the u sual oper ations of arithmetic, and so on. For example, the y defined ‘Church nume rals’ as follows: 0 = ( λ f . ( λ x . x )) 1 = ( λ f . ( λ x . f ( x ))) 2 = ( λ f . ( λ x . f ( f ( x )))) 3 = ( λ f . ( λ x . f ( f ( f ( x ))) )) 51 and so on. No te that f is a variable above. Thus, the Chu rch nu meral n is the p rogra m that ‘takes any p rogram to the n th power’: if you giv e it any p rogram f as input, it returns the program that applies f n times to wh atever input x it receives. T o get a feeling for how we can define arithmetic operations on Church numerals, consider λ g . 3(2( g )) . This prog ram takes any prog ram g , squa res it, an d then c ubes the r esult. So, it raises g to th e sixth power . This suggests that λ g . 3(2( g )) = 6 . Indeed th is is true. I f we treat the definitions of Church numera ls as reversible rewrite rules, th en we can start with the left side of the above equatio n and grin d aw ay using rewrite rules u ntil we reach the right side: ( λ g . 3(2( g )) = ( λ g . 3(( λ f . ( λ x . f ( f ( x ))))) ( g )) def. of 2 = ( λ g . 3( λ x . g ( g ( x )))) beta = ( λ g . ( λ f . ( λ x . f ( f ( f ( x )))))( λ x . g ( g ( x )))) def. of 3 = ( λ g . ( λ x . ( λ x . g ( g ( x )))(( λ x . g ( g ( x )))( ( λ x . g ( g ( x ) ))( x ))))) beta = ( λ g . ( λ x . ( λ x . g ( g ( x )))(( λ g . g ( g ( x )))( g ( g ( x ))) ))) beta = ( λ g . ( λ x . ( λ x . g ( g ( x )))( g ( g ( g ( g ( x ))))))) beta = ( λ g . ( λ x . g ( g ( g ( g ( g ( g ( x ) ))))))) beta = 6 def. of 6 If this calculation seems mind-nu mbing , that is precisely the p oint: it resemb les th e inn er workin gs of a co m- puter . W e see here h ow the lambda calculus can serve as a pro gramm ing language, with each step of computation correspo nding to a rewrite rule. Of course, we got the answer 6 becau se 3 × 2 = 6. Genera lizing from this example, we can define a program called ‘times’ that multiplies Church numerals: times = ( λ a . ( λ b . ( λ x . a ( b ( x ))))) . For e xample, times( 3)(2) = 6 . The enter prising reader can drea m up similar p rogram s for the other b asic op erations of arith metic. W ith more clev erness, Ch urch an d Kleene were able to write ter ms corr espondin g to more comp licated f unctions. They ev entually came to belie ve that all computable functions f : N → N can be defin ed in the lambda calculus. Meanwhile, G ¨ odel was developing ano ther ap proach to comp utability , the theo ry o f ‘recursive function s’. Around 1936 , Kleen e proved that the func tions d efinable in the lamb da ca lculus were the same as G ¨ ode l’ s recursive fun ctions. I n 193 7 T uring describ ed his ‘T uring mach ines’, and used these to giv e yet a nother definitio n of com putable fun ctions. This defin ition was later shown to agree with the other two. Th anks to this and o ther evidence, it is now w idely acc epted that the lam bda calculu s c an defin e any fun ction that can b e compu ted b y any systematic method. W e say it is ‘T uring complete’. After th is burst of theoretical work , it took a few decade s for pr ogramm able computers to a ctually be built. It took ev en longer fo r comp uter scientists to p rofit fro m Church and K leene’ s insights. This b egan around 1958, when McCarthy in vented the prog ramming lang uage Lisp, based on the lambda c alculus [74]. I n 1965, an 52 influential paper by Landin [68] p ointed out a powerful analogy between the lam bda calcu lus and the lan guage ALGOL. The se developments led to a re newed interest in th e lam bda calcu lus whic h contin ues to this day . By now , a number of comp uter languag es are explicitly based on ideas from the lambda calculus. The most famous of th ese includ e Lisp, ML an d Haskell. These lan guages, ca lled ‘fu nctional prog ramming languag es’, are beloved by theoretical computer scientists for their conceptual clarity . I n fact, for many years, everyone majoring in co mputer science at MIT h as been required to take an introd uctory course that in volves pr ogram ming in Scheme, a dialect of Lisp. The cover of the textbook for this course [1] e ven has a big λ on the cov er! W e should admit that lan guage s o f a di ff erent sort — ‘imper ativ e p rogra mming lan guage s’ — are more pop- ular a mong working p rogram mers. Ex amples in clude FOR TRAN, B ASIC, and C. I n imperative programm ing, a progr am is a series of instructions that tell the computer what to do. By co nstrast, in functional programm ing, a progr am simp ly describes a function. T o run the pro gram, we apply it to an i npu t. So, as in the lambda calculu s, ‘application ’ is a fundame ntal op eration in functiona l prog ramming . If we co mbine app lication with lambda abstraction, we obtain a language powerful enou gh to compute any compu table function. Howe ver , mo st f unctiona l pro gramm ing languag es are m ore regimented than the or iginal lam bda calculus. As we have seen, in the lambd a calculus as originally developed by Church and Kleene, any term can b e applied to any oth er . In r eal life , program ming inv olves m any k inds of data. For examp le, su ppose we are writing a progr am that inv olves days of the week. It would not make sense to write times( 3)(T uesday) because Tuesday is not a numb er . W e might choose to repre sent T uesday by a number in some pro gram, but doublin g that num ber doesn’t have a go od interpretation: is the first da y of the week Sunday or Monday ? Is the week indexed from zer o or one? Th ese are arbitrary choices that a ff ect the r esult. W e cou ld let the pro grammer make the choices, b ut the resulting unstructu red framew ork easily leads t o m istakes. It is better to treat data as comin g in v arious ‘types’, such as integers, floating-poin t numb ers, alphanumeric strings, and so on. Thus, wh enever we intr oduce a variable in a p rogra m, we sh ould ma ke a ‘ type d eclaration ’ saying what type it is. For example, we might write: T uesday : day This notation is used in Ada, Pascal and some other langua ges. Other nota tions ar e also in widespread use. Then, our system should ha ve a ‘type checker’ (usually part of the comp iler) that complains i f we try to apply a progr am to a piece of data of the wron g type. Mathematically , this id ea is formalized b y a m ore soph isticated version o f the lambda ca lculus: the ‘typed ’ lambda calculus, wh ere ev ery term has a type. Th is id ea is also fund amental to ca tegory th eory , where every morph ism is like a black box with input and output wires of specified types: f X Y and it makes n o sense to ho ok two black boxes together u nless the output of th e first h as th e same type as the input of the next: 53 f g X Y Z Indeed , there is a deep relation between the typed lambda calculu s and cartesian closed categories. This was discovered by Lambe k in 1980 [6 6]. Quite rough ly speaking, a ‘typed lambda- theory ’ is a very simple fu nctional progr amming la nguag e with a specified collection of basic data types from which other more complicated types can be built, and a specified collection of basic terms from which more comp licated terms can be b uilt. T he data types of this langu age are o bjects in a cartesian closed category , while the pr ograms — th at is, ter ms — give morphisms! Here we are being a bit sloppy . Recall from Section 3.3 that in logic we can build closed monoidal categories where the m orphisms are equ iv alence classes o f p roofs. W e need to take equ iv alence classes f or th e ax ioms o f a clo sed mon oidal categor y to h old. Similarly , to g et closed monoida l categories fr om compu ter science, we need the mor phisms to be e quiv alence classes of ter ms. T w o te rms co unt as equ iv alent if th ey di ff er by rewrite rules suc h as beta r eduction , eta r eduction a nd alph a co n version. As we h av e seen , th ese r ewrites represent th e steps whereb y a pr ogram carries out its comp utation. F or example, in the original ‘u ntyped’ lambda calcu lus, the ter ms times( 3)(2) an d 6 di ff er b y rewrite rules, but they give the same mo rphism. So, w hen we constru ct a cartesian closed category from a typed lambda-theory , we ne glect the a c tual pr ocess of computation . T o remedy this we should work with a cartesian closed 2-category which has: • types as objects, • terms as morph isms, • equivalence classes of rewrites as 2-morphisms. For details, see th e work o f Seely [84], Hilken [50], and Me lli ´ es [73]. Someday th is work will be part of the larger n -categor ical Rosetta Stone mentio ned at the end of Section 2.5. In any event, Lamb ek showed tha t ev ery ty ped lambda-th eory gives a c artesian closed category — and conv ersely , every cartesian closed category g iv es a typ ed lamb da-theo ry . This discovery led to a ric h lin e o f research b lending category theo ry and com puter scien ce. There is no way we can summarize the resu lting enormo us b ody of work, though it constitutes a crucial aspect of the Rosetta Stone. T wo good starting points for further reading are the textbook by C role [34] a nd the online revie w article by Scott [80]. In what follo ws, our goal is more limited. First, in Section 4.2, we explain how e very ‘typed lambda-th eory’ giv es a cartesian closed c ategory , and conversely . W e follow the treatmen t of Lambek and Scott [67], in a somewhat simp lified form . Then , in Section 4.3, we describe how e very ‘linear type theory’ gives a c losed symmetric monoida l category , and conversely . The idea here is roughly that a ‘linea r type theory ’ is a p rogram ming langu age suitable for bo th classical and quantu m comp utation . This langu age d i ff ers fro m the ty ped lambd a calculus in that it fo rbids dup lication and 54 deletion o f d ata except wh en exp ressly permitted . Th e r eason is that while every object in a cartesian category comes equipp ed with ‘dup lication’ and ‘deletion’ morphisms: ∆ X : X → X ⊗ X , ! X : X → 1 , a symmetric monoidal category typically lacks these. As we saw in Section 2.3, a great example is the category Hilb with its usua l tensor produ ct. So, a pro gramm ing languag e suitable fo r quan tum co mputation shou ld not assume we can duplicate all types of data [28, 100]. V ar ious versio ns of ‘quan tum’ or ‘linear ’ lambd a calcu lus have alr eady bee n stud ied, for example by Benton, Bierman d e Pai va and Hylan d [ 21], Dorca and van T onder [98], and Selin ger a nd V aliron [88]. Abr amsky and Tzevelek os sketch a version in th eir p aper in this volume [6]. W e in stead explain the ‘linear type theories’ developed b y Simon Ambler in his 1991 thesis [7]. 4.2 The T yped Lambda Calculus Like the orig inal ‘untyped’ lambda calculus e xplaine d above, the t ype d lambda calculus uses terms to repre sent both programs and data. Howev er, now ev ery term has a specific type. A program that inputs data of type X and outputs data of type Y is said to be of type X ⊸ Y . So, we can only apply a term s to a term t of type X if s is o f type X ⊸ Y for some Y . In this case s ( t ) is a well-d efined term of type Y . W e call X ⊸ Y a function type . Whenever we introduce a variable, we must declare its type. W e write t : X to mean that t is a term of type X . So, in lambd a abstraction , we n o lo nger simply write exp ressions like ( λ x . t ). In stead, if x is a variable of type X , we write ( λ x : X . t ) . For e xample, here is a simple prog ram that tak es a prog ram of type X ⊸ X and ‘squares’ it: ( λ f : X ⊸ X . ( λ x : X . f ( f ( x )))) . In th e origin al lambda calculus, a ll progra ms take a single piece of data as inpu t. In other words, they compute unary fu nctions. T his is no rea l limitation, since we can han dle function s that take more than on e argument using a trick called ‘cur rying’ , d iscussed in Section 2.6 This tur ns a function of s everal arguments in to a function that t akes the first argumen t and retur ns a function of the remaining arguments. W e saw an e xample in the last section: the p rogram ‘time s’. For exam ple, times( 3) is a progr am that multiplies b y 3, so times(3)( 2) = 6. While makin g a ll prog rams co mpute unary fu nctions is econo mical, it is no t very k ind to the progr ammer . So, in the typed lambda calculus we also introduce pro ducts: given types X and Y , there is a type X × Y called a product t ype . W e can think of a datum of ty pe X × Y as a pair co nsisting of a datum of typ e X and a datum of type Y . T o make this intuition explicit, we insist that gi ven terms s : X an d t : Y there is a term ( s , t ) : X × Y . W e also insist th at g iv en a term u : X × Y th ere are terms p ( u ) : X and p ′ ( u ) : Y , which we th ink of a s th e first and second compon ents of the pair t . W e also include rewrite rules saying : ( p ( u ) , p ′ ( u )) = u for all u : X × Y , p ( s , t ) = s for all s : X and t : Y , p ′ ( s , t ) = t for all s : X an d t : Y . Product type s allow us to write pro grams that take m ore than one input. Even mo re importan tly , they let us dea l with pr ograms that produ ce mor e than one outpu t. For example, we might have a type called ‘integer’. 55 Then we might want a program that takes an i nteger and duplicates it: duplicate : integer ⊸ (in teger × in teger) Such a program is easy to write: duplicate = ( λ x : integer . ( x , x )) . Of cou rse this a p rogra m we should n ot be allowed to wr ite when duplica ting in forma tion is forbid den, but in this section our consideratio ns are all ‘classical’, i.e., suited to cartesian closed categories. The typ ed lambd a calculu s also h as a special type called the ‘unit typ e’, which we denote as 1. There is a single term of this typ e, which we denote as ( ). From the v iewpoint of category theory , the need for this type is clear: a ca tegory with fin ite pr oducts must h ave not only bina ry pro ducts but also a termin al object (see Definition 10). For example, in the cate gor y Set, the terminal object can be taken as any one-element set, and () is the unique element of this set. It may be less clear why this type is usefu l in pro grammin g. One reason is that it lets us think of a constant of type X as a f unction of type 1 ⊸ X — th at is, a ‘nullary’ function, one that takes no argu ments. Ther e ar e so me o ther reasons, but th ey go beyond the scope of this discussion. Su ffi ce it to say that Haskell, Lisp and e ven widely used imperati ve languages s uch as C, C ++ and Jav a includ e the unit type. Having in troduce d the main in gredien ts of the typed lambd a calcu lus, let us give a mor e formal treatment. As we shall see, a ‘typed lambd a-theor y’ con sists of types, terms and re write rules. From a typed lambd a-theor y we can get a cartesian closed category . The typ es will gi ve o bjects, th e terms will giv e morph isms, and the rewrite rules will give equatio ns between morphisms. First, the types are gi ven inductively as f ollows: • Basic types: There is an arbitar ily chosen set of types called basic t ypes . • Product t ypes: Giv en types X and Y , there is a typ e X × Y . • Function types: Giv en types X an d Y , there is a type X ⊸ Y . • Unit type: There is a type 1. There may be un expected equatio ns betwe en ty pes: for example w e may have a typ e X satisfying X × X = X . Howe ver , we demand that: • If X = X ′ and Y = Y ′ then X × Y = X ′ × Y ′ . • If X = X ′ and Y = Y ′ then X ⊸ Y = X ′ ⊸ Y ′ . Next we define terms . Each term has a specific type, and if t is a term of type X we write t : X . The rules for building terms are as follo ws: • Basic terms: For each type X there is a set of basic terms of type X . • V ariables: F or eac h type X there is a co untably infin ite collection of ter ms of type X called varia bles of type X . • Application: If f : X ⊸ Y and t : X th en there is a term f ( t ) of typ e Y . 56 • Lambda abstractio n: If x is a variable of type X a nd t : Y then there is a term ( λ x : X . t ) of type X ⊸ Y . • Pairing: If s : X and t : Y then there is a term ( s , t ) o f type X × Y . • Projection: I f t : X × X ′ then there is a term p ( t ) of X a nd a term p ′ ( t ) o f type X ′ . • Unit term: There is a term () of type 1. Finally ther e are rewrite rules going b etween ter ms of the same typ e. Given any fixed set of variables S , there will be r ewrite rules be tween ter ms of th e same type, all of wh ose free variables lie in th e set S . For our present purpo ses, we on ly n eed th ese r ewrite rules to decide when two terms determin e the same mor phism in the cartesian c losed category we sha ll build. So, wh at matters is not rea lly the rewrite rules th emselves, but the equiv alence relation they gene rate. W e wr ite this equiv alence relation as s ∼ S t . The relation ∼ S can be any equi valence relation satisfying the following list of rules. In what follo ws, t [ s / x ] denotes the result of taking a term t an d rep lacing every f ree o ccurence o f the variable x by the term s . Also, when when we say ‘ter m’ withou t further qualificatio n, we mea n ‘term all of who se free variables lie in the set S ’. • T ype preservation: If t ∼ S t ′ then t and t ′ must be terms of the same ty pe, all of wh ose free variables lie in the set S . • Beta reduction: Suppose x is a variable o f type X , s is a term of ty pe X , and t is any term. If n o free occurre nce of a v ariable in s becomes bound in t [ s / x ] , then: ( λ x : X . t )( s ) ∼ S t [ s / x ] . • Eta reduction: Sup pose the v ariable x d oes not appear in the term f . Then: ( λ x : X . f ( x )) ∼ S f . • Alpha conversion: Suppose x and y are variables of ty pe X , a nd n o free occurr ence of a ny variable in t becomes bound in t [ x / y ]. Then: ( λ x : X . t ) ∼ S ( λ y : X . t [ x / y ]) . • Application: Sup pose t and t ′ are terms of type X with t ∼ S t ′ , and suppose that f : X ⊸ Y . Then: f ( t ) ∼ S f ( t ′ ) . • Lambda a bstraction: Sup pose t and t ′ are terms o f type Y , a ll of whose free variables lie in the set S ∪ { x } . Supp ose that t ∼ S∪{ x } t ′ . Then: ( λ x : X . t ) ∼ S ( λ x : X . t ′ ) • Pairing: If u is a term of type X × Y then: ( p ( u ) , p ′ ( u )) ∼ S u . 57 • Projection: if s is a term of type X and t is a term of type Y then: p ( s , t ) ∼ S s p ′ ( s , t ) ∼ S t . • Unit term: If t is a ter m of type 1 then: t ∼ S () . Now we can d escribe Lam bek’ s classic result relatin g typed lambda- theories to cartesian c losed categories. From a typed lambda-theo ry we get a cartesian closed category C fo r which: • The objects of C are the types. • The mor phisms f : X → Y of C are eq uiv alence classes of pairs ( x , t ) co nsisting o f a variable x : X and a term t : Y with no free v ariables except perhaps x . Here ( x , t ) is equiv alent to ( x , t ′ ) if and only if: t ∼ { x } t ′ [ x / x ′ ] . • Given a morphism f : X → Y co ming from a pair ( x , t ) and a morp hism g : Y → Z comin g from a pair ( y , u ) as above, the com posite g f : X → Y comes from the pair ( x , u [ t / y ]) . W e can also reverse this p rocess an d g et a typed lambd a-theor y from a cartesian c losed c ategory . In fact, L ambek and Scott nicely explain how to construct a category of cate gor y of cartesian closed categories and a category of typed-lam bda theories. T hey co nstruct fu nctors g oing b ack a nd f orth between these c ategories an d show th ese functor s are inverses up to natural isomorphism. W e thus say these categories are ‘equiv alent’ [67 ]. 4.3 Linear T ype Theories In his thesis [7], Ambler described how to generalize Lambek’ s classic result from cartesian closed cate gories to closed sy mmetric mon oidal categories. T o do t his, he rep laced typed lambda-theo ries with ‘linear type theories’. A linear type th eory c an b e seen as a p rogra mming language suitab le fo r both c lassical an d qu antum co mputa- tion. As we have seen, in a noncar tesian category like Hilb, we cann ot freely duplicate or delete informa tion. So linear type theories must prev ent duplication or deletion of data e xcept when it is expr essly allowed . T o achieve this, linear type theories must not allow us to write a program lik e this: ( λ x : X . ( x , x )) . Even a program t hat ‘ squares’ another program, like this: ( λ f : X ⊸ X . ( λ x : X . f ( f ( x )))) , is not allowed, since it ‘reuses’ th e variable f . On the o ther hand, a progr am that com poses two progr ams is allowed! T o impose the se restrictions, linear type theories t reat v ariables very di ff eren tly tha n the typed lamb da calcu- lus. I n fact, in a linear ty pe theory , any term will contain a given variable at most once . But linear type theor ies 58 depart ev en more dr amatically from the typed lam bda calculus in an other way . T hey m ake n o use of lambda abstraction! I nstead, they use ‘combinators’. The id ea of a co mbinato r is very old: in fact, it pr edates th e lamb da c alculus. Combin atory lo gic was born in a 1924 pa per by Sch ¨ onfinkel [8 3], and was red iscovered and extensiv ely developed by Curry [35] starting in 1927. I n re trospect, we can see th eir work as a strip ped-d own version o f the untyped lambd a calculu s tha t completely avoids the use of variables. Starting fro m a b asic stock of ter ms called ‘comb inators’, the only way to build ne w ones is application: we can app ly any term f to any term t and get a term f ( t ). T o build a T urin g-comp lete p rogra mming languag e in such an impoverished setup, we need a su ffi cient stock o f combin ators. Remark ably , it su ffi ces to use three. In fact it is possible to use ju st o ne cleverly ch osen combinato r — but this tour de for ce is not p articularly enlig htening , so we shall d escribe a commo nly used set of three. The first, called I , acts like the identity , since it comes with the rewrite rule: I ( a ) = a for e very term a . The second, called K , gives a con stant function K ( a ) for each term a . In o ther w ords, it comes with a rewrite rule saying K ( a )( b ) = a for every term b . The third , called S , is the tricky one . It takes th ree terms, applies th e first to the thir d, and applies the result to the second applied to the third: S ( a )( b )( c ) = a ( c )( b ( c )) . Later it was seen that the combinator calculus can be embedded in the untyped lambda calculus as follows : I = ( λ x . x ) K = ( λ x . ( λ y . x )) S = ( λ x . ( λ y . ( λ z . x ( z )( y ( z )))) ) . The r ewrite rules for these combinator s then follow from rewrite rules in the lambda calculus. More surprisingly , any fu nction compu table using th e lamb da ca lculus can also b e com puted u sing just I , K and S ! While we do not need this fact to understand linea r type theories, we canno t resist sketchin g the proof, since it is a classic example of using combinators to a void explicit use of lambda abstraction . Note that all the variables in the lam bda calculu s f ormulas fo r I , K , and S are bo und variables. Mo re g en- erally , in th e lambda calculus we define a combinator to be a term in wh ich all variables a re boun d variables. T wo combinators c and d are ext ensionally equivalent if they gi ve the same result on any input: that is, for any term t , we can app ly lam bda calculus r ewrite rules to c ( t ) and d ( t ) in a way that lead s to the same term. There is a pr ocess called ‘abstractio n elimination ’ tha t takes a ny c ombinato r in th e lambda calcu lus and pro duces an extensionally equi valent one built from I , K , and S . Abstraction elimination works by taking a term t = ( λ x . u ) with a single lambda abstra ction an d rewriting it into the form ( λ x . f ( x )), where f has no instances o f lambda abstraction. Then we can a pply eta reductio n, which says ( λ x . f ( x )) = f . Th is lets us rewrite t as a term f that do es no t inv olve lambda abstraction. W e shall use the notation [[ u ]] x to mean ‘any term f satisfing f ( x ) = u ’. There are three cases to consider ; each case justifies the d efinition of one combinator: 1. t = ( λ x . x ). W e can rewrite this as t = ( λ x . I ( x )) , so t = [[ x ]] x = I . 59 2. t = ( λ x . u ), where u does not depend on x . W e ca n rewrite this as t = ( λ x . K ( u )( x )) , so t = [[ u ]] x = K ( u ) . 3. t = ( λ x . u ( v )) , where u an d v may depend on x . W e can r ewrite th is as t = ( λ x . (([[ u ]] x x )([[ v ]] x x )) or t = ( λ x . S ([[ u ]] x )([[ v ]] x )( x )), s o t = S ([[ u ]] x )([[ v ]] x ) . W e can eliminate all use of lambd a abstraction fro m any term by repeatedly using these three rules ‘fro m the inside out’ . T o see how th is works, consider the lambd a term t = ( λ x . ( λ y . y )) , which takes two inputs and returns the second. Using the rules above we have: ( λ x . ( λ y . y )) = ( λ x . ( λ y . [[ y ]] y ( y ))) = ( λ x . ( λ y . I ( y ))) = ( λ x . I ) = ( λ x . [[ I ]] x ( x )) = ( λ x . K ( I )( x ) = K ( I ) . W e can check that it works as desired: K ( I )( x ) ( y ) = I ( y ) = y . Now let us return to our main theme: linear typ e theories. Of the th ree combina tors describ ed above, only I is suitable for use in an arbitrar y closed symm etric monoida l category . The reaso n is that K de letes data, while S duplicates it. W e can see this dire ctly from the re write rules they satisfy: K ( a )( b ) = a S ( a )( b )( c ) = a ( c )( b ( c )) . Every linear typ e the ory h as a set of ‘basic combinato rs’, which n either duplicate no r d elete data. Since linear ty pe theo ries gen eralize typed lambda- theories, these basic comb inators are typed. Ambler writes th em using notation resembling the notation for morph isms in category theory . For example, gi ven two types X and Y in a linear type th eory , there is a t ensor product type X ⊗ Y . Th is is analogo us to a p roduct type in the typed lambd a calculus. In particular, given a term s of type X an d a term t of type Y , we can combine them to form a term of type X ⊗ Y , which we now denote as ( s ⊗ t ). W e repare nthesize iterated tensor products using the following basic com binator: assoc X , Y , Z : ( X ⊗ Y ) ⊗ Z → X ⊗ ( Y ⊗ Z ) . This combinato r comes with the following re write rule: assoc X , Y , Z (( s ⊗ t ) ⊗ u ) = ( s ⊗ ( t ⊗ u )) for all terms s : X , t : Y and u : Z . Of co urse, the b asic com binator assoc X , Y , Z is just a mildly d isguised version of th e associato r , familiar fr om category th eory . Ind eed, all the basic co mbinato rs come fr om natural or dinatural transfor mations implicit in the definition of ‘clo sed symmetric mono idal ca tegory’. In add ition to these, any given linear typ e th eory also has comb inators called ‘function symbols’. These come fr om the mor phisms particular to a giv en category . For example, suppose in so me c ategory the tensor prod uct X ⊗ X is a ctually the cartesian p roduct. Then the correspo nding linear type theor y should ha ve a function symbol ∆ X : X → X ⊗ X 60 which lets us duplicate data of type X , together with function symbols p : X ⊗ X → X , p ′ : X ⊗ X → X that project onto the first and second factors. T o m ake sure these work as desired, we can includ e re write rules: ∆ ( s ) = ( s ⊗ s ) p ( s ⊗ t ) = s p ′ ( s ⊗ t ) = t . So, while dup lication and d eletion o f data is not a ‘built-in featur e’ of linear type th eories, we can in clude it when desired. Using com binators, we could try to design a p rogr amming lan guage suitable for closed sy mmetric mon oidal categories that co mpletely av oid the u se o f variables. Ambler follows a di ff eren t p ath. He retains variables in his forma lism, but they play a very di ff er ent — and mu ch simpler —- role than they d o in th e lambda calculu s. Their only r ole is to help decide which terms should coun t as equi valent. Fur thermor e, lambda abstractio n plays no r ole in line ar ty pe theories, so the whole issue of f ree versus boun d variables d oes n ot arise! I n a sense, all variables are free. Mor eover , e very term contains any given variable at most once. After these words of w arning , we hope the reader is ready fo r a more formal treatm ent o f linear ty pe theories. A linear type theory h as types, combin ators, terms, and rewrite r ules. The types will corresp ond to objects in a closed sym metric m onoid al category , while e quiv alence classes of comb inators will corr espond to mor phisms. T erm s and re write rules are only used to define the equiv alence relation. First, the set of types is defined inductively as follows: • Basic types: There is an arbitar ily chosen set of types called basic t ypes . • Product t ypes: Giv en types X and Y , there is a typ e ( X ⊗ Y ). • Function types: Giv en types X an d Y , there is a type ( X ⊸ Y ). • T rivial type: There is a type I . There may be equations between types, but we req uire that: • If X = X ′ and Y = Y ′ then X ⊗ Y = X ′ ⊗ Y ′ . • If X = X ′ and Y = Y ′ then X ⊸ Y = X ′ ⊸ Y ′ . Second, a linear typ e theory has for each pair of typ es X and Y a set of combinators of the for m f : X → Y . These are defined by the following inductive rules: • Given types X and Y there is an arbitrarily chosen s et of combin ators f : X → Y called function symbols . • Given types X , Y , and Z we have the following combinators, called basic combinators : – id X : X → X – assoc X , Y , Z : ( X ⊗ Y ) ⊗ Z → X ⊗ ( Y ⊗ Z ) 61 – unassoc X , Y , Z : X ⊗ ( Y ⊗ Z ) → ( X ⊗ Y ) ⊗ Z – braid X , Y : X ⊗ Y → Y ⊗ X – left X : I ⊗ X → X – unleft X : X → I ⊗ X – right X : I ⊗ X → X – unrigh t X : X → I ⊗ X – ev al X , Y : X ⊗ ( X ⊸ Y ) → Y • If f : X → Y and g : Y → Z are comb inators, then ( g ◦ f ): X → Z is a combinato r . • If f : X → Y and g : X ′ → Y ′ are combinato rs, then ( f ⊗ g ) : X ⊗ X ′ → Y ⊗ Y ′ is a combin ator . • If f : X ⊗ Y → Z is a combin ator, then we can curry f to ob tain a combinator ˜ f : Y → ( X ⊸ Z ). It will g enerally cau se no co nfusion if we leave ou t the subscripts on the ba sic combin ators. F or example, we may write simply ‘assoc’ instead of assoc X , Y , Z . Third, a linear type theo ry has a set of terms of any given ty pe. As usual, we write t : X to say that t is a term of type X . T erms are defined inductively as follo ws: • For each type X there is a cou ntably infinite collection of variables of type X . If x is a variable of type X then x : X . • There is a term 1 with 1 : I . • If s : X an d t : Y , then there is a term ( s ⊗ t ) with ( s ⊗ t ) : X ⊗ Y , as long a s no variable appear s in both s and t . • If f : X → Y is a combinator and t : X th en there is a term f ( t ) with f ( t ) : X . Note that any gi ven variable may appear at most once in a term. Fourth an d fin ally , a linear type th eory h as rewrite rules go ing b etween terms of the same type. As in ou r treatment of the typ ed lam bda calculus, we on ly car e here abo ut the e quiv alence r elation ∼ gener ated by these rewrite r ules. This equi valence relation must have all the proper ties listed below . In what follows , we say a t erm is basic if it contains no comb inators. Such a term i s just an iterated tensor produ ct of distinct v ariables, such as ( z ⊗ ( ( x ⊗ y ) ⊗ w )) . These are the prop erties that the equ iv alence relation ∼ must have: • If t ∼ t ′ then t and t ′ must be terms of the same type, containing the same variables. • The equivalence relation is substitutive : – Giv en terms s ∼ s ′ , a variable x of type X , and terms t ∼ t ′ of typ e X whose v ariables appe ar in neither s nor s ′ , then s [ t / x ] ∼ s ′ [ t ′ / x ]. 62 – Giv en a b asic term t with the same typ e as a variable x , if no ne o f the variables o f t app ear in the terms s or s ′ , and s [ t / x ] ∼ s ′ [ t / x ], then s ∼ s ′ . • The equiv alence relation is ext ensional : if f : X ⊸ Y , g : X ⊸ Y an d eval ( t ⊗ f ) = ev al( t ⊗ g ) fo r all basic terms t : X , then f = g . • W e h av e: – id( s ) ∼ s – ( g ◦ f )( s ) ∼ g ( f ( s )) – ( f ⊗ g )( s ⊗ t ) ∼ ( f ( s ) ⊗ g ( t )) – assoc(( s ⊗ t ) ⊗ u ) ∼ ( s ⊗ ( t ⊗ u )) – unassoc( s ⊗ ( t ⊗ u )) ∼ ( ( s ⊗ t ) ⊗ u ) – braid( s ⊗ t ) ∼ ( t ⊗ s ) – left(1 ⊗ s ) ∼ s – unleft( s ) ∼ (1 ⊗ s ) – right(1 ⊗ s ) ∼ s – unrigh t( s ) ∼ (1 ⊗ s ) – ev al( s ⊗ ˜ f ( t )) ∼ f ( s ⊗ t ) Note th at term s can have variables appearing anywher e within th em. For example, if x , y , z are variables of types X , Y and Z , and f : Y ⊗ Z → W is a f unction symbol, then braid( x ⊗ f ( y ⊗ z )) is a term o f typ e W ⊗ X . However , ev ery term t is equivalent to a term of the form cp( t )(vp( t )), where cp ( t ) is the combinator part of t and vp( t ) is a b asic term called the variable part o f t . For example, the above term is equiv alent to braid ◦ (id ⊗ ( f ◦ (id ⊗ id)))( x ⊗ ( y ⊗ z )) . The combinator and variable parts can be compu ted inductiv ely as follows : • If x is a variable of type X , cp( x ) = id: X → X . • cp(1) = id: I → I . • For any terms s and t , cp( s ⊗ t ) = cp( s ) ⊗ cp( t ). • For any term s : X and any combinato r f : X → Y , c p( f ( s )) = f ◦ cp( s ). • If x is a variable of type X , vp( x ) = x . • vp(1) = 1. • For any terms s and t , v p( s ⊗ t ) = vp( s ) ⊗ vp( t ) . 63 • For any term s : X and any combinato r f : X → Y , v p( f ( s )) = vp( s ). Now , suppose that we have a lin ear type theory . Am bler’ s first main result is this: th ere is a symm etric monoid al category where o bjects ar e typ es and mo rphisms are equivalence classes of comb inators. T he e quiv- alence r elation o n combina tors is defined as f ollows: two co mbinator s f , g : X → Y are equ iv alent if and o nly if f ( t ) ∼ g ( t ) for some b asic term t of type X . In fact, Am bler sh ows that f ( t ) ∼ g ( t ) for some ba sic te rm t : X if and only if f ( t ) ∼ g ( t ) for all such basic terms. Ambler’ s second main result describes how we can build a lin ear type the ory from any closed symmetric monoid al category , say C . Sup pose C has co mposition  , tensor p roduc t • , in ternal hom  , and unit ob ject ι . W e let the b asic types of ou r line ar type theo ry b e the objects of C . W e take a s equatio ns betwe en ty pes those generated by: • ι = I • A • B = A ⊗ B • A  B = A ⊸ B W e let the function symbols b e all the morph isms of C . W e take as our equivalence relation o n ter ms the smallest allowed equivalence relation such that: • 1 A ( x ) ∼ A • ( g  f )( x ) ∼ g ( f ( x )) • ( f • g )( x ⊗ y ) ∼ ( f ( x ) ⊗ g ( y )) • a A , B , C (( x ⊗ y ) ⊗ z ) ∼ ( x ⊗ ( y ⊗ z )) • b A , B ( x ⊗ y ) ∼ ( y ⊗ x ) • l A (1 ⊗ x ) ∼ x • r A ( x ⊗ 1) ∼ x • ev A , B ( x ⊗ ˜ f ( y )) ∼ f ( x ⊗ y ) Then we define • id = 1 • assoc = a • unassoc = a − 1 • braid = b • left = l 64 • unleft = l − 1 • right = r • unleft = r − 1 • ev al = ev • g ◦ f = g  f and we’ re done! Ambler also shows that this pro cedure is the ‘inverse’ of his pro cedure fo r tu rning lin ear type theories into closed sym metric m onoid al categories. Mor e pr ecisely , he describes a category o f clo sed symmetric m onoidal categories (which is well-known), and also a category of linear type theories. He con structs func tors goin g back and fo rth between these, based o n th e p rocedu res we have sketched, and shows that these f unctors a re inverses up to natural isomorphism. So , these categories are ‘equiv alent’. In this section we have fo cused on closed symmetric monoida l categories. What abou t closed categories that are just br aided monoida l, o r merely mon oidal? While we have no t checked the details, we suspect that p ro- grammin g langu ages suited to these kinds of categories can be obtained from Ambler’ s formalism by removing various features. T o get the braided monoidal case, the obvious guess is to remove Ambler’ s r ewrite rule for the ‘braid’ combin ator and add two re write rules corresponding to the hexag on equations (see Section 2.4 for the se). T o get the monoidal case, the o bvious guess is to completely remove the combin ator ‘braid’ and all rewrite rules in volving it. I n fact, Jay [53] gave a languag e suitab le fo r closed monoid al categor ies in 19 89; Ambler ’ s work is based on this. 5 Conclusions In this pa per we sketched how category theory can serve to clarify the an alogies between physics, topolo gy , logic and co mputation . Each field has its own con cept of ‘thing’ (o bject) and ‘p rocess’ (morp hism) — and these thing s and p rocesses are o rganized into categories that share many commo n fe atures. T o keep our task manageab le, we focused on tho se features that ar e present in ev ery closed symm etric monoid al cate gor y . T able 4, an expanded v ersion of the Rosetta Stone, shows s ome of the analo gies we found. Howe ver , we o nly scratche d the surface! The re is m uch m ore to say a bout categories equippe d with extra structure, and how we can use them to strength en the ties betwee n p hysics, topolog y , lo gic and comp utation — not to men tion what happens wh en we go from categories to n -c ategories. But the real fun starts when we exploit these analogies to co me up with new ideas and surpr ising connections. Here is an example. In the late 1 980s, W itten [ 99] re alized that strin g theor y was deep ly connected to a 3 d topo logical quan tum field th eory a nd thu s the theor y of knots an d tangles [65]. This led to a huge explo sion of work, which was ultimately distilled in to a beautif ul bod y of results focu sed o n a ce rtain c lass of compac t braided monoid al categories called ‘modular tensor categories’ [16, 97]. All th is m ight seem of p urely th eoretical inter est, were it n ot fo r th e fact that supe rcondu cting thin films in magnetic fields seem to display an e ff ect — th e ‘fractio nal quantum Hall e ff ect’ — that c an be n icely modelled 65 Category Theory Phy sics T opolo gy Logic Computation object X Hilbert space X manifold X proposition X data type X morph ism operator cobord ism proof progr am f : X → Y f : X → Y f : X → Y f : X → Y f : X → Y tensor prod uct Hilber t space disjoint union conjunc tion produ ct of objects: of joint system: of manifold s: of propo sitions: of data types: X ⊗ Y X ⊗ Y X ⊗ Y X ⊗ Y X ⊗ Y tensor prod uct of par allel disjoint union of proof s carried out programs e xecuting morph isms: f ⊗ g proc esses: f ⊗ g cob ordisms: f ⊗ g in parallel: f ⊗ g in parallel: f ⊗ g internal hom: Hilbert space of disjoint union of condition al function type: X ⊸ Y ‘anti- X and Y ’: orientation-reversed pr oposition : X ⊸ Y X ∗ ⊗ Y X and Y : X ∗ ⊗ Y X ⊸ Y T able 4: The Rosetta Stone (larger version) with the h elp of such categor ies [9 2, 93]. I n a nu tshell, th e idea is th at excitations of the se films can act like particles, called ‘anyons’. When two anyons trade places, the result depends on ho w they go about it: , So, collection s of anyons are described by o bjects in a b raided mono idal ca tegory! The details d epend o n things like the streng th of the mag netic field; the range o f possibilities c an b e worked out with the help of modular tensor categories [76, 79]. So far this is a ll abo ut physics and to polog y . Com putation enter ed the game ar ound 2000 , when Freed man, Kitaev , Larsen and W ang [41] showed that certain systems of anyons could functio n as ‘universal quantum computer s’. This means th at, in pr inciple, arbitrar y computations can be car ried out by movin g anyons around. Doing th is in practice will be far from easy . Howe ver , Micr osoft ha s set up a research unit called Project Q attempting to do just this. After all, a working quantum computer could ha ve huge practical consequence s. But regardless of whether to polog ical qu antum computation e ver becomes practical, the implications are marvelous. A simple diag ram lik e this: can now be seen as a qua ntum pr ocess , a ta n gle , a co m p utation — or an abstrac t morph ism in any braided monoid al categor y! This is just the so rt of thing on e would ho pe for in a general scien ce of systems and processes. 66 Acknowledgeme nts W e owe a lo t to participan ts of th e seminar at UCR where some of th is material was first pr esented: especially David Ellerman, Larry Harp er , T om Payne — and Dere k Wise, who took notes [1 2]. This pa per was also vastly improved b y co mments b y Andrej Bauer, Tim Chevalier , Derek Elkins, Greg Fried man, Matt Hellige, Robin Hou ston, The o Johnso n–Freyd, J ¨ urgen K oslowski, T odd T rimble, Dave T weed , an d o ther regular s at the n -Category Caf ´ e . MS would like to thank Go ogle fo r letting h im devote 20 % o f his time to this re search, and Ken Shirri ff for help ful cor rections. This work was suppo rted by the National Science Foundatio n under Grant No. 06536 46. Refer ences [1] H. Abelson, G. J. Sussman and J. S ussman, Structure a nd Interpretatio n of Computer Pro grams , MIT Press, 1996. A vailable at http: // mitp ress.mit.edu / sicp / . [2] S. Abram sky , Ab stract scalars, loops, and free tr aced and strong ly comp act clo sed categories, in Pro- ceedings o f CALCO 20 05 , Lectu re N otes in Comp uter Scien ce 3629 , Sp ringer, Berlin, 200 5, 1–3 1. Also av ailable at http: // web.comlab.ox.ac.uk / oucl / work / samson.abramsk y / calco05.pdf . [3] S. Abramsky an d B . Coecke, A categorical semantics of quantum protocols, available at arXiv:quant-ph / 0 4021 30 . [4] S. Abr amsky and R. Du ncan, A categorical quantum lo gic, to ap pear in Mathematical Stru ctures in Com - puter Science , 2006. Also a vailable as arXiv:quant-p h / 051 2114 . [5] S. Ab ramsky , E. Hagh verdi and P . Sco tt, Geo metry o f in teraction an d linear comb inatory algebras, Math. Struct. Comp. Sci. 12 (2002 ), 625–665. Also available at http: // citeseer .ist.psu.edu / 4916 23.html . [6] S. Abr amsky and N. Tzevelokos, Intr oductio n to categor ies and categor ical logic, in this volume. Also av ailable at http: // we b .comlab.ox.ac.uk / people / Bob .Coecke / AbrNikos.pdf . [7] S. Ambler , First order logic in symmetr ic monoidal closed categories, Ph.D. thesis, U. of Edin burgh, 1991. A vailable at http: // www .lfcs.inf.ed.ac.u k / reports / 92 / ECS-LFCS-92-194 / . [8] M. F . Atiyah , T opological quantum field theories, Publ. Math. IHES Paris 68 (1989 ), 175–186. M. F . Atiyah , The Geometry and Physics of Knots , Cambridge U. Press, Cambridge, 1990. [9] J. Baez, An introdu ction to spin foam models of quantum gravity and B F theor y , in Geometry and Quantum Physics , eds. H. Gausterer and H. Gr osse, Sprin ger, Berlin, 2000 , pp. 25– 93. Also available at arXiv:gr-qc / 99050 87 . [10] J. Baez, Highe r-dimensional algebra and Planck-scale physics, in Physics Meets Philosophy at the Planck Length , eds. C. Callender and N. Huggett, Cambrid ge U. Press, Cambrid ge, 200 1, pp . 17 7–19 5. Also av ailable as arXiv:gr-qc / 990201 7 . 67 [11] J. Baez, Qu antum quan daries: a categor y-theor etic perspective, in Structural Foundatio ns of Quantum Gravity , eds. S. French , D. Rickles and J. Saatsi, Oxford U . Press, Oxford, 2006, pp. 240 -265. Also av ailable as arXiv:quant-ph / 0404 040 . [12] J. Baez, Classical versus quantum computation, U. C . Riverside seminar notes by D. Wise. A vailable at http: // math .ucr .edu / ho me / baez / qg-fall2006 / and http: // math .ucr .edu / ho me / baez / qg-winter2007 . [13] J. Baez and J. Dolan , Higher-dimensional algebra and topological quantum field theory , Jour . Math. Phys. 36 (1995 ), 6073–6105 . Also available as arXiv:q-alg / 950 3002 . [14] J. Baez and L. Langford, Hig her-dimensional alg ebra IV : 2-tangles, Adv . Math. 180 (2003 ), 705 –764 . Also av ailable as arXiv:q-alg / 970 3033 . [15] J. Baez and A. Lau da, A p rehistory of n -categorical physics, to appear in proceed ings of Deep Beauty : Mathematical Innovation and the Search for an Underlying In telligibility of the Q uantum W orld , Princeton, October 3, 200 7, ed. Hans Halvorson. Also av ailable at h ttp: // math .ucr .edu / hom e / baez / history .pdf . [16] B. Bakalov an d A. Kirillov , Jr ., Lectures on T en sor Categories and Modular Fun ctors , Amer- ican Mathematical Society , Providence, Rho de Island, 2001. Preliminary version available at http: // www .math.sunysb.edu / ∼ kirillov / ten sor / tensor .html . [17] H. Bare ndregt, The Lambda Calculus, its Syntax and Semantics , North–Hollan d, Amsterdam, 1984 . [18] M. Barr and C. W ells, T oposes, T riples and The ories , Spring er V erlag, Berlin, 1983. R evised and corre cted version a vailable at h ttp: // www .cwru.edu / artsci / math / wells / pub / ttt.html . [19] J. S. Bell, O n the Einstein-Podolsky-Rosen paradox, Physics 1 (1964), 195–20 0. [20] J. L . Bell, The Dev elopm ent of C ategorical Logic , a vailable at http: // pu blish.uwo.ca / ∼ jb ell / catlogprime.pdf . [21] N. Benton, G. M. Bierman, V . de Pai va and J. M. E. Hyland, Linear lambd a-calculus and categorical mod els revisited, in Computer Science Logic (CSL ’92) , Selected Papers , Lecture Notes in Computer Science 702 , Springer, Berlin, 199 2, pp. 61–84. Also av ailable at http: // citeseer .ist.psu.edu / ben ton92linear .html [22] N. Benton , G. Bierm an, V . de Pai va and M. Hy land, T erm Assignmen t for Intuition istic Linear Log ic , T ech nical Rep ort 262 , University of Cambrid ge Comp uter Lab oratory , Augu st 199 2. Also available at http: // citeseer .ist.psu.edu / 1273 .html . [23] G. Bierm an, On Intuition istic Lin ear Logic , PhD Thesis, Cam bridge U niversity . A vailable at http: // resear ch.micro soft.com / ∼ gmb / Papers / thesis.pdf . [24] R. Blute and P . Scott, Category theor y for linea r logic ians, in Linear Lo gic in Compu ter Scien ce , e ds. T . Ehrhar d, J .-Y . Girard , P . Ruet, P . Scott, Cambr idge U. Press, C ambr idge, 2004, pp. 3–64. Als o available at http: // www .site.uottawa.ca / ∼ phil / pap ers / catsurv . web .pdf . [25] S. N. Bur ris and H. P . Sankapp anav ar, A Cour se in Universal Algebra , Springer, B erlin, 1 981. Also av ail- able at http: // www .math.uwaterloo .ca / ∼ snburris / htdocs / ualg.html . [26] V . Char i and A. Pressley , A Guide to Quantum Group s , Cambridg e Uni versity Press, Cambridge, 1995. 68 [27] E. Cheng and A. L auda, Higher-Dimensional Categories: an Illu strated Guideb ook . A vailable at http: // www .dpmms.cam .ac.uk / ∼ elgc2 / guidebook / . [28] M. A. Nielsen and I . L. Chuang , Quantum Comp utation an d Quantu m Inf ormation , Cambridg e U. Pre ss, Cambridge, 2000 . [29] A. Chu rch, An unsolvable prob lem of elementary number theory , Amer . Jour . Math. 58 (1936 ), 345–3 63. [30] B. Coecke, De-linearizing linearity: pr ojective quantum a xiomatics from strong compact closur e, Proceed- ings of the 3rd Inter national W orksho p on Quantum Prog ramming Lang uages (QPL 2005) , Else vier, 2007, pp. 49–7 2. Also a vailable as arXiv:quant-p h / 050 6134 . [31] B. Coecke, K indergarten qu antum m echanics, to appear in Proceeding s o f QTRF-III . Also available as arXiv:quant-ph / 0 5100 32 . [32] B. Coecke and E. O. Paquette, PO VMs and Naimark ’ s theo rem without su ms, to appear in Proceeding s of the 4th In ternationa l W ork shop on Qu antum Pro grammin g Lang uages (QPL 20 06) . Also available as arXiv:quant-ph / 0 6080 72 . [33] B. Coecke and D. Pavlovic, Quantu m m easurements without sums, to appear in The Mathematics of Quan- tum Computation and T ech nology , eds. Chen, Kau ff man an d Lomo naco, T ay lor and Francis. Also available as arXiv:quant-ph / 0608 035 . [34] R. L . Crole, Categories for T ypes , Cambridge U. Press, Cambridge, 1993. [35] H. B. Cu rry and R. Feys, Combinator y Logic , V ol. I, North–Holland, Amsterdam, 1958. H. B. Curry , J. R. Findley an d J. P . Selding, Combinator y Logic , V ol. II, Nor th–Holland , Amsterdam, 1972. [36] P . Cvitanovic, Group Theory , Princeton U. P ress, Princ eton, 2003. A vailable at http: // www .nbi.dk / Group Theory / . [37] R. D i Cosmo and D. Miller, Line ar log ic, Stanford Encycloped ia of Philosop hy , a vailable at http: // plato .stanford .edu / e ntries / logic-linear / [38] M. Do rca and A. van T onder , Quantu m compu tation, categorical seman tics and linear logic, av ailable as arXiv:quant-ph / 0 3121 74 . [39] S. Eilenb erg and G. M. K elly , Closed cate gories, in Proceeding s of the Conferen ce on Cate gor ical Algeb ra (La Jolla, 196 5) , Spring er , B erlin, 19 66, pp. 421–562 . [40] S. Eilenb erg and S. Mac Lane, General theory of natural equi valences, T rans. Amer . Math. Soc. 58 (1 945), 231–2 94. [41] M. Freedm an, A. Kitaev , M. Larsen and Z. W an g, T op ological quan tum computa tion, available as arXiv:quant-ph / 0 1010 25 . M. Freedma n, A. Kitaev an d Z . W ang, Simulation of topologic al field theo ries by q uantum computers, Comm. Math. Phys. 227 (200 2), 587–603. Also av ailable as arXiv:quant-p h / 00 01071 . M. Fre edman, A. Kitaev and Z. W ang, A modular functor wh ich is un iv ersal for q uantum compu tation, Comm. Math. Phys. 227 (200 2), 605–622. Also av ailable as arXiv:quant-p h / 00 01108 . 69 [42] P . Fr eyd and D. Y etter , Braided compac t monoid al categories with ap plications to low dimensional to pol- ogy , Adv . Math. 77 (1989), 156–182 . [43] J.-Y . G irard, Linear logic, Theor . Comp. Sci. 50 (1987 ), 1–102. Also available at http: // iml.u niv-mrs.fr / girard / line ar .pdf . [44] J.-Y . Girard , Y . Laf ont and P . T aylor, Proofs and T ypes , Cambr idge U. Press, Cambridge, 199 0. Also av ailable at http: // www .monad. me.uk / stable / Proofs%2BT y pes.html . [45] K. G ¨ odel, Zur intuition istischen Arith metik u nd Zahlenth eorie, Ergebnisse eines m athematischen K ollo- quiums 4 (1933), 34–38. [46] R. Goldblatt, T opoi: the Categorial Analysis of Logic , North–Hollan d, Ne w Y ork, 1984. Also available at http: // cdl. library .cornell.ed u / cgi-bin / cul.math / docviewer ?did = Gold010 . [47] D. Go ttesman and I. L. Chuang, Quantu m teleportation is a universal computatio nal prim iti ve, Nature 402 (1999 ), 390–393. Als o available as arXiv:quant-ph / 9 9080 10 . [48] M. Hasegawa, Logical predicates for in tuitionistic linear type theo ries, T yped Lambda Calculi and Appli- cations: 4th Intern ational Confe rence, TLCA ’99 , ed. J.-Y . Girard, Lecture Notes in Computer Science 1581 , Springe r , B erlin, 19 99. Also a vailable at http: // citeseer .ist.psu.edu / 18 7161.html . [49] A. Heyting , ed. , L. E. J. Brouwe r: Collected W or ks 1 : Philosop hy and Foun dations o f Mathem atics , Elsevier , Amsterdam, 1975. [50] B. Hilken, T o wards a pro of theory of r ewriting: the sim ply-typ ed 2 λ -calculus, Theor . Comp. Sci. 170 (1996 ), 407–444. [51] J. R. Hindley and J. P . Seldin, Lambda- Calculus and Combinato rs: An Intro duction , Cambridg e U. Press, Cambridge, 2008 . [52] W . A. Howard, The for mulae-as-ty pes notion of constructions, in T o H. B. Curry: Essays on Combinatory Logic, La mbda Calculus and Formalism , eds. J. P . Seldin and J. R. Hindley , Academic Press, New Y ork, 1980, pp. 479 –490 . [53] C. B. Jay , Languag es for mon oidal cate gor ies, Jour . Pure Appl. Alg. 59 (1989), 61–85. [54] C. B. Jay , The structure of free closed categories, Jour . Pure App l. Alg. 66 (1990 ), 271–285. [55] A. Joyal and R. Street, The geo metry of tensor calculus I, Adv . Math. 88 (1991 ), 55–113. A. Joyal and R. Street, The geometry of tensor calculus II. A vailable at http: // www .math.mq. edu.au / street / GTCII.pdf. [56] A. Joyal a nd R. Street, Braided m onoid al categories, Macquarie Math Reports 86008 1 ( 1986 ). A v ailable at http: // rutherglen. ics.mq.edu.au / ∼ street / JS86.pdf . A. Joyal and R. Street, Braided tensor categories, Adv . Math. 102 (1993), 20–78. [57] D. Kaiser , Drawing T heories Apart: T he Dispersion of Feynman Diagrams in Postwar Physics , U. Chicago Press, Chicago, 2005. [58] C. Kassel, Quantum Group s , Springer , B erlin, 19 95. 70 [59] L. H. Kau ff man, Knots and Physics , W orld Scientific, Singapo re, 1991 . [60] L. H. Kau ff man and S. Lins, T emp erley–Lieb Recoupling Theory and In variants of 3-Manifolds , Princ eton U. Press, Princeton , 1994. [61] G. M. Kelly and S. Mac Lane, C oher ence in closed cate gories, Jour . Pure Appl. Alg. 1 ( 1971) , 97–14 0 an d 219. [62] G. M. K elly and M. L . Laplaza, Coherence for compact closed categories, Jour . Pure Appl. Alg . 19 (1 980), 193–2 13. [63] S. K leene, λ -definab ility and recu rsiv eness, Duke Math. Jour . 2 (1936), 340–35 3. [64] J. K ock, Frobeniu s Algebras and 2D T opological Quantum Field Th eories , London Mathematical Society Student T exts 59 , Cambrid ge U. Press, Cambridge, 2004. [65] T . K ohno, ed., New Developments in the Th eory of Knots , W orld Scientific, Singapore, 1990. [66] J. L ambek, From λ -calculus to cartesian closed categories, in T o H. B. Curry : Essays on Combin atory Logic, La mbda Calculus and Formalism , eds. J. P . Seldin and J. R. Hindley , Academic Press, New Y ork, 1980, pp. 375 –402 . [67] J. Lambek and P . J. Sco tt, Introd uction to Higher-order Categorical Log ic , Cambridg e U. Press, Cambridg e, 1986. [68] P . Lan din, A correspon dence between ALGOL 60 and Chur ch’ s lambda-notation, Comm. A CM 8 (196 5), 89–10 1, 158–165. [69] F . W . Lawvere, Functorial Semantics of Algeb raic Theories , Ph.D. Dissertatio n, Colu mbia University , 1963. Also av ailable at http: // www .tac.mta.ca / tac / r eprints / articles / 5 / tr5abs.html . [70] T . Leinster, A survey o f definition s o f n -category , Th. App l. Cat. 10 (20 02), 1–70. A lso av ailable as arXiv:math / 0107 188 . [71] S. M ac Lane, Natural associativity and com mutativity , Rice Univ . Stud. 49 (1963 ) 28– 46. [72] S. M ac Lane, Categories for the W o rking Mathem atician , Spring er , B erlin, 19 98. [73] P . Melli ` es, Axiomatic rewriting th eory I : a d iagramma tic standardisation theor em, in Processes, T erms and Cycles: Steps o n the Road to In finity , Lecture Notes in Com puter Science 383 8 , Spring er , 2 005, pp. 554–6 38. Also a vailable at http : // www .pps.jussieu.fr / mellies / paper s / jwkfestschrift.p df . [74] J. McCarthy , Recursi ve fun ctions of symb olic expr essions and their computation by machine, Part I, Comm. A CM 4 (1960), 184–19 5. Also av ailable at http: // www-f ormal.stanf ord.edu / jmc / recursive .html . [75] C. Mc Larty , Elementary Categories, Elementary T oposes , Clarendon Press, Oxford, 1995. [76] G. Mo ore an d N. Read , Nonabe lions in the th e fractional q uantum Ha ll e ff ect, Nucl. Ph ys. B 360 (1 991), 362–3 96. [77] J. M oschovakis, Intuitionistic logic, Stanford Encycloped ia of Philosophy , av ailable at http: // plato .stanford .edu / e ntries / logic-intuitionistic / . 71 [78] R. Penrose, A pplications of n egativ e dimensional tensors, in Combinator ial Mathematics and its Ap plica- tions , ed. D. W elsh. Academ ic Press, 1971, pp. 221–244. R. Penrose, Ang ular mome ntum: an appro ach to co mbinato rial spac e-time, in Quantum Theory and Be- yond , ed. T . Bastin. Cambridge U. Press, 1971, pp. 151–1 80. R. Penro se, On the natu re of quantum geom etry , in Magic W ithou t Magic , ed. J. Klauder, Freeman, 1972, pp. 333– 354. R. Penro se, Combina torial quantum theor y and quantized dir ections, in Advances in T wistor Th eory , eds. L. Hugh ston and R. W ar d, Pitman Advanced P ublishin g Program, 1979, pp. 301–31 7. [79] E. Rowell, R. Stong a nd Z. W ang , On classification of modular tensor categories, av ailable as arXiv:0712.137 7 . [80] P . Scott, Some asp ects of categories in compu ter science, in Handbo ok of Algeb ra , V ol. 2 , ed. M. Hazewinkel, Els evier , Amsterdam, 2000. Also a vailable at http: // www .site.uottawa.ca / p hil / pap ers / hand book.ps . [81] S. Sawin, Links, q uantum gr oups and TQFTs, Bull. Amer . Math. Soc. 33 (19 96), 413-4 45. Also av ailable as arXiv:q-alg / 95 06002 . [82] A. Sch alk, What is a categorical model for linear logic? A v ailable at http: // www .cs.man.ac.u k / ∼ schalk / notes / llmodel.pdf . [83] M. Sch ¨ onfinkel, ¨ Uber die Bausteine d er mathem atischen Logik, Math. An n. 92 (19 24), 30 5–316 . Also av ailable as On the building blocks of mathem atical logic, trans. S. Bauer-Menge lberg, i n A Source Book in Mathem atical Lo gic, 1 879- 1931 , ed . J. v an Heijenoo rt, Harvard U. Press, Cambridge, Massachusetts, 1967, pp. 355 –366 . [84] R. A. G. Seely , W eak ad jointness in pro of theory , Applications of Sheaves , Lecture Notes in Math ematics 753 , Springer, Berlin, 697– 701. Also av ailable at http: // www .math.mcg ill.ca / rags / WkAd j / adj.pdf . R. A. G. Seely , M odeling com putation s: a 2-categor ical fr amework, in Proc. Sym p. Logic Comp. Sci. 1987 , Computer Society of the IEEE, pp. 65–71. Also a vailable at http: // www .math.mcg ill.ca / rags / WkAd j / LICS.pdf . [85] G. Segal, T he definition of a confor mal field theory , in T opolo gy , Geometr y a nd Quantum Field Theory : Proceeding s of the 20 02 Oxf ord Sympo sium in Honou r of the 6 0th Birthda y o f Graeme Segal, ed. U. L. T illmann, Cambridg e U. Press, 2004. [86] P . Selinger, Lecture notes on the lambda calculus, av ailable at http: // www .mscs.dal.ca / ∼ seling er / pap ers / #lambdanotes . [87] P . Selinger , Dagger compac t closed cate gor ies and completely positi ve maps, Proceeding s of the 3rd Inter- national W orksh op on Quantum Progr amming Languages (QPL 2005) , Else vier , 2007 , pp. 139–163 . Also av ailable at http: // www .mscs.dal.ca / ∼ selinger / p apers / #dagger . [88] P . Selin ger and B. V aliron, A lambd a calculus for qua ntum compu tation with classical control, Math. Struct. Comp. Sci. 13 (2006 ), 527–552. Also available at http: // www .mathstat.dal.ca / ∼ selinger / p apers / #qlambda . 72 [89] M. -C. Shum, T ortile tensor categories, Jour . Pure Appl. Alg. 93 (1994 ), 57–11 0. [90] S. So loviev , Proof of a conjecture of S. Mac Lane, Ann. Pure Appl. Logic 90 (1997 ), 101–162. [91] L. Smolin, The future of spin networks, The Geo metric Un iv erse: Scien ce, Geometry , an d the W ork of Roger Penr ose , eds. S. Hugget, P . T od, and L. J. Maso n, Oxford U. Press, Oxf ord, 1998. Also av ailable as arXiv:gr -qc / 97020 30 . [92] A. Stern , Anyons and the qua ntum Hall e ff ect – a ped agogica l review , Ann. Phy s. 323 (2008 ), 204– 249. av ailable as arXiv:0711.46 97 . [93] M. Stone, ed., Quantum Hall E ff ect , W o rld Scientific, Singap ore, 1992. [94] M. E. Szabo, ed., Collected Papers of Gerhard Gentzen , North–Holland, Amsterdam, 1969. [95] T . Trimble, Linear Lo gic, Bimodules, an d Fu ll Cohe rence fo r Auton omou s Cate gor ies , Ph.D . thesis, Rut- gers University , 1994. [96] A. S. T roelstra, Lectures on Lin ear Logic , Center fo r the Study of Langu age an d Inform ation, Stanfo rd, California, 199 2. [97] V . G. Turae v , Quantum Inv ariants of Kno ts and 3-Manifold s , de Gruyter, Berlin, 1994. [98] A. van T ond er , A lambda calculus for quantum computation, SIAM Jour . Comput. 33 (2004 ), 1109–1135 . Also av ailable as a rXiv:quant-ph / 0 3071 50 . [99] E. W itten, Quantum field theory and the Jones polynom ial, Comm. Math. Phys. 121 (1989), 351–39 9. [100] W . K. W ootters and W . H. Zurek, A single quantum cannot be cloned, Nature 299 (1982), 802–80 3. [101] D. N. Y etter, Functorial Knot Theory : Categories of T angles, Coherence, Categorical Def ormation s, and T opolo gical In variants , W orld Scientific, Singap ore, 2001. 73

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment