Reminder of Linear Algebra
Reminder of Linear Algebra
El Houcine Bergou
[email protected]
1/25
2/25
2/25
2/25
2/25
2/25
Norm
Given x ∈ Rn , a norm of x, ∥x∥, is a nonnegative real number
satisfying :
2/25
Norm
Given x ∈ Rn , a norm of x, ∥x∥, is a nonnegative real number
satisfying :
▶ (Definiteness) : ∥x∥ ≥ 0 and ∥x∥ = 0 if and only if x = 0.
2/25
Norm
Given x ∈ Rn , a norm of x, ∥x∥, is a nonnegative real number
satisfying :
▶ (Definiteness) : ∥x∥ ≥ 0 and ∥x∥ = 0 if and only if x = 0.
▶ (Homogeneity) : For any real number α and all x ∈ Rn ,
∥αx∥ = |α|∥x∥.
2/25
Norm
Given x ∈ Rn , a norm of x, ∥x∥, is a nonnegative real number
satisfying :
▶ (Definiteness) : ∥x∥ ≥ 0 and ∥x∥ = 0 if and only if x = 0.
▶ (Homogeneity) : For any real number α and all x ∈ Rn ,
∥αx∥ = |α|∥x∥.
▶ (The triangle inequality) : For all x, y ∈ Rn , ∥x + y∥ ≤ ∥x∥ + ∥y∥.
2/25
Examples
3/25
Examples
▶ The Euclidean,
√ or ℓ2 , norm :
∥x∥2 = x⊤ x = (x21 + x22 + . . . + x2n )1/2 .
3/25
Examples
▶ The Euclidean,
√ or ℓ2 , norm :
∥x∥2 = x⊤ x = (x21 + x22 + . . . + x2n )1/2 .
▶ The max, or ℓ∞ , norm : ∥x∥∞ = max1≤i≤n |xi |.
3/25
Examples
▶ The Euclidean,
√ or ℓ2 , norm :
∥x∥2 = x⊤ x = (x21 + x22 + . . . + x2n )1/2 .
▶ The max, or ℓ∞ , norm : ∥x∥∞ = max1≤i≤n |xi |.
▶ The p-norm or ℓp norm : ∥x∥p = (|x1 |p + |x2 |p + . . . + |xn |p )1/p .
3/25
Examples
▶ The Euclidean,
√ or ℓ2 , norm :
∥x∥2 = x⊤ x = (x21 + x22 + . . . + x2n )1/2 .
▶ The max, or ℓ∞ , norm : ∥x∥∞ = max1≤i≤n |xi |.
▶ The p-norm or ℓp norm : ∥x∥p = (|x1 |p + |x2 |p + . . . + |xn |p )1/p .
3/25
4/25
Definition
An inner product on Rn is a map : x, y → ⟨x, y⟩, mapping
Rn × Rn → R and satisfying the following :
▶ (Definiteness) : ⟨x, x⟩ ≥ 0 and ⟨x, x⟩ = 0 if and only if x = 0.
4/25
Definition
An inner product on Rn is a map : x, y → ⟨x, y⟩, mapping
Rn × Rn → R and satisfying the following :
▶ (Definiteness) : ⟨x, x⟩ ≥ 0 and ⟨x, x⟩ = 0 if and only if x = 0.
▶ (Bilinearity) : For any real number α, β and all x, y, z ∈ Rn .
⟨αx + βy, z⟩ = α⟨x, z⟩ + β⟨y, z⟩.
4/25
Definition
An inner product on Rn is a map : x, y → ⟨x, y⟩, mapping
Rn × Rn → R and satisfying the following :
▶ (Definiteness) : ⟨x, x⟩ ≥ 0 and ⟨x, x⟩ = 0 if and only if x = 0.
▶ (Bilinearity) : For any real number α, β and all x, y, z ∈ Rn .
⟨αx + βy, z⟩ = α⟨x, z⟩ + β⟨y, z⟩.
▶ (Symmetry) : For all x, y ∈ Rn ⟨x, y⟩ = ⟨y, x⟩.
4/25
Definition
An inner product on Rn is a map : x, y → ⟨x, y⟩, mapping
Rn × Rn → R and satisfying the following :
▶ (Definiteness) : ⟨x, x⟩ ≥ 0 and ⟨x, x⟩ = 0 if and only if x = 0.
▶ (Bilinearity) : For any real number α, β and all x, y, z ∈ Rn .
⟨αx + βy, z⟩ = α⟨x, z⟩ + β⟨y, z⟩.
▶ (Symmetry) : For all x, y ∈ Rn ⟨x, y⟩ = ⟨y, x⟩.
4/25
5/25
5/25
5/25
5/25
5/25
6/25
6/25
6/25
6/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
7/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
▶ (Definiteness) : ∥A∥∗ ≥ 0 and ∥A∥∗ = 0 if and only if A = 0.
7/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
▶ (Definiteness) : ∥A∥∗ ≥ 0 and ∥A∥∗ = 0 if and only if A = 0.
▶ (Homogeneity) : ∥αA∥∗ = |α|∥A∥∗ .
7/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
▶ (Definiteness) : ∥A∥∗ ≥ 0 and ∥A∥∗ = 0 if and only if A = 0.
▶ (Homogeneity) : ∥αA∥∗ = |α|∥A∥∗ .
▶ (The triangle inequality) : For all A, B,
∥A + B∥∗ ≤ ∥A∥∗ + ∥B∥∗ .‘
7/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
▶ (Definiteness) : ∥A∥∗ ≥ 0 and ∥A∥∗ = 0 if and only if A = 0.
▶ (Homogeneity) : ∥αA∥∗ = |α|∥A∥∗ .
▶ (The triangle inequality) : For all A, B,
∥A + B∥∗ ≤ ∥A∥∗ + ∥B∥∗ .‘
▶ (The compatibility, if m = n) : For all A, B, ∥AB∥∗ ≤ ∥A∥∗ ∥B∥∗ .
7/25
Definition
Given A an m by n real matrix and a real number α, a norm of A,
∥A∥∗ , is a nonnegative real number satisfying :
▶ (Definiteness) : ∥A∥∗ ≥ 0 and ∥A∥∗ = 0 if and only if A = 0.
▶ (Homogeneity) : ∥αA∥∗ = |α|∥A∥∗ .
▶ (The triangle inequality) : For all A, B,
∥A + B∥∗ ≤ ∥A∥∗ + ∥B∥∗ .‘
▶ (The compatibility, if m = n) : For all A, B, ∥AB∥∗ ≤ ∥A∥∗ ∥B∥∗ .
7/25
Let A ∈ Rm×n .
▶ The kernel (null space) of A is the subspace given by
8/25
Let A ∈ Rm×n .
▶ The kernel (null space) of A is the subspace given by
8/25
Let A ∈ Rm×n .
▶ The kernel (null space) of A is the subspace given by
8/25
Let A ∈ Rm×n .
▶ The kernel (null space) of A is the subspace given by
Rank-nullity theorem
For any matrix A ∈ Rm×n , one has
8/25
Matrix inversion
A matrix A ∈ Rn×n is invertible (or non-singular) if it exists
B ∈ Rn×n such that BA = AB = In , where In is the identity matrix
of Rn×n .
In this case, B is called inverse matrix of A and is denoted by A−1 .
9/25
Matrix inversion
A matrix A ∈ Rn×n is invertible (or non-singular) if it exists
B ∈ Rn×n such that BA = AB = In , where In is the identity matrix
of Rn×n .
In this case, B is called inverse matrix of A and is denoted by A−1 .
Positive (semi-)definiteness
A matrix A ∈ Rn×n is positive semi-definite if
∀x ∈ Rn , x⊤ Ax ≥ 0.
9/25
Matrix inversion
A matrix A ∈ Rn×n is invertible (or non-singular) if it exists
B ∈ Rn×n such that BA = AB = In , where In is the identity matrix
of Rn×n .
In this case, B is called inverse matrix of A and is denoted by A−1 .
Positive (semi-)definiteness
A matrix A ∈ Rn×n is positive semi-definite if
∀x ∈ Rn , x⊤ Ax ≥ 0.
9/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
∃v ∈ Rn , ∥v∥ =
̸ 0, Av = λv.
10/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
11/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
where
▶ V is an orthogonal matrix (i.e. V −1 = V ⊤ ) whose columns are
eigenvectors of A.
11/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
where
▶ V is an orthogonal matrix (i.e. V −1 = V ⊤ ) whose columns are
eigenvectors of A.
▶ Λ is a diagonal matrix with the n eigenvalues of A λ1 , . . . , λn on
the diagonal.
11/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
where
▶ V is an orthogonal matrix (i.e. V −1 = V ⊤ ) whose columns are
eigenvectors of A.
▶ Λ is a diagonal matrix with the n eigenvalues of A λ1 , . . . , λn on
the diagonal.
Remark
11/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
where
▶ V is an orthogonal matrix (i.e. V −1 = V ⊤ ) whose columns are
eigenvectors of A.
▶ Λ is a diagonal matrix with the n eigenvalues of A λ1 , . . . , λn on
the diagonal.
Remark
▶ A spectral decomposition is not unique.
11/25
Theorem
Any symmetric matrix in Rn×n possesses a spectral decomposition of
the form
A = V ΛV ⊤ ,
where
▶ V is an orthogonal matrix (i.e. V −1 = V ⊤ ) whose columns are
eigenvectors of A.
▶ Λ is a diagonal matrix with the n eigenvalues of A λ1 , . . . , λn on
the diagonal.
Remark
▶ A spectral decomposition is not unique.
▶ The set of the eigenvalues of a matrix A is unique.
11/25
12/25
12/25
12/25
12/25
Remark
12/25
Remark
▶ The SVD is not unique.
12/25
Remark
▶ The SVD is not unique.
▶ The singular values along the diagonal of Σ are usually arranged
in decreasing size, σ1 ≥ σ2 ≥ · · · ≥ σmin(m,n) ≥ 0.
12/25
13/25
where
▶ Ur = [u1 , . . . , ur ] ∈ Rm×r denotes the first r columns of U . The
columns of Ur form an orthonormal basis for Im(A)
(=Im(AA⊤ )).
⊤
v1
▶ Vr = ...
⊤
∈ Rr×n denotes the first r columns of V . The
vr⊤
columns of Vr form an orthonormal basis for Im(A⊤ )
(=Im(A⊤ A)).
▶ Σr ∈ Rr×r is a diagonal matrix composed of the positive singular
values. 14/25
15/25
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
16/25
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
16/25
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
16/25
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
17/25
A
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
17/25
A A3
20 20
40 40
60 60
80 80
100 100
120 120
140 140
160 160
180 180
200 200
50 100 150 200 250 300 50 100 150 200 250 300
17/25
A A3 A10
20 20 20
40 40 40
60 60 60
80 80 80
17/25
A A3 A10
20 20 20
40 40 40
60 60 60
80 80 80
A20
20
40
60
80
100
120
140
160
180
200
50 100 150 200 250 300
17/25
A A3 A10
20 20 20
40 40 40
60 60 60
80 80 80
A20 A30
20 20
40 40
60 60
80 80
100 100
120 120
140 140
160 160
180 180
200 200
50 100 150 200 250 300 50 100 150 200 250 300
17/25
A A3 A10
20 20 20
40 40 40
60 60 60
80 80 80
40 40 40
60 60 60
80 80 80
17/25
A ≈ Ak
⊤
U ΣV ≈ Uk Σk Vk⊤
m×n ≈ (m × k)(k)(k × n)
mn ≈ (m + n + 1)k
200 × 320 = 64000 → (200 + 320 + 1)20 = 10420.
18/25
Definition
A linear system of n unknowns x and m linear equations is given by
a11 x1 + a12 x2 + ... + a1n xn = b1
a21 x1
+ a22 x2 + ... + a2n xn = b2
.. .. .. .. ..
. . . . .
am1 x1 + am2 x2 + ... + amn xn = bm
19/25
Ax = b, where A ∈ Rm×n , m ̸= n.
20/25
Ax = b, where A ∈ Rm×n , m ̸= n.
20/25
Ax = b, where A ∈ Rm×n , m ̸= n.
20/25
Ax = b, where A ∈ Rm×n , m ̸= n.
20/25
Ax = b, where A ∈ Rm×n , m ̸= n.
▶ Infinite solution in R2 :
x1 + x2 = 0
20/25
Ax = b, where A ∈ Rm×n , m ̸= n.
▶ Infinite solution in R2 :
x1 + x2 = 0
▶ No solution :
x1 = 2
2x2 = 1
x1 + x2 = 0
20/25
21/25
Linear least-squares
A linear least-squares problem consists of finding the minimum of the
function x → ∥Ax − b∥.
The regarded problem is of the form
min ∥Ax − b∥
x∈Rn
21/25
Linear least-squares
A linear least-squares problem consists of finding the minimum of the
function x → ∥Ax − b∥.
The regarded problem is of the form
min ∥Ax − b∥
x∈Rn
Properties
21/25
Linear least-squares
A linear least-squares problem consists of finding the minimum of the
function x → ∥Ax − b∥.
The regarded problem is of the form
min ∥Ax − b∥
x∈Rn
Properties
▶ This problems has always a solution (even if Ax = b has’nt ).
21/25
Linear least-squares
A linear least-squares problem consists of finding the minimum of the
function x → ∥Ax − b∥.
The regarded problem is of the form
min ∥Ax − b∥
x∈Rn
Properties
▶ This problems has always a solution (even if Ax = b has’nt ).
▶ The solution depends on the rank of A.
21/25
Linear least-squares
A linear least-squares problem consists of finding the minimum of the
function x → ∥Ax − b∥.
The regarded problem is of the form
min ∥Ax − b∥
x∈Rn
Properties
▶ This problems has always a solution (even if Ax = b has’nt ).
▶ The solution depends on the rank of A.
▶ The SVD plays a major role.
21/25
Definition
22/25
Definition
▶ For any matrix A ∈ Rm×n , one can define a linear operator that
“invert” the system Ax = b.
22/25
Definition
▶ For any matrix A ∈ Rm×n , one can define a linear operator that
“invert” the system Ax = b.
▶ Such operator is called the pseudo-inverse of the matrix A, noted
by A+ .
22/25
24/25
Ax = b, where A ∈ Rm×n .
Theorem
For any b ∈ Rm , A+ b is the solution with minimal norm of the
problem
min ∥Ax − b∥
x∈Rn
25/25