Definition codeArityLNTF (f : nat) :=
  switchPR f
    (switchPR (pred f)
       (switchPR (pred (pred f)) (switchPR (pred (pred (pred f))) 0 1) 2) 3)
    3.

(* Specifications: *)
Lemma codeArityLNTFIsPR : isPR 1 codeArityLNTF.
Lemma codeArityLNTFIsCorrect1 : forall f : Functions LNT, codeArityLNTF (codeLNTFunction f) = S (arity LNT (inr _ f)).
Lemma codeArityLNNFIsCorrect1 : forall f : Functions LNN, codeArityLNTF (codeLNTFunction f) = S (arity LNN (inr _ f)).
Lemma codeArityLNTFIsCorrect2 : forall n : nat, codeArityLNTF n <> 0 -> exists f : Functions LNT, codeLNTFunction f = n.
Lemma codeArityLNNFIsCorrect2 : forall n : nat, codeArityLNTF n <> 0 -> exists f : Functions LNN, codeLNTFunction f = n.