Consider stochastic matrix $P$, it means that the sum of elements in row is equal $1$. Matrix $P$ is function of $p\in\left(0,1\right)$, it means that $$P=\begin{pmatrix}f_1(p) & f_2(p) & f_3(p)\\ g_1(p) & g_2(p) & g_3(p) \\ h_1(p) & h_2(p) & h_3(p) \end{pmatrix},$$ where $\sum\limits_{i=1}^{3}f_i(p)=\sum\limits_{i=1}^{3}g_i(p)=\sum\limits_{i=1}^{3}h_i(p)=1$ $\forall p\in\left(0,1\right)$ and $f_i(p)$, $g_i(p)$, $h_i(p)$ are polynomials $\forall i=1,2,3$.
My task is to show that elements of vector $\left(\pi_1,\pi_2,\pi_3\right)$, which satisfy $$\left(\pi_1,\pi_2,\pi_3\right)\cdot P=\left(\pi_1,\pi_2,\pi_3\right),$$ are racional function consisted from elements of matrix $P$. Moreover $\sum\limits_{i=1}^{3}\pi_i=1 $.
I think that it is clear because the elements of matrix $P$ are polynomials and we just multiply vector $\left(\pi_1,\pi_2,\pi_3\right)$ with matrix $P$ and trying to solve linear system of equations. The solution is therefore some product and proportion of these polynomials.
But some formal proof is expected of me. Do you think that it can be proved some more formal without computing exactly what the elements of vector $\left(\pi_1,\pi_2,\pi_3\right)$ equal (because for future it should be prove for bigger matrix $P$).
Any help will be appreciated. Thank you very much.
When you ask about properties of "the" probability vector" $\pi$ solving $\pi=\pi P$ you are in effect assuming that there is a unique probability vector $\pi$. This need not hold: if $P$ is the identity matrix there are multiple $\pi$. When you introduce the parameter $p$, and ask for the properties of the solution $\pi(p)$ to $\pi(p)=\pi(p)P(p)$, the problem persists. For example, if $P(p)$ equals the identity matrix, for all $p$, then the matrix entries of $P(p)$ are polynomials in $p$, but the choice $$\pi(p)=\begin{cases}(1,0,0,\ldots,0)&p \text{ rational}\\(0,1,0,\ldots,0)&p \text{ irrational}\end{cases}$$ is a counterexample to what is asked for.
Hint: If you add the hypothesis that for each $p$, the equation $\pi = \pi P(p)$ has a unique probability vector solution $\pi=\pi(p)$, then you can make an argument, with these ingredients: (1) the system of linear equations in the components of $x=(x_1,\ldots,x_n)$ implied by $xP(p)=x$ and $\sum_i x_i=1$ is of full rank, and (2) if $A$ is of full rank, the solution $x$ of $Ax=b$ is rational in the entries of $A$ and $b$. Here Cramer's rule is useful.