set
(l :=
checkPrfAXM
:: checkPrfMP
:: checkPrfGEN
:: checkPrfIMP1
:: checkPrfIMP2
:: checkPrfCP
:: checkPrfFA1
:: checkPrfFA2
:: checkPrfFA3
:: checkPrfEQ1
:: checkPrfEQ2
:: checkPrfEQ3
:: checkPrfEQ4 :: checkPrfEQ5 :: nil)
in *.
assert
(forall (l : list (nat -> nat -> nat)) (n : nat),
list_rect (fun _ => Set) unit
(fun (a : nat -> nat -> nat) _ (rec : Set) => (isPR 2 a * rec)%type) l ->
isPR 2 (f l n)).
intro.
induction l0 as [| a l0 Hrecl0].
simpl in |- *.
intros.
apply filter10IsPR with (g := fun _ : nat => 0).
apply const1_NIsPR.
simpl in |- *.
intros.
apply
compose2_3IsPR
with (f1 := fun p recs : nat => iterate pred n (cPairPi1 (cPairPi2 p))).
apply
filter10IsPR
with (g := fun p : nat => iterate pred n (cPairPi1 (cPairPi2 p))).
apply compose1_1IsPR with (f := fun p : nat => cPairPi1 (cPairPi2 p)).
apply compose1_1IsPR.
apply cPairPi2IsPR.
apply cPairPi1IsPR.
apply iterateIsPR.
apply predIsPR.
apply Hrecl0.
eapply snd.
apply H.
eapply fst.
apply H.
apply switchIsPR.
assert (isPR 2 (f l 0)).
apply H.
simpl in |- *.
repeat split.
apply checkPrfAXMIsPR.
apply checkPrfMPIsPR.
apply checkPrfGENIsPR.
apply checkPrfIMP1IsPR.
apply checkPrfIMP2IsPR.
apply checkPrfCPIsPR.
apply checkPrfFA1IsPR.
apply checkPrfFA2IsPR.
apply checkPrfFA3IsPR.
apply checkPrfEQ1IsPR.
apply checkPrfEQ2IsPR.
apply checkPrfEQ3IsPR.
apply checkPrfEQ4IsPR.
apply checkPrfEQ5IsPR.
unfold checkPrfHelp in |- *.
apply evalStrongRecIsPR.
apply H0.
Qed.
Definition checkPrf (f p : nat) : nat :=
switchPR (wellFormedFormula f) (checkPrfHelp (cPair f p)) 0.

Lemma checkPrfCorrect1 :
forall (l : list Formula) (f : Formula) (p : Prf l f),
checkPrf (codeFormula L codeF codeR f) (codePrf L codeF codeR l f p) =
S (codeList (map (codeFormula L codeF codeR) l)).