Linear Transformations, Matrices, and Linear Models – Lecture 4 (Linear Algebra)
Overview
This lecture finishes Chapter 1 with three sections (1.8, 1.9 and 1.10). It starts by treating
multiplication by a matrix as a function: a rule T that takes vectors in Rn as inputs and
returns vectors in Rm. Such a linear transformation respects addition and scaling, always
sends 0 to 0, and can project, shear, rotate, or stretch space. The central result
is Theorem 10: every linear transformation from Rn to Rm is multiplication by a
unique matrix, and that matrix can be read off from where the transformation sends the columns of the
identity matrix. The pivot structure of that matrix then decides whether T is onto and whether it is
one-to-one. The lecture closes with two applied linear models: a diet problem and an electrical
circuit.
Key Concepts
Function vocabulary
A function gives each input exactly one output: if a=b then f(a)=f(b). A circle fails the
vertical line test, so it is not the graph of a function.
A function is one-to-one if equal outputs force equal inputs. y=x2 is not one-to-one, since
(−1)2=12. A non-horizontal line is.
A function is onto if every possible output is actually produced. y=x2 never outputs −4, so as a
function from R to R it is not onto. The line y=x+2 is onto.
The domain is the set of allowed inputs. The range (also called the image) is the set of
outputs actually produced.
Transformations from Rn to Rm
A transformation (also called a function or a mapping) T:Rn→Rm is a rule
that assigns to each x in Rn a vector T(x) in Rm.
Rn is the domain and Rm is the codomain. The range is the set of all
images T(x). It lies inside the codomain but need not fill it. For example,
T(x)=0x (the 2×4 zero matrix) sends all of R4 to the single
point 0 in R2.
A matrix transformation has the form T(x)=Ax, often written
x↦Ax. For Ax to be defined with x in Rn and
Ax in Rm, the matrix A must be m×n: one column per input entry and one
row per output entry.
For example, with
A=[42−301531],A1111=[58],A14−13=[00]
the map x↦Ax goes from R4 to R2.
Is b in the range of x↦Ax? That is the same question as whether
Ax=b is consistent, so row reduce [Ab]. A row
[0⋯0c] with c=0 means no. If there is a solution and no free variable, then
exactly one x maps to b.
Geometric examples
Projection.A=100010000 sends (x1,x2,x3) to
(x1,x2,0). It collapses all of R3 onto the x1x2-plane, like casting a shadow. For
example, (1,3,7)↦(1,3,0), and every point on the vertical line above (1,3,0) has that
same image.
Shear.A=[1031] fixes (2,0) and sends (0,2) to
(6,2) and (2,2) to (8,2). The square with corners (0,0), (2,0), (2,2), (0,2) is pushed
sideways into a parallelogram.
Rotation.A=[01−10] rotates the plane 90∘
counterclockwise. With u=(4,1) and v=(2,3), it gives T(u)=(−1,4),
T(v)=(−3,2), and T(u+v)=T(6,4)=(−4,6)=T(u)+T(v).
Dilation.T(x)=3x scales every vector by 3.
Linear transformations
A transformation T is linear if, for all u,v in its domain and every scalar
c:
(i)T(u+v)=T(u)+T(v)(ii)T(cu)=cT(u)
Every matrix transformation is linear, because A(u+v)=Au+Av
and A(cu)=cAu.
A linear transformation sends 0 to 0. For any u in the domain,
T(0)=T(0u)=0T(u)=0
One-step test.T is linear if and only if, for all vectors u,v and all
scalars c,d,
T(cu+dv)=cT(u)+dT(v)
Linearity gives this by applying (i) and then (ii). In the other direction, c=d=1 recovers (i),
and d=0 recovers (ii). In practice this single identity is the one checked.
Superposition principle. Repeating the argument extends it to any number of terms:
T(c1v1+⋯+cpvp)=c1T(v1)+⋯+cpT(vp)
Example: T(x)=3x is linear.
T(cu+dv)=3(cu+dv)=c(3u)+d(3v)=cT(u)+dT(v)
The matrix of a linear transformation (Theorem 10)
In is the n×nidentity matrix, with 1s on the diagonal and 0s elsewhere. It satisfies
Inx=x, just as 1⋅x=x. Only square identity matrices exist, since the
output must have the same size as the input.
ej is the jth column of In: a 1 in position j and 0s elsewhere. The size n is read
from context.
Theorem 10. Let T:Rn→Rm be linear. Then there is a uniquem×n
matrix A with T(x)=Ax for all x, namely the standard matrix
A=[T(e1)T(e2)⋯T(en)]
Existence. Write x=Inx=x1e1+⋯+xnen and use
linearity:
T(x)=x1T(e1)+⋯+xnT(en)=[T(e1)⋯T(en)]x
Uniqueness. Suppose T(x)=Bx as well. Multiplying a matrix by ej
returns its jth column, so aj=Aej=T(ej)=Bej=bj for every j. The two matrices have the same columns, so B=A.
Every linear map between Rn and Rm is therefore a matrix transformation, and
knowing where it sends e1,…,en determines it completely. For example,
T(x)=3x on R2 has T(e1)=(3,0) and
T(e2)=(0,3), so its standard matrix is [3003].
Building geometric matrices from T(ej)
Picture where each ej lands and write those images down as the columns:
Transformation
T(e1)
T(e2)
Standard matrix
Rotate 90∘ counterclockwise
(0,1)
(−1,0)
[01−10]
Rotate 90∘ clockwise
(0,−1)
(1,0)
[0−110]
Rotate 180∘
(−1,0)
(0,−1)
[−100−1]
Reflect across the x1-axis
(1,0)
(0,−1)
[100−1]
Reflect across the x2-axis
(−1,0)
(0,1)
[−1001]
Reflection through the origin sends x to −x. It has the same standard matrix as
rotation by 180∘, so the two are the same transformation.
Rotation by θ. Counterclockwise rotation sends e1 to (cosθ,sinθ).
It sends e2 to the point at angle θ+90∘, which is
(cos(θ+90∘),sin(θ+90∘))=(−sinθ,cosθ):
A=[cosθsinθ−sinθcosθ]
Setting θ=90∘ or θ=180∘ recovers the rows of the table above.
The same method works in R3. Rotating 90∘ about the x3-axis, so that
e1↦e2, e2↦−e1 and e3 stays put,
gives
A=010−100001
Onto and one-to-one
T:Rn→Rm is ontoRm if every b in Rm is
the image of at least onex in Rn. Several inputs may share an image.
T is one-to-one if every b in Rm is the image of at most onex. Some b may have no preimage at all.
A map that is both one-to-one and onto is a bijection: each b is the image of exactly
one x. A rotation of R2 is a bijection. The projection of R3 onto a
plane is neither one-to-one nor onto R3.
Theorem 11. A linear T is one-to-one if and only if T(x)=0 has only the
trivial solution. If the homogeneous equation has only x=0, then each consistent
T(x)=b has its solution set shifted from that single point, so it has exactly
one solution.
Theorem 12. Let T(x)=Ax with A an m×n matrix.
(a) T is onto Rm if and only if the columns of A span Rm.
(b) T is one-to-one if and only if the columns of A are linearly independent.
In terms of pivots:
Property of T
Columns of A
Pivot pattern of A
Onto Rm
Span Rm
A pivot in every row
One-to-one
Linearly independent
A pivot in every column
For example,
A=100−4208−10135 has a pivot in every
row, so x↦Ax maps R4ontoR3. Column 3 has no
pivot, so there is a free variable, and the map is not one-to-one.
Coordinate notation. Lay often writes a transformation as T(x1,x2) in place of
T([x1x2]). To show such a T is linear, pull each
variable out into its own column:
This is a matrix transformation from R2 to R3, so it is linear.
Linear models (Section 1.10)
With applied problems, the difficult part is translating the data into a matrix. After that, row
reduction finishes the job.
Diet. Per 100 g, nonfat milk supplies (36,52,0) grams of (protein, carbohydrate, fat), soy flour
supplies (51,34,7), and whey supplies (13,74,1.1). Let x1,x2,x3 be the numbers of 100 g
units eaten. The target of 33 g protein, 45 g carbohydrate and 3 g fat becomes
x136520+x251347+x313741.1=33453
Solving gives x1≈0.277, x2≈0.392, x3≈0.233, or roughly 27.7 g of nonfat
milk, 39.2 g of soy flour and 23.3 g of whey.
Electrical networks. Two physical laws turn a circuit into a linear system.
Ohm's law gives the voltage drop across a resistor as V=RI.
Kirchhoff's voltage law says that around any closed loop, the sum of the RI drops equals the sum
of the battery voltages, so the net change in potential around the loop is zero.
Assign a loop current to each loop and write one equation per loop. A resistor on a branch shared
with a neighboring loop carries both loop currents, with opposite signs when they run in opposite
directions.
Worked Example
Finding a standard matrix from T(e1) and T(e2). A linear transformation
T:R2→R3 satisfies T(e1)=(5,−7,2) and
T(e2)=(−3,8,0). Find a formula for T(x).
so x=(23,−21). Check the first entry:
23(1)−21(−3)=3. Both columns are pivot columns, so there is no free variable,
and this is the onlyx whose image is b.
Is c in the range? Only the last entry has changed. The same row operations give
The last row says 0=25, so the system is inconsistent and c is not in the
range of T. A 3×2 matrix has at most two pivots, so it cannot have a pivot in every row, and
T cannot be onto R3.
A three-loop circuit. Applying Kirchhoff's voltage law to each loop gives one equation per loop
current:
Row reduction gives I1=3 A, I2=1 A and I3=−8 A. The negative sign means the third current
runs opposite to the direction assumed, at 8 A. As a check on the first loop, the shared branch carries
I1−I2=2 A through its 3Ω resistor. The drops are 4(3)+4(3)+3(2)=30 volts, which
match the 30 V battery.
Summary
A transformation T:Rn→Rm assigns each input in the domain Rn an
output in the codomain Rm. The range is the set of outputs actually produced, and
b is in the range of x↦Ax exactly when Ax=b
is consistent.
T is linear when T(cu+dv)=cT(u)+dT(v). Every linear T
sends 0 to 0 and obeys the superposition principle.
Theorem 10: every linear T:Rn→Rm equals x↦Ax for
exactly one matrix, A=[T(e1)⋯T(en)].
Rotations, reflections, shears, projections and dilations can each be built by tracking where the
columns of the identity matrix land. Rotation by θ has columns (cosθ,sinθ) and
(−sinθ,cosθ).
T(x)=Ax is onto exactly when A has a pivot in every row (its columns span
Rm). It is one-to-one exactly when A has a pivot in every column (its columns are linearly
independent).
Diet planning and circuit analysis reduce to systems Ax=b. The modeling step is
turning the data, or Ohm's and Kirchhoff's laws, into the right matrix.