# Cosine = Contraction? (Banach)

1. Jun 7, 2010

### nonequilibrium

So in Analysis I we explained the convergence of cos to a fixed value by Banach's contraction theorem. But is the cos a strict contraction? Is that obvious? (What is its contraction factor?)

2. Jun 7, 2010

### Tedjn

It's not obvious to me that cosine is a strict contraction on the whole real line. In fact, I'm not sure it's even true. For instance, around pi/2 seems to pose many problems. Was the contraction restricted to an interval?

3. Jun 7, 2010

### rasmhop

As Tedjn mentioned you need to restrict cosine to a small enough interval due to the behavior near pi/2 (and kpi+pi/2 for all integers k). In fact it's a well-known trigonometric identity that $\sin(h)/h \to 1$ as $h\to 0$ so this gives us:
$$\left|\frac{\cos(\pi/2-h) -\cos(\pi/2)}{\pi/2-h-\pi/2}\right| = \frac{\cos(\pi/2-h)}{h} = \frac{\sin(h)}{h} \to 1$$
for $h \to 0$. This shows in particular:
$$d(\cos(\pi/2),\cos(x)) \to d(\pi/2,x) \qquad \mbox{for }x \to \pi/2$$
so if you choose a contraction factor k < 1 it would result in a contradiction for x close enough to $\pi/2$.

However it's possible to show that cos is a contraction mapping defined on any set of the form $[-\pi/2+\epsilon,\pi/2-\epsilon]$ where $0 < \epsilon < \pi/2$. In fact we know $|sin h| < |h|$ for all h in $[-\pi/2,\pi/2]$. Let $k=\sin(\pi/2-\epsilon) < 1$. Using the identity:
$$\cos y - \cos x = 2\sin\left(\frac{x+y}{2}\right)\sin\left(\frac{x-y}{2}\right)$$
we have:
\begin{align*} f(x,y) = \left|\frac{\cos y - \cos x}{y - x}\right| &= \left|2\sin\left(\frac{x+y}{2}\right)\frac{\sin\left(\frac{x-y}{2}\right)}{x-y}\right| \\ &= \left|\sin\left(\frac{x+y}{2}\right)\frac{\sin\left(\frac{x-y}{2}\right)}{\frac{x-y}{2}}\right| \end{align*}
Clearly a least upper bound for f(x,y) is equivalent to a contraction factor. We can fix $x=pi/2-\epsilon$ and let y approach x from below. Then the first term of f(x,y) approaches $\sin(\pi/2-\epsilon)$ and the second approaches 1, so f(x,y) will approach $$k=sin(\pi/2-\epsilon)$$. This shows that the contraction factor must at least be k. On the other hand we have:
$$\left|\frac{\sin\left(\frac{x-y}{2}\right)}{\frac{x-y}{2}}\right| \leq 1$$
so
$$|f(x,y)| \leq \left|sin\left(\frac{x+y}{2}\right)\right| \leq \sin(\pi/2-\epsilon) = k$$
which shows that k is actually the contraction factor for cos defined on $[-\pi/2+\epsilon,\pi/2-\epsilon]$.

This should however be sufficient as $|cos(x)| \leq 1$ so clearly any fixed point will lie in $[-1,1]$ and $\pi/2 > 1$.

Last edited: Jun 7, 2010
4. Jun 7, 2010

### Tedjn

A very nice proof that it fails near pi/2. Another way I've seen the second part proved is using the mean value theorem.

5. Jun 8, 2010

### nonequilibrium

Ramshop, that's the second time you've made a very informative post, thank you.

Also thank you to Tedjn for posting :)

Having seen the proof, it's logical the fixed-point theorem of Banach still applies, as no matter where you start, you'll eventually end up in the strict contraction "zone".

6. Jun 8, 2010

### Xitami

One button calculator, cos, cos, cos,...
Code (Text):
_________________________________
|    _   _  _  _  _  _  _     _   |
|   | |   | _||_|| ||_||_   | _|  |
|   |_|.  | _| _||_||_| _|  | _|  |