# Topics in Abstract Algebra/Linear algebra
## The Moore-Penrose inverse

Inverse matrices play a key role in linear algebra, and particularly in computations. However, only square matrices can possibly be invertible. This leads us to introduce the Moore-Penrose inverse of a potentially non-square real- or complex-valued matrix, which satisfies some but not necessarily all of the properties of an inverse matrix.
Definition.
$A$
$\mathbb {K}$
$A^{+}$
$\mathbb {K}$
$\mathbb {K}$
$\mathbb {R}$
$\mathbb {C}$
$A^{*}$
$A$
* $AA^{+}A=A$,
* $A^{+}AA^{+}=A^{+}$,
* $\left(AA^{+}\right)^{*}=AA^{+}$,
* $\left(A^{+}A\right)^{*}=A^{+}A$.
We will see below that given a matrix $A$, there exists a unique matrix $A^{+}$ that satisfies all four of the Moore–Penrose conditions. They generalise the properties of the usual inverse.
Remark.
$A$
$A^{-1}$
$A$
$A^{+}$
$A$
$A$
$A^{+}$

### Basic properties of the Hermitian conjugate

We assemble some basic properties of the conjugate transpose for later use. In the following lemmas, $A$ is a matrix with complex elements and n columns, $B$ is a matrix with complex elements and n rows.
Lemma (1).
$\mathbb {K}$
$A$
$A^{*}A=0\Rightarrow A=0$
Proof. The assumption says that all elements of A*A are zero. Therefore,
    $0=\operatorname {Tr} \left(A^{*}A\right)=\sum _{j=1}^{n}\left(A^{*}A\right)_{jj}=\sum _{j=1}^{n}\sum _{i=1}^{m}\left(A^{*}\right)_{ji}A_{ij}=\sum _{i=1}^{m}\sum _{j=1}^{n}\left|A_{ij}\right|^{2}.$
Therefore, all $A_{ij}$ equal 0 i.e. $A=0$. $\square$
Lemma (2).
$\mathbb {K}$
$A$
$A^{*}AB=0\Rightarrow AB=0$
Proof. : ${\begin{aligned}0&=A^{*}AB&\\\Rightarrow 0&=B^{*}A^{*}AB&\\\Rightarrow 0&=(AB)^{*}(AB)&\\\Rightarrow 0&=AB&({\text{by Lemma 1}})\end{aligned}}$ $\square$
Lemma (3).
$\mathbb {K}$
$A$
$ABB^{*}=0\Rightarrow AB=0$
Proof. This is proved in a manner similar to the argument of Lemma 2 (or by simply taking the Hermitian conjugate). $\square$

### Existence and uniqueness

We establish existence and uniqueness of the Moore-Penrose inverse for every matrix.
Theorem.
$A$
$\mathbb {K}$
$A_{1}^{+}$
$A_{2}^{+}$
$A$
$A_{1}^{+}=A_{2}^{+}$
Proof. Let $A$ be a matrix over $\mathbb {R}$ or $\mathbb {C}$. Suppose that ${A_{1}^{+}}$ and ${A_{2}^{+}}$ are Moore–Penrose inverses of $A$. Observe then that
    $A{A_{1}^{+}}{\overset {(1)}{=}}(A{A_{2}^{+}}A){A_{1}^{+}}=(A{A_{2}^{+}})(A{A_{1}^{+}}){\overset {(3)}{=}}(A{A_{2}^{+}})^{*}(A{A_{1}^{+}})^{*}={A_{2}^{+}}^{*}(A{A_{1}^{+}}A)^{*}{\overset {(1)}{=}}{A_{2}^{+}}^{*}A^{*}=(A{A_{2}^{+}})^{*}{\overset {(3)}{=}}A{A_{2}^{+}}.$
Analogously we conclude that ${A_{1}^{+}}A={A_{2}^{+}}A$. The proof is completed by observing that then
    ${A_{1}^{+}}{\overset {(2)}{=}}{A_{1}^{+}}A{A_{1}^{+}}={A_{1}^{+}}A{A_{2}^{+}}=A_{2}^{+}A{A_{2}^{+}}{\overset {(2)}{=}}{A_{2}^{+}}.$ $\square$
