Skip to content
datarekha

Vector Spaces & Subspaces

Which parts of a space are self-contained — so that adding or stretching arrows inside them never throws you out? Those are subspaces, decided by three quick checks. GATE's favourite trap dresses a set with squared coordinates so it looks linear but quietly fails closure.

9 min read Intermediate GATE DA Lesson 19 of 122

What you'll learn

  • What a vector space is, in plain terms
  • The subspace test: contains 0, closed under addition, closed under scalar multiplication
  • Lines and planes through the origin are subspaces; offset ones are not
  • Why squared coordinates break closure — the real 2024 trap

Before you start

You already know how to add arrows and stretch them — that is the whole of working inside a vector space. It is the polite name for any setting where addition and scaling behave the way you expect (the plane and 3-D space are the everyday ones).

The interesting question, and the one GATE keeps asking, is which parts of that space are self-contained. Which collections of arrows are “complete”, in the sense that adding or stretching arrows from the collection never throws you outside it? Those complete parts are called subspaces, and they pass or fail on three quick checks.

The subspace test — three conditions

A subset W of a vector space is a subspace exactly when all three hold:

  1. It contains the zero vector — the origin 0 is in W.
  2. It is closed under addition — if u and v are in W, so is u + v.
  3. It is closed under scalar multiplication — if v is in W and c is any scalar, so is cv.

Geometrically in , the only things that pass are:

  • the origin alone
  • every line through the origin
  • every plane through the origin
  • all of

Anything that misses the origin, bends, or is bounded fails.

Through the origin = subspace0passes through 0; sums and scalings stay on itOffset = NOT a subspace0misses 0; scaling a point leaves the plane
A plane through the origin is a subspace; the same plane shifted off the origin fails all three.

The fastest screen is condition 1. If the origin is not in the set, stop — it is not a subspace. That one check kills every “offset” set on sight.

Necessary is not sufficient

Do not let that speed run in the other direction, though. This is the classic slip: containing the origin is necessary, never sufficient. Passing check 1 tells you only that you must keep testing.

Take the first quadrant, {(x, y) : x ≥ 0 and y ≥ 0}. It holds the origin ✓ and even survives check 2: adding two points with non-negative coordinates gives another ✓. Then it dies at check 3, because scaling (1, 1) by −1 gives (−1, −1), which is nowhere near the quadrant. All three conditions do independent work, and “every scalar” includes the negative ones.

Drag the two arrows below and watch. As long as both live in your candidate subset, every sum and every scaled copy must too, or closure breaks. Line them up along a line through the origin and notice that addition and scaling never push you off it.

Tryvector playground

Drag the arrow tips — watch the dot product change

uv
u(3.0, 4.0)
v(4.0, 1.0)
|u|5.00
|v|4.12
u·v16.00
cos θ0.776
angle39°
Drag the colored tip of each arrow. The dot product spikes when the arrows point the same way and vanishes when they're perpendicular.

The trap GATE loves

Three flavours of set

The designed difficulty mixes three flavours of set:

  • a genuine subspace (a linear equation through the origin)
  • an affine set (a linear equation set equal to a non-zero constant, so it misses the origin)
  • a set written with squared coordinates — which looks algebraic but breaks closure under scaling

GATE DA 2024 used squared coefficients precisely because they masquerade as linear.

Three sets, three outcomes

Decide which of these subsets of are subspaces: (a) {(x, y) : x + y = 0}, (b) {(x, y) : x² + y² ≤ 1}, (c) {(x, y) : x + y = 1}.

Set (a), x + y = 0 — a subspace. The origin gives 0 + 0 = 0 ✓. If two points both satisfy it, so does their sum: (x₁+x₂) + (y₁+y₂) = 0. And scaling by c gives cx + cy = c(x+y) = 0. All three pass — it is the line through the origin of slope −1.

Set (b), the unit disk x² + y² ≤ 1 — NOT a subspace. The origin is inside, so condition 1 passes, but closure fails: (1, 0) is in the disk, yet scaling by 2 gives (2, 0) with 2² + 0² = 4 > 1, outside. The squared terms make the set bounded, and scaling escapes it.

