TITLE: Curious decomposition between two sets
QUESTION [10 upvotes]: Suppose $X,Y$ are sets, and $f:X\to Y$ and $g: Y \to X$. Then there are disjoint subsets  $X_1,X_2 \subseteq X$ with $X_1\cup X_2= X$ and disjoint subsets $Y_1,Y_2 \subseteq Y$ with $Y_1\cup Y_2= Y$ such that

$f(X_1) = Y_1$,  and
$g(Y_2) = X_2$.

(This curious result is a consequence of the Knaster-Tarski fixed point theorem.)
Can this statement be generalized to partial functions, or even binary relations $R_1, R_2 \subseteq X\times Y$?

REPLY [5 votes]: Yes, I think the exact same proof goes through for binary relations $R: X \nrightarrow Y$ and $S: Y \nrightarrow X$ (which of course includes the partial function case). Each induces a monotone operation between power sets, e.g. $\exists R: PX \to PY$ takes $A \subseteq X$ to $\{y: \exists_{x \in A} R(x, y)\}$. Letting $\neg_X$ denote complementation on subsets $A \subseteq X$, we obtain a covariant (i.e. monotone) operation 
$$\neg_X \circ \exists S \circ \neg_Y \circ \exists R: PX \to PX$$ 
which by the Knaster-Tarski theorem has a fixed point $X_1 \in PX$. Put $Y_1 = (\exists R)(X_1)$ and $Y_2 = \neg_Y Y_1$ and $X_2 = (\exists S)(Y_2)$. Then $X_2 = \neg_X X_1$ by the fixed point equation.