**Notation and Setting**: let $\operatorname{Aff}$ denote the category of affine schemes whose objects are covariant representable functors $\operatorname{X}:\operatorname{Ring}\rightarrow\operatorname{Set}$ and $\operatorname{Spec}:\operatorname{Ring^{op}}\rightarrow\operatorname{Func(Ring, Set)} $ be the contravariant Yoneda embedding of $\operatorname{Ring^{op}}$ in its category of presheaves so that $\operatorname{Aff}\simeq\operatorname{Ring^{op}}$.


In addition, let $\mathcal{O}:\operatorname{Func(Ring, Set)}\rightarrow\operatorname{Ring^{op}}$ be the functor that sends a functor $\operatorname{X}:\operatorname{Ring}\rightarrow\operatorname{Set}$ to the ring of maps $\operatorname{X}\rightarrow \mathbb{A}^1$ (where $\mathbb{A}^1$ is the forgetful functor) so that $\operatorname{Spec}$ and $\mathcal{O}$ are inverse of one another.


Let $\widehat{\operatorname{Aff}}$ be the indization of $\operatorname{Aff}$, i.e. the category whose objects are functors $\operatorname{X}:\operatorname{Ring}\rightarrow\operatorname{Set}$ that are small filtered colimits of affine schemes 


Let $\operatorname{G}\in\operatorname{Aff}$ be a group object (affine group), i.e $\operatorname{(G(R),m\_G)}$ is a group for every ring R, whereas $m\_G$ is the multiplication map $m\_G:\operatorname{G(R)}\times\operatorname{G(R)}\rightarrow\operatorname{G(R)}$ and $\mathcal{O}\_G$ the ring of maps $\operatorname{G}\rightarrow\mathbb{A}^1$.


