# Extending derivations to the superposition closure

Let $X$ be a set and $\mathcal{F}\subseteq {\mathbb{R}^X}$ an arbitrary family of functions. The superposition closure of $\mathcal{F}$ is defined as $$\overline{\mathcal{F}}=\{ H\circ(f_1\times\cdots f_i)\mid H\in C^\infty(\mathbb{R}^i),\ f_1,\ldots,f_i\in \mathcal{F},\ i\in\mathbb{N}\}\, ,$$ where $(f_1\times\cdots f_i)(x)=(f_1(x),\ldots, f_i(x))$, $\forall x\in X$, and it is a commutative unitary sub-algebra of ${\mathbb{R}^X}$ containing $\mathcal{F}$. For instance, if $X=\mathbb{R}^2$ and $\mathcal{F}=C^\infty(\mathbb{R})\otimes_{\mathbb{R}} C^\infty(\mathbb{R})$, then $\overline{\mathcal{F}}=C^\infty(\mathbb{R}^2)$ (basically, this is the Kolmogorov superposition theorem discussed in the post Kolmogorov superposition for smooth functions).

Suppose now that $\mathcal{F}$ is already an unitary sub-algebra of ${\mathbb{R}^X}$. Then, we have a sequence of algebra inclusions $${\mathcal{F}}\subseteq \overline{\mathcal{F}}\subseteq \mathbb{R}^X$$

QUESTION: is it true that any derivation of ${\mathcal{F}}$ can be uniquely extended to a derivation of $\overline{\mathcal{F}}$?

By derivation I simply mean an $\mathbb{R}$-linear map $\Delta:{\mathcal{F}}\to {\mathcal{F}}$ satisfying the Leibniz rule.

I've been trying for many years to answer this question: all the examples I could think of gave a positive answer, but I could not lay down a general proof. All the experts I contacted gave me unsatisfactory answers (basically, one uses the chain rule for derivatives and tries to prove that the result is independent on the choice of the $H$ and the $f$'s above). Finding a counterexample would be really nice!

The counterexample proposed in the answer below is correct, and based on the fact that there can be a subalgebra $\mathcal{F}$ of $C^\infty(\mathbb{R})$ whose (real) spectrum is $\mathbb{R}^2$: it suffices to take two algebraically independent smooth functions. Then the inclusion $\mathcal{F}\subseteq C^\infty(\mathbb{R})$ should correspond, at the level of spectra, to a map $\mathbb{R}\to \mathbb{R}^2$, i.e., a "curve". I guess that, in this case, the ambiguity boils down to the fact that there are many ways to extend a vector field on a curve to the ambient space, loosely speaking. What I'm really looking for is a counterexample where $\mathcal{F}$ and its superposition closure $\overline{\mathcal{F}}$ share the same spectrum.

Not every derivation can be extended to the closure: consider the subalgebra $\mathcal{F}\subset C^\infty(\mathbb{R})$ generated by functions $x$ and $e^x$. Since these are algebraically independent this algebra is isomorphic to a polynomial algebra in two variables and we can define a derivation $\Delta$ on generators by $$\Delta(x)=1 \quad \text{and} \quad \Delta(e^x)=x.$$ Now the closure of $\mathcal{F}$ is $C^\infty(\mathbb{R})$ but no derivation on $C^\infty(\mathbb{R})$ satisfies both of these equations.

On the other hand, if there is an extension, it is unique by the following

Lemma: For any derivation $D$ on the closure $\overline{\mathcal{F}}$ of a function subalgebra $\mathcal{F}\subset \mathbb{R}^X$ we have

$$D\left(H(f_1,\ldots,f_n)\right)=\sum_{i=1}^n \partial_i H (f_1,\ldots,f_n)\cdot D(f_i)$$

for any $H\in C^\infty(\mathbb{R}^n)$ and $f_i \in \mathcal{F}$.

Proof: Fix any point $p\in X$ and apply Hadamard's Lemma on $H$ to write

$$H(f_1,\ldots,f_n)=H\left(f_1(p),\ldots,f_n(p)\right)+ \sum_{i=1}^n \partial_i H \left(f_1(p),\ldots,f_n(p)\right)\cdot\left(f_i-f_i(p)\right)+\sum_{|\sigma|=2}G_{\sigma}(f)\cdot(f-f(p))^\sigma$$ Now apply $D$ on both sides and then evaluate the result at $p$.