Higher order reflections

Mathematical reflections, not those supposedly practiced in metaphilosophy.

Given a function {f} defined for {x\ge 0}, we have two basic ways to reflect it about {x=0}: even reflection {f(-x)=f(x)} and odd reflection {f(-x)=-f(x)}. Here is the even reflection of the exponential function {e^x}:

Even reflection
Even reflection

The extended function is not differentiable at {0}. The odd reflection, pictured below, is not even continuous at {0}. But to be fair, it has the same slope to the left and to the right of {0}, unlike the even reflection.

Odd reflection
Odd reflection

Can we reflect a function preserving both continuity and differentiability? Yes, this is what higher-order reflections are for. They define {f(-x)} not just in terms of {f(x)} but also involve values at other points, like {f(x/2)}. Here is one such smart reflection:

\displaystyle    f(-x) = 4f(x/2)-3f(x)  \qquad\qquad\qquad (1)

Differentiable reflection
Differentiable reflection

Indeed, letting {x\rightarrow 0^+}, we observe continuity: both sides converge to {f(0)}. Taking derivatives of both sides, we get

\displaystyle  -f'(-x) = 2f'(x/2) - 3f'(x)

where the limits of both sides as {x\rightarrow 0^+} again agree: they are {-f'(0)}.

A systematic way to obtain such reflection formulas is to consider what they do to monomials: {1}, {x}, {x^2}, etc. A formula that reproduces the monomials up to degree {d} will preserve the derivatives up to order {d}. For example, plugging {f(x)=1} or {f(x)=x} into (1) we get a valid identity. With {f(x)=x^2} the equality breaks down: {x^2} on the left, {-2x^2} on the right. As a result, the curvature of the graph shown above is discontinuous: at {x=0} it changes the sign without passing through {0}.

To fix this, we’ll need to use a third point, for example {x/4}. It’s better not to use points like {2x}, because when the original domain of {f} is a bounded interval {[0,b]}, we probably want the reflection to be defined on all of {[-b,b]}.

So we look for coefficients {A,B,C} such that {f(-x)=Af(x/4)+Bf(x/2)+Cf(x)} holds as identity for {f(x)=1,x,x^2}. The linear system {A+B+C=1}, {A/4+B/2+C=-1}, {A/16+B/4+C=1} has the solution {A=16}, {B=-20}, {C=5}. This is our reflection formula, then:

\displaystyle  f(-x) = 16f(x/4)-20f(x/2)+5f(x)  \qquad\qquad\qquad (2)

And this is the result of reflecting {\exp(x)} according to (2):

Twice differentiable reflection
Twice differentiable reflection

Now the curvature of the graph is continuous. One could go on, but since human eye is not sensitive to discontinuities of the third derivative, I’ll stop here.

In case you don’t believe the last paragraph, here is the reflection with three continuous derivatives, given by

\displaystyle  f(-x) = \frac{640}{7} f(x/8) - 144f(x/4)+60f(x/2)-\frac{45}{7}f(x)

and below it, the extension given by (2). For these plots I used Desmos because plots in Maple (at least in my version) have pretty bad aliasing.

Three continuous derivatives
Three continuous derivatives
Two continuous derivatives
Two continuous derivatives

Also, cubic splines have only two continuous derivatives and they connect dots naturally.

Through the Looking-Glass II

Just a few illustrations that did not fit in the previous post. A brief recap: given a holomorphic map f of the upper half-plane, we can extend it to the bottom half-plane by setting f(\bar z)=f'(z)(\bar z-z). This extension is not holomorphic unless f is linear; however, it extends f to a global homeomorphism provided that |f''(z)|\cdot |\bar z-z|<|f'(z)|. A calculation shows that the power map f(z)=z^p satisfies this inequality whenever |p-1|<1/2.

Here are two examples where this inequality is seriously violated: p=1.8 and p=2. The images of concentric circles |z|=r are shown, the upper half (power map) in green and the lower half (extended map) in red.


When p=2 the extension is f(\bar z)=2|z|^2-2z^2, so the images of concentric circles are again circles. The plot reminded me of this:

However, here the angle is 2\arcsin (1/2)=60^{\circ}. Oh well. Maybe I should blog about the Kelvin wake pattern instead of holomorphic maps. The Wikipedia article does not offer much in the way of explanation.

By the way, nothing forces p to be a real number. The Ahlfors extension works for any complex exponent with |p-1|<1/2. For example, 1+i/3:


The plot shows also images of radial segments. In the green territory, the radial segments and circles are mapped to logarithmic spirals. The red part is more complicated. Here is what happens when |p-1| exceeds 1/2:


Finally, a flower with p=2+3i:


Through the Looking-Glass, and What Ahlfors Found There

There are two ways to extend a function f\colon [0,+\infty) to the negative semi-axis:

  • Even reflection f(-x)=f(x)
  • Odd reflection f(-x)=-f(x)
Reflection in 1D

As the sketch shows, the even reflection is more likely to yield a continuous function. The odd reflection has no chance of being continuous unless f(0)=0. On the other hand, it has the same slope to the left and to the right of 0, so if f happens to be differentiable with f(0)=0, then the odd reflection is differentiable too.

Most importantly for this post, the odd extension has a chance of being a bijection. For example, f(x)=\sqrt{x} extends to f(x)=x/\sqrt{|x|}, which is a homeomorphism of \mathbb R onto itself.

Let’s move one dimension up. It’s more convenient to place the looking-glass onto the horizontal axis. We have a map that f=(u,v) is defined in the upper halfplane y\ge 0, and would like to extend its definition to y<0. If f sends the line y=0 into v=0, we can extend it using the mixed even-u/odd-v method: u(x,-y)=u(x,y), v(x,-y)=-v(x,y). This is easier to write down in complex notation: f(\bar z)=\overline{f(z)}. If f was a homeomorphism of the upper halfplane onto itself, the extension will be a homeomorphism of the entire plane. The process looks like this:

But in general, the image of the horizontal axis is not a straight line. How can we find a reflection of f in such a strange mirror?

Curved looking-glass

Going back to the origins of geometry, we can use similar triangles to locate the image of a point:


Denoting the purple point by z and the blue one by z+h, we see that the (complex) scaling factor of the triangle is \displaystyle \frac{f(z+h)-f(z)}{h}, and therefore the image of the red point is

\displaystyle f(\bar z)=f(z)+\frac{f(z+h)-f(z)}{h}(\bar z-z)

This looks promising, but there is no obvious reason why f(\bar z) should fall into the region behind the looking-glass, or why this extension should be a homeomorphism. It is also unclear how to choose h: should it be real, as on the picture above? should its size be fixed or depend on z? Or maybe… get rid of h be letting h\to 0? Let’s do that. The extension becomes

\displaystyle f(\bar z)=f(z)+f'(z)(\bar z-z)

Can’t get much simpler than that. The identity f(z)=z extends to f(\bar z)=z+1(\bar z-z)=\bar z, which is encouraging but not very interesting. Let’s try other powers f(z)=z^p. The extension \displaystyle f(\bar z)=z^p+pz^{p-1}(\bar z-z) is homogeneous of degree p, so concentric circles around 0 are mapped onto similar curves. The plots below show the images of concentric circles for several value of p: the image of upper semicircle is green, the image of the bottom (where the extension formula is used) is in red.

Let’s begin with p>1:

p=5/4, extension is a homeomorphism
p=3/2, extension forms cusps
p=5/3, injectivity is lost -- the extended map overlaps itself

And it gets worse as p increases. In the opposite direction, consider powers less than 1:

p=2/3: looking good
p=1/2: no longer injective
p=1/3: horrible, the extension overlaps the green part

It’s surprisingly easy to get to the root of the problem. Take the complex derivatives of the extended map: f(\bar z)_{z}=f''(z)(\bar z-z) and f(\bar z)_{\bar z}=f'(z). To preserve orientation, the extension must satisfy |f(\bar z)_{z}|<|f(\bar z)_{\bar z}|, which requires the original map to satisfy 2|f''(z)|\mathrm{Im}\,z<|f'(z)|. With f(z)=z^p this boils down to |p-1|<1/2.

This extension (in a more general form) was given by Lars Ahlfors in "Sufficient conditions for quasiconformal extension" (1973). I learned about it in when working on quasisymmetric graphs. The plots were created with Maple:

with(plots): p:=3/2:
curves:={seq(complexplot((1+k/5)^p*exp(I*p*t),t=0..Pi,color=green,thickness=2), k=-4..4)} union {seq(complexplot((1+k/5)^p*((1-p)*exp(I*p*t)+p*exp((p-2)*I*t)),t=0..Pi,thickness=2) ,k=-4..4)}: