# A nifty triangle inequality trick

I was reading the proof of a theorem and at a point of the argument the author just posed an inequality which I was unable to derive, but is probably just a smart application of the triangle inequality.

The problem is as follows. Let $$f,g:\mathbb{R} \to \mathbb{R}$$ be uniformly continuous and $$\epsilon, \delta >0$$ such that if $$x,y\in \mathbb{R}$$ are st $$|x-y| < \delta$$, that then $$|f(x)-f(y)|, |g(x)-g(y)| <\epsilon$$. Let $$I \subset \mathbb{R}$$ be an interval with $$diam(I) < \delta$$

The author then states without proof that $$\sup_{x,y\in I} |f(x)-g(y)|^p < |f(t)-g(t)+2\epsilon|^p$$ for all $$t \in I$$., $$p\geq 1$$

It feels as if this should be easy to prove, but I have been stuck at it for quite some time now. Any help would be greatly appreciated.

• I edited the problem formulation to the one as in the proof as there was a crucial mistake in my original formulation. Sorry! Mar 6, 2019 at 22:04

It appears to be a mistake, possibly a typo. Consider the following $$2$$ uniformly continuous functions

$$f(x) = bx - c \tag{1}\label{eq1}$$ $$g(x) = \left| x \right| + a \tag{2}\label{eq2}$$

with $$a, b \in \mathbb{R}$$, $$a \gt 0$$, $$b \gt 1$$ and $$c \gt 0$$. Also, let $$\delta = 1$$. In this case, $$|f(x)-f(y)| \lt b$$ and $$|g(x)-g(y)| \lt 1$$ in the interval, so we can choose $$\epsilon = b$$. Next, let $$I = [-0.9, -0.1]$$. Note that

$$\left| f(-0.9) - g(-0.1) \right| = \left| -0.9b - c - 0.1 - a \right| = 0.9b + c + 0.1 + a \tag{3}\label{eq3}$$

Next, let $$t = -0.5$$ to get

$$\left| f(-0.5) - g(-0.5) + 2\epsilon \right| = \left| -0.5b - c - 0.5 - a + 2b \right| = \left| 1.5b - c - 0.5 - a \right| \tag{4}\label{eq4}$$

There are many values for $$a, b \text{ and } c$$ which show that the base requested inequality of

$$|f(x)-g(y)| < |f(t)-g(t)+2\epsilon| \tag{5}\label{eq5}$$

does not hold. For example, if $$b = 2$$, $$c = 1$$ and $$a = 1$$, then \eqref{eq3} gives $$3.9$$ while \eqref{eq4} give $$0.5$$.

We have $$|f(x)-g(x)|= |f(x)-f(t)+f(t)-g(x)+g(t)-g(t)|$$ And this is less than $$|f(t)-g(t)+2\epsilon|$$ by uniform continuity

• Can you explain how you keep the $\varepsilon$ inside the absolute values? I'm in agreement with this method if you know $f(t)\geq g(t)$ for all $t\in I$, but it's possible that the inequality reverses any number of times. Essentially, one can easily prove $|f(x)-g(y)|<|f(t)-g(t)|+2\varepsilon$ for all $t\in I$, but keeping the $\varepsilon$ inside the absolute values seemed a little more delicate (I can be missing something obvious, though). Mar 6, 2019 at 22:17
• @Clayton good point...actually doesn't that lead to a counter example showing this is false without additional assumptions? For instance take $f=x$ and $g=x+1$? Mar 6, 2019 at 22:29
• @Clayton I agree with what you wrote, including that it's quite easy to prove that $|f(x)-g(y)| \lt |f(t)-g(t)| + 2\epsilon$ for all $t \in I$. As I believe I show how to create various fairly simple counter-examples in my answer, you can't always keep the $\epsilon$ within the absolute values, so I don't think you're missing anything obvious. Mar 7, 2019 at 3:20