Theorem.
$\mathbb {K}$
$A$
$A^{+}$
$A$
Proof. The proof proceeds in stages.
$A$ is a 1-by-1 matrix
For any $x\in \mathbb {K}$, we define:
    $x^{+}:={\begin{cases}x^{-1},&{\mbox{if }}x\neq 0\\0,&{\mbox{if }}x=0\end{cases}}$
It is easy to see that $x^{+}$ is a pseudoinverse of $x$ (interpreted as a 1-by-1 matrix).
$A$ is a square diagonal matrix
Let $D$ be an n-by-n matrix over $\mathbb {K}$ with zeros off the diagonal. We define $D^{+}$ as an n-by-n matrix over $\mathbb {K}$ with $\left(D^{+}\right)_{ij}:=\left(D_{ij}\right)^{+}$ as defined above. We write simply $D_{ij}^{+}$ for $\left(D^{+}\right)_{ij}=\left(D_{ij}\right)^{+}$.
Notice that $D^{+}$ is also a matrix with zeros off the diagonal.
We now show that $D^{+}$ is a pseudoinverse of $D$:
* $\left(DD^{+}D\right)_{ij}=D_{ij}D_{ij}^{+}D_{ij}=D_{ij}\Rightarrow DD^{+}D=D$
* $\left(D^{+}DD^{+}\right)_{ij}=D_{ij}^{+}D_{ij}D_{ij}^{+}=D_{ij}^{+}\Rightarrow D^{+}DD^{+}=D^{+}$
* $\left(DD^{+}\right)_{ij}^{*}={\overline {\left(DD^{+}\right)_{ji}}}={\overline {D_{ji}D_{ji}^{+}}}=\left(D_{ji}D_{ji}^{+}\right)^{*}=D_{ji}D_{ji}^{+}=D_{ij}D_{ij}^{+}\Rightarrow \left(DD^{+}\right)^{*}=DD^{+}$
* $\left(D^{+}D\right)_{ij}^{*}={\overline {\left(D^{+}D\right)_{ji}}}={\overline {D_{ji}^{+}D_{ji}}}=\left(D_{ji}^{+}D_{ji}\right)^{*}=D_{ji}^{+}D_{ji}=D_{ij}^{+}D_{ij}\Rightarrow \left(D^{+}D\right)^{*}=D^{+}D$
$A$ is a general diagonal matrix
Let $D$ be an m-by-n matrix over $\mathbb {K}$ with zeros off the main diagonal, where m and n are unequal. That is, $D_{ij}=d_{i}$ for some $d_{i}\in \mathbb {K}$ when $i=j$ and $D_{ij}=0$ otherwise.
Consider the case where $n>m$. Then we can rewrite $D=\left[D_{0}\,\,\mathbf {0} _{m\times (n-m)}\right]$ by stacking where $D_{0}$ is a square diagonal m-by-m matrix, and $\mathbf {0} _{m\times (n-m)}$ is the m-by-(n−m) zero matrix. We define $D^{+}\equiv {\begin{bmatrix}D_{0}^{+}\\\mathbf {0} _{(n-m)\times m}\end{bmatrix}}$ as an n-by-m matrix over $\mathbb {K}$, with $D_{0}^{+}$ the pseudoinverse of $D_{0}$ defined above, and $\mathbf {0} _{(n-m)\times m}$ the (n−m)-by-m zero matrix. We now show that $D^{+}$ is a pseudoinverse of $D$:
* By multiplication of block matrices, $DD^{+}=D_{0}D_{0}^{+}+\mathbf {0} _{m\times (n-m)}\mathbf {0} _{(n-m)\times m}=D_{0}D_{0}^{+},$ so by property 1 for square diagonal matrices $D_{0}$ proven in the previous section,$DD^{+}D=D_{0}D_{0}^{+}\left[D_{0}\,\,\mathbf {0} _{m\times (n-m)}\right]=\left[D_{0}D_{0}^{+}D_{0}\,\,\mathbf {0} _{m\times (n-m)}\right]=\left[D_{0}\,\,\mathbf {0} _{m\times (n-m)}\right]=D$.
* Similarly, $D^{+}D={\begin{bmatrix}D_{0}^{+}D_{0}&\mathbf {0} _{m\times (n-m)}\\\mathbf {0} _{(n-m)\times m}&\mathbf {0} _{(n-m)\times (n-m)}\end{bmatrix}}$, so $D^{+}DD^{+}={\begin{bmatrix}D_{0}^{+}D_{0}&\mathbf {0} _{m\times (n-m)}\\\mathbf {0} _{(n-m)\times m}&\mathbf {0} _{(n-m)\times (n-m)}\end{bmatrix}}{\begin{bmatrix}D_{0}^{+}\\\mathbf {0} _{(n-m)\times m}\end{bmatrix}}={\begin{bmatrix}D_{0}^{+}D_{0}D_{0}^{+}\\\mathbf {0} _{(n-m)\times m}\end{bmatrix}}=D^{+}.$
* By 1 and property 3 for square diagonal matrices, $\left(DD^{+}\right)^{*}=\left(D_{0}D_{0}^{+}\right)^{*}=D_{0}D_{0}^{+}=DD^{+}$.
* By 2 and property 4 for square diagonal matrices, $\left(D^{+}D\right)^{*}={\begin{bmatrix}\left(D_{0}^{+}D_{0}\right)^{*}&\mathbf {0} _{m\times (n-m)}\\\mathbf {0} _{(n-m)\times m}&\mathbf {0} _{(n-m)\times (n-m)}\end{bmatrix}}={\begin{bmatrix}D_{0}^{+}D_{0}&\mathbf {0} _{m\times (n-m)}\\\mathbf {0} _{(n-m)\times m}&\mathbf {0} _{(n-m)\times (n-m)}\end{bmatrix}}=D^{+}D.$
Existence for $D$ such that $m>n$ follows by swapping the roles of $D$ and $D^{+}$ in the $n>m$ case and using the fact that $\left(D^{+}\right)^{+}=D$.
$A$ is an arbitrary matrix
The singular value decomposition theorem states that there exists a factorization of the form
    $A=U\Sigma V^{*}$
