Definition switchPR : naryFunc 3.
simpl in |- *.
intros.
destruct H as [| n].
apply H1.
apply H0.
Defined.

Lemma switchIsPR : isPR 3 switchPR.
Fixpoint boundedSearchHelp (P : naryRel 1) (b : nat) {struct b} : nat :=
match b with
| O => 0
| S b' =>
match eq_nat_dec (boundedSearchHelp P b') b' with
| left _ => match P b' with
| true => b'
| false => S b'
end
| right _ => boundedSearchHelp P b'
end
end.