Home›Courses›Linear Algebra›Week 5 · Lecture 16
← Lecture 15
On this pageWhy Abstract?·Vector Space·VS Examples·Exercise: F[a,b]·Recall·Subspaces·Subspace Examples·Span, Once More·Span Example·Standard Spans·Theorem 6.2.2·Example 6.2.10·Independence·Basis & Dimension·dim P = ∞·More Examples·Exercises
Lecture 17 →
MATH-120 · Linear Algebra · Lecture 167 July 2026

Vector Spaces: Going Abstract

Everything we did in ℝⁿ works verbatim for matrices, polynomials, and functions — because it was never really about the arrows

§1Why Go Abstract?

In lecture, your instructor moved straight from subspaces of $\mathbb{R}^n$ (Lecture 14) to independence, basis, and dimension (Lecture 15) without ever writing down the general definition of a "vector space." That was not an oversight — it was a deliberate choice. $\mathbb{R}^n$ is already a vector space, and every idea in those two lectures can be built with plain coordinates, with nothing lost.

📋
A note on what was (and wasn't) covered in lecture
This lecture note starts with the formal definition of a vector space — a step the lecture itself skipped, on purpose. We add it here for a good reason: once you see the real definition, you'll realise that matrices, polynomials, and even functions are "vectors" too, obeying exactly the same rules $\mathbb{R}^n$ obeys. Skim the definition if you like — it is short and mostly a checklist — but know that everything from §6.2 onward (Nicholson) is genuinely new material, not review.

Here is the punchline before the details: every theorem you proved for $\mathbb{R}^n$ — "a span is always a subspace," "an independent set has no redundancy," "dimension is a well-defined number" — was never really about arrows with coordinates. It was about the rules those arrows obey: you can add them, you can scale them, and a short list of algebra laws holds. Any set with those rules is a vector space, and every proof from Lectures 14–15 carries over word for word.

§2The Definition of a Vector Space

Keep this as a checklist, not something to memorise line by line — you will almost never write out all eight rules by hand.

Vector space (Definition 6.1)

A vector space is a nonempty set $V$ together with a rule for addition and a rule for scalar multiplication (by real numbers), such that for all $\mathbf{x}, \mathbf{y}, \mathbf{z}$ in $V$ and all scalars $a, b$, the following eight rules hold:

A1$\mathbf{x}+\mathbf{y}$ is in $V$, and $\mathbf{x}+\mathbf{y}=\mathbf{y}+\mathbf{x}$.
A2$(\mathbf{x}+\mathbf{y})+\mathbf{z}=\mathbf{x}+(\mathbf{y}+\mathbf{z})$.
A3There is a zero vector $\mathbf{0}$ in $V$ with $\mathbf{0}+\mathbf{x}=\mathbf{x}$ for every $\mathbf{x}$.
A4Every $\mathbf{x}$ in $V$ has a negative $-\mathbf{x}$ in $V$ with $-\mathbf{x}+\mathbf{x}=\mathbf{0}$.
A5$a\mathbf{x}$ is in $V$ for every scalar $a$.
A6$a(\mathbf{x}+\mathbf{y})=a\mathbf{x}+a\mathbf{y}$.
A7$(a+b)\mathbf{x}=a\mathbf{x}+b\mathbf{x}$, and $a(b\mathbf{x})=(ab)\mathbf{x}$.
A8$1\mathbf{x}=\mathbf{x}$.
🔑
What actually matters in practice
You will almost never verify all eight axioms by hand. A1–A4 and A6–A8 are usually "obviously true," because addition and scalar multiplication are inherited from ordinary arithmetic — adding matrices, adding polynomials, adding functions all reduce to adding real numbers underneath. The only two axioms that can actually fail are A1's and A5's closure clauses: "$\mathbf{x}+\mathbf{y}$ is again in $V$" and "$a\mathbf{x}$ is again in $V$." That is the shortcut we use for every example below: check that the set is closed under addition and scalar multiplication — everything else follows for free from ordinary algebra.

§3Examples of Vector Spaces

For each example, ask three questions, in order:

  1. 1What is the space? — what are its elements: numbers, matrices, polynomials?
  2. 2What do addition and scalar multiplication mean here?
  3. 3Is it closed?

We will not write out all eight axioms each time — just the closure check, as the callout above promised.

1. $M_{mn}$ — all $m \times n$ matrices

The space $M_{mn}$ is the set of all $m \times n$ matrices with real entries. Its "vectors" are entire matrices. Addition is the usual entrywise matrix addition; scalar multiplication is the usual entrywise scaling — both from Lecture 5.

Example 1M_{mn} is a vector space

If $A$ and $B$ are both $m\times n$, then $A+B$ is computed entrywise and is again $m\times n$ — closed under addition. If $A$ is $m\times n$ and $c$ is a scalar, $cA$ is again $m\times n$ — closed under scalar multiplication. Since matrix addition and scaling are just real-number addition and multiplication applied entry by entry, A1–A4 and A6–A8 hold automatically (they are just the real-number rules, copied into every entry). So $M_{mn}$ is a vector space, with zero vector the $m\times n$ zero matrix.

2. $P$ — all polynomials

The space $P$ is the set of all polynomials $a_0 + a_1x + a_2x^2 + \cdots + a_nx^n$ (any finite degree $n \geq 0$, any real coefficients $a_i$). Addition adds like-degree coefficients; scalar multiplication scales every coefficient — the "foregoing" addition and scalar multiplication the textbook refers to.

Example 2P is a vector space

If $p$ and $q$ are polynomials, $p+q$ (add coefficient by coefficient) is again a polynomial — closed under addition. If $c$ is a scalar, $cp$ (scale every coefficient) is again a polynomial — closed under scalar multiplication. As with matrices, the remaining axioms are inherited from real-number arithmetic on the coefficients. So $P$ is a vector space, with zero vector the zero polynomial.

3. $P_n$ — polynomials of degree at most $n$

Given $n \geq 1$, $P_n$ is the set of all polynomials of degree at most $n$, together with the zero polynomial: $\{a_0+a_1x+\cdots+a_nx^n : a_i \text{ in } \mathbb{R}\}$.

Example 3P_n is a vector space

If $p, q$ each have degree $\leq n$, then $p+q$ also has degree $\leq n$ — adding polynomials never raises degree, terms can only cancel or combine. Closed under addition. If $c$ is a scalar, $cp$ has degree $\leq n$ too (or becomes the zero polynomial if $c=0$) — closed under scalar multiplication. So $P_n$ is a vector space. (You will soon see it is also a subspace of $P$ — more on that idea in a moment.)

§4Try It Yourself: Functions on an Interval

One more example, worth sitting with before we move on — here the "vectors" are not lists of numbers or polynomials, but entire functions.

Exercise 6.1.4F[a, b] — functions as vectors

Fix an interval $[a,b]$ of real numbers. Let $F[a,b]$ be the set of all real-valued functions $f : [a,b] \to \mathbb{R}$ — no continuity or smoothness required, just any rule assigning a number to each $x$ in $[a,b]$. Define addition and scalar multiplication pointwise:

$$(f+g)(x) = f(x) + g(x), \qquad (cf)(x) = c\cdot f(x), \qquad \text{for every } x \text{ in } [a,b].$$

In words: to add two functions, add their output values at every single point $x$. To scale a function by $c$, multiply every output value by $c$. Each single element of $F[a,b]$ is an entire graph, not a number.

Show that $F[a,b]$ is a vector space.

🧭
Hint
Use the same shortcut as above: check closure. If $f$ and $g$ are both functions on $[a,b]$, is $f+g$ (defined pointwise) also a function on $[a,b]$? Yes — at every $x$ you get a well-defined real number $f(x)+g(x)$, since real numbers can always be added. Is $cf$ also a function on $[a,b]$? Yes, for the same reason. Both closure checks hold "for free." The zero vector is the zero function $\mathbf{0}(x) = 0$ for every $x$; the negative of $f$ is $(-f)(x) = -f(x)$. Every remaining axiom (A1–A4, A6–A8) holds pointwise, because it holds for real numbers at each individual $x$. Try writing out A1 yourself: why does $(f+g)(x) = (g+f)(x)$ follow immediately from $f(x)+g(x)=g(x)+f(x)$?
🌌
Why this example matters
$F[a,b]$ is your first taste of an infinite-dimensional vector space — we will come back to what that phrase means later in this lecture. Every continuous function, every polynomial, every wiggly graph you have ever drawn on $[a,b]$ is one single "vector" living inside this space. This is the starting point for Fourier analysis, differential equations, and quantum mechanics — fields where "vector" means "function," and the machinery of this course (span, basis, dimension) still applies, almost unchanged.

§5Recall — And What Changes Now

Lectures 14 and 15 built subspaces, spanning, linear combinations, independence, basis, and dimension — entirely inside $\mathbb{R}^n$. Every definition and every theorem from those lectures carries over to any vector space $V$, word for word, with "vector in $\mathbb{R}^n$" replaced by "vector in $V$." We will not re-derive the theorems — we already have them — we will just point the same machinery at new kinds of vectors.

🔁
The dictionary
  • •Subspace axioms S1/S2/S3 → the exact same three rules, now for a subset $U$ of a vector space $V$.
  • •Linear combination and span → the exact same formula $a_1\mathbf{v}_1+\cdots+a_k\mathbf{v}_k$, now with the $\mathbf{v}_i$ possibly matrices or polynomials.
  • •Independent / dependent → the exact same "only the trivial combination vanishes" test.
  • •Basis, dimension → the exact same "independent and spanning" and "size of any basis."

Nothing new to memorise — just new vectors to plug in.

§6§6.2 — Subspaces of a Vector Space

Subspace (Definition 6.2)

A subset $U$ of a vector space $V$ is called a subspace of $V$ if $U$ is itself a vector space, using the same addition and scalar multiplication as $V$. In practice, you check three things:

S1The zero vector $\mathbf{0}$ of $V$ is in $U$.
S2If $\mathbf{x}, \mathbf{y}$ are in $U$, then $\mathbf{x}+\mathbf{y}$ is in $U$.
S3If $\mathbf{x}$ is in $U$, then $a\mathbf{x}$ is in $U$ for every scalar $a$.

Compare this with §5.1 of Lecture 14 — it is identical, with "$\mathbb{R}^n$" replaced by "$V$." Every subspace check you already know how to do (verify $\mathbf{0} \in U$, then closure) works completely unchanged, even when the vectors are matrices or polynomials.

§7Two Subspace Examples

★ 4Example 6.2.3 — matrices that commute with A

Let $A$ be a fixed matrix in $M_{nn}$. Show that $U = \{X \text{ in } M_{nn} : AX = XA\}$ is a subspace of $M_{nn}$.

★ 5Example 6.2.4 — polynomials with 3 as a root

Consider the set $U$ of all polynomials in $P$ that have $3$ as a root: $U = \{p(x) \text{ in } P : p(3) = 0\}$. Show that $U$ is a subspace of $P$.

🧩
Notice the pattern
Both examples above are defined by a condition — "commutes with $A$," "vanishes at $3$" — and both proofs followed the identical three-line shortcut: check $\mathbf{0}$ satisfies the condition, then check the condition survives addition and scaling. Once you have this shortcut, checking a subspace almost never requires new ideas — only patience.

§8Linear Combinations and Span, Once More

Linear combination & span, in any vector space

For vectors $\mathbf{v}_1, \ldots, \mathbf{v}_k$ in a vector space $V$, a linear combination is any vector $a_1\mathbf{v}_1+\cdots+a_k\mathbf{v}_k$ (scalars $a_i$), and the span $\operatorname{span}\{\mathbf{v}_1,\ldots,\mathbf{v}_k\}$ is the set of all such combinations. Exactly the definitions from Lecture 14, §5.1 — no change at all except that $\mathbf{v}_i$ can now be a matrix or a polynomial.

So $\operatorname{span}\{p_1, p_2\}$ for two polynomials means "every $ap_1+bp_2$," and testing whether a target polynomial lies in that span is — exactly as before — a question of solving a linear system for $a$ and $b$.

§9Testing Span Membership in P₂

★ 6Example 6.2.7 — is a polynomial in the span?

Consider $p_1 = 1+x+4x^2$ and $p_2 = 1+5x+x^2$ in $P_2$. Determine whether $p_1$ and $p_2$ lie in $\operatorname{span}\{1+2x-x^2,\; 3+5x+2x^2\}$.

§10Standard Spanning Sets

Just as $\{\mathbf{e}_1,\ldots,\mathbf{e}_n\}$ span $\mathbb{R}^n$ (Lecture 14, Example 5.1.6), each vector space above has its own natural "starter kit":

  • •$M_{mn}$: the $mn$ matrix units $E_{ij}$ (a $1$ in row $i$, column $j$, and $0$ elsewhere), for $i=1,\ldots,m$ and $j=1,\ldots,n$. Any matrix $A = \sum_{i,j} a_{ij}E_{ij}$, so these span $M_{mn}$.
  • •$P_n$: the $n+1$ monomials $\{1, x, x^2, \ldots, x^n\}$. Every $a_0+a_1x+\cdots+a_nx^n$ is literally a linear combination of these.
  • •$P$: the infinite list $\{1, x, x^2, x^3, \ldots\}$.
⚠️
A subtlety with infinite spanning sets
$P$ needs infinitely many spanning vectors — but "linear combination" still only ever means a finite sum. Every actual polynomial has some finite degree $n$, so it only ever uses finitely many of $1,x,x^2,\ldots$ (namely $1$ through $x^n$) with nonzero coefficient. An infinite spanning set just means you have an infinite menu to choose finitely many ingredients from — you never add infinitely many terms at once.

§11Theorem 6.2.2 — Span Is Still the Smallest Subspace

Theorem 6.2.2

Let $U = \operatorname{span}\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_n\}$ in a vector space $V$. Then:

  • •1. $U$ is a subspace of $V$ containing each of $\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_n$.
  • •2. $U$ is the "smallest" subspace containing these vectors, in the sense that any subspace that contains each of $\mathbf{v}_1, \ldots, \mathbf{v}_n$ must contain $U$.
🧠
This is exactly Theorem 5.1.1, one level up
You already proved the ideas behind this in Lecture 14. Part 1 holds because a combination of combinations is still a combination (closure), and each $\mathbf{v}_i$ is trivially $0\mathbf{v}_1+\cdots+1\mathbf{v}_i+\cdots+0\mathbf{v}_n$. Part 2 holds because any subspace $W$ containing all the $\mathbf{v}_i$ must, by closure under addition and scaling, contain every combination of them — which is exactly $U$. Same two-line argument, now stated for an arbitrary $V$.

§12A Spanning Set for P₃

★ 7Example 6.2.10 — does this odd-looking set span P₃?

Show that $P_3 = \operatorname{span}\{x^2+x^3,\; x,\; 2x^2+1,\; 3\}$.

§13§6.3 — Independence, Once More

Independence, in any vector space (quick recall)

A set $\{\mathbf{v}_1,\ldots,\mathbf{v}_k\}$ in a vector space $V$ is linearly independent if the only scalars making $a_1\mathbf{v}_1+\cdots+a_k\mathbf{v}_k = \mathbf{0}$ true are $a_1=\cdots=a_k=0$. Exactly Lecture 15's definition, unchanged. It is dependent otherwise — some nontrivial combination vanishes.

★ 8Example 6.3.1 — independence in P₂

Show that $\{1+x,\; 3x+x^2,\; 2+x-x^2\}$ is independent in $P_2$.

★ 9Example 6.3.3 — independence survives a mix

Suppose $\{\mathbf{u}, \mathbf{v}\}$ is an independent set in a vector space $V$. Show that $\{\mathbf{u}+2\mathbf{v},\; \mathbf{u}-3\mathbf{v}\}$ is also independent.

★ 10Example 6.3.5 — powers of a nilpotent matrix

Suppose $A$ is an $n\times n$ matrix with $A^k = 0$ but $A^{k-1} \neq 0$. Show that $B = \{I, A, A^2, \ldots, A^{k-1}\}$ is independent in $M_{nn}$.

§14Basis and Dimension, Once More

Basis and dimension (quick recall)

A basis of a subspace $U$ of $V$ is a set that is both independent and spans $U$ — no waste, nothing missing. The dimension $\dim U$ is the number of vectors in any basis (Lecture 15's Invariance Theorem guarantees this number does not depend on which basis you pick — and that proof did not use anything special about $\mathbb{R}^n$, so it holds here too).

Using the standard spanning sets from §10 (each one is also independent — a short check you can carry out the same way as Example 8), the dimensions are:

  • •$\dim \mathbb{R}^n = n$ (basis $\{\mathbf{e}_1,\ldots,\mathbf{e}_n\}$).
  • •$\dim P_n = n+1$ (basis $\{1,x,\ldots,x^n\}$ — count carefully: degree at most $n$ means $n+1$ monomials, from $x^0$ to $x^n$).
  • •$\dim M_{mn} = mn$ (basis the matrix units $\{E_{ij}\}$, of which there are $mn$).

§15An Interesting Fact: dim P = ∞

🎲
P has no finite basis
Here is something genuinely surprising: $P$, the space of all polynomials, has no finite basis at all. We say $\dim P = \infty$ — $P$ is infinite-dimensional.

The reason is short. Suppose, for contradiction, that finitely many polynomials $q_1,\ldots,q_m$ spanned $P$. Let $N$ be the largest degree among $q_1,\ldots,q_m$. Every linear combination $a_1q_1+\cdots+a_mq_m$ then has degree at most $N$ (combining polynomials never raises degree beyond the largest one you started with). But $x^{N+1}$ is a perfectly good polynomial in $P$ with degree $N+1 > N$ — it can never be reached by such a combination. So no finite set can span $P$; you always need infinitely many polynomials, e.g. all of $1, x, x^2, x^3, \ldots$, and that infinite set turns out to be independent too (no finite sub-collection of distinct powers of $x$ can combine to zero, since a nonzero polynomial of degree $N$ genuinely has a nonzero $x^N$ coefficient). An infinite independent spanning set is exactly what "infinite-dimensional" means.

📜
Why this idea matters — some history
Finite-dimensional spaces like $\mathbb{R}^n$ or $P_n$ can be fully understood with matrices and determinants — everything in this course so far. But the moment mathematicians started asking serious questions about functions — Joseph Fourier's early-1800s discovery that a periodic function can be built from infinitely many sine and cosine waves is the first great example — they were secretly doing linear algebra in an infinite-dimensional space, decades before anyone had the vocabulary for it. It took until the early 20th century, with David Hilbert, Stefan Banach, and others, for mathematicians to build a rigorous theory of infinite-dimensional vector spaces (now called functional analysis). That theory turned out to be exactly the right language for quantum mechanics — a particle's possible quantum states form an infinite-dimensional vector space (a Hilbert space), and predictions in quantum physics are, quite literally, "coordinates" of a vector in that space. The humble fact that $\dim P = \infty$ is the seed of all of that.

§16Two More Worked Examples

★ 11Example 6.3.10 — dimension of a matrix centralizer

Let $A = \begin{bmatrix} 1 & 1 \\ 0 & 0 \end{bmatrix}$ and consider the subspace $U = \{X \text{ in } M_{22} : AX = XA\}$ of $M_{22}$. Show that $\dim U = 2$ and find a basis of $U$.

★ 12Example 6.3.11 — the symmetric 2×2 matrices

Show that the set $V$ of all symmetric $2\times2$ matrices is a vector space, and find $\dim V$.

§17Exercises

Three problems to practice on your own, in the same spirit as today's examples. Hints only — try each one properly before reading further.

Exercise ASkew-symmetric 2×2 matrices

Let $U = \{A \text{ in } M_{22} : A^T = -A\}$ (the skew-symmetric matrices). Show $U$ is a subspace of $M_{22}$ and find $\dim U$.

🧭
Hint
The subspace check is the same three-line pattern as Example 6.3.11, with transposes. For the dimension: write $A=\begin{bmatrix}a&b\\c&d\end{bmatrix}$ and impose $A^T=-A$ entry by entry — you should find the diagonal entries are forced to be $0$ and the off-diagonal entries are forced to be negatives of each other, leaving only one free parameter.
Exercise BIndependence check in P₂

Determine whether $\{1-x^2,\; 2+x,\; x+x^2\}$ is independent in $P_2$.

🧭
Hint
Set $t_1(1-x^2)+t_2(2+x)+t_3(x+x^2)=0$ and match coefficients of $1, x, x^2$ to get three equations in $t_1,t_2,t_3$. Solve exactly as in Example 6.3.1 — chase the equations through in a convenient order until every $t_i$ is forced to $0$.
Exercise CNo finite set spans P

Using the idea from §15, explain in your own words why no finite set of polynomials can span $P$.

🧭
Hint
Suppose some finite set spanned $P$ and let $N$ be the largest degree appearing in it. What degree does every linear combination of that set have, at most? Now compare that to the polynomial $x^{N+1}$.
Looking back

Nothing in Lectures 14–15 was really about ℝⁿ. It was about closure, combinations, and counting — and that works anywhere.

Matrices, polynomials, and functions all turned out to be vectors in exactly the technical sense of Definition 6.1 — and every tool from subspaces to dimension carried over without a single new proof. That is the payoff of abstraction: prove something once, in general, and it is true forever after for every new example you meet — including ones, like $F[a,b]$, that you have not fully explored yet.

Lecture 16 — complete
MATH-120 · Shoaib Khan · LUMS · July 2026
← Lecture 15Lecture 17 →