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).

Lemma codeNoDupCorrect : forall l : list nat, codeNoDup (codeList l) = codeList (no_dup _ eq_nat_dec l).