1. Linear algebra
Table of contents
- Linear Algebra
- Systems of Linear Equations
- Matrices
- Solving Systems of Linear Equations
- Vector Spaces
- Linear Independence
- Basis and Rank
- Linear Mappings
- Affine Spaces
- Analytic Geometry
- 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: Tuples of n real numbers, where component-wise addition of two vectors a,b∈Rn results in c∈Rn, and multiplication by a scalar λ∈R yields λa∈Rn 2.
📝 In R3, the vector a=123 can be added to b=456 to get a+b=579, and scaled by λ=2 to get 2a=246. Both results remain in R3 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 m linear equations with n unknowns x1,…,xn is expressed as: a11x1+⋯+a1nxn=b1⋮am1x1+⋯+amnxn=bm where aij∈R are coefficients and bi∈R are constants.
- Solution: An n-tuple (x1,…,xn)∈Rn that satisfies all equations in the system simultaneously 4.
📝 A company produces n products using m resources. If aij units of resource Ri are needed for product Nj, and bi units of resource Ri are available, the production plan xj for each product Nj 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=3, x1−x2+2x3=2, 2x1+3x3=5 has infinitely many solutions. By setting x3=a, the solutions are of the form (25−23a,21+21a,a) for any a∈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 x1x2-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=5 and 2x1−4x2=1, the solution space is the point (x1,x2)=(1,41), 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, where A is the coefficient matrix, x is the vector of unknowns, and b is the vector of constants. a11⋮am1⋯⋱⋯a1n⋮amnx1⋮xn=b1⋮bm 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) matrix A is an m⋅n-tuple of elements aij, where i=1,…,m (rows) and j=1,…,n (columns).
- Notation: A∈Rm×n denotes a matrix with m rows and n columns.
- Special matrices:
- Row: A (1,n)-matrix.
- Column: An (m,1)-matrix.
- These are also called row/column vectors.
- Reshaping: A matrix A∈Rm×n can be represented as a long vector a∈Rmn 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⋮am1+bm1⋯⋱⋯a1n+b1n⋮amn+bmn∈Rm×n.
- Matrix multiplication: For A∈Rm×n and B∈Rn×k, the elements cij of the product C=AB∈Rm×k are computed as the sum of products of elements from the i-th row of A and the j-th column of B. cij=∑l=1nailblj 6.
- Dimension matching: Matrix multiplication AB is only defined if the number of columns in A equals the number of rows in B.
- Non-commutativity: In general, AB=BA, even if both products are defined.
- Hadamard product: An element-wise multiplication of matrices, distinct from standard matrix multiplication 7.
📝 Given A=[142536]∈R2×3 and B=792813∈R3×2, their product AB is defined and results in a 2×2 matrix, while BA is defined and results in a 3×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): An n×n matrix with ones on the main diagonal and zeros elsewhere. In:=10⋮001⋮0⋯⋯⋱⋯00⋮1∈Rn×n 7.
| Property | Description |
|---|---|
| Associativity | (AB)C=A(BC) |
| Distributivity | (A+B)C=AC+BC and A(C+D)=AC+AD |
| Identity multiplication | ImA=AIn=A |
3.4 Inverse and transpose 9
The inverse and transpose are fundamental operations for square matrices 8.
- Inverse (A−1): For a square matrix A∈Rn×n, its inverse B (denoted A−1) satisfies AB=In=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×2 inverse: For A=[a11a21a12a22], A−1=a11a22−a12a211[a22−a21−a12a11], provided a11a22−a12a21=0. The term a11a22−a12a21 is the determinant 8.
- Transpose (A⊤): For A∈Rm×n, its transpose B∈Rn×m has elements bij=aji.
- Main diagonal: Entries Aij where i=j.
- Symmetric matrix: A square matrix A∈Rn×n is symmetric if A=A⊤ 9.
| Property | Description |
|---|---|
| Inverse definition | AA−1=I=A−1A |
| Inverse of product | (AB)−1=B−1A−1 |
| Inverse of sum | (A+B)−1=A−1+B−1 |
| Double transpose | (A⊤)⊤=A |
| Transpose of product | (AB)⊤=B⊤A⊤ |
| Transpose of sum | (A+B)⊤=A⊤+B⊤ |
| Inverse of transpose | (A−1)⊤=(A⊤)−1=:A−⊤ |
📝 The sum of two symmetric matrices A,B∈Rn×n is always symmetric, but their product 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 and λ∈R, λA=K, where Kij=λaij 9.
- Properties:
- Associativity: (λψ)C=λ(ψC) and λ(BC)=(λB)C=B(λC)=(BC)λ.
- Distributivity: (λ+ψ)C=λC+ψC and λ(B+C)=λB+λC 10.
📝 For C=[1324], (λ+ψ)C=[(λ+ψ)1(λ+ψ)3(λ+ψ)2(λ+ψ)4]=[λ3λ2λ4λ]+[ψ3ψ2ψ4ψ]=λC+ψ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=1, 4x1−2x2−7x3=8, 9x1+5x2−3x3=2 can be written as 2493−255−7−3x1x2x3=182, or simply Ax=b.
- Linear combination: The product Ax represents a linear combination of the columns of 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 11.
- General solution: The set of all possible solutions to Ax=b, which is the sum of a particular solution and all solutions to the homogeneous system Ax=0.
- Solution steps:
- Find a particular solution to Ax=b.
- Find all solutions to the homogeneous system Ax=0.
- Combine these to form the general solution.
- Non-uniqueness: Neither the particular nor the general solution is necessarily unique 12.
📝 For the system [100182−412]x1x2x3x4=[428], a particular solution is [42,8,0,0]⊤. The general solution is x=42800+λ182−10+λ2−4120−1, where λ1,λ2∈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}.
- Addition of two equations (rows).
- Augmented matrix: A compact representation of Ax=b as [A∣b] 13.
📝 To solve the system −2x1+4x2−2x3−x4+4x54x1−8x2+3x3−3x4+x5x1−2x2+x3−x4+x5x1−2x2−3x4+4x5=−3=0=0=a, 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 10030001000139−4 is in reduced row-echelon form, with pivots highlighted. Here, x1,x3,x4 are basic variables, and x2,x5 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 when A is in RREF 16.
- Procedure:
- Assume A∈Rk×n is in RREF with no zero rows.
- Augment A to an n×n matrix A~ by adding rows of zeros such that the diagonal of A~ contains either 1 or -1.
- The columns of A~ that contain -1 on the diagonal form a basis for the solution space (kernel or null space) of Ax=0 16 17.
📝 For A=10030001000139−4, augmenting it to a 5×5 matrix A~ by inserting −1s on the diagonal for free variables yields A~=100003−10000010000010309−4−1. The columns containing −1 on the diagonal (columns 2 and 5) give the solutions: x=λ13−1000+λ2309−4−1 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 for A∈Rn×n, form the augmented matrix [A∣In]. Apply elementary row transformations to bring the left side to In. The right side will then be A−1. [A∣In]⇝[In∣A−1] 17.
📝 To find the inverse of A=1000010000100001, the augmented matrix is 1000010000100001∣∣∣∣1000010000100001. After Gaussian elimination, the right side yields A−1=1000010000100001 18.
4.6 Algorithms for solving systems of linear equations
Various approaches exist for solving Ax=b, assuming a solution exists 18.
- Direct inverse method: If A is a square and invertible matrix, the solution is x=A−1b.
- Normal equations: For non-square or non-invertible A with linearly independent columns, the solution can be found using x=(A⊤A)−1A⊤b. This approach is used in linear regression for approximate solutions 18.
5. Vector Spaces
5.1 Groups
A group G=(G,⊗) is a set G with a binary operation ⊗:G×G→G that satisfies specific axioms, providing a fundamental framework for operations on sets used in cryptography, coding theory, and graphics 20.
| Property | Description |
|---|---|
| Closure | For all x,y∈G, x⊗y∈G |
| Associativity | For all x,y,z∈G, (x⊗y)⊗z=x⊗(y⊗z) |
| Neutral element | There exists an element e∈G such that for all x∈G, x⊗e=x and e⊗x=x |
| Inverse element | For all x∈G, there exists an element y∈G such that x⊗y=e and y⊗x=e |
- Abelian group: A group G=(G,⊗) is Abelian (or commutative) if, additionally, for all x,y∈G, x⊗y=y⊗x 20.
- General linear group GL(n, R): The set of regular (invertible) n×n matrices A∈Rn×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,+) is an Abelian group. However, the set of natural numbers including zero with addition (N0,+) is not a group because inverse elements are missing (e.g., there is no negative integer for 1∈N0 such that 1+(−1)=0) 20.
5.2 Vector Spaces
A real-valued vector space V=(V,+,⋅) is a set V equipped with two operations: vector addition (+:V×V→V) and scalar multiplication (⋅:R×V→V), satisfying a set of axioms.
- Vectors: The elements x∈V are called vectors.
- Scalars: The elements λ∈R are called scalars.
- Zero vector: The neutral element of (V,+) is the zero vector 0=[0,…,0]⊤ 21.
| Axiom | Description |
|---|---|
| Abelian group | (V,+) must be an Abelian group |
| Distributivity (scalar over vector addition) | For all λ∈R, x,y∈V: λ⋅(x+y)=λ⋅x+λ⋅y |
| Distributivity (scalar over scalar addition) | For all λ,ψ∈R, x∈V: (λ+ψ)⋅x=λ⋅x+ψ⋅x |
| Associativity (outer operation) | For all λ,ψ∈R, x∈V: λ⋅(ψ⋅x)=(λψ)⋅x |
| Neutral element (outer operation) | For all x∈V: 1⋅x=x |
📝 Rn, the set of n-tuples of real numbers, is a vector space with component-wise addition and scalar multiplication. For instance, in R2, if x=(x1,x2) and y=(y1,y2), then x+y=(x1+y1,x2+y2) and λx=(λx1,λx2) 22.
5.3 Vector Subspaces
A vector subspace U of a vector space V is a non-empty subset U⊆V that is itself a vector space under the same operations restricted to U.
- Closure properties: To verify if U is a subspace, it must satisfy:
- U=∅, specifically 0∈U.
- Closure under scalar multiplication: For all λ∈R and x∈U, λx∈U.
- Closure under vector addition: For all x,y∈U, x+y∈U.
- Homogeneous systems: The solution set of a homogeneous system of linear equations Ax=0 is a vector subspace of Rn.
- Inhomogeneous systems: The solution set of an inhomogeneous system Ax=b where b=0 is not a subspace because it does not contain the zero vector 23.
📝 For any vector space V, the trivial subspaces are V itself and {0}. In R2, 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∈V is any vector v∈V that can be expressed as v=λ1x1+⋯+λkxk=∑i=1kλixi, where λ1,…,λk∈R are scalars.
- The zero vector can always be written as a linear combination by setting all scalars λi=0.
- A non-trivial linear combination of vectors x1,…,xk to represent 0 means that at least one coefficient λi is not zero 24.
6.2 Linear (In)dependence
Vectors x1,…,xk∈V are linearly dependent if there exists a non-trivial linear combination that equals the zero vector, i.e., ∑i=1kλixi=0 with at least one λi=0.
- Linearly independent: If only the trivial solution exists (i.e., λ1=⋯=λ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} with k≥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=λxj), 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:
- Write the vectors as columns of a matrix A.
- Perform Gaussian elimination to transform A into row-echelon form 25.
- Pivot columns: These columns correspond to vectors that are linearly independent of the vectors to their left.
- Non-pivot columns: These columns can be expressed as linear combinations of the pivot columns to their left.
- 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, x2=201, x3=−2−20 are linearly independent in R4, form a matrix A=1−34201−2−20 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 m linear combinations xj=∑i=1kλijbi of k linearly independent vectors b1,…,bk.
- The set {x1,…,xm} is linearly independent if and only if the column vectors {λ1,…,λm} (where λj=[λ1j,…,λkj]⊤) are linearly independent.
- If m>k, then m linear combinations of k vectors are always linearly dependent 27.
📝 Given linearly independent vectors b1,b2,b3,b4∈Rn, and x1=b1−2b2+b3−b4, x2=−4b1−2b2+4b4, x3=2b1+3b2−b3−3b4, x4=17b1−10b2+11b3+b4. To check if x1,…,x4 are linearly independent, we examine the linear independence of their coefficient vectors: λ1=1−21−1, λ2=−4−204, λ3=23−1−3, λ4=17−10111. 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} for a vector space V is a set of vectors such that every vector v∈V can be expressed as a linear combination of the vectors in A.
- The span of A, denoted span[A] or span[x1,…,xk], is the set of all possible linear combinations of vectors in A.
- If A spans V, we write V=span[A] 28.
7.2 Basis
A basis B of a vector space V 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 V 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∈V can be uniquely expressed as a linear combination of basis vectors.
- Dimension: For finite-dimensional vector spaces, the dimension of V, denoted dim(V), is the number of vectors in any basis of V.
- All bases of a given vector space have the same number of elements.
- If U⊆V is a subspace, then dim(U)≤dim(V), and dim(U)=dim(V) if and only if U=V 29 30.
📝 In R3, the canonical basis is B=⎩⎨⎧100,010,001⎭⎬⎫. Another valid basis could be B1=⎩⎨⎧110,011,101⎭⎬⎫ 29.
7.3 Determining a Basis for a Subspace
To find a basis for a subspace U=span[x1,…,xm]⊆Rn:
- Write the spanning vectors x1,…,xm as columns of a matrix A.
- Determine the row-echelon form of A using Gaussian elimination.
- The spanning vectors corresponding to the pivot columns in the row-echelon form constitute a basis for U 30.
📝 For a subspace U⊆R5 spanned by x1=10000, x2=01−200, x3=3−435−3, x4=8−5−600, form a matrix A with these vectors as columns. After reducing A to row-echelon form, if x1,x2,x4 correspond to pivot columns, then {x1,x2,x4} is a basis for U 30 31.
7.4 Rank
The rank of a matrix A∈Rm×n, denoted rk(A), is the number of linearly independent columns, which is equal to the number of linearly independent rows 31.
| Property | Description |
|---|---|
| Column rank equals row rank | rk(A)=rk(A⊤) |
| Dimension of column space | The columns of A span a subspace U⊆Rm with dim(U)=rk(A) (image or range) |
| Dimension of row space | The rows of A span a subspace W⊆Rn with dim(W)=rk(A) |
| Invertibility for square matrices | For A∈Rn×n, A is regular (invertible) if and only if rk(A)=n |
| Solvability of linear systems | The system Ax=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=0 (kernel or null space) has dimension n−rk(A) |
- Full rank: A matrix A∈Rm×n has full rank if its rank equals the maximum possible for its dimensions, i.e., rk(A)=min(m,n).
- Rank deficient: A matrix is rank deficient if it does not have full rank 31.
📝 For the matrix A=147258369, 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 between two vector spaces V and W that preserves their structure, meaning it maintains the operations of vector addition and scalar multiplication 32.
- Properties: For all x,y∈V and λ,ψ∈R:
- Φ(x+y)=Φ(x)+Φ(y).
- Φ(λx)=λΦ(x).
- These can be combined into a single condition: Φ(λx+ψy)=λΦ(x)+ψΦ(y) 32.
- Composition: For linear mappings Φ:V→W and Ψ:W→X, the composite mapping Ψ∘Φ:V→X is also linear 33.
- Linear combinations: If Φ:V→W and Ψ:V→W are linear, then Φ+Ψ and λΦ (for λ∈R) are also linear 34.
📝 The mapping Φ:R2→C, defined as Φ((x1x2))=x1+ix2, 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 Mapping | Condition |
|---|---|
| Injective | ∀x,y∈V:Φ(x)=Φ(y)⟹x=y (one-to-one) |
| Surjective | Φ(V)=W (every element in W is 'reached' from V) |
| Bijective | Both injective and surjective (implies existence of an inverse mapping Φ−1) |
- Inverse mapping: If Φ is bijective, an inverse mapping Ψ:W→V exists such that Ψ∘Φ(x)=x, denoted as Φ−1.
- Identity mapping: The mapping idV:V→V, x↦x, is called the identity mapping or identity automorphism in V 33.
| Special Linear Mapping | Conditions |
|---|---|
| Isomorphism | Φ:V→W is linear and bijective |
| Endomorphism | Φ:V→V is linear |
| Automorphism | Φ:V→V is linear and bijective |
- Isomorphism property: Finite-dimensional vector spaces V and W are isomorphic if and only if dim(V)=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 is an isomorphism, then its inverse Φ−1:W→V is also an isomorphism 33.
8.3 Matrix representation of linear mappings
Any n-dimensional vector space is isomorphic to Rn. An ordered basis B=(b1,…,bn) of a vector space V is crucial for defining coordinates, as the order of basis vectors matters 34.
- Coordinates: For any vector x∈V, its unique representation as a linear combination x=α1b1+⋯+αnbn yields the coordinates α1,…,αn with respect to B.
- Coordinate vector: The vector α=α1⋮αn∈Rn is the coordinate vector or coordinate representation of x with respect to B 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∈R2 with coordinates [2,3]⊤ in the standard basis (e1,e2) can be represented as x=2e1+3e2. With respect to a different basis, such as b1=[1,−1]⊤ and b2=[1,1]⊤, the same vector x would have coordinates [21,25]⊤, meaning x=21b1+25b2 35.
- Transformation matrix: For a linear mapping Φ:V→W with ordered bases B=(b1,…,bn) for V and C=(c1,…,cm) for W, the transformation matrix AΦ∈Rm×n has elements AΦ(i,j)=αij, where Φ(bj)=∑i=1mαijci is the unique representation of Φ(bj) with respect to C.
- The coordinates of Φ(bj) with respect to C form the j-th column of AΦ 35.
- If x^ is the coordinate vector of x∈V with respect to B, and y^ is the coordinate vector of y=Φ(x)∈W with respect to C, then y^=AΦx^ 36.
📝 For a homomorphism Φ:V→W with bases B=(b1,b2,b3) and C=(c1,c2,c3,c4), if Φ(b1)=c1−c2+3c3−c4, Φ(b2)=2c1+c2+7c3+2c4, and Φ(b3)=3c2+c3+4c4, the transformation matrix AΦ is formed by these coordinate vectors as columns: AΦ=1−13−121720314 36.
8.4 Basis change
Transformation matrices of a linear mapping change when the bases in V and W are changed 37.
- Basis change theorem: For a linear mapping Φ:V→W, with transformation matrix AΦ with respect to bases B and C, the corresponding transformation matrix A~Φ with respect to new bases B~ and C~ is given by A~Φ=T−1AΦS.
- S∈Rn×n: Transformation matrix of idV that maps coordinates with respect to B~ onto coordinates with respect to B. Its j-th column is the coordinate representation of b~j with respect to B.
- T∈Rm×m: Transformation matrix of idW that maps coordinates with respect to C~ onto coordinates with respect to C. Its k-th column is the coordinate representation of c~k with respect to C 38.
- Both S and T are regular (invertible) matrices 39.
- Compositional view: The transformation A~Φ can be seen as a composition of mappings: first transforming coordinates from B~ to B (via S), then applying Φ (via AΦ), and finally transforming coordinates from C to C~ (via T−1) 40 41.
| Matrix Relationship | Condition |
|---|---|
| Equivalent matrices | Two matrices A,A~∈Rm×n are equivalent if A~=T−1AS for regular matrices S∈Rn×n and T∈Rm×m |
| Similar matrices | Two matrices A,A~∈Rn×n are similar if A~=S−1AS for a regular matrix S∈Rn×n |
- Relationship: Similar matrices are always equivalent, but equivalent matrices are not necessarily similar.
- Transformation of composite mappings: For linear mappings Φ:V→W and Ψ:W→X, with transformation matrices AΦ and AΨ, the transformation matrix of the composite mapping is AΨ∘Φ=AΨAΦ 40.
📝 Consider a linear mapping Φ:R3→R4 with transformation matrix AΦ=1−13−121720314 with respect to standard bases B and C. To find A~Φ with respect to new bases B~ and C~, one would construct S by representing B~ vectors in terms of B, and T by representing C~ vectors in terms of C. Then, A~Φ=T−1AΦ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}.
- It is the set of all vectors in the domain V that map to the neutral element 0W in the codomain W.
- ker(Φ) is always a subspace of V and is never empty, as 0V∈ker(Φ).
- Φ is injective if and only if ker(Φ)={0V}.
- For a matrix A∈Rm×n representing Φ(x)=Ax, the kernel is the general solution to the homogeneous system Ax=0.
- Image: Im(Φ):=Φ(V)={w∈W∣∃v∈V:Φ(v)=w}.
- It is the set of all vectors in W that can be "reached" by Φ from some vector in V.
- Im(Φ) is always a subspace of W 42.
- For a matrix A=[a1,…,an], the image is the span of the columns of A, also known as the column space: Im(Φ)=span[a1,…,an]⊆Rm.
- The rank of matrix A is equal to the dimension of the image: rk(A)=dim(Im(Φ)) 43.
📝 For the linear mapping Φ:R4→R2, Φ(x1x2x3x4)=(x1+2x2−x3x1+x4), the image is Im(Φ)=span[(11),(20),(−10),(01)]. To find the kernel, one solves Ax=0, where A=(1120−1001). After Gaussian elimination, the kernel is found to be span[01/210,−11/201] 43 44.
- Rank-Nullity Theorem: For vector spaces V,W and a linear mapping Φ:V→W, it holds that dim(ker(Φ))+dim(Im(Φ))=dim(V).
- This is also known as the fundamental theorem of linear mappings.
- Consequences:
- If dim(Im(Φ))<dim(V), then ker(Φ) is non-trivial, meaning dim(ker(Φ))≥1 and Ax=0 has infinitely many solutions.
- If dim(V)=dim(W), then Φ is injective ⟺ Φ is surjective ⟺ Φ 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) L of a vector space V is defined as a subset L=x0+U, where x0∈V is the support point and U⊆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 x0 is not in the direction space U.
- Relationship between affine subspaces: For two affine subspaces L=x0+U and L~=x~0+U~, L⊆L~ if and only if U⊆U~ and x0−x~0∈U~.
- Parametric equation: A k-dimensional affine space L=x0+U can be uniquely described by a parametric equation x=x0+λ1b1+⋯+λkbk, where (b1,…,bk) is an ordered basis of U and λ1,…,λk∈R are parameters 45.
| Dimension | Name | Parametric Equation |
|---|---|---|
| 1 | Line | y=x0+λb1 |
| 2 | Plane | y=x0+λ1b1+λ2b2 |
| n−1 | Hyperplane | y=x0+∑i=1n−1λibi |
📝 In R3, a line is a one-dimensional affine subspace defined by a support point x0 and a single direction vector b1. A plane is a two-dimensional affine subspace defined by x0 and two linearly independent direction vectors b1,b2. A hyperplane in R2 is a line, and in R3 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λ=x (where A∈Rm×n and x∈Rm) is either empty or an affine subspace of Rn 46.
- Dimension of solution space: The dimension of this affine subspace is n−rk(A).
- Hyperplane solution: The solution to λ1b1+⋯+λnbn=x (with (λ1,…,λn)=(0,…,0)) is a hyperplane in Rn.
- Homogeneous systems: For homogeneous systems Ax=0, the solution is a vector subspace, which can be considered a special affine space with a support point x0=0 46.
9.3 Affine Mappings
An affine mapping ϕ:V→W between two vector spaces V and W is defined as ϕ(x)=a+Φ(x), where Φ:V→W is a linear mapping and a∈W is the translation vector 47.
- Composition: An affine mapping is the composition of a linear mapping Φ and a translation τ in W, such that ϕ=τ∘Φ. Both Φ and τ are uniquely determined.
- Composition of affine mappings: The composition of two affine mappings ϕ′:W→X and ϕ:V→W (i.e., ϕ′∘ϕ) is also an affine mapping.
- Geometric structure preservation: If an affine mapping ϕ 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 that assigns a length ∥x∥∈R to each vector x, satisfying specific properties for all λ∈R and x, y $\in V$ 55.
- Absolutely homogeneous: ∥λx∥=∣λ∣∥x∥.
- Triangle inequality: ∥x+y∥≤∥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 and ∥x∥=0⟺x=0 55.
| Norm Type | Definition | Properties |
|---|---|---|
| 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 is a specific type of inner product defined as x⊤y=∑i=1nxiyi 56.
10.4 General Inner Products
A bilinear mapping Ω:V×V→R is linear in each argument.
- Ω(λx+ψy,z)=λΩ(x,z)+ψΩ(y,z).
- Ω(x,λy+ψz)=λΩ(x,y)+ψΩ(x,z) 56.
An inner product is a positive definite, symmetric bilinear mapping Ω:V×V→R, typically denoted as ⟨x,y⟩.
- Symmetric: Ω(x,y)=Ω(y,x) for all
x, y $\in V$. - Positive definite: ∀x∈V∖{0}:Ω(x,x)>0 and Ω(0,0)=0 57.
An inner product space (V,⟨⋅,⋅⟩) 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 can be defined as ⟨x,y⟩:=x1y1−(x1y2+x2y1)+2x2y2, 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 ⟨⋅,⋅⟩ and an ordered basis B, the inner product can be expressed as ⟨x,y⟩=x^⊤Ay^, where x^,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. If ≥ holds, it is symmetric, positive semidefinite 58.
- Null space: The null space (kernel) of a symmetric, positive definite matrix
Acontains only the zero vector, implyingAx $\ne 0$ifx $\ne 0$. - Diagonal elements: The diagonal elements
a_{ii}ofAare positive, asa_{ii} = e_i^\top A e_i > 058.
📝 The matrix A1=(9665) is symmetric and positive definite because x⊤A1x=9x12+12x1x2+5x22=(3x1+2x2)2+x22>0 for all
x $\ne 0$. In contrast, A2=(9663) is symmetric but not positive definite, as x⊤A2x=(3x1+2x2)2−x22 can be negative (e.g., forx =^\top) 58.
10.6 Lengths and Distances
Inner products naturally induce a norm ∥x∥:=⟨x,x⟩, 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,⟨⋅,⋅⟩), the induced norm ∥⋅∥ satisfies ∣⟨x,y⟩∣≤∥x∥∥y∥ 59.
📝 For
x = ^\top \in \mathbb{R}^2, using the dot product, ∥x∥=12+12=2. With a different inner product ⟨x,y⟩:=x1y1−21(x1y2+x2y1)+x2y2, the norm becomes ∥x∥=x12−x1x2+x22=1−1+1=1, indicatingxis "shorter" with this inner product 1 59.
The distance between x and y in an inner product space (V,⟨⋅,⋅⟩) is defined as d(x,y):=∥x−y∥=⟨x−y,x−y⟩. 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 allx, y $\in V$andd(x, y) = 0 $\iff x = y$. - Symmetric:
d(x, y) = d(y, x)for allx, y $\in V$. - Triangle inequality:
d(x, z) $\le d(x, y) + d(y, z)for allx, y, z $\in VUSD60.
10.7 Angles and Orthogonality
Inner products define the angle ω between two non-zero vectors x, y in an inner product space using the Cauchy-Schwarz inequality. The angle ω∈[0,π] is given by cosω=∥x∥∥y∥⟨x,y⟩.
This angle intuitively reflects the similarity of vector orientations 60.
📝 For
x = ^\topandy = ^\topin R2, using the dot product, cosω=x⊤xy⊤yx⊤y=103. The angle ω=arccos(103)≈0.32 radians or18degrees 1 2 61.
Two vectors x and y are orthogonal (x $\perp$ y) if and only if ⟨x,y⟩=0. If, additionally, ∥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 = ^\topandy =^\topin R2, the dot product ⟨x,y⟩=0, so they are orthogonal (angle90degrees). However, using the inner product ⟨x,y⟩=x⊤(2001)y, ⟨x,y⟩=−1, leading to cosω=−1/3, so ω≈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
xfor the dot product: ∥Ax∥22=(Ax)⊤(Ax)=x⊤A⊤Ax=x⊤Ix=x⊤x=∥x∥22. - Angle preservation: The angle between any two vectors
x, yis also preserved under transformation by an orthogonal matrixA. 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} where ⟨bi,bj⟩=0 for i $\ne$ j and ⟨bi,bi⟩=1 for all i, j = 1, \dots, n. If only the orthogonality condition ⟨bi,bj⟩=0 for i $\ne$ j is met, it is an orthogonal basis 63.
📝 The canonical (standard) basis for a Euclidean vector space Rn is an orthonormal basis when the inner product is the dot product. In R2, the vectors b1=(10),b2=(01) form an orthonormal basis because
b_1^\top b_2 = 0and ∥b1∥=1=∥b2∥ 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⊥ where {b1,…,bM} is a basis forUand {b1⊥,…,bD−M⊥} is a basis forU^\perp64.
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 64.
- If this integral evaluates to
0, the functionsuandvare orthogonal. - This generalization leads to the concept of a Hilbert space 65.
📝 For
u = \sin(x)andv = \cos(x), the integral ∫−ππsin(x)cos(x)dx evaluates to0because sin(x)cos(x) is an odd function. Therefore, sin(x) and cos(x) are orthogonal functions over the interval [−π,π]. The collection of functions {1,cos(x),cos(2x),…} is orthogonal when integrated from −π to π, 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 (where U $\subseteq V$ is a subspace) is a linear mapping such that π2=π∘π=π. 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 that is closest to x 66.
- The segment πU(x)−x is orthogonal to
U, meaning ⟨πU(x)−x,b⟩=0. - πU(x) is a multiple of
b, so πU(x)=λb for some λ∈R 67.
The procedure to find the projection involves three steps (assuming the dot product as the inner product):
- Finding the coordinate λ: From ⟨x−λb,b⟩=0, we get λ=⟨b,b⟩⟨x,b⟩=∥b∥2⟨b,x⟩. For the dot product, λ=b⊤bb⊤x=∥b∥2b⊤x. If ∥b∥=1, then λ=b⊤x 67.
- Finding the projection point πU(x)∈U: πU(x)=λb=∥b∥2⟨x,b⟩b. For the dot product, πU(x)=∥b∥2b⊤xb. The length of the projection is ∥πU(x)∥=∣λ∣∥b∥=∣cosω∣∥x∥, where ω is the angle between
xandb. - Finding the projection matrix
P_\pi: Since πU(x)=Pπx, for the dot product, πU(x)=b∥b∥2b⊤x=∥b∥2bb⊤x. Thus, Pπ=∥b∥2bb⊤.P_\piis a symmetric matrix of rank 1 68.
📝 To find the projection matrix
P_\pionto the line spanned by b=212, we compute Pπ=b⊤bbb⊤=91212(212)=91424212424. For x=121, the projection is πU(x)=Pπx=91424212424121=9110510. ApplyingP_\piagain to πU(x) yields πU(x) itself, confirmingP_\pi^2 = P_\pi69.
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) be an ordered basis of U. Any projection πU(x) is a linear combination of these basis vectors: πU(x)=∑i=1mλibi=Bλ, where B = [b_1, \dots, b_m $\in \mathbb{R}^{n \times m}$ and λ=[λ1,…,λm]⊤∈Rm 69 70.
The three-step procedure (assuming the dot product) is:
- Find the coordinates λ1,…,λm: The vector
x - $\pi_U(x)$must be orthogonal to all basis vectors ofU. This leads tomsimultaneous conditions: bi⊤(x−πU(x))=0for i=1,…,m. In matrix form,B^\top (x - B\lambda) = 0, which simplifies to the normal equation: B⊤Bλ=B⊤x. Sinceb_iare linearly independent,B^\top B $\in \mathbb{R}^{m \times m}$is invertible, yielding λ=(B⊤B)−1B⊤x. The matrix (B⊤B)−1B⊤ is called the pseudo-inverse ofB70. - Find the projection πU(x)∈U: Substitute λ back into πU(x)=Bλ: πU(x)=B(B⊤B)−1B⊤x.
- Find the projection matrix
P_\pi: From the expression for πU(x), the projection matrix is Pπ=B(B⊤B)−1B⊤. 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)∥. 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} of U is an ONB, the projection simplifies significantly:
B^\top B = I.- λ=B⊤x.
- πU(x)=BB⊤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) of an n-dimensional vector space V into an orthogonal or orthonormal basis (u1,…,un) of V. This method ensures that the span of the original basis is preserved, i.e., span[b1,…,bn]=span[u1,…,un] 73.
- Procedure:
- The first orthogonal vector u1 is set equal to the first basis vector b1: u1:=b1.
- For subsequent vectors, uk is obtained by subtracting the orthogonal projection of bk onto the subspace spanned by the previously constructed orthogonal vectors u1,…,uk−1 from bk: uk:=bk−πspan[u1,…,uk−1](bk) for k=2,…,n.
- This subtraction ensures that uk is orthogonal to the (k−1)-dimensional subspace spanned by u1,…,uk−1.
- Orthonormal basis: If the constructed orthogonal vectors uk are normalized, an orthonormal basis (ONB) is obtained where ∥uk∥=1 for all k 73.
📝 Given a basis (b1,b2) of R2 with b1=(21) and b2=(11), the Gram-Schmidt method (using the dot product) yields: u1:=b1=(21) u2:=b2−πspan[u1](b2)=b2−∥u1∥2u1u1⊤b2=(11)−22+12(21)(21)(11)=(11)−53(21)=(−1/52/5) 73 74.
10.15 Projection onto affine subspaces
Projecting a vector onto an affine subspace L=x0+U (where x0 is a support point and U is a vector subspace) can be transformed into a projection onto a vector subspace 74.
- Method:
- Shift the problem by subtracting the support point x0 from the vector x and the affine space L, resulting in L−x0=U, which is a vector subspace.
- Compute the orthogonal projection of the shifted vector (x−x0) onto the vector subspace U, denoted as πU(x−x0).
- Translate this projection back into the affine space L by adding x0, yielding the orthogonal projection onto the affine space: πL(x)=x0+πU(x−x0).
- Distance: The distance from a vector x to an affine space L is equivalent to the distance from the shifted vector (x−x0) to the direction space U: d(x,L)=∥x−πL(x)∥=∥x−(x0+πU(x−x0))∥=d(x−x0,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 θ about the origin, which remains a fixed point. For a positive angle θ>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
In R2, a rotation transforms the standard basis vectors e1=(10) and e2=(01) into new vectors Φ(e1) and Φ(e2). These rotated vectors remain linearly independent, forming a new basis for R2, indicating that rotation performs a basis change 76.
- Rotation matrix: The rotation matrix R(θ) for a counterclockwise rotation by an angle θ is constructed from the images of the standard basis vectors: Φ(e1)=(cosθsinθ) Φ(e2)=(−sinθcosθ) R(θ)=(cosθsinθ−sinθcosθ) 76.
10.18 Rotations in R3 77
In R3, 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 Rotation | Rotation Matrix R(θ) |
|---|---|
| e1-axis (rotation in e2e3 plane) | R1(θ)=1000cosθsinθ0−sinθcosθ |
| e2-axis (rotation in e1e3 plane) | R2(θ)=cosθ0−sinθ010sinθ0cosθ |
| e3-axis (rotation in e1e2 plane) | R3(θ)=cosθsinθ0−sinθcosθ0001 |
10.19 Rotations in n dimensions
Generalizing rotations to n-dimensional Euclidean vector spaces involves fixing n−2 dimensions and restricting the rotation to a two-dimensional plane within the n-dimensional space 77.
- Givens rotation: A Givens rotation Rij(θ) is an n×n identity matrix In with specific entries modified to perform a rotation in the plane spanned by the i-th and j-th standard basis vectors 77.
- The matrix Rij(θ) has rii=cosθ, rij=−sinθ, rji=sinθ, and rjj=cosθ, with all other entries being those of the identity matrix.
- For n=2, this reduces to the standard 2D rotation matrix R(θ) 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)∥.
- Angle preservation: The angle between two vectors x and y remains unchanged after rotation, i.e., the angle between Rθx and Rθy is equal to the angle between x and y.
- 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(ϕ), 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) or ∣A∣, is a function defined for square matrices A∈Rn×n that maps the matrix to a real number, characterizing its overall properties. It represents the signed volume of the n-dimensional parallelepiped formed by the columns of the matrix 83 85.
- Invertibility: A square matrix A is invertible if and only if det(A)=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 T, its determinant is the product of its diagonal elements: det(T)=∏i=1nTii 85.
| Matrix Size | Determinant Formula |
|---|---|
| n=1 | det(A)=a11 |
| n=2 | det(A)=a11a22−a12a21 |
| n=3 (Sarrus' rule) | a11a22a33+a21a32a13+a31a12a23−a31a22a13−a11a32a23−a21a12a33 |
The Laplace expansion provides a recursive method to compute the determinant of an n×n matrix by reducing it to determinants of (n−1)×(n−1) submatrices 86.
- Laplace expansion: For a matrix A∈Rn×n:
- Expansion along column j: det(A)=∑k=1n(−1)k+jakjdet(Ak,j).
- Expansion along row j: det(A)=∑k=1n(−1)k+jajkdet(Aj,k).
- Minor: det(Ak,j) is the determinant of the submatrix Ak,j obtained by deleting row k and column j.
- Cofactor: (−1)k+jdet(Ak,j) is the cofactor 86.
📝 For A=100213301, expanding along the first row yields det(A)=1⋅det(1301)−2⋅det(0001)+3⋅det(0013)=1(1−0)−2(0−0)+3(0−0)=1 86 87.
| Property | Description |
|---|---|
| Product rule | det(AB)=det(A)det(B) |
| Transpose invariance | det(A)=det(A⊤) |
| Inverse determinant | det(A−1)=1/det(A) if A is invertible |
| Similarity invariance | Similar matrices have the same determinant, making it invariant to basis choice |
| Row/column operations | Adding a multiple of one row/column to another does not change det(A) |
| Scalar multiplication | det(λA)=λndet(A) |
| Row/column swap | Swapping two rows/columns changes the sign of det(A) |
The trace of a square matrix A∈Rn×n, denoted tr(A), is the sum of its diagonal elements: tr(A):=∑i=1naii 87 88.
- Properties of trace:
- tr(A+B)=tr(A)+tr(B).
- tr(αA)=αtr(A).
- tr(In)=n.
- tr(AB)=tr(BA) for A∈Rn×k,B∈Rk×n.
- Cyclic permutation invariance: tr(AKL)=tr(KLA) for matrices A∈Ra×k,K∈Rk×l,L∈Rl×a.
- Basis independence: The trace of a linear mapping Φ is independent of the choice of basis for its transformation matrix 88.
The characteristic polynomial of a square matrix A∈Rn×n is defined as pA(λ):=det(A−λI), where λ∈R and I is the identity matrix 88.
- It can be expressed as pA(λ)=c0+c1λ+⋯+cn−1λn−1+(−1)nλn 88.
- The constant term c0=det(A).
- The coefficient cn−1=(−1)n−1tr(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×n, λ∈R is an eigenvalue and x∈Rn∖{0} is its corresponding eigenvector if Ax=λx.
- Collinearity: If x is an eigenvector for eigenvalue λ, then any non-zero scalar multiple cx is also an eigenvector for the same λ.
- Eigenvalue condition: λ is an eigenvalue of A if and only if det(A−λI)=0, meaning λ is a root of the characteristic polynomial pA(λ) 89.
- Algebraic multiplicity: The number of times an eigenvalue λi appears as a root in the characteristic polynomial.
- Eigenspace: For an eigenvalue λ, the set of all eigenvectors associated with λ forms a subspace of Rn, denoted Eλ. It is the null space of (A−λI).
- Eigenspectrum (spectrum): The set of all eigenvalues of A.
- 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×n, its characteristic polynomial is pI(λ)=det(I−λI)=(1−λ)n=0. This yields a single eigenvalue λ=1 with algebraic multiplicity n. Any non-zero vector x∈Rn satisfies Ix=1x, so all n standard basis vectors are eigenvectors, and the eigenspace E1 spans n dimensions 90.
| Property | Description |
|---|---|
| Transpose | A and A⊤ have the same eigenvalues, but not necessarily the same eigenvectors |
| Eigenspace | Eλ=ker(A−λI) |
| Similarity | Similar matrices have the same eigenvalues, making them invariant to basis change |
| Symmetric, positive definite matrices | Always 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 for each eigenvalue 91.
📝 To find eigenvalues and eigenvectors for A=(4213):
- Characteristic Polynomial: pA(λ)=det(4−λ213−λ)=(4−λ)(3−λ)−2=λ2−7λ+10=(λ−2)(λ−5).
- Eigenvalues: The roots are λ1=2 and λ2=5.
- Eigenvectors and Eigenspaces:
- For λ1=5: (A−5I)x=(−121−2)(x1x2)=(00). This yields −x1+x2=0, so x1=x2. The eigenspace is E5=span[(11)].
- For λ2=2: (A−2I)x=(2211)(x1x2)=(00). This yields 2x1+x2=0, so x2=−2x1. The eigenspace is E2=span[(1−2)] 91 92.
The geometric multiplicity of an eigenvalue λ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 n linearly independent eigenvectors, meaning the sum of the dimensions of its eigenspaces is less than n. 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×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 A can be eigendecomposed as A=PDP⊤, where D is a diagonal matrix of eigenvalues and P 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.
| Characteristic | Relationship to Eigenvalues |
|---|---|
| Determinant | Product of eigenvalues: det(A)=∏i=1nλi |
| Trace | Sum of eigenvalues: tr(A)=∑i=1nλi |
📝 For a matrix A∈R2×2 with two linearly independent, orthonormal eigenvectors x1,x2, the transformation A maps these to v1=λ1x1 and v2=λ2x2. The area of the unit square spanned by x1,x2 changes by a factor of ∣λ1λ2∣, which is ∣det(A)∣. The perimeter changes by 2(∣λ1∣+∣λ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 A can be uniquely factorized into a product A=LL⊤, where L is a lower-triangular matrix with positive diagonal elements.
- Cholesky factor: The matrix L is called the Cholesky factor of A 98.
📝 For a symmetric, positive definite matrix A∈R3×3, its Cholesky factorization A=LL⊤ is: A=a11a21a31a21a22a32a31a32a33=l11l21l310l22l3200l33l1100l21l220l31l32l33=l112l21l11l31l11l21l11l212+l222l31l21+l32l22l31l11l31l21+l32l22l312+l322+l332 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×n is diagonalizable if it is similar to a diagonal matrix D, meaning there exists an invertible matrix P∈Rn×n such that D=P−1AP.
This transformation expresses the same linear mapping in a basis composed of A's eigenvectors 99 100.
- Eigendecomposition theorem: A square matrix A∈Rn×n can be factored into A=PDP−1 if and only if its eigenvectors form a basis of Rn.
- Components:
- P: An invertible matrix whose columns are the n linearly independent eigenvectors of A.
- D: A diagonal matrix whose diagonal entries are the corresponding eigenvalues of A 100.
- Symmetric matrices: A symmetric matrix S∈Rn×n can always be diagonalized, and its eigenvectors form an orthonormal basis, making P an orthogonal matrix such that D=PTAP 101.
- Applications:
- Matrix powers: Ak=(PDP−1)k=PDkP−1, where Dk is computed by raising each diagonal element to the power k.
- Determinant computation: det(A)=det(PDP−1)=det(P)det(D)det(P−1)=det(D)=∏idii, which is efficient as D is diagonal 102 103.
📝 For A=(5/2−2−25/2), the eigenvalues are λ1=7/2 and λ2=3/2, with corresponding normalized eigenvectors p1=21(1−1) and p2=21(11). The matrix P=21(1−111) and D=(7/2003/2), so A=PDP−1 102.
11.5 Geometric intuition for the eigendecomposition
The eigendecomposition A=PDP−1 can be interpreted as a sequence of linear transformations 101.
- Basis change (P−1): Transforms vectors from the standard basis into the eigenbasis of A.
- Scaling (D): Scales the vectors along the remapped orthogonal eigenvectors by their respective eigenvalues λi.
- Inverse basis change (P): 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×n of rank r, its SVD is A=UΣVT.
- U∈Rm×m: An orthogonal matrix with column vectors ui (left-singular vectors).
- V∈Rn×n: An orthogonal matrix with column vectors vj (right-singular vectors).
- Σ∈Rm×n: A rectangular diagonal matrix with non-negative diagonal entries σi (singular values), ordered such that σ1≥σ2≥⋯≥σr≥0.
- Singular value matrix Σ:
- It is unique and has the same dimensions as A 103.
- If m>n, Σ has a diagonal submatrix up to row n and then consists of zero row vectors.
- If m<n, Σ has a diagonal structure up to column m and then consists of zero columns 104.
11.7 Geometric intuitions for the SVD
The SVD of a matrix A can be interpreted as a decomposition of a linear mapping Φ:Rn→Rm into three sequential operations 104.
- Basis change in domain (VT): Transforms vectors from the standard basis in Rn to an orthonormal basis defined by the right-singular vectors vj.
- Scaling and dimensionality adjustment (Σ): Scales the new coordinates by the singular values σi and maps from Rn to Rm, potentially adding or deleting dimensions.
- Basis change in codomain (U): Transforms the scaled vectors from an orthonormal basis in Rm to the standard basis in Rm 104 105.
📝 When mapping a square grid of vectors X∈R2 using A=UΣVT, VT first rotates X. Then, Σ scales these rotated vectors and maps them to R3, where they lie in the x1-x2 plane. Finally, U performs a rotation within R3, moving the vectors out of the x1-x2 plane while remaining on a plane 105 106.
11.8 Construction of the SVD
The SVD of A∈Rm×n is constructed by finding two sets of orthonormal bases, U=(u1,…,um) for the codomain Rm and V=(v1,…,vn) for the domain Rn 107.
- Right-singular vectors (V):
- Form an orthonormal basis for Rn.
- They are the eigenvectors of the symmetric, positive semidefinite matrix ATA∈Rn×n.
- If ATA=VDVT, then V consists of the eigenvectors of ATA, and the eigenvalues λi of ATA are the squared singular values σi2 of A 107.
- Left-singular vectors (U):
- Form an orthonormal basis for Rm.
- They are the eigenvectors of the symmetric matrix AAT∈Rm×m.
- The nonzero eigenvalues of AAT are the same as those of ATA, which are the squared singular values σi2.
- Linking U and V: The left-singular vectors ui are obtained by normalizing the images of the right-singular vectors vi under A: ui=∥Avi∥Avi=σi1Avi. This leads to the singular value equation: Avi=σiui for i=1,…,r 108.
- Full SVD: Concatenating vi into V and ui into U yields AV=UΣ, which, by right-multiplying with VT, gives A=UΣVT 109.
📝 To compute the SVD of A=(1−2), first compute ATA=(5−2−25). Its eigenvalues are λ1=6 and λ2=1, so singular values are σ1=6 and σ2=1. The eigenvectors of ATA form V=(5/30−2/30−2/305/30). The singular value matrix is Σ=(6001). Finally, u1=σ11Av1=(1/5−2/5) and u2=σ21Av2=(2/51/5), forming U=(1/5−2/52/51/5) 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.
| Feature | Eigendecomposition (A=PDP−1) | Singular Value Decomposition (A=UΣVT) |
|---|---|---|
| Matrix type | Only for square matrices A∈Rn×n | For any matrix A∈Rm×n |
| Existence | Exists only if eigenvectors form a basis of Rn | Always exists |
| Orthogonality of basis vectors | Columns of P are not necessarily orthogonal | Columns of U and V are orthonormal (rotations) |
| Domain and codomain | Operates within the same vector space | Domain and codomain can be different dimensions |
| Inverse relationship of basis matrices | P and P−1 are inverses of each other | U and V are generally not inverses of each other |
| Diagonal matrix entries | Diagonal entries of D (eigenvalues) can be complex or negative | Diagonal entries of Σ (singular values) are always real and non-negative |
| Relationship to ATA and AAT | — | Left-singular vectors of A are eigenvectors of AAT; Right-singular vectors of A are eigenvectors of ATA; Nonzero singular values of A are square roots of nonzero eigenvalues of AAT and ATA |
For symmetric matrices A∈Rn×n, the eigenvalue decomposition and SVD are identical 111.
11.10 Matrix approximation
The SVD allows for approximating a matrix A 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×n is formed by the outer product of the i-th left-singular vector ui and the i-th right-singular vector vi: Ai:=uiviT 113.
- Full rank decomposition: A matrix A∈Rm×n of rank r can be written as a sum of r rank-1 matrices, weighted by their singular values: A=∑i=1rσiuiviT=∑i=1rσiAi.
- Rank-k approximation: A rank-k approximation A^(k) of A is obtained by summing only the first k terms (where k<r): A^(k):=∑i=1kσiuiviT=∑i=1kσiAi.
- This approximation has rank k.
- It significantly reduces the number of values needed to represent the matrix, enabling data compression 114.
📝 An image represented by a 1432×1910 matrix requires 2,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,715 numbers, which is about 0.6% of the original data 114.
11.11 Spectral norm and Eckart-Young theorem
The spectral norm of a matrix A∈Rm×n is defined as ∥A∥2:=maxx∥x∥2∥Ax∥2 for x∈Rn∖{0} 115.
- Property: The spectral norm of A is equal to its largest singular value σ1.
- Eckart-Young theorem: For a rank-r matrix A∈Rm×n and a rank-k matrix B∈Rm×n (where k≤r), the rank-k approximation A^(k)=∑i=1kσiuiviT is the best possible rank-k approximation of A in terms of minimizing the spectral norm of the error.
- A^(k)=argminrk(B)=k∥A−B∥2.
- The error of this approximation is ∥A−A^(k)∥2=σk+1.
- Interpretation: The SVD provides a principled way to project a full-rank matrix onto a lower-dimensional space of rank-at-most-k 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-r matrix A to a rank-k matrix A^ in the spectral norm sense, providing the best rank-k 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 A and A^(k) is the sum of the remaining rank-1 matrices, A−A^(k)=∑i=k+1rσiuivi⊤.
- Spectral norm: The spectral norm of the difference matrix, A−A^(k)2, is equal to σk+1, the (k+1)-th singular value.
- Optimality: If there were another matrix B with rank k such that ∥A−B∥2<A−A^(k)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⊤ 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⊤ might capture a "French art house" theme, reflecting different preferences. Combining these, A^(2)=σ1A1+σ2A2, 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×m 118.
- Non-square matrices (n=m): SVD always exists for these matrices.
- Square matrices (n×n):
- Determinant: Indicates whether an inverse matrix exists, classifying it as regular (invertible) or singular.
- Eigenvectors: If a matrix has n 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⊤.
- Orthogonal matrices: A subset of normal matrices where A⊤A=AA⊤=I, implying A⊤=A−1.
- Symmetric matrices: A subset of normal matrices where S=S⊤, possessing only real eigenvalues.
- Positive definite matrices: A subset of symmetric matrices where x⊤Px>0 for all x∈Rn∖{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 I is a special diagonal matrix 119.
| Matrix Type | Key Property | Decomposition/Operation |
|---|---|---|
| Real matrices | A ∈ Rn×m | SVD (always exists) |
| Square matrices | A ∈ Rn×n | Determinant, Trace |
| Regular (invertible) | det =0 | Inverse Matrix |
| Non-defective (diagonalizable) | Basis of eigenvectors exists | Eigendecomposition |
| Normal | A⊤A=AA⊤ | — |
| Orthogonal | A⊤A=AA⊤=I | — |
| Symmetric | S=S⊤, eigenvalues ∈R | — |
| Positive definite | x⊤Px>0, eigenvalues >0 | Cholesky decomposition |
| Diagonal | Non-zero entries only on main diagonal | — |
| Identity matrix | Diagonal 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-k 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 values instead of n×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.