Where does the inequality: $|f(x)-f(y)|\leq|f(x)-f_n(x)|+|f_n(x)-f_n(y)|+|f_n(y)-f(y)|$ come from?

I've seen the inequality

$$|f(x)-f(y)|\leq|f(x)-f_n(x)|+|f_n(x)-f_n(y)|+|f_n(y)-f(y)|$$

used many times to prove that if a sequence of continuous functions converges uniformly to $f$, then $f$ is continuous, but I never understood where it came from.

Could someone enlighten me?

1 Answer

\begin{align} |f(x)-f(y)| &= |f(x)-f_n(x)+f_n(x)-f_n(y)+f_n(y) - f(y)| \\ &\leq |f(x)-f_n(x)|+|f_n(x)-f_n(y)|+|f_n(y)-f(y)| \end{align} using the triangle inequality.

• Thanks a lot! I figured I had to use the triangle inequality, but I couldn't think of your clever way. – YoTengoUnLCD Dec 19 '15 at 2:15
• I will accept your answer when it's available (also, I've never seen an answer get so many upvotes in so little time haha). – YoTengoUnLCD Dec 19 '15 at 2:16
• @YoTengoUnLCD Haha, I've been here for 2.5 years and I'd have to say the same – Clarinetist Dec 19 '15 at 2:20