Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Probability and measure/04

Measurable functions

Lesson 4 of 13 · 1 min read

"Lebesgue measure and null sets" built length for every Borel set, and "σ-algebras and Borel sets" explained which sets may be measured at all: the sets of a chosen σ-algebra, the events one can answer questions about. So far the objects being measured have been sets. But most of what one wants to know about a space is described by functions on it: a score, a temperature, a position. A function has no length. What can be measured is how much of the space the function sends into a given range of values, the length of {x:f(x)∈B}\{x : f(x) \in B\}{x:f(x)∈B}. This lesson asks which functions allow that question to be answered for every Borel set BBB, calls them measurable, and shows that nearly every function met in practice is one. It then introduces two tools that the following lessons build on: simple functions, which approximate any measurable function from below, and image measures, which record where a measure ends up after a function has moved its points.

Preimages

Take the function f(x)=x2f(x) = x^2f(x)=x2 on [0,1][0, 1][0,1], with length as the measure. How much of [0,1][0, 1][0,1] is sent into the range of values from 0.250.250.25 to 0.640.640.64? Since x2≥0.25x^2 \ge 0.25x2≥0.25 exactly when x≥0.5x \ge 0.5x≥0.5, and x2≤0.64x^2 \le 0.64x2≤0.64 exactly when x≤0.8x \le 0.8x≤0.8, the answer is the interval [0.5,0.8][0.5, 0.8][0.5,0.8], which has length 0.30.30.3. The set of points whose value falls in a given set BBB is called the preimage of BBB:

f−1(B)={ω∈Ω:f(ω)∈B}.f^{-1}(B) = \{\omega \in \Omega : f(\omega) \in B\}.f−1(B)={ω∈Ω:f(ω)∈B}.

Here Ω\OmegaΩ is the space where fff lives, and BBB is a set of values. The notation does not mean that fff has an inverse function: x2x^2x2 on [−1,1][-1, 1][−1,1] certainly has none, because −0.5-0.5−0.5 and 0.50.50.5 share the value 0.250.250.25.

A preimage can have several pieces. Let g(x)=4x(1−x)g(x) = 4x(1 - x)g(x)=4x(1−x), a hump that rises from 0 at x=0x = 0x=0 to 1 at x=0.5x = 0.5x=0.5 and falls back to 0 at x=1x = 1x=1. The points with a value in [0.75,1][0.75, 1][0.75,1] form the single interval [0.25,0.75][0.25, 0.75][0.25,0.75], because g(0.25)=0.75g(0.25) = 0.75g(0.25)=0.75, and its length is 0.50.50.5. The points with a value in [0.25,0.64][0.25, 0.64][0.25,0.64] form two intervals, one on the rising side and one on the falling side. Solving 4x(1−x)=y4x(1 - x) = y4x(1−x)=y gives x=12(1±1−y)x = \tfrac12\big(1 \pm \sqrt{1 - y}\big)x=21​(1±1−y​). For y=0.25y = 0.25y=0.25 this is 0.06700.06700.0670 and 0.93300.93300.9330, for y=0.64y = 0.64y=0.64 it is 0.20.20.2 and 0.80.80.8, so the preimage is [0.0670,0.2]∪[0.8,0.9330][0.0670, 0.2] \cup [0.8, 0.9330][0.0670,0.2]∪[0.8,0.9330], of total length 0.26600.26600.2660.

Preimages are the right tool because they respect every operation on sets that a σ-algebra is built from:

f−1(Bc)=(f−1(B))c,f−1(⋃kBk)=⋃kf−1(Bk),f−1(⋂kBk)=⋂kf−1(Bk).f^{-1}(B^c) = \big(f^{-1}(B)\big)^c, \qquad f^{-1}\Big(\bigcup_k B_k\Big) = \bigcup_k f^{-1}(B_k), \qquad f^{-1}\Big(\bigcap_k B_k\Big) = \bigcap_k f^{-1}(B_k).f−1(Bc)=(f−1(B))c,f−1(k⋃​Bk​)=k⋃​f−1(Bk​),f−1(k⋂​Bk​)=k⋂​f−1(Bk​).

Each identity takes one line. A point ω\omegaω lies in f−1(Bc)f^{-1}(B^c)f−1(Bc) exactly when f(ω)f(\omega)f(ω) is not in BBB, that is, exactly when ω\omegaω is not in f−1(B)f^{-1}(B)f−1(B). A point lies in f−1(⋃kBk)f^{-1}(\bigcup_k B_k)f−1(⋃k​Bk​) exactly when f(ω)f(\omega)f(ω) is in some BkB_kBk​, that is, exactly when ω\omegaω is in some f−1(Bk)f^{-1}(B_k)f−1(Bk​). The reason is that every point has exactly one value, so the question "is f(ω)f(\omega)f(ω) in BBB?" has a yes-or-no answer for each ω\omegaω separately. For x2x^2x2 on [0,1][0, 1][0,1] the set B=[0,0.25]B = [0, 0.25]B=[0,0.25] has the preimage [0,0.5][0, 0.5][0,0.5], and its complement (0.25,1](0.25, 1](0.25,1] has the preimage (0.5,1](0.5, 1](0.5,1], which is the complement of [0,0.5][0, 0.5][0,0.5] in [0,1][0, 1][0,1].

