(* File: Search.v  (last edited on 27/10/2000) (c) Klaus Weich  *)


Require Export Rules.
Require Export Weight.

Definition vlist := list (list Int * form).

Fixpoint vlist2list (gamma : vlist) : flist :=
  match gamma with
  | nil => fnil
  | (l, a) :: gamma => vimp l a :: vlist2list gamma
  end.

Fixpoint vlist2hlist (gamma : vlist) : flist :=
  match gamma with
  | nil => fnil
  | (l, a) :: gamma => a :: vlist2hlist gamma
  end.



Definition search_atom_invariant (n : nat) :=
  forall (goal : Int) (gamma : vlist) (work : nf_list) 
    (context : flist) (j : Int),
  weight_gamma (vlist2hlist gamma) < n ->
  search_spec (Atom goal) (vlist2list gamma) work context j.


Lemma search_atom_aux : forall n : nat, search_atom_invariant n.
(* Goal: forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j *)
intros n; elim n; clear n.
(* n=0 *)
(* Goal: search_atom_invariant (S n) *)
unfold search_atom_invariant in |- *.
(* Goal: forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) O), search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (_ : forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) (S n)), search_spec goal gamma work context j *)
intros goal gamma work context j lt_weight.
(* Goal: search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (_ : forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) (S n)), search_spec goal gamma work context j *)
elimtype False.
(* Goal: False *)
(* Goal: forall (n : nat) (_ : search_atom_invariant n), search_atom_invariant (S n) *)
apply (lt_n_O (weight_gamma (vlist2hlist gamma))); assumption.

(* n>0 *)
(* Goal: forall (n : nat) (_ : search_atom_invariant n), search_atom_invariant (S n) *)
intros n ih.
(* Goal: search_atom_invariant (S n) *)
unfold search_atom_invariant in |- *.
(* Goal: forall (goal : form) (gamma : flist), search_spec goal gamma *)
intros goal gamma.
(* Goal: forall (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist gamma)) (S n)), search_spec (Atom goal) (vlist2list gamma) work context j *)
case gamma; clear gamma.

(* gamma=nil *)
(* Goal: forall (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@nil (prod (list Int) form)))) (S n)), search_spec (Atom goal) (vlist2list (@nil (prod (list Int) form))) work context j *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros work context j lt_weight.
(* Goal: search_spec (Atom goal) (vlist2list (@nil (prod (list Int) form))) work context j *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
unfold search_spec in |- *.
(* Goal: forall (_ : below_form (Atom goal) j) (_ : below_list (vlist2list (@nil (prod (list Int) form))) j) (_ : below_list context j) (_ : sound (vlist2list (@nil (prod (list Int) form))) work context) (_ : minimal (vlist2list (@nil (prod (list Int) form))) work context), search_spec_aux (Atom goal) (vlist2list (@nil (prod (list Int) form))) work context *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros below_goal below_gamma below_context sound minimal.
(* Goal: search_spec_aux (Atom goal) (vlist2list (@nil (prod (list Int) form))) work context *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
elim (nsearch goal work context).
(* Goal: forall _ : Derivable gamma goal, search_spec goal gamma *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_gamma gamma nf_nil k) (_ : forall _ : forces_t k goal, False), search_spec goal gamma *)
(* Goal: below_form goal j *)
(* Goal: below_list gamma j *)
(* Goal: below_list gamma j *)
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
intros der; apply derivable; assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma work DNil NNil AI_Nil ANil k) (_ : forall _ : forces_t k (Atom goal), False), search_spec_aux (Atom goal) (vlist2list (@nil (prod (list Int) form))) work context *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros k k_is_mon k_forces_ngamma k_notforces_goal.
(* Goal: search_spec goal gamma *)
(* Goal: below_form goal j *)
(* Goal: below_list gamma j *)
(* Goal: below_list gamma j *)
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
apply refutable with k; try assumption.
(* Goal: forces_gamma (vlist2list (@nil (prod (list Int) form))) work k *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
unfold forces_gamma in |- *.
(* Goal: forall (a : form) (_ : in_gamma gamma nf_nil a), Derivable gamma a *)
(* Goal: minimal gamma nf_nil gamma *)
intros a in_a.
(* Goal: Derivable gamma a *)
(* Goal: minimal gamma nf_nil gamma *)
elim in_a; clear in_a a.
(* Goal: forall (n : nat) (a : form) (_ : my_nth form n (vlist2list (@nil (prod (list Int) form))) a), forces_t k a *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), forces_t k (nf2form a) *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros m a nth; inversion_clear nth.
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), forces_t k (nf2form a) *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros m a nth.
(* Goal: forces_t k (nf2form a) *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
apply k_forces_ngamma.
(* Goal: in_ngamma work DNil NNil AI_Nil ANil a *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
apply In_Work with m; assumption.
(* side premisses: Elim (nsearch goal work context).  *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), Derivable context (nf2form a) *)
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros m a nth; apply sound; apply In_Work1 with m; assumption.
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forall (b : normal_form) (_ : @In normal_form b work), forces_t k (nf2form b)) (_ : @In form a context), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros a k k_is_mon k_forces_work in_a.
(* Goal: forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
apply minimal; try assumption.
(* Goal: forces_gamma (vlist2list (@nil (prod (list Int) form))) work k *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
unfold forces_gamma in |- *.
(* Goal: forall (a : form) (_ : in_gamma (vlist2list (@nil (prod (list Int) form))) work a), forces_t k a *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros c in_c.
(* Goal: forces_t k c *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
elim in_c; clear in_c c.
(* Goal: forall (n : nat) (a : form) (_ : my_nth form n (vlist2list (@nil (prod (list Int) form))) a), forces_t k a *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), forces_t k (nf2form a) *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros m c nth; inversion_clear nth.
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n work a), forces_t k (nf2form a) *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros m c nth.
(* Goal: forces_t k (nf2form c) *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
apply k_forces_work.
(* Goal: @In normal_form c work *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
apply nth_in with m; assumption.

(* gamma=(cons a gamma) *)
(* Goal: forall (p : prod (list Int) form) (l : list (prod (list Int) form)) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) p l))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) p l)) work context j *)
intros a gamma work context j.

