Chapter 3: Matrix Calculus and Linear Differential Equations
Lesson 1: Matrix Operations, Rank, and Null Space
This lesson consolidates matrix operations as algebraic representations of linear transformations, then develops rank and null space as rigorous invariants that quantify linear dependence, solvability of linear systems, and degrees of freedom in homogeneous constraints. We prove the Rank–Nullity Theorem, establish key rank identities and inequalities, and present practical algorithms (exact and numerical) to compute rank and null bases—tools that will later reappear as rank conditions in modern state-space control.
1. Conceptual Overview
A matrix \( \mathbf{A} \in \mathbb{R}^{m \times n} \) simultaneously encodes: (i) a linear transformation \( T_{\mathbf{A}}:\mathbb{R}^n \to \mathbb{R}^m \) via \( T_{\mathbf{A}}(\mathbf{x})=\mathbf{A}\mathbf{x} \), and (ii) a system of linear equations \( \mathbf{A}\mathbf{x}=\mathbf{b} \).
Two subspaces govern the structure of \( \mathbf{A} \): the column space (all achievable outputs \( \mathbf{A}\mathbf{x} \)) and the null space (all inputs mapped to zero). The dimension of the column space is the rank, and the dimension of the null space is the nullity. Their sum equals the number of columns.
flowchart TD
X["Input space R^n"] -->|"x"| T["Linear map: x -> A x"]
T --> Y["Output space R^m"]
subgraph S1["Subspaces determined by A"]
CS["ColSpace(A): reachable outputs"]
NS["NullSpace(A): solutions of A x = 0"]
end
X --> NS
T --> CS
note1["dim(ColSpace(A)) = rank(A)"]
note2["dim(NullSpace(A)) = nullity(A)"]
CS --> note1
NS --> note2
In control engineering, these notions become operational: rank reveals redundancy and constraints in multi-input–multi-output algebra, while null spaces parameterize families of solutions. Later (after state-space models are introduced), rank conditions will serve as precise tests for structural properties.
2. Core Matrix Operations and Identities
Let \( \mathbf{A},\mathbf{B}\in\mathbb{R}^{m\times n} \), \( \mathbf{C}\in\mathbb{R}^{n\times p} \), and \( \alpha\in\mathbb{R} \). Matrix addition and scalar multiplication are entrywise:
\[ (\mathbf{A}+\mathbf{B})_{ij} = a_{ij}+b_{ij},\qquad (\alpha\mathbf{A})_{ij} = \alpha a_{ij}. \]
Matrix multiplication is defined by dot products of rows and columns:
\[ (\mathbf{A}\mathbf{C})_{ik} = \sum_{j=1}^{n} a_{ij}c_{jk}. \]
The transpose satisfies \( (\mathbf{A}^T)_{ij}=a_{ji} \) and the fundamental identities:
\[ (\mathbf{A}+\mathbf{B})^T = \mathbf{A}^T+\mathbf{B}^T,\quad (\alpha\mathbf{A})^T = \alpha\mathbf{A}^T,\quad (\mathbf{A}\mathbf{C})^T = \mathbf{C}^T\mathbf{A}^T. \]
Proof of \( (\mathbf{A}\mathbf{C})^T=\mathbf{C}^T\mathbf{A}^T \).
For any indices \( k,i \):
\[ \big((\mathbf{A}\mathbf{C})^T\big)_{ki} = (\mathbf{A}\mathbf{C})_{ik} = \sum_{j=1}^{n} a_{ij}c_{jk} = \sum_{j=1}^{n} (c_{jk})(a_{ij}) = \sum_{j=1}^{n} (\mathbf{C}^T)_{kj}(\mathbf{A}^T)_{ji} = (\mathbf{C}^T\mathbf{A}^T)_{ki}. \]
A square matrix \( \mathbf{A}\in\mathbb{R}^{n\times n} \) is invertible if there exists \( \mathbf{A}^{-1} \) such that \( \mathbf{A}^{-1}\mathbf{A}=\mathbf{I} \) and \( \mathbf{A}\mathbf{A}^{-1}=\mathbf{I} \). Invertibility is equivalent to having full rank: \( \operatorname{rank}(\mathbf{A})=n \).
3. Rank — Definitions, Equivalences, and Inequalities
The rank of \( \mathbf{A}\in\mathbb{R}^{m\times n} \) can be defined in multiple (equivalent) ways. Let the columns be \( \mathbf{a}_1,\dots,\mathbf{a}_n \).
Definition (column-rank).
\[ \operatorname{rank}(\mathbf{A}) \;=\; \dim\big(\operatorname{Col}(\mathbf{A})\big) \;=\; \dim\big(\operatorname{span}\{\mathbf{a}_1,\dots,\mathbf{a}_n\}\big). \]
Definition (row-rank). If \( \mathbf{r}_1^T,\dots,\mathbf{r}_m^T \) are the rows, then
\[ \operatorname{rank}(\mathbf{A}) \;=\; \dim\big(\operatorname{Row}(\mathbf{A})\big) \;=\; \dim\big(\operatorname{span}\{\mathbf{r}_1,\dots,\mathbf{r}_m\}\big). \]
Theorem (row rank equals column rank). The two definitions coincide.
Proof (via elementary operations and reduced row echelon form).
Apply elementary row operations to transform \( \mathbf{A} \) to a reduced row echelon form (RREF) \( \mathbf{R} \). Row operations correspond to left multiplication by an invertible matrix \( \mathbf{E} \), hence \( \mathbf{R}=\mathbf{E}\mathbf{A} \). Because \( \mathbf{E} \) is invertible, the row space dimension is preserved: \( \dim(\operatorname{Row}(\mathbf{R}))=\dim(\operatorname{Row}(\mathbf{A})) \).
In RREF, the number of nonzero rows equals the number of pivot columns; call this number \( r \). The nonzero rows are linearly independent, so \( \dim(\operatorname{Row}(\mathbf{R}))=r \). Also, the pivot columns of \( \mathbf{R} \) are linearly independent, so \( \dim(\operatorname{Col}(\mathbf{R}))=r \).
Finally, since \( \mathbf{R}=\mathbf{E}\mathbf{A} \) with invertible \( \mathbf{E} \), left multiplication is a bijection on \( \mathbb{R}^m \), hence it preserves linear dependence among columns: \( \dim(\operatorname{Col}(\mathbf{R}))=\dim(\operatorname{Col}(\mathbf{A})) \). Therefore, both row rank and column rank equal \( r \).
Rank bounds.
\[ 0 \le \operatorname{rank}(\mathbf{A}) \le \min(m,n). \]
Product inequality. For compatible sizes:
\[ \operatorname{rank}(\mathbf{A}\mathbf{C}) \le \min\big(\operatorname{rank}(\mathbf{A}),\operatorname{rank}(\mathbf{C})\big). \]
Proof. The columns of \( \mathbf{A}\mathbf{C} \) lie in \( \operatorname{Col}(\mathbf{A}) \) because each column of \( \mathbf{A}\mathbf{C} \) is \( \mathbf{A} \) times a vector (a column of \( \mathbf{C} \)). Hence \( \operatorname{Col}(\mathbf{A}\mathbf{C}) \subseteq \operatorname{Col}(\mathbf{A}) \), so \( \dim(\operatorname{Col}(\mathbf{A}\mathbf{C})) \le \dim(\operatorname{Col}(\mathbf{A})) \). A symmetric argument with transposes yields the other bound.
Rank under invertible transformations. If \( \mathbf{P}\in\mathbb{R}^{m\times m} \) and \( \mathbf{Q}\in\mathbb{R}^{n\times n} \) are invertible, then
\[ \operatorname{rank}(\mathbf{P}\mathbf{A}\mathbf{Q}) = \operatorname{rank}(\mathbf{A}). \]
This is crucial in practice: algorithmic row/column operations do not change rank, and later coordinate changes in control will preserve rank-based properties.
4. Null Space and the Rank–Nullity Theorem
Definition (null space / kernel).
\[ \mathcal{N}(\mathbf{A}) \;=\; \{\mathbf{x}\in\mathbb{R}^n : \mathbf{A}\mathbf{x}=\mathbf{0}\}. \]
\( \mathcal{N}(\mathbf{A}) \) is a subspace of \( \mathbb{R}^n \). Its dimension is the nullity of \( \mathbf{A} \).
Lemma. \( \mathcal{N}(\mathbf{A}) \) is a linear subspace.
Proof. If \( \mathbf{A}\mathbf{x}_1=\mathbf{0} \) and \( \mathbf{A}\mathbf{x}_2=\mathbf{0} \), then for any scalars \( \alpha,\beta \):
\[ \mathbf{A}(\alpha\mathbf{x}_1+\beta\mathbf{x}_2) = \alpha\mathbf{A}\mathbf{x}_1+\beta\mathbf{A}\mathbf{x}_2 = \alpha\mathbf{0}+\beta\mathbf{0}=\mathbf{0}. \]
Theorem (Rank–Nullity). For \( \mathbf{A}\in\mathbb{R}^{m\times n} \):
\[ \operatorname{rank}(\mathbf{A}) + \operatorname{nullity}(\mathbf{A}) = n. \]
Proof (basis decomposition).
Consider the linear transformation \( T_{\mathbf{A}}(\mathbf{x})=\mathbf{A}\mathbf{x} \). Let \( \{\mathbf{v}_1,\dots,\mathbf{v}_k\} \) be a basis for \( \mathcal{N}(\mathbf{A}) \), where \( k=\operatorname{nullity}(\mathbf{A}) \). Extend this basis to a basis of \( \mathbb{R}^n \) by adding vectors \( \mathbf{v}_{k+1},\dots,\mathbf{v}_n \).
We claim that \( \{\mathbf{A}\mathbf{v}_{k+1},\dots,\mathbf{A}\mathbf{v}_{n}\} \) is a basis for \( \operatorname{Col}(\mathbf{A}) \).
(Spanning) Take any \( \mathbf{y}\in\operatorname{Col}(\mathbf{A}) \), so \( \mathbf{y}=\mathbf{A}\mathbf{x} \). Expand \( \mathbf{x}=\sum_{i=1}^{n} c_i\mathbf{v}_i \). Then
\[ \mathbf{y}=\mathbf{A}\mathbf{x}=\sum_{i=1}^{n} c_i\mathbf{A}\mathbf{v}_i = \sum_{i=1}^{k} c_i\mathbf{A}\mathbf{v}_i + \sum_{i=k+1}^{n} c_i\mathbf{A}\mathbf{v}_i = \sum_{i=k+1}^{n} c_i\mathbf{A}\mathbf{v}_i \]
because \( \mathbf{A}\mathbf{v}_i=\mathbf{0} \) for \( i\le k \). Thus the images span the column space.
(Independence) Suppose \( \sum_{i=k+1}^{n} c_i\mathbf{A}\mathbf{v}_i=\mathbf{0} \). Then \( \mathbf{A}\left(\sum_{i=k+1}^{n} c_i\mathbf{v}_i\right)=\mathbf{0} \), so \( \sum_{i=k+1}^{n} c_i\mathbf{v}_i \in \mathcal{N}(\mathbf{A}) \). But any vector in \( \mathcal{N}(\mathbf{A}) \) is a combination of \( \mathbf{v}_1,\dots,\mathbf{v}_k \). Since \( \mathbf{v}_1,\dots,\mathbf{v}_n \) are linearly independent, this forces \( c_i=0 \) for all \( i=k+1,\dots,n \). Hence the images are independent.
Therefore, \( \dim(\operatorname{Col}(\mathbf{A})) = n-k \), i.e. \( \operatorname{rank}(\mathbf{A}) = n-\operatorname{nullity}(\mathbf{A}) \).
Solvability of \( \mathbf{A}\mathbf{x}=\mathbf{b} \).
The equation has a solution iff \( \mathbf{b}\in\operatorname{Col}(\mathbf{A}) \). If \( \mathbf{x}_p \) is one solution, then all solutions are \( \mathbf{x}=\mathbf{x}_p+\mathbf{x}_0 \) where \( \mathbf{x}_0\in\mathcal{N}(\mathbf{A}) \).
\[ \mathbf{A}\mathbf{x}=\mathbf{b} \;\Longleftrightarrow\; \mathbf{A}(\mathbf{x}_p+\mathbf{x}_0)=\mathbf{A}\mathbf{x}_p+\mathbf{A}\mathbf{x}_0 =\mathbf{b}+\mathbf{0}=\mathbf{b}. \]
5. Computing Rank and a Null Basis (Exact and Numerical)
The most instructive exact method is Gaussian elimination. Row-reducing \( \mathbf{A} \) to RREF yields: (i) rank = number of pivots, and (ii) a parameterization of the null space by free variables.
flowchart TD
A0["Input matrix A (m x n)"] --> S0["Row reduction to echelon / RREF"]
S0 --> P0["Identify pivot columns and free columns"]
P0 --> R0["rank(A) = number of pivots"]
P0 --> N0["Solve A x = 0 using free variables"]
N0 --> B0["Construct null-space basis vectors"]
B0 --> C0["Check: A * v_i = 0 for each basis vector"]
RREF-based null space construction (outline).
Suppose RREF yields a system where pivot variables are expressed in terms of free variables. Let the free variables be \( x_{f_1},\dots,x_{f_k} \). For each free variable, set it to 1 and the other free variables to 0, then solve for pivot variables. The resulting vector is one basis element of \( \mathcal{N}(\mathbf{A}) \). You obtain exactly \( k=\operatorname{nullity}(\mathbf{A}) \) basis vectors.
Numerical rank (floating-point).
In computation, exact zero pivots rarely occur due to rounding. A practical approach defines “numerical rank” by a tolerance: treat values with magnitude \( < \varepsilon \) as zero, where \( \varepsilon \) is chosen based on scale and machine precision. Many libraries implement rank and null-space extraction using stable decompositions.
6. Implementations (Python, C++, Java, MATLAB/Simulink, Wolfram Mathematica)
The goal is consistent, verifiable outputs: (i) compute rank, (ii) compute a basis for the null space, (iii) verify \( \mathbf{A}\mathbf{v}_i=\mathbf{0} \), and (iv) verify Rank–Nullity: \( \operatorname{rank}(\mathbf{A})+\dim(\mathcal{N}(\mathbf{A}))=n \).
6.1 Python (NumPy/SciPy/SymPy; optional Control Systems tooling later)
import numpy as np
A = np.array([[1., 2., 3., 1.],
[2., 4., 6., 2.],
[1., 1., 1., 0.]], dtype=float)
# Numerical rank (SVD-based internally)
rank_A = np.linalg.matrix_rank(A, tol=1e-10)
print("rank(A) =", rank_A)
# Null space via SVD (from scratch)
U, s, Vt = np.linalg.svd(A)
tol = 1e-10
null_mask = (s < tol)
# For rectangular matrices, s has length min(m,n); we need null vectors from Vt
# Null space dimension = n - rank
n = A.shape[1]
k = n - rank_A
null_basis = Vt[-k:, :].T # columns span null space
print("nullity(A) =", null_basis.shape[1])
print("rank + nullity =", rank_A + null_basis.shape[1], " (should equal n =", n, ")")
# Verification
residuals = A @ null_basis
print("||A * N||_F =", np.linalg.norm(residuals, ord="fro"))
# Exact rational null space (symbolic) using SymPy
import sympy as sp
As = sp.Matrix([[1,2,3,1],
[2,4,6,2],
[1,1,1,0]])
print("rank_sym(A) =", As.rank())
print("nullspace_sym(A) =", As.nullspace())
Notes: (i) for symbolic exactness, use
sympy.Matrix(...).nullspace(); (ii)
for numerical work, SVD-based null space is robust; (iii) later in the
course, the same linear algebra pipeline will be used to diagnose rank
conditions arising in modern control computations.
6.2 C++ (Eigen)
#include <iostream>
#include <Eigen/Dense>
int main() {
Eigen::MatrixXd A(3,4);
A << 1,2,3,1,
2,4,6,2,
1,1,1,0;
// Rank via SVD
Eigen::JacobiSVD<Eigen::MatrixXd> svd(A, Eigen::ComputeFullV);
Eigen::VectorXd s = svd.singularValues();
double tol = 1e-10;
int rank = 0;
for (int i = 0; i < s.size(); ++i) {
if (s(i) > tol) rank++;
}
int n = A.cols();
int nullity = n - rank;
std::cout << "rank(A) = " << rank << std::endl;
std::cout << "nullity(A) = " << nullity << std::endl;
std::cout << "rank + nullity = " << (rank + nullity) << " (should be " << n << ")" << std::endl;
// Null space basis from V (last columns corresponding to small singular values)
Eigen::MatrixXd V = svd.matrixV(); // n x n
Eigen::MatrixXd N = V.rightCols(nullity); // n x nullity
// Verify A*N ≈ 0
Eigen::MatrixXd R = A * N;
std::cout << "Frobenius norm ||A*N||_F = " << R.norm() << std::endl;
return 0;
}
Library note: Eigen is a standard choice for linear algebra in C++ control implementations (including embedded/control-adjacent code), because it offers efficient decompositions that stabilize rank and null computations.
6.3 Java (EJML)
import org.ejml.data.DMatrixRMaj;
import org.ejml.dense.row.CommonOps_DDRM;
import org.ejml.dense.row.SingularOps_DDRM;
import org.ejml.dense.row.decomposition.DecompositionFactory_DDRM;
import org.ejml.interfaces.decomposition.SingularValueDecomposition_F64;
public class RankNullspaceDemo {
public static void main(String[] args) {
DMatrixRMaj A = new DMatrixRMaj(new double[][]{
{1,2,3,1},
{2,4,6,2},
{1,1,1,0}
});
SingularValueDecomposition_F64<DMatrixRMaj> svd =
DecompositionFactory_DDRM.svd(A.numRows, A.numCols, true, true, false);
if (!svd.decompose(A.copy())) {
throw new RuntimeException("SVD failed");
}
double tol = 1e-10;
int rank = SingularOps_DDRM.rank(svd, tol);
int n = A.numCols;
int nullity = n - rank;
System.out.println("rank(A) = " + rank);
System.out.println("nullity(A) = " + nullity);
System.out.println("rank + nullity = " + (rank + nullity) + " (should be " + n + ")");
// Extract V and take last columns as null basis
DMatrixRMaj V = svd.getV(null);
DMatrixRMaj N = CommonOps_DDRM.extract(V, 0, V.numRows, rank, V.numCols);
// Verify A*N ≈ 0
DMatrixRMaj R = new DMatrixRMaj(A.numRows, N.numCols);
CommonOps_DDRM.mult(A, N, R);
double fro = CommonOps_DDRM.normF(R);
System.out.println("||A*N||_F = " + fro);
}
}
Library note: EJML is widely used for numerical linear algebra in Java-based engineering code; SVD-based rank/null space methods are preferred when working with floating-point matrices.
6.4 MATLAB and Simulink
% MATLAB: rank and null space
A = [1 2 3 1;
2 4 6 2;
1 1 1 0];
r = rank(A); % numerical rank
N = null(A,'r'); % rational basis if possible (symbolic-style), otherwise uses tolerance
disp(['rank(A) = ' num2str(r)]);
disp(['nullity(A) = ' num2str(size(N,2))]);
disp(['rank + nullity = ' num2str(r + size(N,2)) ' (should be n = ' num2str(size(A,2)) ')']);
disp('Frobenius norm ||A*N||_F = ');
disp(norm(A*N,'fro'));
% Exact row-reduction (RREF) for pedagogy
[R, piv] = rref(A);
disp('RREF(A) = '); disp(R);
disp('Pivot columns = '); disp(piv);
Simulink (programmatic model sketch). While Simulink is not a symbolic algebra system, you can compute rank/null space inside a MATLAB Function block for time-varying matrices.
% Build a minimal Simulink model that computes rank(A(t)) inside a MATLAB Function block
model = 'mc_rank_null_demo';
new_system(model); open_system(model);
add_block('simulink/Sources/Clock',[model '/Clock']);
add_block('simulink/User-Defined Functions/MATLAB Function',[model '/RankBlock']);
set_param([model '/RankBlock'], 'Script', sprintf([ ...
'function r = fcn(t)\n' ...
'%% Example time-varying matrix A(t)\n' ...
'A = [1 2 3 1; 2 4 6 2; 1 1 1 0] + 1e-3*sin(t)*[1 0 0 0; 0 0 0 0; 0 0 0 0];\n' ...
'r = rank(A);\n' ...
'end\n'
]));
add_block('simulink/Sinks/Display',[model '/Display']);
add_line(model,'Clock/1','RankBlock/1');
add_line(model,'RankBlock/1','Display/1');
set_param(model,'StopTime','10');
save_system(model);
Practical note: the time-varying perturbation illustrates why numerical rank depends on tolerance and matrix conditioning.
6.5 Wolfram Mathematica
A = { {1, 2, 3, 1},
{2, 4, 6, 2},
{1, 1, 1, 0} };
r = MatrixRank[A];
ns = NullSpace[A];
Print["rank(A) = ", r];
Print["nullity(A) = ", Length[ns]];
Print["rank + nullity = ", r + Length[ns], " (should be n = ", Length[A[[1]]], ")"];
(* Verification *)
res = A.# & /@ ns;
Print["A * v_i (each) = ", res];
(* Row reduction *)
rr = RowReduce[A];
Print["RowReduce(A) = ", rr];
7. Problems and Solutions
Problem 1 (Rank–Nullity verification on a concrete matrix). Let \( \mathbf{A}=\begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 6 & 2 \\ 1 & 1 & 1 & 0 \end{bmatrix} \). Compute \( \operatorname{rank}(\mathbf{A}) \) and a basis for \( \mathcal{N}(\mathbf{A}) \). Verify Rank–Nullity.
Solution. Row-reduce. Subtract \( 2 \) times row 1 from row 2:
\[ \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 6 & 2 \\ 1 & 1 & 1 & 0 \end{bmatrix} \;\sim\; \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0 \end{bmatrix}. \]
Now subtract row 1 from row 3:
\[ \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & -1 & -2 & -1 \end{bmatrix}. \]
There are two nonzero rows, hence \( \operatorname{rank}(\mathbf{A})=2 \). Since \( n=4 \), Rank–Nullity gives \( \operatorname{nullity}(\mathbf{A})=4-2=2 \).
Solve \( \mathbf{A}\mathbf{x}=\mathbf{0} \) using the reduced equations:
\[ \begin{aligned} x_1 + 2x_2 + 3x_3 + x_4 &= 0,\\ -x_2 - 2x_3 - x_4 &= 0. \end{aligned} \]
Let free variables be \( x_3=s \), \( x_4=t \). Then \( x_2 = -2s - t \) and \( x_1 = -2x_2 - 3s - t = -2(-2s-t)-3s-t = s + t \). Thus
\[ \mathbf{x} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = s\begin{bmatrix} 1 \\ -2 \\ 1 \\ 0 \end{bmatrix} + t\begin{bmatrix} 1 \\ -1 \\ 0 \\ 1 \end{bmatrix}. \]
A basis is \( \left\{\begin{bmatrix} 1 \\ -2 \\ 1 \\ 0 \end{bmatrix},\begin{bmatrix} 1 \\ -1 \\ 0 \\ 1 \end{bmatrix}\right\} \), which has dimension 2, matching nullity.
Problem 2 (Rank of a product). Prove that \( \operatorname{rank}(\mathbf{A}\mathbf{C}) \le \operatorname{rank}(\mathbf{A}) \) for compatible matrices \( \mathbf{A},\mathbf{C} \).
Solution. Let \( \mathbf{z} \) be any column of \( \mathbf{A}\mathbf{C} \). Then \( \mathbf{z}=\mathbf{A}\mathbf{c} \) for some vector \( \mathbf{c} \) (a column of \( \mathbf{C} \)), implying \( \mathbf{z}\in\operatorname{Col}(\mathbf{A}) \). Therefore \( \operatorname{Col}(\mathbf{A}\mathbf{C}) \subseteq \operatorname{Col}(\mathbf{A}) \), hence
\[ \operatorname{rank}(\mathbf{A}\mathbf{C}) = \dim(\operatorname{Col}(\mathbf{A}\mathbf{C})) \le \dim(\operatorname{Col}(\mathbf{A})) = \operatorname{rank}(\mathbf{A}). \]
Problem 3 (Invertibility via null space). Show that a square matrix \( \mathbf{A}\in\mathbb{R}^{n\times n} \) is invertible iff \( \mathcal{N}(\mathbf{A})=\{\mathbf{0}\} \).
Solution.
(Only if) If \( \mathbf{A} \) is invertible and \( \mathbf{A}\mathbf{x}=\mathbf{0} \), multiply by \( \mathbf{A}^{-1} \): \( \mathbf{x}=\mathbf{A}^{-1}\mathbf{0}=\mathbf{0} \). Thus the null space is trivial.
(If) If \( \mathcal{N}(\mathbf{A})=\{\mathbf{0}\} \), then the linear map \( T_{\mathbf{A}} \) is injective. For finite-dimensional spaces with equal dimension, injective implies surjective, so for every \( \mathbf{b}\in\mathbb{R}^n \) there exists a unique \( \mathbf{x} \) solving \( \mathbf{A}\mathbf{x}=\mathbf{b} \). This is equivalent to invertibility. Equivalently, Rank–Nullity gives \( \operatorname{rank}(\mathbf{A}) = n \).
Problem 4 (Solution set structure). Suppose \( \mathbf{A}\mathbf{x}=\mathbf{b} \) is consistent and \( \mathbf{x}_p \) is a particular solution. Prove that all solutions are \( \mathbf{x}_p + \mathcal{N}(\mathbf{A}) \).
Solution.
If \( \mathbf{x} \) is any solution, then \( \mathbf{A}(\mathbf{x}-\mathbf{x}_p)=\mathbf{A}\mathbf{x}-\mathbf{A}\mathbf{x}_p=\mathbf{b}-\mathbf{b}=\mathbf{0} \), so \( \mathbf{x}-\mathbf{x}_p\in\mathcal{N}(\mathbf{A}) \) and \( \mathbf{x}=\mathbf{x}_p+\mathbf{x}_0 \). Conversely, if \( \mathbf{x}=\mathbf{x}_p+\mathbf{x}_0 \) with \( \mathbf{A}\mathbf{x}_0=\mathbf{0} \), then \( \mathbf{A}\mathbf{x}=\mathbf{A}\mathbf{x}_p+\mathbf{A}\mathbf{x}_0=\mathbf{b} \).
Problem 5 (Rank–Nullity as a degree-of-freedom statement). Let \( \mathbf{A}\in\mathbb{R}^{m\times n} \) have rank \( r \). Show that the homogeneous system \( \mathbf{A}\mathbf{x}=\mathbf{0} \) has exactly \( n-r \) free parameters.
Solution. Row reduction identifies \( r \) pivot variables and \( n-r \) free variables. The null space is the set of all solutions and has dimension equal to the number of free parameters. By Rank–Nullity,
\[ \dim(\mathcal{N}(\mathbf{A})) = \operatorname{nullity}(\mathbf{A}) = n - \operatorname{rank}(\mathbf{A}) = n-r. \]
8. Summary
We formalized matrix operations as linear-map algebra, defined rank via row/column space dimensions, and developed null space as the solution space of homogeneous constraints. The Rank–Nullity Theorem was proven by basis extension and image independence, yielding a precise degrees-of-freedom interpretation. Finally, we outlined Gaussian-elimination-based computation (exact) and stable numerical computation (tolerance-aware), with implementations across Python, C++, Java, MATLAB/Simulink, and Mathematica.
9. References
- Moore, E.H. (1920). On the reciprocal of the general algebraic matrix. Bulletin of the American Mathematical Society, 26, 394–395.
- Penrose, R. (1955). A generalized inverse for matrices. Proceedings of the Cambridge Philosophical Society, 51(3), 406–413.
- Eckart, C., & Young, G. (1936). The approximation of one matrix by another of lower rank. Psychometrika, 1(3), 211–218.
- Householder, A.S. (1958). Unitary triangularization of a nonsymmetric matrix. Journal of the ACM, 5(4), 339–342.
- Golub, G.H., & Reinsch, C. (1970). Singular value decomposition and least squares solutions. Numerische Mathematik, 14, 403–420.
- Stewart, G.W. (1977). On the perturbation of pseudo-inverses, projections and linear least squares problems. SIAM Review, 19(4), 634–662.
- Demmel, J.W. (1987). The condition number of equivalence transformations that block diagonalize matrix pencils. SIAM Journal on Numerical Analysis, 24(3), 599–610.