Theorems II.3.7 and II.3.9 in Simpson's Subsystems of Second-Order Arithmetic appear to be circular. Specifically, theorem II.3.7 seems to make implicit use of theorem II.3.9.
[Theorem II.3.9 is the principle of bounded $\Sigma_1$ comprehension. That is, if $n$ is some fixed number and $Q[n]$ is a $\Sigma_1$ formula, the class $\{i\colon i < n\wedge Q[i]\}$ is a set.]
II.3.7 states that for any $\Sigma_1$ formula $P[i]$, either the set $\{i\colon P[i]\}$ exists and is finite, or else there is a one-to-one function $f$ for which $\forall n\colon P[n] \leftrightarrow \exists m\colon f(m) = n$. The proof proceeds by assuming that the set $\{i\colon P[i]\}$ is not finite and constructing an appropriate function $f$. It is left implicit that if the function $f$ does not exist, then the set $\{i\colon P[i]\}$ must be finite (and in fact this argument is used in the proof of II.3.9).
My problem is that we never actually show that the set $\{i\colon P[i]\}$ exists. The proof of II.3.7 uses the assumption that there is no upper bound on the $i$'s for which $P[i]$ is true to construct the function $f$. So if $f$ does not exist, I can accept that there is a largest $i$ for which $P[i]$ holds. I accept that if $\{i\colon P[i]\}$ were already known to be a set, that it would be finite. But I don't accept that $\{i\colon P[i]\}$ is a set. True, we know that it must be bounded, but we have not yet proven the bounded comprehension principle, so boundedness does not yet imply set existence.
It is even worse if you try to prove II.3.9 directly by writing out all the steps from II.3.7 in-line. If you do this, you start by assuming that the set $\{i: i < n\wedge Q[i]\}$ (for a $\Sigma_1$ formula $Q[i]$) is infinite. But this function can be used to derive a contradiction, from which you conclude that the set $\{i < n\wedge Q[i]\}$ is finite. But there's a missing step: all we've shown is that there is an upper bound on the numbers $i$ for which $i < n \wedge Q[i]$ holds (but we already had a bound--$n$ itself!). We have not yet shown that $\{i < n\wedge Q[i]\}$ is a set.
Am I missing something?
Gro-Tsen figured it out in the comments. I was missing something, but Simpson's proof is missing something, too, specifically the explicit discussion about $j_\hbox{max}$. The bound on $Y$ provides not only a bound on $X$ but also a bound for the existential quantifier. A correct version of II.3.7 follows:
Let $R[j,i]$ be a $\Sigma_0$ formula. Consider the set $Y = \{(j,i)\colon R[j,i]\wedge \neg(\exists k<j\colon R[k,i])\}$. It is either finite or infinite. If it is infinite, then follow Simpson's original proof to construct the one-to-one function $f$. Otherwise $Y$ is finite and there must be bounds $i_\hbox{max}$ and $j_\hbox{max}$ for which $(i,j)\in Y$ implies $i\leq i_\hbox{max}$ and $j\leq j_\hbox{max}$. Discard $i_\hbox{max}$ as irrelevant, and then observe that $\forall i\colon(\exists j\colon R[j,i])\leftrightarrow(\exists j\leq j_\hbox{max}\colon R[j,i])$.
Now by $\Sigma_0$ comprehension the set $X = \{i\colon (\exists j\leq j_\hbox{max}\colon R[j,i])\}$ must exist, and the previous paragraph shows that it can be rewritten as $X=\{i\colon (\exists j\colon R[j,i])\} = \{i\colon P[i]\}$, where $P[i]$ is $\Sigma_1$. QED.
[Somewhat obnoxiously, the bound $j_\hbox{max}$ is not in general computable. The set $X$ is recursive only because it is finite, and every finite set can be recognized by some Turing machine. There's just no way to determine, in general, which Turing machine to use.]