Vector Space and Basis — Seeing the World from a Different Coordinate System
Vector Space and Basis -- Seeing the World from a Different Coordinate System
The longitude and latitude values at the same location are different in the GPS coordinate system and the BeiDou coordinate system—but the location itself hasn't changed.
Vectors are the same: the same vector has different coordinates in different bases. Understanding this is understanding the essence of PCA dimensionality reduction and word embedding spaces.
Vector Space
Vector Space = a set whose elements (vectors) are closed under addition and scalar multiplication.
Closed = the sum of any two vectors in the space, or the product of any vector by a scalar, remains within the space.
Basis: Describing the coordinate scale of the space
It is a set of vectors whose linear combinations can uniquely represent any vector in the space.
Standard basis: (1,0,0), (0,1,0), (0,0,1) — representing the x, y, and z axis directions, respectively.
Linearly independent: No redundancy
A set of vectors is linearly independent = none of the vectors can be represented as a linear combination of the others.
Intuition: Each vector brings a truly "new direction," with no waste.
** Linearly independent
{(1,0), (0,1)}
Each vector provides a new direction
Rank = 2 (full rank)
Linearly dependent
{(1,2), (2,4)}
The second = the first × 2
Rank = 1 (redundant)
A basis must satisfy two conditions: linearly independent (no redundancy) + spans the entire space (can represent all vectors).
A basis for an n-dimensional space contains exactly n vectors.
Real-life example
**Change coordinate system
The location of Beijing is (x₁, y₁) in the Beijing 54 coordinate system and (x₂, y₂) in the WGS-84 coordinate system.
The location itself has not changed, but the "ruler" (base) describing it is different, so the coordinate numbers are different.
**Word embedding space
A word embedding model maps each word to a vector in a 300-dimensional space. Each dimension in this space corresponds to an implicit semantic direction.
"King - Man + Woman ≈ Queen" — these vector operations all occur in this 300-dimensional vector space.
Mathematical definition
( {\mathbf{v}_1, \dots, \mathbf{v}_n} ) is a basis = they are linearly independent + span{(\mathbf{v}_1,\dots,\mathbf{v}_n)} = the entire space.
Linear combination: ( c_1\mathbf{v}_1 + \cdots + c_n\mathbf{v}_n = \mathbf{0} ) has only the zero solution $\rightarrow$ linearly independent.
Python hands-on practice
Example
import
numpy
as
np
Standard base
e1
,
e2
,
e3
=
np.
array
(
[
1
,
0
,
0
]
)
,
np.
array
(
[
0
,
1
,
0
]
)
,
np.
array
(
[
0
,
0
,
1
]
)
v
=
np.
array
(
[
4
,
5
,
6
]
)
(
"v = 4e1 + 5e2 + 6*e3:"
,
4
*e1 +
5
*e2 +
6
*e3
)
Use rank to determine linear independence
v1
,
v2
=
np.
array
(
[
1
,
2
]
)
,
np.
array
(
[
2
,
4
]
)
v2 = 2*v1
M
=
np.
column_stack
(
[
v1
,
v2
]
)
(
f
"{{v1, v2}}'s rank: {np.linalg.matrix_rank(M)} (< 2 → linearly dependent)"
)
Change of basis: the same vector has different coordinates in different bases
v_std
=
np.
array
(
[
3.0
,
2.0
]
)
B_new
=
np.
array
(
[
[
2.0
,
0
]
,
[
0
,
3.0
]
]
)
New Foundation
v_new
=
np.
linalg
.
inv
(
B_new
)
@
v_std
(
f
"Standard coordinates: {v_std}, New base coordinates: {v_new}"
)
(
f
"Verify B @ new coordinates = {B_new @ v_new}"
)
Original prompt (Chinese, left untranslated)
v = 4*e1 + 5*e2 + 6*e3: [4 5 6]
{v1, v2} 的秩: 1 (< 2 → 线性相关)
标准坐标: [3. 2.], 新基下坐标: [1.5 0.67]
验证 B @ 新坐标 = [3. 2.]
Application scenarios in AI
PCA dimensionality reduction = basis change
PCA finds a set of new orthonormal bases (principal component directions) that maximize the variance of the data along the first k coordinates of the new basis. Dimensionality reduction = only keeping the first k new basis coordinates and discarding directions with small variance. This is essentially a coordinate system transformation—from a 784-dimensional pixel space to a 50-dimensional principal component space.
Word Embedding Space
Word2Vec and GloVe map each word to a point in a 300-dimensional vector space. This space is not arbitrarily constructed—the geometric relationship between words reflects semantic relationships. Synonyms are close, and antonyms are exactly opposite in certain directions. Linear operations (addition and subtraction) in the vector space correspond to semantic operations.
Feature Space Transformation
Each layer of a neural network can be seen as mapping the input to a new vector space. Data that is linearly inseparable in the original space (such as the XOR problem) becomes linearly separable after being transformed into the feature space by the hidden layer. This is the core intuition of deep learning—transformation layer by layer, ultimately allowing separation with a simple classifier in the feature space.