Skip to content
The Lumenary
First-year graduateGraduate 150 min

Stochastic processes

Random functions of time — the Poisson process counts rare events, Brownian motion jitters continuously but nowhere smoothly, and Itô's calculus explains why its chain rule needs an extra term.

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

Random functions of time

In 1827 the botanist Robert Brown watched particles from pollen grains in water under a microscope and saw them jitter ceaselessly, in no preferred direction. In 1900 Louis Bachelier, in a thesis on the Paris stock exchange, modelled prices by a process with independent Gaussian increments. In 1905 Albert Einstein, and independently Marian Smoluchowski, explained Brown's motion by molecular collisions and predicted that the mean square displacement grows linearly in time; Jean Perrin's measurements (1908–1909) confirmed it and fixed Avogadro's number, helping to settle the reality of atoms. Meanwhile the engineer Agner Krarup Erlang, designing the Copenhagen telephone exchange (1909), and the actuary Filip Lundberg, modelling insurance claims (1903), needed a model for events arriving "at random" in continuous time.

These are stochastic processes: random functions t↦Xtt \mapsto X_t. They raise questions the previous lesson could not ask. What does it mean to choose a function at random? Which properties of a random path hold almost surely? And since Brownian paths turn out to be nowhere differentiable, how can one write — let alone solve — a differential equation driven by them? The answer to the last question, Itô's stochastic calculus (1944), is now used from population genetics to quantitative finance.

IntuitionH

Two limits of coin tossing

Both basic processes are scaling limits of coin tossing.

Rare events. Divide [0,t][0, t] into nn short slots and let an "arrival" occur in each slot independently with probability λt/n\lambda t / n. The number of arrivals is binomial, and as n→∞n \to \infty it becomes Poisson with mean λt\lambda t (the law of rare events). Counts in disjoint intervals are independent, and the waiting time for the next arrival does not care how long you have already waited. This is the Poisson process: a random step function that jumps by 11 at random times.

Many small steps. Take a simple random walk and speed it up: steps of size 1/n1/\sqrt n every 1/n1/n units of time. After time tt the position is a sum of ntnt independent steps of variance 1/n1/n, so by the central limit theorem it is approximately N(0,t)N(0, t). The limit is Brownian motion: a continuous random path with independent Gaussian increments. The scaling — space like the square root of time — is the source of everything strange about it. Over a time step dtdt the path moves about dt\sqrt{dt}, far more than dtdt, so the path has no slope; but the squares of the increments add up to exactly the elapsed time. In the heuristic shorthand of stochastic calculus, (dB)2=dt(dB)^2 = dt. A second-order Taylor expansion therefore keeps a term that ordinary calculus discards:

df(Bt)=f′(Bt) dBt+12f′′(Bt) (dBt)2=f′(Bt) dBt+12f′′(Bt) dt.df(B_t) = f'(B_t) \, dB_t + \tfrac12 f''(B_t) \, (dB_t)^2 = f'(B_t) \, dB_t + \tfrac12 f''(B_t) \, dt.

This is Itô's formula. The rest of the lesson makes these heuristics into theorems.

DefinitionsH

Definitions

Definition— stochastic process, finite-dimensional distributions

A stochastic process on a probability space (Ω,F,P)(\Omega, \mathcal F, P) is a family (Xt)t∈I(X_t)_{t \in I} of random variables indexed by time, I=[0,∞)I = [0, \infty) or {0,1,2,… }\{0, 1, 2, \dots\}. Its finite-dimensional distributions are the laws of the vectors (Xt1,…,Xtk)(X_{t_1}, \dots, X_{t_k}). For each ω\omega, t↦Xt(ω)t \mapsto X_t(\omega) is a sample path. A filtration (Ft)(\mathcal F_t) is an increasing family of sub-σ-algebras; XX is adapted if each XtX_t is Ft\mathcal F_t-measurable, and an adapted integrable XX is a martingale if E[Xt∣Fs]=Xs\mathbb E[X_t \mid \mathcal F_s] = X_s almost surely for all s≤ts \le t.

The Kolmogorov extension theorem says that any consistent family of finite-dimensional distributions (consistent under permuting and forgetting coordinates) is the family of some process. It does not control paths: the event "the path is continuous" depends on uncountably many coordinates and is not even measurable in the product σ-algebra. Path regularity has to be constructed separately — for Brownian motion by Wiener's or Lévy's construction, or by the Kolmogorov–Chentsov continuity theorem.

Definition— Poisson process

A Poisson process of rate λ>0\lambda > 0 is a process (Nt)t≥0(N_t)_{t \ge 0} with values in {0,1,2,… }\{0, 1, 2, \dots\} such that N0=0N_0 = 0; its paths are right-continuous, non-decreasing, and increase by jumps of size 11; its increments over disjoint intervals are independent; and Nt−NsN_t - N_s has the Poisson distribution with mean λ(t−s)\lambda (t - s) for s<ts \lt t:

P(Nt−Ns=k)=pk(λ(t−s)),pk(r)=e−rrkk!.P(N_t - N_s = k) = p_k\big(\lambda(t - s)\big), \qquad p_k(r) = e^{-r} \frac{r^k}{k!}.

Definition— continuous-time Markov chain

Let SS be a finite set. A generator (Q-matrix) on SS is a matrix Q=(qij)Q = (q_{ij}) with qij≥0q_{ij} \ge 0 for i≠ji \ne j and rows summing to 00; write qi=−qii=∑j≠iqijq_i = -q_{ii} = \sum_{j \ne i} q_{ij}. The continuous-time Markov chain with generator QQ sits in state ii for an exponential time with rate qiq_i, then jumps to j≠ij \ne i with probability qij/qiq_{ij}/q_i, independently of the past. Its transition matrix is P(t)ij=P(Xt=j∣X0=i)P(t)_{ij} = P(X_t = j \mid X_0 = i).

Definition— Brownian motion

A standard Brownian motion is a real process (Bt)t≥0(B_t)_{t \ge 0} such that

  1. B0=0B_0 = 0;
  2. for 0≤t0<t1<⋯<tk0 \le t_0 \lt t_1 \lt \dots \lt t_k the increments Bt1−Bt0,…,Btk−Btk−1B_{t_1} - B_{t_0}, \dots, B_{t_k} - B_{t_{k-1}} are independent;
  3. for s<ts \lt t, Bt−BsB_t - B_s is normal with mean 00 and variance t−st - s;
  4. almost every sample path t↦Bt(ω)t \mapsto B_t(\omega) is continuous.

A Gaussian process is one whose finite-dimensional distributions are all multivariate normal; it is determined in law by its mean EXt\mathbb E X_t and covariance Cov⁡(Xs,Xt)\operatorname{Cov}(X_s, X_t).

Definition— simple integrands and the Itô integral

Let (Bt)(B_t) be a Brownian motion with filtration (Ft)(\mathcal F_t) (for which Bt−BsB_t - B_s is independent of Fs\mathcal F_s). A simple process on [0,T][0, T] has the form Ht=∑k=0n−1ξk1(tk,tk+1](t)H_t = \sum_{k=0}^{n-1} \xi_k \mathbf 1_{(t_k, t_{k+1}]}(t) for a partition 0=t0<⋯<tn=T0 = t_0 \lt \dots \lt t_n = T, where each ξk\xi_k is bounded and Ftk\mathcal F_{t_k}-measurable — the integrand is decided at the left endpoint. Its Itô integral is

∫0THt dBt=∑k=0n−1ξk(Btk+1−Btk).\int_0^T H_t \, dB_t = \sum_{k=0}^{n-1} \xi_k \big(B_{t_{k+1}} - B_{t_k}\big).

It extends by an L2L^2 limit (below) to all adapted, jointly measurable HH with E∫0THt2 dt<∞\mathbb E \int_0^T H_t^2 \, dt \lt \infty.

Definition— Itô process, stochastic differential equation, quadratic variation

An Itô process is Xt=X0+∫0tμs ds+∫0tσs dBsX_t = X_0 + \int_0^t \mu_s \, ds + \int_0^t \sigma_s \, dB_s, written dXt=μt dt+σt dBtdX_t = \mu_t \, dt + \sigma_t \, dB_t. A stochastic differential equation dXt=b(t,Xt) dt+σ(t,Xt) dBtdX_t = b(t, X_t) \, dt + \sigma(t, X_t) \, dB_t asks for an Itô process with μt=b(t,Xt)\mu_t = b(t, X_t) and σt=σ(t,Xt)\sigma_t = \sigma(t, X_t). The quadratic variation of a process over [0,t][0, t] is the limit, if it exists, of ∑k(Xtk+1−Xtk)2\sum_k (X_{t_{k+1}} - X_{t_k})^2 as the mesh of the partition tends to 00.

ProofH

The Poisson process

Theorem— Construction from exponential waiting times

Let E1,E2,…E_1, E_2, \dots be independent exponential random variables with rate λ\lambda (density λe−λs\lambda e^{-\lambda s} on s>0s > 0), let Tn=E1+⋯+EnT_n = E_1 + \dots + E_n be the nn-th arrival time and Nt=#{n≥1:Tn≤t}N_t = \#\{n \ge 1 : T_n \le t\}. Then:

  1. TnT_n has the Gamma density fn(s)=λnsn−1e−λs/(n−1)!f_n(s) = \lambda^n s^{n-1} e^{-\lambda s}/(n - 1)! on s>0s > 0;
  2. NtN_t has the Poisson distribution with mean λt\lambda t;
  3. (memorylessness) P(E1>s+t∣E1>s)=P(E1>t)P(E_1 > s + t \mid E_1 > s) = P(E_1 > t) for s,t≥0s, t \ge 0.

Proof

(1) By induction: f1f_1 is the exponential density, and since Tn+1=Tn+En+1T_{n+1} = T_n + E_{n+1} with independent summands, its density is the convolution fn+1(s)=∫0sfn(u) λe−λ(s−u) du=λn+1e−λs(n−1)!∫0sun−1 du=λn+1sne−λsn!f_{n+1}(s) = \int_0^s f_n(u) \, \lambda e^{-\lambda(s - u)} \, du = \frac{\lambda^{n+1} e^{-\lambda s}}{(n-1)!} \int_0^s u^{n-1} \, du = \frac{\lambda^{n+1} s^n e^{-\lambda s}}{n!}.