(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp a b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp a b) c)) (vlist2list gamma)) work context j *)
case a; clear a.
(* Goal: forall (l : list Int) (f : form) (_ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form l f) gamma))) (S n)), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) (@pair (list Int) form l f) gamma)) work context j *)
intros l a.
(* Goal: forall _ : lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form l a) gamma))) (S n), search_spec (Atom goal) (vlist2list (@cons (prod (list Int) form) (@pair (list Int) form l a) gamma)) work context j *)
generalize l; clear l.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: forall (l : list Int) (_ : lt (Nat.add (weight a) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l a) (vlist2list gamma)) work context j *)
elim a; clear a.

(* a=Falsum *)
(* Goal: forall (l : list Int) (_ : lt (Nat.add (weight Falsum) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l Falsum) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (l : list Int) (_ : lt (Nat.add (weight (Atom i)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Atom i)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (AndF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (AndF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros l lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l Falsum) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (l : list Int) (_ : lt (Nat.add (weight (Atom i)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Atom i)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (AndF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (AndF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
simpl in |- *; apply rule_shift_gamma_work with (a := NFalsum).
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.

(* a=(Atom i) *)
(* Goal: forall (i : Int) (l : list Int) (_ : lt (Nat.add (weight (Atom i)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Atom i)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (AndF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (AndF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros i l lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Atom i)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (AndF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (AndF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NAtom i).
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.

(* a=(AndF a b) *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (AndF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (AndF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros a ih_a b ih_b l lt_weight.
(* Goal: forall _ : lt (Nat.add (weight (OrF a b)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (OrF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
clear ih_a ih_b.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 l) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
case l; clear l.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@nil Int)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@cons Int i l)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_conj_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@nil Int) a) (@cons form (vimp (@nil Int) b) (vlist2list gamma))) work context j *)
(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i l) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (nil, a) :: (nil, b) :: gamma).
(* Goal: lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) a) (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) b) gamma)))) n *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
simpl in |- *; apply weight_gamma_weak2' with (AndF a b); try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i l) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros i1 l.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 l) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
case l; clear l.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@nil Int)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@cons Int i l)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_conj_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@nil Int)) a) (@cons form (vimp (@cons Int i1 (@nil Int)) b) (vlist2list gamma))) work context j *)
(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@cons Int i l)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (i1 :: nil, a) :: (i1 :: nil, b) :: gamma).
(* Goal: lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) a) (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) b) gamma)))) n *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
simpl in |- *; apply weight_gamma_weak2' with (AndF a b); try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* Goal: forall (i : Int) (l : list Int), search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@cons Int i l)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros i2 l.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i1 (@cons Int i2 l)) (AndF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_conj_gamma_new with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int j (@nil Int)) a) (@cons form (vimp (@cons Int j (@nil Int)) b) (vlist2list gamma))) (@cons normal_form (nvimp (@cons Int i1 (@cons Int i2 l)) (NAtom j)) work) (@cons form (vimp (@cons Int i1 (@cons Int i2 l)) (Atom j)) (@cons form (Imp (Atom j) (AndF a b)) context)) j1 *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, a) :: (j :: nil, b) :: gamma).
(* Goal: lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) a) (@cons (prod (list Int) form) (@pair (list Int) form (@cons Int j (@nil Int)) b) gamma)))) n *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
simpl in |- *; apply weight_gamma_weak2' with (AndF a b); try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.


