Back to the Electrical Engineering roadmap

Linear Algebra I · Fundamental subspaces and solvability

Prerequisites: Gaussian elimination, pivot columns, bases and rank–nullity, transpose, orthogonal projection and least squares. Goals: identify all four fundamental subspaces with their ambient dimensions, prove the two orthogonal-complement relations, test consistency using the left nullspace, and distinguish a unique fitted vector from unique coefficients and a minimum-norm solution. This coverage-review bridge joins earlier topics before the cumulative final; it does not assume a matrix inverse or introduce a general pseudoinverse algorithm.

Review bases and rank · Review projection · Review least squares

Four spaces, two different ambient spaces

Let A be a real m×n matrix of rank r. The column space C(A)={Ax:x∈ℝⁿ} lies in ℝᵐ and has dimension r. The nullspace N(A)={x∈ℝⁿ:Ax=0} lies in ℝⁿ and has dimension n−r. The row space C(Aᵀ), the span of the rows regarded as column vectors, lies in ℝⁿ and has dimension r. The left nullspace N(Aᵀ)={y∈ℝᵐ:Aᵀy=0} lies in ℝᵐ and has dimension m−r. “Left” means yᵀA=0ᵀ; it does not move this space into ℝⁿ. A basis of the zero subspace is the empty list, of dimension zero.

Why both row and column dimensions equal r: reversible row operations preserve the row span. The nonzero rows in reduced echelon form are independent and form a row-space basis; there are r pivots. Pivot columns of the ORIGINAL A form a column-space basis, also of size r, as proved in the bases lesson. Thus rank(Aᵀ)=rank(A)=r. Applying rank–nullity to A and Aᵀ gives n−r and m−r. Do not extract a basis of C(A) from columns of the reduced matrix: row operations preserve column relations but can change the column space itself.

Orthogonal complements and unique decomposition

For a subspace W⊆ℝᵈ, define W⊥={v:vᵀw=0 for every w∈W}. A vector orthogonal to a basis is orthogonal to every linear combination, so testing a basis suffices. Orthogonality of two individual vectors is not the same as equality of two complementary subspaces. An orthonormal basis q₁,…,qₖ of W can be extended by Gram–Schmidt to an orthonormal basis of ℝᵈ. The last d−k vectors span W⊥: their coefficients are exactly the components perpendicular to W. Hence dim(W⊥)=d−k, and every v decomposes uniquely as v=vW+v⊥, with perpendicular terms. Uniqueness follows because W∩W⊥={0}.

The fundamental identities are N(A)=C(Aᵀ)⊥ and N(Aᵀ)=C(A)⊥. Proof of the first: Ax=0 says the dot product of every row with x is zero, exactly perpendicularity to their span. The second is the same argument for Aᵀ. Consequently ℝⁿ=C(Aᵀ)⊕N(A) and ℝᵐ=C(A)⊕N(Aᵀ), where ⊕ means every vector has a unique sum of components in the indicated spaces. The dimensions add to n and m respectively, not to a single combined ambient dimension.

Input ℝⁿOutput ℝᵐRow spaceColumn spaceNullspaceLeft nullspace C(Aᵀ)C(A)dim = rdim = r⊥⊥N(A)N(Aᵀ)dim = n−rdim = m−rAAx=A xrow; A xnull=0b=p+r; p⊥r
Original schematic: complementary pairs live in different ambient spaces. Restricted to the row space, A is a bijection onto its column space; the nullspace contributes no output. Box positions do not depict angles or lengths.

Consistency, fitted outputs, and minimum norm

Ax=b is solvable exactly when b∈C(A), equivalently yᵀb=0 for EVERY y∈N(Aᵀ). This follows from C(A)=N(Aᵀ)⊥; testing a left-nullspace basis is enough. Necessity can also be checked directly: yᵀb=yᵀAx=0. If xₚ is one exact solution, every exact solution is xₚ+z with z∈N(A), since A(x−xₚ)=0. A consistent system has unique coefficients exactly when N(A)={0}, not merely when its fitted output is unique.

