Consider a symmetric and positive semidefinite matrix $A \in \mathbb{R}^{n \times n}$ Assume additionally that there exists no vector $x \in \mathbb{R}^n \setminus \{ 0 \}$ which satisfies $x^T A y = 0$ for all $y \in \mathbb{R}^n$. Prove that $A$ is positive definite.
My attempt:
Since $A$ is psd, for any $\bf z\in\mathbb{R}^n\setminus\{0\}$ we have $\bf z^{T}A\bf z\ge0$. Now according to the question $\not\exists\bf x\in\mathbb R^n\setminus\{0\}$ such that $\bf x^{T}A\bf y=0$ for all $\bf y\in\mathbb R^n$. In particular, if we take $\bf y=\bf z$, then $\bf z^{T}A\bf z\ne0$, but since $A$ is psd $\bf z^{T}A\bf z\ge0$. This implies $\bf z^{T}A\bf z >0$. Thus $A$ is positive definite.
Is this proof correct? If not where is the flaw?
Thank you.
As stated in the comments, your proof does not work. However, the result is true. Indeed, if $A$ was merely positive semidefinite and not positive definite, then there would have to be some nonzero vector $x$ such that $x^t A x = 0$. Now by the spectral theorem, there is some orthogonal matrix $B$ such that $A = BDB^t$ for $D$ diagonal. Now let $y = B^{-1}x = B^t x \neq 0$. $x^t A x = 0$ implies that $(By)^t (BDB^t) (By) = 0$. This left hand side is equal to $y^t B^tBDB^tBy = y^t D y$. Let $y^t = (y_1, \dots, y_n)$. Then $0 = y^t D y = \sum D_{ii} y_i^2$. As $A$ is positive semi-definite $D$ is as well, so all the $D_{ii} \geq 0$. Indeed, if $D_{ii} < 0$ then $e_i^t D e_i < 0$, a contradiction. Thus, each $D_{ii} y_i^2 \geq 0$ and their sum is zero, so each $D_{ii} y_i^2 = 0$. Now, $y \neq 0$ so some $y_j \neq 0$. Thus, that corresponding $D_{jj} = 0$. In other words, $e_j$ is an eigenvector of $D$ of eigenvalue $0$. $ABe_j = B D e_j = 0$, so $0 \neq Be_j$ is an eigenvector of $A$ of eigenvalue $0$. Now, let $z \in \mathbb R^n$ and we shall compute $(B e_j)^t A z$. Indeed, as $A$ is symmetric this is $(Be_j)^t A^t z = (ABe_j)^t z = 0$. But $z$ was chosen arbitrarily and as $B$ is orthogonal, $B e_j \neq 0$. We assumed that no such nonzero vector would exist, so $A$ must have been positive definite.