where:
    $U$ is an m-by-m unitary matrix over $\mathbb {K}$.
    $\Sigma$ is an m-by-n matrix over $\mathbb {K}$ with nonnegative real numbers on the diagonal and zeros off the diagonal.
    $V$ is an n-by-n unitary matrix over $\mathbb {K}$.
Define $A^{+}$ as $V\Sigma ^{+}U^{*}$.
We now show that $A^{+}$ is a pseudoinverse of $A$:
* $AA^{+}A=U\Sigma V^{*}V\Sigma ^{+}U^{*}U\Sigma V^{*}=U\Sigma \Sigma ^{+}\Sigma V^{*}=U\Sigma V^{*}=A$
* $A^{+}AA^{+}=V\Sigma ^{+}U^{*}U\Sigma V^{*}V\Sigma ^{+}U^{*}=V\Sigma ^{+}\Sigma \Sigma ^{+}U^{*}=V\Sigma ^{+}U^{*}=A^{+}$
* $\left(AA^{+}\right)^{*}=\left(U\Sigma V^{*}V\Sigma ^{+}U^{*}\right)^{*}=\left(U\Sigma \Sigma ^{+}U^{*}\right)^{*}=U\left(\Sigma \Sigma ^{+}\right)^{*}U^{*}=U\left(\Sigma \Sigma ^{+}\right)U^{*}=U\Sigma V^{*}V\Sigma ^{+}U^{*}=AA^{+}$
* $\left(A^{+}A\right)^{*}=\left(V\Sigma ^{+}U^{*}U\Sigma V^{*}\right)^{*}=\left(V\Sigma ^{+}\Sigma V^{*}\right)^{*}=V\left(\Sigma ^{+}\Sigma \right)^{*}V^{*}=V\left(\Sigma ^{+}\Sigma \right)V^{*}=V\Sigma ^{+}U^{*}U\Sigma V^{*}=A^{+}A$ $\square$
This leads us to the natural definition:
Definition (Moore-Penrose inverse).
$A$
$\mathbb {K}$
$\mathbb {K}$
$A$
$A^{+}$
$A$