For arbitrary b, split b=p+r with p∈C(A), r∈N(Aᵀ), and p⊥r. For any q∈C(A), ||b−q||²=||r||²+||p−q||², so p is the unique closest output. Coefficients producing p may still differ by N(A). They satisfy Aᵀ(b−Ax)=0, the normal equations already derived in the least-squares lesson. Among all such coefficients, the unique minimum-norm vector lies in C(Aᵀ): write x=xrow+z with z∈N(A), then Ax=Axrow and ||x||²=||xrow||²+||z||². This proves the minimum and its uniqueness without inverting a singular AᵀA.

A restricted to its row space is one-to-one because its kernel there is C(Aᵀ)∩N(A)={0}. It is onto C(A): decompose any input into row and null parts and discard the null part without changing Ax. Thus the diagram’s r-dimensional arrow is a bijection even when A is rectangular or singular on its full input space.

Worked examples

  1. A wide matrix: B=[1 0 1;0 1 1] is 2×3 with rank 2. A column basis is {(1,0),(0,1)}; a row-space basis is {(1,0,1),(0,1,1)}. N(B)=span{(−1,−1,1)} and N(Bᵀ)={0}. Every b=(a,c) is solvable, with x=(a−t,c−t,t); no b has unique coefficients. Row vectors are perpendicular to (−1,−1,1), confirming the complement relation in ℝ³. The column and left-null spaces live instead in ℝ².
  2. Redundant rows and columns: A=[1 2 0;0 0 1;1 2 1] reduces to [1 2 0;0 0 1;0 0 0]. Rank is 2. Use original columns 1 and 3 for C(A): (1,0,1),(0,1,1). A row basis is (1,2,0),(0,0,1). N(A)=span{z} with z=(−2,1,0); N(Aᵀ)=span{w} with w=(−1,−1,1). Multiplication verifies Az=0 and Aᵀw=0. Thus b is compatible iff b₃=b₁+b₂. For b=(1,2,3), all solutions are (1−2s,s,2). Perpendicularity to z requires −2+5s=0, giving minimum-norm x=(1/5,2/5,2).
  3. Inconsistency does not prevent a best fit: keep A from example 2 and take b=(1,2,4). Since wᵀb=1, no exact solution exists. Project onto span{w}: r=(wᵀb/wᵀw)w=w/3, so p=b−r=(4/3,7/3,11/3). Every least-squares coefficient vector solves Ax=p and has form (4/3−2s,s,7/3). The row-space condition gives s=8/15 and xrow=(4/15,8/15,7/3). All xrow+t z give the same fit and squared data error 1/3, but their squared coefficient norms are 29/5+5t², uniquely minimized at t=0.
  4. A tall matrix with unique coefficients: C=[1 0;0 1;1 1] has rank 2, N(C)={0}, C(Cᵀ)=ℝ², and N(Cᵀ)=span{(−1,−1,1)}. Exact solutions require b₃=b₁+b₂ and, when they exist, x=(b₁,b₂) is unique. For b=(0,0,1), the closest output is (1/3,1/3,2/3), giving unique least-squares coefficients (1/3,1/3), despite there being no exact solution. Tall shape alone is not a uniqueness proof; full column rank is the decisive condition.

Common mistakes and checks

Keep m and n attached to the correct ambient spaces. Find left-null vectors by solving Aᵀy=0, not Ax=0. One left-null vector is enough for the example’s one-dimensional space, but not for an arbitrary higher-dimensional left nullspace. Do not confuse a unique fitted output with unique coefficients, and do not invert a singular AᵀA. Minimum data error and minimum coefficient norm are different optimizations. Small rounded residuals in measured data do not establish exact compatibility or rank.

Practice

  1. For a real 4×6 matrix of rank 3, give the ambient space and dimension of all four subspaces. Can every b have an exact solution? Can a consistent system have unique coefficients?
  2. For A=[1 2 0;0 0 1;1 2 1], test b=(2,−1,1), write all exact solutions, and find the one of minimum norm.
  3. For the same A and b=(0,0,3), compute residual, fitted output, all least-squares solutions, and the unique minimum-norm coefficient vector.
  4. If the columns of an m×n matrix are independent, what are N(A) and dim N(Aᵀ)? Does column independence guarantee that every b∈ℝᵐ is solvable? Explain.