Set (c), x + y = 1 — NOT a subspace. Check the origin first: 0 + 0 = 0 ≠ 1, so it fails immediately. This is the line x + y = 0 shifted off the origin.

Only (a) survives — three sets, three different reasons.

How big is a subspace?

Once a set passes the test, the natural follow-up is how big it is. A subspace’s dimension counts the directions living inside it: 1 for a line, 2 for a plane, n for the whole of Rⁿ.

You can usually read it straight off the defining equation, because each homogeneous linear equation you impose removes exactly one degree of freedom.

Set (a) is the smallest example of that. starts with two free coordinates. The equation x + y = 0 forces y = −x, so choosing x decides everything — one free coordinate remains, dimension 1, a line, exactly as we found.

Run the same count in R⁴ and one homogeneous equation leaves 4 − 1 = 3. In general, k independent homogeneous equations in Rⁿ carve out a subspace of dimension n − k.

A question to carry forward

A line through the origin needs just one arrow to generate it; a plane needs two. Here is the thread onward — the word that followed us across from probability: those generating arrows must be independent, each pointing in a genuinely new direction the others cannot reach.

How few independent arrows does it take to build a whole subspace, and how do we tell when one is secretly redundant?

In one breath

  • A subspace W passes three tests: (1) contains 0, (2) closed under addition, (3) closed under scalar multiplication (every scalar, including −1).
  • Lead with the zero-vector check — if 0 ∉ W, stop (kills every offset/affine set like x+y=1).
  • In , the only subspaces are:
    • the origin
    • lines through 0
    • planes through 0
    • all of
  • A subspace equation is linear AND homogeneous (RHS = 0).
  • The 2024 trap: squared terms (x²+y² ≤ 1, x²=y) look algebraic but break closure under scaling — scale a member and it leaves the set.
  • One homogeneous equation in Rⁿ drops the dimension by 1 (x+y+z=0 in → a 2-D plane).

Practice

Quick check

0/6
Q1Recall: which single quick check rules out the most non-subspaces fastest?
Q2Trace: is {(x, y) : x + y = 1} a subspace of R²? Why?
Q3Trace: what is the dimension of the subspace {(x, y, z) : x + y + z = 0} in R³?numerical answer — type a number
Q4Apply: which of these subsets of R² are subspaces? (select all that apply)select all that apply
Q5Apply: which sets fail because closure under scalar multiplication breaks? (select all that apply)select all that apply
Q6Create: invent a subset of R² that contains the origin and is closed under addition, yet is NOT a subspace, and name the condition it breaks.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Practice this in an interview

All questions
What are embeddings, and how do you measure similarity between them for vector search?

Embeddings are learned dense vectors that place semantically related data near one another in a model-specific geometric space. Vector search embeds a query, compares it with stored vectors using a metric such as cosine similarity, dot product, or Euclidean distance, and returns the nearest candidates.

What is the kernel trick in SVM, and why does it work?

The kernel trick lets an SVM find a nonlinear decision boundary by implicitly mapping data into a higher-dimensional space where it becomes linearly separable, without ever computing that mapping explicitly. It works because the SVM's dual formulation depends only on dot products between points, and a kernel function computes that dot product directly in the high-dimensional space. Common kernels are linear, polynomial, and RBF.

How does an SVM work, and what is the kernel trick?

An SVM finds the hyperplane that maximises the margin between the two nearest points of each class (the support vectors). When data is not linearly separable, the kernel trick implicitly maps inputs to a high-dimensional feature space — computing inner products there without ever materialising the transformation — enabling non-linear decision boundaries at the cost of linear-space computation.

What is a vector database and how does it enable semantic retrieval?

A vector database stores embeddings with metadata and searches their vector space using nearest-neighbor indexes. Because documents and queries are embedded by the same model, it can retrieve paraphrases and related concepts rather than only shared keywords; production systems often add metadata filters, lexical search, and reranking.

Related lessons

Explore further