Vectors, matrices and norms

Learning Objectives

Vector Spaces

A vector space is a set \(V\) of vectors and a field \(F\) (elements of F are called scalars) with the following two operations:

  1. Vector addition: \(\forall \mathbf{v},\mathbf{w} \in V\), \(\mathbf{v} + \mathbf{w} \in V\)
  2. Scalar multiplication: \(\forall \alpha \in F, \mathbf{v} \in V\), \(\alpha \mathbf{v} \in V\)

which satisfiy the following conditions:

  1. Associativity (vector): \(\forall \mathbf{u}, \mathbf{v}, \mathbf{w} \in V\), \((\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v}+\mathbf{w})\)
  2. Zero vector: There exists a vector \(\mathbf{0} \in V\) such that \(\forall \mathbf{u} \in V, \mathbf{0} + \mathbf{u} = \mathbf{u}\)
  3. Additive inverse (negatives): For every \(\mathbf{u} \in V\), there exists \(\mathbf{-u} \in V\), such that \(\mathbf{u} + \mathbf{-u} = \mathbf{0}\).
  4. Associativity (scalar): \(\forall \alpha, \beta \in F, \mathbf{u} \in V\), \((\alpha \beta) \mathbf{u} = \alpha (\beta \mathbf{u})\)
  5. Distributivity: \(\forall \alpha, \beta \in F, \mathbf{u} \in V\), \((\alpha + \beta) \mathbf{u} = \alpha \mathbf{u} + \beta \mathbf{u}\)
  6. Unitarity: \(\forall \mathbf{u} \in V\), \(1 \mathbf{u} = \mathbf{u}\)

If there exist a set of vectors \(\mathbf{v}_1,\mathbf{v}_2\dots, \mathbf{v}_n\) such that any vector \(\mathbf{x}\in V\) can be written as a linear combination

with uniquely determined scalars \(c_1,\dots,c_n\), the set \({\mathbf{v}_1,\dots, \mathbf{v}_n}\) is called a basis for \(V\). The size of the basis \(n\) is called the dimension of \(V\).

The standard example of a vector space is \(V=\mathbb{R}^n\) with \(F=\mathbb{R}\). Vectors in \(\mathbb{R}^n\) are written as an array of numbers:

The dimension of \(\mathbb{R}^n\) is \(n\). The standard basis vectors of \(\mathbb{R}^n\) are written as

A set of vectors \(\mathbf{v}_1,\dots,\mathbf{v}_k\) is called linearly independent if the equation \(\alpha_1\mathbf{v}_1 + \alpha_2\mathbf{v}_2 + \dots + \alpha_k\mathbf{v}_k = \mathbf{0}\) in the unknowns \(\alpha_1,\dots,\alpha_k\), has only the trivial solution \(\alpha_1=\alpha_2 = \dots = \alpha_k = 0\). Otherwise the vectors are linearly dependent, and at least one of the vectors can be written as a linear combination of the other vectors in the set. A basis is always linearly independent.

Inner Product

Let \(V\) be a real vector space. Then, an inner product is a function \(\langle\cdot, \cdot \rangle: V \times V \rightarrow \mathbb{R}\) (i.e., it takes two vectors and returns a real number) which satisfies the following four properties, where \(\mathbf{u}, \mathbf{v}, \mathbf{w} \in V\) and \(\alpha, \beta \in \mathbb{R}\):

  1. Positivity: \(\langle \mathbf{u}, \mathbf{u} \rangle \geq 0\)
  2. Definiteness: \(\langle \mathbf{u}, \mathbf{u} \rangle = 0\) if and only if \(\mathbf{u} = 0\)
  3. Symmetric: \(\langle \mathbf{u}, \mathbf{v} \rangle = \langle \mathbf{v}, \mathbf{u} \rangle\)
  4. Linearity: \(\langle \alpha \mathbf{u} + \beta \mathbf{v}, \mathbf{w} \rangle = \alpha \langle \mathbf{u}, w \rangle + \beta \langle \mathbf{v}, \mathbf{w} \rangle\)

The inner product intuitively represents the similarity between two vectors. Two vectors \(\mathbf{u}, \mathbf{v} \in V\) are said to be orthogonal if \(\langle \mathbf{u}, \mathbf{v} \rangle = 0\).

The standard inner product on \(\mathbb{R}^n\) is the dot product :

To read more about Inner Product Definition

Linear Transformations and Matrices