(2) P(Nt=0)=P(E1>t)=e−λtP(N_t = 0) = P(E_1 > t) = e^{-\lambda t}. For n≥1n \ge 1, Nt=nN_t = n exactly when Tn≤t<Tn+En+1T_n \le t \lt T_n + E_{n+1}. Since En+1E_{n+1} is independent of TnT_n,

P(Nt=n)=∫0tfn(s) P(En+1>t−s) ds=∫0tλnsn−1e−λs(n−1)! e−λ(t−s) ds=e−λt(λt)nn!.P(N_t = n) = \int_0^t f_n(s) \, P(E_{n+1} > t - s) \, ds = \int_0^t \frac{\lambda^n s^{n-1} e^{-\lambda s}}{(n-1)!} \, e^{-\lambda(t - s)} \, ds = e^{-\lambda t} \frac{(\lambda t)^n}{n!}.

(3) P(E1>s+t)/P(E1>s)=e−λ(s+t)/e−λs=e−λtP(E_1 > s + t)/P(E_1 > s) = e^{-\lambda(s + t)}/e^{-\lambda s} = e^{-\lambda t}.

∎

Memorylessness characterises the exponential law among distributions on (0,∞)(0, \infty): if G(t)=P(E>t)G(t) = P(E > t) satisfies G(s+t)=G(s)G(t)G(s + t) = G(s) G(t) and GG is monotone with 0<G(1)<10 \lt G(1) \lt 1, then G(t)=e−λtG(t) = e^{-\lambda t} with λ=−log⁡G(1)\lambda = -\log G(1) (Cauchy's functional equation for log⁡G\log G). It is also why the construction has independent, stationary increments: at any fixed time ss, the residual waiting time until the next arrival is again exponential with rate λ\lambda and independent of what happened before ss, so (Ns+t−Ns)t≥0(N_{s+t} - N_s)_{t \ge 0} is a Poisson process independent of (Nu)u≤s(N_u)_{u \le s} (Norris, Markov Chains, §2.4). In particular the counts must be consistent: a Poisson(λs\lambda s) count followed by an independent Poisson(λt\lambda t) count must total a Poisson(λ(s+t)\lambda(s + t)) count.

Theorem— Poisson counts add

For s,t≥0s, t \ge 0 and k≥0k \ge 0: ∑j=0kpj(s) pk−j(t)=pk(s+t)\displaystyle \sum_{j=0}^k p_j(s) \, p_{k-j}(t) = p_k(s + t). Equivalently, the sum of independent Poisson variables with means ss and tt is Poisson with mean s+ts + t.

Proof

∑j=0ke−ssjj! e−ttk−j(k−j)!=e−(s+t)k!∑j=0k(kj)sjtk−j=e−(s+t)(s+t)kk!\displaystyle \sum_{j=0}^k e^{-s}\frac{s^j}{j!} \, e^{-t} \frac{t^{k-j}}{(k-j)!} = \frac{e^{-(s+t)}}{k!} \sum_{j=0}^k \binom kj s^j t^{k-j} = e^{-(s+t)} \frac{(s+t)^k}{k!}, by the binomial theorem.

∎

Theorem— Law of rare events

If npn→rn p_n \to r, then (nk)pnk(1−pn)n−k→e−rrk/k!\binom nk p_n^k (1 - p_n)^{n-k} \to e^{-r} r^k/k! for every fixed kk.

Proof

Write (nk)pnk=n(n−1)⋯(n−k+1)nk⋅(npn)kk!→rkk!\binom nk p_n^k = \frac{n (n-1) \cdots (n - k + 1)}{n^k} \cdot \frac{(n p_n)^k}{k!} \to \frac{r^k}{k!}. Also pn→0p_n \to 0, so (1−pn)−k→1(1 - p_n)^{-k} \to 1, and nlog⁡(1−pn)=−npn(1+O(pn))→−rn \log(1 - p_n) = -n p_n (1 + O(p_n)) \to -r gives (1−pn)n→e−r(1 - p_n)^n \to e^{-r}.

∎

Two further operations keep us inside the family (Kingman, Poisson Processes): the superposition of independent Poisson processes of rates λ\lambda and μ\mu is a Poisson process of rate λ+μ\lambda + \mu, and thinning — keeping each arrival independently with probability pp — turns a Poisson process of rate λ\lambda into one of rate pλp\lambda, independent of the process of discarded arrivals.

ProofH

Continuous-time Markov chains

Theorem— Kolmogorov's equations (finite state space)

Let QQ be a generator on a finite set SS and P(t)=etQ=∑m≥0tmQm/m!P(t) = e^{tQ} = \sum_{m \ge 0} t^m Q^m/m!. Then P(0)=IP(0) = I, P(s+t)=P(s)P(t)P(s + t) = P(s) P(t), each P(t)P(t) is a stochastic matrix (non-negative entries, rows summing to 11), and

P′(t)=Q P(t)(backward equation),P′(t)=P(t) Q(forward equation).P'(t) = Q \, P(t) \quad \text{(backward equation)}, \qquad P'(t) = P(t) \, Q \quad \text{(forward equation)}.

Proof

The exponential series converges absolutely; e(s+t)Q=esQetQe^{(s+t)Q} = e^{sQ} e^{tQ} because sQsQ and tQtQ commute, and differentiating the series termwise gives P′=QP=PQP' = QP = PQ. Rows: Q1=0Q \mathbf 1 = 0 (rows of QQ sum to zero), so P(t)1=1+∑m≥1tmQm1/m!=1P(t) \mathbf 1 = \mathbf 1 + \sum_{m \ge 1} t^m Q^m \mathbf 1/m! = \mathbf 1. Non-negativity: with c=max⁡iqic = \max_i q_i, the matrix Q+cIQ + cI has non-negative entries, so et(Q+cI)e^{t(Q + cI)} does too, and etQ=e−ctet(Q+cI)e^{tQ} = e^{-ct} e^{t(Q + cI)} (as cIcI commutes with QQ).

∎

One shows that the jump-and-hold chain of the definition has exactly these transition probabilities (Norris, §2.8): the backward equation comes from conditioning on the first jump, the forward equation from conditioning on the last. A distribution π\pi is stationary if πP(t)=π\pi P(t) = \pi for all tt, equivalently πQ=0\pi Q = 0; for an irreducible finite chain it is unique and P(t)ij→πjP(t)_{ij} \to \pi_j as t→∞t \to \infty (no periodicity can arise in continuous time).

Example— The two-state chain

On S={0,1}S = \{0, 1\} with q01=aq_{01} = a, q10=bq_{10} = b and a+b>0a + b > 0, the forward equation for p(t)=P(t)00p(t) = P(t)_{00} reads p′=−ap+b(1−p)p' = -a p + b (1 - p): probability leaves 00 at rate aa and returns at rate bb. With p(0)=1p(0) = 1 its solution is

p(t)=ba+b+aa+be−(a+b)t→t→∞ba+b=π0.p(t) = \frac{b}{a + b} + \frac{a}{a + b} e^{-(a+b) t} \xrightarrow[t \to \infty]{} \frac{b}{a+b} = \pi_0.

The relaxation rate a+ba + b is the non-zero eigenvalue of −Q-Q.

The Poisson process is the chain on {0,1,2,… }\{0, 1, 2, \dots\} with qi,i+1=λq_{i, i+1} = \lambda. On infinite state spaces a new phenomenon appears: a pure birth chain with rates λn\lambda_n makes infinitely many jumps in finite time — it explodes — with probability one if ∑n1/λn<∞\sum_n 1/\lambda_n \lt \infty (the expected total holding time is finite), and with probability zero if ∑n1/λn=∞\sum_n 1/\lambda_n = \infty.

ProofH

Brownian motion

Brownian motion exists. Wiener (1923) constructed its law on the space of continuous functions; Lévy gave a construction by successive dyadic interpolation with independent Gaussian corrections; alternatively, the finite-dimensional distributions exist by Kolmogorov's extension theorem, and since E∣Bt−Bs∣2p=Cp∣t−s∣p\mathbb E|B_t - B_s|^{2p} = C_p |t - s|^p, the Kolmogorov–Chentsov theorem provides a modification whose paths are locally Hölder continuous of every order γ<p−12p\gamma \lt \frac{p-1}{2p}, hence of every order γ<12\gamma \lt \tfrac12 (Mörters–Peres, §1.1; Le Gall, Ch. 2).

Theorem— Brownian motion as a Gaussian process

A process (Bt)(B_t) with B0=0B_0 = 0 and continuous paths is a standard Brownian motion if and only if it is a Gaussian process with EBt=0\mathbb E B_t = 0 and Cov⁡(Bs,Bt)=min⁡(s,t)\operatorname{Cov}(B_s, B_t) = \min(s, t).

Proof

(⇒\Rightarrow) Any vector (Bt1,…,Btk)(B_{t_1}, \dots, B_{t_k}) with t1<⋯<tkt_1 \lt \dots \lt t_k is a linear image of the independent Gaussian increments, hence Gaussian with mean 00. For s≤ts \le t, independence of BsB_s and Bt−BsB_t - B_s gives Cov⁡(Bs,Bt)=Var⁡Bs+Cov⁡(Bs,Bt−Bs)=s\operatorname{Cov}(B_s, B_t) = \operatorname{Var} B_s + \operatorname{Cov}(B_s, B_t - B_s) = s.

(⇐\Leftarrow) The increments over t0<⋯<tkt_0 \lt \dots \lt t_k are jointly Gaussian. For s≤t≤u≤vs \le t \le u \le v, Cov⁡(Bt−Bs,Bv−Bu)=t−s−t+s=0\operatorname{Cov}(B_t - B_s, B_v - B_u) = t - s - t + s = 0, and jointly Gaussian uncorrelated variables are independent. Finally Var⁡(Bt−Bs)=t−2s+s=t−s\operatorname{Var}(B_t - B_s) = t - 2s + s = t - s.

∎

Theorem— Invariances

If BB is a standard Brownian motion, so are: −B-B (symmetry); c−1/2Bctc^{-1/2} B_{ct} for each c>0c > 0 (scaling); Bs+t−BsB_{s+t} - B_s for each fixed s≥0s \ge 0, and it is independent of (Bu)u≤s(B_u)_{u \le s} (Markov property); and tB1/tt B_{1/t} (with value 00 at t=0t = 0) (time inversion).

Proof

Each new process is a centred Gaussian process; by the previous theorem it suffices to compute covariances and check continuity. For scaling, Cov⁡(c−1/2Bcs,c−1/2Bct)=c−1min⁡(cs,ct)=min⁡(s,t)\operatorname{Cov}(c^{-1/2} B_{cs}, c^{-1/2} B_{ct}) = c^{-1} \min(cs, ct) = \min(s, t). For time inversion with 0<s≤t0 \lt s \le t, Cov⁡(sB1/s,tB1/t)=stmin⁡(1/s,1/t)=st/t=s\operatorname{Cov}(s B_{1/s}, t B_{1/t}) = st \min(1/s, 1/t) = st/t = s. Continuity of tB1/tt B_{1/t} at t=0t = 0 amounts to Bu/u→0B_u/u \to 0 as u→∞u \to \infty, the Brownian strong law; it follows, for instance, from Doob's maximal inequality applied on dyadic blocks (Mörters–Peres, Ch. 1). The Markov property: the increments of Bs+⋅−BsB_{s + \cdot} - B_s are increments of BB over [s,∞)[s, \infty), independent of those over [0,s][0, s].

∎

Theorem— Brownian martingales

With respect to the natural filtration, BtB_t, Bt2−tB_t^2 - t and exp⁡(θBt−θ2t/2)\exp(\theta B_t - \theta^2 t/2) (for each θ∈R\theta \in \R) are martingales.

Proof

For s<ts \lt t write Bt=Bs+DB_t = B_s + D with D=Bt−Bs∼N(0,t−s)D = B_t - B_s \sim N(0, t - s) independent of Fs\mathcal F_s. Then E[Bt∣Fs]=Bs\mathbb E[B_t \mid \mathcal F_s] = B_s; E[Bt2∣Fs]=Bs2+2BsED+ED2=Bs2+t−s\mathbb E[B_t^2 \mid \mathcal F_s] = B_s^2 + 2 B_s \mathbb E D + \mathbb E D^2 = B_s^2 + t - s; and E[eθBt∣Fs]=eθBsEeθD=eθBs+θ2(t−s)/2\mathbb E[e^{\theta B_t} \mid \mathcal F_s] = e^{\theta B_s} \mathbb E e^{\theta D} = e^{\theta B_s + \theta^2 (t - s)/2}, using the Gaussian moment generating function.

∎

Theorem— Quadratic variation of Brownian motion

Let Πn={0=t0n<⋯<tmnn=t}\Pi_n = \{0 = t_0^n \lt \dots \lt t_{m_n}^n = t\} be partitions of [0,t][0, t] with mesh ∣Πn∣=max⁡k(tk+1n−tkn)→0|\Pi_n| = \max_k (t^n_{k+1} - t^n_k) \to 0. Then Qn=∑k(Btk+1n−Btkn)2→tQ_n = \sum_k \big(B_{t^n_{k+1}} - B_{t^n_k}\big)^2 \to t in L2L^2.

Proof

Write Δk=Btk+1−Btk\Delta_k = B_{t_{k+1}} - B_{t_k} and δk=tk+1−tk\delta_k = t_{k+1} - t_k (dropping nn). Then EΔk2=δk\mathbb E \Delta_k^2 = \delta_k, so EQn=t\mathbb E Q_n = t. The Δk2\Delta_k^2 are independent with Var⁡Δk2=EΔk4−δk2=3δk2−δk2=2δk2\operatorname{Var} \Delta_k^2 = \mathbb E \Delta_k^4 - \delta_k^2 = 3\delta_k^2 - \delta_k^2 = 2\delta_k^2. Hence

E(Qn−t)2=Var⁡Qn=2∑kδk2≤2 ∣Πn∣∑kδk=2t ∣Πn∣→0.\mathbb E (Q_n - t)^2 = \operatorname{Var} Q_n = 2 \sum_k \delta_k^2 \le 2 \, |\Pi_n| \sum_k \delta_k = 2 t \, |\Pi_n| \to 0.

∎

If ∑n∣Πn∣<∞\sum_n |\Pi_n| \lt \infty (for instance dyadic partitions), Chebyshev and Borel–Cantelli upgrade this to almost-sure convergence.

Theorem— Brownian paths have infinite variation

Almost surely, the total variation V=sup⁡Π∑k∣Btk+1−Btk∣V = \sup_\Pi \sum_k |B_{t_{k+1}} - B_{t_k}| of BB on [0,t][0, t] (with t>0t > 0) is infinite.

Proof

Take the dyadic partitions Πn\Pi_n of [0,t][0, t], along which Qn→tQ_n \to t almost surely. For every nn, Qn≤max⁡k∣Δk∣⋅∑k∣Δk∣≤max⁡k∣Δk∣⋅VQ_n \le \max_k |\Delta_k| \cdot \sum_k |\Delta_k| \le \max_k |\Delta_k| \cdot V. Each path is uniformly continuous on [0,t][0, t], so max⁡k∣Δk∣→0\max_k |\Delta_k| \to 0. If V(ω)<∞V(\omega) \lt \infty then Qn(ω)→0Q_n(\omega) \to 0, which happens only on a null set because Qn→t>0Q_n \to t > 0 almost surely.

∎

So Brownian paths are not of bounded variation, and ∫H dB\int H \, dB cannot be defined path by path as a Riemann–Stieltjes integral. In fact much more is true.

Theorem— Nowhere differentiability (Paley–Wiener–Zygmund, 1933)

Almost surely, t↦Btt \mapsto B_t is differentiable at no point of [0,1)[0, 1).

Proof

This proof is due to Dvoretzky, Erdős and Kakutani (1961). Suppose BB is differentiable at some s∈[0,1)s \in [0, 1). Then there are M∈NM \in \N and δ>0\delta > 0 with ∣Bu−Bs∣≤M∣u−s∣|B_u - B_s| \le M |u - s| for ∣u−s∣≤δ|u - s| \le \delta. Let n>4/δn > 4/\delta and k=⌈ns⌉k = \lceil ns \rceil, so 0≤k/n−s<1/n0 \le k/n - s \lt 1/n. For j=1,2,3j = 1, 2, 3 both (k+j)/n(k + j)/n and (k+j−1)/n(k + j - 1)/n lie within 4/n4/n of ss, and

∣B(k+j)/n−B(k+j−1)/n∣≤Mj+1n+Mjn≤7Mn.\big|B_{(k+j)/n} - B_{(k+j-1)/n}\big| \le M \frac{j + 1}{n} + M \frac{j}{n} \le \frac{7M}{n}.

So ω\omega lies in An,M=⋃k=0n⋂j=13{∣B(k+j)/n−B(k+j−1)/n∣≤7M/n}A_{n, M} = \bigcup_{k=0}^n \bigcap_{j=1}^3 \big\{|B_{(k+j)/n} - B_{(k+j-1)/n}| \le 7M/n\big\} for all large nn. The three increments are independent N(0,1/n)N(0, 1/n), and a N(0,1/n)N(0, 1/n) density is at most n/(2π)≤n/2\sqrt{n/(2\pi)} \le \sqrt n/2, so each event in the intersection has probability at most 2⋅7Mn⋅n2=7M/n2 \cdot \frac{7M}{n} \cdot \frac{\sqrt n}{2} = 7M/\sqrt n. Hence

P(An,M)≤(n+1)(7Mn)3→n→∞0.P(A_{n, M}) \le (n + 1) \Big(\frac{7M}{\sqrt n}\Big)^3 \xrightarrow[n \to \infty]{} 0.

The set of paths differentiable somewhere in [0,1)[0, 1) is therefore contained in ⋃Mlim inf⁡nAn,M\bigcup_{M} \liminf_n A_{n, M}, and P(lim inf⁡nAn,M)≤lim inf⁡nP(An,M)=0P(\liminf_n A_{n, M}) \le \liminf_n P(A_{n, M}) = 0 for each MM.

∎

Finally, the reflection principle: for a>0a > 0, P(max⁡s≤tBs≥a)=2P(Bt≥a)P\big(\max_{s \le t} B_s \ge a\big) = 2 P(B_t \ge a). Reflect the path after the first time it hits aa; by the strong Markov property the reflected path is again a Brownian motion (Mörters–Peres, §2.2).

ProofH

Itô's stochastic calculus

Theorem— Itô isometry (simple integrands)

For a simple process HH on [0,T][0, T]: E∫0THt dBt=0\mathbb E \int_0^T H_t \, dB_t = 0 and E(∫0THt dBt)2=E∫0THt2 dt\displaystyle \mathbb E \Big(\int_0^T H_t \, dB_t\Big)^2 = \mathbb E \int_0^T H_t^2 \, dt.

Proof

Let Δk=Btk+1−Btk\Delta_k = B_{t_{k+1}} - B_{t_k}, independent of Ftk\mathcal F_{t_k}, with mean 00 and variance δk=tk+1−tk\delta_k = t_{k+1} - t_k. Since ξk\xi_k is Ftk\mathcal F_{t_k}-measurable, E[ξkΔk]=E[ξk] E[Δk]=0\mathbb E[\xi_k \Delta_k] = \mathbb E[\xi_k] \, \mathbb E[\Delta_k] = 0. Expanding the square, for j<kj \lt k the variable ξjΔjξk\xi_j \Delta_j \xi_k is Ftk\mathcal F_{t_k}-measurable, so E[ξjΔjξkΔk]=E[ξjΔjξk] EΔk=0\mathbb E[\xi_j \Delta_j \xi_k \Delta_k] = \mathbb E[\xi_j \Delta_j \xi_k] \, \mathbb E \Delta_k = 0. The diagonal terms give E[ξk2Δk2]=E[ξk2] δk\mathbb E[\xi_k^2 \Delta_k^2] = \mathbb E[\xi_k^2] \, \delta_k, and ∑kE[ξk2]δk=E∫0THt2 dt\sum_k \mathbb E[\xi_k^2] \delta_k = \mathbb E \int_0^T H_t^2 \, dt.

∎

The isometry says that H↦∫H dBH \mapsto \int H \, dB is a linear isometry from simple processes, with the norm (E∫0TH2 dt)1/2\big(\mathbb E \int_0^T H^2 \, dt\big)^{1/2}, into L2(Ω)L^2(\Omega). Simple processes are dense in the space of adapted, jointly measurable HH with E∫0TH2 dt<∞\mathbb E \int_0^T H^2 \, dt \lt \infty, so the integral extends uniquely, still isometric. The resulting process t↦∫0tH dBt \mapsto \int_0^t H \, dB has a continuous modification which is a martingale (Karatzas–Shreve, §3.2). The choice of the left endpoint is what makes the integral a martingale: the integrand cannot anticipate the increment it multiplies.

Theorem— Integral of B dB

∫0tBs dBs=12Bt2−12t\displaystyle \int_0^t B_s \, dB_s = \frac12 B_t^2 - \frac12 t.

Proof

Fix partitions Πn\Pi_n of [0,t][0, t] with mesh →0\to 0 and let Hn=∑kBtk1(tk,tk+1]H^n = \sum_k B_{t_k} \mathbf 1_{(t_k, t_{k+1}]}. (These are not bounded, but they are square-integrable, which suffices for the isometry.) Then

E∫0t(Bs−Hsn)2 ds=∑k∫tktk+1(s−tk) ds=12∑kδk2≤t2∣Πn∣→0,\mathbb E \int_0^t (B_s - H^n_s)^2 \, ds = \sum_k \int_{t_k}^{t_{k+1}} (s - t_k) \, ds = \frac12 \sum_k \delta_k^2 \le \frac t2 |\Pi_n| \to 0,

so by the isometry ∫Hn dB→∫B dB\int H^n \, dB \to \int B \, dB in L2L^2. On the other hand, the algebraic identity a(b−a)=12(b2−a2)−12(b−a)2a(b - a) = \frac12 (b^2 - a^2) - \frac12 (b - a)^2, summed over the partition (the discrete Itô formula, formalised in Lean below), gives

∫0tHn dB=∑kBtk(Btk+1−Btk)=12Bt2−12∑k(Btk+1−Btk)2→L212Bt2−12t\int_0^t H^n \, dB = \sum_k B_{t_k} (B_{t_{k+1}} - B_{t_k}) = \frac12 B_t^2 - \frac12 \sum_k (B_{t_{k+1}} - B_{t_k})^2 \xrightarrow{L^2} \frac12 B_t^2 - \frac12 t

by the quadratic variation theorem.

∎

Ordinary calculus would predict 12Bt2\frac12 B_t^2. The extra −12t-\frac12 t is forced: the left side is a martingale with mean 00, and E[12Bt2]=t2≠0\mathbb E[\frac12 B_t^2] = \frac t2 \ne 0. With midpoints 12(Btk+Btk+1)\frac12(B_{t_k} + B_{t_{k+1}}) instead of left endpoints the sum telescopes to exactly 12Bt2\frac12 B_t^2: this is the Stratonovich integral ∫B∘dB\int B \circ dB, which obeys the ordinary chain rule but is not a martingale.

Theorem— Itô's formula

Let f(t,x)f(t, x) be continuously differentiable once in tt and twice in xx, and let dXt=μt dt+σt dBtdX_t = \mu_t \, dt + \sigma_t \, dB_t be an Itô process. Then, almost surely for all tt,

f(t,Xt)=f(0,X0)+∫0t(∂tf+μs ∂xf+12σs2 ∂xxf)(s,Xs) ds+∫0tσs ∂xf(s,Xs) dBs.f(t, X_t) = f(0, X_0) + \int_0^t \Big(\partial_t f + \mu_s \, \partial_x f + \tfrac12 \sigma_s^2 \, \partial_{xx} f\Big)(s, X_s) \, ds + \int_0^t \sigma_s \, \partial_x f(s, X_s) \, dB_s.

In particular df(Bt)=f′(Bt) dBt+12f′′(Bt) dtdf(B_t) = f'(B_t) \, dB_t + \frac12 f''(B_t) \, dt.

About the proof. Expand f(tk+1,Xtk+1)−f(tk,Xtk)f(t_{k+1}, X_{t_{k+1}}) - f(t_k, X_{t_k}) by Taylor's theorem to first order in time and second order in space and sum over a partition. The first-order space terms converge to the stochastic integral, the second-order terms 12∂xxf (ΔXk)2\frac12 \partial_{xx} f \, (\Delta X_k)^2 converge to 12∫∂xxf σ2 ds\frac12 \int \partial_{xx} f \, \sigma^2 \, ds by the same variance computation as for quadratic variation, and the remainders vanish because ∑k∣ΔXk∣3→0\sum_k |\Delta X_k|^3 \to 0. A localisation argument removes boundedness assumptions (Karatzas–Shreve, §3.3; Le Gall, Ch. 5). The formula with f(x)=x2f(x) = x^2 and X=BX = B is exactly the previous theorem.

Example— Geometric Brownian motion

Consider dSt=μSt dt+σSt dBtdS_t = \mu S_t \, dt + \sigma S_t \, dB_t with S0>0S_0 > 0, the Black–Scholes model of a stock price. Guess St=f(t,Bt)S_t = f(t, B_t) with f(t,x)=S0exp⁡((μ−σ22)t+σx)f(t, x) = S_0 \exp\big((\mu - \frac{\sigma^2}{2}) t + \sigma x\big). Then ∂xf=σf\partial_x f = \sigma f, ∂xxf=σ2f\partial_{xx} f = \sigma^2 f, ∂tf=(μ−σ22)f\partial_t f = (\mu - \frac{\sigma^2}{2}) f, and Itô's formula gives

dSt=(μ−σ22+σ22)St dt+σSt dBt=μSt dt+σSt dBt.dS_t = \Big(\mu - \frac{\sigma^2}{2} + \frac{\sigma^2}{2}\Big) S_t \, dt + \sigma S_t \, dB_t = \mu S_t \, dt + \sigma S_t \, dB_t.

Since the coefficients are Lipschitz, this is the unique solution (Øksendal, Thm 5.2.1). Its behaviour is instructive. ESt=S0eμt\mathbb E S_t = S_0 e^{\mu t} (the mean of a log-normal), but the median is S0e(μ−σ2/2)tS_0 e^{(\mu - \sigma^2/2)t}, and since Bt/t→0B_t/t \to 0 almost surely, 1tlog⁡St→μ−σ22\frac1t \log S_t \to \mu - \frac{\sigma^2}{2}. If 0<μ<σ2/20 \lt \mu \lt \sigma^2/2, the expectation grows exponentially while almost every path tends to 00: the mean is carried by ever rarer, ever larger paths.

Example— The Ornstein–Uhlenbeck process

The Langevin equation dXt=−θXt dt+σ dBtdX_t = -\theta X_t \, dt + \sigma \, dB_t (θ>0\theta > 0) models the velocity of a particle with friction. Itô's formula for eθtXte^{\theta t} X_t (here ∂xx=0\partial_{xx} = 0) gives d(eθtXt)=σeθt dBtd(e^{\theta t} X_t) = \sigma e^{\theta t} \, dB_t, so

Xt=e−θtX0+σ∫0te−θ(t−s) dBs.X_t = e^{-\theta t} X_0 + \sigma \int_0^t e^{-\theta(t - s)} \, dB_s.

The integral is Gaussian with mean 00 and, by the isometry, variance σ2∫0te−2θ(t−s) ds=σ22θ(1−e−2θt)\sigma^2 \int_0^t e^{-2\theta(t-s)} \, ds = \frac{\sigma^2}{2\theta}(1 - e^{-2\theta t}). So XtX_t converges in distribution to N(0,σ2/2θ)N(0, \sigma^2/2\theta), the stationary law — in physics, the Maxwell distribution of velocities, with σ2/2θ\sigma^2/2\theta proportional to temperature.

Formal mathematicsF

Stochastic processes in Lean and Mathlib

Mathlib has no Itô integral yet, but the algebra that produces Itô's correction term can be formalised for any real sequence. The discrete Itô formula — left-point sums equal half the change of the square minus half the quadratic variation — is proved by induction, one line of ring per step:

discrete_itoLean 4Proved here from basic factsFormally verified
/-- **The discrete Itô formula.** For any real sequence `S₀, S₁, …` the left-point sums satisfy
`∑_{k<n} Sₖ (Sₖ₊₁ − Sₖ) = (Sₙ² − S₀²)/2 − ½ ∑_{k<n} (Sₖ₊₁ − Sₖ)²`.
The last sum is the quadratic variation. For a smooth path it tends to `0` under refinement and we
recover `∫ S dS = (Sₙ² − S₀²)/2`; for Brownian motion it tends to `t`, which gives
`∫₀ᵗ B dB = (B_t² − t)/2`. Proof: induction on `n`; each step is the identity
`a (b − a) = (b² − a²)/2 − (b − a)²/2`. -/
theorem discrete_ito (S : ℕ → ℝ) (n : ℕ) :
    ∑ k ∈ Finset.range n, S k * (S (k + 1) - S k) =
      (S n ^ 2 - S 0 ^ 2) / 2 - (∑ k ∈ Finset.range n, (S (k + 1) - S k) ^ 2) / 2 := by
  induction n with
  | zero => simp
  | succ n ih =>
    rw [Finset.sum_range_succ, Finset.sum_range_succ, ih]
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

With midpoints the sum telescopes and the ordinary chain rule holds; for the simple random walk the quadratic variation is exactly nn, giving the discrete form of ∫B dB=12(Bt2−t)\int B \, dB = \frac12 (B_t^2 - t):

discrete_stratonovichLean 4Proved here from basic factsFormally verified
/-- **The discrete Stratonovich formula.** With midpoint values `(Sₖ + Sₖ₊₁)/2` instead of
left-point values, the sum telescopes exactly and the ordinary chain rule holds:
`∑_{k<n} (Sₖ + Sₖ₊₁)/2 · (Sₖ₊₁ − Sₖ) = (Sₙ² − S₀²)/2`. The two sums differ by half the quadratic
variation, so for Brownian paths the choice of evaluation point matters. -/
theorem discrete_stratonovich (S : ℕ → ℝ) (n : ℕ) :
    ∑ k ∈ Finset.range n, (S k + S (k + 1)) / 2 * (S (k + 1) - S k) = (S n ^ 2 - S 0 ^ 2) / 2 := by
  induction n with
  | zero => simp
  | succ n ih =>
    rw [Finset.sum_range_succ, ih]
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
random_walk_itoLean 4Proved here from basic factsFormally verified
/-- **Itô's formula for the simple random walk.** If `S₀ = 0` and every step is `±1`, the
quadratic variation after `n` steps is exactly `n`, so
`∑_{k<n} Sₖ (Sₖ₊₁ − Sₖ) = (Sₙ² − n)/2`. Rescaling space by `√n` and time by `n` turns this into
`∫₀¹ B dB = (B₁² − 1)/2`. Proof: the discrete Itô formula with `(±1)² = 1`. -/
theorem random_walk_ito (S : ℕ → ℝ) (h0 : S 0 = 0)
    (hstep : ∀ k, S (k + 1) - S k = 1 ∨ S (k + 1) - S k = -1) (n : ℕ) :
    ∑ k ∈ Finset.range n, S k * (S (k + 1) - S k) = (S n ^ 2 - n) / 2 := by
  have hqv : ∑ k ∈ Finset.range n, (S (k + 1) - S k) ^ 2 = n := by
    rw [Finset.sum_congr rfl fun k _ => show (S (k + 1) - S k) ^ 2 = 1 by
      rcases hstep k with h | h <;> rw [h] <;> norm_num]
    simp
  rw [discrete_ito, h0, hqv]
  ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

For the Poisson process, we define the Poisson probabilities, check that they agree with the point masses of Mathlib's poissonMeasure, and prove the convolution identity from the binomial theorem, as in the human proof. Mathlib proves the measure-level statement through characteristic functions, and the law of rare events:

poissonPMFLean 4Formally verified
/-- The Poisson probabilities `pₖ(r) = e^{-r} rᵏ / k!`: the probability of exactly `k` arrivals
in a time interval of length `t` for a Poisson process of rate `λ`, with `r = λt`. -/
noncomputable def poissonPMF (r : ℝ) (k : ℕ) : ℝ :=
  Real.exp (-r) * r ^ k / k.factorial
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
poissonPMF_eqLean 4Applies a library theoremFormally verified
/-- Our `poissonPMF` agrees with the point masses of Mathlib's Poisson distribution `Po(r)`
(`ProbabilityTheory.poissonMeasure_real_singleton`). -/
theorem poissonPMF_eq (r : ℝ≥0) (k : ℕ) : (poissonMeasure r).real {k} = poissonPMF r k :=
  poissonMeasure_real_singleton r k
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
poisson_convolutionLean 4Proved here from basic factsFormally verified
/-- **Poisson counts add.** `∑_{j ≤ k} pⱼ(s) p_{k−j}(t) = pₖ(s + t)`: if `N_s` and `N_{s+t} − N_s`
are independent Poisson variables with means `s` and `t`, their sum is Poisson with mean
`s + t`. This is the consistency (Chapman–Kolmogorov) condition that makes the Poisson process
well defined. Proof: expand `(s + t)ᵏ` by the binomial theorem (`add_pow`) and write
`C(k, j) = k! / (j! (k − j)!)` (`Nat.cast_choose`). -/
theorem poisson_convolution (s t : ℝ) (k : ℕ) :
    ∑ j ∈ Finset.range (k + 1), poissonPMF s j * poissonPMF t (k - j) = poissonPMF (s + t) k := by
  simp only [poissonPMF]
  rw [add_pow, Finset.mul_sum, Finset.sum_div]
  refine Finset.sum_congr rfl fun j hj => ?_
  have hjk : j ≤ k := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj)
  rw [Nat.cast_choose ℝ hjk, neg_add, Real.exp_add]
  have h1 : (j.factorial : ℝ) ≠ 0 := by positivity
  have h2 : ((k - j).factorial : ℝ) ≠ 0 := by positivity
  have h3 : (k.factorial : ℝ) ≠ 0 := by positivity
  field_simp
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
poisson_convLean 4Applies a library theoremFormally verified
/-- Mathlib's measure-level statement of the same fact: the convolution of `Po(r₁)` and `Po(r₂)`
is `Po(r₁ + r₂)`, proved through characteristic functions
(`ProbabilityTheory.poissonMeasure_conv_poissonMeasure`). -/
theorem poisson_conv (r₁ r₂ : ℝ≥0) :
    poissonMeasure r₁ ∗ poissonMeasure r₂ = poissonMeasure (r₁ + r₂) :=
  poissonMeasure_conv_poissonMeasure r₁ r₂
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
law_of_rare_eventsLean 4Applies a library theoremFormally verified
/-- **The law of rare events** (Poisson limit theorem). If `n pₙ → r`, the binomial
probabilities `C(n, k) pₙᵏ (1 − pₙ)^{n−k}` tend to `e^{-r} rᵏ / k!`. Chop `[0, t]` into `n` slots
with an arrival in each with probability `λt/n`: in the limit the count is Poisson. This is
Mathlib's `tendsto_choose_mul_pow_of_tendsto_mul_atTop`. -/
theorem law_of_rare_events {p : ℕ → ℝ} {r : ℝ} (k : ℕ)
    (hr : Tendsto (fun n => n * p n) atTop (𝓝 r)) :
    Tendsto (fun n => n.choose k * p n ^ k * (1 - p n) ^ (n - k)) atTop
      (𝓝 (Real.exp (-r) * r ^ k / k.factorial)) :=
  tendsto_choose_mul_pow_of_tendsto_mul_atTop k hr
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

