I'm trying to determine the number of binary relations between sets $A$ and $B$ that are both left-unique and right-unique, which we call one-to-one. That is, relations $R$ such that every $a \in A$ and every $b \in B$ appear in at most one pair in $R$. Here's what I'm thinking:
We can have such a relation containing any number of pairs ranging from $0$ up to $\min(m,n)$. If there are more pairs than this, uniqueness breaks. Let's say we are considering $k$ pairs, where $0 \leq k \leq \min(m,n)$. Then I must choose $k$ elements from $A$ and corresponding $k$ elements from $B$ to be paired. Once this is done, I can pair them uniquely in $k!$ ways (can view as a bijection between the chosen subsets, both of size $k$). This is the expression I arrived at: $$ \sum_{k=0}^{\min(m,n)} \binom{m}{k} \binom{n}{k} k!. $$ This formula makes sense as it is symmetric in $m$ and $n$ and the converse of a one-to-one relation is also one-to-one. I wrote a quick and dirty Python-script and verified it for small test cases. However, after much googling, I could not find this formula anywhere. Can anyone tell me if I'm just dead wrong about this one, and if so, where my logic breaks down? Thanks!