# Why does going from 2's complement (in binary) to the positive value by completing to 1 then adding 1 work?

I'm studying Computer science and this has confused me for a long time since our professor didn't give any proof.

When changing from 2's complement to the positive value, we can go in reverse (by subtracting 1, then using 1's complement), and that's clear why it works.

But our professor told us another method which is taking the number, using 1's complement, THEN adding 1.

I don't understand why the second method works.

Suppose that your integers are $$n$$ bit long. One's complement changes $$x$$ to $$2^n-1-x$$, since adding $$x$$ to its one's complement gives $$\underbrace{1\dots 1}_{n}{}_2 = 2^n-1$$.
Subtracting 1 and taking one's complement changes $$x$$ to $$2^n-1-(x-1) = 2^n-x$$.
Taking one's complement and adding 1 changes $$x$$ to $$(2^n-1-x)+1 = 2^n-x$$.