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.

Lemma subAllCloseFrom :
forall (n : nat) (m : nat -> fol.Term L) (f : fol.Formula L)
(T : fol.System L),
folProof.SysPrf L T (closeFrom 0 n f) ->
folProof.SysPrf L T
(subAllFormula f
(fun x : nat =>
match le_lt_dec n x with
| left _ => fol.var L x
| right _ => m x
end)).