In an exercise my teacher asked the following:
- Let $f:\mathbb R\to \mathbb R $ be a function of class $C^1$. Prove that $f$ is a contraction iff $\exists K\in (0,1):\forall x \in \mathbb R, |f'(x)|\leq K$.
I was able to prove this but I didn't use anywhere the fact that $f'$ is a continuous function and because of that, I'm starting the question of the validity of my proof. This is what I did:
(1. contraction $\implies$ $|f'(x)|\leq K$)
If $f$ is a contraction, then $\exists K\in (0,1)$ such that: $\forall x,y\in \mathbb R, |f(x)-f(y)|\leq K|x-y|$, and this is the same as: $$\left|\frac{f(x)-f(y)}{x-y}\right|\leq K$$
Let $x \in \mathbb R$, then:
$$|f'(x)|=\left|\lim _{\alpha\to 0} \frac {f(x+\alpha ) - f(x)}{(x+\alpha)-x}\right|$$ $$ =\lim_{\alpha \to 0}\left| \frac {f(x+\alpha ) - f(x)}{(x+\alpha)-x}\right|\leq K$$
(2. $|f'(x)|\leq K \implies$ contraction)
Let $f$ be a function such that $\forall x \in \mathbb R, |f'(x)| \leq K$ with $K \in (0,1)$. Let $x,y \in \mathbb R$ with $x < y$. Then,$\exists c \in (x,y)$ such that:
$$\left| \frac{f(y)-f(x)}{y-x} \right|=|f'(c)|\leq K$$
So: $$|f(y)-f(x)|\leq K|y-x|$$
In the proof, I never used the fact that the function $f$ has a continuous derivative. Is the proof correct or did I make some kind of mistake that considering that $f'$ is continuous would fix?
It is not needed that $f\in C^1$. Indeed, as you have shown, it is enough to assume that $f$ is differentiable.