Purpose

For a shorter introduction to the computational basics, start with Elementary Linear Algebra; the corresponding NumPy operations are collected in the Python Linear Algebra Cheatsheet.

Geometric Basics

Definition and Representation

  • A vector is a quantity with both magnitude and direction
  • Notation: or or
  • Components: in 3D space

Geometric Interpretation

  • Directed line segment from initial point to terminal point
  • Length (magnitude):
  • Two vectors are equal if they have same magnitude and direction

Position Vectors

  • Vector from origin to a point
  • Written as:

Direction Vectors

  • Unit vector in direction of :
  • Represents pure direction (magnitude = 1)

Unit Vectors

  • Vectors with magnitude 1:
  • Direction cosines:

Standard Basis Vectors

VectorComponentsDescription
Unit vector in x-direction
Unit vector in y-direction
Unit vector in z-direction

Basic Vector Operations

Addition and Subtraction

  • Addition:
  • Subtraction:

Parallelogram Law

  • Sum of vectors forms diagonal of parallelogram
  • where is diagonal

Triangle Inequality

  • Equality holds if and only if vectors are parallel

Scalar Multiplication

  • Properties:

Systems of Linear Equations

Matrix Form (Ax = b)

Solution Types

TypeConditionGeometric Interpretation
Unique SolutionLines/planes intersect at one point
Infinite SolutionsLines/planes overlap
No SolutionLines/planes are parallel

Geometric Interpretation

  • 2D: Intersection of lines
  • 3D: Intersection of planes
  • Higher dimensions: Intersection of hyperplanes

Solution Methods

Gaussian Elimination

  1. Forward Elimination

    • Convert matrix to row echelon form (REF)
    • Create zeros below diagonal
    [1 * * *]
    [0 1 * *]
    [0 0 1 *]
    [0 0 0 1]
    
  2. Back Substitution

    • Solve for variables from bottom up

Gauss-Jordan Elimination

  • Convert to reduced row echelon form (RREF)
  • Create zeros above and below diagonal
[1 0 0 *]
[0 1 0 *]
[0 0 1 *]

Key Operations

OperationDescriptionNotation
Row SwapSwap rows and
Scalar MultiplicationMultiply row by
Row AdditionAdd multiple of row to row

Matrices

Types and Properties

TypeDefinitionProperties
Square matrix- Same number of rows and columns
- Can have determinant
- May be invertible
Rectangular matrix- Different number of rows and columns
- No determinant
Identity ()- Square matrix
- 1’s on diagonal, 0’s elsewhere
-
Zero ()All entries are 0- Can be any dimension
-
Diagonal for - Non-zero elements only on main diagonal
TriangularUpper: for
Lower: for
- Square matrix
- Determinant = product of diagonal entries

Basic Matrix Operations

Addition and Subtraction

  • Only defined for matrices of same dimensions
  • Commutative:
  • Associative:

Scalar Multiplication

  • Distributive:

Transpose

Row Echelon Form

A matrix is in row echelon form if:

  1. All zero rows are at the bottom
  2. Leading coefficient (pivot) of each nonzero row is to the right of pivots above
  3. All entries below pivots are zero

Reduced Row Echelon Form

Additional conditions for RREF:

  1. Leading coefficient of each nonzero row is 1
  2. Each leading 1 is the only nonzero entry in its column

Pivot Positions

  • First nonzero element in each row
  • Determines rank of matrix
  • Maximum number of linearly independent columns

Leading Entries

Properties:

  • Always nonzero
  • Leftmost nonzero entry in row
  • Each leading entry is right of leading entries above it

Vector Spaces

Axioms of Vector Spaces

Let be a vector space over field with vectors and scalars :

  1. Closure under addition:
  2. Commutativity:
  3. Associativity:
  4. Additive identity: such that
  5. Additive inverse: such that
  6. Scalar multiplication closure:
  7. Scalar multiplication distributivity:
  8. Vector distributivity:
  9. Scalar multiplication associativity:
  10. Scalar multiplication identity:

Linear Independence

Definition

Vectors are linearly independent if: implies

Tests and Algorithms

TestDescriptionResult
Matrix TestForm matrix with vectors as columns and solve Independent if only solution is trivial
DeterminantFor square matrix of vectorsIndependent if det
RankCompute rank of matrix Independent if rank = number of vectors

Span

Definition

The span of vectors is:

Geometric Interpretation

  • 1 vector: line through origin
  • 2 vectors: plane through origin (if independent)
  • 3 vectors: 3D space (if independent)

Basis

A basis is a linearly independent set of vectors that spans the vector space.

Standard Basis

For : where: (1 in th position)

Dimension

The dimension of a vector space is the number of vectors in any basis.

Basis Theorem

Every basis of a vector space has the same number of vectors.

Dimension Theorem

For finite-dimensional vector space :

  • Any linearly independent set can be extended to a basis
  • Any spanning set can be reduced to a basis

Subspaces

Tests for Subspaces

A subset of vector space is a subspace if:

  1. Closed under addition:
  2. Closed under scalar multiplication:

Common Subspaces

SubspaceDefinitionDimension
Null Space
Column Space
Row Space

Advanced Vector Operations (cont. 1)

Dot Product

The scalar product of two vectors.

Geometric Definition

where is the angle between vectors

Algebraic Definition

For vectors in :

Properties

PropertyFormulaDescription
CommutativeOrder doesn’t matter
DistributiveDistributes over addition
Scalar MultiplicationScalars can be factored out
Self-Dot ProductDot product with itself equals magnitude squared

Angle Formula

Projection Formula

Vector projection of onto :

Cross Product

Vector product resulting in a vector perpendicular to both input vectors (3D only).

Right-Hand Rule

  1. Point index finger in direction of first vector
  2. Point middle finger in direction of second vector
  3. Thumb points in direction of cross product

Properties

PropertyFormulaDescription
Anti-commutativeOrder matters
DistributiveDistributes over addition
MagnitudeArea of parallelogram
Perpendicular and Result is perpendicular to both vectors

Triple Product

Scalar triple product: Represents volume of parallelepiped

Linear Combinations

Sum of vectors with scalar coefficients:

Geometric Interpretation

  • For two vectors: Points on plane formed by vectors
  • For three vectors: Points in space formed by vectors
  • Span: Set of all possible linear combinations

Matrix Properties (cont. 1)

Rank

The rank of a matrix is the dimension of the vector space spanned by its columns (or rows).

Full Rank

A matrix has full rank when:

  • For m×n matrix: rank = min(m,n)
  • Column rank = Row rank
  • For square matrix: rank = n ⟺ matrix is invertible

Rank Theorems

TheoremStatement
Rank-NullityFor m×n matrix A: rank(A) + nullity(A) = n
Product Rankrank(AB) ≤ min(rank(A), rank(B))
Addition Rankrank(A + B) ≤ rank(A) + rank(B)

Trace

The trace of a square matrix is the sum of elements on the main diagonal.

Properties

  • tr(A + B) = tr(A) + tr(B)
  • tr(cA) = c⋅tr(A)
  • tr(AB) = tr(BA)
  • tr(A^T) = tr(A)
  • For eigenvalues λᵢ: tr(A) = ∑λᵢ

Determinant

For square matrix A, det(A) or |A| measures the scaling factor of the linear transformation.

Properties

  1. det(AB) = det(A)⋅det(B)
  2. det(A^T) = det(A)
  3. det(A^{-1}) = \frac{1}{det(A)}
  4. For triangular matrices: det = product of diagonal entries
  5. det(cA) = c^n det(A) for n×n matrix

Calculation Methods

Cofactor Expansion

For n×n matrix: where Cᵢⱼ is the (i,j) cofactor

Row/Column Expansion

Choose any row/column i: where Mᵢⱼ is the minor

