5  Functions

Highlights of this Chapter: we briefly explore the evolution of the modern conception of a function, and give foundational definitions for reference.

5.1 Freedom from Formulas

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|={xx0xx>0

But we also agree that x2 and 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,

x2=|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)={3+sin(x)x(0,π]1+sin(x)x(π,2π]3+sin(x)x(2π,3π]

This can be written as a composition involving just one piecewise function f(x)=|1+sinx|+2

Which can, by the earlier trick, be reduced to a function with no “pieces” at all:

f(x)=2+1+2sin(x)+sin2(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)

Through this definitions added generality comes simplicity: we are not trying to police 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 5.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 xX as y=f(x), and the entire function as f:XY

The definition of a function comes with three parts, so its good to have precise names for all of these.

Definition 5.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)xX} 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.

5.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 5.3 (Composition) If f:XY and g:YZ 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 gf:XZgf(x):=g(f(x))

Every set has a particularly simple function defined on it known as the identity function: idX:XX is the function that takes each element xX and does nothing: idX(x)=x. These play a role in concisely defining inverse functions below:

Definition 5.4 (Inverse Functions) If f:XY is a function, and g:YX is another function such that gf=idXfg=idY Then f and g are called inverse functions of one another, and we write g=f1 if we wish to think of g as inverting f, or f=g1 rather we started with g, and think of f as undoing it.

Example 5.1 The function f(x)=2x and g(x)=x/2 are inverses of one another as functions RR.

The squaring function s:RR defined by s(x)=x2 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 4=2 so s is not the identity: it takes 2 to 2!

5.3 Useful Terminology

Definition 5.5 (Restricting the Domain) Given a function f with domain D, the restriction to a subset SD is denoted f|S.

Definition 5.6 Given a function with a domain D, an extension of f to a set XD is a function f~:XR such that f~|D=f.

Definition 5.7 (Increasing / Decreasing) A function f is (monotone) increasing if for all xy we have f(x)f(y). It’s monotone decreasing if instead xy implies f(x)f(y). A function is strictly increasing if x<y impleis f(x)<f(y), and analogously for strictly decreasing.

Exercise 5.1 If f is a strictly increasing function, then it is one-to-one: every output y is achieved by a unique input x.

This exercise implies that strict monotone functions are invertible, as the inverse of any one-to-one function is defined by sending a given y to the unique x that maps to it.

Definition 5.8 (Convexity) Let f be a function defined on some interval (possibly all of R). Then f is convex if for any interval [x,y]domf, the value of f at the midpoint exceeds the average value of f at the endpoints: x,yf(x+y2)f(x)+f(y)2

A function f is said to be monotone or convex (etc) on a set S if the restriction of f to S is monotone / convex.

Definition 5.9 (Local Extrema)  

  • Increasing Decreasing
  • Convex
  • Local Extrema

5.4 A Zoo of Examples

Example 5.2 (Polynomial Functions) A polynomial function is an assignment p:RR which takes each x to a linear combination of powers of x: p(x)=anxn+an1xn1+a1x+a0 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 5.3 (Rational Functions) A rational function is a an assignment f(x)=p(x)q(x) where p and q are polynomials. Rational functions are real-valued, but their domain is not all of R: 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 5.4 (The Characteristic Function of Q) The function f:RR defined as follows f(x)={1xQ0xQ

Here’s another monstrous piecewise function we will encounter again soon:

Example 5.5 (Thomae’s Function) This is the function τ:RR defined by

τ(x)={1qxQ and pq is lowest terms.0xQ

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 5.6 A function may be defined for each xR as the limit of a sequence, such as E(x)=limnk=0nxkk!

A function can also be defined by a less explicit limit procedure, like the limits defining powers: where we’ve previously seen that any sequence rnx of rationals converging to x produces the same limiting value of arn.

Example 5.7 (Exponential as Powers) For any xR and a0 the function f(x)=ax is defined by ax=limnarn for rn a sequence of rational numbers converging to x.

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 5.8 ( defined by an existence theorem) We proved that for every x0 that there exists some number y>0 with y2=x, back in our original study of completeness ().

We can easily see that such a number is unique: if y1y2 then by the order axioms one is greater: without loss of generality 0<y1<y2. Thus y12<y22, so we can’t have both y12=x and y22=x, and xy=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 5.9 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.

Exercise 5.2 (Invertibility implies Monotonicity) Let f be an invertible function. Prove that f is (strictly) monotone increasing, or (strictly) monotone decreasing.