Scalar Transpose
1. First, let's state the problem: We want to understand why the scalar $y^T X w$ equals its transpose $(X w)^T y$.
2. Note that $y^T$ is a row vector, $X$ is a matrix, and $w$ is a column vector, so the product $X w$ is a column vector.
3. The expression $y^T X w$ is a scalar because it results from multiplying a $1 \times n$ matrix ($y^T$) by an $n \times m$ matrix ($X$) then by an $m \times 1$ vector ($w$), giving a $1 \times 1$ matrix (a scalar).
4. The transpose of a scalar (a $1 \times 1$ matrix) is itself, so:
$$y^T X w = (y^T X w)^T$$
5. Using the property of transpose of a product:
$$(ABC)^T = C^T B^T A^T$$
we have
$$(y^T X w)^T = w^T X^T (y^T)^T$$
6. Since $(y^T)^T = y$, the expression becomes:
$$w^T X^T y$$
7. Observing that $w^T X^T y = (X w)^T y$ because:
$$(X w)^T = w^T X^T$$
8. Therefore, we conclude:
$$y^T X w = (X w)^T y$$
This equality shows that the scalar $y^T X w$ is equal to the transpose expression $(X w)^T y$, demonstrating the symmetry of scalars under transpose.
Final answer: $$y^T X w = (X w)^T y$$