Section subAllCloseFrom.
Fixpoint closeFrom (a n : nat) (f : fol.Formula L) {struct n} :
fol.Formula L :=
match n with
| O => f
| S m => fol.forallH L (a + m) (closeFrom a m f)
end.
Opaque le_lt_dec.
End subAllCloseFrom.

Lemma subAllSubFormula :
forall (T : fol.System L) (A : fol.Formula L) (v : nat)
(s : fol.Term L) (map : nat -> fol.Term L),
folProof.SysPrf L T
(fol.iffH L (subAllFormula (substituteFormula L A v s) map)
(subAllFormula A
(fun x : nat =>
match eq_nat_dec v x with
| left _ => subAllTerm s map
| right _ => map x
end))).