provides reasonable approximations to the function near zero: for example, with we get
The quality of approximation not being spectacular, one can try to improve it by using rational functions instead of polynomials. In view of the identity
one can get with . The improvement is substantial for negative :
Having rational approximation of the form makes perfect sense, because such approximants obey the same functional equation as the exponential function itself. We cannot hope to satisfy other functional equations like by functions simpler than .
However, the polynomial is not optimal for approximation except for . For degree , the optimal choice is . In the same plot window as above, the graph of is indistinguishable from .
This is a Padé approximant to the exponential function. One way to obtain such approximants is to replace the Taylor series with continued fraction, using long division:
Terminating the expansion after an even number of apprearances gives a Padé approximant of the above form.
This can be compared to replacing the decimal expansion of number :
with the continued fraction expansion
which, besides greater accuracy, has a regular pattern: 121 141 161 181 …
The numerators of the (diagonal) Padé approximants to the exponential function happen to have a closed form:
which shows that for every fixed , the coefficient of converges to as . The latter is precisely the Taylor coefficient of .
In practice, a recurrence relation is probably the easiest way to get these numerators: begin with and , and after that use . This relation can be derived from the recurrence relations for the convergents of a generalized continued fraction . Namely, and . Only the first relation is actually needed here.
Using the recurrence relation, we get
(so, not all coefficients have numerator 1…)
The quality of approximation to is best seen on logarithmic scale: i.e., how close is to ? Here is this comparison using .
For comparison, the Taylor polynomial of fifth degree, also on logarithmic scale: where .
The standard normal probability density function has inflection points at where which is about 60.5% of the maximum of this function. For this, as for other bell-shaped curves, the inflection points are also the points of steepest incline.
This is good to know for drawing an accurate sketch of this function, but in general, the Gaussian curve may be scaled differently, like , and then the inflection points will be elsewhere. However, their relative height is invariant under scaling: it is always 60.5% of the maximum height of the curve. Since it is the height that we focus on, let us normalize various bell-shaped curves to have maximum :
So, the Gaussian curve is inflected at the relative height of . For the Cauchy density the inflection is noticeably higher, at of the maximum:
Another popular bell shape, hyperbolic secant or simply , is in between with inflection height . It is slightly unexpected to see an algebraic number arising from this transcendental function.
Can we get inflection height below ? One candidate is with large even , but this does not work: the relative height of inflection is . Shown here for :
However, increasing the power of in the Gaussian curve works: for example, has inflection at relative height :
More generally, the relative height of inflection for is for even . As , this approaches . Can we go lower?
Well, there are compactly supported bump functions which look bell-shaped, for example for . Normalizing the height to makes it . For this function inflection occurs at relative height about .
Once again, we can replace by an arbitrary positive even integer and get relative inflection height down to . As increases, this height decreases to where is the golden ratio. This is less than which is low enough for me today. The smallest for which the height is less than is : it achieves inflection at .
In the opposite direction, it is easy to produce bell-shaped curve with high inflection points: either or will do, where is slightly larger than . But these examples are only once differentiable, unlike the infinitely smooth examples above. Aside: as , the latter function converges to the (rescaled) density of the Laplace distribution and the former to a non-integrable function.
As for the middle between two extremes… I did not find a reasonable bell-shaped curve that inflects at exactly half of its maximal height. An artificial example is with but this is ugly and only smooth.
The algebraic connectivity of a graph is its smallest nontrivial Laplacian eigenvalue. Equivalently, it is the minimum of edge sums over all functions normalized by and . Here are vertex/edge sets, and means the difference of the values of at the vertices of the edge .
It is clear from the definition that adding edges to cannot make smaller; thus, among all graphs on vertices the maximal value of is attained by the complete graph, for which . For any other graph which can be shown as follows. Pick two non-adjacent vertices and and let , , and elsewhere. This function is normalized as required above, and its edge sum is at most since there are at most edges with a nonzero contribution.
What if we require the graph to have degree vertex at most , and look for maximal connectivity then? First of all, only connected graphs are under consideration, since for non-connected graphs. Also, only the cases are of interest, otherwise the complete graph wins. The argument in the previous paragraph shows that but is this bound attained?
The case is boring: the only two connected graphs are the path and the cycle . The cycle wins with versus .
When , one might suspect a pattern based on the following winners:
The structure of these two is the same: place points on a circle, connect each of them to nearest neighbors.
But this pattern does not continue: the 8-vertex winner is completely different.
This is simply the complete bipartite graph . And it makes sense that the “4 neighbors” graph loses when the number of vertices is large: there is too much “redundancy” among its edges, many of which connect the vertices that were already connected by short paths.
In general, when , the complete bipartite graph achieves and therefore maximizes the algebraic connectivity. The fact that follows by considering graph complement, as discussed in Laplacian spectrum of small graphs. The complement of is the disjoint union of two copies of the complete graph , for which the maximal eigenvalue is . Hence .
When is odd, we have a natural candidate in for which the argument from the previous paragraph shows . This is indeed a winner when :
The winner is not unique since one can add another edge between two of the vertices of degree 2. This does not change the , however: there is a fundamental eigenfunction that has equal values at the vertices of that added edge.
Same for : the complete bipartite graph shares the maximum value of algebraic connectivity with two other graphs formed by adding edges to it:
However, the family does not win the case in general: we already saw a 4-regular graph on 7 vertices with , beating . Perhaps wins when is odd?
I do not have any other patterns to conjecture, but here are two winners for : the cube and the “twisted cube”.
The cube is twisted by replacing a pair of edges on the top face with the diagonals. This is still a 3-regular graph and the algebraic connectivity stays the same, but it is no longer bipartite: a 5-cycle appears.
There is a useful sequential characterization of continuity in metric spaces. Let be a map between metric spaces. If for every convergent sequence in we have in , then is continuous. And the converse is true as well.
Uniformly continuous functions also have a useful property related to sequences: if is uniformly continuous and is a Cauchy sequence in , then is a Cauchy sequence in . However, this property does not characterize uniform continuity. For example, if , then Cauchy sequences are the same as convergent sequences, and therefore any continuous function preserves the Cauchy-ness of sequences—it does not have to be uniformly continuous.
Let us say that two sequences and are equivalent if the distance from to tends to zero. The sequential characterization of uniform continuity is: is uniformly continuous if and only if for any two equivalent sequences and in , their images and are equivalent in . The proof of this claim is straightforward.
In the special case when is a constant sequence, the sequential characterization of uniform continuity reduces to the sequential characterization of continuity.
A typical example of the use of this characterization is the proof that a continuous function on a compact set is uniformly continuous: pick two equivalent sequences with non-equivalent images, pass to suitable subsequences, get a contradiction with continuity.
Here is a different example. To state it, introduce the notation .
Removability Theorem. Let be continuous. Suppose that there exists such that for every , the restriction of to is uniformly continuous. Then is uniformly continuous on .
This is a removability result because from having a certain property on subsets of we get it on all of . To demonstrate its use, let with the standard metric, , and . The uniform continuity of on follows immediately from the derivative being bounded on that set (so, is Lipschitz continuous there). By the removability theorem, is uniformly continuous on .
Before proving the theorem, let us restate the sequential characterization in an equivalent form (up to passing to subsequences): is uniformly continuous if and only if for any two equivalent sequences and there exist equivalent subsequences and , with the same choice of indices in both.
Proof of the theorem. Suppose and are equivalent sequences in . If , then as well, and the continuity of at implies that both and converge to , hence are equivalent sequences. If , then by passing to a subsequence we can achieve for some constant . By the triangle inequality, for sufficiently large we have . Since is uniformly continuous on , it follows that and are equivalent.
Consider this linear differential equation: with boundary conditions and . Nothing looks particularly scary here. Just one nonconstant coefficient, and it’s a simple one. Entering this problem into Wolfram Alpha produces the following explicit solution:
I am not sure how anyone could use this formula for any purpose.
Let us see what simple linear algebra can do here. The differential equation can be discretized by placing, for example, equally spaces interior grid points on the interval: , . The yet-unknown values of at these points are denoted . Standard finite-difference formulas provide approximate values of and :
where is the step size, in our case. Stick all this into the equation: we get 4 linear equations, one for each interior point. Namely, at it is
(notice how the condition is used above), at it is
and so on. Clean up this system and put it in matrix form:
This isn’t too hard to solve even with pencil and paper. The solution is
It can be visualized by plotting 4 points :
Not particularly impressive is it? And why are all these negative y-values in a problem with boundary condition ? They do not really look like they want to approach at the left end of the interval. But let us go ahead and plot them together with the boundary conditions, using linear interpolation in between:
Or better, use cubic spline interpolation, which only adds another step of linear algebra (see Connecting dots naturally) to our computations.
This begins to look believable. For comparison, I used a heavier tool: BVP solver from SciPy. Its output is the red curve below.
Those four points we got from a 4-by-4 system, solvable by hand, pretty much tell the whole story. At any rate, they tell a better story than the explicit solution does.
Graphics made with: SciPy and Matplotlib using Google Colab.
A natural way to measure the nonlinearity of a function , where is an interval, is the quantity which expresses the deviation of from a line, divided by the size of interval . This quantity was considered in Measuring nonlinearity and reducing it.
Let us write where the supremum is taken over all intervals in the domain of definition of . What functions have finite ? Every Lipschitz function does, as was noted previously: . But the converse is not true: for example, is finite for the non-Lipschitz function , where .
The function looks nice, but is clearly unbounded. What makes finite? Note the scale-invariant feature of NL: for any the scaled function satisfies , and more precisely . On the other hand, our function has a curious scaling property where the linear term does not affect NL at all. This means that it suffices to bound for intervals of unit length. The plot of shows that not much deviation from the secant line happens on such intervals, so I will not bother with estimates.
The class of functions with is precisely the Zygmund class defined by the property with independent of . Indeed, since the second-order difference is unchanged by adding an affine function to , we can replace by with suitable and use the triangle inequality to obtain
where . Conversely, suppose that . Given an interval , subtract an affine function from to ensure . We may assume attains its maximum on at a point . Applying the definition of with and , we get , hence . This shows . The upshot is that is equivalent to the Zygmund seminorm of (i.e., the smallest possible M in the definition of ).
A function in may be nowhere differentiable: it is not difficult to construct so that is bounded between two positive constants. The situation is different for the small Zygmund class whose definition requires that as . A function is differentiable at any point of local extremum, since the condition forces its graph to be tangent to the horizontal line through the point of extremum. Given any two points we can subtract the secant line from and thus create a point of local extremum between and . It follows that is differentiable on a dense set of points.
The definitions of and apply equally well to complex-valued functions, or vector-valued functions. But there is a notable difference in the differentiability properties: a complex-valued function of class may be nowhere differentiable [Ullrich, 1993]. Put another way, two real-valued functions in need not have a common point of differentiability. This sort of thing does not often happen in analysis, where the existence of points of “good” behavior is usually based on the prevalence of such points in some sense, and therefore a finite collection of functions is expected to have common points of good behavior.
The key lemma in Ullrich’s paper provides a real-valued VMO function that has infinite limit at every point of a given set of measure zero. Although this is a result of real analysis, the proof is complex-analytic in nature and involves a conformal mapping. It would be interesting to see a “real” proof of this lemma. Since the antiderivative of a VMO function belongs to , the lemma yields a function that is not differentiable at any point of . Consider the lacunary series . One theorem of Zygmund shows that when , while another shows that is almost nowhere differentiable when . It remains to apply the lemma to get a function that is not differentiable at any point where is differentiable.
We know that every bounded sequence of real numbers has a convergent subsequence. For a sequence of functions, say , the notion of boundedness can be stated as: there exists a constant such that for every and for all . Such a sequence is called uniformly bounded.
Once we fix some point , the boundedness assumption provides a subsequence which converges at that point. But since different points may require different subsequences, it is not obvious whether we can pick a subsequence which converges for all . (Such a subsequence is called pointwise convergent.)
It is easy to give an example of a uniformly bounded sequence with no uniformly convergent subsequence (uniform convergence requires , which is stronger than for every ). Indeed, does the job. This sequence is uniformly bounded (by ) and converges pointwise to a discontinuous function such that and elsewhere. Any subsequence has the same pointwise limit and since is not continuous, the convergence cannot be uniform.
But what would be an example of a uniformly bounded sequence of continuous functions with no pointwise convergent subsequence? In Principles of Mathematical Analysis Rudin gives as such an example but then uses the Lebesgue Dominated Convergence Theorem to prove the non-existence of pointwise convergent subsequences. I do not want to use the DCT.
The simplest example I could think of is based on the letter-folding function defined by
or by a magic one-line formula if you prefer: .
Let be the sequence of the iterates of , that is and . This means , , , and so on.
By construction, the sequence is uniformly bounded (). It is somewhat similar to the example in that we have increasingly rapid oscillations. But the proof that has no pointwise convergent subsequence is elementary. It is based on the following observations.
(A) Suppose that is a sequence such that for each . Then the number satisfies if and if .
The proof of (A) amounts to summing a geometric series. Incidentally, observe that are the digits of in base .
(B) For as above we have . In other words, shifts the ternary digits of to the left. As a consequence, shifts them to the left by places.
(C) Given any subsequence , let if for some , and otherwise. By part (B), which means the first ternary digit of is . By construction, this digit is when is even, and when is odd. By part (A) we have when is even, and when is odd. Thus, does not converge. This completes the proof.
The set of all points of the form considered in (A), (B), (C), i.e., those with all ternary digits or , is precisely the standard Cantor set .
The function magnifies each half of by the factor of , and maps it onto .
The important part of the formula for is that when . The rest of it could be some other continuous extension to .
A similar example could be based on the tent map , whose graph is shown below.
However, in case of the tent map it is more convenient to use the sequence of even iterates: , , and so on.
Indeed, since when , one can simply replace base with base in all of the above computations and arrive at the same conclusion, except the orbit of will now be jumping between the intervals and .
The tent map is conjugate to the logistic map , shown below. This conjugacy is where .
The conjugacy shows that the th iterate is . Therefore, the sequence of the even iterates of has no pointwise convergent subsequence. This provides an example with smooth functions, even polynomials.
One could use the sequence of all iterates (not just the even ones) in the constructions based on and , it just takes a bit of extra work that I prefer to avoid.
This is a brief return to the topic of Irrational Sunflowers. The sunflower associated with a real number is the set of points with polar coordinates and , . A sunflower reduces to equally spaced rays if and only if is a rational number written in lowest terms as .
Here is the sunflower of of size .
Seven rays emanate from the center because , then they become spirals, and spirals rearrange themselves into 113 rays because . Counting these rays is boring, so here is a way to do this automatically with Python (+NumPy as np):
a = np.pi
n = 5000
x = np.mod(a*np.arange(n, 2*n), 1)
np.sum(np.diff(np.sort(x)) > 1/n)
This code computes the polar angles of sunflower points indexed , sorts them and counts the relatively large gaps between the sorted values. These correspond to the gaps between sunflower rays, except that one of the gaps gets lost when the circle is cut and straightened onto the interval . So the program output (112) means there are 113 rays.
Here is the same sunflower with the points alternatively colored red and blue.
The colors blur into purple when the rational approximation pattern is strong. But they are clearly seen in the transitional period from 22/7 approximation to 355/113.
How many points would we need to see the next rational approximation after 355/113?
What will that approximation be? Yes, 22/7 and 355/113 and among the convergent of the continued fraction of . But so is 333/106 which I do not see in the sunflower. Are some convergents better than others?
Finally, the code I used to plot sunflowers.
import numpy as np
import matplotlib.pyplot as plt
a = np.pi
k = np.arange(10000)
r = np.sqrt(k)
t = a*2*np.pi*k
plt.plot(r*np.cos(t), r*np.sin(t), '.')
Calculus books tend to introduce transcendental functions (trigonometric, exponential, logarithm) early. Analysis textbooks such as Principles of Mathematical Analysis by Rudin tend to introduce them later, because of how long it takes to develop enough of the theory of power series.
The Riemann-Lebesgue lemma involves either trigonometric or exponential functions. But the following version works with the “late transcendentals” approach.
Transcendental-free Riemann-Lebesgue Lemma
TFRLL. Suppose that and are continuously differentiable functions, and is bounded. Then as .
The familiar form of the lemma is recovered by letting or .
Proof. By the chain rule, is the derivative of . Integrate by parts:
By assumption, there exists a constant such that everywhere. Hence , , and . By the triangle inequality,
completing the proof.
As a non-standard example, TFRLL applies to, say, for which . The conclusion is that , that is, which seems somewhat interesting. When , the factor of can be removed by applying the result to , leading to .
What if we tried less smoothness?
Later in Rudin’s book we encounter the Weierstrass theorem: every continuous function on is a uniform limit of polynomials. Normally, this would be used to make the Riemann-Lebesgue lemma work for any continuous function . But the general form given above, with an unspecified , presents a difficulty.
Indeed, suppose is continuous on . Given , choose a polynomial such that on . Since has continuous derivative, it follows that . It remains to show that is close to . By the triangle inequality,
which is bounded by … um. Unlike for and , we do not have a uniform bound for or for its integral. Indeed, with the integrals grow linearly with . And this behavior would be even worse with , for example.
At present I do not see a way to prove TFRLL for continuous , let alone for integrable . But I do not have a counterexample either.
There are many ways to approximate a given continuous function (I will consider the interval for convenience.) For example, one can use piecewise linear interpolation through the points , where . The resulting piecewise linear function has some nice properties: for example, it is increasing if is increasing. But it is not smooth.
A convenient way to represent piecewise linear interpolation is the sum where the functions are the triangles shown below: .
The functions form a partition of unity, meaning that and all are nonnegative. This property leads to the estimate
The latter sum is small because when is close to , the first factor is small by virtue of continuity, while the second factor is bounded by . When is far from , the second factor is zero, so the first one is irrelevant. The upshot is that is uniformly small.
But if we want a smooth approximation , we need a smooth partition of unity . But not just any set of smooth nonnegative functions that add up to is equally good. One desirable property is preserving monotonicity: if is increasing, then should be increasing, just as this works for piecewise linear interpolation. What does this condition require of our partition of unity?
An increasing function can be expressed as a limit of sums of the form where and is the Iverson bracket: 1 if true, 0 if false. By linearity, it suffices to have increasing for the case . In this case is simply for some , . So we want all to be increasing functions. Which is the case for the triangular partition of unity, when each looks like this:
One smooth choice is Bernstein basis polynomials: . These are nonnegative on , and the binomial formula shows . Are the sums increasing with ? Let’s find out. By the product rule,
In the second sum the term with vanishes, and the terms with can be rewritten as , which is , which is . After the index shift this becomes identical to the terms of the first sum and cancels them out (except for the first one). Thus,
To summarize: the Bernstein polynomials are monotone whenever is. On the other hand, the proof that uniformly is somewhat complicated by the fact that the polynomial basis functions are not localized the way that the triangle basis functions are: the factors do not vanish when is far from . I refer to Wikipedia for a proof of convergence (which, by the way, is quite slow).
Is there some middle ground between non-smooth triangles and non-localized polynomials? Yes, of course: piecewise polynomials, splines. More specifically, B-splines which can be defined as follows: B-splines of degree are the triangle basis functions shown above; a B-spline of degree is the moving averages of a -spline of degree with a window of length . The moving average of can be written as . We get a partition of unity because the sum of moving averages is the moving average of a sum, and averaging a constant function does not change it.
The splines of even degrees are awkward to work with… they are obtained from the triangles by taking those integrals with an odd number of times, which makes their knots fall in the midpoints of the uniform grid instead of the grid points themselves. But I will use anyway, because this degree is enough for -smooth approximation.
Recall that a triangular basis function has slope and is supported on an interval where . Accordingly, its moving average will be supported on . Since , the second derivative is when , is when , and is again when . This is enough to figure out the formula for :
These look like:
Nice! But wait a moment, the sum near the endpoints is not constant: it is less than 1 because we do not get a contributions of two splines to the left and right of the interval. To correct for this boundary effect, replace with and with , using “ghost” elements of the basis that lie outside of the actual grid. Now the quadratic B-spline basis is correct:
Does this partition of unity preserve monotinicity? Yes, it does: which is nonnegative because the sum is an increasing piecewise linear function, as noted previously. Same logic works for B-splines of higher degree.
In conclusion, here is a quadratic B-spline approximation (orange) to a tricky increasing function (blue).
One may wonder why the orange curve deviates from the line at the end – did we miss some boundary effect there? Yes, in a way… the spline actually approximates the continuous extension of our original function by constant values on the left and right. Imagine the blue graph continuing to the right as a horizontal line: this creates a corner at and the spline is smoothing that corner. To avoid this effect, one may want to extend in a better way and then work with the extended function, not folding the ghosts into .
But even so, B-spline achieves a better approximation than the Bernstein polynomial with the same number of basis functions (eight):
The reason is the non-local nature of the polynomial basis , which was noted above. Bernstein polynomials do match the function perfectly at the endpoints, but this is small consolation.