1. Linear algebra

Table of contents

  1. Linear Algebra
  2. Systems of Linear Equations
  3. Matrices
  4. Solving Systems of Linear Equations
  5. Vector Spaces
  6. Linear Independence
  7. Basis and Rank
  8. Linear Mappings
  9. Affine Spaces
  10. Analytic Geometry
  11. Matrix Decompositions

1. Linear Algebra

1.1 Introduction to vectors

Linear algebra is a field of mathematics focused on the study of vectors and the rules for manipulating them. While geometric vectors are commonly known, the concept extends to more abstract objects that satisfy specific properties 1.

  • Vectors: Objects that can be added together and multiplied by scalars to produce another object of the same kind.
  • Geometric vectors: Directed segments that can be visually represented, where addition results in another geometric vector and scalar multiplication scales the original vector 1.
  • Polynomials: Abstract mathematical expressions that can be added and scaled, yielding another polynomial, thus qualifying as vectors.
  • Audio signals: Represented as series of numbers, these can be added and scaled to produce new audio signals, making them vectors.
  • Elements of Rn\mathbb{R}^n: Tuples of nn real numbers, where component-wise addition of two vectors a,b∈Rn\mathbf{a}, \mathbf{b} \in \mathbb{R}^n results in c∈Rn\mathbf{c} \in \mathbb{R}^n, and multiplication by a scalar λ∈R\lambda \in \mathbb{R} yields λa∈Rn\lambda \mathbf{a} \in \mathbb{R}^n 2.

📝 In R3\mathbb{R}^3, the vector a=[123]\mathbf{a} = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} can be added to b=[456]\mathbf{b} = \begin{bmatrix} 4 \\ 5 \\ 6 \end{bmatrix} to get a+b=[579]\mathbf{a} + \mathbf{b} = \begin{bmatrix} 5 \\ 7 \\ 9 \end{bmatrix}, and scaled by λ=2\lambda = 2 to get 2a=[246]2\mathbf{a} = \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix}. Both results remain in R3\mathbb{R}^3 2.

1.2 Closure and vector spaces

A fundamental concept in mathematics is closure, which addresses the set of all possible outcomes from applying defined operations to a starting set of objects 2.

  • Closure: For vectors, it refers to the set of all vectors that can be generated by starting with a small set of vectors and repeatedly adding them to each other and scaling them.
  • Vector space: The resulting set of vectors that satisfies the closure properties, forming the foundation for many machine learning concepts 2.

2. Systems of Linear Equations

2.1 Formulation of systems of linear equations

Systems of linear equations are central to linear algebra, providing a framework for modeling and solving various problems 3.

  • General form: A system of mm linear equations with nn unknowns x1,…,xnx_1, \dots, x_n is expressed as: a11x1+⋯+a1nxn=b1⋮am1x1+⋯+amnxn=bma_{11}x_1 + \dots + a_{1n}x_n = b_1 \\ \vdots \\ a_{m1}x_1 + \dots + a_{mn}x_n = b_m where aij∈Ra_{ij} \in \mathbb{R} are coefficients and bi∈Rb_i \in \mathbb{R} are constants.
  • Solution: An nn-tuple (x1,…,xn)∈Rn(x_1, \dots, x_n) \in \mathbb{R}^n that satisfies all equations in the system simultaneously 4.

📝 A company produces nn products using mm resources. If aija_{ij} units of resource RiR_i are needed for product NjN_j, and bib_i units of resource RiR_i are available, the production plan xjx_j for each product NjN_j is determined by a system of linear equations 3.

2.2 Number of solutions

Systems of linear equations can have no solution, exactly one solution, or infinitely many solutions 4 5.

  • No solution: Occurs when the equations are contradictory.
  • Unique solution: Occurs when there is only one specific set of values for the unknowns that satisfies all equations.
  • Infinitely many solutions: Occurs when equations are redundant or dependent, allowing for a free variable that can take any real value.

📝 The system x1+x2+x3=3x_1 + x_2 + x_3 = 3, x1−x2+2x3=2x_1 - x_2 + 2x_3 = 2, 2x1+3x3=52x_1 + 3x_3 = 5 has infinitely many solutions. By setting x3=ax_3 = a, the solutions are of the form (52−32a,12+12a,a)(\frac{5}{2} - \frac{3}{2}a, \frac{1}{2} + \frac{1}{2}a, a) for any a∈Ra \in \mathbb{R} 4.

2.3 Geometric interpretation of systems of linear equations

The solution set of a system of linear equations can be visualized geometrically 5.

  • Two variables: Each linear equation represents a line in the x1x2x_1x_2-plane. The solution set is the intersection of these lines, which can be a point, a line (if equations describe the same line), or empty (if lines are parallel).
  • Three variables: Each linear equation represents a plane in three-dimensional space. The solution set is the intersection of these planes, which can be a plane, a line, a point, or empty 5.

📝 For the system 4x1+4x2=54x_1 + 4x_2 = 5 and 2x1−4x2=12x_1 - 4x_2 = 1, the solution space is the point (x1,x2)=(1,14)(x_1, x_2) = (1, \frac{1}{4}), representing the intersection of two distinct lines 5.

2.4 Compact matrix notation

Systems of linear equations can be compactly represented using matrix notation 5.

  • Matrix form: The system of equations (2.3) can be written as Ax=b\mathbf{Ax} = \mathbf{b}, where A\mathbf{A} is the coefficient matrix, x\mathbf{x} is the vector of unknowns, and b\mathbf{b} is the vector of constants. [a11⋯a1n⋮⋱⋮am1⋯amn][x1⋮xn]=[b1⋮bm]\begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} & \cdots & a_{mn} \end{bmatrix} \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} = \begin{bmatrix} b_1 \\ \vdots \\ b_m \end{bmatrix} 6.

3. Matrices

3.1 Definition of a matrix

A matrix is a rectangular array of real-valued elements arranged in rows and columns 6.

  • Matrix: An (m,n)(m, n) matrix A\mathbf{A} is an m⋅nm \cdot n-tuple of elements aija_{ij}, where i=1,…,mi = 1, \dots, m (rows) and j=1,…,nj = 1, \dots, n (columns).
  • Notation: A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n} denotes a matrix with mm rows and nn columns.
  • Special matrices:
  • Row: A (1,n)(1, n)-matrix.
  • Column: An (m,1)(m, 1)-matrix.
  • These are also called row/column vectors.
  • Reshaping: A matrix A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n} can be represented as a long vector a∈Rmn\mathbf{a} \in \mathbb{R}^{mn} by stacking its columns 6.

3.2 Matrix addition and multiplication

Matrices support operations such as addition and multiplication, with specific rules governing their application 6.

  • Matrix addition: Defined as the element-wise sum of two matrices of the same dimensions. A+B:=[a11+b11⋯a1n+b1n⋮⋱⋮am1+bm1⋯amn+bmn]∈Rm×n\mathbf{A} + \mathbf{B}:= \begin{bmatrix} a_{11} + b_{11} & \cdots & a_{1n} + b_{1n} \\ \vdots & \ddots & \vdots \\ a_{m1} + b_{m1} & \cdots & a_{mn} + b_{mn} \end{bmatrix} \in \mathbb{R}^{m \times n}.
  • Matrix multiplication: For A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n} and B∈Rn×k\mathbf{B} \in \mathbb{R}^{n \times k}, the elements cijc_{ij} of the product C=AB∈Rm×k\mathbf{C} = \mathbf{AB} \in \mathbb{R}^{m \times k} are computed as the sum of products of elements from the ii-th row of A\mathbf{A} and the jj-th column of B\mathbf{B}. cij=∑l=1nailbljc_{ij} = \sum_{l=1}^{n} a_{il}b_{lj} 6.
  • Dimension matching: Matrix multiplication AB\mathbf{AB} is only defined if the number of columns in A\mathbf{A} equals the number of rows in B\mathbf{B}.
  • Non-commutativity: In general, AB≠BA\mathbf{AB} \neq \mathbf{BA}, even if both products are defined.
  • Hadamard product: An element-wise multiplication of matrices, distinct from standard matrix multiplication 7.

📝 Given A=[123456]∈R2×3\mathbf{A} = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix} \in \mathbb{R}^{2 \times 3} and B=[789123]∈R3×2\mathbf{B} = \begin{bmatrix} 7 & 8 \\ 9 & 1 \\ 2 & 3 \end{bmatrix} \in \mathbb{R}^{3 \times 2}, their product AB\mathbf{AB} is defined and results in a 2×22 \times 2 matrix, while BA\mathbf{BA} is defined and results in a 3×33 \times 3 matrix, demonstrating non-commutativity 7.

3.3 Identity matrix and matrix properties 8

The identity matrix is a special square matrix that acts as a multiplicative identity 7.

  • Identity matrix (In\mathbf{I}_n): An n×nn \times n matrix with ones on the main diagonal and zeros elsewhere. In:=[10⋯001⋯0⋮⋮⋱⋮00⋯1]∈Rn×n\mathbf{I}_n:= \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix} \in \mathbb{R}^{n \times n} 7.
PropertyDescription
Associativity(AB)C=A(BC)(\mathbf{AB})\mathbf{C} = \mathbf{A}(\mathbf{BC})
Distributivity(A+B)C=AC+BC(\mathbf{A} + \mathbf{B})\mathbf{C} = \mathbf{AC} + \mathbf{BC} and A(C+D)=AC+AD\mathbf{A}(\mathbf{C} + \mathbf{D}) = \mathbf{AC} + \mathbf{AD}
Identity multiplicationImA=AIn=A\mathbf{I}_m\mathbf{A} = \mathbf{A}\mathbf{I}_n = \mathbf{A}

3.4 Inverse and transpose 9

The inverse and transpose are fundamental operations for square matrices 8.

  • Inverse (A−1\mathbf{A}^{-1}): For a square matrix A∈Rn×n\mathbf{A} \in \mathbb{R}^{n \times n}, its inverse B\mathbf{B} (denoted A−1\mathbf{A}^{-1}) satisfies AB=In=BA\mathbf{AB} = \mathbf{I}_n = \mathbf{BA}.
  • Existence: Not all matrices have an inverse. If an inverse exists, the matrix is called regular, invertible, or nonsingular. Otherwise, it is singular or noninvertible.
  • Uniqueness: If an inverse exists, it is unique.
  • 2×22 \times 2 inverse: For A=[a11a12a21a22]\mathbf{A} = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}, A−1=1a11a22−a12a21[a22−a12−a21a11]\mathbf{A}^{-1} = \frac{1}{a_{11}a_{22} - a_{12}a_{21}} \begin{bmatrix} a_{22} & -a_{12} \\ -a_{21} & a_{11} \end{bmatrix}, provided a11a22−a12a21≠0a_{11}a_{22} - a_{12}a_{21} \neq 0. The term a11a22−a12a21a_{11}a_{22} - a_{12}a_{21} is the determinant 8.
  • Transpose (A⊤\mathbf{A}^\top): For A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n}, its transpose B∈Rn×m\mathbf{B} \in \mathbb{R}^{n \times m} has elements bij=ajib_{ij} = a_{ji}.
  • Main diagonal: Entries AijA_{ij} where i=ji=j.
  • Symmetric matrix: A square matrix A∈Rn×n\mathbf{A} \in \mathbb{R}^{n \times n} is symmetric if A=A⊤\mathbf{A} = \mathbf{A}^\top 9.
PropertyDescription
Inverse definitionAA−1=I=A−1A\mathbf{AA}^{-1} = \mathbf{I} = \mathbf{A}^{-1}\mathbf{A}
Inverse of product(AB)−1=B−1A−1(\mathbf{AB})^{-1} = \mathbf{B}^{-1}\mathbf{A}^{-1}
Inverse of sum(A+B)−1≠A−1+B−1(\mathbf{A} + \mathbf{B})^{-1} \neq \mathbf{A}^{-1} + \mathbf{B}^{-1}
Double transpose(A⊤)⊤=A(\mathbf{A}^\top)^\top = \mathbf{A}
Transpose of product(AB)⊤=B⊤A⊤(\mathbf{AB})^\top = \mathbf{B}^\top\mathbf{A}^\top
Transpose of sum(A+B)⊤=A⊤+B⊤(\mathbf{A} + \mathbf{B})^\top = \mathbf{A}^\top + \mathbf{B}^\top
Inverse of transpose(A−1)⊤=(A⊤)−1=:A−⊤(\mathbf{A}^{-1})^\top = (\mathbf{A}^\top)^{-1} =: \mathbf{A}^{-\top}

📝 The sum of two symmetric matrices A,B∈Rn×n\mathbf{A}, \mathbf{B} \in \mathbb{R}^{n \times n} is always symmetric, but their product AB\mathbf{AB} is generally not symmetric 9.

3.5 Multiplication by a scalar

Scalar multiplication involves multiplying each element of a matrix by a scalar value 9.

  • Definition: For A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n} and λ∈R\lambda \in \mathbb{R}, λA=K\lambda \mathbf{A} = \mathbf{K}, where Kij=λaijK_{ij} = \lambda a_{ij} 9.
  • Properties:
  • Associativity: (λψ)C=λ(ψC)(\lambda\psi)\mathbf{C} = \lambda(\psi\mathbf{C}) and λ(BC)=(λB)C=B(λC)=(BC)λ\lambda(\mathbf{BC}) = (\lambda\mathbf{B})\mathbf{C} = \mathbf{B}(\lambda\mathbf{C}) = (\mathbf{BC})\lambda.
  • Distributivity: (λ+ψ)C=λC+ψC(\lambda + \psi)\mathbf{C} = \lambda\mathbf{C} + \psi\mathbf{C} and λ(B+C)=λB+λC\lambda(\mathbf{B} + \mathbf{C}) = \lambda\mathbf{B} + \lambda\mathbf{C} 10.

📝 For C=[1234]\mathbf{C} = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, (λ+ψ)C=[(λ+ψ)1(λ+ψ)2(λ+ψ)3(λ+ψ)4]=[λ2λ3λ4λ]+[ψ2ψ3ψ4ψ]=λC+ψC(\lambda + \psi)\mathbf{C} = \begin{bmatrix} (\lambda + \psi)1 & (\lambda + \psi)2 \\ (\lambda + \psi)3 & (\lambda + \psi)4 \end{bmatrix} = \begin{bmatrix} \lambda & 2\lambda \\ 3\lambda & 4\lambda \end{bmatrix} + \begin{bmatrix} \psi & 2\psi \\ 3\psi & 4\psi \end{bmatrix} = \lambda\mathbf{C} + \psi\mathbf{C} 10.

3.6 Compact representations of systems of linear equations

