Skip to content
The Lumenary
Research pathwaysResearch orientation (stochastic processes and the probabilistic method assumed) 140 min

Random structures: walks, percolation and random geometry

A random walker is sure to come home on a street grid but may be lost forever in space; a random forest either burns locally or burns forever — and the boundary between the two regimes has a geometry of its own.

Formally verified · 18 LeanComputationally tested · 2 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

Will the walker come home?

In the early 1920s George Pólya, walking in the woods above Zürich, kept running into the same young couple, far more often than seemed polite. He wondered whether two random walkers on a grid of paths are bound to meet again and again — equivalently, whether a single random walker is bound to return to where it started. His answer (1921) is one of the most quoted theorems in probability: on the line and in the plane a simple random walk returns home with probability one; in three or more dimensions it does not. A remark often attributed to Shizuo Kakutani puts it memorably: a drunk man will find his way home, but a drunk bird may get lost forever.

Pólya's theorem is the entrance to a large territory where randomness creates shape. Let each pipe in a porous rock be open or blocked at random (Broadbent and Hammersley's model of a gas-mask filter, 1957): does water seep through? Join nn people by random acquaintances (Erdős and Rényi, 1959–60): is there a giant connected community? Let a random walk take smaller and faster steps: what does the limiting curve look like, and what is the shape of its outer boundary? All these systems have phase transitions — sharp thresholds where global behaviour changes abruptly — and at the threshold, beautiful random fractals appear. This lesson is an orientation: the classical theorems with full proofs, the deep theorems stated precisely, and the open problems marked as open.

IntuitionH

Counting returns, currents and clusters

Returns. A walk returns with probability one exactly when the expected number of returns is infinite. After 2n2n steps the chance of being at the origin of Zd\Z^d is about cd n−d/2c_d\, n^{-d/2} (by the central limit theorem, the walk has spread over a region of volume about nd/2n^{d/2}). The series ∑n−d/2\sum n^{-d/2} diverges for d≤2d \le 2 and converges for d≥3d \ge 3. That is the whole story, once each step is made rigorous.

Currents. Make every edge of the grid a 1 Ω1\,\Omega resistor and pump current from the origin to "infinity". If the total resistance to infinity is infinite, no current escapes, and the random walk — whose hitting probabilities are exactly the voltages — keeps coming back. In the plane the number of resistors in parallel at distance kk grows only like kk, so the resistances of successive shells add up like ∑1/k=∞\sum 1/k = \infty; in space they grow like k2k^2 and ∑1/k2<∞\sum 1/k^2 \lt \infty.

Clusters. In percolation, open edges form clusters. For small pp every cluster is finite: the number of possible long paths grows like 3n3^n, but each is open with probability pnp^n. For pp close to 11 the closed edges are rare and cannot surround the origin. In between lies a critical value pcp_c, which for the square lattice is exactly 12\frac12 — because the lattice is its own planar dual.

Analogy, not a formal construction

The resistor picture is not just an analogy: the voltage at xx when the origin is held at 11 volt and a far boundary at 00 is exactly the probability that a random walk from xx hits the origin before the boundary. Both are the unique harmonic function with those boundary values. The analogy is a theorem; what is heuristic above is only the shell-counting estimate.

DefinitionsH

Definitions

We assume stochastic processes (Markov chains, the strong Markov property, Brownian motion) and the probabilistic method; see also Markov chains.

Definition— simple random walk, recurrence and the Green function

On a connected, locally finite graph Γ\Gamma, simple random walk moves from xx to a uniformly chosen neighbour at each step. It is recurrent if, started at aa, it returns to aa with probability 11, and transient otherwise (this does not depend on aa). The Green function is G(a,a)=∑n≥0Pa(Sn=a)G(a, a) = \sum_{n \ge 0} P_a(S_n = a), the expected number of visits to aa. On Zd\Z^d we write u2n=P0(S2n=0)u_{2n} = P_0(S_{2n} = 0).

Definition— electrical network and effective resistance

Give each edge ee a conductance c(e)>0c(e) \gt 0 (resistance r(e)=1/c(e)r(e) = 1/c(e)). For disjoint vertex sets AA, ZZ of a finite network, the voltage vv with v=1v = 1 on AA, v=0v = 0 on ZZ and ∑y∼xc(xy)(v(y)−v(x))=0\sum_{y \sim x} c(xy)(v(y) - v(x)) = 0 elsewhere (harmonic) drives a total current II out of AA; the effective resistance is Reff(A↔Z)=1/IR_{\mathrm{eff}}(A \leftrightarrow Z) = 1/I. For an infinite network and an exhaustion by finite sets Γn\Gamma_n, Reff(a↔∞)=lim⁡nReff(a↔Γ∖Γn)R_{\mathrm{eff}}(a \leftrightarrow \infty) = \lim_n R_{\mathrm{eff}}(a \leftrightarrow \Gamma \setminus \Gamma_n).

Definition— bond percolation and the critical probability

In bond percolation with parameter p∈[0,1]p \in [0, 1] on a graph, each edge is open with probability pp and closed otherwise, independently. Open edges form open clusters. Let θ(p)=Pp(the open cluster of the origin is infinite)\theta(p) = P_p(\text{the open cluster of the origin is infinite}); it is non-decreasing in pp. The critical probability is pc=sup⁡{p:θ(p)=0}p_c = \sup\{p : \theta(p) = 0\}; by Kolmogorov's 0–1 law an infinite open cluster exists with probability 00 for p<pcp \lt p_c and 11 for p>pcp \gt p_c.

Definition— Erdős–Rényi random graph

G(n,p)G(n, p) has vertex set {1,…,n}\{1, \dots, n\}, each of the (n2)\binom n2 possible edges present independently with probability pp. A property holds with high probability (w.h.p.) if its probability tends to 11 as n→∞n \to \infty. The giant component regime is p=c/np = c/n with cc fixed.

Definition— Hausdorff dimension

For A⊂RdA \subset \R^d and s≥0s \ge 0, Hs(A)=lim⁡δ→0inf⁡{∑i(diam⁡Ui)s:A⊂⋃Ui, diam⁡Ui<δ}\mathcal{H}^s(A) = \lim_{\delta \to 0} \inf\{\sum_i (\operatorname{diam} U_i)^s : A \subset \bigcup U_i,\ \operatorname{diam} U_i \lt \delta\}, and dim⁡HA=inf⁡{s:Hs(A)=0}\dim_H A = \inf\{s : \mathcal{H}^s(A) = 0\}. A smooth curve has dimension 11; random fractals such as Brownian paths have larger, often non-integer, dimensions.

Worked examplesH

Examples

Example— The line ℤ

The walk on Z\Z is at 00 at time 2n2n exactly when nn of its 2n2n steps go right: u2n=(2nn)4−nu_{2n} = \binom{2n}{n}4^{-n}. Since (2nn)\binom{2n}{n} is the largest of the 2n+12n + 1 binomial coefficients (2nk)\binom{2n}{k}, which add up to 4n4^n, we get u2n≥12n+1u_{2n} \ge \frac{1}{2n+1}, and ∑u2n=∞\sum u_{2n} = \infty. Electrically, Z\Z is two half-lines of resistance ∞\infty each.

Example— The binary tree is transient

In the rooted binary tree each vertex has two children. The 2k2^k edges between generations k−1k - 1 and kk are in parallel and the generations are in series, so Reff(root↔∞)=∑k≥12−k=1<∞R_{\mathrm{eff}}(\text{root} \leftrightarrow \infty) = \sum_{k \ge 1} 2^{-k} = 1 \lt \infty: transient. Directly: from a non-root vertex the walk moves to its parent with probability 13\frac13, so the probability hh of ever reaching the parent solves h=13+23h2h = \frac13 + \frac23 h^2, whose relevant root is h=12h = \frac12. From the root the walk first steps to a child, so it never returns with probability 12\frac12 — matching the formula 1/(deg⁡(root) Reff)=121/(\deg(\text{root})\, R_{\mathrm{eff}}) = \frac12 of Theorem 3 below.

Example— Percolation on a tree is a branching process

On the rooted tree in which every vertex has bb children, the open cluster of the root is a Galton–Watson tree with Bin⁡(b,p)\operatorname{Bin}(b, p) offspring. It is infinite with positive probability exactly when the mean offspring bp>1bp \gt 1, so pc=1/bp_c = 1/b. The survival probability is the largest root of 1−θ=(1−pθ)b1 - \theta = (1 - p\theta)^b. The same mechanism — a branching process with mean cc — produces the giant component of G(n,c/n)G(n, c/n).

Example— The Wheatstone bridge is self-dual

Five resistors arranged as a Wheatstone bridge between two terminals have effective resistance 11 (by symmetry no current flows through the bridge). As a percolation problem, the bridge with each edge open with probability 12\frac12 connects the terminals with probability exactly 12\frac12: its planar dual is again a bridge, and exactly one of "the terminals are joined by open edges" and "the dual terminals are joined by closed dual edges" occurs. This is the case n=1n = 1 of the self-dual rectangles used in the second experiment, where the computer checks it by enumerating all 252^5 configurations (and all 2132^{13} for n=2n = 2).

ProofH

Pólya's theorem