A function \(f: V \to W\) between two vector spaces \(V\) and \(W\) is called linear if

  1. \(f(\mathbf{u} + \mathbf{v}) = f(\mathbf{u}) + f(\mathbf{v})\), for any \(\mathbf{u},\mathbf{v} \in V\)
  2. \(f(c\mathbf{v}) = cf(\mathbf{v})\), for all \(\mathbf{v} \in V\) and all scalars \(c\)

\(f\) is commonly called a linear transformation.

If \(n\) and \(m\) are the dimension of \(V\) and \(W\), respectively, then \(f\) can be represented as an \(m\times n\) rectangular array or matrix

The numbers in the matrix \(\mathbf{A}\) are determined by the basis vectors for the spaces \(V\) and \(W\). To see how, we first review matrix vector multiplication.

Matrix-vector multiplication

Let \(\mathbf{A}\) be an \(m\times n\) matrix of real numbers. We can also write \(\mathbf{A}\in\mathbb{R}^{m\times n}\) as shorthand. If \(\mathbf{x}\) is a vector in \(\mathbb{R}^n\) then the matrix-vector product \(\mathbf{A}\mathbf{x} = \mathbf{b}\) is a vector in \(\mathbf{R}^m\) defined by:

We can interpret matrix-vector multiplications in two ways. Throughout this online textbook reference, we will use the notation to refer to the column of the matrix and to refer to the row of the matrix .

1) Writing a matrix-vector multiplication as inner products of the rows :

2) Writing a matrix-vector multiplication as linear combination of the columns of :

It is this representation that allows us to express any linear transformation between finite-dimensional vector spaces with matrices.

Matrix Representation of Linear Transformations

Let be the standard basis of . If we define the vector , then using the interpretation of matrix-vector products as linear combinations of the column of , we have that:

where we have written the standard basis of as .

In other words, if is written as a linear combination of the basis vectors of , the element is the coefficient corresponding to .


Let’s try an example. Suppose that \(V\) is a vector space with basis \(\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\), and \(W\) is a vector space with basis \(\mathbf{w}_1,\mathbf{w}_2\). Then \(V\) and \(W\) have dimension 3 and 2, respectively. Thus any linear transformation \(f: V \to W\) can be represented by a \(2\times 3\) matrix. We can introduce column vector notation, so that vectors \(\mathbf{v} = \alpha_1\mathbf{v}_1 + \alpha_2\mathbf{v}_2 + \alpha_3\mathbf{v}_3\) and \(\mathbf{w} = \beta_1\mathbf{w}_1 + \beta_2\mathbf{w}_2\) can be written as

We have not specified what the vector spaces \(V\) and \(W\), but it is fine if we treat them like elements of \(\mathbb{R}^3\) and \(\mathbb{R}^2\).

Suppose that the following facts are known about the linear transformation \(f\):

This is enough information to completely determine the matrix representation of \(f\). The first equation tells us

So we know . The second equation tells us that

So we know . Finally, the third equation tells us

Thus, \(a_{13} = 2,\ a_{23} = 2\), and the linear transformation \(f\) can be represented by the matrix:

It is important to note that the matrix representation not only depends on \(f\), but also our choice of basis. If we chose different bases for the vector spaces \(V\text{ and } W\), the matrix representation of \(f\) would change as well.

Special Matrices

Zero Matrices

The \(m \times n\) zero matrix is denoted by \({\bf 0}_{mn}\) and has all entries equal to zero. For example, the \(3 \times 4\) zero matrix is

Identity Matrices

The \(n \times n\) identity matrix is denoted by \({\bf I}_n\) and has all entries equal to zero except for the diagonal, which is all 1. For example, the \(4 \times 4\) identity matrix is

Diagonal Matrices

A \(n \times n\) diagonal matrix has all entries equal to zero except for the diagonal entries. We typically use \({\bf D}\) for diagonal matrices. For ecample, \(4 \times 4\) diagonal matrices have the form:

Triangular Matrices

A lower-triangular matrix is a square matrix that is entirely zero above the diagonal. We typically use \({\bf L}\) for lower-triangular matrices. For example, \(4 \times 4\) lower-triangular matrices have the form:

An upper triangular matrix is a square matrix that is entirely zero below the diagonal. We typically use \({\bf U}\) for upper-triangular matrices. For example, \(4 \times 4\) upper-triangular matrices have the form:

Properties of triangular matrices:

  1. An \(n \times n\) triangular matrix has \(n(n-1)/2\) entries that must be zero, and \(n(n+1)/2\) entries that are allowed to be non-zero.
  2. Zero matrices, identity matrices, and diagonal matrices are all both lower triangular and upper triangular.

Permutation Matrices

A permuation matrix is a square matrix that is all zero, except for a single entry in each row and each column which is 1. We typically use \({\bf P}\) for permutation matrices. An example of a \(4 \times 4\) permutation matrix is

The properties of a permutation matrix are:

  1. Exactly \(n\) entries are non-zero.
  2. Multiplying a vector with a permutation matrix permutes (rearranges) the order of the entries in the vector. For example, using \({\bf P}\) above and \(x = [1, 2, 3, 4]^T\), the product is \({\bf Px} = [2, 4, 1, 3]^T\).
  3. If \(P_{ij} = 1\) then \(({\bf Px})_i = x_j\).
  4. The inverse of a permutation matrix is its transpose, so \({\bf PP}^T = {\bf P}^T{\bf P} = {\bf I}\).

Matrices in Block Form

A matrix in block form is a matrix partitioned into blocks. A block is simply a submatrix. For example, consider

where \({\bf A}\), \({\bf B}\), \({\bf C}\), and \({\bf D}\) are submatrices.

There are special matrices in block form as well. For instance, a block diagonal matrix is a block matrix whose off-diagonal blocks are zero matrices.

Matrix Rank

The rank of a matrix is the number of linearly independent columns of the matrix. It can also be shown that the matrix has the same number of linearly indendent rows, as well. If \(\mathbf{A} \text{ is an } m \times n\) matrix, then

  1. \(\text{rank}(\mathbf{A}) \leq \text{min}(m,n)\).
  2. If \(\text{rank}(\mathbf{A}) = \text{min}(m,n)\), then \(\mathbf{A}\) is full rank. Otherwise, \(\mathbf{A}\) is rank deficient.

A square \(n\times n\) matrix \(\mathbf{A}\) is invertible if there exists a square matrix \(\mathbf{B}\) such that \(\mathbf{AB} = \mathbf{BA} = \mathbf{I}\), where \(\mathbf{I}\) is the \(n\times n\) identity matrix. The matrix \(\mathbf{B}\) is denoted by \(\mathbf{A}^{-1}\). A square matrix is invertible if and only if it has full rank. A square matrix that is not invertible is called a singular matrix.

Vector Norm

A vector norm is a function (i.e., it takes a vector and returns a nonnegative real number) that satisfies the following properties, where and :

  1. Positivity:
  2. Definiteness: if and only if
  3. Homogeneity:
  4. Triangle inequality:

A norm is a generalization of “absolute value” and measures the “magnitude” of the input vector.

The p-norm

The p-norm is defined as


The definition is a valid norm when . If then it is not a valid norm because it violates the triangle inequality.

When (2-norm), this is called the Euclidean norm and it corresponds to the length of the vector.

Vector Norm Examples

Consider the case of , in this part we will show how to calculate the 1, 2, and norm of .

For the 1-norm:

For the 2-norm:

For the -norm:

Matrix Norm

A general matrix norm is a real valued function that satisfies the following properties:

  1. Positivity:
  2. Definiteness: if and only if
  3. Homogeneity: for all scalars
  4. Triangle inequality:

Induced (or operator) matrix norms are associated with a specific vector norm and are defined as:

An induced matrix norm is a particular type of a general matrix norm. Induced matrix norms tell us the maximum amplification of the norm of any vector when multiplied by the matrix. Note that the definition above is equivalent to

In addition to the properties above of general matrix norms, induced matrix norms also satisfy the submultiplicative conditions:

Frobenius norm

The Frobenius norm is simply the sum of every element of the matrix squared, which is equivalent to applying the vector -norm to the flattened matrix,

The Frobenius norm is an example of a general matrix norm that is not an induced norm.

The matrix p-norm

The matrix p-norm is induced by the p-norm of a vector. It is . There are three special cases:

For the 1-norm, this reduces to the maximum absolute column sum of the matrix, i.e.,

For the 2-norm, this reduces the maximum singular value of the matrix.

For the -norm this reduces to the maximum absolute row sum of the matrix.

Matrix Norm Examples

Now we will go through a few examples with a matrix , defined below.

For the 1-norm:

For the 2-norm:

The singular values are the square roots of the eigenvalues of the matrix . You can also find the maximum singular values by calculating the Singular Value Decomposition of the matrix.

For the -norm:

Review Questions