跳到主要内容

東京大学 情報理工学系研究科 コンピュータ科学専攻 2021年2月実施 問題4

Author

zephyr

Description

Let nn and dd (n<dn < d) be natural numbers and R\mathbb{R} be the set of real numbers. Denote by \top the transposition operator of a vector and a matrix. Define the inner product of two column vectors x1,x2Rd\mathbf{x_1}, \mathbf{x_2} \in \mathbb{R}^d as x1x2R\mathbf{x_1}^\top \mathbf{x_2} \in \mathbb{R}. Let w=(w1,w2,,wd)Rd\mathbf{w} = (w_1, w_2, \ldots, w_d)^\top \in \mathbb{R}^d be a dd-dimensional column vector, XRn×d\mathbf{X} \in \mathbb{R}^{n \times d} an n×dn \times d matrix where XX\mathbf{X} \mathbf{X}^\top is invertible, and yRn\mathbf{y} \in \mathbb{R}^n an nn-dimensional column vector. Consider solving the following optimization problem by using the Lagrange multipliers method:

minw12w2subject toy=Xw,\min_{\mathbf{w}} \frac{1}{2} \|\mathbf{w}\|^2 \quad \text{subject to} \quad \mathbf{y} = \mathbf{Xw},

where w=w12+w22++wd2\|\mathbf{w}\| = \sqrt{w_1^2 + w_2^2 + \ldots + w_d^2}. The Lagrange function is given by

L(w,μ)=12w2+μ(yXw),L(\mathbf{w}, \boldsymbol{\mu}) = \frac{1}{2} \|\mathbf{w}\|^2 + \boldsymbol{\mu}^\top (\mathbf{y} - \mathbf{Xw}),

where μRn\boldsymbol{\mu} \in \mathbb{R}^n is the Lagrange multipliers.

Let λ1,λ2,,λn\lambda_1, \lambda_2, \ldots, \lambda_n be positive real values. The sets of column vectors {uiRn}i=1n\{\mathbf{u_i} \in \mathbb{R}^n\}_{i=1}^{n} and {vjRd}j=1d\{\mathbf{v_j} \in \mathbb{R}^d\}_{j=1}^{d} form an orthonormal basis of Rn\mathbb{R}^n and Rd\mathbb{R}^d, respectively; that is, they are all unit vectors and orthogonal to each other. Suppose that the singular value decomposition of X\mathbf{X} is

X=UΛV,\mathbf{X} = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top,

where U\mathbf{U} is an n×nn \times n matrix, Λ\mathbf{\Lambda} is an n×dn \times d matrix, and V\mathbf{V} is a d×dd \times d matrix given by

U=(u1,u2,,un),Λ=(λ100000λ200000λn00),V=(v1v2vd).\mathbf{U} = (\mathbf{u_1}, \mathbf{u_2}, \ldots, \mathbf{u_n}), \quad \mathbf{\Lambda} = \begin{pmatrix} \lambda_1 & 0 & \cdots & 0 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 & 0 & & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & \lambda_n & 0 & \cdots & 0\\ \end{pmatrix}, \quad \mathbf{V}^\top = \begin{pmatrix} \mathbf{v_1}^\top \\ \mathbf{v_2}^\top \\ \vdots \\ \mathbf{v_d}^\top \\ \end{pmatrix}.

Moreover, define

X=V(Λ)U,whereΛ=(1λ1000001λ2000001λn00).\mathbf{X^-} = \mathbf{V} (\mathbf{\Lambda}^-)^{\top} \mathbf{U}^\top, \quad \text{where} \quad \mathbf{\Lambda}^- = \begin{pmatrix} \frac{1}{\lambda_1} & 0 & \cdots & 0 & 0 & \cdots & 0 \\ 0 & \frac{1}{\lambda_2} & \cdots & 0 & 0 & & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & \frac{1}{\lambda_n} & 0 & \cdots & 0\\ \end{pmatrix}.

Answer the following questions. Describe not only an answer but also the derivation process.

(1) Express XXX\mathbf{XX^-X} using only X\mathbf{X}.

(2) Express XX\mathbf{XX^\top} using only U\mathbf{U} and λi\lambda_i (i=1,,ni = 1, \ldots, n).

