Definition codeApp : nat -> nat -> nat :=
  evalStrongRec 1
    (fun n Hrecs p1 : nat =>
     switchPR n
       (S
          (cPair (cPairPi1 (pred n))
             (codeNth (n - S (cPairPi2 (pred n))) Hrecs))) p1).

(* Specifications: *)
Lemma codeAppCorrect : forall l1 l2 : list nat, codeApp (codeList l1) (codeList l2) = codeList (l1 ++ l2).
Lemma codeAppIsPR : isPR 2 codeApp.