I am confronted with the assertion that the following expression describes the conditional:
$\text{Cond}\left[ t, f, g \right] = \text{Pr} \left[pr^2_1, pr^4_2 \right] \circ(f,g,t)$.
This is meant to be equivalent to this:
$\text{cond}(f,g,t) = \cases{f\quad \text{if}\ t = 0\\g \quad \text{else}}$
Well, first of all, composing $Pr$ with $f, g, t$ is not the same as applying it to $f, g, t$ as arguments, right? So, if $Pr$ takes 3 arguments, then what are these, if not $f, g, t$?
Secondly, there needs to be some variable $y \in \mathbb{N}$ to be decremented during the recursion that needs to be passed as an argument. If $f, g, t$ are all functions, where is $y$ coming from?
Lastly I don't know how I have to interpret the composition of $Pr$ with $f, g, t$... what would the resulting expression look like?
So, how is the primitive recursive conditional expression to be understood?
Edit
Following the explanation in the answer, I still have an issue with this. I tried doing an example by hand but immediately get stuck:
The program computes if (x == 1) then s x else p x
$cond[t,f,g] = Pr[pr^2_1, pr^4_2] \circ (f, g, t)$
Let
$f = s$ the sucessor function
$g = p$ the predecessor function
$t = \cases{x \mapsto 0 \quad if\ x = 1\\ x \mapsto 1 \quad else} $
$ \begin{aligned} &cond[t,f,g]\ (3) &= \quad &(Pr[pr^2_1, pr^4_2] \circ (f, g, t))\ (3)\\ & &= \quad &pr^4_2\ ??? \end{aligned} $
My issue now is the following:
by composition I would now apply $f, g, t$ to $x = 3$.
So I would end up with
$ \begin{aligned} &cond[t,f,g]\ (3) &= \quad &(Pr[pr^2_1, pr^4_2] \circ (f, g, t))\ (3)\\ & &= \quad &pr^4_2\ (f(3), g(3), t(3)-1, cond(f(3), g(3), t(3)-1)\\ &\text{which is equal to:}&&\\ & &= \quad &pr^4_2\ (s\ 3, p\ 3, 0, cond(s\ 3, p\ 3, 0)\\ &\dots \end{aligned} $
Somehow this feels incorrect... is there something wrong here?
Apparently your source defines $\operatorname{Pr}$ with a different ordering of the inputs from the one to which I’m accustomed. It appears that if $h=\operatorname{Pr}\left(\operatorname{pr}_1^2,\operatorname{pr}_2^4\right)$, then $h$ is the ternary function such that
$$\begin{align*} h(x_1,x_2,0)&=\operatorname{pr}_1^2(x_1,x_2)=x_1\\ h(x_1,x_2,y+1)&=\operatorname{pr}_2^4\big(x_1,x_2,y,h(x_1,x_2,y)\big)=x_2\;. \end{align*}$$
Clearly this amounts to saying that
$$h(x_1,x_2,y)=\begin{cases} x_1,&\text{if }y=0\\ x_2,&\text{otherwise}\;. \end{cases}$$
Now assume that $f,g$, and $t$ are $m$-ary functions for some $m\in\Bbb N$, and for convenience write $\vec x$ for $\langle x_1,x_2,\ldots,x_m\rangle$. Then
$$\begin{align*} \big(h\circ(f,g,t)\big)(x_1,\ldots,x_m)&=h\big(f(\vec x),g(\vec x),t(\vec x)\big)\\\\ &=\begin{cases} f(\vec x),&\text{if }t(\vec x)=0\\ g(\vec x),&\text{otherwise}\;. \end{cases} \end{align*}$$
Added: It would be easier to follow the example in the edit if you simplified the notation, but it looks fine. Using my abbreviation, it’s simply this:
$$\begin{align*} h\big(f(3),g(3),t(3)\big)&=h(4,2,1)\\ &=\operatorname{pr}_2^4\big(4,2,0,h(4,2,0)\big)\\ &=2 \end{align*}$$
This is clearly the correct value of the conditional when $x=3$. If you’re worried by the presence of $h(4,2,0)$ in the penultimate line, note that it doesn’t actually matter what that fourth operand is, since $\operatorname{pr}_2^4$ always ignores it anyway.