Pivot columns in Linear optimization proof I need help. 
I am trying to understand pivot columns in Linear optimization and not sure how they got from:

$$y_i=\frac{1}{a_{ij}}(-y_1a_{1j}-\ldots-y_{(i-1)}a_{(i-1)j}+s_j-y_{i+1}a_{(i+1)j}-\ldots-y_{m}a_{mj})$$
  Then we may substitute this expression for $y_i$ into other equations. For example:
  $$y_1\left(a_{1k}-\frac{a_{ik}a_{1j}}{a_{ij}}\right)+\ldots+s_j\left(\frac{a_{ik}}{a_{ij}}\right)+y_m\left(a_{mk}-\frac{a_{ik}{a_{mj}}}{a_{ij}}\right) $$

then somehow manage to arrive at the generalization of these four pivot equations:

$$\hat{a}_{ij}=\frac{1}{a_{ij}}$$
  $$ \hat{a}_{hj}=-\frac{a_{hj}}{a_{ij}} \ \text{ for } h\neq i$$
  $$ \hat{a}_{ik}=\frac{a_{ik}}{a_{ij}} \ \text{ for } k\neq j$$
  $$ \hat{a}_{hk}=\left(a_{hk}-\frac{a_{ik}{a_{hj}}}{a_{ij}}\right) \ \text{ for } h\neq i \text{ and }  k\neq j $$

I get that they were algebraically manipulating the basic system of an $m \times n$ matrix, but not sure exactly how...
Any help is greatly appreciated. 
 A: Set up a $2 \times 2$ matrix and see what happens; if you understand that, then the transformation for any larger matrix behaves the same way.
So let's start with the system
$$a_{11}y_1 + a_{21}y_2 - s_1 = -t_1\\
a_{12}y_1 + a_{22}y_2 - s_2 = -t_2$$
where the $t_j$ represent slack variables. (This looks sideways to me, since it seems like the columns of a matrix rather than the rows, but that's how you've presented it, so I assume you're fine with it. Also, your notation might be slightly different; perhaps my $t_1$ and $t_2$ are your $y_3$ and $y_4$.)
The basic variables at the beginning are $t_1$ and $t_2$. Suppose that we swap $y_1$ and $t_1$; in other words, we want to isolate $y_1$ and move it to the RHS. So the first equation becomes
$$\frac1{a_{11}}t_1 + \frac{a_{21}}{a_{11}}y_2 - \frac1{a_{11}}s_1 = -y_1.$$
That's the first line you quoted in your question. Now take this expression for $-y_1$ and substitute it into the second equation, giving
$$a_{12}\left[-\left(\frac1{a_{11}}t_1 + \frac{a_{21}}{a_{11}}y_2 - \frac1{a_{11}}s_1\right)\right] + a_{22}y_2 - s_2 = -t_2,$$
and after gathering coefficients for like variables, we get
$$-\frac{a_{12}}{a_{11}}t_1 + \left(a_{22}-\frac{a_{12}a_{21}}{a_{11}}\right)y_2 + \left(-1+\frac{a_{12}}{a_{11}}\right)s_2 = -t_2.$$
You can see that the new coefficients correspond to the ones in the pivot equations.
