Big O Subtraction: $g(x) = f(x) + O(x) \rightarrow f(x) = g(x) + O(x)$

42 Views Asked by At

Is this true, that:

$$ g(x) = f(x) + O(x) \rightarrow f(x) = g(x) + O(x)$$

In other words, is the order relation symmetric? How can I prove this?

I think this is true, since:

$$ g(x) = f(x) + O(x) \rightarrow g(x) - f(x) = O(x) $$

So in other words:

$$ \frac{|g(x) - f(x)|}{x} = K $$

For some value $K$ as $x \rightarrow \infty$. Similarly, we see that:

$$ f(x) = g(x) + O(x) \rightarrow f(x) - g(x) = O(x) $$

So in other words:

$$ \frac{|f(x) - g(x)|}{x} = M $$

For some other value $M$ as $x \rightarrow \infty$. But since $|g(x) - f(x)|$ = $|f(x) - g(x)|$, we have that $K = M$. So the relation holds.


Is this the way to prove this?

1

There are 1 best solutions below

4
On BEST ANSWER

The idea is correct, but the problem with these proofs is that what we write as $O(x) $ is actually just some element from the set $O(x)$. So the most rigorous way would probably be to pick a representative element. Something like: let $ h\in O(x) $ such that $f(x) =g(x) +h(x) $ then $g(x) =f(x) - h(x) $ and since $-h \in O(x) $ our hypotesis holds. If you find it tricky, try to find the rigorous definition of $O(f)$.