A01: Linear systems, vector spaces, and transformations
On this page
- A. Prerequisites and observable goals
- B. The central question: which combinations produce the desired output?
- C. Span, independence, and bases
- D. Elimination preserves the solution set
- E. Composition explains matrix multiplication
- F. Inverses and determinants: useful but not universal tools
- G. Independent practice
- H. Complete solutions: A01
- I. Retention and readiness
A. Prerequisites and observable goals#
Modules 01–02 for algebra and functions; C01 for the optional Python lab. Vectors from Module 33 are useful but not required.
Interpret a matrix as a map, solve and classify linear systems, identify span, independence, basis, rank, and null space, and explain when an inverse or determinant is useful.
Level: Degree-core mathematics; no calculus prerequisite.
B. The central question: which combinations produce the desired output?#
A vector is an ordered collection of coordinates relative to a chosen basis. It can describe displacement, a feature representation, a sampled signal, or a collection of unknowns. The same tuple can have different meanings in different coordinate systems. Addition and scalar multiplication are coordinatewise: and . A linear combination is a sum . The coefficients are scalars; the are vectors. Do not confuse the number of coefficients with the dimension of each vector.
A matrix is a rectangular array with rows and columns. It represents a linear map from to . Writing its columns as makes multiplication meaningful:
Thus asks whether the desired output can be assembled from the columns of , and, if so, with which coefficients. This connects an algebraic system with a geometric image rather than treating multiplication as a mysterious row-by-column ritual.
C. Span, independence, and bases#
The span of a collection is the set of all its linear combinations. A collection is linearly independent when the only coefficients producing the zero vector are all zero. A basis for a vector space is an independent spanning collection; its size is the dimension. For example, and form a basis of . So do and . The coordinates of a vector change with the basis, while the represented geometric vector need not.
The null space describes inputs collapsed to zero. The column space describes achievable outputs. The rank is the dimension of the image. The rank–nullity theorem states
where is the dimension of the input space. One way to understand this is to extend a basis of the null space to a basis of the whole input space. The added basis vectors have images that form a basis of the image: they must span it, and any dependence would contradict the way the original basis was completed. Each lost input direction reduces the number of independent output directions.
D. Elimination preserves the solution set#
Consider
Add the equations to obtain , so ; substitute into to obtain . The augmented matrix records the same operations:
Swapping equations, multiplying an equation by a nonzero scalar, and adding a multiple of one equation to another are reversible operations. They preserve exactly the same solutions. Multiplying a row by zero is not reversible and can erase a constraint. A pivot is a leading nonzero entry used to eliminate a variable from other equations. If a prospective pivot is zero, exchange rows when possible; do not divide by zero and hope a later simplification repairs it.
A row means : the system is inconsistent. A row of all zeros means one constraint is redundant. A nonpivot input variable is free in a consistent system. For example,
has for every real , not merely one numerical answer. Changing the second right-hand side to 7 makes the system inconsistent. The coefficient matrix has rank 1 in both cases, but the right-hand side changes consistency.
E. Composition explains matrix multiplication#
Suppose and . The composition has matrix . Column of is applied to column of . Dimensions enforce which multiplication is meaningful; the order follows the function composition. In general , even when both products exist.
A planar rotation and nonuniform scaling demonstrate the difference. With
, whereas . Applying local scale before world rotation is not the same as scaling along world axes afterward. Translation is affine, not linear when , because it does not send zero to zero. Homogeneous coordinates encode an affine map in a larger matrix, but they do not make the original translation a linear map on the original vector space.
F. Inverses and determinants: useful but not universal tools#
For a square matrix, invertibility, full rank, trivial null space, independent columns, and nonzero determinant are equivalent. The inverse undoes the map. To solve one numerical system, elimination or a factorization is generally preferable to explicitly forming an inverse: the inverse computes more information than the requested solution and can introduce avoidable work or error. [LA]
In two dimensions, is an oriented area scale factor. Its absolute value describes area scaling; its sign distinguishes orientation preservation from reversal. A zero determinant identifies dimension collapse. It is not a general measure of numerical quality: has determinant 1 but stretches different directions by vastly different amounts. Conditioning in A05 and singular values in A02 explain that problem more accurately.
G. Independent practice#
F foundation C standard course work T transfer S optional stretch L runnable lab or project. Attempt the complete set before opening its solutions.
Solve , by a different elimination order than the worked example. Substitute the answer into both original equations. Identify the two column vectors whose combination equals .
For , find its rank, a basis for its null space, and one solution to . Explain why the solution is not unique.
Find the coordinates of in the basis , . Prove these two vectors are a basis, and distinguish coordinates from the geometric vector.
Compute and for the matrices above. Give a vector witnessing their difference. Explain why the determinant alone cannot distinguish all different transformations.
Implement exact elimination with Fraction in linear_lab.py. Support nonempty square systems with a unique solution, pivot by swapping to a nonzero row, copy the inputs, and reject a singular system or incompatible dimensions. Test a system requiring a row swap and compare generated solutions by substitution. State why this exact rational lab is not a high-performance floating-point solver.
Optional small hints
A01.02: use the third unknown as a free parameter. A01.03: solve . A01.05: a nonzero pivot is enough over exact rationals; floating-point pivot quality is a separate issue.
H. Complete solutions: A01#
Compare the first step where your work differs. A corrected answer is not yet an independent success.
A01.01Show solution
Eliminate the other variable first
Subtract twice the second equation from the first: , so and . The second equation then gives . Verification: and . The columns are and ; the output is . This vector equation and the two scalar equations describe the same constraints.
Back to A01.01A01.02Show solution
Free variables are lost input directions
The second row gives in the homogeneous system. Let ; then , and the first row gives , so . A null-space basis is . The two rows have distinct pivot positions, so rank is 2 and nullity is . For the stated right-hand side, taking gives , . Every solution is . Substitution gives for all . The nonzero null direction proves nonuniqueness.
Back to A01.02A01.03Show solution
Coordinates depend on the chosen basis
The equations are and . Adding yields , so and . The homogeneous equations yield , proving independence. Two independent vectors in form a basis, or directly solve the same system for arbitrary target to obtain . The coordinate tuple in this basis represents the vector with standard coordinates ; it is not a contradiction or a change in the physical displacement.
Back to A01.03A01.04Show solution
Order is part of the operation
The vector gives outputs and . Both determinants equal 2, since both compositions multiply oriented area by 2. A determinant records only one scalar summary of a transformation, not its complete action on every direction. Equal determinants do not imply equal maps or equal conditioning.
Back to A01.04A01.05Show solution
Reference implementation and exactness boundary
"""A01.05: exact Gaussian elimination on small rational systems."""
from fractions import Fraction
def solve_exact(a: list[list], b: list) -> list[Fraction]:
n = len(a)
if n == 0 or len(b) != n or any(len(row) != n for row in a):
raise ValueError("nonempty square system required")
m = [[Fraction(v) for v in row] + [Fraction(rhs)]
for row, rhs in zip(a, b)]
for k in range(n):
pivot = next((i for i in range(k, n) if m[i][k] != 0), None)
if pivot is None:
raise ValueError("system is not uniquely solvable")
m[k], m[pivot] = m[pivot], m[k]
for i in range(k + 1, n):
factor = m[i][k] / m[k][k]
for j in range(k, n + 1):
m[i][j] -= factor * m[k][j]
x = [Fraction(0)] * n
for i in range(n - 1, -1, -1):
x[i] = (m[i][n] - sum(m[i][j] * x[j]
for j in range(i + 1, n))) / m[i][i]
return x
if __name__ == "__main__":
print(solve_exact([[2, 1], [1, -1]], [5, 1]))A row swap preserves the equations. Dividing the pivot row by its nonzero pivot and eliminating that column from other rows preserves the solution set while fixing a variable’s coefficient. After all columns, the coefficient matrix is the identity, so the augmented column is the unique solution. Failure to find a pivot in a square coefficient matrix means it is singular; this bounded interface rejects it rather than classifying all consistent and inconsistent singular cases. Rational arithmetic avoids rounding, but numerator and denominator sizes can grow substantially. The nested elimination work is cubic in matrix dimension when individual arithmetic operations are treated as unit cost; exact bit complexity is larger. Test generated systems with known , form , solve, and substitute back. The tests are independent numerical evidence in addition to the reversible-row-operation argument.
Back to A01.05I. Retention and readiness#
Retrieve function composition from Module 03 and the difference between a factor and an additive term from Module 01. Advance when you can explain both as equations and as a column combination, and can recognize a free variable without treating it as a missing calculation.