Intersection of finitely generated subalgebras also finitely generated?

It is enough to show that the intersection of two finitely generated semigroups inside a finitely generated commutative semigroup is not necessarily finitely generated, for then you can consider the semigroup algebras.

So let $A$ be freely generated by $\{y,z\}\cup\{x_n:n\geq1\}$ subject to the relations $yx_n=x_{n+1}$ and $zx_n=x_{n+1}$ for all $n\geq 1$, and $x_nx_m=x_{nm}$ for all $n,m\geq1$ (notice that $A$ in fact coincides with the given set of generators...). Let $A_1$ be the subsemigroup generated by $y$ and $x_1$, and let $A_2$ be the subsemigroup generated by $z$ and $x_1$. Then $A$, $A_1$ and $A_2$ are finitely generated and commutative, yet the intersection $A_1\cap A_2$ is the subsemigroup of $A$ generated by $\{x_n:n\geq1\}$, which is isomorphic to $\mathbb N$ under the product. This is not finitely generated.

Later: Yemon asks in a comment if one can change this so that the containing algebra is a domain. I think this works: let $A$ be the algebra generated by $\{y,z,u\}\cup\{x_n:n\geq2\}$ subject to the relations $yx_n=x_{n+1}$ and $zx_n=x_{n+1}+u$ for all $n\geq 2$, and $x_nx_m=x_{nm}$ for all $n,m\geq1$, let $A_1$ be generated by $y$ and $x_2$, and let $A_2$ be generated by $z$, $u$ and $x_2$. (I have to remove $x_1$ for otherwise $x_1(x_1-1)=0$)


Thomas Bayer has found a counter-example using rings of invariants inside polynomial rings.


Here is a variant of Mariano's construction that answers the question. We shall construct a commutative semigroup $S$ and its subsemigroups $S_1,S_2$ such that

(*) $S,S_1,S_2$ are finitely generated, but $S_1\cap S_2$ is not.

Then passing to the semigroup algebras $A=k[S]$, $A_1=k[S_1]$, $A_2=k[S_2]$, which satisfy $A_1\cap A_2=k[S_1\cap S_2]$ and have the same finite generation properties as the corresponding semigroups, would yield a counterexample to the question.

Let $T$ be the commutative subsemigroup of $\Bbb{Z}^2$ generated by $x_i=(i,1)$ for $i\geq 0$. Thus $$T=\{(a,b)\in\Bbb{Z}^2: a\geq 0, b\ge 1 \text{ or } a=b=0\}$$ consists of the integer points in the semiopen real cone $\{(a,b)\in \Bbb{R}^2: a\geq 0, b>0\}$ together with the origin. It is easy to see that $T$ is not f.g. Let $S$ be formed by adjoining commuting elements $y,z$ to $T$ subject to the relations $yx_i=x_iy=x_{i+1}$ and $z x_i=x_i z=x_{i+1}$. Set $S_1=\langle T,y\rangle$ and $S_2=\langle T,z\rangle$. Clearly, $S_1$ is generated by $x_0$ and $y$, $S_2$ is generated by $x_0$ and $z$ and $S$ is generated by $x_0, y$ and $z$. Moreover, $S_1\cap S_2=T$ is not f.g., meaning (*) holds.

Where does this come from? First, $T$ is the standard example of a non-f.g. commutative semigroup embedded into an f.g. one. In fact, both $S_1$ and $S_2$ are naturally isomorphic to $\Bbb{Z}_{+}^2$, with $y$, resp. $z$, corresponding to $(1,0)$, and $S$ is the amalgamated product of $S_1$ and $S_2$ over $T$ in the category of commutative semigroups. However, I do not see how to modify this construction to make $S$ an affine semigroup (so that $A=k[S]$ is a domain). In particular, it appears impossible to get a counterexample with $A$ a polynomial ring in this fashion.