### Basic properties

We have already seen above that the Moore-Penrose inverse generalises the classical inverse to potentially non-square matrices. We will now list some basic properties of its interaction with the Hermitian conjugate, leaving most of the proofs as exercises to the reader.
Exercise.
$\mathbb {K}$
$A$
${A^{*}}^{+}={A^{+}}^{*}$
The following identities hold:
* A$^+$ = A$^+$ A$^{+*}$ A$^*$
* A$^+$ = A$^*$ A$^{+*}$ A$^+$
* A = A$^{+*}$ A$^*$ A
* A = A A$^*$ A$^{+*}$
* A$^*$ = A$^*$ A A$^+$
* A$^*$ = A$^+$ A A$^*$
Proof of the first one: $A^{+}=A^{+}AA^{+}$ and $AA^{+}=\left(AA^{+}\right)^{*}$ imply that $A^{+}=A^{+}\left(AA^{+}\right)^{*}=A^{+}A^{+^{*}}A^{*}$. □
The remaining identities are left as exercises.

### Reduction to the Hermitian case

The results of this section show that the computation of the pseudoinverse is reducible to its construction in the Hermitian case. It suffices to show that the putative constructions satisfy the defining criteria.
Proposition.
$\mathbb {K}$
$A$
$A^{+}=A^{*}(AA^{*})^{+}$
Proof. Observe that
    ${\begin{aligned}&&AA^{*}&=AA^{*}\left(AA^{*}\right)^{+}AA^{*}&\\&\Leftrightarrow &AA^{*}&=ADAA^{*}&\\&\Leftrightarrow &0&=(AD-I)AA^{*}&\\&\Leftrightarrow &0&=ADA-A&({\text{by Lemma 3}})\\&\Leftrightarrow &A&=ADA&\end{aligned}}$
Similarly, $\left(AA^{*}\right)^{+}AA^{*}\left(AA^{*}\right)^{+}=\left(AA^{*}\right)^{+}$ implies that $A^{*}\left(AA^{*}\right)^{+}AA^{*}\left(AA^{*}\right)^{+}=A^{*}\left(AA^{*}\right)^{+}$ i.e. $DAD=D$.
Additionally, $AD=AA^{*}\left(AA^{*}\right)^{+}$ so $AD=(AD)^{*}$.
Finally, $DA=A^{*}\left(AA^{*}\right)^{+}A$ implies that $(DA)^{*}=A^{*}\left(\left(AA^{*}\right)^{+}\right)^{*}A=A^{*}\left(\left(AA^{*}\right)^{+}\right)A=DA$.
Therefore, $D=A^{+}$. $\square$
Exercise.
$\mathbb {K}$
$A$
$A^{+}=(A^{*}A)^{+}A^{*}$

### Products

We now turn to calculating the Moore-Penrose inverse for a product of two matrices, $C=AB.$
Proposition.
$A$
$A^{*}A=I$
$\mathbb {K}$
$B$
$(AB)^{+}=B^{+}A^{+}$
Proof. Since $A^{*}A=I$, $A^{+}=A^{*}$. Write $C=AB$ and $D=B^{+}A^{+}=B^{+}A^{*}$. We show that $D$ satisfies the Moore–Penrose criteria for $C$.
    ${\begin{aligned}CDC&=ABB^{+}A^{*}AB=ABB^{+}B=AB=C,\\[4pt]DCD&=B^{+}A^{*}ABB^{+}A^{*}=B^{+}BB^{+}A^{*}=B^{+}A^{*}=D,\\[4pt](CD)^{*}&=D^{*}B^{*}A^{*}=A\left(B^{+}\right)^{*}B^{*}A^{*}=A\left(BB^{+}\right)^{*}A^{*}=ABB^{+}A^{*}=CD,\\[4pt](DC)^{*}&=B^{*}A^{*}D^{*}=B^{*}A^{*}A\left(B^{+}\right)^{*}=\left(B^{+}B\right)^{*}=B^{+}B=B^{+}A^{*}AB=DC.\end{aligned}}$
