Principal ideal subrings of formal power series rings In the formal power series ring $\mathbb{F}[[x]]$ over a field $\mathbb{F}$ of characteristic $p>0$, consider an element of the form $f=\sum_{i=0}^\infty a_ix^{p^i}$.  Let $R$ denote the unitary subalgebra of $\mathbb{F}[[x]]$ generated by $x$ and $f$. 
In my recent work I came across the following problem: 

QUESTION. When is $R$ a principal ideal domain?  

Of course, this is trivial whenever $x$ belongs to the subalgebra generated by $f$ (or vice versa).
 A: More generally, let $f=\sum_{i}^\infty a_i x^{p^i}$ and $g=\sum_{i}^\infty b_i x^{p^i}$ two formal power series involving $p$-powers of $x$ only. Then the subalgebra $R$ generated by $f$ and $g$ is a PID iff there exist $\alpha_0, \alpha_1,\ldots,\alpha_m, \beta_0, \beta_1,\ldots,\beta_n \in \mathbb{F}$ with $\alpha_0,\beta_0 \neq (0,0)$ such that the element
$$
h=\sum_{i=0}^m\alpha_i f^{p^i}+ \sum_{j=0}^n\beta_j g^{p^j}
$$
generates $R$ as an algebra.
Indeed, the condition is clearly sufficient, as in that case $R$ is isomorphic to a polynomial algebra in one indeterminate. For the converse, observe first that $f$ and $g$ cannot be algebraically independent (as already remarked by Mohan), otherwise $R$ would be isomorphic to a polynomial algebra in two variable and so it cannot be a PID. Let $\Omega$ denote the ideal consisting of all elements of $R$ with zero constant term. As any quotient ring of a PID is also a PID, it is easy to see that, for every $k>0$, $R/ \Omega^{p^k}$ is isomorphic to a truncated polynomial algebra in one variable. Consequently, there are $\alpha_0, \alpha_1,\ldots,\alpha_{k-1}, \beta_0, \beta_1,\ldots,\beta_{k-1} \in \mathbb{F}$ with $\alpha_0,\beta_0 \neq (0,0)$ such that the element
$$
\bar{h}=\sum_{i=0}^{k-1}\alpha_i f^{p^i}+ \sum_{j=0}^{k-1}\beta_j g^{p^j}
$$
is a generator for $R/ \Omega^{p^k}$ as an algebra. As $f$ and $g$ are algebraically dependent, using the fact that $\bigcap_{n=0}^{\infty}  \Omega^n=\{ 0\}$  one can now see that there exist an element $h$ with the required property.  
A: This happens if and only if the coefficients $a_i$ satisfy a simple Frobenius-linear recurrence $a_i = \sum_{j=1}^n a_{i-j}^{p^j} c_j$ for all $i \geq n$.
First assume that $R$ has dimension $1$.
$R$ is an integral domain generated by $x$ and $f$, so it is $\mathbb F[x,f]/I$ for some prime ideal $I$. Because $x$ and $f$ satisfy some relation, $I$ is nonempty, and because $x$ satisfies no relation all on its own, $I$ is maximal, so $I$ is generated by a single element $g(x,f)$.
Observe that $g(x_1+x_2, f(x_1) + f(x_2))= g(x_1+x_2, f(x_1+x_2))$ vanishes as an element of $\mathbb F[[x]] \otimes \mathbb F[[x]]$. So it vanishes as an element of $R \otimes R = F[x,f]/g(x,f) \otimes F[x,f]/g(x,f)$.
Hence $g(x_1+x_2,y_1+y_2)$ lies in the ideal generated by $g(x_1,y_1)$ and $g(x_2,y_2)$. Because these polynomials all have the same degree, and $g(x_1,y_1)$ and $g(x_2,y_2)$ are in independent variables, we have $g(x_1+x_2,y_1+y_2)=c_1 g(x_1,y_1)+ c_2 g(x_2,y_2)$. We can clearly see that $c_1 = c_2 =1$.
In particular $g(x,y) =g(x,0)+g(0,y)$, so $g$ splits into a polynomial in $x$ and a polynomial in $y$. Furthermore $g(x_1+x_2,0)=g(x_1,0)+g(x_2,0)$, so both these are additive. In other words, the only monomials appearing  in $g(x,y)$ are $x^{p^i}$ and $y^{p^i}$.
Let $g(x,y) = \sum_{k=1}^m b_k x^{p^k} + \sum_{j=1}^n c_j y^{p^k}  $.
Expanding $g(x,\sum_i a_i x^{p^i})=0$, we get for all $i> \max(n,m)$ that $\sum_j c_j  a_{i-j}^{p^j}  =0$. Prune the coefficients $c_j$ so that the first one is nonzero, then divide the other coefficients by it. Then add additional $0$s to the end until the condition $i> \max(n,m)$ is no longer necessary. This gives the desired recurrence.

Conversely if $a_i = \sum_{j=1}^n a_{i-j}^{p^j} c_j$ for all $i \geq n$, then $f(x) - \sum_{j=1}^n f(x)^{p^j} c_j$ is a $p$-power polynomial in $x$ of degree at most $p^{n-1}$, i.e. $$f(x) - \sum_{j=1}^n f(x)^{p^j} c_j = \sum_{k=1}^{n-1} b_k x^{p^k}$$
The relation $$y- \sum_{j=1}^n y^{p^j} c_j = \sum_{k=1}^{n-1} b_k x^{p^k}$$ defines a finite etale cover of $\mathbb A^1$ - etale because the coefficient of $f(x)$ is nonzero. (We actually may want to work with a slightly smllaer finite etale cover, the connected component of $(0,0)$. To check this is a PID, it is sufficient to check that this smooth curve is isomorphic to $\mathbb A^1$. But there is a clear group structure on this curve: $(x_1,y_1) +(x_2,y_2)=(x_1+y_1,x_2+y_2)$. So the smooth affine curve has a transitive group of automorphisms and hence is isomorphic to $\mathbb P^1$ minus one or two points. It can't be $\mathbb P^1$ minus two points as there is no group homomorphism from that to $\mathbb A^1$.
