For n by n matrices X,Y,P, if $\forall P \succ 0, \langle X,P \rangle = \langle Y,P \rangle$, does $X=Y$, where the inner product is the Forbenius inner product?
This question arises from some optimization work I'm doing and in the case of my question $Y=X^{T}$. Since all positive definite matrices are not a subspace, we cannot really pick a basis. I tried to use some special matrix P to isolate elements of X but it doesn't go really well. Maybe we can do something with the trace?
My original question is about when X and Y are not necessarily symmetric. In that case, X does not have to be Y (as described in the first comment), so what if we require X and Y to be symmetric?
Here is a perspective on this problem that you might find helpful. If we let $M = X - Y$, then the following statements are equivalent: $$ \forall P \succ 0, \langle X,P\rangle = \langle Y,P\rangle\\ \forall P \succ 0, \langle X,P\rangle - \langle Y,P\rangle = 0\\ \forall P \succ 0, \langle X-Y,P\rangle = 0\\ \forall P \succ 0, \langle M,P\rangle = 0. $$ Thus, the question amounts to the following: for a matrix $M$, does $\langle M,P \rangle = 0$ for all $M$ imply that $M = 0$ (or, what can we say about $M$ under this condition)?
As the comments on your question reflect, it is not necessarily the case that $M = 0$. This is because the set of positive definite matrices does not span the space of all matrices, it spans only the set of the symmetric matrices. That is, $$ \operatorname{span}\{P:P \succ 0\} = \{A:A = A^T\} =: \mathcal S. $$ The fact that $\langle M,P \rangle = 0$ tells us that $M$ is within the orthogonal complement of this span. That is, $M \in \mathcal S^\perp$. As it turns out, this implies that $M^T = -M$, which is to say that $M$ is skew-symmetric.
To reframe things in terms of the original question $\langle X,P \rangle = \langle Y,P\rangle$ will hold for all positive definite $P$ if and only if the matrix $X-Y$ is skew-symmetric.