(3) Suppose we wish to express the stationary points of L(w,μ)L(\mathbf{w}, \boldsymbol{\mu}) in the form of w=Ay\mathbf{w} = \mathbf{A} \mathbf{y} and μ=By\boldsymbol{\mu} = \mathbf{B} \mathbf{y}. Express the matrices ARd×n\mathbf{A} \in \mathbb{R}^{d \times n} and BRn×n\mathbf{B} \in \mathbb{R}^{n \times n} using only X\mathbf{X}.

(4) Express A\mathbf{A} in question (3) using only X\mathbf{X^-}.


nndd (n<dn < d) 为自然数,R\mathbb{R} 为实数集。记 \top 为向量和矩阵的转置算子。定义两个列向量 x1,x2Rd\mathbf{x_1}, \mathbf{x_2} \in \mathbb{R}^d 的内积为 x1x2R\mathbf{x_1}^\top \mathbf{x_2} \in \mathbb{R}。设 w=(w1,w2,,wd)Rd\mathbf{w} = (w_1, w_2, \ldots, w_d)^\top \in \mathbb{R}^d 为一个 dd 维列向量,XRn×d\mathbf{X} \in \mathbb{R}^{n \times d} 是一个 n×dn \times d 矩阵,其中 XX\mathbf{X} \mathbf{X}^\top 可逆,yRn\mathbf{y} \in \mathbb{R}^n 是一个 nn 维列向量。考虑使用拉格朗日乘子法求解以下优化问题:

minw12w2subject toy=Xw,\min_{\mathbf{w}} \frac{1}{2} \|\mathbf{w}\|^2 \quad \text{subject to} \quad \mathbf{y} = \mathbf{Xw},

其中 w=w12+w22++wd2\|\mathbf{w}\| = \sqrt{w_1^2 + w_2^2 + \ldots + w_d^2}。拉格朗日函数为

L(w,μ)=12w2+μ(yXw),L(\mathbf{w}, \boldsymbol{\mu}) = \frac{1}{2} \|\mathbf{w}\|^2 + \boldsymbol{\mu}^\top (\mathbf{y} - \mathbf{Xw}),

其中 μRn\boldsymbol{\mu} \in \mathbb{R}^n 是拉格朗日乘子。

λ1,λ2,,λn\lambda_1, \lambda_2, \ldots, \lambda_n 为正实数。列向量集合 {uiRn}i=1n\{\mathbf{u_i} \in \mathbb{R}^n\}_{i=1}^{n}{vjRd}j=1d\{\mathbf{v_j} \in \mathbb{R}^d\}_{j=1}^{d} 分别构成 Rn\mathbb{R}^nRd\mathbb{R}^d 的正交基;即它们都是单位向量且彼此正交。假设 X\mathbf{X} 的奇异值分解为

X=UΛV,\mathbf{X} = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top,

其中 U\mathbf{U} 是一个 n×nn \times n 矩阵,Λ\mathbf{\Lambda} 是一个 n×dn \times d 矩阵,V\mathbf{V} 是一个 d×dd \times d 矩阵,给出如下

U=(u1,u2,,un),Λ=(λ100000λ200000λn00),V=(v1v2vd).\mathbf{U} = (\mathbf{u_1}, \mathbf{u_2}, \ldots, \mathbf{u_n}), \quad \mathbf{\Lambda} = \begin{pmatrix} \lambda_1 & 0 & \cdots & 0 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 & 0 & & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & \lambda_n & 0 & \cdots & 0\\ \end{pmatrix}, \quad \mathbf{V}^\top = \begin{pmatrix} \mathbf{v_1}^\top \\ \mathbf{v_2}^\top \\ \vdots \\ \mathbf{v_d}^\top \\ \end{pmatrix}.

此外,定义

X=V(Λ)U,whereΛ=(1λ1000001λ2000001λn00).\mathbf{X^-} = \mathbf{V} (\mathbf{\Lambda}^-)^{\top} \mathbf{U}^\top, \quad \text{where} \quad \mathbf{\Lambda}^- = \begin{pmatrix} \frac{1}{\lambda_1} & 0 & \cdots & 0 & 0 & \cdots & 0 \\ 0 & \frac{1}{\lambda_2} & \cdots & 0 & 0 & & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & \frac{1}{\lambda_n} & 0 & \cdots & 0\\ \end{pmatrix}.

回答以下问题。描述答案的同时也要给出推导过程。

(1) 使用仅 X\mathbf{X} 表示 XXX\mathbf{XX^-X}

(2) 使用仅 U\mathbf{U}λi\lambda_i (i=1,,ni = 1, \ldots, n) 表示 XX\mathbf{XX^\top}

