Not every vector space is given by the span of a finite number of vectors. Such a vector space is said to be of infinite dimension or infinite dimensional. We will now see an example of an infinite dimensional vector space.
Let \(P\) denote the vector space of all polynomials in \(x\) with rational coefficients. (It is not difficult to check that \(P\) is indeed a vector space with the usual polynomial addition as vector addition and multiplying a polynomial by a rational number as scalar multiplication.) For example, the following are all vectors in \(P\): \(5\), \(x^{1000} + 2x\), \(x^4 + x^3 - x^2 + 8\). Adding the first two gives \(x^{1000} + 2x + 5\) and multiplying the last one by \(3\) gives \(3x^3+3x^3-3x^2 + 24\).
We claim that \(P\) is infinite dimensional.
Suppose to the contrary that \(P\) is given by the span of \(k\) polynomials in \(P\), \(p_1,\ldots,p_k\). Let \(m\) denote the maximum of the degrees of these \(k\) polynomials. Then \(x^{m+1}\) is a vector in \(P\) but it cannot be written as a linear combination of \(p_1,\ldots,p_k\) because taking linear combinations of polynomials of degree at most \(m\) cannot give polynomials of degree higher than \(m\). Hence, \(x^{m+1}\) is not in the span of \(\{p_1,\ldots,p_k\}\), which is a contradiction.
A vector space that is not of infinite dimension is said to be of finite dimension or finite dimensional. For example, if we consider the vector space consisting of only the polynomials in \(x\) with degree at most \(k\), then it is spanned by the finite set of vectors \(\{1,x,x^2,\ldots, x^k\}\).