Therefore, $D=C^{+}$. $\square$
Exercise.
$B$
$\mathbb {K}$
$A$
$(AB)^{+}=B^{+}A^{+}$
Another important special case which approximates closely that of invertible matrices is when $A$ has full column rank and $B$ has full row rank.
Proposition.
$A$
$B$
$(AB)^{+}=B^{+}A^{+}$
Proof. Since $A$ has full column rank, $A^{*}A$ is invertible so $\left(A^{*}A\right)^{+}=\left(A^{*}A\right)^{-1}$. Similarly, since $B$ has full row rank, $BB^{*}$ is invertible so $\left(BB^{*}\right)^{+}=\left(BB^{*}\right)^{-1}$.
Write $D=B^{+}A^{+}=B^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}$(using reduction to the Hermitian case). We show that $D$ satisfies the Moore–Penrose criteria.
    ${\begin{aligned}CDC&=ABB^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}AB=AB=C,\\[4pt]DCD&=B^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}ABB^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}=B^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}=D,\\[4pt]CD&=ABB^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}=A\left(A^{*}A\right)^{-1}A^{*}=\left(A\left(A^{*}A\right)^{-1}A^{*}\right)^{*},\\\Rightarrow (CD)^{*}&=CD,\\[4pt]DC&=B^{*}\left(BB^{*}\right)^{-1}\left(A^{*}A\right)^{-1}A^{*}AB=B^{*}\left(BB^{*}\right)^{-1}B=\left(B^{*}\left(BB^{*}\right)^{-1}B\right)^{*},\\\Rightarrow (DC)^{*}&=DC.\end{aligned}}$
Therefore, $D=C^{+}$. $\square$
We finally derive a formula for calculating the Moore-Penrose inverse of $AA^{*}$.
Proposition.
$B=A^{*}$
$(AB)^{+}=A^{+*}A^{+}$
Proof. Here, $B=A^{*}$, and thus $C=AA^{*}$ and $D=A^{+*}A^{+}$. We show that indeed $D$ satisfies the four Moore–Penrose criteria.
    ${\begin{aligned}CDC&=AA^{*}A^{+*}A^{+}AA^{*}=A\left(A^{+}A\right)^{*}A^{+}AA^{*}=AA^{+}AA^{+}AA^{*}=AA^{+}AA^{*}=AA^{*}=C\\[4pt]DCD&=A^{+*}A^{+}AA^{*}A^{+*}A^{+}=A^{+*}A^{+}A\left(A^{+}A\right)^{*}A^{+}=A^{+*}A^{+}AA^{+}AA^{+}=A^{+*}A^{+}AA^{+}=A^{+*}A^{+}=D\\[4pt](CD)^{*}&=\left(AA^{*}A^{+*}A^{+}\right)^{*}=A^{+*}A^{+}AA^{*}=A^{+*}\left(A^{+}A\right)^{*}A^{*}=A^{+*}A^{*}A^{+*}A^{*}\\&=\left(AA^{+}\right)^{*}\left(AA^{+}\right)^{*}=AA^{+}AA^{+}=A\left(A^{+}A\right)^{*}A^{+}=AA^{*}A^{+*}A^{+}=CD\\[4pt](DC)^{*}&=\left(A^{+*}A^{+}AA^{*}\right)^{*}=AA^{*}A^{+*}A^{+}=A\left(A^{+}A\right)^{*}A^{+}=AA^{+}AA^{+}\\&=\left(AA^{+}\right)^{*}\left(AA^{+}\right)^{*}=A^{+*}A^{*}A^{+*}A^{*}=A^{+*}\left(A^{+}A\right)^{*}A^{*}=A^{+*}A^{+}AA^{*}=DC\end{aligned}}$
