Two ways of defining rank of a set I am studying set theory, and I have some difficulties in understanding how people define the notion of rank there (I hope, specialists in logic will excuse me for this). 
As far as I understand, there are two equivalent ways of defining rank of a set:


*

*Krzysztof Ciesielski in his book Set Theory for the Working
Mathematician defines rank by the formula 
$$
\text{rank}(X)=\min\{A\in\text{Ordinal numbers}: \ X\in V_{A+1}\},
$$ 
where $V_A$ is what is called cumulative hierarchy.

*J.Donald Monk in his Introduction to Set Theory defines rank by the formula
$$
\text{rank}(X)=\min\{A\in\text{Ordinal numbers}: \ \forall Y\in X\quad \text{rank}(Y)< A\}.
$$
There is no problem for me with the first definition, but I don't understand the second one. 
J.D.Monk writes that his definition is justified by the  

General recursion principle: each function $F:V\to V$ (where $V$ is the class of all sets) defines a unique function $G:V\to V$ by the formula
  $$
G(X)=F(G\big|_X),\qquad X\in V
$$ 
  (here $G\big|_X$ is the restriction of $G$ on $X$; I simplify a bit Monk's Theorem 13.1).

The problem for me is that I don't understand, which function $F:V\to V$ in these terms defines rank. I would think that Monk has in mind the function
$$
F(H)=\min\{A\in\text{Ordinal numbers}: \ \text{Range}(H)\subseteq A\}.
$$
But this function is not defined for all $H\in V$, only for those $H$ which have range in the class of all ordinals (I wrote this in one of my previous questions, here).  
I suppose, there must be a standard trick, that people use here, but I don't know it. Can anybody clarify me this? 
 A: Just define $$F(H)=\min\{A\in\text{Ordinal numbers}: \ \text{Range}(H)\subseteq A\}$$
if $H$ is a function and every value of $H$ is an ordinal number, and $F(H)=\emptyset$ otherwise.  By the general recursion principle, you then get a function $G$, and you can prove by $\in$-induction that $G(X)$ is an ordinal for all $X$ and so $G(X)$ is actually always given by the first case in the definition of $F$.
A: Long comment
We have to verify the conditions of Th.13.1.
1) The relation $\in$ is well–founded. and 
2) The field of $\in$ is $V$ and, for all $x \in V$ (i.e.$x \in Fld (\in)$): $\{ y : y∈x \}$ is a set.
Now we have to define the function $F$ with domain $Fld (\in) \times V$, i.e. $V \times V$ such that:

$$F(x,u) = \min(\{ \alpha \in OR : u(y) < \alpha, \text { for each }y \in x \})$$

if $u$ is a function whose range is contained in $OR$ and $y = \emptyset$ otherwise.
Then, by recursion, there is a unique function $G$ such that $Dom(G) = Fld(\in)=V$ and for all $x \in V$, 
$$Gx = F(x,G|_{\{ y : y \in x \}})$$ 
$$ρ(x) = \min(\{ \alpha : \rho(y) < \alpha, \text { for each } y \in x \}).$$
