~/tedtes/writing/math-foundations-for-reasoning-models

~/writing/math-foundations-for-reasoning-models $ ls

Matrices as Transformations

Composition of Transformations

Composition means applying transformations in sequence, where one output becomes the next input.

~/writing/math-foundations-for-reasoning-models $ cat topic.md

Composition Of Transformations

Definition

Composition means applying transformations in sequence.

Example:

input -> transformation 1 -> intermediate output -> transformation 2 -> final output

If transformations are matrices, composition can be represented by matrix multiplication.

Composition = chaining transformations.


Step-By-Step Example

Start with:

v = [2, 3]

First transformation:

scale by 2
[2, 3] -> [4, 6]

Second transformation:

swap components
[4, 6] -> [6, 4]

The composed transformation sends:

[2, 3] -> [6, 4]

A composed transformation is the total effect of several steps.


Output Becomes Input

Composition works because the output of one transformation becomes the input to the next.

Example:

v -> B(v) -> A(B(v))

Read this as:

apply B first
then apply A

The composed transformation is:

A * B

In A * B, B acts first on the vector.


Why Order Matters

Changing the order can change the result.

Example:

scale then shift direction

may not match:

shift direction then scale

For matrices:

A * B is usually not equal to B * A

This is because the sequence of transformations matters.

Composition is order-sensitive.


Composition As One Rule

Multiple transformations can be replaced by one combined transformation.

Example:

v -> B(v) -> A(B(v))

can be represented as:

v -> (A * B)(v)

The matrix A * B packages the combined effect.

Composition compresses a sequence into one transformation rule.


Connection To Computation

Composition matches the computation pattern from earlier chapters:

state -> rule -> next state

With transformations:

vector -> matrix -> new vector

With composition:

vector -> matrix B -> matrix A -> final vector

Composition is step-by-step computation over vectors.


Why It Matters

Complex transformations can be built from simple ones.

Example:

scale
rotate
project

Each can be represented separately.

Composition lets them act as one structured operation.

Composition explains how simple transformations build complex transformations.


Final Summary

  • Composition applies transformations in sequence.
  • One output becomes the next input.
  • Matrix multiplication represents composition.
  • In A * B, B acts first.
  • Order usually matters.
  • Composition can package many steps into one transformation.

~/writing/math-foundations-for-reasoning-models $ open

Continue the series.

Identity Matrix