Gaussian elimination
For a system of $m$ linear equations in $n$ unknowns, $$\pmat{A_{11} & A_{12} & A_{13} & \ldots & A_{1n} \\ A_{21} & A_{22} & A_{23} & \ldots & A_{2n} \\ \vdots & & & \ddots & \vdots \\ A_{m1} & A_{m2} & A_{m3} & \ldots & A_{mn}} \pmat{x_1 \\ x_2 \\ x_3 \\ \vdots \\ x_n} = \pmat{d_1 \\ d_2 \\ \vdots \\ d_m} \qquad \qquad \begin{cases} A_{11} x_1 + A_{12} x_2 + \ldots + A_{1n} x_n &= d_1 \\ A_{21} x_1 + A_{22} x_2 + \ldots + A_{2n} x_n &= d_2 \\ \vdots \\ A_{m1} x_1 + A_{m2} x_2 + \ldots + A_{mn} x_n &= d_m \\ \end{cases}$$
By assuming $A_{11}\neq 0$ etc by reordering the equations or variables if needed, we write $x_1$ in terms of the other variables, and then substitute into the other equations. Repeat and terminate when we have no equations with non-zero coefficients left. We will get $$\pmat{A_{11} & A_{12} & A_{13} & \ldots & \ldots & \ldots & A_{1n} \\ 0 & A_{22}^{(2)} & A_{23}^{(2)} & \ldots & \ldots & \ldots & A_{2n}^{(2)} \\ \vdots & & \ddots &&& &\vdots \\ 0 & \ldots & 0 & A_{rr}^{(r)} & A_{r(r+1)}^{(r)} & \ldots & A_{rn}^{(n)} \\ 0 & \ldots & 0 & 0 & 0 & \ldots & 0 \\ \vdots &&&&&& \vdots \\ 0 & \ldots & \ldots & \ldots & \ldots & \ldots & 0} \pmat{x_1 \\ x_2 \\ x_3 \\ \vdots \\ x_n} = \pmat{d_1 \\ d_2 \\ \vdots \\ d_m} \quad \quad \begin{cases} A_{11} x_1 &+& A_{12} x_2 &+& \ldots &+&\ldots&+&A_{1n} x_n &=& d_1 \\ & &A_{22}^{(2)} x_2 &+&\ldots &+& \ldots &+& A_{2n}^{(2)} x_n &=& d_2^{(2)} \\ &&&\ddots &&&&&&&\vdots \\ &&&&A_{rr}^{(r)} x_r &+& \ldots &+& A_{rn}^{(r)} x_n &=& d_r^{(r)} \\ &&&&&&&&0 &=& d_{r+1}^{(r)} \\ &&&&&&&&\vdots &=& \vdots \\ &&&&&&&&0 &=& d_{n}^{(r)} \\ \end{cases}$$ with $A_{ii}^{(n)} \neq 0$ for all $i=1,2,\ldots,r$, where the superfix refers to the version number.
-
If $r<m$ and $d_i^{(r)} \neq 0$ for some $i=r+1,r+2,\ldots,m$, then the system is inconsistent, so there is no solution.
We say the system is overdetermined. -
If $r=n\leq m$ and all $d_i^{(r)} = 0$ for some $i=r+1,r+2,\ldots,m$, then last non-zero equation $$ A_{nn}^{(n)} x_n = d_n^{(n)} $$ can be solved, then performing back substitution gives a unique solution.
We say the system is determined. -
If $r<n$ and all $d_i^{(r)} = 0$ for some $i=r+1,r+2,\ldots,m$, then the last non-zero equation is $$A_{rr}^{(r)} x_r + A_{r(r+1)}^{(r)} x_{r+1} + \ldots + A_{rn}^{(r)} x_{n} = d_{r}^{(r)}, $$ so $x_{r+1}, \ldots, x_n$ can be chosen freely, and back substitution gives a valid solution.
Therefore we have infinitely many solution.
We say the system is underdetermined.
When $m=n$, $\det A = (-1)^R \det$ (the upper triangular matrix), where $R$ is the number of rearrangements of rows and columns.
Note that since the only $\sigma\in S_n$ such that $\sigma(i)\geq i$ for all $i=1,\ldots,n$ is the identity, $$ \det A = (-1)^R A_{11} A_{22}^{(2)} A_{33}^{(3)} \ldots A_{nn}^{(n)}. $$ Therefore $\det A=0$ iff $r<n$.