# How many non-differentiable functions exist?

The size of the set of functions that map $\mathbb{R}\to \mathbb{R}$ equals $(\#\mathbb{R})^{\#\mathbb{R}}$. How many non-differentiable functions are there in this set?

• It's not clear what differentiable even means for a map between two arbitrary sets, is it? May 8, 2016 at 22:35
• @Kevin: I expect the OP is using $R$ to mean $\mathbb R$. May 8, 2016 at 22:38
• @TonyK Ah okay, maybe it's just beyond me then, but I don't know what $\mathbb{R}^{\mathbb{R}}$ means then, unless its something like $\mathfrak{c}^\mathfrak{c}$. May 8, 2016 at 22:44
• @Kevin: No, $\mathbb R^{\mathbb R}$ is specifically the set of functions $\mathbb R \to \mathbb R$. We do have $|\mathbb R^{\mathbb R}| = \mathfrak{c}^\mathfrak{c}$. May 8, 2016 at 22:50
• I would expect the cardinality to be the same as that of the functions. Differentiability is a highly improbable coincidence.
– user65203
May 9, 2016 at 6:45

Here is a simple way to get the answer:

Suppose a function $f:\mathbb R \to \mathbb R$ is equal to the function $g$ on $\mathbb Q$, where $g:\mathbb Q \to \mathbb Q$ is defined by $g(p/q) = q$ (and we choose the representation $p/q$ so that $q$ is the smallest possible positive integer). Then $f$ is nowhere differentiable, because it is unbounded on every interval.

And the number of such $f$ is $|\mathbb R^{\mathbb R \setminus \mathbb Q}| = |\mathbb R^{\mathbb R}|$, because $|\mathbb R \setminus \mathbb Q| = |\mathbb R|$.

Hence there as many nowhere-differentiable functions $\mathbb R \to \mathbb R$ as there are functions $\mathbb R \to \mathbb R$.

(This doesn't tell you how many differentiable functions there are. The number of somewhere-differentiable functions is the same as the set of all functions; but the number of everywhere-differentiable functions is $|\mathbb R^\mathbb Q| = |\mathbb R|$, because such a function is determined by its values on the rationals.)

• @DaveL.Renfro : Your argument seems to include that the pointwise limit of a sequence of everywhere continuous functions is a continuous function. This is wildly false. (It's not even true for a sequence of everywhere differentiable functions.) May 9, 2016 at 19:03
• @Eric Towers: You're right -- I confused "a function being differentiable" (what I intended to address) with "the resulting derivative of a function that is differentiable" (what I actally addressed). I'll delete my comment tomorrow. I need to take care of an emergency now (just came up). May 9, 2016 at 19:19

It is very hard to say something about "how many" such functions exist. One possibility is to use the formalism of Baire's Theorem and indeed it is known that

the set of functions that have a derivative at some point is a meager set in the space of all continuous functions.

EDIT: The precise meaning of this statement really requires to learn some basic definitions from Baire's theory, but the summary is: functions that have a derivative at some point are really, really, really rare -- even among continuous ones, let alone among all functions. On the other hand, a different, more measure-flavoured answer to the OP's question can be found here.

• It is in fact rather easy to say how many such functions exist $-$ see my answer. May 8, 2016 at 22:59
• Hmmm...the set of continuous functions that have a derivative at some point has the same cardinality as the set of all continuous functions, namely $\mathbb R$. So what is Baire's result saying? Is it saying that the measure of the former set in the latter set is zero? What measure is this? May 8, 2016 at 23:19
• @TonyK What I was meaning is that there are different notions to measure "how many" non-differentiable functions exist: density, meaure, meagerness, to name a few. You have chosen to go for checking that two sets are mutually bijective, why not. But it is clearly not the only natural way to proceed.
– DeM
May 8, 2016 at 23:19
• @TonyK Well, just check the statement of Baire's Theorem, which is very classical in functional analysis. Its application to the OP's question is btw not due to Baire himself, but to Banach.
– DeM
May 8, 2016 at 23:22
• I have tried to follow your instructions ("just check the statement..."). It seems that we need a topology on the set of continuous functions, but I can't find a definition of this topology anywhere. In particular, I can't find whether we can use this idea for the set of all functions. May 8, 2016 at 23:36