in 2007 rob spekkens proposed a toy theory @xcite with the aim of showing that many of the characteristic features of quantum mechanics could result from a restriction on our knowledge of the state of an essentially classical system .
the theory describes a simple type of system which mimics many of the features of a quantum qubit .
the success of the toy theory in replicating characteristic quantum behaviour is , in one sense , quite puzzling , since the mathematical structures employed by the two theories are quite different .
quantum mechanics represents states of systems by vectors in a hilbert space , while processes undergone by systems are represented by linear maps .
in contrast , the toy theory represents states by subsets and processes by relations .
this ` incomparability ' means that the mathematical origins of the similarities ( and differences ) between the two theories are not easy to pinpoint .    in this paper
we consider the toy theory from a new perspective - by looking at the ` algebra ' of how the processes of the theory combine .
the mathematical structure formed by the composition of processes in any physical theory is a _
symmetric monoidal category _ @xcite , with the objects of the category representing systems , and the morphisms representing processes undergone by these systems - we term this the _ process category _ of the theory .
work initiated by abramsky and coecke @xcite , and continued by many other authors @xcite has investigated the structure of the process category of quantum mechanics .
mathematical structures of this category have been identified which correspond directly to key physical features of the theory . in principle , any theory whose processes form a category with these mathematical features should exhibit these quantum - like physical features .
it will be gratifying then to note that the process category of the toy theory shares many of these features , thus ` accounting for ' the similarities which this theory has with quantum mechanics .
the main aim of this paper is to characterise the process category of the toy theory .
this turns out to be less straightforward than one might have hoped ! in the case of quantum mechanics
it is straightforward to see that the states of a system correspond exactly with the vectors of the hilbert space describing that system , and that processes correspond exactly with linear maps ; thus we can immediately conclude that the process category of quantum mechanics is * hilb * , whose objects are hilbert spaces and whose morphisms are linear maps .
such a quick and easy statement of the process category for the toy theory is not possible .
this is due largely to the way that the valid states and processes of the theory are defined : this is via an inductive procedure where the valid states and transformations for a collection of @xmath0 systems must be known before those for a collection of @xmath1 systems can be deduced .
there is also a certain degree of ambiguity in the way in which the theory was originally stated , and , since the toy theory was never fully constructed ( until now ) , its consistency was not even guaranteed .
another feature which was not addressed in the theory is _ compositional closure _ _ , that is : _ if we compose two valid processes , either in parallel or sequentially ( when types match ) , do we again obtain a valid process ? _ obviously , this is a natural operational requirement , and as indicated above , this notion of compositional closure is the operational cornerstone to modelling physical processes in a symmetric monoidal category . in this paper , it is exactly the compositional closure assumption which allows us to formulate the toy theory in terms of no more than a few generators , with clear operational meanings . _ _ _ _ _    the structure of the paper is as follows .
we begin with a very brief summary of the toy bit theory , and a discussion of the ambiguities in its definition .
we then define a categories * spek * and * mspek * which we claim is the process category for the toy theory .
this is a sub - category of * rel * , whose objects are sets and whose morphisms are relations .
the next section is devoted to showing the general form of the relations which constitute the morphisms of * mspek*. we then go on to argue that these relations are exactly those which describe the processes of the toy theory , thus demonstrating that * mspek * is the process category of the toy theory .
finally we note some of the key categorical features of * mspek * and link these to the characteristically quantum behaviour exhibited by the toy bit theory .
the category * spek * was first proposed by us in @xcite , and we provide some explicit pointers to useful information therein throughout this text .
for full details of spekkens s toy bit theory , the reader is referred to the original paper @xcite . here
we provide a very brief summary of the key points .
there is just one type of elementary system in the theory , which can exist in one of four states .
we will denote the set of these four states , the _
ontic state space _ by @xmath2 .
alternatively we can depict it graphically as : @xmath3 the ontic states are to be distinguished from the _ epistemic _ states , which describe the extent of our knowledge about which ontic state the system occupies .
for example we might know that the system is either in ontic state 1 or 2 .
we would depict such an epistemic state in the following fashion : @xmath4 the epistemic state is intended to be the analogue of the quantum state .
note that an epistemic state is simply a subset of the ontic state space . given a composite system of @xmath1 elementary systems ,
its ontic state space is simply the cartesian product of the ontic state spaces of the composite systems , @xmath5 .
thus such a system has @xmath6 ontic states .
the key premise of the theory is that our knowledge of the ontic state is restricted in a specific way so that only certain epistemic states are allowed .
we refer the reader to the original paper for the full statement of this epistemic restriction , which spekkens refers to as the _ knowledge balance principle_. it suffices here to say that , given an @xmath1-component system , an epistemic state is a @xmath7 or @xmath8 element subset of the ontic state space , the @xmath9 case being the situation of maximal knowledge and the @xmath8 case being the situation of total ignorance .    for a single system
this means that there are six epistemic states of maximal knowledge : @xmath10 and one of non - maximal knowledge : @xmath11    a consequence of the knowledge balance principle is that any measurement on a system inevitably results in a probabilistic disturbance of that system s ontic state .
a measurement in the toy theory essentially corresponds to asking which of a collection of subsets of the ontic state space contains the ontic state .
an example would be a measurement on a single system corresponding to the question `` is the ontic state in the subset @xmath12 or the subset @xmath13 ? '' .
if the initial epistemic state of the system was the subset @xmath14 then answering this question would allow us to pin down the ontic state precisely , to 1 if we get the first answer or 3 if we get the second , in violation of the knowledge balance principle .
thus we hypothesise that if , for example , we get the first answer to our question , then the ontic state undergoes a random disturbance , either remaining in state 1 or moving into state 2 , with equal probability .
the epistemic state following the measurement then would be @xmath12 .
the effect of such a probabilistic disturbance on the _ epistemic _ state is best modelled by viewing it as a _ relation _ on the ontic state space , defined by @xmath15 , @xmath16 , @xmath17 , @xmath18 , where the notation denotes that the element 1 in the domain relates to both the elements 1 and 2 in the codomain , the element 2 in the domain , while the elements 3 and 4 in the domain relate to no elements in the codomain . below we will omit specification of those elements in the domain that relate to no elements in the codomain .
thus in general the transformations of the theory are described by _
relations_.    in his original paper spekkens derives the states and transformations allowed in the theory , apparently appealing only to the following three principles :    1
.   the epistemic state of any system must satisfy the knowledge balance principle globally i.e. it should be a @xmath7 or @xmath8 element subset of the ontic state space .
2 .   when considering a composite system , the ` marginal ' epistemic state of any subsystem should also satisfy the knowledge balance principle . by the marginal epistemic state we mean the following .
suppose the whole system has @xmath1 components , and we are interested in an @xmath19-component subsystem .
the epistemic state of the whole system will be some set of @xmath1-tuples : to get the marginal state on the @xmath19-component system we simply delete the @xmath20 entries from each tuple which correspond to the subsystems which are not of interest to us .
3 .   applying a valid transformation to a valid state should result in a valid state .
the second principle is used , for example , to rule this out as an epistemic state for a two - component system : @xmath21 the third principle is used extensively .
it is invoked to show that the transformations on a single element system constitute permutations on the set of ontic states , since any other function on @xmath22 would lead to some valid epistemic state being transformed into an invalid state .
another illuminating example of the third principle in action is the elimination of this state as a valid epistemic state : @xmath23 this state would be allowed by the first and second principles , but upon making a certain measurement on one of the systems , the resulting measurement disturbance would transform it into this state : @xmath24 which clearly fails to satisfy the first principle .
the mode of definition of the theory , via the three principles stated earlier , raises some interesting issues .
firstly , this approach seems to be necessarily iterative .
compare it , for example , to how we would describe the form of valid states in quantum mechanics - in one line we can say that they are the normalised vectors of the system s state space .
secondly , do these rules actually uniquely define the toy theory ?
there does seem to be a problem with the third rule .
when we use it to rule out the state in diagram [ ruledoutby3 ] , our argument is that we already know what the valid measurement disturbance transformations on a single elementary system are , and when we apply one of them to this state we obtain a state which clearly violates the knowledge balance principle .
however , it is not clear that we could not have made the alternative choice - that this state should be valid , and therefore that the transformation which we had previously thought was valid could no longer be considered as such .
it seems that considerations other than the three rules above come into deciding which should be the valid states of the theory , but it is nowhere clearly stated exactly what they are .
the second point touched slightly on our final issue : is the theory as spekkens presents it consistent ?
he derives valid states and transformations for systems with up to three elementary components .
however , can we be sure that these states and transformations , when combined in more complex situations involving four or more elementary systems , wo nt yield a state which clearly violates the knowledge balance principle ? currently there seems to be no such proof of consistency .
in fact , in the process of re - expressing the theory in categorical terms , we will develop such a proof .
we briefly review the key structural features of the process categories of quantum - like theories .
a physicist - friendly tutorial of the category theoretic preliminaries is in @xcite .
a survey on the recent applications of these to quantum theory and quantum information is in @xcite .
[ smcdef ] a _ symmetric monoidal category _
@xmath25 is a category equipped with the following extra structure : a bifunctor @xmath26 ; a _ unit object _
@xmath27 ; and four natural isomorphisms , left and right unit : @xmath28 , @xmath29 , associative : @xmath30 and commutative : @xmath31 .
furthermore these objects and natural isomorphisms obey a series of _ coherence conditions _ @xcite .
as argued in @xcite , the process category of any physical theory is a smc .
the bifunctor @xmath32 is interpreted as adjoining two systems to make a larger compound system .
* hilb * becomes a smc with the tensor product as the bifunctor , and @xmath33 as the unit object .
* rel * is a smc with the cartesian product as the bifunctor and the single element set as the unit object .
there is a very useful graphical language for describing smcs , due to joyal and street @xcite , which we will make extensive use of .
it traces back to penrose s earlier diagrammatic notation for abstract tensors @xcite .    in this language
we represent a morphism @xmath34 by a box : @xmath35 @xmath36 , the composition of morphisms @xmath37 and @xmath38 is depicted as : @xmath39 the identity morphism @xmath40 is actually just written as a straight line  this makes sense if you imagine composing it with another morphism .
turning to the symmetric monoidal structure , a morphism @xmath41 is depicted : @xmath42 and if @xmath34 and @xmath43 then @xmath44 is depicted as : @xmath45 the identity object @xmath27 is not actually depicted in the graphical language .
morphisms @xmath46 and @xmath47 are written as : @xmath48 the associativity and left and right unit natural isomorphisms are also implicit in the language .
the symmetry natural isomorphism is depicted as : @xmath49 in fact the graphical language is more than just a useful tool ; it enables one to derive all equational statements that follow from the axioms of a smc :    two morphisms in a symmetric monoidal category can be shown to be equal using the axioms of a smc iff the diagrams corresponding to these morphisms in the graphical language are isomorphic , where by diagram isomorphism we mean that the boxes and wires of the first are in bijective correspondence with the second , preserving the connections between boxes and wires .    the categories described by the graphical language are in fact _ strict smcs , that is , those for which @xmath50 , @xmath51 and @xmath52 are equalities .
mac lane s _ strictification theorem @xcite , which establishes an equivalence of any smc with a strict one , enables one to apply the diagrammatic notation to any smc . _
_    we will often refer to morphisms of type @xmath46 as _ states _
, since in a process category they represent the preparation of a system @xmath53 in a given state .
in * hilb * such morphisms are in bijection with the vectors of the hilbert space @xmath53 ; in * rel * they correspond to subsets of the set @xmath53 .
the process categories of _ quantum - like _ theories possess a range of additional structures .
a _ dagger category _ is a category equipped with a contravariant involutive identity - on - objects functor @xmath54 .
dagger symmetric monoidal category _ ( @xmath55-smc ) is a symmetric monoidal category with a dagger functor such that : @xmath56 , @xmath57 , @xmath58 , @xmath59 , and @xmath60 .    *
hilb * is a @xmath55-smc with the _ adjoint _ playing the role of the dagger functor .
* rel * is a @xmath55-smc with _ relational converse _ as the dagger functor .
[ csdef ] in a smc @xmath61 a _ compact structure _ on an object @xmath53 is a tuple @xmath62 where @xmath63 is a dual object to @xmath53 which may or may not be equal to @xmath53 , and @xmath64 and @xmath65 satisfy the conditions : @xmath66 and the dual diagram for @xmath67 .
a _ compact closed _
category @xmath61 is a smc in which all @xmath68 have compact structures .
* hilb * is a compact closed category , where for each object @xmath53 the _ bell - state _
ket @xmath69 ( with @xmath70 a basis for the hilbert space @xmath53 ) familiar from quantum mechanics provides the morphism @xmath64 , and the corresponding bra acts as @xmath65 .
perhaps unsurprisingly , given this example , abramsky and coecke in @xcite showed that this structure underlies the capacity of any quantum - like theory to exhibit information processing protocols such as _ teleportation _ and _ entanglement swapping_. furthermore abramsky has shown @xcite that any theory whose process category is compact closed will obey a generalised version of the no - cloning theorem .    for the compact structures of interest in this paper @xmath71
is always equal to @xmath53  see proposition [ inducedcsprop ] below . hence , from here on we wo nt distinguish these two objects .
this simplifies the graphical language , which can be extended by introducing special elements to represent the morphisms of the compact structure @xmath64 and @xmath65 : @xmath72 equation [ cccomdiag ] and its dual are then depicted as : @xmath73 this extension of the graphical language now renders it completely equivalent to the axioms of a compact closed category ; for a detailed discussion we refer to @xcite .
two morphisms in a compact closed category can be shown to be equal using the axioms of compact closure iff the diagrams corresponding to these morphisms in the graphical language are isotopic .
compact closure is of particular importance to us since in any compact closed category there will be _ map - state duality _ : a bijection between the hom - sets @xmath74 and @xmath75 ( in fact both these will further be in bijection with @xmath76 ) : @xmath77 and @xmath78 that this is a bijection follows from equation [ yanking ] .
if we have a morphism with larger composite domain and codomain the number of hom - sets in bijection increases dramatically .
for example the morphisms of the hom - sets @xmath79 and @xmath80 are in bijection : explicitly the conversion between morphisms from the two sets can be depicted as : @xmath81 clearly manoeuvres like this can convert any ` input ' line into an ` output ' line , by using the unit and co - unit morphisms to ` bend lines around ' .
[ decdef ] a _ _ diagram equivalence class _ _ ( dec ) is a set of morphisms in a compact closed category which can be inter - converted by composition with the units and co - units of the factors of their domains and codomains .
the final structure of interest is the _ basis structure _ , which can be seen as the ` dagger - variant ' of carboni and walters s frobenius algebras @xcite .
this structure is discussed at length in @xcite .
[ bsdef ] in a @xmath55-smc a _ basis structure _
@xmath82 on an object @xmath53 is a commutative isometric dagger frobenius comonoid @xmath83 . for more details on this definition
see section 4 of @xcite where basis structures are referred to as ` observable structures ' .
we represent the morphisms @xmath84 and @xmath85 graphically as : @xmath86    basis structures are so named because in * hilb * they are in bijection with orthonormal bases , via the correspondence : @xmath87 where @xmath88 is an orthonormal basis for @xmath89 .
this is proved in @xcite .
[ sepbsprop ] two basis structures @xmath90 and @xmath91 induce a third basis structure @xmath92 , with : @xmath93    [ inducedcsprop ] any basis structure induces a self - dual dagger compact structure , with @xmath94 and @xmath95 .
basis structures are identified in @xcite as a key structure underlying a variety of quantum - like features , for example the existence of incompatible observables , and information processing tasks such as the quantum fourier transform .
in the section we give the definitions of two key categories . the first definition is a convenient stepping stone to the second :    [ defspek ] the category * spek * is a subcategory of * rel * , defined inductively , as follows :    * the objects of * spek * are the single - element set @xmath96 , the four element set @xmath97 , and its @xmath1-fold cartesian products @xmath5 . * the morphisms of * spek * are all those relations generated by composition , cartesian product and relational converse from the following generating relations : 1 .
all permutations @xmath98 of the four element set , represented diagrammatically by : @xmath99 there are 24 such permutations and they form a group , @xmath100 .
2 .   a relation @xmath101 defined by : @xmath102 represented diagrammatically by : @xmath103 3 .
a relation @xmath104 defined by @xmath105 and represented diagrammatically by : @xmath106 4 .   the relevant unit , associativity and symmetry natural isomorphisms .
@xcite[spek : basisstruc ] @xmath107 is a basis structure in * frel * and hence also in * spek*.    this category turns out to be the process category for the fragment of the toy theory containing only epistemic states of maximal knowledge . in particular , as discussed in detail in @xcite , the interaction of the basis structure @xmath107 and the permutations of @xmath108 results in three basis structures , analogous to the @xmath109- , the @xmath110- and the @xmath111-bases of a qubit .
furthermore , as also discussed in @xcite4 , * spek * also contains operations which in quantum theory correspond with projection operators , while these are not included in the toy theory .
indeed , compact closure of * spek * implies _ map - state duality _ _ : operations and bipartite states are in bijective correspondence . _ _ _    the process category for the full toy theory has a similar definition :    the category * mspek * is a sub - category of * rel * , with the same objects as * spek*. its morphisms are all those relations generated by composition , cartesian product and relational converse from the generators of * spek * plus an additional generator : @xmath112    by construction , both * spek * and * mspek * inherit dagger symmetric monoidal structure from * rel * , with cartesian product being the monoidal product , and relational converse acting as the dagger functor .    * spek * and * mspek * are both compact closed .    by propositions [ spek : basisstruc ] and [ sepbsprop ]
it follows that each object in these categories has a basis structure , and hence by proposition [ inducedcsprop ] they both are compact closed .
the primary task of the remainder of this paper is to demonstrate that * mspek * is indeed the process category of spekkens s toy theory .
we first make some preliminary observations .
a _ * spek * diagram _ is any valid diagram in the graphical language introduced in section [ seccategories ] which can be formed by linking together the diagrams of the * spek * generators , as described in definition [ defspek ] .
there is clearly a bijection between the possible compositions of * spek * generators , and * spek * diagrams .
a * spek * diagram with @xmath19 inputs and @xmath1 outputs represents a morphism of type @xmath113 : a relation between sets @xmath114 and @xmath5 .
the number of relations between two finite sets @xmath53 and @xmath115 is clearly finite itself : it is the power set of @xmath116 .
thus the hom - set * frel*(a , b ) is finite . since @xmath117
we can be sure that the hom - sets of * spek * are finite . on the other hand , there is clearly an infinite number of * spek * diagrams which have @xmath19 inputs and @xmath1 inputs - we can add more and more internal loops to the diagrams .
thus many diagrams represent the same morphism . however the morphisms of * spek * are , by definition , all those relations resulting from arbitrary compositions of the generating relations , i.e. any relation that corresponds to one of the infinity of * spek * diagrams .
hence any proof about the form of the morphisms in * spek * is going to have to be a result about the relations corresponding to each possible * spek * diagram , even though in general many diagrams correspond to a single morphism .    if we know the relation corresponding to one diagram in one of * spek * s diagram equivalence classes ( recall definition [ decdef ] ) , then it is straightforward to determine the relations corresponding to all of the other diagrams .
[ bendlinelemma ] given a * spek * diagram and corresponding relation : @xmath118 then the relation corresponding to the following diagram : @xmath119 is given by , for all @xmath120 : @xmath121 where @xmath122 is the subset of @xmath123 which is related by @xmath124 to @xmath125 .    every diagram equivalence class in * spek *
has at least one diagram of type @xmath126 , representing a state , where we make every external line an output .
relations of this type can be viewed as subsets of the set @xmath5 and it will be convenient for us to concentrate on characterising these morphisms . via lemma [ bendlinelemma ] any results on
the general form of states will translate into results on the general form of all morphisms . in
what follows we will therefore make no distinction between the inputs and outputs of a * spek*-diagram : a diagram with @xmath19 inputs and @xmath1 outputs will simply be referred to as a @xmath127-legged diagram .
our proof will involve building up * spek * diagrams by connecting together the generating morphisms .
here we show what various diagram manipulations mean in concrete terms for the corresponding relations .
henceforth , remembering that we only have to consider states , we will assume that the relation corresponding to any @xmath1-legged diagram is of type @xmath126 .
first we introduce some terminology .
the _ composite _ of an @xmath19-tuple @xmath128 and an @xmath1-tuple @xmath129 is the @xmath127-tuple @xmath130 from @xmath131 . by the @xmath132__-remnant _ _ of an @xmath1-tuple we mean the @xmath133-tuple obtained by deleting its @xmath134 component . by the @xmath135__-remnant _ _ of an @xmath1-tuple ( where @xmath136 ) we mean the @xmath137-tuple obtained by deleting the @xmath138 component of its @xmath132-remnant ( or equivalently , deleting the @xmath139 component of its @xmath140-remnant ) .    _
[ relationtree ] consider linking two diagrams , the first representing the relation @xmath141 the second representing the relation @xmath142 via a permutation @xmath143 , to form a new diagram as shown : @xmath144 the relation corresponding to this diagram is given by @xmath145 or , in less formal language , for every pair of a tuple from @xmath124 and a tuple from @xmath146 obeying the condition @xmath147 , we form composite of the @xmath134 remnant of the tuple from @xmath124 , and the @xmath138 remnant of the tuple from @xmath146 . _    _ [ relationloop ] given a diagram representing the relation @xmath141 , consider forming a new diagram by linking the @xmath134 and @xmath138 legs of the original diagram via a permutation @xmath143 .
@xmath148 the relation corresponding to this diagram is given by : @xmath149 or , in less formal language , we take the @xmath135-remnant of every tuple for which @xmath150 . _    _ [ relationcapping ] consider linking two diagrams , the first representing the relation @xmath151 the second representing the relation @xmath152 via a permutation @xmath143 , to form a new diagram as shown : @xmath153 the relation corresponding to this diagram is given by : @xmath154 or , in less formal language , we take the @xmath134 remnant of every tuple for which @xmath155 . _
it is convenient to single out a particular sub - group of the @xmath108 permutation sub - group .
this consists of the four permutations which do nt mix between the sets @xmath12 and @xmath13 : ( 1)(2)(3)(4 ) ( the identity ) , ( 12)(3)(4 ) , ( 1)(2)(34 ) and ( 12)(34 ) .
we term these the _ phased _ permutations .
all other permutations are termed _
unphased_. we single out this sub - group because the relations corresponding to * spek * diagrams generated from @xmath156 , @xmath157 , and the four phased permutations have a significantly simpler general form .
we term such diagrams _ phased diagrams_. all other diagrams are termed _
unphased diagrams_. a morphism which corresponds to a phased diagram is termed a _ phased morphism _ , all other morphisms being _
unphased morphisms_.    it is straightforward to see that any unphased * spek * diagram can be viewed as a collection of phased sub - diagrams linked together via unphased permutations .
we refer to these sub - diagrams as _
zones_. furthermore , note that any permutation in @xmath108 can be written as a product of phased permutations and the unphased permutation ( 1)(3)(24 ) ( which we denote by @xmath158 ) .
since a single phased permutation constitutes a phased zone with two legs , we can in fact view an unphased diagram as a collection of phased zones linked together by the permutation @xmath158 : @xmath159 here @xmath160 represents a phased sub - diagram and a square box represents an unphased permutations .
note that such a diagram is not necessarily planar , i.e.  it may involve crossing wires .
we distinguish between _ external zones _ which have external legs ( e.g. @xmath161 , @xmath162 and @xmath163 in diagram [ generalunphasedeq ] ) , and _ internal zones _ all of whose legs are connected to other legs within the diagram ( e.g. @xmath164 and @xmath165 ) . to the external legs we associate an enumeration , such that legs from the same external zone appear consecutively .    in the first stage of the proof
we determine the general form of the relation corresponding to a _
phased diagram_. this stage itself splits into two phases : first we determine the general form of the morphisms of a new category * halfspek * , and then we show how to use this result to prove our main result in * spek*. in the second stage we draw on the results of the first to determine the general form of the relation corresponding to _ any _ * spek * diagram .
we build up to the full theorem via a simplified case . for this
we need a new category .
[ defhalfspek ] the category * halfspek * is a subcategory of * frel*. it is defined inductively , as follows :    * the objects of * halfspek * are the single - element set @xmath96 , the two element set @xmath166 , and its @xmath1-fold cartesian products @xmath167 .
* the morphisms of * halfspek * are all those relations generated by composition , cartesian product and relational converse from the following generating relations : 1 .
all permutations @xmath168 of the two element set .
there are 2 such permutations , the identity and the operation @xmath169 which swaps the elements of @xmath170 .
together they form the group @xmath171 .
a relation @xmath172 defined by : @xmath173 3 .
a relation @xmath174    @xcite @xmath175 is a basis structure in * frel * and hence also in * halfspek*.    _ the existence of this basis structure came as a surprise to the authors . naively one might think ( as many working in the area of categorical quantum mechanics initially did ) that on a set @xmath110 in * frel * there is a single basis structure with @xmath84 given by @xmath176 for all @xmath177 .
the ` basis vectors ' ( or copyable points in the language of @xcite ) are then the elements of this set . but
this is not the case .
there are many ` non - well - pointed ' basis structures such as @xmath175 for which the number of copyable points is less than the number of elements of the set . in related work
, pavlovic has classified all basis structures in * frel * and evans et al .
have identified the pairs of complementary basis structures ( in the sense of @xcite ) among these @xcite .
_    next we determine the general form of the relations which constitute the morphisms of * halfspek * , to which the considerations made at the beginning of section [ aboutdiagsandstates ] also apply .
we say that an element of @xmath167 has _ odd _
parity if it has an odd number of ` 1 ' elements , and that it has _ even _ parity if it has an even number of ` 1 ' elements .
we will use @xmath143 to represent a particular parity , odd or even , and @xmath178 will represent the opposite parity . whether an odd - parity @xmath1-tuple has
an odd or even number of ` 0 ' elements clearly depends on whether @xmath1 itself is odd or even .
we could have chosen either 0 or 1 to play the role of labelling the parity ; we have chosen 1 since it will turn out to be more convenient later on .    _ [ halfspekmorphisms ] the relation in * halfspek * corresponding to an @xmath1-legged * halfspek*-diagram is a subset of @xmath167 , consisting of all @xmath179 @xmath1-tuples of a certain parity , which depending on the diagram may either be even or odd : if the product of all the permutations appearing in the diagram is the identity , then parity is even , and if it is @xmath169 , then the parity is odd . _
we prove this result by induction on the number of generators @xmath180 required to construct the diagram .
remember that we need only consider those diagrams whose corresponding relations are states .
there is just one possible base case ( @xmath181 ) , a diagram composed purely of the generator @xmath182 for which @xmath183 : the corresponding state consists of the single 1-tuple ( 0 ) , which is indeed the unique 1-tuple of even parity .
now consider a diagram @xmath184 built from @xmath180 generators with a corresponding state @xmath185 consisting all @xmath179 @xmath1-tuples of parity @xmath143 .
it is easily seen that composing @xmath184 with either @xmath186 , @xmath187 or @xmath188 respectively yields a diagram whose corresponding state consists of all @xmath189 @xmath0-tuples , all @xmath190 @xmath191-tuples , and all @xmath189 @xmath0-tuples of parity @xmath143 ; and that composing with @xmath169 yields all @xmath179 @xmath1-tuples of parity @xmath178 .
finally consider producing a disconnected diagram by laying the @xmath182 diagram alongside @xmath184 : it is easily seen that the corresponding state consists of @xmath190 @xmath191-tuples of parity @xmath143 .
we want to apply our results on * halfspek * to the category of real interest , * spek*. to do this we first need to digress to discuss some structural features of relations . the category * rel * has another symmetric monoidal structure , namely the _ disjoint union _ or _ direct sum _ _ , denoted by @xmath192 .
concretely , if we can partition a set @xmath53 into @xmath19 subsets @xmath193 , then we have @xmath194 , and recalling that a relation @xmath195 is a subset of @xmath116 , we can decompose @xmath124 into @xmath196 components of the form @xmath197 , such that @xmath198 .
the relations @xmath197 are termed the _ components _ of @xmath124 _ with respect to partitions _
@xmath194 , @xmath199 . in category
theoretic terms , this is _ biproduct _ _ , and there is a _ distributive law _ with respect to the cartesian product : @xmath200 for sets @xmath201 and relations @xmath202 . for @xmath194 , @xmath199 , @xmath203 and @xmath204 , and relations @xmath195 , @xmath205 and @xmath206
, we then have : @xmath207 for @xmath208 by distributivity we have : @xmath209 if for @xmath210 and @xmath211 the only non - empty components are @xmath212 and @xmath213 we call it _ parallel_. given parallel relations @xmath214 , @xmath215 and @xmath216 with respect to the partition @xmath208 , the relations : @xmath217 are all also easily seen to be parallel with respect to the same partition of @xmath53 . _ _ _ _ _ _ _ _ _ _    we can use these insights to make a connection between * halfspek * and * spek*.    the generators of the phased morphisms of * spek * , i.e. @xmath218 , @xmath219 and the phased permutations on @xmath22 , are all parallel with respect to the following partition of @xmath220 . we conclude that all phased morphisms of * spek * are also parallel with respect to this partition .
we refer to the two components of a phased * spek * morphism as its @xmath12-component and @xmath13-component .    [ halfspekgenarespekgen ] the @xmath12-components of the generators of the phased morphisms of * spek * are simply the generators of * halfspek * with the elements of @xmath221 re - labelled according to @xmath222 , @xmath223 . similarly the @xmath13-components of the generators of the phased morphisms of * spek * are simply the generators of * halfspek * with the elements of @xmath221 re - labelled according to @xmath224 , @xmath225 .
[ spekdis2halfspekd ] a state @xmath226 corresponding to a phased * spek * diagram @xmath184 is equal to the union of two states @xmath227 and @xmath228 .
@xmath229 and @xmath230 are obtained by the following procedure .
form a * halfspek * diagram @xmath231 by replacing every occurence of @xmath218 and @xmath219 in @xmath184 with @xmath232 and @xmath233 , and replacing every occurence of a permutation with its @xmath12 component , re - labelled as a @xmath234 permutation as described in proposition [ halfspekgenarespekgen ] .
form a second * halfspek * diagram @xmath235 in the obvious analogous fashion using @xmath13 components of permutations . @xmath229 and @xmath230 are the states corresponding to @xmath231 and @xmath235 , once again under the re - labelling described in proposition [ halfspekgenarespekgen ] .    note that @xmath231 and @xmath235 will appear identical as graphs , both to each other and to @xmath184 , but the labels on some of their permutations will differ
.    from proposition [ spekdis2halfspekd ] and theorem [ halfspekmorphisms ] now follows :    [ phasedmorphisms ] a phased morphism in * spek * of type @xmath126 is a subset of @xmath5 , consisting of @xmath9 @xmath1-tuples , divided into two classes of equal number :    * the first class consists of tuples of 1s and 2s , all of either odd or even parity .
* the second class consists of tuples of 3s and 4s , again all of either odd or even parity .
note that we are adopting the convention that tuples of the first class have odd parity if they have an odd number of 2s , even parity if they have an even number of 2s .
tuples of the first class have odd parity if they have an odd number of 4s , even parity if they have an even number of 4s .
recall from section [ proofstructuresec ] that any unphased diagram can be viewed as a collection of phased zones linked together by the permutation @xmath158 , ( 1)(3)(24 ) .
we also enumerated the external legs .
[ externalnonphasedth ] the relation in * spek * corresponding to an @xmath1-legged * spek*-diagram with @xmath19 zones , none of which is internal , is a subset @xmath185 of @xmath5 with the following form :    1 .
it contains @xmath9 @xmath1-tuples ; each entry corresponding to an external leg .
all those entries corresponding to a given zone of the diagram are termed a _ zone _ of the tuple ( whether we are referring to a zone of a diagram , or zone of a tuple should be clear from the context ) .
each zone of the tuple has a well - defined _ type _ ( components either all 1 or 2 , or all 3 or 4 ) and _ parity _ ( as defined for phased relations ) .
3 .   a _ block _
@xmath115 is a subset of @xmath185 such that the @xmath134 zone of all @xmath1-tuples in @xmath115 has the same parity and type .
the sequence of types and parities of each zone is called the _ signature _ of the block .
the @xmath9 tuples of @xmath185 are partitioned into @xmath236 equally sized blocks each with a unique signature .
each of the @xmath236 blocks has a different type signature - these exhaust all possible type signatures .
the parity signature of a block is the following simple function of its type signature : @xmath237 here @xmath238 and @xmath239 are boolean variables representing the parity and type of the @xmath134 zone .
we adopt the convention that an odd parity is represented by 0 and an even parity by 1 , whilst the type @xmath12 is represented by 0 and the type @xmath13 by 1 .
the set adj(@xmath240 ) consists of the zones directly adjacent to the @xmath134 zone .
@xmath241 denotes the parity of the type @xmath239 tuples in the relation corresponding to the @xmath134 zone seen as an independent phased diagram ( recall theorem [ phasedmorphisms ] ) .    [ internalnonphasedth ] the relation in * spek * corresponding to an @xmath1-legged * spek*-diagram with @xmath19 zones , of which @xmath242 are external is either :    * a subset , @xmath185 of @xmath5 which satisfies conditions ( 1 ) and ( 2 ) of theorem [ externalnonphasedth ] and which is partitioned into @xmath243 blocks .
the signatures of these blocks are determined as follows : 1 .
begin with the state corresponding to the diagram obtained by adding an external leg to every internal zone ( i.e. we will have @xmath236 blocks , each with @xmath19 zones , exhausting all possible type signatures ) .
2 .   eliminate all blocks whose type signatures do not satisfy the following constraints , one for each internal zone : @xmath244 where @xmath240 is the label of the internal zone , and @xmath245 labels its adjacent zones .
3 .   finally from each block delete the zones corresponding to internal zones . * _ or _ it is equal to the empty set , @xmath246 .
this second possibility occurs iff the constraints in equation [ typeconstrainteq ] are inconsistent .
a simple counting argument shows that within each block , every tuple with the correct type and parity signature occurs .
theorems [ externalnonphasedth ] and [ internalnonphasedth ] thus completely characterise the state corresponding to any * spek*-diagram . the input data is the shape of the diagram , which determines _
adj(i ) _ , and the ` intrinsic parities ' @xmath241 of each zone .
futhermore , note from theorem [ phasedmorphisms ] that , as we would expect , the general form of phased morphisms is a special case of the form described above , with @xmath247 .
_ we now give an example of theorem [ externalnonphasedth ] in action .
consider the following schematic**spek**-diagram ( circles simply denote zones ) , which has three zones , all external ( @xmath248 ) and five external legs ( @xmath249 ) : @xmath250 where the labels by each zone denote the intrinsic parities of that zone ( i.e. the parity of the type-12 tuples and the parity of the type-34 tuples , recall theorem [ phasedmorphisms ] ) .
we conclude from theorem [ externalnonphasedth ] that the state corresponding to this diagram will consist of @xmath251 5-tuples each with 3 zones , and that these will be partitioned into @xmath252 equally sized blocks .
every combination of types appears exactly once amongst these blocks , and the parity signatures are easily determined from equation [ typeparityeq ] as follows .
first we note , from the intrinsic parities that @xmath253 , @xmath254 and @xmath255 .
we then see that equation [ typeparityeq ] here is essentially three equations : @xmath256 from this we can establish the signatures of the eight blocks : @xmath257 the first zone will have two elements , the second zone one element and the third zone two elements . within each block every possible collection of tuples consistent with the signature will appear meaning that each block will consist of four tuples .
_    _ we go on to give an example of theorem [ internalnonphasedth ] .
consider the following diagram : it is identical to the diagram in the previous example except that the second zone has been internalised .
@xmath258 this diagram has two external zones @xmath259 and four external legs @xmath260 ; thus we expect the corresponding state to consist of @xmath261 4-tuples , each with 2 zones , partitioned into @xmath262 blocks .
we now determine the signatures of the blocks applying theorem [ internalnonphasedth ] . according to step ( 1 ) we begin with the blocks from the previous example .
step ( 2 ) requires that we eliminate all blocks whose types do not satisfy the constraint @xmath263 .
this leaves : @xmath264 finally we delete the second zone from each block , leaving : @xmath265 _    the proofs of theorems [ externalnonphasedth ] and [ internalnonphasedth ] proceed as inductions over the process of building up a diagram by linking together phased zones via the permutation @xmath158 .
in the course of this process it is clearly possible for an external zone to become an internal zone , as its last external leg is linked to some other zone - we refer to this as _ internalising _ a zone .
it turns out that internalisation of a zone complicates the inductive proof . to get around this we do the induction in two stages . in the first stage
we build up a diagram identical to the one we are aiming for , _ except _ that every zone that should be internal is given a single external leg in the following fashion .
suppose we need to link together two zones via a permutation , and this will result in the internalisation of the left hand zone : @xmath266 we instead link the left hand zone to the permutation via a @xmath218 morphism .
the @xmath218 morphism becomes part of the original zone , and provides it with an external leg : @xmath267 in the second stage we cap off all these extra external legs with the @xmath219 morphism . since @xmath218 and @xmath219 constitute a basis structure the result is the diagram which we are aiming for : @xmath268      we now prove theorem [ externalnonphasedth ] .
the proof uses an induction over the process of building up a diagram .
this building up can be split into two phases : firstly we connect all of the zones which will appear in the final diagram into a ` tree - like ' structure with no closed loops , secondly we close up any loops necessary to yield the desired diagram
. henceforth we will represent the signature of a tuple with @xmath19 zones as @xmath269 where @xmath238 is the parity of the @xmath134 zone , and @xmath239 is its type .
again , if @xmath143 is a parity , @xmath178 indicates the opposite parity , and likewise if @xmath270 is a type , @xmath271 represents the other type .
[ unphasedtreelemma ] consider an @xmath1-legged non - phased diagram @xmath161 with @xmath19 zones .
suppose the corresponding state @xmath272 satisfies the conditions in theorem [ externalnonphasedth ] .
now consider linking the @xmath134 leg of @xmath161 to the @xmath138 leg of an @xmath273-legged phased diagram @xmath162 ( with corresponding state @xmath274 ) , via @xmath158 , to create an @xmath275-legged diagram @xmath164 with @xmath276 external zones .
we will assume that the @xmath134 leg of @xmath161 lies within its @xmath277 external zone .
the state @xmath278 corresponding to @xmath164 also satisfies the conditions in theorem [ externalnonphasedth ] .    by the 1-@xmath134-remnants of @xmath279 we mean the @xmath134-remnants of those tuples in @xmath279 with a 1 in the @xmath134 position .
we define the 2- , 3- , and 4-@xmath134-remnants similarly . by proposition [ relationtree ]
the elements of @xmath280 comprise all the possible composites of the @xmath281-@xmath134-remnants of @xmath279 and the @xmath282-@xmath138-remnants of @xmath274 , where @xmath283 .
it is clear that the zone structure of the tuples of @xmath279 is inherited by these composites , and that the @xmath282-@xmath138-remnants of @xmath274 constitute an additional zone within the composites - we conventionally consider this to be the @xmath284 zone .
thus the tuples of @xmath280 satisfy condition ( 2 ) .
consider a block @xmath285 , with signature @xmath286 , in which for definiteness we assume that @xmath287 ( the argument runs entirely analogously if @xmath288 ) .
the composites of the 1-@xmath134-remnants of @xmath115 and the @xmath289-@xmath138-remnants of @xmath274 all have the same signature , @xmath290 , and constitute a block @xmath291 .
likewise the composites of the 2-@xmath134-remnants of @xmath115 and the @xmath292-@xmath138-remnants of @xmath274 constitute a block @xmath293 of signature @xmath294 @xmath295 .
thus each ` parent ' block in @xmath279 gives rise to two ` progeny ' blocks in @xmath280 . by hypothesis
, each block @xmath296 has a unique type signature , thus the progeny blocks derived from different parent blocks are distinct .
thus @xmath280 is partitioned into @xmath297 blocks , thus satisfying condition ( 3 ) .
it is also clear that if all possible type signatures are represented by the @xmath236 blocks of @xmath279 then this is also true for the @xmath297 blocks of @xmath280 , and thus that @xmath280 satisfies condition ( 1 ) .
note that @xmath115 consists of @xmath298 @xmath1-tuples , and will have @xmath299 1-@xmath134-remnants and a similar number of 2-@xmath134-remnants , all of which will be distinct . similarly @xmath274 will have @xmath300 @xmath289-@xmath134-remnants and a similar number of 4-@xmath134-remnants , again all distinct .
thus , both @xmath301 and @xmath302 will consist of @xmath303 tuples .
this holds for all blocks @xmath285 , of which there are @xmath236 .
thus in total @xmath280 consists of @xmath304 tuples , and so satisfies condition ( 4 ) .
finally we turn to condition ( 5 ) .
recall from above that a parent block of signature @xmath305 @xmath306 yields two progeny blocks , of signatures @xmath307 @xmath308 and @xmath309 .
note that those progeny blocks for which the @xmath277 zone and its new adjacent zone have different types exhibit a parity flip on the @xmath277 zone , relative to the parent block , and on the new adjacent zone , relative to its ` intrinsic parity ' .
no such flip occurs if the zones have the same type .
note that the term @xmath310 is equal to 0 if @xmath311 and 1 if @xmath312 .
if condition ( 2 ) holds for @xmath279 then the correct parity signature for the blocks of @xmath280 can be obtained simply by adding the term @xmath313 to the @xmath314 and @xmath315 equations ( equation [ typeparityeq ] ) .
thus we conclude that condition ( 5 ) will hold for @xmath280 as well .
[ unphasedlooplemma ] consider an @xmath1-legged diagram @xmath184 with @xmath19 external zones .
suppose the corresponding state @xmath185 satisfies the conditions in theorem [ externalnonphasedth ] .
now consider forming a new @xmath137-legged diagram @xmath316 , with corresponding state @xmath317 , by linking the @xmath134 leg of @xmath184 ( in the @xmath277 zone of @xmath184 ) , to the @xmath138 leg ( in the @xmath318 zone ) , via @xmath158 .
@xmath317 also satisfies the conditions in theorem [ externalnonphasedth ] .    by the @xmath319-@xmath320__-remnants
_ _ of a set of tuples we mean the @xmath320-remnants of all those tuples with @xmath281 in the @xmath134 position and @xmath321 in the @xmath138 position . from proposition [ relationloop ]
, @xmath317 consists of the @xmath322-@xmath320-remnants of @xmath185 . the zone structure of @xmath185
is clearly inherited by these remnants , thus the tuples of @xmath317 satisfy condition ( 2 ) .    consider a block @xmath323 with signature @xmath324 @xmath325 .
it is straightforward to see that only one quarter of the tuples in this block have @xmath320-remnants which are @xmath322-@xmath320-remnants .
all the @xmath322-@xmath320-remnants have the same signature : @xmath326 if @xmath327 and @xmath328 @xmath329 if @xmath330
. thus each ` parent ' block in @xmath185 gives rise to one ` progeny ' block in @xmath317 , with one quarter as many tuples .
the type signatures of the progeny blocks are identical to those of the parent blocks ; by hypothesis each parent block had a different type signature and so the progeny blocks deriving from different parent blocks are all distinct .
thus @xmath317 is partitioned into @xmath236 blocks , each containing @xmath331 tuples , and so satisfies conditions ( 1 ) and ( 3 ) .
since the type signatures of progeny and parent blocks are identical , if @xmath185 satisfies condition ( 4 ) , so will @xmath317 .
we now turn to condition ( 5 ) . closing
a loop between the @xmath277 and @xmath318 zones means that they now become adjacent to each other . in the previous paragraph
we saw that a progeny block for which the @xmath277 and @xmath318 zones have different types exhibits a parity flip on both these zones . using similar reasoning as in the previous lemma
we conclude that , if condition ( 2 ) holds for @xmath185 , the correct parity signature for the blocks of @xmath317 can be obtained simply by adding the term @xmath332 to the @xmath314 and @xmath333 equations ( equation [ typeparityeq ] ) .
thus we conclude that condition ( 5 ) will hold for @xmath317 as well .
we can now prove * theorem [ externalnonphasedth ] * :    by induction .
the base case is a diagram consisting of a single zone , and it is clear from theorem [ phasedmorphisms ] that this satisfies all the conditions . any other diagram is built up via two inductive steps : linking a new phased zone onto the existing diagram and closing up internal loops within the diagram .
lemmas [ unphasedtreelemma ] and [ unphasedlooplemma ] respectively show that if a diagram satisfied the conditions prior to either of these steps , the resulting new diagram will also satisfy the conditions .
we now address the issue of internalising zones .
recall that this step involves capping off external legs with the @xmath219 relation . throughout this section @xmath184
will denote a diagram with no internal zones , and @xmath316 will denote the diagram obtained by internalising some of @xmath184 s zones .
the corresponding states will be @xmath185 and @xmath317 .
suppose we obtain @xmath316 by capping the @xmath277 external leg of @xmath184 with the @xmath219 morphism . from lemma [ relationcapping ]
we conclude that @xmath317 consists of the 1-@xmath277- and 3-@xmath277-remnants of @xmath185 .
suppose that in going from @xmath184 to @xmath316 we internalised the @xmath134 zone of @xmath184 .
from the proposition above we deduce that each block @xmath323 for which @xmath334 will give rise to one progeny block @xmath335 with the same number of tuples as @xmath115 , while all those blocks for which @xmath336 will give rise to no progeny blocks . from this
we can conclude that those blocks which do give rise to progeny blocks satisfy a constraint on their type signatures , derived from setting @xmath334 in equation [ typeparityeq ] . depending on the form of @xmath241 , and whether the number of zones adjacent to the @xmath134 is odd or
even , this constraint takes one of four forms : @xmath337 @xmath338 we describe the constraints in ( [ type0eq ] ) as _ type-0 constraints _ , and those in ( [ type1eq ] ) as _
type-1 constraints_.    suppose @xmath184 has @xmath1 external legs and @xmath19 external zones .
suppose that in going to @xmath316 we internalise @xmath339 of its zones .
_ each internalisation gives rise to a corresponding constraint .
_ there are now two possibilities :    1 .
not all of the constraints are consistent . in this case none of the blocks in @xmath185 satisfy all of the constraints , and none of them will give rise to progeny blocks . thus @xmath340 .
all @xmath339 constraints are consistent , and of these @xmath341 are linearly independent ( this essentially means that @xmath342 of the constraints can be derived from the remaining @xmath341 ) .
each independent constraint reduces the number of blocks which can give rise to progeny by one half .
thus only @xmath343 of the blocks in @xmath185 give rise to progeny blocks in @xmath317 , and @xmath317 can have at most @xmath343 blocks - this maximum is attained if all of the progeny blocks are distinct .    [ duplicationlemma ] the following are equivalent :    1 .
the constraints are consistent and there are @xmath341 linearly independent constraints .
the @xmath343 blocks in @xmath185 which can give rise to progeny blocks in @xmath317 are partitioned into @xmath344 sets , each consisting of @xmath345 blocks which all yield identical progeny blocks .
thus in total there are @xmath344 distinct progeny blocks . for brevity we will describe this as @xmath346-_fold duplication _ of progeny blocks .
the proof of this lemma requires a number of preliminary definitions .
the _ iz - set _ is the set of zones which are internalised in going from @xmath184 to @xmath316 .
the _ non - internalised adjacent zones ( niazs ) _ of an internalised zone are all the zones adjacent to it which are not themselves members of the iz - set
adjacency closure set ( acs ) _ is a subset of the iz - set with the minimal number of elements such that the disjoint union of the niazs of each element contains each niaz an even number of times .    _
consider the following seven zone diagram ( external legs are suppressed for clarity ) .
the filled - in zones are those which we internalise . @xmath347
the iz - set is @xmath348 .
the niazs for 1 are @xmath349 for 3 are @xmath350 , for 6 are @xmath351 and for 7 are @xmath352 .
zones 3 , 6 and 7 together constitute an acs .
zone 1 is not part of any acs . _
given a set @xmath146 of zones in @xmath184 , and a block @xmath323 , the _ @xmath146-mirror of @xmath115 _ , @xmath353 is the block with the same type signature as @xmath115 except on the zones in @xmath146 , where the types are opposite .
[ dupmirrorprop ] suppose @xmath184 has an acs @xmath124 .
now , so long as the blocks @xmath354 ( i.e. a block and its @xmath124-mirror ) both yield progeny blocks in @xmath317 , these progeny blocks will be identical .
conversely , if any two blocks @xmath355 yield identical progeny blocks in @xmath317 , they must be mirrored with respect to some acs in @xmath184 .    for two blocks in @xmath185 to give identical progeny blocks in @xmath317
they must have identical type and parity on every zone which is not internalised .
note from equation [ typeparityeq ] that two blocks in @xmath185 which are type mirrored on a single zone will otherwise differ only in parities on all the zones adjacent to this zone .
now consider two blocks which are type - mirrored on a set of zones @xmath124 : in the case where @xmath124 constitutes an acs all the parity flips predicted by equation [ typeparityeq ] cancel one another out on the zones which will still be visible in @xmath317 .
[ mirrorconstraintprop ] suppose @xmath184 has an acs @xmath124 whose member zones have corresponding constraints which satisfy the following condition : those zones with an odd number of adjacent zones within the iz - set have type-1 constraints , while those zones with an even number of adjacent zones within the iz - set have type-0 constraints .
then if a block @xmath323 satisfies the constraints and gives rise to progeny blocks in @xmath317 , so does its @xmath124-mirror .
conversely , if a block @xmath323 and its mirror with respect to some acs @xmath124 in @xmath184 both give rise to progeny blocks , the constraints corresponding to the zones of @xmath124 must satisfy the condition above .
if a constraint contains an even number of terms relating to zones from a set @xmath124 then given a block @xmath323 either ( i ) both @xmath115 and @xmath356 satisfy the constraint ( ii ) neither @xmath115 nor @xmath356 satisfy the constraint .
conversely , if both @xmath115 and @xmath356 satisfy a constraint , it must contain an even number of terms relating to zones from @xmath124 .
[ constraintlindepprop ] suppose @xmath184 has an acs @xmath124 whose member zones have corresponding constraints which satisfy the condition in the previous proposition . then the constraints together form a linearly dependent set .
the converse is also true .
if @xmath124 is an acs and the condition on constraints is satisfied then each term appears in the constraints an even number of times altogether .
summing all the constraints together then results in all the terms cancelling out , yielding the single equation 0=0 .
this is a necessary and sufficient condition for the constraints to be linearly dependent .
we can now prove lemma [ duplicationlemma ] .    from propositions
[ dupmirrorprop ] and [ mirrorconstraintprop ] we conclude that for @xmath1-fold duplication to take place the iz - set must contain @xmath1 acss and that the constraints must satisfy the condition in proposition [ mirrorconstraintprop ] .
the converse is also clearly true .
every linearly dependent set amongst the constraints corresponding to the internalised zones reduces the total number of linearly independent constraints by one . from proposition [ constraintlindepprop ]
we conclude that for there to be @xmath1 linearly dependent sets the iz - set must contain @xmath1 acss and that the constraints must satisfy the condition in proposition [ mirrorconstraintprop ] .
the converse is also clearly true .
thus we conclude that both statements in the lemma are equivalent to a third statement : the iz - set contains @xmath342 acss , and the constraints corresponding to the internalised zones satisfy the condition of proposition [ mirrorconstraintprop ] .    given a diagram @xmath184 without internal zones which satisfies the conditions in theorem [ externalnonphasedth ] ,
a diagram @xmath316 with internal zones formed by capping off external legs of @xmath184 with @xmath219 morphisms will satisfy the conditions in theorem [ internalnonphasedth ] .
* theorem [ internalnonphasedth ] * follows as a straightforward corollary .      _
[ mspeknumbers ] all * mspek * morphisms of type @xmath126 are subsets of @xmath5 containing @xmath357 or @xmath8 @xmath1-tuples .
_    any * mspek * diagram @xmath316 can be obtained from a * spek * diagram @xmath184 simply by capping one or more legs of @xmath184 with the morphism @xmath358 .
suppose we obtain @xmath316 by capping a single external leg of @xmath184 ( the @xmath134 , say ) with @xmath358 . the state @xmath317 corresponding to @xmath316 consists of the @xmath134-remnants of @xmath185 , the state corresponding to @xmath184 .
suppose @xmath184 has @xmath1 external legs : since @xmath184 is a * spek*-diagram @xmath185 consists of @xmath9 tuples . then ,
unless some of the @xmath134-remnants of @xmath185 are identical , @xmath317 will also consist of @xmath9 tuples , despite only having @xmath359 external legs .
furthermore it is clear that either all the @xmath134-remnants of @xmath185 are distinct , or @xmath185 is partitioned into pairs , the elements of which yield identical @xmath134-remnants , meaning that the addition of each @xmath358 cap either halves the number of tuples or leaves it unchanged .
we know that the epistemic states of the toy theory are subsets of the sets @xmath5 , and that the transformations on these states are relations between these sets .
thus we can see immediately that the toy theory s process category must be some sub - category of * frel * , restricted to the objects @xmath5 .
furthermore we know that it can not be the full sub - category restricted to these objects , since some subsets of @xmath5 clearly violate the knowledge balance principle .
we will show now that ( a strong candidate for ) the process category for the toy theory in its entirety is * mspek * , while if we restrict the toy theory to states of maximal knowledge ( consistent with the knowledge balance principle ) , the process category is * spek*.    the morphisms of the process category of the toy theory are closed under composition , cartesian product and relational converse .
there is no feature of the toy theory which would put any restrictions on which operations could be composed , so we expect the states and transformations to be closed under composition . since the cartesian product is used by the toy theory to represent composite systems we also expect the states and transformations to be closed under cartesian product .
every epistemic state corresponds to an outcome for at least one measurement ( measurements correspond to asking as many questions as possible from canonical sets , epistemic states correspond to the answers ) .
recalling the discussion of measurement in section 2 , we see that given a state @xmath226 the disturbance resulting from the corresponding measurement outcome can be decomposed as @xmath360 , where @xmath361 is the relational converse of @xmath185 .
thus we expect the relational converse of each state also to feature in the physical category of the theory .
the toy theory state corresponding to the subset @xmath362 along with its relational converse are then easily seen to constitute a compact structure on @xmath22 .
we thus have map - state duality , and it is straightforward then to show that if states are closed under relational converse , so is any morphism in the physical category .
note that this point sharpens our discussion about the consistency of the toy theory , in section 2 .
if the states and transformations which spekkens has derived for up to three systems , under the operations of composition , cartesian product and relational converse , yield states which violate the knowledge balance principle , then the theory as presented is inconsistent .
all of the generating morphisms of * mspek * are states or transformations of the toy theory , or can be derived from them by composition , cartesian product or relational converse .
the only generator for which this is less than obvious is @xmath218 .
this is formed by composing spekkens s ghz - like state ( see section v of @xcite ) with the relational converse of the state @xmath363 defined in the proof above .
all of the states and transformations derived by spekkens in his original paper @xcite are morphisms of * mspek*. when we restrict to states of maximal knowledge all of the states and transformations are morphisms of * spek*.    by inspection of @xcite .
[ spekisclosure ] * mspek * is the minimal closure under composition , cartesian product and relational converse of the states and transformations described in @xcite .
* spek * is the minimal closure under these operations of the states of @xcite corresponding to maximal knowledge and the transformations which preserve them .
[ spekmspekarekbp ] all states @xmath364 of * mspek * and * spek * satisfy the knowledge balance principle on the system corresponding to @xmath5 viewed as one complete system
. all those of * spek * satisfy the principle maximally .
recall that the knowledge balance principle requires that we can know the answer to at most half of a canonical question set .
a system with @xmath1 elementary components has @xmath8 ontic states .
a canonical set for such a system consists of @xmath365 questions , each answer to a question halving the number of possibilities for the ontic state .
thus , we know the answer to @xmath19 such questions ( @xmath366 ) , iff our epistemic state is a subset of @xmath5 with @xmath367 elements .
we conclude from theorem [ mspeknumbers ] that all states of * mspek * satisfy the knowledge balance principle on the system as a whole .
we conclude that all states of * spek * correspond to the maximum knowledge about the system as a whole consistent with the knowledge balance principle .
[ subsysarekbptoo ] all states @xmath364 of * mspek * and * spek * satisfy the knowledge balance principle on every subsystem of the system corresponding to @xmath5 .
given an epistemic state @xmath226 of a composite system with @xmath1 elementary components , the ` marginal ' state on some subsystem is obtained from @xmath185 by deleting from the tuples of @xmath185 the components corresponding to the elementary systems which are not part of the subsystem of interest .
suppose this epistemic state corresponds to a * spek * or * mspek * diagram , @xmath184 .
the elementary systems which are not part of the subsystem correspond to a certain collection of external legs of @xmath184 , and , by lemma [ relationcapping ] , if we cap these with the * mspek * generator @xmath358 , the effect on the state @xmath185 is exactly as just described .
composing a * spek * or * mspek * morphism with @xmath358 yields some morphism of * mspek * , which by proposition [ spekmspekarekbp ] satisfies the knowledge balance principle .    from corollary [ spekisclosure ] and propositions [ spekmspekarekbp ] and [ subsysarekbptoo ] we reach two key conclusions :    * the states and transformations derived by spekkens in @xcite for systems of up to three components are all consistent with the knowledge balance principle . *
the process category of the toy theory must , at least , contain all of the morphisms of * mspek*.    the second conclusion begs the question , could * mspek * be a strict sub - category of the process category of the toy theory i.e. could the toy theory contain operations not contained in * mspek * ?
it is difficult to answer this question , since , as discussed at the end of section 2 it is not clear what the rigorous definition of the toy theory is , or whether there is an unambiguous way to extend it beyond three systems .
certainly , * mspek * is the process category of a theory which coincides with spekkens s theory up to the case of three qubits , and whose states and transformations are bound to satisfy the three rules of section 2 ( the first two rules by propositions [ spekmspekarekbp ] and [ subsysarekbptoo ] , and the third simply by its definition as the closure under composition of a set of generators ) .
it is in this sense that we earlier remarked that * mspek * is a strong candidate for the process category of the toy theory .
we achieved our goal stated in the abstract , that is , to provide a rigorous mathematical description of spekkens toy theory , which proves its consistency .
this was established both in terms of generators for a dagger symmetric monoidal subcategory of * frel * , consisting of symmetries for the elementary system and a basis structure ( and nothing more ! ) , as well as in terms of an explicit description of these relations as in theorems [ internalnonphasedth ] , [ externalnonphasedth ] and [ mspeknumbers ] .
this description meanwhile already has proved to be of great use , for example , in pinpointing what the essential structural difference is between the toy theory and the relevant fragment of quantum theory . in joint work with spekkens in @xcite
we showed that the key difference between the toy theory and relevant fragment of quantum theory is the _ phase group _ _ , a group that by pure abstract nonsense can be attributed to each basis structure . in the case of the toy theory
this phase group is @xmath368 while in the case of the relevant fragment of quantum theory it is @xmath369 .
one can then show that it is this difference that causes the toy theory to be local , while the relevant fragment of quantum theory is non - local .
_ _ _    in this context , one may wonder wether there is a general categorical construction which would turn a ` local theory ' like * spek * into a non - local one .
we also expect that the construction in this paper can be fairly straightforwardly extended beyond qubit theories , for example to qutrits @xcite .
s.  abramsky ( 2009 ) _ no - cloning in categorical quantum mechanics__. in : semantic techniques for quantum computation , i.  mackie and s.  gay ( eds ) , pages 128 , cambridge university press .
_    s.  abramsky and b.  coecke ( 2004 ) _ a categorical semantics of quantum protocols__. in : proceedings of 19th ieee conference on logic in computer science , pages 415425 .
ieee press .
arxiv : quant - ph/0402130 . revised version ( 2009 ) :
_ categorical quantum mechanics__. in : handbook of quantum logic and quantum structures , k.  engesser , d.  m.  gabbay and d.  lehmann ( eds ) , pages 261323 .
_ _ _ _ _        b.  coecke and r.  duncan ( 2008 ) _ interacting quantum observables__. in : proceedings of the 35th international colloquium on automata , languages and programming ( icalp ) , pages 298310 , lecture notes in computer science 5126 , springer - verlag .
extended version ( 2011 ) : _ interacting quantum observables : categorical algebra and diagrammatics__. new journal of physics * 13 * , 043016 .
arxiv:0906.4725 _ _ _ _ _ _        b.  coecke and e.  o.  paquette ( 2011 ) _ categories for the practicing physicist__. in : new structures for physics , b.  coecke ( ed ) , pages 167271 .
lecture notes in physics , springer - verlag .
_    b.  coecke and d.  pavlovic ( 2007 ) _ quantum measurements without sums__. in : mathematics of quantum computing and technology , g.  chen , l.  kauffman and s.  lamonaco ( eds ) , pages 567604 .
taylor and francis .
arxiv : quant - ph/0608035 .