Matrix multiplication rules allow for a compact representation of systems of linear equations 10.

  • Matrix form: A system like 2x1+3x2+5x3=12x_1 + 3x_2 + 5x_3 = 1, 4x1−2x2−7x3=84x_1 - 2x_2 - 7x_3 = 8, 9x1+5x2−3x3=29x_1 + 5x_2 - 3x_3 = 2 can be written as [2354−2−795−3][x1x2x3]=[182]\begin{bmatrix} 2 & 3 & 5 \\ 4 & -2 & -7 \\ 9 & 5 & -3 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 1 \\ 8 \\ 2 \end{bmatrix}, or simply Ax=b\mathbf{Ax} = \mathbf{b}.
  • Linear combination: The product Ax\mathbf{Ax} represents a linear combination of the columns of A\mathbf{A} 10.

4. Solving Systems of Linear Equations

4.1 Particular and general solution

Solving systems of linear equations involves finding particular and general solutions 11.

  • Particular solution: A single solution to the system Ax=b\mathbf{Ax} = \mathbf{b} 11.
  • General solution: The set of all possible solutions to Ax=b\mathbf{Ax} = \mathbf{b}, which is the sum of a particular solution and all solutions to the homogeneous system Ax=0\mathbf{Ax} = \mathbf{0}.
  • Solution steps:
  1. Find a particular solution to Ax=b\mathbf{Ax} = \mathbf{b}.
  2. Find all solutions to the homogeneous system Ax=0\mathbf{Ax} = \mathbf{0}.
  3. Combine these to form the general solution.
  • Non-uniqueness: Neither the particular nor the general solution is necessarily unique 12.

📝 For the system [108−401212][x1x2x3x4]=[428]\begin{bmatrix} 1 & 0 & 8 & -4 \\ 0 & 1 & 2 & 12 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = \begin{bmatrix} 42 \\ 8 \end{bmatrix}, a particular solution is [42,8,0,0]⊤[42, 8, 0, 0]^\top. The general solution is x=[42800]+λ1[82−10]+λ2[−4120−1]\mathbf{x} = \begin{bmatrix} 42 \\ 8 \\ 0 \\ 0 \end{bmatrix} + \lambda_1 \begin{bmatrix} 8 \\ 2 \\ -1 \\ 0 \end{bmatrix} + \lambda_2 \begin{bmatrix} -4 \\ 12 \\ 0 \\ -1 \end{bmatrix}, where λ1,λ2∈R\lambda_1, \lambda_2 \in \mathbb{R} 11 12.

4.2 Elementary transformations

Elementary transformations are operations that simplify a system of linear equations without changing its solution set 12.

  • Types of transformations:
  • Exchange of two equations (rows in the augmented matrix).
  • Multiplication of an equation (row) by a non-zero constant λ∈R∖{0}\lambda \in \mathbb{R} \setminus \{0\}.
  • Addition of two equations (rows).
  • Augmented matrix: A compact representation of Ax=b\mathbf{Ax} = \mathbf{b} as [A∣b][\mathbf{A} | \mathbf{b}] 13.

📝 To solve the system −2x1+4x2−2x3−x4+4x5=−34x1−8x2+3x3−3x4+x5=0x1−2x2+x3−x4+x5=0x1−2x2−3x4+4x5=a\begin{aligned} -2x_1 + 4x_2 - 2x_3 - x_4 + 4x_5 &= -3 \\ 4x_1 - 8x_2 + 3x_3 - 3x_4 + x_5 &= 0 \\ x_1 - 2x_2 + x_3 - x_4 + x_5 &= 0 \\ x_1 - 2x_2 - 3x_4 + 4x_5 &= a \end{aligned}, one can start by swapping rows in the augmented matrix to simplify the leading coefficient 13.

4.3 Row-echelon form and reduced row-echelon form

Gaussian elimination uses elementary transformations to bring a matrix into row-echelon form (REF) or reduced row-echelon form (RREF) 14 15.

  • Row-echelon form (REF): A matrix is in REF if:
  • All rows consisting entirely of zeros are at the bottom.
  • For any non-zero row, the first non-zero number from the left (the pivot or leading coefficient) is strictly to the right of the pivot of the row above it.
  • Basic and free variables: Variables corresponding to pivots in REF are basic variables, while others are free variables 14.
  • Reduced row-echelon form (RREF): A matrix is in RREF if it satisfies the conditions for REF, and additionally:
  • Every pivot is 1.
  • The pivot is the only non-zero entry in its column.
  • Gaussian elimination: An algorithm that performs elementary transformations to transform a system of linear equations into RREF 15.

📝 The matrix [13003001090001−4]\begin{bmatrix} \mathbf{1} & 3 & 0 & 0 & 3 \\ 0 & 0 & \mathbf{1} & 0 & 9 \\ 0 & 0 & 0 & \mathbf{1} & -4 \end{bmatrix} is in reduced row-echelon form, with pivots highlighted. Here, x1,x3,x4x_1, x_3, x_4 are basic variables, and x2,x5x_2, x_5 are free variables 15.

4.4 The minus-1 trick

The minus-1 trick is a practical method for reading solutions to homogeneous systems Ax=0\mathbf{Ax} = \mathbf{0} when A\mathbf{A} is in RREF 16.

  • Procedure:
  1. Assume A∈Rk×n\mathbf{A} \in \mathbb{R}^{k \times n} is in RREF with no zero rows.
  2. Augment A\mathbf{A} to an n×nn \times n matrix A~\tilde{\mathbf{A}} by adding rows of zeros such that the diagonal of A~\tilde{\mathbf{A}} contains either 1 or -1.
  3. The columns of A~\tilde{\mathbf{A}} that contain -1 on the diagonal form a basis for the solution space (kernel or null space) of Ax=0\mathbf{Ax} = \mathbf{0} 16 17.

📝 For A=[13003001090001−4]\mathbf{A} = \begin{bmatrix} 1 & 3 & 0 & 0 & 3 \\ 0 & 0 & 1 & 0 & 9 \\ 0 & 0 & 0 & 1 & -4 \end{bmatrix}, augmenting it to a 5×55 \times 5 matrix A~\tilde{\mathbf{A}} by inserting −1-1s on the diagonal for free variables yields A~=[130030−1000001090001−40000−1]\tilde{\mathbf{A}} = \begin{bmatrix} 1 & 3 & 0 & 0 & 3 \\ 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 9 \\ 0 & 0 & 0 & 1 & -4 \\ 0 & 0 & 0 & 0 & -1 \end{bmatrix}. The columns containing −1-1 on the diagonal (columns 2 and 5) give the solutions: x=λ1[3−1000]+λ2[309−4−1]\mathbf{x} = \lambda_1 \begin{bmatrix} 3 \\ -1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + \lambda_2 \begin{bmatrix} 3 \\ 0 \\ 9 \\ -4 \\ -1 \end{bmatrix} 17.

4.5 Calculating the inverse

Gaussian elimination can also be used to compute the inverse of a square matrix 17.

  • Method: To find A−1\mathbf{A}^{-1} for A∈Rn×n\mathbf{A} \in \mathbb{R}^{n \times n}, form the augmented matrix [A∣In][\mathbf{A} | \mathbf{I}_n]. Apply elementary row transformations to bring the left side to In\mathbf{I}_n. The right side will then be A−1\mathbf{A}^{-1}. [A∣In]⇝[In∣A−1][\mathbf{A} | \mathbf{I}_n] \leadsto [\mathbf{I}_n | \mathbf{A}^{-1}] 17.

📝 To find the inverse of A=[1000010000100001]\mathbf{A} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}, the augmented matrix is [1000∣10000100∣01000010∣00100001∣0001]\begin{bmatrix} 1 & 0 & 0 & 0 & | & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & | & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & | & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & | & 0 & 0 & 0 & 1 \end{bmatrix}. After Gaussian elimination, the right side yields A−1=[1000010000100001]\mathbf{A}^{-1} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} 18.

4.6 Algorithms for solving systems of linear equations

Various approaches exist for solving Ax=b\mathbf{Ax} = \mathbf{b}, assuming a solution exists 18.

  • Direct inverse method: If A\mathbf{A} is a square and invertible matrix, the solution is x=A−1b\mathbf{x} = \mathbf{A}^{-1}\mathbf{b}.
  • Normal equations: For non-square or non-invertible A\mathbf{A} with linearly independent columns, the solution can be found using x=(A⊤A)−1A⊤b\mathbf{x} = (\mathbf{A}^\top\mathbf{A})^{-1}\mathbf{A}^\top\mathbf{b}. This approach is used in linear regression for approximate solutions 18.

5. Vector Spaces

5.1 Groups

A group G=(G,⊗)G = (G, \otimes) is a set GG with a binary operation ⊗:G×G→G\otimes: G \times G \to G that satisfies specific axioms, providing a fundamental framework for operations on sets used in cryptography, coding theory, and graphics 20.

PropertyDescription
ClosureFor all x,y∈Gx, y \in G, x⊗y∈Gx \otimes y \in G
AssociativityFor all x,y,z∈Gx, y, z \in G, (x⊗y)⊗z=x⊗(y⊗z)(x \otimes y) \otimes z = x \otimes (y \otimes z)
Neutral elementThere exists an element e∈Ge \in G such that for all x∈Gx \in G, x⊗e=xx \otimes e = x and e⊗x=xe \otimes x = x
Inverse elementFor all x∈Gx \in G, there exists an element y∈Gy \in G such that x⊗y=ex \otimes y = e and y⊗x=ey \otimes x = e
  • Abelian group: A group G=(G,⊗)G = (G, \otimes) is Abelian (or commutative) if, additionally, for all x,y∈Gx, y \in G, x⊗y=y⊗xx \otimes y = y \otimes x 20.
  • General linear group GL(n, R): The set of regular (invertible) n×nn \times n matrices A∈Rn×nA \in \mathbb{R}^{n \times n} forms a group under matrix multiplication, but it is not Abelian because matrix multiplication is generally not commutative 21.

📝 The set of integers with addition (Z,+)(\mathbb{Z}, +) is an Abelian group. However, the set of natural numbers including zero with addition (N0,+)(\mathbb{N}_0, +) is not a group because inverse elements are missing (e.g., there is no negative integer for 1∈N01 \in \mathbb{N}_0 such that 1+(−1)=01 + (-1) = 0) 20.

5.2 Vector Spaces

A real-valued vector space V=(V,+,⋅)V = (V, +, \cdot) is a set VV equipped with two operations: vector addition (+:V×V→V)(+: V \times V \to V) and scalar multiplication (⋅:R×V→V)(\cdot: \mathbb{R} \times V \to V), satisfying a set of axioms.

  • Vectors: The elements x∈Vx \in V are called vectors.
  • Scalars: The elements λ∈R\lambda \in \mathbb{R} are called scalars.
  • Zero vector: The neutral element of (V,+)(V, +) is the zero vector 0=[0,…,0]⊤0 = [0, \dots, 0]^\top 21.
AxiomDescription
Abelian group(V,+)(V, +) must be an Abelian group
Distributivity (scalar over vector addition)For all λ∈R\lambda \in \mathbb{R}, x,y∈Vx, y \in V: λ⋅(x+y)=λ⋅x+λ⋅y\lambda \cdot (x + y) = \lambda \cdot x + \lambda \cdot y
Distributivity (scalar over scalar addition)For all λ,ψ∈R\lambda, \psi \in \mathbb{R}, x∈Vx \in V: (λ+ψ)⋅x=λ⋅x+ψ⋅x(\lambda + \psi) \cdot x = \lambda \cdot x + \psi \cdot x
Associativity (outer operation)For all λ,ψ∈R\lambda, \psi \in \mathbb{R}, x∈Vx \in V: λ⋅(ψ⋅x)=(λψ)⋅x\lambda \cdot (\psi \cdot x) = (\lambda\psi) \cdot x
Neutral element (outer operation)For all x∈Vx \in V: 1⋅x=x1 \cdot x = x

📝 Rn\mathbb{R}^n, the set of nn-tuples of real numbers, is a vector space with component-wise addition and scalar multiplication. For instance, in R2\mathbb{R}^2, if x=(x1,x2)x = (x_1, x_2) and y=(y1,y2)y = (y_1, y_2), then x+y=(x1+y1,x2+y2)x+y = (x_1+y_1, x_2+y_2) and λx=(λx1,λx2)\lambda x = (\lambda x_1, \lambda x_2) 22.

5.3 Vector Subspaces

A vector subspace UU of a vector space VV is a non-empty subset U⊆VU \subseteq V that is itself a vector space under the same operations restricted to UU.

  • Closure properties: To verify if UU is a subspace, it must satisfy:
  • U≠∅U \neq \emptyset, specifically 0∈U0 \in U.
  • Closure under scalar multiplication: For all λ∈R\lambda \in \mathbb{R} and x∈Ux \in U, λx∈U\lambda x \in U.
  • Closure under vector addition: For all x,y∈Ux, y \in U, x+y∈Ux + y \in U.
  • Homogeneous systems: The solution set of a homogeneous system of linear equations Ax=0Ax = 0 is a vector subspace of Rn\mathbb{R}^n.
  • Inhomogeneous systems: The solution set of an inhomogeneous system Ax=bAx = b where b≠0b \neq 0 is not a subspace because it does not contain the zero vector 23.

📝 For any vector space VV, the trivial subspaces are VV itself and {0}\{0\}. In R2\mathbb{R}^2, a line passing through the origin is a subspace, as it contains the zero vector and is closed under addition and scalar multiplication. A line not passing through the origin is not a subspace because it does not contain the zero vector 23.

6. Linear Independence

6.1 Linear Combination

A linear combination of vectors x1,…,xk∈Vx_1, \dots, x_k \in V is any vector v∈Vv \in V that can be expressed as v=λ1x1+⋯+λkxk=∑i=1kλixiv = \lambda_1 x_1 + \dots + \lambda_k x_k = \sum_{i=1}^k \lambda_i x_i, where λ1,…,λk∈R\lambda_1, \dots, \lambda_k \in \mathbb{R} are scalars.

  • The zero vector can always be written as a linear combination by setting all scalars λi=0\lambda_i = 0.
  • A non-trivial linear combination of vectors x1,…,xkx_1, \dots, x_k to represent 00 means that at least one coefficient λi\lambda_i is not zero 24.

6.2 Linear (In)dependence

Vectors x1,…,xk∈Vx_1, \dots, x_k \in V are linearly dependent if there exists a non-trivial linear combination that equals the zero vector, i.e., ∑i=1kλixi=0\sum_{i=1}^k \lambda_i x_i = 0 with at least one λi≠0\lambda_i \neq 0.

  • Linearly independent: If only the trivial solution exists (i.e., λ1=⋯=λk=0\lambda_1 = \dots = \lambda_k = 0), then the vectors are linearly independent.
  • Intuition: Linearly independent vectors have no redundancy; removing any vector from the set results in a loss of representational capacity 24.

📝 In a 2D geographic coordinate system, if you describe a location by going "506 km Northwest" and then "374 km Southwest," these two vectors are linearly independent. If you then add "751 km West," this third vector is a linear combination of the first two, making the set of three vectors linearly dependent 25.