Forward images do not behave like this. Let f(x)=x2f(x) = x^2f(x)=x2 on [−1,1][-1, 1][−1,1], A=[−1,0]A = [-1, 0]A=[−1,0] and B=[0,1]B = [0, 1]B=[0,1]. The two sets meet only in the point 000, so f(A∩B)={0}f(A \cap B) = \{0\}f(A∩B)={0}, yet f(A)∩f(B)=[0,1]∩[0,1]=[0,1]f(A) \cap f(B) = [0, 1] \cap [0, 1] = [0, 1]f(A)∩f(B)=[0,1]∩[0,1]=[0,1]. Different points can share a value, and the forward image forgets which point a value came from. This is why measurability is defined through preimages.

Measurable functions

Let (Ω,F)(\Omega, \mathcal{F})(Ω,F) be a measurable space, as in "σ-algebras and Borel sets". A function f:Ω→Rf : \Omega \to \mathbb{R}f:Ω→R is measurable if the preimage of every Borel set lies in F\mathcal{F}F:

f−1(B)∈Ffor every B∈B(R).f^{-1}(B) \in \mathcal{F} \qquad \text{for every } B \in \mathcal{B}(\mathbb{R}).f−1(B)∈Ffor every B∈B(R).

In words: for every question of the form "does the value of fff fall in BBB?", the set of points where the answer is yes is an event. If μ\muμ is a measure on (Ω,F)(\Omega, \mathcal{F})(Ω,F), then μ(f−1(B))\mu(f^{-1}(B))μ(f−1(B)) is defined for every Borel set BBB, and this is the number that says how much of Ω\OmegaΩ has its value in BBB.

Each ingredient of the definition has a job. The condition on F\mathcal{F}F guarantees that the preimages can be measured at all. The Borel sets on the value side are the sets of R\mathbb{R}R that are meaningful to ask about, and they cannot be replaced by all subsets of R\mathbb{R}R: with Ω=[0,1]\Omega = [0, 1]Ω=[0,1], the Borel sets as F\mathcal{F}F, and the identity function f(x)=xf(x) = xf(x)=x, the preimage of Vitali's set VVV is VVV itself, which is not in F\mathcal{F}F.

The half-line test

There are far too many Borel sets to check one by one. Luckily it is enough to check the half-lines. Write {f≤c}\{f \le c\}{f≤c} for the set {ω:f(ω)≤c}=f−1((−∞,c])\{\omega : f(\omega) \le c\} = f^{-1}((-\infty, c]){ω:f(ω)≤c}=f−1((−∞,c]). If {f≤c}∈F\{f \le c\} \in \mathcal{F}{f≤c}∈F for every real number ccc, then fff is measurable. The argument has three steps, and its idea is used again and again.

  1. Collect the good sets: let G\mathcal{G}G be the family of all B⊆RB \subseteq \mathbb{R}B⊆R for which f−1(B)∈Ff^{-1}(B) \in \mathcal{F}f−1(B)∈F. This family is a σ-algebra. It contains R\mathbb{R}R, because f−1(R)=Ω∈Ff^{-1}(\mathbb{R}) = \Omega \in \mathcal{F}f−1(R)=Ω∈F. It is closed under complements and countable unions, because preimages turn complements into complements and unions into unions, and F\mathcal{F}F is closed under both.
  2. By assumption, G\mathcal{G}G contains every half-line (−∞,c](-\infty, c](−∞,c].
  3. The Borel sets are the smallest σ-algebra that contains the half-lines ("σ-algebras and Borel sets"). A σ-algebra that contains the half-lines contains the smallest one, so G\mathcal{G}G contains every Borel set, which says that fff is measurable.

Other half-lines work just as well, because each can be built from another by complements and countable operations: {f>c}\{f > c\}{f>c} is the complement of {f≤c}\{f \le c\}{f≤c}, and {f<c}=⋃n{f≤c−1/n}\{f < c\} = \bigcup_n \{f \le c - 1/n\}{f<c}=⋃n​{f≤c−1/n}. Later lessons use whichever form is most convenient.

