1 Introduction

In order to make sense of computability questions in analysis, the spaces of objects involved have to be equipped with representations: A representation determines the information that is provided (or has to be provided) when computing on these objects. When changing from a more general to more restrictive setting, there are two options: Either to merely restrict the scope to the special objects and retain the representation, or to introduce a new representation containing more information.

As a first example of this, consider the closed subsets of [0,1]2 and the closed convex subsets of [0,1]2 (following [12]). The former are represented as enumerations of open balls exhausting the complement. The latter are represented as the intersection of a decreasing sequence of rational polygons. Thus, prima facie the notions of a closed set which happens to be convex and a convex closed set are different. In this case it turns out they are computably equivalent after all (the proof, however, uses the compactness of [0,1]2).

1.1 Summary of the results

This paper presents different examples of the same phenomenon: In Section 2 the difference between an analytic function and a continuous functions that happens to be analytic is investigated for functions on a fixed compact domain. It is known that these actually are different notions. The results quantify how different they are using the framework of Weihrauch reducibility. The additional information provided for an analytic function over a continuous function can be expressed by a single natural number. Thus, this is an instance of computation with discrete advice as introduced in [35]. Finding this number is Weihrauch equivalent to \(\mathrm {C}_{{\mathbb {N}}}\). This means that while the number can be chosen to be falsifiable (i.e. wrong values can be detected), this is the only computationally relevant restriction on how complicated the relationship between object and associated number can be. The results are summarized in Fig. 4 on Page 13

Section 3 considers continuous functions that happen to be polynomials versus analytic functions that happen to be polynomials versus polynomials. All translations turn out to be either computable, or Weihrauch equivalent to one of the two well-studied principles \(\mathrm {C}_{{\mathbb {N}}}\) and LPO. The results are summarized in Fig. 5 on Page 18.

The last Section 4 changes the setting in that it swaps the compact subset of the complex plane as domain for the real line. It contrasts the spaces of smooth functions, Schwartz functions and bump functions. While going from smooth (or Schwartz) to a bump function is equivalent to \(\mathrm {C}_{{\mathbb {N}}}\), going from a smooth function that happens to be Schwartz to a Schwartz function is equivalent to the Weihrauch degree \(\lim \). This degree captures the Halting problem. In particular it follows that there is a function \(f\in {\mathrm {C}}^{\infty }(\mathbb {R})\) that decays faster than any polynomial (i.e. \(f\in \mathcal {S}\)) and is computable as element of \(C^{\infty }(\mathbb {R})\), but as element of \(\mathcal {S}\) is not only non-computable, but computes the Halting problem.

We briefly mention two alternative perspectives on the phenomenon: First, recall that in intuitionistic logic a negative translated statement behaves like a classical one, and that double negations generally do not cancel. In this setting the difference boils down to considering either analytic functions or continuous functions that are not not analytic. Second, from a topological perspective, Weihrauch equivalence of a translation to \(\mathrm {C}_{{\mathbb {N}}}\) implies that the topologies induced by the representations differ. Indeed, the suitable topology on the space of analytic functions is not just the subspace topology inherited from the space of continuous functions but a direct limit topology.

An extended abstract based on this paper can be found as [25].

1.2 Represented spaces

This section provides a very brief introduction to the required concepts from computable analysis. For a more in depth introduction and further information, the reader is pointed to the standard textbook in computable analysis [32], and to [21]. Also, [28] should be mentioned as an excellent source, even though the approach differs considerably from the one taken here.

Recall that a represented space X = (X, δ X ) is given by a set X and a partial surjection \(\delta _{\mathbf {X}}: \subseteq {\mathbb {N}^{\mathbb {N}}} \to X\) from Baire space onto it. The elements of \(\delta ^{-1}_{{\mathbf {X}}}(x)\) should be understood as encodings of x and are called the X-names of x. Each represented spaces inherits a topology from Baire space: The final topology of the chosen representation. We usually refrain from mentioning the representation of a represented space in the same way as the topology of a topological space is usually not mentioned. For instance the set of natural numbers is regarded as a represented space with the representation \(\delta _{{\mathbb {N}}}(p) := p(0)\). Therefore, from now on denote by \({\mathbb {N}}\) not only the set or the topological space, but the represented space of natural numbers. If a topological space is to represented, the representation should be chosen such that it fits the topology as good as possible. For instance for the case \({\mathbb {N}}\) above, the final topology of the representation is the discrete topology.

If X is a represented space and Y is a subset of X, then Y can be turned into a represented space by equipping it with the range restriction of the representation of X. Denote the represented space arising in this way by X| Y . We use the same notation X| Y if Y is a represented space already. In this case, however, no information about the representation of Y is carried over to X| Y .

Recall that a multivalued function f from X to Y (or X to Y) is an assignment that assigns to each element x of its domain a set f(x) of acceptable return values. Multivaluedness of a function is indicated by \(f:{\mathbf {X}}\rightrightarrows {\mathbf {Y}}\). The domain of a multivalued function is the set of elements such that the image is not empty. Furthermore, recall that \(f:\subseteq {\mathbf {X}}\to {\mathbf {Y}}\) indicates that the function f is allowed to be partial, i.e. that its domain may be a proper subset of X.

Definition 1

A partial function \(F : \subseteq {\mathbb {N}^{\mathbb {N}}} \to {\mathbb {N}^{\mathbb {N}}}\) is a realizer of a multivalued function \(f : \subseteq \mathbf {X} \rightrightarrows \mathbf {Y}\) if δ Y (F(p))∈f(δ X (p)) for all \(p \in \delta _{{\mathbf {X}}}^{-1}(\text {dom}(f))\) (compare Fig. 1).

Fig. 1
figure 1

A diagram

A (multivalued) function between represented spaces is called computable if it has a computable realizer, where computability on Baire space is defined via oracle Turing machines (as in e.g. [10]) or via Type-2 Turing machines (as in e.g. [32]). We call a (multivalued) function between represented spaces continuous, if it has a continuous realizer. For single valued functions on admissibly represented spaces (in the sense of Schröder [29]), this notion coincides with topological continuity. All representations discussed in this paper are admissible.

The remainder of this section introduces the represented spaces that are needed for the content of the paper.

Sets of natural numbers

Let \(\mathcal {O}(\mathbb {N})\) resp. \(\mathcal A(\mathbb {N})\) denote the represented spaces of open resp. closed subsets of \(\mathbb {N}\). The underlying set of both \({\mathcal {O}}({\mathbb {N}})\) and \({\mathcal {A}}({\mathbb {N}})\) is the power set of \({\mathbb {N}}\). The representation of \({\mathcal {O}}({\mathbb {N}})\) is defined by

$$\delta_{\mathcal{O}(\mathbb{N})}(p) = O \quad\Leftrightarrow\quad O = \{p(n)-1\mid n\in\mathbb{N}, p(n) > 0\}. $$

That is: A \({\mathcal {O}}({\mathbb {N}})\)-name of a set of natural numbers is an enumeration of the set, however the enumeration is allowed to not return an element of the set in each step (otherwise no finite set would get a name). The closed sets \({\mathcal {A}}({\mathbb {N}})\) are represented as complements of open sets:

$$\delta_{\mathcal A(\mathbb{N})}(p) = A \quad\Leftrightarrow\quad \delta_{\mathcal{O}(\mathbb{N})}(p) = A^{c}. $$

I.e. a \(\mathcal A(\mathbb {N})\)-name of a set of natural numbers is an enumeration of the complement.

Computable metric spaces, \(\mathbb {R}\), \(\mathbb {C}\), \(\mathcal C(D)\)

Given a triple \(\mathcal M = (M,d,(x_{n})_{n\in \mathbb {N}})\) such that (M, d) is a separable metric space and x n is a dense sequence, turn \(\mathcal M\) into a represented space by equipping it with the representation

$$\delta_{\mathcal M}(p) = x \quad \Leftrightarrow\quad \forall n\in \mathbb{N}: d(x,x_{p(n)}) < 2^{-n}. $$

This is the canonical way of considering \(\mathbb {R}\), \(\mathbb {R}^{d}\) and \({\mathbb {C}}\) as represented spaces; the dense sequences are standard enumerations of the rational elements.

The space \(\mathcal C(D)\) of continuous functions on a compact subset D of \(\mathbb {R}^{d}\) is a separable metric space and thus a represented space. The metric is the one induced by the supremum norm and the dense sequences are standard enumerations of the polynomials with rational coefficients. The computable Weierstraß approximation theorem states that a function is computable as element of C([0,1]) if and only if it is computable in the sense of realizers as a function between the represented spaces [0,1] and \(\mathbb {R}\) respectively.

Sequences in a represented space

For a represented space X there is a canonical way to turn the set of sequences in X into a represented space \({\mathbf {X}}^{{\mathbb {N}}}\): Let \(\langle \cdot ,\cdot \rangle :{\mathbb {N}}\times {\mathbb {N}} \to {\mathbb {N}}\) be a standard paring function (i.e. bijective, recursive with recursive projections). Define a function \(\langle \cdot \rangle :\left ({\mathbb {N}^{\mathbb {N}}}\right )^{{\mathbb {N}}}\to {\mathbb {N}^{\mathbb {N}}}\) by

