## Areas of Mathematics

October 22, 2013 3 comments

For one of my upcoming talks I am trying to include an exhaustive mindmap showing the different areas of Mathematics, and somehow, how they relate to each other. Most of the information I am using has been processed from years of exposure in the field, and a bit of help from Wikipedia.

But I am not entirely happy with what I see: my lack of training in the area of Combinatorics results in a rather dry treatment of that part of the mindmap, for example. I am afraid that the same could be told about other parts of the diagram. Any help from the reader to clarify and polish this information will be very much appreciated.

And as a bonus, I included a $\LaTeX$ script to generate the diagram with the aid of the tikz libraries.

\tikzstyle{level 2 concept}+=[sibling angle=40]
\begin{tikzpicture}[scale=0.49, transform shape]
\path[mindmap,concept color=black,text=white]
node[concept] {Pure Mathematics} [clockwise from=45]
child[concept color=DeepSkyBlue4]{
node[concept] {Analysis} [clockwise from=180]
child {
node[concept] {Multivariate \& Vector Calculus}
[clockwise from=120]
child {node[concept] {ODEs}}}
child { node[concept] {Functional Analysis}}
child { node[concept] {Measure Theory}}
child { node[concept] {Calculus of Variations}}
child { node[concept] {Harmonic Analysis}}
child { node[concept] {Complex Analysis}}
child { node[concept] {Stochastic Analysis}}
child { node[concept] {Geometric Analysis}
[clockwise from=-40]
child {node[concept] {PDEs}}}}
child[concept color=black!50!green, grow=-40]{
node[concept] {Combinatorics} [clockwise from=10]
child {node[concept] {Enumerative}}
child {node[concept] {Extremal}}
child {node[concept] {Graph Theory}}}
child[concept color=black!25!red, grow=-90]{
node[concept] {Geometry} [clockwise from=-30]
child {node[concept] {Convex Geometry}}
child {node[concept] {Differential Geometry}}
child {node[concept] {Manifolds}}
child {node[concept,color=black!50!green!50!red,text=white] {Discrete Geometry}}
child {
node[concept] {Topology} [clockwise from=-150]
child {node [concept,color=black!25!red!50!brown,text=white]
{Algebraic Topology}}}}
child[concept color=brown,grow=140]{
node[concept] {Algebra} [counterclockwise from=70]
child {node[concept] {Elementary}}
child {node[concept] {Number Theory}}
child {node[concept] {Abstract} [clockwise from=180]
child {node[concept,color=red!25!brown,text=white] {Algebraic Geometry}}}
child {node[concept] {Linear}}}
node[extra concept,concept color=black] at (200:5) {Applied Mathematics}
child[grow=145,concept color=black!50!yellow] {
node[concept] {Probability} [clockwise from=180]
child {node[concept] {Stochastic Processes}}}
child[grow=175,concept color=black!50!yellow] {node[concept] {Statistics}}
child[grow=205,concept color=black!50!yellow] {node[concept] {Numerical Analysis}}
child[grow=235,concept color=black!50!yellow] {node[concept] {Symbolic Computation}};
\end{tikzpicture}


## More on Lindenmayer Systems

September 24, 2013 2 comments

We briefly explored Lindenmayer systems (or L-systems) in an old post: Toying with Basic Fractals. We quickly reviewed this method for creation of an approximation to fractals, and displayed an example (the Koch snowflake) based on tikz libraries.

I would like to show a few more examples of beautiful curves generated with this technique, together with their generating axiom, rules and parameters. Feel free to click on each of the images below to download a larger version.

