Section CPair_projections.
Let searchXY (a : nat) :=
boundedSearch (fun a y : nat => ltBool a (sumToN (S y))) a.
Definition cPairPi1 (a : nat) := a - sumToN (searchXY a).
Definition cPairPi2 (a : nat) := searchXY a - cPairPi1 a.

Lemma cPairProjectionsHelp :
forall a b : nat, b < sumToN (S a) -> sumToN a <= b -> searchXY b = a.