The inverse of $f$ is the relation $f^{-1}\colon B\mathrel {\rightarrow \kern -9.5pt\mathrlap {|}\kern 6pt}A$ defined as follows:
-
•
Viewing relations from $B$ to $A$ as subsets of $B\times A$, we define
\[ f^{-1}\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ (b,f^{-1}(b))\in B\times A\ \middle |\ a\in A\right\} , \]where
\[ f^{-1}(b)\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ a\in A\ \middle |\ f(a)=b\right\} \]for each $b\in B$.
-
•
Viewing relations from $B$ to $A$ as functions $B\times A\to \{ \mathsf{true},\mathsf{false}\} $, we define
\[ [f^{-1}]^{b}_{a}\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\begin{cases} \mathsf{true}& \text{if there exists $a\in A$ with $f(a)=b$,}\\ \mathsf{false}& \text{otherwise} \end{cases} \]for each $(b,a)\in B\times A$.
-
•
Viewing relations from $B$ to $A$ as functions $B\to \mathcal{P}(A)$, we define
\[ f^{-1}(b)\mathrel {\smash {\overset {\mathclap {\scriptscriptstyle \text{def}}}=}}\left\{ a\in A\ \middle |\ f(a)=b\right\} \]for each $b\in B$.