6.3 Properties of Linear (In)dependence

Several properties help determine whether vectors are linearly independent:

  • Vectors are either linearly dependent or linearly independent; there is no other option.
  • If at least one vector in a set is the zero vector, the set is linearly dependent.
  • If two vectors in a set are identical, the set is linearly dependent.
  • A set of non-zero vectors {x1,…,xk}\{x_1, \dots, x_k\} with k≥2k \ge 2 is linearly dependent if and only if at least one vector is a linear combination of the others.
  • If one vector is a multiple of another (e.g., xi=λxjx_i = \lambda x_j), the set is linearly dependent 25.

6.4 Checking Linear Independence with Gaussian Elimination

A practical method to check for linear independence involves Gaussian elimination:

  1. Write the vectors as columns of a matrix AA.
  2. Perform Gaussian elimination to transform AA into row-echelon form 25.
  3. Pivot columns: These columns correspond to vectors that are linearly independent of the vectors to their left.
  4. Non-pivot columns: These columns can be expressed as linear combinations of the pivot columns to their left.
  5. Conclusion: All column vectors are linearly independent if and only if all columns are pivot columns. If there is at least one non-pivot column, the vectors are linearly dependent 26.

📝 To check if x1=(1−34)x_1 = \begin{pmatrix} 1 \\ -3 \\ 4 \end{pmatrix}, x2=(201)x_2 = \begin{pmatrix} 2 \\ 0 \\ 1 \end{pmatrix}, x3=(−2−20)x_3 = \begin{pmatrix} -2 \\ -2 \\ 0 \end{pmatrix} are linearly independent in R4\mathbb{R}^4, form a matrix A=(12−2−30−2410)A = \begin{pmatrix} 1 & 2 & -2 \\ -3 & 0 & -2 \\ 4 & 1 & 0 \end{pmatrix} and apply Gaussian elimination. If all columns become pivot columns in row-echelon form, the vectors are linearly independent 26.

6.5 Linear Combinations of Linearly Independent Vectors

Consider mm linear combinations xj=∑i=1kλijbix_j = \sum_{i=1}^k \lambda_{ij} b_i of kk linearly independent vectors b1,…,bkb_1, \dots, b_k.

  • The set {x1,…,xm}\{x_1, \dots, x_m\} is linearly independent if and only if the column vectors {λ1,…,λm}\{\lambda_1, \dots, \lambda_m\} (where λj=[λ1j,…,λkj]⊤\lambda_j = [\lambda_{1j}, \dots, \lambda_{kj}]^\top) are linearly independent.
  • If m>km > k, then mm linear combinations of kk vectors are always linearly dependent 27.

📝 Given linearly independent vectors b1,b2,b3,b4∈Rnb_1, b_2, b_3, b_4 \in \mathbb{R}^n, and x1=b1−2b2+b3−b4x_1 = b_1 - 2b_2 + b_3 - b_4, x2=−4b1−2b2+4b4x_2 = -4b_1 - 2b_2 + 4b_4, x3=2b1+3b2−b3−3b4x_3 = 2b_1 + 3b_2 - b_3 - 3b_4, x4=17b1−10b2+11b3+b4x_4 = 17b_1 - 10b_2 + 11b_3 + b_4. To check if x1,…,x4x_1, \dots, x_4 are linearly independent, we examine the linear independence of their coefficient vectors: λ1=(1−21−1)\lambda_1 = \begin{pmatrix} 1 \\ -2 \\ 1 \\ -1 \end{pmatrix}, λ2=(−4−204)\lambda_2 = \begin{pmatrix} -4 \\ -2 \\ 0 \\ 4 \end{pmatrix}, λ3=(23−1−3)\lambda_3 = \begin{pmatrix} 2 \\ 3 \\ -1 \\ -3 \end{pmatrix}, λ4=(17−10111)\lambda_4 = \begin{pmatrix} 17 \\ -10 \\ 11 \\ 1 \end{pmatrix}. Forming a matrix with these as columns and reducing it to row-echelon form reveals if any column is a non-pivot column, indicating linear dependence 27 28.

7. Basis and Rank

7.1 Generating Set and Span

A generating set A={x1,…,xk}A = \{x_1, \dots, x_k\} for a vector space VV is a set of vectors such that every vector v∈Vv \in V can be expressed as a linear combination of the vectors in AA.

  • The span of AA, denoted span[A]\text{span}[A] or span[x1,…,xk]\text{span}[x_1, \dots, x_k], is the set of all possible linear combinations of vectors in AA.
  • If AA spans VV, we write V=span[A]V = \text{span}[A] 28.

7.2 Basis

A basis BB of a vector space VV is a generating set that is also linearly independent.

  • Minimal generating set: A basis is a minimal generating set, meaning no smaller subset can span VV 28.
  • Maximal linearly independent set: A basis is a maximal linearly independent set, meaning adding any other vector to it makes the set linearly dependent.
  • Unique linear combination: Every vector x∈Vx \in V can be uniquely expressed as a linear combination of basis vectors.
  • Dimension: For finite-dimensional vector spaces, the dimension of VV, denoted dim(V)\text{dim}(V), is the number of vectors in any basis of VV.
  • All bases of a given vector space have the same number of elements.
  • If U⊆VU \subseteq V is a subspace, then dim(U)≤dim(V)\text{dim}(U) \le \text{dim}(V), and dim(U)=dim(V)\text{dim}(U) = \text{dim}(V) if and only if U=VU = V 29 30.

📝 In R3\mathbb{R}^3, the canonical basis is B={(100),(010),(001)}B = \left\{ \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix} \right\}. Another valid basis could be B1={(110),(011),(101)}B_1 = \left\{ \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix}, \begin{pmatrix} 1 \\ 0 \\ 1 \end{pmatrix} \right\} 29.

7.3 Determining a Basis for a Subspace

To find a basis for a subspace U=span[x1,…,xm]⊆RnU = \text{span}[x_1, \dots, x_m] \subseteq \mathbb{R}^n:

  1. Write the spanning vectors x1,…,xmx_1, \dots, x_m as columns of a matrix AA.
  2. Determine the row-echelon form of AA using Gaussian elimination.
  3. The spanning vectors corresponding to the pivot columns in the row-echelon form constitute a basis for UU 30.

📝 For a subspace U⊆R5U \subseteq \mathbb{R}^5 spanned by x1=(10000)x_1 = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix}, x2=(01−200)x_2 = \begin{pmatrix} 0 \\ 1 \\ -2 \\ 0 \\ 0 \end{pmatrix}, x3=(3−435−3)x_3 = \begin{pmatrix} 3 \\ -4 \\ 3 \\ 5 \\ -3 \end{pmatrix}, x4=(8−5−600)x_4 = \begin{pmatrix} 8 \\ -5 \\ -6 \\ 0 \\ 0 \end{pmatrix}, form a matrix AA with these vectors as columns. After reducing AA to row-echelon form, if x1,x2,x4x_1, x_2, x_4 correspond to pivot columns, then {x1,x2,x4}\{x_1, x_2, x_4\} is a basis for UU 30 31.

7.4 Rank

The rank of a matrix A∈Rm×nA \in \mathbb{R}^{m \times n}, denoted rk(A)\text{rk}(A), is the number of linearly independent columns, which is equal to the number of linearly independent rows 31.

PropertyDescription
Column rank equals row rankrk(A)=rk(A⊤)\text{rk}(A) = \text{rk}(A^\top)
Dimension of column spaceThe columns of AA span a subspace U⊆RmU \subseteq \mathbb{R}^m with dim(U)=rk(A)\text{dim}(U) = \text{rk}(A) (image or range)
Dimension of row spaceThe rows of AA span a subspace W⊆RnW \subseteq \mathbb{R}^n with dim(W)=rk(A)\text{dim}(W) = \text{rk}(A)
Invertibility for square matricesFor A∈Rn×nA \in \mathbb{R}^{n \times n}, AA is regular (invertible) if and only if rk(A)=n\text{rk}(A) = n
Solvability of linear systemsThe system Ax=bAx = b can be solved if and only if $\text{rk}(A) = \text{rk}(A
Dimension of null space (kernel)The subspace of solutions for Ax=0Ax = 0 (kernel or null space) has dimension n−rk(A)n - \text{rk}(A)
  • Full rank: A matrix A∈Rm×nA \in \mathbb{R}^{m \times n} has full rank if its rank equals the maximum possible for its dimensions, i.e., rk(A)=min⁡(m,n)\text{rk}(A) = \min(m, n).
  • Rank deficient: A matrix is rank deficient if it does not have full rank 31.

📝 For the matrix A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}, the rank is 2. This means there are two linearly independent rows and two linearly independent columns, even though the matrix has three rows and three columns 31.

8. Linear Mappings

8.1 Definition of linear mapping

A linear mapping (or vector space homomorphism/linear transformation) is a function Φ:V→W\Phi: V \to W between two vector spaces VV and WW that preserves their structure, meaning it maintains the operations of vector addition and scalar multiplication 32.

  • Properties: For all x,y∈Vx, y \in V and λ,ψ∈R\lambda, \psi \in \mathbb{R}:
  • Φ(x+y)=Φ(x)+Φ(y)\Phi(x + y) = \Phi(x) + \Phi(y).
  • Φ(λx)=λΦ(x)\Phi(\lambda x) = \lambda \Phi(x).
  • These can be combined into a single condition: Φ(λx+ψy)=λΦ(x)+ψΦ(y)\Phi(\lambda x + \psi y) = \lambda \Phi(x) + \psi \Phi(y) 32.
  • Composition: For linear mappings Φ:V→W\Phi: V \to W and Ψ:W→X\Psi: W \to X, the composite mapping Ψ∘Φ:V→X\Psi \circ \Phi: V \to X is also linear 33.
  • Linear combinations: If Φ:V→W\Phi: V \to W and Ψ:V→W\Psi: V \to W are linear, then Φ+Ψ\Phi + \Psi and λΦ\lambda \Phi (for λ∈R\lambda \in \mathbb{R}) are also linear 34.

📝 The mapping Φ:R2→C\Phi: \mathbb{R}^2 \to \mathbb{C}, defined as Φ((x1x2))=x1+ix2\Phi(\begin{pmatrix} x_1 \\ x_2 \end{pmatrix}) = x_1 + ix_2, is a homomorphism because it satisfies the linearity conditions for addition and scalar multiplication 33.

8.2 Special mappings

Mappings can be classified based on their properties related to injectivity, surjectivity, and bijectivity, which describe how elements from the domain map to elements in the codomain 32.

Type of MappingCondition
Injective∀x,y∈V:Φ(x)=Φ(y)  ⟹  x=y\forall x, y \in V: \Phi(x) = \Phi(y) \implies x = y (one-to-one)
SurjectiveΦ(V)=W\Phi(V) = W (every element in WW is 'reached' from VV)
BijectiveBoth injective and surjective (implies existence of an inverse mapping Φ−1\Phi^{-1})
  • Inverse mapping: If Φ\Phi is bijective, an inverse mapping Ψ:W→V\Psi: W \to V exists such that Ψ∘Φ(x)=x\Psi \circ \Phi(x) = x, denoted as Φ−1\Phi^{-1}.
  • Identity mapping: The mapping idV:V→V\text{id}_V: V \to V, x↦xx \mapsto x, is called the identity mapping or identity automorphism in VV 33.
Special Linear MappingConditions
IsomorphismΦ:V→W\Phi: V \to W is linear and bijective
EndomorphismΦ:V→V\Phi: V \to V is linear
AutomorphismΦ:V→V\Phi: V \to V is linear and bijective
  • Isomorphism property: Finite-dimensional vector spaces VV and WW are isomorphic if and only if dim(V)=dim(W)\text{dim}(V) = \text{dim}(W).
  • This implies that vector spaces of the same dimension are structurally equivalent, allowing transformation between them without loss.
  • Inverse of isomorphism: If Φ:V→W\Phi: V \to W is an isomorphism, then its inverse Φ−1:W→V\Phi^{-1}: W \to V is also an isomorphism 33.

8.3 Matrix representation of linear mappings

Any nn-dimensional vector space is isomorphic to Rn\mathbb{R}^n. An ordered basis B=(b1,…,bn)B = (b_1, \dots, b_n) of a vector space VV is crucial for defining coordinates, as the order of basis vectors matters 34.

  • Coordinates: For any vector x∈Vx \in V, its unique representation as a linear combination x=α1b1+⋯+αnbnx = \alpha_1 b_1 + \dots + \alpha_n b_n yields the coordinates α1,…,αn\alpha_1, \dots, \alpha_n with respect to BB.
  • Coordinate vector: The vector α=(α1⋮αn)∈Rn\alpha = \begin{pmatrix} \alpha_1 \\ \vdots \\ \alpha_n \end{pmatrix} \in \mathbb{R}^n is the coordinate vector or coordinate representation of xx with respect to BB 34.
  • Coordinate system: A basis effectively defines a coordinate system, where a vector's representation changes depending on the chosen basis 35.

📝 A vector x∈R2x \in \mathbb{R}^2 with coordinates [2,3]⊤[2, 3]^\top in the standard basis (e1,e2)(e_1, e_2) can be represented as x=2e1+3e2x = 2e_1 + 3e_2. With respect to a different basis, such as b1=[1,−1]⊤b_1 = [1, -1]^\top and b2=[1,1]⊤b_2 = [1, 1]^\top, the same vector xx would have coordinates [12,52]⊤[\frac{1}{2}, \frac{5}{2}]^\top, meaning x=12b1+52b2x = \frac{1}{2}b_1 + \frac{5}{2}b_2 35.

  • Transformation matrix: For a linear mapping Φ:V→W\Phi: V \to W with ordered bases B=(b1,…,bn)B = (b_1, \dots, b_n) for VV and C=(c1,…,cm)C = (c_1, \dots, c_m) for WW, the transformation matrix AΦ∈Rm×nA_\Phi \in \mathbb{R}^{m \times n} has elements AΦ(i,j)=αijA_\Phi(i, j) = \alpha_{ij}, where Φ(bj)=∑i=1mαijci\Phi(b_j) = \sum_{i=1}^m \alpha_{ij} c_i is the unique representation of Φ(bj)\Phi(b_j) with respect to CC.
  • The coordinates of Φ(bj)\Phi(b_j) with respect to CC form the jj-th column of AΦA_\Phi 35.
  • If x^\hat{x} is the coordinate vector of x∈Vx \in V with respect to BB, and y^\hat{y} is the coordinate vector of y=Φ(x)∈Wy = \Phi(x) \in W with respect to CC, then y^=AΦx^\hat{y} = A_\Phi \hat{x} 36.

