A map f:𝐑n→𝐑m is linear if there exists an m -by-n matrix A such that f(v)=Av for all v∈𝐑n .
38. Linear maps
38. Linear maps
Two definitions of linearity
At the outset of this course, we talked about the geometric transformations coming from matrices (rotations, reflections, shears etc). These geometric transformations have a name: they are called linear maps. In this video we'll give two definitions of linear maps and show they're equivalent. The first definition encapsulates how we've been dealing with linear maps so far:
However, some linear maps are more natural to describe in another way, without giving the matrix A .
Fix n . Consider the space of polynomials P(x) of degree at most n . Differentiation gives a map ddx:P↦dP/dx from this space to itself. This map is linear. To understand why, we need to understand polynomials as vectors. We encode a polynomial P(x)=anxn+⋯+a1x+a0
This way of encoding polynomials as vectors is a bit artificial. For example, I could have chosen to write the vector with an at the top and a0 at the bottom, and the matrix D would have ended up looking quite different. The fact that differentiation of polynomials is a linear map is an intrinsic fact about differentiation, and our proof above obscures that. So here's an equivalent definition of linearity which is more intrinsic.
A map f is linear if:
-
f(v+w)=f(v)+f(w) for all v,w
-
f(λv)=λf(v) for all v and for all λ∈𝐑 .
I haven't specified the domain and target of f because I want to be intentionally vague: this definition makes sense whenever the domain and target of f admit operations of addition and rescaling (e.g. spaces of polynomials or functions as well as just 𝐑n ). In the final video of the course, we'll see that the natural setting for this definition is the setting of vector spaces.
Differentiation of polynomials is linear because ddx(P+Q)=dPdx+dQdx
The function f:𝐑→𝐑 which converts metres to feet is linear. Since 1 metre is ≈3.281 feet, f(x)=3.281x . If you double the number of metres, you double the number of feet. If you take two distances x metres and y metres you can add them and then convert to feet (f(x+y) ) or you can convert and then add (f(x)+f(y) ) and you get the same answer. So f is linear.
The function f:𝐑→𝐑 which converts Celsius to Kelvin is not linear. Recall that f(0)≈273 . Any linear map satisfies f(0)=0 , because f(0)=f(00)=0f(0)=0 (some of those 0 s are numbers, some are vectors!).
I'm told the way they used to mark exams in Oxford was to take the marks from each question, square them and add them up. For example, if there were two questions and you got marks x and y then your final score would be x2+y2 . This rewards those who do very well on a couple of questions (instead of scatter-gunning a little bit of knowledge over all questions). This function f(x,y)=x2+y2 is not a linear map! For example, if you score 1 and 0 then you get 1 in total, but if you double your score for x then you quadruple your total. Sadly for those taking the exam, f(0,0)=0 .
Equivalence
These two definitions of linearity are equivalent. In other words, the conditions
-
f(v+w)=f(v)+f(w) and f(λv)=λf(v)
imply there exists a matrix A such that f(v)=Av , and any map of this form satisfies these conditions.
If f(v)=Av for some matrix A then f(v+w)=A(v+w)=Av+Aw=f(v)+f(w)
Conversely, consider the basis vectors e1=(10⋮0),e2=(01⋮0),⋯,en=(0⋮01).
Then f(v)=f(v1⋮vn)=f(v1e1+⋯+vnen)=v1f(e1)+⋯+vnf(en).