Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We shall say that two functions $f$ and $g$ defined on a set $E$ are equal almost everywhere, and write $f(x)=g(x)$ a.e $x\in E$, if the set $\{x\in E: f(x)\neq g(x)\}$ has measure zero.

I just can't wrap my brain around the fact that such functions exist! Certainly, we can take the cantor set which has measure zero but how to pick $f$ and $g$? Is there an example that I am not aware of ?

share|cite|improve this question
Any function is equal to itself almost everywhere. – David Mitra Dec 26 '12 at 3:04
up vote 8 down vote accepted

Let $f$ map all real numbers to $0$ and $g$ map all irrationals to $0$ and all rationals to $1$. Then $f$ and $g$ are distinct but equal a.e.

share|cite|improve this answer

$\newcommand{\R}{\Bbb R}$ There are other sets of measure $0$. For example $Z=\{1\}$ have measure $0$. Consider $f:\R\to \R$ the function defined by $$f(x)=x,$$ and $g:\R\to\R$ given by $$g(x)=\begin{cases} x &\text{if $x\neq 1$}\\ \pi &\text{if $x=1$}\end{cases}$$ Then $f=g$ a.e. since $f\neq g$ on $Z$.

share|cite|improve this answer
That's neat!Thanks! – Lyapunov Dec 26 '12 at 3:04
@POTUS glad to help. – leo Dec 26 '12 at 3:08

Consider a measure zero set i.e. $E_1$ such that $\mu(E_1) = 0$. Let $$h(x) = \begin{cases} 0 & x \in E_1^c\\ \text{any value} & x \in E_1 \end{cases}$$ Now consider any function $f(x)$. Then $g(x) = f(x) + h(x)$ satisfies your criteria.

share|cite|improve this answer

If we let $f(x) = \lceil x \rceil$ and $g(x) = \lfloor x \rfloor + 1$ (ceiling and floor functions respectively) then $f$ and $g$ only differ on the set of integers $\mathbb{Z}$, which has measure zero.

share|cite|improve this answer

Consider $\mathbb{R}$ equipped with the Borel $\sigma$-field $\mathcal{B}(\mathbb{R})$ and the Lebesgue measure $\lambda$, i.e. $\lambda$ is the measure on $\mathcal{B}(\mathbb{R})$ which satisfies $\lambda((a,b))=b-a$ for $a,b\in\mathbb{R}$, $a<b$.

Let $f:\mathbb{R}\to\mathbb{R}$ be any Borel measurable function and suppose we "change" $f$ in at most countably many points. If we call this new function $g$, then $f=g$ almost everywhere (with respect to $\lambda$). In particular, $f$ and $g$ have the same integral over any Borel set.

Let us formalize this: Let $(x_n)_{n\geq 1},(y_n)_{n\geq 1}\subseteq \mathbb{R}$ be two sequences of real numbers and define $$ g(x)= \begin{cases} y_n\quad &\text{if } x=x_n,\\ f(x)&\text{if }x\neq x_n\text{ for all }n, \end{cases} $$ i.e. we have "changed" $f$ along the sequence $(x_n)_{n\geq 1}$. Then $$ \{x\in\mathbb{R}:f(x)\neq g(x)\}\subseteq \{x_n: n\geq 1\}, $$ which has measure zero.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.