From: 3blue1brown

Recap: Understanding Linear Transformations

Linear transformations are functions that take vectors as inputs and produce vectors as outputs [00:00:25]. Visually, they can be thought of as “smooshing around space” in a way that grid lines remain parallel and evenly spaced, and the origin stays fixed [00:00:33].

A key concept is that a linear transformation is entirely determined by where it moves the basis vectors of the space, such as i-hat and j-hat in two dimensions [00:00:41]. Any other vector can be described as a linear combination of these basis vectors [00:00:51]. For a vector with coordinates (x, y), it is x times i-hat plus y times j-hat [00:00:57].

After a transformation, the vector’s new position will be x times the transformed i-hat plus y times the transformed j-hat [00:01:10]. The coordinates where i-hat and j-hat land are conventionally recorded as the columns of a matrix [00:01:33]. Matrix-vector multiplication is defined as the sum of the scaled versions of these columns by x and y [00:01:37]. Thus, a matrix represents a specific linear transformation, and multiplying a matrix by a vector computationally applies that transformation [00:01:46].

Composing Linear Transformations

The composition of linear transformations refers to the effect of applying one transformation and then another [00:02:01]. For instance, rotating a plane 90 degrees counterclockwise and then applying a shear [00:02:07]. The overall effect of these successive actions is itself another linear transformation [00:02:15].

Representing Composed Transformations with Matrices

Like any linear transformation, a composite transformation can be described by its own unique matrix [00:02:28]. This matrix is found by tracking where the basis vectors (i-hat and j-hat) ultimately land after both transformations have been applied [00:02:32].

Example: If a rotation then a shear is applied:

  • The ultimate landing spot for i-hat becomes the first column of the new matrix [00:02:36].
  • The ultimate landing spot for j-hat becomes the second column of the new matrix [00:02:44]. This new matrix captures the entire effect of applying the rotation then the shear as a single action [00:02:52].

Matrix-Matrix Multiplication

When a vector is first multiplied by a rotation matrix and then the result is multiplied by a shear matrix, this sequence of operations is equivalent to applying the new composition matrix to the original vector [00:03:05]. This is what it means computationally to apply a sequence of transformations [00:03:20].

This concept leads to the definition of matrix-matrix multiplication, where the new matrix (the composition matrix) is considered the product of the original two matrices [00:03:42].

Calculating Matrix Products

To find the columns of the product matrix (representing M1 then M2):

  1. For the first column:
    • Find where i-hat lands after applying the first transformation (M1) [00:05:04]. This is the first column of M1 [00:05:08].
    • Multiply this resulting vector by the second transformation’s matrix (M2) [00:05:16]. The result is the first column of the composite matrix [00:05:30].
  2. For the second column:
    • Find where j-hat lands after applying the first transformation (M1) [00:05:34]. This is the second column of M1 [00:05:37].
    • Multiply this resulting vector by the second transformation’s matrix (M2) [00:05:42]. The result is the second column of the composite matrix [00:05:49].

Geometric Interpretation is Key

Always remember that multiplying two matrices has the geometric meaning of applying one transformation then another [00:03:56]. This conceptual understanding is more valuable than rote memorization of the algebraic formula for matrix multiplication [00:07:09].

Reading Order

When performing matrix multiplication M_left * M_right, the transformations are applied from right to left [00:04:05]. You first apply the transformation represented by the matrix on the right, then the transformation represented by the matrix on the left [00:04:10]. This convention stems from function notation, where functions are written to the left of variables (e.g., f(g(x))), requiring a right-to-left reading when composing functions [00:04:17].

Properties of Matrix Multiplication

Non-Commutativity (Order Matters)

The order in which matrices are multiplied does matter [00:07:28]. Example:

  • Applying a shear then a 90-degree rotation results in a different final state for the basis vectors compared to [00:07:43]
  • Applying a 90-degree rotation then a shear [00:07:53]. Since the overall effect is clearly different, the order of matrix multiplication affects the outcome [00:08:06]. This can often be visualized without performing explicit matrix calculations [00:08:12].

Associativity

Matrix multiplication is associative [00:08:29]. For three matrices A, B, and C, (A * B) * C is equal to A * (B * C) [00:08:32]. This means the grouping of operations (where parentheses are placed) does not change the final result [00:08:44].

From a geometric perspective, this property is trivial: if you apply transformation C, then B, then A, it’s the same sequence of actions regardless of how you group the matrix multiplications [00:08:55]. It’s simply applying the same three transformations one after the other, in the same order [00:09:04]. This conceptual understanding serves as a robust proof for associativity [00:09:21].

Engage with the Concepts

To deepen understanding, it’s recommended to visualize two different transformations, consider the outcome of applying one after the other, and then numerically work out the matrix product [00:09:31].

These concepts can be extended beyond two dimensions, which will be explored in future discussions [00:09:47].