(* --------- a=(OrF a b)  ---------- *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (OrF f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF f f0)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros a ih_a b ih_b l.
(* Goal: forall _ : lt (Nat.add (weight (OrF a b)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (OrF a b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
clear ih_a ih_b.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp a b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp a b) c)) (vlist2list gamma)) work context j *)
case a; clear a.
(* a=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF Falsum b)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_falsum_or_a_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l b) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, b) :: gamma).
(* Goal: lt (weight_gamma (vlist2hlist (@cons (prod (list Int) form) (@pair (list Int) form l b) gamma))) n *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
simpl in |- *; apply weight_gamma_weak' with (OrF Falsum b); try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* a=(Atom i0) *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros i0. 
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp (Atom i0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
case b; clear b.
(* b=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) Falsum)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i0) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_a_or_falsum_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Atom i0)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i0) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, Atom i0) :: gamma).
apply
 (weight_gamma_weak' (Atom i0) (OrF (Atom i0) Falsum) (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* b=(Atom i1) *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (OrF (Atom i0) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros i1 lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Atom i1))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NDisj i0 i1).
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply my_lt_weak.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* b=(AndF b0 b1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp b0 b1))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_atom_or_a_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (Imp (Atom j) (AndF b0 b1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NDisj i0 j)) work) (@cons form (vimp l (OrF (Atom i0) (Atom j))) (@cons form (Imp (Atom j) (AndF b0 b1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, AndF b0 b1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
simpl in |- *; apply lt_S_n; assumption.
(* b=(OrF b0 b1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp b0 b1))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_atom_or_a_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (Imp (Atom j) (OrF b0 b1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NDisj i0 j)) work) (@cons form (vimp l (OrF (Atom i0) (Atom j))) (@cons form (Imp (Atom j) (OrF b0 b1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Atom i0) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, OrF b0 b1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
simpl in |- *; apply lt_S_n; assumption.
(* b=(Imp b0 b1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Atom i0) (Imp b0 b1))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_atom_or_a_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (Imp (Atom j) (Imp b0 b1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NDisj i0 j)) work) (@cons form (vimp l (OrF (Atom i0) (Atom j))) (@cons form (Imp (Atom j) (Imp b0 b1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (AndF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (AndF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (OrF f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (OrF f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (OrF (Imp f f0) b)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (OrF (Imp f f0) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, Imp b0 b1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
simpl in |- *; apply lt_S_n; assumption.
(* a=(AndF a0 a0) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Imp a0 a1) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_a_or_b_gamma with j1; try assumption.
apply
 ih with (gamma := (l, OrF (Atom j) b) :: (j :: nil, AndF a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (OrF (Atom j) b) (AndF a0 a1) 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (OrF (AndF a0 a1) b) (vlist2hlist gamma)); try assumption.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
simpl in |- *; apply lt_n_Sn.
(* a=(OrF a0 a1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Imp a0 a1) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_a_or_b_gamma with j1; try assumption.
apply
 ih with (gamma := (l, OrF (Atom j) b) :: (j :: nil, OrF a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (OrF (Atom j) b) (OrF a0 a1) 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (OrF (OrF a0 a1) b) (vlist2hlist gamma)); try assumption.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
simpl in |- *; apply lt_n_Sn.
(* a=(Imp a0 a1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (OrF (Imp a0 a1) b)) (vlist2list gamma)) work context j *)
(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
apply rule_vimp_a_or_b_gamma with j1; try assumption.
apply
 ih with (gamma := (l, OrF (Atom j) b) :: (j :: nil, Imp a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (OrF (Atom j) b) (Imp a0 a1) 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (OrF (Imp a0 a1) b) (vlist2hlist gamma)); try assumption.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
simpl in |- *; apply lt_n_Sn.


(******************* a=(Imp a c) *****************************)

(* Goal: forall (f : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f) (vlist2list gamma)) work context j) (f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight f0) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l f0) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp f f0)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp f f0)) (vlist2list gamma)) work context j *)
intros a ih_a c; clear ih_a.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp a b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp a b) c)) (vlist2list gamma)) work context j *)
case a; clear a.
(* a=Falsum  *)
(* Goal: forall (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp Falsum c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp Falsum c)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
intros ih_c l lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp Falsum c)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_falsum_imp_b_gamma.
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply lt_S_n.
apply
 le_lt_trans with (weight (Imp Falsum c) + weight_gamma (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: le (S (weight_gamma (vlist2hlist gamma))) (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply (plus_le_compat_r 1 (weight c) (weight_gamma (vlist2hlist gamma))).
(* Goal: le (S O) (weight c) *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply weight_ge_1.

(* a=(Atom i0) *)
(* Goal: forall (i : Int) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Atom i) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
intros i0 ih_c l lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Atom i0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_atom_imp_b_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int i0 l) c) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply ih_c.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
assumption.

(* a=(Imp a b) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
intros a b ih_c l lt_weight; clear ih_c.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (AndF a b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_and_imp_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp a (Imp b c))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, Imp a (Imp b c)) :: gamma).
apply
 (weight_gamma_weak' (Imp a (Imp b c)) (Imp (AndF a b) c) (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (S O))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply lt_plus_assoc_l.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* a=(OrF a b) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
intros a b ih_c l; clear ih_c.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
case c; clear c.
(* c=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_or_imp_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp a Falsum)) (@cons form (vimp l (Imp b Falsum)) (vlist2list gamma))) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (OrF a b) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, Imp a Falsum) :: (l, Imp b Falsum) :: gamma).
apply
 (weight_gamma_weak2' (Imp a Falsum) (Imp b Falsum) 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (Imp (OrF a b) Falsum) (vlist2hlist gamma)); try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply my_lt_weak.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) (S O)) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1)))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) O) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg a)).
(* Goal: lt (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (S O))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply lt_plus_assoc_l.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* c=(Atom i) *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros i lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_or_imp_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp a (Atom i))) (@cons form (vimp l (Imp b (Atom i))) (vlist2list gamma))) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, Imp a (Atom i)) :: (l, Imp b (Atom i)) :: gamma).
apply
 (weight_gamma_weak2' (Imp a (Atom i)) (Imp b (Atom i))
    (Imp (OrF a b) (Atom i)) (vlist2hlist gamma)); 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply my_lt_weak.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) (S O)) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1)))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) O) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg a)).