As an example, take f(x)=x2f(x) = x^2f(x)=x2 on [0,1][0, 1][0,1]. The set {f≤c}\{f \le c\}{f≤c} is [0,c ][0, \sqrt{c}\,][0,c​] for 0≤c≤10 \le c \le 10≤c≤1, empty for c<0c < 0c<0, and all of [0,1][0, 1][0,1] for c>1c > 1c>1: always an interval, so x2x^2x2 is measurable. For the hump ggg and c=0.64c = 0.64c=0.64, {g≤0.64}\{g \le 0.64\}{g≤0.64} is [0,0.2]∪[0.8,1][0, 0.2] \cup [0.8, 1][0,0.2]∪[0.8,1], again a Borel set.

Examples and a non-example

Most functions one meets are measurable, and several familiar kinds are quickly seen to be.

  • Continuous functions. If f:[0,1]→Rf : [0, 1] \to \mathbb{R}f:[0,1]→R is continuous, the preimage of an open set is open, and open sets are Borel. Open sets generate the Borel sets, so the good-sets argument gives f−1(B)∈B([0,1])f^{-1}(B) \in \mathcal{B}([0, 1])f−1(B)∈B([0,1]) for every Borel BBB.
  • Monotone functions. If fff is increasing, then {f≤c}\{f \le c\}{f≤c} is an interval: if f(y)≤cf(y) \le cf(y)≤c and x<yx < yx<y, then f(x)≤f(y)≤cf(x) \le f(y) \le cf(x)≤f(y)≤c. So monotone functions are measurable even when they jump.
  • Indicators. The indicator 1A\mathbf{1}_A1A​ equals 1 on AAA and 0 elsewhere. A preimage under 1A\mathbf{1}_A1A​ is ∅\emptyset∅, AAA, AcA^cAc or Ω\OmegaΩ, depending on whether BBB contains neither of the values 0 and 1, only 1, only 0, or both. So 1A\mathbf{1}_A1A​ is measurable exactly when A∈FA \in \mathcal{F}A∈F.
  • Step functions. A function that takes finitely many values on intervals is measurable, because each preimage is a finite union of those intervals. The step function of the figure below is 0.20.20.2 on [0,0.3)[0, 0.3)[0,0.3), 0.70.70.7 on [0.3,0.6)[0.3, 0.6)[0.3,0.6) and 0.40.40.4 on [0.6,1][0.6, 1][0.6,1]; then {f≤0.4}=[0,0.3)∪[0.6,1]\{f \le 0.4\} = [0, 0.3) \cup [0.6, 1]{f≤0.4}=[0,0.3)∪[0.6,1], of length 0.70.70.7.

Continuity is not required. The function 1Q\mathbf{1}_{\mathbb{Q}}1Q​, equal to 1 at the rationals and 0 at the irrationals, is discontinuous at every point of [0,1][0, 1][0,1], yet it is measurable, because the rationals form a countable, hence Borel, set. Measurability asks only that the level sets can be measured, not that the function varies smoothly.

A non-example comes from the one place where measurability can fail. With Vitali's set V⊆[0,1)V \subseteq [0, 1)V⊆[0,1) and the Borel sets as F\mathcal{F}F, the indicator 1V\mathbf{1}_V1V​ is not measurable, because {1V>12}=V\{\mathbf{1}_V > \tfrac12\} = V{1V​>21​}=V is not an event. A function is non-measurable exactly when it hides a non-measurable set, and every such example needs the same exotic constructions as Vitali's set itself. Every function that can be written down by a formula, a limit or an explicit rule is measurable.

Measurability on a partition

Measurability is easiest to understand when Ω\OmegaΩ is finite. Let F\mathcal{F}F be the σ-algebra generated by a partition, as in "σ-algebras and Borel sets", whose pieces are the atoms. Every event is a union of atoms, and a function fff is measurable exactly when it is constant on every atom.

To see why, suppose fff takes two different values on one atom, at points aaa and bbb. The preimage of the single value f(a)f(a)f(a) contains aaa but not bbb. It is an event, hence a union of atoms, hence it contains bbb whenever it contains aaa, because aaa and bbb lie in the same atom. This is a contradiction. In the other direction, if fff is constant on every atom, every preimage is a union of whole atoms, which is an event.

The running example of the die makes this concrete. Let Ω={1,…,6}\Omega = \{1, \ldots, 6\}Ω={1,…,6} and let the observer who sees only the parity of the face have the σ-algebra {∅,{1,3,5},{2,4,6},Ω}\{\emptyset, \{1, 3, 5\}, \{2, 4, 6\}, \Omega\}{∅,{1,3,5},{2,4,6},Ω}, with the two atoms {1,3,5}\{1, 3, 5\}{1,3,5} and {2,4,6}\{2, 4, 6\}{2,4,6}. The function "face mod 2", equal to 1 on odd faces and 0 on even faces, is constant on both atoms, hence measurable, and its preimages are {2,4,6}\{2, 4, 6\}{2,4,6} for the value 0 and {1,3,5}\{1, 3, 5\}{1,3,5} for the value 1. The function f(ω)=ωf(\omega) = \omegaf(ω)=ω, the face itself, is not measurable: it takes the values 1 and 3 on the atom {1,3,5}\{1, 3, 5\}{1,3,5}, and the event "the face is 1" is not one the parity observer can answer. The observer who sees only "at most 2" has the atoms {1,2}\{1, 2\}{1,2} and {3,4,5,6}\{3, 4, 5, 6\}{3,4,5,6}, and a function is measurable for this observer exactly when it is a pair of numbers, one for each atom.