$$\langle (p_{k})_{k\in \mathbb{N}}\rangle(\langle m,n\rangle) := p_{m}(n). $$

For a represented space X define a representation of the set \(X^{{\mathbb {N}}}\) of the sequences in the set X underlying X by

$$\delta_{\mathbf{X}^{\mathbb{N}}}(\langle (p_{k})_{k\in\mathbb{N}}\rangle) =(x_{k})_{k\in\mathbb{N}} \quad \Leftrightarrow \quad \forall m\in\mathbb{N}: \delta_{{\mathbf{X}}}(p_{m}) = x_{m}. $$

I.e. p is a name of \((x_{m})_{m\in {\mathbb {N}}}\) if for each fixed m the mapping np(〈m, n〉) is a name of x m . In particular the spaces \(\mathbb {R}^{{\mathbb {N}}}\) and \({\mathbb {C}}^{{\mathbb {N}}}\) of real and complex sequences are considered represented spaces in this way. For a partial, multivalued function \(f:\subseteq {\mathbf {X}}\rightrightarrows {\mathbf {Y}}\) let \(f^{{\mathbb {N}}}:\subseteq {\mathbf {X}}^{{\mathbb {N}}}\rightrightarrows {\mathbf {Y}}^{{\mathbb {N}}}\) denote the function defined by \(f^{{\mathbb {N}}}((x_{n})_{n\in {\mathbb {N}}}):= (f(x_{n}))_{n\in {\mathbb {N}}}\).

1.3 Weihrauch reducibility

This section provides a brief introduction to Weihrauch reducibility. The research programme of Weihrauch reducibility was formulated in [2], a more up-to-date introduction can be found in [6].

Every multivalued function \(f:\subseteq \mathbf {X}\rightrightarrows \mathbf {Y}\) corresponds to a computational task. Namely: ‘given information about x and the additional assumption x∈dom(f) find suitable information about some yf(x)’. What information about x resp. f(x) is provided resp. asked for is reflected in the choice of the representations for X and Y. The following example of this is very relevant for the content of this paper:

Definition 2

Let closed choice on the integers be the multivalued function \(\mathrm {C}_{\mathbb {N}} : \subseteq \mathcal {A}(\mathbb {N}) \rightrightarrows \mathbb {N}\) defined on nonempty sets by

$$y\in\mathrm{C}_{\mathbb{N}}(A)\Leftrightarrow y\in A. $$

The corresponding task is ‘given an enumeration of the complement of a set of natural numbers and provided that it is not empty, return an element of the set’. \(\mathrm {C}_{\mathbb {N}}\) does not permit a computable realizer: Whenever a machine decides that the name of the element of the set should begin with n, it has only read a finite beginning segment of the enumeration. The next value might as well be n.

From the point of view of multivalued functions as computational tasks, it makes sense to compare their difficulty by comparing the corresponding multivalued functions. This paper uses Weihrauch reductions as formalization of such a comparison. Weihrauch reductions define a rather fine pre-order on multivalued functions between represented spaces.

Definition 3

Let f and g be partial, multivalued functions between represented spaces. Say that f is Weihrauch reducible to g, in symbols fW g, if there are computable functions \(K:\subseteq {\mathbb {N}^{\mathbb {N}}}\times {\mathbb {N}^{\mathbb {N}}} \to {\mathbb {N}^{\mathbb {N}}}\) and \(H:\subseteq {\mathbb {N}^{\mathbb {N}}}\to {\mathbb {N}^{\mathbb {N}}}\) such that whenever G is a realizer of g, the function \(F := \left (p \mapsto K(p,G(H(p)))\right )\) is a realizer for f.

H is called the pre-processor and K the post-processor of the Weihrauch reduction. This definition and the nomenclature is illustrated in Fig. 2. The relation ≤W is reflexive and transitive. We use ≡W to denote that reductions in both directions exist and <W if this is not the case. The equivalence class of a multivalued function with respect to the equivalence relation ≡W is called the Weihrauch degree of a function f and we denote it by \(\left [f\right ]\). We still use ≤W for the induced partial order on the Weihrauch degrees and by abuse of notations sometimes use it to compare multivalued functions and Weihrauch degrees. A Weihrauch degree is called non-computable if it contains no computable function.

Fig. 2
figure 2

Weihrauch reductions

The Weihrauch degree corresponding to \(\mathrm {C}_{\mathbb {N}}\) has received significant attention, e.g. in [3, 4, 6, 7, 1519]. In particular, as shown in [23], a function between computable Polish spaces is Weihrauch reducible to \({\mathrm {C}}_{\mathbb {N}}\) if and only if it is piecewise computable or equivalently is effectively \({{\Delta }^{0}_{2}}\)-measurable.

For the purposes of this paper, the following representatives of this degree are also relevant:

Lemma 1 (24)

The following are Weihrauch equivalent:

  • \(\mathrm {C}_{\mathbb {N}}\) , that is closed choice on the natural numbers.

  • \(\max : \subseteq \mathcal {O}(\mathbb {N}) \to \mathbb {N}\) defined on the bounded sets in the obvious way.

  • \(\text {Bound}: \subseteq \mathcal {O}(\mathbb {N}) \rightrightarrows \mathbb {N}\) , where n∈Bound(U) iff ∀m∈U:n ≥ m.

Given \(p\in {\mathbb {N}^{\mathbb {N}}}\) denote the support of p by \(\text {supp}(p) := \{n\in \mathbb {N}\mid p(n)>0\}\). Furthermore, for a finite set A denote the number of elements of that set by #A.

Lemma 2

The function \(\text {Count}:\subseteq {\mathbb {N}^{\mathbb {N}}} \to \mathbb {N}\) , defined via

$$\text{dom}(\text{Count}) := \{p \in {\mathbb{N}^{\mathbb{N}}} \mid \text{supp}(p) \text{ is finite}\} \quad\text{and}\quad \text{Count}(p) := \#{{\text{supp}}(p)} $$

is Weihrauch equivalent to closed choice on the naturals \(\mathrm {C}_{{\mathbb {N}}}\).

Proof

First construct the Weihrauch reduction that proves \(\mathrm {C}_{\mathbb {N}}\leq _{\mathrm {W}}\text {Count}\): Let the pre-processor H be the function sending some \(p\in \text {dom}(\mathrm {C}_{{\mathbb {N}}})\) to the function that returns 1 on input n whenever its support up to n has fewer elements than the least element that has not been excluded from the set by the first n elements of the enumeration of the complement. This function is computable as can be seen from its recursive definition:

$$H(p)(n) := \left\{\begin{array}{ll} 1 & \text{if} \ \min\{m\mid\forall j\leq n: p(j){-}1\neq m\} > \#{\{j < n \mid H(p)(j) = 1\}} \\ 0 & \text{otherwise.} \end{array}\right. $$

H(p) has finite support, since the set described by p is nonempty: There is some m never shows up as value of p and by definition the support of H(p) does not outgrow that number. Applying a realizer of Count to H(p) returns an encoding of the least element of the set encoded by p. To obtain a Weihrauch reduction just pass this number on to be the output via K(p, q)(n): = q(0).

For the opposite direction, i.e. \(\text {Count}\leq _{\mathrm {W}}\mathrm {C}_{\mathbb {N}}\) use Lemma 1 and replace \(\mathrm {C}_{\mathbb {N}}\) by \(\max \). Define the pre-processor H of a Weihrauch reduction \({\text {Count}}{\leq _{\mathrm {W}}}\max \) as follows:

$$H(p)(n) := \left\{\begin{array}{ll} n+1 & \text{ if}\ p(n) > 0 \\ 0 & \ \text{otherwise.} \end{array}\right. $$

This means that H(p) is a \({\mathcal {O}}({\mathbb {N}})\) name of supp(p). Applying \(\max \) will give the maximal element of the support.

Define the post-processor K to be the function

$$K(p,q)(n) := \#{\{m\mid m \leq q(0)\text{ and}\ p(m)>0\}}. $$

This function is computable and since q(0) will always be the maximal element of the support of p, the composition counts the support of p and is a Weihrauch reduction. □

In Section 3 another non-computable Weihrauch degree is encountered: LPO. Here, LPO is short for ‘limited principle of omniscience’. We refrain from stating LPO explicitly as it would need more machinery than we introduced. Instead we characterize it by specifying the representative that is used in the proofs:

Proposition 1 ([18, Korollar 3.1.4.6])

The function \(\min : {\mathbb {N}^{\mathbb {N}}} \to \mathbb {N}\) defined on all of Baire space in the obvious way is a representative of the Weihrauch degree LPO .

A third and final Weihrauch degree making an appearance as the degree of a translation is the degree \(\lim \) encountered in Section 4.

Definition 4

Let X be a computable metric space. Then \(\lim _{\mathbf {X}} : \subseteq \mathbf {X}^{\mathbb {N}} \to \mathbf {X}\) maps a converging sequence to its limit.

As shown in [3], \(\lim _{\mathbb {N}}\equiv _{\mathrm {W}} \mathrm {C}_{\mathbb {N}}\). In general, it holds that \(\lim _{\mathbf {X}} \leq _{\mathrm {W}} \lim _{{\mathbb {N}^{\mathbb {N}}}} \equiv _{\mathrm {W}} \lim _{{\{0, 1\}^{\mathbb {N}}}}\), and whenever Y is a subspace of X, then \(\lim _{\mathbf {Y}} {\leq _{\mathrm {W}}} \lim _{\mathbf {X}}\). As \({{\{0, 1\}^{\mathbb {N}}}}\) embeds into any computable metric space considered in this paper apart from \(\mathbb {N}\), it suffices to consider the Weihrauch degree \(\lim :=\big [{\lim _{{{\{0, 1\}^{\mathbb {N}}}}}}\big ]\) corresponding to \(\lim _{{{\{0, 1\}^{\mathbb {N}}}}}\). The degree \(\lim \) is also complete for the effectively \({{\Sigma }^{0}_{2}}\)-measurable functions [2, 22].

To give more intuition as to why the Weihrauch degrees LPO, \(\mathrm {C}_{\mathbb {N}}\) and \(\lim \) show up in this paper, note the following: All three are derived from the maybe simplest non-computable Weihrauch degree LPO via canonical closure operators defined on the Weihrauch degrees. LPO the Weihrauch degree of the characteristic function of the zero function in Baire space, namely \(\textrm {LPO} = \left [\chi _{0}\right ]\), where

$$\chi_{0}(p) :=\left\{\begin{array}{ll} 1 & \text{if}\ p\ \text{is the zero function, i.e.}\ \forall n:p(n)=0. \\ 0 & \text{otherwise.} \end{array}\right. $$

In computable analysis LPO shows up as the Weihrauch degree of the equality test for real (or complex) numbers.

Now, LPO corresponds to carrying out a fixed finite but arbitrary high number of equality tests on the real or complex numbers via the operator from [20]. The operator introduced in [17] captures using the given degree an arbitrary finite number of times (without the requirement that the number is fixed in advance), and it holds that \([\mathrm {C}_{{\mathbb {N}}}] = \textrm {LPO}^{\diamond }\). Define one last operator on the Weihrauch degrees by setting \(\widehat {[f]} := [{f^{{\mathbb {N}}}}]\). This operation was also investigated in [5] and corresponds to a countable number of invocations of f all performed in parallel. It holds that \(\widehat {\textrm {LPO}} = \widehat {[{\mathrm {C}_{{\mathbb {N}}}}]} = \lim \).

It is known that \(\text {id}_{{\mathbb {N}^{\mathbb {N}}}} <_{\mathrm {W}} \text {LPO}<_{\text {W}}\text {LPO}^{*}<_{\text {W}}\text {C}_{\mathbb {N}} <_{\text {W}} \lim \).

2 Analytic functions

2.1 Representations of analytic functions

Recall that a function is analytic if it is locally given by a power series:

Definition 5

Let \(D\subseteq \mathbb {C}\) be a set. A function \(f:D \to \mathbb {C}\) is called analytic, if for every x 0D there is a neighborhood U of x 0 and a sequence \((a_{k})_{k\in {\mathbb {N}}}\in {\mathbb {C}}^{{\mathbb {N}}}\) such that for each \(x\in U\cap D\)

$$f(x) = \sum\limits_{k\in \mathbb{N}} a_{k} (x-x_{0})^{k}. $$

The set of analytic functions is denoted by \(\mathcal C^{\omega }(D)\). Each analytic function is continuous, i.e. \(\mathcal C^{\omega }(D)\subseteq \mathcal C(D)\). If D is open, the analytic functions on D are smooth, i.e. infinitely often differentiable. Any analytic function can be analytically extended to an open superset of its domain.

Recall that a germ of an analytic function is a point of its domain together with the series expansion around said point. As long as the domain is connected, an analytic function is uniquely determined by each of its germs. The one to one correspondence of germs and analytic functions only partially carries over to the computability realm: It is well known that an analytic function on the unit disk is computable if and only if the germ around any computable point of the domain is computable (see for instance [9]). However, the proofs of these statements are inherently non-uniform. The operations of obtaining a germ from a function and a function from a germ are discontinuous and therefore not computable (see [14]).

There is a more suitable representation for the analytic functions than the restriction of the representation of continuous functions. This representation has been investigated by different authors for instance in [8, 11, 14]. For simplicity restrict to the case of analytic functions on the unit disk. From now on let D denote the closed unit disk. And let U m denote the open ball \(B_{r_{m}}(0)\) of radius \(r_{m} :=2^{\frac 1{m+1}}\) around zero. Note that \(U_{m+1}\subseteq U_{m}\) and that the intersection of all U m is the unit disk. Recall from the introduction that the space \({\mathcal {C}(D)}\) of continuous functions is represented as a metric space (where \({\mathbb {C}}\) is identified with \(\mathbb {R}^{2}\)).

Definition 6

Let \(\mathcal C^{\omega }(D)\) denote the represented space of analytic functions on D, where the representation is defined as follows: A function \(q\in {\mathbb {N}^{\mathbb {N}}}\) is a name of an analytic function f on D, if and only if f extends analytically to the closure of U q(0), the extension is bounded by q(0) and nq(n+1) is a name of \(f\in {\mathcal {C}(D)}\).

Note that the representation of \(\mathcal C^{\omega }(D)\) arises from the restriction of the representation of continuous functions by adding discrete additional information. This information is quantified by the advice function \({\text {Adv}_{\mathbb {C}^{\omega }}}:\subseteq {\mathcal {C}(D)} \to {\mathbb {N}}\) whose domain are the analytic functions and that on those is defined by

$$ \begin{array}{ll} \text{Adv}_{\mathrm{C}^{\omega}}(f) & := \{q(0)\mid q\ \text{is a}\ \mathcal C^{\omega}(D)-\text{name of}\ f)\} \\ & = \{m\in\mathbb{N}\mid f \ \text{has an analytic cont. to}\ U_{m}\ \text{bounded by} \ m\}. \end{array} $$
(AC)

This function turns up in the results of this paper. In the terminology of [8], one would say that \({\mathcal {C}^{\omega }(D)}\) arises from the restriction \({\mathcal {C}(D)}|_{{\mathcal {C}^{\omega }(D)}}\) by enriching with the discrete advice \({\text {Adv}_{\mathbb {C}^{\omega }}}\).

The topology induced by the representation of \(\mathcal C^{\omega }(D)\) is well known and used in analysis: It can be constructed as a direct limit topology and makes \({\mathcal {C}^{\omega }(D)}\) a so called Silva-Space. For more information on this topology and its relation to computability and complexity theory also compare [11].

The set \(\mathcal {O}\) of germs around zero, i.e. of power series with radius of convergence strictly larger than 1 can be made a represented space in a very similar way:

Definition 7

Let \(\mathcal {O}\) denote the represented space of germs around zero with radii of convergence greater than 1, where the representation is defined as follows: A function \(q\in {\mathbb {N}^{\mathbb {N}}}\) is a name of a power series \((a_{k})_{k\in {\mathbb {N}}}\), if and only if

$$\forall k\in\mathbb{N}:|a_{k}|\leq 2^{-\frac k{q(0)+1}}q(0) $$

and nq(n+1) is a name of the sequence \((a_{k})_{k\in {\mathbb {N}}}\) as element of \({\mathbb {C}}^{{\mathbb {N}}}\).

As above, this representation is related to the restriction of the representation of \(\mathbb {C}^{\mathbb {N}}\) by means of an advice function \({\text {Adv}_{{\mathcal {O}}}}:\subseteq {\mathbb {C}}^{{\mathbb {N}}}\rightrightarrows {\mathbb {N}}\) whose domain are the sequences with radius of convergence strictly larger than one and that is defined on those by

$$ \begin{array}{ll} \text{Adv}_{\mathcal{O}}((a_{k})_{k\in\mathbb{N}}) & := \{q(0) \mid q\ \text{is a}\ \mathcal{O}-\text{name of}\ (a_{k})_{k\in\mathbb{N}}\}\\ &= \{n\in \mathbb{N}\mid \forall k\in \mathbb{N}: \left|a_{k}\right| \leq 2^{-\frac k{n+1}}\cdot n\} \quad\quad\quad (AG)\end{array} $$

Again, the topology induced by this representation is well known and used in analysis: It is the standard choice of a topology on the set of germs and can be introduced as a direct limit topology.

Proofs that the following holds can be found in [8] or [14]:

Theorem 1 (computability of summation)

The assignment

$$\mathcal{O}\to \mathcal C^{\omega}(D), \quad (a_{k})_{k\in\mathbb{N}} \mapsto \left( x\mapsto \sum\limits_{k} a_{k} x^{k}\right) $$

is computable.

A proof of the following can be found in [8]:

Theorem 2

Differentiation is computable as mapping from \(\mathcal C^{\omega }(D)\) to \(\mathcal C^{\omega }(D)\).

2.2 Summing power series

Summing a power series is not computable on \(\mathbb {C}^{\mathbb {N}}\). Recall that \(\text {Adv}_{\mathcal {O}}\) was the advice function of the representation \({\mathcal {O}}\) of germs around zero of analytic functions on the unit disk. The computational task corresponding to this multivalued function is to find from a sequence that is guaranteed to have radius of convergence bigger than one a constant witnessing the exponential decay of the absolute value of the coefficients (compare (AG) on page 10). Theorem 1 states that summation is computable on \({\mathcal {O}}\). Therefore, the advice function \({\text {Adv}_{{\mathcal {O}}}}\) can not be computable. The following theorem classifies the difficulty of summing power series and \({\text {Adv}_{{\mathcal {O}}}}\) in the sense of Weihrauch reductions.

Theorem 3

The following are Weihrauch-equivalent:

  • \(\mathbf {C}_{\mathbb {N}}\) , that is: Closed choice on the naturals.

  • Sum, that is: The partial mapping from \(\mathbb {C}^{\mathbb {N}}\) to \(\mathcal C(D)\) defined on the sequences with radius of convergence strictly larger than one by

    $$\text{Sum}((a_{k})_{k\in\mathbb{N}})(x) := \sum\limits_{k\in\mathbb{N}} a_{k} x^{k}. $$

    I.e. summing a power series.

  • \(\mathbf {Adv}_{\mathcal {O}}\) , that is: The function from (AG) on page 10. I.e. obtaining the constant from the series.

Proof

Build a Weihrauch reduction circle:

\(\mathrm {C}_{\mathbb {N}}\leq _{\mathrm {W}}\text {Sum}\)::

Lemma 2 permits us to replace \(\mathrm {C}_{\mathbb {N}}\) by Count.

The Weihrauch reduction Count≤WSum can be constructed as follows: Let the pre-processor be a realizer of the computable mapping that assigns to \(p \in {\mathbb {N}^{\mathbb {N}}}\) the sequence \((a_{k})_{k\in {\mathbb {N}}}\in {\mathbb {C}}^{{\mathbb {N}}}\) defined by

$$a_{k} :=\left\{\begin{array}{ll} 1 & \text{ if} \ p(k)>0 \\ 0 &\text{ if} \ p(k)=0 \end{array}\right.. $$

Note that p∈dom(Count) means that p has a finite support, and the radius of convergence of \((a_{k})_{k\in \mathbb {N}}\) is strictly bigger than one (it is infinite). Applying a realizer of Sum will result in a name of the corresponding function f. From the definition of \((a_{k})_{k\in {\mathbb {N}}}\) it is clear that f(1)=Count(p). Therefore, the post-processor can be chosen as the second projection composed with a realizer of the evaluation in 1, which is well known to be computable on the continuous functions.

\(\text {Sum}\leq _{\mathrm {W}}\text {Adv}_{\mathcal {O}}\)::

Let the pre-processor be the identity. Note that an element of \(\text {Adv}_{\mathcal {O}}((a_{k})_{k\in \mathbb {N}})\) and a \({\mathbb {C}}^{{\mathbb {N}}}\)-name of \((a_{k})_{k\in {\mathbb {N}}}\) can easily be put together to an \({\mathcal {O}}\)-name of \((a_{k})_{k\in {\mathbb {N}}}\). Thus the post-processor can be chosen to be the composition of this mapping and a realizer of the summation mapping on \({\mathcal {O}}\), which is computable by Theorem 1.

\(\text {Adv}_{\mathcal {O}}\leq _{\mathrm {W}}\mathrm {C}_{\mathbb {N}}\)::

Let the pre-processor be the function that maps a given name p of \((a_{k})_{k\in {\mathbb {N}}}\in {\mathbb {C}}^{\omega }\) to an \({\mathcal {A}}({\mathbb {N}})\)-name of the set \({\text {Adv}_{{\mathcal {O}}}}((a_{k})_{k\in {\mathbb {N}}})\). Note that an enumeration of the complement of this set can be extracted from p as follows: For all k and \(m\in {\mathbb {N}}\) dovetail the test \(|{a_{k}}|>2^{-\frac k{m+1}}m\). If it holds for some k, return m as an element of the complement. This procedure indeed produces a list of the complement of \({\text {Adv}_{{\mathcal {O}}}}((a_{k})_{k\in {\mathbb {N}}})\): If the above does not hold for any k, then \(|{a_{k}}|\leq 2^{-\frac k{m+1}}m\) for all k and m is an element of \({\text {Adv}_{{\mathcal {O}}}}((a_{k})_{k\in {\mathbb {N}}})\).

Applying closed choice to this set will give result in a valid return value. Thus, choose the post-processor to be the second projection.

2.3 Differentiating analytic functions

In Subsection 2.1 we remarked that it is not possible to compute the germ of an analytic function just from a name as continuous function. The proof in [14] that this is in general impossible, however, argues about analytic functions on an interval. The first lemma of this chapter proves that for analytic functions on the unit disk it is possible to compute a germ if its base point is well inside of the domain. We only consider the case where the base point is zero, but the proof works whenever a lower bound on the distance of the base point to the boundary of the disk is known.

Lemma 3

Germ, that is: The partial mapping from \(\mathcal C(D)\) to \(\mathbb {C}^{\mathbb {N}}\) defined on analytic functions by mapping them to their series expansion around zero, is computable.

Proof

Remember that the Cauchy integral formula states that for an analytic function f on the closed unit disk:

$$f^{(k)}(0) = \frac{k!}{2\pi i} {\int}_{0}^{2\pi} f\left( e^{i t}\right)e^{-i t(k+1)} dt $$

It is well known that the integral is computable from a name of the function \(f\in {\mathcal {C}(D)}\). This works uniformly in k. □

The next theorem is very similar to Theorem 3. Both the advice function \(\text {Adv}_{\mathrm {C}^{\omega }}\) and computing a germ around a boundary point are shown to be Weihrauch equivalent to \(\mathrm {C}_{{\mathbb {N}}}\). Note that the coefficients of the series expansion \((a_{k})_{k\in {\mathbb {N}}}\) of an analytic function f around a point x 0 are related to the derivatives f (k) of the function via k!a k = f (k)(x 0). Therefore, computing a series expansion around a point is equivalent to computing all the derivatives in that point.

Theorem 4

The following are Weihrauch equivalent:

  • \(\mathbf {C}_{\mathbb {N}}\) , that is closed choice on the naturals.

  • Diff 1 , that is the partial mapping from \(\mathcal C(D)\) to \(\mathbb {C}\) defined on analytic functions by

    $$\text{Diff}_{1}(f) := f^{\prime}(1). $$

    I.e. evaluating the derivative of an analytic function in 1.

  • \(\mathbf {Adv}_{\mathrm {C}^{\omega }}\) , that is the function from (AC). I.e. obtaining the constant from the function.

Proof

By building a circle of Weihrauch reductions:

\(\mathrm {C}_{\mathbb {N}}\leq _{\mathrm {W}}\text {Diff}_{1}\)::

Use Lemma 2 to show Count≤WDiff1 instead. Let p be from the domain of Count. That is: \({\text {supp}}(p)=\{n\in {\mathbb {N}}\mid p(n)>0\}\) is finite. Define a sequence of analytic functions \(f_{n}:D\to {\mathbb {C}}\) by

$$f_{n}(x) :=\left( x-x_{n}\right)^{-2^{n+1}}, $$

where

$$x_{n}:=1+2^{\frac{n+1}{2^{n+1}+1}} $$

(see Fig. 3). The sequence is carefully chosen such that \(f_{n}^{\prime }(1) = 1\) and

$$\forall x\in D: \left|f_{n}(x)\right|<2^{-n}. $$

Furthermore, it is computable as a sequence of functions from \(\mathcal C(D)\).

Consider the function

$$f(x) := \sum\limits_{n\in\text{supp}(p)} f_{n}(x). $$

Note that this function can be computed from p: To approximate f by a polynomial it suffices to approximate those f n whose index is small. Let the pre-processor be a realizer of this assignment.

Note that applying Diff1 to the function f results in

$$\text{Diff}_{1}(f) = f^{\prime}(1) = \sum\limits_{n\in\text{supp}(p)} f^{\prime}_{n}(1) =\#{\text{supp}(p)}. $$

Therefore, the post-processor K(p, q): = q results in a Weihrauch reduction.

\(\text {Diff}_{1}\leq _{\mathrm {W}}\text {Adv}_{\mathrm {C}^{\omega }}\)::

Let the pre-processor be the identity.

An appropriate post-processor can be described as follows: Combine the return value of \(\text {Adv}_{\mathrm {C}^{\omega }}\) on the function f and the \({\mathcal {C}(D)}\)-name of f to an \({\mathcal {C}^{\omega }(D)}\)-name of f. Afterwards apply a realizer of the differentiation operator on \({\mathcal {C}^{\omega }(D)}\) which can be chosen computable by Theorem 2. Finally, obtain a \({\mathcal {C}(D)}\)-name of \(f^{\prime }\) from the \({\mathcal {C}^{\omega }(D)}\)-name and evaluate it in 1.

\(\text {Adv}_{\mathrm {C}^{\omega }}\leq _{\mathrm {W}}\mathrm {C}_{\mathbb {N}}\)::

Combine computable \(\text {Germ} : \mathcal {C}(D) \to \mathbb {C}^{\mathbb {N}}\), the classification \({\text {Adv}_{{\mathcal {O}}}} {\equiv _{\mathrm {W}}} \ \mathrm {C}_{{\mathbb {N}}}\) from Theorem 3 and the computability of summation from Theorem 1.

Fig. 3
figure 3

The functions f n

Recall from the introduction that \(\mathcal C(D)|_{\mathcal C^{\omega }(D)}\) resp. \(\mathbb {C}^{\mathbb {N}}|_{\mathcal {O}}\) denote the represented spaces obtained by restricting the representation of \({\mathcal {C}(D)}\) resp. \({\mathbb {C}}^{{\mathbb {N}}}\) to \({\mathcal {C}^{\omega }(D)}\), resp. \({\mathcal {O}}\). Theorems 1 , 3, 4 and Lemma 3 are illustrated in Fig. 4.

Fig. 4
figure 4

The results of Theorems 1 3, 4 and Lemma 3

3 Polynomials

3.1 Polynomials as finite sequences

Consider the set \(\mathbb {C}[X]\) of polynomials with complex coefficients in one variable X. There are several straightforward ways to represent polynomials. The first one that comes to mind is to represent a polynomial by a finite list of complex numbers. One can either demand the length of the list to equal the degree of the polynomial or just to be big enough to contain all of the non-zero coefficients. Since the first option fails to make basic operations like addition of polynomials computable, we choose the second option.

Definition 8

Let \(\mathbb {C}[X]\) denote the represented space of polynomials, where the representation is defined as follows: \(p\in {\mathbb {N}^{\mathbb {N}}}\) is a \({{\mathbb {C}}[X]}\)-name of P if \(p(0)\geq \deg (P)\) and np(n+1) is a \({\mathbb {C}}^{p(0)+1}\)-name of the first p(0)+1 coefficients of P.

Let \(\mathbb {C}_{m}[X]\) denote the set of monic polynomials over \(\mathbb {C}\), i.e. the polynomials with leading coefficient equal to one. Make \({\mathbb {C}}_{m}[X]\) a represented space by restricting the representation of \({\mathbb {C}}[X]\). Monic polynomials are important because it is possible to compute their roots – albeit in an unordered way. To formalize this define a representation of the disjoint union \(\mathbb {C}^{\times } := {\coprod }_{n \in \mathbb {N}} {\mathbb {C}}^{n}\) as follows: A function p is a name of \(x\in \mathbb {C}^{\times }\) if and only if \(x\in {\mathbb {C}}^{p(0)}\) and np(n+1) is a \({\mathbb {C}}^{p(0)}\) name of x. Note that the construction of the representation of \({\mathbb {C}}[X]\) is very similar. The only difference being that in \(\mathbb {C}^{\times }\) vectors with leading zeros are not identified with shorter vectors.

Now, the task of finding the zeros in an unordered way can be formalized by computing the multivalued function that maps a polynomial to the set of lists of its zeros, each appearing according to its multiplicities:

$$\text{Zeros}: \subseteq \mathbb{C}[X] \rightrightarrows \mathbb{C}^{\times}, \quad P \mapsto \left\{(a_{1},\ldots,a_{\deg(P)})\mid \exists \lambda:P=\lambda\prod\limits_{k=1}^{\deg(P)}(X-a_{k})\right\} $$

The importance of \({\mathbb {C}}_{m}[X]\) is reflected in the following well known lemma:

Lemma 4

Restricted to \(\mathbb {C}_{m}[X]\) the mapping Zeros is computable.

Proof

(Proof sketch) This is well known. A nice description of an algorithm to do this can for instance be found in [13], although algorithms were known a lot longer. We only sketch how to find out the degree, which is the number of zeros of the polynomial and therefore the first step towards computing the set of zeros as element of \({\mathbb {C}}^{\times }\). Get an approximation to each of the coefficients with precision \(\frac 12\). Since the highest coefficient will be one, it can be found from this approximation. □

The main difficulty in computing the zeros of an arbitrary polynomial is to find its degree. A polynomial of known degree can be converted to a monic polynomial with the same zeros by scaling. On \({\mathbb {C}}[X]\) consider the following functions:

  • \(\deg \): The function assigning to a polynomial its degree.

  • Dbnd: The multivalued function where an integer is a valid return value if and only if it is an upper bound of the degree of the polynomial.

Dbnd is computable by definition of the representation of \(\mathbb {C}[X]\). \(\deg \) is not computable on the polynomials, however, from the proof of Lemma 4 it follows:

Lemma 5

The degree mapping is computable when restricted to the monic polynomials.

The next result classifies finding the degree, turning a polynomial into a monic polynomial and finding the zeros to be Weihrauch equivalent to LPO.

Proposition 2

The following are Weihrauch-equivalent to LPO :

  • \(\deg \) , that is the mapping from \(\mathbb {C}[X]\) to \(\mathbb {N}\) defined in the obvious way.

  • Monic, that is the mapping from \(\mathbb {C}[X]\) to \(\mathbb {C}_{m}[X]\) defined on the non-zero polynomials by

    $$P = \sum\limits_{k=0}^{\deg(P)} a_{k} X^{k} \mapsto \sum\limits_{k=0}^{\deg(P)}\frac{a_{k}}{a_{\deg(P)}}X^{k}. $$
  • \(\text {Zeros} : \subseteq \mathbb {C}[X] \to \mathbb {C}^{\times }\) , mapping a non-zero polynomial to the set of its zeros, each appearing according to its multiplicity.

Proof

Note that LPO is Weihrauch equivalent to the function \(\min :{\mathbb {N}^{\mathbb {N}}} \to \mathbb {N}\) by Proposition 1. Proceed by building a chain of Weihrauch equivalences:

\(\min \equiv _{\mathrm {W}}\deg \)::

To showFootnote 1 \(\min {\leq _{\mathrm {W}}}\deg \), note that given \(p \in {\mathbb {N}^{\mathbb {N}}}\) and np(0), we can compute a n defined by \(a_{n} = 2^{-\min \{i \mid p(0) - p(i) = n\}}\), where we understand a n = 0 if {ip(0)−p(i) = n} = . Subsequently we can compute the polynomial \(P := {\sum }_{i=0}^{p(0)} a_{i}x^{i}\), and find that \(\min p = p(0) - \deg P\).

On the other hand to see \(\deg \leq _{\mathrm {W}}\min \) let p be a \(\mathbb {C}[X]\)-name of a polynomial P. Set H(p)(0): = p(0) and let H(p)(n) be the minimal number such that the 2n+1-approximation of the polynomial is consistent with \(\deg (P)=p(0)-m\). Apply \(\min \) to this function to get \(p(0)-\deg (P)\). Thus, the post-processor K can be chosen as K(p, q) = p(0)−q(0)

\(\deg \equiv _{\mathrm {W}}\text {Monic}\)::

For \(\deg \leq _{\mathrm {W}}\text {Monic}\) let the pre-processor be the identity. Applying Monic to the input will result in a monic polynomial of the same degree. Let the post-processor be the second projection composed with a realizer of the degree mapping on the monic polynomials that can be chosen computable by Lemma 5.

\(\text {Monic}\leq _{\mathrm {W}}\deg \) is obvious since division by a non-zero number is computable.

Monic≡WZeros::

To see that Monic≤WZeros note, that from approximations to a vector (y 0, y 1,…, y n ) of all the zeros of a polynomial P approximations to the coefficients of Monic(P) can be computed via

$$\text{Monic}(P) = \prod\limits_{k \leq n} (X - y_{k}). $$

For the opposite direction note, that P and Monic(P) have the same set of zeros and that the set of zeros can be computed from Monic(P) by Lemma 4.

3.2 Polynomials as functions

As polynomials induce analytic functions on the unit disk, the representations of \(\mathcal C^{\omega }(D)\) and \(\mathcal C(D)\) can be restricted to the polynomials. The represented spaces that result from this are \({\mathcal {C}^{\omega }(D)}|_{{\mathbb {C}}[X]}\), resp. \({\mathcal {C}(D)}|_{{\mathbb {C}}[X]}\). Here, the choice of the unit disk D as domain seems arbitrary: A polynomial defines a continuous resp. analytic function on the whole space. The following proposition can easily be checked to hold whenever the domain contains an open neighborhood of zero and, since translations are computable with respect to all the representations we consider, if it contains any open set.

Denote the degree resp. degree bound functions on the continuous resp. analytic functions by \(\deg _{\mathcal C(D)}\), \({\text {Dbnd}}_{{\mathcal {C}(D)}}\) resp. \(\deg _{{\mathcal {C}^{\omega }(D)}}\), \({\text {Dbnd}}_{{\mathcal {C}^{\omega }(D)}}\). When polynomials are regarded as functions, resp. analytic functions, these maps become harder to compute.

Theorem 5

The following are Weihrauch-equivalent:

  • \(\mathrm {C}_{\mathbb {N}}\) , that is: Closed choice on the naturals.

  • \(\text {Dbnd}_{\mathcal C^{\omega }(D)}\) , that is: Given an analytic function which is a polynomial, find an upper bound of its degree.

  • \(\deg _{\mathcal C^{\omega }(D)}\) , that is: Given an analytic function which is a polynomial, find its degree.

Proof

Build a circle of Weihrauch reductions:

\(\mathrm {C}_{\mathbb {N}}\leq _{\mathrm {W}}\text {Dbnd}_{\mathcal C^{\omega }(D)}\)::

Use Lemma 1 and reduce to Bound instead. Thus, let p be an enumeration of some bounded subset of the natural numbers. Define a polynomial P as follows:

$$P(X) := \sum\limits_{n\in\mathbb{N}} 2^{-(n + p(n))} X^{p(n)}. $$

One readily verifies that a \(\mathcal C^{\omega }(D)\)-name of the function f corresponding to P can be computed from p: A \({\mathcal {C}(D)}\)-name of f is easy to get hold of as the coefficients fall fast enough with n, and it is easy to check that 2 is an allowed value of \({\text {Adv}_{\mathbb {C}^{\omega }}}(f)\). Let the pre-processor H be a realizer of this assignment.

Obviously \(\text {Dbnd}_{\mathcal C^{\omega }(D)}(f)\) is an upper bound of the set enumerated by p. This means that the choice K(p, q): = q for the post-processor results in a Weihrauch reduction.

\(\text {Dbnd}_{\mathcal C^{\omega }(D)}\leq _{\mathrm {W}}\deg _{\mathcal C^{\omega }(D)}\)::

Is trivial: Using the identity as pre-processor and the second projection as post-processor will do.

\(\deg _{\mathcal C^{\omega }(D)}\leq _{\mathrm {W}}\mathrm {C}_{\mathbb {N}}\)::

By Lemma 1 replace \(\mathrm {C}_{\mathbb {N}}\) with \(\max \). Let p be a \(\mathcal C^{\omega }(D)\)-name of the function corresponding to some polynomial P. Shifting the name will result in a \({\mathcal {C}(D)}\)-name of P and by Lemma 3 a \({\mathbb {C}}^{{\mathbb {N}}}\)-name q of the series of coefficients of P can be computed from this. Let d n denote the enumeration of the rational elements of \({\mathbb {C}}\) that was fixed for the definition of the representation of \({\mathbb {C}}\). Define the pre-processor H as follows:

$$H(p)(\langle m,n\rangle) := \left\{\begin{array}{ll} m+1 &\text{if}\ \left|d_{q(\langle m,n\rangle)}\right| > 2^{-n} \\ 0 & \text{otherwise}. \end{array}\right. $$

This pre-processor is computable and H(p) enumerates the set of indices k such that a k is not zero. Therefore, applying \(\max \) will result in the degree of the polynomial and K(p, q): = q can be chosen as post-processor of a Weihrauch reduction.

From the proof of the previous theorem it can be seen that stepping down from analytic to continuous functions is not an issue. For sake of completeness we add a slight tightening of the third item of Theorem 4 and state this as theorem:

Theorem 6

The following are Weihrauch-equivalent to \(\mathrm {C}_{\mathbb {N}}\):

  • \(\deg _{\mathcal C(D)}\) , that is: Given a continuous function which happens to be a polynomial, find its degree.

  • \(\text {Dbnd}_{\mathcal C(D)}\) , that is: Given an analytic function which happens to be a polynomial, find an upper bound of its degree.

  • \(\text {Adv}_{\mathrm {C}^{\omega }}|_{\mathbb {C}[X]}\) , that is: Given a continuous function which happens to be a polynomial, find the constant needed to represent it as analytic function.

Proof

Weihrauch equivalence of the first two bullets to \(\mathrm {C}_{\mathbb {N}}\) follows directly from the proofs of Theorem 5. For the last item first note, that the Weihrauch reduction \({\text {Adv}_{\mathbb {C}^{\omega }}}{\leq _{\mathrm {W}}}\ \mathrm {C}_{{\mathbb {N}}}\) constructed in Theorem 4 is also a Weihrauch reduction showing \({\text {Adv}_{\mathbb {C}^{\omega }}}|_{{\mathbb {C}}[X]}{\leq _{\mathrm {W}}}\ \mathrm {C}_{{\mathbb {N}}}\). This is generally true for restrictions. On the other hand, the sequence f n of analytic functions in the proof of the reduction \(\mathrm {C}_{{\mathbb {N}}} {\leq _{\mathrm {W}}}\ {\text {Adv}_{\mathbb {C}^{\omega }}}\) in the same theorem may be replaced by rational polynomials that approximate the functions and their derivative well enough. This way, the constructed function f is a polynomial and the reduction a Weihrauch reduction to the restriction \({\text {Adv}_{\mathbb {C}^{\omega }}}|_{{\mathbb {C}}[X]}\). □

\(\text {Dbnd}_{\mathcal C^{\omega }(D)}\) may be regarded as the advice function of \(\mathbb {C}[X]\) over \(\mathcal C^{\omega }(D)\): The representation where a function p is a name of a polynomial P if and only if \(p(0) = {\text {Dbnd}}_{{\mathcal {C}^{\omega }(D)}}\) and np(n+1) is a \({\mathcal {C}^{\omega }(D)}\)-name of P is computationally equivalent to the representation of \({\mathbb {C}}[X]\). The same way, \({\text {Dbnd}}_{{\mathcal {C}(D)}}\) can be considered an advice function of \({\mathbb {C}}[X]\) over \({\mathcal {C}(D)}\).

Figure 5 illustrates Lemma 4, Proposition 1 and Theorems 6, 5.

Fig. 5
figure 5

The result of Lemma 4, Proposition 1 and Theorems 6, 5

4 Test function spaces

This section considers three spaces of test functions as a final example.

4.1 The spaces \(\mathcal E\), \(\mathcal S\) and \(\mathcal D\)

Consider the spaces

$$\mathcal E:=C^{\infty}(\mathbb{R}) $$

of smooth functions,

$$\mathcal S:=\big\{f\in \mathcal E\mid \forall n,m \ \ \exists C \ \ \forall x: \left|x^{n}f^{(m)}(x)\right|\leq C\big\} $$

of Schwartz functions and

$$\mathcal D:= C^{\infty}_{0}(\mathbb{R}) $$

of bump functions, i.e. those smooth functions that are zero outside some compact set. We use the slightly less common name ‘bump functions’ for \({\mathcal {D}}\) instead of the standard name ‘test functions’ as all three spaces are called in ‘spaces of test functions’ and \({\mathcal {D}}\subseteq \mathcal {S}\subseteq {\mathcal {E}}\). The standard example of a function from \({\mathcal {D}}\) is listed in Example 1 below.

These spaces are in particular relevant as their dual spaces with respect to the topologies introduced below are the space \({\mathcal {D}}^{\prime }\) of distributions, \(\mathcal {S}^{\prime }\) of tempered distributions and \({\mathcal {E}}^{\prime }\) of distributions with compact support. The spaces \({\mathcal {D}},\mathcal {S}\) and \({\mathcal {E}}\) are complete locally convex spaces. Recall that a topological vector space is called locally convex if its topology is the initial topology of a family (∥⋅∥ i ) iI of semi-norms. Set \(I:={\mathbb {N}}\times {\mathbb {N}}\). In the case of \({\mathcal {E}}\) the semi-norms

$$\parallel f \parallel^{\mathcal E}_{N,m} := \sup_{|x| \leq N}\left|f^{(m)}(x)\right| $$

can be used. For \(\mathcal S\) use the semi-norms defined via

$$\parallel f\parallel^{\mathcal S}_{d,m} := \sup_{x \in \mathbb{R}} |x^{d}f^{(m)}(x)|. $$

Finally note that \(\mathcal D\) can be regarded as the union of all the spaces \({\mathcal {D}}_{K}\) of smooth functions with support contained in the compact set K. The Spaces \({\mathcal {D}}_{K}\) can be regarded topological vector spaces as the space \({\mathcal {E}}\) above. Define a collection of semi-norms on \({\mathcal {D}}\) as follows: A semi-norm ∥⋅∥ on \({\mathcal {D}}\) is contained in the collection if and only if it restricts to a continuous semi-norm on each of the spaces \({\mathcal {D}}_{K}\).

With respect to the locally convex topologies defined above the inclusions \(\iota _{\mathcal D}^{\mathcal S}:\mathcal D\hookrightarrow \mathcal S\) and \(\iota _{\mathcal {S}}^{{\mathcal {E}}}:\mathcal {S}\hookrightarrow {\mathcal {E}}\) are continuous. The corresponding subspace topologies, however, are strictly coarser. The index set of the families of semi-norms on \({\mathcal {E}}\) and \(\mathcal {S}\) are both \({\mathbb {N}}\times {\mathbb {N}}\) and can be identified with \({\mathbb {N}}\) using the pairing function from the introduction. This makes these spaces Fréchet spaces. Note that a Fréchet space can always be equipped with a translation invariant metric by setting

$$d(x,y) = \sum\limits_{i \in \mathbb{N}} \frac{2^{-i} \left\|x - y\right\|_{i}}{\left\|x - y\right\|_{i} + 1}, $$

where \((\parallel \cdot \parallel _{i})_{i\in {\mathbb {N}}}\) is a countable family of semi-norms inducing the topology. On \({\mathcal {D}}\) there does not exist a countable family of semi norms that induces the right topology: It is not metrizable.

4.2 Representing test functions

For representing these spaces first turn to \(\mathcal E\) and \(\mathcal S\), which can be handled as metric spaces. For the space \(\mathcal E\) of smooth functions choose as dense sub sequence the polynomials with rational coefficients. Equip \({\mathcal {E}}\) with the corresponding metric representation.

Lemma 6

An element of \(\mathcal E\) is computable if and only if the mapping

$$\mathbb{N}\times \mathbb{R} \to \mathbb{R}, \quad(m,x) \mapsto f^{(m)}(x) $$

is computable.

Proof

First assume that the mapping is computable. To approximate f by polynomials in the translation invariant metric up to precision 2n first note that N, m≤〈N, m〉. Therefore it suffices to approximate all up to the m-th derivatives of f on the interval [−N, N] in supremum norm. Use the computable Weierstraß Approximation Theorem to find polynomial approximations of f (m) on [−N, N] to precision (2N)m2n. By the Intermediate Value Theorem \(f^{(m-1)}(x) -f^{(m-1)}(y) \leq \parallel {f^{(m)}}\parallel _{\infty } |{x-y}|\leq (2N)^{-m+1}2^{-n}\), and analogously none of the derivatives up to m can vary by more than 2n.

For the other direction just get an upper bound N for x, read polynomial approximations to the derivatives from the name of the function f and evaluate them. □

The above can seen to be uniform in the sense that it proves the metric representation is computably equivalent to the following one:

Definition 9

Let \(\mathcal E\) denote the represented space of smooth functions, where the representation is defined as follows: A function \(q\in {\mathbb {N}^{\mathbb {N}}}\) is a name of a smooth function f if for all \(N,m\in {\mathbb {N}}\) it holds that nφ(〈N, m, n〉) is a C([−N, N])-name of f (m).

Computability on the space \(\mathcal S\) of Schwartz functions is investigated in [34]Footnote 2. Note that the rational polynomials are not contained in the space \(\mathcal {S}\), thus they have to be replaced by truncating rational polynomials to rational intervals in a smooth way. Writing the corresponding sequence down explicitly is cumbersome, however, it can be done. An alternative approach to obtain a representation of \(\mathcal {S}\) is to effectivize the definition directly.

Definition 10

Let \(\mathcal S\) denote the represented space of Schwartz functions, where the representation is defined as follows: A function \(q\in {\mathbb {N}^{\mathbb {N}}}\) is a name of a Schwartz function f if for all d, m, kn it holds that

$$\forall x\in\mathbb{R}: |x|\geq q(2n) \quad \Rightarrow\quad\left|{x^{d}f^{(m)}(x)}\right|\leq2^{-k} $$

and nq(2n+1) is a name of \(f\in {\mathcal {E}}\).

A proof that this representation is computably equivalent to the metric representation of \(\mathcal S\) can be found as Lemma 5.3 (2) in [34]. This representation adds information to an \({\mathcal {E}}\)-name of a function. However, in contrast to the other cases we encountered so far the information added is an element of Baire space and not discrete.

Finally turn to the bump functions: The space \(\mathcal D\) not being metrizable does not prohibit the existence of a well behaved representation. For instance also the space \({\mathcal {C}^{\omega }(D)}\) of analytic functions is also not metrizable. The topology of \({\mathcal {D}}\) is, however, also not sequential. Thus, a representation can not be expected to induce the topology itself but at most its sequentialization. The question of how to represent \({\mathcal {D}}\) is for instance studied in [11, 34].

Definition 11

Let \(\mathcal D\) denote the represented space of bump functions, where the representation is defined as follows: A function \(q\in {\mathbb {N}^{\mathbb {N}}}\) is a name of a bump function f if and only if the support of f is contained in [−q(0), q(0)] and nq(n+1) is a name of \(f\in {\mathcal {E}}\).

The representation of \(\mathcal D\) arises from subspace representation of \(\mathcal E\) by enriching

with discrete advice. The advice function is given by

$$\text{Adv}^{\mathcal E}_{\mathcal D}(f) = \{k\mid \text{supp}(f)\subseteq [-k,k]\}. $$

Example 1

Consider the function

$$f(x) := \left\{\begin{array}{ll} e^{\frac{x^{2}}{x^{2}-1}} &\text{if} \ |x| < 1 \\ 0& \text{otherwise} \end{array}\right. $$

(compare Fig. 6). We need the following:

Fig. 6
figure 6

The bump function f

Lemma 7

The function f from Example 1 is computable as element of \(\mathcal D\) . For its shifts f λ (x):=f(x−λ) it is true that

$$\left\|f_{\lambda}\right\|^{\mathcal S}_{d,m} \leq (|\lambda|+1)^{d} (17m)^{4m} .$$

This can be pieced together from [34] or [8]. We give a direct proof.

Proof

That f is computable is clear from its definition. A proof that f is infinitely often differentiable is an standard exercise and left to the reader. A direct computation of \(f^{\prime }\) and an easy induction show that for |x|<1

$$f^{(n)}(x) = p_{n} f(x) (1-x^{2})^{-2n}, $$

where p n are integer polynomials recursively defined as follows:

$$p_{0} = 1 \quad\text{and}\quad p_{n+1}:= (1-x^{2})^{2} p_{n}^{\prime} + 2((2n-1)x - 2nx^{3})p_{n}. $$

These formulas show that the mapping (m, x)↦f (m)(x) is computable. The computability of f in \({\mathcal {E}}\) now follows from Lemma 6 and to find a computable \({\mathcal {D}}\)-name it suffices to add 1 to the front of the computable \({\mathcal {E}}\)-name.

Further computations show that \(\deg (p_{n}) = 3n\), that for n>0 the absolute value of each of its coefficients is bonded by (17n−7)n. From applying l’Hospital’s rule it can be seen that (1−x 2)−2n f(x)→0 for |x|→1. Thus the suprema can be found by searching for zeros of the derivative. They are

$$x_{1} := \frac1{2n} + \sqrt{\frac1{4n^{2}} +1} \quad\text{and}\quad x_{2} =\frac1{2n} - \sqrt{\frac1{4n^{2}} +1} $$

with \((1-x_{1/2}^{2})^{-2n} f(x_{1/2}) \leq n^{4n}+1\). It follows that

$$\|f^{(n)}\|_{\infty} \leq 3n(17n-7)^{n}(n^{4n}+1)\leq (17n)^{4n} $$

and thus

$$\left\|f_{\lambda}\right\|^{\mathcal S}_{d,m} = \sup_{x\in\mathbb{R}} \left|x^{d} f^{(m)}(x-\lambda)\right| = \sup_{x\in[\text{-} 1,1]} \left|(x+\lambda)^{d}f^{(m)}(x)\right| \leq (|\lambda|+1)^{d}(17m)^{4m} $$

4.3 Inclusions

We are now ready to investigate the inclusion maps and their inverses between these spaces. Follow [34, Proposition 5.4] to see that the inclusion \(\iota _{{\mathcal {D}}}^{\mathcal {S}} : {\mathcal {D}}\hookrightarrow \mathcal {S}\) is computable: Given a \({\mathcal {D}}\)-name q of F obtain the values of an \(\mathcal {S}\)-name of f (compare Definition 10) on even numbers by 2nq(0) and the values on odd numbers by 2n+1↦q(n+1). That the map \(\iota _{\mathcal {S}}^{{\mathcal {E}}} :\mathcal {S} \hookrightarrow {\mathcal {E}}\) is computable follows from comparing the metric representations. Note that \(\iota _{{\mathcal {D}}}^{\mathcal {S}}\) and \(\iota _{\mathcal {S}}^{{\mathcal {E}}}\) are injective thus they have unique partial sections \(\pi _{\mathcal {S}}^{{\mathcal {D}}}\) and \(\pi _{{\mathcal {E}}}^{\mathcal {S}}\) with domains \({\mathcal {D}}\subseteq \mathcal {S}\) resp. \(\mathcal {S}\subseteq {\mathcal {E}}\). As mentioned before the subspace topologies are strictly finer, thus the sections are not continuous.

Proposition 3

The following are Weihrauch-equivalent to \(\mathrm {C}_{\mathbb {N}}\):

  • \(\pi _{\mathcal S}^{\mathcal D}: \subseteq \mathcal S\to \mathcal D\) , the partial inverse of the embedding \(\mathcal D\hookrightarrow \mathcal S\).

  • \(\pi _{\mathcal E}^{\mathcal D} := \pi _{\mathcal S}^{\mathcal D}\circ \pi _{\mathcal E}^{\mathcal S}:\subseteq \mathcal E \to \mathcal D\) , the partial inverse of the embedding \({\mathcal {D}}\hookrightarrow {\mathcal {E}}\).

Proof

Exhibit a cycle of Weihrauch reductions:

\(\mathrm {C}_{\mathbb {N}} \leq _{\mathrm {W}} \pi _{\mathcal S}^{\mathcal D}\)::

Recall, that by Lemma 1 the function \(\mathrm {C}_{\mathbb {N}}\) may be replaced the function Bound\(:\subseteq {\mathcal {O}}({\mathbb {N}}) \rightrightarrows {\mathbb {N}}\) defined on the finite sets in the obvious way.

Recall the function f from Example 1 and its shifts f λ (x): = f(xλ). Let the pre-processor H be a realizer of the function mapping a string function p to the function

$$g = \sum\limits_{i\in \mathbb{N}} 2^{-i-1}(2p(i)+1)^{-i}(17 i)^{-4 i} f_{2p(i)}. $$

Let g k denote the k-th partial sum of g. Thus

$$\begin{array}{@{}rcl@{}} d(g,g_{k}) & = &\sum\limits_{\langle d,m\rangle\in\mathbb{N}} 2^{-\langle d,m\rangle} \frac{\|{g-g_{k}}\|^{\mathcal{S}}_{d,m}}{\|{g-g_{k}}\|^{\mathcal{S}}_{d,m}+1} \\ & \leq&\sum\limits_{\begin{array}{ll} \langle d,m\rangle\in\mathbb{N} \\ d\leq k\text{ and} m\leq k \end{array}} 2^{-\langle d,m\rangle} \|{g-g_{k}}\|^{\mathcal{S}}_{d,m} + \sum\limits_{\begin{array}{ll} \langle d,m\rangle\in{\mathbb{N}} \\ d> k\text{ or} m> k \end{array}} 2^{-\langle d,m\rangle}. \end{array} $$

Here the latter sum is obviously smaller than 2k−1 and the first can be estimated to be smaller by using the definition of g k and the estimate of the semi-norms of f λ from Lemma 7. Now the sequence \((f_{i})_{i\in {\mathbb {N}}}\) is a computable element of \({\mathcal {D}}^{{\mathbb {N}}}\) and therefore also of \(\mathcal {S}^{{\mathbb {N}}}\) and the sequence g k can be computed from this sequence and p. This suffices to compute a \(\mathcal {S}\)-name of g from p.

From the definition of g it is clear that any bound on the support of g is also a bound for the values of p and therefore a valid return value of Bound. The post-processor K can be chosen as the second projection.

\(\pi _{\mathcal S}^{\mathcal D} \leq _{\mathrm {W}} \pi _{\mathcal E}^{\mathcal D}\)::

Follows from the computability of \(\pi _{\mathcal E}^{\mathcal S}\).

\(\pi _{\mathcal E}^{\mathcal D} \leq _{\mathrm {W}} \mathrm {C}_{\mathbb {N}}\)::

Assume we are given an \(\mathcal E\)-name of some \(f\in \mathbb {D}\). Let \((q_{n})_{n\in \mathbb {N}}\) be a standard enumeration of the rationals. Let the pre-processor H map f to the set the set

$$H(p) := \{K\mid\exists n \forall m: f(q_{m}) > 2^{-n} \Rightarrow q_{m}\leq K\}. $$

This set is not empty since any bound on the support of f fulfills the condition for all n. On the other hand, if the condition is violated by some m, then we can get a polynomial \(\frac {2^{-n}-f(q_{m})}2\)-approximation valid on [−q m , q m ] from the \({\mathcal {E}}\)-name and evaluate it on q m with this the same precision to witness the violation. Therefore H is computable.

Applying \(\mathrm {C}_{\mathbb {N}}\) to the set returns a bound of the support and thus the post-processor K can be chosen to be the projection to the second argument.

Theorem 7

For the partial inverse \(\pi _{\mathcal E}^{\mathcal S}:\subseteq \mathcal E\to \mathcal S\) of the inclusion \(\mathcal S\hookrightarrow \mathcal E\) it holds that \([{\pi _{{\mathcal {E}}}^{\mathcal {S}}}]=\lim \) , i.e. that \(\pi _{{\mathcal {E}}}^{\mathcal {S}} {\equiv _{\mathrm {W}}} \mathrm {C}_{{\mathbb {N}}}^{{\mathbb {N}}}\).

Proof

First prove \(\pi _{\mathcal E}^{\mathcal S}\leq _{\mathrm {W}}\mathrm {C}_{\mathbb {N}}^{\mathbb {N}}\). To obtain a \(\mathcal S\)-name of f from a \(\mathcal E\)-name it necessary to find a sequence a n such that for all d, m, kn it holds that |x d f (m)(x)≤2k| for all x with \(|{x}|\geq 2^{a_{n}}\). Each a n can be found using one instance of \(\mathrm {C}_{{\mathbb {N}}}\): Note that the inequalities above are fulfilled for all real numbers if and only if they are fulfilled for all rational numbers. Therefore, it is possible to enumerate those natural numbers b for which the condition is not fulfilled by searching for a rational counterexample. It follows that computing the sequence a n , and therefore also an \(\mathcal {S}\)-name of f, from an \({\mathcal {E}}\)-name of f is Weihrauch reducible to \(\mathrm {C}_{{\mathbb {N}}}^{{\mathbb {N}}}\).

For the other direction by Lemma 2 it suffices to prove \(\text {Bound}^{\mathbb {N}}\leq _{\mathrm {W}}\pi _{\mathcal E}^{\mathcal S}\). Note that Bound\(^{{\mathbb {N}}}\) produces from \(p\in {\mathbb {N}^{\mathbb {N}}}\) such that

$$\forall m \in \mathbb{N} :\max\{p(\langle n,m\rangle)\mid n\in\mathbb{N}\} $$

a \(q\in {\mathbb {N}^{\mathbb {N}}}\) such that q(m) is a bound of the maximum above.

Let f be the function from Example 1 and f i its integer shifts. For \(i,k\in \mathbb {N}\) let m i, k denote the smallest integer such that p(〈m i, k , k〉) = i. Consider the following sequence of functions:

$$g_{k} := \sum\limits_{i\in\text{img}(p)}\max\{x,2\}^{-k} f_{m_{i,k}+i} $$

A \(\mathcal E^{\mathbb {N}}\)-name of this function sequence is computable from p since (f i ) is computable in \({\mathbb {D}}^{{\mathbb {N}}}\) and each restriction of g k to [−N, N] only depends on the first N values of p. Let the preprocessor H be a realizer of this mapping.

Due to the assumption \(p\in \text {dom}(\text {Bound}^{\mathbb {N}})\) the functions g k have compact support. Furthermore, from the bounds from Lemma 7 it is easy to see that the function

$$g:= \sum\limits_{k\in\mathbb{N}} g_{k} \quad\text{fulfills}\quad \left\|g\right\|^{\mathcal S}_{d,m}\leq \sum\limits_{i\in\text{img}(p)} (1+m_{i,k} + i)^{d}(17m)^{4m} < \infty $$

and is therefore contained in \(\mathcal {S}\).

On the other hand all the values of the g k are positive and therefore

$$g(m_{i,k}+p(\langle i,k\rangle))\geq g_{k}(m_{i,k}+p(\langle i,k\rangle)) \geq 2^{-k} $$

Therefore, if q is an \(\mathcal {S}\)-name of g, then for all i it holds that q(2k)≥p(〈i, k〉) and q(2⋅) is a valid return value for Bound\(^{{\mathbb {N}}}\). □

Another important representative of the degree \(\lim \) is the Turing jump \(J : {\{0, 1\}^{\mathbb {N}}} \to {\{0, 1\}^{\mathbb {N}}}\) mapping p to the Halting problem relative to p. As shown in [5], \(J {\equiv _{\mathrm {W}}} \lim \) (essentially by a uniform version of Shoenfields Limit Lemma). This has the important consequence that whenever \(T {\equiv _{\mathrm {W}}} \lim \), then there is some computable point x∈dom(T) such that T(x) computes the Halting problem [1].

Corollary 1

There exists a function \(f : \mathbb {R} \to \mathbb {R}\) which is computable as an element of \(\mathcal E\) , and which also is an element of \(\mathcal {S}\) , but as the latter, computes the Halting problem.

5 Conclusions & Outlook

We have seen that some care is required when formulating statements about computability with respect to some more complicated function spaces in analysis: Computing a continuous function (that happens to be analytic) is easier than computing the same function as an analytic function, etc. For most the distinctions we have investigated, these differences are rather small: As the degree of \(\mathrm {C}_{\mathbb {N}}\) preserves computability of points, an individual analytic function is a computable analytic function iff it is a computable continuous function. For Schwartz functions, however, the situation is different, and crucial distinctions already appear at the level of individual functions.

The relevance of the choice of function spaces for computable analysis has been very prominent in the discussion of the computability of the wave equation: In [26, 27], computable parameters were exhibited that forced the solution to take non-computable values at time 1. This constituted a significant challenge for the philosophical discussion about computability and physics. A resolution was then offered in [33] by demonstrating that the solution operator for the wave equation is computable after all – if one chooses the correct function spaces.

The examples we have studied in this paper are by far not all that deserve attention. Based partially on the results in Section 4, one could contrast continuous functions, distributions and tempered distributions. Similarly, the relationship between continuous functions and \(\mathcal {L}^{1}\) functions that happen to be continuous should be clarified. It is known, however, that translating from a continuous real function that has a continuous derivative to a \(C^{1}(\mathbb {R})\) function is equivalent to \(\lim \) [30].

We should point out that many of the results proved in Section 2 work for more general domains: Lemma 3 generalizes to any computable point of the interior of an arbitrary domain. It can be made a uniform statement by including the base point of a germ. In this case for the proof to go through computability of the distance function of the complement of the domain of the analytic function is needed.

Another example is the part of Theorem 4 that says finding a germ on the boundary is difficult. In this case a disc of finite radius touching the boundary in a computable point is needed. Alternatively, a simply connected bounded Lipshitz domain with a computable point in the boundary can be used. Also in this case it seems reasonable to assume that a uniform statement can be proven.