(* Goal: lt (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (S O))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (OrF a b) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF a b) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply lt_plus_assoc_l.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* c=(AndF c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_or_imp_gamma_new with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp a (Atom j))
              :: (l, Imp b (Atom j)) :: (j :: nil, AndF c0 c1) :: gamma).
apply
 (weight_gamma_weak3' (Imp a (Atom j)) (Imp b (Atom j)) 
    (AndF c0 c1) (Imp (OrF a b) (AndF c0 c1)) (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) (S O)) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1)))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) O) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg a)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg b) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (Nat.add (weight_neg b) O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg b)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (weight_neg b))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) (weight_neg b)).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* c=(OrF c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_or_imp_gamma_new with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp a (Atom j))
              :: (l, Imp b (Atom j)) :: (j :: nil, OrF c0 c1) :: gamma).
apply
 (weight_gamma_weak3' (Imp a (Atom j)) (Imp b (Atom j)) 
    (OrF c0 c1) (Imp (OrF a b) (OrF c0 c1)) (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) (S O)) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1)))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) O) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg a)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg b) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (Nat.add (weight_neg b) O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg b)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (weight_neg b))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) (weight_neg b)).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* c=(Imp c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_or_imp_gamma_new with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp a (Atom j))
              :: (l, Imp b (Atom j)) :: (j :: nil, Imp c0 c1) :: gamma).
apply
 (weight_gamma_weak3' (Imp a (Atom j)) (Imp b (Atom j)) 
    (Imp c0 c1) (Imp (OrF a b) (Imp c0 c1)) (vlist2hlist gamma));
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) (S O)) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1)))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (Nat.add (Nat.add (weight_neg a) O) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg a)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (Nat.add (weight_neg b) (S O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg b) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (Nat.add (weight_neg b) O))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg b)).
(* Goal: lt (Nat.add (Nat.add (weight_neg a) (S (weight_neg b))) (Nat.add (weight_neg c0) (weight c1))) (S (S (Nat.add (Nat.add (weight_neg a) (weight_neg b)) (Nat.add (weight_neg c0) (weight c1))))) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg a) (weight_neg b)).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* a=(Imp a b) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
intros a b ih_c l; clear ih_c.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp a b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp a b) c)) (vlist2list gamma)) work context j *)
case a; clear a.

(* a=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp Falsum b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_falsum_imp_imp_gamma.
(* Goal: search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, c) :: gamma).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* a=(Atom i0) *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros i0.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp (Atom i0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
case b; clear b.
(* b=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_imp_falsum_imp_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom j)) c)) (vlist2list gamma)) work (@cons form (vimp l (Imp (Imp (Atom i0) (Atom j)) c)) context) j1 *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (l, Imp (Imp (Atom i0) (Atom j)) c) :: gamma).
(* Goal: lt (weight_goal g1) n *)
simpl in |- *; apply lt_S_n; assumption.
(* b=(Atom i1) *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros i1.
(* Goal: forall _ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) c)) (weight_gamma (vlist2hlist gamma))) (S n), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
case c; clear c.