Let $I\_0\supseteq I\_1 \supseteq I\_2 \supseteq \cdots$ be an infinite sequence of ideals in $\mathcal{O}\_G$, i.e $I\_n\in\mathcal{O}\_G$ for every $n$. From [Martin's argument](https://mathoverflow.net/questions/351050/simple-examples-of-colimits-of-affine-schemes-evaluated-in-the-presheaf-categor/351084#351084) we know that the formal colimit $\operatorname{Y}:=\mathrm{colimit}\_{n\in\mathbb{Z}\_{\geq0}}\operatorname{Spec(\mathcal{O}\_{X}/I\_n)}$ exists and is not an affine scheme (not representable). 


**My general question**: When is $\operatorname{Y}$ a formal group, i.e. a group object in $\widehat{\operatorname{Aff}}$?


My considerations were as follows: since $\operatorname{Spec(\mathcal{O}\_{G}/I\_n)}\subseteq\operatorname{G}$ is a subfunctor for every $n$, the universal property of $\operatorname{Y}$ as a colimit gives us a unique map $\phi:\operatorname{Y}\rightarrow\operatorname{G}$ which implies that $\operatorname{Y}$ is a subfunctor of $\operatorname{G}$ (since every two parallel maps to Y which have the same image on G are equal to one another). In particular, $y\in\operatorname{Y(R)}$ corresponds to a map $f:\mathcal{O}\_G\rightarrow R$ such that $I\_n\subseteq\operatorname{Ker(f)}$ for some $n$. For every ring R, we thus have $\phi:\operatorname{Y(R)}\rightarrow\operatorname{G(R)}, y\mapsto y$.


This fact, and the example of $\operatorname{Nil}\simeq\mathrm{colimit}\_{n\in\mathbb{Z}\_{\geq0}}\operatorname{Spec(\mathbb{Z}[x]/(x)^{n})}$ which delivers $\operatorname{(Nil(R),+)}\subseteq\operatorname{(\mathbb{A}^1(R),+)}$ as a subgroup, lead me to the claim:


$\operatorname{Y}$ is a formal group if and only if $\operatorname{Y}$ is a sub group of $\operatorname{G}$ 


Now $\leftarrow$ is trivial. To show $\rightarrow$, we let $\operatorname{Y}$ be a formal group with multiplication map $m\_Y$. Now if it is true (**this is the point I am not sure about**)  

that $\phi$ is **a map of formal groups** and not just a normal natural transforamtion
then we have
$\phi(m\_{Y}(y,y'))=m\_{G}(\phi(y),\phi(y'))$ which, since $\phi(y)=y$, is equivalent to 
$m\_{Y}=m\_{G}$ and we are done. 


**my specific questions**:


1. Is the universal map $\phi$ necceserally a map of formal groups and if so why?
2. Assuming the answer to 1. is negative then: 


2.1 In which cases is $\phi$ indeed a map of formal groups? 


2.2 are there any examples of such situations where $\operatorname{Y}$ is not a subgroup of $\operatorname{G}$?


**Edit: taking S. Carnahan's answer into consideration**


Not assuming that $\phi:\operatorname{Y(R)}\rightarrow\operatorname{G(R)}, y\mapsto y$ is automatically a map of formal groups, it follows that that $\phi$ is a map of formal groups iff there is some $k$ such that the kernel of the map given by $m\_G(y,y')$ lies in $I\_k$. 


Hopf ideals are kernals of maps of Hopf algebras. Thus
saying that $\operatorname{I}$ is a Hopf ideal is equivalent to saying that the map $\mathcal{O}\_{G}\rightarrow\mathcal{O}\_{G}/I$ is a map of Hopf algebras which is equivalent to the map $\operatorname{Spec(\mathcal{O}\_{G}/I)}\rightarrow\operatorname{Spec(\mathcal{O}\_{G})}$ being a map of affine groups.


**My question:** How do we show that the property $m\_G(y,y')$ lies in a certain $I\_k$ is equivalent to the fact that $I$ is a Hopf ideal?


Things to take into consideration:


* We have that $I\_k\subseteq I$.
* We know (Milne Algebraic Groups Pro. 3.12., p.67) that, given a Hopf ideal $I$, any Hopf algebra homomorphism $A\rightarrow B$ whose kernal contains $I$ factors uniquely through $A\rightarrow A/I$
* In the example of $\operatorname{Nil}$ we have for $a\in\operatorname{Nil\_n(R)}, b\in\operatorname{Nil\_m(R)}, (a+b)\in\operatorname{Nil\_{n+m}(R)}$ and thus $k=n+m$. In addition, the map $\mathbb{Z}[x]\rightarrow\mathbb{Z}[x]/(x)\simeq\mathbb{Z}$ is a map of Hopf algebras whose kernal $(x)$ is hence a Hopf ideal. How to show the equivalence in this example?


Thanks



Is the formal completion of an affine group necessarily a formal group?
The universal map is not a map of formal groups without some extra condition. An easy class of counterexamples comes from completions of an affine group along a closed subscheme that does not contain the identity element. In general, when you want to complete an affine group to get a formal group, you set $I\_n = I^n$ for an ideal $I$ that defines a closed subgroup. That is, $I$ is a Hopf ideal for the coordinate ring. In particular, $\Delta(I) \subseteq \mathcal{O}\_G \otimes I + I \otimes \mathcal{O}\_G$, so $\Delta(I\_n) \subseteq \sum\_{i+j=n} I\_i \otimes I\_j$.


To be more specific in the language you use, you need your system of ideals to be compatible with multiplication in the following way: If $y$ and $y'$ are $R$-points, such that the maps $\mathcal{O}\_G \to R$ have kernel containing $I\_n$ and $I\_{n'}$, respectively, then there is some $k$ such that the kernel of the map given by $m\_G(y,y')$ lies in $I\_k$. You have not specified any structure that forces this condition to hold. For Hopf ideals, our calculation of $\Delta(I\_n)$ shows that setting $k \geq n+n'$ is sufficient.


Here is an explicit example. We complete the additive group $\mathbb{G}\_a = \operatorname{Spec} k[x]$ (for some nonzero commutative ring $k$) at the point $1$, so our ideals are $I\_n = (x-1)^n$. Any $R$-point factors through some map $k[x]/(x-1)^n \to R$, but the product of such $R$-points comes from the composite $k[x] \to k[y,z] \to k[y,z]/((y-1)^m(z-1)^n) \to R$, where the first map takes $x$ to $y+z$, and hence $(x-2)^{m+n} \mapsto ((y-1)+(z-1))^{m+n}$. Then, this map necessarily factors through $k[x]/(x-2)^{m+n}$. Since $2 \neq 1$ in $k$, this map does not factor through $k[x]/(x-1)^r$ for any positive $r$.


