(* Returns smallest value of x below b such that (P b x).  Otherwise returns b*)
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.