In words, a function is measurable when its value can be computed from the information the σ-algebra stands for: the parity observer can compute "face mod 2" but not the face, and an observer who knows nothing can compute only constants.

The σ-algebra generated by a function

Every function carries some information, namely the information that is revealed by knowing its value. This is captured by the collection of all preimages of Borel sets:

σ(f)={f−1(B):B∈B(R)}.\sigma(f) = \{ f^{-1}(B) : B \in \mathcal{B}(\mathbb{R}) \}.σ(f)={f−1(B):B∈B(R)}.

Since preimages keep complements and countable unions, σ(f)\sigma(f)σ(f) is a σ-algebra, and it is the smallest one for which fff is measurable: any σ-algebra that makes fff measurable contains all these preimages. It consists of the events whose truth can be decided by looking at fff alone.

On the die, let f(ω)=1f(\omega) = 1f(ω)=1 if ω≤2\omega \le 2ω≤2 and f(ω)=0f(\omega) = 0f(ω)=0 otherwise. The preimages are f−1({1})={1,2}f^{-1}(\{1\}) = \{1, 2\}f−1({1})={1,2} and f−1({0})={3,4,5,6}f^{-1}(\{0\}) = \{3, 4, 5, 6\}f−1({0})={3,4,5,6}, and so σ(f)={∅,{1,2},{3,4,5,6},Ω}\sigma(f) = \{\emptyset, \{1, 2\}, \{3, 4, 5, 6\}, \Omega\}σ(f)={∅,{1,2},{3,4,5,6},Ω}, exactly the "at most 2" observer. A function with more values knows more. Let f(ω)=(ω−3.5)2f(\omega) = (\omega - 3.5)^2f(ω)=(ω−3.5)2, the squared distance of the face from the middle. Its values are 6.256.256.25 for the faces 111 and 666, 2.252.252.25 for 222 and 555, and 0.250.250.25 for 333 and 444. The atoms of σ(f)\sigma(f)σ(f) are {1,6}\{1, 6\}{1,6}, {2,5}\{2, 5\}{2,5} and {3,4}\{3, 4\}{3,4}, and σ(f)\sigma(f)σ(f) has 23=82^3 = 823=8 events. Squaring has lost the side of the middle on which the face lies; no event separating 111 from 666 is in σ(f)\sigma(f)σ(f). The same happens for x2x^2x2 on [−1,1][-1, 1][−1,1], where σ(f)\sigma(f)σ(f) contains only the Borel sets that are symmetric about 0.

Combining measurable functions

New measurable functions come from old ones, and the rules explain why measurability is so rarely a problem. Let fff and ggg be measurable. The sum f+gf + gf+g is measurable, and the proof shows how countability enters. A point satisfies f(ω)+g(ω)>cf(\omega) + g(\omega) > cf(ω)+g(ω)>c exactly when some rational number qqq separates the two parts, with f(ω)>qf(\omega) > qf(ω)>q and g(ω)>c−qg(\omega) > c - qg(ω)>c−q:

{f+g>c}=⋃q∈Q({f>q}∩{g>c−q}).\{f + g > c\} = \bigcup_{q \in \mathbb{Q}} \big( \{f > q\} \cap \{g > c - q\} \big).{f+g>c}=q∈Q⋃​({f>q}∩{g>c−q}).

If f(ω)+g(ω)>cf(\omega) + g(\omega) > cf(ω)+g(ω)>c, then c−g(ω)<f(ω)c - g(\omega) < f(\omega)c−g(ω)<f(ω), and a rational number qqq fits strictly between them. The right side is a countable union of events, so it is an event.

The other rules use the same half-line test. The maximum and minimum satisfy {max⁡(f,g)>c}={f>c}∪{g>c}\{\max(f, g) > c\} = \{f > c\} \cup \{g > c\}{max(f,g)>c}={f>c}∪{g>c} and {min⁡(f,g)>c}={f>c}∩{g>c}\{\min(f, g) > c\} = \{f > c\} \cap \{g > c\}{min(f,g)>c}={f>c}∩{g>c}. The square f2f^2f2 is measurable, since {f2>c}\{f^2 > c\}{f2>c} is Ω\OmegaΩ for c<0c < 0c<0 and {f>c }∪{f<−c }\{f > \sqrt{c}\,\} \cup \{f < -\sqrt{c}\,\}{f>c​}∪{f<−c​} otherwise, and the product follows from fg=14((f+g)2−(f−g)2)fg = \tfrac14\big((f + g)^2 - (f - g)^2\big)fg=41​((f+g)2−(f−g)2). If h:R→Rh : \mathbb{R} \to \mathbb{R}h:R→R is a Borel function, such as ∣x∣|x|∣x∣ or a continuous function, then h∘fh \circ fh∘f is measurable, because (h∘f)−1(B)=f−1(h−1(B))(h \circ f)^{-1}(B) = f^{-1}\big(h^{-1}(B)\big)(h∘f)−1(B)=f−1(h−1(B)) and h−1(B)h^{-1}(B)h−1(B) is Borel.