Theorem— Theorem 1 — recurrence and the Green function

Simple random walk on Γ\Gamma started at aa is recurrent if and only if G(a,a)=∞G(a, a) = \infty. More precisely, if F=Pa(return to a)F = P_a(\text{return to } a), then G(a,a)=11−FG(a, a) = \frac{1}{1 - F} (read as ∞\infty when F=1F = 1).

Proof

Let N=#{n≥0:Sn=a}N = \#\{n \ge 0 : S_n = a\} be the number of visits, including time 00. By the strong Markov property at successive return times, P(N≥k+1)=F P(N≥k)P(N \ge k + 1) = F\, P(N \ge k), so P(N≥k)=Fk−1P(N \ge k) = F^{k-1}. Hence E[N]=∑k≥1P(N≥k)=∑k≥1Fk−1=11−FE[N] = \sum_{k \ge 1} P(N \ge k) = \sum_{k \ge 1} F^{k-1} = \frac{1}{1 - F}. On the other hand E[N]=∑nP(Sn=a)=G(a,a)E[N] = \sum_n P(S_n = a) = G(a, a) by linearity of expectation.

∎

Theorem— Theorem 2 — Pólya (1921)

Simple random walk on Zd\Z^d is recurrent for d=1,2d = 1, 2 and transient for d≥3d \ge 3.

Proof

d=1d = 1. As in the example, u2n=(2nn)4−n≥12n+1u_{2n} = \binom{2n}{n}4^{-n} \ge \frac{1}{2n+1}, and ∑12n+1=∞\sum \frac{1}{2n+1} = \infty.

d=2d = 2: the rotation trick. Write Sn=(Xn,Yn)S_n = (X_n, Y_n) and set Un=Xn+YnU_n = X_n + Y_n, Vn=Xn−YnV_n = X_n - Y_n. The four steps (±1,0),(0,±1)(\pm1, 0), (0, \pm1) become the four steps (±1,±1)(\pm1, \pm1) of (U,V)(U, V), each with probability 14\frac14 — that is, UU and VV are independent simple random walks on Z\Z. Since (x,y)↦(x+y,x−y)(x, y) \mapsto (x + y, x - y) is injective, S2n=0S_{2n} = 0 iff U2n=V2n=0U_{2n} = V_{2n} = 0, so

u2n(2)=((2nn)4−n)2.u^{(2)}_{2n} = \Big(\binom{2n}{n} 4^{-n}\Big)^2 .

Now 16n≤4n(2nn)216^n \le 4n\binom{2n}{n}^2 for n≥1n \ge 1, by induction: it holds for n=1n = 1 (16≤1616 \le 16), and using (n+1)(2n+2n+1)=2(2n+1)(2nn)(n+1)\binom{2n+2}{n+1} = 2(2n+1)\binom{2n}{n} the inductive step reduces to 4n(n+1)≤(2n+1)24n(n+1) \le (2n+1)^2. Hence u2n(2)≥14nu^{(2)}_{2n} \ge \frac{1}{4n} and ∑u2n(2)=∞\sum u^{(2)}_{2n} = \infty.

d=3d = 3. A closed walk of length 2n2n takes i,j,ki, j, k steps in each direction along the three axes and the same number back, with i+j+k=ni + j + k = n, so

u2n(3)=162n∑i+j+k=n(2n)!(i! j! k!)2=(2nn)14n∑i+j+k=n(n!i! j! k! 3n)2≤(2nn)14n max⁡i+j+k=nn!i! j! k! 3n,u^{(3)}_{2n} = \frac{1}{6^{2n}}\sum_{i+j+k=n} \frac{(2n)!}{(i!\,j!\,k!)^2} = \binom{2n}{n}\frac{1}{4^n}\sum_{i+j+k=n}\Big(\frac{n!}{i!\,j!\,k!\,3^n}\Big)^2 \le \binom{2n}{n}\frac{1}{4^n}\, \max_{i+j+k=n}\frac{n!}{i!\,j!\,k!\,3^n},

because the numbers n!i!j!k!3n\frac{n!}{i!j!k!3^n} are the probabilities of a trinomial distribution and sum to 11. The maximum is attained with i,j,ki, j, k as equal as possible, and Stirling's formula bounds it by C/nC/n. Together with (2nn)4−n≤1/2n+1\binom{2n}{n}4^{-n} \le 1/\sqrt{2n+1} (an induction like the one above) this gives u2n(3)≤C′n−3/2u^{(3)}_{2n} \le C' n^{-3/2}, which is summable.

d≥4d \ge 4. The first three coordinates of the walk on Zd\Z^d perform a lazy simple random walk on Z3\Z^3 (they move with probability 3/d3/d at each step), which is transient; if the walk on Zd\Z^d returned to 00 infinitely often, so would they.

∎

The proof for d=1,2d = 1, 2 is formalised in Lean below, apart from the probabilistic modelling (the formula for u2nu_{2n} and Theorem 1). For d=3d = 3 the Stirling step is cited, not proved. The first experiment computes G(N)=∑n≤Nu2nG(N) = \sum_{n \le N} u_{2n} for all three dimensions: it grows like 2N/π2\sqrt{N/\pi}, like 1πlog⁡N\frac{1}{\pi}\log N, and converges to Watson's constant 1.51641.5164, so the walk on Z3\Z^3 returns with probability 1−1/1.5164=0.34051 - 1/1.5164 = 0.3405.

Recurrent is not the same as "returns quickly". For the walk on Z\Z, the first return time TT satisfies P(T>2n)=u2nP(T \gt 2n) = u_{2n} (a classical reflection-principle identity; see Feller, Vol. I, Ch. III). So E[T]=2∑nu2n=∞E[T] = 2\sum_n u_{2n} = \infty: the walk returns with probability one, but the expected time it takes is infinite. In Lean, return_prob_tendsto_zero and return_1d_not_summable are exactly the two halves of this picture.

ProofH

Electrical networks

Let Γ\Gamma have unit conductances, so the walk is simple random walk.

Theorem— Theorem 3 — the electrical criterion

For a vertex aa of degree deg⁡(a)\deg(a), Pa(never return to a)=1deg⁡(a) Reff(a↔∞)P_a(\text{never return to } a) = \dfrac{1}{\deg(a)\, R_{\mathrm{eff}}(a \leftrightarrow \infty)}. In particular the walk is recurrent if and only if Reff(a↔∞)=∞R_{\mathrm{eff}}(a \leftrightarrow \infty) = \infty.

Proof

Fix a finite set Γn∋a\Gamma_n \ni a and let ZnZ_n be its outer boundary. Let v(x)=Px(hit a before Zn)v(x) = P_x(\text{hit } a \text{ before } Z_n). Then v(a)=1v(a) = 1, v=0v = 0 on ZnZ_n, and vv is harmonic elsewhere (condition on the first step), so it is the voltage of the definition. The current out of aa is I=∑y∼a(v(a)−v(y))=deg⁡(a)(1−1deg⁡(a)∑y∼av(y))=deg⁡(a) Pa(hit Zn before returning to a)I = \sum_{y \sim a}(v(a) - v(y)) = \deg(a)\big(1 - \frac{1}{\deg(a)}\sum_{y \sim a} v(y)\big) = \deg(a)\, P_a(\text{hit } Z_n \text{ before returning to } a). Hence Pa(hit Zn before returning)=1deg⁡(a)Reff(a↔Zn)P_a(\text{hit } Z_n \text{ before returning}) = \frac{1}{\deg(a) R_{\mathrm{eff}}(a \leftrightarrow Z_n)}. As n→∞n \to \infty these events decrease, and their intersection is "never return" up to a null set: almost surely, a walk that never returns to aa leaves every finite set, because staying in a finite set forever would mean visiting some vertex infinitely often, which forces a visit to aa. Meanwhile the resistances increase to Reff(a↔∞)R_{\mathrm{eff}}(a \leftrightarrow \infty).

∎

Two tools make the criterion usable, both proved in Doyle–Snell and Lyons–Peres (Ch. 2):

  • Rayleigh's monotonicity principle. Increasing any edge resistance does not decrease any effective resistance. So a subgraph of a recurrent graph is recurrent, and a graph containing a transient subgraph is transient — another proof that Zd\Z^d, d≥4d \ge 4, is transient once Z3\Z^3 is.
  • The Nash-Williams inequality (1959). If Π1,Π2,…\Pi_1, \Pi_2, \dots are disjoint sets of edges, each separating aa from infinity, then Reff(a↔∞)≥∑k∣Πk∣−1R_{\mathrm{eff}}(a \leftrightarrow \infty) \ge \sum_k |\Pi_k|^{-1}.

Z2\Z^2 again. Let Πk\Pi_k be the edges joining ∂[−k,k]2\partial[-k, k]^2 to ∂[−(k+1),k+1]2\partial[-(k+1), k+1]^2: there are 8k+48k + 4 of them, so Reff≥∑k18k+4=∞R_{\mathrm{eff}} \ge \sum_k \frac{1}{8k + 4} = \infty and the walk is recurrent. (The divergence is proved in Lean.)

