(Used to ask: How to check whether a population density obeys replicator dynamics, but now I think I found a proof that the answer is that it does, except if some species have density zero).
Say we have a probability vector or population density $p = (p_1,...,p_n)$ with $p_i \geq 0$ and $\sum_i p_i =1$. Also assume we know the functions $g=(g_1,...,g_n)$ such that:
$$p_i(t+1) = g_i(p(t))$$
where $t$ is a discrete time index. Assume we want to know whether $g$ implements a discrete time replicator equation. I.e. whether there is a function $f=(f_1,...,f_n)$, called the fitness landscape, such that:
$$p_i(t+1)= \frac{f_i(p(t))}{\langle f \rangle_{p(t)}} p_i(t).$$
where $\langle f \rangle_{p(t)}:=\sum_j p_j(t) f_j(p(t))$ is the average fitness of the population density.
I'll now present the argument why the answer is yes at least as long as $p_i > 0$ for all $i$ and not just $p_i \geq 0$.
Since the left hand sides of the two equations are equal we get:
$$g_i(p(t)) = \frac{f_i(p(t))}{\langle f \rangle_{p(t)}} p_i(t).$$
Let's drop the time dependence since it is irrelevant here:
$$g_i(p) = \frac{f_i(p)}{\langle f \rangle_{p}} p_i$$
and solve for $f_i(p)$:
$$f_i(p) = \langle f \rangle_{p} \frac{g_i(p)}{p_i}$$
where we divided by $p_i$ so this only works if $p_i>0$. So, if for any $p$ such that there exists $j$ with $p_j=0$ we have $g_i(p)>0$ for some $i$ then we cannot write $g(p)$ as a replicator equation. Else, we are basically done. To verify the solution let's start from the replicator equation and plug in the above:
\begin{align} \frac{f_i(p)}{\langle f \rangle_{p}} p_i &= \frac{f_i(p)}{\sum_j p_j f_j(p)} p_i \\ &=\frac{\langle f \rangle_{p} \frac{g_i(p)}{p_i}}{\sum_j p_j \langle f \rangle_{p} \frac{g_j(p)}{p_j}} p_i \\ &=\frac{\langle f \rangle_{p} \, g_i(p)}{\langle f \rangle_{p} \sum_j g_j(p)}\\ &=\frac{g_i(p)}{\sum_j g_j(p)}\\ &=g_i(p). \end{align} where we used $\sum_j g_j(p)=1$ since $p(t+1)$ is again normalized (probability or population) vector by assumption. We note that the expectation value $\langle f \rangle_{p}$ drops out so that we can choose it freely when constructing the fitness e.g. $\langle f \rangle_{p}:=1$.
Is there a mistake in here or is the replicator dynamic really that general? Basically any deterministic evolution of a probability (including any Markov chain) that maps probabilities that are zero to zero has a fitness function such that it implements replicator dynamics?