The strongest rules concern sequences. If f1,f2,…f_1, f_2, \ldotsf1​,f2​,… are measurable, then so are sup⁡nfn\sup_n f_nsupn​fn​ and inf⁡nfn\inf_n f_ninfn​fn​, since

{sup⁡nfn>c}=⋃n{fn>c},{inf⁡nfn<c}=⋃n{fn<c}.\Big\{ \sup_n f_n > c \Big\} = \bigcup_n \{ f_n > c \}, \qquad \Big\{ \inf_n f_n < c \Big\} = \bigcup_n \{ f_n < c \}.{nsup​fn​>c}=n⋃​{fn​>c},{ninf​fn​<c}=n⋃​{fn​<c}.

The supremum exceeds ccc exactly when some term does. These functions may take the value +∞+\infty+∞ or −∞-\infty−∞, and the half-line test works unchanged for functions with values in [−∞,∞][-\infty, \infty][−∞,∞]. From suprema and infima come lim sup⁡nfn=inf⁡nsup⁡k≥nfk\limsup_n f_n = \inf_n \sup_{k \ge n} f_klimsupn​fn​=infn​supk≥n​fk​ and lim inf⁡nfn\liminf_n f_nliminfn​fn​, and so the pointwise limit lim⁡nfn\lim_n f_nlimn​fn​, wherever it exists, which is where lim sup⁡\limsuplimsup and lim inf⁡\liminfliminf agree.

A pointwise limit of continuous functions need not be continuous, but it is measurable. The functions fn(x)=xnf_n(x) = x^nfn​(x)=xn on [0,1][0, 1][0,1] are all continuous. At x=0.9x = 0.9x=0.9 they take the values 0.9,0.81,0.729,…0.9, 0.81, 0.729, \ldots0.9,0.81,0.729,…, which tend to 0, while at x=1x = 1x=1 they stay at 1. The limit is therefore 000 on [0,1)[0, 1)[0,1) and 111 at the single point x=1x = 1x=1, which is 1{1}\mathbf{1}_{\{1\}}1{1}​: not continuous, but measurable, and equal to the zero function almost everywhere.

One last rule concerns null sets. Suppose ggg equals the measurable function fff except on a null set NNN. Then {g>c}\{g > c\}{g>c} and {f>c}\{f > c\}{f>c} differ at most inside NNN, so ggg is measurable for the completed σ-algebra of "Lebesgue measure and null sets". It need not be Borel measurable: if SSS is a subset of the Cantor set that is not Borel, then 1S\mathbf{1}_S1S​ equals the zero function almost everywhere, yet {1S>12}=S\{\mathbf{1}_S > \tfrac12\} = S{1S​>21​}=S is not Borel.

Simple functions

The simplest nonconstant measurable functions take only finitely many values. A simple function is a finite combination

φ=∑k=1mak1Ak,ak∈R,  Ak∈F.\varphi = \sum_{k=1}^{m} a_k \mathbf{1}_{A_k}, \qquad a_k \in \mathbb{R}, \; A_k \in \mathcal{F}.φ=k=1∑m​ak​1Ak​​,ak​∈R,Ak​∈F.

It is measurable because each indicator is measurable and sums and constant multiples are. The sets AkA_kAk​ may overlap. For example, φ=2⋅1[0,0.5]+3⋅1[0.25,1]\varphi = 2\cdot\mathbf{1}_{[0, 0.5]} + 3\cdot\mathbf{1}_{[0.25, 1]}φ=2⋅1[0,0.5]​+3⋅1[0.25,1]​ on [0,1][0, 1][0,1] equals 222 on [0,0.25)[0, 0.25)[0,0.25), where only the first indicator is on, 2+3=52 + 3 = 52+3=5 on [0.25,0.5][0.25, 0.5][0.25,0.5], where both are on, and 333 on (0.5,1](0.5, 1](0.5,1]. Its standard form uses the distinct values and the disjoint sets on which they are taken, φ=2⋅1[0,0.25)+5⋅1[0.25,0.5]+3⋅1(0.5,1]\varphi = 2\cdot\mathbf{1}_{[0, 0.25)} + 5\cdot\mathbf{1}_{[0.25, 0.5]} + 3\cdot\mathbf{1}_{(0.5, 1]}φ=2⋅1[0,0.25)​+5⋅1[0.25,0.5]​+3⋅1(0.5,1]​. The sets {φ=ak}\{\varphi = a_k\}{φ=ak​} then partition Ω\OmegaΩ, with lengths 0.250.250.25, 0.250.250.25 and 0.50.50.5. A simple function is a finite list of values, each with the event where it is taken.

