Definition codeLength : nat -> nat :=
  evalStrongRec 0
    (fun n Hrecs : nat =>
     switchPR n (S (codeNth (n - S (cPairPi2 (pred n))) Hrecs)) 0).

(* Specifications: *)
Lemma codeLengthCorrect : forall l : list nat, codeLength (codeList l) = length l.
Lemma codeLengthIsPR : isPR 1 codeLength.