Applying One Transformation After Another
A linear transformation can change both the coordinates of a vector and the dimension of the space containing it. If one transformation sends vectors in \(\mathbb{R}^n\) to \(\mathbb{R}^m\), and a second accepts vectors in \(\mathbb{R}^m\), we can feed the first output into the second. This successive application is called composition. To define it correctly, we must keep track of which map acts first and which spaces its inputs and outputs belong to.
A map \(T:\mathbb{R}^n\to\mathbb{R}^m\) is linear if, for all \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and all \(a,b\in\mathbb{R}\), it satisfies \(T(a\mathbf{x}+b\mathbf{y})=aT(\mathbf{x})+bT(\mathbf{y})\). In particular, this condition includes preservation of sums and scalar multiples. The space after the arrow is the codomain: it specifies where the map’s outputs are declared to lie, even if the map does not produce every vector in that space.
The requirement that the codomain of \(T\) be the domain of \(S\) makes \(S(T(\mathbf{x}))\) meaningful for every input \(\mathbf{x}\). The composite’s domain comes from the first map, \(T\), and its codomain comes from the second map, \(S\). Thus the dimensions follow the chain \(\mathbb{R}^n\to\mathbb{R}^m\to\mathbb{R}^p\), giving a composite from \(\mathbb{R}^n\) to \(\mathbb{R}^p\).
Why the Composite Is Linear
Proof. Take any \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and \(a,b\in\mathbb{R}\). By the definition of composition and the linearity of \(T\),
The vectors \(T(\mathbf{x})\) and \(T(\mathbf{y})\) belong to \(\mathbb{R}^m\), the domain of \(S\). We can therefore apply the linearity of \(S\) to the last expression:
This holds for every \(\mathbf{x},\mathbf{y}\in\mathbb{R}^n\) and every \(a,b\in\mathbb{R}\), so it is exactly the condition that \(S\circ T\) is linear. Its domain and codomain are \(\mathbb{R}^n\) and \(\mathbb{R}^p\) by the definition of composition. \(\square\)
The proof depends on both maps being linear and on their spaces matching. It uses the linearity of \(T\) to simplify the input to \(S\), then uses the linearity of \(S\) to separate the resulting sum and scalars. The conclusion does not assert that the composite reaches every vector in \(\mathbb{R}^p\), or that distinct inputs must have distinct outputs.
Evaluating a Composite in Coordinates
Worked Example: From R² Through R³ to R²
Let \(T:\mathbb{R}^2\to\mathbb{R}^3\) and \(S:\mathbb{R}^3\to\mathbb{R}^2\) be given by \(T(x,y)=(x+y,2x-y,x)\) and \(S(u,v,w)=(u-w,v+w)\). Find \((S\circ T)(x,y)\), then evaluate it at \((2,-1)\).
Each coordinate in these formulas is a linear combination of the input coordinates, so both maps are linear. The output of \(T\) has three coordinates, which supplies the three inputs required by \(S\). Substitute \(u=x+y\), \(v=2x-y\), and \(w=x\) into the formula for \(S\):
For \((x,y)=(2,-1)\), first apply \(T\): \(T(2,-1)=(2+(-1),2(2)-(-1),2)=(1,5,2)\). Then apply \(S\): \(S(1,5,2)=(1-2,5+2)=(-1,7)\).
Check: The direct formula gives \((y,3x-y)=(-1,3(2)-(-1))=(-1,7)\), agreeing with the successive calculation. The composite has domain \(\mathbb{R}^2\) and codomain \(\mathbb{R}^2\), since \(T\) starts in \(\mathbb{R}^2\) and \(S\) ends in \(\mathbb{R}^2\).
In a calculation, always apply the right-hand map in \(S\circ T\) first. The notation records function composition, not a left-to-right sequence. Keeping the intermediate vector visible helps catch both order errors and dimension mismatches.
Worked Example: A Composite With a Four-Dimensional Output
Define \(T:\mathbb{R}^3\to\mathbb{R}^2\) and \(S:\mathbb{R}^2\to\mathbb{R}^4\) by \(T(x,y,z)=(x-z,y+2z)\) and \(S(u,v)=(u,v,u+v,2u-v)\). Find the composite formula and evaluate it at \((1,-2,3)\).
Again, every output coordinate is a linear combination of the inputs, so these maps are linear. Since \(T\) outputs two coordinates and \(S\) accepts two inputs, \(S\circ T\) is defined. Substituting \(u=x-z\) and \(v=y+2z\) gives
For the specified input, the first map gives \(T(1,-2,3)=(1-3,-2+2(3))=(-2,4)\). The second map then gives \(S(-2,4)=(-2,4,-2+4,2(-2)-4)=(-2,4,2,-8)\).
Check: Substitution into the composite formula gives \((1-3,-2+6,1-2+3,2-(-2)-12)=(-2,4,2,-8)\). This confirms the computation. The composite is a map \(\mathbb{R}^3\to\mathbb{R}^4\): its input space is inherited from \(T\), and its output space from \(S\).
Composition Along a Longer Chain
When three maps are compatible, either of two groupings can be used: first compose the first two maps and then the third, or first compose the last two and then apply the first. The resulting maps agree, as the next result shows. The parentheses describe how the operations are grouped; they do not change the order in which a particular input passes through the maps.
Proof. Both grouped compositions are defined because the codomain of each map matches the domain of the next. To prove that the maps are equal, take any \(\mathbf{x}\in\mathbb{R}^n\) and evaluate each one. By the definition of composition,
while
The outputs agree for every \(\mathbf{x}\in\mathbb{R}^n\), so the two maps are equal. Each maps \(\mathbb{R}^n\) into \(\mathbb{R}^q\), as required. \(\square\)
Worked Example: Tracking a Vector Through Three Maps
Let \(T:\mathbb{R}^2\to\mathbb{R}^3\) be \(T(x,y)=(x,y,x-y)\), let \(S:\mathbb{R}^3\to\mathbb{R}^2\) be \(S(a,b,c)=(a+b,0)\), and let \(U:\mathbb{R}^2\to\mathbb{R}\) be \(U(r,s)=r-s\). Find the output for input \((-1,3)\) using both groupings.
All three maps are linear because each output coordinate is a linear combination of input coordinates. Applying them successively from the right gives \(T(-1,3)=(-1,3,-4)\), \(S(-1,3,-4)=(2,0)\), and \(U(2,0)=2\). Thus \(((U\circ S)\circ T)(-1,3)=2\).
For the other grouping, first apply \(T\) and \(S\), obtaining \((S\circ T)(-1,3)=(2,0)\), and then apply \(U\), giving \((U\circ(S\circ T))(-1,3)=U(2,0)=2\).
Check: The two calculations give the same scalar, \(2\), and both grouped maps have domain \(\mathbb{R}^2\) and codomain \(\mathbb{R}\). In either grouping, the input passes through \(T\), then \(S\), then \(U\).
Codomain, Image, and a Common Error
The codomain of a composite is fixed by the definition: it is the codomain of the outer map. Its actual outputs may occupy only part of that space. For example, in the three-map example, \(S(a,b,c)=(a+b,0)\) always has second coordinate zero. Consequently, \((S\circ T)(x,y)\) always lies on the horizontal axis in \(\mathbb{R}^2\), but \(S\circ T\) is still declared as a map into \(\mathbb{R}^2\). A restricted set of outputs does not by itself change the declared codomain.
Common mistake: carrying forward the intermediate output as the final answer. Let \(T:\mathbb{R}^2\to\mathbb{R}^3\) be \(T(x,y)=(x,y,x+y)\), and let \(S:\mathbb{R}^3\to\mathbb{R}\) be \(S(a,b,c)=a-b\). A wrong calculation at \((1,2)\) might stop after \(T(1,2)=(1,2,3)\) and report that as \((S\circ T)(1,2)\). That vector is only the intermediate output, and it is in the wrong space for the final answer. The correction is to apply \(S\): \(S(1,2,3)=1-2=-1\). Therefore \((S\circ T)(1,2)=-1\), and the composite maps \(\mathbb{R}^2\) to \(\mathbb{R}\).
A related check is to compare the middle spaces before composing. If \(T\) outputs vectors in \(\mathbb{R}^3\), an outer map whose domain is only \(\mathbb{R}^2\) cannot accept \(T(\mathbf{x})\) as an input. The notation \(S\circ T\) is not defined for that pair of maps unless the output of \(T\) lies in the domain of \(S\) as specified.
Check Your Understanding
For each question, keep the intermediate output and the final output spaces distinct.
- If \(T:\mathbb{R}^2\to\mathbb{R}^3\) and \(S:\mathbb{R}^3\to\mathbb{R}\), what are the domain and codomain of \(S\circ T\)?
- Let \(T(x,y)=(x-y,2x)\) and \(S(a,b)=(a+b,a-b)\). Find \((S\circ T)(x,y)\) and evaluate it at \((1,3)\).
- State the condition on the domain and codomain that makes \(S\circ T\) defined for \(T:\mathbb{R}^n\to\mathbb{R}^m\) and \(S:\mathbb{R}^k\to\mathbb{R}^p\).
- In a sentence, explain why linearity of both component maps is needed in the proof that their composition is linear.
- For three compatible maps \(T,S,U\), write the common input-output expression for \(((U\circ S)\circ T)(\mathbf{x})\) and \((U\circ(S\circ T))(\mathbf{x})\).