Problem: Let $f:\mathbb{R}^n \rightarrow \mathbb{R}$ be defined by $f(x) = x \cdot M x$, where $M$ is a positive definite symmetric matrix. Let $A_1, A_2$ be two distinct affine subspaces of $\mathbb{R}^n$, $y \in A_1 \cap A_2$, and $x_1, x_2$ minimize $f$ over $A_1, A_2$ respectively. Prove that $y \cdot M(x_1 - x_2) = 0$.
Attempt: We know that since $x_1,x_2$ minimize $f$ over $A_1,A_2$ respectively, $\nabla f(x_1) \cdot (y - x_1) = 0$, and $\nabla f(x_2) \cdot (y - x_2) = 0$ by necessary condition of minimizer on arbitrary sets of $\mathbb{R}^n$. This in turn means $y \cdot Mx_1 = x_1 \cdot M x_1$, and $y \cdot Mx_2 = x_2 \cdot M x_2$. These are nice results and seem useful, but I cannot see how $y \cdot M (x_1 - x_2) = min_{A_1}f - min_{A_2}f$ could lead to the desired result. Any help is appreciated!