(3) 假设我们希望用 w=Ay\mathbf{w} = \mathbf{A} \mathbf{y}μ=By\boldsymbol{\mu} = \mathbf{B} \mathbf{y} 表示 L(w,μ)L(\mathbf{w}, \boldsymbol{\mu}) 的驻点。使用仅 X\mathbf{X} 表示矩阵 ARd×n\mathbf{A} \in \mathbb{R}^{d \times n}BRn×n\mathbf{B} \in \mathbb{R}^{n \times n}

(4) 使用仅 X\mathbf{X^-} 表示问题 (3) 中的 A\mathbf{A}

题目描述

设自然数 n<dn<dwRd\boldsymbol{w}\in\mathbb R^dXRn×dX\in\mathbb R^{n\times d}yRn\boldsymbol{y}\in\mathbb R^n,并假定 XXTXX^{\mathsf T} 可逆。用拉格朗日乘子法求解

minw12w2满足y=Xw,\min_{\boldsymbol{w}}\frac12\|\boldsymbol{w}\|^2 \quad\text{满足}\quad \boldsymbol{y}=X\boldsymbol{w},

其拉格朗日函数为

L(w,μ)=12w2+μT(yXw),μRn.L(\boldsymbol{w},\boldsymbol{\mu}) =\frac12\|\boldsymbol{w}\|^2 +\boldsymbol{\mu}^{\mathsf T} (\boldsymbol{y}-X\boldsymbol{w}), \qquad \boldsymbol{\mu}\in\mathbb R^n.

XX 的奇异值分解为 X=UΛVTX=U\Lambda V^{\mathsf T},其中 U,VU,V 的列分别构成 Rn,Rd\mathbb R^n,\mathbb R^d 的标准正交基, ΛRn×d\Lambda\in\mathbb R^{n\times d} 的前 nn 个对角元为正数 λ1,,λn\lambda_1,\ldots,\lambda_n,其余为零。将这些非零奇异值取倒数形成 Λ\Lambda^-,并定义

X=V(Λ)TUT.X^-=V(\Lambda^-)^{\mathsf T}U^{\mathsf T}.

各问除答案外还须给出推导。

(1)仅用 XX 表示 XXXXX^-X

(2)仅用 UUλi (i=1,,n)\lambda_i\ (i=1,\ldots,n) 表示 XXTXX^{\mathsf T}

(3)将 LL 的驻点写成 w=Ay\boldsymbol{w}=A\boldsymbol{y}μ=By\boldsymbol{\mu}=B\boldsymbol{y},仅用 XX 表示 ARd×nA\in\mathbb R^{d\times n}BRn×nB\in\mathbb R^{n\times n}

(4)仅用 XX^- 表示第(3)问中的 AA

Kai

(1)

Given:

X=UΛV,\mathbf{X} = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top,
X=VΛU,\mathbf{X^-} = \mathbf{V} \mathbf{\Lambda}^- \mathbf{U}^\top,

we can write:

X=V(Λ)U,\mathbf{X^-} = \mathbf{V} (\mathbf{\Lambda}^-) \mathbf{U}^\top,

where

Λ=(1λ1000001λ2000001λn00).\mathbf{\Lambda}^- = \begin{pmatrix} \frac{1}{\lambda_1} & 0 & \cdots & 0 & 0 & \cdots & 0 \\ 0 & \frac{1}{\lambda_2} & \cdots & 0 & 0 & & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & \frac{1}{\lambda_n} & 0 & \cdots & 0\\ \end{pmatrix}.

To find XXX\mathbf{XX^-X}:

XXX=(UΛV)(VΛU)(UΛV).\mathbf{XX^-X} = (\mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top)(\mathbf{V} \mathbf{\Lambda}^- \mathbf{U}^\top)(\mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top).

Notice:

VV=Id,UU=In,\mathbf{V}^\top \mathbf{V} = \mathbf{I}_d, \quad \mathbf{U}^\top \mathbf{U} = \mathbf{I}_n,

therefore:

XXX=UΛ(VV)(Λ)UUΛV=UΛ(Λ)ΛV=UΛInΛV=UΛΛV=X.\mathbf{XX^-X} = \mathbf{U} \mathbf{\Lambda} (\mathbf{V}^\top \mathbf{V}) (\mathbf{\Lambda}^-) \mathbf{U}^\top \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top = \mathbf{U} \mathbf{\Lambda} (\mathbf{\Lambda}^-) \mathbf{\Lambda} \mathbf{V}^\top = \mathbf{U} \mathbf{\Lambda} \mathbf{I}_n \mathbf{\Lambda} \mathbf{V}^\top = \mathbf{U} \mathbf{\Lambda} \mathbf{\Lambda} \mathbf{V}^\top = \mathbf{X}.

