The sub spaces I found are $W_1 = span\{(1,0,2)\}$ $W_2 = span\{(1,1,0),(0,0,1)\}$ and the projections are $P_1 (x,y,z)= \{(x-y,0,2x-2y)\}$ and $P_2 (x,y,z)= \{(y,y,z-x+y)\}$
I am having trouble finding these $g_i (x)$ polynomials such that $P_i = g_i (T)$.
My guess is that I need to define some polynomial and show that the requirement is satisfied, however, I don't know where to start.
Edit: The sub spaces are T-invariant