Require Export Coq.Lists.List.
Require Vector.
Definition codeLength : nat -> nat :=
evalStrongRec 0
(fun n Hrecs : nat =>
switchPR n (S (codeNth (n - S (cPairPi2 (pred n))) Hrecs)) 0).

Lemma codeInIsPR : isPR 2 codeIn.
Definition codeNoDup : nat -> nat :=
evalStrongRec 0
(fun l recs : nat =>
switchPR l
(switchPR
(codeIn (cPairPi1 (pred l))
(codeNth (l - S (cPairPi2 (pred l))) recs))
(codeNth (l - S (cPairPi2 (pred l))) recs)
(S
(cPair (cPairPi1 (pred l))
(codeNth (l - S (cPairPi2 (pred l))) recs)))) 0).