In Appendix B, Theorem B.3 of Introduction to Real Analysis by Bartle & Sherbert, we have to prove the existence of a function $\phi:\mathbb{N}\rightarrow A$, where $A\subseteq\mathbb{N}$ is a non empty and infinite, such that $\phi(n+1)\gt\phi(n) \geq n \forall n \in \mathbb{N}$ and further prove that $\phi$ is bijective. In the last portion of the proof, where it is claimed that $\phi$ is surjective, we consider least element $p \in A'=A\setminus \phi(\mathbb{N})$, and we claim that $p \in \{\phi(1),\phi(2),\ldots, \phi(p) \}$. If the latter claim is false, then $p \in A\setminus\{\phi(1),\phi(2),\ldots, \phi(p) \} = A_{p} $. Till here, it is fine.
I couldn't understand what it is said further, that is $\phi(p+1)$ is the least element of $A_{p}$ and thus, $\phi(p+1)\leq p$ satisfies.
Since we are considering $A'=A\setminus \phi(\mathbb{N})$ to be non-empty, should we not consider the possibility that there might exist a number in $A_{p}$ which is less than $\phi(p+1)$ and doesn't belong to $\phi(\mathbb{N})$ i.e. $\phi(p+1)$ is not the least element of $A_{p}$.
I believe that $\phi$ is recursively defined as $\phi(1) = \min A$, and $\phi(n+1) = \min (A\setminus \{\phi(1), \ldots, \phi(n)\})$ for all $n \in \mathbb{N}$, using the well-ordering of $\mathbb{N}$.
If $p \notin \{\phi(1), \ldots, \phi(p)\}$, then $p \in A\setminus \{\phi(1), \ldots, \phi(p)\}$ so by definition $$\phi(p+1) = \min (A\setminus \{\phi(1), \ldots, \phi(p)\}) \le p$$ since the minimum of the set is $\le$ than any particular element of the set.
But this is a contradiction with the property that $\phi(n+1) > n, \forall n \in \mathbb{N}$. Hence $p \in \{\phi(1), \ldots, \phi(p)\} \subseteq \phi(\mathbb{N})$.