Note that any coding language with plotting capabilities should be able to tackle this project. I used once again tikz for $\text{\LaTeX}$, but this time with the tikzlibrary lindenmayersystems.

 name : Dragon Curve axiom : X order : 11 step : 5pt angle : 90 rules : X -> X+YF+ Y -> -FX-Y  name : Gosper Space-filling Curve axiom : XF order : 5 step : 2pt angle : 60 rules : XF -> XF+YF++YF-XF--XFXF-YF+ YF -> -XF+YFYF++YF+XF--XF-YF  name : Quadric Koch Island axiom : F+F+F+F order : 4 step : 1pt angle : 90 rules : F -> F+F-F-FF+F+F-F  name : Sierpinski Arrowhead axiom : F order : 8 step : 3.5pt angle : 60 rules : G -> F+G+F F -> G-F-G  name : ? axiom : F+F+F+F order : 4 step : 2pt angle : 90 rules : F -> FF+F+F+F+F+F-F  name : ? axiom : F+F+F+F order : 4 step : 3pt angle : 90 rules : F -> FF+F+F+F+FF 

Would you like to experiment a little with axioms, rules and parameters, and obtain some new pleasant curves with this method? If the mathematical properties of the fractal that they approximate are interesting enough, I bet you could attach your name to them. Like the astronomer that finds through her telescope a new object in the sky, or the zoologist that discover a new species of spider in the forest.

## Some results related to the Feuerbach Point

Given a triangle $\triangle ABC,$ the circle that goes through the midpoints of each side, $D, E, F,$ is called the Feuerbach circle. It has very surprising properties:

• It also goes through the feet of the heights, points $G, H, I.$
• If $Oc$ denotes the orthocenter of the triangle, then the Feuerbach circle also goes through the midpoints of the segments $OcA, OcB, OcC.$ For this reason, the Feuerbach circle is also called the nine-point circle.
• The center of the Feuerbach circle is the midpoint between the orthocenter and circumcenter of the triangle.
• The area of the circumcircle is precisely four times the area of the Feuerbach circle.

Most of these results are easily shown with sympy without the need to resort to Gröbner bases or Ritt-Wu techniques. As usual, we realize that the properties are independent of rotation, translation or dilation, and so we may assume that the vertices of the triangle are $A=(0,0), B=(1,0)$ and $C=(r,s)$ for some positive parameters $r,s>0.$ To prove the last statement, for instance we may issue the following:

>>> import sympy
>>> from sympy import *
>>> A=Point(0,0)
>>> B=Point(1,0)
>>> r,s=var('r,s')
>>> C=Point(r,s)
>>> D=Segment(A,B).midpoint
>>> E=Segment(B,C).midpoint
>>> F=Segment(A,C).midpoint
>>> simplify(Triangle(A,B,C).circumcircle.area/Triangle(D,E,F).circumcircle.area)
4


But probably the most amazing property of the nine-point circle, is the fact that it is tangent to the incircle of the triangle. With exception of the case of equilateral triangles, both circles intersect only at one point: the so-called Feuerbach point.

## An Automatic Geometric Proof

July 9, 2013 4 comments

We are familiar with that result that states that, on any given triangle, the circumcenter, centroid and orthocenter are always collinear. I would like to illustrate how to use Gröbner bases theory to prove that the incenter also belongs in the previous line, provided the triangle is isosceles.

We start, as usual, indicating that this property is independent of shifts, rotations or dilations, and therefore we may assume that the isosceles triangle has one vertex at $A=(0,0)$, another vertex at $B=(1,0)$ and the third vertex at $C=(1/2, s)$ for some value $s \neq 0.$ In that case, we will need to work on the polynomial ring $R=\mathbb{R}[s,x_1,x_2,x_3,y_1,y_2,y_3,z],$ since we need the parameter $s$ free, the variables $x_1$ and $y_1$ are used to input the conditions for the circumcenter of the triangle, the variables $x_2$ and $y_2$ for centroid, and the variables $x_3$ and $y_3$ for the incenter (note that we do not need to use the orthocenter in this case).

We may obtain all six conditions by using sympy, as follows:

>>> import sympy
>>> from sympy import *
>>> A=Point(0,0)
>>> B=Point(1,0)
>>> s=symbols("s",real=True,positive=True)
>>> C=Point(1/2.,s)
>>> T=Triangle(A,B,C)
>>> T.circumcenter
Point(1/2, (4*s**2 - 1)/(8*s))
>>> T.centroid
Point(1/2, s/3)
>>> T.incenter
Point(1/2, s/(sqrt(4*s**2 + 1) + 1))


