# String diagram

In category theory, string diagrams are a way of representing 2-cells in 2-categories.

## Definition

The idea is to represent structures of dimension d by structures of dimension 2-d, using the Poincaré duality. Thus,

• an object is represented by a portion of plane,
• a 1-cell ${\displaystyle f:A\to B}$ is represented by a vertical segment — called a string — separating the plane in two (the left part corresponding to A and the right one to B),
• a 2-cell ${\displaystyle \alpha :f\Rightarrow g:A\to B}$ is represented by an intersection of strings (the strings corresponding to f above the link, the strings corresponding to g below the link).

The parallel composition of 2-cells corresponds to the horizontal juxtaposition of diagrams and the sequential composition to the vertical juxtaposition of diagrams.

Duality between commutative diagrams (on the left hand side) and string diagrams (on the right hand side)

## Example

Consider an adjunction ${\displaystyle (F,G,\eta ,\varepsilon )}$ between two categories ${\displaystyle {\mathcal {C}}}$ and ${\displaystyle {\mathcal {D}}}$ where ${\displaystyle F:{\mathcal {C}}\leftarrow {\mathcal {D}}}$ is left adjoint of ${\displaystyle G:{\mathcal {C}}\rightarrow {\mathcal {D}}}$ and the natural transformations ${\displaystyle \eta :I\rightarrow GF}$ and ${\displaystyle \varepsilon :FG\rightarrow I}$ are respectively the unit and the counit. The string diagrams corresponding to these natural transformations are:

String diagram of the unit
String diagram of the counit
String diagram of the identity

The string corresponding to the identity functor is drawn as a dotted line and can be omitted. The definition of an adjunction requires the following equalities:

{\displaystyle {\begin{aligned}(\varepsilon F)\circ F(\eta )&=1_{F}\\G(\varepsilon )\circ (\eta G)&=1_{G}\end{aligned}}}

The first one is depicted as

Diagrammatic representation of the equality ${\displaystyle (\varepsilon F)\circ F(\eta )=1_{F}}$

## Other diagrammatic languages

Monoidal categories can also be pictured this way[1] since a strict monoidal category can be seen as a 2-category with only one object (there will therefore be only one type of plane) and Mac Lane's strictness theorem states that any monoidal category is monoidally equivalent to a strict one. The graphical language of string diagrams for monoidal categories may be extended to represent expressions in categories with other structure, such as symmetric monoidal categories, dagger categories,[2] and is related to geometric presentations for braided monoidal categories[3] and ribbon categories.[4]