document.write( "Question 1201735: Let X be the design matrix of a linear regression problem with m rows (samples) and d columns (variables/features). Let y∈R^m be the response vector corresponding the samples in X. Recall that for some vector space V⊆R^d the orthogonal complement of V is: V^⊥:={x∈R^d∣⟨x,v⟩=0∀v∈V} \r
\n" ); document.write( "\n" ); document.write( "1. Prove that: Ker(X)=Ker(X^⊤X) \r
\n" ); document.write( "\n" ); document.write( "2. Prove that for a square matrix A:Im(A^⊤)=Ker(A)^⊥
\n" ); document.write( "
\n" ); document.write( "3. Let y=Xw be a non-homogeneous system of linear equations. Assume that X is square and not invertible. Show that the system has ∞ solutions ⇔y⊥Ker(X^⊤). \r
\n" ); document.write( "\n" ); document.write( "4. Consider the (normal) linear system X^⊤Xw=X^⊤y. Using what you have proved above prove that the normal equations can only have a unique solution (if X^⊤X is invertible) or infinitely many solutions (otherwise).\r
\n" ); document.write( "\n" ); document.write( "Please help me to solve question 3 and 4.
\n" ); document.write( "

Algebra.Com's Answer #848017 by asinus(45)\"\" \"About 
You can put this solution on YOUR website!
Let's tackle each part of the problem step by step.\r
\n" ); document.write( "\n" ); document.write( "### 1. Prove that $ \text{Ker}(X) = \text{Ker}(X^TX) $\r
\n" ); document.write( "\n" ); document.write( "**Proof:**\r
\n" ); document.write( "\n" ); document.write( "- Let $ v \in \text{Ker}(X) $. Then, by definition, $ Xv = 0 $.
\n" ); document.write( "- Multiplying both sides by $ X^T $, we have:
\n" ); document.write( " $$
\n" ); document.write( " X^TXv = X^T0 = 0
\n" ); document.write( " $$
\n" ); document.write( " Thus, $ v \in \text{Ker}(X^TX) $.\r
\n" ); document.write( "\n" ); document.write( "- Now, let $ v \in \text{Ker}(X^TX) $. Then $ X^TXv = 0 $.
\n" ); document.write( "- This implies $ \langle Xv, Xv \rangle = 0 $ (since $ \langle a, a \rangle = 0 $ if and only if $ a = 0 $).
\n" ); document.write( "- Therefore, $ Xv = 0 $, which means $ v \in \text{Ker}(X) $.\r
\n" ); document.write( "\n" ); document.write( "Combining both parts, we conclude:
\n" ); document.write( "$$
\n" ); document.write( "\text{Ker}(X) = \text{Ker}(X^TX)
\n" ); document.write( "$$\r
\n" ); document.write( "\n" ); document.write( "### 2. Prove that for a square matrix $ A $: $ \text{Im}(A^T) = \text{Ker}(A)^\perp $\r
\n" ); document.write( "\n" ); document.write( "**Proof:**\r
\n" ); document.write( "\n" ); document.write( "- Let $ v \in \text{Im}(A^T) $. Then there exists some $ u $ such that $ v = A^Tu $.
\n" ); document.write( "- For any $ w \in \text{Ker}(A) $, we have $ Aw = 0 $.
\n" ); document.write( "- Thus, $ \langle v, w \rangle = \langle A^Tu, w \rangle = \langle u, Aw \rangle = \langle u, 0 \rangle = 0 $.
\n" ); document.write( "- This shows that $ v \in \text{Ker}(A)^\perp $.\r
\n" ); document.write( "\n" ); document.write( "- Now, let $ v \in \text{Ker}(A)^\perp $. We need to show $ v \in \text{Im}(A^T) $.
\n" ); document.write( "- By the definition of orthogonal complement, $ \langle v, w \rangle = 0 $ for all $ w \in \text{Ker}(A) $.
\n" ); document.write( "- The rank-nullity theorem states that $ \text{dim}(\text{Im}(A)) + \text{dim}(\text{Ker}(A)) = d $.
\n" ); document.write( "- Since $ A $ is square, $ \text{Im}(A^T) $ has dimension equal to $ \text{dim}(\text{Ker}(A)) $.
\n" ); document.write( "- Therefore, $ \text{Im}(A^T) = \text{Ker}(A)^\perp $.\r
\n" ); document.write( "\n" ); document.write( "### 3. Show that the system $ y = Xw $ has $ \infty $ solutions $ \Leftrightarrow y \perp \text{Ker}(X^T) $\r
\n" ); document.write( "\n" ); document.write( "**Proof:**\r
\n" ); document.write( "\n" ); document.write( "- If $ y \perp \text{Ker}(X^T) $, then for any $ v \in \text{Ker}(X^T) $, we have $ \langle y, v \rangle = 0 $.
\n" ); document.write( "- This means that $ y $ can be expressed as $ y = Xw + v $ for some $ w $ and $ v \in \text{Ker}(X^T) $.
\n" ); document.write( "- Since $ v $ can take infinitely many values in $ \text{Ker}(X^T) $, there are infinitely many $ w $ that satisfy $ y = Xw $.\r
\n" ); document.write( "\n" ); document.write( "- Conversely, if the system has infinitely many solutions, then there exists a non-zero $ v \in \text{Ker}(X^T) $ such that $ y = Xw + v $.
\n" ); document.write( "- This implies $ y \perp \text{Ker}(X^T) $.\r
\n" ); document.write( "\n" ); document.write( "Thus, we conclude:
\n" ); document.write( "$$
\n" ); document.write( "y \perp \text{Ker}(X^T) \Leftrightarrow \text{the system has } \infty \text{ solutions}
\n" ); document.write( "$$\r
\n" ); document.write( "\n" ); document.write( "### 4. Prove that the normal equations $ X^TXw = X^Ty $ can only have a unique solution (if $ X^TX $ is invertible) or infinitely many solutions (otherwise)\r
\n" ); document.write( "\n" ); document.write( "**Proof:**\r
\n" ); document.write( "\n" ); document.write( "- If $ X^TX $ is invertible, then the normal equations have a unique solution given by:
\n" ); document.write( " $$
\n" ); document.write( " w = (X^TX)^{-1}X^Ty
\n" ); document.write( " $$\r
\n" ); document.write( "\n" ); document.write( "- If $ X^TX $ is not invertible, then $ \text{Ker}(X^TX) \neq \{0\} $. From part 1, we know:
\n" ); document.write( " $$
\n" ); document.write( " \text{Ker}(X^TX) = \text{Ker}(X)
\n" ); document.write( " $$
\n" ); document.write( "- If $ y \perp \text{Ker}(X^T) $, then the system has infinitely many solutions, as shown in part 3.\r
\n" ); document.write( "\n" ); document.write( "Thus, we conclude:
\n" ); document.write( "- The normal equations have a unique solution if $ X^TX $ is invertible.
\n" ); document.write( "- They have infinitely many solutions if $ X^TX $ is not invertible.\r
\n" ); document.write( "\n" ); document.write( "This completes the proof for all parts.
\n" ); document.write( "
\n" );