# 6.4 Decorated cospans

## Contents

# 6.4 Decorated cospans#

This section is unique to one of the authors. See [1502.00872] Decorated Cospans and 1609.05382.pdf.

See Review “Seven-Sketches suggestions” - Google Docs (several issues in this section).

## 6.4.1 Symmetric monoidal functors#

See Monoidal functor and monoidal functor.

### Example 6.69#

### Symmetric monoidal power set functor#

For the image map \(im_f\), imagine what the function would do to the function \(f\) given by the relation \(\{(1,α),(2,β),(3,β)\}\). We have:

So that:

What the definition says is that each subset is mapped to its Image (mathematics); we call this an “image map” in Example 6.69. The new function, again represented as a relation, is:

In Image (mathematics) § Notation, the article authors suggest \(f^→\) and \(f^*\) as alternatives to \(im_f\). Many readers will be even more familiar with the \(f(A)\) and \(f[A]\) notations, although these are more ambiguous (relying on only capitalization to indicate a subset of some set rather than an element of the set).

See also category theory - Covariant Power set functor - MSE for a less helpful example because the source and target sets are the same size. The “Power sets functor” example in Functor § Examples is fine, although for someone new to the concept it is a bit confusing that the function \(f\) is a map from \(X\) to the power set of \(X\). That is, in that example we have (adding \(S\) and \(T\) from the definition in this text):

### Exercise 6.70#

Remember that \(|P(S)| = 2^{|S|}\). So we know that \(|P(S)×P(T)| = 2^{|S|+|T|}\) and \(|P(S×T)| = 2^{|S||T|}\); except when \(|S|=1\) or \(|T|=1\) the latter term will be equal to or much larger than the former. In the example above, we had \(|S|=3\) and \(|T|=2\). To imagine the 32 elements of \(P(S)×P(T)\), consider how much space it would take to write out the cartesian product of the 8 elements of \(P(S)\) and 4 elements of \(P(T)\) both explicitly written out above. To imagine the 64 elements of \(P(S×T)\), try taking the power set of (using e.g. Pascal’s triangle to get up to 64, or bit flipping six bits):

Inspect the diagram in Exercise 6.70. In terms of Rough Definition 6.68, in Example 6.69 and along the arrows on the top/bottom of the diagram we are substituting \(c_1 = S\) and \(c_2 = T\). Per Exercise 6.69, the power set functor acts on morphisms by sending them to the their image map, so e.g. \(P(f×g) = im_{f×g}\) and \(P(f)×P(g) = im_f×im_g\). What it means to be “natural” in this context then is similar to what it means to be natural in Natural transformation, but with F defined by the structure of the left side of the equation in Rough Definition 6.68 and G defined by the structure of the right side of the equation:

Let’s replace F and G in Natural transformation by \(F_n\) and \(G_n\) to avoid a namespace conflict with the \(F\) used for the symmetric monoidal functor. Then more explicitly, \(F_n\) and \(G_n\) are functors from \(𝓒×𝓒→𝓓\) (as also stated in Monoidal functor) and could be given:

We are being asked to show \(φ_{S,T}⨟im_{f×g} = im_f×im_g⨟φ_{S',T'}\). We know from Example 4.49 that:

These variable names follow Example 6.69, where \(A∈P(S)\) and \(B∈P(T)\) (A is a subset of S, and B is a subset of T).

The coherence maps are defined (these are essentially equivalent, but with the dummy variables changed):

How do we define \(im_{f×g}\)? By analogy with how \(A\) and \(B\) are defined above, let’s define \(C\) so \(C ∈ P(S×T)\). That is, \(C\) is a set of sets where each individual set comprises two-tuples:

The reason we’re starting with this rather general definition is that you can’t construct every element of \(P(S×T)\) from \(P(S)×P(T)\); the latter set is smaller (as discussed above). So you can’t take a spec of \(A,B\) to construct every element of \(P(S×T)\). For example, the set \(\{(2,α),(3,β)\}\) in the context of the example above is an element of \(P(S×T)\) but not an element of \(P(S)×P(T)\).

We do have more structure here, however, because every \(C\) will have been constructed from two sets \(A,B\) as \(A×B\) by \(φ_{S,T}\). Therefore:

Reveal 7S answer

## 6.4.2 Decorated cospans#

### Example of composition#

### Theorem 6.77#

### Exercise 6.78#

Because 𝓒 is a symmetric monoidal functor with finite colimits, the category \(\bf{Cospan}_𝓒\) is a hypergraph category by Example 6.61. Then, because the constant functor is a symmetric monoidal functor, we should also have that \(\bf{Cospan}_F\) is a hypergraph category by Theorem 6.77.

Reveal 7S answer

## 6.4.3 Electrical circuits#

### Exercise 6.79#

Reveal 7S answer

### A decoration functor for circuits#

### Exercise 6.80#

Reveal 7S answer

### Exercise 6.82#

Reveal 7S answer

### Open circuits using decorated cospans#

### Exercise 6.84#

Reveal 7S answer

### Composition in \(\textbf{Cospan}_{Circ}\)#

If we draw (6.85) in the style of (6.47) we get:

When the author refers to \(ι_N\) and \(ι_P\), he’s referring to how they are defined in (6.20), perhaps more clearly stated with these morphisms labeled on (6.85):

Said yet another way, the author uses the language “pushout maps” rather than what we might call the “coproduct maps” defined in (6.12) (which also use the symbol iota). The copairing is only defined in terms of (6.12), however, with \(f\) and \(g\) corresponding to \(ι_N\) and \(ι_P\) (perhaps this isn’t drawn because it leads to a namespace clash on \(ι_N\) and \(ι_P\)). So the function \(f = [ι_N,ι_P]: \underline{4}→\underline{3}\) is from the coproduct \(N+P\) to the pushout \(N+_BP\).

The clause “as described in Example 6.14 and 6.25” would probably be clearer if it ended with “respectively” (one covers copairing, the other covers pushout maps).

### Exercise 6.86#

These two functions have already been expressed as morphisms in \(\textbf{Cospan}_{Circ}\) in (6.72) and the drawing below it. Repeating those here:

Computing the composite of the cospans in the style of (6.47) (some of the connected components are given unique colors to help visually distinguish the arrows):

Computing the composite of the cospans in the style of (6.85):

The copairing \(f = [ι_N,ι_P]: \underline{7}→\underline{5}\):

Reveal 7S answer

### Monoidal product in \(\textbf{Cospan}_{Circ}\)#

### Exercise 6.88#

The second sentence repeats η; it should use both η and ε:

Also define cospans η: 0 → 2 and ε: 2 → 0 as follows:

Reveal 7S answer