(* c=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) Falsum)) (vlist2list gamma)) work context j *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NImp_NF (NImp i0 i1 NFalsum)).
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply my_lt_weak.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* c=(Atom i2) *)
(* Goal: forall (i : Int) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Atom i))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom i))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros i2 lt_weight.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom i2))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NImp_NF (NImp i0 i1 (NAtom i2))).
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_gamma (vlist2hlist gamma)) n *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (AndF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply my_lt_weak.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* c=(AndF c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_imp_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (vimp (@cons Int j (@nil Int)) (Imp c0 c1)) (vlist2list gamma))) work (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (Imp c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NImp_NF (NImp i0 i1 (NAtom j))).
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int j (@nil Int)) (AndF c0 c1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NImp_NF (NImp i0 i1 (NAtom j)))) work) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (AndF c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (OrF f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, AndF c0 c1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* c=(OrF c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_imp_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (vimp (@cons Int j (@nil Int)) (Imp c0 c1)) (vlist2list gamma))) work (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (Imp c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NImp_NF (NImp i0 i1 (NAtom j))).
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int j (@nil Int)) (OrF c0 c1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NImp_NF (NImp i0 i1 (NAtom j)))) work) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (OrF c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, OrF c0 c1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
(* c=(Imp c0 c1) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Imp f f0))) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros c0 c1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_vimp_imp_gamma with j1; try assumption.
(* Goal: search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (vimp (@cons Int j (@nil Int)) (Imp c0 c1)) (vlist2list gamma))) work (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (Imp c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply rule_shift_gamma_work with (a := NImp_NF (NImp i0 i1 (NAtom j))).
(* Goal: search_spec (Atom goal) (@cons form (vimp (@cons Int j (@nil Int)) (Imp c0 c1)) (vlist2list gamma)) (@cons normal_form (nvimp l (NImp_NF (NImp i0 i1 (NAtom j)))) work) (@cons form (vimp l (Imp (Imp (Atom i0) (Atom i1)) (Atom j))) (@cons form (Imp (Atom j) (Imp c0 c1)) context)) j1 *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (AndF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (AndF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply ih with (gamma := (j :: nil, Imp c0 c1) :: gamma).
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.

(* (Imp (Imp (Atom i0) (AndF b0 b1)) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_atom_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom i0) (Atom j)) c)
              :: (i0 :: l, Imp (AndF b0 b1) (Atom j)) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom i0) (Atom j)) c)
    (Imp (AndF b0 b1) (Atom j)) (Imp (Imp (Atom i0) (AndF b0 b1)) c)
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (vlist2hlist gamma)); try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (weight c) (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (S O)))) (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (OrF f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (OrF f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_comm (weight c) (S (weight_neg b0 + weight_neg b1 + 1))).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (S O)))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg b0 + weight_neg b1) 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (weight c) (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) O)))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg b0 + weight_neg b1)).
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* (Imp (Imp (Atom i0) (OrF b0 b1)) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_atom_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom i0) (Atom j)) c)
              :: (i0 :: l, Imp (OrF b0 b1) (Atom j)) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom i0) (Atom j)) c)
    (Imp (OrF b0 b1) (Atom j)) (Imp (Imp (Atom i0) (OrF b0 b1)) c)
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (vlist2hlist gamma)); try assumption.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (S O)))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm (weight_neg b0 + weight_neg b1) 0).
(* Goal: lt (Nat.add (weight c) (S (S (S (Nat.add (S (Nat.add (weight_neg b0) (weight_neg b1))) O))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
simpl in |- *; fold weight_neg in |- *.
(* Goal: lt (Nat.add (weight c) (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) O)))))) (S (S (S (S (S (Nat.add (Nat.add (weight_neg b0) (weight_neg b1)) (weight c))))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O (weight_neg b0 + weight_neg b1)).
 rewrite
 (plus_comm (weight c) (S (S (S (S (weight_neg b0 + weight_neg b1))))))
 .
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* (Imp (Imp (Atom i0) (Imp b0 b1)) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Atom i0) (Imp f f0)) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Atom i0) (Imp f f0)) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros b0 b1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_atom_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom i0) (Atom j)) c)
              :: (i0 :: l, Imp (Imp b0 b1) (Atom j)) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom i0) (Atom j)) c)
    (Imp (Imp b0 b1) (Atom j)) (Imp (Imp (Atom i0) (Imp b0 b1)) c)
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
    (vlist2hlist gamma)); try assumption.