Thus,

XXX=X.\boxed{\mathbf{XX^-X} = \mathbf{X}}.

(2)

Given:

X=UΛV,\mathbf{X} = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top,

we have:

XX=(UΛV)(VΛU)=UΛΛU.\mathbf{XX^\top} = (\mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top)(\mathbf{V} \mathbf{\Lambda}^\top \mathbf{U}^\top) = \mathbf{U} \mathbf{\Lambda} \mathbf{\Lambda}^\top \mathbf{U}^\top.

Since Λ\mathbf{\Lambda} is an n×dn \times d matrix with singular values λ1,λ2,,λn\lambda_1, \lambda_2, \ldots, \lambda_n on the diagonal, ΛΛ\mathbf{\Lambda} \mathbf{\Lambda}^\top is an n×nn \times n diagonal matrix:

ΛΛ=diag(λ12,λ22,,λn2).\mathbf{\Lambda} \mathbf{\Lambda}^\top = \mathrm{diag}(\lambda_1^2, \lambda_2^2, \ldots, \lambda_n^2).

Therefore,

XX=U(λ12000λ22000000λn2)U.\mathbf{XX^\top} = \mathbf{U} \begin{pmatrix} \lambda_1^2 & 0 & \cdots & 0 \\ 0 & \lambda_2^2 & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & \lambda_n^2 \\ \end{pmatrix} \mathbf{U}^\top.

Thus,

XX=Udiag(λ12,λ22,,λn2)U.\boxed{\mathbf{XX^\top} = \mathbf{U} \mathrm{diag}(\lambda_1^2, \lambda_2^2, \ldots, \lambda_n^2) \mathbf{U}^\top}.

(3)

To solve the optimization problem using Lagrange multipliers:

L(w,μ)=12w2+μ(yXw),L(\mathbf{w}, \boldsymbol{\mu}) = \frac{1}{2} \|\mathbf{w}\|^2 + \boldsymbol{\mu}^\top (\mathbf{y} - \mathbf{Xw}),

we need to find w\mathbf{w} and μ\boldsymbol{\mu} such that:

Lw=0andLμ=0.\frac{\partial L}{\partial \mathbf{w}} = 0 \quad \text{and} \quad \frac{\partial L}{\partial \boldsymbol{\mu}} = 0.

First, compute Lw\frac{\partial L}{\partial \mathbf{w}}:

Lw=wXμ=0    w=Xμ.\frac{\partial L}{\partial \mathbf{w}} = \mathbf{w} - \mathbf{X}^\top \boldsymbol{\mu} = 0 \implies \mathbf{w} = \mathbf{X}^\top \boldsymbol{\mu}.

Next, compute Lμ\frac{\partial L}{\partial \boldsymbol{\mu}}:

Lμ=yXw=0    y=Xw.\frac{\partial L}{\partial \boldsymbol{\mu}} = \mathbf{y} - \mathbf{Xw} = 0 \implies \mathbf{y} = \mathbf{Xw}.

Substituting w=Xμ\mathbf{w} = \mathbf{X}^\top \boldsymbol{\mu} into y=Xw\mathbf{y} = \mathbf{Xw}:

y=X(Xμ)    y=(XX)μ.\mathbf{y} = \mathbf{X} (\mathbf{X}^\top \boldsymbol{\mu}) \implies \mathbf{y} = (\mathbf{X} \mathbf{X}^\top) \boldsymbol{\mu}.

Since XX\mathbf{X} \mathbf{X}^\top is invertible,

μ=(XX)1y.\boldsymbol{\mu} = (\mathbf{X} \mathbf{X}^\top)^{-1} \mathbf{y}.

Then,

w=Xμ=X(XX)1y.\mathbf{w} = \mathbf{X}^\top \boldsymbol{\mu} = \mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1} \mathbf{y}.

Therefore,

A=X(XX)1,B=(XX)1.\mathbf{A} = \mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1}, \quad \mathbf{B} = (\mathbf{X} \mathbf{X}^\top)^{-1}.

Thus,