The reason for introducing simple functions is that every nonnegative measurable function is a limit of them. Given f≥0f \ge 0f≥0 and a level of detail nnn, round every value down to a multiple of 2−n2^{-n}2−n (a dyadic grid), and cap the result at nnn:

φn(ω)=min⁡(n,  ⌊2nf(ω)⌋2n).\varphi_n(\omega) = \min\Big( n, \; \frac{\lfloor 2^n f(\omega) \rfloor}{2^n} \Big).φn​(ω)=min(n,2n⌊2nf(ω)⌋​).

The cap keeps the number of values finite, even if fff is unbounded: for f(x)=1/xf(x) = 1/xf(x)=1/x at x=0.1x = 0.1x=0.1, where f=10f = 10f=10, the value of φ3\varphi_3φ3​ is 333. This φn\varphi_nφn​ is simple. It takes values k/2nk/2^nk/2n for k=0,1,…,n2nk = 0, 1, \ldots, n 2^nk=0,1,…,n2n, and the set where it takes the value k/2nk/2^nk/2n is {k/2n≤f<(k+1)/2n}\{k/2^n \le f < (k+1)/2^n\}{k/2n≤f<(k+1)/2n}, or {f≥n}\{f \ge n\}{f≥n} for the largest value. These are events because fff is measurable. Moreover φn≤f\varphi_n \le fφn​≤f, and φn≤φn+1\varphi_n \le \varphi_{n+1}φn​≤φn+1​, since a finer grid can only move the rounded-down value up, and the cap nnn only grows. Finally φn→f\varphi_n \to fφn​→f pointwise: once n>f(ω)n > f(\omega)n>f(ω) the cap is inactive and f(ω)−φn(ω)<2−nf(\omega) - \varphi_n(\omega) < 2^{-n}f(ω)−φn​(ω)<2−n.

For f(x)=x2f(x) = x^2f(x)=x2 at x=0.7x = 0.7x=0.7, where f=0.49f = 0.49f=0.49, the approximations are φ1=0\varphi_1 = 0φ1​=0, φ2=0.25\varphi_2 = 0.25φ2​=0.25, φ3=0.375\varphi_3 = 0.375φ3​=0.375, φ4=0.4375\varphi_4 = 0.4375φ4​=0.4375 and φ5=0.46875\varphi_5 = 0.46875φ5​=0.46875. They rise towards 0.490.490.49 and stay below it, and at n=5n = 5n=5 the error 0.021250.021250.02125 is below 2−5=0.031252^{-5} = 0.031252−5=0.03125.

What matters most is how φn\varphi_nφn​ cuts up the problem. It slices the range of fff into bands of height 2−n2^{-n}2−n and records, for each band, the set of points whose value falls in it. It does not slice the domain into pieces of equal width. For f(x)=x2f(x) = x^2f(x)=x2 and n=2n = 2n=2 the bands are [0,14)[0, \tfrac14)[0,41​), [14,12)[\tfrac14, \tfrac12)[41​,21​), [12,34)[\tfrac12, \tfrac34)[21​,43​) and [34,1)[\tfrac34, 1)[43​,1), and their preimages are [0,0.5)[0, 0.5)[0,0.5), [0.5,0.7071)[0.5, 0.7071)[0.5,0.7071), [0.7071,0.8660)[0.7071, 0.8660)[0.7071,0.8660) and [0.8660,1)[0.8660, 1)[0.8660,1), with lengths 0.50.50.5, 0.20710.20710.2071, 0.15890.15890.1589 and 0.13400.13400.1340, which add up to 1. Each preimage is a Borel set, which is exactly where measurability is needed. The next lesson, "The Lebesgue integral", multiplies every value of φn\varphi_nφn​ by the length of its set and adds up.

Worked example

