2a. Continuous functions

[math] \newcommand{\mathds}{\mathbb}[/math]

This article was automatically generated from a tex file and may contain conversion errors. If permitted, you may login and edit this article to improve the conversion.

We are now ready to talk about functions, which are the main topic of this book. A function [math]f:\mathbb R\to\mathbb R[/math] is a correspondence [math]x\to f(x)[/math], which to each real number [math]x\in\mathbb R[/math] associates a real number [math]f(x)\in\mathbb R[/math]. As examples, we have [math]f(x)=x^2[/math], [math]f(x)=2^x[/math] and so on. This suggests that any function [math]f:\mathbb R\to\mathbb R[/math] should be given by some kind of “mathematical formula”, but unfortunately this is not correct, because, with suitable definitions of course, there are more functions than mathematical formulae.


This being said, we will see that under suitable regularity assumptions on [math]f:\mathbb R\to\mathbb R[/math], we have indeed a mathematical formula for [math]f(x)[/math] in terms of [math]x[/math], at least locally. And with this being actually the main idea of calculus, that will take some time to be developed. But more on this later, once we will know more about functions.


Getting started now, let us keep from the above discussion the idea that we should focus our study on the functions [math]f:\mathbb R\to\mathbb R[/math] having suitable regularity properties. In what regards these regularity properties, the most basic of them is continuity:

Definition

A function [math]f:\mathbb R\to\mathbb R[/math], or more generally [math]f:X\to\mathbb R[/math], with [math]X\subset\mathbb R[/math] being a subset, is called continuous when, for any [math]x_n,x\in X[/math]:

[[math]] x_n\to x\implies f(x_n)\to f(x) [[/math]]
Also, we say that [math]f:X\to\mathbb R[/math] is continuous at a given point [math]x\in X[/math] when the above condition is satisfied, for that point [math]x[/math].

Observe that a function [math]f:X\to\mathbb R[/math] is continuous precisely when it is continuous at any point [math]x\in X[/math]. We will see examples in a moment. Still speaking theory, there are many equivalent formulations of the notion of continuity, with a well-known one, coming by reminding in the above definition what convergence of a sequence means, twice, for both the convergences [math]x_n\to x[/math] and [math]f(x_n)\to f(x)[/math], being as follows:

[[math]] \forall x\in X,\forall\varepsilon \gt 0,\exists\delta \gt 0,|x-y| \lt \delta\implies|f(x)-f(y)| \lt \varepsilon [[/math]]


At the level of examples, basically all the functions that you know, including powers [math]x^a[/math], exponentials [math]a^x[/math], and more advanced functions like [math]\sin,\cos,\exp,\log[/math], are continuous. However, proving this will take some time. Let us start with:

Theorem

If [math]f,g[/math] are continuous, then so are:

  • [math]f+g[/math].
  • [math]fg[/math].
  • [math]f/g[/math].
  • [math]f\circ g[/math].


Show Proof

Before anything, we should mention that the claim is that (1-4) hold indeed, provided that at the level of domains and ranges, the statement makes sense. For instance in (1,2,3) we are talking about functions having the same domain, and with [math]g(x)\neq0[/math] for the needs of (3), and there is a similar discussion regarding (4).


(1) The claim here is that if both [math]f,g[/math] are continuous at a point [math]x[/math], then so is the sum [math]f+g[/math]. But this is clear from the similar result for sequences, namely:

[[math]] \lim_{n\to\infty}(x_n+y_n)=\lim_{n\to\infty}x_n+\lim_{n\to\infty}y_n [[/math]]


(2) Again, the statement here is similar, and the result follows from:

[[math]] \lim_{n\to\infty}x_ny_n=\lim_{n\to\infty}x_n\lim_{n\to\infty}y_n [[/math]]


(3) Here the claim is that if both [math]f,g[/math] are continuous at [math]x[/math], with [math]g(x)\neq0[/math], then [math]f/g[/math] is continuous at [math]x[/math]. In order to prove this, observe that by continuity, [math]g(x)\neq0[/math] shows that [math]g(y)\neq0[/math] for [math]|x-y|[/math] small enough. Thus we can assume [math]g\neq0[/math], and with this assumption made, the result follows from the similar result for sequences, namely:

