A double category has both: tight arrows (functions), loose arrows (relations), and squares relating them. We use these to express how to lift programs (or functions) to specifications (or relations) of their behavior.
This is a reference for effectful programs as arrows Power and Robinson (1997).
Definition 1 A proto double category has objects, tight arrows \(f : V \to V'\), loose arrows \(M : V \not\rightarrow W\) and squares
with loose composition associative and unital up to coherent (globular) isomorphisms.
Definition 2 A double category is a proto double category which furthermore has a loose composition of squares
as well as tight composition of squares
which satisfy the interchange law.
Example 1 \(\mathbb{R}\text{el}\) has sets, functions and relations \(R \subseteq A \times B\). A square from \(R\) to \(R'\) along \(f, g\) exists when
\[\forall (x, y) \in R.\ (f(x), g(y)) \in R'.\]
Example 2 \(\mathbb{P}\mathbb{R}\text{el}\) has sets, functions and proof relevant relations \(R : A \not\rightarrow B\) (functor \(\text{Disc}(A) \times \text{Disc}(B) \rightarrow \mathcal{S}\text{et}\)). A square from \(R\) to \(R'\) along \(f\) and \(g\) is a \(\phi =\)
\[(\phi_{x,y} : R(x,y) \rightarrow R'(f(x),g(y)))_{(x,y) \in A \times B}.\]
Example 3 For a symmetric monoidal category \(\mathcal{V}\), \(\mathcal{V}-\mathbb{P}\text{rof}\) has \(\mathcal{V}\)-enriched categories, \(\mathcal{V}\)-enriched functors and \(\mathcal{V}\)-Profunctors \(M : \mathbb{A}\not\rightarrow\mathbb{B}\) (\(\mathcal{V}\)-functor \(\mathbb{A} \otimes \mathbb{B}^{op} \rightarrow \mathcal{V}\)). A square from \(M\) to \(M'\) along \(F\) and \(G\) is a \(\mathcal{V}\)-natural transformation
\[\phi : M \Rightarrow M' \circ F \otimes G^{op}.\]
- Pending