---
format:
  html:
    html-math-method: katex
---


Running from Hearts: Mandelbrot beyond i
========================================

Fractals are popular among mathematicians because they are typically easy to generate, but display complex behavior. The [*Mandelbrot set*](
https://en.wikipedia.org/wiki/Mandelbrot_set) is such an example, recognizable as a cardioid surrounded by circles and infinitesimally thin tendrils. A complex number $c = a + bi$ is in the Mandelbrot set if the iterative process $z_0 = 0;~z_{n+1} = z_{n}^2 + c$ does not tend toward infinity.

Naively, this requires calculating $z_\infty$, an infinite procedure which cannot be completed. Instead, it is typical to run the iteration for a finite number of steps. Numbers are excluded from the set if the norm of a $z_n$ exceeds a certain bound. The set lies within a circle in the complex plane of radius 2 centered at 0, which establishes a bound on the norm.

Even after reducing an infinite process to a finite one, there are several definitions implicit in this description. Naturally, it is possible to [increase the power of $z$](https://en.wikipedia.org/wiki/Multibrot_set), but I would prefer to explore other options, such as:

- Changing the value of $i$ in $a + bi$
- Using a norm other than the Euclidean ($|z| = a^2 + b^2$)
- Altering the manner in which complex numbers multiply


Other Roots of Unity
--------------------

The imaginary unit *i* lies at a quarter turn around the unit circle, starting from the positive real axis and rotating counterclockwise. Complex numbers which are positioned at fractions of a turn around the unit circle are termed *roots of unity*. Since it takes four quarter turns to produce one full turn, *i* is a fourth (primitive) root of unity. Multiplying complex numbers adds their angles, so this is equivalent to the statement $i^4 = 1$. With *i* as the imaginary unit, the vectors connecting it and 1 to the origin form an orthonormal basis for the complex numbers.

All roots of unity other than the first (1), second (-1), and fourth (*i*) are given in terms of the imaginary unit and surds. For example, the sixth root of unity lying in the upper half of the complex plane is $\xi_6 = \frac 1 2 + i\frac{\sqrt 3} 2$. If we consider complex numbers of the form $a + b\xi_6$, then this has the effect of rotating the imaginary unit from its original position.

::: {}
![]()
This diagram and all others are shown in the range -2 to 2 for both the real and imaginary axes
:::

The basis with respect to 1 is no longer orthogonal, and this shears the Mandelbrot set along that angle. "Up" is now 30 degrees to the left of where it once was, where *i* lies in relation to $\xi_6$.

Introducing a scalar multiple to the *b* term moves *i* off of the unit circle. Predictably, the *b* term must grow or shrink in the opposite way. This means that the set dilates along the vertical if *i* lies within the unit circle, and shrinks if *i* lies outside. This can be combined with the shearing effect, but the general shape of the Mandelbrot set stays the same.


Out of the Norm
---------------

We used the unit circle to justify speaking about roots of unity. It is defined by the Euclidean norm. This form naturally arises as the product of a complex number and its conjugate.

$$
|z| = a^2 + b^2 = (a + bi) (a\ - bi) = zz^*
$$

Points which lie on a circle with radius 2 have a norm of 4, which means that it is sufficient to test our points while generating the set by $|z_n| \leq 4$.


### Being Hyperbolic

There are other norms we can consider that alter the notion of distance. For example, we can consider a hyperbolic norm. There are two of them, which are dual to one another.

$$
\begin{align*}
|z|_{{hyp}_1} &= a^2 - b^2 \\
|z|_{{hyp}_2} &= ab
\end{align*}
$$

Both of these expressions can take on negative values. We address this by squaring them, producing a quartic form. This also squares the bound on the norm to $z_{hyp} \leq 16$.

:::: {}
::: {}
![]()
:::

::: {}
![]()
:::
::::

Using this norm to bound the set produces the above two images. Hyperbolic spikes replace the rounded regions which bound the set at successive iterations. However, the black figure in the middle remains largely the same. Notably, the spikes in one graph appear to be rotated from the other, just as how the curve $xy = 1$ is a rotation of $x^2\ - y^2 = 1$.


### Maximizing Manhattan

The Euclidean norm also belongs to a group called [$L^p$ norms](https://en.wikipedia.org/wiki/Lp_space).

$$
||z||_p = |a^p| + |b^p|
$$

(**Note**: To simplify things, I'm leaving out the radical typically seen here.) Two more dual norms lie at extreme values of *p*: 1 and $\infty$. Circles within the $L^1$ ("taxicab") norm are squares, albeit rotated 45 degrees.

The above definition doesn't work with $\infty$, but for higher *p*, one of *a* or *b* will tend to dominate the other. Therefore, the norm degenerates to $||z||_\infty = \max(a, b)$. Circles with respect to this norm are also squares, but with edges parallel to the axes.

:::: {}
::: {}
![]()
:::

::: {}
![]()
:::
::::

These two norms produces the above images. The regions are generally larger when using the maximum norm since the unit circle has a larger area. The cusps and curves seem to be interchanged between plots, similarly to the spokes in the hyperbolic norms.

Unfortunately, all of these norms still produce roughly the same shape. This is because they all share the notion of "infinitely far" from the origin, which isn't enough to change the shape of the set. Whatever process is used to determine the general size of *z*, the magnitudes of both *a* and *b* tend to grow if a number is not in the set.


Distributing Values
-------------------

A more subtle alteration we can make is changing the the entire operation of multiplication. When multiplying two complex numbers, there are four pairs of products which can appear among the real and imaginary components of the result. If $\odot$ signifies pointwise matrix multiplication and $\Sigma$ is an operator which sums the elements, then we can characterize multiplication as:

$$
\begin{gather*}
z_1 z_2 =
(a + bi) (c + di) = \begin{matrix}
&(ac)(\boldsymbol{1^2}) & + & (ad)(\boldsymbol{1i}) \\
+&(bc)(\boldsymbol{i1}) & + & (bd)(\boldsymbol{i^2})
\end{matrix} \\ \\
= \Sigma \left(
\begin{pmatrix}
ac & ad \\
bc & bd
\end{pmatrix}
\odot
\begin{pmatrix}
1^2 & 1i \\
i1 & i^2
\end{pmatrix}
\right)
= \Sigma (
P_2 \odot M
)
\end{gather*}
$$

This characterization is a little too naive, since we can assume that $1^2 = 1$ and $1i = i1 = i$. The first equality follows from scalar multiplication working on complex numbers. $i^2$ is free from such limitations, and a more honest product can be formulated as:

$$
\begin{gather*}
(a + bi) (c + di) = ac + (bc + ad)i + bdi^2 \\ \\
= \Sigma \left(
P_2 \odot
\begin{pmatrix} 1 & i \\ i & i^2 \end{pmatrix}
\right )= \Sigma (
P_2 \odot M
)
\end{gather*}
$$

This restriction enforces the distributivity of multiplication over addition. Since *M* is symmetric, it also means that multiplication is commutative. For the purposes of generating the normal set, commutativity isn't required, but it may become a problem if we use higher powers of *z*.


### Complex, but Split

Complex numbers are defined by the relation $i^2 = 1$. If instead $i^2 = 1$, then the system is termed the "[split-complex numbers](https://en.wikipedia.org/wiki/Split-complex_number)". They are typically assigned the hyperbolic norm $a^2 - b^2$, since this is the product of a number and its conjugate. Before using this norm, let's see the Mandelbrot set with respect to the other four norms over the split complex numbers.

![]()

All four images have the same shape. Rather than the distinctive main cardioid which appears in the normal Mandelbrot set, the only thing which remains is a black diamond. The approximant regions outside of the black shape are only due to the norm considered, as previously shown. In the hyperbolic (upper right) plot, the spoke along the positive real axis is an artifact of this. In fact, the part of this plot which lies on the real axis should be exactly the same as in the normal Mandelbrot set, since it has no imaginary component.

![]()

The other hyperbolic norm produces more or less the same shape, albeit with some black islands and a hyperbolic "bite" taken out of the left side. By picking a different threshold value, both of these artifacts disappear. However, the spokes along the lines $\Re(z) = \Im(z)$ and $\Re(z) = -\Im(z)$ are numbers for which the norm is 0, and will not be removed, similar to the other hyperbolic 0 line.

If the we transition the value of $i^2$ between -1 and 1, then the Mandelbrot set transitions between its familiar shape and the alien diamond shape.

![]()

Exactly halfway between this transition from -1 to 1, $i^2 = 0$. This system is called the "dual numbers", and their multiplication is similar to the treatment of infinitesimals in nonstandard calculus.


### Oops, all Imaginary

$i^2$ need not be a real number. Letting $i^2 = i$ or $i^2 = -i$ means that imaginary terms cannot "escape" to influence the real component as they can normally.

:::: {}
::: {}
![]()
$i^2 = i$
:::

::: {}
![]()
$i^2 = -i$
:::
::::

If we squint hard enough, this also appears to be midway between a transition between the Mandelbrot set in the complex numbers and in the split-complex numbers. It combines both the diamond shape (albeit sheared) and hints of interesting behavior toward the boundary.

In the following video, the value of $i^2$ is rotated about the unit circle, with the blue arrow pointing to the value.

![]()

This plot also contains some of the shears previously seen by assigning i to another root of unity.


Other Vector Products
---------------------

Without relaxing the distributive law, we can choose to examine numbers composed of two imaginary values, rather than a real and an imaginary one. Numbers remain 2D, but of the form $z = ai + bj$. We have a bit more freedom in choosing the products

$$
\begin{gather*}
z_1 z_2 =
(ai + bj) (ci + dj) = \begin{matrix}
&(ac)(\boldsymbol{i^2}) & + & (ad)(\boldsymbol{ij}) \\
+&(bc)(\boldsymbol{ji}) & + & (bd)(\boldsymbol{j^2})
\end{matrix} \\ \\
= \Sigma \left(
P_2 \odot
\begin{pmatrix}
i^2 & ij \\
ji & j^2
\end{pmatrix}
\right)
= \Sigma \left(
P_2 \odot M
\right)
\end{gather*}
$$

Each term of *M* should have an *i* or a *j* component, and no real components, so that the product remains two-dimensional. I'll take it one step further and say that entries must be any of 0, $\pm i$ and $\pm j$.


### Absorbative Imaginary

We can construct a simple matrix by letting each of ij and ji be zero and i and j are absorbative with respect to themselves.

$$
M = \begin{pmatrix}
i & 0 \\
0 & j
\end{pmatrix} \Rightarrow (ai + bj) (ci + dj) = aci + bdj
$$

This form is similar to the dot product between two 2D vectors. If we use this scheme, the shape produced by the Mandelbrot iteration is fairly boring.

![]()

The harsh black edge meeting the pale yellow region is due to any growth of $z^n,~|z| < 2$ being counteracted by the initial value under consideration.


### Cyclic Imaginary

The previous multiplication is uninteresting because one component never affects the other. We can slightly alter the multiplication so that such an interchange can take place.

$$
M = \begin{pmatrix}
j & 0 \\
0 & i
\end{pmatrix} \Rightarrow (ai + bj) (ci + dj) = bdi + acj
$$

![]()

The boundary of the figure no longer appears to lie parallel with either the real or imaginary axis. There also appear to be some "bubbles" of exclusion in the lower right corner, as well as "hairs" of inclusion coming off the main body.


### Mutually Imaginary

We can also move the the terms of the above matrices onto the off-diagonal of *M*, producing yet another pair of multiplications.

$$
\begin{gather*}
M = \begin{pmatrix}
0 & i \\
j & 0
\end{pmatrix} \Rightarrow (ai + bj) (ci + dj) = adi + bcj \\
M' = \begin{pmatrix}
0 & j \\
i & 0
\end{pmatrix} \Rightarrow (ai + bj) (ci + dj) = bci + adj
\end{gather*}
$$

As stated previously, if *M* is not symmetric, then the operation is not commutative. Interchanging the order of the operands in either of these multiplications results in interchanging the *i* and *j* components. This has no effect when squaring a number since both the left and right operands are the same.

![]()

In this multiplication, hyperbolic shapes appear to be taking form in the upper right quadrant. There also appears to be a somewhat parabolic shape in the opposite quadrant. It joins up with the hyperbolae at the positive real and imaginary axes.


Summary and Closing
-------------------

My original goal was to pinpoint what gives the Mandelbrot set its shape. Armed with this knowledge, it would be possible to find a sufficient generalization of the set to higher dimensions. Before proceeding to 3D, I wanted to explore some less-examined options as they pertain to the typical, 2D set.

Without changing the iterative process, the multiplication of numbers determines the shape of the Mandelbrot set. In a sense, the set is a manifestation of the distributive law with respect to an underlying number system. While we can shear this shape by rotating i around the unit circle, assigning a value to $i^2$ produces more prominent changes, without needing to involve approximating roots.

By using a system with both an *i* and a *j* component, the shape of the set can be altered further, as in the final examples given. With minimal effort, we can make it 3D by letting these numbers also have a real component. This will be the focus of the [next post]().


### Additional Links
- [Generalized Mandelbrot Sets and Moduli Spaces](https://www.math.uwaterloo.ca/~wgilbert/FractalGallery/Mandel/MandelMath.html), by Professor William Gilbert
