I am trying to get acquainted with the arithmetical hierarchy, and as I wrote down some examples, I got a bit confused.
Consider the language $L=\{+\cdot,<,=,0,1\}$ of $\mathsf{PA}$.
For example, the sentence $\phi:=\forall x\,\exists y\,(y<x\wedge x=y+1)$ is a $\Pi_{1}$-sentence because it is of the form $\forall x\,\theta$, where $\theta = \exists y\,(y<x\wedge x=y+1)$ is a formula having only bounded quantifiers.
On the other hand, in the sentence $\psi:=\forall x\,\exists y\,(x=y+1)$, the formula $(x=y+1)$ has no bounded quantifiers. Hence, what type of formula is $\psi$? How are formulas with no bounded quantifiers classified? In this case, $\theta$ and $\exists y\,(x=y+1)$ are logically equivalent.
What about the sentence $\forall x\,(x=x)$? Is it $\Pi_{0}$? If so, what about $(x=x)$?
A final example: Goodstein's Theorem (where the sequence is defined recursively starting with $x$ in hereditary base $2$, bumping the base by $1$ and subtracting $1$ from the result) can be expressed as the sentence $G:=\forall x\,\exists y\,(g_{y}(x) = 0)$, where $g_{y}(x)$ denotes the $y^{th}$ term of the Goodstein sequence starting at $x$. I have read that $G$ is a $\Pi_{2}$-sentence. But the formula $(g_{y}(x) = 0)$ does not have bounded quantifiers. Is it equivalent to a formula having only bounded quantifiers?
These examples describe the nature of my confusion. Any guidance will be appreciated.
Edit: As far as I can tell now, there are several approaches to defining the arithmetic hierarchy. At least three. This and this do a good job of exhibiting different approaches and hashing out the details and how they may be linked (e.g. Post's Theorem). Differences occur at the bottom level $\Sigma_{0}=\Pi_{0}=\Delta_{0}$. But crucially all approaches agree as one moves up the hierarchy.
Some references with various points of view:
Rogers, H. jun., Theory of recursive functions and effective computability, Maidenhead, Berksh.: McGraw-Hill Publishing Company, Ltd. 512 p. (1967). ZBL0183.01401. (See Ch. 14.1 & 14.7)
Avigad, Jeremy, Mathematical logic and computation, Cambridge: Cambridge University Press (ISBN 978-1-108-47875-5/hbk; 978-1-108-77875-6/ebook). xii, 513 p. (2023). ZBL1524.03001. (See Ch. 10.2)
Simpson, Stephen G., Subsystems of second order arithmetic, Perspectives in Mathematical Logic. Berlin: Springer. xiv, 444 p. (1999). ZBL0909.03048. (See Ch. I.7 - Definition I.7.8)
Schwichtenberg, Helmut; Wainer, Stanley S., Proofs and computations, Perspectives in Logic. Cambridge: Cambridge University Press; Urbana, IL: Association for Symbolic Logic (ASL) (ISBN 978-0-521-51769-0/hbk; 978-1-139-03190-5/ebook). xiii, 465 p. (2012). ZBL1294.03006. (See Ch. 2.6, 3.1 & the definition on p.151)
"Only bounded quantifiers" should be understood as "all quantifiers are bounded", so a formula with no quantifiers at all would qualify vacuously as having "only bounded quantifiers".
So $x = y+1$ would have "only bounded quantifiers". It is $\Pi_0$ (and $\Sigma_0$).
Thus $\theta := \exists y (x = y + 1)$ would be $\Sigma_1$.
Now, in the logically equivalent formula $\theta' := \exists y\,(y<x\wedge x=y+1)$, the quantifier on $y$ is bounded. Thus $\theta'$ is $\Sigma_0$ (and $\Pi_0$).
Since $\theta$ and $\theta'$ are logically equivalent, then $\theta$ is also $\Sigma_0$ and $\Pi_0$.
Usually we are interested in the least $n$ which classifies a formula as either $\Sigma_n$ or $\Pi_n$.