[step:Prove $R$-recursion by the same attempt construction]
[claim:$R$-Recursion]
Let $G$ be a function-class defined on all sets. Then there exists a unique function-class $F$ such that
\begin{align*}
F(x) = G(F|_{R,\, x}) \quad \text{for all sets } x,
\end{align*}
where $F|_{R,\, x} := \{(y, F(y)) : y \mathrel{R} x\}$.
[/claim]
[proof]
The proof parallels the $\in$-Recursion Theorem verbatim, with three substitutions:
**Substitution 1: $F|_{R,\, x}$ is a set.** For fixed $x$, the collection $\{y : y \mathrel{R} x\}$ is a set by locality. Replacement applied to this set and the function-class $y \mapsto (y, F(y))$ yields the set $F|_{R,\, x}$. Hence $G(F|_{R,\, x})$ is well-defined.
**Substitution 2: attempts have $R$-closed domains.** Call $f$ an **$R$-attempt** if $\operatorname{dom} f$ is a set closed under $R$-predecessors (meaning: $y \in \operatorname{dom} f$ and $z \mathrel{R} y$ imply $z \in \operatorname{dom} f$) and $f(y) = G(f|_{R,\, y})$ for every $y \in \operatorname{dom} f$. The role previously played by transitive domains is now played by $R$-closed domains.
**Substitution 3: arguments use $R$-induction and $TC_R$ in place of $\in$-induction and $TC$.**
*Agreement of attempts.* If $f$ and $f'$ are $R$-attempts, then $f(y) = f'(y)$ for every $y \in \operatorname{dom} f \cap \operatorname{dom} f'$. By $R$-induction (previous claim): fix $y$ and assume $f(z) = f'(z)$ for every $z \mathrel{R} y$ with $z \in \operatorname{dom} f \cap \operatorname{dom} f'$. If $y \in \operatorname{dom} f \cap \operatorname{dom} f'$, then by $R$-closure every $z \mathrel{R} y$ lies in both domains, so the inductive hypothesis gives $f|_{R,\, y} = f'|_{R,\, y}$, and hence
\begin{align*}
f(y) = G(f|_{R,\, y}) = G(f'|_{R,\, y}) = f'(y).
\end{align*}
*Existence of attempts.* By $R$-induction: fix $x$ and assume for each $y \mathrel{R} x$ there is an $R$-attempt $f_y$ with $y \in \operatorname{dom} f_y$. For each $y \mathrel{R} x$, let $g_y := f_y|_{TC_R(\{y\})}$. The set $TC_R(\{y\})$ is $R$-closed and a set by the first step, so $g_y$ is an $R$-attempt. By agreement, the union
\begin{align*}
f := \bigcup_{y \mathrel{R} x} g_y
\end{align*}
is a well-defined function with $R$-closed domain $TC_R(\{y : y \mathrel{R} x\})$. The extension
\begin{align*}
f' := f \cup \{(x, G(f|_{R,\, x}))\}
\end{align*}
has domain $\operatorname{dom} f \cup \{x\}$, which is $R$-closed (the $R$-predecessors of $x$ are exactly the indices $y$, which lie in $\operatorname{dom} f$), and satisfies the recursion equation everywhere, including at $x$ itself. Hence $f'$ is an $R$-attempt with $x \in \operatorname{dom} f'$.
*Definition of $F$ and uniqueness.* Define $F(x)$ to be the common value $f(x)$ over all $R$-attempts $f$ with $x \in \operatorname{dom} f$; this is well-defined by agreement and total by existence. Uniqueness of $F$ follows by $R$-induction: if $F_1$ and $F_2$ both satisfy the recursion, then $F_1(y) = F_2(y)$ for every $y \mathrel{R} x$ implies $F_1|_{R,\, x} = F_2|_{R,\, x}$, hence $F_1(x) = F_2(x)$. $\square$
[/proof]
[/step]