# Dimension of a linear space

The dimension of a linear space is defined as the cardinality (i.e., the number of elements) of its bases.

For the definition of dimension to be rigorous, we need two things:

• we need to prove that all linear spaces have at least one basis (and we can do so only for some spaces called finite-dimensional spaces);

• we need to prove that all the bases of a finite-dimensional space have the same cardinality (this is the so-called Dimension Theorem).

Recall that we have previously defined a basis for a space as a finite set of linearly independent vectors that span the space itself.

## Dimension theorem

We now prove that all the bases of a given linear space have the same cardinality.

Proposition (Dimension theorem) Let be a linear space. Let and be two bases of . Then, .

Proof

The proof is by contradiction. Suppose that . Then, we can assume without loss of generality that (you can always exchange the order of the two bases). Denote the first basis byand the second basis bySince is a basis, there exist scalars , ..., such thatAt least one of the scalars must be different from zero because otherwise we would have , in contradiction with our hypothesis that is linearly independent from the other elements of . Without loss of generality, we can assume that (if it is not, we can re-number the vectors in the basis). By the basis replacement theorem (see the lecture entitled Basis of a linear space, and in particular the proof of the theorem), we have thatis also a basis. Because is a basis, there exist scalars , ..., such thatAt least one of the scalars must be different from zero because otherwise we would have . Furthermore, one of must be different from zero because otherwise we would have which contradicts the hypothesis that and are linearly independent. We can assume without loss of generality thatso that we can apply the basis replacement theorem and form a new basisWe can proceed in this way until we get the basisBut we now have a contradiction: cannot be a basis because can be written as a linear combination of and, as a consequence, the vectors of are linearly dependent. Therefore, it must be that .

## Finite-dimensional space

We are going to restrict our definition of dimension to so-called finite-dimensional spaces, defined as follows.

Definition A linear space is said to be finite-dimensional if and only if there exists at least one finite set of vectors such thatwhere denotes the span of .

In other words, a space is finite-dimensional if it has a finite spanning set.

## Existence of a basis

The following proposition holds.

Proposition Let be a finite-dimensional linear space. Then, possesses at least one basis.

Proof

Since is finite-dimensional, it has a spanning set . Choose any such that . By itself, trivially constitutes a set of linearly independent vectors. By the basis extension theorem, given the independent set and the spanning set , we can extend the independent set to form a basis for .

## Definition of dimension

Having established that a linear space always possesses a basis and all its bases have the same cardinality, we are now ready to define the concept of dimension of a linear space.

Definition Let be a finite-dimensional linear space. Let be the cardinality (i.e., the number of elements) of any one of its bases. Then, is called the dimension of .

The following example shows that the definition of dimension agrees with our intuition: the dimension of the space of all column vectors is .

Example Let be the linear space of all column vectors. Define the three vectorsThen are a basis for because 1) any vector can be written asand 2) no element of the basis can be written as a linear combination of the others (as a consequence, they are linearly independent). Thus, the basis has elements and the dimension of the space is .

Note that the dimension of a linear space of column vectors having entries can be less than , as shown by the following example.

Example Consider the linear space of all the column vectorssuch that their first two entries can be any scalars and , and their third entry is equal to . Such a space is spanned by the basiswhose cardinality is equal to . Therefore, the dimension of the space is equal to .

## Solved exercises

Below you can find some exercises with explained solutions.

### Exercise 1

Read the last example and show that is indeed a basis.

Solution

Denote the two elements of the basis byThe two vectors are linearly independent because neither of them is a multiple of the other one. Furthermore, all the vectors of the space can be written asthat is, as a linear combination of the two vectors belonging to the basis.

### Exercise 2

Find the dimension of the linear space spanned by the two vectors

Solution

The linear span of and is the space of all vectors that can be written as linear combinations of and . In other words, any can be written aswhere and are two scalars. However, the two vectors and are linearly dependent becauseTherefore, any vector can be written asthat is, all vectors are multiples of . Thus, is a basis for . Its cardinality is . Therefore, the dimension of is .