0

I saw an interesting representation of the absolute difference using integrals and the indicator function and was wondering if someone could point me to a textbook where it shows the derivation a bit more explicitly (or give an explanation themselves)

$$ |y-c| = \int_{-\infty}^c[y \leq x]dx + \int_c^\infty[y \geq x]dx $$

where $[\cdot]$ is the indicator function (here's a specific screenshot incase the formula didn't come out right)

1 Answers1

0

If you know measure theory you can rewrite the integrals using the Lebesgue measure on $\mathbb{R}$, that is the unique measure on $\mathbb{R}$ s.t. $\lambda([a,b]) = b-a$ for all $a \leq b$.

Let $1_A$ denote the indicator function of A, then we can rewrite $$\int_{-\infty}^{c}1_{[y, \infty)}(x) dx= \lim\limits_{b \ \to \ -\infty}\int_{b}^c1_{[y, \infty)}(x) dx = \lim\limits_{b \ \to \ -\infty}\int_{b}^c1_{[y, \infty)}(x)\lambda(dx) = \\ \lim\limits_{b \ \to \ -\infty}\int_{\mathbb{R}}1_{[b, c]}1_{[y, \infty)}(x)\lambda(dx) = *$$ If $y \leq c$ we get: $$* = \lim\limits_{b \ \to \ -\infty}\int_{\mathbb{R}}1_{[\max(y,b),c]}(x) \lambda(dx) = \lim\limits_{b \ \to \ -\infty} \lambda([\max(y,b), c]) = \lim\limits_{b \ \to \ -\infty}c - \max(y,b) = c-y$$ and if $y > c$ we get: $$* = \lim\limits_{b \ \to \ -\infty}\int_{\mathbb{R}}0 \lambda(dx) = 0$$ and similarly for the other integral one can show $$\int_{c}^{\infty}1_{(-\infty, y]}(x)dx = \begin{cases} 0 & y \leq c \\ y-c & y > c \\ \end{cases} $$

HF_
  • 28