[[math]] \lim_{n\to\infty}x_n/y_n=\lim_{n\to\infty}x_n/\lim_{n\to\infty}y_n [[/math]]


(4) Here the claim is that if [math]g[/math] is continuous at [math]x[/math], and [math]f[/math] is continuous at [math]g(x)[/math], then [math]f\circ g[/math] is continuous at [math]x[/math]. But this is clear, coming from:

[[math]] \begin{eqnarray*} x_n\to x &\implies&g(x_n)\to g(x)\\ &\implies&f(g(x_n))\to f(g(x)) \end{eqnarray*} [[/math]]


Alternatively, let us prove this as well by using that scary [math]\varepsilon,\delta[/math] condition given after Definition 2.1. So, let us pick [math]\varepsilon \gt 0[/math]. We want in the end to have something of type [math]|f(g(x))-f(g(y))| \lt \varepsilon[/math], so we must first use that [math]\varepsilon,\delta[/math] condition for the function [math]f[/math]. So, let us start in this way. Since [math]f[/math] is continuous at [math]g(x)[/math], we can find [math]\delta \gt 0[/math] such that:

[[math]] |g(x)-z| \lt \delta\implies|f(g(x))-f(z)| \lt \varepsilon [[/math]]


On the other hand, since [math]g[/math] is continuous at [math]x[/math], we can find [math]\gamma \gt 0[/math] such that:

[[math]] |x-y| \lt \gamma\implies|g(x)-g(y)| \lt \delta [[/math]]


Now by combining the above two inequalities, with [math]z=g(y)[/math], we obtain:

[[math]] |x-y| \lt \gamma\implies|f(g(x))-f(g(y))| \lt \varepsilon [[/math]]


Thus, the composition [math]f\circ g[/math] is continuous at [math]x[/math], as desired.

As a first comment, (3) shows in particular that [math]1/f[/math] is continuous, and we will use this many times, in what follows. As a second comment, more philosophical, the proof of (4) shows that the [math]\varepsilon,\delta[/math] formulation of continuity can be sometimes more complicated than the usual formulation, with sequences, which leads us into the question of why bothering at all with this [math]\varepsilon,\delta[/math] condition. Good question, and in answer:


(1) It is usually said that “for doing advanced math, you must use the [math]\varepsilon,\delta[/math] condition”, but this is not exactly true, because sometimes what happens is that “for doing advanced math, you must use open and closed sets”. With these sets, and the formulation of continuity in terms of them, being something that we will discuss a bit later.


(2) This being said, the point is that the use of open and closed sets, technology that we will discuss in a moment, requires some prior knowledge of the [math]\varepsilon,\delta[/math] condition. So, you cannot really run away from this [math]\varepsilon,\delta[/math] condition, and want it or not, in order to do later some more advanced mathematics, you'll have to get used to that.


(3) But this should be fine, because you're here since you love math and science, aren't you, and good math and science, including this [math]\varepsilon,\delta[/math] condition, will be what you will learn from here. So, everything fine, more on this later, and in the meantime, no matter what we do, always take a few seconds to think at what that means, in [math]\varepsilon,\delta[/math] terms.


Back to work now, at the level of examples, we have:

Theorem

The following functions are continuous:

  • [math]x^n[/math], with [math]n\in\mathbb Z[/math].
  • [math]P/Q[/math], with [math]P,Q\in\mathbb R[X][/math].
  • [math]\sin x[/math], [math]\cos x[/math], [math]\tan x[/math], [math]\cot x[/math].


Show Proof

This is a mixture of trivial and non-trivial results, as follows:


(1) Since [math]f(x)=x[/math] is continuous, by using Theorem 2.2 we obtain the result for exponents [math]n\in\mathbb N[/math], and then for general exponents [math]n\in\mathbb Z[/math] too.


(2) The statement here, which generalizes (1), follows exactly as (1), by using the various findings from Theorem 2.2.


(3) We must first prove here that [math]x_n\to x[/math] implies [math]\sin x_n\to\sin x[/math], which in practice amounts in proving that [math]\sin(x+y)\simeq\sin x[/math] for [math]y[/math] small. But this follows from:

[[math]] \sin(x+y)=\sin x\cos y+\cos x\sin y [[/math]]

To be more precise, let us first establish this formula. In order to do so, consider the following picture, consisting of a length 1 line segment, with angles [math]x,y[/math] drawn on each side, and with everything being completed, and lengths computed, as indicated:

[[math]] \xymatrix@R=15pt@C=70pt{ &\circ\ar@{-}[d]^{\sin x/\cos x}\\ \circ\ar@{-}[ur]^{1/\cos x}\ar@{-}[r]_1\ar@{-}[ddr]_{1/\cos y}&\circ\ar@{-}[dd]^{\sin y/\cos y}\\ \\ &\circ } [[/math]]


Now let us compute the area of the big triangle, or rather the double of that area. We can do this in two ways, either directly, with a formula involving [math]\sin(x+y)[/math], or by using the two small triangles, involving functions of [math]x,y[/math]. We obtain in this way:

[[math]] \frac{1}{\cos x}\cdot\frac{1}{\cos y}\cdot\sin(x+y)=\frac{\sin x}{\cos x}\cdot 1+\frac{\sin y}{\cos y}\cdot 1 [[/math]]


But this gives the formula for [math]\sin(x+y)[/math] claimed above.


(4) Now with this formula in hand, we can establish the continuity of [math]\sin x[/math], as follows, with the limits at 0 which are used being both clear on pictures:

[[math]] \begin{eqnarray*} \lim_{y\to0}\sin(x+y) &=&\lim_{y\to0}\left(\sin x\cos y+\cos x\sin y\right)\\ &=&\sin x\lim_{y\to0}\cos y+\cos x\lim_{y\to0}\sin y\\ &=&\sin x\cdot1+\cos x\cdot0\\ &=&\sin x \end{eqnarray*} [[/math]]

(5) Moving ahead now with [math]\cos x[/math], here the continuity follows from the continuity of [math]\sin x[/math], by using the following formula, which is obvious from definitions:

[[math]] \cos x=\sin\left(\frac{\pi}{2}-x\right) [[/math]]


(6) Alternatively, and let us do this because we will need later the formula, by using the formula for [math]\sin(x+y)[/math] we can deduce a formula for [math]\cos(x+y)[/math], as follows:

[[math]] \begin{eqnarray*} \cos(x+y) &=&\sin\left(\frac{\pi}{2}-x-y\right)\\ &=&\sin\left[\left(\frac{\pi}{2}-x\right)+(-y)\right]\\ &=&\sin\left(\frac{\pi}{2}-x\right)\cos(-y)+\cos\left(\frac{\pi}{2}-x\right)\sin(-y)\\ &=&\cos x\cos y-\sin x\sin y \end{eqnarray*} [[/math]]


But with this, we can use the same method as in (4), and we get, as desired:

[[math]] \begin{eqnarray*} \lim_{y\to0}\cos(x+y) &=&\lim_{y\to0}\left(\cos x\cos y-\sin x\sin y\right)\\ &=&\cos x\lim_{y\to0}\cos y-\sin x\lim_{y\to0}\sin y\\ &=&\cos x\cdot1-\sin x\cdot0\\ &=&\cos x \end{eqnarray*} [[/math]]

(7) Finally, the fact that [math]\tan x[/math], [math]\cot x[/math] are continuous is clear from the fact that [math]\sin x[/math], [math]\cos x[/math] are continuous, by using the result regarding quotients from Theorem 2.2.

We will be back to more examples later, and in particular to functions of type [math]x^a[/math] and [math]a^x[/math] with [math]a\in\mathbb R[/math], which are more tricky to define. Also, we will talk as well about inverse functions [math]f^{-1}[/math], with as particular cases the basic inverse trigonometric functions, namely [math]\arcsin[/math], [math]\arccos[/math], [math]\arctan[/math], [math]{\rm arccot}[/math], once we will have more tools for dealing with them.


Going ahead with more theory, some functions are “obviously” continuous:

Proposition

If a function [math]f:X\to\mathbb R[/math] has the Lipschitz property