Triangular Method

  1. Convert to upper triangular using row operations
  2. Multiply diagonal elements
  3. Account for row operation signs

Cramer’s Rule

For system Ax = b with det(A) ≠ 0: where Aᵢ is A with column i replaced by b

Matrix Operations (cont. 1)

Matrix Multiplication

For matrices and :

Properties

  • Distributive:
  • Associative:
  • Scalar multiplication:
  • Identity:
  • Zero matrix:

Non-commutativity

  • Generally,
  • Exception: If and commute, they are called “commuting matrices”
  • Special cases where :
    • When or is identity matrix
    • When or is scalar multiple of identity
    • When and are diagonal matrices

Associativity

always holds for conformable matrices

Inverse

For square matrix , if , then is the inverse of

Existence Conditions

  • Matrix must be square
  • Matrix must be non-singular (determinant ≠ 0)
  • rank(A) = n for n×n matrix

Properties

PropertyFormula
Double Inverse
Product Inverse
Scalar Inverse
Transpose Inverse

Calculation Methods

Adjugate Method

For an n×n matrix: where adj(A) is the adjugate matrix

Gaussian Elimination

  1. Form augmented matrix
  2. Convert left side to identity matrix
  3. Right side becomes

Elementary Matrices

  • Result from applying elementary row operations to identity matrix
  • Types:
    1. Row swap:
    2. Row multiplication:
    3. Row addition:
  • Properties:
    • Always invertible
    • where is row reduced form

Conjugate Transpose

For matrix :

  • Denoted as or
  • Properties:
    • For real matrices,

Systems of Linear Equations (cont. 1)

Homogeneous Systems ()

A system where all constants are zero:

Trivial Solution

  • Always has solution (zero vector)
  • Exists for any coefficient matrix

Nontrivial Solutions

  • Exist if and only if where is number of variables
  • Equivalent to for square matrices
  • Number of free variables =

Consistency Theorems

Consistent System Conditions

ConditionSystem is Consistent When
Rank Test
Square Matrix
GeneralSolutions exist if is in column space of

Fredholm Alternative

For system , exactly one of these is true:

  1. System has a solution
  2. has a solution with

Cramer’s Rule

For system where is with : Where is matrix with column replaced by

Matrix Inverse Method

For square system where is invertible:

Requirements:

  • must be square
  • Computationally expensive for large systems

Linear Transformations

Definition

A linear transformation is a function between vector spaces that preserves:

  1. Addition:
  2. Scalar multiplication:

Matrix Representation

Every linear transformation can be represented by a unique matrix

Standard Matrix

For transformation , the standard matrix is formed by: where are standard basis vectors

Properties

PropertyDefinitionTest
Kernel (Null Space)Solve
Range (Image)Span of columns of
One-to-One (Injective)
Onto (Surjective)Columns span
IsomorphismBijective linear transformationOne-to-one and onto

Special Transformations

Rotation

  • 2D rotation by angle :

Reflection

  • Across x-axis:
  • Across y-axis:

Projection

  • Onto x-axis:
  • Onto y-axis:

Scaling

  • Scale by factors and :

Shearing

  • Horizontal shear by :
  • Vertical shear by :

Inner Product Spaces

Definition

An inner product on a vector space is a function (or )

Properties

PropertyMathematical FormDescription
Positive Definiteness and Always non-negative, zero only for zero vector
SymmetryComplex conjugate for complex spaces
LinearityLinear in first argument

Norm

The norm induced by inner product:

Properties

  • Non-negative:
  • Positive definite:
  • Homogeneous:
  • Triangle inequality:

Distance Function

Orthogonality

Orthogonal Vectors

Two vectors are orthogonal if

Orthogonal Sets

  • Set of vectors where each pair is orthogonal
  • If normalized, called orthonormal set
  • Orthonormal basis: orthonormal set that spans space

Orthogonal Matrices

Matrix is orthogonal if

Properties

