co.combinatorics – Is there general theory of this type of problem?

Suppose we have a function $f(x_1 ,x_2 ,x_3 ,x_4).$ We know that we can factor it int 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.