This translates into the following polynomials

$h_1=2x_1-1, h_2=8sy_1-4s^2+1$ (for circumcenter)
$h_3=2x_2-1, h_4=3y_2-s$ (for centroid)
$h_5=2x_3-1, h_6=(4sy_3+1)^2-4s^2-1$ (for incenter)

The hypothesis polynomial comes simply from asking whether the slope of the line through two of those centers is the same as the slope of the line through another choice of two centers; we could use then, for example, $g=(x_2-x_1)(y_3-y_1)-(x_3-x_1)(y_2-y_1).$ It only remains to compute the Gröbner basis of the ideal $I=(h_1, \dotsc, h_6, 1-zg) \subset \mathbb{R}[s,x_1,x_2,x_3,y_1,y_2,y_3,z].$ Let us use SageMath for this task:

sage: R.<s,x1,x2,x3,y1,y2,y3,z>=PolynomialRing(QQ,8,order='lex')
sage: h=[2*x1-1,8*r*y1-4*r**2+1,2*x2-1,3*y2-r,2*x3-1,(4*r*y3+1)**2-4*r**2-1]
sage: g=(x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)
sage: I=R.ideal(1-z*g,*h)
sage: I.groebner_basis()
[1]


This proves the result.

## Sympy should suffice

I have just received a copy of Instant SymPy Starter, by Ronan Lamy—a no-nonsense guide to the main properties of SymPy, the Python library for symbolic mathematics. This short monograph packs everything you should need, with neat examples included, in about 50 pages. Well-worth its money.

To celebrate, I would like to pose a few coding challenges on the use of this library, based on a fun geometric puzzle from cut-the-knot: Rhombus in Circles

Segments $\overline{AB}$ and $\overline{CD}$ are equal. Lines $AB$ and $CD$ intersect at $M.$ Form four circumcircles: $(E)=(ACM), (F)=(ADM), (G)=(BDM), (H)=(BCM).$ Prove that the circumcenters $E, F, G, H$ form a rhombus, with $\angle EFG = \angle AMC.$

Note that if this construction works, it must do so independently of translations, rotations and dilations. We may then assume that $M$ is the origin, that the segments have length one, $A=(2,0), B=(1,0),$ and that for some parameters $a>0, \theta \in (0, \pi),$ it is $C=(a+1) (\cos \theta, \sin\theta), D=a (\cos\theta, \sin\theta).$ We let SymPy take care of the computation of circumcenters:

import sympy
from sympy import *

# Point definitions
M=Point(0,0)
A=Point(2,0)
B=Point(1,0)
a,theta=symbols('a,theta',real=True,positive=True)
C=Point((a+1)*cos(theta),(a+1)*sin(theta))
D=Point(a*cos(theta),a*sin(theta))

#Circumcenters
E=Triangle(A,C,M).circumcenter
F=Triangle(A,D,M).circumcenter
G=Triangle(B,D,M).circumcenter
H=Triangle(B,C,M).circumcenter


Finding that the alternate angles are equal in the quadrilateral $EFGH$ is pretty straightforward:

In [11]: P=Polygon(E,F,G,H)

In [12]: P.angles[E]==P.angles[G]
Out[12]: True

In [13]: P.angles[F]==P.angles[H]
Out[13]: True


To prove it a rhombus, the two sides that coincide on each angle must be equal. This presents us with the first challenge: Note for example that if we naively ask SymPy whether the triangle $\triangle EFG$ is equilateral, we get a False statement:

In [14]: Triangle(E,F,G).is_equilateral()
Out[14]: False

In [15]: F.distance(E)
Out[15]: Abs((a/2 - cos(theta))/sin(theta) - (a - 2*cos(theta) + 1)/(2*sin(theta)))

In [16]: F.distance(G)
Out[16]: sqrt(((a/2 - cos(theta))/sin(theta) - (a - cos(theta))/(2*sin(theta)))**2 + 1/4)


Part of the reason is that we have not indicated anywhere that the parameter theta is to be strictly bounded above by $\pi$ (we did indicate that it must be strictly positive). The other reason is that SymPy does not handle identities well, unless the expressions to be evaluated are perfectly simplified. For example, if we trust the routines of simplification of trigonometric expressions alone, we will not be able to resolve this problem with this technique:

In [17]: trigsimp(F.distance(E)-F.distance(G),deep=True)==0
Out[17]: False


Finding that $\angle EFG = \angle AMC$ with SymPy is not that easy either. This is the second challenge.

How would the reader resolve this situation?

Categories: Geometry, puzzles, sage, Teaching

## A nice application of Fatou’s Lemma

Let me show you an exciting technique to prove some convergence statements using exclusively functional inequalities and Fatou’s Lemma. The following are two classic problems solved this way. Enjoy!

Exercise 1 Let ${(X, \mathcal{F}, \mu)}$ be a measurable space and suppose ${\{f_n\}_{n\in \mathbb{N}}}$ is a sequence of measurable functions in ${L_1(\mu)}$ that converge almost everywhere to a function ${f \in L_1(\mu)},$ and such that the sequence of norms ${\big\{ \lVert f_n \rVert_1 \big\}_{n \in \mathbb{N}}}$ converges to ${\lVert f \rVert_1}$. Prove that the sequence of integrals ${\int_E \lvert f_n \rvert\, d\mu}$ converges to the integral ${\int_E \lvert f \rvert\, d\mu}$ for every measurable set ${E}$.

Proof: Note first that

$\displaystyle \begin{array}{rcl} \lvert f_n - f\rvert\, \boldsymbol{1}_E \leq \lvert f_n - f \rvert \leq \lvert f_n \rvert + \lvert f \rvert. \end{array}$

Set then ${g_n = \lvert f_n \rvert + \lvert f \rvert - \lvert f_n-f \rvert\, \boldsymbol{1}_E}$ (which are non-negative functions) and apply Fatou’s Lemma to that sequence. We have then

$\displaystyle \begin{array}{c} \int_X \liminf_n g_n\, d\mu \leq \liminf_n \int_X g_n\, d\mu \\ \\ \int_X \liminf_n \big( \lvert f_n \rvert + \lvert f \rvert - \lvert f_n - f \rvert\, \boldsymbol{1}_E \big)\, d\mu \leq \liminf_n \int_X \big( \lvert f_n \rvert + \lvert f \rvert - \lvert f_n - f \rvert\, \boldsymbol{1}_E \big)\, d\mu \\ \\ \int_X \big( 2\lvert f \rvert - \limsup_n \lvert f_n-f \rvert\, \boldsymbol{1}_E\big)\, d\mu \leq \liminf_n \int_X \lvert f_n \rvert\, d\mu + \lVert f \rVert_1 - \limsup_n \int_E \lvert f_n -f \rvert\, d\mu \\ \\ 2\lVert f\rVert_1 \leq 2\lVert f \rVert_1 - \limsup_n \int_E \lvert f_n - f\rvert\, d\mu, \end{array}$

which implies

$\displaystyle \begin{array}{rcl} 0 \leq \liminf_n \int_E \lvert f_n-f \rvert\, d\mu \leq \limsup_n \int_E \lvert f_n-f \rvert\, d\mu \leq 0. \end{array}$

It must then be ${\int_E \lvert f_n - f \rvert\, d\mu = 0}$. But this proves the statement, since

$\displaystyle \begin{array}{c} \bigg\lvert \int_E \lvert f_n\rvert\, d\mu - \int_E \lvert f \rvert\, d\mu \bigg\rvert = \bigg\lvert \int_E \big( \lvert f_n \rvert - \lvert f \rvert \big)\, d\mu \bigg\rvert \\ \leq \int_E \Big\lvert \lvert f_n \rvert - \lvert f \rvert \Big\rvert\, d\mu \leq \int_E \lvert f_n - f \rvert\, d\mu \end{array}$

$\Box$

Exercise 2 Let ${(X, \mathcal{F}, \mu)}$ be a finite measure space and let ${1. Suppose that ${\{ f_n \}_{n \in \mathbb{N}}}$ is a sequence of measurable functions in ${L_p(\mu)}$ whose norms are uniformly bounded in ${n}$ and which converge almost everywhere to a function ${f}$. Prove that the sequence ${\big\{ \int_X f_ng\, d\mu \big\}_{n \in \mathbb{N}}}$ converges to ${\int_x fg\, d\mu}$ for all ${g \in L_q(\mu)}$ where ${q}$ is the conjugate exponent of ${p}$.

Proof: The proof is very similar to the previous problem. We start by noticing that under the hypotheses of the problem,

$\displaystyle \begin{array}{c} \bigg\lvert \int_x f_ng\, d\mu - \int_X fg\, d\mu \bigg\rvert = \bigg\lvert \int_X (f_n -f)g\, d\mu \bigg\rvert \\ \leq \lVert (f_n-f)g \rVert_1 \leq \lVert f_n - f \rVert_p\, \lVert g \rVert_q. \end{array}$

If we prove that ${\lim_n \lVert f_n-f \rVert_p = 0}$, we are done.

We will achieve this by using the convexity of ${\lvert \cdot \rvert^p}$, since in that case it is

$\displaystyle \begin{array}{rcl} \frac{\lvert f_n - f \rvert^p}{2^p} \leq \tfrac{1}{2} \lvert f_n \rvert^p + \tfrac{1}{2} \lvert f \rvert^p. \end{array}$

hence,

$\displaystyle \begin{array}{rcl} \lvert f_n -f \rvert^p \leq 2^{p-1} \big( \lvert f_n \rvert^p + \lvert f \rvert^p \big). \end{array}$

Set then ${g_n = 2^{p-1} \big( \lvert f_n\rvert^p + \lvert f \rvert^p\big) - \lvert f_n-f \rvert^p}$ (which are non-negative functions) and apply Fatou’s Lemma as before. $\Box$

Categories: Analysis, Teaching

## Have a child, plant a tree, write a book

April 23, 2013 2 comments

Or more importantly: rear your children to become nice people, water those trees, and make sure that your books make a good impact.

I recently enjoyed the rare pleasure of having a child (my first!) and publishing a book almost at the same time. Since this post belongs in my professional blog, I will exclusively comment on the latter: Learning SciPy for Numerical and Scientific Computing, published by Packt in a series of technical books focusing on Open Source software.

Keep in mind that the book is for a very specialized audience: not only do you need a basic knowledge of Python, but also a somewhat advanced command of mathematics/physics, and an interest in engineering or scientific applications. This is an excerpt of the detailed description of the monograph, as it reads in the publisher’s page:

It is essential to incorporate workflow data and code from various sources in order to create fast and effective algorithms to solve complex problems in science and engineering. Data is coming at us faster, dirtier, and at an ever increasing rate. There is no need to employ difficult-to-maintain code, or expensive mathematical engines to solve your numerical computations anymore. SciPy guarantees fast, accurate, and easy-to-code solutions to your numerical and scientific computing applications.

Learning SciPy for Numerical and Scientific Computing unveils secrets to some of the most critical mathematical and scientific computing problems and will play an instrumental role in supporting your research. The book will teach you how to quickly and efficiently use different modules and routines from the SciPy library to cover the vast scope of numerical mathematics with its simplistic practical approach that is easy to follow.

The book starts with a brief description of the SciPy libraries, showing practical demonstrations for acquiring and installing them on your system. This is followed by the second chapter which is a fun and fast-paced primer to array creation, manipulation, and problem-solving based on these techniques.

The rest of the chapters describe the use of all different modules and routines from the SciPy libraries, through the scope of different branches of numerical mathematics. Each big field is represented: numerical analysis, linear algebra, statistics, signal processing, and computational geometry. And for each of these fields all possibilities are illustrated with clear syntax, and plenty of examples. The book then presents combinations of all these techniques to the solution of research problems in real-life scenarios for different sciences or engineering — from image compression, biological classification of species, control theory, design of wings, to structural analysis of oxides.

The book is also being sold online in Amazon, where it has been received with pretty good reviews. I have found other random reviews elsewhere, with similar welcoming comments: