Math starts with counting. Ten-fingered humans have 10 symbols to write numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. But fingerless transistor-based computers prefer binary, which is just 2 symbols: 0 and 1.
Classical computers use bits (strictly 0 or 1), while quantum computers use qubits. A qubit is
The natural numbers are $1, 2, 3, 4, \dots$ etc... up to but not including $\infty$, and the real numbers are filling in the gaps with fractions, decimals, $\pi$ and mostly non-computable finite numbers.

The complex numbers throw in $i$ with $i^2 = -1$ and one example of a complex number is the principal branch of $\sqrt{-15} = 0 + i\sqrt{15}$.

Ergodicity describes a dynamic system where a point's trajectory eventually visits all parts of the space uniformly. In the complex plane, we can observe this through iterative maps.
Consider the unit circle $\mathbb{{ '{' }}S{{ '}' }}^1$ in the complex plane, where every point is $z = e^{{ '{' }}i \theta{{ '}' }}$. If we apply the transformation map:
$T(z) = e^{{ '{' }}2\pi i \alpha{{ '}' }} z$
If $\alpha$ is an irrational number, the orbit of any starting point $z_0$ will never repeat. Instead, it will densely fill the entire unit circle. The time average of a function evaluated along this chaotic orbit equals its space average over the circleโthe defining property of an ergodic system!
Now consider a non-invertible transformation on the same unit circle:
$z \mapsto z^2$
In polar coordinates, this doubles the angle at each step: $\theta \mapsto 2\theta \pmod{{ '{' }}2\pi{{ '}' }}$. This map is highly chaotic; two points that start infinitesimally close together will separate exponentially fast. Like the irrational rotation, it is ergodic with respect to the Lebesgue measure, serving as a fundamental model for deterministic chaos.
In the early 20th century, math had a crisis. Bertrand Russell pointed out a logical contradiction in the basis of math: sets. A set is a collection of abstract objects, like numbers. We can use curly brackets for a set, like the natural numbers
$$\htmlData{tooltip=Some prefer to exclude 0 from the naturals but no biggie.}{\mathbb{N} = \{0, 1, 2, ...\},} $$
and the symbol $\in$ for elements of the set, like
$$\htmlData{tooltip=50 is in the naturals but 3.14159... is not in.}{50 \in \mathbb{N}, \text{ but } \pi \notin \mathbb{N}.}$$
We want to define sets by properties, like
$$\{ x \in \mathbb{N}, x > 50\},$$
the set of all natural numbers bigger than 50.
Russell's paradox occurs when you let sets be elements of themselves.
The set of all sets that do not contain themselves,
$$X = \{ x \in \text{Sets}, x \notin x \}$$
creates a non-question: is $X \in X$? If true, then false, and vice versa, just like
This sentence is false.
cannot be true nor false.
Religion encounters the same phenomenon in defining an all-powerful god, when you ask
Can God create a rock too heavy for God to lift?
If all-powerful, both creating and lifting
should work, a contradiction.
The crisis in math was resolved by enhancing the concept of sets. One such enhancement is
Type Theory. Types are just like sets, but there is a hierarchy that prevents Russell's paradox.
$\mathbb{N}$ is a Type in Lean. And regular Types of Type(0) are elements of a higher type, Type(1).
The type level in parentheses is called a universe, which organizes mathematical objects to maintain
logical consistency. Other systems to avoid Russell's paradox are used in other formalization
languages. Coq gets it name from calculus of constructions
, and HOL from higher-order logic
.
Lean uses Type Theory, which may be preferred by computer scientists who have a similar notion in data types, like Bool and Int. Computers crash when programs encounter contradictions, so formal verification, a way of checking programs by strict type-checking, is akin to formal mathematics. Basically computer scientists and mathematicians have the same problem with the same solution: the results are not perfectly trustworthy unless formalized.
Formalization is slow. Human language has developed for thousands if not millions of years, and human mathematicians have an arsenal of shortcuts still to teach the computers. The ratio of formal language to informal language in programming math is known as the de Bruijn factor. Professional mathematicians operate on the premise that they could explain everything formally, with painstaking detail, but there is a trade-off between progress and perfection. The de Bruijn factor tends to be between 1 and 10,000. In the Liquid Tensor Experiment, mathematician Peter Scholze stated a result in roughly 5 lines of human language that took 80,000 lines of code to formalize. The Lean language uses tactics to prune the gap, putting meticulous code into single words that help computers catch up to human shortcuts. The #print theorem command unravels tactics into fully formal computer language in case checking is desired. Artificial intelligence may discover a mathematical proof which is too long for humans to check, even in human language, so the trade-off betweeen trust and testing will always persist.
The mathematical proofs that AI finds will only be valuable if they are understandable to humans, which can happen to various degrees. A classic calculator can display about 10 digits of approximation to $\pi$, which would take a human infant quite a long time to learn individually and be a waste of time to do by hand. Trust is collective, and the people who make calculators can be trusted to implement circuits that do as advertised, including negative consequences for competitors who get it wrong. One common practical value of higher math is cryptographic, allowing you to buy things online. Perfect code cannot be hacked, but hackability is an imperfect test contingent on the skill and resources of the hacker. At Mathgod we endeavor to reduce the gap between computer and human understanding, championing transparency and explainability. We propose a scale that rates the gap. $\pi$ is a number known to humans for centuries if not millenia, so calculators that spit out digits of $\pi$ are a 1 out of 10 on our scale. Fermat's Last Theorem, actively being formalized, was proved without computers, so once formalized it also is 1 out of 10. If some result in fact turns out impossible to formalize, perhaps requiring a new language or philosophical choice, we rank it 0 out of 10 on the Mathgod scale (not intended as an insult). Some modern results, such as the Four Color Theorem, were, like estimating many digits of pi, too tedious to achieve by hand, but their acceptance is not as universal as digits of $\pi$ because the algorithms are more complicated and not understood by as many people. We rate those 2 out of 10. We intend the scale to have plenty of room at the top and be human-centric, but have scientific basis. Using the de Bruijn factor, recency of proof, and breadth of acceptance and practical value, we propose to rate computer proofs of mathematical results, as much a social exercise as a numerical one, inviting debate.
One time a person named Brown was looking at cells or dust or something under a microscope or floating in sunlight and noticed they were wobbly, which turned out to have a statistical pattern that Einstein later used to explain Brownian motion, part of his "miracle year" of publishing 4 papers all worthy of a Nobel. Mathematicians know a lot about Brownian motion. Kakutani proved that harmonic measure from complex function theory is the probability distribution of a random traveller, Brownian traveller if you will. The Laplacian being zero of an analytic function and the Cauchy-Riemann equations are founding members of the gang.
Brownian motion is a continuous-time random walk, and when a particle starts at a point $z = h$ in a domain $\Omega$ and stops upon hitting the boundary $\partial \Omega$, the probability distribution of its hitting location is known as the Harmonic Measure.
For instance, if a random walker starts at height $h$ in the right half-plane $\mathbb{H}$, the probability density of hitting the imaginary axis at position $y$ is exactly given by the Poisson kernel: $$P_h(y) = \frac{1}{\pi} \frac{h}{h^2 + y^2}$$
The beauty of Complex Analysis is that random walks are conformally invariant! By Riemann's Mapping Theorem, we can smoothly stretch domains like slits and disks into the half-plane, allowing us to compute these exact theoretical distributions for very complex shapes.
While the Harmonic Walker visualizer demonstrates these theorems
informally and empirically, we are in the process of auto-formalizing these rigorous statistical inference
results in Lean 4. You can see the formal stub in our codebase at
mathgod_lean/MathgodLean/HarmonicMeasure.lean.
The VanEck Sequence (also known as the Van Eck sequence) is a fascinating, self-referencing integer sequence first proposed by Jan Ritsema van Eck in 2010. It is defined as follows:
For a deep dive into its behavior and mystery, check out the famous Numberphile Video on the VanEck Sequence featuring Neil Sloane.
The core rule of the sequence is entirely about counting STEPS BACK to the last occurrence of the current number:
import Mathlib.Data.Nat.Basic
import Mathlib.Data.List.Basic
def vanEckStep (l : List โ) : List โ :=
match l with
| [] => [0]
| hd :: tl =>
let idx := tl.findIdx (ยท == hd)
if idx < tl.length then
(idx + 1) :: hd :: tl
else
0 :: hd :: tl
def vanEckList : โ โ List โ
| 0 => [0]
| n + 1 => vanEckStep (vanEckList n)
def vanEckNthTerm (n : โ) : โ :=
match vanEckList n with
| [] => 0
| hd :: _ => hdImagine transmitting a binary string over a noisy network, but instead of bits being flipped (substitution errors), a bit is completely dropped (a deletion error). This shifts all subsequent bits and destroys alignment!
Correcting deletion errors is notoriously difficult. The Varshamov-Tenengolts (VT) Codes provide an elegant mathematical solution to the single deletion problem using a weighted modulo checksum. While VT codes are asymptotically optimal, finding the absolute maximum size of a single deletion correcting code for any arbitrary finite length $n$ remains a deeply fascinating boundary problem in discrete mathematics (unsolved! if you solve it you'd be famous).
Abstract algebra is the study of algebraic structures such as groups, rings, and fields. Rather than studying specific numbers, we study the underlying symmetries and rules that govern operations.
A Group gives you a set and a single operation (like addition or composition) that is reversible, has an identity, and is associative. It's the mathematical language of symmetry.
Imagine a clock with only 3 hours: 0, 1, and 2. If you are at 2 and add 1, you wrap around back to 0. This is modular addition! It forms a simple Abelian (commutative) group.
| $+$ | 0 | 1 | 2 |
|---|---|---|---|
| 0 | 0 | 1 | 2 |
| 1 | 1 | 2 | 0 |
| 2 | 2 | 0 | 1 |
Take a physical square. You can rotate it by 90ยฐ, 180ยฐ, 270ยฐ, or flip it along its axes. There are exactly 8 such rigid motions. If you do one motion, then another, the result is always equivalent to a single motion. This forms a non-commutative group, because rotating then flipping is not the same as flipping then rotating!
| $\circ$ | $R_0$ | $R_{90}$ | $R_{180}$ | $R_{270}$ | $H$ | $V$ | $D_1$ | $D_2$ |
|---|---|---|---|---|---|---|---|---|
| $R_0$ | $R_0$ | $R_{90}$ | $R_{180}$ | $R_{270}$ | $H$ | $V$ | $D_1$ | $D_2$ |
| $R_{90}$ | $R_{90}$ | $R_{180}$ | $R_{270}$ | $R_0$ | $D_1$ | $D_2$ | $V$ | $H$ |
| $R_{180}$ | $R_{180}$ | $R_{270}$ | $R_0$ | $R_{90}$ | $V$ | $H$ | $D_2$ | $D_1$ |
| $R_{270}$ | $R_{270}$ | $R_0$ | $R_{90}$ | $R_{180}$ | $D_2$ | $D_1$ | $H$ | $V$ |
| $H$ | $H$ | $D_2$ | $V$ | $D_1$ | $R_0$ | $R_{180}$ | $R_{270}$ | $R_{90}$ |
| $V$ | $V$ | $D_1$ | $H$ | $D_2$ | $R_{180}$ | $R_0$ | $R_{90}$ | $R_{270}$ |
| $D_1$ | $D_1$ | $H$ | $D_2$ | $V$ | $R_{90}$ | $R_{270}$ | $R_0$ | $R_{180}$ |
| $D_2$ | $D_2$ | $V$ | $D_1$ | $H$ | $R_{270}$ | $R_{90}$ | $R_{180}$ | $R_0$ |
Read as: Row element applied first, then Column element.
$R_d$: Rotation by $d$ degrees clockwise. $H$: Horizontal flip. $V$: Vertical flip. $D_1$ / $D_2$: Diagonal flips.
F = Front (Unflipped), B = Back (Flipped). Corners: Yellow (0), Red (1), Green (2), Blue (3).
Note: $R_{90}$ and $H$ are generators of the group. Every other element can be built just by combining those two!
The "Monster" is the largest of the sporadic simple groups, containing $808,017,424,794,512,875,886,459,904,961,710,757,005,754,368,000,000,000$ elements! It acts as a symmetry group on a 196,883-dimensional space and is intimately tied to string theory and modular functions (Monstrous Moonshine).
A Ring is an Abelian group (under addition) that comes with a second operation (multiplication) that distributes over the first. Unlike group elements, ring elements don't always have multiplicative inverses (you can't always divide).
Just like our group example, but now we can multiply! The addition table is exactly the same, but the multiplication table adds a new layer.
| $+$ | 0 | 1 | 2 |
|---|---|---|---|
| 0 | 0 | 1 | 2 |
| 1 | 1 | 2 | 0 |
| 2 | 2 | 0 | 1 |
| $\times$ | 0 | 1 | 2 |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 2 |
| 2 | 0 | 2 | 1 |
Let's verify that multiplication distributes over addition: $a \times (b + c) = (a \times b) + (a \times c)$. Let $a=2$, $b=1$, $c=2$.
The classic ring. You can add, subtract, and multiply integers, and the result is always an integer. But you can't divide 3 by 2 and stay in the integers, which is why $\mathbb{Z}$ is a ring, but not a field.
Let's look at the polynomial ring $\mathbb{R}[x]$. The elements are polynomials. We have both additive and multiplicative parts.
Just as a group has normal subgroups, a ring has ideals. An ideal is a subset that absorbs multiplication (multiplying anything in the ideal by any polynomial keeps it trapped inside the ideal).
An affine algebraic variety defined by a set of polynomials $S$ is the set of all geometric points where every polynomial in $S$ evaluates exactly to zero.
Hilbert's Nullstellensatz proves there is a dictionary mapping Ideals directly to Geometric Varieties. If a geometric shape gets larger (e.g., a 0D point expands to a 1D line), its corresponding Algebraic Ideal gets smaller! When you manipulate the algebra, you are directly manipulating the geometry.