Chapter 7. Inner Product Spaces
第 7 章内积空间
7.1 Inner Products and Norms
7.1 内积和范数
To extend the geometric ideas of length, distance, and angle beyond and , we introduce inner products. Inner products provide a way of measuring similarity between vectors, while norms derived from them measure length. These concepts are the foundation of geometry inside vector spaces.
为了将长度、距离和角度的几何概念扩展到 和 之外,我们引入了内积。内积提供了一种度量向量之间相似性的方法,而由内积导出的范数则用于度量长度。这些概念是向量空间几何的基础。
Inner Product
内积
An inner product on a real vector space is a function
实向量空间 上的内积是一个函数
that assigns to each pair of vectors a real number, subject to the following properties:
为每对向量 分配一个实数,并遵循以下属性:
-
Symmetry:
对称性:
-
Linearity in the first argument:
第一个参数的线性:
-
Positive-definiteness: , and equality holds if and only if .
正定性: ,且仅当 时等式成立。
The standard inner product on is the dot product:
上的标准内积是点积:
Norms
范数
The norm of a vector is its length, defined in terms of the inner product:
向量的范数是其长度,根据内积定义:
For the dot product in :
对于 中的点积:
Angles Between Vectors
向量之间的角度
The inner product allows us to define the angle between two nonzero vectors by
通过内积,我们可以定义两个非零向量 之间的角度 ,即
Thus, two vectors are orthogonal if .
因此,若 ,则两个向量正交。
Examples
示例
Example 7.1.1. In , with , :
例 7.1.1。 在 中,使用 、 :
So,
所以,
Example 7.1.2. In the function space , the inner product
例 7.1.2。 在函数空间 中,内积
defines a length
定义长度
This generalizes geometry to infinite-dimensional spaces.
这将几何学推广到无限维空间。
Geometric Interpretation
几何解释
-
Inner product: measures similarity between vectors.
内积:测量向量之间的相似性。
-
Norm: length of a vector.
范数:向量的长度。
-
Angle: measure of alignment between two directions.
角度:两个方向之间的对齐度量。
These concepts unify algebraic operations with geometric intuition.
这些概念将代数运算与几何直觉统一起来。
Why this matters
为什么这很重要
Inner products and norms allow us to extend geometry into abstract vector spaces. They form the basis of orthogonality, projections, Fourier series, least squares approximation, and many applications in physics and machine learning.
内积和范数使我们能够将几何扩展到抽象向量空间。它们构成了正交性、投影、傅里叶级数、最小二乘近似以及物理学和机器学习中许多应用的基础。
Exercises 7.1
练习 7.1
-
Compute . Then find the angle between them.
计算 。然后求出它们之间的角度。
-
Show that satisfies the properties of a norm.
证明 满足范数的性质。
-
In , verify that and are orthogonal.
在 中,验证 和 是否正交。
-
In , compute for , .
在 中,计算 、 的 。
-
Prove the Cauchy–Schwarz inequality:
证明柯西-施瓦茨不等式:
7.2 Orthogonal Projections
7.2 正交投影
One of the most useful applications of inner products is the notion of orthogonal projection. Projection allows us to approximate a vector by another lying in a subspace, minimizing error in the sense of distance. This idea underpins geometry, statistics, and numerical analysis.
内积最有用的应用之一是正交投影的概念。投影使我们能够用子空间中的另一个向量来近似一个向量,从而最小化距离方向上的误差。这一思想是几何、统计学和数值分析的基础。
Projection onto a Line
投影到线上
Let be a nonzero vector. The line spanned by is
令 为非零向量。 所张成的直线为
Given a vector , the projection of onto is the vector in closest to . Geometrically, it is the shadow of on the line.
给定向量 , 在 上的投影是 中距离 最近的向量。从几何学上讲,它是 在线上的阴影。
The formula is
公式是
The error vector is orthogonal to .
误差向量 与 正交。
Example 7.2.1
例 7.2.1
Let , .
令 , 。
So
所以
The error vector is , which is orthogonal to .
误差向量为 ,与 正交。
Projection onto a Subspace
投影到子空间
Suppose is a subspace with orthonormal basis . The projection of a vector onto is
假设 是一个具有正交基 的子空间。向量 在 上的投影为
This is the unique vector in closest to . The difference is orthogonal to all of .
这是 中与 最接近的唯一向量。差值 与所有 正交。
Least Squares Approximation
最小二乘近似
Orthogonal projection explains the method of least squares. To solve an overdetermined system , we seek the that makes the projection of onto the column space of . This gives the normal equations
正交投影解释了最小二乘法。为了解决超定问题 系统 ,我们寻找 ,使得 成为 在 的列空间上的投影。这给出了正则方程
Thus, least squares is just projection in disguise.
因此,最小二乘法只是伪装的投影。
Geometric Interpretation
几何解释
-
Projection finds the closest point in a subspace to a given vector.
投影找到子空间中距离给定向量最近的点。
-
It minimizes distance (error) in the sense of Euclidean norm.
它按照欧几里得范数的意义最小化距离(误差)。
-
Orthogonality ensures the error vector points directly away from the subspace.
正交性确保误差向量直接指向远离子空间的方向。
Why this matters
为什么这很重要
Orthogonal projection is central in both pure and applied mathematics. It underlies the geometry of subspaces, the theory of Fourier series, regression in statistics, and approximation methods in numerical linear algebra. Whenever we fit data with a simpler model, projection is at work.
正交投影在纯数学和应用数学中都至关重要。它是子空间几何、傅里叶级数理论、统计学中的回归以及数值线性代数中的近似方法的基础。每当我们用更简单的模型拟合数据时,投影就会发挥作用。
Exercises 7.2
练习 7.2
-
Compute the projection of onto the vector .
计算 到向量 的投影。
-
Show that is orthogonal to .
证明 与 正交。
-
Let . Find the projection of onto .
令 。求 到 的投影。
-
Explain why least squares fitting corresponds to projection onto the column space of .
解释为什么最小二乘拟合对应于 的列空间上的投影。
-
Prove that projection onto a subspace is unique: there is exactly one closest vector in to a given .
证明投影到子空间 是唯一的:在 中,有且仅有一个与给定 最接近的向量。
7.3 Gram–Schmidt Process
7.3 格拉姆-施密特过程
The Gram–Schmidt process is a systematic way to turn any linearly independent set of vectors into an orthonormal basis. This is especially useful because orthonormal bases simplify computations: inner products become simple coordinate comparisons, and projections take clean forms.
格拉姆-施密特过程是一种将任意线性无关的向量集转化为正交基的系统方法。这种方法尤其有用,因为正交基可以简化计算:内积变成了简单的坐标比较,并且投影呈现出清晰的形式。
The Idea
理念
Given a linearly independent set of vectors in an inner product space, we want to construct an orthonormal set that spans the same subspace.
给定内积空间中一组线性无关的向量 ,我们想要构建一个张成同一子空间的正交集 。
We proceed step by step: 我们一步步来:
-
Start with , normalize it to get .
从 开始,将其标准化得到 .
-
Subtract from its projection onto , leaving a vector orthogonal to . Normalize to get .
从 中减去它在上的投影 ,留下一个与正交的向量 . 标准化得到 .
-
For each , subtract projections onto all previously constructed , then normalize.
对于每个 ,减去所有先前构建的𝑢上的投影 ,然后标准化。
The Algorithm
算法
For :
对于 :
The result is an orthonormal basis of the span of the original vectors.
结果 是原始向量跨度的正交基。
Example 7.3.1
例 7.3.1
Take in .
在 中 。
-
Normalize :
标准化 :
-
Subtract projection of on :
减去 在 的投影 :
So
所以
Normalize:
规范化:
-
Subtract projections from :
从中减去投影:
After computing, normalize to obtain .
计算后,归一化得到 .
The result is an orthonormal basis of the span of .
结果是 张成的正交基。
Geometric Interpretation
几何解释
Gram–Schmidt is like straightening out a set of vectors: you start with the original directions and adjust each new vector to be perpendicular to all previous ones. Then you scale to unit length. The process ensures orthogonality while preserving the span.
格拉姆-施密特变换就像拉直一组向量:从原始方向开始,调整每个新向量使其与所有先前的向量垂直。然后缩放到单位长度。这个过程确保了正交性,同时保留了跨度。
Why this matters
为什么这很重要
Orthonormal bases simplify inner products, projections, and computations in general. They make coordinate systems easier to work with and are crucial in numerical methods, QR decomposition, Fourier analysis, and statistics (orthogonal polynomials, principal component analysis).
正交基可以简化内积、投影和一般计算。它们使坐标系更易于使用,并且在数值方法、QR 分解、傅里叶分析和统计学(正交多项式、主成分分析)中至关重要。
Exercises 7.3
练习 7.3
-
Apply Gram–Schmidt to in .
对 中的 应用 Gram–Schmidt 公式。
-
Orthogonalize in .
在 中对 进行正交化。
-
Prove that each step of Gram–Schmidt yields a vector orthogonal to all previous ones.
证明 Gram-Schmidt 的每一步都会产生一个与所有前面的向量正交的向量。
-
Show that Gram–Schmidt preserves the span of the original vectors.
证明 Gram–Schmidt 保留了原始向量的跨度。
-
Explain how Gram–Schmidt leads to the QR decomposition of a matrix.
解释 Gram-Schmidt 如何导致矩阵的 QR 分解。
7.4 Orthonormal Bases
7.4 正交基
An orthonormal basis is a basis of a vector space in which all vectors are both orthogonal to each other and have unit length. Such bases are the most convenient possible coordinate systems: computations involving inner products, projections, and norms become exceptionally simple.
正交基是向量空间中的一种基,其中所有向量彼此正交且具有单位长度。这样的基是最方便的坐标系:涉及内积、投影和范数的计算变得异常简单。
Definition
定义
A set of vectors in an inner product space is called an orthonormal basis if
内积空间 中的一组向量 称为正交基,若
-
whenever (orthogonality),
每当 (正交性)
-
for all (normalization),
对所有 进行 (规范化),
-
The set spans .
该集合张成 。
Examples
示例
Example 7.4.1. In , the standard basis
例 7.4.1. 在 中,标准基础
is orthonormal under the dot product.
在点积下是正交的。
Example 7.4.2. In , the standard basis
例 7.4.2. 在 中,标准基础
is orthonormal.
是正交的。
Example 7.4.3. Fourier basis on functions:
例 7.4.3. 函数的傅里叶基:
is an orthogonal set in the space of square-integrable functions on with inner product
是 上平方可积函数空间中的正交集,具有内积
After normalization, it becomes an orthonormal basis.
经过归一化之后,它就变成了正交基。
Properties
特性
-
Coordinate simplicity: If is an orthonormal basis of , then any vector has coordinates
坐标简单性:如果 是 的正交基,则任何向量 都有坐标
That is, coordinates are just inner products.
也就是说,坐标只是内积。
-
Parseval’s identity: For any ,
帕塞瓦尔的 identity: 对于任意的 ,
-
Projections: The orthogonal projection onto the span of is
投影: 张成的正交投影 是
Constructing Orthonormal Bases
构造正交基
-
Start with any linearly independent set, then apply the Gram–Schmidt process to obtain an orthonormal set spanning the same subspace.
从任意线性无关集开始,然后应用 Gram-Schmidt 过程来获取张成相同子空间的正交集。
-
In practice, orthonormal bases are often chosen for numerical stability and simplicity of computation.
在实践中,通常选择正交基来实现数值稳定性和计算简单性。
Geometric Interpretation
几何解释
An orthonormal basis is like a perfectly aligned and equally scaled coordinate system. Distances and angles are computed directly using coordinates without correction factors. They are the ideal rulers of linear algebra.
正交基就像一个完美对齐且等比例缩放的坐标系。距离和角度直接使用坐标计算,无需校正因子。它们是线性代数的理想标尺。
Why this matters
为什么这很重要
Orthonormal bases simplify every aspect of linear algebra: solving systems, computing projections, expanding functions, diagonalizing symmetric matrices, and working with Fourier series. In data science, principal component analysis produces orthonormal directions capturing maximum variance.
正交基简化了线性代数的各个方面:求解系统、计算投影、展开函数、对角化对称矩阵以及处理傅里叶级数。在数据科学中,主成分分析可以生成正交方向,从而捕捉最大方差。
Exercises 7.4
练习 7.4
-
Verify that and form an orthonormal basis of .
验证 和 是否构成 的正交基。
-
Express in terms of the orthonormal basis .
用正交基 表示 。
-
Prove Parseval’s identity for with the dot product.
使用点积证明 的帕塞瓦尔恒等式。
-
Find an orthonormal basis for the plane in .
在 中找出平面 的正交基。
-
Explain why orthonormal bases are numerically more stable than arbitrary bases in computations.
解释为什么正交基在计算中比任意基在数值上更稳定。