change
  (S (weight c + (weight_neg (Imp b0 b1) + 1)) <
   S (S (S (weight_neg (Imp b0 b1) + weight c)))) in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (Nat.add (weight c) (Nat.add (weight_neg (Imp b0 b1)) (S O))) (S (S (Nat.add (weight_neg (Imp b0 b1)) (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
generalize (weight_neg (Imp b0 b1)); intros m.
(* Goal: lt (Nat.add (weight c) (Nat.add m (S O))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite <- (plus_Snm_nSm m 0).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (Nat.add (weight c) (S (Nat.add m O))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_O m).
(* Goal: lt (Nat.add (weight c) (S m)) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
 rewrite (plus_comm (weight c) (S m)).
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: lt (S (PeanoNat.Nat.add m (weight c))) (S (S (Nat.add m (weight c)))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (AndF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (AndF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
apply lt_n_S.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* (Imp (Imp (AndF a0 a1) b) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_a_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom j) b) c) :: (j :: nil, AndF a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom j) b) c) (AndF a0 a1)
    (Imp (Imp (AndF a0 a1) b) c) (vlist2hlist gamma)); 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
change
  (weight_neg (Imp (Atom j) b) + weight c + weight (AndF a0 a1) <
   S (S (S (S (weight_neg b + weight (AndF a0 a1) + weight c))))) 
 in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) (weight (AndF a0 a1))) (S (S (S (S (Nat.add (Nat.add (weight_neg b) (weight (AndF a0 a1))) (weight c)))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (OrF f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (OrF f f0) b) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
generalize (weight (AndF a0 a1)); intro a.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) (weight c)))))) *)
generalize (weight c); intro cn.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) cn) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc_reverse (weight_neg (Imp (Atom j) b)) cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (Nat.add cn a)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_comm cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (PeanoNat.Nat.add a cn)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc (weight_neg (Imp (Atom j) b)) a cn).
(* Goal: lt (PeanoNat.Nat.add (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply le_lt_trans with (S (S (S (weight_neg b))) + a + cn).
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (weight_neg (Imp (Atom j) b)) (S (S (S (weight_neg b)))) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply weight_neg_le.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* (Imp (Imp (OrF a0 a1) b) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_a_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom j) b) c) :: (j :: nil, OrF a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom j) b) c) (OrF a0 a1)
    (Imp (Imp (OrF a0 a1) b) c) (vlist2hlist gamma)); 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
change
  (weight_neg (Imp (Atom j) b) + weight c + weight (OrF a0 a1) <
   S (S (S (S (weight_neg b + weight (OrF a0 a1) + weight c))))) 
 in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) (weight (OrF a0 a1))) (S (S (S (S (Nat.add (Nat.add (weight_neg b) (weight (OrF a0 a1))) (weight c)))))) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
generalize (weight (OrF a0 a1)); intro a.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) (weight c)))))) *)
generalize (weight c); intro cn.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) cn) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc_reverse (weight_neg (Imp (Atom j) b)) cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (Nat.add cn a)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_comm cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (PeanoNat.Nat.add a cn)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc (weight_neg (Imp (Atom j) b)) a cn).
(* Goal: lt (PeanoNat.Nat.add (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply le_lt_trans with (S (S (S (weight_neg b))) + a + cn).
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (weight_neg (Imp (Atom j) b)) (S (S (S (weight_neg b)))) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply weight_neg_le.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* (Imp (Imp (Imp a0 a1) b) c) *)
(* Goal: forall (f f0 : form) (_ : lt (Nat.add (weight (Imp (Imp (Imp f f0) b) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp (Imp f f0) b) c)) (vlist2list gamma)) work context j *)
intros a0 a1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_a_imp_b_imp_c_gamma with j1; try assumption.
apply
 ih
  with
    (gamma := (l, Imp (Imp (Atom j) b) c) :: (j :: nil, Imp a0 a1) :: gamma).
apply
 (weight_gamma_weak2' (Imp (Imp (Atom j) b) c) (Imp a0 a1)
    (Imp (Imp (Imp a0 a1) b) c) (vlist2hlist gamma)); 
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
 try assumption.
change
  (weight_neg (Imp (Atom j) b) + weight c + weight (Imp a0 a1) <
   S (S (S (S (weight_neg b + weight (Imp a0 a1) + weight c))))) 
 in |- *.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) (weight (Imp a0 a1))) (S (S (S (S (Nat.add (Nat.add (weight_neg b) (weight (Imp a0 a1))) (weight c)))))) *)
