Analytic functions in arbitrary rings? We have developed a rich theory of analytic functions over $\mathbb{R}^n$ and $\mathbb{C}^n$. This is pretty reasonable, as analyticity here (local representation by power series) is closely linked to desirable differentiability conditions. However, I see no reason why this idea of power series representation cannot be generalized to any ring $R$. To create such a power series, all we need is multiplication and addition (i.e. a ring). For $f(x) \in R[[X]]$, $$f(x) = \sum f_i x^i,$$ certainly is a formal power series. But under what conditions does this have meaning beyond a sequence of coefficients?
You can make analogous constructions over objects with more structure, like $R$-algebras. Perhaps these constructions may play nicely with the additional structure. There may also be technical issues with a general ring $R$, so if it is necessary just take this to be a field.
My main questions are the following,

*

*Are there necessary conditions on $R$ for these power series to be meaningful? You would at the least need some metric/norm, to make sense of convergence.

*What stronger conditions would we need to make a notion of derivative? That is to say, is there a situation where the formal derivative of this power series has some (probably geometric) meaning? How much analysis do we get for free here? Call this derivation $D$, what do things akin to a Taylor Series mean if we replace the derivative with $D$?

*Presuming that this process is indeed possible, do the elementary functions have meaningful analogs in the spirit of the matrix exponential? Say something, $$\cos_R(x) = \sum \frac{(-1)^n}{(2n)!} x^{2n},$$ where the integer coefficients come from the subring generated by $1_R$ in the obvious way. In this particular example, we would likely need a field, as there is division of coefficients.

*There's also the implicit question here of what do we mean by locally. Should this be done on open sets of a suitable topology? Should this be done in the AG manner of localization at a prime ideal?

I suspect that once you start adding additional hypotheses in hopes of getting some of the properties I listed above, the situation will very quickly narrow down to something like $ \left( \mathbb{R} \text{ or } \mathbb{C} \right)$-algebras. I hope there is some interesting examples that are not of this form.
These questions are numerous and open ended, so please share whatever you think may be useful. If you have recommendations to resources where I may read about topics similar to this, I would very much appreciate it. Thank you!
 A: Taking $R$ as a complete valued field will provide a Haussdorff topology where the convergence of power series can be considered. Those complete valued fields will often be presented as fields of formal series: Laurent series, series of real powers... One example is the Levi-Civita field, where certain elementary functions can be defined by relying on their power series expansion.
One particular and arguably more interesting case is to take $R$ as a field $\mathbb{F}=k[[t^{\Gamma}]]$ of Hahn series. Those are a sort of generalization of formal series with coefficients in a constant field denoted $k$ here, and they come with a notion of summability of infinite families. This notion is combinatorial in nature, as is the definition of Hahn series fields (it involves the well-orderedness of some sets and the finiteness of others). I write $\mathbb{F}^{\prec}$ for the set of elements $\varepsilon \in \mathbb{F}$ with positive valuation $v \varepsilon >0$. Those are sometimes called infinitesimals. The summation in $\mathbb{F}$ shares some properties with the standard summation of series in Banach spaces. We have the following facts:

*

*Consider an infinitesimal $\varepsilon \in \mathbb{F}^{\prec}$. Then for all $(a_n)_{n \in \mathbb{N}}\in k^{\mathbb{N}}$, the family $(a_n \varepsilon^n)_{n \in \mathbb{N}}$ is summable, so it has a well-defined sum $S(\varepsilon):= \sum \limits_{n \in \mathbb{N}} a_n \varepsilon^n$. Moreover, every formal combinatorial property of the sequence is valid for this assignment (for instance if $k$ has characteristic $0$ and $a_n=\frac{1}{n!}$ for all $n$, then $S(\varepsilon_0+\varepsilon_1)=S(\varepsilon_0)S(\varepsilon_1)$ for all $\varepsilon_0,\varepsilon_1 \in \mathbb{F}^{\prec}$).
In particular, every power series in $k[[X]]$ acts as a function $\mathbb{F}^{\prec}\rightarrow \mathbb{F}$.