PropertyFormulaNote
InverseTranspose equals inverse
DeterminantAlways unit magnitude
Column/RowsForm orthonormal set
Length PreservationPreserves distances

Orthogonal Complements

For subspace , orthogonal complement :

Orthogonal Projections

Projection onto subspace : where is basis for

For orthonormal basis:

Special Matrices (cont. 1)

TypeDefinitionPropertiesExample
Symmetric- Diagonal elements can be any real number
- Elements symmetric across main diagonal
- All eigenvalues are real
Skew-symmetric- Diagonal elements must be zero
-
- All eigenvalues are imaginary or zero
Orthogonal-
- Columns/rows form orthonormal basis
-
- Preserves lengths and angles
Idempotent- Eigenvalues are only 0 or 1
- Trace = rank
- Used in projection matrices
Nilpotent for some - All eigenvalues = 0
- Trace = 0
- where is matrix size

Additional Properties:

  1. Symmetric Matrices:

    • All real symmetric matrices are diagonalizable
    • is a quadratic form
  2. Orthogonal Matrices:

    • Every column/row has unit length
    • Any two columns/rows are perpendicular
    • Preserves inner products:
  3. Idempotent Matrices:

    • is also idempotent if is idempotent
    • Rank = Trace for idempotent matrices
  4. Nilpotent Matrices:

    • The minimal for which is called the index of nilpotency
    • Characteristic polynomial is

Change of Basis

Transition Matrices

A transition matrix transforms coordinates from one basis to another: where are the basis vectors of B expressed in basis C

OperationFormulaMeaning
Change from C to BVector v in basis B
Change from B to CVector v in basis C
Inverse relationMatrices are inverses

Similar Matrices

Two matrices A and B are similar if: where P is an invertible matrix

Properties:

  • Similar matrices have same eigenvalues
  • Similar matrices have same determinant
  • Similar matrices have same trace
  • Similar matrices have same rank

Coordinate Vectors

For a vector and basis : where

Orthogonalization

Gram-Schmidt Process

Converting basis to orthogonal basis :

General formula: where

QR Decomposition

Matrix A can be decomposed as: where:

  • Q is orthogonal matrix ()
  • R is upper triangular matrix

Orthonormal Basis

Construction

  1. Start with any basis
  2. Apply Gram-Schmidt process
  3. Normalize each vector:

Properties

PropertyDescription
Orthogonality for
Normality for all i
Transition MatrixP is orthogonal ()
Coordinates

Eigenvalues and Eigenvectors

Definitions

  • Eigenvalue (): A scalar value where for some nonzero vector
  • Eigenvector (): A nonzero vector satisfying for some scalar

Characteristic Equation

where:

  • is the square matrix
  • is the eigenvalue
  • is the identity matrix

Characteristic Polynomial

  • Degree equals matrix dimension
  • Roots are eigenvalues

Properties

PropertyDescription
Sum
Product
Number≤ dimension of matrix

Geometric Multiplicity

  • Number of linearly independent eigenvectors for a given eigenvalue
  • ≤ algebraic multiplicity
  • = dimension of null space of

Algebraic Multiplicity

  • Multiplicity of eigenvalue as root of characteristic polynomial
  • ≥ geometric multiplicity

Eigenspace

  • Subspace spanned by eigenvectors for eigenvalue
  • Dimension = geometric multiplicity

Diagonalization

where:

  • is diagonal matrix of eigenvalues
  • is matrix of eigenvectors

Diagonalizability Conditions

Matrix is diagonalizable if and only if:

  1. Geometric multiplicity = algebraic multiplicity for all eigenvalues
  2. Sum of dimensions of eigenspaces = matrix dimension

Diagonalization Process

  1. Find eigenvalues (solve characteristic equation)
  2. Find eigenvectors for each eigenvalue
  3. Form from eigenvectors as columns
  4. Form with eigenvalues on diagonal
  5. Verify

Similar Matrices

  • and similar if for invertible
  • Similar matrices have same eigenvalues
  • Similar matrices have same characteristic polynomial

