AI Glossary / Mathematics and optimization / Intermediate

Linear map

Definition

A linear map is a function between vector spaces that preserves addition and scalar multiplication. It satisfies T(u+v)=T(u)+T(v) and T(cu)=cT(u) for every permitted pair of vectors and scalar. In finite-dimensional coordinates, such a map can be represented by multiplication by a matrix.

What it means

Linearity means that combining inputs and then applying the map gives the same result as applying the map separately and combining the outputs. This property is also called superposition. It makes many calculations easier because the behavior on a basis determines the behavior everywhere in the space.
A linear map sends the zero vector to zero. A transformation x↦Ax+b with a nonzero offset b is therefore affine, not strictly linear, even though machine-learning software often calls a layer with this form a linear layer.
The inputs and outputs need not have the same dimension. A map can turn three measurements into two scores, or expand a two-dimensional vector into a higher-dimensional representation. Changing dimension does not by itself determine whether information is preserved.

How it works

Choose bases for the input and output spaces. Apply the map to each input basis vector and write those output coordinates as the columns of a matrix A. If the input has n coordinates and the output has m, A has m rows and n columns, and T(x)=Ax.
Composition corresponds to matrix multiplication. If T acts first and S second, with compatible matrices A and B, the combined map is S(T(x))=BAx. The order matters because AB and BA generally differ and may not both be defined.
The kernel contains inputs mapped to zero, while the image contains outputs that can be reached. A nontrivial kernel means distinct inputs can give the same output. These properties help explain compression, redundancy, and invertibility without relying only on the size of the matrix.

Three practical examples

  • A feature-processing step can produce a fixed weighted combination of numerical inputs using a matrix.
  • A graphics operation can rotate, reflect, or scale coordinates about the origin through a linear map.
  • A dimensionality-reduction method can project vectors onto a chosen subspace, with any separate centering step described explicitly.

Think of it this way

Think of a mixer that combines input signals using fixed proportions. Doubling every input doubles the output, and mixing two inputs together has the same result as adding their separate outputs. The analogy assumes no added baseline, clipping, saturation, or input-dependent control; those features can break strict linearity.

Worked example

Consider an original map T from three coordinates to two, defined by T(x₁,x₂,x₃)=(2x₁+x₂, x₂−x₃). Its matrix has rows (2,1,0) and (0,1,−1). The columns show where the three standard basis vectors go: (2,0), (1,1), and (0,−1).
For u=(1,2,3), T(u)=(4,−1). For v=(−1,0,2), T(v)=(−2,−2). Their sum is u+v=(0,2,5), whose image is (2,−3). This equals T(u)+T(v), as required. Also, T(3u)=(12,−3)=3T(u).
Now examine z=(1,−2,−2). Its image is (0,0), so z is a nonzero kernel vector. Consequently T(u+z)=T(u): the distinct input (2,0,1) produces the same output (4,−1) as u. This map cannot recover every original input from its two outputs.
Define a second map S(a,b)=a+3b. Applying it after T gives S(T(x))=2x₁+4x₂−3x₃. For u, the result is 2+8−9=1, matching S(4,−1)=1.
Finally, add an offset and define F(x)=T(x)+(5,0). Then F(0)=(5,0), so F is not linear. It is affine. This small change is common in prediction models and explains why strict mathematical terminology can differ from an informal model name.

Illustrative case study

In a fictional analytics project, engineers exchange a feature-transformation matrix between two services. One service applies the matrix to raw measurements, while the other first subtracts a stored mean vector. Their outputs disagree even though the matrix files are identical.
The team documents the complete transformation as x↦A(x−μ), including the centering vector and feature order. It recognizes that this is generally affine as a function of raw x. The hypothetical case illustrates why a matrix alone may not describe an entire preprocessing pipeline, without claiming a measured deployment result.

Common misconceptions and mistakes

Do not assume a straight-looking formula is a linear map. The function x↦2x+1 fails because it does not send zero to zero. Conversely, checking T(0)=0 is necessary but insufficient: x↦x² also sends zero to zero and is not linear over the real numbers.
Do not assume all linear maps preserve lengths, angles, or invertibility. Projection can lose information, and scaling can change lengths. Also, the matrix representation depends on the chosen bases. A different matrix can describe the same underlying map in different coordinates, so feature and basis conventions must accompany the numbers.

Business use

Linear maps appear throughout numerical data processing and AI. Their usefulness comes from predictable composition and efficient matrix operations. For practical review, record dimensions, coordinate ordering, units, offsets, and any later nonlinear operations.
A sequence of compatible linear maps is still one linear map, even if implemented as many stages. Adding nonlinear transformations changes the range of behaviors that can be represented. This distinction helps teams understand why stacking matrix multiplications alone does not create the same expressive capacity as a network with nonlinear activations.

People also ask

Must a linear map use a square matrix?

No. Input and output dimensions can differ.

Is a map with an intercept linear?

Strictly, a nonzero intercept makes it affine. Some machine-learning terminology uses linear more loosely.

Does linearity imply the map is reversible?

No. A nontrivial kernel means different inputs share an output, preventing an inverse on the full input space.

Check your understanding

Is T(x)=3x linear over the real numbers, and is F(x)=3x−2 linear?

Answer: T is linear. F is affine and fails the zero-vector test because F(0)=−2.

Related terms

  • Matrix
  • Basis
  • Kernel
  • Image
  • Rank
  • Vector space
  • affine map
  • projection
  • matrix multiplication
  • linear layer
  • nonlinear activation

Learn next

Next, construct a matrix from the images of basis vectors and verify one composition by direct calculation. Then study kernels and rank to understand exactly which distinctions between inputs a map preserves or loses.

  • Matrix
  • Basis
  • 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

Primary teaching references: Duke Connected Curriculum Project, Linear Transformations, Part 1: https://sites.math.duke.edu/education/ccp/materials/linalg/lintrans/lint1.html . MIT 18.022, Matrices and Linear Transformations: https://math.mit.edu/~djk/18_022/chapter16/section01.html . The three-to-two-dimensional example is original.

Previous: Linear light Next: Linear model

  • 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