[[math]] |f(x)-f(y)|\leq K|x-y| [[/math]]
for some [math]K \gt 0[/math], then it is continuous.


Show Proof

This is indeed clear from our definition of continuity.

Along the same lines, we can also argue, based on our intuition, that “some functions are more continuous than other”. For instance, we have the following definition:

Definition

A function [math]f:X\to\mathbb R[/math] is called uniformly continuous when:

[[math]] \forall\varepsilon \gt 0,\exists\delta \gt 0,|x-y| \lt \delta\implies|f(x)-f(y)| \lt \varepsilon [[/math]]
That is, [math]f[/math] must be continuous at any [math]x\in X[/math], with the continuity being “uniform”.

As basic examples of uniformly continuous functions, we have the Lipschitz ones. Also, as a basic counterexample, we have the following function:

[[math]] f:\mathbb R\to\mathbb R\quad,\quad f(x)=x^2 [[/math]]


Indeed, it is clear by looking at the graph of [math]f[/math] that, the further our point [math]x\in\mathbb R[/math] is from [math]0[/math], the smaller our [math]\delta \gt 0[/math] must be, compared to [math]\varepsilon \gt 0[/math], in our [math]\varepsilon,\delta[/math] definition of continuity. Thus, given an [math]\varepsilon \gt 0[/math], we have no [math]\delta \gt 0[/math] doing the [math]|x-y| \lt \delta\implies|f(x)-f(y)| \lt \varepsilon[/math] job at any [math]x\in\mathbb R[/math], and so our function is indeed not uniformly continuous.


Quite remarkably, we have the following theorem, due to Heine and Cantor:

Theorem

Any continuous function defined on a closed, bounded interval

[[math]] f:[a,b]\to\mathbb R [[/math]]
is automatically uniformly continuous.


Show Proof

This is something quite subtle, and we are punching here a bit above our weight, but here is the proof, with everything or almost included:


(1) Given [math]\varepsilon \gt 0[/math], for any [math]x\in[a,b][/math] we know that we have a [math]\delta_x \gt 0[/math] such that:

[[math]] |x-y| \lt \delta_x\implies|f(x)-f(y)| \lt \frac{\varepsilon}{2} [[/math]]


So, consider the following open intervals, centered at the various points [math]x\in[a,b][/math]:

[[math]] U_x=\left(x-\frac{\delta_x}{2}\,,\,x+\frac{\delta_x}{2}\right) [[/math]]


These intervals then obviously cover [math][a,b][/math], in the sense that we have:

[[math]] [a,b]\subset\bigcup_{x\in[a,b]}U_x [[/math]]


Now assume that we managed to prove that this cover has a finite subcover. Then we can most likely choose our [math]\delta \gt 0[/math] to be the smallest of the [math]\delta_x \gt 0[/math] involved, or perhaps half of that, and then get our uniform continuity condition, via the triangle inequality.


(2) So, let us prove first that the cover in (1) has a finite subcover. For this purpose, we proceed by contradiction. So, assume that [math][a,b][/math] has no finite subcover, and let us cut this interval in half. Then one of the halves must have no finite subcover either, and we can repeat the procedure, by cutting this smaller interval in half. And so on. But this leads to a contradiction, because the limiting point [math]x\in[a,b][/math] that we obtain in this way, as the intersection of these smaller and smaller intervals, must be covered by something, and so one of these small intervals leading to it must be covered too, contradiction.


(3) With this done, we are ready to finish, as announced in (1). Indeed, let us denote by [math][a,b]\subset\bigcup_iU_{x_i}[/math] the finite subcover found in (2), and let us set:

[[math]] \delta=\min_i\frac{\delta_{x_i}}{2} [[/math]]


Now assume [math]|x-y| \lt \delta[/math], and pick [math]i[/math] such that [math]x\in U_{x_i}[/math]. By the triangle inequality we have then [math]|x_i-y| \lt \delta_{x_i}[/math], which shows that we have [math]y\in U_{x_i}[/math] as well. But by applying now [math]f[/math], this gives as desired [math]|f(x)-f(y)| \lt \varepsilon[/math], again via the triangle inequality.

General references

Banica, Teo (2024). "Calculus and applications". arXiv:2401.00911 [math.CO].