Matrices are a table of real numbers. They can also be seen as a sequence of vectors. But they are more than that. They are functions, they can represent linear systems of equations and they are central to most of the operations in linear algebra. Matrices are images, neural networks, backbone of AI and multidimensional computation.
Definitions
Informally, matrices are rectangular array of (for now, real) numbers. Here is an m×n matrix:
The names that we came up with to describe the matrices might sound funny but they tell us a lot about the matrix. For now just be aware of the intuitive names:
from the lecture notes HS25
Square Matrices
Square matrices are special for reasons that will become clear later. We have specific and intuitive names to describe specific square matrices as you can see below. Be aware that a non square matrix can not belong to one of these categories.
Formal definitions can be found in the lecture notes. A square matrix can be attributed with more than one of the features listed above. For example a diagonal matrix is an upper triangular and also a lower triangular matrix, it is symmetric as well. E.g. a zero matrix has all four features together.
Matrix Vector Multiplication
Matrix vector multiplication can be seen as the linear combination of the columns of the matrix, where the coefficients are the elements of the vector.
2134+3297=134297[23]
In general:
A=∣v1∣∣v2∣…∣vn∣∈Rm×n,x=x1x2…xn∈Rn
Their multiplication is the linear combination of the column vectors of the matrix A. Be aware that the dimensions must match for us to be able to multiply a matrix with a vector. The matrix must have the same number of columns as the vector has elements.
Ax:=j=1∑nxjvj∈Rm
In column notation: with xi∈R (scalar) and vi∈Rm:
∣x1v1∣∣x2v2∣…∣xnvn∣
Observation
2.5
Let A be an m×n matrix.
(i) A vector b∈Rm is a linear combination of the columns of A if and only if there is a vector x∈Rn (of suitable scalars) such that Ax=b.
(ii) The columns of A are linearly independent if and only if x=0 is the only vector such that Ax=0.
You can also view the matrix vector multiplication as the scalar products of the rows of the matrix with the given vector.
Observation
2.8
(Matrix-vector multiplication with A in row notation)
Let
A=−−−u1⊤u2⊤⋮um⊤−−−∈Rm×n,x∈Rn. Then Ax=m scalar productsu1⊤xu2⊤x⋮um⊤x.
Column Space
Column space of a matrix is the span of its column vectors. Formally for A∈Rm×n the column space C(A) is:
C(A):={Ax:x∈Rn}⊆Rm
Zero is always in the column space of a matrix. 0∈C(A). Do not forget that the 0 is an abuse of notation here and 0∈Rm just as any vector in C(A).
Rank
The rank of a matrix is one of the most important features of a matrix. We define it as follows:
The rank of a matrix is the number of its independent columns.
A column of the matrix vj is independent if it can not be written as the linear combination of the previous columns.
An important observation is that a matrix A∈Rm×n (a matrix that has n columns) can only have
0≤rank(A)≤n
Note: rank(A)=0 only if A=0, the zero matrix.
The Transpose
There are many ways to think about the transpose of a matrix:
You get the transpose of a matrix by mirroring the entries along the diagonal.
The entry in aij of a matrix A is swapped with aji.
Transposing a matrix interchanges columns with rows.
A=134297A⊤=[123947]
Remember we also have transposes of vectors. With this fact, it is easier to think about the transpose of a matrix in terms of column and row notations.
The transpose in column and row notations, form lecture notes p.53
Important Notes on the Transpose:
Mirroring two times gives us the initial matrix: (A⊤)⊤=A.
A square matrix is symmetric if and only ifA=A⊤. (use this for proofs/calculations)
Row Space
Row space of a matrix A∈Rm×n is the span of its rows. Since the rows of A are the columns of A⊤ we can define the row space of A as follows:
R(A):=C(A⊤)⊆Rn
Similarly we define the row rank of a matrix as the number of its independent rows, or equivalently the number of the independent columns of its transpose.
Note that for all matrices the following relation holds:
row rank=column rank
Which we are going to prove later. However this leads to the following observation about the possible values of the rank of a matrix: a matrix A∈Rm×n can only have
0≤rank(A)≤min{m,n}
Nullspace
Nullspace is one of the fundamental spaces associated with a matrix. It consists of all the vectors that result in the zero vector 0 when multiplied with a matrix A. By this definition, 0 vector is always in the nullspace of any matrix. Formally:
N(A)={x∈Rn:Ax=0}⊆Rn
An important observation is that if an m×n matrix has N(A)={0}, ie0 is the only vector in the Nullspace, then the columns of the matrix are linearly independent according to Observation 2.5.
Linear Transformations
Linear Transformations are one of the fundamental concepts of linear algebra. Under the hood matrices are tools to represent linear transformations. At this point we should consider matrices as functions.
Matrices as Functions
Matrices are functions! They are defined as follows in the lecture notes:
Definition
2.18
(Matrix transformation)
Let A be an m×n matrix. The function TA:Rn↦Rm is the function defined by:
TA(x)=Ax
is the matrix transformation with matrix A.
To understand in what ways a matrix transforms a vector we are specifically interested in the standard unit vectors e1,e2,…,en. To intuitively sum up why, it is because we can express everything in a space Rn using the set of standard unit vectors. If we know what A does to this set of vectors, we can generalize the effect of A to all vectors in Rn.
This is demonstrated below. If you know what happens to the unit square (little red guy), then you can generalize that effect to any other shape or e.g. to any set of vectors.
Example from HS23
Certain operations have special names that intuitively describe the operation a matrix does. Some examples are scaling, shear, rotation and projection.
A =
Hints
In-Class
Section 2.1.4 from the lecture notes is helpful.
a) You can try to visualize this on unit vectors in R3. You can also first consider the matrix
[2121−2121]
No hints.
No hints.
d) Write the matrix A∈R3×3 in a generic way. Remember that if you can find one vector other than 0 with Ax=0, then you can prove rank(A)≤2.