Completeness of Nominal PROPs

We introduce nominal string diagrams as string diagrams internal in the category of nominal sets. This leads us to define nominal PROPs and nominal monoidal theories. We show that the categories of ordinary PROPs and nominal PROPs are equivalent. This equivalence is then extended to symmetric monoidal theories and nominal monoidal theories, which allows us to transfer completeness results between ordinary and nominal calculi for string diagrams.


Introduction
The purpose of this work is to give rigorous foundations to string diagrams with named wires.To achieve this, we follow the wide-spread practice of modeling string diagrams as product and permutation categories, or PROPs for short.The novel feature of our approach is to internalise PROPs in the category Nom of nominal sets.We then show that the category of ordinary PROPs is equivalent to the category of PROPs internal in Nom, or, briefly, that ordinary PROPs are equivalent to nominal PROPs.
This formalises an observation familiar to users of string diagrams, namely that we can afford ourselves the practical convenience of named wires without departing from the mathematical convenience of canonically ordered wires.To illustrate this consider the following picture.On the left, we see equations between ordinary string diagrams.Sequential composition of two diagrams connects the wires respecting their order.
For example, the top left most diagram is actually a composition of several smaller diagrams: Mathematically, a collection of wires is an ordinal.On the right we see nominal string diagrams.A collection of wires is a set of 'names'.Sequential composition connects wires that have the same name.Let us look at the uppermost equations (on grey background).For ordinary string diagrams on the left, we need axioms that equate all diagrams that represent the same permutations, since the order of wires is important.On the right, we see that we do not have any equations with wire crossings.This reflects that invariance under permutations for nominal string diagrams is inherited from nominal sets.Intuitively, while in the ordinary case wires are lists, in the nominal case wires are sets.
The third row (on green background) contains the equations stating that the binary operation in question (we may call it a "cup") is commutative and associative and interacts in the expected way with wire-crossings (on the left) and with renamings (on the right).
Apart from proving that the PROPs defined by the equations on the left are equivalent to the nominal PROPs axiomatised by the equations on the right, we are also interested in a procedure translating ordinary equations into nominal ones, and vice versa.This needs some care as the equations involving wire-crossings (on the left) and renamings (on the right) look quite different.
Our main results are transfer theorems that allow us not only to translate a complete symmetric monoidal theory (as illustrated on the left) to a nominal monoidal theory (as shown on the right), but also to transfer completeness.We also show the other direction from the nominal to the ordinary side.
As a result of our study we obtain the equivalence of symmetric and nominal monoidal theories and can now use named wires in a completely rigorous way, transerring results back and forth.We will remark on possible applications of nominal PROPs in the conclusions.This is an extended version of [BK19].In particular, Sections 6.5-6.8 are new.
Hyper-links.Due to its syntactic nature, this paper introduces a large number of technical definitions and notations, for example: PROP, nPROP, SMT, NMT, F, nF, Trm, nTrm, Prop, Th, NOM, ORD, box, dia, NOM, ORD, nfNmt, nfSmt.To make the paper easier to read, these notions are hyper-linked in the electronic version.
Acknowledgments.We started to work on this project inspired by Pawel Sobocinski's course on Graphical Linear Algebra at MGS in Leicester 2016.Over the years we profited from discussions with Fredrik Dahlqvist, Giuseppe Greco, Bart Jacobs, Peter Jipsen, Samuel Mimram, Drew Moshier, Alessandra Palmigiano, David Pym, Mike Shulman, Georg Struth, Apostolos Tzimoulis and Fabio Zanasi who all influenced the paper in some way.Special thanks go to Chad Nester for pointing out the important paper by Blute et al [BCST96], which we had missed, and to Thomas Streicher who helped us with questions on fibrations and internal categories.

