Span, Basis, and Dimensions
Explore the fundamental concepts of span, basis, and dimensions within vector spaces to build a strong foundation in linear algebra. Understand how spanning sets generate vector spaces, learn what constitutes a basis with linearly independent vectors, and grasp the fixed nature of dimensions across bases. This lesson equips you with essential knowledge for applying these concepts to data science and Python coding projects.
Span
The span of a set, , is another set, , consisting of all the linear combinations of vectors in . The set is referred to as a spanning set.
Examples
We can create any vector in , say , using a linear combination of the spanning set . So, spans . That is:
- line in the direction of
Note: A line consists of points that are also position-vectors.
Spanning set isn’t unique
A spanning set corresponding to a given span isn’t unique.
In a previous example, we showed that . . However, there exists infinitely many spanning sets that span . For instance, . To prove this, we may show that and . That is:
Note: A vector, , is in the span of the vectors if is a linear combination of the vectors , i.e., .
The linear combination test can be viewed as a consistency check of a linear system. In the animation below, the column vectors of the coefficient matrix are linearly independent causing the two by two matrix to be invertible. So, the linear system is consistent for every right-hand-side b.
Span results in a vector space
The span of any spanning set will create a vector space. To formally prove this, we have to show that all axioms of the vector space are satisfied with a span of a set. Below, we prove only the closure axiom. Enthusiastic learners should try working out the other proofs too.
Consider , , and that scalars are taken from field . We need to show that is closed under linear combinations.
Basis
A basis of a vector space, , is a set, , of linearly independent vectors such that . In other words, a basis is a spanning set with linearly independent vectors.
Examples
- , and the set contains linearly independent vectors. So, is a basis for .
- , but the set doesn’t contain linearly independent vectors, so, isn’t a basis for .
Note: The basis of a vector space is not unique. It’s not hard to see that the columns of every invertible matrix form a basis for .
Note: Basis vectors are also known as axes. This also implies that the axis of a space need not be orthogonal.
Equivalence of basis
Given two bases, and , can we test if both span the same vector space? The answer is yes. We can check if every vector of one basis can be written as a linear combination of the vectors from the other basis or the other way around. Let’s write a code to do this.
Note: If both and are linearly independent sets and are in each other’s span, then both and are bases of the same space, which means that the basis of space isn’t unique.
Dimensions of a vector space
The dimensions of a vector space are the number of basis vectors for that vector space. Although the bases for a vector space aren’t unique, the vector space dimensions are fixed, that is, every basis has the same number of vectors.
Examples
- Consider . Every basis has independent vectors. The columns of a identity matrix form the standard basis of .
- Consider . This is a line through the origin in the direction of the spanning vector.