Showing that a branching process forms a martingale Let $(X_{n,i})_{n,i \geq 1}$ be i.i.d. non-negative integer-valued random variables, and assume that $\mathrm{E}[X_{1,1}] < \infty$. We define the branching process $(Z_n)_{n \geq 0}$ as follows:
$$
Z_0 = 1,\; Z_n = \sum_{i=1}^{Z_{n-1}}X_{n,i} \text{ for } n \geq 1
$$
We then define the extinction probability $q$ as follows:
$$
q := \mathrm{P}[\exists n \geq 1 \text{ s.t. } Z_n = 0]
$$
Finally, we define $Y_n = q^{Z_n}$. I want to show that $Y_n$ is indeed a martingale.

Obviously, the easy part of this question is to show that $Y_n$ has finite expectation as $0 \leq q \leq 1$. The main issue is to show that $\mathrm{E}[Y_{n+1} \mid \sigma(Y_0,\dots,Y_n)] = Y_n$. Let $\mathcal{F}_n := \sigma(Y_0,\dots,Y_n)$, and expanding this shows that:
$$
\mathrm{E}[Y_{n+1} \mid \mathcal{F}_n] = \mathrm{E}[q^{Z_{n+1}} \mid \mathcal{F}_n] = \mathrm{E}[q^{\sum_{i=1}^{Z_{n}}X_{n+1,i}} \mid \mathcal{F}_n]
$$
I'm not sure how I should handle the $Z_n$ at the top of the summation and the $n+1$ index. For the index, I considered that since all the random variables are i.i.d., we can just replace each $X_{n+1,i}$ with $X_{n,i}'$, an identical copy of $X_n$ (not sure if this is legal).
Any help would be appreciated.

Since $X_{n+1,i}, i \leq Z_n$ are i.i.d. we get $E(s^{Z_{n+1}}|\mathcal F_n)=E(s^{\sum X_{n+1,i}}|\mathcal F_n)=\prod_{ i \leq Z_n} f(s)$ where $f$ is the generating function, namely $f(s)=E(s^{Z_1}|\mathcal F_n)$. But $f(q)=q$ so we get $E(q^{Z_{n+1}}|\mathcal F_n)=(f(q)^{z_n}=q^{z_n}$.
