AI Glossary / Mathematics and optimization / Intermediate

Nullspace

Definition

The nullspace of a matrix A is the set of all vectors x that the matrix maps to the zero vector: Ax=0. It describes directions that a linear transformation cannot distinguish from no change. The nullspace is a vector subspace of the input space and is also called the kernel of the linear map.

What it means

If A turns an input vector into a set of measurements or features, a nullspace direction is invisible to those outputs. For any n in the nullspace, A(x+n)=Ax+An=Ax. Two different inputs can therefore produce exactly the same transformed representation.

Every matrix has the zero vector in its nullspace. A trivial nullspace contains only that vector; a nontrivial nullspace contains nonzero directions as well. Nontrivial does not mean “incorrect.” Compression, projection, underdetermined equations, and redundant parameters naturally produce such directions, though their interpretation depends on the application.

How it works

To find an exact nullspace, solve the homogeneous linear system Ax=0. Row reduction can identify free variables and express every solution as a linear combination of basis vectors. For an m-by-n matrix of rank r, the nullspace dimension is n−r, by the rank-nullity relation.

Numerically, singular value decomposition can identify directions associated with zero or sufficiently small singular values. A tolerance determines what counts as numerically zero. Thus a computed numerical nullspace can depend on scale, precision, and a threshold, especially for nearly rank-deficient matrices.

For a consistent system Ax=b, one particular solution x_0 gives all solutions as x=x_0+n with n in the nullspace. Additional information, constraints, or regularization may select among these possibilities. Such selection does not change what the original linear measurements alone can distinguish.

Three practical examples

1. Feature compression: identify input changes erased by a linear projection into a lower-dimensional representation.

2. Regression analysis: understand coefficient directions that leave all training predictions unchanged when the design matrix has dependent columns.

3. Measurement systems: determine which combinations of unknown quantities cannot be recovered uniquely from the available linear measurements.

Think of it this way

Think of a recording system that stores only the total contents of two containers. Moving some material from one container to the other leaves the recorded total unchanged.

The analogy captures an invisible direction of change. It does not imply that the individual container quantities are unrestricted: physical limits can reduce the possible changes. Likewise, a matrix nullspace describes linear indistinguishability, while external constraints can still rule out some mathematically possible inputs.

Worked example

Let A have rows (1,1,0) and (0,1,1). For x=(x_1,x_2,x_3), the equation Ax=0 becomes x_1+x_2=0 and x_2+x_3=0. Set x_2=t; then x_1=−t and x_3=−t.

The nullspace is therefore {t(−1,1,−1):t is real}. It has dimension one. The two rows are independent, so rank(A)=2 and n−rank(A)=3−2=1, confirming the result.

Now take x_0=(2,3,4). Its output is Ax_0=(5,7). Adding the nullspace vector (−1,1,−1) gives x_1=(1,4,3), whose output is also (5,7). The transformation cannot distinguish these inputs.

In fact, every input producing (5,7) has form (2−t,3+t,4−t). If an application additionally requires all coordinates nonnegative, then −3≤t≤2. The constraint narrows the solution set but still leaves many possible inputs. A particular regularizer could choose one; it would not establish that the selected input was the uniquely observed truth.

An orthonormal nullspace basis could use (−1,1,−1)/sqrt3. Multiplying this basis vector by −1 gives an equally valid basis, so differing signs in software outputs need not indicate an error.

Illustrative case study

Fictional case study: an analytics team includes both a total count and the component counts that add up to it in a linear model. Several coefficient vectors produce the same predictions, causing confusion when different fitting routines return different coefficients.

The team examines the design matrix's dependent columns and nullspace. It then revises the representation or uses a documented regularization rule, depending on the analytical goal. Prediction equivalence does not justify attributing a unique effect to each redundant feature. The case illustrates identifiability, not a claim that every correlated-feature problem has an exact nullspace.

Common misconceptions and mistakes

Do not confuse the nullspace with the set of zero entries in a matrix. It is a set of input vectors that cancel under the whole transformation.

Do not confuse nullspace with column space. The nullspace lies in the input coordinate space; the column space describes possible outputs.

Do not assume a tiny singular value is exactly zero mathematically. Numerical rank depends on tolerance and scale. Also distinguish the right nullspace Ax=0 from the left nullspace Aᵀy=0; they concern different spaces and can have different dimensions.

Business use

Nullspace analysis helps explain when a system lacks enough independent information to recover a unique answer. That matters in forecasting models, compressed representations, sensor design, and interpretation of fitted coefficients.

Document whether ambiguity is exact, numerical, or caused by insufficient practical precision. If a regularizer selects one solution, explain the preference it imposes. Additional independent measurements may resolve ambiguity, while collecting more copies of the same redundant measurement may not. A small residual only shows agreement with the recorded equations, not necessarily unique recovery of the original input.

People also ask

Can the nullspace be empty?

No. The zero vector always satisfies Ax=0.

Does a square invertible matrix have a nullspace?

Yes, but it is trivial: only the zero vector belongs to it.

Why can numerical routines return different bases?

A subspace can have many valid bases. Compare the represented subspaces and residuals, not just individual basis-vector signs or coordinates.

Check your understanding

Why do (2,3,4) and (1,4,3) produce the same output in the example?

Answer: Their difference is (−1,1,−1), which belongs to the nullspace. Applying A to that difference gives zero, so the transformed outputs coincide.

Related terms

  • Kernel
  • Rank
  • Column space
  • Singular value decomposition
  • Regularization
  • Inverse problem
  • rank-nullity theorem
  • linear dependence
  • identifiability

Learn next

add a third independent measurement to the example and check whether the nullspace becomes trivial. Then perturb a dependent column slightly and compare exact algebraic rank with numerical rank under different tolerances.

  • Rank

More in Mathematics and optimization

  • Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
  • Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
  • Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
  • Σ-algebra
  • Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
  • Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.

Sources

Sources: Aalto Dictionary of Machine Learning, nullspace: https://aaltodictionaryofml.github.io/ADictML_Main.pdf ; SciPy, scipy.linalg.null_space: https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.null_space.html . Primary definition, feature-transformation interpretation, SVD construction, and numerical-tolerance guidance were read. The linear system and fictional regression case are original; no software execution is claimed for the basis calculation.

Previous: Null Value Next: Number needed to treat

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer