Skip to main content
Mathematical Foundations for Machine Learning

Groups, Vector Spaces, and Linear Combinations

📅 Published: 2026-07-08
🎓 Level: postgraduate
👥 Audience: Postgraduate students in Mathematical Foundations for Machine Learning

3.1 Groups

Hook. You know that adding 5 and then subtracting 5 gets you back to where you started. But what if you multiply two matrices? Can you always undo that multiplication? Why do some operations have a guaranteed "undo" button and others don't? The answer to this question is what the theory of groups is built to answer.
Intuition + Analogy. Think of a group as a well-designed board game. You have a set of game pieces (the set of elements). You have one legal move you can make with any two pieces (the binary operation). The game has four rules.

(1) Any move lands you on another piece on the board — you never fall off. (2) When you chain three moves, the grouping does not change the outcome. (3) There is a "skip turn" piece that leaves things unchanged. (4) Every move has a "reverse move" that undoes it.

A set-plus-operation pair that follows all four rules is a group. If even one rule breaks, the game is broken — and it is not a group. Where the analogy breaks: In a board game, you normally choose which pieces to move and when. In a group, the operation is fully defined for every pair —. In a group, the operation is fully defined for every pair. — you don't have a choice of which operation to apply. ; In a group, the operation is fully defined for every pair. — you don't have a choice of which operation to apply. ; there is only one.

3.1.1 What Is a Group

A group is one of the most fundamental structures in abstract algebra. It consists of exactly two things:

  1. A set of elements — a collection of items. You already know many sets: the set of all integers,. the set of all whole numbers,. the set of all even numbers,. the set of square numbers. While we usually think of elements as numbers, they can be anything —. While we usually think of elements as numbers, they can be anything. — matrices, functions, symmetries of a shape, or moves in a puzzle.
  2. A binary operation — an operation that takes two elements and produces a result. The basic binary operations are addition, subtraction, multiplication, and division.

When you take a set of elements together with a binary operation, the whole composition is called a group —. When you take a set of elements together with a binary operation, the whole composition is called a group. — provided it follows four basic rules. We write a group as , pronounced "the group G under the operation circle."

Notation. A binary operation is often written with the symbol (used in pure mathematics). So for two elements in the group , the operation is written . For concrete operations like addition or multiplication, we write the familiar symbols or .

3.1.2 Symbol Registry

SymbolNameMeaningTypeDomain
Group setThe collection of elements forming the groupSet
Binary operationThe operation combining two elementsOperation
ElementsMembers of the group set Element
IntegersThe set Set
Natural numbersThe set Set
Identity elementThe "do-nothing" elementElement
Inverse elementThe "undo" partner of Element
"For all"Universal quantifierQuantifier
"There exists"Existential quantifierQuantifier
"Belongs to"Set membershipRelation

3.1.3 The Four Group Properties

For a set and an operation to form a group, all four of these properties must hold. If even one fails, it is not a group. Think of these as the four legs of a table — remove any one and the structure collapses.

Property 1: Closure

Formal statement. For all elements , the result must also belong to .

What it means. Take any two elements from the set and apply the operation. The output must stay inside the set. It cannot land outside. This is the most basic requirement — the operation must be a "closed loop" within the set.

Example (holds). Let (the set of all integers) and let the operation be addition. Take and . Then , and is also an integer. This works for any two integers — the sum of two integers is always an integer.

Example (holds). Same set with multiplication. , still an integer.

Example (fails). with division. , which is not an integer. The output has left the set. So is not a group — it fails closure right away.

Example (fails). Let the set be the natural numbers and the operation be subtraction. Take and : , which is negative and not in . Fails closure.

Example (fails). Let the set be the square numbers with addition. , which is not a perfect square. Fails closure.

Important nuance. If a property holds for some specific cases but fails for others, it does not hold. The property must be true for all elements in the set. A single counterexample is enough to disqualify the group.

Geometric intuition. Picture all the integers on a number line from to . If you add any two integers, the result is still a point on that same line. If you multiply any two integers, the result is still on that line. That is closure.

Property 2: Associativity

Formal statement. For all , .

What it means. A binary operation only works on two elements at a time. When you have three or more elements, you must group them — you decide which two to combine first. Associativity says the grouping does not affect the final output. You can combine the first two first, then add the third. Or combine the last two first, then add the first. You get the same result either way.

Example (holds). with addition. Take :

The same holds for multiplication. For with multiplication, grouping vs always gives the same product.

Key distinction from commutativity. Associativity is about grouping when you have more than two elements. It is not about the order of the elements. Order is a separate property called commutativity. A group can be associative without being commutative — A group can be associative without being commutative. — for example, matrix multiplication: (associative), but A group can be associative without being commutative. — for example, matrix multiplication: (associative), but generally (not commutative).

Property 3: Identity Element

Formal statement. There must exist a special element such that for every ,. .

What it means. There is a "do-nothing" element in the set. When you apply the operation with this element and any other element, the result is just the other element — unchanged.

Example. with addition. The identity is , because for any integer .

Example. with multiplication. The identity is , because for any integer .

So the identity element depends on the operation, not just the set. The same set has identity under addition but identity under multiplication.

Property 4: Inverse Element

Formal statement. For every ,. there must exist an element such that ,. where. is the identity element.

What it means. Every element must have an "undo" partner in the set. When you combine an element with its inverse using the group operation, you get back to the identity.

Example. with addition. The inverse of is , because (the identity). For any integer , its additive inverse is .

Example. Multiplication. The inverse of is , because (the identity). But note: under the set of integers with multiplication, is not an integer. So fails the inverse property and is not a group. It passes closure, associativity, and identity — but fails inverse.

Why inverses matter. Inverses give you the ability to "go back" — to undo an operation and return to where you started. If you apply a transformation, you need a way to reverse it. This concept will be critical when we study matrix inverses and their role in solving linear systems .

3.1.4 Summary: The Group Test

A candidate is a group if and only if:

#PropertyTest
1Closure
2Associativity
3Identity such that
4Inverse such that

All four must hold. One failure and it is not a group.

3.1.5 Worked Examples: Group or Not?

Example 1: — the set of integers under addition.

  • Closure: sum of two integers is an integer. ✓
  • Associativity: . ✓
  • Identity: is an integer and . ✓
  • Inverse: for any integer , is also an integer and . ✓
  • Verdict: Group.

Example 2: — the set of integers under multiplication.

  • Closure: product of two integers is an integer. ✓
  • Associativity: . ✓
  • Identity: is an integer and . ✓
  • Inverse: for , the inverse would be , which is not an integer. ✗
  • Verdict: Not a group. (Fails inverse.)

Example 3: — natural numbers under subtraction.

  • Closure: . ✗
  • Verdict: Not a group. (Fails closure immediately — no need to check further.)

Example 4: Set of all matrices with integer entries, under matrix multiplication.

  • Closure: product of two integer matrices is a integer matrix. ✓
  • Associativity: matrix multiplication is associative. ✓
  • Identity: the identity matrix is in the set. ✓
  • Inverse: not every matrix has an inverse (singular matrices have no inverse). Even when an inverse exists, its entries may not be integers. ✗
  • Verdict: Not a group. (Fails inverse.)
Scope: When this applies and when it breaks.

The group framework applies to any set-plus-operation pair where all four axioms hold. But it is a local property — it depends entirely on the specific set and operation you choose. The same set is a group under but not under (fails inverse) or (fails closure).

Key assumption: the operation must be fully defined for every pair in the set. If the operation is undefined for some pairs (like division by zero), the group framework does not even apply —. If the operation is undefined for some pairs (like division by zero), the group framework does not even apply. — those cases are handled by more general algebraic structures.

Another assumption: the properties are checked over the entire set. A single counterexample kills the group. You cannot salvage a failed candidate by removing a few "problematic" elements —. You cannot salvage a failed candidate by removing a few "problematic" elements. — unless the remaining subset itself forms a subgroup, which You cannot salvage a failed candidate by removing a few "problematic" elements. — unless the remaining subset itself forms a subgroup, which is a separate concept.

What breaks if a property fails:

  • If closure fails, the operation is unreliable — you might produce results outside your universe.
  • If associativity fails, the outcome depends on the order you evaluate, which makes reasoning about chained operations impossible.
  • If identity is missing, you lose the concept of a "neutral" state — there is no baseline.
  • If inverses are missing, some operations become irreversible — you cannot go back.

3.1.6 Visual Intuition

Picture a number line stretching from to . Mark every integer as a dot. Now imagine the operation of addition as a rule that takes any two dots and slides along the line to a third dot. Because the integers are evenly spaced and extend infinitely in both directions, any addition lands on another dot — closure holds. The zero sits at the center, unmoving — that is your identity. Every dot has a mirror image on the opposite side of zero — that is the inverse.

Now imagine instead the set of natural numbers on a ray starting at 1 and going right forever. If you subtract, you might slide left past 1 into negative territory — off the ray entirely. The ray cannot contain the result. That is closure failure.

Takeaway: a group's set must be "symmetric" around the identity under its operation. Integers stretch both ways, so addition works. Naturals only go one way, so subtraction breaks.

Pitfalls — common traps when testing for a group.
  1. Checking one or two elements is not enough. Showing that does not prove closure. You must confirm it holds for every possible pair. But to disprove closure, one counterexample is enough.
  2. Confusing associativity with commutativity. Associativity is about grouping : . Commutativity is about order : . They are different properties and a group requires only associativity. String concatenation is associative ("ab" + "c" = "a" + "bc") but not commutative ("ab" "ba").
  3. Forgetting that the identity depends on the operation. The same set has identity under addition but under multiplication. Always ask: "What element, when combined with any other via this operation, leaves the other unchanged?"
  4. Thinking every element must have an inverse within the same set. Under integer multiplication, has inverse , but . The inverse must live inside the set — external inverses do not count. This is the most common reason a candidate fails the group test.
  5. Assuming subtraction is just "addition of negative." While ,. subtraction itself is not associative: but . So fails associativity, making it not a group under subtraction.
Student Q&A — deduplicated from multiple class questions.

Q: Does division follow the closure property for integers? (Several students asked variations of this.)

A: No. When you divide two integers, the result may not be an integer. is outside the set, so closure fails. Even though some divisions like stay inside, the property must hold for all pairs. One counterexample disqualifies the operation.

Q: Does associativity imply commutativity? If , does not that mean order does not matter?

A: No. Associativity is about grouping — which pair you combine first when you have three or more elements. Commutativity is about swapping the two operands. A group can be associative without being commutative. Strings under concatenation are the classic example: ("a"+"b")+"c" = "a"+("b"+"c") = "abc" (associative), but "ab" "ba" (not commutative). Matrix multiplication is another: but generally .

Q: Can you mix operations in a group definition — like starting with addition and then switching to multiplication?

A: No. A group is defined with respect to exactly one operation. You stick to that single operation throughout. If you want to work with two operations simultaneously,. you need a richer structure like a ring,. a field,. or a vector space —. If you want to work with two operations simultaneously,. you need a richer structure like a ring,. a field,. or a vector space. — all of which build on top of the group concept.

Q: Does multiplication of two negative numbers violate closure for integers?

A: No. is still an integer. The sign change does not take you outside , so closure holds.

Q: Is the set of all matrices with integer entries a group under multiplication?

A: No. It passes closure (product of two integer matrices is an integer matrix), associativity, and identity ( has integer entries). But it fails inverse: not every matrix has an inverse, and when an inverse exists, its entries may be fractions, not integers. Also, matrix multiplication is not commutative, so even if it were a group, it would not be abelian.

Recap + Bridge. A group is the simplest algebraic structure with a guaranteed "undo" button. Closure keeps you inside the set. Associativity lets you group freely. Identity gives you a neutral baseline. Inverses let you reverse any move. If you have all four, you have a group. Next, we add one more rule — commutativity. That gives us abelian groups, a special kind of group where the order of moves does not matter.

3.1.7 Real-World & Domain Connection

Group theory is not just abstract formalism. In cryptography, the security of RSA encryption rests on the group of integers modulo under multiplication —. In cryptography, the security of RSA encryption rests on the group of integers modulo under multiplication. — finding inverses (decrypting) is easy if you know the group structure (the private key) and computationally infeasible if you do not. In physics, Noether's theorem links every symmetry of a system to a conservation law, and. In physics, Noether's theorem links every symmetry of a system to a conservation law. , and those symmetries form groups. — In physics, Noether's theorem links every symmetry of a system to a conservation law. , and those symmetries form groups. — the group of rotations gives conservation of angular momentum. In machine learning, when. you study matrix factorizations and principal component analysis later in this course,. you are implicitly relying on the group properties of invertible matrices under multiplication. The "undo" operation — the matrix inverse — is what makes solving possible when is invertible. Without the group properties holding for the space you are working in, every operation becomes a gamble.

3.2 Abelian Groups

Hook. You add 3 and 5. You add 5 and 3. Same answer: 8. You multiply 4 and 7. You multiply 7 and 4. Same answer: 28. But now try putting on your socks and then your shoes. Then try shoes first. Not the same result. Some operations care about order. Some do not. The ones that do not get a special name.
Intuition + Analogy. Think of commutativity as a two-way street. If you can drive from A to B and from B to A and always end up at the same destination, the road is commutative. Addition is a two-way street: and both land on 8. Matrix multiplication is a one-way street: the destination depends on which road you take first. An abelian group is just a group where every road is two-way — order never matters. Where the analogy breaks: On a real road, the distance is the same regardless of direction. In a group, commutativity means the result (not some measure of the result) is identical. For matrix multiplication, both the result matrix numbers and the geometric transformation are different depending on order.

3.2.1 Definition

An abelian group (also called a commutative group) is a group that satisfies one additional property beyond the four group axioms:

Property 5: Commutativity. For all ,

In plain language: the order of the two elements does not matter. Whether you compute or , you get the same result.

Symbol Registry (new symbols in this section):

SymbolMeaning
Abelian groupA group where for all
CommutativityThe property that order of operands does not affect the result

3.2.2 The Hierarchy

Think of these concepts as nested, like Russian dolls:

  • Every abelian group is a group (it satisfies all four group properties plus commutativity).
  • Not every group is an abelian group (it may lack commutativity).

The hierarchy goes: Group Abelian Group Vector Space — each layer adds more structure.

3.2.3 Examples

Example (abelian). — integers under addition. . Commutativity holds. Since we already verified all four group properties in Section 3.1, is an abelian group.

Example (abelian). — real numbers under addition. . Also an abelian group.

Example (not a group at all). — integers under multiplication. While multiplication is commutative (), recall from Section 3.1 that this fails the inverse property. So it is not even a group, let alone an abelian one. Commutativity cannot save a failed group.

Example (group but not abelian). The set of all invertible matrices under multiplication. Let and :

