Proof of positive semi-definiteness of hat matrix product

Consider the matrices $$B = \begin{bmatrix}1 &0\\-1&1\\0&1\end{bmatrix}$$, $$Y = \begin{bmatrix}x_1&0 & 0\\0&x_2&0\\0&0&x_3 \end{bmatrix}$$, $$\tilde{B} = YB$$ and $$T = \begin{bmatrix}d&0 & 0\\0&1&0\\0&0&1 \end{bmatrix}$$ as well as the vector $$P^T = \begin{bmatrix}x_1&x_2&x_3\end{bmatrix}$$. Moreover, $$H = \tilde{B} (\tilde{B}^T\tilde{B})^{-1}\tilde{B}^T$$ is the known hat matrix and $$x_1, x_2, x_3$$ are all positive values and $$d$$ is a scalar $$d \geq 1$$.

B can be decomposed into a block matrix of the form $$B = \begin{bmatrix}1 &\begin{bmatrix}0\end{bmatrix}\\\begin{bmatrix}C_h\end{bmatrix}& \begin{bmatrix}M_h\end{bmatrix}\end{bmatrix}$$ where the entries of column $$C_h$$ are always negative or zero and the entries of matrix (or vector for the particular case of B having two columns)$$M_h$$ are always positive. Accordingly, one can decompose $$P^T$$ as $$P^T = \begin{bmatrix}x_1& \begin{bmatrix} x_h\end{bmatrix}\end{bmatrix}$$ where $$\begin{bmatrix} x_h\end{bmatrix}$$ is vector $$P^T$$ without the first entry. In the same way, $$\begin{bmatrix} Y_h\end{bmatrix}$$ is equal to $$Y$$ without the first row an column.

Then, $$x_1$$ is related with $$x_2, x_3 ...$$ through $$x_1 = \sqrt{-x_h \cdot \begin{bmatrix}Y_h\end{bmatrix}\begin{bmatrix}C_h\end{bmatrix}}$$.

Is it possible to prove that the scalar $$M = P^T T H P \geq 0$$ ?

I have developed the algebraic expression of M and it is possible to prove for the present case that $$M\geq 0$$ but I am interested in finding a more general and elegant method.

Is it possible to prove $$M = P^T T H P \geq 0$$ for a general full rank matrix B $$\in\mathbb R^{m\times n}$$ and matrices $$Y, B, T$$ and $$P$$ of compatible dimensions but with the same restrictions on the values of $$Y$$ and $$P$$?

EDIT 1: Clarified what I mean by in general.

EDIT 2: Extra constraints.

It is wrong in general. Taking $$B=\begin{bmatrix}3\\-2\end{bmatrix}$$, $$Y=\begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}$$ and $$T=\begin{bmatrix}2 & 0 \\ 0 & 1\end{bmatrix}$$ we have $$H=\frac12 \begin{bmatrix}1 & -1 \\ -1 & 1\end{bmatrix}$$ and with $$P=\begin{bmatrix}2 & 3\end{bmatrix}$$ we get for the product: $$P T H P^t=-1/2$$.

• Thank you for your answer. Maybe I was not clean enough but there has to be an agreement between Y and P, meaning that $x_1, x_2, x_3$ are the same values for both matrices. In your case if $P = [2, 3]$ then Y cannot be identity and is $Y = \begin{bmatrix}2&0 \\0&3 \end{bmatrix}$. If that is the case then $M = \frac{5}{13}$ May 16, 2020 at 10:01
• OK, I didn't get that point at first. I think, however, you may use the Y you mention and simply for B then take [1/2 // -1/3] to get the counterexample? May 16, 2020 at 11:17
• You're right. Indeed it does not represent all the physical constraints in my problem and like this, the statement is not true. In my problem $x_1$ is related to $x_2 etc..$ through an additional constraint that I edited in the main question. May 16, 2020 at 18:02
• This gets a little bit out of hand... In general I think that there is little reason to believe that the product of two positive (so also s.a.) but non-commuting operators stay positive. May 16, 2020 at 20:30
• Indeed it gets out of hand. And yes, I was not hopeful at all that it would be the case. But the point is that this is inside a method I use all the time and it always works (to my surprise). Hence the reason why I'm motivated to prove it. Either way, thank you for your help! May 16, 2020 at 21:08