Z3\Z^3 again. T. Lyons (1983) proved that a network is transient if and only if there is a unit flow from aa to infinity with finite energy ∑er(e) i(e)2\sum_e r(e)\, i(e)^2. Spreading a unit flow evenly over the roughly k2k^2 edges at distance kk gives energy about ∑kk2(k−2)2=∑kk−2<∞\sum_k k^2 (k^{-2})^2 = \sum_k k^{-2} \lt \infty. Making this precise requires some care with the cube's geometry (Lyons–Peres, Ch. 2); the convergence of ∑k−2\sum k^{-2} is in Mathlib.

ProofH

Percolation: the phase transition on ℤ²

Theorem— Lemma 4 — counting paths

The number σ(n)\sigma(n) of self-avoiding paths of length nn in Z2\Z^2 starting at the origin satisfies σ(n)≤4⋅3n−1\sigma(n) \le 4 \cdot 3^{n-1}.

Proof

There are 44 choices for the first step, and at most 33 for each later step, since a self-avoiding path cannot immediately reverse.

∎

(In fact σ(n)1/n→μ≈2.638\sigma(n)^{1/n} \to \mu \approx 2.638, the connective constant of Z2\Z^2, whose exact value is unknown.)

Theorem— Theorem 5 — a genuine phase transition (Broadbent–Hammersley, 1957, by Peierls' argument)

For bond percolation on Z2\Z^2, 13≤pc≤23\frac13 \le p_c \le \frac23. In particular there is a genuine phase transition: 0<pc<10 \lt p_c \lt 1.

Proof

Lower bound. If the origin lies in an infinite open cluster, then for every nn there is an open self-avoiding path of length nn from the origin. Each such path is open with probability pnp^n, so by the union bound and Lemma 4, θ(p)≤4⋅3n−1pn\theta(p) \le 4 \cdot 3^{n-1} p^n for every nn. If p<13p \lt \frac13 the right side tends to 00 (formalised as peierls_tendsto), so θ(p)=0\theta(p) = 0 and pc≥13p_c \ge \frac13.

Upper bound. Place the dual lattice Z2+(12,12)\Z^2 + (\frac12, \frac12) so that each dual edge crosses exactly one primal edge, and declare a dual edge closed when the primal edge it crosses is closed. Planar topology gives the key fact: if a finite set BB of vertices lies in a single open cluster, that cluster is finite if and only if some closed dual circuit surrounds BB. Let q=1−p<13q = 1 - p \lt \frac13 and Bm=[−m,m]2B_m = [-m, m]^2. A dual circuit of length nn surrounding BmB_m has n≥8m+4n \ge 8m + 4 and crosses the positive xx-axis at one of fewer than nn points; through each point there are at most 4⋅3n−14\cdot 3^{n-1} such circuits (Lemma 4 on the dual lattice). So

Pp(some closed dual circuit surrounds Bm)≤∑n≥8m+4n⋅4⋅3n−1qn→m→∞0,P_p(\text{some closed dual circuit surrounds } B_m) \le \sum_{n \ge 8m+4} n \cdot 4 \cdot 3^{n-1} q^n \xrightarrow[m \to \infty]{} 0,

as the tail of a convergent series (formalised as dual_circuits_summable). Fix mm with this probability less than 11. The event GmG_m that no closed dual circuit surrounds BmB_m depends only on edges outside BmB_m (a dual edge of a circuit surrounding BmB_m crosses an edge with an endpoint outside BmB_m), and the event FmF_m that all edges inside BmB_m are open depends only on edges inside. They are independent, both have positive probability, and on Fm∩GmF_m \cap G_m the origin lies in an infinite open cluster. So θ(p)≥P(Fm)P(Gm)>0\theta(p) \ge P(F_m)P(G_m) \gt 0, and pc≤23p_c \le \frac23.

∎

Kesten's theorem (1980). For bond percolation on Z2\Z^2, pc=12p_c = \frac12; moreover θ(12)=0\theta(\frac12) = 0 (Harris, 1960). The proof combines self-duality — at p=12p = \frac12 the dual configuration has the same law as the primal one, so suitably chosen rectangles are crossed with probability exactly 12\frac12 (the experiment checks this by exhaustive enumeration for small rectangles) — with the Russo–Seymour–Welsh theory (1978), which turns crossings of squares into crossings of long rectangles with probability bounded below, and a sharp-threshold argument showing that the crossing probabilities jump from near 00 to near 11 in a window around 12\frac12 that shrinks with the size. Modern proofs use the Kahn–Kalai–Linial influence inequality (Bollobás–Riordan, 2006) or the randomised-algorithm method of Duminil-Copin, Raoufi and Tassion (2019). For site percolation on Z2\Z^2 there is no self-duality and no known closed form: pcsite≈0.5927p_c^{\mathrm{site}} \approx 0.5927, an estimate from simulation and rigorous numerical bounds.

Random graphs (Erdős–Rényi, 1960). For G(n,c/n)G(n, c/n): if c<1c \lt 1, w.h.p. every component has O(log⁡n)O(\log n) vertices; if c>1c \gt 1, w.h.p. there is a unique giant component with (β+o(1))n(\beta + o(1))n vertices, where β∈(0,1)\beta \in (0,1) solves β=1−e−cβ\beta = 1 - e^{-c\beta}, and all other components have O(log⁡n)O(\log n) vertices; at c=1c = 1 the largest component has order n2/3n^{2/3}. The proof explores a component vertex by vertex; each newly found vertex has about Bin⁡(n,c/n)≈Poisson⁡(c)\operatorname{Bin}(n, c/n) \approx \operatorname{Poisson}(c) new neighbours, so the exploration is approximately a branching process with mean cc, whose survival probability β\beta solves the equation above. For c≤1c \le 1 that equation has no positive root (proved in Lean), matching the absence of a giant. The giant appears at p=1/np = 1/n; the graph becomes connected only much later, at p=(log⁡n)/np = (\log n)/n.

ExplanationH

Scaling limits: Brownian motion, SLE and random planar geometry

Brownian motion as a limit. Donsker's invariance principle (1951): the rescaled walk t↦S⌊nt⌋/nt \mapsto S_{\lfloor nt\rfloor}/\sqrt n converges in distribution to Brownian motion, whatever the step distribution (mean zero, finite variance). Pólya's theorem has a continuum twin: planar Brownian motion is neighbourhood-recurrent (it returns to every disc, though it hits a given point with probability zero), while Brownian motion in R3\R^3 is transient. Planar Brownian paths have Hausdorff dimension 22 (a classical result; see Mörters–Peres). Their outer boundary — the frontier of the path — was conjectured by Mandelbrot (1982), from simulations, to have dimension 43\frac43; Lawler, Schramm and Werner proved it (2001).

Schramm–Loewner evolution. Oded Schramm (2000) observed that a random curve in a planar domain which is conformally invariant and has a "domain Markov property" must be one of a one-parameter family SLEκ\mathrm{SLE}_\kappa, obtained by running Loewner's differential equation with driving function κ Bt\sqrt\kappa\, B_t. Established identifications of scaling limits:

  • loop-erased random walk → SLE2\mathrm{SLE}_2, uniform spanning tree Peano curve → SLE8\mathrm{SLE}_8 (Lawler–Schramm–Werner, 2004);
  • critical site percolation on the triangular lattice: Smirnov proved Cardy's formula and conformal invariance (2001), the exploration path converges to SLE6\mathrm{SLE}_6, and Smirnov and Werner derived critical exponents such as θ(p)=(p−12)5/36+o(1)\theta(p) = (p - \frac12)^{5/36 + o(1)} as p↓12p \downarrow \frac12 (2001);
  • interfaces of the critical Ising model → SLE3\mathrm{SLE}_3 (Smirnov and coauthors, around 2010).

Werner (2006), Smirnov (2010) and Duminil-Copin (2022) received Fields Medals for work in this area.

Random planar geometry. Uniformly random planar maps (graphs embedded in the sphere) with nn faces, with distances rescaled by n−1/4n^{-1/4}, converge to a random metric space, the Brownian map (Le Gall; Miermont, 2013), homeomorphic to the sphere and of Hausdorff dimension 44. Miller and Sheffield (2015–16) showed that the Brownian map is equivalent to Liouville quantum gravity with parameter 8/3\sqrt{8/3}, a random geometry built from the Gaussian free field.

Open problems (as of the references; check recent surveys):

  • Is θ(pc)=0\theta(p_c) = 0 for bond percolation on Z3\Z^3? Proved in dimension 22 and in high dimensions (Hara–Slade, 1990, d≥19d \ge 19; Fitzner–van der Hofstad, 2017, d≥11d \ge 11), open in 3≤d≤103 \le d \le 10.
  • Conformal invariance of critical bond percolation on Z2\Z^2. Smirnov's proof uses the special symmetry of the triangular lattice; universality, though widely believed, is open for Z2\Z^2.
  • The self-avoiding walk. Its scaling limit in the plane is conjectured to be SLE8/3\mathrm{SLE}_{8/3} and its connective constant on Z2\Z^2 is unknown; on the hexagonal lattice the connective constant is 2+2\sqrt{2 + \sqrt 2} (Duminil-Copin and Smirnov, 2012).
Formal mathematicsF

The exact mathematics in Lean

Mathlib has measure-theoretic probability but no random walks on lattices, percolation or random graphs; and the probabilistic modelling (formulas for u2nu_{2n}, Theorem 1, duality) would be a substantial project. What is formalised is the exact mathematics that the proofs above reduce to — the parts where the actual estimates live.

The bounds on central binomial coefficients, by induction, and the resulting divergence for Z\Z and Z2\Z^2:

four_pow_le_central_binomLean 4Applies a library theoremFormally verified
/-- `4ⁿ ≤ (2n + 1) · C(2n, n)`: the central binomial coefficient is the largest of the `2n + 1`
coefficients `C(2n, k)`, which sum to `4ⁿ`. This applies Mathlib's
`Nat.four_pow_le_two_mul_add_one_mul_centralBinom`. -/
theorem four_pow_le_central_binom (n : ℕ) : 4 ^ n ≤ (2 * n + 1) * centralBinom n :=
  Nat.four_pow_le_two_mul_add_one_mul_centralBinom n
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
central_binom_sq_lowerLean 4Proved here from basic factsFormally verified
/-- **Lower bound** `16ⁿ ≤ 4n · C(2n, n)²` for `n ≥ 1`, i.e. `C(2n, n)/4ⁿ ≥ 1/(2√n)`. Induction
using `(n + 1) C(2n+2, n+1) = 2(2n + 1) C(2n, n)` and `4n(n + 1) ≤ (2n + 1)²`. -/
theorem central_binom_sq_lower : ∀ n : ℕ, 1 ≤ n → 16 ^ n ≤ 4 * n * (centralBinom n) ^ 2 := by
  intro n hn
  induction n with
  | zero => omega
  | succ m ih =>
    rcases Nat.eq_zero_or_pos m with h | h
    · subst h; simp [centralBinom]
    · have ih' := ih h
      have key := Nat.succ_mul_centralBinom_succ m
      -- multiply the target by (m + 1)², then use the recursion and the induction hypothesis
      have h2 : 16 ^ (m + 1) * (m + 1) ^ 2 ≤
          4 * (m + 1) * (centralBinom (m + 1)) ^ 2 * (m + 1) ^ 2 := by
        have e : 4 * (m + 1) * (centralBinom (m + 1)) ^ 2 * (m + 1) ^ 2 =
            4 * (m + 1) * ((m + 1) * centralBinom (m + 1)) ^ 2 := by ring
        rw [e, key]
        have : 16 ^ (m + 1) * (m + 1) ^ 2 = 16 * 16 ^ m * (m + 1) ^ 2 := by ring
        rw [this]
        calc 16 * 16 ^ m * (m + 1) ^ 2 ≤ 16 * (4 * m * centralBinom m ^ 2) * (m + 1) ^ 2 := by
              gcongr
          _ ≤ 4 * (m + 1) * (2 * (2 * m + 1) * centralBinom m) ^ 2 := by
              have : 4 * m * (m + 1) ≤ (2 * m + 1) ^ 2 := by nlinarith
              nlinarith [Nat.zero_le (centralBinom m ^ 2), this]
      exact Nat.le_of_mul_le_mul_right h2 (by positivity)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
central_binom_sq_upperLean 4Proved here from basic factsFormally verified
/-- **Upper bound** `(2n + 1) · C(2n, n)² ≤ 16ⁿ`, i.e. `C(2n, n)/4ⁿ ≤ 1/√(2n + 1)`. Induction using
the same recursion and `(2n + 1)(2n + 3) ≤ 4(n + 1)²`. -/
theorem central_binom_sq_upper : ∀ n : ℕ, (2 * n + 1) * (centralBinom n) ^ 2 ≤ 16 ^ n := by
  intro n
  induction n with
  | zero => simp
  | succ m ih =>
    have key := Nat.succ_mul_centralBinom_succ m
    have h2 : (2 * (m + 1) + 1) * (centralBinom (m + 1)) ^ 2 * (m + 1) ^ 2 ≤
        16 ^ (m + 1) * (m + 1) ^ 2 := by
      have e : (2 * (m + 1) + 1) * (centralBinom (m + 1)) ^ 2 * (m + 1) ^ 2 =
          (2 * m + 3) * ((m + 1) * centralBinom (m + 1)) ^ 2 := by ring
      rw [e, key]
      have e2 : (2 * m + 3) * (2 * (2 * m + 1) * centralBinom m) ^ 2 =
          4 * (2 * m + 3) * (2 * m + 1) * ((2 * m + 1) * centralBinom m ^ 2) := by ring
      rw [e2]
      calc 4 * (2 * m + 3) * (2 * m + 1) * ((2 * m + 1) * centralBinom m ^ 2)
          ≤ 4 * (2 * m + 3) * (2 * m + 1) * 16 ^ m := by gcongr
        _ ≤ 16 ^ (m + 1) * (m + 1) ^ 2 := by
          have : (2 * m + 3) * (2 * m + 1) ≤ 4 * (m + 1) ^ 2 := by nlinarith
          have h16 : 16 ^ (m + 1) = 16 * 16 ^ m := by ring
          rw [h16]
          nlinarith [Nat.zero_le (16 ^ m)]
    exact Nat.le_of_mul_le_mul_right h2 (by positivity)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
not_summable_one_div_two_mul_add_oneLean 4Proved here from basic factsFormally verified
/-- `∑ 1/(2n + 1)` diverges: it dominates half the harmonic series, `1/(n + 1) ≤ 2/(2n + 1)`, and
Mathlib knows that `∑ 1/n` diverges (`Real.not_summable_one_div_natCast`). -/
theorem not_summable_one_div_two_mul_add_one :
    ¬ Summable (fun n : ℕ => (1 : ℝ) / (2 * n + 1)) := by
  intro h
  have h2 : Summable (fun n : ℕ => (1 : ℝ) / ((n + 1 : ℕ) : ℝ)) := by
    refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) (h.mul_left 2)
    push_cast
    rw [div_le_iff₀ (by positivity)]
    field_simp
    nlinarith
  exact Real.not_summable_one_div_natCast ((summable_nat_add_iff 1).mp h2)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
return_1d_not_summableLean 4Proved here from basic factsFormally verified
/-- **Pólya in dimension 1, analytically.** The probability that simple random walk on ℤ is at
the origin at time `2n` is `p₂ₙ = C(2n, n)/4ⁿ`, and `∑ p₂ₙ` (the expected number of returns)
diverges, because `p₂ₙ ≥ 1/(2n + 1)`. By the criterion proved in the lesson (Theorem 1), the
walk is recurrent. -/
theorem return_1d_not_summable :
    ¬ Summable (fun n : ℕ => (centralBinom n : ℝ) / 4 ^ n) := by
  intro h
  apply not_summable_one_div_two_mul_add_one
  refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) h
  have hle : (4 : ℝ) ^ n ≤ (2 * n + 1) * centralBinom n := by
    exact_mod_cast four_pow_le_central_binom n
  rw [div_le_div_iff₀ (by positivity) (by positivity)]
  linarith
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
return_2d_not_summableLean 4Proved here from basic factsFormally verified
/-- **Pólya in dimension 2, analytically.** On ℤ² the return probability at time `2n` is
`(C(2n, n)/4ⁿ)²` (by the rotation trick below), and `∑ (C(2n, n)/4ⁿ)²` diverges, because by
`central_binom_sq_lower` each term is at least `1/(4n)`. -/
theorem return_2d_not_summable :
    ¬ Summable (fun n : ℕ => ((centralBinom n : ℝ) / 4 ^ n) ^ 2) := by
  intro h
  have h1 : Summable (fun n : ℕ => (1 : ℝ) / ((n + 1 : ℕ) : ℝ)) := by
    have h' := (summable_nat_add_iff 1).mpr h
    refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) (h'.mul_left 4)
    have hlow : (16 : ℝ) ^ (n + 1) ≤
        4 * ((n + 1 : ℕ) : ℝ) * (centralBinom (n + 1) : ℝ) ^ 2 := by
      exact_mod_cast central_binom_sq_lower (n + 1) (by omega)
    have h16 : ((4 : ℝ) ^ (n + 1)) ^ 2 = 16 ^ (n + 1) := by
      rw [← pow_mul, mul_comm, pow_mul]; norm_num
    have hpos : (0 : ℝ) < ((n + 1 : ℕ) : ℝ) := by positivity
    simp only [div_pow, h16]
    rw [div_le_iff₀ hpos,
      show 4 * ((centralBinom (n + 1) : ℝ) ^ 2 / 16 ^ (n + 1)) * ((n + 1 : ℕ) : ℝ)
        = 4 * ((n + 1 : ℕ) : ℝ) * (centralBinom (n + 1) : ℝ) ^ 2 / 16 ^ (n + 1) by ring,
      le_div_iff₀ (by positivity)]
    linarith
  exact Real.not_summable_one_div_natCast ((summable_nat_add_iff 1).mp h1)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
return_prob_tendsto_zeroLean 4Proved here from basic factsFormally verified
/-- Yet `p₂ₙ = C(2n, n)/4ⁿ → 0`: by `central_binom_sq_upper`, `p₂ₙ² ≤ 1/(2n + 1)`. The walk on ℤ
returns with probability one, but the chance of being home at any given late time is small — one
reason the expected return time is infinite. -/
theorem return_prob_tendsto_zero :
    Tendsto (fun n : ℕ => (centralBinom n : ℝ) / 4 ^ n) atTop (𝓝 0) := by
  have hsq : Tendsto (fun n : ℕ => ((centralBinom n : ℝ) / 4 ^ n) ^ 2) atTop (𝓝 0) := by
    refine squeeze_zero (fun n => by positivity) (fun n => ?_)
      tendsto_one_div_add_atTop_nhds_zero_nat
    have hup : (2 * (n : ℝ) + 1) * (centralBinom n : ℝ) ^ 2 ≤ 16 ^ n := by
      exact_mod_cast central_binom_sq_upper n
    have h16 : ((4 : ℝ) ^ n) ^ 2 = 16 ^ n := by
      rw [← pow_mul, mul_comm, pow_mul]; norm_num
    rw [div_pow, h16, div_le_div_iff₀ (by positivity) (by positivity)]
    nlinarith [sq_nonneg (centralBinom n : ℝ)]
  have h := hsq.sqrt
  simp only [Real.sqrt_zero] at h
  refine h.congr (fun n => ?_)
  exact Real.sqrt_sq (by positivity)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor

The rotation trick: the map, the bijection of steps, and the characterisation of closed paths.

rotLean 4Formally verified
/-- The 45° rotation (and scaling by `√2`) `(x, y) ↦ (x + y, x − y)` of ℤ², as an additive map. -/
def rot : ℤ × ℤ →+ ℤ × ℤ where
  toFun v := (v.1 + v.2, v.1 - v.2)
  map_zero' := by simp
  map_add' u v := by ext <;> simp <;> ring
Axioms used: propextformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
rot_injectiveLean 4Proved here from basic factsFormally verified
/-- The rotation is injective: from `x + y` and `x − y` one recovers `x` and `y`. -/
theorem rot_injective : Function.Injective rot := by
  intro u v h
  simp only [rot, AddMonoidHom.coe_mk, ZeroHom.coe_mk, Prod.mk.injEq] at h
  ext <;> omega
Axioms used: propext, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
unitStepsLean 4Formally verified
/-- The four unit steps of simple random walk on ℤ². -/
def unitSteps : Finset (ℤ × ℤ) := {(1, 0), (-1, 0), (0, 1), (0, -1)}
Axioms used: propext, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
diagStepsLean 4Formally verified
/-- The four diagonal steps `(±1, ±1)`: a pair of independent `±1` steps. -/
def diagSteps : Finset (ℤ × ℤ) := {(1, 1), (-1, -1), (1, -1), (-1, 1)}
Axioms used: propext, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
rot_unit_stepsLean 4Proved here from basic factsFormally verified
/-- The rotation maps the four unit steps bijectively onto the four diagonal steps (checked by
`decide`; injectivity is `rot_injective`). So a uniformly random unit step becomes a pair of
*independent* uniform `±1` steps, and simple random walk on ℤ² becomes two independent simple
random walks on ℤ. -/
theorem rot_unit_steps : unitSteps.image rot = diagSteps := by
  decide
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
closed_iff_rotLean 4Proved here from basic factsFormally verified
/-- A planar path (a list of steps) returns to the origin iff **both** rotated coordinate walks do.
With `rot_unit_steps` this gives `P(S₂ₙ = 0 in ℤ²) = P(S₂ₙ = 0 in ℤ)² = (C(2n, n)/4ⁿ)²`. -/
theorem closed_iff_rot (L : List (ℤ × ℤ)) :
    L.sum = 0 ↔ ((L.map rot).map Prod.fst).sum = 0 ∧ ((L.map rot).map Prod.snd).sum = 0 := by
  have e1 : ((L.map rot).map Prod.fst).sum = (rot L.sum).1 := by
    rw [map_list_sum rot L]
    exact (map_list_sum (AddMonoidHom.fst ℤ ℤ) _).symm
  have e2 : ((L.map rot).map Prod.snd).sum = (rot L.sum).2 := by
    rw [map_list_sum rot L]
    exact (map_list_sum (AddMonoidHom.snd ℤ ℤ) _).symm
  rw [e1, e2]
  constructor
  · intro h
    simp [h]
  · rintro ⟨h1, h2⟩
    apply rot_injective
    rw [map_zero]
    exact Prod.ext h1 h2
Axioms used: propext, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor

Electrical networks: Nash-Williams for Z2\Z^2, and the series behind transience of Z3\Z^3.

nash_williams_divergesLean 4Proved here from basic factsFormally verified
/-- **The Nash-Williams series for ℤ² diverges.** The edges joining the boundary of the box
`[-k, k]²` to the boundary of `[-(k+1), k+1]²` form a cutset of `8k + 4` unit resistors; the
Nash-Williams inequality gives `R_eff(0 ↔ ∞) ≥ ∑ₖ 1/(8k + 4) = ∞`, so the walk on ℤ² is
recurrent. Proof: compare with the harmonic series. -/
theorem nash_williams_diverges : ¬ Summable (fun k : ℕ => (1 : ℝ) / (8 * k + 4)) := by
  intro h
  have h2 : Summable (fun n : ℕ => (1 : ℝ) / ((n + 1 : ℕ) : ℝ)) := by
    refine Summable.of_nonneg_of_le (fun n => by positivity) (fun n => ?_) (h.mul_left 8)
    push_cast
    rw [div_le_iff₀ (by positivity)]
    field_simp
    nlinarith
  exact Real.not_summable_one_div_natCast ((summable_nat_add_iff 1).mp h2)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
summable_inv_sqLean 4Applies a library theoremFormally verified
/-- `∑ 1/n²` converges. In ℤ³ a unit flow from the origin spread evenly over spheres has energy
comparable to `∑ₖ k² · (1/k²)² = ∑ 1/k²`, finite, so by T. Lyons' criterion the walk on ℤ³ is
transient. This applies Mathlib's `Real.summable_one_div_nat_pow`. -/
theorem summable_inv_sq : Summable (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 2) :=
  Real.summable_one_div_nat_pow.mpr one_lt_two
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor

Peierls' argument, with the path count of Lemma 4 as a hypothesis:

peierls_tendstoLean 4Proved here from basic factsFormally verified
/-- **Peierls' estimate.** If there are at most `cₙ ≤ 4 · 3ⁿ` self-avoiding paths of length `n`
from the origin and each is open with probability `pⁿ`, then for `p < 1/3` the expected number of
open such paths, at most `cₙ pⁿ ≤ 4(3p)ⁿ`, tends to `0`. So the origin lies in an infinite open
cluster with probability `0`, and `p_c(ℤ²) ≥ 1/3`. (The count `cₙ ≤ 4 · 3^{n-1}` is proved in the
lesson; here it is a hypothesis.) -/
theorem peierls_tendsto {c : ℕ → ℕ} (hc : ∀ n, c n ≤ 4 * 3 ^ n) {p : ℝ} (hp0 : 0 ≤ p)
    (hp : p < 1 / 3) : Tendsto (fun n => (c n : ℝ) * p ^ n) atTop (𝓝 0) := by
  have h3 : 3 * p < 1 := by linarith
  have hlim : Tendsto (fun n : ℕ => 4 * (3 * p) ^ n) atTop (𝓝 0) := by
    simpa using (tendsto_pow_atTop_nhds_zero_of_lt_one (by linarith) h3).const_mul 4
  refine squeeze_zero (fun n => by positivity) (fun n => ?_) hlim
  have : (c n : ℝ) ≤ 4 * 3 ^ n := by exact_mod_cast hc n
  calc (c n : ℝ) * p ^ n ≤ (4 * 3 ^ n) * p ^ n := by gcongr
    _ = 4 * (3 * p) ^ n := by ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor
dual_circuits_summableLean 4Applies a library theoremFormally verified
/-- **The dual half of Peierls' argument.** The number of dual circuits of length `n` surrounding
the origin is at most `n · 4 · 3ⁿ`, and each is closed with probability `qⁿ`, `q = 1 − p`. For
`q < 1/3` the series `∑ n · 4 · 3ⁿ qⁿ` converges, so its tails tend to `0`; this gives
`p_c(ℤ²) ≤ 2/3`. Uses Mathlib's `summable_pow_mul_geometric_of_norm_lt_one`. -/
theorem dual_circuits_summable {q : ℝ} (hq0 : 0 ≤ q) (hq : q < 1 / 3) :
    Summable (fun n : ℕ => (n : ℝ) * 4 * 3 ^ n * q ^ n) := by
  have h := summable_pow_mul_geometric_of_norm_lt_one 1 (r := 3 * q)
    (by rw [Real.norm_eq_abs, abs_lt]; constructor <;> linarith)
  refine (h.mul_left 4).congr (fun n => ?_)
  ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor

And the subcritical random graph:

no_giant_subcriticalLean 4Proved here from basic factsFormally verified
/-- **No giant component for `c ≤ 1`.** The fraction `β` of vertices of `G(n, c/n)` in the giant
component satisfies, in the limit, the survival equation of a Poisson(`c`) branching process,
`β = 1 − e^{−cβ}`. For `c ≤ 1` its only solution `β ≥ 0` is `β = 0`, because `1 − e^{−x} < x` for
`x > 0` (from Mathlib's `Real.add_one_lt_exp`). For `c > 1` a second, positive root appears. -/
theorem no_giant_subcritical {c β : ℝ} (hc : c ≤ 1) (hc0 : 0 ≤ c) (hβ : 0 ≤ β)
    (h : β = 1 - Real.exp (-(c * β))) : β = 0 := by
  by_contra hne
  have hpos : 0 < β := lt_of_le_of_ne hβ (Ne.symm hne)
  rcases eq_or_lt_of_le hc0 with hc0' | hc0'
  · subst hc0'
    simp at h
    exact hne h
  · have hx : 0 < c * β := mul_pos hc0' hpos
    have := Real.add_one_lt_exp (show -(c * β) ≠ 0 by linarith)
    nlinarith
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/RandomGeometry.leanTry it in the Lean web editor

Not formalised: the random walk as a stochastic process and Theorem 1; the identification of P(S2n=0)P(S_{2n} = 0) with the counts used here; the d=3d = 3 Stirling estimate; electrical networks and the Nash-Williams inequality itself; Lemma 4 and planar duality; Kesten's theorem; the Erdős–Rényi theorem; Brownian motion's path properties and SLE. Formalising planar duality for percolation would need a discrete Jordan curve theorem — a good project for an ambitious learner.

ComputationC

Return probabilities, crossings and giants, computed

The first experiment checks the rotation trick by brute force (all 42n4^{2n} walks of length 2n≤82n \le 8) and then sums exact return probabilities. In d=3d = 3 it uses the formula obtained by conditioning on the number of vertical steps, and compares the partial sums — and a tail correction based on u2n∼2(34πn)3/2u_{2n} \sim 2\big(\frac{3}{4\pi n}\big)^{3/2} — with Watson's closed form G=632π3Γ(124)Γ(524)Γ(724)Γ(1124)G = \frac{\sqrt6}{32\pi^3}\Gamma(\frac1{24})\Gamma(\frac5{24})\Gamma(\frac7{24})\Gamma(\frac{11}{24}) (Watson, 1939, in the form given by Glasser and Zucker, 1977).

Polya's theorem: return probabilities in dimensions 1, 2 and 3PythonExhaustive finite checkNumerical approximationComputationally tested
"""Polya's theorem by exact return probabilities.

Simple random walk on Z^d is recurrent exactly when the expected number of
returns to the origin, G = sum_n u_2n with u_2n = P(S_2n = 0), is infinite.
We compute u_2n exactly or to floating-point accuracy:

    d = 1:  u_2n = C(2n, n) / 4^n
    d = 2:  u_2n = (C(2n, n) / 4^n)^2          (the 45-degree rotation trick)
    d = 3:  condition on the number 2j of vertical steps:
            u_2n = sum_j C(2n, 2j) (1/3)^(2j) (2/3)^(2n-2j) u1_2j u2_(2n-2j)

and watch the partial sums G(N): they grow like sqrt(N) in d = 1, like
log(N)/pi in d = 2, and converge in d = 3, to Watson's constant
G = sqrt(6)/(32 pi^3) Gamma(1/24) Gamma(5/24) Gamma(7/24) Gamma(11/24),
so the walk returns with probability 1 - 1/G = 0.3405... We also check the
rotation trick exhaustively for short walks.

Evidence: exact counting for short walks (exhaustive-finite) and
floating-point summation of exact formulas (numerical). Finite partial sums
cannot prove divergence; the proofs are in the lesson and in Lean.
"""

import itertools
import math

STEPS2 = [(1, 0), (-1, 0), (0, 1), (0, -1)]

def closed_walks_2d(n):
    """Number of walks of length 2n on Z^2 that end at the origin (brute force)."""
    count = 0
    for walk in itertools.product(STEPS2, repeat=2 * n):
        if sum(s[0] for s in walk) == 0 and sum(s[1] for s in walk) == 0:
            count += 1
    return count

def u1(n_max):
    """[u_0, u_2, ..., u_2n_max] for d = 1, via u_2n+2 = u_2n (2n+1)/(2n+2)."""
    u = [1.0]
    for n in range(n_max):
        u.append(u[-1] * (2 * n + 1) / (2 * n + 2))
    return u

def u3(n_max, one=None):
    """Return probabilities u_2n of simple random walk on Z^3, n <= n_max."""
    one = one if one is not None else u1(n_max)
    two = [x * x for x in one]
    out = []
    for n in range(n_max + 1):
        total = 0.0
        # term for j vertical pairs: C(2n,2j) (1/3)^2j (2/3)^(2n-2j) one[j] two[n-j]
        log_c = 0.0  # log C(2n, 2j), updated multiplicatively
        for j in range(n + 1):
            if j > 0:
                a = 2 * n - 2 * j + 2
                log_c += math.log(a * (a - 1) / ((2 * j) * (2 * j - 1)))
            weight = math.exp(log_c + 2 * j * math.log(1 / 3)
                              + (2 * n - 2 * j) * math.log(2 / 3))
            total += weight * one[j] * two[n - j]
        out.append(total)
    return out

def watson_constant():
    """G(Z^3) = sqrt(6)/(32 pi^3) Gamma(1/24)Gamma(5/24)Gamma(7/24)Gamma(11/24)."""
    g = math.gamma
    return (math.sqrt(6) / (32 * math.pi ** 3)
            * g(1 / 24) * g(5 / 24) * g(7 / 24) * g(11 / 24))

def partial_sums(u, checkpoints):
    """{N: sum_{n=0}^{N} u_2n} at the given N."""
    out, s = {}, 0.0
    for n, x in enumerate(u):
        s += x
        if n in checkpoints:
            out[n] = s
    return out

def main():
    print("Exhaustive check of the rotation trick on Z^2:")
    for n in range(1, 5):
        print(f"  closed walks of length {2 * n}: {closed_walks_2d(n):>5}"
              f"   C({2 * n},{n})^2 = {math.comb(2 * n, n) ** 2:>5}")
    big, small = 100000, 1200
    one = u1(big)
    g1 = partial_sums(one, {100, 1000, 10000, 100000})
    g2 = partial_sums([x * x for x in one], {100, 1000, 10000, 100000})
    g3 = partial_sums(u3(small, one), {100, 300, 1200})
    print()
    print("Expected number of visits to 0 up to time 2N, G(N) = sum u_2n:")
    print(f"{'N':>8}{'d = 1':>11}{'2 sqrt(N/pi)':>14}{'d = 2':>9}"
          f"{'log(N)/pi':>11}")
    for n in sorted(g1):
        print(f"{n:>8}{g1[n]:>11.2f}{2 * math.sqrt(n / math.pi):>14.2f}"
              f"{g2[n]:>9.3f}{math.log(n) / math.pi:>11.3f}")
    c3 = 4 * (3 / (4 * math.pi)) ** 1.5  # tail ~ c3 / sqrt(N)
    print(f"{'N':>8}{'d = 3':>11}{'+ tail est.':>14}")
    for n in sorted(g3):
        print(f"{n:>8}{g3[n]:>11.5f}{g3[n] + c3 / math.sqrt(n):>14.5f}")
    w = watson_constant()
    print(f"Watson's exact value G = {w:.7f}; return probability "
          f"1 - 1/G = {1 - 1 / w:.6f}")
    print()
    print("Epistemic status: the first table is an exhaustive count (exact);")
    print("the others sum exact formulas in floating point. Partial sums that")
    print("grow, or seem to settle, cannot by themselves prove divergence or")
    print("convergence; the d = 1, 2 divergence is proved in the lesson and in")
    print("Lean, and d = 3 convergence in the lesson (by an estimate).")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second experiment estimates by simulation the probability of an open left–right crossing of the self-dual (L+1)×L(L + 1) \times L rectangle for several pp, showing the curve sharpening around 12\frac12 as LL grows — and staying at 12\frac12 at p=12p = \frac12, as self-duality requires. Then it measures the largest component of random graphs with 20002000 vertices and average degree cc, against the branching-process prediction β(c)\beta(c).

Percolation crossings and the Erdos-Renyi giant componentPythonStatistical evidenceExperimental evidenceComputationally tested
"""Phase transitions: bond percolation on a grid and the giant component.

Part 1. Bond percolation on a square grid: each edge is open with
probability p. We estimate by simulation the probability that open edges
connect the left side of an (L + 1) x L rectangle to its right side. As L
grows the curve sharpens into a step at p = 1/2, Kesten's critical value;
at p = 1/2 the crossing probability is exactly 1/2 for every L, because the
rectangle is chosen to be self-dual.

Part 2. The Erdos-Renyi random graph with n vertices and m = c n / 2 random
edges (asymptotically the same as G(n, c/n)). The largest component has a
vanishing fraction of the vertices when c < 1 and a fraction close to the
positive root beta of beta = 1 - exp(-c beta) when c > 1.

Evidence: statistical (Monte Carlo with a fixed seed, small sizes and few
trials, with approximate standard errors). Simulations near a critical
point estimate behaviour; the exact critical values are theorems.
"""

import math
import random

def find(parent, x):
    """Root of x in a union-find forest, with path halving."""
    while parent[x] != x:
        parent[x] = parent[parent[x]]
        x = parent[x]
    return x

def union(parent, size, a, b):
    """Merge the components of a and b (union by size)."""
    ra, rb = find(parent, a), find(parent, b)
    if ra == rb:
        return
    if size[ra] < size[rb]:
        ra, rb = rb, ra
    parent[rb] = ra
    size[ra] += size[rb]

def crosses(n, p, rng):
    """Is there an open left-right crossing of the self-dual rectangle R_n?

    R_n has n interior columns x = 1..n and n + 1 rows y = 0..n. Each row
    has n + 1 horizontal edges, from the left side (x = 0) through the
    interior to the right side (x = n + 1), and each interior column has n
    vertical edges. Its planar dual is a rotated copy of R_n, so at p = 1/2
    a crossing occurs with probability exactly 1/2.
    """
    count = n * (n + 1) + 2
    parent, size = list(range(count)), [1] * count
    left, right = count - 2, count - 1

    def node(x, y):
        return y * n + (x - 1)

    for y in range(n + 1):
        if rng.random() < p:
            union(parent, size, left, node(1, y))
        if rng.random() < p:
            union(parent, size, node(n, y), right)
        for x in range(1, n):
            if rng.random() < p:
                union(parent, size, node(x, y), node(x + 1, y))
    for x in range(1, n + 1):
        for y in range(n):
            if rng.random() < p:
                union(parent, size, node(x, y), node(x, y + 1))
    return find(parent, left) == find(parent, right)

def crossing_probability(n, p, trials, rng):
    """Fraction of trials with an open left-right crossing."""
    return sum(crosses(n, p, rng) for _ in range(trials)) / trials

def largest_component_fraction(n, c, rng):
    """Largest component of a random graph with n vertices and c n / 2 edges."""
    parent, size = list(range(n)), [1] * n
    for _ in range(round(c * n / 2)):
        a, b = rng.randrange(n), rng.randrange(n)
        if a != b:
            union(parent, size, a, b)
    return max(size[find(parent, v)] for v in range(n)) / n

def giant_fraction(c, iterations=200):
    """Largest root of beta = 1 - exp(-c beta) in [0, 1].

    For c <= 1 the only root is 0 (proved in the lesson's Lean file); for
    c > 1 iterating beta -> 1 - exp(-c beta) from beta = 1 converges to the
    positive root.
    """
    if c <= 1:
        return 0.0
    beta = 1.0
    for _ in range(iterations):
        beta = 1 - math.exp(-c * beta)
    return beta

def main():
    rng = random.Random(1957)
    ps = [0.35, 0.45, 0.5, 0.55, 0.65]
    trials = 200
    print(f"Part 1: P(left-right open crossing), {trials} trials per entry")
    print("  p    " + "".join(f"{p:>8}" for p in ps))
    for n in [8, 24]:
        est = [crossing_probability(n, p, trials, rng) for p in ps]
        print(f"  L = {n:<3}" + "".join(f"{e:>8.2f}" for e in est))
    print(f"  (standard error of each entry at most about "
          f"{0.5 / math.sqrt(trials):.2f})")
    print()
    n, reps = 2000, 5
    print(f"Part 2: random graph, n = {n} vertices, average degree c "
          f"({reps} samples)")
    print(f"  {'c':>4}{'largest component / n':>24}{'beta(c) theory':>17}")
    for c in [0.5, 0.9, 1.5, 2.0, 3.0]:
        sim = sum(largest_component_fraction(n, c, rng)
                  for _ in range(reps)) / reps
        print(f"  {c:>4}{sim:>24.3f}{giant_fraction(c):>17.3f}")
    print("  (for c < 1 the largest component has O(log n) vertices,")
    print("  so its fraction tends to 0 only slowly as n grows)")
    print()
    print("Epistemic status: Monte Carlo estimates from a few hundred random")
    print("samples on small systems (statistical evidence). They are")
    print("consistent with Kesten's theorem p_c = 1/2 and the Erdos-Renyi")
    print("theorem, but cannot determine critical values or exponents exactly.")

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The first experiment is exhaustive (exact) for short walks and numerical for the sums; the second is statistical, with a few hundred samples on small systems. A simulation near a critical point can suggest pcp_c and estimate exponents; it cannot determine them exactly — Kesten's theorem and the SLE computations do that.

Explore

Explore: walks and spanning trees

Many one-dimensional walks at once, with their root-mean-square distance against the exact n\sqrt n. Notice how far a typical walk wanders while still being bound to come home: that tension is why the expected return time is infinite.

Simple random walks on ℤ

Typical distance √n — and yet every walk returns, eventually.

-500500100200300400stepsposition
  • 8 of the walks
  • root-mean-square distance (500 walks)
  • ±√n (exact)

Root-mean-square distance after 400 steps

Simulated20.08

Exact√400 ≈ 20

Simulation of 500 walks of 400 steps: root-mean-square distance 20.08. The exact value is √n, about 20.

Evidence, not proofThis is a simulation of 500 walks (run 1) using a seeded random number generator. It is evidence, not proof: the exact values come from mathematics, and a new run gives slightly different numbers.

Exactly: the average of (position)² after n steps is n, so the root-mean-square distance is √n. Going twice as far takes four times as many steps.

Kirchhoff's theorem (1847) connects electrical networks to spanning trees: with unit resistors, the effective resistance between the endpoints of an edge ee equals the fraction of spanning trees that contain ee. Build spanning trees of this 3×33 \times 3 grid; the widget counts all of them (192192) by the matrix-tree theorem. Uniform spanning trees, whose branches are loop-erased random walks (Wilson's algorithm), converge to SLE2\mathrm{SLE}_2 and SLE8\mathrm{SLE}_8.

Spanning trees of a 3 × 3 grid

Kirchhoff: R_eff across an edge = (spanning trees through it) / (all spanning trees).

|V| = 9|E| = 12Click edges to choose them for a spanning tree.

Edges chosen: 0. A spanning tree on 9 vertices has exactly 8 edges (|V| − 1).

  • No cycle ✓
  • Reaches every vertex ✗The chosen edges leave 9 separate pieces.
  • A spanning tree ✗

Altogether this graph has 192 different spanning trees (counted exactly by Kirchhoff's matrix-tree theorem).

Exercises

Exercises

1. Random structures: walks, percolation and random geometry

Warm-upHuman

How many of the 44=2564^4 = 256 walks of length 44 on Z2\Z^2 (steps (±1,0)(\pm1, 0), (0,±1)(0, \pm 1)) end at the origin?

2. Random structures: walks, percolation and random geometry

CoreHuman

On which of these graphs is simple random walk recurrent? (Choose all that apply.)

Choose all that apply

3. Random structures: walks, percolation and random geometry

CoreHuman

In the rooted binary tree (root of degree 22, all other vertices of degree 33), what is the probability that simple random walk started at the root never returns to the root?

Choose one

4. Random structures: walks, percolation and random geometry

Warm-upHuman

How many edges of Z2\Z^2 join a vertex on the boundary of the square [−2,2]2[-2, 2]^2 to a vertex on the boundary of [−3,3]2[-3, 3]^2? (This is the cutset Π2\Pi_2 in the Nash-Williams argument.)

5. Random structures: walks, percolation and random geometry

CoreHuman

In Peierls' proof that pc(Z2)≥13p_c(\Z^2) \ge \frac13, which fact justifies the bound 4⋅3n−14 \cdot 3^{n-1} on the number of self-avoiding paths of length nn from the origin?

Choose one

6. Random structures: walks, percolation and random geometry

CoreHuman

In G(n,c/n)G(n, c/n) with c=2c = 2, roughly what fraction of the vertices lie in the largest component when nn is large?

Choose one

7. Random structures: walks, percolation and random geometry

CoreFormal

Which Lean statement says that the expected number of returns to the origin of simple random walk on Z\Z, ∑n(2nn)4−n\sum_n \binom{2n}{n}4^{-n}, is infinite?

Choose one

8. Random structures: walks, percolation and random geometry

StretchHuman

Which of these are established theorems (not conjectures or numerical observations)? (Choose all that apply.)

Choose all that apply

9. Random structures: walks, percolation and random geometry

StretchComputational

Write return_prob_1d(n) returning P(S2n=0)=(2nn)/4nP(S_{2n} = 0) = \binom{2n}{n}/4^n for simple random walk on Z\Z as an exact Fraction, return_prob_2d(n) returning the probability for Z2\Z^2 (use the rotation trick), and expected_visits(f, N) returning ∑n=0Nf(n)\sum_{n=0}^{N} f(n). The tests check exact values and the slow growth of the 2D sum.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

10. Random structures: walks, percolation and random geometry

CoreHuman

Simple random walk on Z\Z returns to 00 with probability 11. What is the expected time E[T]E[T] of the first return?

Choose one
Common misconceptionsH

Common misconceptions

Misconception

"A recurrent walk must return quickly." In dimensions 11 and 22 the return time is finite with probability one but has infinite expectation: for the walk on Z\Z, P(T>2n)=u2n≈1/πnP(T \gt 2n) = u_{2n} \approx 1/\sqrt{\pi n}, whose sum diverges. In Z2\Z^2 the tail is even heavier, P(T>n)≈π/log⁡nP(T \gt n) \approx \pi/\log n.

Misconception

"Simulations near a critical point determine the critical exponents." Simulations give estimates with statistical and finite-size errors, which converge slowly near criticality. Exact values such as 536\frac{5}{36} for triangular-lattice percolation or 43\frac43 for the Brownian frontier needed proofs (here via SLE); Mandelbrot's 43\frac43 was a conjecture from pictures for nearly twenty years. For bond percolation on Z3\Z^3 even the qualitative statement θ(pc)=0\theta(p_c) = 0 is unproved.

Misconception

"pc=12p_c = \frac12 is obvious by the symmetry p↔1−pp \leftrightarrow 1 - p." Self-duality shows that crossings at p=12p = \frac12 are balanced, which makes 12\frac12 the natural candidate, but turning this into pc=12p_c = \frac12 took twenty years (Harris 1960, Kesten 1980): one needs RSW estimates and a sharp-threshold argument. Without self-duality there is no reason for a nice value: site percolation on Z2\Z^2 has pc≈0.5927p_c \approx 0.5927.

Misconception

"A transient walker escapes in a straight line." In Z3\Z^3 the walk returns to the origin with probability about 0.340.34, and it visits every finite set only finitely often — but its path is still a wildly wandering random fractal at large scales (Brownian, of dimension 22), not a ray.

Misconception

"The giant component appears when the graph becomes connected." In G(n,p)G(n, p) the giant component emerges at p=1/np = 1/n, while connectivity requires p≈(log⁡n)/np \approx (\log n)/n; in between, the graph has a giant plus many small pieces, the last of which to join are isolated vertices.

ViewpointsH

Viewpoints

Analysis— Fourier analysis and harmonic functions

The analyst proves Pólya's theorem in one line. With φ(θ)=1d∑i=1dcos⁡θi\varphi(\theta) = \frac1d\sum_{i=1}^d \cos\theta_i the characteristic function of a step, P(Sn=0)=(2π)−d∫[−π,π]dφ(θ)n dθP(S_n = 0) = (2\pi)^{-d}\int_{[-\pi,\pi]^d}\varphi(\theta)^n\, d\theta, so (with a little care at φ=−1\varphi = -1) G=(2π)−d∫dθ1−φ(θ)G = (2\pi)^{-d}\int \frac{d\theta}{1 - \varphi(\theta)}. Near θ=0\theta = 0, 1−φ(θ)≈∣θ∣2/(2d)1 - \varphi(\theta) \approx |\theta|^2/(2d), and ∫∣θ∣<1∣θ∣−2 dθ\int_{|\theta| \lt 1} |\theta|^{-2}\, d\theta is finite exactly when d≥3d \ge 3. Watson's 1939 evaluation of this integral for d=3d = 3 gives the constant computed in the experiment. Harmonic functions are the bridge to harmonic analysis and potential theory: voltages are discrete harmonic functions, and Kakutani (1944) showed that Brownian motion solves the Dirichlet problem.

Geometry— Random walks see the geometry of groups

Run simple random walk on the Cayley graph of a finitely generated group. Varopoulos (1986), using Gromov's polynomial growth theorem, proved that the walk is recurrent if and only if the group is a finite extension of {0}\{0\}, Z\Z or Z2\Z^2 — Pólya's theorem is the abelian case of a statement about growth: the volume of balls must grow at most quadratically. Kesten (1959) showed that the return probabilities decay exponentially exactly when the group is non-amenable, as for free groups, whose Cayley graphs are trees. Random walks have become a basic tool of geometric group theory.

Topology— Planar duality and crossing events

Percolation on Z2\Z^2 is controlled by topology: the dual-circuit criterion in Peierls' argument and the self-duality behind Kesten's theorem are discrete forms of the Jordan curve theorem — in a rectangle, either there is an open left-right crossing or a closed dual top-bottom crossing, never both (the "Hex theorem", equivalent to the Brouwer fixed-point theorem in dimension 22). In the scaling limit, critical interfaces become random fractal curves, and the question "how does a random curve wind around a point?" is answered by the SLE computations, which recover exponents from winding and crossing probabilities.

Combinatorics— Counting paths and the probabilistic method

Every proof in this lesson begins with counting: binomial coefficients for returns, 4⋅3n−14\cdot 3^{n-1} for self-avoiding paths, trees for spanning trees and branching processes. The Erdős–Rényi threshold is proved with first- and second-moment methods — the expected number of tree components of each size, and its variance — the same techniques that prove the existence of Ramsey graphs in the probabilistic method. Kirchhoff's matrix-tree theorem turns effective resistances into ratios of spanning-tree counts, and Wilson's algorithm (1996) samples uniform spanning trees exactly using loop-erased random walks.

Physics— Critical phenomena and universality

Percolation is the simplest model of a phase transition in statistical mechanics. Physicists predicted, before any proof, that near pcp_c quantities obey power laws whose exponents are universal — the same for bond and site percolation and for every two-dimensional lattice — and, using conformal field theory, computed them: Cardy's crossing formula (1992) and exponents such as 536\frac{5}{36} and 43\frac{4}{3}. These derivations are heuristic. Smirnov's theorem and the SLE program turned several of them into theorems, but only for specific lattices; universality itself remains largely unproved. Brownian motion entered physics through Einstein (1905) and Smoluchowski (1906), and Perrin's experiments confirming their predictions (1908) helped establish the existence of atoms.

Wonder Trails

Wonder Trails

History & global context

History and global context

  • 1847–1900: networks and diffusion. Gustav Kirchhoff's laws and the matrix-tree theorem (1847); Lord Rayleigh's monotonicity principle (1870s); Louis Bachelier's random walk model of the Paris stock exchange (1900).
  • 1905–1923: Brownian motion. Albert Einstein (1905) and Marian Smoluchowski (1906) explained Brownian motion as the cumulative effect of molecular collisions; Jean Perrin confirmed it experimentally (1908); Norbert Wiener constructed Brownian motion rigorously (1923).
  • 1921–1960: walks, percolation, random graphs. George Pólya's recurrence theorem (1921). Andrei Kolmogorov's axioms (1933) made probability part of measure theory. Shizuo Kakutani linked Brownian motion and harmonic functions (1944); Kiyosi Itô built stochastic calculus (1940s). Monroe Donsker's invariance principle (1951). Simon Broadbent and John Hammersley introduced percolation (1957). Crispin Nash-Williams proved his inequality (1959). Paul Erdős and Alfréd Rényi founded random graph theory (1959–60). Theodore Harris proved θ(12)=0\theta(\frac12) = 0 (1960).
  • 1978–1990: the critical point. Lucio Russo, Paul Seymour and Dominic Welsh developed crossing estimates (1978); Harry Kesten proved pc=12p_c = \frac12 (1980); Terry Lyons proved his flow criterion (1983); Peter Doyle and Laurie Snell popularised electrical networks (1984); Takashi Hara and Gordon Slade developed the lace expansion for high-dimensional percolation (1990).
  • 2000–today: conformal invariance. Oded Schramm introduced SLE (2000). Gregory Lawler, Schramm and Wendelin Werner computed intersection exponents and proved Mandelbrot's conjecture (2001). Stanislav Smirnov proved conformal invariance of critical percolation on the triangular lattice (2001). Jean-François Le Gall and Grégory Miermont constructed the Brownian map (2013); Jason Miller and Scott Sheffield related it to Liouville quantum gravity (2015–16). Hugo Duminil-Copin's work on phase transitions earned the 2022 Fields Medal.
Further reading

Further reading

  • Peter G. Doyle and J. Laurie Snell, Random Walks and Electric Networks (1984) — the classic, short and delightful introduction to the electrical method and Pólya's theorem.
  • Russell Lyons and Yuval Peres, Probability on Trees and Networks (2016) — the standard modern reference for random walks on graphs, electrical networks, percolation on trees and groups.
  • Geoffrey Grimmett, Percolation (1989; 2nd ed. 1999) — the comprehensive text, including Kesten's theorem.
  • Béla Bollobás and Oliver Riordan, Percolation (2006) — a shorter route to pc=12p_c = \frac12 through sharp thresholds.
  • Geoffrey Grimmett, Probability on Graphs (2010; 2nd ed. 2018) — percolation, random walks, the Ising model and random graphs in one compact book.
  • Remco van der Hofstad, Random Graphs and Complex Networks, Vol. 1 (2017) — the Erdős–Rényi phase transition in detail.
  • Peter Mörters and Yuval Peres, Brownian Motion (2010) — path properties, Hausdorff dimension, and a first look at SLE.
  • Gregory F. Lawler, Conformally Invariant Processes in the Plane (2005) — the mathematics of SLE.
  • William Feller, An Introduction to Probability Theory and Its Applications, Vol. I (1950; 3rd ed. 1968) — Chapter III on the simple random walk, including return times.

A reading path: Doyle–Snell → Lyons–Peres Ch. 1–2 and 5 → Grimmett (Probability on Graphs) → Lawler or Mörters–Peres for the continuum.