generalize (weight (Imp a0 a1)); intro a.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) (weight c)) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) (weight c)))))) *)
generalize (weight c); intro cn.
(* Goal: lt (Nat.add (Nat.add (weight_neg (Imp (Atom j) b)) cn) a) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc_reverse (weight_neg (Imp (Atom j) b)) cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (Nat.add cn a)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_comm cn a).
(* Goal: lt (Nat.add (weight_neg (Imp (Atom j) b)) (PeanoNat.Nat.add a cn)) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
 rewrite (plus_assoc (weight_neg (Imp (Atom j) b)) a cn).
(* Goal: lt (PeanoNat.Nat.add (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply le_lt_trans with (S (S (S (weight_neg b))) + a + cn).
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (PeanoNat.Nat.add (weight_neg (Imp (Atom j) b)) a) (Nat.add (S (S (S (weight_neg b)))) a) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply plus_le_compat_r.
(* Goal: le (weight_neg (Imp (Atom j) b)) (S (S (S (weight_neg b)))) *)
(* Goal: lt (Nat.add (Nat.add (S (S (S (weight_neg b)))) a) cn) (S (S (S (S (Nat.add (Nat.add (weight_neg b) a) cn))))) *)
apply weight_neg_le.
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
Qed.


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


Fixpoint list2vlist (gamma : flist) : vlist :=
  match gamma with
  | nil => nil (A:=list Int * form)
  | a :: gamma => (nil, a) :: list2vlist gamma
  end.

Lemma vlist_eq : forall gamma : flist, gamma = vlist2list (list2vlist gamma).
(* Goal: forall gamma : flist, @eq flist gamma (vlist2list (list2vlist gamma)) *)
intros gamma; elim gamma; clear gamma.
(* Goal: @eq flist (@nil form) (vlist2list (list2vlist (@nil form))) *)
(* Goal: forall (a : form) (l : list form) (_ : @eq flist l (vlist2list (list2vlist l))), @eq flist (@cons form a l) (vlist2list (list2vlist (@cons form a l))) *)
trivial.
(* Goal: forall (a : form) (l : list form) (_ : @eq flist l (vlist2list (list2vlist l))), @eq flist (@cons form a l) (vlist2list (list2vlist (@cons form a l))) *)
intros a gamma ih.
(* Goal: @eq flist (@cons form a gamma) (vlist2list (list2vlist (@cons form a gamma))) *)
simpl in |- *.
(* Goal: @eq flist (@nil form) (vlist2list (list2vlist (@nil form))) *)
(* Goal: forall (a : form) (l : list form) (_ : @eq flist l (vlist2list (list2vlist l))), @eq flist (@cons form a l) (vlist2list (list2vlist (@cons form a l))) *)
 rewrite <- ih; trivial.
Qed.


Lemma search_goal_invariant :
 forall (goal : form) (gamma : flist) (work : nf_list) 
   (context : flist) (j : Int), search_spec goal gamma work context j.  
(* Goal: forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int), search_spec goal gamma work context j *)
intros goal gamma work context j.
cut
 (forall (n : nat) (goal : form) (gamma : flist) (work : nf_list)
    (context : flist) (j : Int),
  weight_goal goal < n -> search_spec goal gamma work context j).
(* Goal: forall _ : forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j, search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j *)
intros claim.
(* Goal: search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j *)
apply claim with (S (weight_goal goal)).
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.
(* Goal: forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j *)
clear goal gamma work context j.
(* Goal: forall (n : nat) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j *)
intros n; elim n; clear n.
(* Goal: forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) O), search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (_ : forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) (S n)), search_spec goal gamma work context j *)
intros goal gamma work context j lt_weight.
(* Goal: search_spec goal gamma work context j *)
(* Goal: forall (n : nat) (_ : forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) (S n)), search_spec goal gamma work context j *)
elimtype False.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply (lt_n_O (weight_goal goal)); assumption.

(* Goal: forall (n : nat) (_ : forall (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) n), search_spec goal gamma work context j) (goal : form) (gamma : flist) (work : nf_list) (context : flist) (j : Int) (_ : lt (weight_goal goal) (S n)), search_spec goal gamma work context j *)
intros n ih goal gamma work context j.
(* Goal: forall _ : lt (weight_goal goal) (S n), search_spec goal gamma work context j *)
case goal; clear goal.

