Rank factorization (source code)

= Rank factorization
{title2=$A=BC,\quad B\in\mathbb R^{m\times r},\quad C\in\mathbb R^{r\times n}$}
{wiki}

For a <matrix> of <matrix rank> $r$, choose an ordered <basis> of its <column space> as the columns of $B$. Express every column of $A$ in that basis and put its coordinates in $C$. Then $A=BC$, $B$ has <full column rank> and $C$ has <full row rank>. Choosing independent original columns makes the corresponding columns of $C$ the standard basis <vectors>, directly proving its rank.

The basis choice is not unique: for any invertible $r\times r$ <matrix> $S$, the factors $BS$ and $S^{-1}C$ have the same product. Once $B$ is fixed, its coordinate <matrix> is unique. For rank zero, the empty factors of the displayed shapes represent the zero <matrix>.