Suppose we have a function $f(x\_1 ,x\_2 ,x\_3 ,x\_4).$ We know that we can factor it in two ways as $f(x\_1 ,x\_2 ,x\_3 ,x\_4)=\phi\_1 (x\_1 ,x\_2 )\phi\_2(x\_3 ,x\_4 )=\psi\_1 (x\_1,x\_3)\psi\_2(x\_2,x\_4)$


Show that we can completely factor the function as: $f(x\_1 ,x\_2 ,x\_3 ,x\_4)=\varphi\_1(x\_1)\varphi\_2(x\_2)\varphi\_3(x\_3)\varphi\_4(x\_4).$


I stumbled a little bit on this elementary problem as the proof is not as immediate as I think. But eventually I can prove this.


Here the overlap of partition {{1,2} {3,4}} and {{1,3},{2,4}} is {{1},{2},{3},{4}} and indeed satisfying the first two partition implies that we can factor by the overlap of both partitions.


I wonder if there is a general statement/theory of this.



Function of $(x_1,x_2,x_3,x_4)$ that factors in two ways as $\phi_1 (x_1 ,x_2 )\phi_2(x_3 ,x_4 )=\psi_1 (x_1,x_3)\psi_2(x_2,x_4)$
Here is a fairly straightforward proof which also proves various generalizations of your problem. Choose $c,d$ such that $\phi\_2(c,d) \neq 0$. If no such $c,d$ exist, then $f$ is identically $0$ and can be completely factored trivially. Now,
$$\phi\_1(x\_1, x\_2)=\psi\_1(x\_1, c)\psi\_2(x\_2, d) \phi\_2(c,d)^{-1},$$
for all $x\_1$, $x\_2$. Similarly, choosing $a$, $b$ such that $\phi\_1(a,b) \neq 0$, we have
$$\phi\_2(x\_3, x\_4)=\psi\_1(a, x\_3)\psi\_2(b, x\_4) \phi\_1(a,b)^{-1},$$
for all $x\_3$, $x\_4$. Thus,
$$f(x\_1 ,x\_2 ,x\_3 ,x\_4)=\phi\_1(a,b)^{-1}\phi\_2(c,d)^{-1}\psi\_1(x\_1, c)\psi\_2(x\_2, d) \psi\_1(a, x\_3)\psi\_2(b, x\_4), $$
for all $x\_1,x\_2,x\_3,x\_4$. $\Box$


The same proof also proves the following generalization. Given a partition $\alpha$ of $[n]$, we say that $f(x\_1, \dotsc, x\_n)$ *factors with respect to $\alpha$* if for each $A \in \alpha$ there exists a function $f\_A$ (which only depends on the variables $x\_i$ for $i \in A$) such that $f(x\_1, \dotsc, x\_n)=\prod\_{A \in \alpha} f\_A$. Given two partitions $\alpha$ and $\beta$ of $[n]$, $a \wedge b$ is the partition of $[n]$ whose sets are the non-empty sets of the form $A \cap B$ for $A \in \alpha$ and $B \in \beta$.


**Lemma.** Let $\alpha$ and $\beta$ be partitions of $[n]$. If $f(x\_1, \dotsc, x\_n)$ factors with respect to both $\alpha$ and $\beta$, then $f(x\_1, \dotsc, x\_n)$ factors with respect to $\alpha \wedge \beta$.


Note that I am only using the fact that the function takes values in some field or some group. I am not sure if the result still holds if inverses do not exist (this was asked by Richard Stanley in the [comments](https://mathoverflow.net/questions/374180/function-of-x-1-x-2-x-3-x-4-that-factors-in-two-ways-as-phi-1-x-1-x-2#comment948410_374197) below).


**Update.** The above lemma does not always hold for monoids, as shown by Harry West in an [answer](https://mathoverflow.net/a/401397) to [Functions over monoids which factor in two different ways](https://mathoverflow.net/questions/398427/functions-over-monoids-which-factor-in-two-different-ways).


