The concept of linearity is quite a general concept. However, I will keep it limited to linear transformation in the context of functions and matrix multiplications.
Linearity in Functions
Consider a function . For linearity, two different properties need to hold.
- Additivity:
- Homogeneity of degree-1 (Scaling):
Now these two properties can be combined into a single expression that holds if a function is linear:
Linearity in terms of Matrix Multiplication
The map is linear if for any and any ,
What does it mean intuitively or visually? It is hard to describe its general form. But some properties that need to be preserved in geometric sense:
- After the transformation, the origin of the vector can not be shifted
- Parallel lines stay parallel after transformation.
I will provide two counter-examples where linearity is not preserved.
The following is an example of affine transformations.
These kinds of transformations perform an additional “shifting” to the vectors in addition to a linear transformation. Here, the shifting is done by the vector and essentially shifts the origin which violates the assumptions of linearity. To summarize, Given a vector , is a linear transformation, but when an additional shift is applied it is no longer linear.
The following is another visualization of how a non-linear transformation may look like.
In a purely geometric sense, parallel lines are no longer parallel after the transformation.
Understanding the Linearity in Matrix Multiplication
Let’s define the matrix transformation as some functional transformation to the elementary basis vectors of the vector space .
What happens when we multiply the matrix with a specific basis vector?
What happens when we do this for a general vector ,
Now assuming the linearity holds we can we write the following