Definition max_var_nformulae (l : list (NFormula Z)) :=
List.fold_left  (fun acc f => Pos.max acc (max_var xH (fst f))) l xH.
Section MaxVar.
Definition F (acc : positive) (f : Pol Z * Op1) := Pos.max acc (max_var 1 (fst f)).

(* Specifications: *)
Lemma max_var_nformulae_mono_aux :
forall l v acc,
(v <= acc ->
v <= fold_left F l acc)%positive.
Lemma max_var_nformulae_mono_aux' :
forall l acc acc',
(acc <= acc' ->
fold_left F l acc <= fold_left F l acc')%positive.
Lemma max_var_nformulae_correct_aux : forall l p o v,
In (p,o) l -> In v (vars xH p) -> Pos.le v (fold_left F l 1)%positive.