Fully worked solutions
  1. C(A)⊆ℝ⁴ has dimension 3; N(A)⊆ℝ⁶ has dimension 3; C(Aᵀ)⊆ℝ⁶ has dimension 3; N(Aᵀ)⊆ℝ⁴ has dimension 1. Some b lie outside the three-dimensional column space, so not every b is solvable. A consistent system has a three-dimensional nullspace of coefficient changes and cannot have unique coefficients.
  2. The defect is 1−2−(−1)=0, so it is consistent. All solutions are (2−2s,s,−1). Dotting with z=(−2,1,0) gives −4+5s=0, so s=4/5 and xrow=(2/5,4/5,−1). Adding any nonzero multiple of z increases squared norm by 5t².
  3. Defect d=3, so r=w=(−1,−1,1), p=b−r=(1,1,2). All coefficient vectors are (1−2s,s,1). Perpendicularity to z requires s=2/5, giving xrow=(1/5,2/5,1). The data error is ||r||²=3 for every such coefficient vector, but only xrow has minimum norm.
  4. Rank is n, so N(A)={0} and dim N(Aᵀ)=m−n. Coefficients are unique whenever an exact solution exists. Every b is solvable only if rank=m as well, hence only if m=n in the full-column-rank situation. A tall full-column-rank matrix generally has incompatible right-hand sides.

Assessment · Open book · 18 points

Open book: use books, lesson notes, cited readings, calculators, and relevant free software. Explain your own reasoning, assumptions, units, and checks; identify references or software you use. Attempt the questions before opening the answer key. Suggested study time: 40–60 minutes; this is a self-study guide, not a timed restriction.

References and relevant free software are allowed. State ambient dimensions and justify compatibility and uniqueness. The application question adds 6 points to these 12.

  1. For B=[1 0 1;0 1 1], give bases and dimensions of all four fundamental subspaces. (4)
  2. For A=[1 2 0;0 0 1;1 2 1] and b=(1,0,2), test exact compatibility, calculate the closest output and residual, and find the minimum-norm least-squares coefficient vector. (5)
  3. Prove that xrow is the unique minimum-norm coefficient vector among xrow+z with z∈N(A), provided xrow∈C(Aᵀ). Explain what remains unchanged when z is added. (3)

Application and reasoning · 6 points

For M=[1 1;2 2;0 0], b=(1,3,2), a reviewer claims that a unique least-squares fitted output guarantees unique coefficients and recommends (MᵀM)⁻¹Mᵀb. Diagnose the claim with rank and nullspace (2). Find the closest output and squared data error (2). Find the minimum-norm coefficient vector and explain why that extra choice does not make the coefficients identifiable from these data alone (2).

Complete answer key and scoring rubric
  1. Column basis {(1,0),(0,1)} in ℝ², dimension 2 (1). Row basis {(1,0,1),(0,1,1)} in ℝ³, dimension 2 (1). Null basis {(−1,−1,1)} in ℝ³, dimension 1 (1). Left nullspace {0} in ℝ², empty basis, dimension 0 (1).
  2. wᵀb=−1+0+2=1≠0, so no exact solution (1). Since wᵀw=3, r=w/3 (1), and p=(4/3,1/3,5/3) (1). Solve Ax=p: x=(4/3−2s,s,1/3) (1). Requiring xᵀz=0 gives s=8/15 and xrow=(4/15,8/15,1/3); verify Axrow=p and Aᵀr=0 (1).
  3. The complement identity gives xrowᵀz=0 (1), so ||xrow+z||²=||xrow||²+||z||², minimized only at z=0 (1). Since Az=0, the fitted vector and therefore the data residual stay unchanged (1).

Application and reasoning · 6 points

Rank is 1 and N(M)=span{(1,−1)}, so coefficients differing by that vector have identical output (1). MᵀM=[5 5;5 5] is singular, so the proposed inverse is invalid (1). Project onto v=(1,2,0): α=(vᵀb)/(vᵀv)=7/5, giving p=(7/5,14/5,0) (1); residual (−2/5,1/5,2) has squared norm 21/5 (1). Coefficients satisfy x₁+x₂=7/5; orthogonality to (1,−1) gives xrow=(7/10,7/10) (1). Every xrow+t(1,−1) has the same data fit and squared norm 49/50+2t²; minimum norm selects t=0 mathematically, while the observations alone cannot distinguish t (1).

