Engineering/Mathematics/Representations
New Matrix Representations From Old
Representing a transformation by a matrix is not merely a labelling exercise: it respects every algebraic operation. Sums map to sums, scalar multiples to scalar multiples, and — the decisive case — composition of transformations maps to multiplication of matrices, .
- Advanced level
- Stream: representations
- Reading time 14 min
- Ref KVS-ENG-MATH-0110
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Matrix representation and the fundamental theorem
- Sum rule
- Composition rule
- Consequence
- is isomorphic to
- Interpretation
- Matrix multiplication is function composition
Overview
Linear transformations can be combined. Two transformations with the same domain and codomain can be added pointwise; any transformation can be scaled by a constant; and a transformation into a space can be followed by a transformation out of it. Each construction yields a new linear transformation, so each new transformation has matrix representations of its own. The question this page settles is whether those new representations can be obtained from the old ones by matrix arithmetic, without returning to the underlying spaces.
The answer is that all three constructions commute with representation, given consistent bases. Addition of transformations corresponds to matrix addition, scaling corresponds to scalar multiplication of a matrix, and composition corresponds to matrix multiplication. The first two are unsurprising and are proved by a short calculation. The third is the substantive result, and it recasts matrix multiplication — usually first met as an unmotivated rule about rows and columns — as the exact bookkeeping needed to compose two functions.
Two consequences follow immediately and are worth stating up front. First, the map sending a transformation to its representation is a linear bijection from the space of all linear transformations onto the space of matrices, so those spaces are isomorphic and . Second, every structural property of matrix multiplication inherits an explanation: it is associative because composition of functions is associative, it fails to commute because composition of functions fails to commute, and the identity matrix behaves as it does because it represents the identity transformation.
In application, the composition rule is what makes modular modelling possible. A cascade of subsystems, a chain of coordinate frames, a pipeline of filters or a sequence of manufacturing operations can each be represented once and then combined by multiplying matrices, with no need to derive an algebraic formula for the composite. The intermediate basis must be shared — the codomain basis of the first stage must be the domain basis of the second — and that requirement is exactly what the subscripts in the composition rule record.
Definition
Sum of Linear Transformations
LTAFor transformations and sharing both a domain and a codomain, the sum is defined pointwise by , where the addition on the right takes place in . The result is again a linear transformation from to .
Scalar Multiple of a Linear Transformation
LTSMFor a transformation and a scalar , the transformation is defined by , the scalar multiplication taking place in . Together with pointwise addition this makes the set of all linear transformations from to a vector space.
Composition of Linear Transformations
LTCFor transformations and , the composition is defined by . It is a linear transformation. The codomain of must be the domain of ; composition in the other order need not be defined at all.
The notation is read right to left: in the transformation acts first. Matrix products inherit this ordering, which is the source of a large fraction of implementation errors in transform pipelines.
Concepts
Representation is a linear map on transformations
Fix bases of and of . The rules and state precisely that the assignment is itself a linear transformation, from the vector space to the vector space . Both identities are proved the same way: apply each side to the coordinate vector of an arbitrary input, use the fundamental theorem to convert to statements about and , and then invoke the fact that two matrices agreeing on every matrix-vector product must be equal.
Composition becomes multiplication
With , and bases , , of , , , the composition rule reads . The proof chains the fundamental theorem twice: coordinatise the input with , apply to reach the coordinates of relative to , then apply to reach the coordinates of relative to . Associativity of matrix multiplication packages those two steps as a single matrix, which must therefore be the representation of .
Why matrix multiplication looks the way it does
The entry-by-entry rule for a matrix product — sum of products along a row and a column — is often presented as a definition to be memorised. Read through the composition theorem it becomes forced. Column of must be the coordinates of ; the coordinates of are column of ; and applying to a vector given in coordinates means combining the columns of with those coefficients. The row-times-column formula is the arithmetic that results, and no other definition of matrix product would make composition work.
Structural properties inherited from functions
Because composition of functions is associative, matrix multiplication is associative. Because composition rarely commutes — and is often defined in only one order — matrix multiplication does not commute. Because the identity transformation leaves every vector alone, its representation relative to a single basis used at both ends is the identity matrix. Because composition distributes over pointwise addition of transformations, matrix multiplication distributes over matrix addition. Each algebraic law about matrices acquires a functional explanation rather than a computational one.
The intermediate basis must be shared
The composition rule requires the codomain basis used for to be the same as the domain basis used for . If a team represents relative to but represents relative to a different basis of the same space, the matrix product is meaningless even though the shapes conform. The subscript pattern in is a visual check: the inner labels must match, exactly as inner dimensions must match. Where two bases are genuinely in use, a change-of-basis matrix must be inserted between the factors.
Isomorphism of transformation spaces and matrix spaces
Representation relative to fixed bases is injective, because two transformations with equal representations agree on a basis and hence everywhere, and surjective, because any matrix defines a transformation with that representation. Combined with linearity, this makes and isomorphic vector spaces. The practical reading is that questions about linear transformations between finite-dimensional spaces never require new machinery: the entire subject can be transported to matrices, computed there, and transported back.
Combining representations correctly
Equations
Representation of a sum
EQ-NRFO-01Valid when and share a domain and codomain and both representations use the same pair of bases.
Representation of a scalar multiple
EQ-NRFO-02Scaling a transformation scales every entry of its representation, for any scalar .
Representation of a composition
EQ-NRFO-03With and , and bases , , of , , . The first-acting transformation appears on the right.
Chained fundamental theorem
EQ-NRFO-04The two-step calculation from which the composition rule follows.
Representation of the identity transformation
EQ-NRFO-05The identity transformation on , represented with the same basis at both ends, is the identity matrix. Using two different bases instead gives the change-of-basis matrix.
Iterated transformation and matrix powers
EQ-NRFO-06For represented with one basis at both ends, repeated application corresponds to a matrix power. This is what makes discrete-time state propagation a matrix power.
Isomorphism of transformations and matrices
EQ-NRFO-07Representation relative to fixed bases is a linear bijection, so the algebra of transformations is faithfully mirrored by the algebra of matrices.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| First transformation | Linear transformation from to ; acts first in a composition | element of L(U,V) | |
| Second transformation | Linear transformation from to in a composition, or a second map from to in a sum | element of L(V,W) | |
| Composition | The transformation from to given by applying then | element of L(U,W) | |
| Scalar | Multiplier applied to a transformation or to its representation | complex number | |
| Domain basis | Ordered basis of , indexing the columns of the leftmost factor's operand | ordered basis of U | |
| Intermediate basis | Ordered basis of ; must be shared by both factors of a composition | ordered basis of V | |
| Final codomain basis | Ordered basis of , indexing the rows of the composite representation | ordered basis of W | |
| Space of linear transformations | All linear transformations from to , itself a vector space | vector space of dimension mn | |
| Identity matrix | Representation of the identity transformation relative to one basis used at both ends | n x n matrix |
Worked Numerical Example
Problem statement
A polynomial sensor model in is post-processed in two stages: a differentiation stage that converts the calibration curve into a sensitivity curve, and a sampling stage that reports the sensitivity at two operating points. Build the representation of each stage, form the composite by matrix multiplication, and verify against the composite transformation computed directly. The sum rule is checked at the same time against a second differential operator.
Define the stages and the bases
Let be differentiation, , and let be two-point sampling, . Use for both copies of and the standard basis for . Both maps are linear, so both have representations.
Represent the differentiation stage
Evaluate on the domain basis: , , . Coordinatising relative to gives the columns directly.
Represent the sampling stage
Evaluate on the same basis, now viewed as the domain of : , , . The representation is , matching .
Multiply the representations
The composition rule places the first-acting stage on the right. The inner subscripts both read , so the product is legitimate.
Represent the composite directly
The composite transformation is . On the basis: , and . Assembling those columns reproduces the matrix product exactly, confirming the theorem on this pair.
Test on a specific model
Take the calibration curve , so . The composite representation returns . Checking by hand, , giving and .
Check the sum rule on a second operator
Let be the scaling-derivative operator , whose representation relative to and is . The transformation sends to , and evaluating it on the basis gives images , and . Its representation is exactly the entrywise sum of the two matrices.
Note what the order forbids
The reversed composition does not exist: delivers a vector in and expects a polynomial. Correspondingly the reversed matrix product is a times product, which is not conformable. Non-commutativity of matrix multiplication is not an accident of the definition; it reflects that functions cannot generally be applied in either order.
The two-stage pipeline is represented by the single matrix obtained by multiplying the stage representations in reverse order of application. Each stage can be developed, tested and stored independently; the composite is then one matrix product, and the same discipline scales to pipelines of any length provided each shared space carries one agreed basis.
Applications & Industry Use
Series interconnection of subsystems
Cascading two linear blocks is composition of their operators, so the composite state or transfer description is the product of the individual representations. This is why a series interconnection is computed by multiplying matrices rather than by re-deriving the governing equations, and why the ordering of the factors follows signal flow from right to left.
ABCD parameter cascades
A two-port network is described by a chain matrix relating input voltage and current to output voltage and current. Cascading networks composes the corresponding linear maps, so the overall chain matrix is the ordered product of the section matrices. Transmission lines, matching sections and filters are designed by exactly this multiplication.
Kinematic chains
Each joint contributes a linear map between adjacent link frames. Composing along the chain gives the map from end effector to base, and the corresponding matrices multiply in the same order. Because composition is associative but not commutative, the product can be re-bracketed for efficiency but never reordered — a distinction that separates a valid optimisation from a kinematics bug.
Transform stacks
Model, view and projection stages are separate linear maps between separate frames. Rendering pipelines pre-multiply them into a single matrix so that each vertex costs one product instead of three. The requirement that the intermediate frame be agreed is the reason mismatched handedness or axis conventions between tools corrupt an entire scene rather than a single stage.
Gate sequences
Each gate is a unitary operator on a finite-dimensional state space, and running gates in sequence composes them. The circuit's overall operator is the product of the gate matrices in reverse order of application, which is how compilers fuse adjacent gates and how a circuit is verified against a target unitary.
Time stepping as matrix powers
A linear one-step integrator applies the same transformation repeatedly, so propagating steps is represented by the -th power of the step matrix. This turns questions of long-run stability into questions about the spectral radius of a single matrix, and it justifies precomputing a power for a fixed horizon rather than iterating.
Design Considerations
Compose matrices, not derivations
When a composite transformation is needed, deriving an algebraic formula by substitution is error prone and does not scale beyond two or three stages. Representing each stage once and multiplying is mechanical, testable stage by stage, and reusable when one stage changes. Reserve symbolic composition for cases where the closed-form expression itself is the deliverable.
Pin down the intermediate basis in the interface
The composition rule is only valid when the shared space carries one basis. In a multi-team system that basis is an interface contract: axis order, sign conventions, units and normalisation all form part of it. Publishing the basis alongside the matrix, and rejecting matrices that do not declare one, prevents the most expensive category of integration failure.
Choose the bracketing of long products deliberately
Associativity permits any bracketing of a chain of representations, and the cost differs sharply. Multiplying a chain of matrices to be applied to many vectors is usually best done left to right into a single matrix; applying a chain to a single vector is almost always cheaper as a sequence of matrix-vector products. For rectangular factors, the optimal bracketing is a classic dynamic programming problem worth solving when the chain is long.
Exploit structure created by composition
Products of structured representations often retain structure: triangular times triangular stays triangular, orthogonal times orthogonal stays orthogonal, and permutation times anything is a reordering. Recognising this avoids both wasted arithmetic and unnecessary loss of exactness, since a structured product can be formed with fewer operations and less rounding than a general one.
Watch fill-in when composing sparse representations
Sparsity is not preserved by multiplication. Two representations that are sparse because their bases are local can have a product that is substantially denser, since composition couples any basis vector whose image overlaps another's support. Estimate the non-zero pattern of the product before committing to a sparse storage strategy for a long chain.
Prefer one accumulated matrix only when it is reused
Collapsing a pipeline into a single representation costs arithmetic once and saves it on every subsequent application. If the pipeline changes every step — time-varying gains, adaptive filters, animated transforms — the accumulation must be repeated and the saving evaporates. Decide on the basis of how many inputs will be pushed through between changes.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
BLAS Level 3 (GEMM) | Basic Linear Algebra Subprograms, matrix-matrix operations | The composition rule turns every pipeline of linear transformations into a general matrix-matrix product, the operation standardised as xGEMM and the single most heavily optimised kernel in high-performance computing. |
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Specifies the composition symbol and the conventions for operator and matrix notation used in the identities on this page. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Determines the accumulation order and rounding of the inner products that form a matrix product, which is why a long chain of representations can lose accuracy even when every factor is exact. |
ISO/IEC 14882 | Programming languages — C++ | Governs operator overloading and evaluation order in libraries such as Eigen, where expression templates decide the bracketing of a chain of representation products at compile time. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Provides the semantic markup for the layered sub-and-superscripts that keep composition subscripts readable and machine-interpretable. |
Material Selection
For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.
| Representation | Select when | Trade-off |
|---|---|---|
| Exact rational entries | Symbolic verification that a composite representation equals a claimed closed form, or derivation of an operator algebra identity. | Products are exact, so an identity either holds or fails outright, but entry size grows with each factor in a long chain. |
| IEEE 754 binary64 | Default choice for engineering pipelines with several stages and physically derived entries. | Each product introduces rounding proportional to the inner dimension; accumulated error over a long chain grows with the product of the factors' condition numbers. |
| Mixed precision with binary32 storage | Very large representations composed on accelerators, where memory bandwidth rather than arithmetic dominates. | Halves traffic and often doubles throughput, but demands accumulation in higher precision to keep the product usable. |
| Sparse compressed storage | Chains built from locally supported bases where the product's non-zero pattern has been estimated in advance. | Large savings when fill-in is modest; a poor estimate leads to repeated reallocation and can be slower than a dense product. |
| Structured formats: triangular, orthogonal, permutation | One or more stages is known to be a shear, a rotation or a reordering. | Cuts operation counts by a constant factor and preserves exactness for permutations, but requires the structure to be tracked through the chain rather than discarded on assembly. |
| Integer arithmetic modulo a prime | Verifying an operator identity or a circuit equivalence cheaply, where only exact equality matters. | Products are exact and fast with no growth in operand size, but a chance coincidence modulo one prime can mask a genuine difference, so several primes should be used. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Operation counts for the three rules
Adding two representations costs additions; scaling costs multiplications. Multiplying an representation by a one costs about floating-point operations by the classical algorithm. The asymmetry is the reason a composition is worth forming once and reusing, while a sum can be formed on demand.
Two routes to a composite, and which to check against
A composite representation can be obtained by composing the transformations symbolically and then representing the result, or by representing each stage and multiplying. The two routes are guaranteed to agree, which makes them an excellent mutual check on a hand computation: derive the composite one way and confirm it the other.
Library behaviour and operator conventions
NumPy's @ operator and numpy.matmul implement the mathematical product directly, so the first-acting stage goes on the right. Several graphics and robotics stacks store transposed representations and apply row vectors on the left, reversing the visual order. Determine which convention a library uses before mixing it with hand-derived representations, since both orders produce conformable products in the square case and the error is silent.
Verification technique
Test the composition rule on the basis vectors of the domain one at a time. Column of the composite must equal applied to column of , so a discrepancy localises to a single column and, within it, usually to a single mis-transcribed entry of the second factor.
Accuracy of long chains
Rounding error in a product of representations grows roughly with the product of their norms rather than with alone, so a chain containing one badly scaled stage can dominate the error budget. Normalising or equilibrating each stage before accumulation, and accumulating in an order that keeps intermediate norms comparable, are both cheap mitigations.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Multiplying the representations in the wrong order | high | Writing because is applied first, forgetting that composition notation is read right to left. | Match the subscripts: the inner labels must agree, which is only possible in the order . In the square case, where both orders conform, verify on a test vector. |
| Different bases on the shared intermediate space | high | Two stages developed independently, each with a convenient but different basis for the space between them. | Declare the intermediate basis as an interface contract, or insert the appropriate change-of-basis matrix between the factors. |
| Adding representations built on different bases | high | Summing two matrices that represent transformations relative to different pairs of bases, producing an array that represents nothing. | Record the basis pair with every stored representation and refuse to add unless both pairs match exactly, including order. |
| Assuming the product commutes | medium | Reordering factors in a chain to simplify arithmetic, by analogy with scalar multiplication. | Re-bracket freely, since composition is associative, but never reorder. Any proposed reordering must be justified by a specific commutation property of the transformations involved. |
| Scaling the wrong object | low | Applying a scalar to the coordinate vector rather than the representation when a gain is inserted into a pipeline. | Both give the same answer for a single application, but only scaling the matrix produces a reusable representation of ; keep the gain in the stage it belongs to. |
| Composing transformations that do not compose | medium | The codomain of the first stage is not the domain of the second, but the matrices happen to be conformable because the dimensions coincide. | Check the spaces, not just the shapes. Equal dimension does not imply the same space, and a conformable product can be entirely meaningless. |
| Losing sparsity through accumulation | low | Collapsing a long chain of sparse representations into one dense matrix without estimating the fill-in first. | Estimate the non-zero pattern symbolically before accumulating, or keep the chain factored and apply it stage by stage to each vector. |
| Treating an affine stage as linear | medium | A pipeline stage includes a constant offset, so it has no matrix representation and the product silently drops the offset. | Detect non-zero images of the zero vector and either use homogeneous coordinates or carry the offset separately through the chain. |
FAQs
Why does the first-acting transformation appear on the right of the matrix product?
Because matrices act on column vectors from the left. In the factor nearest the coordinate vector is applied first, and that must be the representation of the transformation applied first. The convention is inherited directly from function notation, where also places nearer the argument.
Does this mean matrix multiplication was invented to represent composition?
Historically the definition emerged from composing substitutions in systems of equations, which is composition of linear maps in different language. Whatever the history, the composition theorem shows that no other rule would work: once you accept that a matrix acts by combining its columns, the row-times-column formula is the only arithmetic that makes representation respect composition.
Can I add representations of transformations between different spaces?
No. The sum of transformations is only defined when both share a domain and a codomain, and the sum rule additionally requires both representations to use the same ordered pair of bases. Two matrices of the same shape representing transformations on different spaces can be added as arrays, but the result represents nothing.
What is the representation of the identity transformation?
If the same basis is used for domain and codomain, it is the identity matrix, since each basis vector maps to itself and its coordinates form a standard unit vector. If different bases are used, the same construction yields the change-of-basis matrix between them, which is the observation that makes the whole change-of-basis theory a special case of this section.
Why is matrix multiplication associative but not commutative?
Both properties are inherited from function composition. Composing functions is associative because applying maps in a fixed sequence does not depend on how the sequence is grouped. It is not commutative because the order in which maps are applied genuinely changes the result, and in the rectangular case the reverse order is not even defined.
How does this relate to raising a matrix to a power?
When a transformation maps a space to itself and one basis is used at both ends, applying it times is represented by the -th power of its representation. This is the formal basis for discrete-time state propagation, Markov chain evolution and iterative solvers, and it is why the eigenvalues of the representation control long-run behaviour.
If two transformations have the same representation, are they the same transformation?
Relative to the same pair of bases, yes. They agree on a basis of the domain, and linearity extends that agreement to every input. Relative to different bases the conclusion fails completely, which is why the bases must always accompany the matrix.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section MR, Subsection NRFO. Licensed under the GNU Free Documentation License v1.2.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
- Dongarra, J. J. et al. A Set of Level 3 Basic Linear Algebra Subprograms. ACM Transactions on Mathematical Software, 1990.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002.
AI Suggested Questions
- Derive the entry-by-entry formula for a matrix product starting only from the requirement that representation must respect composition.
- Show a concrete pair of transformations on the same space whose representations do not commute, and interpret the difference of the two products.
- How much accuracy is lost when ten badly scaled representations are accumulated into a single matrix, and how would equilibration help?
- Work out the optimal bracketing for a chain of five rectangular representations with given dimensions.
- Explain how a two-port ABCD cascade in electrical engineering is an instance of the composition rule, including what the intermediate basis is.
- Given representations of and relative to different bases of the shared space, insert the correct change-of-basis matrix and form the composite.
Related Calculators
Enter two stage representations with their bases, check the intermediate basis agrees, and form the composite .
Matrix Chain Order OptimiserGiven the dimensions of a chain of representations, report the bracketing that minimises the total operation count.
Matrix Multiplication CalculatorMultiply two matrices with exact rational or floating-point entries and display the intermediate inner products.
