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.
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 R² and 3-D space R³ 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:
- It contains the zero vector — the origin
0is inW. - It is closed under addition — if
uandvare inW, so isu + v. - It is closed under scalar multiplication — if
vis inWandcis any scalar, so iscv.
Geometrically in R³ the only things that pass 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, 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.
Drag the arrow tips — watch the dot product change
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
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 — 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
Wpasses 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 likex+y=1). - In
R³the only subspaces are: the origin, lines through 0, planes through 0, all ofR³. 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=0inR³→ a 2-D plane).
Practice
Quick check
Practice this in an interview
All questionsThe 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.
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.
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.