Preimages and approximations for f(x) = x²

  1. The lower end of f−1([0.25,0.64])f^{-1}([0.25, 0.64])f−1([0.25,0.64]) solves x2=0.25x^2 = 0.25x2=0.25:

    0.25\displaystyle \sqrt{0.25}0.25​=0.5
  2. The upper end solves x2=0.64x^2 = 0.64x2=0.64:

    0.64\displaystyle \sqrt{0.64}0.64​=0.8
  3. The length of the preimage [0.5,0.8][0.5, 0.8][0.5,0.8]:

    0.8−0.5\displaystyle 0.8 - 0.50.8−0.5=0.3
  4. The length of the preimage of [0,0.25][0, 0.25][0,0.25], which is [0,0.5][0, 0.5][0,0.5]:

    λ(f−1([0,0.25]))=0.25\displaystyle \lambda\big(f^{-1}([0, 0.25])\big) = \sqrt{0.25}λ(f−1([0,0.25]))=0.25​=0.5
  5. At x=0.7x = 0.7x=0.7 the value is 0.490.490.49, and φ2\varphi_2φ2​ rounds it down to a multiple of 1/41/41/4:

    ⌊4⋅0.49⌋/4\displaystyle \lfloor 4 \cdot 0.49 \rfloor / 4⌊4⋅0.49⌋/4=0.25
  6. φ3\varphi_3φ3​ rounds down to a multiple of 1/81/81/8:

    ⌊8⋅0.49⌋/8\displaystyle \lfloor 8 \cdot 0.49 \rfloor / 8⌊8⋅0.49⌋/8=0.375
  7. φ4\varphi_4φ4​ rounds down to a multiple of 1/161/161/16:

    ⌊16⋅0.49⌋/16\displaystyle \lfloor 16 \cdot 0.49 \rfloor / 16⌊16⋅0.49⌋/16=0.4375

Image measures

A measurable function moves a measure from the space where it lives to the number line. Let (Ω,F,μ)(\Omega, \mathcal{F}, \mu)(Ω,F,μ) be a measure space and fff measurable. The image measure of μ\muμ under fff, also called the pushforward, is

(μ∘f−1)(B)=μ(f−1(B))for Borel B⊆R.(\mu \circ f^{-1})(B) = \mu\big(f^{-1}(B)\big) \qquad \text{for Borel } B \subseteq \mathbb{R}.(μ∘f−1)(B)=μ(f−1(B))for Borel B⊆R.

The picture is sand. Think of μ\muμ as an amount of sand spread over Ω\OmegaΩ, and let fff carry each grain from ω\omegaω to the position f(ω)f(\omega)f(ω) on the number line. Then (μ∘f−1)(B)(\mu \circ f^{-1})(B)(μ∘f−1)(B) is the amount of sand that ends up in BBB. It is defined for every Borel set exactly because fff is measurable, since the preimages must be sets that μ\muμ can measure.

It is a measure on B(R)\mathcal{B}(\mathbb{R})B(R). The empty set has an empty preimage, so it receives 0. If B1,B2,…B_1, B_2, \ldotsB1​,B2​,… are disjoint, their preimages are disjoint, since a point has only one value, and the preimage of the union is the union of the preimages, so countable additivity of μ\muμ carries over:

μ(f−1(⋃kBk))=μ(⋃kf−1(Bk))=∑kμ(f−1(Bk)).\mu\Big(f^{-1}\Big(\bigcup_k B_k\Big)\Big) = \mu\Big(\bigcup_k f^{-1}(B_k)\Big) = \sum_k \mu\big(f^{-1}(B_k)\big).μ(f−1(k⋃​Bk​))=μ(k⋃​f−1(Bk​))=k∑​μ(f−1(Bk​)).

Grains are moved, never created or destroyed, so the total mass is unchanged: (μ∘f−1)(R)=μ(Ω)(\mu \circ f^{-1})(\mathbb{R}) = \mu(\Omega)(μ∘f−1)(R)=μ(Ω). A probability measure becomes a probability measure.

Take λ\lambdaλ on [0,1][0, 1][0,1] and the step function of the figure. It sends the interval [0,0.3)[0, 0.3)[0,0.3) to the position 0.20.20.2, [0.3,0.6)[0.3, 0.6)[0.3,0.6) to 0.70.70.7 and [0.6,1][0.6, 1][0.6,1] to 0.40.40.4, so all the sand ends up at three positions: λ∘f−1=0.3 δ0.2+0.4 δ0.4+0.3 δ0.7\lambda \circ f^{-1} = 0.3\,\delta_{0.2} + 0.4\,\delta_{0.4} + 0.3\,\delta_{0.7}λ∘f−1=0.3δ0.2​+0.4δ0.4​+0.3δ0.7​, a combination of point masses as in "Measuring the size of sets". The band B=[0.3,0.75]B = [0.3, 0.75]B=[0.3,0.75] contains the positions 0.40.40.4 and 0.70.70.7, so it receives 0.4+0.3=0.70.4 + 0.3 = 0.70.4+0.3=0.7, which is also the length of its preimage.