(* goal=Falsum *)
(* Goal: forall _ : lt (weight_goal Falsum) (S n), search_spec Falsum gamma work context j *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_gamma_falsum with j1; try assumption.


(* Goal: search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
 rewrite (vlist_eq gamma).
(* Goal: search_spec (Atom i) (vlist2list (list2vlist gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply (search_atom_aux (S (weight_gamma (vlist2hlist (list2vlist gamma))))).
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* goal=(Atom i) *)
(* Goal: forall (i : Int) (_ : lt (weight_goal (Atom i)) (S n)), search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros i lt_weight.
(* Goal: search_spec (Atom i) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
 rewrite (vlist_eq gamma).
(* Goal: search_spec (Atom i) (vlist2list (list2vlist gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply (search_atom_aux (S (weight_gamma (vlist2hlist (list2vlist gamma))))).
(* Goal: lt (weight_gamma (vlist2hlist (list2vlist gamma))) (S (weight_gamma (vlist2hlist (list2vlist gamma)))) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (AndF f f0)) (S n)), search_spec (AndF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (OrF f f0)) (S n)), search_spec (OrF f f0) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
apply lt_n_Sn.

(* goal=(AndF g0 g1) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros g0 g1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_gamma_a with j1; try assumption.
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.

(* goal=(OrF g0 g1) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros g0 g1 lt_weight.
(* Goal: search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
elim (int_succ j).
(* Goal: forall (x : Int) (_ : Less j x), search_spec (OrF g0 g1) gamma work context j *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros j1 less1.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply rule_gamma_a with j1; try assumption.
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.

(* goal=(Imp g0 g1) *)
(* Goal: forall (f f0 : form) (_ : lt (weight_goal (Imp f f0)) (S n)), search_spec (Imp f f0) gamma work context j *)
intros g0 g1 lt_weight.
(* Goal: search_spec (Imp g0 g1) gamma work context j *)
apply rule_gamma_a_imp_b.
(* Goal: search_spec g1 (@cons form g0 gamma) work (@cons form g0 context) j *)
apply ih.
(* Goal: lt (weight_goal g1) n *)
apply lt_S_n; assumption.
Qed.


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

Inductive search_spec (goal : form) (gamma : flist) : Set :=
  | derivable : Derivable gamma goal -> search_spec goal gamma
  | refutable :
      forall k : kripke_tree,
      Is_Monotone_kripke_tree k ->
      (forall a : form, In a gamma -> forces_t k a) ->
      (forces_t k goal -> False) -> search_spec goal gamma.


Theorem search : forall (goal : form) (gamma : flist), search_spec goal gamma. 
(* Goal: forall (goal : form) (gamma : flist), search_spec goal gamma *)
intros goal gamma.
(* Goal: search_spec goal gamma *)
elim (max_int_of_list (goal :: gamma)).
(* Goal: forall (x : Int) (_ : below_list (@cons form goal gamma) x), search_spec goal gamma *)
intros j below.
(* Goal: search_spec goal gamma *)
elim (search_goal_invariant goal gamma nf_nil gamma j).
(* Goal: forall _ : Derivable gamma goal, search_spec goal gamma *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_gamma gamma nf_nil k) (_ : forall _ : forces_t k goal, False), search_spec goal gamma *)
(* Goal: below_form goal j *)
(* Goal: below_list gamma j *)
(* Goal: below_list gamma j *)
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
intros der; apply derivable; assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_gamma gamma nf_nil k) (_ : forall _ : forces_t k goal, False), search_spec goal gamma *)
(* Goal: below_form goal j *)
(* Goal: below_list gamma j *)
(* Goal: below_list gamma j *)
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
intros k k_is_mon k_forces_gamma k_notforces_goal.
(* Goal: search_spec goal gamma *)
(* Goal: below_form goal j *)
(* Goal: below_list gamma j *)
(* Goal: below_list gamma j *)
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
apply refutable with k; try assumption.
(* Goal: forall (a : form) (_ : in_gamma gamma nf_nil a), Derivable gamma a *)
(* Goal: minimal gamma nf_nil gamma *)
intros a in_a.
(* Goal: forces_t k a *)
elim (in_nth form a gamma in_a).
(* Goal: forall (x : nat) (_ : my_nth form x gamma a), forces_t k a *)
intros n nth.
(* Goal: forces_t k a *)
apply k_forces_gamma.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply In_Gamma with n; assumption.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply below_cons_list_head with gamma; assumption.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply below_cons_list_tail with goal; assumption.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply below_cons_list_tail with goal; assumption.
(* Goal: sound gamma nf_nil gamma *)
(* Goal: minimal gamma nf_nil gamma *)
unfold sound in |- *.
(* Goal: forall (a : form) (_ : in_gamma gamma nf_nil a), Derivable gamma a *)
(* Goal: minimal gamma nf_nil gamma *)
intros a in_a.
(* Goal: Derivable gamma a *)
(* Goal: minimal gamma nf_nil gamma *)
elim in_a; clear in_a a.
(* Goal: forall (n : nat) (a : form) (_ : my_nth form n gamma a), Derivable gamma a *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n nf_nil a), Derivable gamma (nf2form a) *)
(* Goal: minimal gamma nf_nil gamma *)
intros n a nth.
(* Goal: Derivable gamma a *)
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n nf_nil a), Derivable gamma (nf2form a) *)
(* Goal: minimal gamma nf_nil gamma *)
apply Derivable_Intro with (Var n).
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply ByAssumption; assumption.
(* Goal: forall (n : nat) (a : normal_form) (_ : my_nth normal_form n nf_nil a), Derivable gamma (nf2form a) *)
(* Goal: minimal gamma nf_nil gamma *)
intros n a nth; elimtype False; inversion_clear nth.

(* Goal: minimal gamma nf_nil gamma *)
unfold minimal in |- *.
(* Goal: forall (a : form) (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_gamma gamma nf_nil k) (_ : @In form a gamma), forces_t k a *)
intros a k k_is_mon k_forces_gamma in_a.
(* Goal: forces_t k a *)
elim (in_nth form a gamma in_a).
(* Goal: forall (x : nat) (_ : my_nth form x gamma a), forces_t k a *)
intros n nth.
(* Goal: forces_t k a *)
apply k_forces_gamma.
(* Goal: lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n) *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (AndF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (AndF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (OrF f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (OrF f f0) c)) (vlist2list gamma)) work context j *)
(* Goal: forall (f f0 : form) (_ : forall (l : list Int) (_ : lt (Nat.add (weight c) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l c) (vlist2list gamma)) work context j) (l : list Int) (_ : lt (Nat.add (weight (Imp (Imp f f0) c)) (weight_gamma (vlist2hlist gamma))) (S n)), search_spec (Atom goal) (@cons form (vimp l (Imp (Imp f f0) c)) (vlist2list gamma)) work context j *)
apply In_Gamma with n; assumption.
Qed.