w=X(XX)1y,μ=(XX)1y.\boxed{\mathbf{w} = \mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1} \mathbf{y}, \quad \boldsymbol{\mu} = (\mathbf{X} \mathbf{X}^\top)^{-1} \mathbf{y}}.

(4)

From question 3, we have:

A=X(XX)1.\mathbf{A} = \mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1}.

Using X\mathbf{X^-}:

X=VΛU,\mathbf{X^-} = \mathbf{V} \mathbf{\Lambda}^- \mathbf{U}^\top,

we know:

XX=UΛVVΛU=UΛΛU=UInU=In,\mathbf{X} \mathbf{X}^- = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top \mathbf{V} \mathbf{\Lambda}^- \mathbf{U}^\top = \mathbf{U} \mathbf{\Lambda} \mathbf{\Lambda}^-\mathbf{U}^\top = \mathbf{U} \mathbf{I}_n \mathbf{U}^\top = \mathbf{I}_n,

Therefore:

X(XX)1=X.\mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1} = \mathbf{X^-}.

Another way to see this is to use the given SVD of X\mathbf{X} and XX\mathbf{X}\mathbf{X}^\top from Question 2:

X=UΛV,\mathbf{X} = \mathbf{U} \mathbf{\Lambda} \mathbf{V}^\top,
XX=Udiag(λ12,λ22,,λn2)U\mathbf{X}\mathbf{X}^\top = \mathbf{U} \mathrm{diag}(\lambda_1^2, \lambda_2^2, \ldots, \lambda_n^2) \mathbf{U}^\top

Then,

A=X(XX)1\mathbf{A} = \mathbf{X}^\top (\mathbf{X} \mathbf{X}^\top)^{-1}
=VΛU(Udiag(λ12,λ22,,λn2)U)1= \mathbf{V} \mathbf{\Lambda}^\top \mathbf{U}^\top (\mathbf{U} \mathrm{diag}(\lambda_1^2, \lambda_2^2, \ldots, \lambda_n^2) \mathbf{U}^\top)^{-1}
=VΛUUdiag(λ12,λ22,,λn2)U= \mathbf{V} \mathbf{\Lambda}^\top \mathbf{U}^\top \mathbf{U} \mathrm{diag}(\lambda_1^{-2}, \lambda_2^{-2}, \ldots, \lambda_n^{-2}) \mathbf{U}^\top
=VΛdiag(λ12,λ22,,λn2)U= \mathbf{V} \mathbf{\Lambda}^\top \mathrm{diag}(\lambda_1^{-2}, \lambda_2^{-2}, \ldots, \lambda_n^{-2}) \mathbf{U}^\top
=V(λ1000λ2000000λn000000)(λ12000λ22000000λn2)U= \mathbf{V} \begin{pmatrix} \lambda_1 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & \lambda_n \\ 0 & 0 & \cdots & 0 \\ \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & 0 \end{pmatrix} \begin{pmatrix} \lambda_1^{-2} & 0 & \cdots & 0 \\ 0 & \lambda_2^{-2} & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & \lambda_n^{-2} \\ \end{pmatrix} \mathbf{U}^\top
=V(λ11000λ21000000λn1000000)U=X.= \mathbf{V} \begin{pmatrix} \lambda_1^{-1} & 0 & \cdots & 0 \\ 0 & \lambda_2^{-1} & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & \lambda_n^{-1} \\ 0 & 0 & \cdots & 0 \\ \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & 0 \end{pmatrix} \mathbf{U}^\top = \mathbf{X^-}.

Thus,

A=X.\boxed{\mathbf{A} = \mathbf{X^-}}.

Knowledge

最优化 奇异值分解 线性代数 拉格朗日乘数法

难点思路

这道题目涉及多个知识点的综合运用,特别是拉格朗日乘数法和奇异值分解的结合使用。重点在于理解矩阵运算和变换的基本性质。

解题技巧和信息

  • 拉格朗日乘数法:在求解带有约束的最优化问题时非常有用。
  • 奇异值分解:帮助简化矩阵运算,特别是对于逆矩阵和伪逆矩阵的计算。

重点词汇

  • inner product 内积
  • transpose 转置
  • Lagrange multipliers 拉格朗日乘数
  • singular value decomposition 奇异值分解
  • orthonormal basis 正交归一基

参考资料

  1. 《线性代数及其应用》David C. Lay,第四章:奇异值分解
  2. 《最优化理论》Edwin K. P. Chong and Stanislaw H. Zak,第三章:拉格朗日乘数法