For f(x)=x2f(x) = x^2f(x)=x2 the result is smoother. The set f−1([0,c])=[0,c ]f^{-1}([0, c]) = [0, \sqrt{c}\,]f−1([0,c])=[0,c​] has length c\sqrt{c}c​, so (λ∘f−1)([0,c])=c(\lambda \circ f^{-1})([0, c]) = \sqrt{c}(λ∘f−1)([0,c])=c​. The quarter of the number line [0,0.25][0, 0.25][0,0.25] receives 0.25=0.5\sqrt{0.25} = 0.50.25​=0.5, half of all the sand, while (0.75,1](0.75, 1](0.75,1] receives only 1−0.75=0.13401 - \sqrt{0.75} = 0.13401−0.75​=0.1340. The squaring crowds the values towards 0. For an interval (a,b](a, b](a,b] the amount is b−a\sqrt{b} - \sqrt{a}b​−a​, which is the area under the curve y↦1/(2y)y \mapsto 1/(2\sqrt{y})y↦1/(2y​) between aaa and bbb, because y\sqrt{y}y​ has the derivative 1/(2y)1/(2\sqrt{y})1/(2y​). So the image measure has the density 1/(2y)1/(2\sqrt{y})1/(2y​) on (0,1](0, 1](0,1], which is large near 0, where the sand piles up.

The hump is different. Every height below the top is reached twice, so {g≥y}\{g \ge y\}{g≥y} is the interval from 12(1−1−y)\tfrac12(1 - \sqrt{1 - y})21​(1−1−y​) to 12(1+1−y)\tfrac12(1 + \sqrt{1 - y})21​(1+1−y​), of length 1−y\sqrt{1 - y}1−y​: 0.50.50.5 for y=0.75y = 0.75y=0.75 and 0.80.80.8 for y=0.36y = 0.36y=0.36.

The figure shows all of this. Choose a function and move the ends ccc and ddd of the band B=[c,d]B = [c, d]B=[c,d] on the vertical axis. The thick pieces on the horizontal axis form the preimage f−1(B)f^{-1}(B)f−1(B), listed with its length, and the last readout shows the same number as the amount of sand the image measure places in BBB. With the default x2x^2x2 and B=[0.25,0.64]B = [0.25, 0.64]B=[0.25,0.64] the preimage is [0.500,0.800][0.500, 0.800][0.500,0.800], of length 0.30.30.3. For the hump with B=[0.75,1]B = [0.75, 1]B=[0.75,1] it is [0.250,0.750][0.250, 0.750][0.250,0.750], of length 0.50.50.5, and with B=[0.25,0.64]B = [0.25, 0.64]B=[0.25,0.64] it has two pieces of total length 0.26600.26600.2660. For the step function and B=[0.3,0.75]B = [0.3, 0.75]B=[0.3,0.75] the pieces touch and are listed as [0.300,1.000][0.300, 1.000][0.300,1.000], of length 0.70.70.7.

The preimage of an interval and its lengthOpen in Random Variables
0.25
01
0.64
01
000.50.511
f⁻¹(B)
[0.500, 0.800]
λ(f⁻¹(B))
0.3000
Image measure of B
0.3000

Move c and d to slide the band B up and down the vertical axis; the thick pieces on the horizontal axis are every x whose value lands in B.

The probability part of this track gives these objects new names: a measurable function on a probability space is called a random variable, and its image measure is called its distribution. Nothing in the construction changes. Everything in that part is built on the pushforward described here.

Summary

  • The preimage f−1(B)f^{-1}(B)f−1(B) collects the points whose value lies in BBB; unlike forward images, preimages keep complements, unions and intersections.
  • A function is measurable if every preimage of a Borel set is an event; it is enough to check the sets {f≤c}\{f \le c\}{f≤c}, because the good sets form a σ-algebra that contains the half-lines.
  • Continuous, monotone, step functions and indicators of events are measurable, as are sums, products, maxima, minima, suprema, infima and pointwise limits of sequences; the only failures come from non-measurable sets such as Vitali's set.
  • On a finite σ-algebra a function is measurable exactly when it is constant on every atom, and σ(f)\sigma(f)σ(f) is the information revealed by knowing fff.
  • Simple functions take finitely many values on events, and the dyadic functions φn\varphi_nφn​ rise to any nonnegative measurable fff by slicing its range.
  • The image measure μ∘f−1\mu \circ f^{-1}μ∘f−1 is the measure on the value side that records how much of μ\muμ lands in each Borel set; it has the same total mass as μ\muμ.
Try itOpen the random variables lab
Previous · 03Lebesgue measure and null setsNext · 05The Lebesgue integral
Connections

Measurable functions

Open the full graph
Builds on
05.03Lebesgue measure and null sets05.02σ-algebras and Borel sets05.01Measuring the size of sets
Leads to
05.05The Lebesgue integral05.06Convergence theorems05.07Probability spaces and Kolmogorov's axioms05.08Random variables and their distributions05.09Expectation, variance and inequalities05.10Independence and product measures05.12Conditional probability and conditional expectation05.13Measure theory in option pricing
See it in the knowledge graph
Labs for this lesson
Random Variables