What is $d(\sin(x),\cos(x))$ if d is a distance function in a metric space?

181 Views Asked by At

Let $M=\{f:[a,b] \to \textbf{R} | f \,is \,continuous \}$. Let $d:M \to \textbf{R}$ be defined by $d(f,g)=\int_a^b |f(x)-g(x)| \,dx$. What is d represent geometrically, and show that M, d is a metric space. What is $d(\sin(x),\cos(x))$ for $[a,b]=[0, 2\pi]$?

$\textbf{What does d represent geometrically?}$

d represents absolute value of the area of the region that is bounded by the functions f and g.

$\textbf{Show that M,d is a metric space.}$

$\textbf{Proof:}$ For M to be a metric space, it must satisfy the following properties:

  • If $f,g \in M$ with $d(f,g)=0$, then $f=g$ (vice versa).

Let $f,g \in M$. Assume $d(f,g)=\int_a^b |f(x)-g(x)| \,dx=0$. $$ \int_a^b |f(x)-g(x)| \,dx=0 \iff |f(x)-g(x)|=0 \iff$$ \begin{cases} f(x)-g(x)=0 \iff f(x)=g(x)\\ -(f(x)-g(x))=0 \iff f(x)=g(x)\\ \end{cases} Hence $f=g$.

  • If $f,g \in M$, then $d(f,g)=d(g,f)$.

Let $f,g \in M$. Assume $d(f,g)=\int_a^b |f(x)-g(x)| \,dx$. $$d(f,g)=\int_a^b |f(x)-g(x)| \,dx=\int_a^b |-(g(x)-f(x))| \,dx=\int_a^b |g(x)-f(x)| \,dx=d(g,f)$$ Hence $d(f,g)=d(g,f)$.

  • Triangle Inequality

Let $f,g,h \in M$. Assume $d(f,h)=\int_a^b |f(x)-h(x)| \,dx$. \begin{equation*} \begin{split} d(f,h) & =\int_a^b |f(x)-h(x)| \,dx \\ & =\int_a^b |f(x)-g(x)+g(x)-h(x)| \,dx\\ & \leq \int_a^b |f(x)-g(x)|+|g(x)-h(x)| \,dx\\ & =\int_a^b |f(x)-g(x)|\,dx + \int_a^b|g(x)-h(x)| \,dx\\ & =d(f,g)+d(g,h) \\ \end{split} \end{equation*} Hence $d(f,h) \leq d(f,g)+d(g,h)$.

Hence M,d is a metric space.

$\textbf{What is $d(\sin(x),\cos(x))$ for $[a,b]=[0, 2\pi]$?}$

$$d(\sin(x),\cos(x))=\int_0^{2\pi} |\sin(x)-\cos(x)| \,dx=(-\cos(x)-\sin(x))]_0^{2 \pi}=0$$ Is this correct?

Correction: \begin{equation*} \begin{split} d(\sin(x),\cos(x)) & =\int_0^{2\pi} |\sin(x)-\cos(x)| \,dx \\ & =\int_0^\frac{\pi}{4} \cos(x)-sin(x)\,dx +\int_\frac{\pi}{4}^\frac{5\pi}{4} \sin(x)-cos(x)\,dx+\int_\frac{5\pi}{4}^{2\pi} \cos(x)-sin(x)\,dx \\ & = \sqrt{2}-1+2\sqrt{2}+1+\sqrt{2}\\ & =4\sqrt{2} \\ \end{split} \end{equation*}

2

There are 2 best solutions below

4
On

No. You cannot simply drop the absolute values. You have to break up the integral into pieces where $\sin x > \cos x$ and vice versa. The answer should be $4\sqrt{2}$.

2
On

You claim that if the integral of $|f-g|$ is zero, then $f - g$ must be zero, but without any supporting argument. Consider the function $f(x) = 0$ for all $x$ except $f(0) = 1$, while $g(x) = 0$. The integral of the absolute value of the difference of these over the interval $[-1, 1]$ is zero, but the function difference is certainly not zero.

Your claim is actually true, but requires proof...including a reason that will outlaw the case I just proposed as a "counterexample".

Your integral at the bottom is wrong, however. The function and its absolute value are different, and you need to address that by breaking the integral into multiple parts. (It also contradicts what you supposedly proved above: that if $d(f, g) = 0$, then $f = g$!)