Complete local rings, automorphisms and approximation Consider two local morphisms $f,g: B\rightarrow A$ of noetherian complete local rings and $f$ surjective.
Does there exist an integer $n\in\mathbb{N}$, such that if $f=g \mod \mathfrak{m}_{A}^{n}$ then $f$ and $g$ differ by an automorphism $\theta$ of $B$?
 A: In the regular case, this is true.  For simplicity, I will assume that $B$ contains its residue field $k$ as a subring, i.e., $B$ is a power series ring over $k$.  The general case should follow from the Cohen Structure Theorem.  
Denote the surjective local homomorphism of complete local Noetherian rings by, $$f:(B,\mathfrak{l})\to (A,\mathfrak{m}).$$  Let $x_1,\dots,x_r\in \text{Ker}(f)$ be elements whose images in $(\text{Ker}(f)+\mathfrak{l}^2)/\mathfrak{l}^2$ give a basis as a $k$-vector space.  Let $y_1,\dots,y_m$ be elements in $\mathfrak{l}$ whose images in $\mathfrak{l}/\mathfrak{l}^2$ give a basis for a complementary $k$-subspace.  By the hypothesis that $B$ is regular, the sequence $(x_1,\dots,x_r,y_1,\dots,y_m)$ is a regular sequence for $\mathfrak{l}$.  By construction, the images $f(y_1),\dots,f(y_m)\in \mathfrak{m}$ map to a basis for the $k$-vector space $\mathfrak{m}/\mathfrak{m}^2$.  Thus, the integer $m$ equals the $k$-vector space dimension of $\mathfrak{m}/\mathfrak{m}^2$, the integer $r+m$ equals the $k$-vector space dimension of $\mathfrak{l}/\mathfrak{l}^2$, and $r$ equals the difference between these two dimensions.  All of these integers depend only on the local rings $(B,\mathfrak{\ell})$ and $(A,\mathfrak{m})$, not on the homomorphism $f$.
For a surjective local homomorphism of complete local Noetherian rings, $$g:(B,\mathfrak{l}) \to (A,\mathfrak{m}),$$ let $x'_1,\dots,x'_r\in \text{Ker}(g)$ be elements whose images in $(\text{Ker}(g)+\mathfrak{l}^2)/\mathfrak{l}^2$ give a basis as a $k$-vector space.  There exists a $k$-linear automorphism of $\mathfrak{l}/\mathfrak{l}^2$ that maps the images of $x'_1,\dots,x'_r$ to the images of $x_1,\dots,x_r$.  Since $B$ is a power series ring, there is a local $k$-algebra automorphism of $B$ that maps the regular sequence $(x'_1,\dots,x'_r)$ to the regular sequence $(x_1,\dots,x_r)$, and that induces the specified automorphism of $\mathfrak{l}/\mathfrak{l}^2$.  Thus, without loss of generality, assume that $x'_i$ equals $x_i$ for every $i=1,\dots,r$.  Therefore both $f$ and $g$ factor through the quotient
$\overline{B}:=B/\langle x_1,\dots,x_r$, $$\overline{f},\overline{g}:(\overline{B},\overline{\mathfrak{l}})\twoheadrightarrow (A,\mathfrak{m}).$$ 
By construction, both $\overline{f}$ and $\overline{g}$ induce $k$-linear isomorphisms of $k$-vector spaces, $$\mathfrak{l}/\mathfrak{l}^2 \to \mathfrak{m}/\mathfrak{m}^2.$$  Thus, these $k$-linear maps differ by a (unique) $k$-linear automorphism of $\mathfrak{l}/\mathfrak{l}^2$.  This lifts to a local $k$-algebra automorphism of $\overline{B}$.  After performing this automorphism, assume that $f(y_1),\dots,f(y_m)$ and $g(y_1),\dots,g(y_m)$ are equal modulo $\mathfrak{m}^2$.  
Since $g$ is surjective, for every $i=1,\dots,m$, there exists an element $y'_i\in \mathfrak{l}$ such that $g(y'_i)$ equals $f(y_i)$, and such that $y'_i-y_i\in \mathfrak{\ell}^2$.  Since $\overline{B}$ is a power series $k$-algebra, there exists a unique local $k$-algebra automorphism of $\overline{B}$ that maps every $\overline{y}_i$ to $\overline{y}'_i$.  Since the composition of $\overline{g}$ and this automorphism agrees with $\overline{f}$ on the elements $\overline{y}_i$, and sense these are topological generators for the complete local ring $\overline{B}$, these morphisms are equal.  