📝 For a homomorphism Φ:V→W\Phi: V \to W with bases B=(b1,b2,b3)B=(b_1, b_2, b_3) and C=(c1,c2,c3,c4)C=(c_1, c_2, c_3, c_4), if Φ(b1)=c1−c2+3c3−c4\Phi(b_1) = c_1 - c_2 + 3c_3 - c_4, Φ(b2)=2c1+c2+7c3+2c4\Phi(b_2) = 2c_1 + c_2 + 7c_3 + 2c_4, and Φ(b3)=3c2+c3+4c4\Phi(b_3) = 3c_2 + c_3 + 4c_4, the transformation matrix AΦA_\Phi is formed by these coordinate vectors as columns: AΦ=(120−113371−124)A_\Phi = \begin{pmatrix} 1 & 2 & 0 \\ -1 & 1 & 3 \\ 3 & 7 & 1 \\ -1 & 2 & 4 \end{pmatrix} 36.

8.4 Basis change

Transformation matrices of a linear mapping change when the bases in VV and WW are changed 37.

  • Basis change theorem: For a linear mapping Φ:V→W\Phi: V \to W, with transformation matrix AΦA_\Phi with respect to bases BB and CC, the corresponding transformation matrix A~Φ\tilde{A}_\Phi with respect to new bases B~\tilde{B} and C~\tilde{C} is given by A~Φ=T−1AΦS\tilde{A}_\Phi = T^{-1} A_\Phi S.
  • S∈Rn×nS \in \mathbb{R}^{n \times n}: Transformation matrix of idV\text{id}_V that maps coordinates with respect to B~\tilde{B} onto coordinates with respect to BB. Its jj-th column is the coordinate representation of b~j\tilde{b}_j with respect to BB.
  • T∈Rm×mT \in \mathbb{R}^{m \times m}: Transformation matrix of idW\text{id}_W that maps coordinates with respect to C~\tilde{C} onto coordinates with respect to CC. Its kk-th column is the coordinate representation of c~k\tilde{c}_k with respect to CC 38.
  • Both SS and TT are regular (invertible) matrices 39.
  • Compositional view: The transformation A~Φ\tilde{A}_\Phi can be seen as a composition of mappings: first transforming coordinates from B~\tilde{B} to BB (via SS), then applying Φ\Phi (via AΦA_\Phi), and finally transforming coordinates from CC to C~\tilde{C} (via T−1T^{-1}) 40 41.
Matrix RelationshipCondition
Equivalent matricesTwo matrices A,A~∈Rm×nA, \tilde{A} \in \mathbb{R}^{m \times n} are equivalent if A~=T−1AS\tilde{A} = T^{-1}AS for regular matrices S∈Rn×nS \in \mathbb{R}^{n \times n} and T∈Rm×mT \in \mathbb{R}^{m \times m}
Similar matricesTwo matrices A,A~∈Rn×nA, \tilde{A} \in \mathbb{R}^{n \times n} are similar if A~=S−1AS\tilde{A} = S^{-1}AS for a regular matrix S∈Rn×nS \in \mathbb{R}^{n \times n}
  • Relationship: Similar matrices are always equivalent, but equivalent matrices are not necessarily similar.
  • Transformation of composite mappings: For linear mappings Φ:V→W\Phi: V \to W and Ψ:W→X\Psi: W \to X, with transformation matrices AΦA_\Phi and AΨA_\Psi, the transformation matrix of the composite mapping is AΨ∘Φ=AΨAΦA_{\Psi \circ \Phi} = A_\Psi A_\Phi 40.

📝 Consider a linear mapping Φ:R3→R4\Phi: \mathbb{R}^3 \to \mathbb{R}^4 with transformation matrix AΦ=(120−113371−124)A_\Phi = \begin{pmatrix} 1 & 2 & 0 \\ -1 & 1 & 3 \\ 3 & 7 & 1 \\ -1 & 2 & 4 \end{pmatrix} with respect to standard bases BB and CC. To find A~Φ\tilde{A}_\Phi with respect to new bases B~\tilde{B} and C~\tilde{C}, one would construct SS by representing B~\tilde{B} vectors in terms of BB, and TT by representing C~\tilde{C} vectors in terms of CC. Then, A~Φ=T−1AΦS\tilde{A}_\Phi = T^{-1}A_\Phi S 41 42.

8.5 Image and kernel

The kernel (or null space) and image (or range) of a linear mapping are fundamental vector subspaces 42.

  • Kernel: ker(Φ):=Φ−1(0W)={v∈V:Φ(v)=0W}\text{ker}(\Phi):= \Phi^{-1}(0_W) = \{v \in V: \Phi(v) = 0_W\}.
  • It is the set of all vectors in the domain VV that map to the neutral element 0W0_W in the codomain WW.
  • ker(Φ)\text{ker}(\Phi) is always a subspace of VV and is never empty, as 0V∈ker(Φ)0_V \in \text{ker}(\Phi).
  • Φ\Phi is injective if and only if ker(Φ)={0V}\text{ker}(\Phi) = \{0_V\}.
  • For a matrix A∈Rm×nA \in \mathbb{R}^{m \times n} representing Φ(x)=Ax\Phi(x) = Ax, the kernel is the general solution to the homogeneous system Ax=0Ax = 0.
  • Image: Im(Φ):=Φ(V)={w∈W∣∃v∈V:Φ(v)=w}\text{Im}(\Phi):= \Phi(V) = \{w \in W \mid \exists v \in V: \Phi(v) = w\}.
  • It is the set of all vectors in WW that can be "reached" by Φ\Phi from some vector in VV.
  • Im(Φ)\text{Im}(\Phi) is always a subspace of WW 42.
  • For a matrix A=[a1,…,an]A = [a_1, \dots, a_n], the image is the span of the columns of AA, also known as the column space: Im(Φ)=span[a1,…,an]⊆Rm\text{Im}(\Phi) = \text{span}[a_1, \dots, a_n] \subseteq \mathbb{R}^m.
  • The rank of matrix AA is equal to the dimension of the image: rk(A)=dim(Im(Φ))\text{rk}(A) = \text{dim}(\text{Im}(\Phi)) 43.

📝 For the linear mapping Φ:R4→R2\Phi: \mathbb{R}^4 \to \mathbb{R}^2, Φ((x1x2x3x4))=(x1+2x2−x3x1+x4)\Phi(\begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{pmatrix}) = \begin{pmatrix} x_1 + 2x_2 - x_3 \\ x_1 + x_4 \end{pmatrix}, the image is Im(Φ)=span[(11),(20),(−10),(01)]\text{Im}(\Phi) = \text{span}[\begin{pmatrix} 1 \\ 1 \end{pmatrix}, \begin{pmatrix} 2 \\ 0 \end{pmatrix}, \begin{pmatrix} -1 \\ 0 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \end{pmatrix}]. To find the kernel, one solves Ax=0A x = 0, where A=(12−101001)A = \begin{pmatrix} 1 & 2 & -1 & 0 \\ 1 & 0 & 0 & 1 \end{pmatrix}. After Gaussian elimination, the kernel is found to be span[(01/210),(−11/201)]\text{span}[\begin{pmatrix} 0 \\ 1/2 \\ 1 \\ 0 \end{pmatrix}, \begin{pmatrix} -1 \\ 1/2 \\ 0 \\ 1 \end{pmatrix}] 43 44.

  • Rank-Nullity Theorem: For vector spaces V,WV, W and a linear mapping Φ:V→W\Phi: V \to W, it holds that dim(ker(Φ))+dim(Im(Φ))=dim(V)\text{dim}(\text{ker}(\Phi)) + \text{dim}(\text{Im}(\Phi)) = \text{dim}(V).
  • This is also known as the fundamental theorem of linear mappings.
  • Consequences:
  • If dim(Im(Φ))<dim(V)\text{dim}(\text{Im}(\Phi)) < \text{dim}(V), then ker(Φ)\text{ker}(\Phi) is non-trivial, meaning dim(ker(Φ))≥1\text{dim}(\text{ker}(\Phi)) \ge 1 and Ax=0Ax=0 has infinitely many solutions.
  • If dim(V)=dim(W)\text{dim}(V) = \text{dim}(W), then Φ\Phi is injective   ⟺  \iff Φ\Phi is surjective   ⟺  \iff Φ\Phi is bijective 44.

9. Affine Spaces

Affine spaces are sets that are offset from the origin, distinguishing them from vector subspaces by not necessarily containing the zero vector. This distinction is crucial as it means affine spaces are not vector subspaces unless the offset vector is itself within the direction space 45.

9.1 Affine Subspaces

An affine subspace (or linear manifold) LL of a vector space VV is defined as a subset L=x0+UL = x_0 + U, where x0∈Vx_0 \in V is the support point and U⊆VU \subseteq V is a subspace called the direction or direction space 45.

  • Exclusion of origin: An affine subspace does not contain the zero vector if its support point x0x_0 is not in the direction space UU.
  • Relationship between affine subspaces: For two affine subspaces L=x0+UL = x_0 + U and L~=x~0+U~\tilde{L} = \tilde{x}_0 + \tilde{U}, L⊆L~L \subseteq \tilde{L} if and only if U⊆U~U \subseteq \tilde{U} and x0−x~0∈U~x_0 - \tilde{x}_0 \in \tilde{U}.
  • Parametric equation: A kk-dimensional affine space L=x0+UL = x_0 + U can be uniquely described by a parametric equation x=x0+λ1b1+⋯+λkbkx = x_0 + \lambda_1 b_1 + \dots + \lambda_k b_k, where (b1,…,bk)(b_1, \dots, b_k) is an ordered basis of UU and λ1,…,λk∈R\lambda_1, \dots, \lambda_k \in \mathbb{R} are parameters 45.
DimensionNameParametric Equation
1Liney=x0+λb1y = x_0 + \lambda b_1
2Planey=x0+λ1b1+λ2b2y = x_0 + \lambda_1 b_1 + \lambda_2 b_2
n−1n-1Hyperplaney=x0+∑i=1n−1λibiy = x_0 + \sum_{i=1}^{n-1} \lambda_i b_i

📝 In R3\mathbb{R}^3, a line is a one-dimensional affine subspace defined by a support point x0x_0 and a single direction vector b1b_1. A plane is a two-dimensional affine subspace defined by x0x_0 and two linearly independent direction vectors b1,b2b_1, b_2. A hyperplane in R2\mathbb{R}^2 is a line, and in R3\mathbb{R}^3 it is a plane 45 46.

9.2 Inhomogeneous Systems of Linear Equations and Affine Subspaces

The solution set of an inhomogeneous system of linear equations Aλ=xA\lambda = x (where A∈Rm×nA \in \mathbb{R}^{m \times n} and x∈Rmx \in \mathbb{R}^m) is either empty or an affine subspace of Rn\mathbb{R}^n 46.

  • Dimension of solution space: The dimension of this affine subspace is n−rk(A)n - \text{rk}(A).
  • Hyperplane solution: The solution to λ1b1+⋯+λnbn=x\lambda_1 b_1 + \dots + \lambda_n b_n = x (with (λ1,…,λn)≠(0,…,0)(\lambda_1, \dots, \lambda_n) \neq (0, \dots, 0)) is a hyperplane in Rn\mathbb{R}^n.
  • Homogeneous systems: For homogeneous systems Ax=0Ax = 0, the solution is a vector subspace, which can be considered a special affine space with a support point x0=0x_0 = 0 46.

9.3 Affine Mappings

An affine mapping ϕ:V→W\phi: V \to W between two vector spaces VV and WW is defined as ϕ(x)=a+Φ(x)\phi(x) = a + \Phi(x), where Φ:V→W\Phi: V \to W is a linear mapping and a∈Wa \in W is the translation vector 47.

  • Composition: An affine mapping is the composition of a linear mapping Φ\Phi and a translation τ\tau in WW, such that ϕ=τ∘Φ\phi = \tau \circ \Phi. Both Φ\Phi and τ\tau are uniquely determined.
  • Composition of affine mappings: The composition of two affine mappings ϕ′:W→X\phi': W \to X and ϕ:V→W\phi: V \to W (i.e., ϕ′∘ϕ\phi' \circ \phi) is also an affine mapping.
  • Geometric structure preservation: If an affine mapping ϕ\phi is bijective, it preserves geometric structures, including dimension and parallelism 47.

10. Analytic Geometry

10.1 Norms 55 56

Norms quantify the length of vectors, representing the distance of a directed line segment's end from the origin in geometric terms. A norm is a function ∥⋅∥:V→R\|\cdot\|: V \to \mathbb{R} that assigns a length ∥x∥∈R\|x\| \in \mathbb{R} to each vector x, satisfying specific properties for all λ∈R\lambda \in \mathbb{R} and x, y $\in V$ 55.

  • Absolutely homogeneous: ∥λx∥=∣λ∣∥x∥\|\lambda x\| = |\lambda| \|x\|.
  • Triangle inequality: ∥x+y∥≤∥x∥+∥y∥\|x + y\| \le \|x\| + \|y\|, meaning the sum of any two sides of a triangle is greater than or equal to the third side.
  • Positive definite: ∥x∥≥0\|x\| \ge 0 and ∥x∥=0  ⟺  x=0\|x\| = 0 \iff x = 0 55.
Norm TypeDefinitionProperties
Manhattan Norm (ℓ1 norm)$$\x\
Euclidean Norm (ℓ2 norm)$$\x\

10.2 Inner Products

Inner products introduce geometric concepts like vector length, angle, and distance, and are crucial for determining vector orthogonality 56.

10.3 Dot Product

The dot product (or scalar product) in Rn\mathbb{R}^n is a specific type of inner product defined as x⊤y=∑i=1nxiyi\mathbf{x}^\top \mathbf{y} = \sum_{i=1}^n x_i y_i 56.

10.4 General Inner Products

A bilinear mapping Ω:V×V→R\Omega: V \times V \to \mathbb{R} is linear in each argument.

  • Ω(λx+ψy,z)=λΩ(x,z)+ψΩ(y,z)\Omega(\lambda x + \psi y, z) = \lambda \Omega(x, z) + \psi \Omega(y, z).
  • Ω(x,λy+ψz)=λΩ(x,y)+ψΩ(x,z)\Omega(x, \lambda y + \psi z) = \lambda \Omega(x, y) + \psi \Omega(x, z) 56.

An inner product is a positive definite, symmetric bilinear mapping Ω:V×V→R\Omega: V \times V \to \mathbb{R}, typically denoted as ⟨x,y⟩\langle x, y \rangle.

  • Symmetric: Ω(x,y)=Ω(y,x)\Omega(x, y) = \Omega(y, x) for all x, y $\in V$.
  • Positive definite: ∀x∈V∖{0}:Ω(x,x)>0\forall x \in V \setminus \{0\}: \Omega(x, x) > 0 and Ω(0,0)=0\Omega(0, 0) = 0 57.

An inner product space (V,⟨⋅,⋅⟩)(V, \langle \cdot, \cdot \rangle) is a vector space equipped with an inner product. If the dot product is used, it is called a Euclidean vector space 57.