Memorylessness, from Mathlib's formula for the distribution function of expMeasure r, and the solution of the two-state forward equation (with HasDerivAt for the derivative):

exp_memorylessLean 4Proved here from basic factsFormally verified
/-- **Exponential waiting times are memoryless.** If `T` has the exponential distribution with
rate `r > 0`, then `P(T > s + t) = P(T > s) · P(T > t)` for `s, t ≥ 0`, i.e.
`P(T > s + t | T > s) = P(T > t)`: having waited `s` units tells you nothing. This is why the
holding times of a Poisson process (and of any continuous-time Markov chain) are exponential.
Proof: Mathlib's formula `F(x) = 1 − e^{−rx}` for the distribution function (`cdf_expMeasure_eq`)
and `e^{a+b} = eᵃ eᵇ`. -/
theorem exp_memoryless {r : ℝ} (hr : 0 < r) {s t : ℝ} (hs : 0 ≤ s) (ht : 0 ≤ t) :
    1 - cdf (expMeasure r) (s + t) =
      (1 - cdf (expMeasure r) s) * (1 - cdf (expMeasure r) t) := by
  rw [cdf_expMeasure_eq hr, cdf_expMeasure_eq hr, cdf_expMeasure_eq hr]
  simp only [add_nonneg hs ht, hs, ht, ite_true, sub_sub_cancel]
  rw [← Real.exp_add]
  ring_nf
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
two_state_forwardLean 4Proved here from basic factsFormally verified
/-- **The two-state chain solves Kolmogorov's forward equation.** A chain on `{0, 1}` jumps
`0 → 1` at rate `a` and `1 → 0` at rate `b` (with `a + b > 0`). Its transition probability
`p(t) = P(X_t = 0 | X_0 = 0) = b/(a+b) + a/(a+b) · e^{−(a+b)t}` satisfies `p(0) = 1` and
`p′(t) = −a p(t) + b (1 − p(t))`: probability flows out of `0` at rate `a` and back in at rate
`b`. As `t → ∞`, `p(t) → b/(a+b)`, the stationary probability of state `0`. -/
theorem two_state_forward {a b : ℝ} (hab : 0 < a + b) (t : ℝ) :
    (b / (a + b) + a / (a + b) * Real.exp (-(a + b) * 0) = 1) ∧
    HasDerivAt (fun s => b / (a + b) + a / (a + b) * Real.exp (-(a + b) * s))
      (-a * (b / (a + b) + a / (a + b) * Real.exp (-(a + b) * t)) +
        b * (1 - (b / (a + b) + a / (a + b) * Real.exp (-(a + b) * t)))) t := by
  have hne : a + b ≠ 0 := hab.ne'
  constructor
  · field_simp
    simp
    ring
  · have hexp : HasDerivAt (fun s => Real.exp (-(a + b) * s))
        (Real.exp (-(a + b) * t) * (-(a + b))) t := by
      have := ((hasDerivAt_id t).const_mul (-(a + b))).exp
      simpa using this
    convert (hexp.const_mul (a / (a + b))).const_add (b / (a + b)) using 1
    field_simp
    ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

