# Prove $Y=X$ almost surely given they have the same distribution and $Y$ is an increasing function of $X$

If $$X$$ and $$Y$$ have the same distribution and $$Y=g(X)$$ where $$g$$ is monotonically increasing, then $$Y=X$$ almost surely. It seems obvious, but how to prove it?

• are they integrable ? Apr 15, 2023 at 4:51
• @StratosFair If it is true for integrable variables I think you can extend to non-integrable without too much difficulty by truncating. Apr 15, 2023 at 6:36
• Although I think this statement is probably true, could you please add where did you see it? Apr 16, 2023 at 0:41
• "have the same distribution" this means that the cdf is equal in every point? Apr 16, 2023 at 9:14
• @YashaswiMohanty If $g$ and $F$ (the CDF of $X$) are strictly increasing, then it is easy to prove. Apr 16, 2023 at 20:23

## 1 Answer

The idea is clear in a picture: if we were to sketch the graph of the distribution function $$F_X$$ of $$X,$$ we may conceive of $$g$$ as locally shifting all horizontal points various amounts (but always consistently, never allowing any overlapping), thereby distorting the graph of $$F_X$$ into the graph of $$F_Y$$. The condition $$F_X=F_Y$$ means that this distortion is purely horizontal: the height $$F_X(t)$$ at any point $$t$$ must remain the same as the height $$F_Y(t).$$ Thus, if $$g(t)\ne t,$$ $$(t,F_X(t))$$ and $$(g(t),F_X(g(t))$$ are always part of a horizontal line segment in the graph of $$F_X$$: but over that segment, $$X$$ has zero probability (because its distribution function $$F$$ does not change over that segment).

The only real issue is showing that it's legitimate to sum these zero probabilities over potentially infinitely many such segments. This is related to a basic property of real numbers.

Let's reason from the definitions.

• $$X$$ is a real-valued random variable. Let $$F_X(x) = \Pr(X\le x)$$ be its distribution function.

• We are given $$g:\mathbb R\to \mathbb R$$ where $$s\lt t$$ implies $$g(s)\lt g(t)$$ ($$g$$ is increasing) and $$Y = g\circ X$$ is also a random variable.

The condition in the statement, that $$F_X = F_Y,$$ therefore means that for all numbers $$t,$$

$$\Pr(X\le t) = F_X(t) = F_Y(t) = \Pr(Y\le t) = \Pr(g(X)\lt t).\tag{*}$$

To adopt an economical notation, when $$a$$ and $$b$$ are real numbers, $$(a,b)$$ is the open interval with endpoints at $$a$$ and $$b$$ (even when $$b\lt a$$). When $$a=b,$$ this is the empty set. Condition $$(*)$$ implies that for all numbers $$t$$ where $$g(t)\le t,$$

$$\Pr(X\in (g(t), t]) = \Pr(X\in (-\infty, t] \setminus (-\infty, g(t)]) = F_X(t) - F_Y(t) = 0.\tag{**}$$

The same result obtains when $$g(t)\gt t.$$ Thus, writing $$\mathcal A$$ for the event $$X\ne Y,$$ we may characterize it as

$$X\ne Y:\ X\in \mathcal A = \bigcup_{t\in\mathbb R}\, (t, g(t))$$

This is an uncountable union of open intervals: no axioms or theorems of probability permit us to draw any conclusion about its probability directly. The key is to recall that $$\mathbb R$$ is locally compact: this implies that on any bounded closed interval, such as $$[-n,n]$$ for positive integers $$n,$$ a finite number of real numbers $$t_{n,i},$$ $$i=1,2,\ldots, N(n),$$ can be found for which

$$\mathcal A \cap [-n,n] = \bigcup_{i=1}^{N(n)}\, (t_{n,i}, g(t_i)).$$

(See the Heine-Borel theorem.)

Therefore the probability of this event is not greater than the sum of the probabilities of the intervals of which it is comprised and since by $$(**)$$ each of those intervals is contained within a zero-probability event,

$$\Pr(\mathcal A \cap [-n,n]) = 0.$$

Taking the countable union of these sets for $$n=1,2,3,\ldots,$$ and applying the sigma-additivity property of probability shows

$$\Pr(\mathcal A) = 0 = \Pr(X\ne Y),$$

QED.

• Conjuring up a picture couldn't be more powerful. This answer bears the testament to that. +1. Apr 17, 2023 at 15:11
• "The only real issue is showing that it's legitimate to sum these zero probabilities over potentially infinitely many such segments." Your picture is very nice, but the issue is not entirely settled, especially because that infinite sum over zero probabilities. I myself was looking into the Cantor distribution or ways to express functions $g(x)$ that express a number in terms of the next number while that number changes by zero (a function that doesn't exist, see : finding the next rational number). Your proof that solves this is very cool Apr 17, 2023 at 15:41