. So even though invertible matrices form a group (closure: product of invertible matrices is invertible;. So even though invertible matrices form a group (closure: product of invertible matrices is invertible. ; associativity: yes. ; So even though invertible matrices form a group (closure: product of invertible matrices is invertible. ; associativity: yes. ; identity: . ; So even though invertible matrices form a group (closure: product of invertible matrices is invertible. ; associativity: yes. ; identity: . ; inverse: every invertible matrix has one), they are. not an abelian group because commutativity fails.

3.2.4 Geometric Intuition: Why for Matrices

Think of matrices as transformations of a 2D plane. A matrix can stretch, shear, rotate, or distort the plane.

  • Applying matrix first (say,. a shear that tilts a square into a parallelogram) and then matrix (say,. a rotation) produces one final shape.
  • Applying first (rotation) and then (shear) produces a different final shape.

Rotation-then-shear is not the same as shear-then-rotation because the shear acts on a different orientation in each case. First you rotate a square 45 degrees, then shear it — versus first you shear a square, then rotate the resulting parallelogram. The final shapes point in different directions and have different proportions.

This is why matrix multiplication is not commutative — the order of transformations matters. The same principle underlies why putting on socks then shoes works but shoes then socks does not.

Scope: When commutativity matters and when it does not.

Commutativity is an extra property, not a required one. Many useful structures are groups without being abelian. The set of all invertible matrices under multiplication (called the general linear group GL) is one of the most important non-abelian groups in mathematics. It governs rotations, reflections, and all reversible linear transformations.

Assumption: Commutativity must hold for all pairs, just like the other group properties. Showing for one specific pair of matrices does not make the group abelian —. Showing for one specific pair of matrices does not make the group abelian. — you must show it for every possible pair. For matrix multiplication, finding even one counterexample is enough to prove it is not abelian.

What breaks if commutativity fails: In an abelian group, you can reorder long sequences of operations freely, which simplifies proofs and algorithms. In a non-abelian group, order is part of the logic — changing the order changes the outcome. This is why parallelizing non-abelian operations is harder: you cannot naively reorder steps.

3.2.5 Visual Intuition

Draw a 2D plane with a unit square at the center. Label the square's corners. Now apply transformation A (a horizontal shear): the square leans right, becoming a parallelogram. Then apply transformation B (a 90-degree rotation): the parallelogram rotates, pointing upward. The result is a tall, tilted parallelogram.

Now start over — same square. Apply B first: the square rotates 90 degrees, becoming a diamond. Then apply A: the shear tilts the diamond further. The result is a wide, tilted parallelogram — different from the first result.

Both axes show the plane coordinates . The key landmark is the original square's top-right corner: under A-then-B it lands at one position;. The key landmark is the original square's top-right corner: under A-then-B it lands at one position. ; under B-then-A it lands at a different position. The takeaway: the order of transformations changes the destination — geometrically proving that .

Pitfalls — common traps with abelian groups.
  1. Assuming all groups are abelian. Many students, fresh from arithmetic, assume every operation commutes. Matrix multiplication is the wake-up call. Remember: associativity is mandatory for a group; commutativity is optional.
  2. Confusing commutativity of the operation with commutativity of the proof. Just because you can write does not mean the group is abelian — you must verify it for all elements. Showing one pair commutes is not a proof.
  3. Thinking commutativity fixes other failures. has commutative multiplication, but it still fails the inverse property. Commutativity is an extra condition on top of the four group axioms — it cannot substitute for any of them.
  4. Forgetting that abelian groups are named after Niels Henrik Abel. It is "abelian" (lowercase 'a' by convention in modern usage), not "Abelian" from some abstract concept. Abel was a Norwegian mathematician who proved the impossibility of solving quintic equations by radicals.
Recap + Bridge. An abelian group is a group where order does not matter — you can swap the operands freely. The integers under addition are abelian. Invertible matrices under multiplication form a group but not an abelian one, because . The commutativity property is what separates abelian groups from general groups, and it is the bridge to our next structure: vector spaces, which start from an abelian group of vectors and add a second operation — scalar multiplication.

3.2.6 Real-World & Domain Connection

Abelian groups underpin much of modern cryptography and coding theory. Elliptic curve cryptography, used in Bitcoin and secure messaging, operates on an abelian group of points on a curve —. Elliptic curve cryptography, used in Bitcoin and secure messaging, operates on an abelian group of points on a curve. — commutativity ensures that shared secrets computed by two parties match. In physics, the abelian gauge theory (U(1)) describes electromagnetism — In physics, the abelian gauge theory (U(1)) describes electromagnetism. — the photon does not interact with itself because the underlying group is abelian. Meanwhile, the strong nuclear force uses a non-abelian group (SU(3)), where gluons do interact with each other. — Meanwhile, the strong nuclear force uses a non-abelian group (SU(3)). , where gluons do interact with each other. — the non-commutativity creates the complex behavior that binds quarks together. In machine learning, most feature-space operations (addition, weighted averaging) happen in abelian groups ( under addition), which. In machine learning, most feature-space operations (addition, weighted averaging) happen in abelian groups ( under addition). , which is why we can reorder and parallelize training computations safely. The non-abelian case appears in geometric deep learning, where transformations like 3D rotations (SO(3)) are not commutative and require special handling.

Student Q&A.

Q: Can you give an example of a group that is associative but not commutative?

A: Yes. The set of all strings (sequences of characters) under concatenation forms a structure where concatenation is associative: ("ab" + "c") + "d" = "ab" + ("c" + "d") = "abcd". But it is not commutative: "ab" + "cd" = "abcd", while "cd" + "ab" = "cdab" — different results. Another example: the set of all invertible matrices under multiplication —. Another example: the set of all invertible matrices under multiplication. — holds (associative), but Another example: the set of all invertible matrices under multiplication. — holds (associative), but in general (not commutative). These are groups (with the empty string or identity matrix as the identity element) but they are not abelian groups.

3.3 Vector Spaces

Hook. A group gives you one operation and one set. But the world of data needs more. You do not just add two houses — you want to say "this house is twice as big and half as old" and combine that with another scaled version. One operation is not enough. You need two operations working together across two sets. That is a vector space.
Intuition + Analogy. Imagine an infinite, flat drawing board that stretches forever in every direction. You have an origin point marked at the center. Two basic actions: (1) you can chain one arrow to the tip of another — that is vector addition, giving you a new arrow from the origin. (2) You can stretch or shrink any arrow by any real number — that is scalar multiplication. If every combination of chaining and stretching keeps you on the board, you are in a vector space. The board is . If you restrict yourself to only the top-right quarter of the board (the first quadrant), scaling by a negative number flips your arrow into the bottom-left — you fall off the restricted board. That restricted quarter is not a vector space. Where the analogy breaks: The drawing board has edges in reality — paper has margins. A true vector space has no boundaries. It extends infinitely. This is why bounded regions fail the vector space test.

3.3.1 What Is a Vector Space

A vector space is more complex than a group. It involves:

  • Two sets (not one):
    1. A set of vectors — the arrows or points in the space
    2. A set of scalars — typically the real numbers , which can also form a field (a set with its own addition and multiplication, supporting inverses for both)
  • Two operations (not one):
    1. Vector addition — adding two vectors together
    2. Scalar multiplication — multiplying a vector by a scalar

The vectors themselves form an abelian group under vector addition. The scalar multiplication then layers on top, connecting the two sets. Formally,. a vector space over a field (usually ) is an abelian group together with a scalar multiplication satisfying distributivity and compatibility rules.

These two operations — vector addition and scalar multiplication — are the foundation of all of linear algebra. Roughly 90% of everything you will do with vectors in this course is built on these two basic operations.

Notation. Vectors are typically written in bold: , or with an arrow: . Scalars are written as plain letters: .

Symbol Registry (new symbols in this section):

SymbolNameMeaningTypeDomain
2D real spaceThe 2-dimensional planeVector spaceAll pairs
3D real spaceThe 3-dimensional spaceVector spaceAll triples
n-D real spaceThe n-dimensional real spaceVector spaceAll n-tuples of reals
VectorAn element of a vector spaceVector
Zero vectorThe origin; additive identityVector
ScalarA real number used to scale vectorsScalar
Vector spaceThe set of all vectors under considerationSet

3.3.2 Vector Space

denotes the 2-dimensional plane. Think of it as an infinite flat sheet. Any point in this plane is a position vector — it tells you the position of that point relative to the origin.

A point in is specified by two coordinates . So a vector in is a combination of two numbers. This is why you need both and to locate a point —. This is why you need both and to locate a point. — one number alone is not enough in two dimensions.

3.3.3 Vector Space

is the 3-dimensional space we live in. Any point requires three coordinates . A position vector in looks like .

3.3.4 Vector Space

is the -dimensional space. A vector in has components:

You cannot visualize for on a 2D sheet of paper. But you can do the exact same mathematics with -dimensional vectors as you do with 2D or 3D vectors. This is the power of linear algebra — it lets you work with -dimensional spaces even though you cannot picture them.

Real-world motivation. A house can be described by many features. Size (1000 sq ft), age (10 years), number of bedrooms (3), number of bathrooms (1). This is a 4-dimensional vector: . You could add more features — location score, garage size, floor number — and get a 5-dimensional, 6-dimensional, or -dimensional vector. Linear algebra gives you the tools to do math with these high-dimensional feature vectors, which is exactly what happens in machine learning.

3.3.5 Properties a Vector Space Must Satisfy

A vector space must satisfy all the properties of an abelian group under vector addition. But now with respect to two operations across two sets. The critical properties are:

  1. Closure under vector addition. If , then . Adding two vectors never takes you outside the space.
  2. Closure under scalar multiplication. If and is a scalar, then . Scaling a vector never takes you outside the space.
  3. Presence of the zero vector (origin). There must be a zero vector such that for all .

In practice, for. proving or disproving whether a space is a vector space,. two properties most often fail: closure (under addition or scalar multiplication) and the presence of the zero vector. The other group properties (associativity, commutativity of addition, inverse) tend to hold automatically in most reasonable settings —. The other group properties (associativity, commutativity of addition, inverse) tend to hold automatically in most reasonable settings. — they are inherited from when your set is a subset of .

3.3.6 Why Is a Vector Space

Take any two vectors in the 2D plane. Their sum is another vector in the same plane — closure under addition holds. Scale any vector by any real number — it stays in the plane — closure under scalar multiplication holds. The origin is present. The vectors under addition form an abelian group (associativity, commutativity, identity, inverses all hold). So is a vector space.

Similarly, and are vector spaces.

3.3.7 Worked Examples: Vector Space or Not?

Example 1: The First Quadrant — NOT a vector space.

Consider only the first quadrant of — the set of all vectors with both coordinates positive. Is this a vector space?

Take a vector in the first quadrant. Multiply it by the scalar :

The result is in the third quadrant — outside the first quadrant. Closure under scalar multiplication fails. Therefore, the first quadrant is not a vector space.

The same reasoning disqualifies any single quadrant: multiplying a positive-coordinate vector by a negative scalar flips it to the opposite quadrant.

Example 2: The Line — IS a vector space.

Consider the line passing through the origin in . Any point on this line has the form for some real number .

  • Closure under addition. Take and . Their sum is , which lies on . In general, , which is also on the line. ✓
  • Closure under scalar multiplication. Scale by : , on the line. Scale by : , still on the line. ✓
  • Zero vector present. is on the line. ✓

Therefore, the line is a vector space (and a subspace of ). This exact example appeared in a previous semester's examination.

Example 3: The Line — NOT a vector space.

Consider the line . This line is shifted up by one unit — it does not pass through the origin.

  • Zero vector? The point does not satisfy , so it is not on the line. The zero vector is absent. ✗

Already, this fails the requirement that a vector space must contain the zero vector. So is not a vector space.

Example 4: A Bounded Region — NOT a vector space.

Consider the set of all vectors where and —. Consider the set of all vectors where and . — a confined square region in . This example appeared in a previous year's examination.

Take the vector , which is inside the region. Scale it by :

The result is outside the bounded region. Closure under scalar multiplication fails. Therefore, this bounded region is not a vector space.

3.3.8 The Role of the Origin

The origin (zero vector) serves a critical role beyond just being the identity element for addition:

  • Reference point. Every position vector is measured from the origin. A vector means "2 units in the x-direction and 3 units in the y-direction from the origin ."
  • Inversion. To invert a vector (get its negative), you "flip" it through the origin. The vector scaled by becomes . Adding them gives — you return to the origin.
  • Observing transformations. When a linear transformation (via a matrix) deforms the space, you need a fixed reference point. That point lets you measure how much each point has moved. The origin is that fixed point. If the origin itself moved, you would lose the ability to quantify the transformation and to invert it.

Think of the origin as the anchor — everything is defined relative to it.

Scope: When a candidate is a vector space and when it is not.

A subset of is a vector space (specifically, a subspace ) if and only if it passes three tests: contains , closed under addition, closed under scalar multiplication. These three are sufficient — the other seven or so vector space axioms are automatically inherited from the parent space .

Key assumption: The scalars come from a field (like or ). If you use scalars from a set that is not a field (e.g., integers only), the structure is a module , not a vector space, and many familiar properties (like every vector space having a basis) may fail.

What breaks if a property fails:

  • If the origin is missing, there is no additive identity — you cannot define "zero" in your space.
  • If scalar multiplication closure fails, scaling a valid vector can eject you from the space — the space is not "scale-invariant."
  • If addition closure fails, combining two valid vectors can eject you — the space is not "addition-invariant."

3.3.9 Visual Intuition

Picture the 2D plane with the origin at . Draw the first quadrant as the top-right wedge — all points with . Now take the point in that wedge. Draw an arrow from the origin to that point — that is your vector. Now multiply by : the arrow flips 180 degrees through the origin and lands at in the bottom-left wedge. The arrow has left the first quadrant. The quadrant cannot contain all scalar multiples — it is not scale-invariant.

Now draw the line as a 45-degree diagonal through the origin. Take the point on it. Multiply by : you get , still on the line. Multiply by : you get , still on the line. Add and : you get , on the line. The line is closed under both operations and contains the origin — it is a vector space.

The takeaway: a vector space must be "radially complete" — The takeaway: a vector space must be "radially complete". — from the origin, you can go any distance in any direction the space allows, and. The takeaway: a vector space must be "radially complete". — from the origin, you can go any distance in any direction the space allows, and you stay inside. Bounded regions fail because they cap your travel distance. Shifted lines fail because they cap your reference point.

Pitfalls — common traps with vector spaces.
  1. Assuming any subset of is a vector space. Most subsets are not. The zero vector must be present, and both operations must stay inside. The first quadrant, a shifted line, and a bounded box are all subsets of — none are vector spaces.
  2. Checking only addition. Scalar multiplication by a negative number is the silent killer. Many students check addition (it "looks" closed) but forget to test what happens when you multiply by or a large number.
  3. Assuming "contains the origin" is enough. The line shifted to pass through the origin becomes , which The line shifted to pass through the origin becomes , which is a vector space. But the bounded region contains the origin and still fails — scaling kicks you out. The origin is necessary but not sufficient.
  4. Confusing vector-by-vector multiplication with scalar multiplication. In a vector space, you multiply a scalar by a vector, not a vector by a vector. The dot product and cross product are separate operations defined later — they are not part of the vector space axioms.
Student Q&A — deduplicated from multiple class questions.

Q: Is the first quadrant a vector space? (Several students asked this.)

A: No. While it might seem plausible at first — While it might seem plausible at first. — the quadrant contains positive vectors and seems "closed" under addition of positives. — While it might seem plausible at first. — the quadrant contains positive vectors and seems "closed" under addition of positives. — multiplying by a negative scalar sends it to the third quadrant. Closure under scalar multiplication fails.

Q: What are the boundaries of a vector space? At what point does a vector leave the space?

A: itself has no boundaries — it extends infinitely in all directions. Any operation on vectors in stays inside . A vector "leaves" when you restrict to a subset — A vector "leaves" when you restrict to a subset. — like a quadrant, a bounded box, or a line not through the origin. An operation then produces a result outside that subset. A vector space is "boundary-less" by nature — if there were boundaries, scaling would eventually cross them.

Q: When proving something is a vector space, do we always need to check all properties?

A: For subsets of , three properties usually suffice: contains , closed under addition, closed under scalar multiplication. The other axioms (associativity, commutativity, etc.) are inherited from . The two that most commonly fail are closure (addition or scalar multiplication) and the presence of .

Q: If we move the origin to some other point, can that still be a valid vector space?

A: If the new "origin" point satisfies both the identity property and the inverse property for the space,. then in principle the vector space axioms are about abstract structure,. not a specific coordinate. But conventionally, we always work with the origin at . In practice, when. working with subsets of , a space that does not contain the standard zero vector fails to be a vector space. — In practice. , when. working with subsets of , a space that does not contain the standard zero vector fails to be a vector space. — it is an. affine space , not a vector space.

Q: In scalar multiplication for vector spaces, do we multiply vector by vector or vector by scalar?

A: Vector by scalar. The two operations are strictly: (1) add vector to vector, (2) multiply scalar by vector. We do not multiply vector by vector in the definition of a vector space. The dot product and cross product are separate operations defined later.

Q: Why do we focus only on addition and multiplication in vector spaces, not division or subtraction?

A: Vector addition and scalar multiplication are the two operations that define linear combinations. All of linear algebra is built on these two. Division by a vector is not defined in general. Subtraction is just addition of a negatively scaled vector: , so it is already covered.

Recap + Bridge. A vector space is an abelian group of vectors with scalar multiplication layered on top. The three quick tests — contains origin, closed under addition, closed under scalar multiplication — determine membership. Lines through the origin pass. Shifted lines, quadrants, and bounded regions fail. Next, we explore the fundamental operation that makes vector spaces useful: the linear combination — scaling vectors and adding them to reach new points.

3.3.10 Real-World & Domain Connection

Vector spaces are the mathematical bedrock of machine learning. Every dataset of features lives in . When you train a linear regression model, you are finding a vector of weights that operates on feature vectors. When you apply Principal Component Analysis (PCA), you are finding a new basis —. When you apply Principal Component Analysis (PCA), you are finding a new basis. — a rotated coordinate system. — When you apply Principal Component Analysis (PCA), you are finding a new basis. — a rotated coordinate system. — within the same vector space that captures maximum variance. When a neural network layer applies a weight matrix to an input vector ,. the output is a linear combination of the columns of —. When a neural network layer applies a weight matrix to an input vector ,. the output is a linear combination of the columns of . — staying squarely inside . The closure property guarantees that these operations never produce undefined results. In computer graphics,. 3D rendering engines operate in and (homogeneous coordinates),. using vector addition for translation and scalar multiplication for scaling objects. In economics, portfolio theory treats asset allocations as vectors in , and. In economics, portfolio theory treats asset allocations as vectors in . , and the vector space structure ensures that combining portfolios yields another valid portfolio.

3.4 Linear Combinations

Hook. You have two vectors. You can stretch them, shrink them, flip them, and then add the results together. What points can you reach? The answer to this question unlocks everything from span to basis to solving .
Intuition + Analogy. Think of vectors as ingredients in a kitchen. Scalar multiplication is adjusting the quantity — double the flour (), halve the sugar (). Vector addition is mixing them together in a bowl. A linear combination is the full recipe: take scoops of ingredient , scoops of , and so on, mix them all together, and out comes a new dish — a new vector. By varying the amounts (scalars), you can cook up a whole menu of possible vectors. Where the analogy breaks: In cooking, you cannot have negative amounts of flour. In linear algebra, negative scalars flip the direction of a vector — they are just as valid as positive ones. This is why the first quadrant is not a vector space: it bans negative scalars, but vector spaces need them.

3.4.1 Definition

A linear combination is the result of scaling vectors and then adding them together.

Given vectors and scalars , the linear combination is:

In words: multiply each vector by its own scalar. Then add all the results together. These are the same two fundamental operations — vector addition and scalar multiplication — that define vector spaces.

Symbol Registry (new symbols in this section):

SymbolMeaning
The vectors being combined
Scalars (real numbers) multiplying each vector
A linear combination

3.4.2 Geometric Interpretation

A linear combination is the set of all points you can reach by scaling given vectors and adding the results.

Imagine you have two vectors in : and . You can change their lengths by multiplying with scalars — stretching or shrinking, and flipping direction if the scalar is negative. Then you add the scaled versions tip-to-tail. The resulting vector points to a new location in the plane.

By varying the scalars and over all real numbers, you can reach many different points in . The collection of all points reachable this way is the span of (discussed in Section 3.6).

3.4.3 Worked Example: House Vectors

Consider two house vectors, each describing a property by (size in sq ft, age in years):

  • — a house of 1000 sq ft, 10 years old.
  • — a house of 2000 sq ft, 5 years old.

Scale by :

Scale by :

Now add the scaled vectors:

The linear combination produces the vector . This is a new point in the space reached by scaling and adding the original two vectors.

Sense check: The result has negative size ( sq ft), which is physically meaningless for a real house. But mathematically, it is a perfectly valid vector in . This illustrates that vector spaces contain points that may not correspond to physically realizable objects — the math works regardless. In practice, you would constrain scalars to keep features physically meaningful.

3.4.4 Linear Combination Is the Fundamental Building Block

Almost everything that follows in linear algebra is built on the idea of linear combinations. Span, basis, linear independence, dimension, matrix multiplication, solving — all of it. When you multiply a matrix by a vector ,. the product is exactly a linear combination of the columns of ,. weighted by the entries of :.

If you deeply understand linear combinations as "scale some vectors and add them up," you have the key. It unlocks the rest of the course.

Scope: When linear combinations apply and when they do not.

Linear combinations are defined inside any vector space. The scalars must come from the same field as the vector space (usually ). If the scalars come from a different set, the result may not stay in the space.

Assumption: The vectors being combined must all belong to the same vector space. You cannot linearly combine a vector from with one from — their dimensions do not match.

What breaks if the space is not a vector space: If you are working in a non-vector-space (like the first quadrant), a linear combination can produce a vector outside the set. The whole machinery — span, independence, basis — relies on the guarantee that linear combinations stay inside the space.

3.4.5 Visual Intuition

Draw the 2D plane with origin at . Draw vector as an arrow pointing right-and-up. Draw vector as an arrow pointing left-and-up. Now vary and . When , place 's tail at 's tip —. When , place 's tail at 's tip. — the resulting arrow from the origin to the final tip is the sum . When , flip halfway backward and double — the sum points somewhere else entirely. By sampling many pairs, the tips of the resulting arrows fill the entire plane. The takeaway: two independent vectors in can reach every point through linear combinations.

Pitfalls — common traps with linear combinations.
  1. Forgetting that scalars can be negative. A common instinct is to think of scalars as positive multipliers only. Negative scalars flip the vector's direction, which is essential for reaching all points. Without negative scalars, two vectors in can only reach a wedge, not the whole plane.
  2. Confusing linear combination with just addition. A linear combination is scaling and then adding. Skipping the scaling step just gives vector addition, which is a special case (all ).
  3. Assuming the order of scaled vectors matters in the sum. Vector addition is commutative — the order you add them does not change the result. Only the scalar-vector pairings matter.
Recap + Bridge. A linear combination is scaling vectors by scalars and adding them together. It is the single most important operation in linear algebra — every matrix-vector product, every solution to , and every basis representation is a linear combination. Next, we ask: given a set of vectors, are any of them redundant — can one be expressed as a linear combination of the others? That question leads us to linear independence.

3.4.6 Real-World & Domain Connection

Linear combinations are the engine behind dimensionality reduction techniques like PCA, where. each principal component is a linear combination of the original features. In recommender systems (Netflix, Spotify), a user's predicted rating for an item is a linear combination of latent feature vectors —. In recommender systems (Netflix, Spotify), a user's predicted rating for an item is a linear combination of latent feature vectors. — the scalars are the user's preferences, the vectors are item embeddings. In finance, a portfolio's return is a linear combination of individual asset returns weighted by allocation percentages. In signal processing, any sound wave can be expressed as a linear combination of sine and cosine waves of different frequencies —. In signal processing, any sound wave can be expressed as a linear combination of sine and cosine waves of different frequencies. — the Fourier transform finds those scalars.

3.5 Linear Independence and Dependence

Hook. You have three vectors in . Can all three be essential, or is one of them just dead weight? If you can build one vector from the other two, why keep it around? Linear independence answers: which vectors in your set actually add new directions, and which are just rehashing what you already have?
Intuition + Analogy. Imagine you are describing locations in a city. You have three navigation instructions: "go North," "go East," and "go Northeast." The third instruction is redundant — you can get Northeast by combining equal parts North and East. The set {North, East, Northeast} is linearly dependent — Northeast does not add a new direction you could not already reach. The set {North, East} is linearly independent — neither can be built from the other, and together they can reach anywhere on the map. In machine learning terms, linear dependence is feature redundancy. If one feature (column in your data matrix) is just a linear combination of other features, it adds no new information — and may destabilize your model. Where the analogy breaks: Directions are unit-length by nature. In vector spaces, vectors can be any length. Linear independence cares only about direction uniqueness, not magnitude.

3.5.1 Formal Definition

A set of vectors is linearly independent if the only way to make the linear combination equal the zero vector is to set all scalars to zero:

implies

This is called the trivial solution . If any non-trivial combination (where at least one ) also produces , the vectors are linearly dependent .

Symbol Registry (new symbols in this section):

SymbolMeaning
The zero vector (origin)
Linear independenceOnly the trivial combination (all ) gives
Linear dependenceSome non-trivial combination (not all ) gives

3.5.2 What Linear Dependence Really Means

If the vectors are linearly dependent, at least one vector in the set is redundant —. If the vectors are linearly dependent, at least one vector in the set is redundant. — it can be written as a linear combination of the others.

Suppose with . Then you can solve for :

So is just a scaled version of . The two vectors lie on the same line through the origin — one is a stretched or flipped copy of the other.

With three vectors,. linear dependence means one vector can be expressed as a linear combination of the other two: . All three vectors lie in the same plane (or even the same line).

3.5.3 Geometric Interpretation

Linearly dependent vectors in : Take and . Notice that . Both vectors lie on the exact same line through the origin. No matter how you scale and add them, you can never leave that line. You are trapped on a 1-dimensional subspace of .

Linearly independent vectors in : Take and . These vectors point in different directions — they do not lie on the same line. You cannot express one as a scalar multiple of the other. By scaling and adding them, you can reach any point in the entire 2D plane.

3.5.4 The Geometric Test

A quick geometric test for linear independence in and :

  • Two vectors in are linearly independent if they do not lie on the same line through the origin. If they do, one is a scalar multiple of the other — dependent.
  • Three vectors in are linearly independent if they do not all lie in the same plane through the origin. If they do, at least one is a linear combination of the others — dependent.
  • In general , a set of vectors is linearly dependent if at least one vector falls within the span of the others — , a set of vectors is linearly dependent if at least one vector falls within the span of the others —. it lies on the line, plane, or hyperplane generated by the rest.

3.5.5 Worked Examples: Independence Check

Example 1: Dependent pair. , .

Check: can we find not both zero such that ?

Try : . Non-trivial solution found. Verdict: Dependent. Indeed, .

Example 2: Independent pair. , .

Set . This gives:

From the first equation, . Substitute: , so and then . Only the trivial solution. Verdict: Independent.

Sense check: The vectors and point in different directions — neither is a scalar multiple of the other. In , two independent vectors span the whole plane.

Scope: When independence matters and what it guarantees.

Linear independence is a property of a set of vectors, not of individual vectors. It depends on the relationships among all vectors in the set.

Assumption: The definition relies on the concept of the zero vector . In any vector space, exists by axiom. The independence test is always well-defined.

Key numerical fact: In , you can have at most linearly independent vectors. Any set with more than vectors in is automatically dependent — this is a dimension argument (see Section 3.6).

What breaks if independence is assumed but not true: If you treat dependent vectors as independent, your basis has redundancy. Solving may give infinitely many solutions when you expected a unique one. In machine learning, dependent features make the normal equations singular — linear regression fails without regularization.

3.5.6 Visual Intuition

Draw the 2D plane with origin at . Plot and — both arrows lie on the same diagonal line from the origin. Draw 's tip at and 's tip at — they are collinear. Now plot and a new —. Now plot and a new . — the arrows fork away from each other, creating a V-shape from the origin. The collinear pair can only reach points on their shared line (a 1D subspace). The forked pair can reach every point in the plane through linear combinations. The takeaway: independent vectors "fan out" into new dimensions; dependent ones "stack" on the same line or plane.

Pitfalls — common traps with linear independence.
  1. Confusing (zero vector) with (zero scalar). The equation sets a linear combination equal to the zero vector (the origin), not the number zero. In , .
  2. Thinking the trivial solution "does not count." Setting all always gives . Linear independence asks: is that the only way? If yes, independent. If there is another way (some ), dependent.
  3. Assuming independence means "none is a scalar multiple of another." This works for two vectors but fails for three or more. Three vectors in can be dependent even if no two are scalar multiples —. Three vectors in can be dependent even if no two are scalar multiples. — one might be the sum of the other two (a plane relationship).
  4. Checking only pairwise relationships. For , you must check whether any vector is a linear combination of the rest , which may involve multiple vectors. Gaussian elimination (stacking vectors as columns and row-reducing) is the systematic method.
  5. Forgetting that any set containing the zero vector is automatically dependent. If is in your set, set and all other — If is in your set, set and all other —. you get in a non-trivial way.
Student Q&A — deduplicated from multiple class questions.

Q: Does the equation mean the zero scalar or the zero vector? (Several students asked.)

A: The zero vector — the origin with all components zero. In , that is . The left-hand side is a linear combination that geometrically "lands" at the origin. For independence, the only way to land at the origin is to set every scalar to zero.

Q: If vectors are linearly independent, can you ever reach the origin through a linear combination?

A: You can always reach the origin by setting all scalars to zero: . That is the trivial combination. The question is whether there is another way — a non-trivial combination — that also reaches the origin. Independence means the trivial combination is the only way.

Q: If you add two independent vectors and get a third vector, and If you add two independent vectors and get a third vector, and that third vector is part of your set — If you add two independent vectors and get a third vector, and that third vector is part of your set. — are the three vectors dependent?

A: Yes. If ,. then is a linear combination of and (with ). The three together are linearly dependent, even though and individually might be independent. The dependence comes from having more vectors than the dimension they span.

Q: Does the zero vector have a direction?

A: The zero vector does not have a well-defined direction. It is a point — the origin. Every other vector is measured from it, but the zero vector itself points nowhere. This is why any set containing is automatically dependent — the zero vector contributes nothing to the span.

Q: Is the relationship between linear independence and solving linear equations direct?

A: Yes. For a system ,. the columns of are linearly independent if and only if the only solution is . This is the exact definition of linear independence applied to the columns of . If has a non-zero solution, the columns are dependent.

Q: For linearly dependent vectors, do we always get infinite solutions to ?

A: Not always. When the columns of are dependent,. either has no solution (if is not in the column space) or infinitely many solutions (if is in the column space). Which case you get depends on whether can be expressed as a linear combination of the columns.

Recap + Bridge. Linear independence means no vector in your set is redundant — you cannot build one from the others. Dependent vectors waste dimensions; independent vectors earn their keep. This concept sets up span: the set of all points you can reach from a given set of vectors. Independence tells you which vectors are essential; span tells you what they can generate together.

3.5.7 Real-World & Domain Connection

Linear independence is at the heart of feature selection in machine learning. When building a regression model, you check whether your feature matrix has full column rank —. When building a regression model, you check whether your feature matrix has full column rank. — meaning all feature columns are linearly independent. Dependent features cause multicollinearity, inflating variance and making coefficient estimates unstable. In compressed sensing,. the key insight is that a sparse signal can be recovered from far fewer measurements than the Nyquist rate,. provided the measurement matrix's columns are sufficiently "incoherent" (nearly independent). In network analysis, finding a maximal set of linearly independent paths in a graph reveals the network's throughput capacity. The concept also underpins the invertibility of matrices: an matrix is invertible if and only if its columns (and rows) are linearly independent.

3.6 Span

Hook. You have a set of vectors. You can scale them however you like and add the results. What is the complete set of all points you can ever reach? That set — the "reachable zone" of your vectors — is their span. It tells you the full extent of what those vectors can generate.
Intuition + Analogy. Think of your vectors as available modes of transportation. is a train going North. is a bus going East. By taking the train for some distance (scalar ) and then the bus for some distance (scalar ), you can reach any point in the city — your span is the entire 2D map. But if the bus only goes Northeast — the same direction as a combination of North and East — then no matter how you mix them, you are stuck on the Northeast-Southwest corridor. Your span is just a 1D line. Where the analogy breaks: In the real world, trains and buses have fixed routes and finite range. In a vector space, scalars can be any real number — including negative (going "backward" on the route) and arbitrarily large (unlimited range). The span extends infinitely.

3.6.1 Definition

The span of a set of vectors is the set of all possible linear combinations of those vectors:

In words: take every possible choice of scalars (all real numbers), form every possible linear combination, and collect all the resulting vectors. That collection is the span. It is always a subspace of the parent vector space.

Symbol Registry (new symbols in this section):

SymbolMeaning
The set of all linear combinations of the given vectors

3.6.2 Geometric Interpretation

Span of one non-zero vector in . The span of a single vector is the line through the origin in the direction of . Every linear combination is just — Every linear combination is just . — a scalar multiple. — Every linear combination is just . — a scalar multiple. — so you trace out the entire line through the origin in that direction. A 1-dimensional span.

Span of two linearly independent vectors in . With and , their span is the entire plane . You can reach any point by setting . A 2-dimensional span.

Span of two linearly dependent vectors in . If and (where ), both lie on the same line. Their span is just that line — a 1-dimensional subspace. You cannot leave the line no matter how you scale and add.

Span of three vectors in .

  • All three independent (not coplanar) → span is (3D).
  • All three in the same plane → span is that plane (2D).
  • All three on the same line → span is that line (1D).

3.6.3 Worked Example: Finding the Span

Consider and in .

Form a general linear combination:

The -coordinate is always 0, regardless of and . So the span is the -plane — all vectors of the form . This is a 2-dimensional subspace of .

Sense check: The -plane is flat, infinite, and passes through the origin. It contains and and every linear combination of them. The third dimension () is unreachable because no vector in the set has a -component.

3.6.4 Span, Independence, and Dimension

These three concepts are intimately connected:

  • The span tells you what subspace is generated — the "territory" covered by your vectors.
  • Linear independence tells you whether any vector in the set is redundant — already inside the span of the others.
  • The dimension of the span is the number of linearly independent vectors in the set. If you have vectors but only are independent, the span has dimension .

A basis is a set of vectors that are both linearly independent and span the entire space. The number of vectors in a basis is the dimension of the space. In , the standard basis is where has 1 in the -th position and 0 elsewhere.

3.6.5 Connection to Solving Linear Systems

If you have a system of linear equations :

  • The product is a linear combination of the columns of .
  • A solution exists if and only if is in the span of the columns of (the column space of ).
  • If is not in the column space, the system has no solution — is unreachable.
  • If the columns are linearly independent, every in the column space has a unique .

This connection — span = solvability condition — is one of the central ideas of linear algebra.

Scope: What span can and cannot tell you.

Span tells you the reachable subspace — the territory your vectors can cover. It does not tell you whether the representation is unique (that is independence) or efficient (that is basis and dimension).

Assumption: Span is defined over the entire field of scalars (all real numbers). If you restrict scalars (e.g., only positive, only integers), you get a cone or a lattice , not a span in the vector-space sense.

What breaks if vectors are dependent: The span's dimension is less than the number of vectors — you have redundant generators. The span itself is still a valid subspace, but you are using more vectors than necessary to describe it. In computational settings, dependent vectors cause rank deficiency and prevent matrix inversion.

3.6.6 Visual Intuition

Picture as a room. The origin is a point on the floor. A single vector pointing diagonally up defines a line through the origin — its span. Add a second vector pointing forward — Add a second vector pointing forward. — if it is not collinear with ,. the two together define a plane through the origin (the floor,. a wall,. or a tilted surface). Add a third vector pointing to the side — Add a third vector pointing to the side. — if it is not in the plane of the first two, the three together span the entire room. The key landmarks: each new independent vector adds a dimension to the span. A dependent vector (already in the current span) adds nothing — it lies flat in the existing subspace. The takeaway: the dimension of the span equals the number of independent vectors you have; every dependent vector is a wasted opportunity.

Pitfalls — common traps with span.
  1. Confusing the number of vectors with the dimension of their span. Three vectors can span a 1D subspace if they are all collinear. The dimension of the span is the number of independent vectors, not the total count.
  2. Thinking the span of the empty set is undefined. By convention, — the trivial subspace containing only the zero vector, with dimension 0.
  3. Assuming the span must "look like" the vectors. The span of and is the line — a 1D subspace. Both vectors lie on it, but the span does not "inherit" their lengths or directions individually; it is the entire line.
  4. Expecting every vector in to be in the span. If you have fewer than independent vectors, their span is a lower-dimensional subspace — If you have fewer than independent vectors, their span is a lower-dimensional subspace —. most vectors in are not in it. For example, the span of one vector in is a line — almost all points in lie off that line.
Recap + Bridge. The span is your reachable universe from a given set of vectors — every point you can get to by scaling and adding. Independence determines whether your generators are efficient; span determines what they can generate. Together, they set up the concept of a basis: a minimal set of independent vectors that spans the entire space. A basis is the "just right" set — no redundancies, no gaps. This ties everything together: Groups → Vector Spaces → Linear Combinations → Independence → Span → Basis.

3.6.7 Real-World & Domain Connection

Span directly translates to the concept of representational capacity in machine learning. The column space of a data matrix is the span of its feature vectors —. The column space of a data matrix is the span of its feature vectors. — it is the set of all predictions a linear model. can make. If the target vector lies in this span, the model can fit the training data perfectly (zero training error). If not, you have irreducible error. In deep learning, the activations of a hidden layer span a subspace, and. In deep learning, the activations of a hidden layer span a subspace. , and the layer's width determines the maximum dimension of that subspace. In computer graphics, the span of two texture basis vectors defines all possible surface colors achievable by blending them. In robotics, the span of a robot arm's joint-angle vectors defines its reachable workspace —. In robotics, the span of a robot arm's joint-angle vectors defines its reachable workspace. — the set of all positions the end-effector can attain.

3.7 The Big Picture: Math as Assumptions

3.7.1 Why These Abstract Structures Matter

Groups, vector spaces, and the properties they enforce are not arbitrary mathematical formalism. They are a system of assumptions — a contract. When you do mathematics on vectors, you want guarantees. Scaling them, adding them, combining them — you need to know what can and cannot happen.

The closure property guarantees that your operations never produce something outside the space you are working in. You never have to worry about a vector addition spilling into an undefined territory. The identity and inverse properties guarantee you can "undo" operations — every transformation has a reverse gear. Associativity and commutativity guarantee that the order and grouping of operations do not introduce hidden complexity —. Associativity and commutativity guarantee that the order and grouping of operations do not introduce hidden complexity. — you can reorganize calculations without changing the result.

When these properties hold, you can reason about systems with confidence. When they fail, you know exactly where the math breaks and why. This is the engineer's mindset: know your assumptions, verify them, and understand what happens at the boundaries.

3.7.2 The Hierarchy Revisited

Group
 └─ Abelian Group (Group + Commutativity)
     └─ Vector Space (Abelian Group on vectors + scalar multiplication field)

Every vector space is an abelian group under vector addition. Every abelian group is a group. But the reverse implications do not hold:

  • A group lacks commutativity (e.g., invertible matrices under multiplication).
  • An abelian group lacks scalar multiplication (e.g., integers under addition — An abelian group lacks scalar multiplication (e.g., integers under addition. — you can scale by integers but not by all real numbers in a way that stays within the integers).

Each level adds structure, and with it, more power. By the time you reach a vector space, you have two operations harmonizing across two sets —. By the time you reach a vector space, you have two operations harmonizing across two sets. — enough machinery to build all of linear algebra.

3.7.3 Connection to Machine Learning

When you work with feature vectors in machine learning — describing houses, images, text embeddings — you are working inside . You implicitly assume:

  • Adding two feature vectors gives another valid feature vector (closure under addition).
  • You can scale features — normalization and standardization depend on scalar multiplication.
  • There is a meaningful zero vector (all features zero), which serves as the reference for centering data.
  • You can form linear combinations to create new representations — You can form linear combinations to create new representations. — every layer of a neural network computes linear combinations followed by a non-linearity.

These are the same vector space properties discussed throughout this lecture. They are not abstract curiosities — They are not abstract curiosities. — they are the mathematical foundation that makes operations like PCA, linear regression, and They are not abstract curiosities. — they are the mathematical foundation that makes operations like PCA, linear regression, and neural network weight updates well-defined.

Exam note: The hierarchy Group → Abelian Group → Vector Space is a conceptual thread that runs through the entire course. Exam questions often test whether you can place a given structure in this hierarchy and justify why it does (or does not) belong at a certain level.

3.7.4 What Comes Next

With groups and vector spaces established, the next lectures build on this foundation directly:

  • Linear transformations and matrices use the vector space structure to map between spaces.
  • Solving relies on the span of columns (existence) and linear independence (uniqueness).
  • Determinants and eigenvalues characterize how matrices stretch and rotate the vector space.
  • Inner products (Lecture 4) add the concept of angle and length, turning a vector space into an inner product space — a further enrichment of the hierarchy.

3.8 Student Questions and Answers

The student questions from the lecture have been integrated into their respective concept sections for better context. Use this index to locate them quickly.

3.8.1 Groups and Abelian Groups — see Section 3.1

  • Division and closure for integers → Section 3.1, Student Q&A
  • Specific cases vs. universal properties (single counterexample rule) → Section 3.1, Student Q&A
  • Associativity vs. commutativity → Section 3.1, Student Q&A
  • Mixing operations in a group definition → Section 3.1, Student Q&A
  • Matrix multiplication and group properties → Section 3.1, Student Q&A
  • Multiplication of two negatives and closure → Section 3.1, Student Q&A

3.8.2 Vector Spaces and Linear Combinations — see Sections 3.3 and 3.5

  • First quadrant as a vector space → Section 3.3, Student Q&A
  • Boundaries of a vector space → Section 3.3, Student Q&A
  • Moving the origin → Section 3.3, Student Q&A
  • Which properties to check when proving a vector space → Section 3.3, Student Q&A
  • Scalar multiplication: vector-by-vector or scalar-by-vector → Section 3.3, Student Q&A
  • Why only addition and multiplication, not division or subtraction → Section 3.3, Student Q&A
  • Zero vector vs. zero scalar in independence definition → Section 3.5, Student Q&A
  • Can independent vectors reach the origin → Section 3.5, Student Q&A
  • Adding independent vectors and dependence → Section 3.5, Student Q&A
  • Zero vector direction → Section 3.5, Student Q&A
  • Linear independence and solving → Section 3.5, Student Q&A
  • Dependent columns: no solution or infinite solutions → Section 3.5, Student Q&A

3.9 Key Concepts and Summary

3.9.1 Summary Table

ConceptPlain-Language MeaningKey Test
GroupA set of elements plus a binary operation that satisfies closure, associativity, identity, and inverseCheck all four properties; one failure disqualifies
Abelian GroupA group where the operation is also commutative ()All four group properties + commutativity for all pairs
Vector SpaceTwo sets (vectors + scalars) with two operations (vector addition + scalar multiplication), satisfying all group/abelian group propertiesContains , closed under addition, closed under scalar multiplication
Linear CombinationScale vectors by scalars, then add the results: The fundamental operation of linear algebra
Linear IndependenceThe only linear combination that gives the zero vector is the trivial one (all scalars = 0)Solve ; only works
Linear DependenceSome non-trivial linear combination gives the zero vector; at least one vector is redundantAt least one non-zero scalar exists in the zero-combination
SpanThe set of all possible linear combinations of a given set of vectorsEquals the column space of the matrix formed by the vectors
ClosureOperating on elements of the set never produces something outside the set,
IdentityA special "do-nothing" element ( for addition, for multiplication)
InverseAn "undo" element for every element ()
Origin / Zero VectorThe reference point from which all vectors are measuredMust be present for a set to be a vector space

3.9.2 The Hierarchy at a Glance

Group (4 axioms: closure, associativity, identity, inverse)
  │
  └─ Abelian Group (+ commutativity: x∘y = y∘x)
       │
       └─ Vector Space (+ scalar multiplication over a field)
  • Every vector space is an abelian group (under vector addition).
  • Every abelian group is a group.
  • Reverse implications do not hold.

3.9.3 Quick Counterexample Bank

CandidateVerdictWhy It Fails
Group (abelian)All four axioms + commutativity hold
Not a groupFails inverse:
Not a groupFails closure:
integer matrices under Not a groupFails inverse: singular matrices have no inverse
First quadrant of Not a vector spaceFails scalar multiplication: quadrant
Line through originVector spacePasses all tests
Line Not a vector spaceFails zero vector: not on the line
Bounded region Not a vector spaceFails scalar multiplication: out of bounds

3.10 Exam Guidance Summary

3.10.1 What to Expect

  • Quizzes and midterm: Questions asking you to prove whether a given set with a given operation forms a group typically carry one or two marks. These were explicitly mentioned as common quiz and exam content. Be prepared to verify all four properties systematically.
  • Vector space questions: Expect questions that ask you to determine whether a given set (line, quadrant, bounded region) is a vector space. The key is to test closure properties and presence of the zero vector. Show your reasoning — a yes/no answer alone gets no credit.
  • Line as a vector space: This exact example has appeared in a previous semester's examination. Know how to verify: any point is , addition gives , scalar multiplication gives —. Know how to verify: any point is , addition gives , scalar multiplication gives . — all on the line. Zero vector is present.
  • Bounded region as a non-vector-space: Also appeared in a previous year's examination. The counterexample is scaling: pick in the region, scale by , get — outside. One counterexample is enough.
  • The four group properties (closure, associativity, identity, inverse) must be memorized in order. Questions may ask you to verify all four for a given . Use the checklist approach shown in Section 3.1.4.
  • Linear independence definition: Expect a question asking you to state the formal definition and apply it to a set of two or three vectors. Remember: set up and solve for . If only the trivial solution exists, the vectors are independent.
  • Abelian/commutative distinction: You may be asked whether a specific group is abelian. Show one counterexample if it is not (e.g., two matrices where ). For proof that it is abelian, the operation must commute for all pairs.
  • Sample questions will be shared separately for practice.
Exam note: The most common exam pattern is "Is X a group/vector space? Justify." Follow this template: (1) state each property, (2) test it on the candidate, (3) conclude pass or fail. If any property fails, stop — the candidate is disqualified. For vector spaces specifically, test the three key properties: contains , closed under addition, closed under scalar multiplication.

MFML Lecture 03 notes · Groups, Vector Spaces, and Linear Combinations

Mathematical Foundations for Machine Learning· postgraduate· 2026-07-08

Sections Breakdown

1Groups

Definition of a group as a set plus a binary operation satisfying closure, associativity, identity, and inverse, with worked examples.

2Abelian Groups

A group where the operation is also commutative, with the hierarchy and matrix counterexamples.

3Vector Spaces

Two sets and two operations; the three quick tests for a vector space and common non-examples.

4Linear Combinations

Scaling vectors and adding them; the fundamental operation behind span, basis, and matrix multiplication.

5Linear Independence and Dependence

When no vector in a set is a redundant linear combination of the others.

6Span

The set of all linear combinations of a set of vectors, its link to solvability of Ax=b, and dimension.

7The Big Picture: Math as Assumptions

Why these structures are contracts of assumptions and how they connect to machine learning.

8Student Questions and Answers

Index of student questions answered inline in the concept sections.

9Key Concepts and Summary

Summary table, hierarchy, and counterexample bank for quick review.

10Exam Guidance Summary

What to expect in quizzes and exams and the standard proof template.

Postgraduate students in Mathematical Foundations for Machine Learning

Exam Revision Notes

Below is the distilled, exam-ready core of this lecture. Every entry is built from the full textbook notes above. Use this section for rapid review — but if something doesn't make sense, go back to the full explanation in the main content.

Groups

Must-know: A group is a set with a binary operation satisfying four properties: closure, associativity, identity, and inverse. One failure disqualifies it. The same set can be a group under one operation but not another — is a group under but not under .

⚠️ Top pitfall: Showing one or two pairs work does NOT prove closure — you need all pairs. To disprove, a single counterexample is enough. Also, the inverse must live inside the set ().

Self-check: Is a group? Why or why not?

Connects to: Abelian Groups, Vector Spaces, Linear Independence and Dependence

Abelian Groups

Must-know: An abelian group is a group where the operation is also commutative: for all pairs. Commutativity is optional for a group. Invertible matrices form a group under multiplication but are NOT abelian because in general.

⚠️ Top pitfall: Assuming every group is abelian. Matrix multiplication is the classic counterexample: holds (associative) but (not commutative). One counterexample disproves abelian.

Self-check: Give one example of a group that is associative but not commutative.

Connects to: Groups, Vector Spaces

Vector Spaces

Must-know: A vector space has two sets (vectors and scalars, usually ) and two operations (vector addition and scalar multiplication). For a subset of , three tests suffice: contains the zero vector, closed under addition, closed under scalar multiplication. Lines through the origin pass; quadrants, shifted lines, and bounded boxes fail.

⚠️ Top pitfall: Forgetting to test scalar multiplication by a negative number. The first quadrant fails because leaves it. The bounded box contains but escapes it.

Self-check: Is the line a vector space? Explain in one line.

Connects to: Linear Combinations, Span, Groups

Linear Combinations

Must-know: A linear combination scales vectors by scalars and adds them: . It is the single most important operation in linear algebra. The matrix-vector product is exactly a linear combination of the columns of weighted by .

⚠️ Top pitfall: Treating scalars as positive only. Negative scalars flip a vector's direction and are essential to reach all points. Without them, two vectors in reach only a wedge, not the whole plane.

Self-check: Write as a single vector for , .

Connects to: Vector Spaces, Span, Linear Independence and Dependence

Linear Independence and Dependence

Must-know: A set is linearly independent if the only way is when all (the trivial solution). If a non-trivial combination gives , the set is dependent and at least one vector is redundant. In you can have at most independent vectors.

⚠️ Top pitfall: Confusing the zero vector with the zero scalar . The equation equals the origin , not the number . Also, for three or more vectors, no two being scalar multiples does NOT guarantee independence (one may be the sum of the others).

Self-check: Are and linearly independent? Show the non-trivial combination.

Connects to: Linear Combinations, Span, Vector Spaces

Span

Must-know: The span of a set of vectors is the set of ALL their linear combinations. It is always a subspace. A system has a solution iff is in the span of the columns of (the column space). The dimension of the span equals the number of independent vectors.

⚠️ Top pitfall: Equating the number of vectors with the dimension of their span. Three collinear vectors span only a 1D line. The span of fewer than independent vectors in is a lower-dimensional subspace, so most vectors are NOT in it.

Self-check: What is the span of and in ? Give its dimension.

Connects to: Linear Combinations, Linear Independence and Dependence, Vector Spaces

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.