Effective Genericity and Differentiability

We prove that a real x is 1-generic if and only if every differentiable computable function has continuous derivative at x. This provides a counterpart to recent results connecting effective notions of randomness with differentiability. We also consider multiply differentiable computable functions and polynomial time computable functions.


Introduction
The notion of 1-genericity is an effective notion of genericity from computability theory that has been studied extensively, see e.g. Jockusch [6], or the textbooks Odifreddi [11] and Downey and Hirschfeldt [5]. 1-Genericity, or Σ 0 1 -genericity in full, can be defined using computably enumerable (c.e.) sets of strings as forcing conditions. This notion captures a certain type of effective finite extension constructions that is common in computability theory. In this paper we give an characterization of 1-genericity in terms of familiar notions from computable analysis. This complements recent results by Brattka, Miller, and Nies [1] that characterize various notions of algorithmic randomness in terms of computable analysis. For example, in [1] it was proven (building on earlier work by Demuth [4]) that an element x ∈ [0, 1] is Martin-Löf random if and only if every computable function of bounded variation is differentiable at x. Note that the notion of Martin-Löf randomness, which one could also call Σ 0 1 -randomness, is the measure-theoretic counterpart of the topological notion of 1-genericity.
The main result of this paper is as follows. The two implications of this theorem will be proven in Theorems 4.3 and 5.2. Note that by "differentiable computable function" we mean a computable function that is classically differentiable, so that in particular the derivative need not be continuous. Our result can be seen an effectivization of a result by Bruckner and Leonard. [3, p. 27]) A set A ⊆ R is the set of discontinuities of a derivative if and only if A is a meager Σ 0 2 set. One might expect that, in analogy to Theorem 1.1, n times differentiable computable functions would characterize n-genericity. However, in section 7 we show that 1-genericity is also equivalent to the nth derivative of any n times differentiable computable function being continuous at x. In section 8 we consider differentiable polynomial time computable functions and show that again these characterize 1genericity.
Our notation is mostly standard. We denote the natural numbers by ω. The Cantor space of all infinite binary sequences is denoted by 2 ω , and 2 <ω is the set of all finite binary strings. For a finite string σ and a finite or infinite string x, we denote by σ ⊑ x that σ is an initial segment of x. For a string σ ∈ 2 <ω , we have The product topology on 2 ω , sometimes called the tree topology, or the finite information topology, has all sets of the form [ n and Π 0 n . These notions are defined in the same way for [0, 1], using rational intervals as basic opens. We denote the interior of a set V ⊆ 2 ω by Int(V ).
For unexplained notions from computability theory, we refer to Odifreddi [10] or Downey and Hirschfeldt [5]. For background in descriptive set theory we refer to Kechris [7] or Moschovakis [9]. Further background on (classical) Baire category theory can also be found in Oxtoby [12].

1-Genericity
First, let us recall what it means for an element x ∈ 2 ω to be 1-generic. We will then discuss 1-genericity for elements of [0, 1]. A discussion of the properties of arithmetically generic and 1-generic sets can be found in Jockusch [6]. The "forcing-free" formulation of genericity we use here is due to Posner, see [6, p115].
Given a sequence x ∈ 2 ω and a set A ⊆ 2 <ω , we say that Definition 2.1. An element x ∈ 2 ω is 1-generic if x meets every c.e. set A ⊆ 2 <ω that is dense along x.
We now reformulate the definition of 1-genericity into a form that will be convenient in what follows. This formulation is also better suited for the discussion of generic real numbers (as opposed to infinite strings).  One of the reasons this is interesting to mention explicitly is because a typical example of a nowhere dense set is a closed set with its interior removed, and the Π 0 1 sets are the simplest type of closed sets. Thus, the Corollary 2.3 says that x is 1-generic if it is not in any of the simple, typical nowhere dense sets. This way of looking at 1-generic sets complements the usual motivation of 1-genericity by forcing, and it also allows one to easily compare 1-genericity with weak 1-genericity (since x is weakly 1-generic if it is not in any Π 0 1 -class with empty interior, see [5]). With this equivalence in mind, we can now also define what it means for an element of [0, 1] to be 1-generic.
There is a natural 'almost-homeomorphism' between 2 ω and [0, 1]: given an infinite sequence x ∈ 2 ω we have 0.x ∈ [0, 1] (interpreting the sequence as a decimal expansion in binary), and conversely given y ∈ [0, 1] we can take the binary expansion of y containing infinitely many 0s, which gives us an element of 2 ω . Note that the problem of nonunique expansions only occurs for rationals, which are not 1-generic anyway. It is thus natural to ask if the notions of 1-genericity in these two spaces correspond via this mapping. The next proposition says this is indeed the case. Note that 2 ω − is dense in 2 ω and that [0, 1] − is dense in [0, 1]. Thus, it is enough if we can show that if Y ⊆ X is such that Y is dense in X, then 1-genericity on X and Y coincide for elements y ∈ Y . Given a Π 0 . Towards a contradiction, assume that U ∩ (X \ V ) = ∅, then this is a nonempty open set. However, we also have . This completes the proof.

Effective Baire class 1 functions
In this section we will discuss what it means for a function to be of effective Baire class 1, and discuss some of the basic properties of these functions. First, let us recall what it means for a function on the reals to be computable. Our definitions follow Moschovakis [9].
if there exists a computable function α : Q × Q → ω such that for all q, r ∈ Q we have that f −1 ((q, r)) is equal to the Σ 0 1 class given by the index α(q, r).
Definition 3.1 is equivalent to the formulation with computable functionals, see e.g. the discussion in Pour-El and Richards [13].
Functions of effective Baire class 1 are obtained by weakening the above definition as follows.
we obtain what is known as a function of (non-effective) Baire class 1. Before we give an important example of an effective Baire class 1 function, let us first consider the following proposition, which gives an equivalent condition for a function to be of effective Baire class 1. This proposition mirrors the classical proposition which says that a function is of Baire class 1 if and only if it is a pointwise limit of continuous functions, see e.g. Kechris [7, p. 192]. (This does not hold for all Polish spaces; it holds for f : The following are equivalent: (i) f is of effective Baire class 1, (ii) f is the pointwise limit of a uniform sequence of computable functions, i.e. there exists a sequence f 0 , f 1 , . . . of functions from [0, 1] to R converging pointwise to f and a computable function α : ω × Q × Q → ω such that for all q, r ∈ Q and all n ∈ ω we have that f −1 n ((q, r)) is equal to the Σ 0 1 class given by the index α(n, q, r).
. is a computable enumeration of the closed intervals with rational endpoints. We claim: Then for every m n we have that Then for every m n we have f m (x) ∈ V i , and since V i is closed we then also have f (x) = lim m→∞ f m (x) ∈ V i ⊆ U , which completes the proof of the claim.
(i) → (ii): This follows by effectivizing Kechris [7, Theorem 24.10]; this result is also mentioned (without proof) in Moschovakis [9, Exercise 3.E.14]. Since this implication is not used anywhere in this paper, we will not go into further detail.
Using this proposition, we can now give an important example of effective Baire class 1 functions: derivatives of computable functions. This also explains our interest in them. Proof. Let f n (x) = 2 n (f (x + 2 −n ) − f (x)). To account for the problem that for x + 2 −n > 1 the value f (x + 2 −n ) is not defined, we let f (y) = −f (2 − y) + 2f (1) for y > 1 (i.e. we flip and mirror f on [1,2]). Then the sequence f 0 , f 1 , . . . is uniformly computable and converges pointwise to f ′ , so f ′ is of effective Baire class 1 by Proposition 3.3.

Continuity of Baire class 1 functions
At the basis of this section lies the following important classical result. We will now effectivize this result.
Now, let x be such that f is discontinuous at x and let n be such that Let i be such that x ∈ V i \ Int(V i ). Then x is not 1-generic by Definition 2.4.
Combining this result with the fact that derivatives of computable functions are of effective Baire class 1, we get the first implication of Theorem 1.1 as a consequence.

Functions discontinuous at non-1-generics
In this section we will prove the second implication of Theorem 1.1. To this end, we will build, for each Π 0 1 class V , a Volterra-style differentiable computable function whose derivative will fail to be continuous at the points whose non-1-genericity is witnessed by V . We have to be careful in order to make this function computable.
Proof. In the construction of f below, we first define auxiliary functions g and h.
Construction. We define an auxiliary function g, with the property that g is differentiable and computable, and g ′ is continuous on (0, 1) and discontinuous at 0 and 1.
Define the function h on [0, 1] by h(0) = 0 and h(x) = x 2 sin( 1 x 2 ) for x > 0. Then h is computable and differentiable, with derivative h ′ (0) = 0 and when x > 0. Note that h ′ is discontinuous at x = 0. Fix a computable x 0 ∈ (0, 1 2 ] such that h ′ (x 0 ) = 0. Such an x 0 exists, because h ′ has isolated roots, and isolated roots of computable functions are computable. Now define g on [0, 1] by Then g is a differentiable computable function, with derivative In particular, we see that g ′ is continuous exactly on (0, 1). We will use g to construct f . For the given Π 0 1 class V , let U = [0, 1] \ V , and fix computable enumerations q 0 , q 1 , . . . and r 0 , r 1 , . . . of rational numbers in [0, 1] such that U = n∈ω [q n , r n ] and such that the (q n , r n ) are pairwise disjoint. We will construct f as a sum of a sequence f 0 , f 1 , . . . of uniformly computable functions. We define f n by: Finally, we let f = ∞ n=0 f n .

Verification.
We first show that f is computable. To this end, first observe that each f n is supported on (q n , r n ), and therefore the supports of the different f n are disjoint. Furthermore, each f n is bounded by 2 −n .
Let (a, b) be a basic open subset of R. We distinguish two cases. First, assume 0 ∈ (a, b). We assume a > 0, the case b < 0 is proven in a similar way. Let n ∈ ω be such that 2 −n < a. Then, since the supports of the f m are disjoint, and each f m is bounded by 2 −m , we have ((a, b)), which is Σ 0 1 because a finite sum of computable functions is computable. In the second case, we have 0 ∈ (a, b). Let n be such that |a|, |b| 2 −n . Then, again because the supports of the f m are disjoint, we see that if x is not in the support of any f m for m n then certainly f (x) ∈ (a, b). Therefore we have which is also Σ 0 1 . It is clear that the case distinction is uniformly computable, so it follows that f is computable.
Next, we check that f is differentiable. We first note that every f n is differentiable, because g is differentiable. Let x ∈ [0, 1]. We distinguish two cases. First, if x is in some (q n , r n ) then it is immediate that f is differentiable at x with derivative f ′ n (x), because the intervals (q n , r n ) are disjoint. Next, we consider the case where x is not in any interval (q n , r n ). Note that in this case we have f (x) = 0. Fix m ∈ ω. Then we have: Because f 0 + · · · + f m is differentiable at x with derivative 0, this is equal to: To show that this limit is 0, we will prove that it is bounded by 1 2 m (1−x0) for every m. Let y ∈ [0, 1] be distinct from x. Let us assume that x < y; the other case is proven in the same way. If y is not in any (q n , r n ) for n m + 1 then (f m+1 + f m+2 + . . . )(y) = 0. Otherwise, there is exactly one such n. Then: where the last inequality follows from the fact that x does not lie in (q n , r n ). We distinguish three cases. First, if z = y−qn rn−qn ∈ (0, x 0 ], then f n (y) Combining this with (5.2) we see that lim y→x Since m was arbitrary this shows that f is differentiable at x, with derivative f ′ (x) = 0.
Finally, we need to verify that f ′ is discontinuous at x for all x ∈ V \ Int(V ). Therefore, let x ∈ V \ Int(V ). Then every open set W containing x has nonempty intersection W ∩U (recall that U = [0, 1]\ V ), but this intersection does not contain x. We have shown above that f ′ (x) = 0. We will show that for every open interval I containing x there is a point y ∈ I such that f ′ (y) −1, which clearly shows that f ′ cannot be continuous at x. Fix an open interval I containing x. Then I ∩ U = ∅, so there is an n ∈ ω such that I ∩ [q n , r n ] is nonempty. Note that I contains x and therefore I cannot be a subinterval of [q n , r n ]. Therefore there exists a q n < s < r i such that either [q n , s) ⊆ I or (s, r n ] ⊆ I. We will assume the first case; the second case is proven in a similar way. Note that on [q n , s) the function f ′ is equal to f ′ n . For y ∈ (q n , s) we thus have: f ′ (y) = 2 −n g ′ ((y − q n )/(r n − q n )).
So, we need to show that there is a y ∈ (q n , s) such that g ′ ((y−q n )/(r n −q n )) −2 n , or equivalently, that there is a z ∈ (0, (s − q n )/(r n − q n )) such that g ′ (z) −2 n . Without loss of generality, (s − q n )/(r n − q n ) < x 0 . Let k n be such that 2 −k s−qn rn−qn . Then: This completes the verification.
Proof. If x is not 1-generic, then there is a Π 0 1 class V such that x ∈ V \ Int(V ). Applying Theorem 5.1 to V gives a differentiable computable function f for which f ′ is discontinuous at x.

n-Genericity
The notion of 1-genericity (Definition 2.1) corresponds to the first level of the arithmetical hierarchy. Higher genericity notions can be defined using forcing conditions from higher levels of the arithmetical hierarchy. As for 1-genericity, an equivalent formulation can be given as follows, see Jockusch [6]: 1. An element x ∈ 2 ω is n-generic if x meets every Σ 0 n set of strings A ⊆ 2 <ω that is dense along x.
As usual, let ∅ ′ denote the halting set, and let ∅ (n) denote the n-th jump. Since a Σ 0 n set of strings is the same as a Σ 0 1 set of strings relative to ∅ (n−1) , a set is n-generic if and only if it is 1-generic relative to ∅ (n−1) . Corollary 2.3 relativizes to: For any x ∈ 2 ω we have that x is n-generic if and only if for Note that in general a Π 0,∅ (n−1) 1 class in 2 ω is not the same as a Π 0 n class, since the latter need not even be closed. (And even if one assumes that the class is closed the notions are not the same, see [5, p76].) Given this equivalence, we can now generalize Definition 2.4 to: 1]. We say that x is n-generic if for every Π 0,∅ (n−1) Further justification for this definition comes from the fact that Proposition 2.5 relativizes: An irrational x ∈ [0, 1] is n-generic according to Definition 6.3 if and only if its binary expansion is n-generic in 2 ω .
It is straightforward to check that the results of all the previous sections relativize to an arbitrary oracle A. This gives the following relativized version of Theorem 1.1: Taking A = ∅ (n−1) , this immediately gives the following characterization of ngenericity: Also, taking all n together, we see that a real x is arithmetically generic if and only if every differentiable arithmetical function has continuous derivative at x.

Multiply differentiable functions
We have characterized 1-genericity using the continuity of the derivatives of (once) differentiable computable functions. One might wonder: what kind of effective genericity for x corresponds to every twice differentiable, computable function having continuous second derivative at x? Or, more generally, what corresponds to every n times differentiable, computable function having continuous nth derivative at x? It turns out that the answer is always 1-genericity. To show this we will need the following proposition, which essentially tells us that the case for n > 2 collapses to the case n = 2. If the second derivative of a computable function exists, it is easy to see that it is of effective Baire class 2 (i.e. a pointwise limit of a computable sequence of functions of effective Baire class 1), by similar arguments as in the proof of Corollary 3.4 However, using the following proposition we can easily see that the second derivative of a computable function is in fact of effective Baire class 1.
Proof. See e.g. Rudin [14, p. 115]. Proof. For n = 1 this is exactly Theorem 1.1. So, we may assume n 2. First, if x ∈ [0, 1] is not 1-generic, then by Theorem 1.1 there is a differentiable, computable function g : [0, 1] → R such that g ′ is not continuous at x. Now let h 1 = g and let h i be a computable antiderivative of h i−1 for 2 i n (which exists by Ko [8,Theorem 5.29]). Then, if we let f = h n , we see that f is an n times differentiable, computable function such that f (n) is discontinuous at x.
Conversely, if f is an n times differentiable, computable function, then f (n−2) is computable by Proposition 7.1. So, f (n) is of effective Baire class 1 by Proposition 7.2. Thus, if f (n) is discontinuous at x, then x is not 1-generic by Theorem 4.2.

Complexity theoretic considerations
In this section we discuss polynomial time computable real functions. The theory of these functions is developed in Ko [8], to which we refer the reader for the basic results and definitions. Briefly, a function f : [0, 1] → R is polynomial time computable if for any x ∈ [0, 1] we can compute an approximate value of f (x) to within an error of 2 −n in time n k for some constant k.
Most of the common functions from analysis, such as rational functions and the trigonometric functions, as well as their inverses, are all polynomial time computable, see e.g. Brent [2] and Weihrauch [15]. Also, the polynomial time computable functions are closed under composition. With this knowledge, it is not difficult to see that the construction of the function f in section 5 can be modified to yield a polynomial time computable function, rather than just a computable one. For this it is also needed that the complement of the Π 0 1 class V from Theorem 5.1 can be represented by a polynomial time computable set of strings. This is similar to the fact that every nonempty computably enumerable set is the range of a polynomial time computable function, simply by sufficiently slowing down the enumeration. Since the enumeration of U = [0, 1] \ V in the proof of Theorem 5.1 is now slower, the definition of f n in (5.1) has to be adapted by replacing 2 n by 2 t(n) , where t(n) is the stage at which the interval (q n , r n ) is enumerated into U . This modification ensures that the functions f n are uniformly polynomial time computable, so that also the function f = ∞ n=0 f n , is polynomial time computable. Thus we obtain the following strengthening of Theorem 5.1: Proof. The "only if" direction is immediate from Theorem 1.1. For the "if" direction; if x is not 1-generic, then there is a Π 0 1 class V such that x ∈ V \ Int(V ). Theorem 8.1 then gives a differentiable polynomial time computable function f for which f ′ is discontinuous at x.