# Linear span

In mathematics, the linear span (also called the linear hull or just span) of a set $S$ of elements of a vector space $V$ is the smallest linear subspace of $V$ that contains $S.$ It is the set of all finite linear combinations of the elements of S, and the intersection of all linear subspaces that contain $S.$ It often denoted span(S) or $\langle S\rangle .$
For example, in geometry, two linearly independent vectors span a plane.
To express that a vector space V is a linear span of a subset S, one commonly uses one of the following phrases: S spans V; S is a spanning set of V; V is spanned or generated by S; S is a generator set or a generating set of V.
Spans can be generalized to many mathematical structures, in which case, the smallest substructure containing $S$ is generally called the substructure generated by $S.$

## Definition

Given a vector space V over a field K, the span of a set S of vectors (not necessarily finite) is defined to be the intersection W of all subspaces of V that contain S. It is thus the smallest (for set inclusion) subspace containing W. It is referred to as the subspace spanned by S, or by the vectors in S. Conversely, S is called a spanning set of W, and we say that S spans W.
It follows from this definition that the span of S is the set of all finite linear combinations of elements (vectors) of S, and can be defined as such. That is, $\operatorname {span} (S)={\biggl \\lambda _{1}\mathbf {v} _{1}+\lambda _{2}\mathbf {v} _{2}+\cdots +\lambda _{n}\mathbf {v} _{n}\mid n\in \mathbb {N} ,\;\mathbf {v} _{1},...\mathbf {v} _{n}\in S,\;\lambda _{1},...\lambda _{n}\in K{\biggr \}}$
When S is empty, the only possibility is n = 0, and the previous expression for $\operatorname {span} (S)$ reduces to the empty sum. The standard convention for the empty sum implies thus ${\text{span}}(\emptyset )=\{\mathbf {0} \},$ a property that is immediate with the other definitions. However, many introductory textbooks simply include this fact as part of the definition.
When $S=\{\mathbf {v} _{1},\ldots ,\mathbf {v} _{n}\}$ is finite, one has $\operatorname {span} (S)=\{\lambda _{1}\mathbf {v} _{1}+\lambda _{2}\mathbf {v} _{2}+\cdots +\lambda _{n}\mathbf {v} _{n}\mid \lambda _{1},...\lambda _{n}\in K\}$

## Examples

The real vector space $\mathbb {R} ^{3}$ has {(−1, 0, 0), (0, 1, 0), (0, 0, 1)} as a spanning set. This particular spanning set is also a basis. If (−1, 0, 0) were replaced by (1, 0, 0), it would also form the canonical basis of $\mathbb {R} ^{3}$.
Another spanning set for the same space is given by {(1, 2, 3), (0, 1, 2), (−1, 1⁄2, 3), (1, 1, 1)}, but this set is not a basis, because it is linearly dependent.
The set {(1, 0, 0), (0, 1, 0), (1, 1, 0)} is not a spanning set of $\mathbb {R} ^{3}$, since its span is the space of all vectors in $\mathbb {R} ^{3}$ whose last component is zero. That space is also spanned by the set {(1, 0, 0), (0, 1, 0)}, as (1, 1, 0) is a linear combination of (1, 0, 0) and (0, 1, 0). Thus, the spanned space is not $\mathbb {R} ^{3}.$ It can be identified with $\mathbb {R} ^{2}$ by removing the third components equal to zero.
The empty set is a spanning set of {(0, 0, 0)}, since the empty set is a subset of all possible vector spaces in $\mathbb {R} ^{3}$, and {(0, 0, 0)} is the intersection of all of these vector spaces.
The set of monomials x$^n$, where n is a non-negative integer, spans the space of polynomials.

## Theorems
### Equivalence of definitions

The set of all linear combinations of a subset S of V, a vector space over K, is the smallest linear subspace of V containing S.
    Proof. We first prove that span S is a subspace of V. Since S is a subset of V, we only need to prove the existence of a zero vector 0 in span S, that span S is closed under addition, and that span S is closed under scalar multiplication. Letting $S=\{\mathbf {v} _{1},\mathbf {v} _{2},\ldots ,\mathbf {v} _{n}\}$, it is trivial that the zero vector of V exists in span S, since $\mathbf {0} =0\mathbf {v} _{1}+0\mathbf {v} _{2}+\cdots +0\mathbf {v} _{n}$. Adding together two linear combinations of S also produces a linear combination of S: $(\lambda _{1}\mathbf {v} _{1}+\cdots +\lambda _{n}\mathbf {v} _{n})+(\mu _{1}\mathbf {v} _{1}+\cdots +\mu _{n}\mathbf {v} _{n})=(\lambda _{1}+\mu _{1})\mathbf {v} _{1}+\cdots +(\lambda _{n}+\mu _{n})\mathbf {v} _{n}$, where all $\lambda _{i},\mu _{i}\in K$, and multiplying a linear combination of S by a scalar $c\in K$ will produce another linear combination of S: $c(\lambda _{1}\mathbf {v} _{1}+\cdots +\lambda _{n}\mathbf {v} _{n})=c\lambda _{1}\mathbf {v} _{1}+\cdots +c\lambda _{n}\mathbf {v} _{n}$. Thus span S is a subspace of V.
    It follows that $S\subseteq \operatorname {span} S$, since every v$_i$ is a linear combination of S (trivially). Suppose that W is a linear subspace of V containing S. Since W is closed under addition and scalar multiplication, then every linear combination $\lambda _{1}\mathbf {v} _{1}+\cdots +\lambda _{n}\mathbf {v} _{n}$ must be contained in W. Thus, span S is contained in every subspace of V containing S, and the intersection of all such subspaces, or the smallest such subspace, is equal to the set of all linear combinations of S.

