Linear Algebra I · Linear transformations and inverse matrices
Prerequisites: matrix products, Gaussian elimination, basis coordinates, rank, and nullspace from the previous three Linear Algebra lessons. We use real scalars and standard coordinate bases unless stated otherwise. Goals: test linearity, construct a matrix from basis images, interpret composition, decide whether information is lost, and calculate and verify an inverse. Read the definitions and diagram, reproduce the examples, run the downloadable lab or its browser alternative, then complete practice and the assessment before opening the answers.
A linear transformation preserves combinations
A transformation T:ℝⁿ→ℝᵐ takes an input vector to an output vector. It is linear if T(su+tv)=sT(u)+tT(v) for every pair of inputs u,v and every real s,t. Equivalently it preserves addition and scalar multiplication. Every matrix rule T(x)=Ax with A of size m×n is linear, by distributing the sums. In particular T(0)=0. This is necessary but not sufficient: f(x)=x² sends zero to zero but f(2)=4≠2f(1). One counterexample disproves linearity; a few successful numerical tests do not prove it.
An affine rule F(x)=Ax+b with fixed b≠0 is not linear because F(0)=b. In engineering, a nonzero baseline may be removed when defining input/output deviations, yielding a linear model of those deviations. That modeling choice must be stated; it does not make every nonlinear or saturated physical system linear.
Construct the matrix from basis images
Let eⱼ be the jth standard coordinate vector in ℝⁿ. Put T(e₁),…,T(eₙ) in the columns of A. Since x=∑ⱼxⱼeⱼ, linearity gives T(x)=∑ⱼxⱼT(eⱼ)=Ax. This proves both the construction and uniqueness of the matrix in these fixed bases. With other bases, each column contains the output coordinates of the image of an input basis vector. The transformation can remain the same while its coordinate matrix changes. Keep input and output basis orders fixed.
Composition: the rightmost map acts first
If T(x)=Bx maps ℝⁿ to ℝᵖ and S(y)=Ay maps ℝᵖ to ℝᵐ, then (S∘T)(x)=A(Bx)=(AB)x. Check the intermediate dimensions. In general S∘T differs from T∘S, even when both exist. The identity map leaves its input unchanged and has matrix I. If both square matrices A and B are invertible, undo AB in reverse order: (AB)⁻¹=B⁻¹A⁻¹. Multiplying shows (AB)(B⁻¹A⁻¹)=AIA⁻¹=I, and the reverse product also equals I.
When an inverse exists
A map is one-to-one (injective) if equal outputs imply equal inputs; it is onto (surjective) if every vector in its stated codomain is reached. For T(x)=Ax, injectivity is equivalent to null(A)={0}: Ax=Ay means A(x−y)=0. Surjectivity onto ℝᵐ means the columns span ℝᵐ. For square n×n A, rank n gives both properties. Then every b has exactly one preimage and a two-sided inverse matrix A⁻¹ exists, satisfying A⁻¹A=AA⁻¹=I. A singular matrix lacks an inverse. A nonzero kernel vector proves information was lost: x and x+z have the same output whenever Az=0.
To calculate an inverse, augment [A|I] and use reversible row operations to reduce the left block to I; the right block becomes A⁻¹. This solves Ax=eⱼ for every column at once. If the left block cannot become I, no two-sided inverse exists. A rectangular matrix may be one-to-one or onto, but cannot have a two-sided inverse unless its input and output dimensions agree. For large numerical systems, solving Ax=b directly is usually preferable to explicitly forming A⁻¹.
Worked examples
- Build a shear: S(e₁)=(1,0), S(e₂)=(1,1). Thus S has matrix [1 1; 0 1] and S(x,y)=(x+y,y). Input (2,3) becomes (5,3). Its inverse subtracts the second coordinate from the first: S⁻¹(5,3)=(2,3), with matrix [1 −1; 0 1]. The diagram shows the same rule on four square vertices.
- Gauss–Jordan inverse: A=[1 1; 1 2]. Start [1 1 | 1 0; 1 2 | 0 1]. Replace R₂ by R₂−R₁ to get [0 1 | −1 1]. Then replace R₁ by R₁−R₂ to get [1 0 | 2 −1]. Therefore A⁻¹=[2 −1; −1 1]. Both AA⁻¹ and A⁻¹A equal [1 0; 0 1]. For b=(1,0), A⁻¹b=(2,−1), and A(2,−1)=(1,0).
- A map that loses information: P(x,y)=(x,0) has matrix [1 0; 0 0]. It is linear, but P(0,0)=P(0,1), so it is not injective. Its image is the horizontal axis, not all ℝ²; its kernel is the vertical axis. Rank 1 rules out an inverse. Recovering the missing y-coordinate from P(x,y) alone is impossible.
- Composition order: let D(x,y)=(2x,y), and use shear S from example 1. SD=[2 1; 0 1] gives SD(1,1)=(3,1); DS=[2 2; 0 1] gives DS(1,1)=(4,1). To undo SD, apply S⁻¹ then D⁻¹: D⁻¹S⁻¹(a,b)=((a−b)/2,b). It sends (3,1) back to (1,1).
Common mistakes and numerical conditions
Do not confuse a matrix inverse with entrywise reciprocals or the transpose. Check both multiplication order and compatible dimensions. Finding a single solvable b does not prove invertibility; every output must have exactly one input. T(0)=0 alone does not prove linearity. Exact invertibility also does not guarantee stable recovery: an almost-collapsed direction can magnify measurement errors. In the lab family below, recovering the second input divides an output difference by k−1, so small |k−1| can amplify output error.
Practice
- Warm-up: is F(x,y)=(x+2y,3y+1) linear? Give a decisive test.
- A linear T sends e₁ to (2,1) and e₂ to (−1,1). Construct its matrix, find T(3,2), and recover the input using its inverse.
- For C=[1 2; 2 4], give two distinct inputs with the same output and a nonzero kernel vector.
- Challenge: U maps ℝ² to ℝ³ by U(x,y)=(x,y,x+y). Is it injective, onto ℝ³, or invertible as a map onto its own image? Explain the codomain distinction.
Fully worked solutions
- F(0,0)=(0,1)≠(0,0), contradicting a necessary condition. It is affine, not linear.
- A=[2 −1; 1 1] and T(3,2)=(6−2,3+2)=(4,5). Solving 2x−y=a, x+y=b gives x=(a+b)/3, y=(−a+2b)/3, so A⁻¹=(1/3)[1 1; −1 2]. Applying it to (4,5) gives (3,2).
- C(0,0)=C(−2,1)=(0,0). Thus (−2,1) is a nonzero kernel vector and information is lost. Equivalently C(1,0)=C(−1,1)=(1,2).
- The first two output coordinates recover x,y, so U is injective. Its image is the plane z=x+y, so it is not onto ℝ³. As a map ℝ²→that plane it has inverse (a,b,a+b)↦(a,b). This is not a two-sided matrix inverse between all of ℝ² and all of ℝ³.
Assessment · Open book · 18 points
Open book: use books, lesson notes, cited readings, calculators, and relevant free software. Explain your own reasoning, assumptions, units, and checks; identify references or software you use. Attempt the questions before opening the answer key. Suggested study time: 40–60 minutes; this is a self-study guide, not a timed restriction.
- For T(x,y)=(x+2y,y), construct A from basis images, find A⁻¹, and recover the input for output (7,2). Verify. (5)
- For A(k)=[1 1; 1 k], determine exactly which k give an inverse. At the exceptional value, give a nonzero kernel vector and describe the image. (4)
- Using S and D from worked example 4, find SD and its inverse. Explain which map acts first in each product. (3)
Application and reasoning · 6 points
Let A=[1 1;0 1], B=diag(2,1). A program reports (AB)⁻¹=A⁻¹B⁻¹. Compute the correct inverse (2). Test both candidates on output (3,1) (2). Explain the order error in terms of undoing transformations (2).
Complete answer key and scoring rubric
- T(e₁)=(1,0), T(e₂)=(2,1), so A=[1 2; 0 1] (1). Undoing x+2y gives A⁻¹=[1 −2; 0 1] (2). Thus input=(7−4,2)=(3,2) (1), and A(3,2)=(7,2) (1).
- Subtract row 1 from row 2: last pivot k−1 (1). Invertible exactly for k≠1 (1). At k=1, kernel contains (1,−1) (1) and image is {(a,a):a∈ℝ} (1).
- SD=[2 1; 0 1] (1). Its inverse D⁻¹S⁻¹=[1/2 −1/2; 0 1] (1). SD applies D first, then S; the inverse applies S⁻¹ first, then D⁻¹ (1).
Application and reasoning · 6 points
AB=[2 1;0 1], inverse B⁻¹A⁻¹=[1/2 −1/2;0 1] (1 each). Correct input is (1,1), which maps back to (3,1); wrong A⁻¹B⁻¹ gives (1/2,1), whose output is (2,1) (1 each). AB applies B then A; undo A first, then B, so inverse factors reverse order (2).
Scoring: existing questions 12 + application problem 6 = 18 points. Award the stated method and reasoning marks, not only final answers.
Download the transformation-and-inverse lab
Download the exact-arithmetic Python lab
Objective: apply A(k)=[1 1; 1 k] and determine whether its output uniquely identifies its input. Install free Python 3 from the official link below on Windows, macOS, or Linux. Save the file, open a terminal in its folder, and run the commands; Windows users can replace python3 with py -3. It runs offline after installation with no account or extra packages. Arguments are k, x₁, x₂, each from −4 to 6; rational values such as 3/2 are accepted.
python3 ee-transformations.py 2 2 -1
python3 ee-transformations.py 1 2 -1
python3 ee-transformations.py 0 1 2
python3 ee-transformations.py 3/2 1/2 -1
Procedure: predict Ax, perform row 2 minus row 1, and decide whether the remaining pivot k−1 is nonzero. Run each case and compare with the browser lab. For k≠1, solve x₂=(b₂−b₁)/(k−1) and x₁=(kb₁−b₂)/(k−1), giving A⁻¹=(1/(k−1))[k −1; −1 1]. The script verifies both identity products exactly and recovers the input. Expected outputs are (1,0), (1,1), (3,1), and (−1/2,−1); recovery works except in the second case. At k=1, input (3,−2) also gives (1,1), so no unique inverse exists. Question: why does an output error ε in the second component change recovered x₂ by ε/(k−1)? Because x₂=(b₂−b₁)/(k−1). This is an idealized algebraic experiment, not a physical calibration or a test of hardware skills.
Free primary readings and software
Read the transformation summary pp. 1–3 for linearity and basis images, then the inverse-matrices summary pp. 2–3 for Gauss–Jordan elimination. Lecture videos and problem sets are optional extensions. These materials are publicly accessible without institutional login; the suggested commercial textbook is not required.
- MIT 18.06SC · Linear Transformations and their Matrices: summary pp. 1–3, lecture and exercises
- MIT 18.06SC · Multiplication and Inverse Matrices: summary pp. 2–3 and problems
- Python Software Foundation · Free Python 3 downloads
- Python documentation · fractions and exact rational arithmetic
Inverse lab · Recover the input or show lost information
Apply A(k)=[1 1; 1 k] and check whether recovery is unique.
Free tool built into this page. Use it in your browser without an account or download.
Procedure
Try (k,x1,x2)=(2,2,−1), (1,2,−1), (0,1,2), and (1.5,0.5,−1). Predict the output and last pivot. Compare with the downloaded lab. At k=1, explain why two different inputs have the same output.
Expected results and answer check
Outputs are (1,0), (1,1), (3,1), and (−0.5,−1). Only the second case is singular: k−1=0 and inputs (2,−1) and (3,−2) share output (1,1). Other cases recover the original input. Since x2=(b2−b1)/(k−1), output error can be amplified when |k−1| is small.
The browser accepts half-unit inputs and rounds displayed inverses; Python uses exact rational arithmetic. This ideal model excludes measurement noise and saturation and does not teach physical calibration or instrument handling.