Mathlib defines Brownian motion as in the lesson: IsPreBrownianReal B P says that the finite-dimensional laws are those of Brownian motion (centred Gaussian with covariance min⁡(s,t)\min(s, t)), and IsBrownianReal adds almost surely continuous paths. Time is indexed by ℝ≥0. It proves the covariance, the Gaussian increments, their independence, scaling and time inversion — the Gaussian-process theorem and the invariances above. (Mathlib proves these for any process with the right laws; we do not need an existence theorem for them.)

brownian_covarianceLean 4Applies a library theoremFormally verified
/-- **The covariance of Brownian motion** is `Cov(B_s, B_t) = min(s, t)`. Together with
`E[B_t] = 0` and Gaussian finite-dimensional laws this characterises (pre-)Brownian motion. This
is Mathlib's `IsPreBrownianReal.covariance_eval`. -/
theorem brownian_covariance {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
    {B : ℝ≥0 → Ω → ℝ} (hB : IsPreBrownianReal B P) (s t : ℝ≥0) :
    cov[B s, B t; P] = ((min s t : ℝ≥0) : ℝ) :=
  hB.covariance_eval s t
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
brownian_incrementLean 4Applies a library theoremFormally verified
/-- **Brownian increments are Gaussian:** `B_s − B_t` has law `N(0, |s − t|)`. This is Mathlib's
`IsPreBrownianReal.hasLaw_sub`. -/
theorem brownian_increment {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
    {B : ℝ≥0 → Ω → ℝ} (hB : IsPreBrownianReal B P) (s t : ℝ≥0) :
    HasLaw (B s - B t) (gaussianReal 0 (nndist s.1 t.1)) P :=
  hB.hasLaw_sub s t
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
brownian_indep_incrementsLean 4Applies a library theoremFormally verified
/-- **Brownian increments over disjoint intervals are independent.** This is Mathlib's
`IsPreBrownianReal.hasIndepIncrements`. -/
theorem brownian_indep_increments {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
    {B : ℝ≥0 → Ω → ℝ} (hB : IsPreBrownianReal B P) : HasIndepIncrements B P :=
  hB.hasIndepIncrements
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
brownian_scalingLean 4Applies a library theoremFormally verified
/-- **Brownian scaling.** If `B` is a Brownian motion and `c > 0`, then `t ↦ c^{−1/2} B_{ct}` is
again a Brownian motion: zooming in on a Brownian path by `c` in time and `√c` in space gives a
Brownian path. This is Mathlib's `IsBrownianReal.smul`. -/
theorem brownian_scaling {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
    {B : ℝ≥0 → Ω → ℝ} (hB : IsBrownianReal B P) {c : ℝ≥0} (hc : c ≠ 0) :
    IsBrownianReal (fun t ω => (√c)⁻¹ * B (c * t) ω) P :=
  hB.smul hc
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
brownian_time_inversionLean 4Applies a library theoremFormally verified
/-- **Time inversion.** If `B` is a pre-Brownian motion, so is `t ↦ t B_{1/t}`. It converts
statements about `t → ∞` into statements about `t → 0`. This is Mathlib's
`IsPreBrownianReal.inv`. -/
theorem brownian_time_inversion {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω}
    {B : ℝ≥0 → Ω → ℝ} (hB : IsPreBrownianReal B P) :
    IsPreBrownianReal (fun t ω => t * B (1 / t) ω) P :=
  hB.inv
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

Finally, geometric Brownian motion: we verify the derivatives that Itô's formula needs and the cancellation (μ−σ22)+σ22=μ(\mu - \frac{\sigma^2}{2}) + \frac{\sigma^2}{2} = \mu in the drift.

gbmLean 4Formally verified
/-- The candidate solution of `dS = μ S dt + σ S dB`, written as a function of time `t` and of
the value `x = B_t` of the driving Brownian motion: `f(t, x) = S₀ exp((μ − σ²/2) t + σ x)`. -/
noncomputable def gbm (S₀ μ σ t x : ℝ) : ℝ :=
  S₀ * Real.exp ((μ - σ ^ 2 / 2) * t + σ * x)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor
gbm_itoLean 4Proved here from basic factsFormally verified
/-- **The calculus behind geometric Brownian motion.** For `f = gbm S₀ μ σ`:
`∂ₓf = σ f`, `∂ₓₓf = σ² f`, `∂ₜf = (μ − σ²/2) f`, and hence `∂ₜf + ½ ∂ₓₓf = μ f`.
Itô's formula `df(t, B_t) = (∂ₜf + ½ ∂ₓₓf) dt + ∂ₓf dB_t` then gives
`dS_t = μ S_t dt + σ S_t dB_t` for `S_t = f(t, B_t)`: the `−σ²/2` in the exponent is exactly
cancelled by Itô's correction term `½ ∂ₓₓf`. (Itô's formula itself is not in Mathlib; this
theorem verifies the derivatives it needs.) -/
theorem gbm_ito (S₀ μ σ t x : ℝ) :
    HasDerivAt (fun y => gbm S₀ μ σ t y) (σ * gbm S₀ μ σ t x) x ∧
    HasDerivAt (fun y => σ * gbm S₀ μ σ t y) (σ ^ 2 * gbm S₀ μ σ t x) x ∧
    HasDerivAt (fun s => gbm S₀ μ σ s x) ((μ - σ ^ 2 / 2) * gbm S₀ μ σ t x) t ∧
    (μ - σ ^ 2 / 2) * gbm S₀ μ σ t x + σ ^ 2 * gbm S₀ μ σ t x / 2 = μ * gbm S₀ μ σ t x := by
  -- derivative in the space variable
  have hx : HasDerivAt (fun y => gbm S₀ μ σ t y) (σ * gbm S₀ μ σ t x) x := by
    have h := (((hasDerivAt_id x).const_mul σ).const_add ((μ - σ ^ 2 / 2) * t)).exp.const_mul S₀
    convert h using 1
    · simp only [gbm, id]
    · simp only [gbm, id]
      ring
  refine ⟨hx, ?_, ?_, by ring⟩
  · convert hx.const_mul σ using 1
    ring
  · have h := ((((hasDerivAt_id t).const_mul (μ - σ ^ 2 / 2)).add_const (σ * x)).exp).const_mul S₀
    convert h using 1
    · simp only [gbm, id]
    · simp only [gbm, id]
      ring
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/StochasticProcesses.leanTry it in the Lean web editor

Not formalised here: the Itô integral and Itô's formula themselves, quadratic variation and nowhere differentiability of Brownian paths, the construction of the Poisson process from waiting times, and the matrix-exponential solution of Kolmogorov's equations. What is formalised is the exact algebra and calculus on which those limit arguments rest, together with Mathlib's genuine probabilistic theorems about Brownian motion and Poisson laws.

ComputationC

Experiments: Itô sums, Poisson arrivals, geometric Brownian motion

The first experiment follows one simulated Brownian path on [0,1][0, 1] through dyadic partitions with up to 2162^{16} intervals. The left-point (Itô) sums of B dBB \, dB approach 12(B12−1)\frac12(B_1^2 - 1), the trapezoidal (Stratonovich) sums equal 12B12\frac12 B_1^2 on every partition, the quadratic variation approaches 11, and the total variation grows like 2n/π\sqrt{2n/\pi} without bound.

Ito versus Stratonovich sums along a Brownian pathPythonNumerical approximationStatistical evidenceComputationally tested
"""Where Ito's extra term comes from: Riemann sums along one Brownian path.

We sample one Brownian path on [0, 1] at 2^16 equally spaced times (seeded
Gaussian increments) and evaluate, for coarser partitions, the left-point
sum (Ito), the average of the endpoint values (Stratonovich), the quadratic
variation and the total variation. The left sums approach (B_1^2 - 1)/2,
the trapezoidal sums equal B_1^2/2 exactly, the quadratic variation tends to
1 = t, and the total variation grows without bound like sqrt(2n/pi).
"""

import math
import random

def brownian_path(levels, rng):
    """B at times k / 2^levels, k = 0..2^levels, from Gaussian increments."""
    n = 2 ** levels
    sd = math.sqrt(1.0 / n)
    path = [0.0]
    for _ in range(n):
        path.append(path[-1] + rng.gauss(0.0, sd))
    return path

def subsample(path, step):
    """Every step-th value of the path (a coarser partition)."""
    return path[::step]

def ito_sum(path):
    """Left-point sum of B dB: sum of B_k (B_(k+1) - B_k)."""
    return math.fsum(a * (b - a) for a, b in zip(path, path[1:]))

def stratonovich_sum(path):
    """Trapezoidal sum: sum of (B_k + B_(k+1))/2 * (B_(k+1) - B_k)."""
    return math.fsum((a + b) / 2 * (b - a) for a, b in zip(path, path[1:]))

def quadratic_variation(path):
    """Sum of squared increments."""
    return math.fsum((b - a) ** 2 for a, b in zip(path, path[1:]))

def total_variation(path):
    """Sum of absolute increments."""
    return math.fsum(abs(b - a) for a, b in zip(path, path[1:]))

def main():
    levels = 16
    path = brownian_path(levels, random.Random(1944))
    b1 = path[-1]
    print(f"One Brownian path on [0, 1]; B_1 = {b1:.5f}")
    print(f"Targets: (B_1^2 - 1)/2 = {(b1 * b1 - 1) / 2:.5f},"
          f" B_1^2/2 = {b1 * b1 / 2:.5f}")
    print("      n     Ito sum   Stratonovich   quad. var.   total var.")
    for m in [2, 4, 6, 8, 10, 12, 14, 16]:
        p = subsample(path, 2 ** (levels - m))
        print(f"  {2 ** m:>5}   {ito_sum(p):>9.5f}   {stratonovich_sum(p):>10.5f}"
              f"   {quadratic_variation(p):>9.5f}   {total_variation(p):>9.2f}")
    p = path
    gap = stratonovich_sum(p) - ito_sum(p) - quadratic_variation(p) / 2
    print(f"Stratonovich - Ito - QV/2 on the finest grid: {gap:.1e}")
    print(f"sqrt(2n/pi) for n = 2^16: {math.sqrt(2 * 2 ** 16 / math.pi):.2f}")
    print("The Stratonovich sum telescopes to B_1^2/2 on every partition; the")
    print("Ito sum differs from it by half the quadratic variation, which")
    print("tends to t = 1. Unbounded total variation is why no ordinary")
    print("(Riemann-Stieltjes) integral against B exists.")
    print()
    print("Epistemic status: floating-point computation on a single seeded")
    print("pseudo-random path and finitely many partitions. The identities")
    print("between the sums are exact algebra (formalised in Lean); the limits")
    print("are theorems (quadratic variation of Brownian motion), illustrated")
    print("here, not proved.")

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

The second builds a Poisson process from exponential waiting times and compares the counts with the Poisson law, the covariance of counts on disjoint intervals with 00, and the conditional waiting time with the unconditional one.

A Poisson process from exponential waiting timesPythonStatistical evidenceNumerical approximationComputationally tested
"""Building a Poisson process from exponential waiting times.

Arrivals of rate lam = 2 are generated by adding independent exponential
waiting times (seeded). We count the arrivals in [0, 3] over many runs and
compare the frequencies with the Poisson(6) probabilities, check that the
counts in [0, 1] and (1, 3] are uncorrelated (independent increments), test
the memoryless property of the waiting time, and verify the convolution
identity Po(s) * Po(t) = Po(s + t) term by term.
"""

import math
import random

def poisson_pmf(r, k):
    """e^(-r) r^k / k!"""
    if r < 0 or k < 0:
        raise ValueError("need r >= 0 and k >= 0")
    return math.exp(-r) * r ** k / math.factorial(k)

def arrival_times(lam, horizon, rng):
    """Arrival times in [0, horizon] from i.i.d. exponential gaps."""
    times, t = [], rng.expovariate(lam)
    while t <= horizon:
        times.append(t)
        t += rng.expovariate(lam)
    return times

def count_in(times, a, b):
    """Number of arrivals in the interval (a, b]."""
    return sum(1 for t in times if a < t <= b)

def convolution_gap(s, t, k):
    """|sum_j p_j(s) p_(k-j)(t) - p_k(s + t)|."""
    total = math.fsum(poisson_pmf(s, j) * poisson_pmf(t, k - j)
                      for j in range(k + 1))
    return abs(total - poisson_pmf(s + t, k))

def main():
    lam, runs = 2.0, 20000
    rng = random.Random(1909)
    firsts, seconds, totals, first_gap = [], [], [], []
    for _ in range(runs):
        times = arrival_times(lam, 3.0, rng)
        firsts.append(count_in(times, 0.0, 1.0))
        seconds.append(count_in(times, 1.0, 3.0))
        totals.append(len(times))
        first_gap.append(times[0] if times else math.inf)
    print(f"{runs} runs, rate 2, arrivals in [0, 3] versus Poisson(6):")
    print("   k   simulated   Poisson(6)")
    for k in [0, 2, 4, 6, 8, 10, 12]:
        freq = totals.count(k) / runs
        print(f"  {k:>2}   {freq:.4f}      {poisson_pmf(6.0, k):.4f}")
    mean = sum(totals) / runs
    var = sum((x - mean) ** 2 for x in totals) / runs
    print(f"mean {mean:.3f}, variance {var:.3f} (both 6 in theory)")
    m1, m2 = sum(firsts) / runs, sum(seconds) / runs
    cov = sum((a - m1) * (b - m2) for a, b in zip(firsts, seconds)) / runs
    print(f"Cov(N(0,1], N(1,3]) = {cov:.4f} (0 for independent increments)")
    t_wait = [x for x in first_gap if x > 0.5]
    cond = sum(1 for x in t_wait if x > 1.0) / len(t_wait)
    plain = sum(1 for x in first_gap if x > 0.5) / runs
    print(f"P(T > 1 | T > 0.5) = {cond:.4f}, P(T > 0.5) = {plain:.4f},"
          f" exact e^-1 = {math.exp(-1):.4f}")
    worst = max(convolution_gap(1.3, 2.4, k) for k in range(30))
    print(f"max |Po(1.3) * Po(2.4) - Po(3.7)| over k < 30: {worst:.1e}")
    print()
    print("Epistemic status: the frequencies, covariance and conditional")
    print("probability come from seeded simulations (statistical evidence,")
    print("with errors of order 1/sqrt(runs) = 0.007). The convolution check")
    print("is floating point; the identity is proved exactly in the lesson and")
    print("in Lean.")

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

The third solves dS=μS dt+σS dBdS = \mu S \, dt + \sigma S \, dB numerically by the Euler–Maruyama scheme Sk+1=Sk+μSkΔt+σSkΔBkS_{k+1} = S_k + \mu S_k \Delta t + \sigma S_k \Delta B_k and compares it, on the same Brownian increments, with Itô's exact solution: the error shrinks like Δt\sqrt{\Delta t} (strong order 12\frac12). The "ordinary chain rule" solution S0eμt+σBtS_0 e^{\mu t + \sigma B_t} has the wrong mean.

Geometric Brownian motion: Euler-Maruyama versus Ito's formulaPythonNumerical approximationStatistical evidenceComputationally tested
"""Geometric Brownian motion: Ito's correction is real.

We simulate dS = mu S dt + sigma S dB with mu = 0.1, sigma = 0.4, S_0 = 1 on
[0, 1] by the Euler-Maruyama scheme and compare it, path by path, with the
exact solution S_1 = exp((mu - sigma^2/2) + sigma B_1) driven by the same
Brownian increments. The strong error shrinks like sqrt(dt). The sample mean
matches e^mu, the sample median matches e^(mu - sigma^2/2), and the "ordinary
chain rule" guess exp(mu + sigma B_1) has the wrong mean e^(mu + sigma^2/2).
"""

import math
import random
import statistics

MU, SIGMA = 0.1, 0.4

def exact_solution(s0, mu, sigma, t, b):
    """Ito's solution S_t = s0 exp((mu - sigma^2/2) t + sigma B_t)."""
    return s0 * math.exp((mu - sigma ** 2 / 2) * t + sigma * b)

def euler_maruyama(s0, mu, sigma, increments, dt):
    """Iterate S <- S + mu S dt + sigma S dB over the given increments."""
    s = s0
    for db in increments:
        s += mu * s * dt + sigma * s * db
    return s

def coarsen(increments, factor):
    """Sum consecutive blocks of increments (same path, coarser grid)."""
    return [math.fsum(increments[i:i + factor])
            for i in range(0, len(increments), factor)]

def main():
    rng = random.Random(1973)
    paths, fine = 1000, 2 ** 8
    incs = [[rng.gauss(0.0, math.sqrt(1 / fine)) for _ in range(fine)]
            for _ in range(paths)]
    finals = [math.fsum(inc) for inc in incs]
    exact = [exact_solution(1.0, MU, SIGMA, 1.0, b) for b in finals]
    print("Strong error E|S_1(Euler) - S_1(exact)| on the same paths:")
    print("  steps       dt       error   error/sqrt(dt)")
    for m in [2, 4, 6, 8]:
        n = 2 ** m
        errs = [abs(euler_maruyama(1.0, MU, SIGMA, coarsen(inc, fine // n),
                                   1 / n) - ex)
                for inc, ex in zip(incs, exact)]
        err = statistics.fmean(errs)
        print(f"  {n:>5}   {1 / n:.5f}   {err:.5f}   {err / math.sqrt(1 / n):.4f}")
    print()
    naive = [math.exp(MU + SIGMA * b) for b in finals]
    print(f"Sample mean of exact S_1:   {statistics.fmean(exact):.4f}"
          f"   (theory e^mu = {math.exp(MU):.4f})")
    print(f"Sample median of exact S_1: {statistics.median(exact):.4f}"
          f"   (theory e^(mu - s^2/2) = {math.exp(MU - SIGMA ** 2 / 2):.4f})")
    print(f"Mean of naive exp(mu + s B_1): {statistics.fmean(naive):.4f}"
          f" (= e^(mu + s^2/2) = {math.exp(MU + SIGMA ** 2 / 2):.4f}, wrong)")
    print("The ordinary chain rule would predict the naive formula; Ito's")
    print("formula adds -sigma^2/2 to the exponent, and only then is the mean")
    print("e^(mu t), as dS = mu S dt + sigma S dB requires.")
    print()
    print("Epistemic status: seeded simulations with 1000 paths (statistical")
    print("evidence; sample means carry errors of a few percent) and floating")
    print("point. The rate dt^(1/2) and the formulas are theorems; the run")
    print("illustrates them.")

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

These are simulations: statistical and numerical evidence for finitely many paths and partitions. The exact identities between the sums are proved in Lean; the limits are the theorems above.

Explore

Random walks, the heat kernel and the log-normal

Many random walks at once: the root-mean-square distance grows like n\sqrt n, the diffusive scaling that becomes Var⁡Bt=t\operatorname{Var} B_t = t in the limit.

Diffusive scaling: distance grows like √n

Each walker steps left or right at random. The typical distance from the start grows like √n.

-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.

The law of BtB_t has density pt(x)=(2πt)−1/2e−x2/2tp_t(x) = (2\pi t)^{-1/2} e^{-x^2/2t}, the heat kernel: it solves ∂tp=12∂xxp\partial_t p = \frac12 \partial_{xx} p. Move tt and watch the heat spread; the area under the curve stays 11.

The heat kernel: the law of Brownian motion at time t

Move the sliders and trace along the curves to read off values.

  • density of B_t
  • Signed area: above the axis counts as positive, below (hatched) as negative
  • density of B_t: y = 0.2076

For geometric Brownian motion with S0=1S_0 = 1, compare the mean eμte^{\mu t} with the median e(μ−σ2/2)te^{(\mu - \sigma^2/2)t}. Choose μ=0.05\mu = 0.05 and slide σ\sigma past 2μ≈0.32\sqrt{2\mu} \approx 0.32: the median turns downward while the mean keeps rising.

Geometric Brownian motion: mean versus median

Move the sliders and trace along the curves to read off values.

  • mean E S_t = e^(μt)
  • median e^((μ − σ²/2)t)
  • mean E S_t = e^(μt): y = 1.0513
  • median e^((μ − σ²/2)t): y = 0.9704
Exercises

Exercises

1. Stochastic processes

Warm-upHuman

Let BB be a standard Brownian motion. Compute Var⁡(B3−B1)+E[B2B5]\operatorname{Var}(B_3 - B_1) + \mathbb E[B_2 B_5].

2. Stochastic processes

Warm-upHuman

Requests reach a server in Nairobi as a Poisson process of rate 22 per minute. Given that exactly 1010 requests arrived in the first 55 minutes, what is the expected number of requests in the first 88 minutes?

3. Stochastic processes

CoreHuman

Which of these processes are martingales with respect to the natural filtration of a standard Brownian motion BB? Select all that apply.

Choose all that apply

4. Stochastic processes

CoreHuman

Compute E[(∫04Bs dBs)2]\mathbb E\Big[\Big(\int_0^4 B_s \, dB_s\Big)^2\Big].

5. Stochastic processes

CoreHuman

Which equation is correct for Xt=Bt2X_t = B_t^2?

Choose one

6. Stochastic processes

CoreHuman

A geometric Brownian motion has μ=0.05\mu = 0.05 and σ=0.4\sigma = 0.4, so St=S0exp⁡((μ−σ2/2)t+σBt)S_t = S_0 \exp\big((\mu - \sigma^2/2) t + \sigma B_t\big). Which statement is true as t→∞t \to \infty?

Choose one

7. Stochastic processes

CoreHuman

The proof that Brownian paths have infinite variation uses ∑k(ΔBk)2≤max⁡k∣ΔBk∣⋅∑k∣ΔBk∣\sum_k (\Delta B_k)^2 \le \max_k |\Delta B_k| \cdot \sum_k |\Delta B_k| along dyadic partitions of [0,t][0, t]. Which property of Brownian motion guarantees max⁡k∣ΔBk∣→0\max_k |\Delta B_k| \to 0 for each path?

Choose one

8. Stochastic processes

CoreFormal

For a real sequence S : ℕ → ℝ, which Lean statement is the discrete Itô formula proved in the lesson?

Choose one

9. Stochastic processes

StretchHuman

A pure birth chain on {0,1,2,… }\{0, 1, 2, \dots\} jumps from nn to n+1n + 1 at rate λn\lambda_n (so the holding time in state nn is exponential with mean 1/λn1/\lambda_n). For which rate sequences does the chain make infinitely many jumps in finite time (explode) with probability one? Select all that apply.

Choose all that apply

10. Stochastic processes

CoreComputational

A path is given by its values path = [S_0, S_1, ..., S_n] on a partition. Write ito_sum(path) (left-point sum of S dSS \, dS), stratonovich_sum(path) (midpoint sum, with 12(Sk+Sk+1)\frac12(S_k + S_{k+1})) and quadratic_variation(path). The tests check them on exact rational paths and verify the discrete Itô and Stratonovich formulas.

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

Common misconceptions

Misconception

"The chain rule of calculus applies to Itô integrals." It does not: d(Bt2)=2Bt dBt+dtd(B_t^2) = 2 B_t \, dB_t + dt, not 2Bt dBt2 B_t \, dB_t, and ∫0tB dB=12Bt2−12t\int_0^t B \, dB = \frac12 B_t^2 - \frac12 t. The extra term comes from the quadratic variation, ∑(ΔB)2→t\sum (\Delta B)^2 \to t, which vanishes for smooth paths but not for Brownian ones. The ordinary chain rule holds for the Stratonovich integral, at the price of losing the martingale property.

Misconception

"Brownian paths are continuous, so they must be differentiable almost everywhere." Continuity does not imply differentiability anywhere (Weierstrass's function is an example), and monotone or bounded-variation functions are the ones that are differentiable almost everywhere (Lebesgue). Brownian paths have infinite variation on every interval and are differentiable at no point, almost surely. Velocity is not defined, which is why physicists' "white noise" dB/dtdB/dt makes sense only as a generalised function.

Misconception

"A Poisson process spreads its arrivals out evenly." Arrivals cluster: the gaps are exponential, whose most likely values are near 00. Given Nt=nN_t = n, the arrival times are distributed like nn independent uniform points on [0,t][0, t] sorted in order — and uniform random points form clumps and gaps. Regular spacing would be a sign that the process is not Poisson.

Misconception

"If ESt\mathbb E S_t grows, the typical path grows." For geometric Brownian motion with 0<μ<σ2/20 \lt \mu \lt \sigma^2/2, ESt=S0eμt→∞\mathbb E S_t = S_0 e^{\mu t} \to \infty while St→0S_t \to 0 almost surely. Expectations can be dominated by rare events; almost-sure statements describe the typical path.

Misconception

"Every martingale is a Markov process", or the reverse. Bt2B_t^2 is a Markov process but not a martingale. Conversely, a fair-coin walk whose step size (11 or 22) is fixed once and for all by the direction of its first step is a martingale but not a Markov process: its current position alone does not tell you how far it will move next (position 11 at time 33 can be reached with either step size). The two notions describe different kinds of memory.

ViewpointsH

Many ways of seeing

Analysis— Generators, the heat equation and harmonic functions

Every Markov process has an infinitesimal generator Lf=lim⁡t↓0(Exf(Xt)−f(x))/t\mathcal L f = \lim_{t \downarrow 0} (\mathbb E_x f(X_t) - f(x))/t; for a finite chain it is the matrix QQ, and for Brownian motion it is 12Δ\frac12 \Delta. The transition semigroup Ptf(x)=Exf(Bt)P_t f(x) = \mathbb E_x f(B_t) solves the heat equation ∂tu=12Δu\partial_t u = \frac12 \Delta u with u(0,⋅)=fu(0, \cdot) = f, and Itô's formula shows that f(Bt)−∫0t12Δf(Bs) dsf(B_t) - \int_0^t \frac12 \Delta f(B_s) \, ds is a martingale. Consequences flow both ways. Kakutani (1944): the solution of the Dirichlet problem Δu=0\Delta u = 0 in a domain DD with boundary values gg is u(x)=Exg(Bτ)u(x) = \mathbb E_x g(B_\tau), where τ\tau is the exit time from DD. The Feynman–Kac formula (Kac, 1949) represents solutions of ∂tu=12Δu−Vu\partial_t u = \frac12 \Delta u - V u as Ex[f(Bt)e−∫0tV(Bs) ds]\mathbb E_x\big[f(B_t) e^{-\int_0^t V(B_s) \, ds}\big]. See partial differential equations.

Geometry— Brownian motion on manifolds, and conformal invariance

On a Riemannian manifold, Brownian motion is the diffusion with generator 12Δg\frac12 \Delta_g, the Laplace–Beltrami operator; its transition density is the heat kernel of the manifold, and the short-time asymptotics lim⁡t↓0tlog⁡pt(x,y)=−12d(x,y)2\lim_{t \downarrow 0} t \log p_t(x, y) = -\tfrac12 d(x, y)^2 recover the geodesic distance from the random motion (Varadhan, 1967). Curvature appears in how fast Brownian particles spread: on hyperbolic space they escape to infinity at linear speed, on a compact manifold they equidistribute. In the plane there is a hidden symmetry: Lévy's conformal invariance theorem says that if ff is a non-constant analytic function, then f(Bt)f(B_t) is again a planar Brownian motion, run with the random clock ∫0t∣f′(Bs)∣2 ds\int_0^t |f'(B_s)|^2 \, ds. Planar Brownian motion thus sees only the conformal structure — which is why it connects to complex analysis and, through Schramm–Loewner evolution, to the scaling limits of planar statistical mechanics. See Riemannian geometry.

Topology— A measure on path space, and winding around a point

Wiener measure is a Borel probability measure on the Polish space C([0,∞))C([0, \infty)) of continuous paths with the topology of uniform convergence on compacts. It is concentrated on paths that are Hölder continuous of every order γ<12\gamma \lt \frac12 and of no order γ>12\gamma > \frac12 — a topologically meagre subset of path space carrying full measure. Donsker's invariance principle (1951) is a statement of weak convergence in this space: rescaled random walk paths converge in law to Brownian motion, so continuous functionals such as max⁡s≤1Bs\max_{s \le 1} B_s can be computed from simple random walks. Planar Brownian motion started at 11 never hits 00 (points are polar in dimension two), so its winding angle θt\theta_t around 00 is well defined, and Spitzer's theorem (1958) says that 2θt/log⁡t2\theta_t/\log t converges in distribution to a standard Cauchy law: the path winds around the origin endlessly, in both directions. See the fundamental group.

Physics— Diffusion, atoms and friction

Einstein (1905) argued that a suspended particle of radius aa in a fluid of viscosity η\eta at temperature TT diffuses with EXt2=2Dt\mathbb E X_t^2 = 2Dt in each coordinate, where D=kBT/(6πηa)D = k_B T/(6\pi\eta a); measuring DD therefore measures Boltzmann's constant kBk_B, and with it Avogadro's number. Perrin's experiments did exactly this. Langevin (1908) wrote Newton's law with friction and a random force, m dv=−γv dt+σ dBtm \, dv = -\gamma v \, dt + \sigma \, dB_t: the Ornstein–Uhlenbeck process, whose stationary variance σ2/(2γm)\sigma^2/(2\gamma m) must equal kBT/mk_B T/m — a fluctuation–dissipation relation. Physicists' white noise "ξt=dBt/dt\xi_t = dB_t/dt" is heuristic: Wong and Zakai (1965) showed that ordinary differential equations driven by smooth approximations of white noise converge to the Stratonovich solution, which is why physicists often prefer Stratonovich calculus and mathematicians Itô's.

Combinatorics— Counting paths: reflection and the ballot problem

Behind Brownian identities stand exact counts of lattice paths. The reflection principle for simple random walk — reflect the path after its first visit to level aa — gives the number of paths of length nn from 00 to b<ab \lt a that touch aa as the number of all paths from 00 to 2a−b2a - b. It solves the ballot problem (Bertrand, 1887): if candidate A receives pp votes and B receives q<pq \lt p, counted in random order, the probability that A is strictly ahead throughout the count is (p−q)/(p+q)(p - q)/(p + q). Passing to the diffusive limit turns these counts into P(max⁡s≤tBs≥a)=2P(Bt≥a)P(\max_{s \le t} B_s \ge a) = 2 P(B_t \ge a) and the arcsine laws for the time spent positive (Lévy). See Markov chains and random structures.

Wonder Trails

Wonder Trails

History & global context

History and context

  • Siméon Denis Poisson (1837) derived his distribution as a limit of binomials; Ladislaus von Bortkiewicz (1898) famously fitted it to deaths from horse kicks in the Prussian cavalry. Filip Lundberg (1903) and Agner Krarup Erlang (1909) used Poisson arrivals for insurance risk and telephone traffic.
  • Thorvald Thiele (1880) and Louis Bachelier (1900) described Brownian motion mathematically; Albert Einstein (1905), Marian Smoluchowski (1906) and Paul Langevin (1908) gave its physics, and Jean Perrin (1908–1909) its experimental confirmation (Nobel Prize 1926).
  • Norbert Wiener (1923) constructed Brownian motion as a measure on path space; Raymond Paley, Wiener and Antoni Zygmund (1933) proved nowhere differentiability; Andrey Kolmogorov (1931) founded the analytic theory of Markov processes with his forward and backward equations; Paul Lévy (Processus stochastiques et mouvement brownien, 1948) discovered most of the fine path properties.
  • Kiyosi Itô (1944, 1951) defined the stochastic integral and proved his formula, building a theory of stochastic differential equations; in 2006 he received the first Gauss Prize. Wolfgang Doeblin, killed in 1940, had sent a sealed envelope to the Paris Academy containing a version of Itô's formula; it was opened in 2000. Joseph Doob (1953) put continuous-time martingales at the centre; William Feller developed the semigroup theory of diffusions; Ruslan Stratonovich (1966) introduced his integral.
  • Fischer Black, Myron Scholes and Robert Merton (1973) priced options with geometric Brownian motion and Itô's formula (Nobel Prize in Economics 1997 for Merton and Scholes). Stochastic analysis now underlies population genetics (Kimura's diffusions), filtering and control, statistical physics and the study of random geometry.
Further reading

Further reading

  • Ioannis Karatzas and Steven E. Shreve, Brownian Motion and Stochastic Calculus (2nd ed., 1991) — the standard rigorous treatment.
  • Bernt Øksendal, Stochastic Differential Equations: An Introduction with Applications (6th ed., 2003) — the friendliest route to Itô calculus and SDEs.
  • Peter Mörters and Yuval Peres, Brownian Motion (2010) — path properties, with modern proofs.
  • Jean-François Le Gall, Brownian Motion, Martingales, and Stochastic Calculus (2016) — concise and complete.
  • James R. Norris, Markov Chains (1997) — discrete and continuous time, Poisson processes, with clear proofs.
  • J. F. C. Kingman, Poisson Processes (1993) — the geometry and calculus of Poisson point processes.
  • J. Michael Steele, Stochastic Calculus and Financial Applications (2001) — Itô calculus motivated by finance.