aa r X i v : . [ m a t h . C T ] F e b When Only Topology Matters
Titouan Carette
CNRS, LORIA, Inria Mocqua, Universit´e de Lorraine, F 54000 Nancy, [email protected]
Abstract —Graphical languages are symmetric monoidalcategories presented by generators and equations. Thestring diagrams notation allows to transform numerousaxioms into low dimension topological rules we are com-fortable with as three dimensional space citizens. Thisaspect is often referred to by the
Only Topology Matters paradigm (OTM). However OTM remains quite informaland its exact meaning in terms of rewriting rules isambiguous. In this paper we define three precise aspectsof the OTM paradigm, namely flexsymmetry, flexcyclicityand flexibility of Frobenius algebras. We investigate howthis new framework can simplify the presentation of knowngraphical languages based on Frobenius algebras.
I. I
NTRODUCTION
Motivation:
A great amount of the elegance of graphicallanguages, like the ZX[1], ZW [2], ZH [3] and ∆ ZX-calculus [4], comes from the fact than they can be manip-ulated as graphs. This allows intuitive graphical manip-ulations and then simpler implementation into graphicalproof assistant softwares [5]. When a graphical calculushas such properties we say informally that
Only TopologyMatters (OTM) [1]. However there is no universallyaccepted formal definition of the OTM paradigm. In factvarious authors gather different properties under OTMfrom general coherence results for monoidal categoriesto specific properties of internal structures. Among them,Frobenius algebras have been identified as one of thekey structure carrying this feature and specific rewritingprocedures have been studied in this context [6]. Notonly they come with a simple graphical calculus but theyalso automatically provide a compact structure allowingto bend the wires. However, some graphical calculi ofinterest, even if they are built from Frobenius algebras,fail to satisfy the OTM paradigm in a broad sense.Examples are graphical linear algebra (GLA) [7] or thequtrit ZX-calculus [8].
Contribution:
We propose a formal definition ofparadigms in graphical language design as a way to keepimplicit some generators and equations that are consid-ered more fundamental than the others. We present twosuch paradigms: flexsymmetry and flexcyclicity, two for-mal interpretations of the OTM paradigm. Flexsymmetrycorresponds to seeing a diagram as an open graph with generators as vertices. Flexcyclicity adds a cylic orderingon the incident edges for each vertices. We provide anotion of Flexsymmetric graphical language and exhibita construction of the category of free flexsymmetriclanguages called Σ -graphs . We study flexsymmetry withrespect to different compact structure and define thesubdivision of graphical languages as a way to recoverflexsymmetry when needed. We characterize Frobeniusalgebras (FA) as flexcyclic monoids. Then we focuson the behavior of Frobenius algebras in the presenceof a compact structure. Aside from flexsymmetry weidentify a flexibility property as the key point in seeingFAs as graphs. The main example of subdivided theoryare subdivided FAs, which are present in both the ZW and ZH -calculus. Through subdivision we obtainflexcyclic languages by transforming non flexcyclic FAsinto flexcyclic subdivided FAs. As an application wegive flexsymmetric presentations of different graphicallanguages, namely: GLA [9] and graphical group alge-bras for finite abelian groups, a family of calculi whichcontains a fragment of qutrit ZX-calculus [8] as a specialcase. Finally we apply the subdivision method to givessome insights on ZX and ZW -calculus. Related work:
The OTM paradigm have been intro-duced in [1] and mentioned in almost all ZX-calculuspapers since. Attempt to capture similar topologicalproperties have been made using hypergraph categories[10] or string graphs [11]. A version of the softeningtechnique is used in [12].
Structure of the paper:
The first section starts witha review of the foundations of graphical languagessetting the notations and ends with the introduction ofparadigms. The second section defines flexsymmetry,flexcyclicity as such paradigms and provides an explicitconstruction of free flexsymmetric graphical languages.The section 3 reviews the basics of Frobenius algebrasthat we characterize as flexcyclic monoids. Section 4introduces the subdivision of graphical languages as away to obtain flexsymmetry. The section 5 focus onthe application of subdivision to Frobenius algebras.Finally, the section 6 illustrates by various examples howubdivision is used on concrete graphical languages fromthe literature.II. G
RAPHICAL LANGUAGES
This section is about the categorical foundations ofgraphical language design. The first subsections exposesclassical results in categorical universal algebra and setthe notations necessary to state , in the last subsection,the definition of paradigms. We consider graphical lan-guages in the framework of props.
A. String diagrams A prop is a symmetric strict monoidal category whosemonoid of objects is freely generated by one element .Denoting the tensor additively, each object is denoted bya natural number n and is the tensor unit. Props admita graphical notation called string diagrams [13], see [14]for a survey.A morphism of type n → m is depicted as a diagramwith n inputs and m outputs. We draw our diagrams frombottom to top. Composition corresponds to pluggingdiagrams. The identity is depicted by parallel wires. Thetensor product corresponds to diagram juxtaposition andthe tensor unit is the empty diagram. D ...... D ... D ...... ... D ...... D ...... D D ◦ D id n D ⊗ D id The axioms of strict monoidal categories are built inthe string diagram notation. We can extend the notationto symmetries by adding a swap generator of type → . = D ...... ... = D ......... σ involution naturality There is a category
Prop of props and morphisms ofprops that are symmetric strict monoidal functors. Thiscomplete and cocomplete category have been studied in[15].
B. Cups and caps
Self-dual compact structures provide additional gen-erators and equations that fit particularly well with thestring diagram notation for props.
Definition 1 (Compact structure):
A self dual compactstructure C in a prop P is given by a pair of morphisms:the cup : 0 → and the cap : 2 → satisfying the snake equations: = = . It is said symmetric if furthermore: = and = . In this paper if not explicitly said all compactstructures will be considered symmetric.
In presence of a symmetric compact structure the transpose of a diagram is defined by : D ...... t def = D ...... ............ ...... Compact structures will play a prominent role in theremaining of this paper.
C. Categorical equational theories
A prop can be described by generators and equations.Such a presentation is what we call a graphical language.This subsection presents reformulations of folklore re-sults in categorical universal algebra. Let it be clear that ,except the notations, nothing here is new. We rely heavilyon the monadic adjunction of [16] and results from [17].Our goal is to set up the notations for the next sectionintroducing paradigms. Our presentation is very syntacticand might surprise people used to set based universalalgebra. We’ll attempt to make the correspondence withmore common formalisms as clear as possible. Proofsare provided for the sake of completeness.A signature is an object of the functor category
Set N × N , where N is seen as a discrete category. Asignature Σ represents a family of generators withdifferent types. Σ[ n, m ] is the set of generators of type n → m . | Σ | def = U n,m ∈ N Σ[ n, m ] is the set of allgenerators of any type. Usually in universal algebra asignature is a set of symbols with an arity function. Thisis equivalent, we just have chosen to sort the generatorsby arity from the beginning. We recover the usual pictureby setting an arity function | Σ | → N × N which mapseach generator to the hom set it came from.There is a forgetful functor U : Prop → Set N × N such that ( U P )[ n, m ] def = P [ n, m ] . This functor gathersinto one signature all morphisms in a prop. U is shownto be monadic in [16]. In other words, it has a leftadjoint: the free functor F : Set N × N → Prop , suchthat
Prop is equivalent to the Eilenberg-Moore categoryof the monad U ◦ F . The free functor F maps asignature to the free prop generated by it. A morphism in ( F Σ)[ n, m ] is a diagram with n inputs and m outputsmade of generators in | Σ | and swaps combined usingtensor and composition. Those diagrams are quotientedby the topological rules corresponding to the axioms of2ymmetric strict monoidal categories. From now on, inthis paper, when we say diagram we will always referto a morphism in F Σ .The monad U F maps a signature Σ to the signaturegathering all the diagrams we can built from the gener-ators in | Σ | . Prop Set N × N FU ⊣ An equation of type n → m is a pair of diagrams ( f, g ) with f, g ∈ ( F Σ)[ n, m ] . Categorically, a pair isdescribed by two functions of type → U F [ n, m ] andthen a familly of equations is a parallel pair of signaturemorphisms l, r : E → U F Σ . E [ n, m ] is the set of names of equations of type n → m . The functions l n,m and r n,m map the name of an equation respectively to its leftand right hand side. A graphical language is a signaturetogether with a family of equations. Definition 2 (Graphical language): A graphicallanguage is a pair L def = (Σ L , E L ) where E L def = ( E L , l L , r L ) with Σ L , E L : Set N × N and l L , r L : E L → U F Σ L . Σ L is called the signature of L and E L the equations of L .This definition is more syntactic than most definitionsof equational theories. For example, exchanging the rightand left hand side of an equation gives a differentgraphical language in a strict sense. Of course, thosetwo graphical languages still describe the same prop. Definition 3 (Models and interpretations):
Given agraphical language L , let L be the following coequalizerin Prop : F E F Σ L π L ǫ Σ ◦ F lǫ Σ ◦ F r .A model of L is given by a prop P and a prop morphism,called interpretation , J K : L → P . A graphicallanguage L is said universal , respectively complete ,for a model P if the interpretation is full, respectivelyfaithful.Taking the identity as interpretation, L is a universaland complete model of L . Definition 4 (Translations):
Given two graphical lan-guages L and Y , a translation α : L → Y is a givenby a signature map α : Σ L → U F Σ Y satisfying the soundness condition : π Y ◦ ( ǫ F Σ Y ◦ F α ) ◦ ( ǫ F Σ L ◦ F r L ) = π Y ◦ ( ǫ F Σ Y ◦ F α ) ◦ ( ǫ F Σ L ◦ F l L ) .A translation α : L → Y maps the generators of L to diagrams in Y . The soundness condition ensures that two diagrams that are equivalent modulo the equationsof L will still be equivalent modulo the equations of Y after the translation. In other words, that the translationinduces a well defined prop morphism α : L → Y . Proposition 1:
A translation α satisfies the soundnesscondition iff there is a morphism of prop α such that: α ◦ π L = π Y ◦ ( ǫ F Σ Y ◦ F α ) . If it exists then α is unique.Graphical languages and translations form a category GL with a full functor : GL → Prop defined by
L 7→ L and α α . Proof in A. Proposition 2 (Quotient):
The quotient of a graphicallanguage L by a set of equations E def = ( E, l, r ) is definedby: L / E def = (Σ L , E L + E, [ l L , l ] , [ r L , r ]) . F E
L L / E π L / E π L ◦ ǫ F Σ L ◦ F lπ L ◦ ǫ F Σ L ◦ F r is a coequalizer in
Prop . Proof in A.Quotienting amounts to add new equations to a lan-guage. Given a signature Σ we define !Σ as the freegraphical language over Σ with no equations. The emptyfamily of equation is defined as ∅ Σ def = ( ∅ , ! UF Σ , ! UF Σ ) where ! UF Σ : ∅ → U F Σ is the unique map from ∅ . There is a functor ! : GL → Prop defined by Σ (Σ , ∅ Σ ) and f η Σ ′ ◦ f . We have !Σ = F Σ . Thisjustify the abuse of notation which is to see a signatureas a graphical language by writing Σ instead of !Σ whenthe context is clear. Hence, for any graphical language L we can write L = Σ L (cid:14) E L . This follows directly fromthe definitions. Proposition 3 (Sums):
Given two graphical languages L and Y , the sum of the two famillies of equations E L and E Y is defined by: E L + E Y def = ( E L + E Y , l L + Y , r L + Y ) .Where l L + Y def = [ U F ( ι Σ L ) ◦ l L , U F ( ι Σ L ) ◦ l Y ] and r L + Y def = [ U F ( ι Σ L ) ◦ r L , U F ( ι Σ L ) ◦ r Y ] . The sum of L and Y is defined by: L + Y def = (Σ L + Σ Y ) . ( E L + E Y ) . L + Y is the coproduct of L and Y in Prop . Proof inA.Note that L + Y is not a coproduct in GL , only itsimage by is, in Prop .When we have a family of equations E def = ( E, l, r ) fora signature Σ , we can naturally extend it to the signature Σ + Σ ′ by ( E, U F ( ι Σ ) ◦ l, U F ( ι Σ ) ◦ r ) . When there isno ambiguity we will use the same notation for both fam-ilies. This allows to write: L + (cid:0) Y / E (cid:1) = ( L + Y ) / E .From the definitions we also have: (cid:0) L / E (cid:1) / E ′ = L . ( E + E ′ ) .3 . Paradigms With those definitions we are ready to state the defi-nition of the notion of paradigms in graphical languagedesign. The idea is to promote some generators and equa-tions as more fundamental than the others. So we abstractthem into a monad and define a new kind of graphicallanguage in which these generators and equations aresystematically embedded. To provide a concrete exam-ple, monoids are semi-groups that always come with anadditional generator, the unit, and additional equations,the unit laws. We can see monoids as a paradigm oversemi groups and then work in the framework of monoidswhere the unit is always implicitly there and satisfies thesame implicit unit laws.
Definition 5: A paradigm P is given by a sig-nature Σ P of paradigmatic generators , a functor E P : Set N × N → Set N × N and two natural transfor-mations l P , r P : E P ⇒ U F ( + Σ P ) defining foreach signature Σ a family of paradigmatic equations : E P Σ def = (cid:0) E P Σ , l P Σ , r P Σ (cid:1) .Paradigmatic generators are shared by all paradig-matic languages. The paradigmatic equations involveboth paradigmatic generators and the other generators.We require that the paradigmatic equation depends onthe signature in a natural way. Given a paradigm P , weconstruct the following diagram: PropSet N F P U P Prop P GLGL P FU !! P ( ) P ⊣ ⊢ P { } P The category of paradigmatic graphical languagesGL P is a subcategory of GL . The objects arethe graphical languages of the form of the form: (Σ L + Σ P ) .(cid:0) E L + E P Σ L (cid:1) incorporating the paradig-matic generators and equations. The arrows are thetranslations of the form [ α, U F ( ι Σ P ) ◦ η Σ P ] mapingparadigmatic generators to paradigmatic generators. Thefaithful inclusion functor is denoted { } P : GL P → GL .The category of paradigmatic props Prop P is theimage of GL P by the functor { } P . Prop P is a sub-category of Prop and the faithful inclusion functor isdenoted ( ) P : Prop P → Prop . We have by definitiona pullback square, (cid:16) L P (cid:17) P = {L} P : { } P Prop P ( ) PP GL P GLProp
Given a signature we can construct the free paradig-matic graphical language over it.
Lemma 1:
There is a functor ! P : Set N × N → GL P defined by Σ (Σ + Σ P ) . E P Σ and f [ U F ( ι Σ ′ ) ◦ η Σ ′ ◦ f, U F ( ι Σ P ) ◦ η Σ P ] . Furthermore: ǫ Σ ′ +Σ P ◦ ! P f = F ( f + id Σ P ) . Proof in A.The functoriality of ! P follows from the definition ofparadigmatic equations by natural transformations. Wedefine F P def = P ◦ ! P and U P def = U ◦ ( ) P . F P sends asignature to the free paradigmatic prop. U P is a forgetfulfunctor from paradigmatic props to signatures. Theorem 1: F P ⊣ U P is a monadic adjunction. Proofin A.This adjunction provides a monad over Set N × N . Wehappen to be in the same situation than before with F ⊣ U . Defining graphical languages with respect tothis new monad gives us exactly GL P . We can nowwork with paradigmatic graphical languages wherethe paradigmatic generators and equations are implicitlyembeded in the language. If needed, we can still use thefunctors ( ) P and { } P to work in props and then showthat we can go back in the paradigm. Example 1:
A self-dual compact structure is an exam-ple of a simple paradigm. Cup and cap are the paradig-matic generators and the snake equation the paradigmaticequation. It is simple because the paradigmatic equationdoes not depend on the non-paradigmatic generators.Straightforwardly self-dual symmetric compact structureis also a paradigm S defined by: Σ S def = { , } and E S def = ( = , = ) . Example 2:
Our definition of paradigm generalizesto any monad over
Set N . So props can be seen as aparadigm over pros. The swap generator and the natu-rality equations are the implicit paradigmatic generatorsand equations.Iterating the paradigms can be tricky. In our construc-tion the paradigmatic generators of the first paradigmwould not contribute to the paradigmatic equations ofthe second. To avoid such technicalities we will alwaysdefine clearly our paradigms in one step starting fromprops, even if some more involved presentation mightbe possible.4II. F LEXSYMMETRY AND FLEXCYCLICITY
This section presents a first attempt to formalize theOTM paradigm.
A. DefinitionDefinition 6 (Flexsymmetry and flexcyclicity):
The flexsymmetry paradigm F is defined by: Σ F def = Σ S and E F def = E S + {F D,σ , ∀ D ∈ Σ[ n, m ] , ∀ σ ∈ S n + m } where F D,σ is the flexsymmetry equation: D σ ... ............... = D ............ where σ is a permutation of n + m elements.The flexcyclicity paradigm C is defined by: Σ C def = Σ S and E C def = E S + {C D , ∀ D ∈ Σ[ n, m ] } where C D is the flexcyclicity equation: D ............ ...... = D ............ .In any graphical language L with a compact structurewe say that a diagram D is flexsymmetric if F D,σ holdsin L for all permutations σ . We say that a diagram D is flexcyclic if F D holds in L . So flexsymmetry impliesflexcyclicity.Those properties simplify the implementation into agraphical proof assistant, telling which data structure canbe used to represent diagrams faithfully. As we write,the graphical proof assistants Quantomatic [5] and Pyzx[18] are only able to handle flexsymmetric languages,leading to difficulties when one wants to implement nonflexcyclic generator like the triangle of ∆ ZX [4]. B. Σ -graphs We now make precise the correspondence betweenflexsymmetric languages and graphs by giving an explicitconstruction of F F Σ . This provides a possible imple-mentation of flexsymmetric graphical languages using Σ -graphs . Definition 7 ( Σ -graphs): Given a signature Σ , a Σ -graph is a tuple ( G, i, o, l ) . G is a colored multi graph.The set of colors is { x, ∃ n, m ∈ N x ∈ Σ( n, m ) } ⊎{ I, O } . We call input vertices , respectively outputvertices , and denote In ( G ) , respectivly Out ( G ) , the setof vertices colored with I , respectively O . The othervertices are called generator vertices . G must satisfy: • A vertex in In ( G ) S Out ( G ) has degree one. • A generator vertex, colored in x ∈ Σ( n, m ) , hasdegree n + m . i : J , | In ( G ) | K → In ( G ) and o : J , | Out ( G ) | K → Out ( G ) are bijective labeling functions. l ∈ N is calledthe loop count .Each generator vertex corresponds to a generator inthe signature. The inputs and outputs vertices correspondrespectively to the inputs and outputs of diagrams. Fora Σ -graph G the notation G : a → b means that a = | In ( G ) | and b = | Out ( G ) | . A Σ -graph is representedgraphically as G indexed by its loop count l . Definition 8 ( Σ -graph isomorphism): Two Σ -graphsare said isomorphic if there is a graph isomorphismpreserving the colors and the labeling of inputs andoutputs between them, and they have the same loopcount.We define the composition of two Σ -graphs intuitivelyby plugging outputs into inputs. Definition 9 (Composition of Σ -graphs): The compo-sition H ◦ G of a Σ -graph G : a → b with a Σ -graph H : b → c is constructed as follow: • Take the disjoint union of the two graphs G + H , we call interface vertices the vertices in In ( H ) S Out ( G ) . • For all ≤ j ≤ b add an edge ( i H ( j ) , o G ( j )) . Noweach interface vertex has degree . • Remove all cycles of interface vertices, let k be thenumber of cycles removed. • Replace all chain of interface vertices between noninterface vertices x and y by an edge ( x, y ) .Then In ( H ◦ G ) def = In ( G ) , Out ( H ◦ G ) def = Out ( H ) , i H ◦ G def = i G , o H ◦ G def = o H and l H ◦ G = l G + l H + k .In the construction the only cycles that can occur arethose arising from the composition of and . Thiscreates a loop that is taken into account by incrementingthe loop count of H ◦ G . Example 3:
We compute ! a ◦ ! b We start by the union graph, coloring the interfacevertices in grey: → → →
211 2
We had to remove one cycle so here k = 1 . Finally: ! a ◦ ! b =
211 2 a + b +1 We define a tensor of Σ -graphs by taking the uniongraph and relabeling the inputs and outputs. Definition 10 (Tensor of Σ -graphs): The tensor H ⊗ G of a Σ -graph G : a → b with a Σ -graph H : c → d is the disjoint union of the two graphs G + H . We5et In ( G ⊗ H ) def = In ( G ) S In ( H ) , Out ( G ⊗ H ) def = Out ( G ) S Out ( H ) , l G ⊗ H = l G + l H , i G ⊗ H ( j ) def = i G ( j ) if j ≤ a and else i H ( j − a ) , o G ⊗ H ( j ) def = o G ( j ) if j ≤ b and else o H ( j − b ) . Example 4:
The only subtlety here is the relabeling: ! a ⊗ ! b = ! a + b Proposition 4:
The category Σ -gr with objects thenatural numbers and morphisms the Σ -graphs up to Σ -graph isomorphism is a self-dual compact closed prop.Proof in A.The link between Σ -graphs and the flexsymmetryparadigm is given by the following lemma: Theorem 2: Σ -gr ≃ F F Σ . Proof in A.A flexsymmetric graphical language can be soundlyrepresented by a Σ -graphs quotiented by equations.The flexsymmetry paradigm corresponds to the OTMparadigm in the following sense: diagrams are basi-cally graphs. In the case of flexcyclic languages, oneneeds also to keep information about the cyclic orderof the inputs and outputs. This could be done witha corresponding notion of Σ -graphs equipped with arotational system, that is a cyclic ordering on all theincident edges for each vertex. This implies that underthe flexcyclicity paradigm, diagrams are basically port-graphs. If flexsymmetry and flexcyclicity are on somepoints satisfying formalizations of the OTM paradigmthere is still one aspect of it that require more attention.In fact in the Z ∗ family of OTM graphical languages,the OTM paradigm is always stated in reference to someproperties Frobenius algebras. We will see in the nextsection that those properties are not exactly reducible toflexsymmetry and flexcyclicity.IV. F LEXIBILITY OF F ROBENIUS ALGEBRAS
Frobenius algebras (FA) have been extensively studiedin representation theory and have recently experienced arenewed interest in the context of topological quantumfield theory [19], quantum foundations [20] and evennatural language processing [21]. See [22] for a surveyon graphical aspects. A cause of this multidisciplinaryinterest is their intuitive topological calculus.
A. Spiders
The graphical language of Frobenius algebras is givenin Table I. If furthermore we add the equation C weobtain a Commutative
Frobenius Algebra (CFA). Byadding the equation S we get a Special
FrobeniusAlgebras (SFA).
TABLE IT
HE LANGUAGE F OF F ROBENIUS ALGEBRAS Σ F E F = = = C = S = = == = = Given an FA one can define a family of n -ary gener-ators called spiders in an inductive way. Definition 11 (spider):
Given an FA the spiders s n,m = ...... of arity ( n, m ) are defined by: . . .... s , s , s , s , s n,m An important property of special Frobenius algebras isthat all the rules can be summarized into one meta rule.This is the spider theorem originally proved in [23], see[20] for a graphical presentation.
Theorem 3 (spider theorems):
Spiders arising froman FA, respectively an SFA, satisfy the fusion rule ...... ...... = ...... ...... , respectively the special fusion rule ...... ...... ... = ...... ...... where there is at least onehorizontal wire. For now on when a theory contains an FA oran SFA we will just write the generic generator s n,m and the fusion or special fusion equation as ashortcut for Σ F and E F or E F + S . FAs admit a very compact flexcyclic definition fromthe theory of monoids given in Table II. The flexcyclic(flexsymmetric) language of monoids is equivalent to thelanguage of (commutative) Frobenius algebras.
Lemma 2: ( M C ) C ≃ F , ( M F ) F ≃ F / C and (cid:16) M C / B (cid:17) C ≃ F / S . Proof in A.6 ABLE IIT
HE LANGUAGE M OF M ONOIDS Σ M E M = = = B = Thus, in a flexcyclic theory we will use spiders andspider fusion as a shortcut for Σ M and E M or E M + B . B. Flexibility
Any FA F defines a possibly non-symmetric compactstructure: and . This allows to define differentproperties of FAs depending on the properties of theirinduced compact structures: = (cid:18) (cid:19) t = ! t = symmetric upbent cross-upbent A commutative FA is always symmetric and in thiscase being up bent and cross up bent is equivalent. Ourmain concern with respect to flexcyclicity is to studyhow an FA interacts with another symmetric compactstructure. The OTM paradigm is often associated to thefollowing property:
Definition 12:
An FA is said flexible if = = .Plugging the counit we see that an FA is flexiblewith respect to a compact structure iff this compactstructure is the one induced by the FA. An FA is said self-transpose if = (cid:18) (cid:19) t . The flexcyclicity of anFA does not implies its flexibility. A flexcyclic FA canindeed be seen as a graph but then the monoid and thecomonoid will be two different kind of vertices of degree . They can be identified only if the FA is flexible. Inthis sense, flexibility is the right notion of OTM forFrobenius algebras. The precise link between flexibilityand flexcyclicity is stated in the following lemma. Lemma 3:
An FA is flexible iff it is flexcyclic andself-transpose. Proof in A. In a flexcyclic setting if we see an FA as a flexcyclicmonoid the compact structure induced is directly thecanonical one, so the FA is directly flexible. In conse-quence, we claim that the interesting structures withrespect to the OTM paradigm are not Frobeniusalgebras but flexcyclic monoids . C. Dualizer
Given a non-flexible FA, trying to make it fit theflexibility equation, we obtain: = . Thissuggests that we can quantify the defect of flexibilityby defining the dualizer d : d def = d t def = d − def = ( d t ) − def = An FA is flexible iff d = id . We recover the Nakayamaautomorphisms: α def = d t ◦ d − and α − def = d ◦ ( d t ) − see [22] for details. We can rephrase previous propertiesusing the dualizer: symmetric ⇔ d = d t , upbent ⇔ d = ( d t ) − and cross - upbent ⇔ d = d − . Any two ofthose properties imply the third one. Definition 13:
An FA is said d - compatible with re-spect to a compact structure if d is a self-transposedinvolution, in other words d = d t = d − = ( d t ) − .Compatibility has a strong link with flexibility, the twoproperties can be exchanged by changing the compactstructure, this will be made precise in the next section.Compatibility will be the condition for an FA to bedeformed into an other flexcyclic structure. But beforethis we need to introduce the subdivision of a graphicallanguage.V. S UBDIVISION OF GRAPHICAL LANGUAGES
The goal of this section is to find conditions whenwe can transform a graphical language into anotherequivalent flexcyclic one. We need to be very careful willmanipulating equational theories as diagrams substitu-tion in the equations can have unexpected consequences.
A. Cup-cap switch
The definition of flexcyclicity implies the choice of acanonical symmetric compact structure. However it mayhappen that different symmetric compact structure areavailable in a same prop. Given a prop with two sym-metric compact structures { , } and { , } ,the dualizer d : 1 → is defined as:7 ef = . It is an invertible map with inverse . It isself transpose for both compact structure. Furthermorewe have: = and = . We say the the twostructures are compatible if the dualizer is an involution.In this case we can use the notations = and = . In fact the dualizer of a Frobenius algebradefined in the previous section is exactly the dualizer ofits induced compact structure with the canonical one.The definition of compatibility also matches. In thissubsection we always work under the paradigm S soevery graphical language comes with a canonical com-pact structure. We want to replace the canonical compactstructure by another one without changing the prop. Tosimplify the presentation we restrict ourselves to thecompatible case. The idea is to replace all occurrencesof cups and caps in the equations by the modifiedversion composed or precomposed with the dualizer d .This is simple but making it formal requires some care,especially if the diagram representing the dualizer itselfinvolves cups and caps. To avoid such circles we firstadd freely a generator. Let Y def = { Y : 1 → } . We thenimplement the substitution on all equations but with thenew generator Y instead of the dualizer. Finally, we addthe equation Y = d . Definition 14 (cupcap switch):
Let L be a graphi-cal language under the paradigm S , since we act ex-plicitly on the paradigmatic generators we work with ( L ) S = (cid:0) Σ + Σ S (cid:1) .(cid:0) E + E S Σ (cid:1) . Let Z ∈ F (Σ L + Σ S ) be a diagram such that π L Z is a self-transposed in-volution in {L} S . Let s Z : Σ S → U F (cid:0) Σ S + Y (cid:1) bedefined by and . We define s Z L def = (cid:0) Σ + Σ S + Y (cid:1) .(cid:0) E s z + { Y = s ′ Z Z } + E S Σ (cid:1) .With s ′ Z def = [ U F ι Σ S + Y ◦ µ Σ S + Y ◦ U F s z , U F ι Σ ◦ η Σ ] and E s Z def = (
E, s ′ Z ◦ l, s ′ Z ◦ r ) . Since E S Σ = E S Σ+ Y , s Z L is also a paradigmatic language for S .In practice the dualizer will often be a generator of L and then the process really just amounts to replace thecups and caps. The cup-cap switch leads to an equivalentlanguage. Lemma 4: L S ≃ s Z L S . Proof in A.In general, a generator which is flexsymmetric (flex-cyclic) for a given symmetric compact structure will notbe flexsymmetric (flexcyclic) for another. However itsatisfies the flexsymmetry (flexcyclicity) equation up tothe dualizer if the two compact structures are compatible: D σ ... ............... = D ............ . It is then natural to define a transforma- tion that add the necessary dualizers to diagrams in orderto recover flexsymmetry (flexcyclicity). This is exactlythe point of subdivision. B. Subdivision
As for cup-cap switch the idea of subdivision is simplebut require attention to avoid circles. We replace eachoccurrences of some generators in the equations by thesame generators composed by dualizers.
Definition 15 (Subdivision of diagrams):
Provided asignature Σ , a sub signature ∆ ⊆ Σ and a diagram Z ∈ F (Σ)[1 , . The subdivision is define as: S Z | ∆ : Σ → U F (Σ) x ∈ Σ( n, m ) ( x ◦ Z ⊗ n if x ∈ ∆( n, m ) x if x / ∈ ∆( n, m ) The name subdivision comes from the fact that thisoperation correspond to the subdivision of the underlyinggraph.
Example 5:
A Subdivision with Σ def = (cid:26) , , (cid:27) , Z def = and ∆ def = (cid:26) (cid:27) gives: S Z | ∆ : .We now extend this to the whole graphical language.We will always subdivide by an invertible morphism. Definition 16 (Subdivision by an invertible):
Given agraphical language L , a subset ∆ ⊂ Σ L , and a diagram Z ∈ F (Σ L )[1 , such that π L ( Z ) is invertible in L .The subdivision of L by Z is defined by: § Z | ∆ L def =(Σ L + Y ) . E § with E § def = { S Y | ∆ ( a ) = S Y | ∆ ( b ) , a = b ∈ E L } + { Y = S Y | ∆ ( Z ) } .Subdividing a graphical language does not change itscorresponding prop. Lemma 5:
Given a graphical language L , a subset ∆ ⊂ Σ L , and a diagram Z ∈ F (Σ L )[1 , such that π L ( Z ) isinvertible in L then L ≃ § Z | ∆ L . Proof in A.As promised subdivision can be used together withcup-cap switch to act on flexsymmetry. Lemma 6:
Given a graphical language L , a subset ∆ ⊂ Σ L , and a diagram Z ∈ F (Σ L )[1 , such that π L ( Z ) isinvertible and self-transposed in L . L ≃ s Z § Z | ∆ L anda generator g ∈ ∆( n, m ) is flexcyclic (flexsymmetric)in L iff it is is flexcyclic (flexsymmetric) in s Z § Z | ∆ L .Proof in A.A cup-cap switch composed by a subdivision by thedualizer preserves flexcyclicity.8I. H ARVESTMAN AND SOFTENING
Now that cup-cap switch and subdivision are defined,we come back to Frobenius algebras. We first state theannounced result that we can exchange compatibility andflexibility.
Lemma 7: A d -compatible FAs in L is a flexible FAsin s d L and vice-versa. Proof in A.Subdividing FAs provides an interesting structure. Let I def = (cid:0) Z : 1 → , { Z = id } (cid:1) and ∆ def = (cid:26) , , , (cid:27) ,remember that we took the convention to write ...... instead of ∆ in a graphical languages without anyparadigm. A subdivided Frobenius algebra ( § FA) is de-fined by the language § F def = § Z | ∆ ( F + I ) . The graphicalpresentation of § F is given in Table III. TABLE IIIT
HE GRAPHICAL LANGUAGE § F OF SUBDIVIDED F ROBENIUSALGEBRAS Σ § F E § F = = = = == == = § S = Subdivision provides a translation
L → § Z | ∆ L thatallows to translate directly some results to the subdi-vided version, just by subdividing everything. We callthe subdivided version of Theorem 3 the harvestmantheorem . Theorem 4 (harvestman theorem):
Given a § FA onecan uniquely define the harvestmen with n inputs and m outputs as h n,m def = § Z | ∆ s n,m satisfying a fusion rule ...... ...... = ...... ...... . If the FA is special we even havea special fusion rule ...... ...... ... = ...... ...... . Such structures already appeared in ZW[2] and ZH-calculus[3]. The equivalence § F ≃ ( F + I ) gives aninteresting insight on harvestman. We can see them astwo different FAs that can be translated into each otherusing an involution. If the involution happens to be an FAmorphism then the two FAs coincide and the harvestmanis just an FA composed with an FA morphism. We alsodirectly have a characterization in term of flexsymmetricsubdivided monoid § M , the language is given in TableIV. Lemma 8: ( § M C ) C ≃ § F , ( § M F ) F ≃ § F (cid:14) § C and (cid:16) § M C (cid:14) § B (cid:17) C ≃ § F (cid:14) § S . TABLE IVT
HE LANGUAGE § M OF SUBDIVIDED MONOIDS Σ § M E § M = = = = § B = In a flexcyclic context we will use the same shortcutwith § FAs than with FAs. We say that a § F A is flexibleif = = .Given a compatible FA, if we subdivide it by thedualizers, we obtain a flexible § F A . We call this process softening . Lemma 9: A d -compatible FA in L becomes a flexible § FA in § d | ...... L . Proof in A.Note that softening a flexible FA leave it unmodifiedsince the dualizer is then the identity. Applications ofsoftening are given in the next section.VII. E XAMPLES AND APPLICATIONS
In this section we investigate various concrete appli-cation of cup-cap switch, subdivision and softening.
A. Flexsymmetric ∆ ZX-calculus
The ∆ ZX-calculus was introduced in [4]. This lan-guage was difficult to implement in Quantomatic be-cause of the triangle generator: r z = (cid:18) (cid:19) . With9espect to the canonical compact structure of ∆ ZX, thisgenerator is only flexcyclic up to the NOT gate withinterpretation: (cid:18) (cid:19) . Subdividing the triangle by thisNOT dualizer gives a flexsymmetric language.
B. Flexsymmetric graphical linear algebra
Graphical linear algebra (GLA) is a complete graph-ical language for linear relations over Q , that is linearsub-spaces of Q n × Q m . A complete technical introduc-tion can be found in the thesis [9]. An entertaining andvery accessible presentation is [24]. This language relieson a two spiders and an antipode with interpretations: s ...... { def = { (( x, · · · , x ) , ( x, · · · , x )) , x ∈ Q } s ...... { def = ( ( −→ x , −→ y ) , P i x i = P j y j ) q y def = { ( x, − x ) , x ∈ Q } r z def = { (( x, y ) , ( y, x )) , x, y ∈ Q } J K def = { (( x, x ) , , x ∈ Q } J K def = { (0 , ( x, x )) , x ∈ Q } where −→ x def = ( x , · · · , x n ) and −→ y def = ( y , · · · , y m ) .The white FA is -compatible. Softening it gives aflexible § FA, ...... def = ...... , with interpretation: s ...... { = ( ( −→ x , −→ y ) , P i x i + P j y j = 0 ) we see directly in the interpretation how softening hasbroken the asymmetry between inputs and outputs. Onehas then a complete flexsymmetric graphical languagegiven in Table V.See [9] for detailed explanations. The reduction of thenumber of axioms seems radical but a lot of the originalrules are in fact hidden into spiders or redondant underflexsymmetry. C. Flexcyclic Graphical Group Ring
It has been pointed many times that ZX-calculus is aparticular case of a graphical calculus for group rings[25], [26], [27]. Here we restrict to the group algebraover C for a finite group G . This is our only flexcyclicexample which is not flexsymmetric. TABLE VT
HE FLEXSYMMETRIC GRAPHICAL LANGUAGE
GLA Σ GLA ...... ...... E GLA ...... ...... ... = ...... ...... ...... ...... ... = ...... ...... = = ∀ k > , kk = kk == = = = Definition 17 (Group algebra):
Given a finite abeliangroup ( G, ⋆, e ) the group algebra C [ G ] is the C -algebraspanned by the | g i for g ∈ G , in other words any elementis of the form: P g ∈ G a g | g i with a g ∈ C . The convolutionproduct is defined as: P g ∈ G a g | g i ! ∗ (cid:18) P h ∈ G b h | h i (cid:19) = P h,g ∈ G a g b h | g ⋆ h i .The language is generated by two spiders. The inter-pretation is given into the prop with object C | G |⊗ n andlinear maps as morphisms. s ...... { def = |−→ x i 7→ P y j ∈ G δ x = ··· = x n = y = ··· = y m |−→ y i s ...... { def = |−→ x i 7→ | G | m − n P y j ∈ G δ ⋆ i x i = ⋆ j y j |−→ y i r z = | xy i 7→ | yx i J K = | G | P x ∈ G | xx i J K = | G | P y ∈ G h yy | This case is very close to graphical linear algebraexcept that the + operation over Q is replaced by thebinary operation • over G . Thus the dualizer is theinverse operator : | g i 7→ | g − i . Choosing the greencompact structure and softening the -compatible redspider gives a § FA: s ...... { def = |−→ x i 7→ | G | m − n P y j ∈ G δ (cid:18) ⋆ i x i (cid:19) ⋆ (cid:18) ⋆ j y j (cid:19) = e |−→ y i TABLE VIT
HE FLEXCYCLIC GRAPHICAL LANGUAGE GA Σ GA ...... ...... E GA ...... ...... ... = ...... ...... ...... ...... ... = ...... ...... = = === == = In the commutative case we have flexsymmetry andwe can add an additional generator with interpretationthe Fourier transform on finite abelian groups and satis-fying: ...... = ...... . D. Flexsymmetric qudit ZX-calculus
The qudit ZX-calculus [26] is a special case of thegroup algebra construction with G = Z d Z . In the case ofqubits, where d = 2 , the dualizer is the identity and thenthe qubit ZX-calculus is obviously flexsymmetric. How-ever in the case d ≥ , harvestmen are necessary. Thisgives an equivalent flexsymmetric presentation of thequtrit ZX-calculus [8]. In [8] some topological lemmasare shown which would directly follow from flexsym-metry. Furthermore this presentation allows to avoid theinverse Fourier transform as an explicit generator. E. The monochromatic ZX-calculus
The ZX-calculus is a complete graphical calculus forqubits introduced in [1]. Two complete axiomatizationsfor full qubits quantum mechanic have been given in [28]and [29]. We will rely on the compact axiomatizationof [30]. It correspond to GA with G = Z with the Hadamard gate . As said before this language isalready flexsymmetric, however using cup-cap switchand softening gives an interesting equivalent language.Applying a cup-cap switch with two SCFAs are notflexible anymore but they are both -compatible. If wesoften the green spider and anti-soften the red one, that iswe precompose by dualizers. This gives two § FAs whichcoincides: ...... def = ...... = ...... . We obtain a new languagewith interpretation: s ...... { = | + i ⊗ m h | ⊗ n + e iα |−i ⊗ m h | ⊗ n r z = | xy i 7→ | yx i J K = | i + | −i J K = h | + h − | where | + i def = | i + | i√ and |−i def = | i−| i√ .Translating the axioms of [30] gives a complete cal-culus for qubits presented in Table VII. TABLE VIIT
HE FLEXSYMMETRIC GRAPHICAL LANGUAGE M -ZX Σ M -ZX ...... E M -ZX ...... ...... ... α β = ...... ......α + β = α == α α = πγβ β β β = arg( z ) + arg( z ′ ) β = 2 arg( i + | zz ′ | ) β = arg( z ) − arg( z ′ ) γ = x + − arg( z ) + π − β x + def = α + α x − def = x + − α z def = − sin( x + ) + i cos( x − ) z ′ def = cos( x + ) − i sin( x − ) z ′ = 0 ⇒ β = 0 F. The black cap ZW-calculus
One of the starting point of this work was the odd lookof ZW equations. They are in fact subdivided versions ofmore familiar equations. To see this will only considerthe black harvestman fragment of the ZW-calculus. We11an see this harvestman as arising from the subdivisionof two spiders, the indigo and the orange, which are thetranspose of each other: ...... def = ...... s ...... { = P | xy | =1 | y ih x | ...... def = ...... s ...... { = P | xy | =1 | y ih x | r z = | xy i 7→ | yx i J K = | i + | i J K = h | + h | Those two FAs are both -compatible with respectto the canonical compact structure of the ZW-calculuswhere q y = | x i 7→ | x i . Thus, a cup-cap switch givestwo flexible FAs satisfying equations close to those ofthe ZX-calculus given in Table VIII. TABLE VIIIT
HE FLEXSYMMETRIC GRAPHICAL LANGUAGE B -ZW Σ B -ZW ...... ...... E B -ZW ...... ...... = ...... ...... ...... ...... = ...... ...... · · ·· · · = · · ·· · · = = == Those FAs are not special but anti-special. Moredetails about anti-spiders can be found in [20]. Thegenerators satisfy the equation = involving thefermionic swap with interpretation: r z def = | xy i 7→ ( − x ∧ y | yx i . The fermionic swap is flexcyclic for thecanonic compact structure but is not with respect to theblack one. So giving a complete flexcyclic presentationof ZW-calculus in this form is not really more elegantsince we then need a subdivided fermionic swap. This isan interesting obstacle which would require further worknotably on non-symmetric compact structures. VIII. C ONCLUSION
Paradigms provide a clean framework to organize theequational presentations of graphical languages. We hopethey could be useful as a compact way to define futuregraphical languages and also as a guide to design them.Finding description of free paradigmatic languagespaves the way towards their implementation into graph-ical proof assistants. This is what we have done withflexsymmetry and Σ -graphs. We are convinced that thenext generation of graphical proof assistant would benefitrelying on different paradigms to fit the rewriting algo-rithms to the languages and avoid unnecessary tricks. Sofar, Quantomatic[5] and Pyzx[18] only handles flexsym-metric languages.The concepts of flexsymmetry and flexcyclicity giveprecise formalizations to the vague OTM paradigm.However flexcyclicity fails to explain the flexibility ofFrobenius algebras. This problem is solved by defin-ing spiders not as Frobenius algebras but as flexcyclicmonoids.The author is not aware of any prior work on § FAsoutside the ZH-calculus and ZW-calculus, and wouldbe very glad to know if such structures have alreadyappeared in representation theory. Finally a generalgraphical theory of § FAs still has to be developed. Aclassification of those structures might give new insightson interacting FAs obtained from the same § FA, alongthe works of [31], [32], [33], [12].We can then focus on what, else than topology,matters. R
EFERENCES[1] B. Coecke and R. Duncan, “Interacting quantum observables:categorical algebra and diagrammatics,”
New Journal of Physics ,vol. 13, no. 4, p. 043016, 2011.[2] A. Hadzihasanovic, “Zw calculi: diagrammatic languages forpure-state quantum computing,”
Logic and Applications LAP2018 , p. 13, 2018.[3] M. Backens and A. Kissinger, “Zh: A complete graphical calcu-lus for quantum computations involving classical non-linearity,” arXiv preprint arXiv:1805.02175 , 2018.[4] R. Vilmart, “A zx-calculus with triangles for toffoli-hadamard,clifford+ t, and beyond,” arXiv preprint arXiv:1804.03084 , 2018.[5] A. Kissinger and V. Zamdzhiev, “Quantomatic: A proof assistantfor diagrammatic reasoning,” in
International Conference onAutomated Deduction . Springer, 2015, pp. 326–336.[6] F. Bonchi, F. Gadducci, A. Kissinger, P. Soboci´nski, andF. Zanasi, “Rewriting modulo symmetric monoidal structure,” in . IEEE, 2016, pp. 1–10.[7] F. Bonchi, P. Soboci´nski, and F. Zanasi, “A categorical semanticsof signal flow graphs,” in
International Conference on Concur-rency Theory . Springer, 2014, pp. 435–450.[8] Q. Wang and X. Bian, “Qutrit dichromatic calculus and itsuniversality,” arXiv preprint arXiv:1406.3056 , 2014.[9] F. Zanasi, “Interacting hopf algebras: the theory of linear sys-tems,” arXiv preprint arXiv:1805.03032 , 2018.
10] B. Fong and D. I. Spivak, “Hypergraph categories,”
Journal ofPure and Applied Algebra , vol. 223, no. 11, pp. 4746–4777, 2019.[11] A. Kissinger, “Pictures of processes: automated graph rewritingfor monoidal categories and applications to quantum computing,” arXiv preprint arXiv:1203.0202 , 2012.[12] T. Carette and E. Jeandel, “A recipe for quantum graphicallanguages,”
Preprint , 2020.[13] A. Joyal and R. Street, “The geometry of tensor calculus, i,”
Advances in mathematics , vol. 88, no. 1, pp. 55–112, 1991.[14] P. Selinger, “A survey of graphical languages for monoidalcategories,” in
New structures for physics . Springer, 2010, pp.289–355.[15] P. Hackney and M. Robertson, “On the category of props,”
Applied Categorical Structures , vol. 23, no. 4, pp. 543–573, 2015.[16] J. C. Baez, B. Coya, and F. Rebro, “Props in network theory,” arXiv preprint arXiv:1707.08321 , 2017.[17] M. Barr and C. Wells,
Toposes, Triples, and Theories . Springer-Verlag, 2000.[18] A. Kissinger and J. van de Wetering, “Pyzx: Largescale automated diagrammatic reasoning,” arXiv preprintarXiv:1904.04735 , 2019.[19] J. Kock,
Frobenius algebras and 2-d topological quantum fieldtheories . Cambridge University Press, 2004, vol. 59.[20] B. Coecke and A. Kissinger,
Picturing quantum processes . Cam-bridge University Press, 2017.[21] D. Kartsaklis, M. Sadrzadeh, S. Pulman, and B. Coecke, “Rea-soning about meaning in natural language with compact closedcategories and frobenius algebras,”
Logic and Algebraic Struc-tures in Quantum Computing , p. 199, 2013.[22] B. Fauser, “Some graphical aspects of frobenius structures,” arXivpreprint arXiv:1202.6380 , 2012.[23] S. Lack, “Composing props,”
Theory and Applications of Cate-gories , vol. 13, no. 9, pp. 147–163, 2004.[24] P. Sobocinski, “Graphical linear algebra.” [Online]. Available:https://graphicallinearalgebra.net/[25] J. Vicary, “Topological structure of quantum algorithms,” in
Proceedings of the 2013 28th Annual ACM/IEEE Symposium onLogic in Computer Science . IEEE Computer Society, 2013, pp.93–102.[26] A. Ranchin, “Depicting qudit quantum mechanics and mutuallyunbiased qudit theories,” arXiv preprint arXiv:1404.1288 , 2014.[27] S. Gogioso and A. Kissinger, “Fully graphical treatment of thequantum algorithm for the hidden subgroup problem,” arXivpreprint arXiv:1701.08669 , 2017.[28] K. F. Ng and Q. Wang, “A universal completion of the zx-calculus,” arXiv preprint arXiv:1706.09877 , 2017.[29] E. Jeandel, S. Perdrix, and R. Vilmart, “Completeness of the zx-calculus,” arXiv preprint arXiv:1903.06035 , 2019.[30] R. Vilmart, “A near-optimal axiomatisation of zx-calculusfor pure qubit quantum mechanics,” arXiv preprintarXiv:1812.09114 , 2018.[31] F. Bonchi, P. Soboci´nski, and F. Zanasi, “Interacting bialgebrasare frobenius,” in
International Conference on Foundations ofSoftware Science and Computation Structures . Springer, 2014,pp. 351–365.[32] R. Duncan and K. Dunne, “Interacting frobenius algebras arehopf,” in
Proceedings of the 31st Annual ACM/IEEE Symposiumon Logic in Computer Science . ACM, 2016, pp. 535–544.[33] J. Collins and R. Duncan, “Hopf-frobenius algebras and a newdrinfeld double,” arXiv eprint arXiv:1905.00797 , 2019.[34] P.-L. Curien, “The joy of string diagrams,” in
InternationalWorkshop on Computer Science Logic . Springer, 2008, pp. 15–22.[35] D. Marsden, “Category theory using string diagrams,” arXivpreprint arXiv:1401.7220 , 2014. A PPENDIX
We will use a variation of the string diagram notationto handle natural transformation, see [34] or [35] for anintroduction. We represent horizontaly the compositionof functor and vertically the composition of naturaltransformations.
Proof of Proposition 1:
A translation is pictured: αF Σ L Σ Y U . The soundnesscondition is: Y αl L Σ L F π Y = Y αr L Σ L F π Y . The co-equalizer property of Y gives a unique prop morphism α such that: απ Y Y Σ L F = π L Y Σ L F α . Conversly, if we havesuch a morphism we can deduce the soundness conditionand so this morphism is unique: Y αl L Σ L F π Y = l L Σ L F π L Y α = r L Σ L F π L Y α = Y αr L Σ L F π Y The composition between to translations α : L → Y and β : Y → K is defined as: βαF Σ L Σ K U def = α Σ L βF Σ K U .We check the soundness condition for the composi-tion:13 π K α Σ L β K = α π Y β Σ L F K = Σ L βπ L αF K So the soundness condition is satisfied with βα = β ◦ α . Given three translations α : L → Y , β : Y → K and γ : K → M we have: γ ( βα ) = α Σ L γF Σ M U β = Σ L F Σ M U α γβ = ( γβ ) α So the composition is associative. The unit is definedas: id Y F Σ Y Σ Y U def = F Σ Y Σ Y U . The soundness condition issatisfied: π Y Y Σ L F = π Y Σ L F Y , and we have id Y = id Y .We have: id Y α = α Σ L F Σ Y U = αF Σ L Σ Y U = α and β id Y = Σ Y βF Σ K U = βF Σ Y Σ K U = β So GL is a category and we have a functor : GL → Prop . Since
Prop is equivalent to the Eilenberg-Moore cat-egory of U ◦ F then each prop P is a coequalizer of freeprops [17]. An explicit coequalizer is: F UF U P F U
P P ǫ P F Uǫ P ǫ FU P In fact: PP F UUF = PP F UUF .Let’s take Σ P def = U P , E P def = U F U P , r P def = id F UF U P and l P def = F η Uǫ P . We have: ǫ FU P ◦ l P = ǫ FU P ◦ F η Uǫ P = P F UUF P F U = P F UUF P F U = F U ǫ P .Thus we can define P def = (Σ P , E P , l P , r P ) and wehave P ≃ P . So is essentially surjective.Let s be a section of π Y . Given a prop morphism f : L → Y we define a translation α f : L → Y by α f def = Σ L π L fs Σ Y U F . We check the soundness condition:
F π Y θ f Σ L Y = Y F π Y Σ L π L fs = F Σ L π L f Y .This gives us α f = f . So is full. Proof of Proposition 2:
We use the following dia-gram: F ( E L + E ) π L FE L FE F Σ L ǫ F Σ L ◦ Frǫ F Σ L ◦ Fl F Σ L F Σ L L / E π L / E ǫ F Σ L ◦ Fr L ǫ F Σ L ◦ Fl L ǫ F Σ L ◦ F [ r L ,r ] ǫ F Σ L ◦ F [ l L ,l ] Fι E Fι E L K fπ g L π L / E ◦ ǫ F Σ L ◦ F l L = π L / E ◦ ǫ F Σ L ◦ F r L and thus there is a unique π : L → L / E such that π ◦ π L = π L / E . Then: π ◦ π L ◦ ǫ F Σ L ◦ F l = π ◦ π L ◦ ǫ F Σ L ◦ F r .It remains to show the universal property. Let f : L →K be a prop morphism such that: f ◦ π L ◦ ǫ F Σ L ◦ F l = f ◦ π L ◦ ǫ F Σ L ◦ F r .We also have f ◦ π L ◦ ǫ F Σ L ◦ F l L = f ◦ π L ◦ ǫ F Σ L ◦ F r L and then the universal property of the coproduct givesus f ◦ π L ◦ ǫ F Σ L ◦ F [ l L , l ] = f ◦ π L ◦ ǫ F Σ L ◦ F [ r L , r ] .So there is a unique g : L / E → K such that: f ◦ π L = g ◦ π L / E = g ◦ π ◦ π L . And since π L is an epimorphism: f = g ◦ π . Proof of Proposition 3:
Since coproducts commutewith coequalizers we have the following coequalizer: F ( E L + E Y ) F (Σ L + Σ Y ) L + Y π L + π Y ( ǫ F Σ L ◦ Fl L ) + ( ǫ F Σ L ◦ Fl Y )( ǫ F Σ L ◦ Fr L ) + ( ǫ F Σ L ◦ Fr Y ) Furthermore:
F ι Σ L ◦ ǫ F Σ L ◦ F l L = ǫ F Σ L + Y ◦ F U F ι Σ L ◦ F l L .And so: ǫ F Σ L + Y ◦ F l L + Y = ǫ F Σ L + Y ◦ F [ U F ( ι Σ L ) ◦ l L , U F ( ι Σ L ) ◦ l Y ] = [ ǫ F Σ L + Y ◦ F U F ( ι Σ L ) ◦ l L , ǫ F Σ L + Y ◦ F U F ( ι Σ L ) ◦ l Y ] = [ F ι Σ L ◦ ǫ F Σ L ◦ F l L , F ι Σ Y ◦ ǫ F Σ Y ◦ F l Y ] = ( ǫ F Σ L ◦ F l L ) + ( ǫ F Σ Y ◦ F l Y ) . Finally L + Y = L + Y . Proof of Lemma 1:
The naturality enforces thesoundness condition in the following diagram: FE P Σ ǫ F Σ L ◦ Fl P Σ ǫ F Σ L ◦ Fr P Σ FE P Σ ′ F (Σ ′ + Σ P ) { ! P Σ ′ } P π { ! P Σ ′ } P ǫ F Σ L ◦ Fl P Σ ′ ǫ F Σ L ◦ Fr P Σ ′ FE P f F ( f + id Σ P ) { ! P Σ } P F (Σ + Σ P ) π { ! P Σ } P Proof of Theorem 1:
We will use Beck’s monadicitytheorem to show that U P is monadic. We need threeconditions: • U P is conservative. That is if U P f is anisomorphism then f is an isomorphism.We have U P = U ◦ ( ) P , U is monadic and thenconservative so we just have to show that ( ) P is con-servative. Let f : P → Q be a morphism in Prop P suchthat ( f ) P is an isomorphism. So there is a morphism f − in Prop such that ( f ) P ◦ f − = id and f − ◦ ( f ) P = id .We need to show that f − is in Prop P .We will use graphical languages and translations. Bydefinition there are two paradigmatic graphical languages L , Y : GL P such that L = P and Y = Q , and atranslation α : L → Y such that α = f . We construct β : Y → L in GL P such that β = f − . Taking asection s of π L . We define β def = [ U sf − π Y ◦ η Σ Y ◦ ι Σ Y , η Σ L +Σ P ◦ ι Σ P ] .We now check the soundness condition. This will atthe same time proves that β is a well defined translationand that β = f − . The condition is: f − ◦ π Y = π L ◦ ( ǫ F Σ L ◦ F β ) . We have: Σ Y β L π L F ι Σ Y = Σ Y ι Σ Y π Y f − s L π L F = Σ Y ι Σ Y π Y f − s L π L F = Σ Y ι Σ Y π Y f − L F and Σ P β L π L F ι Σ P = Σ P L π L F ι Σ P = Σ P L π L F ι Σ P = Σ P L π L F ι Σ P ff − = Σ P L F ι Σ P f − α π Y = Σ P L F ι Σ P f − π Y = Σ P L F ι Σ P f − π Y .So the soundness condition holds from the universalproperty of F (Σ Y + Σ P ) . • U P has a left adjoint. We show that F P is this leftadjoint.We check the universal property. Given a signature Σ . We have a morphism η P Σ : Σ → U P F P (Σ) . Using U P F P = U ◦ ( ) P ◦ P ◦ ! P = U ◦ ◦ { } P ◦ ! P it isdefined by η P Σ def = U π P Σ ◦ U F ι Σ ◦ η Σ .Given a prop P and a map f : Σ → U P P weneed to show that F P ( f ) is the unique map satisfying U P F P ( f ) ◦ η P Σ = f Let g : F P Σ → P be a map such that U P g ◦ η P Σ = f .15 P g Σ U P PU P F P Σ f ⇔ Σ U ◦ ( P ) P UF Σ fη Σ U (cid:0) ( g ) P ◦ π P Σ ◦ Fι Σ (cid:1) Since U has a left adjoint F the universal propertygives: F f = ( g ) P ◦ π P Σ ◦ F ι Σ . Since π P Σ is anepimorphism ( g ) P ◦ π P Σ uniquely caracterizes ( g ) P . Furthermore by definition we know that ( g ) P ◦ π P Σ ◦ F ι Σ P = π P P ◦ F ι Σ P . So by theuniversal property of the coproduct F (Σ P + Σ) there is a unique g satisfying this property and [ U F ι U P P ◦ η U P P ◦ f, U F ι Σ P ◦ η Σ P ] = F P f does. • Prop P has and U P preserves coequalizers of U P -split pair.We consider a U P -split pair f, g : P → Q . This meanswe have a split coequalizer: hU P fU P gU P P U P Q ∆ ⇔ hU ( f ) P ∆ U ( g ) P U ( Q ) P U ( P ) P Since U is monadic we know that it preserves co-equalizers of U -split pairs. So we consider the pair: ( f ) P ( g ) P ( Q ) P ( P ) P .Let L and Y be paradigmatic graphical languages suchthat {L} P = ( P ) P and {Y} P = ( Q ) P . Let α, β : Σ P → U F (Σ P + Σ P ) be such that [ α, U F ι Σ P ◦ η Σ P ] = ( f ) P and [ β, U F ι Σ P ◦ η Σ P ] = ( g ) P . We define E α,β def =(Σ P, α, β ) . We know that (cid:16) ( Y ) P . E α,β (cid:17) is a coequal-izer of π Y ◦ ǫ U (Σ P +Σ) ◦ α and π Y ◦ ǫ U (Σ P +Σ) ◦ β in Prop .Furthermore π = (cid:0) η Σ P +Σ Q (cid:1) . Thus π and ( Y ) P . E α,β are in Prop P . ( f ) P ( g ) P ( P ) P ( Q ) P ππ Y ◦ ǫ F (Σ P +Σ) ◦ αF Σ P U P Q ( Y ) P . E α,β π P ◦ F ι Σ P π Y ◦ ǫ F (Σ P +Σ) ◦ β The diagram commutes and then π and ( Y ) P . E α,β are also a coequalizer of ( f ) P and ( g ) P in Prop . Westill have to show that we also have a coequalizer in
Prop P . Given a paradigmatic prop R and a morphism ( h ) P satisfying the property we have a unique propmorphism h ′ such that h ′ ◦ π = ( h ) P . Let θ : Σ Q → U F (Σ P + Σ P ) be such that [ θ, U F ι Σ P ◦ η Σ P ] = ( h ) P .Then [ θ, U F ι Σ P ◦ η Σ P ] = h ′ so Prop P has coequalizersand ( ) P preserves them. Finally the Beck monadicity theorem gives us amonadic adjunction F P ⊣ U P . Proof of Proposition 4:
When composing three Σ -graphs the two interfaces have no vertex in common thisensure the associativity of composition. The identity isgiven by the Σ -graphs of the form: (cid:16) nn · · · (cid:17) . So Σ -gr is a category.The tensor is associative and the tensor unit identityis the empty Σ -graphs: () .The functoriality follows from the fact that whentensoring two compositions, we can take the disjointunion of the interfaces and see it as the interface forthe composition of the two tensors.The symmetries are generated by the involutive swap Σ -graphs (cid:16)
211 2 (cid:17) . The naturality follows from Σ -graphisomorphism.So Σ -gr is a prop.A self-dual compact structure is given by ( ) and ( ) . Proof of Proposition 2:
Given a morphism f : n → m in F F Σ . By map-stateduality each generator g : a → b corresponds to a state g : 0 → a + b : g ............ . The flexsymmetry equations exactlymeans that those states are symmetric for all g ∈ Σ . Thus f is completely characterized by giving a list of states g and how there are linked whith each other and with the n inputs and m outputs. In other words f is uniquelydefined by a Σ -graph.This provides a bijective mapping between F F Σ[ n, m ] and Σ -gr [ n, m ] . This mapping correspondsto a full and faithful prop morphism E : F F Σ → Σ -gr defined by E : x elm x . The left and right handside of the flexsymmetry equations being equivalent has Σ -graphs, E is a well defined isomorphism of prop. So F F Σ ≃ Σ -gr . Proof of 2:
The proof follows from this equivalentdefinition of FAs, see [22]:
Definition 18 (FA alternative definition):
A Frobeniusalgebra is equivalently defined by a monoid (cid:18) , (cid:19) ( , ) satisfying: = .One just have to show that the flexcyclic equation isequivalent to the one from the alternative definition: = ⇔ = ⇔ = So ( M C ) C ≃ F .Then flexsymmetry is equivalent to commutativity andflexcyclicity giving: ( M F ) F ≃ F / C .Finally equation B is equivalent to S under flexcyclic-ity so (cid:16) M C / B (cid:17) C ≃ F / S . Proof of Proposition 3:
If we have flexibility: = = = and = = = so we haveflexcyclicity. = = = so we haveself-transposness.Conversely if we have flexcyclicity and self-transposeness: = = = by symme-try we also have the other direction.
Lemma 10: ◦ ( d ⊗ d ) = d ◦ (cid:18) (cid:19) t . Proof in A. Proof of Lemma 10:
Rewriting the equation graph-ically we have: = = = = . The following lemma is useful to show compatibility:
Lemma 11: self - transpose and symmetric ⇔ compatible and d is a F A homomorphism . Proof inA. Proof of Lemma 11: ( ⇒ ) F is symmetric. It is also self-transposed andthen it is upbent so by definition it is compatible. Thenby Lemma 10 the dualizer is an F -homomorphism. ( ⇐ ) F is compatible so it is symmetric. Then by Lemma10, since F is self transpose then the dualizer is an F -homomorphism. Proof of Lemma 4:
The proof is similar to Lemma5.
Proof of Lemma 5:
We start with an intermediate SMT T ′ := (Σ ′ , E ′ ) where Σ ′ := Σ ⊎ Y and E ′ := E ⊎ { Y = Z } . Since Z ∈ F (Σ)[1 , then T ≃ T ′ . F ( E ′ ) F (Σ ′ ) F (Σ ′ ) P § Z | ∆ T P T ′ l ′ r ′ S Y | ∆ ◦ l ′ π ′ S Y | ∆ ◦ r ′ S Y | ∆ S Z − | ∆ π s φψF ( E ′ ) Since P § Z | ∆ T is the coequalizer of S Y | ∆ ◦ l ′ and S Y | ∆ ◦ r ′ , we have π s ◦ S Y | ∆ ◦ l ′ = π s ◦ S Y | ∆ ◦ r ′ . Then theuniversal property of P T ′ , as the coequalizer of l and r ,gives a morphism φ : P T ′ → P § Z | ∆ T satisfying φ ◦ π ′ = π s ◦ S Y | ∆ . We now contruct an inverse to φ .By hypothesis there is a diagram Z − ∈ F (Σ)[1 , such that π ′ ( Z − ) = π ′ ( Z ) − . The functor S Z − | ∆ : F (Σ + Y ) → F (Σ + Y ) satisfies, for any x ∈ ∆( n, m ) :17 ′ ◦ S Z − | ∆ ◦ S Y | ∆ ( x ) = π ′ ◦ S Z − | ∆ ( X ◦ Y ⊗ n )= π ′ (cid:16) S Z − | ∆ ( X ) ◦ S Z − | ∆ ( Y ) ⊗ n (cid:17) = π ′ (cid:16) X ◦ Z − ⊗ n ◦ Y ⊗ n (cid:17) = π ′ ( X ) ◦ π ′ (cid:0) Z − (cid:1) ⊗ n ◦ π ′ ( Y ) ⊗ n = π ′ ( X ) ◦ π ′ (cid:0) Z − (cid:1) ⊗ n ◦ π ′ ( Z ) ⊗ n = π ′ ( X ) From this it follows that π ′ ◦ S Z − | ∆ ◦ S Y | ∆ ◦ l ′ = π ′ ◦ S Z − | ∆ ◦ S Y | ∆ ◦ r ′ . Then the universal property of P § Z | ∆ T , as the coequalizer of S Y | ∆ ◦ l ′ and S Y | ∆ ◦ r ′ ,gives a morphism ψ : P § Z | ∆ T → P T ′ satisfying ψ ◦ π s = π ′ ◦ S Z − | ∆ .It remains to show that ψ is an inverse. First ψ ◦ φ ◦ π ′ = ψ ◦ π s ◦ S Y | ∆ = π ′ ◦ S Z − | ∆ ◦ S Y | ∆ = π ′ , since π ′ isan epimorphism we have ψ ◦ φ = id . Then φ ◦ ψ ◦ π s = φ ◦ π ′ ◦ S Z − | ∆ = π s ◦ S Y | ∆ ◦ S Z − | ∆ . But for any x ∈ ∆( n, m ) : π s ◦ S Y | ∆ ◦ S Z − | ∆ ( X ) = π s ◦ S Y | ∆ ( X ◦ Z − ⊗ n )= π s (cid:16) S Y | ∆ ( X ) ◦ S Y | ∆ ( Z − ) ⊗ n (cid:17) = π s (cid:16) X ◦ Y ⊗ n ◦ S Y | ∆ ( Z − ) ⊗ n (cid:17) = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ (cid:0) π s ◦ S Y | ∆ (cid:1) ( Z − ) ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ ( φ ◦ π ′ ) ( Z − ) ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ φ (cid:0) π ′ ( Z ) − (cid:1) ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ φ ( π ′ ( Y )) − ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ ( φ ◦ π ′ ) ( Y ) − ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ (cid:0) π s ◦ S Y | ∆ (cid:1) ( Y ) − ⊗ n = π s ( X ) ◦ π s ( Y ) ⊗ n ◦ π s ( Y ) − ⊗ n = π s ( X ) So φ ◦ ψ ◦ π s = π s ◦ S Y | ∆ ◦ S Z − | ∆ = π s . Since π ′ is an epimorphism we have φ ◦ ψ = id . ψ is the inverseof φ . Finally T ≃ T ′ ≃ § Z | ∆ T . Proof of Lemma 6:
The flexsymmetry equations areinvariant. In fact, given a permutation σ and a generator G ∈ ∆( n, m ) : C Z § Z | ∆ G σ ... ............... = G ............ ⇔ G σ ... ............... ...... = G ............ ...... ⇔ G ...... ...... σ ... ......... = G ............ ...... ⇔ G σ ... ............... = G ............ Proof of Lemma 7:
Provided a flexible FA in L ,in s Z L , this FA has dualizer z def = π L Z which is aself-transposed involution, the FA is then z -compatible.Given a z -compatible FA in L the dualizer of thecorresponding FA in s Z L is z = id , in other wordsthis FA is flexible. Proof of Lemma 9:
This comes from the followinggraphical manipulation: = = == = =