(************************************************************************)

Fixpoint below_form (a : form) (i : Int) {struct a} : Prop :=
  match a with
  | Falsum => True
  | Atom j => Less j i
  | AndF a0 a1 => below_form a0 i /\ below_form a1 i
  | OrF a0 a1 => below_form a0 i /\ below_form a1 i
  | Imp a0 a1 => below_form a0 i /\ below_form a1 i
  end.Definition below_list (L : flist) (i : Int) :=
  forall a : form, In a L -> below_form a i.

(* Specifications: *)
Lemma below_form_less_below_form : forall (a : form) (i j : Int), below_form a i -> Less i j -> below_form a j.
Lemma below_list_less_below_list : forall (l : flist) (i j : Int), below_list l i -> Less i j -> below_list l j.
Lemma below_cons_list_head : forall (a : form) (l : flist) (i : Int), below_list (a :: l) i -> below_form a i.
Lemma below_cons_list_tail : forall (a : form) (l : flist) (i : Int), below_list (a :: l) i -> below_list l i.
Lemma below_cons_list : forall (a : form) (l : flist) (i : Int), below_form a i -> below_list l i -> below_list (a :: l) i.
Lemma below_list_weak : forall (l : flist) (a b : form) (i : Int), (below_form a i -> below_form b i) -> below_list (a :: l) i -> below_list (b :: l) i.
Lemma below_list_weak2 : forall (l : flist) (a b c : form) (i : Int), (below_form a i -> below_form b i /\ below_form c i) -> below_list (a :: l) i -> below_list (b :: c :: l) i.
Lemma subst_form_below : forall (i : Int) (g a : form), below_form a i -> subst_form i g a = a.
Lemma subst_list_below : forall (i : Int) (g : form) (l : flist), below_list l i -> subst_list i g l = l.
Lemma below_vimp : forall (j : Int) (l : list Int) (a b : form), (forall j : Int, below_form a j -> below_form b j) -> below_form (vimp l a) j -> below_form (vimp l b) j.
Lemma below_vimp2 : forall (j : Int) (l : list Int) (a b c : form), (forall j : Int, below_form a j -> below_form b j -> below_form c j) -> below_form (vimp l a) j -> below_form (vimp l b) j -> below_form (vimp l c) j.
Lemma below_vimp_head : forall (j : Int) (l : list Int) (a : form), below_form (vimp l a) j -> below_form a j.
Lemma below_vimp_split : forall (j : Int) (l : list Int) (a : form), (forall i : Int, In i l -> Less i j) -> below_form a j -> below_form (vimp l a) j.
Lemma below_vimp_tail : forall (j : Int) (l : list Int) (a : form), below_form (vimp l a) j -> forall i : Int, In i l -> Less i j.
Lemma subst_vimp_head : forall (j : Int) (a : form) (l : list Int) (b : form), (forall i : Int, In i l -> Less i j) -> subst_form j a (vimp l b) = vimp l (subst_form j a b).
Lemma max_int_of_form : forall a : form, {j : Int | below_form a j}.
Lemma max_int_of_list : forall Gamma : flist, {j : Int | below_list Gamma j}.