*If $k=\mathbb{C}$ (and similar results hold for $k=\mathbb{R}$), then you have a calculus for entire functions on $\mathbb{C}+\mathbb{F}^{\prec}$. Indeed, given an entire function $\varphi$, $z \in \mathbb{C}$ and $\varepsilon \in \mathbb{F}^{\prec}$, we set $$\overline{\varphi}(z+\varepsilon):= \sum \limits_{n \in \mathbb{N}}\frac{\varphi^{(n)}(z)}{n!} \varepsilon^n.$$
This defines a function $\mathbb{C} + \mathbb{F}^{\prec} \rightarrow \mathbb{C} + \mathbb{F}^{\prec}$, and the assignment $\varphi \mapsto \overline{\varphi}$ is a morphism of $\mathbb{C}$-algebras which commutes with the composition law on the set of entire functions.

*For any $\delta,\eta \in \mathbb{F}$ with $v \delta \leq v \eta$ and any sequence $(f_n)_{n \in \mathbb{N}}$, if the family $(f_n \delta^n)_{n \in \mathbb{N}}$ is summable, then the family $(f_n \eta^n)_{n \in \mathbb{N}}$ is summable. So the function $\xi \rightarrow \sum \limits_{n\in \mathbb{N}} f_n \xi^n$ has a convex domain (possibly reduced to $\{0\}$). See the PhD thesis Corps de transséries of Michael Schmeling (only the introduction is in French, and there's also an English version at the end) or the article On generalized power series of Joris van der Hoeven.

*As in any topological field, one can define a notion of differentiability on $\mathbb{F}$ (the derivative of $\Psi$ will be the limit of $\frac{\Psi(x+h)-\Psi(x)}{h}$ as $h$ tends to $0$ if that limit exists). Say that a function $\Psi: U \rightarrow \mathbb{F}$ defined on a non-empty open subset $U \subseteq \mathbb{F}$ is analytic if it is infinitely differentiable and we have $\Psi(x+h)=\sum \limits_{n \in \mathbb{N}}\frac{\Psi^{(n)}(x)}{n!} h^n$ for all $x \in U$ and sufficiently small $h \in \mathbb{F}$ (the radius may depend on $x$).
Analytic functions on open subsets of $\mathbb{F}$ (this includes power series on $\mathbb{F}^{\prec}$) share some elementary properties with complex analytic or real-analytic functions. This was studied, although in a more specific context, by Norman Alling in his book Foundations of Analysis over Surreal Number Fields, especially chapters 7 and 8.

One specific example where one can do all this is the case of transseries. The ordered field $\mathbb{T}$ of logarithmic-exponential transseries is not really a Hahn series field, but rather a directed union of Hahn series fields. The previous results hold for $\mathbb{F}=\mathbb{T}$, except in 3. that $k=\mathbb{R}$ in this case. Every element $f$ of $\mathbb{T}$ induces an analytic function $\widetilde{f}$ defined on the set $\mathbb{T}^{>\mathbb{R}}$ of transseries $g$ with $g >\mathbb{R}$. Moreover, we have $\widetilde{f}\circ \widetilde{g}=\widetilde{h}$ and $\widetilde{f}'=\widetilde{j}$ for  unique ordered pair $(h,j)$ of transseries denoted $(f \circ g,\partial f)$.
The field $\mathbb{T}$ contains a certain transseries $\operatorname{e}^x$ which acts like the exponential function, and a transseries $\log x$ which acts like the logarithm. However, general analytic functions are only defined on $\mathbb{R}+\mathbb{T}^{\prec}$ as in 3. a priori. In particular there is no "good" version of the sine function which is defined everywhere on $\mathbb{T}$, and there is no non-zero transseries solution $f$ to the differential equation $\partial (\partial(f))+f=0$.
