Section Ignore_Params.
Fixpoint ignoreParams (n m : nat) (f : naryFunc n) {struct m} :
naryFunc (m + n) :=
match m return (naryFunc (m + n)) with
| O => f
| S x => fun _ => ignoreParams n x f
end.
Definition projectionListPR (n m : nat) (p : m <= n) : PrimRecs n m.
intros.
induction m as [| m Hrecm].
exact (PRnil n).
assert (m < n).
apply lt_S_n.
apply le_lt_n_Sm.
apply p.
apply (PRcons _ m (projFunc _ _ H)).
apply Hrecm.
apply le_S_n.
apply le_S.
apply p.
Defined.
Definition projectionList (n m : nat) (p : m <= n) :
Vector.t (naryFunc n) m := evalPrimRecs n m (projectionListPR n m p).
End Ignore_Params.
Definition switchPR : naryFunc 3.
simpl in |- *.
intros.
destruct H as [| n].
apply H1.
apply H0.
Defined.
(* Returns smallest value of x below b such that (P b x).  Otherwise returns b*)
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.
Definition boundedSearch (P : naryRel 2) (b : nat) : nat :=
boundedSearchHelp (P b) b.

Lemma boundedSearch2 :
forall (P : naryRel 2) (b : nat),
boundedSearch P b = b \/ P b (boundedSearch P b) = true.