Therefore, $D=C^{+}$. In other words:
    $\left(AA^{*}\right)^{+}=A^{+*}A^{+}$
and, since $\left(A^{*}\right)^{*}=A$
    $\left(A^{*}A\right)^{+}=A^{+}A^{+*}$ $\square$

### Projectors and subspaces

The defining feature of classical inverses is that $AA^{-1}=A^{-1}A=I.$ What can we say about $AA^{+}$ and $A^{+}A$?
We can derive some properties easily from the more basic properties above:
Exercise.
$A$
$\mathbb {K}$
$(AA^{+})^{2}=(AA^{+}),(A^{+}A)^{2}=(A^{+}A),(AA^{+})^{*}=(AA^{+})$
$(A^{+}A)^{*}=(A^{+}A)$
We can conclude that $P=AA^{+}$ and $Q=A^{+}A$ are orthogonal projections.
Proposition.
$A$
$\mathbb {K}$
$P=AA^{+}$
$Q=A^{+}A$
Proof. Indeed, consider the operator $P$: any vector decomposes as
    $x=Px+(I-P)x$
and for all vectors $x$ and $y$ satisfying $Px=x$ and $(I-P)y=y$, we have
    $x^{*}y=(Px)^{*}(I-P)y=x^{*}P^{*}(I-P)y=x^{*}P(I-P)y=0$.
It follows that $PA=AA^{+}A=A$ and $A^{+}P=A^{+}AA^{+}=A^{+}$. Similarly, $QA^{+}=A^{+}$ and $AQ=A$. The orthogonal components are now readily identified. $\square$
We finish our analysis by determining image and kernel of the mappings encoded by the Moore-Penrose inverse.
Proposition.
$A$
$\mathbb {K}$
$\operatorname {Ker} \left(A^{+}\right)=\operatorname {Ker} \left(A^{*}\right)$
$\operatorname {Im} \left(A^{+}\right)=\operatorname {Im} \left(A^{*}\right)$
Proof. If $y$ belongs to the range of $A$ then for some $x$, $y=Ax$ and $Py=PAx=Ax=y$. Conversely, if $Py=y$ then $y=AA^{+}y$ so that $y$ belongs to the range of $A$. It follows that $P$ is the orthogonal projector onto the range of $A$. $I-P$ is then the orthogonal projector onto the orthogonal complement of the range of $A$, which equals the kernel of $A^{*}$.
A similar argument using the relation $QA^{*}=A^{*}$ establishes that $Q$ is the orthogonal projector onto the range of $A^{*}$ and $(I-Q)$ is the orthogonal projector onto the kernel of $A$.
Using the relations $P\left(A^{+}\right)^{*}=P^{*}\left(A^{+}\right)^{*}=\left(A^{+}P\right)^{*}=\left(A^{+}\right)^{*}$ and $P=P^{*}=\left(A^{+}\right)^{*}A^{*}$ it follows that the range of P equals the range of $\left(A^{+}\right)^{*}$, which in turn implies that the range of $I-P$ equals the kernel of $A^{+}$. Similarly $QA^{+}=A^{+}$ implies that the range of $Q$ equals the range of $A^{+}$. Therefore, we find,
    ${\begin{aligned}\operatorname {Ker} \left(A^{+}\right)&=\operatorname {Ker} \left(A^{*}\right).\\\operatorname {Im} \left(A^{+}\right)&=\operatorname {Im} \left(A^{*}\right).\\\end{aligned}}$ $\square$

### Applications

We present two applications of the Moore-Penrose inverse in solving linear systems of equations.

#### Least-squares minimization