Related Work
We divide discussion of related work into string diagrams and nominal sets.
String Diagrams.Whilst somewhat difficult to tell with certainty, arguably the first formal definition of string diagrams appears in the habilitation thesis of Günter Hotz [Hot65].However, forms of diagrammatic reasoning in areas such as knot theory have much earlier origins (see [Prz98] for a nice historical summary).Definitions of string diagrams have also been introduced, amongst others, by Penrose [Pen71], Joyal & Street [JS93,JS91] and have cropped up in presentations of sequent calculi [CS17], linear logic as proof nets [Gir87,Mel06], bigraphs [Mil06], signal flow diagrams in control theory [Mas53] and network theory [BSZ15] as well as in areas such as quantum physics and computing [CK17].
All of these formalisms are underpinned by the same category theory, namely that of (symmetric) monoidal categories, specifically product and permutation categories called PROPs for short, introduced by MacLane [Lan65].For an overview of classic/single sorted string diagrams see [Sel11].
Whilst our work is novel in its presentation of nominal string diagrams as monoidal categories internal in Nom, we are by no means the first to generalise PROPs to a multi-sorted or nominal settings.Indeed, even (one of) the earliest papers on string diagrams, namely that of Roger Penrose [Pen71], already introduces "nominal" string diagrams where the wires of his pictures are given labels.Amongst later works, a commonly seen variation to ordinary string diagrams is the notion of colored props [HR15,Zan17].This generalisation from one-sorted to many-sorted PROPs is orthogonal to our generalisation to nominal PROPs.
Finally, we must mention the work of Blute et al. [BCST96], which is similar in many aspects to our work, especially in the use of the diamond notation −] − [− , which we arrived at independently from the authors.We also add the converse [− − −] and work out the axioms under which they are inverse to each other.
Another paper in similar spirit, by Ghica and Lopez [GL17], introduces a version of nominal string diagrams by explicitly introducing names and binders for ordinary string diagrams.
Nominal Sets.Nominal sets were introduced by Gabbay and Pitts in [GP99] and are are based on Fraenkel-Mostowski set theory in which sets are equipped with an additional permutation action.Equivalent formulations based on presheaves [Hof99, FPT99] and named sets [MP97] were introduced around same time.
All three approaches have their own advantages.The presheaf approach explicitly types terms by their sets of free names and recognises quantifiers as adjoints as in Lawvere's hyperdoctrines [Law69].Named sets give finite presentations to infinite orbits and have proved to be a suitable basis for implementing generalisations of algorithms known from automata such as partition refinement [FMT05] or Angluin's algorithm [MSS + 17].
Nominal sets are designed to make minimal modifications to ordinary set theory and are thus well suited to internalising established areas of mathematics.Gabbay and Pitts showed that λ-calculus terms up to α-equivalence form a term-algebra not in sets but in nominal sets.Since names and name binding play a fundamental role in programming languages, several areas of theoretical computer science have been internalised in nominal sets as witnessed for example by work on universal algebra [GM09,Pet11], domain theory [TW09,LP14], Stone duality [GLP11,Pet11] and automata theory [BKL14].
This paper adds new methodology to this line of research by internalising monoidal categories in nominal sets, where nominal sets are themselves taken to be a monoidal category with respect to the so-called separating tensor.This allows us to recast categories with a partial monoidal operation as internal categories with a total monoidal operation.

Preliminaries
From a technical point of view, this paper can be understood as bringing together existing work on string diagrams, or, more specifically, PROPs and nominal sets.In fact, we will be developing the beginnings of a theory of PROPs internal in the category of nominal sets.In this section we review preliminaries on string diagrams and nominal sets.
3.1.String Diagrams, SMTs and PROPs.String diagrams are a 2-(or higher)-dimensional notation for monoidal categories [JS91].Their algebraic theory can be formalised by PROPs as defined by MacLane [Lan78].There is also the weaker notion by Lack [Lac04], see Remark 2.9 of Zanasi [Zan15] for a discussion.
A PROP (products and permutation category) is a symmetric strict monoidal category, with natural numbers as objects, where the monoidal tensor ⊕ is addition.Moreover, PROPs, along with strict symmetric monoidal identity-on-objects functors form the category PROP.
A PROP contains all bijections between numbers as they can be be generated from the symmetry (twist) σ : 1 ⊕ 1 → 1 ⊕ 1 and from the parallel composition ⊕ and sequential composition ; (which we write in diagrammatic order).We denote by σ n,m the canonical symmetry n ⊕ m → m ⊕ n.Functors between PROPs preserve bijections.
PROPs can be presented in algebraic form by operations and equations as symmetric monoidal theories (SMTs) [Zan15].
An SMT (Σ, E) has a set Σ of generators, where each generator γ ∈ Σ is given an arity m and co-arity n, usually written as γ : m → n and a set E of equations, which are pairs of Σ-terms.The set of all Σ-Terms is denoted by Trm(Σ).Σ-terms can be obtained by composing generators in Σ with the unit id : 1 → 1 and symmetry σ : 2 → 2, using either the parallel or sequential composition (see Figure 1).Equations E are pairs of Σ-terms with the same arity and co-arity.
Given an SMT Σ, E , we can freely generate a PROP, by taking Σ-terms as arrows, modulo the equations SMT, which are: • the equations stating that compositions ; and ⊕ form monoids • the equations of Figure 2 • the equations E PROPs have a nice 2-dimensional notation, where sequential composition is horizontal composition of diagrams, and parallel/tensor composition is vertical stacking of diagrams (see Figure 1).
Figure 2: Equations of symmetric monoidal categories We now present the SMTs of bijections B , injections I , surjections S , functions F , partial functions P , relations R and monotone maps M .1The diagram in Figure 3 shows the corresponding operations and equations.
To ease comparison with the corresponding nominal monoidal theories in Figure 8, we also added a striped background to the equations with wire-crossings, since they are already implied by the naturality of symmetries (SMT-nat).These are equations that are part of the definition of a PROP in the sense of MacLane [Lan78] but not in the sense of Lack [Lac04].The right-hand equation for bijections B is (SMT-sym) and holds in all symmetric monoidal theories.We list it here to emphasise the difference with Figure 8.
Example 3.1.The SMT of functions F presents the category F which has natural numbers as objects, all functions as arrows and coproducts as ⊕.It is important to note that ⊕ is symmetric, but not commutative, with, for example, the symmetry σ 2,3 being depicted as We will see later that the category nF of nominal finite functions, see Examples 3.2, 4.2 and 5.6, has a commutative tensor.

Nominal Sets.
Let N be a countably infinite set of 'names' or 'atoms'.Let S be the group of finite2 permutations N → N .An element x ∈ X of a group action S × X → X is supported by S ⊆ N if π • x = x for all π ∈ S and x ∈ S (i.e.π restricted to S is the identity).A group action S × X → X where all elements of X have finite support is called a nominal set.
We write supp(x) for the minimal support of x and Nom for the category of nominal sets, which has as maps the equivariant functions, that is, those functions that respect the permutation action.As our running example, we choose the category of simultaneous substitutions: Example 3.2.We denote by nF the category of finite subsets of N as objects and with all functions as arrows.While nF is a category, it also carries additional nominal structure.In particular, both the set of objects and the set of arrows are nominal sets with supp(A) = A and supp(f ) = A∪B for f : A → B. The categories of injections nI, surjections nS, bijections nB, partial functions nP and relations nR are further examples along the same lines.
One of the aims of this paper is to exhibit and analyse further structure of this example.For example, all bijections in nF can be built from basic functions We call the tensor, or the monoidal or vertical or parallel composition.Semantically, the simultaneous substitution on the right-hand side above, will correspond to the function f : {a, c} → {b, d} satisfying f (a) = b and f (c) = d.
Importantly, parallel composition of simultaneous substitutions is partial.For example, [a →b] [a →c] is undefined, since there is no function {a} → {b, c} that maps a simultaneously to both b and c.Remark 3.3.Let us make some remarks about the advantages of a 2-dimensional calculus for simultaneous substitutions over a 1-dimensional calculus one.A calculus of substitutions can be understood as an algebraic representation of the category nF of finite subsets of N .In a 1-dimensional calculus, operations [a →b] have to be indexed by finite sets S Finally, while it is possible to write down the equations and rewrite rules for the 1-dimensional calculus, it does not appear as particularly natural.In particular, only in the 2-dimensional calculus, will the swapping have a simple normal form such as [a →b] [b →a] (unique up to commutativity of ).

Internal monoidal categories
We introduce the, to our knowledge, novel notion of an internal monoidal category.Given a symmetric monoidal category (V, I, ⊗) with finite limits, we are interested in categories C, internal in V, that carry a monoidal structure not of type where • × is a certain lifting, defined below, of ⊗ to categories internal in V. Before going into the technicalities, let us resume Example 3.2 from the previous section in order to explain why we want to work with the lifted tensor product • ×.First, we give the example of the monoidal category in which we will internalise.
Example 4.1.The symmetric monoidal (closed) category (Nom, 1, * ) of nominal sets with the separated product * is defined as follows [Pit13]. 1 is the terminal object, i.e. a singleton with empty support.The separated product of two nominal sets is defined as Nom is also a symmetric monoidal (closed) category wrt the cartesian product.The two monoidal structures are related by injections j A,B : Next, let us go back to the category nF of Example 3.2, which is the category we want to internalise in (Nom, 1, * ).Recall that while parallel composition in the category F of Example 3.1 is the coproduct we have seen in Example 3.2 that the parallel composition in nF is a partial operation One way to proceed would be to develop a theory of partial monoidal categories.But in our case, it seems more elegant to notice that is a total operation : nF * nF → nF since the separated product * accounts for the constraint that f g is defined iff the domain and codomain of f and g are disjoint.The purpose of this section is to define the notion of internal monoidal category and to show that (nF, ∅, ) is a monoidal category internal in (Nom, 1, * ) with of type : nF • * nF → nF.where • * is the lifting of * to categories internal in Nom.
The task, then, of this section is to extend * : Nom × Nom → Nom to where we denote by Cat(Nom), the category of small internal categories 3 in Nom.See also Remark 4.10 for a summary of notation.At the end of the section, we will have justified our main example: Example 4.2.Following on from the previous example, the category nF is a monoidal category internal in (Nom, 1, * ) with monoidal operation given by A The unit is the empty set ∅.
Since ⊗ does not need to preserve finite limits, we cannot expect that defining (C × C being an internal category.The purpose of the next example is to show what goes wrong in a concrete instance. Example 4.3.Following on from the previous example, given (Nom, 1, * ), we define, just for the purposes of this example, a binary operation nF • * nF as (nF • * nF) 0 = nF 0 * nF 0 and (nF • * nF) 1 = nF 1 * nF 1 .Then nF • * nF cannot be equipped with the structure of an internal category.Indeed, assume for a contradiction that there was an appropriate pullback (nF • * nF) 2 and arrow comp such that the two diagrams commute: (nF Let δ xy : {x} → {y} be the unique function in nF of type {x} → {y}.Then ((δ ac , δ bd ), (δ cb , δ da )), which can be depicted as , but there is no comp such that the two squares above commute, since comp((δ ac , δ bd ), (δ cb , δ da )) would have to be (δ ab , δ ba ).But since δ ab and δ ba do not have disjoint support (since supp(δ ab ) = supp(δ ba ) = {a, b}), this set cannot be in nF 1 * nF 1 .
In the example, the attempt to define a tensor on the category To ask for pairs of arrows in (C ⊗ C) 1 to have disjoint support is too much.Instead we should be looking for a general categorical definition that restricts to those pairs of arrows in (C ⊗ C) 1 that have disjoint domains and disjoint codomains.
The solution to the problem consists in assuming that the given symmetric monoidal category with finite limits (V, 1, ⊗) is semi-cartesian (aka affine), that is, the unit 1 is the terminal object.In such a category there are canonical arrows natural in A and B (dropping the subscripts of j A,B ) and we can use them to define arrows give us the right notion of tensor on arrows.From our example nF above, we know that we want arrows (f, g) to be in (C We now turn this into a category theoretic definition, which is in fact an instance of the general and wellknown construction of pulling back an internal category C along an arrow j : X → C 0 .This construction yields an internal category X with X 0 = X and X 1 the pullback of dom C , cod C along j × j, or, equivalently, the limit in the following diagram Next we define i : X 0 → X 1 as the arrow into the limit X 1 given by Recalling the definition of j 1 from (4.1), there is also a corresponding j 2 : X 2 → C 2 due to the fact that the product of pullbacks is a pullback of products.
Recall the definition of the limit X 1 from (4.1).Then comp X : from which one reads off Finally, in analogy with the definition of j 2 in (4.3), j 3 is defined as the unique arrow into the pullback C 3 , where X 3 is defined in the expected way: This ends the definition of X.Since pulling back internal categories is a well known construction, we skip the verification that X is an internal category.The reader interested in the technical details may find them in the thesis [Bal20] of the first author.We summarise what we have done so far in Proposition 4.4.Given an internal category C and an arrow j : X → C 0 there is an internal category X and an internal functor j : X → C such that X 0 = X and j 0 = j.
To continue our development, we specialise to j : C ⊗ C → C × C available in all semi-cartesian monoidal categories.To make progress, we need to show that C ⊗ C extends to a functor As usual, the easiest way of proving functoriality and naturality is to exhibit the construction in question, in our case • ×, as a universal one.Thus, the next step is to exhibit the j : X → C from the proposition as a so-called cartesian lifting, a notion from the theory of fibrations [Jac01,Str22].
Moreover, P : W → V is called a (Grothendieck) fibration if all j : X → P Y have a cartesian lifting for all Y in W. If P : W → V is a fibration, the subcategory of W that has as arrows the arrows f such that P f = id Y is called the fibre over Y .
The next lemma is a strengthening of Proposition 4.4.
Lemma 4.6.Let V be a category with finite limits.The forgetful functor Cat(V) → V is a fibration.
Proof.We have already shown how to lift j : X → C 0 to j : X → C. One can show that this is a cartesian lifting by drawing out the appropriate diagram.Namely, we have the forgetful functor (−) 0 : Cat(V) → V, which sends an internal category to its "object of objects", internal categories X, Y and an internal functor j between them.Given another internal category W and an internal functor k : W → Y and an arrow h : W 0 → Y 0 , s.t.k 0 = j 0 • h, we show there is a unique h, s.t.k = j • h.This essentially means we need to fill in the following diagram, such that all sub-diagrams commute: Since our category has all finite limits, we can define h 1 as an arrow into the limit X 1 : We obtain h 2 in a similar fashion, thus getting a unique h = (h 2 , h 1 , h), for which we have k = j • h.
While both Proposition 4.4 and Lemma 4.6 allow us to conclude that ⊗ on V can be lifted to an operation • × on Cat(V), we rely on the universal property of Lemma 4.6 to argue that • × is functorial and that j is natural.To show that • × is functorial we use that ⊗ : V × V → V is functorial and that j : In order to lift such natural transformations, which are arrows in the functor category V Cat(V)×Cat(V) , we use Lemma 4.7.If P : W → V is a fibration and A is a category, then Proof.P A is defined via post-composition with P , that is, P A (G) = P • G = P G and P A (η : G → H) = P η.To show that P A is a fibration, i.e. that all j : G → P H have a cartesian lifting j : G → H, we lift j point-wise, using the fact that for all j A : GA → P HA we have j A : GA → HA due to P being a fibration.It remains to check that j is a cartesian lifting, that is, given natural transformations k : F → H and h : P F → G, such that P k = P j • h, there is a unique h, s.t. the following diagrams commute Since k, j and h are natural transformations we have for all f : As P is a fibration, we obtain unique h A and h B for the diagram on the left above, s.t.P h A = h A and P h B = h B , thus obtaining a unique natural transformation h, for which k = h • j.
Instantiating the lemma with P = (−) 0 : Cat(V) → V and A = Cat(V) × Cat(V), we obtain as a corollary that lifting the tensor ⊗ : Theorem 4.8.Let (V, 1, ⊗) be a (symmetric) monoidal category with finite limits in which the monoidal unit is the terminal object.Let P = (−) 0 : Cat(V) → V be the forgetful functor from categories internal in V. Then the canonical arrow j : ×) inherits from (V, 1, ⊗) the structure of a (symmetric) monoidal category with finite limits in which the monoidal unit is the terminal object.
Proof.We continue to use the notation of the proof of Lemma 4.7.Let and j : G → P H be the associated natural transformation.We have by definition that Therefore, j has a cartesian lifting j : G → H by Lemma 4.7.In particular, G is a functor.
In this work we only need internal monoidal categories that are strict.In the same way as a strict monoidal category is a monoid in (Cat, 1, ×), an internal strict monoidal category is a monoid in (Cat(V), I, • ×): Definition 4.9 (Internal monoidal category).Let (V, 1, ⊗) be a monoidal category with finite limits in which the monoidal unit is the terminal object and let (Cat(V), I, • ×) be the induced symmetric monoidal category of internal categories in V.A strict internal monoidal category C is a monoid (C, ∅, ) in (Cat(V), I, • ×).
Remark 4.10.It may be useful to catalogue the different tensors.The first one is the cartesian product × of categories, with the help of which we define a monoidal product ⊗ on a particular category V and then lift it to a monoidal product • × on the category of categories internal in V.This then allows us to define on an internal category C a tensor , which we also call an internal tensor : Example 4.11.We see that the category nF of Example 4.2 is an instance of Definition 4.9 if we choose (V, 1, ⊗) = (Nom, 1, * ) and C = nF and = .
Remark 4.12.In the classical case where V = Cat and both ⊗ and • × are the cartesian product, the interchange law for follows from being a functor.In the same way, the interchange law for follows from being an internal functor (A.2) Example 4.13.In the category (nF, ∅, ) of finite sets of names and functions, see Example 4.2, we have the interchange law (f g);(f g ) = (f;f ) (g;g ) with the right-hand side being defined whenever the left-hand side is.

Nominal PROPs and Nominal Monoidal Theories
We introduce nominal PROPs as particular instances of the internal categories of Section 4, taking care to explicate the definition in enough detail so that the reader can follow the rest of the paper without working through the details of the previous section.Nominal PROPs in turn are presented by nominal monoidal theories (NMTs) and it is with this notion that we start.We also take the time to point out that sequential composition in NMTs is a binding operation and induces what we call diagrammatic α-equivalence.(π-def) The set of nominal terms or s is given by closing under the operations of Figure 4, which should be compared with Figure 1.
Every NMT freely generates a monoidal category internal in nominal sets by quotienting the generated terms by equations in E, together with the set NMT of equations containing: • the equations that state that id and ; obey the laws of a category • the equations stating that id ∅ and are a monoid • the equations of an internal monoidal category of Figure 5 • the equations of permutation actions of Figure 6 • the equations on the interaction of generators with bijections δ of Figure 7 Comparing SMT and NMT, we find that the main difference between the equations in Figure 2 and in Figure 5 is that the interchange law for is required to hold only if both sides are defined and that the two laws involving symmetries are replaced by the commutativity of .
(NMT-right) For terms to form a nominal set, we need equations between permutations to hold, along with the equations of Figure 6 that specify how permutations act on terms.
All the equations presented in the figures above are routine, with the exception of the last two, specifying the interaction of renamings δ with the generators [a γ b] ∈ Σ, which we also depict in diagrammatic form: Instances of these rules can be seen in Figure 8, where they are distinguished by a striped background.
5.2.Diagrammatic α-equivalence.The equations of Figure 6 and Figure 7 introduce a notion of diagrammatic α-equivalence, which allows us to rename 'internal' names and to contract renamings.
Definition 5.1.Two terms of a nominal monoidal theory are α-equivalent if their equality follows from the equations in Figure 6 and Figure 7.We may therefore use the π A as abbreviations in terms.The following proposition is proved by induction on the structure of terms, see [Bal20] for the details.

Every permutation π of names gives rise to bijective functions π
Proposition 5.2.Let t : A → B be a term of a nominal monoidal theory.The equations in Figure 6 and Figure 7 entail that π Corollary 5.3.Let t : A → B be a term of a nominal monoidal theory.Modulo the equations of Figure 6 and Figure 7, the support of t is A ∪ B.
Proof.It follows from the proposition that supp t ⊆ A ∪ B. For the converse, suppose that there is x ∈ A ∪ B and a support S of t with x / ∈ S ⊆ A ∪ B. Choose a permutation π that fixes S and maps x to some π The corollary shows that internal names are bound by sequential composition.Indeed, in a composition A t → C s → B, the names in C \ (A ∪ B) do not appear in the support of t ; s.

Nominal PROPs.
From the point of view of Section 4, a nominal PROP, or nPROP for short, is an internal strict commutative monoidal category in (Nom, 1, * ) where • objects are finite sets of names, • tensor is given by union of disjoint sets, • arrows contain all bijections, • permutations act on objects and bijections point-wise.
A functor between nPROPs is an internal strict monoidal functor that is the identity on objects and bijections.For readers who skipped Section 4, we spell out the definition of nPROP explicitly: Definition 5.4.Given a countably infinite set N of 'names', an nPROP (C, I, ) consists of a set C 0 of 'objects' and a set C 1 of 'arrows' satisfying the following conditions.
• C 0 is the set of finite subsets of N .
• C 0 is equipped with a permutation action given by π • A = π[A] = {π(a) | a ∈ A} for all finite permutations π : N → N .• C is a category.We write ; for its 'sequential' composition (in the diagrammatic order).
• C 1 contains at least all bijections ('renamings') π A : A → π • A, see Definition 5.1, and is closed under the operation mapping an arrow f : the partial operation 'union of disjoint sets'.

•
: g} with the empty function as a unit.
• (f ; f ) (g; g ) is defined whenever (f g); (f g ) is and then both are equal.
• A nominal PROP has a nominal set of objects and a nominal set of arrows.
• The support supp(A) of an object A is A and the support of an arrow f : In particular, supp (f ;g) = dom f ∪ cod g.In other words, nominal PROPs have diagrammatic α equivalence.• There is a category nPROP that consists of nominal PROPs together with functors that are the identity on objects and strict monoidal and equivariant.• Every NMT presents a nPROP.Conversely, every nPROP is presented by at least one NMT given by all terms as generators and all equations as relations.

Examples. We present as examples those
NMTs that correspond to the SMTs of Figure 3.The significant differences between Figure 3 and Figure 8 are that wires now carry labels and that there is a new generator a i i b which allows us to change the label of a wire.Moreover, in the nominal setting, rules for wire crossings are not needed.We should be able to switch easily between a notion of ordered names on the one hand and a notion of unordered abstract names on the other.This intuition is reinforced by putting Figures 3 and 8 next to each other.A careful investigation suggests that there is a general procedure to automatically translate one into the other.This section will give such translations and prove that these translations are inverse to each other and preserve completeness.This yields a tool to derive completeness of an NMT from the completeness of the corresponding SMT and vice versa.
In Section 6.1 we define operations Prop : SMT → PROP and nProp : NMT → nPROP quotienting theories to their represented categories.Sections 6.2-6.4 are devoted to showing that the categories PROP and nPROP are equivalent.Section 6.5 defines the translation nfNmt : SMT → NMT and Section 6.6 shows that nfNmt(S) is complete if S is complete.Sections 6.7-6.8 establish the analogous result in the other direction.
6.1.Interpreting (nominal) monoidal theories as (nominal) PROPs.We start by formalising the operation that maps a theory to the category it represents.Given a theory Σ, E of string diagrams, where Σ is the set of generators and E ⊆ Trm(Σ) × Trm(Σ) is the set of equations, the operation Prop : SMT → PROP takes the signature Σ, E to the category of SMT terms, quotiented by the equations of E. Definition 6.1.The functor Prop : SMT → PROP is defined as Figure 9: Closure operator This definition uses the closure operator Th, defined in Figure 9, which is the usual deductive closure of equational logic.We have * ∈ { ; , ⊕ } for equations on Trms and for equations on nTrms we have * ∈ { ; , } along with an additional rule for permutations: We have a similar construction for NMTs, where we define a functor nProp : NMT → nPROP: Definition 6.2.The functor nProp : NMT → nPROP is defined as We will need later that homomorphisms of term-algebras, see Sections 6.6 and 6.8, preserve equations.Lemma 6.3.Given a set of equations X ⊆ nTrm(A) × nTrm(A), or X ⊆ Trm(A) × Trm(A), and a homomorphism f : nTrm(A) → nTrm(B), or f : Trm(A) → Trm(B), we have For "boxing" to preserve the relevant structure, we have to ensure, in particular, that the symmetric monoidal tensor of a PROPs is mapped to the commutative tensor of nPROPs, and that sequential composition and identities are preserved: We give the details of this construction in the proposition below, using the following notational conventions.Notation 6.4.
• The elements of [a 1 , . . .a n ] will always be pairwise distinct and we say that a is an enumeration of set(a).• Given enumerations a and a with a = a we abbreviate the bijection mapping i → j whenever a i = a j as a|a • Given enumerations a and b of the same length, we write [a|b] for the bijection δ a i b i mapping a i → b i .
• Given two enumerations a and b, we write a + + b for their concatenation (as lists).
Then, NOM : PROP → nPROP is a functor mapping an arrow of PROPs F : S → S to an arrow of nPROPs NOM(F ) : In the proposition above, [a f b] is a purely formal generator.Of course, the intuition is that [a f b] represents a composition of maps [a ;f ; b].This can be made explicit as in the following example.
Then, ORD is a functor mapping an arrow of nPROPs F : T → T to an arrow of PROPs ORD(F ) : ORD(T ) → ORD(T ) defined by In the proposition above, similarly to Proposition 6.5, the notation a]f [b denotes formal generators.The intended meaning as a composition of three functions is made clear by the next example for which we borrow notation from Example 6.6.
Example 6.8.The category F is isomorphic to ORD(nF), with the isomorphism G : ORD(nF) → F given, for all f : A → B, as The detailed verifications are straightforward and can be found in [Bal20, Example 7.26].6.4.Equivalence of PROPs and nominal PROPs.We show that PROP and nPROP are equivalent.More precisely, the functors ORD from Proposition 6.7 and NOM from Proposition 6.5 form an equivalence of categories.Proposition 6.9.For each PROP S, there is an isomorphism of PROPs, natural in S, ∆ : S → ORD(NOM(S)) Proof.For a proof see [Bal20, Proposition 7.33].Proposition 6.10.For each nPROP T , there is an isomorphism of nPROPs, natural in T , Proof.For a proof see [Bal20, Proposition 7.34].
Since the last two propositions provide an isomorphic unit and counit of an adjunction, we obtain Theorem 6.11.The categories PROP and nPROP are equivalent.Remark 6.12.If we generalise the notion of PROP from MacLane [Lan78] to Lack [Lac04], in other words, if we drop the last equation of Figure 2 expressing the naturality of symmetries, we still obtain an adjunction, in which NOM is left-adjoint to ORD.Nominal PROPs then are a full reflective subcategory of ordinary PROPs.In other words, the (generalised) PROPs S that satisfy naturality of symmetries are exactly those for which S ∼ = ORD(NOM(S)).Example 6.14 shows in more detail how naturality of symmetries is a consequence of the commutativity of the nominal tensor.6.5.Translating SMTs into NMTs.We give a formal definition of the translation of the ordinary theories of Figure 3 to the nominal theories of Figure 8.
First let us recall that the composition of Prop from Remark 6.1 with the functor NOM from Proposition 6.5, gives us the following interpretation of a PROP as an nPROP: Given an SMT Σ, E , we can generate an nPROP, by simply taking all the SMT-terms over Σ, as generators (taking Trm(Σ) to nTrm(Trm(Σ))) and taking box(E) ∪ NOM as equations, where: • NOM are the equations from Proposition 6.5 Whilst this construction gives us a way of embedding equivalence classes of ordinary string diagrams into equivalence classes of nominal ones, it does not answer the question of how to translate the axioms defining an SMT into the axioms of the corresponding NMT.
If we recall the definition of an NMT, we see that the signature of a nominal theory consists of a set of ordinary generators Σ and set of equations over nTrm(Σ).Thus, given the ordinary signature of an SMT, with generators Σ and the set of equations E ⊆ Trm(Σ) × Trm(Σ), we need to obtain an E ⊆ nTrm(Σ) × nTrm(Σ) such that any equivalence class induced by E and the equations of NOM (due to the ordinary diagrams being embedded in nominal ones) are mirrored by E.
Intuitively, we translate equations of E, by first embedding them inside a 'nominal box' as a whole and then use the rules of NOM to recursively normalise all "sub-diagrams" into nominal ones (see Example 6.14).When we hit the "base case", i.e. a "boxed" generator from Σ, we simply replace it with a corresponding nominal generator: The definition nfNmt : nTrm(Trm(Σ)) → nTrm(Σ) is thus straightforward: Definition 6.13.We define Nmt : SMT → NMT as where we extend the function nfNmt on a set of equations in the obvious way: We now return to Figure 3 and Figure 8 and show at the hand of an example how, by applying Nmt to the equations in Figure 3, we obtain the equations in Figure 8.
The only interesting case is the one of a nominal generator Proof.We want to show that the two maps nfNmt and ι are isomorphisms.By definition, both nfNmt and ι are homomorphisms between the term algebras.To verify that they are well-defined, that is, that they respect equivalence classes of nTrms, we need to check that they preserve the equations: • For the map ι we have to show In fact, by Lemma 6.For this it suffices: To justify the second inequality, we only need to prove: This finishes the proof.
In Section 5.4, we introduced the nominal monoidal theories for the categories of bijections, injections, surjections and functions (amongst others), see Figure 8.We show now how to prove the completeness of these theories from the completeness of the corresponding SMTs of Figure 3.
Recall that completeness of an SMT Σ, E with regards to some category C means that the PROP presented by Σ, E is isomorphic to Likewise, the completeness of an NMT with regards to some category nC is the existence of an isomorphism nProp Σ, E ∼ = nC Theorem 6.16 (Completeness of NMTs).The calculi of Figure 8 are sound and complete, that is, the categories presented by these calculi are isomorphic to the categories of finite sets of names with the respective maps.
Proof.We show the result for the category of finite functions nF.Similar arguments apply to the other theories presented in Figure 8.In order to show completeness of the nominal theory of functions w.r.t.nF, we start with the SMT Σ F , E F of Figure 3.We know Compared to what we have seen when we defined nfNmt, normalising embedded nominal string diagrams into ordinary string diagrams is slightly more tricky.This is due to the fact that in nominal sequential composition, we are allowed to compose two diagrams which share the same set of output and input labels, disregarding the order of the named ports.
For example, in the picture below, we see a wire crossing inside the purple box, introduced by the fact that the ports of the box interface and the ports of the generator inside the box have to be lined up.The purple box in the pictures above orders sets of labelled wires.We write it as dia in one-dimensional notation and define it as follows.Recall that given a set A of names, we write a for a list that fixes an enumeration of the elements of A. The notation a] t [b is the one from Proposition 6.7.

• dia(t : A
Definition 6.17.We define Smt : NMT → SMT as In terms of Figure 11, the definition above corresponds to going around the square down-right.To prepare us for the next subsection, we also recall how to go around right-down.This is the converse to the construction at the start of Section 6.2, now taking an NMT Σ, E to Trm(dia(nTrm(Σ))), dia(E) ∪ ORD , where dia is as above and ORD are the equations from Proposition 6.7.In the next section, we show that this construction and the one in Definition 6.17 give rise to the same PROPs.
6.8.Completeness of SMTs.While Section 6.6 showed how to transfer completeness of SMTs to completeness of NMTs, we now go into the opposite direction.Indeed, we show how to prove the completeness of the Smt(Σ, E) from the completeness of a nominal monoidal theory Σ, E .The central observation is that the diagram in Figure 11 commutes up to isomorphism.
Lemma 6.18.The diagram in Figure 11 commutes up to isomorphism.Proof.We want to show that the two maps nfSmt and ι are isomorphisms.By definition, both nfSmt and ι are homomorphisms between the term algebras.To verify that these maps are well-defined, that is, that they respect equivalence of Trms, we need to check that they preserve the following equations: • For the map ι , we have to show In fact, by Lemma 6.3, it suffices to check that , where ORD = is equality up to the equations ORD ∪ SMT ∪ dia[NMT].The second is immediate.
• For the map nfSmt, we have to show the other direction for which it suffices: To justify the last inequality, we show: To conclude this section, we give a result analogous to Theorem 6.16.The theorem above can be useful when trying to prove soundness and completeness of an ordinary SMT, where the presented NMT is easier to prove sound and complete, like in the case of bijections described in Section 5.4: Example 6.20.The completeness proof for ordinary string diagrams given in [Laf03] is already quite complex in the case of bijections because it requires a complete calculus for permutations.On the other hand, the corresponding nominal theory of bijections has a trivial completeness proof because all nominal string diagrams in the theory of bijections normalise to a disjoint union of renamings.We can now apply the theorem above to obtain an easy completeness proof for the corresponding symmetric monoidal theory of bijections.

Conclusion
The equivalence of nominal and ordinary PROPs (Theorem 6.11), as well as the equivalence of nominal and symmetric monoidal theories (Theorems 6.19 and 6.16) has a satisfactory graphical interpretation.Indeed, comparing Figure 3 and Figure 8, truncated and shown side by side below, we see that both share, modulo different labellings of wires mediated by the functors ORD and NOM, the same core of generators and equations.The difference lies only in the equations expressing, on the one hand, that ⊕ has natural symmetries and, on the other hand, that generators are a nominal set and that is commutative.In fact, this can be taken as a justification of the importance of the naturality of symmetries, which, informally speaking, compensates for the irrelevant detail induced by ordering names.There are several directions for future research.First, the notion of an internal monoidal category has been developed because it is easier to prove the basic results in general rather than only in the special case of nominal sets.Nevertheless, it would be interesting to explore whether there are more interesting instances of internal monoidal categories in other semi-cartesian closed categories.
Second, internal monoidal categories are a principled way to build monoidal categories with a partial tensor.By working internally in the category of nominal sets with the separated product we can capture in a natural way constraints such as the tensor f ⊕ g for two partial maps f, g : N → V being defined only if the domains of f and g are disjoint.This reminds us of the work initiated by O'Hearn and Pym on categorical and algebraic models for separation logic and other resource logics, see e.g.[OP99, GMP05, DGS15].It seems promising to investigate how to build categorical models for resource logics based on internal monoidal theories.In one direction, one could extend the work of Curien and Mimram [CM17] to partial monoidal categories.
Third, there has been substantial progress in exploiting Lack's work on composing PROPs [Lac04] in order to develop novel string diagrammatic calculi for a wide range of applications, see e.g.[BGK + 16, BSZ17].It will be interesting to explore how much of this technology can be transferred from PROPs to nominal PROPs.
Fourth, various applications of nominal string diagrams could be of interest.The original motivation for our work was to obtain a convenient calculus for simultaneous substitutions that can be integrated with multi-type display calculi [FGK + 16] and, in particular, with the multi-type display calculus for first-order logic of Tzimoulis [Tzi18].Another direction for applications comes from the work of Ghica and Lopez [GL17] on a nominal syntax for string diagrams.In particular, it would be of interest to add various binding operations to nominal PROPs.
More generally, we expect nominal PROPs to play a role as an intermediate level of abstraction for the implementation of programming languages that have a denotational semantics as string diagrams.As case study, it would be interesting to look at the Bayesian Networks of [JZ18,JKZ19].

[
a →b] S : S ∪ {a} → S ∪ {b} for sets S with a, b / ∈ S. On the other hand, in a 2-dimensional calculus with an explicit operation for set union, indexing with subsets S is unnecessary.Moreover, while the swapping {a, b} → {a, b} in the 1-dimensional calculus needs an auxiliary name such as c in [a →c] {b} ; [b →a] {c} ; [c →a] {b} it is represented in the 2-dimensional calculus directly by [a →b] [b →a] lifts uniquely to a natural transformation j : C • × D → C × D and the terminal object 1 ∈ V lifts uniquely to a monoidal unit I of • ×.Moreover, (Cat(V), I, •

5. 1 .
Nominal monoidal theories.In analogy with symmetric monoidal theories (Section 3.1), a nominal monoidal theory (Σ, E) is given by a set Σ of generators and a nominal set E of equations.Each ordinary generator γ : n → m gives rise to a set of nominal generators: The set nΣ of nominal generators consists of all [a γ b] : A → B where A, B are sets of names of cardinality n and m respecitvely and a, b are lists, enumerating the elements of A, B (the enumerations list all elements and contain no repetitions).The set of nominal generators nΣ is closed under permutations: π • [a γ b] : π • A → π • B = [π(a) γ π(b)].

Figure 7 :
Figure 7: NMT Equations of δ Any such π A , as well as the inverse π −1 A , are parallel compositions of δ ab for suitable a, b ∈ N .In fact, we have

6. 2 .
Embedding PROPs into nominal PROPs.In this section, we start proving the equivalence of the categories PROP and nPROP by embedding ordinary PROPs into nPROPs.This is achieved in the following manner.Given an ordinary diagram f : n → m, f we create "boxed" nominal versions [a f b], where a = [a 1 , . . ., a n ] and b = [b 1 , . . ., b m ] are lists of pairwise distinct names: Proposition 6.5.For any PROP S, there is an nPROP NOM(S) that has an arrow [a f b] : a → b for all arrows f : n → m of S and for all lists a = [a 1 , . . .a n ] and b = [b 1 , . . .b m ] of pairwise distinct names.These arrows are subject to the set NOM consisting of the equations Example 6.6.nF is isomorphic to NOM(F) with the isomorphism G : NOM(F) → nF being defined as G([a f b]) = [[a f b]] where the 'semantic box' [[− − −]] translates an arrow f : n → m by pre-composing with − → a : A → n and post-composing with − → b −1 : m → B, where − → a is the bijection between a and n given by the ordering of the list a.In other words, we have [[a f b]] Embedding nominal PROPs into PROPs.We can embed nPROPs into PROPs in much the same fashion.We write this translation in one-dimensional syntax as a] f [b and in two-dimensional syntax as For the next proposition we use again Notation 6.4.Proposition 6.7.For any nPROP T there is a PROP ORD(T ) that has an arrow a]f [b ∈ ORD(T ) for each arrow f : A → B of T and for all lists a = [a 1 , . . .a n ] and b = [b 1 , . . .b m ] of pairwise distinct names.These arrows are subject to the set ORD of equations a] f ; g [c = a] f [b ; b] g [c (ORD-1) use the notation γ to highlight the difference between an element γ of Σ and the string diagram γ ∈ Trm(Σ) as in the blue box above.

Example 6. 14 .
In this example, we illustrate the translation of a rule of an SMT into the corresponding rule of an NMT via nfNmt.The diagram below shows the application of nfNmt to both sides of an equation in the SMT theory of surjections.The next diagram illustrates that the equation (SMT-nat) is subsumed by the equations of NMT, namely by (NMT-comm).Completeness of NMTs.We show how to prove the completeness of Nmt(Σ, E) from the completeness of Σ, E .The central observation is that the diagram in Figure 10 commutes up to isomorphism.First, we define the homomorphism of term-algebras ι : nTrm(Σ) → nTrm(Trm(Σ)): ι ([a γ b]) = [a γ b] where γ ∈ Σ ι (id a ) = id a ι (δ ab ) = δ ab ι (f ; g) = ι (f ) ; ι (g)

Figure 10 :
Figure 10: Completing the square [a γ b], which gets turned into an ordinary string diagram γ, embedded in a nominal diagram [a γ b].Lemma 6.15.The diagram in Figure 10 commutes up to isomorphism.
Theorem 6.19 (Completeness of SMTs).If the NMT Σ, E is complete for some nC and ORD(nC) ∼ = C, then Smt Σ F , E F is complete for C. Proof.From Lemma 6.18 we know that ORD(nProp Σ, E ) ∼ = Prop(Smt Σ, E ) From completeness of Σ, E for nC we know nProp Σ, E ∼ = nC Putting these together, we obtain Prop(Smt Σ, E ) ∼ = C