# Snake identity

> A cap after a cup straightens out to the identity: the zigzag equation of a dual pair. A String diagrams example with its LaTeX source.

A String diagrams example in the TeXeR TikZ library: https://texer.org/library/string-diagrams/snake-identity

Package: [String diagrams](https://texer.org/library/string-diagrams.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: snake identity, zigzag, duality

## Source

```latex
\begin{tikzpicture}[thick, baseline=(current bounding box.center)]
  \draw (0,0) -- (0,1.5) arc[start angle=180, end angle=0, radius=0.5]
  -- (1,1) arc[start angle=180, end angle=360, radius=0.5] -- (2,2.5);
  \node at (2.9,1.25) {$=$};
  \draw (3.8,0) -- (3.8,2.5);
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\begin{tikzpicture}[thick, baseline=(current bounding box.center)]
  \draw (0,0) -- (0,1.5) arc[start angle=180, end angle=0, radius=0.5]
  -- (1,1) arc[start angle=180, end angle=360, radius=0.5] -- (2,2.5);
  \node at (2.9,1.25) {$=$};
  \draw (3.8,0) -- (3.8,2.5);
\end{tikzpicture}
\end{document}
```