### Size of spanning set is at least size of linearly independent set

Every spanning set S of a vector space V must contain at least as many elements as any linearly independent set of vectors from V.
    Proof. Let $S=\{\mathbf {v} _{1},\ldots ,\mathbf {v} _{m}\}$ be a spanning set and $W=\{\mathbf {w} _{1},\ldots ,\mathbf {w} _{n}\}$ be a linearly independent set of vectors from V. We want to show that $m\geq n$.
    Since S spans V, then $S\cup \{\mathbf {w} _{1}\}$ must also span V, and $\mathbf {w} _{1}$ must be a linear combination of S. Thus $S\cup \{\mathbf {w} _{1}\}$ is linearly dependent, and we can remove one vector from S that is a linear combination of the other elements. This vector cannot be any of the w$_i$, since W is linearly independent. The resulting set is $\{\mathbf {w} _{1},\mathbf {v} _{1},\ldots ,\mathbf {v} _{i-1},\mathbf {v} _{i+1},\ldots ,\mathbf {v} _{m}\}$, which is a spanning set of V. We repeat this step n times, where the resulting set after the pth step is the union of $\{\mathbf {w} _{1},\ldots ,\mathbf {w} _{p}\}$ and m - p vectors of S.
    It is ensured until the nth step that there will always be some v$_i$ to remove out of S for every adjoint of v, and thus there are at least as many v$_i$'s as there are w$_i$'s—i.e. $m\geq n$. To verify this, we assume by way of contradiction that $m<n$. Then, at the mth step, we have the set $\{\mathbf {w} _{1},\ldots ,\mathbf {w} _{m}\}$ and we can adjoin another vector $\mathbf {w} _{m+1}$. But, since $\{\mathbf {w} _{1},\ldots ,\mathbf {w} _{m}\}$ is a spanning set of V, $\mathbf {w} _{m+1}$ is a linear combination of $\{\mathbf {w} _{1},\ldots ,\mathbf {w} _{m}\}$. This is a contradiction, since W is linearly independent.

### Spanning set can be reduced to a basis

Let V be a finite-dimensional vector space. Any set of vectors that spans V can be reduced to a basis for V, by discarding vectors if necessary (i.e. if there are linearly dependent vectors in the set). If the axiom of choice holds, this is true without the assumption that V has finite dimension. This also indicates that a basis is a minimal spanning set when V is finite-dimensional.

## Generalizations

Generalizing the definition of the span of points in space, a subset X of the ground set of a matroid is called a spanning set if the rank of X equals the rank of the entire ground set
The vector space definition can also be generalized to modules. Given an R-module A and a collection of elements a$_1$, ..., a$_n$ of A, the submodule of A spanned by a$_1$, ..., a$_n$ is the sum of cyclic modules $Ra_{1}+\cdots +Ra_{n}=\left\{\sum _{k=1}^{n}r_{k}a_{k}{\bigg |}r_{k}\in R\right\}$ consisting of all R-linear combinations of the elements a$_i$. As with the case of vector spaces, the submodule of A spanned by any subset of A is the intersection of all submodules containing that subset.

## Closed linear span (functional analysis)

In functional analysis, a closed linear span of a set of vectors is the minimal closed set which contains the linear span of that set.
Suppose that X is a normed vector space and let E be any non-empty subset of X. The closed linear span of E, denoted by ${\overline {\operatorname {Sp} }}(E)$ or ${\overline {\operatorname {Span} }}(E)$, is the intersection of all the closed linear subspaces of X which contain E.
One mathematical formulation of this is
    ${\overline {\operatorname {Sp} }}(E)=\{u\in X|\forall \varepsilon >0\,\exists x\in \operatorname {Sp} (E):\|x-u\|<\varepsilon \}.$
The closed linear span of the set of functions x$^n$ on the interval [0, 1], where n is a non-negative integer, depends on the norm used. If the L$^2$ norm is used, then the closed linear span is the Hilbert space of square-integrable functions on the interval. But if the maximum norm is used, the closed linear span will be the space of continuous functions on the interval. In either case, the closed linear span contains functions that are not polynomials, and so are not in the linear span itself. However, the cardinality of the set of functions in the closed linear span is the cardinality of the continuum, which is the same cardinality as for the set of polynomials.