I was given the matrix: $$\left[\begin{matrix}1&3&0&-2&-7\\0&1&0&3&6\\0&0&1&0&2\\0&0&0&1&-2\end{matrix}\right]$$ And I was told to continue the row operations to solve the solution for the original system. So for the first step I subtracted $3R_4$, where $R_4$ is row $4$, to get rid of the $x_2$ in the original system. To get: $$\left[\begin{matrix}1&3&0&-2&-7\\0&1&0&0&12\\0&0&1&0&2\\0&0&0&1&-2\end{matrix}\right]$$ Then what I did was $R_1-3R_2$ to get rid of the $x_2$:
$$\left[\begin{matrix}1&0&0&-2&-43\\0&1&0&0&12\\0&0&1&0&2\\0&0&0&1&-2\end{matrix}\right]$$Then lastly $R_1+2R_4$ to get rid of the $x_4$ in $R_1$
$$\left[\begin{matrix}1&0&0&0&-47\\0&1&0&0&12\\0&0&1&0&2\\0&0&0&1&-2\end{matrix}\right]$$I'm curious as to why were able to do this to a matrix. It seems like these manipulations to the rows would make it different. It's strange to me that we can add a constant times another row to get a new, replacement row. Is there any theory behind this, or is it just that simple that we can just change it?
Edit: I changed the question from "did I do this right to" a "why can we do this" just so theres no confusion about the current comments.