Scoring: existing questions 12 + application problem 6 = 18 points. Award the stated method and reasoning marks, not only final answers.

Download the subspace-and-compatibility lab

Download the exact-fraction Python lab

Objective: with fixed A=[1 2 0;0 0 1;1 2 1], vary b and a nullspace offset t, separate incompatibility from coefficient ambiguity, and compare minimum data error with minimum coefficient norm. Install free Python 3 for Windows, macOS or Linux from the official link below. Save the file, open a terminal in its folder, and run each command. Windows can use py -3 instead of python3. No account, institutional access, extra packages or paid license is required; the file runs offline after installation. Inputs b₁,b₂,b₃,t lie from −4 to 6 in half-unit steps, including negative fractions such as -1/2.

python3 ee-fundamental-subspaces.py 1 2 3 0
python3 ee-fundamental-subspaces.py 1 2 3 1
python3 ee-fundamental-subspaces.py 1 2 4 0
python3 ee-fundamental-subspaces.py 1 2 4 1
python3 ee-fundamental-subspaces.py 0 0 0 0
python3 ee-fundamental-subspaces.py -1/2 1/2 0 -1/2

Procedure: predict the defect d=b₃−b₁−b₂, residual r=(d/3)(−1,−1,1), fit p=b−r, minimum-norm xrow=(p₁/5,2p₁/5,p₂), and trial x=xrow+t(−2,1,0). Expected squared data errors are 0,0,1/3,1/3,0,0. The first two commands share fit (1,2,3), with trial vectors (1/5,2/5,2) and (−9/5,7/5,2). The next pair shares fit (4/3,7/3,11/3), with trial vectors (4/15,8/15,7/3) and (−26/15,23/15,7/3). The last two trials are (0,0,0) and (9/10,−7/10,1/2). Compare with the browser alternative. Python verifies null vectors, normal residual, fit, exact compatibility, and the excess coefficient norm 5t².

Questions with answers: why does changing t leave the fit unchanged? Az=0. Why do the first two runs have equal zero data error but different coefficient norms? Both are exact solutions, but only t=0 has no nullspace component. Why is an inconsistent case still labeled least-squares solvable? Its projection p always belongs to C(A). Browser calculations use floating point and six-decimal displays, with entrywise scaled tolerance 10⁻⁹·max(1,|reference|). Compatibility is tested algebraically from the half-unit inputs, not inferred from a rounded residual. The activity is a fixed, dimensionless synthetic measurement model, not a general rank detector, calibration procedure or substitute for physical instrumentation skills.

Free primary readings and coverage checkpoint

Read Georgia Tech §6.2 for complements and row rank, then MIT Lecture 10 and its summary for the four subspaces. Revisit the least-squares lesson to connect its normal equations to the output decomposition proved here. The review found that earlier lessons covered column spaces and rank–nullity but had not explicitly taught row/left-null complement geometry; this unit supplies that bridge. Pivoted LU is now available in the next lesson; the cumulative review and practice final follows it. MIT’s wider course also includes topics beyond this independent sequence, such as SVD; its entire syllabus is not claimed as completed. All linked readings are public without a university login or textbook purchase.

Subspaces lab · Separate compatibility and ambiguity

For A=[1 2 0;0 0 1;1 2 1], compare exact solvability, projection, and coefficient norm.

Free tool built into this page. Use it in your browser without an account or download.

Procedure

Try (b₁,b₂,b₃,t)=(1,2,3,0),(1,2,3,1),(1,2,4,0),(1,2,4,1),(0,0,0,0),(−1/2,1/2,0,−1/2). Predict compatibility, fit, residual and trial coefficients before running. In this browser, enter fractions as decimal halves, such as −0.5. Compare with Python.

Expected results and answer check

Data errors are 0,0,1/3,1/3,0,0. The first pair shares fit (1,2,3); the second pair shares fit (4/3,7/3,11/3). Changing t changes coefficients by t(−2,1,0) and adds 5t² to their squared norm without changing the fit. Only t=0 selects the minimum-norm member.

Python uses exact fractions. Browser calculations use floating point, entrywise scaled tolerance 1e−9 and rounded displays. This fixed synthetic model does not infer rank or calibration from noisy measurements.