2021-09-02 11:31:08 +09:00
\documentclass [letterpaper] { article}
\usepackage { typearea}
\typearea { 12}
\usepackage { here}
\usepackage { bm}
\usepackage { amsmath, amsfonts}
\usepackage [top=20truemm,bottom=20truemm,left=25truemm,right=25truemm] { geometry}
\usepackage [dvipdfmx] { hyperref,graphicx}
2022-07-23 23:02:32 +09:00
% incorporated from Linear Algebra for Everyone 7/18/2022
\newcommand { \bi } [1]{ \hbox { \boldmath $ # 1 $ } }
\DeclareRobustCommand \transp { ^ { \mathrm { T} } }
\DeclareMathAlphabet { \cmrv } { OML} { cmm} { b} { it}
\newcommand { \bu } { \hbox { \boldmath $ u $ } }
\newcommand { \bv } { \hbox { $ \cmrv { v } $ } }
\newcommand { \bw } { \hbox { \boldmath $ w $ } }
\newcommand \mat { { \sf MATLAB} }
%
2022-08-14 15:51:43 +09:00
% prepare to move figures
\graphicspath { { figs/} }
2021-09-02 11:31:08 +09:00
\begin { document}
2025-06-30 14:22:41 +09:00
% Manual title block with numbered footnotes
\begin { center}
{ \LARGE The Art of Linear Algebra\\
2021-09-02 11:31:08 +09:00
\vspace { 5pt}
\large {
-- Graphic Notes on ``Linear Algebra for Everyone" --
}
}
2025-06-30 14:22:41 +09:00
\vspace { 1.5em}
Kenji Hiranabe\footnote { twitter: @hiranabe, k-hiranabe@esm.co.jp, \url { https://anagileway.com} } \\
with the kindest help of Gilbert Strang\footnote { Massachusetts Institute of Technology, \url { http://www-math.mit.edu/\~ gs/} }
2021-09-02 11:31:08 +09:00
2025-06-30 14:22:41 +09:00
\vspace { 1em}
September 1, 2021/updated \today
\end { center}
2021-09-02 11:31:08 +09:00
2025-06-30 14:22:41 +09:00
\vspace { 1.5em}
2021-09-02 11:31:08 +09:00
\vspace { -5pt}
2023-09-10 17:03:13 -04:00
2021-09-02 11:31:08 +09:00
\begin { abstract}
2023-09-10 17:03:13 -04:00
I try to intuitively visualize some important concepts introduced
in ``Linear Algebra for Everyone",\footnote { ``Linear Algebra for Everyone":
2023-09-12 16:58:18 +09:00
\url { http://math.mit.edu/everyone/} with Japanese translation from Kindai Kagaku.}
2023-09-10 17:03:13 -04:00
which include Column-Row ($ \bm { CR } $ ), Gaussian Elimination ($ \bm { LU } $ ),
2022-08-14 15:51:43 +09:00
Gram-Schmidt Orthogonalization ($ \bm { QR } $ ), Eigenvalues and Diagonalization ($ \bm { Q \Lambda Q \transp } $ ),
2023-09-10 17:03:13 -04:00
and Singular Value Decomposition ($ \bm { U \Sigma V \transp } $ ).
This paper aims at promoting the understanding of vector/matrix calculations
2023-09-12 16:58:18 +09:00
and algorithms from the perspective of matrix factorization.
2023-09-10 17:03:13 -04:00
All the artworks including the article itself are maintained under the GitHub repository \url { https://github.com/kenjihiranabe/The-Art-of-Linear-Algebra/} .
2021-09-02 11:31:08 +09:00
\end { abstract}
\section * { Foreword}
I am happy to see Kenji Hiranabe's pictures of matrix operations in linear algebra !
The pictures are an excellent way to show the algebra. We can think of matrix
multiplications by row $ \bm { \cdot } $ column dot products, but that is not all -- it is ``linear combinations"
and ``rank 1 matrices" that complete the algebra and the art.
I am very grateful to see the books in Japanese translation
and the ideas in Kenji's pictures.
\begin { flushright}
-- Gilbert Strang \\ Professor of Mathematics at MIT
\end { flushright}
\tableofcontents
\section { Viewing a Matrix -- 4 Ways}
2023-09-10 17:03:13 -04:00
A matrix ($ m \times n $ ) can be viewed as $ 1 $ matrix, $ mn $ numbers, $ n $ columns and $ m $ rows.
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
\centering
2022-10-15 15:56:30 +09:00
\includegraphics [scale=0.8] { ViewingMatrix-4Ways.eps} \\
2022-08-13 12:37:44 +09:00
\caption { Viewing a Matrix in 4 Ways}
2021-09-02 11:31:08 +09:00
\end { figure}
\begin { equation*}
A= \begin { bmatrix}
a_ { 11} & a_ { 12} \\
a_ { 21} & a_ { 22} \\
a_ { 31} & a_ { 32}
\end { bmatrix}
=
\begin { bmatrix}
| & |\\
\bm { a_ 1} & \bm { a_ 2} \\
| & |
\end { bmatrix}
=
\begin { bmatrix}
- \bm { a_ 1^ *} -\\
- \bm { a_ 2^ *} -\\
- \bm { a_ 3^ *} -
\end { bmatrix}
\end { equation*} \\
Here, the column vectors are in bold as $ \bm { a _ 1 } $ .
Row vectors include $ \bm { * } $ as in $ \bm { a _ 1 ^ * } $ .
Transposed vectors and matrices are indicated by $ \mathrm { T } $ as
2022-07-23 23:02:32 +09:00
in $ \bm { a } \transp $ and $ A \transp $ .
2021-09-02 11:31:08 +09:00
\section { Vector times Vector -- 2 Ways}
2023-09-10 17:03:13 -04:00
Hereafter I point to specific sections of ``Linear Algebra for Everyone"
2021-09-02 11:31:08 +09:00
and present graphics which illustrate the concepts with short names
2023-08-22 09:07:48 +09:00
in gray circles.
2021-09-02 11:31:08 +09:00
\begin { itemize}
\item Sec. 1.1 (p.2) Linear combination and dot products
\item Sec. 1.3 (p.25) Matrix of Rank One
\item Sec. 1.4 (p.29) Row way and column way
2022-10-15 14:45:45 +09:00
\end { itemize}
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-08-13 12:37:44 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { VectorTimesVector.eps}
2021-09-02 11:31:08 +09:00
\caption { Vector times Vector - (v1), (v2)}
\end { figure}
2023-09-10 17:03:13 -04:00
(v1) is an elementary operation of two vectors, but (v2) multiplies the column to the row
and produces a rank 1 matrix. Knowing this outer product (v2) is the key to the following sections.
2022-08-14 15:51:43 +09:00
2021-09-02 11:31:08 +09:00
\section { Matrix times Vector -- 2 Ways}
A matrix times a vector creates a vector of three dot products (Mv1)
as well as a linear combination (Mv2) of the column vectors of $ A $ .
\begin { itemize}
\item Sec. 1.1 (p.3) Linear combinations
\item Sec. 1.3 (p.21) Matrices and Column Spaces
2023-09-10 17:03:13 -04:00
\end { itemize}
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { MatrixTimesVector.eps}
2021-09-02 11:31:08 +09:00
\caption { Matrix times Vector - (Mv1), (Mv2)}
\end { figure}
At first, you learn (Mv1). But when you get used to viewing it as (Mv2),
2022-09-13 11:51:43 +09:00
you can understand $ A \bm { x } $ as a linear combination of the columns of $ A $ .
2021-09-02 11:31:08 +09:00
Those products fill the column space of $ A $ denoted as $ \mathbf { C } ( A ) $ .
2022-09-13 11:51:43 +09:00
The solution space of $ A \bm { x } = \bm { 0 } $ is the nullspace of $ A $ denoted as $ \mathbf { N } ( A ) $ .
2023-08-22 09:07:48 +09:00
To understand the nullspace, let the right-hand side of (Mv1) be $ \bm { 0 } $
and see all the dot products are zero.
2021-09-02 11:31:08 +09:00
2023-09-10 17:03:13 -04:00
Also, (vM1) and (vM2) show the same pattern for a row vector times a matrix.
2022-07-25 14:01:50 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { VectorTimesMatrix.eps}
2022-07-25 14:01:50 +09:00
\caption { Vector times Matrix - (vM1), (vM2)}
\end { figure}
The products fill the row space of $ A $ denoted as $ \mathbf { C } ( A \transp ) $ .
2023-08-22 09:07:48 +09:00
The solution space of $ yA = 0 $ is the left-nullspace of $ A $ , denoted as $ \mathbf { N } ( A \transp ) $ .
2022-07-25 14:01:50 +09:00
2023-09-10 17:03:13 -04:00
The four subspaces consist of $ \mathbf { N } ( A ) $ + $ \mathbf { C } ( A \transp ) $
2021-09-02 11:31:08 +09:00
(which are perpendicular to each other) in $ \mathbb { R } ^ n $ and
2022-08-14 15:51:43 +09:00
$ \mathbf { N } ( A \transp ) $ + $ \mathbf { C } ( A ) $ in $ \mathbb { R } ^ m $
2021-09-02 11:31:08 +09:00
(which are perpendicular to each other).
2022-07-25 14:01:50 +09:00
2021-09-02 11:31:08 +09:00
\begin { itemize}
2022-06-02 13:50:26 +09:00
\item Sec. 3.5 (p.124) Dimensions of the Four Subspaces
2023-09-10 17:03:13 -04:00
\end { itemize}
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.8] { 4-Subspaces.eps}
2021-09-02 11:31:08 +09:00
\caption { The Four Subspaces}
\end { figure}
See $ A = CR $ (Sec 6.1) for the rank $ r $ .
\section { Matrix times Matrix -- 4 Ways}
``Matrix times Vector" naturally extends to ``Matrix times Matrix".
\begin { itemize}
\item Sec. 1.4 (p.35) Four Ways to Multiply $ \bm { AB = C } $
\item Also see the back cover of the book
2023-09-10 17:03:13 -04:00
\end { itemize}
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { MatrixTimesMatrix.eps}
2021-09-02 11:31:08 +09:00
\caption { Matrix times Matrix - (MM1), (MM2), (MM3), (MM4)}
\end { figure}
\section { Practical Patterns}
Here, I show some practical patterns which allow you to capture
2023-09-10 17:03:13 -04:00
the upcoming factorizations in a more intuitive way.
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { Pattern12.eps}
2021-09-02 11:31:08 +09:00
\caption { Pattern 1, 2 - (P1), (P1)}
\end { figure}
Pattern 1 is a combination of (MM2) and (Mv2).
2023-09-10 17:03:13 -04:00
Pattern 2 is an extension of (MM3). Note that Pattern 1 is a column operation (multiplying a matrix from right),
2021-09-02 11:31:08 +09:00
whereas Pattern 2 is a row operation (multiplying a matrix from left).
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { Pattern11-22.eps}
2021-09-02 11:31:08 +09:00
\caption { Pattern 1$ ^ \prime $ , 2$ ^ \prime $ - (P1$ ^ \prime $ ), (P2$ ^ \prime $ )}
\end { figure}
2023-09-10 17:03:13 -04:00
(P1$ ^ \prime $ ) multiplies the diagonal numbers to the columns of the matrix,
whereas (P2$ ^ \prime $ ) multiplies the diagonal numbers to the row of the matrix.
2021-09-02 11:31:08 +09:00
Both are variants of (P1) and (P2).
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { Pattern3.eps}
2021-09-02 11:31:08 +09:00
\caption { Pattern 3 - (P3)}
\end { figure}
2023-09-10 17:03:13 -04:00
This pattern emerges when you solve differential equations and recurrence equations:
2021-09-02 11:31:08 +09:00
\begin { itemize}
\item Sec. 6 (p.201) Eigenvalues and Eigenvectors
\item Sec. 6.4 (p.243) Systems of Differential Equations
2023-09-10 17:03:13 -04:00
\end { itemize}
2021-09-02 11:31:08 +09:00
\begin { align*}
\frac { d \bm { u} (t) } { dt} & = A \bm { u} (t), \quad \bm { u} (0)=\bm { u} _ 0\\
\bm { u} _ { n+1} & = A \bm { u} _ n, \quad \bm { u_ 0} = \bm { u} _ 0
\end { align*}
In both cases, the solutions are expressed with
2023-09-10 17:03:13 -04:00
eigenvalues ($ \lambda _ 1 , \lambda _ 2 , \lambda _ 3 $ ),
2021-09-02 11:31:08 +09:00
eigenvectors $ X = \begin { bmatrix } \bm { x } _ 1 & \bm { x } _ 2 & \bm { x } _ 3 \end { bmatrix } $ of $ A $ , and
2022-08-14 15:51:43 +09:00
the coefficients $ c = \begin { bmatrix } c _ 1 & c _ 2 & c _ 3 \end { bmatrix } \transp $
2021-09-02 11:31:08 +09:00
which are the coordinates of the initial condition $ \bm { u } ( 0 ) = \bm { u } _ 0 $ in terms of
the eigenvectors $ X $ .
\begin { equation*}
\bm { u} _ 0 = c_ 1 \bm { x} _ 1 + c_ 2 \bm { x} _ 2 + c_ 3 \bm { x} _ 3
\end { equation*}
\begin { equation*}
\bm { c} =
\begin { bmatrix}
c_ 1\\
c_ 2\\
c_ 3
\end { bmatrix} = X^ { -1} \bm { u} _ 0
\end { equation*}
and the general solution of the two equations are:
\begin { align*}
2021-09-16 10:08:46 +09:00
\bm { u} (t) & = e^ { At} \bm { u} _ 0 = X e^ { \Lambda t} X^ { -1} \bm { u_ 0} & = X e^ { \Lambda t} \bm { c} & = c_ 1 e^ { \lambda _ 1 t} \bm { x} _ 1 + c_ 2 e^ { \lambda _ 2 t} \bm { x} _ 2 + c_ 3 e^ { \lambda _ 3 t} \bm { x} _ 3\\
\bm { u} _ n & = A^ n \bm { u} _ 0 = X \Lambda ^ n X^ { -1} \bm { u_ 0} & = X \Lambda ^ n \bm { c} & = c_ 1 \lambda _ 1^ n \bm { x} _ 1 + c_ 2 \lambda _ 2^ n \bm { x} _ 2 + c_ 3 \lambda _ 3^ n \bm { x} _ 3
2021-09-02 11:31:08 +09:00
\end { align*}
2022-11-06 20:51:41 +09:00
See Figure 9: Pattern 3 (P3) above again to get $ XDc $ .
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { Pattern4.eps}
2021-09-02 11:31:08 +09:00
\caption { Pattern 4 - (P4)}
\end { figure}
This pattern (P4) works in both eigenvalue decomposition and singular value decomposition.
Both decompositions are expressed as a product of three matrices with a diagonal matrix in the middle,
and also a sum of rank 1 matrices with the eigenvalue/singular value coefficients.
More details are discussed in the next section.
\clearpage
\section { The Five Factorizations of a Matrix}
\begin { itemize}
\item Preface p.vii, The Plan for the Book.
\end { itemize}
2023-09-10 17:03:13 -04:00
$ A = CR, A = LU, A = QR, A = Q \Lambda Q \transp , A = U \Sigma V \transp $ are
2021-09-02 11:31:08 +09:00
illustrated one by one.
2022-10-15 15:56:30 +09:00
\begin { table} [h]
\begin { tabular} { lll}
\Large { \boldmath $ A = CR $ } & \includegraphics { A_ CR.eps} &
\begin { tabular} { l}
Independent columns in $ C $ \\
Row echelon form in $ R $ \\
Leads to column rank = row rank
\end { tabular} \\
\Large { \boldmath $ A = LU $ } & \includegraphics { A_ LU.eps} &
\begin { tabular} { l}
$ LU $ decomposition from\\
Gaussian elimination\\
(Lower triangular)(Upper triangular)
\end { tabular} \\
\Large { \boldmath $ A = QR $ } & \includegraphics { A_ QR.eps} &
\begin { tabular} { l}
$ QR $ decomposition as\\
Gram-Schmidt orthogonalization\\
Orthogonal $ Q $ and triangular $ R $
\end { tabular} \\
2023-09-10 17:03:13 -04:00
2022-10-15 15:56:30 +09:00
\Large { \boldmath $ S = Q \Lambda Q \transp $ } & \includegraphics { A_ QLQT.eps} &
\begin { tabular} { l}
Eigenvalue decomposition\\
of a symmetric matrix $ S $ \\
Eigenvectors in $ Q $ , eigenvalues in $ \Lambda $
\end { tabular} \\
2023-09-10 17:03:13 -04:00
2022-10-15 15:56:30 +09:00
\Large { \boldmath $ A = U \Sigma V \transp $ } & \includegraphics { A_ USVT.eps} &
\begin { tabular} { l}
Singular value decomposition\\
of all matrices $ A $ \\
Singular values in $ \Sigma $
\end { tabular}
\end { tabular}
\caption { The Five Factorization}
\end { table}
2021-09-02 11:31:08 +09:00
\subsection { $ \boldsymbol { A = CR } $ }
\begin { itemize}
\item Sec.1.4 Matrix Multiplication and $ \bm { A = CR } $ (p.29)
\end { itemize}
2023-09-10 17:03:13 -04:00
The row rank and the column rank of a general rectangular matrix $ A $ are equal.
2021-09-02 11:31:08 +09:00
This factorization is the most intuitive way to understand this theorem.
$ C $ consists of independent columns of $ A $ , and $ R $ is the row reduced echelon form of $ A $ .
$ A = CR $ reduces to $ r $ independent columns in $ C $ times $ r $ independent rows in $ R $ .
\begin { equation*}
\begin { split}
A & = CR\\
\begin { bmatrix}
1 & 2 & 3 \\
2 & 3 & 5
\end { bmatrix}
& =
\begin { bmatrix}
1 & 2 \\
2 & 3
\end { bmatrix}
\begin { bmatrix}
1 & 0 & 1 \\
0 & 1 & 1
\end { bmatrix}
\end { split}
\end { equation*}
Procedure: Look at the columns of $ A $ from left to right. Keep independent ones,
discard dependent ones which can be created by the former columns.
The column 1 and the column 2 survive, and the column 3 is discarded
because it is expressed as a sum of the former two columns.
2023-09-10 17:03:13 -04:00
To rebuild $ A $ by the independent columns 1 and 2, you find a row echelon form $ R $
appearing on the right.
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { CR1.eps}
2021-09-02 11:31:08 +09:00
\caption { Column Rank in $ CR $ }
\end { figure}
2023-09-10 17:03:13 -04:00
Now the column rank is two because there are only two independent columns in $ C $
2021-09-02 11:31:08 +09:00
and all the columns of $ A $ are linear combinations of the two columns of $ C $ .
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { CR2.eps}
2021-09-02 11:31:08 +09:00
\caption { Row Rank in $ CR $ }
\end { figure}
2023-09-10 17:03:13 -04:00
And the row rank is also two because there are only two independent rows in $ R $
2021-09-02 11:31:08 +09:00
and all the rows of $ A $ are linear combinations of the two rows of $ R $ .
\subsection { $ \boldsymbol { A = LU } $ }
2023-09-10 17:03:13 -04:00
Solving $ A \bm { x } = \bm { b } $ via Gaussian elimination can be represented as an $ LU $ factorization.
Usually, you apply elementary row operation matrices ($ E $ ) to $ A $ to make upper triangular $ U $ .
2021-09-02 11:31:08 +09:00
\begin { align*}
EA & = U\\
A & = E^ { -1} U\\
\text { let} \; L = E^ { -1} , \quad A & = LU
\end { align*}
2022-10-15 14:45:45 +09:00
Now solve $ A \bm { x } = \bm { b } $ in 2 steps: (1) forward $ L \bm { c } = \bm { b } $ and (2) back $ U \bm { x } = \bm { c } $ .
2021-09-02 11:31:08 +09:00
\begin { itemize}
\item Sec.2.3 (p.57) Matrix Computations and $ \bm { A = LU } $
\end { itemize}
Here, we directly calculate $ L $ and $ U $ from $ A $ .
\begin { equation*}
2023-09-10 17:03:13 -04:00
A =
2021-09-02 11:31:08 +09:00
\begin { bmatrix}
|\\
\bm { l} _ 1\\
|
\end { bmatrix}
\begin { bmatrix}
- \bm { u} ^ *_ 1 -
\end { bmatrix}
+ \begin { bmatrix}
0 & \begin { matrix} 0 & 0 \end { matrix} \\
\begin { matrix} 0 \\ 0 \end { matrix} & A_ 2
\end { bmatrix}
2023-09-10 17:03:13 -04:00
=
2021-09-02 11:31:08 +09:00
\begin { bmatrix}
|\\
\bm { l} _ 1\\
|
\end { bmatrix}
\begin { bmatrix}
- \bm { u} ^ *_ 1 -
\end { bmatrix}
+
\begin { bmatrix}
|\\
\bm { l} _ 2\\
|
\end { bmatrix}
\begin { bmatrix}
- \bm { u} ^ *_ 2 -
\end { bmatrix}
+ \begin { bmatrix}
0 & 0 & 0\\
0 & 0 & 0 \\
0 & 0 & A_ 3
\end { bmatrix} = LU
\end { equation*}
2023-09-10 17:03:13 -04:00
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { LU1.eps}
2021-09-02 11:31:08 +09:00
\caption { Recursive Rank 1 Matrix Peeling from $ A $ }
\end { figure}
To find $ L $ and $ U $ , peel off the rank 1 matrix made of
the first row and the first column of $ A $ .
This leaves $ A _ 2 $ . Do this recursively and decompose $ A $ into the sum of rank 1 matrices.
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { LU2.eps}
2021-09-02 11:31:08 +09:00
\caption { $ LU $ rebuilds $ A $ }
\end { figure}
2023-03-07 13:52:14 +09:00
To rebuild $ A $ from $ L $ times $ U $ , use column-row multiplication.
2021-09-02 11:31:08 +09:00
\subsection { $ \boldsymbol { A = QR } $ }
$ A = QR $ changes the columns of $ A $ into perpendicular columns of $ Q $ , keeping $ \bm { C } ( A ) = \bm { C } ( Q ) $ .
\begin { itemize}
\item Sec.4.4 Orthogonal matrices and Gram-Schmidt (p.165)
\end { itemize}
2023-03-07 13:52:14 +09:00
In Gram-Schmidt, the normalized $ \bm { a } _ 1 $ is $ \bm { q } _ 1 $ .
Then $ \bm { a } _ 2 $ is adjusted to be perpendicular to $ \bm { q } _ 1 $ to create $ \bm { q } _ 2 $ .
This procedure gives:
2021-09-02 11:31:08 +09:00
\begin { align*}
2022-10-01 08:30:37 +09:00
\bm { q} _ 1 & = \bm { a} _ 1/||\bm { a} _ 1|| \\
\bm { q} _ 2 & = \bm { a} _ 2 - (\bm { q} _ 1\transp \bm { a} _ 2)\bm { q} _ 1 , \quad \bm { q} _ 2 = \bm { q} _ 2/||\bm { q} _ 2|| \\
\bm { q} _ 3 & = \bm { a} _ 3 - (\bm { q} _ 1\transp \bm { a} _ 3)\bm { q} _ 1 - (\bm { q} _ 2\transp \bm { a} _ 3)\bm { q} _ 2, \quad \bm { q} _ 3 = \bm { q} _ 3/||\bm { q} _ 3||
2021-09-02 11:31:08 +09:00
\end { align*}
2023-09-10 17:03:13 -04:00
In the reverse direction, let $ r _ { ij } = \bm { q } _ i \transp \bm { a } _ j $ and you will get:
2021-09-02 11:31:08 +09:00
\begin { align*}
\bm { a} _ 1 & = r_ { 11} \bm { q} _ 1\\
\bm { a} _ 2 & = r_ { 12} \bm { q} _ 1 + r_ { 22} \bm { q} _ 2\\
\bm { a} _ 3 & = r_ { 13} \bm { q} _ 1 + r_ { 23} \bm { q} _ 2 + r_ { 33} \bm { q} _ 3
\end { align*}
2023-03-07 13:52:14 +09:00
The original $ A $ becomes $ QR $ : orthogonal $ Q $ times upper triangular $ R $ .
2021-09-02 11:31:08 +09:00
\begin { gather*}
2023-09-10 17:03:13 -04:00
A =
2021-09-02 11:31:08 +09:00
\begin { bmatrix}
| & | & |\\
\bm { q} _ 1 & \bm { q} _ 2 & \bm { q} _ 3\\
| & | & |
\end { bmatrix}
\begin { bmatrix}
r_ { 11} & r_ { 12} & r_ { 13} \\
& r_ { 22} & r_ { 23} \\
& & r_ { 33}
\end { bmatrix} = QR\\
\\
2022-08-14 15:51:43 +09:00
Q Q\transp =Q\transp Q = I
2021-09-02 11:31:08 +09:00
\end { gather*}
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { QR.eps}
2021-09-02 11:31:08 +09:00
\caption { $ A = QR $ }
\end { figure}
2023-09-10 17:03:13 -04:00
Each column vector of $ A $ can be rebuilt from $ Q $ and $ R $ .
2021-09-02 11:31:08 +09:00
See Pattern 1 (P1) again for the graphic interpretation.
2022-08-14 15:51:43 +09:00
\subsection { $ \boldsymbol { S = Q \Lambda Q \transp } $ }
2021-09-02 11:31:08 +09:00
All symmetric matrices $ S $ must have real eigenvalues and orthogonal eigenvectors.
2023-09-10 17:03:13 -04:00
The eigenvalues are the diagonal elements of $ \Lambda $ and the eigenvectors are in $ Q $ .
2021-09-02 11:31:08 +09:00
\begin { itemize}
2021-10-03 20:34:28 +09:00
\item Sec.6.3 (p.227) Symmetric Positive Definite Matrices
2021-09-02 11:31:08 +09:00
\end { itemize}
\begin { align*}
2022-08-14 15:51:43 +09:00
S = Q \Lambda Q\transp
2021-09-02 11:31:08 +09:00
& = \begin { bmatrix}
| & | & |\\
\bm { q} _ 1 & \bm { q} _ 2 & \bm { q} _ 3\\
| & | & |
\end { bmatrix}
\begin { bmatrix}
\lambda _ 1 \\
& \lambda _ 2 & \\
& & \lambda _ 3
\end { bmatrix}
\begin { bmatrix}
2022-08-14 15:51:43 +09:00
- \bm { q} _ 1\transp -\\
- \bm { q} _ 2\transp -\\
- \bm { q} _ 3\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix} \\
\\
& =
\lambda _ 1 \begin { bmatrix}
|\\
\bm { q} _ 1\\
|
\end { bmatrix}
\begin { bmatrix}
2023-09-10 17:03:13 -04:00
- \bm { q} _ 1\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix}
+
\lambda _ 2 \begin { bmatrix}
|\\
\bm { q} _ 2\\
|
\end { bmatrix}
\begin { bmatrix}
2022-08-14 15:51:43 +09:00
- \bm { q} _ 2\transp -
2023-09-10 17:03:13 -04:00
\end { bmatrix}
2021-09-02 11:31:08 +09:00
+
\lambda _ 3 \begin { bmatrix}
|\\
\bm { q} _ 3 \\
|
\end { bmatrix}
\begin { bmatrix}
2022-08-14 15:51:43 +09:00
- \bm { q} _ 3\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix} \\
& = \lambda _ 1 P_ 1 + \lambda _ 2 P_ 2 + \lambda _ 3 P_ 3
\end { align*}
\begin { equation*}
2022-08-14 15:51:43 +09:00
P_ 1=\bm { q} _ 1 \bm { q} _ 1\transp , \quad P_ 2=\bm { q} _ 2 \bm { q} _ 2\transp , \quad P_ 3=\bm { q} _ 3 \bm { q} _ 3\transp
2021-09-02 11:31:08 +09:00
\end { equation*}
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { EVD.eps}
2022-08-14 15:51:43 +09:00
\caption { $ S = Q \Lambda Q \transp $ }
2021-09-02 11:31:08 +09:00
\end { figure}
A symmetric matrix $ S $ is diagonalized into $ \Lambda $ by an orthogonal matrix $ Q $
2022-08-14 15:51:43 +09:00
and its transpose. And it is broken down into a combination of rank 1 projection matrices $ P = qq \transp $ .
2022-06-02 13:50:26 +09:00
This is the spectral theorem.
2021-09-02 11:31:08 +09:00
Note that Pattern 4 (P4) is working for the decomposition.
\begin { gather*}
2022-08-14 15:51:43 +09:00
S=S\transp = \lambda _ 1 P_ 1 + \lambda _ 2 P_ 2 + \lambda _ 3 P_ 3\\
QQ\transp = P_ 1 + P_ 2 + P_ 3 = I \\
2021-09-02 11:31:08 +09:00
P_ 1 P_ 2 = P_ 2 P_ 3 = P_ 3 P_ 1 = O\\
2022-08-14 15:51:43 +09:00
P_ 1^ 2 =P_ 1=P_ 1\transp , \quad P_ 2^ 2=P_ 2=P_ 2\transp , \quad P_ 3^ 2=P_ 3=P_ 3\transp
2021-09-02 11:31:08 +09:00
\end { gather*}
2022-08-14 15:51:43 +09:00
\subsection { $ \boldsymbol { A = U \Sigma V \transp } $ }
2021-09-02 11:31:08 +09:00
\begin { itemize}
2023-07-18 10:18:41 +08:00
\item Sec.7.1 (p.259) Singular Values and Singular Vectors
2021-09-02 11:31:08 +09:00
\end { itemize}
2023-03-07 13:52:14 +09:00
Every matrix (including rectangular one) has a singular value decomposition (SVD).
2022-10-15 14:45:45 +09:00
$ A = U \Sigma V \transp $ has the singular vectors of $ A $ in $ U $ and $ V $ .
2023-09-10 17:03:13 -04:00
The following figure illustrates the 'reduced' SVD.
2022-10-15 14:45:45 +09:00
2021-09-02 11:31:08 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
\includegraphics [scale=0.8] { SVD.eps}
2022-08-14 15:51:43 +09:00
\caption { $ A = U \Sigma V \transp $ }
2021-09-02 11:31:08 +09:00
\end { figure}
2023-09-10 17:03:13 -04:00
You can find $ V $ as an orthonormal basis of $ \mathbb { R } ^ n $ (eigenvectors of $ A \transp A $ )
2022-08-14 15:51:43 +09:00
and $ U $ as an orthonormal basis of $ \mathbb { R } ^ m $ (eigenvectors of $ AA \transp $ ).
2021-09-02 11:31:08 +09:00
Together they diagonalize $ A $ into $ \Sigma $ .
2023-09-10 17:03:13 -04:00
This can be also expressed as a combination of rank 1 matrices.
2021-09-02 11:31:08 +09:00
\begin { align*}
2022-08-14 15:51:43 +09:00
A = U \Sigma V\transp =
2021-09-02 11:31:08 +09:00
\begin { bmatrix}
| & | & |\\
\bm { u} _ 1 & \bm { u} _ 2 & \bm { u} _ 3\\
| & | & |
\end { bmatrix}
\begin { bmatrix}
\sigma _ 1 \\
& \sigma _ 2 \\
& &
\end { bmatrix}
\begin { bmatrix}
2022-08-14 15:51:43 +09:00
- \bm { v} _ 1\transp -\\
- \bm { v} _ 2\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix}
& =
\sigma _ 1 \begin { bmatrix}
|\\
\bm { u} _ 1\\
|
\end { bmatrix}
\begin { bmatrix}
2023-09-10 17:03:13 -04:00
- \bm { v} _ 1\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix}
+
\sigma _ 2 \begin { bmatrix}
|\\
\bm { u} _ 2\\
|
\end { bmatrix}
\begin { bmatrix}
2022-08-14 15:51:43 +09:00
- \bm { v} _ 2\transp -
2021-09-02 11:31:08 +09:00
\end { bmatrix} \\
2022-08-14 15:51:43 +09:00
& = \sigma _ 1 \bm { u} _ 1 \bm { v} _ 1\transp + \sigma _ 2 \bm { u} _ 2 \bm { v} _ 2\transp
2021-09-02 11:31:08 +09:00
\end { align*}
Note that:
\begin { align*}
2022-08-14 15:51:43 +09:00
U U\transp & = I_ m \\
V V\transp & = I_ n
2021-09-02 11:31:08 +09:00
\end { align*}
See Pattern 4 (P4) for the graphic notation.
\section * { Conclusion and Acknowledgements}
2023-09-10 17:03:13 -04:00
I have presented a systematic visualization of matrix/vector multiplication and
its applications to the Five Matrix Factorizations. I hope you
enjoy them and find them useful
in understanding Linear Algebra.
2021-09-02 11:31:08 +09:00
2023-09-10 17:03:13 -04:00
Ashley Fernandes helped me with typesetting, which
makes this paper much more appealing and professional.
2021-09-02 11:31:08 +09:00
To conclude this paper, I'd like to thank Prof. Gilbert Strang for
2023-09-10 17:03:13 -04:00
publishing ``Linear Algebra for Everyone". It presents a new pathway to these beautiful landscapes in Linear Algebra.
2021-09-02 11:31:08 +09:00
Everyone can reach a fundamental understanding of its underlying ideas
in a practical manner that introduces us to contemporary and also
2023-09-12 16:58:18 +09:00
traditional data science and machine learning.
2021-09-02 11:31:08 +09:00
2021-10-01 16:44:25 +09:00
\section * { References and Related Works}
\begin { enumerate}
2023-09-10 17:03:13 -04:00
\item
2021-10-03 20:34:28 +09:00
Gilbert Strang(2020),\emph { Linear Algebra for Everyone} , Wellesley Cambridge Press.,\\
2023-09-12 16:58:18 +09:00
\url { http://math.mit.edu/everyone}
2021-10-01 16:44:25 +09:00
\item
2023-09-12 16:58:18 +09:00
Gilbert Strang(2016), \emph { Introduction to Linear Algebra} ,Wellesley Cambridge Press, 6th ed.,\\
\url { http://math.mit.edu/linearalgebra}
2023-03-23 18:45:15 +09:00
\item Kenji Hiranabe(2021), \emph { Map of Eigenvalues} , Slidedeck,\\
2023-09-12 16:58:18 +09:00
\url { https://github.com/kenjihiranabe/The-Art-of-Linear-Algebra/blob/main/MapofEigenvalues.pdf}
2022-08-13 12:37:44 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2022-08-13 12:37:44 +09:00
\includegraphics [keepaspectratio, width=\linewidth] { MapofEigenvalues.eps}
\caption { Map of Eigenvalues}
\end { figure}
2023-03-23 18:45:15 +09:00
\item Kenji Hiranabe(2020), \emph { Matrix World} , Slidedeck,\\
\url { https://github.com/kenjihiranabe/The-Art-of-Linear-Algebra/blob/main/MatrixWorld.pdf} \\
2022-08-13 12:37:44 +09:00
\begin { figure} [H]
2022-10-15 15:56:30 +09:00
\centering
2022-08-13 12:37:44 +09:00
\includegraphics [keepaspectratio, width=\linewidth] { MatrixWorld.eps}
\caption { Matrix World}
\end { figure}
2023-03-23 18:45:15 +09:00
\item Gilbert Strang, artwork by Kenji Hiranabe, \emph { The Four Subspaces and the solutions to $ A \bm { x } = \bm { b } $ } \\
2023-03-07 13:52:14 +09:00
\begin { figure} [H]
2023-03-23 18:45:15 +09:00
\centering
2023-09-12 16:58:18 +09:00
\includegraphics [scale=0.6] { TheFourSubspaces.eps}
2023-03-07 13:52:14 +09:00
\caption { The Four Subspaces and the solutions to $ A \bm { x } = \bm { b } $ }
\end { figure}
2021-10-01 16:44:25 +09:00
\end { enumerate}
2023-08-22 09:07:48 +09:00
\end { document}