Vector Spaces & Subspaces
A subspace must contain the origin and stay closed under addition and scaling. GATE's favourite trick: a set with squared terms looks linear but fails closure.
What you'll learn
- What a vector space is, in plain terms
- The subspace test: contains the zero vector, 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’s the whole of working
inside a vector space. A vector space is just the polite name for any setting
where addition and scaling behave the way you’d expect, and the plane R² and 3D
space R³ are the everyday examples. The interesting question — and the one GATE
keeps asking — is which subsets of a vector space are themselves vector spaces.
These are called subspaces, and they pass or fail on three quick checks. The
exam loves sets that pass two of the three and quietly miss the third. (Subspaces
aren’t just exam fodder: the low-dimensional subspace that best captures your data
is exactly what PCA hunts for, and a model’s column space is the set of outputs it
can ever produce.)
The subspace test — three conditions
A subset W of a vector space is a subspace if and only if all three hold:
- Contains the zero vector — the origin
0must be inW. - Closed under addition — if
uandvare inW, thenu + vis inW. - Closed under scalar multiplication — if
vis inWandcis any scalar, thencvis inW.
Geometrically in R³ the only subspaces are: the origin alone, every line through
the origin, every plane through the origin, and all of R³. Anything that
misses the origin, bends, or is bounded fails.
The fastest screen is condition 1: if the origin is not in the set, stop — it is not a subspace. That single check kills every “offset” set instantly.
Drag the two arrows and watch what their sum and scalings do. As long as both arrows live in your candidate subset, every sum and every scaled copy must too — or the closure conditions break. Try lining the arrows up along a line through the origin and notice that addition and scaling never push you off that line.
How GATE asks this
The pattern is a clean MCQ or MSQ: a list of subsets of R² or R³ is given,
and you select which ones are subspaces. GATE DA 2024 ran exactly this format. The
designed trap mixes three flavours of set: a genuine subspace (a linear equation
through the origin), an affine set (a linear equation equal to a nonzero constant,
so it misses the origin), and a set defined with squared coordinates (which looks
algebraic but breaks closure under scaling). Test all three conditions, but lead with
the zero-vector check — it resolves most options on its own.
Worked example — three sets, one test each
Decide which of these subsets of
R²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. Subspace. The origin (0, 0) satisfies 0 + 0 = 0, so
condition 1 holds. If (x₁, y₁) and (x₂, y₂) both satisfy it, their sum gives
(x₁ + x₂) + (y₁ + y₂) = 0, so it is closed under addition. Scaling by c gives
cx + cy = c(x + y) = c·0 = 0 — closed. All three pass; this is the line through the
origin with slope -1.
Set (b) — x² + y² ≤ 1 (the unit disk). NOT a subspace. The origin is inside, so
condition 1 passes — but closure fails. Take (1, 0), which is in the disk, and scale
by c = 2: you get (2, 0), and 2² + 0² = 4 > 1, which is outside. Closure
under scalar multiplication is broken, so it is not a subspace. (The squared terms are
the giveaway — they make the set bounded.)
Set (c) — x + y = 1 (affine). NOT a subspace. Check condition 1 first:
(0, 0) gives 0 + 0 = 0 ≠ 1, so the origin is not in the set. It fails
immediately — this is the line x + y = 0 shifted off the origin.
So only (a) is a subspace. Three sets, three different reasons to keep or reject.
Quick check
Quick check
Practice this in an interview
All questionsAn 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.
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.
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.