13 Definition
Highlights of this Chapter: we briefly explore the evolution of the modern conception of a function, and give foundational definitions for reference.
While sequences may be the main tool of real analysis, functions are its main object of study. The term function was first introduced to mathematics by Leibniz during his development of the Calculus in the 1670s (he also introduced the idea of parameters and constants familiar in calculus courses to this day). In the first centuries of its mathematical life, the term function usually denoted what we would think of today as a formula or algebraic expression. For example, Euler’s definition of function from his 1748 book Introductio in analysin infinitorum embodies the sentiment:
A function of a variable quantity is an analytic expression composed in any way whatsoever of the variable quantity and numbers or constant quantities.
As a first step to adding functions to our theory of real analysis, we would somehow like to make this definition rigorous. But upon closer inspection, this concept, of “something expressible by a (single) analytic expression” is actually logically incoherent! For example, say that we decide, after looking at the definition of \(|x|\), that it cannot be a function as it is not expressed as a single formula:
\[|x|=\begin{cases} -x & x\leq 0 \\ x & x>0 \end{cases} \]
But we also agree that \(x^2\) and \(\sqrt{x}\) are both (obviously!) functions as they are given by nice algebraic expressions. What are we then to make of the fact that for all real numbers \(x\),
\[\sqrt{x^2}=|x|\]
It seems we have found a perfectly good “single algebraic expression” for the absolute value after all! This even happens for functions with infinitely many pieces (which surely would have been horrible back then) \[f(x)=\begin{cases} \vdots &\vdots\\ 3+\sin(x) & x\in(0,\pi]\\ 1+\sin(x) & x\in(\pi,2\pi]\\ 3+\sin(x) & x\in(2\pi,3\pi]\\ \vdots &\vdots \end{cases} \]
This can be written as a composition involving just one piecewise function \[f(x)=|1+\sin x|+2\]
Which can, by the earlier trick, be reduced to a function with no “pieces” at all:
\[f(x)=2+\sqrt{1+2\sin(x)+\sin^2(x)}\]
So the idea of “different pieces” or different rules, seemingly so clear to us, is not a good mathematical notion at all! We are forced by logic to include such things, whether we aimed to or not. This became clear rather quickly, as even Euler had altered a bit his notion of functions by 1755:
When certain quantities depend on others in such a way that they undergo a change when the latter change, then the first are called functions of the second. This name has an extremely broad character; it encompasses all the ways in which one quantity can be determined in terms of others.
The modern approach is to be much more open minded about functions, and define a function as any rule whatsoever which uniquely specifies an output given an input. This seems to have first been clearly articulated by Lobachevsky (of hyperbolic geometry fame) in 1834, and independently by Dirichlet in 1837
The general concept of a function requires that a function of x be defined as a number given for each x and varying gradually with x. The value of the function can be given either by an analytic expression, or by a condition that provides a means of examining all numbers and choosing one of them; or finally the dependence may exist but remain unknown. (Lobachevsky)
If now a unique finite \(y\) corresponding to each \(x\), and moreover in such a way that when \(x\) ranges continuously over the interval from \(a\)$ to \(b\), \(y=f(x)\) also varies continuously, then \(y\) is called a continuous function of x for this interval. It is not at all necessary here that \(y\) be given in terms of \(x\) by one and the same law throughout the entire interval, and it is not necessary that it be regarded as a dependence expressed using mathematical operations. (Dirichlet)
13.1 Definition and Examples
Through this definitions added generality comes simplicity: we are not trying to poliece what sort of rules can be used to define a function, and so the notion can be efficiently captured in the language of sets and logic.
Definition 13.1 A function from a set \(X\) to a set \(Y\) is an assignment to each element of \(X\) a unique element of \(Y\). If we call the function \(f\), we write the unique element of \(Y\) assigned to \(x\in X\) as \(y=f(x)\), and the entire function as \[f\colon X\to Y\]
The definition of a function comes with three parts, so its good to have precise names for all of these.
Definition 13.2 If \(f\) is a function, its input set \(X\) is called the domain, and the set of possible outputs \(Y\) is called the codomain. The set of actual outputs, that is \(R=\{f(x)\mid x\in X\}\) is called the range.
If the codomain of a function \(f\) is the real numbers, we call \(f\) a real-valued function. We will be most interested in real valued function throughout this course.
Now, because the definition itself is conspicuously quiet on what a function looks like, it’s good to start ourselves off (as usual) with a collection of examples and non-examples. First, an example
Example 13.1 (\(y=x^2\) is a function) The assignment taking every real number \(x\) to the real number \(x^2\) is a function: for every input, there is exactly one output. We write this \(f(x)=x^2\), and note the domain and codomain are \(\RR\), and the range is just the nonnegative reals.
This example comes with a formula, much like Euler had hoped for: it tells us exactly what to do with our input to get the output - multiply it by itself! This example immediately generalizes to a whole host of functions-defined-by-formulas, by using the field operations of \(\pm\) and \(\times\):
Example 13.2 (Polynomial Functions) A polynomial function is an assignment \(p\colon \RR\to\RR\) which takes each \(x\) to a linear combination of powers of \(x\): \[p(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots a_1x+a_0\] The highest power of \(x\) appearing in \(p\) is called the degree of the polynomial.
The idea of a function defined by a formula can be extended even farther by allowing the field operation of division; though this time we must be careful about the inputs.
Example 13.3 (Rational Functions) A rational function is a an assignment \[f(x)=\frac{p(x)}{q(x)}\] where \(p\) and \(q\) are polynomials. Rational functions are real-valued, but their domain is not all of \(\RR\): at any zero of \(q\) the formula above is undefined, a rational function is only defined on the set of points where \(q\) is nonzero.
We already saw that piecewise formulas count in our modern definition, but perhaps didn’t fully think through the implications: they can be very, very piecewise
Example 13.4 (The Characteristic Function of \(\QQ\)) The function \(f\colon\RR\to\RR\) defined as follows \[f(x)=\begin{cases}1 & x\in\QQ \\ 0& x\not\in\QQ\end{cases} \]
Here’s another monstrous piecewise function we will encounter again soon:
Example 13.5 (Thomae’s Function) This is the function \(\tau\colon\RR\to\RR\) defined by
\[ \tau(x)=\begin{cases} \frac{1}{q} & x\in\QQ\textrm{ and }\frac{p}{q}\textrm{ is lowest terms.}\\ 0 &x\not\in\QQ \end{cases} \]
We’ve stressed that functions don’t need to be given by explicit formulas, so we should give an example of that: here’s a function that is defined at each point as a different limit (using the completeness axiom)
Example 13.6 The exponential function may be defined for each \(x\in\RR\) by the following limit \[\exp(x)=\lim_{n\to\infty} a_n\] Where \(a_n\) is the recursive sequence \(a_0=1\), \(a_{n}=a_{n-1}+\frac{x^n}{n!}\).
A function can also be defined by an existence proof telling us that a certain relationship determines a function, without giving us any hint on how to compute its value:
Example 13.7 (\(\sqrt{\cdot}\) defined by an existence theorem) We proved that for every \(x\geq 0\) that there exists some number \(y>0\) with \(y^2=x\), back in our original study of completeness (Theorem 6.9).
We can easily see that such a number is unique: if \(y_1\neq y_2\) then by the order axioms one is greater: without loss of generality \(0<y_1<y_2\). Thus \(y_1^2<y_2^2\), so we can’t have both \(y_1^2=x\) and \(y_2^2=x\), and \(x\to y=\sqrt{x}\) is a function.
Alright - that’s plenty of examples to get ourselves in the right mindset. Let’s give a non-example, to remind us that while there need not be formulas, the modern notion of function is not ‘anything goes’!
Example 13.8 The assignment taking an integer to one of its prime factors does not define a function. This would take the integer \(6\) to both \(2\) and \(3\), and part of the definition of a function is that the output is unique for a given input.
13.2 Composition and Inverses
Likely familiar from previous math classes, but it is good to get rigorous definitions down on paper when we are starting anew.
Definition 13.3 (Composition) If \(f\colon X\to Y\) and \(g\colon Y\to Z\) then we may use \(f\) to send an element of \(X\) into \(Y\), and follow it by \(g\) to get an element of \(Z\). The result is a function from \(X\) to \(Z\), known as the composition \[g\circ f\colon X\to Z\hspace{1cm} g\circ f(x):=g(f(x))\]
Every set has a particularly simple function defined on it known as the identity function: \(\mathrm{id}_X\colon X\to X\) is the function that takes each element \(x\in X\) and does nothing: \(\mathrm{id}_X(x)=x\). These play a role in concisely defining inverse functions below:
Definition 13.4 (Inverse Functions) If \(f\colon X\to Y\) is a function, and \(g\colon Y\to X\) is another function such that \[g\circ f = \mathrm{id}_X\hspace{1cm}f\circ g = \mathrm{id}_Y\] Then \(f\) and \(g\) are called inverse functions of one another, and we write \(g=f^{-1}\) if we wish to think of \(g\) as inverting \(f\), or \(f=g^{-1}\) rather we started with \(g\), and think of \(f\) as undoing it.
Example 13.9 The function \(f(x)=2x\) and \(g(x)=x/2\) are inverses of one another as functions \(\RR\to\RR\).
The squaring function \(s\colon \RR\to\RR\) defined by \(s(x)=x^2\) has the square root as an inverse, only if the domain and codomain are restricted to the nonnegative reals. Otherwise, we see that \(s(-2)=4\) and \(\sqrt{4}=2\) so \(\sqrt{}\circ s\) is not the identity: it takes \(-2\) to \(2\)!
13.3 Increasing, Decreasing & Convexity
Finally we end our introductory march through definitions with several that make sense for functions on ordered fields, but not necessarily for general functions.
Definition 13.5 (Increasing Functions) A function \(f\colon\RR\to\RR\) is increasing if whenever \(x<y\), it follows that \(f(x)\leq f(y)\). A function is strictly increasing if this inequality is strict (\(<\)).
Definition 13.6 (Decreasing Functions) A function \(f\colon\RR\to\RR\) is decreasing if whenever \(x<y\), it follows that \(f(x)\geq f(y)\). A function is strictly increasing if this inequality is strict (\(>\)).
Definition 13.7 (Monotone) A function is monotone if it is either increasing or decreasing.
Definition 13.8 (Convexity) Let \(f\) be a function defined on some interval (possibly all of \(\RR\)). Then \(f\) is convex if for any interval \([x,y]\subset\mathrm{dom}f\), the value of \(f\) at the midpoint exceeds the average value of \(f\) at the endpoints: \[\forall x,y\hspace{0.5cm}f\left(\frac{x+y}{2}\right)\geq \frac{f(x)+f(y)}{2}\]
Exercise 13.1 Prove that if \(f\) is convex then for any \(x,y\) in the domain, the the secant line connecting \(f(x)\) to \(f(y)\) lies above the graph of \(f\).
Hint: the equation of secant line is \(L(t)=tf(x)+(1-t)f(y)\): so need to show \(L(t)\geq f(t)\).
Proposition 13.1 If \(f\) is a convex function and \(a\in\RR\) Then for \(x<a\) the function \[\ell(x)=\frac{f(x)-f(a)}{x-a}\] is monotone increasing.
Proof.
The same is true for \(x>a\): on this domain the difference quotient also defines a monotone increasing function (so, its monotone decreasing when going “backwards” towards \(a\)).
13.4 \(\bigstar\) Functions of a Real Variable
Our main concern in this class will be real valued functions of a real variable, meaning the input and output are both real numbers.
However the theory of real analysis allows one easy generalization of this: we can consider functions of more complicated outputs so long as we can understand what convergence means in the range.
For example: the complex numbers \(\CC\) are pairs of real numbers, functions \(f\colon\RR\to\CC\) are just pairs of real valued functions. We can define convergence for complex numbers to mean that each component converges (as a real sequence), and then discuss continuity of a complex-valued function
Even more generally, we could look at vector valued functions or even matrix valued functions of a real variable, if we define convergence component-wise.
So, functions of a more complicated range can be easily incorporated into our theory. Its only when the domain gets more complicated that analysis needs a real extension: to complex analysis, or multivariate calculus. We will not discuss these topics in this course.