TITLE: Can you use both sides of an equation to prove equality?
QUESTION [31 upvotes]: For example:

$\color{red}{\text{Show that}}$$$\color{red}{\frac{4\cos(2x)}{1+\cos(2x)}=4-2\sec^2(x)}$$

In high school my maths teacher told me

To prove equality of an equation; you start on one side and manipulate it algebraically until it is equal to the other side.

So starting from the LHS: $$\frac{4\cos(2x)}{1+\cos(2x)}=\frac{4(2\cos^2(x)-1)}{2\cos^2(x)}=\frac{2(2\cos^2(x)-1)}{\cos^2(x)}=\frac{4\cos^2(x)-2}{\cos^2(x)}=4-2\sec^2(x)$$ $\large\fbox{}$
At University, my Maths Analysis teacher tells me

To prove a statement is true, you must not use what you are trying to prove.

So using the same example as before:
LHS = $$\frac{4\cos(2x)}{1+\cos(2x)}=\frac{4(2\cos^2(x)-1)}{2\cos^2(x)}=\frac{2(2\cos^2(x)-1)}{\cos^2(x)}=\frac{2\Big(2\cos^2(x)-\left[\sin^2(x)+\cos^2(x)\right]\Big)}{\cos^2(x)}=\frac{2(\cos^2(x)-\sin^2(x))}{\cos^2(x)}=\bbox[yellow]{2-2\tan^2(x)}$$
RHS =$$4-2\sec^2(x)=4-2(1+\tan^2(x))=\bbox[yellow]{2-2\tan^2(x)}$$
So I have shown that the two sides of the equality in $\color{red}{\rm{red}}$ are equal to the same highlighted expression. But is this a sufficient proof?
Since I used both sides of the equality (which is effectively; using what I was trying to prove) to show that $$\color{red}{\frac{4\cos(2x)}{1+\cos(2x)}=4-2\sec^2(x)}$$
One of the reasons why I am asking this question is because I have a bounty question which is suffering from the exact same issue that this post is about.

EDIT:
Comments and answers below seem to indicate that you can use both sides to prove equality. So does this mean that my high school maths teacher was wrong?
$$\bbox[#AFF]{\text{Suppose we have an identity instead of an equality:}}$$ $$\bbox[#AFF]{\text{Is it possible to manipulate both sides of an identity to prove that the identity holds?}}$$
Thank you.

REPLY [5 votes]: Unfortunately your high-school teacher (and some of the other answers) is wrong. It is false that proving something of the form "$A = B$" is always possible by starting from one side and algebraically manipulating it to get a sequence of equal expressions ending with the other side, not to say necessary.
Not necessary
Let us first deal with the false misconception that you can only go in one direction. Suppose you have proven the following, where $A,B,C$ are any expressions:
  $A = C$.
  $B = C$.
Then you can use the second sentence to substitute $C$ for $B$ in the first to obtain:
  $A = B$.
This is logically valid because "$=$" means "is exactly the same as".
Not always possible
Let us now consider an example where it is simply impossible to manipulate from one side to the other to prove an equality!
$\def\zz{\mathbb{Z}}$
$\def\qq{\mathbb{Q}}$
$\def\rr{\mathbb{R}}$
Theorem:
  Take any $x \in \rr$ such that $x^2 \le 0$. Then $x = 0$.
Proof:
  $x = 0$ or $x > 0$ or $x < 0$.   [by trichotomy]
  If $x > 0$:
    $x^2 = x \times x > 0$.   [by positive multiplication]
    This contradicts $x^2 \le 0$.
  If $x < 0$:
    $0 < -x$.   [by subtraction]
    $x^2 = (-x) \times (-x) > 0$.   [by positive multiplication]
    This contradicts $x^2 \le 0$.
  Therefore $x = 0$.
Here "positive multiplication" denotes "multiplying by a positive real", which preserves the inequality sign. Similarly subtraction preserves an inequality. The above theorem cannot be proven directly by algebraic manipulation from one side "$x$" to the other "$0$", simply because the only given condition is an inequality.
Similarly the construction of $\sqrt{2}$ in elementary real analysis, as shown below, does not permit a proof by algebraic manipulation.
Theorem:
  Let $S = \{ r : r \in \qq_{\ge 0} \land r^2 \le 2 \}$.
  Then $S$ is non-empty and has an upper bound in $\rr$.
  Let $x = \sup_\rr(S)$.
  Then $x^2 = 2$.
Proof:
  [Exercise! Or see a good textbook like Spivak's.]
General identities
To address the new sub-question in blue, it suffices to generalize the above theorem to the cube-root of arbitrary real numbers, namely:

$\sup( \{ r : r \in \qq \land r^3 \le x \} )^3 = x$ for any $x \in \rr$.

This is an identity but cannot be proven by direct manipulation. You may not be satisfied with this counter-example, but in higher mathematics this kind of identity is in fact the usual kind that we are interested in, rather than identities that can be proven by algebraic manipulation (which are usually considered trivial). Here are some more examples:

$\lceil \frac{m}{n} \rceil = \lfloor \frac{m-1}{n}+1 \rfloor$ for any $m \in \zz$ and $n \in \zz_{>0}$.
$\sum_{k=0}^{n-1} 2^k = 2^n-1$ for any $n \in \zz_{>0}$.

Nevertheless, if you desire an arithmetic identity, the question becomes much more interesting and depends heavily on what you mean by "arithmetic" and what axioms you are allowed to use. Tarski's problem asked whether an arithmetic identity concerning positive integers can be proven using only the basic high-school identities about them, and Wilkie gave an explicit and simple identity that cannot be so proven, basically because any proof needs to use subtraction and hence negative integers.