📝 An inner product on R2\mathbb{R}^2 can be defined as ⟨x,y⟩:=x1y1−(x1y2+x2y1)+2x2y2\langle x, y \rangle:= x_1 y_1 - (x_1 y_2 + x_2 y_1) + 2x_2 y_2, which differs from the standard dot product 57.

10.5 Symmetric, Positive Definite Matrices

Symmetric, positive definite matrices are defined via the inner product and are crucial in machine learning. For an n-dimensional vector space V with an inner product ⟨⋅,⋅⟩\langle \cdot, \cdot \rangle and an ordered basis B, the inner product can be expressed as ⟨x,y⟩=x^⊤Ay^\langle x, y \rangle = \hat{x}^\top A \hat{y}, where x^,y^\hat{x}, \hat{y} are coordinate representations of x, y with respect to B, and A is a matrix with A_{ij}:= \langle b_i, b_j \rangleUSD 57.

A symmetric matrix A $\in \mathbb{R}^{n \times n}$ is symmetric, positive definite if ∀x∈V∖{0}:x⊤Ax>0\forall x \in V \setminus \{0\}: x^\top A x > 0. If ≥\ge holds, it is symmetric, positive semidefinite 58.

  • Null space: The null space (kernel) of a symmetric, positive definite matrix A contains only the zero vector, implying Ax $\ne 0$ if x $\ne 0$.
  • Diagonal elements: The diagonal elements a_{ii} of A are positive, as a_{ii} = e_i^\top A e_i > 0 58.

📝 The matrix A1=(9665)A_1 = \begin{pmatrix} 9 & 6 \\ 6 & 5 \end{pmatrix} is symmetric and positive definite because x⊤A1x=9x12+12x1x2+5x22=(3x1+2x2)2+x22>0x^\top A_1 x = 9x_1^2 + 12x_1x_2 + 5x_2^2 = (3x_1 + 2x_2)^2 + x_2^2 > 0 for all x $\ne 0$. In contrast, A2=(9663)A_2 = \begin{pmatrix} 9 & 6 \\ 6 & 3 \end{pmatrix} is symmetric but not positive definite, as x⊤A2x=(3x1+2x2)2−x22x^\top A_2 x = (3x_1 + 2x_2)^2 - x_2^2 can be negative (e.g., for x =^\top) 58.

10.6 Lengths and Distances

Inner products naturally induce a norm ∥x∥:=⟨x,x⟩\|x\|:= \sqrt{\langle x, x \rangle}, allowing for the computation of vector lengths. However, not all norms are induced by an inner product (e.g., the Manhattan norm) 59.

The Cauchy-Schwarz inequality states that for an inner product vector space (V,⟨⋅,⋅⟩)(V, \langle \cdot, \cdot \rangle), the induced norm ∥⋅∥\|\cdot\| satisfies ∣⟨x,y⟩∣≤∥x∥∥y∥\vert \langle x, y \rangle \vert \le \|x\| \|y\| 59.

📝 For x = ^\top \in \mathbb{R}^2, using the dot product, ∥x∥=12+12=2\|x\| = \sqrt{1^2 + 1^2} = \sqrt{2}. With a different inner product ⟨x,y⟩:=x1y1−12(x1y2+x2y1)+x2y2\langle x, y \rangle:= x_1 y_1 - \frac{1}{2}(x_1 y_2 + x_2 y_1) + x_2 y_2, the norm becomes ∥x∥=x12−x1x2+x22=1−1+1=1\|x\| = \sqrt{x_1^2 - x_1 x_2 + x_2^2} = \sqrt{1 - 1 + 1} = 1, indicating x is "shorter" with this inner product 1 59.

The distance between x and y in an inner product space (V,⟨⋅,⋅⟩)(V, \langle \cdot, \cdot \rangle) is defined as d(x,y):=∥x−y∥=⟨x−y,x−y⟩d(x, y):= \|x - y\| = \sqrt{\langle x - y, x - y \rangle}. If the dot product is used, this is called the Euclidean distance.

The mapping d: V \times V \to \mathbb{R} is called a metric 59 60.

Metrics satisfy the following properties:

  • Positive definite: d(x, y) $\ge 0$ for all x, y $\in V$ and d(x, y) = 0 $\iff x = y$.
  • Symmetric: d(x, y) = d(y, x) for all x, y $\in V$.
  • Triangle inequality: d(x, z) $\le d(x, y) + d(y, z) for all x, y, z $\in VUSD 60.

10.7 Angles and Orthogonality

Inner products define the angle ω\omega between two non-zero vectors x, y in an inner product space using the Cauchy-Schwarz inequality. The angle ω∈[0,π]\omega \in [0, \pi] is given by cos⁡ω=⟨x,y⟩∥x∥∥y∥\cos \omega = \frac{\langle x, y \rangle}{\|x\| \|y\|}.

This angle intuitively reflects the similarity of vector orientations 60.

📝 For x = ^\top and y = ^\top in R2\mathbb{R}^2, using the dot product, cos⁡ω=x⊤yx⊤xy⊤y=310\cos \omega = \frac{x^\top y}{\sqrt{x^\top x y^\top y}} = \frac{3}{\sqrt{10}}. The angle ω=arccos⁡(310)≈0.32\omega = \arccos(\frac{3}{\sqrt{10}}) \approx 0.32 radians or 18 degrees 1 2 61.

Two vectors x and y are orthogonal (x $\perp$ y) if and only if ⟨x,y⟩=0\langle x, y \rangle = 0. If, additionally, ∥x∥=1=∥y∥\|x\| = 1 = \|y\|, the vectors are orthonormal.

The zero vector is orthogonal to every vector. Orthogonality generalizes perpendicularity to inner product spaces 61.

📝 For x = ^\top and y =^\top in R2\mathbb{R}^2, the dot product ⟨x,y⟩=0\langle x, y \rangle = 0, so they are orthogonal (angle 90 degrees). However, using the inner product ⟨x,y⟩=x⊤(2001)y\langle x, y \rangle = x^\top \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix} y, ⟨x,y⟩=−1\langle x, y \rangle = -1, leading to cos⁡ω=−1/3\cos \omega = -1/3, so ω≈109.5\omega \approx 109.5 degrees, and they are not orthogonal. This demonstrates that orthogonality depends on the chosen inner product 1 61 62.

An orthogonal matrix A $\in \mathbb{R}^{n \times n}$ is a square matrix whose columns are orthonormal, satisfying AA^\top = I = A^\top A. This implies A^{-1} = A^\top.

  • Length preservation: Transformations by orthogonal matrices preserve the length of a vector x for the dot product: ∥Ax∥22=(Ax)⊤(Ax)=x⊤A⊤Ax=x⊤Ix=x⊤x=∥x∥22\|Ax\|_2^2 = (Ax)^\top (Ax) = x^\top A^\top Ax = x^\top Ix = x^\top x = \|x\|_2^2.
  • Angle preservation: The angle between any two vectors x, y is also preserved under transformation by an orthogonal matrix A. Orthogonal matrices represent rotations (with possible flips) 62.

10.8 Orthonormal Basis

An orthonormal basis (ONB) for an n-dimensional vector space V is a basis {b1,…,bn}\{b_1, \dots, b_n\} where ⟨bi,bj⟩=0\langle b_i, b_j \rangle = 0 for i $\ne$ j and ⟨bi,bi⟩=1\langle b_i, b_i \rangle = 1 for all i, j = 1, \dots, n. If only the orthogonality condition ⟨bi,bj⟩=0\langle b_i, b_j \rangle = 0 for i $\ne$ j is met, it is an orthogonal basis 63.

📝 The canonical (standard) basis for a Euclidean vector space Rn\mathbb{R}^n is an orthonormal basis when the inner product is the dot product. In R2\mathbb{R}^2, the vectors b1=(10),b2=(01)b_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad b_2 = \begin{pmatrix} 0 \\ 1 \end{pmatrix} form an orthonormal basis because b_1^\top b_2 = 0 and ∥b1∥=1=∥b2∥\|b_1\| = 1 = \|b_2\| 63.

The Gram-Schmidt process is a constructive method to iteratively build an orthonormal basis from a set of non-orthogonal, unnormalized basis vectors 63.

10.9 Orthogonal Complement

The orthogonal complement U^\perp of an M-dimensional subspace U within a D-dimensional vector space V is a (D-M)-dimensional subspace of V. It contains all vectors in V that are orthogonal to every vector in U.

  • Intersection: U \cap U^\perp = \{0\} 63.
  • Decomposition: Any vector x $\in V$ can be uniquely decomposed as x=∑m=1Mλmbm+∑j=1D−Mψjbj⊥x = \sum_{m=1}^M \lambda_m b_m + \sum_{j=1}^{D-M} \psi_j b_j^\perp where {b1,…,bM}\{b_1, \dots, b_M\} is a basis for U and {b1⊥,…,bD−M⊥}\{b_1^\perp, \dots, b_{D-M}^\perp\} is a basis for U^\perp 64.

The orthogonal complement can describe a plane U in a three-dimensional space using its normal vector w, which is orthogonal to U and spans U^\perp. Generally, orthogonal complements describe hyperplanes in n-dimensional vector and affine spaces 64.

10.10 Inner Product of Functions

The concept of an inner product can be generalized to functions, which can be thought of as vectors with an infinite number of entries. For two functions u: \mathbb{R} \to \mathbb{R} and v: \mathbb{R} \to \mathbb{R}, an inner product can be defined as the definite integral ⟨u,v⟩:=∫abu(x)v(x)dx\langle u, v \rangle:= \int_a^b u(x)v(x)dx 64.

  • If this integral evaluates to 0, the functions u and v are orthogonal.
  • This generalization leads to the concept of a Hilbert space 65.

📝 For u = \sin(x) and v = \cos(x), the integral ∫−ππsin⁡(x)cos⁡(x)dx\int_{-\pi}^{\pi} \sin(x)\cos(x)dx evaluates to 0 because sin⁡(x)cos⁡(x)\sin(x)\cos(x) is an odd function. Therefore, sin⁡(x)\sin(x) and cos⁡(x)\cos(x) are orthogonal functions over the interval [−π,π][-\pi, \pi]. The collection of functions {1,cos⁡(x),cos⁡(2x),… }\{1, \cos(x), \cos(2x), \dots\} is orthogonal when integrated from −π-\pi to π\pi, forming the basis for Fourier series 65.

10.11 Orthogonal Projections

Projections are linear transformations that map vectors onto a subspace. In machine learning, orthogonal projections are used for dimensionality reduction, retaining maximal information by minimizing the error between original and projected data 65 66.

A projection π:V→U\pi: V \to U (where U $\subseteq V$ is a subspace) is a linear mapping such that π2=π∘π=π\pi^2 = \pi \circ \pi = \pi. This property also applies to projection matrices P_\pi, where P_\pi^2 = P_\pi 66.

10.12 Projection onto One-Dimensional Subspaces (Lines)

To project a vector x $\in \mathbb{R}^n$ onto a one-dimensional subspace U spanned by a basis vector b $\in \mathbb{R}^n$, we seek πU(x)∈U\pi_U(x) \in U that is closest to x 66.

  • The segment πU(x)−x\pi_U(x) - x is orthogonal to U, meaning ⟨πU(x)−x,b⟩=0\langle \pi_U(x) - x, b \rangle = 0.
  • πU(x)\pi_U(x) is a multiple of b, so πU(x)=λb\pi_U(x) = \lambda b for some λ∈R\lambda \in \mathbb{R} 67.

The procedure to find the projection involves three steps (assuming the dot product as the inner product):

  1. Finding the coordinate λ\lambda: From ⟨x−λb,b⟩=0\langle x - \lambda b, b \rangle = 0, we get λ=⟨x,b⟩⟨b,b⟩=⟨b,x⟩∥b∥2\lambda = \frac{\langle x, b \rangle}{\langle b, b \rangle} = \frac{\langle b, x \rangle}{\|b\|^2}. For the dot product, λ=b⊤xb⊤b=b⊤x∥b∥2\lambda = \frac{b^\top x}{b^\top b} = \frac{b^\top x}{\|b\|^2}. If ∥b∥=1\|b\| = 1, then λ=b⊤x\lambda = b^\top x 67.
  2. Finding the projection point πU(x)∈U\pi_U(x) \in U: πU(x)=λb=⟨x,b⟩∥b∥2b\pi_U(x) = \lambda b = \frac{\langle x, b \rangle}{\|b\|^2} b. For the dot product, πU(x)=b⊤x∥b∥2b\pi_U(x) = \frac{b^\top x}{\|b\|^2} b. The length of the projection is ∥πU(x)∥=∣λ∣∥b∥=∣cos⁡ω∣∥x∥\|\pi_U(x)\| = |\lambda| \|b\| = |\cos \omega| \|x\|, where ω\omega is the angle between x and b.
  3. Finding the projection matrix P_\pi: Since πU(x)=Pπx\pi_U(x) = P_\pi x, for the dot product, πU(x)=bb⊤x∥b∥2=bb⊤∥b∥2x\pi_U(x) = b \frac{b^\top x}{\|b\|^2} = \frac{bb^\top}{\|b\|^2} x. Thus, Pπ=bb⊤∥b∥2P_\pi = \frac{bb^\top}{\|b\|^2}. P_\pi is a symmetric matrix of rank 1 68.

📝 To find the projection matrix P_\pi onto the line spanned by b=(212)b = \begin{pmatrix} 2 \\ 1 \\ 2 \end{pmatrix}, we compute Pπ=bb⊤b⊤b=19(212)(212)=19(424212424)P_\pi = \frac{bb^\top}{b^\top b} = \frac{1}{9} \begin{pmatrix} 2 \\ 1 \\ 2 \end{pmatrix} \begin{pmatrix} 2 & 1 & 2 \end{pmatrix} = \frac{1}{9} \begin{pmatrix} 4 & 2 & 4 \\ 2 & 1 & 2 \\ 4 & 2 & 4 \end{pmatrix}. For x=(121)x = \begin{pmatrix} 1 \\ 2 \\ 1 \end{pmatrix}, the projection is πU(x)=Pπx=19(424212424)(121)=19(10510)\pi_U(x) = P_\pi x = \frac{1}{9} \begin{pmatrix} 4 & 2 & 4 \\ 2 & 1 & 2 \\ 4 & 2 & 4 \end{pmatrix} \begin{pmatrix} 1 \\ 2 \\ 1 \end{pmatrix} = \frac{1}{9} \begin{pmatrix} 10 \\ 5 \\ 10 \end{pmatrix}. Applying P_\pi again to πU(x)\pi_U(x) yields πU(x)\pi_U(x) itself, confirming P_\pi^2 = P_\pi 69.

10.13 Projection onto General Subspaces

