# Why is this not an equivalence relation on real functions? $(\exists c\in\mathbb{R})(\forall x\in\mathbb{R})|f(x)-g(x)|=c$

Say we have the following relation on the set of all functions $$\mathbb{R} \to \mathbb{R}$$

$$(\exists c \in \mathbb{R})(\forall x \in \mathbb{R})|f(x) - g(x)| = c$$

I'm having trouble understanding why this relation isn't an equivalence relation.

I know that the relation is reflexive, as $$f(x) - f(x) = 0$$, $$0 \in \mathbb{R}$$.

But I'm having trouble when it comes to symmetry and transitivity.

• Symmetry follows at once from that absolute value there: $\;|f(x)-g(x)|=|g(x)-f(x)|\;$ – DonAntonio Jun 16 '20 at 11:01
• ...and who says it isn't an equivalence relation? Why do you thin it isn't? – DonAntonio Jun 16 '20 at 11:09
• @DonAntonio It is not an equivalence relation if we consider also discontinuous function. For example $f(x) = 1, x \in \mathbb{Q}$ and $f(x) = -1, x \notin \mathbb{Q}$, is related to the null function. The null function is related to $g(x) = 1$. But $f$ is not related to $g$. – Enforce Jun 16 '20 at 11:21
• @DonAntonio This relation is defined on the set of all functions $\mathbb{R}\to\mathbb{R}$, not only continuous ones. – mwt Jun 16 '20 at 11:22
• @mwt I know. I only wanted the OP to answer why he/she believes the relation isn't an equivalence one... – DonAntonio Jun 16 '20 at 11:44

Say $$f(x)= -1$$ if $$x <0$$ and $$f(x) = 1$$ if $$x \geqslant 0$$. Then $$|f(x) - 0| = 1$$ and $$f$$ is related to the null function.

The constant function $$g(x) = 1$$ is also related to the null function.

But $$f$$ and $$g$$ are not related as $$|f(x)-g(x)|$$ is non-constant!

I think if you restrict your relation on continuous functions, you avoid this kind of behavior and maybe it would define an equivalence relation on this set.

• You're right and thanks for pointing out my mistake in my (now deleted) answer. Lack of sleep does that haha. – Matheus Andrade Jun 16 '20 at 11:16

To show that the relation is not transitive let's take three functions $$f,g,h : \mathbb{R} \to \mathbb{R}$$ defined as follows: \begin{align} f(x) &= 0 \\ g(x) &= \left\lbrace\begin{array} --1 &\text{ for x < 0} \\ 1 &\text{ for x >= 0} \\ \end{array}\right. \\ h(x) &= g(x) + 1 \end{align}

For all $$x \in \mathbb{R}$$ we have $$|f(x) - g(x)| = 1$$ and $$|g(x) - h(x)| = 1$$. However $$|f(x) - h(x)|$$ equals either $$0$$ (for $$x < 0$$) or $$2$$ (for $$x >= 0$$).