Updating priors Let $y_1, y_2$ be two independent random samples from $f(y|\theta)$, where $\theta$ has prior $\pi(\theta)$. Consider two possible situations: 1. we observe $y_1$ first, update the pror to $\pi(\theta|y_1)$, then observe $y_2$ and update the distribution again; 2. we observe both $y_1, y_2$ simultaneously and update the prior in one step. Show that we obtain the same posterior distribution of $\theta$ in both cases.
My working out:
The posterior distribution is given as the following $$\pi(\theta|y) = \frac{f(y|\theta)\pi(\theta)}{f(y)}$$
Such that  $f(y)$ is the marginal density of Y
$$f(y) = \int_{-\infty}^{\infty} f(y|\theta)\pi(\theta)d\theta$$
So by updating the prior I presume what is meant is the following:
$$\pi(\theta|y_1) = \frac{f(y_1|\theta)\pi(\theta)}{f(y_1)}$$
For the first observation, and
$$\pi(\theta|y_2) = \frac{f(y_2|\theta)\pi(\theta)}{f(y_2)}$$
For the second observation. However, how do I actually update the prior given the two?
As for the second question, I presume it goes something like this $$\pi(\theta|y_1, y_2) = \frac{f(y_1,y_2|\theta)\pi(\theta)}{f(y_1,y_2)}$$
 A: Updating the prior with $y_1$ gives
$$\pi(\theta \mid y_1) = \frac{f(y_1 \mid \theta) \pi(\theta)}{\int_{\theta'} f(y_1 \mid \theta') \pi(\theta') \, d\theta'}.$$
Updating this again with $y_2$ means using the same formula for the posterior distribution, but using $\pi(\theta \mid y_1)$ as the prior instead of $\pi(\theta)$. Because $y_2$ and $y_1$ are conditionally independent given $\theta$, the first term remains $f(y_2 \mid \theta)$.
$$\pi(\theta \mid y_2, y_1) = \frac{f(y_2 \mid \theta) \pi(\theta \mid y_1)}{\int_{\theta'} f(y_2 \mid \theta') \pi(\theta' \mid y_1) \, d\theta'}
= \frac{f(y_2 \mid \theta) f(y_1 \mid \theta) \pi(\theta)}{\int_{\theta'} f(y_2 \mid \theta') f(y_1 \mid \theta') \pi(\theta') \, d\theta'}.$$
The second step is obtained by plugging in the expression for $\pi(\theta \mid y_1)$ from above.

If updating with both observations at the same time, we immediately have
$$\pi(\theta \mid y_1, y_2) = \frac{f(y_1 \mid \theta) f(y_2 \mid \theta) \pi(\theta)}{\int_{\theta'} f(y_1 \mid \theta') f(y_2 \mid \theta') \pi(\theta') \, d\theta'}.$$
Again, we use the fact that $y_1$ and $y_2$ are conditionally independent given $\theta$.
