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

Lemma codeArityLNTFIsCorrect1 : forall f : Functions LNT, codeArityLNTF (codeLNTFunction f) = S (arity LNT (inr _ f)).