$\def\soe#1{\left\{\begin{align*}#1\end{align*}\right.}$ I had see a proof, which used Cut-Off Subtraction is primitive recursive to show $\max(n,m)$ is primitive recursive on ProofWiki.
My question
Is it correct to simply say $$\max(n_1,n_2)=\soe{P_1^2(n_1,n_2)~~\text{if $n_2\le n_1$}\\P_2^2(n_1,n_2)~~\text{if $n_1\le n_2$}}$$ The $P_i^k$ here is the projection function which is primitive recursive, so in both cases, the $\max(n_1,n_2)$ is primitive recursive.
Could someone verify this proof?
That argument does not obtain $\max$ from the basic primitive recursive functions using only composition and primitive recursion. To make it legitimate, you would first have to prove that definition by primitive recursive cases is primitive recursive, modify your definition to make the cases disjoint, and prove that the relations defining the cases are primitive recursive.