Prove that two lines are perpendicular to each other if and only if their slopes are negative reciprocals of each other
Proof: Let $l_1$ and $l_2$ be arbitrary lines.
$(\rightarrow)$ Suppose that $l_1$ and $l_2$ are perpendicular. Then the angle between the two lines is $90^\circ$. Suppose that $l_2$ is the line with a greater angle of inclination. Then $A_1 = A_2 - 90^\circ$. Then \begin{align} m_1 &= \tan(A_1) \\ &= \tan(A_2 - 90^\circ) \\ &= \frac{\sin(A_2-90^\circ)}{\cos(A_2 - 90^\circ)} \\ &= \frac{\sin(A_2)\cos(-90) + \sin(-90)\cos(A_2)}{\cos(A_2)\cos(-90)-\sin(A_2)\sin(-90)} \\ &= - \frac{\cos(A_2)}{\sin(A_2)} \\ &= - \frac{1}{\tan(A_2)} = - \frac{1}{m_2} \end{align} $(\leftarrow)$ Now suppose that the slopes of $l_1$ and $l_2$ are negative reciprocals of each other. Then $m_1 = \tan(A_1) = - \frac{1}{\tan(A_2)} = - \frac{1}{m_2}$...
How can I go about completing this part of the proof? I tried considering the formula for the tangent of the angle between two lines, but that does not seem to work since $\tan(90^\circ)$ is undefined.