Section LNN.
Variable T : System.
Hypothesis TextendsNN : Included _ NN T.
Variable U : fol.System L.
Variable fU : Formula.
Variable v0 : nat.
Hypothesis freeVarfU : forall v : nat, In v (freeVarFormula LNN fU) -> v = v0.
Hypothesis
expressU1 :
forall f : fol.Formula L,
mem _ U f ->
SysPrf T
(substituteFormula LNN fU v0 (natToTerm (codeFormula L codeF codeR f))).
Hypothesis
expressU2 :
forall f : fol.Formula L,
~ mem _ U f ->
SysPrf T
(notH
(substituteFormula LNN fU v0
(natToTerm (codeFormula L codeF codeR f)))).
Definition codeSysPrf : Formula :=
let nv := newVar (2 :: 1 :: 0 :: v0 :: nil) in
existH nv
(andH
(substituteFormula LNN
(substituteFormula LNN
(primRecFormula 2
(proj1_sig
(checkPrfIsPR L codeF codeR codeArityF codeArityR
codeArityFIsPR codeArityRIsPR))) 0
(Succ (var nv))) 2 (var 0))
(forallH (S nv)
(impH (LT (var (S nv)) (var nv))
(orH
(substituteFormula LNN
(substituteFormula LNN
(substituteFormula LNN
(primRecFormula 2 (proj1_sig codeInIsPR)) 2
(var (S nv))) 1 (var nv)) 0 Zero)
(substituteFormula LNN fU v0 (var (S nv))))))).

Lemma codeSysPrfCorrect2 :
forall (f : fol.Formula L) (A : fol.Formulas L),
(exists g : fol.Formula L, In g A /\ ~ mem _ U g) ->
forall p : Prf L A f,
SysPrf T
(notH
(substituteFormula LNN
(substituteFormula LNN codeSysPrf 0
(natToTerm (codeFormula L codeF codeR f))) 1
(natToTerm (codePrf L codeF codeR A f p)))).