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.

8 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, 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, and 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, and that one check kills every “offset” set on sight. 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 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

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), and 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.

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.

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 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.

How does Ordinary Least Squares derive the coefficient vector, and what is the closed-form solution?

OLS minimizes the sum of squared residuals. Setting the gradient of the loss to zero yields the normal equations, whose unique solution is the projection of y onto the column space of X. The closed-form is the hat matrix formula β = (XᵀX)⁻¹Xᵀy.

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

A vector database stores dense numerical embeddings alongside their source documents and uses approximate nearest-neighbor (ANN) algorithms to find the most semantically similar entries for a query vector in milliseconds. Unlike a keyword index, similarity is measured in geometric space so synonyms and paraphrases match naturally. Common choices include Pinecone, Weaviate, Qdrant, and pgvector for Postgres.

Related lessons

Explore further

Skip to content