If $f(f(x,a), b) = f(x, p)\; \forall x, a, b$, is it also true that $f(f^{-1}(f(x,a), b), c) = f(x, q) \;\forall x, a, b, c$? Let $f:\mathcal{F}\times\mathcal{G} \to \mathcal{F}$ be a function of two arguments, defined over finite sets $\mathcal{F}$ and $\mathcal{G}$, and bijective with respect to the first argument.  Let $g : \mathcal{F}\times\mathcal{G} \to \mathcal{F}$ be the "inverse bundle," i.e. $g(f(x, a), a) = x$ for all $x \in \mathcal{F}$.
Now suppose that for all $x\in\mathcal{F}$, and $a, b\in\mathcal{G}$, there exists $p\in\mathcal{G}$ such that $f(f(x, a), b) = f(x, p)$; it follows that $f(f(f(x,a),b),c) = f(x,q)$.  Is it then also the case that $f(g(f(x,a),b),c) = f(x,r)$ ? 

To me at least, it becomes more penetrable if we Schönfinkel it (Curry, if Haskell is more to your taste).
Then you have a map
$$\varphi \colon \mathcal{G} \to S(\mathcal{F}),$$
where $S(\mathcal{F})$ is the group of permutations of $\mathcal{F}$, with the property that
$$\bigl(\forall a, b \in \mathcal{G}\bigr)\bigl(\exists p \in \mathcal{G}\bigr)\bigl(\varphi(b)\circ\varphi(a) = \varphi(p)\bigr).$$
Since $a = b$ is not excluded, that means $\varphi(a)^n \in \varphi(\mathcal{G})$ for all $a \in \mathcal{G}$ and $n\in\mathbb{N}$, hence, since $S(\mathcal{F})$ is a finite group, the identity of $\mathcal{F}$, and the inverses of $\varphi(a),\, a \in \mathcal{G}$ belong to $\varphi(\mathcal{G})$, i.e. $\varphi(\mathcal{G})$ is a subgroup of $S(\mathcal{F})$. In particular, for all $a\in\mathcal{G}$, the map $\varphi(a)^{-1} = \psi(a) \colon x \mapsto g(x,a)$ belongs to $\varphi(\mathcal{G})$, hence is itself of the form $\varphi(b)$ for some $b\in\mathcal{G}$, so indeed
$$ f(g(f(x,a),b),c)=f(x,r)$$
for some $r\in\mathcal{G}$.
