Linear Algebra: Linear Algebra
Linear Operators
Mappings
In linear algebra, besides the operations that involve two vectors (vector addition, dot product), there are functions (mappings) that take as an input a vector, and output a vector. Let’s denote this mapping as . Formally, any mapping of this sort can be written as:
Let’s consider the following two mappings and :
Now, which mappings can be called linear mappings? The conditions are intuitive, and quite similar to the ones of the vector spaces, so we shall provide now a formal definition.
Linear mapping Let and be vector spaces over the same field . A function is said to be a linear map if for any two vectors and from and any scalar from , the following two conditions are satisfied:
- Additivity: .
- Homogeneity: .
Matrix-vector multiplication
If you’ve encountered linear algebra before, then you probably associate linear mappings/transformations/operators with matrices. Let’s first discuss how and why matrix-vector multiplication works, and then we will connect it to the concept of linear mappings discussed in the previous subsection.
Example of a square matrix To start, let’s imagine we have a very simple canonical basis in , where the basis vectors are:
Now that we know how a matrix transformation transforms our basis vectors, let’s see how this applies to an arbitrary vector. Let’s consider a general matrix and a vector of the following form:
- We have decomposed the vector into its separate components.
- We have pulled out the scalar from each vector in order to easily recognize the basis vectors and .
- Since we are dealing with a linear operator, we use the additivity property defined above.
- Again, as we are dealing with a linear operator, we use homogeneity property defined above.
- We use the definition of what matrix columns represent, i.e. we transform the canonical basis vectors accordingly.
- We simply sum up the two remaining vectors.
Using known rules we have derived the elements of the transformed vector. This result is general, and if we have a matrix-vector multiplication of the type , then the -th element of the output vector is given by:
Example of a non-square matrix In the example above, we have assumed that the matrix is a square matrix, which resulted in vectors and having the same dimension. Let’s take a look at another matrix,
. We will define as
Summary Let’s summarize our current findings regarding matrix-vector multiplication:
- We have a general formula for calculating how a matrix transforms a vector.
- The matrix-vector multiplication may or may not change the dimensionality of the input vector.
- If we have an matrix ( rows, columns), then the input vector has to be -dimensional, while the output will be -dimensional.
- All linear transformations (in finite dimensions) can be written in the matrix form.
Matrix-matrix multiplication
In the previous subsection, we have discussed how matrices (linear operators) transform vectors, and how to calculate elements of the transformed vectors. Matrix-matrix multiplication can be thought of as chaining two transformations one after another, and for this reason, we can calculate the resulting matrix elements by analyzing how the two transformations act on the basis vectors. For simplicity, let’s assume that we have two matrices and of the following form:
In general, if we have a matrix-matrix multiplication of the type , then the -th element of the matrix is given by:
Special types of matrices Next, let’s take a look at two special types of matrices:
- Identity matrix: Identity matrix is often denoted by or \mathbb{I}\), and it represents a matrix that leaves every vector unchanged, i.e. for any vector . Such matrix has elements on the diagonal, and otherwise. For example, a identity matrix has the following form:
- Inverse matrix: An inverse of a matrix is denoted as , and is defined by the following equation: . Intuitively, we can think of the inverse matrix as a matrix that counteracts the operation done by the matrix . Therefore, if we chain the two transformations together, it should be the same as if we did nothing (i.e. the total transformation is equal to the identity matrix ). A matrix that has an inverse is called an invertible matrix, and only square matrices are invertible.
Summary Let’s briefly summarize important information regarding matrix-matrix multiplication:
- Using our formula we can find elements of a matrix that is the result of matrix-matrix multiplication.
- Multiplying an matrix with a matrix will result in an matrix.
- In general, matrix multiplication is not commutative, i.e. .
- An identity matrix leaves every vector unchanged.
- Some square matrices have an inverse, which is denoted by .