# L2 Metric on Closed Real Interval is Metric

## Theorem

Let $S$ be the set of all real functions which are continuous on the closed interval $\closedint a b$.

Let $d: S \times S \to \R$ be the $L^2$ metric on $\closedint a b$:

$\displaystyle \forall f, g \in S: \map {d_2} {f, g} := \paren {\int_a^b \paren {\map f t - \map g t}^2 \rd t}^{\frac 1 2}$

Then $d_2$ is a metric.

## Proof

### Proof of $M1$

 $\displaystyle \map {d_2} {f, f}$ $=$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map f t}^2 \rd t}^{\frac 1 2}$ Definition of $d_2$ $\displaystyle$ $=$ $\displaystyle \paren {\int_a^b 0^2 \rd t}^{\frac 1 2}$ Definition of Absolute Value $\displaystyle$ $=$ $\displaystyle 0$ Definite Integral of Constant

So axiom $M1$ holds for $d_2$.

$\Box$

### Proof of $M2$

It is required to be shown:

$\map {d_2} {f, g} + \map {d_2} {g, h} \ge d_2 \map {d_2} {f, h}$

for all $f, g, h \in S$.

Let:

$(1): \quad t \in \closedint a b$
$(2): \quad \map f t - \map g t = \map r t$
$(3): \quad \map g t - \map h t = \map s t$

Thus we need to show that:

$\displaystyle \paren {\int_a^b \paren {\map f t - \map g t}^2 \rd t}^{\frac 1 2} + \paren {\int_a^b \paren {\map g t - \map h t}^2 \rd t}^{\frac 1 2} \ge \paren {\int_a^b \paren {\map f t - \map h t}^2 \rd t}^{\frac 1 2}$

We have:

 $\displaystyle \map {d_2} {f, g} + \map {d_2} {g, h}$ $=$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map g t}^2 \rd t}^{\frac 1 2} + \paren {\int_a^b \paren {\map g t - \map h t}^2 \rd t}^{\frac 1 2}$ Definition of $d_2$ $\displaystyle$ $=$ $\displaystyle \paren {\int_a^b \paren {\map r t}^2 \rd t}^{\frac 1 2} + \paren {\int_a^b \paren {\map s t}^2 \rd t}^{\frac 1 2}$ $\displaystyle$ $\ge$ $\displaystyle \paren {\int_a^b \paren {\map r t + \map s t}^2 \rd t}^{\frac 1 2}$ Minkowski's Inequality for Integrals $\displaystyle$ $=$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map g t + \map g t - \map h t}^2 \rd t}^{\frac 1 2}$ Definition of $\map r t$ and $\map s t$ $\displaystyle$ $=$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map h t}^2 \rd t}^{\frac 1 2}$ $\displaystyle$ $=$ $\displaystyle \map {d_2} {f, h}$ Definition of $d_2$

So axiom $M2$ holds for $d_2$.

$\Box$

### Proof of $M3$

 $\displaystyle \map {d_2} {f, g}$ $=$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map g t}^2 \rd t}^{\frac 1 2}$ Definition of $d_p$ $\displaystyle$ $=$ $\displaystyle \paren {\int_a^b \paren {\map g t - \map f t}^2 \rd t}^{\frac 1 2}$ Definition of Absolute Value $\displaystyle$ $=$ $\displaystyle \map {d_2} {g, f}$ Definition of $d_2$

So axiom $M3$ holds for $d_2$.

$\Box$

### Proof of $M4$

 $\, \displaystyle \forall t \in \closedint a b: \,$ $\displaystyle \map f t - \map g t$ $\ne$ $\displaystyle 0$ $\displaystyle \leadsto \ \$ $\displaystyle \paren {\map f t - \map g t}^2$ $\ge$ $\displaystyle 0$ $\displaystyle \leadsto \ \$ $\displaystyle \paren {\int_a^b \paren {\map f t - \map g t}^2 \rd t}^{\frac 1 2}$ $\ge$ $\displaystyle 0$ Sign of Function Matches Sign of Definite Integral
$\map {d_2} {f, g} = 0 \implies f = g$

on $\closedint a b$.

So axiom $M4$ holds for $d_2$.

$\blacksquare$