For orthogonal projections of vectors x $\in \mathbb{R}^n$ onto m-dimensional subspaces U $\subseteq \mathbb{R}^n$ (where m $\ge 1$), let (b1,…,bm)(b_1, \dots, b_m) be an ordered basis of U. Any projection πU(x)\pi_U(x) is a linear combination of these basis vectors: πU(x)=∑i=1mλibi=Bλ\pi_U(x) = \sum_{i=1}^m \lambda_i b_i = B\lambda, where B = [b_1, \dots, b_m $\in \mathbb{R}^{n \times m}$ and λ=[λ1,…,λm]⊤∈Rm\lambda = [\lambda_1, \dots, \lambda_m]^\top \in \mathbb{R}^m 69 70.

The three-step procedure (assuming the dot product) is:

  1. Find the coordinates λ1,…,λm\lambda_1, \dots, \lambda_m: The vector x - $\pi_U(x)$ must be orthogonal to all basis vectors of U. This leads to m simultaneous conditions: bi⊤(x−πU(x))=0for i=1,…,mb_i^\top (x - \pi_U(x)) = 0 \quad \text{for } i=1, \dots, m. In matrix form, B^\top (x - B\lambda) = 0, which simplifies to the normal equation: B⊤Bλ=B⊤xB^\top B \lambda = B^\top x. Since b_i are linearly independent, B^\top B $\in \mathbb{R}^{m \times m}$ is invertible, yielding λ=(B⊤B)−1B⊤x\lambda = (B^\top B)^{-1} B^\top x. The matrix (B⊤B)−1B⊤(B^\top B)^{-1} B^\top is called the pseudo-inverse of B 70.
  2. Find the projection πU(x)∈U\pi_U(x) \in U: Substitute λ\lambda back into πU(x)=Bλ\pi_U(x) = B\lambda: πU(x)=B(B⊤B)−1B⊤x\pi_U(x) = B(B^\top B)^{-1} B^\top x.
  3. Find the projection matrix P_\pi: From the expression for πU(x)\pi_U(x), the projection matrix is Pπ=B(B⊤B)−1B⊤P_\pi = B(B^\top B)^{-1} B^\top. This formula generalizes the 1D case 71.

The projection error (or reconstruction error) is the norm of the difference vector between the original vector and its projection: ∥x−πU(x)∥\|x - \pi_U(x)\|. Projections are used to find approximate solutions (least-squares solutions) to unsolvable linear systems Ax = b by projecting b onto the column space of A 72.

If the basis {b1,…,bk}\{b_1, \dots, b_k\} of U is an ONB, the projection simplifies significantly:

  • B^\top B = I.
  • λ=B⊤x\lambda = B^\top x.
  • πU(x)=BB⊤x\pi_U(x) = BB^\top x 72.

📝 For subspace `USDUSDU = \text{span}\left[\begin{pmatrix} 1 \ 1 \ 1 \end{pmatrix}, \begin{pmatrix} 1 \ 2

10.14 Gram-Schmidt orthogonalization

The Gram-Schmidt orthogonalization method is a constructive process to transform any basis (b1,…,bn)(b_1, \dots, b_n) of an nn-dimensional vector space VV into an orthogonal or orthonormal basis (u1,…,un)(u_1, \dots, u_n) of VV. This method ensures that the span of the original basis is preserved, i.e., span[b1,…,bn]=span[u1,…,un]\text{span}[b_1, \dots, b_n] = \text{span}[u_1, \dots, u_n] 73.

  • Procedure:
  • The first orthogonal vector u1u_1 is set equal to the first basis vector b1b_1: u1:=b1u_1:= b_1.
  • For subsequent vectors, uku_k is obtained by subtracting the orthogonal projection of bkb_k onto the subspace spanned by the previously constructed orthogonal vectors u1,…,uk−1u_1, \dots, u_{k-1} from bkb_k: uk:=bk−πspan[u1,…,uk−1](bk)u_k:= b_k - \pi_{\text{span}[u_1, \dots, u_{k-1}]}(b_k) for k=2,…,nk = 2, \dots, n.
  • This subtraction ensures that uku_k is orthogonal to the (k−1)(k-1)-dimensional subspace spanned by u1,…,uk−1u_1, \dots, u_{k-1}.
  • Orthonormal basis: If the constructed orthogonal vectors uku_k are normalized, an orthonormal basis (ONB) is obtained where ∥uk∥=1\lVert u_k \rVert = 1 for all kk 73.

📝 Given a basis (b1,b2)(b_1, b_2) of R2\mathbb{R}^2 with b1=(21)b_1 = \begin{pmatrix} 2 \\ 1 \end{pmatrix} and b2=(11)b_2 = \begin{pmatrix} 1 \\ 1 \end{pmatrix}, the Gram-Schmidt method (using the dot product) yields: u1:=b1=(21)u_1:= b_1 = \begin{pmatrix} 2 \\ 1 \end{pmatrix} u2:=b2−πspan[u1](b2)=b2−u1u1⊤∥u1∥2b2=(11)−(21)(21)22+12(11)=(11)−35(21)=(−1/52/5)u_2:= b_2 - \pi_{\text{span}[u_1]}(b_2) = b_2 - \frac{u_1 u_1^\top}{\lVert u_1 \rVert^2} b_2 = \begin{pmatrix} 1 \\ 1 \end{pmatrix} - \frac{\begin{pmatrix} 2 \\ 1 \end{pmatrix} \begin{pmatrix} 2 & 1 \end{pmatrix}}{2^2 + 1^2} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix} - \frac{3}{5} \begin{pmatrix} 2 \\ 1 \end{pmatrix} = \begin{pmatrix} -1/5 \\ 2/5 \end{pmatrix} 73 74.

10.15 Projection onto affine subspaces

Projecting a vector onto an affine subspace L=x0+UL = x_0 + U (where x0x_0 is a support point and UU is a vector subspace) can be transformed into a projection onto a vector subspace 74.

  • Method:
  • Shift the problem by subtracting the support point x0x_0 from the vector xx and the affine space LL, resulting in L−x0=UL - x_0 = U, which is a vector subspace.
  • Compute the orthogonal projection of the shifted vector (x−x0)(x - x_0) onto the vector subspace UU, denoted as πU(x−x0)\pi_U(x - x_0).
  • Translate this projection back into the affine space LL by adding x0x_0, yielding the orthogonal projection onto the affine space: πL(x)=x0+πU(x−x0)\pi_L(x) = x_0 + \pi_U(x - x_0).
  • Distance: The distance from a vector xx to an affine space LL is equivalent to the distance from the shifted vector (x−x0)(x - x_0) to the direction space UU: d(x,L)=∥x−πL(x)∥=∥x−(x0+πU(x−x0))∥=d(x−x0,U)d(x, L) = \lVert x - \pi_L(x) \rVert = \lVert x - (x_0 + \pi_U(x - x_0)) \rVert = d(x - x_0, U) 74.

10.16 Rotations

A rotation is a linear mapping (an automorphism of a Euclidean vector space) that rotates a plane by an angle θ\theta about the origin, which remains a fixed point. For a positive angle θ>0\theta > 0, the rotation is conventionally counterclockwise.

Rotations are characterized by preserving lengths and angles, a property of linear mappings with orthogonal transformation matrices 75 78.

10.17 Rotations in R2\mathbb{R}^2

In R2\mathbb{R}^2, a rotation transforms the standard basis vectors e1=(10)e_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix} and e2=(01)e_2 = \begin{pmatrix} 0 \\ 1 \end{pmatrix} into new vectors Φ(e1)\Phi(e_1) and Φ(e2)\Phi(e_2). These rotated vectors remain linearly independent, forming a new basis for R2\mathbb{R}^2, indicating that rotation performs a basis change 76.

  • Rotation matrix: The rotation matrix R(θ)R(\theta) for a counterclockwise rotation by an angle θ\theta is constructed from the images of the standard basis vectors: Φ(e1)=(cos⁡θsin⁡θ)\Phi(e_1) = \begin{pmatrix} \cos \theta \\ \sin \theta \end{pmatrix} Φ(e2)=(−sin⁡θcos⁡θ)\Phi(e_2) = \begin{pmatrix} -\sin \theta \\ \cos \theta \end{pmatrix} R(θ)=(cos⁡θ−sin⁡θsin⁡θcos⁡θ)R(\theta) = \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix} 76.

10.18 Rotations in R3\mathbb{R}^3 77

In R3\mathbb{R}^3, rotations occur about a one-dimensional axis, affecting a two-dimensional plane. The convention for "counterclockwise" rotation about an axis is defined by looking at the axis "head on, from the end toward the origin" 76.

Axis of RotationRotation Matrix R(θ)R(\theta)
e1e_1-axis (rotation in e2e3e_2e_3 plane)R1(θ)=(1000cos⁡θ−sin⁡θ0sin⁡θcos⁡θ)R_1(\theta) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \end{pmatrix}
e2e_2-axis (rotation in e1e3e_1e_3 plane)R2(θ)=(cos⁡θ0sin⁡θ010−sin⁡θ0cos⁡θ)R_2(\theta) = \begin{pmatrix} \cos \theta & 0 & \sin \theta \\ 0 & 1 & 0 \\ -\sin \theta & 0 & \cos \theta \end{pmatrix}
e3e_3-axis (rotation in e1e2e_1e_2 plane)R3(θ)=(cos⁡θ−sin⁡θ0sin⁡θcos⁡θ0001)R_3(\theta) = \begin{pmatrix} \cos \theta & -\sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{pmatrix}

10.19 Rotations in nn dimensions

Generalizing rotations to nn-dimensional Euclidean vector spaces involves fixing n−2n-2 dimensions and restricting the rotation to a two-dimensional plane within the nn-dimensional space 77.

  • Givens rotation: A Givens rotation Rij(θ)R_{ij}(\theta) is an n×nn \times n identity matrix InI_n with specific entries modified to perform a rotation in the plane spanned by the ii-th and jj-th standard basis vectors 77.
  • The matrix Rij(θ)R_{ij}(\theta) has rii=cos⁡θr_{ii} = \cos \theta, rij=−sin⁡θr_{ij} = -\sin \theta, rji=sin⁡θr_{ji} = \sin \theta, and rjj=cos⁡θr_{jj} = \cos \theta, with all other entries being those of the identity matrix.
  • For n=2n=2, this reduces to the standard 2D rotation matrix R(θ)R(\theta) 78.

10.20 Properties of rotations

Rotations, as orthogonal matrices, possess several key properties 78.

  • Distance preservation: Rotations maintain the distance between any two points, meaning ∥x−y∥=∥Rθ(x)−Rθ(y)∥\lVert x - y \rVert = \lVert R_\theta(x) - R_\theta(y) \rVert.
  • Angle preservation: The angle between two vectors xx and yy remains unchanged after rotation, i.e., the angle between RθxR_\theta x and RθyR_\theta y is equal to the angle between xx and yy.
  • Commutativity:
  • Rotations in three or more dimensions are generally not commutative, meaning the order of application matters.
  • In two dimensions, vector rotations are commutative, R(ϕ)R(θ)=R(θ)R(ϕ)R(\phi)R(\theta) = R(\theta)R(\phi), and form an Abelian group if they rotate about the same point (e.g., the origin) 78.

11. Matrix Decompositions

11.1 Determinant and Trace

The determinant, denoted as det⁡(A)\det(A) or ∣A∣|A|, is a function defined for square matrices A∈Rn×nA \in \mathbb{R}^{n \times n} that maps the matrix to a real number, characterizing its overall properties. It represents the signed volume of the nn-dimensional parallelepiped formed by the columns of the matrix 83 85.

  • Invertibility: A square matrix AA is invertible if and only if det⁡(A)≠0\det(A) \neq 0 84.
  • Geometric interpretation: The absolute value of the determinant is the volume of the parallelepiped spanned by the matrix's column vectors. The sign indicates the orientation of these vectors relative to the standard basis.
  • Triangular matrices: For an upper-triangular or lower-triangular matrix TT, its determinant is the product of its diagonal elements: det⁡(T)=∏i=1nTii\det(T) = \prod_{i=1}^n T_{ii} 85.
Matrix SizeDeterminant Formula
n=1n=1det⁡(A)=a11\det(A) = a_{11}
n=2n=2det⁡(A)=a11a22−a12a21\det(A) = a_{11}a_{22} - a_{12}a_{21}
n=3n=3 (Sarrus' rule)a11a22a33+a21a32a13+a31a12a23−a31a22a13−a11a32a23−a21a12a33a_{11}a_{22}a_{33} + a_{21}a_{32}a_{13} + a_{31}a_{12}a_{23} - a_{31}a_{22}a_{13} - a_{11}a_{32}a_{23} - a_{21}a_{12}a_{33}

The Laplace expansion provides a recursive method to compute the determinant of an n×nn \times n matrix by reducing it to determinants of (n−1)×(n−1)(n-1) \times (n-1) submatrices 86.

  • Laplace expansion: For a matrix A∈Rn×nA \in \mathbb{R}^{n \times n}:
  • Expansion along column jj: det⁡(A)=∑k=1n(−1)k+jakjdet⁡(Ak,j)\det(A) = \sum_{k=1}^n (-1)^{k+j} a_{kj} \det(A_{k,j}).
  • Expansion along row jj: det⁡(A)=∑k=1n(−1)k+jajkdet⁡(Aj,k)\det(A) = \sum_{k=1}^n (-1)^{k+j} a_{jk} \det(A_{j,k}).
  • Minor: det⁡(Ak,j)\det(A_{k,j}) is the determinant of the submatrix Ak,jA_{k,j} obtained by deleting row kk and column jj.
  • Cofactor: (−1)k+jdet⁡(Ak,j)(-1)^{k+j} \det(A_{k,j}) is the cofactor 86.

📝 For A=(123010031)A = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 0 \\ 0 & 3 & 1 \end{pmatrix}, expanding along the first row yields det⁡(A)=1⋅det⁡(1031)−2⋅det⁡(0001)+3⋅det⁡(0103)=1(1−0)−2(0−0)+3(0−0)=1\det(A) = 1 \cdot \det \begin{pmatrix} 1 & 0 \\ 3 & 1 \end{pmatrix} - 2 \cdot \det \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} + 3 \cdot \det \begin{pmatrix} 0 & 1 \\ 0 & 3 \end{pmatrix} = 1(1-0) - 2(0-0) + 3(0-0) = 1 86 87.

PropertyDescription
Product ruledet⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A)\det(B)
Transpose invariancedet⁡(A)=det⁡(A⊤)\det(A) = \det(A^\top)
Inverse determinantdet⁡(A−1)=1/det⁡(A)\det(A^{-1}) = 1/\det(A) if AA is invertible
Similarity invarianceSimilar matrices have the same determinant, making it invariant to basis choice
Row/column operationsAdding a multiple of one row/column to another does not change det⁡(A)\det(A)
Scalar multiplicationdet⁡(λA)=λndet⁡(A)\det(\lambda A) = \lambda^n \det(A)
Row/column swapSwapping two rows/columns changes the sign of det⁡(A)\det(A)

The trace of a square matrix A∈Rn×nA \in \mathbb{R}^{n \times n}, denoted tr(A)\text{tr}(A), is the sum of its diagonal elements: tr(A):=∑i=1naii\text{tr}(A):= \sum_{i=1}^n a_{ii} 87 88.

  • Properties of trace:
  • tr(A+B)=tr(A)+tr(B)\text{tr}(A + B) = \text{tr}(A) + \text{tr}(B).
  • tr(αA)=αtr(A)\text{tr}(\alpha A) = \alpha \text{tr}(A).
  • tr(In)=n\text{tr}(I_n) = n.
  • tr(AB)=tr(BA)\text{tr}(AB) = \text{tr}(BA) for A∈Rn×k,B∈Rk×nA \in \mathbb{R}^{n \times k}, B \in \mathbb{R}^{k \times n}.
  • Cyclic permutation invariance: tr(AKL)=tr(KLA)\text{tr}(AKL) = \text{tr}(KLA) for matrices A∈Ra×k,K∈Rk×l,L∈Rl×aA \in \mathbb{R}^{a \times k}, K \in \mathbb{R}^{k \times l}, L \in \mathbb{R}^{l \times a}.
  • Basis independence: The trace of a linear mapping Φ\Phi is independent of the choice of basis for its transformation matrix 88.

The characteristic polynomial of a square matrix A∈Rn×nA \in \mathbb{R}^{n \times n} is defined as pA(λ):=det⁡(A−λI)p_A(\lambda):= \det(A - \lambda I), where λ∈R\lambda \in \mathbb{R} and II is the identity matrix 88.

  • It can be expressed as pA(λ)=c0+c1λ+⋯+cn−1λn−1+(−1)nλnp_A(\lambda) = c_0 + c_1\lambda + \dots + c_{n-1}\lambda^{n-1} + (-1)^n\lambda^n 88.
  • The constant term c0=det⁡(A)c_0 = \det(A).
  • The coefficient cn−1=(−1)n−1tr(A)c_{n-1} = (-1)^{n-1}\text{tr}(A) 89.

11.2 Eigenvalues and Eigenvectors

Eigenvalues and eigenvectors characterize how a linear mapping transforms specific vectors 89.

  • Eigenvalue equation: For a square matrix A∈Rn×nA \in \mathbb{R}^{n \times n}, λ∈R\lambda \in \mathbb{R} is an eigenvalue and x∈Rn∖{0}x \in \mathbb{R}^n \setminus \{0\} is its corresponding eigenvector if Ax=λxAx = \lambda x.
  • Collinearity: If xx is an eigenvector for eigenvalue λ\lambda, then any non-zero scalar multiple cxcx is also an eigenvector for the same λ\lambda.
  • Eigenvalue condition: λ\lambda is an eigenvalue of AA if and only if det⁡(A−λI)=0\det(A - \lambda I) = 0, meaning λ\lambda is a root of the characteristic polynomial pA(λ)p_A(\lambda) 89.
  • Algebraic multiplicity: The number of times an eigenvalue λi\lambda_i appears as a root in the characteristic polynomial.
  • Eigenspace: For an eigenvalue λ\lambda, the set of all eigenvectors associated with λ\lambda forms a subspace of Rn\mathbb{R}^n, denoted EλE_\lambda. It is the null space of (A−λI)(A - \lambda I).
  • Eigenspectrum (spectrum): The set of all eigenvalues of AA.
  • Geometric interpretation: An eigenvector points in a direction that is stretched by the linear mapping, and the eigenvalue is the scaling factor. A negative eigenvalue indicates a flipped direction 90.

📝 For the identity matrix I∈Rn×nI \in \mathbb{R}^{n \times n}, its characteristic polynomial is pI(λ)=det⁡(I−λI)=(1−λ)n=0p_I(\lambda) = \det(I - \lambda I) = (1-\lambda)^n = 0. This yields a single eigenvalue λ=1\lambda = 1 with algebraic multiplicity nn. Any non-zero vector x∈Rnx \in \mathbb{R}^n satisfies Ix=1xIx = 1x, so all nn standard basis vectors are eigenvectors, and the eigenspace E1E_1 spans nn dimensions 90.

PropertyDescription
TransposeAA and A⊤A^\top have the same eigenvalues, but not necessarily the same eigenvectors
EigenspaceEλ=ker(A−λI)E_\lambda = \text{ker}(A - \lambda I)
SimilaritySimilar matrices have the same eigenvalues, making them invariant to basis change
Symmetric, positive definite matricesAlways have positive, real eigenvalues

The process for computing eigenvalues and eigenvectors involves finding the roots of the characteristic polynomial and then solving the homogeneous system (A−λI)x=0(A - \lambda I)x = 0 for each eigenvalue 91.

📝 To find eigenvalues and eigenvectors for A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}:

  1. Characteristic Polynomial: pA(λ)=det⁡(4−λ123−λ)=(4−λ)(3−λ)−2=λ2−7λ+10=(λ−2)(λ−5)p_A(\lambda) = \det \begin{pmatrix} 4-\lambda & 1 \\ 2 & 3-\lambda \end{pmatrix} = (4-\lambda)(3-\lambda) - 2 = \lambda^2 - 7\lambda + 10 = (\lambda-2)(\lambda-5).
  2. Eigenvalues: The roots are λ1=2\lambda_1 = 2 and λ2=5\lambda_2 = 5.
  3. Eigenvectors and Eigenspaces:
  • For λ1=5\lambda_1 = 5: (A−5I)x=(−112−2)(x1x2)=(00)(A - 5I)x = \begin{pmatrix} -1 & 1 \\ 2 & -2 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}. This yields −x1+x2=0-x_1 + x_2 = 0, so x1=x2x_1 = x_2. The eigenspace is E5=span[(11)]E_5 = \text{span}\left[\begin{pmatrix} 1 \\ 1 \end{pmatrix}\right].
  • For λ2=2\lambda_2 = 2: (A−2I)x=(2121)(x1x2)=(00)(A - 2I)x = \begin{pmatrix} 2 & 1 \\ 2 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}. This yields 2x1+x2=02x_1 + x_2 = 0, so x2=−2x1x_2 = -2x_1. The eigenspace is E2=span[(1−2)]E_2 = \text{span}\left[\begin{pmatrix} 1 \\ -2 \end{pmatrix}\right] 91 92.

The geometric multiplicity of an eigenvalue λi\lambda_i is the number of linearly independent eigenvectors associated with it, which is the dimensionality of its eigenspace 92.

  • The geometric multiplicity must be at least one and cannot exceed the algebraic multiplicity 92.
  • A matrix is defective if it has fewer than nn linearly independent eigenvectors, meaning the sum of the dimensions of its eigenspaces is less than nn. This occurs when an eigenvalue's geometric multiplicity is less than its algebraic multiplicity 95.

The spectral theorem states that if a matrix A∈Rn×nA \in \mathbb{R}^{n \times n} is symmetric, there exists an orthonormal basis of eigenvectors for the corresponding vector space, and all eigenvalues are real 95.

  • This implies that a symmetric matrix AA can be eigendecomposed as A=PDP⊤A = PDP^\top, where DD is a diagonal matrix of eigenvalues and PP is an orthogonal matrix whose columns are the eigenvectors 95.
  • If eigenvectors associated with the same eigenvalue are not orthogonal, an orthogonal basis can be constructed using methods like the Gram-Schmidt algorithm 96.
CharacteristicRelationship to Eigenvalues
DeterminantProduct of eigenvalues: det⁡(A)=∏i=1nλi\det(A) = \prod_{i=1}^n \lambda_i
TraceSum of eigenvalues: tr(A)=∑i=1nλi\text{tr}(A) = \sum_{i=1}^n \lambda_i

📝 For a matrix A∈R2×2A \in \mathbb{R}^{2 \times 2} with two linearly independent, orthonormal eigenvectors x1,x2x_1, x_2, the transformation AA maps these to v1=λ1x1v_1 = \lambda_1 x_1 and v2=λ2x2v_2 = \lambda_2 x_2. The area of the unit square spanned by x1,x2x_1, x_2 changes by a factor of ∣λ1λ2∣|\lambda_1 \lambda_2|, which is ∣det⁡(A)∣|\det(A)|. The perimeter changes by 2(∣λ1∣+∣λ2∣)2(|\lambda_1| + |\lambda_2|), relating to the sum of absolute eigenvalues 97.

11.3 Cholesky Decomposition

The Cholesky decomposition (or Cholesky factorization) is a square-root-like operation for symmetric, positive definite matrices 98.

  • Theorem 4.18: A symmetric, positive definite matrix AA can be uniquely factorized into a product A=LL⊤A = LL^\top, where LL is a lower-triangular matrix with positive diagonal elements.
  • Cholesky factor: The matrix LL is called the Cholesky factor of AA 98.

📝 For a symmetric, positive definite matrix A∈R3×3A \in \mathbb{R}^{3 \times 3}, its Cholesky factorization A=LL⊤A = LL^\top is: A=(a11a21a31a21a22a32a31a32a33)=(l1100l21l220l31l32l33)(l11l21l310l22l3200l33)=(l112l21l11l31l11l21l11l212+l222l31l21+l32l22l31l11l31l21+l32l22l312+l322+l332)A = \begin{pmatrix} a_{11} & a_{21} & a_{31} \\ a_{21} & a_{22} & a_{32} \\ a_{31} & a_{32} & a_{33} \end{pmatrix} = \begin{pmatrix} l_{11} & 0 & 0 \\ l_{21} & l_{22} & 0 \\ l_{31} & l_{32} & l_{33} \end{pmatrix} \begin{pmatrix} l_{11} & l_{21} & l_{31} \\ 0 & l_{22} & l_{32} \\ 0 & 0 & l_{33} \end{pmatrix} = \begin{pmatrix} l_{11}^2 & l_{21}l_{11} & l_{31}l_{11} \\ l_{21}l_{11} & l_{21}^2 + l_{22}^2 & l_{31}l_{21} + l_{32}l_{22} \\ l_{31}l_{11} & l_{31}l_{21} + l_{32}l_{22} & l_{31}^2 + l_{32}^2 + l_{33}^2 \end{pmatrix} 98.

11.4 Eigendecomposition and diagonalization

A diagonal matrix is a square matrix where all off-diagonal elements are zero, simplifying computations for determinants, powers, and inverses. A matrix A∈Rn×nA \in \mathbb{R}^{n \times n} is diagonalizable if it is similar to a diagonal matrix DD, meaning there exists an invertible matrix P∈Rn×nP \in \mathbb{R}^{n \times n} such that D=P−1APD = P^{-1}AP.

This transformation expresses the same linear mapping in a basis composed of AA's eigenvectors 99 100.

  • Eigendecomposition theorem: A square matrix A∈Rn×nA \in \mathbb{R}^{n \times n} can be factored into A=PDP−1A = PDP^{-1} if and only if its eigenvectors form a basis of Rn\mathbb{R}^n.
  • Components:
  • PP: An invertible matrix whose columns are the nn linearly independent eigenvectors of AA.
  • DD: A diagonal matrix whose diagonal entries are the corresponding eigenvalues of AA 100.
  • Symmetric matrices: A symmetric matrix S∈Rn×nS \in \mathbb{R}^{n \times n} can always be diagonalized, and its eigenvectors form an orthonormal basis, making PP an orthogonal matrix such that D=PTAPD = P^TAP 101.
  • Applications:
  • Matrix powers: Ak=(PDP−1)k=PDkP−1A^k = (PDP^{-1})^k = PD^kP^{-1}, where DkD^k is computed by raising each diagonal element to the power kk.
  • Determinant computation: det⁡(A)=det⁡(PDP−1)=det⁡(P)det⁡(D)det⁡(P−1)=det⁡(D)=∏idii\det(A) = \det(PDP^{-1}) = \det(P)\det(D)\det(P^{-1}) = \det(D) = \prod_i d_{ii}, which is efficient as DD is diagonal 102 103.

📝 For A=(5/2−2−25/2)A = \begin{pmatrix} 5/2 & -2 \\ -2 & 5/2 \end{pmatrix}, the eigenvalues are λ1=7/2\lambda_1 = 7/2 and λ2=3/2\lambda_2 = 3/2, with corresponding normalized eigenvectors p1=12(1−1)p_1 = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix} and p2=12(11)p_2 = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix}. The matrix P=12(11−11)P = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix} and D=(7/2003/2)D = \begin{pmatrix} 7/2 & 0 \\ 0 & 3/2 \end{pmatrix}, so A=PDP−1A = PDP^{-1} 102.

11.5 Geometric intuition for the eigendecomposition

The eigendecomposition A=PDP−1A = PDP^{-1} can be interpreted as a sequence of linear transformations 101.

  • Basis change (P−1P^{-1}): Transforms vectors from the standard basis into the eigenbasis of AA.
  • Scaling (DD): Scales the vectors along the remapped orthogonal eigenvectors by their respective eigenvalues λi\lambda_i.
  • Inverse basis change (PP): Transforms the scaled vectors back into the standard coordinate frame 101.

11.6 Singular value decomposition (SVD)

The singular value decomposition (SVD) is a fundamental matrix decomposition applicable to all matrices, including rectangular ones, and always exists. It quantifies the geometric change between the domain and codomain of a linear mapping 103.

  • SVD theorem: For a rectangular matrix A∈Rm×nA \in \mathbb{R}^{m \times n} of rank rr, its SVD is A=UΣVTA = U\Sigma V^T.
  • U∈Rm×mU \in \mathbb{R}^{m \times m}: An orthogonal matrix with column vectors uiu_i (left-singular vectors).
  • V∈Rn×nV \in \mathbb{R}^{n \times n}: An orthogonal matrix with column vectors vjv_j (right-singular vectors).
  • Σ∈Rm×n\Sigma \in \mathbb{R}^{m \times n}: A rectangular diagonal matrix with non-negative diagonal entries σi\sigma_i (singular values), ordered such that σ1≥σ2≥⋯≥σr≥0\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r \ge 0.
  • Singular value matrix Σ\Sigma:
  • It is unique and has the same dimensions as AA 103.
  • If m>nm > n, Σ\Sigma has a diagonal submatrix up to row nn and then consists of zero row vectors.
  • If m<nm < n, Σ\Sigma has a diagonal structure up to column mm and then consists of zero columns 104.

11.7 Geometric intuitions for the SVD

The SVD of a matrix AA can be interpreted as a decomposition of a linear mapping Φ:Rn→Rm\Phi: \mathbb{R}^n \to \mathbb{R}^m into three sequential operations 104.

  • Basis change in domain (VTV^T): Transforms vectors from the standard basis in Rn\mathbb{R}^n to an orthonormal basis defined by the right-singular vectors vjv_j.
  • Scaling and dimensionality adjustment (Σ\Sigma): Scales the new coordinates by the singular values σi\sigma_i and maps from Rn\mathbb{R}^n to Rm\mathbb{R}^m, potentially adding or deleting dimensions.
  • Basis change in codomain (UU): Transforms the scaled vectors from an orthonormal basis in Rm\mathbb{R}^m to the standard basis in Rm\mathbb{R}^m 104 105.

📝 When mapping a square grid of vectors X∈R2X \in \mathbb{R}^2 using A=UΣVTA = U\Sigma V^T, VTV^T first rotates XX. Then, Σ\Sigma scales these rotated vectors and maps them to R3\mathbb{R}^3, where they lie in the x1x_1-x2x_2 plane. Finally, UU performs a rotation within R3\mathbb{R}^3, moving the vectors out of the x1x_1-x2x_2 plane while remaining on a plane 105 106.

11.8 Construction of the SVD

The SVD of A∈Rm×nA \in \mathbb{R}^{m \times n} is constructed by finding two sets of orthonormal bases, U=(u1,…,um)U = (u_1, \dots, u_m) for the codomain Rm\mathbb{R}^m and V=(v1,…,vn)V = (v_1, \dots, v_n) for the domain Rn\mathbb{R}^n 107.

  • Right-singular vectors (VV):
  • Form an orthonormal basis for Rn\mathbb{R}^n.
  • They are the eigenvectors of the symmetric, positive semidefinite matrix ATA∈Rn×nA^TA \in \mathbb{R}^{n \times n}.
  • If ATA=VDVTA^TA = VDV^T, then VV consists of the eigenvectors of ATAA^TA, and the eigenvalues λi\lambda_i of ATAA^TA are the squared singular values σi2\sigma_i^2 of AA 107.
  • Left-singular vectors (UU):
  • Form an orthonormal basis for Rm\mathbb{R}^m.
  • They are the eigenvectors of the symmetric matrix AAT∈Rm×mAA^T \in \mathbb{R}^{m \times m}.
  • The nonzero eigenvalues of AATAA^T are the same as those of ATAA^TA, which are the squared singular values σi2\sigma_i^2.
  • Linking UU and VV: The left-singular vectors uiu_i are obtained by normalizing the images of the right-singular vectors viv_i under AA: ui=Avi∥Avi∥=1σiAviu_i = \frac{Av_i}{\|Av_i\|} = \frac{1}{\sigma_i}Av_i. This leads to the singular value equation: Avi=σiuiAv_i = \sigma_i u_i for i=1,…,ri=1, \dots, r 108.
  • Full SVD: Concatenating viv_i into VV and uiu_i into UU yields AV=UΣAV = U\Sigma, which, by right-multiplying with VTV^T, gives A=UΣVTA = U\Sigma V^T 109.

📝 To compute the SVD of A=(1−2)A = \begin{pmatrix} 1 \\ -2 \end{pmatrix}, first compute ATA=(5−2−25)A^TA = \begin{pmatrix} 5 & -2 \\ -2 & 5 \end{pmatrix}. Its eigenvalues are λ1=6\lambda_1 = 6 and λ2=1\lambda_2 = 1, so singular values are σ1=6\sigma_1 = \sqrt{6} and σ2=1\sigma_2 = 1. The eigenvectors of ATAA^TA form V=(5/30−2/30−2/305/30)V = \begin{pmatrix} 5/\sqrt{30} & -2/\sqrt{30} \\ -2/\sqrt{30} & 5/\sqrt{30} \end{pmatrix}. The singular value matrix is Σ=(6001)\Sigma = \begin{pmatrix} \sqrt{6} & 0 \\ 0 & 1 \end{pmatrix}. Finally, u1=1σ1Av1=(1/5−2/5)u_1 = \frac{1}{\sigma_1}Av_1 = \begin{pmatrix} 1/\sqrt{5} \\ -2/\sqrt{5} \end{pmatrix} and u2=1σ2Av2=(2/51/5)u_2 = \frac{1}{\sigma_2}Av_2 = \begin{pmatrix} 2/\sqrt{5} \\ 1/\sqrt{5} \end{pmatrix}, forming U=(1/52/5−2/51/5)U = \begin{pmatrix} 1/\sqrt{5} & 2/\sqrt{5} \\ -2/\sqrt{5} & 1/\sqrt{5} \end{pmatrix} 109 110.

11.9 Eigenvalue decomposition vs. singular value decomposition

The eigendecomposition and SVD are both matrix factorization techniques, but they differ in their applicability and properties 110.

FeatureEigendecomposition (A=PDP−1A = PDP^{-1})Singular Value Decomposition (A=UΣVTA = U\Sigma V^T)
Matrix typeOnly for square matrices A∈Rn×nA \in \mathbb{R}^{n \times n}For any matrix A∈Rm×nA \in \mathbb{R}^{m \times n}
ExistenceExists only if eigenvectors form a basis of Rn\mathbb{R}^nAlways exists
Orthogonality of basis vectorsColumns of PP are not necessarily orthogonalColumns of UU and VV are orthonormal (rotations)
Domain and codomainOperates within the same vector spaceDomain and codomain can be different dimensions
Inverse relationship of basis matricesPP and P−1P^{-1} are inverses of each otherUU and VV are generally not inverses of each other
Diagonal matrix entriesDiagonal entries of DD (eigenvalues) can be complex or negativeDiagonal entries of Σ\Sigma (singular values) are always real and non-negative
Relationship to ATAA^TA and AATAA^T—Left-singular vectors of AA are eigenvectors of AATAA^T; Right-singular vectors of AA are eigenvectors of ATAA^TA; Nonzero singular values of AA are square roots of nonzero eigenvalues of AATAA^T and ATAA^TA

For symmetric matrices A∈Rn×nA \in \mathbb{R}^{n \times n}, the eigenvalue decomposition and SVD are identical 111.

11.10 Matrix approximation

The SVD allows for approximating a matrix AA with a sum of simpler, low-rank matrices, which is computationally cheaper than the full SVD 113.

  • Rank-1 matrix construction: A rank-1 matrix Ai∈Rm×nA_i \in \mathbb{R}^{m \times n} is formed by the outer product of the ii-th left-singular vector uiu_i and the ii-th right-singular vector viv_i: Ai:=uiviTA_i:= u_i v_i^T 113.
  • Full rank decomposition: A matrix A∈Rm×nA \in \mathbb{R}^{m \times n} of rank rr can be written as a sum of rr rank-1 matrices, weighted by their singular values: A=∑i=1rσiuiviT=∑i=1rσiAiA = \sum_{i=1}^r \sigma_i u_i v_i^T = \sum_{i=1}^r \sigma_i A_i.
  • Rank-kk approximation: A rank-kk approximation A^(k)\hat{A}^{(k)} of AA is obtained by summing only the first kk terms (where k<rk < r): A^(k):=∑i=1kσiuiviT=∑i=1kσiAi\hat{A}^{(k)}:= \sum_{i=1}^k \sigma_i u_i v_i^T = \sum_{i=1}^k \sigma_i A_i.
  • This approximation has rank kk.
  • It significantly reduces the number of values needed to represent the matrix, enabling data compression 114.

📝 An image represented by a 1432×19101432 \times 1910 matrix requires 2,735,1202,735,120 numbers. A rank-5 approximation using SVD requires storing five singular values and five left- and right-singular vectors, totaling 5×(1432+1910+1)=16,7155 \times (1432 + 1910 + 1) = 16,715 numbers, which is about 0.6%0.6\% of the original data 114.

11.11 Spectral norm and Eckart-Young theorem

The spectral norm of a matrix A∈Rm×nA \in \mathbb{R}^{m \times n} is defined as ∥A∥2:=max⁡x∥Ax∥2∥x∥2\|A\|_2:= \max_x \frac{\|Ax\|_2}{\|x\|_2} for x∈Rn∖{0}x \in \mathbb{R}^n \setminus \{0\} 115.

  • Property: The spectral norm of AA is equal to its largest singular value σ1\sigma_1.
  • Eckart-Young theorem: For a rank-rr matrix A∈Rm×nA \in \mathbb{R}^{m \times n} and a rank-kk matrix B∈Rm×nB \in \mathbb{R}^{m \times n} (where k≤rk \le r), the rank-kk approximation A^(k)=∑i=1kσiuiviT\hat{A}^{(k)} = \sum_{i=1}^k \sigma_i u_i v_i^T is the best possible rank-kk approximation of AA in terms of minimizing the spectral norm of the error.
  • A^(k)=argminrk(B)=k∥A−B∥2\hat{A}^{(k)} = \text{argmin}_{\text{rk}(B)=k} \|A - B\|_2.
  • The error of this approximation is ∥A−A^(k)∥2=σk+1\|A - \hat{A}^{(k)}\|_2 = \sigma_{k+1}.
  • Interpretation: The SVD provides a principled way to project a full-rank matrix onto a lower-dimensional space of rank-at-most-kk matrices, minimizing the approximation error with respect to the spectral norm 115.

11.12 Low-rank approximation and the Eckart-Young theorem

The Eckart-Young theorem states that Singular Value Decomposition (SVD) can optimally reduce a rank-rr matrix AA to a rank-kk matrix A^\hat{A} in the spectral norm sense, providing the best rank-kk approximation. This approximation is a form of lossy compression, where the difference between the original matrix and its approximation is minimized 116.

  • Approximation error: The difference between AA and A^(k)\hat{A}^{(k)} is the sum of the remaining rank-1 matrices, A−A^(k)=∑i=k+1rσiuivi⊤A - \hat{A}^{(k)} = \sum_{i=k+1}^{r} \sigma_i u_i v_i^\top.
  • Spectral norm: The spectral norm of the difference matrix, ∥A−A^(k)∥2\left\|A - \hat{A}^{(k)}\right\|_2, is equal to σk+1\sigma_{k+1}, the (k+1)(k+1)-th singular value.
  • Optimality: If there were another matrix BB with rank kk such that ∥A−B∥2<∥A−A^(k)∥2\left\|A - B\right\|_2 < \left\|A - \hat{A}^{(k)}\right\|_2, it would lead to a contradiction with the rank-nullity theorem, proving the optimality of the SVD-based approximation.
  • Applications: Low-rank approximations are crucial in machine learning for image processing, noise filtering, regularization of ill-posed problems, dimensionality reduction, and principal component analysis 116.

📝 In a movie-rating matrix, a rank-1 approximation A1=u1v1⊤A_1 = u_1 v_1^\top based on the first singular value might capture a "science fiction" theme, showing high ratings for sci-fi movies by sci-fi lovers. A second rank-1 approximation A2=u2v2⊤A_2 = u_2 v_2^\top might capture a "French art house" theme, reflecting different preferences. Combining these, A^(2)=σ1A1+σ2A2\hat{A}^{(2)} = \sigma_1 A_1 + \sigma_2 A_2, yields a rank-2 approximation that closely resembles the original rating matrix, suggesting that these two themes span the relevant movie-theme space 116 117.

11.13 Matrix phylogeny119

A matrix phylogeny illustrates the relationships between different types of matrices and the operations applicable to them, categorizing real matrices A∈Rn×mA \in \mathbb{R}^{n \times m} 118.

  • Non-square matrices (n≠mn \neq m): SVD always exists for these matrices.
  • Square matrices (n×nn \times n):
  • Determinant: Indicates whether an inverse matrix exists, classifying it as regular (invertible) or singular.
  • Eigenvectors: If a matrix has nn linearly independent eigenvectors, it is non-defective and an eigendecomposition exists. Defective matrices, often due to repeated eigenvalues, cannot be diagonalized 118.
  • Normal matrices: Satisfy A⊤A=AA⊤A^\top A = A A^\top.
  • Orthogonal matrices: A subset of normal matrices where A⊤A=AA⊤=IA^\top A = A A^\top = I, implying A⊤=A−1A^\top = A^{-1}.
  • Symmetric matrices: A subset of normal matrices where S=S⊤S = S^\top, possessing only real eigenvalues.
  • Positive definite matrices: A subset of symmetric matrices where x⊤Px>0x^\top P x > 0 for all x∈Rn∖{0}x \in \mathbb{R}^n \setminus \{0\}. These have only positive eigenvalues, are always invertible, and a unique Cholesky decomposition exists.
  • Diagonal matrices: A subset of symmetric matrices, closed under multiplication and addition. The identity matrix II is a special diagonal matrix 119.
Matrix TypeKey PropertyDecomposition/Operation
Real matricesA ∈ Rn×m\mathbb{R}^{n \times m}SVD (always exists)
Square matricesA ∈ Rn×n\mathbb{R}^{n \times n}Determinant, Trace
Regular (invertible)det ≠0\neq 0Inverse Matrix
Non-defective (diagonalizable)Basis of eigenvectors existsEigendecomposition
NormalA⊤A=AA⊤A^\top A = AA^\top—
OrthogonalA⊤A=AA⊤=IA^\top A = AA^\top = I—
SymmetricS=S⊤S = S^\top, eigenvalues ∈R\in \mathbb{R}—
Positive definitex⊤Px>0x^\top P x > 0, eigenvalues >0> 0Cholesky decomposition
DiagonalNon-zero entries only on main diagonal—
Identity matrixDiagonal with all ones on main diagonal—

11.14 Applications of matrix decompositions

Matrix characterization and decomposition methods are fundamental in machine learning for analyzing data representations and mappings, as well as assessing numerical stability 119.

  • Determinants: While useful for theoretical understanding (e.g., basis orientation), numerical computation for matrix inversion and eigenvalues is typically more efficient via Gaussian elimination for larger matrices.
  • Eigendecomposition: Essential for extracting meaningful and interpretable information from linear mappings, forming the basis of spectral methods in machine learning.
  • Spectral methods: A class of algorithms that perform eigendecomposition of a positive-definite kernel, often relying on finding the best rank-kk approximation to a symmetric, positive semidefinite matrix.
  • Examples: Principal Component Analysis (PCA), Fisher Discriminant Analysis, Multidimensional Scaling (MDS), Isomap, Laplacian eigenmaps, Hessian eigenmaps, and spectral clustering.
  • Cholesky decomposition: Frequently used in computing or simulating random events, enabling the reparametrization trick for continuous differentiation over random variables in models like variational autoencoders.
  • Singular Value Decomposition (SVD):
  • General applicability: More broadly applicable than eigendecomposition, especially for non-square matrices and data tables.
  • Data analysis: Relevant for identifying data heterogeneity, data compression (e.g., storing (n+m)k(n+m)k values instead of n×mn \times m), and data pre-processing (e.g., decorrelating predictor variables).
  • Computational efficiency: Low-rank SVD approximations reduce memory and computational operations for large data matrices.
  • Missing values and compression: Used for matrices with missing values, lossy compression, and dimensionality reduction.
  • Tensor extensions: SVD is a special case of more general decompositions for higher-dimensional arrays (tensors), such as Tucker decomposition and CP decomposition 119 120.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also