This is a follow-up question to this [MO question](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/374197#374197), which was asked by Richard Stanley in a comment to my answer there.


Let $S$ be a commutative monoid and $f(x\_1, \dots, x\_n)$ be a function from $S^n$ to $S$. Given a partition $\alpha$ of $[n]$, we say that $f$ *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=\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$.



> 
> **Question.** Is it true that if $f$ factors with respect to both $\alpha$ and $\beta$, then $f$ also factors with respect to $\alpha \wedge \beta$?
> 
> 
> 


My answer to the linked question shows that the answer is **yes** if $S$ is a group, but the proof uses the fact that inverses exist. My proof also works for non-abelian groups (as long as you are careful what factoring means), but for this question I am happy to assume that $S$ is commutative.



Functions over monoids which factor in two different ways
Take $S$ to be the monoid on the set $\{0,2,3,4,5,6\}$ with operation $x\oplus y=\min(x+y,6).$


Let $g:\{0,1\}^3\to S$ be the function $(x,y,z)\mapsto \min(x+y+z+4,6).$ Using any surjective $h:S\to \{0,1\}$ this can be converted to $f(x,y,z)=g(h(x),h(y),h(z)).$ I'll just work with $g.$


$g$ factors with respect to $12,3$ and $1,23$: $g(x,y,z)=(x+y+2)\oplus(z+2)=(x+2)\oplus(y+z+2).$


But $g$ does not factor with respect to $1,2,3.$ Suppose for contradiction that $g(x,y,z)=f\_1(x)\oplus f\_2(y)\oplus f\_3(z)$ for all $x,y,z.$ We must have $f\_i(1)=f\_i(0)+1$ for each $i,$ because $g(0,0,1)=g(0,1,0)=g(1,0,0)=5$ and $g(0,0,0)=4.$ This implies $f\_i(0)\geq 2.$ But then $f\_1(0)\oplus f\_2(0)\oplus f\_3(0)\geq 6> g(0,0,0).$