Special Cases

Repeated Eigenvalues

  • May have fewer linearly independent eigenvectors
  • Need generalized eigenvectors if geometric multiplicity < algebraic multiplicity

Complex Eigenvalues

  • Occur in conjugate pairs for real matrices
  • Complex eigenvectors also occur in conjugate pairs

Applications

Powers of Matrices

  • Simplifies computation of matrix powers
  • Useful for recursive sequences

Difference Equations

For system :

  • General solution involves eigenvalues and eigenvectors
  • Stability determined by

Differential Equations

For system :

  • Solutions of form
  • Stability determined by

Important Theorems

Fundamental Theorem of Linear Algebra

For a linear transformation and its matrix :

Cayley-Hamilton Theorem

Every square matrix satisfies its own characteristic equation:

Spectral Theorem

For symmetric matrices :

  • All eigenvalues are real
  • Eigenvectors of distinct eigenvalues are orthogonal
  • where:
    • is orthogonal ()
    • is diagonal containing eigenvalues

Triangle Inequality

For vectors :

Cauchy-Schwarz Inequality

For vectors :

  • Equality holds if and only if vectors are linearly dependent

Invertible Matrix Theorem

The following statements are equivalent for a square matrix :

  1. is invertible
  2. Columns are linearly independent
  3. has unique solution for all

Matrix Factorization Theorems

LU Decomposition

For matrix : where:

  • is lower triangular
  • is upper triangular
  • Exists if all leading principal minors are nonzero

QR Decomposition

For matrix : where:

  • is orthogonal ()
  • is upper triangular
  • Always exists for full-rank matrices

Cholesky Decomposition

For symmetric positive definite matrix : where:

  • is lower triangular
  • is upper triangular
  • Elements are real

Advanced Topics

Singular Value Decomposition (SVD)

Any matrix can be decomposed as

Singular Values

  • Diagonal entries of matrix
  • Always real and non-negative
  • Ordered:

U and V Matrices

  • : orthogonal matrix (left singular vectors)
  • : orthogonal matrix (right singular vectors)
  • : diagonal matrix with singular values

Applications

ApplicationDescription
Low-rank approximationTruncate to largest singular values
Image compressionReduce dimensionality while preserving structure
Principal Component AnalysisUse right singular vectors as principal components
Pseudoinverse

Jordan Canonical Form

For matrix , exists invertible such that

Jordan Blocks

Generalized Eigenvectors

  • Chain:
  • is regular eigenvector

Positive Definite Matrices

Symmetric matrix where for all nonzero

Tests for Positive Definiteness

TestCondition
EigenvalueAll eigenvalues > 0
Leading PrincipalsAll leading principal minors > 0
CholeskyExists unique lower triangular with
Quadratic Form for all nonzero

Applications

  • Optimization problems
  • Covariance matrices
  • Least squares solutions
  • Energy functions

Linear Operators

Maps between vector spaces preserving linear structure

Adjoint Operators

  • For operator , adjoint satisfies
  • Matrix representation: conjugate transpose
  • Properties:

Self-Adjoint Operators

  • Real eigenvalues
  • Orthogonal eigenvectors
  • Spectral theorem applies

Dual Spaces

Vector space of linear functionals on

Dual Basis

  • For basis of , dual basis satisfies
  • Dimension equals original space
  • Natural pairing:

Dual Maps

For linear map , dual map

Tensor Products

is universal space for bilinear maps

Definition

  • Elementary tensors:
  • Bilinear in components:

Properties

PropertyDescription
Dimension
Associativity
Distributivity
Field multiplication

Multilinear Algebra

Tensors

  • Multilinear maps:
  • Type : contravariant, covariant indices
  • Transformation rules under basis change

Exterior Algebra

  • Antisymmetric tensors
  • Wedge product
  • Properties:
    • Anticommutativity:
    • Associativity:
    • Distributivity over addition
    • -forms and differential forms