Moore-Penrose inverses can be used for least-squares minimisation of a system of equations that might not necessarily have an exact solution.
Proposition.
$m\times n$
$A$
$\|Ax-b\|_{2}\geq \|Az-b\|_{2}$
$z=A^{+}b$
Proof. We first note that (stating the complex case), using the fact that $P=AA^{+}$ satisfies $PA=A$ and $P=P^{*}$, we have
    ${\begin{alignedat}{2}A^{*}(Az-b)&=A^{*}(AA^{+}b-b)\\&=A^{*}(Pb-b)\\&=A^{*}P^{*}b-A^{*}b\\&=(PA)^{*}b-A^{*}b\\&=0\end{alignedat}}$
so that (${\text{c.c.}}$ stands for the Hermitian conjugate of the previous term in the following)
    ${\begin{alignedat}{2}\|Ax-b\|_{2}^{2}&=\|Az-b\|_{2}^{2}+(A(x-z))^{*}(Az-b)+{\text{c.c.}}+\|A(x-z)\|_{2}^{2}\\&=\|Az-b\|_{2}^{2}+(x-z)^{*}A^{*}(Az-b)+{\text{c.c.}}+\|A(x-z)\|_{2}^{2}\\&=\|Az-b\|_{2}^{2}+\|A(x-z)\|_{2}^{2}\\&\geq \|Az-b\|_{2}^{2}\end{alignedat}}$
as claimed. $\square$
Remark.
$Ax=b$
$A$
$m\geq n$
$z$

#### Minimum-norm solution to a linear system

The proof above also shows that if the system $Ax=b$ is satisfiable i.e. has a solution, then necessarily $z=A^{+}b$ is a solution (not necessarily unique). We can say more:
Proposition.
$Ax=b$
$z=A^{+}b$
Proof. Note first, with $Q=A^{+}A$, that $Qz=A^{+}AA^{+}b=A^{+}b=z$ and that $Q^{*}=Q$. Therefore, assuming that $Ax=b$, we have
    ${\begin{aligned}z^{*}(x-z)&=(Qz)^{*}(x-z)\\&=z^{*}Q(x-z)\\&=z^{*}\left(A^{+}Ax-z\right)\\&=z^{*}\left(A^{+}b-z\right)\\&=0.\end{aligned}}$
Thus
    ${\begin{alignedat}{2}\|x\|_{2}^{2}&=\|z+(x-z)\|_{2}^{2}\\&=\|z\|_{2}^{2}+z^{*}(x-z)+{\overline {z^{*}(x-z)}}+\|x-z\|_{2}^{2}\\&=\|z\|_{2}^{2}+\|x-z\|_{2}^{2}\\&\geq \|z\|_{2}^{2}\end{alignedat}}$
with equality if and only if $x=z$, as was to be shown. $\square$
An immediate consequence of this result is that $z$ is also the uniquely smallest solution to the least-squares minimization problem for all $Ax=b$, including when $A$ is neither injective nor surjective. It can be shown that the least-squares approximation $Az=y\approx b$ is unique. Thus it is necessary and sufficient for all $x$ that solve the least-squares minimization to satisfy $Ax=y=Az=AA^{+}b$. This system always has a solution (not necessarily unique) as $Az$ lies in the column space of $A$. From the above result the smallest $x$ which solves this system is $A^{+}(AA^{+}b)=A^{+}b=z$.

## Notes

* ↑ Some authors use slightly different dimensions for the factors. The two definitions are equivalent.

## References

* Ben-Israel, Adi; Greville, Thomas N.E. (2003). Generalized inverses: Theory and applications (2nd ed.). New York, NY: Springer. doi:10.1007/b97366. ISBN 978-0-387-00293-4.
* Campbell, S. L.; Meyer, Jr., C. D. (1991). Generalized Inverses of Linear Transformations. Dover. ISBN 978-0-486-66693-8.
* Nakamura, Yoshihiko (1991). Advanced Robotics: Redundancy and Optimization. Addison-Wesley. ISBN 978-0201151985.
* Rao, C. Radhakrishna; Mitra, Sujit Kumar (1971). Generalized Inverse of Matrices and its Applications. New York: John Wiley & Sons. pp. 240. ISBN 978-0-471-70821-6.