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

Require Export Cons_Counter_Model.
Require Export NSound.

Inductive nsearch_spec_result_aux (goal : Int) (work : nf_list) 
(ds : disjs) (ni : nested_imps) (ai : atomic_imps) 
(a : atoms) (context : flist) : Set :=
  | NDerivable :
      Derivable context (Atom goal) ->
      nsearch_spec_result_aux goal work ds ni ai a context
  | NRefutable :
      forall k : kripke_tree,
      Is_Monotone_kripke_tree k ->
      forces_ngamma work ds ni ai a k ->
      (forces_t k (Atom goal) -> False) ->
      nsearch_spec_result_aux goal work ds ni ai a context.


Inductive nsearch_spec_result (goal : Int) (work : nf_list) 
(ds : disjs) (ni : nested_imps) (ai : atomic_imps) 
(a : atoms) (context : flist) : Set :=
    NSearch_Res :
      forall ni1 : nested_imps,
      le_ni ni1 ni ->
      deco_sound work ds ni1 ai a ->
      nsearch_spec_result_aux goal work ds ni1 ai a context ->
      nsearch_spec_result goal work ds ni ai a context.


Definition nsearch_spec (goal : Int) (work : nf_list) 
  (ds : disjs) (ni : nested_imps) (ai : atomic_imps) 
  (a : atoms) (context : flist) :=
  deco_sound work ds ni ai a ->
  nsound work ds ni ai a context ->
  nminimal work ds ni ai a context ->
  nsearch_spec_result goal work ds ni ai a context.

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

Lemma fail :
 forall (i : Int) (dni : decorated_nested_imps) (ai : atomic_imps)
   (a : atoms) (context : flist),
 a_ai_disj a ai ->
 a_goal_disj a i ->
 nsearch_spec i nf_nil DNil (rev_app dni NNil) ai a context.
(* Goal: nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
unfold nsearch_spec in |- *.
(* Goal: forall (i : Int) (dni : decorated_nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : a_ai_disj a ai) (_ : a_goal_disj a i) (_ : deco_sound nf_nil DNil (rev_app dni NNil) ai a) (_ : nsound nf_nil DNil (rev_app dni NNil) ai a context) (_ : nminimal nf_nil DNil (rev_app dni NNil) ai a context), nsearch_spec_result i nf_nil DNil (rev_app dni NNil) ai a context *)
intros i dni ai a context a_ai_disjunct goal_a_disj complete sound mon.
(* Goal: nsearch_spec_result i nf_nil DNil (rev_app dni NNil) ai a context *)
apply NSearch_Res with (rev_app dni NNil); try assumption.
(* Goal: le_ni ni ni *)
(* Goal: nsearch_spec_result_aux goal (@cons normal_form NFalsum work) ds ni ai a context *)
apply le_ni_refl.
(* Goal: nsearch_spec_result_aux i nf_nil DNil (rev_app dni NNil) ai a context *)
elim (cons_counter_model i dni ai a); try assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros k k_is_mon k_forces_ngamma k_notforces_goal.
(* Goal: nsearch_spec_result_aux i nf_nil DNil (rev_app dni NNil) ai a context *)
apply NRefutable with k; assumption.
Qed.

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


Lemma rule_shift_work_ds :
 forall (goal i j : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist),
 nsearch_spec goal work ((i, j) :: ds) ni ai a context ->
 nsearch_spec goal (NDisj i j :: work) ds ni ai a context.
(* Goal: forall (goal i j : Int) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context), nsearch_spec goal (@cons normal_form (NDisj i j) work) ds ni ai a context *)
intros goal i j work ds ni ai a context premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a' *)
(* Goal: nsound work ds ni ai a' context *)
(* Goal: nminimal work ds ni ai a' context *)
apply NSearch_Res with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ds_work; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_ds_work; assumption.
(* side premisses: Elim premiss. *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ds; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_ds; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ds; assumption.
Qed.



Lemma rule_shift_work_ni0 :
 forall (goal : Int) (x : nimp) (work : nf_list) (ds : disjs)
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist),
 nsearch_spec goal work ds (Undecorated x :: ni) ai a context ->
 nsearch_spec goal (NImp_NF x :: work) ds ni ai a context.
(* Goal: forall (goal : Int) (x : nimp) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : nsearch_spec goal work ds (@cons nested_imp (Undecorated x) ni) ai a context), nsearch_spec goal (@cons normal_form (NImp_NF x) work) ds ni ai a context *)
intros goal x work ds ni ai a context premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: nsearch_spec_result goal (@cons normal_form (NImp_NF x) work) ds ni ai a context *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated x) ni) ai a *)
(* Goal: nsound work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
(* Goal: nminimal work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
apply NSearch_Res with (tail ni1).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
inversion_clear less1; assumption.
(* Goal: deco_sound (@cons normal_form (NImp_NF x) work) ds (@tl nested_imp ni1) ai a *)
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NImp_NF x) work) ds (@tl nested_imp ni1) ai a context *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated x) ni) ai a *)
(* Goal: nsound work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
(* Goal: nminimal work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
generalize complete1; clear spec1 complete1.
(* Goal: forall _ : forces_ngamma work ds ni1 ai a k, forces_ngamma (@cons normal_form (NImp_NF x) work) ds (@tl nested_imp ni1) ai a k *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated x) ni) ai a *)
(* Goal: nsound work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
(* Goal: nminimal work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
inversion_clear less1; intros.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ni_work with (x := Undecorated x); assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ni_work with (x := Decorated x k); assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: forces_ngamma (@cons normal_form (NImp_NF x) work) ds (@tl nested_imp ni1) ai a k *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated x) ni) ai a *)
(* Goal: nsound work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
(* Goal: nminimal work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
generalize k_forces_ngamma; clear complete1 k_forces_ngamma.
(* Goal: forall _ : forces_ngamma work ds ni1 ai a k, forces_ngamma (@cons normal_form (NImp_NF x) work) ds (@tl nested_imp ni1) ai a k *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated x) ni) ai a *)
(* Goal: nsound work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
(* Goal: nminimal work ds (@cons nested_imp (Undecorated x) ni) ai a context *)
inversion_clear less1; intros.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_ni_work with (x := Undecorated x); assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_ni_work with (x := Decorated x k0); assumption.
(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ni0; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_ni; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ni; assumption.
Qed.


Lemma rule_shift_work_ai_new :
 forall (goal i : Int) (b : normal_form) (work : nf_list) 
   (ds : disjs) (ni : nested_imps) (ai ai' : atomic_imps) 
   (a : atoms) (context : flist),
 (forall x : unit, LOOKUP unit i a x -> False) ->
 (forall bs : nf_list, LOOKUP nf_list i ai bs -> False) ->
 EQUIV_INS nf_list i (cons b) nf_nil ai ai' ->
 nsearch_spec goal work ds ni ai' a context ->
 nsearch_spec goal (AImp i b :: work) ds ni ai a context.
intros goal i b work ds ni ai ai' a context notlookup_i notlookup_bs
 equiv_ins premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a' *)
(* Goal: nsound work ds ni ai a' context *)
(* Goal: nminimal work ds ni ai a' context *)
apply NSearch_Res with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ai_work_new with ai'; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_ai_work_new with ai'; assumption.
(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ai with i b ai; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_ai with i b ai; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ai_new with i b ai; assumption.
Qed.



Lemma rule_shift_work_ai_old :
 forall (goal i : Int) (b : normal_form) (work : nf_list) 
   (ds : disjs) (ni : nested_imps) (bs : nf_list) (ai ai' : atomic_imps)
   (a : atoms) (context : flist),
 (forall x : unit, LOOKUP unit i a x -> False) ->
 LOOKUP nf_list i ai bs ->
 EQUIV_INS nf_list i (cons b) nf_nil ai ai' ->
 nsearch_spec goal work ds ni ai' a context ->
 nsearch_spec goal (AImp i b :: work) ds ni ai a context.
intros goal i b work ds ni bs ai ai' a context notlookup_i lookup_bs
 equiv_ins premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a' *)
(* Goal: nsound work ds ni ai a' context *)
(* Goal: nminimal work ds ni ai a' context *)
apply NSearch_Res with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ai_work_old with bs ai'; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_ai_work_old with bs ai'; assumption.
(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ai with i b ai; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_ai with i b ai; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ai_old with i b bs ai; assumption.
Qed.



Lemma rule_shift_work_a :
 forall (goal i : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (ai : atomic_imps) (a a' : atoms) 
   (context : flist),
 (forall bs : nf_list, LOOKUP nf_list i ai bs -> False) ->
 (forall d : unit, LOOKUP unit i a d -> False) ->
 EQUIV_INS unit i (fun _ : unit => tt) tt a a' ->
 nsearch_spec goal work ds ni ai a' context ->
 nsearch_spec goal (NAtom i :: work) ds ni ai a context.
intros goal i work ds ni ai a a' context notlookup_bs notlookup_i equiv_ins
 premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a' *)
(* Goal: nsound work ds ni ai a' context *)
(* Goal: nminimal work ds ni ai a' context *)
apply NSearch_Res with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_a_work with a'; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_a_work with a'; assumption.
(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_a with i a; assumption.
Qed.



Lemma shift_ni_dni :
 forall (goal : Int) (work : nf_list) (ds : disjs) 
   (x : nimp) (k : kripke_tree) (ni : nested_imps)
   (dni : decorated_nested_imps) (ai : atomic_imps) 
   (a : atoms) (context : flist),
 nsearch_spec goal work ds (rev_app ((x, k) :: dni) ni) ai a context ->
 nsearch_spec goal work ds (rev_app dni (Decorated x k :: ni)) ai a context.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; assumption.
Qed.


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


Lemma nax :
 forall (goal : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist),
 in_ngamma work ds ni ai a (NAtom goal) ->
 nsearch_spec goal work ds ni ai a context.
(* Goal: nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
unfold nsearch_spec in |- *.
(* Goal: forall (goal : Int) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : in_ngamma work ds ni ai a (NAtom goal)) (_ : deco_sound work ds ni ai a) (_ : nsound work ds ni ai a context) (_ : nminimal work ds ni ai a context), nsearch_spec_result goal work ds ni ai a context *)
intros goal work ds ni ai a context in_ngamma complete sound mon.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni; try assumption.
(* Goal: le_ni ni ni *)
(* Goal: nsearch_spec_result_aux goal (@cons normal_form NFalsum work) ds ni ai a context *)
apply le_ni_refl.
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NDerivable.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply sound with (c := NAtom goal); assumption.
Qed.


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


Lemma nefq :
 forall (goal : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist), nsearch_spec goal (NFalsum :: work) ds ni ai a context.
(* Goal: nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
unfold nsearch_spec in |- *.
(* Goal: forall (goal : Int) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : deco_sound (@cons normal_form NFalsum work) ds ni ai a) (_ : nsound (@cons normal_form NFalsum work) ds ni ai a context) (_ : nminimal (@cons normal_form NFalsum work) ds ni ai a context), nsearch_spec_result goal (@cons normal_form NFalsum work) ds ni ai a context *)
intros goal work ds ni ai a context complete sound mon.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni; try assumption.
(* Goal: le_ni ni ni *)
(* Goal: nsearch_spec_result_aux goal (@cons normal_form NFalsum work) ds ni ai a context *)
apply le_ni_refl.
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NDerivable.
(* Goal: Derivable context (Atom goal) *)
elim (sound NFalsum).
(* Goal: forall (t : proof_term) (_ : derives context t (nf2form NFalsum)), Derivable context (Atom goal) *)
(* Goal: in_ngamma (@cons normal_form NFalsum work) ds ni ai a NFalsum *)
intros t der_t.
(* Goal: Derivable context (Atom goal) *)
(* Goal: in_ngamma (@cons normal_form NFalsum work) ds ni ai a NFalsum *)
apply Derivable_Intro with (Efq t (Atom goal)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ByAbsurdity; assumption.
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
Qed.


Lemma contradiction_atoms :
 forall (goal i : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist),
 LOOKUP unit i a tt ->
 nsearch_spec goal work ds ni ai a context ->
 nsearch_spec goal (NAtom i :: work) ds ni ai a context.
(* Goal: forall (goal i : Int) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : LOOKUP unit i a tt) (_ : nsearch_spec goal work ds ni ai a context), nsearch_spec goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
intros goal i work ds ni ai a context in_atoms premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
cut (EQUIV_INS unit i (fun _ => tt) tt a a).
(* Goal: forall _ : EQUIV_INS unit i (fun _ : unit => tt) tt a a, nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
intros equiv_ins.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound work ds ni1 ai a) (_ : nsearch_spec_result_aux goal work ds ni1 ai a context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a *)
(* Goal: nsound work ds ni ai a context *)
(* Goal: nminimal work ds ni ai a context *)
(* Goal: EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
clear mon sound complete.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound work ds ni1 ai a) (_ : nsearch_spec_result_aux goal work ds ni1 ai a context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound work ds ni ai a *)
(* Goal: nsound work ds ni ai a context *)
(* Goal: nminimal work ds ni ai a context *)
(* Goal: EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
intros ni1 le1 complete1 spec1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni1; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_a_work with a; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros der_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros k k_is_mon k_forces_ngamma k_notforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_a_work with a; assumption.

(* side premisses: (Elim spec ..)  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_a with i a; assumption.

(* side premiss (Cut (EQUIV_INS ....))  *)
(* Goal: EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
clear complete sound mon premiss context ai ni ds work goal.
(* Goal: EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
generalize in_atoms; clear in_atoms.
(* Goal: forall _ : LOOKUP unit i a tt, EQUIV_INS unit i (fun _ : unit => tt) tt a a *)
elim a; clear a; intros t avl_t.
(* Goal: forall _ : LOOKUP unit i (AVL_intro unit t avl_t) tt, EQUIV_INS unit i (fun _ : unit => tt) tt (AVL_intro unit t avl_t) (AVL_intro unit t avl_t) *)
unfold LOOKUP in |- *.
(* Goal: forall _ : lookup unit i t tt, EQUIV_INS unit i (fun _ : unit => tt) tt (AVL_intro unit t avl_t) (AVL_intro unit t avl_t) *)
unfold EQUIV_INS in |- *.
(* Goal: forall _ : lookup unit i t tt, equiv_ins unit i (fun _ : unit => tt) tt t t *)
intros lookup.
(* Goal: equiv_ins unit i (fun _ : unit => tt) tt t t *)
apply equiv_ins_intro.
(* Goal: forall (k : Int) (data : unit) (_ : Equal k i) (_ : AvlTrees.lookup unit k t data), AvlTrees.lookup unit k t tt *)
(* Goal: forall (k : Int) (_ : Equal k i) (_ : forall (data : unit) (_ : AvlTrees.lookup unit k t data), False), AvlTrees.lookup unit k t tt *)
(* Goal: forall (k : Int) (data : unit) (_ : not (Equal k i)) (_ : AvlTrees.lookup unit k t data), AvlTrees.lookup unit k t data *)
(* Goal: forall (k : Int) (data : unit) (_ : not (Equal k i)) (_ : AvlTrees.lookup unit k t data), AvlTrees.lookup unit k t data *)
intros k d eq_k lookup0.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (equal_eq k i eq_k); assumption.
(* Goal: forall (k : Int) (_ : Equal k i) (_ : forall (data : unit) (_ : AvlTrees.lookup unit k t data), False), AvlTrees.lookup unit k t tt *)
(* Goal: forall (k : Int) (data : unit) (_ : not (Equal k i)) (_ : AvlTrees.lookup unit k t data), AvlTrees.lookup unit k t data *)
(* Goal: forall (k : Int) (data : unit) (_ : not (Equal k i)) (_ : AvlTrees.lookup unit k t data), AvlTrees.lookup unit k t data *)
intros k eq_k notlookup0.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (equal_eq k i eq_k); assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; assumption.
Qed.


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


Lemma left_p_imp_work :
 forall (goal i : Int) (b : normal_form) (work : nf_list) 
   (ds : disjs) (ni : nested_imps) (ai : atomic_imps) 
   (a : atoms) (context : flist),
 forces0_t a i ->
 nsearch_spec goal (b :: work) ds ni ai a context ->
 nsearch_spec goal (AImp i b :: work) ds ni ai a context.
(* Goal: forall (goal i : Int) (b : normal_form) (work : nf_list) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : forces0_t a i) (_ : nsearch_spec goal (@cons normal_form b work) ds ni ai a context), nsearch_spec goal (@cons normal_form (AImp i b) work) ds ni ai a context *)
intros goal i b work ds ni ai a context forces_i premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni1; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak with b; try assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_t k (nf2form b)), forces_t k (nf2form (AImp i b)) *)
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (AImp i b) work) ds ni1 ai a context *)
(* Goal: deco_sound (@cons normal_form b work) ds ni ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
intros.
apply forces_b__forces_a_imp_b_t with (a := Atom i) (b := nf2form b);
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_cons_work_weak with b; try assumption.
(* Goal: forall _ : forces_t k (nf2form b), forces_t k (nf2form (AImp i b)) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
intros forces_b.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
simpl in |- *; apply forces_b__forces_a_imp_b_t; assumption.

(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_strength with (AImp i b); try assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a k), forces_t k (nf2form (NImp_NF (NImp a0 a1 b))) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_a_a_imp_b__forces_b_t with (Atom i); try assumption.
(* Goal: forces_t k (Atom i) *)
(* Goal: forces_t k (Imp (Atom i) (nf2form b)) *)
(* Goal: nsound (@cons normal_form b work) ds ni ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
apply k_forces_ngamma with (c := NAtom i).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply In_Atoms; assumption.
(* Goal: forces_t k (Imp (Atom i) (nf2form b)) *)
(* Goal: nsound (@cons normal_form b work) ds ni ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
apply k_forces_ngamma with (c := AImp i b).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_work_weak with (AImp i b); try assumption.
(* Goal: forall _ : Derivable context (nf2form (AImp i b)), Derivable context (nf2form b) *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
intros der_ab.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply derivable_a_a_imp_b__derivable_b with (Atom i); try assumption.
(* Goal: Derivable context (Atom i) *)
(* Goal: nminimal (@cons normal_form b work) ds ni ai a context *)
apply sound with (c := NAtom i).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply In_Atoms; assumption.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_cons_work_weak with (AImp i b); try assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_t k (nf2form b)), forces_t k (nf2form (AImp i b)) *)
intros k k_is_mon forces_b.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
simpl in |- *; apply forces_b__forces_a_imp_b_t; assumption.
Qed.


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


Lemma left_p_imp_ai :
 forall (goal i : Int) (work : nf_list) (ds : disjs) 
   (ni : nested_imps) (bs : nf_list) (ai ai' : atomic_imps) 
   (a a' : atoms) (context : flist),
 LOOKUP nf_list i ai bs ->
 EQUIV_DEL nf_list i ai ai' ->
 (forall d : unit, LOOKUP unit i a d -> False) ->
 EQUIV_INS unit i (fun _ : unit => tt) tt a a' ->
 nsearch_spec goal (bs ++ work) ds ni ai' a' context ->
 nsearch_spec goal (NAtom i :: work) ds ni ai a context.
intros goal i work ds ni bs ai ai' a a' context lookup_bs equiv_del
 notlookup_i equiv_ins premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
elim premiss; clear premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni) (_ : deco_sound (@app normal_form bs work) ds ni1 ai' a') (_ : nsearch_spec_result_aux goal (@app normal_form bs work) ds ni1 ai' a' context), nsearch_spec_result goal (@cons normal_form (NAtom i) work) ds ni ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
intros ni1 less1 complete1 spec1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni1; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_a_work with a'; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ai_weak with i bs ai'; assumption.
(* Goal: nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni1 ai a context *)
(* Goal: deco_sound (@app normal_form bs work) ds ni ai' a' *)
(* Goal: nsound (@app normal_form bs work) ds ni ai' a' context *)
(* Goal: nminimal (@app normal_form bs work) ds ni ai' a' context *)
elim spec1; clear spec1.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_a_work with a'; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_work_ai_weak with i bs ai'; assumption.

(* side premisses: Elim premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ai_strength with i ai a; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_ai_strength with i ai a; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_work_a with i a; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ai_weak with i ai; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_a with i a; assumption.
Qed.



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


Lemma left_disj :
 forall (goal : Int) (work : nf_list) (i j : Int) (ds : disjs)
   (ni : nested_imps) (ai : atomic_imps) (a : atoms) 
   (context : flist),
 (forall ni1 : nested_imps,
  le_ni ni ni1 ->
  nsearch_spec goal (NAtom i :: work) ds ni1 ai a (Atom i :: context)) ->
 (forall ni2 : nested_imps,
  eqv_ni ni2 ni ->
  nsearch_spec goal (NAtom j :: work) ds ni2 ai a (Atom j :: context)) ->
 nsearch_spec goal work ((i, j) :: ds) ni ai a context.
(* Goal: forall (goal : Int) (work : nf_list) (i j : Int) (ds : disjs) (ni : nested_imps) (ai : atomic_imps) (a : atoms) (context : flist) (_ : forall (ni1 : nested_imps) (_ : le_ni ni ni1), nsearch_spec goal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context)) (_ : forall (ni2 : nested_imps) (_ : eqv_ni ni2 ni), nsearch_spec goal (@cons normal_form (NAtom j) work) ds ni2 ai a (@cons form (Atom j) context)), nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
intros goal work i j ds ni ai a context left_premiss right_premiss.
(* Goal: nsearch_spec goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
unfold nsearch_spec in |- *; intros complete sound mon.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
elim (filter_deco i ni).
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni ni1) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni1), forces_t k (Atom i)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
intros ni1 le1 forces_i.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
elim (left_premiss ni1 le1); clear left_premiss.
(* Goal: forall (ni2 : nested_imps) (_ : le_ni ni2 ni1) (_ : deco_sound (@cons normal_form (NAtom i) work) ds ni2 ai a) (_ : nsearch_spec_result_aux goal (@cons normal_form (NAtom i) work) ds ni2 ai a (@cons form (Atom i) context)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear forces_i.
(* Goal: forall (ni2 : nested_imps) (_ : le_ni ni2 ni1) (_ : deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a) (_ : nsearch_spec_result_aux a1 (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a (@cons form (Atom a0) context)), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni2 le2 complete2 spec2.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim (inf_deco ni ni2).
(* Goal: forall (ni0 : nested_imps) (_ : le_ni ni0 ni) (_ : eqv_ni ni0 ni2) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni0), or (@In nested_imp (Decorated x k) ni) (@In nested_imp (Decorated x k) ni2)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros ni3 le30 le32 inf3.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim spec2; clear spec2.
(* left_premiss yields a derivation *)
(* Goal: forall _ : Derivable (@cons form (Atom i) context) (Atom goal), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros der2.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim (filter_deco j ni3).
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni3 ni1) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni1), forces_t k (Atom j)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros ni4 le4 forces_j.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim (right_premiss ni4); clear right_premiss.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni4) (_ : deco_sound (@cons normal_form (NAtom j) work) ds ni1 ai a) (_ : nsearch_spec_result_aux goal (@cons normal_form (NAtom j) work) ds ni1 ai a (@cons form (Atom j) context)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear forces_j inf3.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32))) (_ : deco_sound work ds ni1 ai a) (_ : nsearch_spec_result_aux goal work ds ni1 ai a context), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni5 le5 complete5 spec5.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim (inf_deco ni ni5).
(* Goal: forall (ni0 : nested_imps) (_ : le_ni ni0 ni) (_ : eqv_ni ni0 ni5) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni0), or (@In nested_imp (Decorated x k) ni) (@In nested_imp (Decorated x k) ni5)), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros ni6 le60 le65 inf6.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NSearch_Res with ni6.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_inf with ni ni5; try assumption.
(* Goal: deco_sound work (@cons (prod Int Int) (@pair Int Int i j) ds) ni2 ai a *)
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni3 ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply deco_sound_shift_work_ds.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak with (NAtom j); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; right; assumption.

(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear inf6.
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim spec5; clear spec5.
(* Goal: forall _ : Derivable (@cons form (Atom j) context) (Atom goal), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear complete complete2 complete5 mon le65 le60 le5 le4 le30 le32 le2 le1.
(* Goal: forall _ : Derivable (@cons form (Atom j) context) (Atom goal), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros der5.
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NDerivable.
(* Goal: Derivable context (Atom goal) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim der2; clear der2; intros s der_s.
(* Goal: forall (t : proof_term) (_ : derives context t (nf2form NFalsum)), Derivable context (Atom goal) *)
(* Goal: in_ngamma (@cons normal_form NFalsum work) ds ni ai a NFalsum *)
elim der5; clear der5; intros t der_t.
(* Goal: Derivable context (Atom goal) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
elim (sound (NDisj i j)); clear sound.
(* Goal: forall (t : proof_term) (_ : derives context t (nf2form (NDisj i j))), Derivable context (Atom goal) *)
(* Goal: in_ngamma work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a (NDisj i j) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros r der_r.
(* Goal: Derivable context (Atom goal) *)
(* Goal: in_ngamma work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a (NDisj i j) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply Derivable_Intro with (Cas (Atom i) (Atom j) r s t).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply OrFElim; assumption.
(* Goal: in_ngamma work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a (NDisj i j) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply In_Disjs with 0; apply My_NthO.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom j) work) ds ni5 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni6 ai a context *)
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear der2 mon sound.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros k k_is_mon k_forces_ngamma k_notforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_eqv with ni5; try assumption.
(* Goal: forces_ngamma work (@cons (prod Int Int) (@pair Int Int i j) ds) ni2 ai a k *)
(* Goal: forall _ : forces_t k (Atom goal), False *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply forces_ngamma_shift_work_ds.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_cons_work_weak with (NAtom j); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; right; assumption.
(* Goal: eqv_ni ni ni5 *)
(* Goal: eqv_ni ni4 ni *)
(* Goal: deco_sound (@cons normal_form (NAtom j) work) ds ni4 ai a *)
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply eqv_ni_trans with ni4.
(* Goal: eqv_ni ni ni4 *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply eqv_ni_trans with ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: eqv_ni ni ni4 *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply eqv_ni_trans with ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* side premisses: Elim right_premiss.  *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_filter_deco; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_le with ni3; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_inf with ni ni2; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_ds_tail with i j; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_tail with (NAtom i); assumption.

(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear forces_j complete2 complete inf3 mon.
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nsound_eqv with ni.
(* Goal: eqv_ni ni ni4 *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply eqv_ni_trans with ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: nsound (@cons normal_form (NAtom j) work) ds ni ai a (@cons form (Atom j) context) *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nsound_cons_work_cons_context with (c := NAtom j).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_ds_tail with i j; assumption.

(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni4 ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear forces_j complete2 complete inf3 sound.
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nminimal_eqv with ni.
(* Goal: eqv_ni ni ni4 *)
(* Goal: nminimal (@cons normal_form (NAtom j) work) ds ni ai a (@cons form (Atom j) context) *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply eqv_ni_trans with ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
apply nminimal_shift_ds_work_context with (c := NAtom j) (i := i) (j := j);
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; right; assumption.
(* left_premiss yields a counter--model *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
clear right_premiss.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (NAtom i) work) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom goal), False), nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
intros k k_is_mon k_forces_ngamma k_notforces_goal.
(* Goal: nsearch_spec_result goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NSearch_Res with ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: deco_sound work (@cons (prod Int Int) (@pair Int Int i j) ds) ni3 ai a *)
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni3 ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
clear sound mon.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_inf with ni ni2; try assumption.
(* Goal: deco_sound work (@cons (prod Int Int) (@pair Int Int i j) ds) ni2 ai a *)
(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni3 ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply deco_sound_shift_work_ds.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak with (NAtom i); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; left; assumption.

(* Goal: nsearch_spec_result_aux goal work (@cons (prod Int Int) (@pair Int Int i j) ds) ni3 ai a context *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply NRefutable with k.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_eqv with ni2; try assumption.
(* Goal: forces_ngamma work (@cons (prod Int Int) (@pair Int Int i j) ds) ni2 ai a k *)
(* Goal: forall _ : forces_t k (Atom goal), False *)
(* Goal: eqv_ni ni ni2 *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply forces_ngamma_shift_work_ds.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_cons_work_weak with (NAtom i); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; left; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* side premiss: Elim inf???? *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
clear right_premiss.
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply eqv_ni_trans with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* side premisses: Elim left_premiss.  *)
(* Goal: deco_sound (@cons normal_form (NAtom i) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply deco_sound_filter_deco.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: deco_sound work ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply deco_sound_le with ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_ds_tail with i j; assumption.

(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nsound_le with ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: nsound (@cons normal_form (NAtom i) work) ds ni ai a (@cons form (Atom i) context) *)
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nsound_cons_work_cons_context with (c := NAtom i).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_ds_tail with i j; assumption.

(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni1 ai a (@cons form (Atom i) context) *)
apply nminimal_eqv with ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: nminimal (@cons normal_form (NAtom i) work) ds ni ai a (@cons form (Atom i) context) *)
apply nminimal_shift_ds_work_context with (c := NAtom i) (i := i) (j := j).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; left; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
Qed.


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


Lemma left_nimp :
 forall (goal : Int) (work : nf_list) (ds : disjs) 
   (a0 a1 : Int) (b : normal_form) (ni : nested_imps)
   (dni : decorated_nested_imps) (ai : atomic_imps) 
   (a : atoms) (context : flist),
 (forall ni1 : nested_imps,
  le_ni (rev_app dni ni) ni1 ->
  nsearch_spec a1 (AImp a1 b :: NAtom a0 :: work) ds ni1 ai a
    (Atom a0 :: context)) ->
 (forall ni1 : nested_imps,
  le_ni ni1 (rev_app dni ni) ->
  nsearch_spec goal (b :: work) ds ni1 ai a context) ->
 (forall (ni1 : nested_imps) (k : kripke_tree),
  le_ni ni1 (rev_app ((NImp a0 a1 b, k) :: dni) ni) ->
  nsearch_spec goal work ds ni1 ai a context) ->
 nsearch_spec goal work ds (rev_app dni (Undecorated (NImp a0 a1 b) :: ni))
   ai a context.
intros goal work ds a0 a1 b ni dni ai a context left_premiss right_premiss
 fail0.
(* Goal: nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
apply rev_app_lemma2 with dni ni.
(* Goal: forall (dni_ni : nested_imps) (_ : @eq nested_imps dni_ni (rev_app dni ni)), nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
intros dni_ni dni_ni_eq.
(* Goal: nsearch_spec goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
unfold nsearch_spec in |- *.
(* Goal: forall (_ : deco_sound work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a) (_ : nsound work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context) (_ : nminimal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
intros complete sound mon.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
elim (filter_deco a0 dni_ni).
(* Goal: forall (ni1 : nested_imps) (_ : le_ni dni_ni ni1) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni1), forces_t k (Atom a0)), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
intros ni1 le1 forces_a0.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim (left_premiss ni1); clear left_premiss; try assumption.
(* Goal: forall (ni2 : nested_imps) (_ : le_ni ni2 ni1) (_ : deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a) (_ : nsearch_spec_result_aux a1 (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a (@cons form (Atom a0) context)), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni2 le2 complete2 spec2.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim (inf_deco dni_ni ni2).
(* Goal: forall (ni0 : nested_imps) (_ : le_ni ni0 dni_ni) (_ : eqv_ni ni0 ni2) (_ : forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) ni0), or (@In nested_imp (Decorated x k) dni_ni) (@In nested_imp (Decorated x k) ni2)), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni3 le3 eqv3 inf3.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim spec2; clear spec2.
(* left_premiss yields a derivation  *)
(* Goal: forall _ : Derivable (@cons form (Atom a0) context) (Atom a1), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros derivable_a0a1; clear fail0.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim right_premiss with ni3; clear right_premiss; try assumption.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 ni3) (_ : deco_sound (@cons normal_form b work) ds ni1 ai a) (_ : nsearch_spec_result_aux goal (@cons normal_form b work) ds ni1 ai a context), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni4 le4 complete4 spec4.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim (le_app0 ni4 (rev_app dni NNil) ni).
(* Goal: forall (ni11 ni12 : nested_imps) (_ : @eq nested_imps ni4 (@app nested_imp ni11 ni12)) (_ : @eq nat (@length nested_imp ni11) (@length nested_imp (rev_app dni NNil))), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni41 ni42 eq_ni4 len.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with (ni41 ++ Undecorated (NImp a0 a1 b) :: ni42).
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_app_nn; try assumption.
(* Goal: forces_ngamma (@cons normal_form (NImp_NF (nested_imp2nimp (Undecorated (NImp a0 a1 b)))) work) ds (@app nested_imp ni41 ni42) ai a k *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni4.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_trans with ni3; assumption.
(* Goal: deco_sound work ds (@app nested_imp ni41 (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni42)) ai a *)
(* Goal: nsearch_spec_result_aux goal work ds (@app nested_imp ni41 (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni42)) ai a context *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ninni.
(* Goal: forces_ngamma (@cons normal_form (NImp_NF (nested_imp2nimp (Undecorated (NImp a0 a1 b)))) work) ds (@app nested_imp ni41 ni42) ai a k *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni4.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak with b; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; simpl in |- *; apply forces_b__forces_a_imp_b_t; assumption.

(* Goal: nsearch_spec_result_aux goal work ds (@app nested_imp ni41 (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni42)) ai a context *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim spec4; clear spec4.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros der_goal; apply NDerivable; assumption.

(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NRefutable with k; try assumption.
(* Goal: forces_ngamma work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a k *)
(* Goal: forall _ : forces_t k (Imp (Atom a0) (Atom a1)), False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_work_ni_x_ni.
(* Goal: forces_ngamma (@cons normal_form (NImp_NF (nested_imp2nimp (Undecorated (NImp a0 a1 b)))) work) ds (@app nested_imp ni41 ni42) ai a k *)
(* Goal: le_ni ni4 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: deco_sound (@cons normal_form b work) ds ni3 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni4.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_cons_work_weak with b; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; simpl in |- *; apply forces_b__forces_a_imp_b_t; assumption.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_trans with ni3; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.

(* side premiss: Elim right_premiss with ni3 dni3 *)
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_inf with dni_ni ni2; try assumption.
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_strength with (NImp_NF (NImp a0 a1 b)).
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a k), forces_t k (nf2form (NImp_NF (NImp a0 a1 b))) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma.
apply forces_a_a_imp_b__forces_b_t with (Imp (Atom a0) (Atom a1));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
apply
 nminimal_derivable_forces
  with work ds (rev_app dni (Undecorated (NImp a0 a1 b) :: ni)) ai a context;
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_work_ni_x_ni; try assumption.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply derivable_a_context_b__derivable_a_imp_b; assumption.
(* Goal: forces_t k (Imp (Imp (Atom a0) (Atom a1)) (nf2form b)) *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds ni2 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply k_forces_ngamma with (c := NImp_NF (NImp a0 a1 b)).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply deco_sound_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: nminimal work ds (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_strength with (NImp_NF (NImp a0 a1 b)).
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a k), forces_t k (nf2form (NImp_NF (NImp a0 a1 b))) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma.
apply forces_a_a_imp_b__forces_b_t with (Imp (Atom a0) (Atom a1));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
apply
 nminimal_derivable_forces
  with work ds (rev_app dni (Undecorated (NImp a0 a1 b) :: ni)) ai a context;
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: forces_ngamma work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a k *)
(* Goal: forall _ : forces_t k (Imp (Atom a0) (Atom a1)), False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_work_ni_x_ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_eqv with ni2; try assumption.
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply eqv_ni_trans with ni1.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply derivable_a_context_b__derivable_a_imp_b; assumption.
(* Goal: forces_t k (Imp (Imp (Atom a0) (Atom a1)) (nf2form b)) *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds ni2 ai a *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply k_forces_ngamma with (c := NImp_NF (NImp a0 a1 b)).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak2 with (AImp a1 b) (NAtom a0); try assumption.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_t k (nf2form (AImp a1 b))) (_ : forces_t k (nf2form (NAtom a0))), forces_t k (nf2form (NImp_NF (NImp a0 a1 b))) *)
(* Goal: nsound (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon forces_a1_b forces_a1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
simpl in |- *; apply forces_a1_imp_b__forces_a0_imp_a1_imp_b_t; assumption.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_ge with (rev_app dni ni); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_work_weak with (NImp_NF (NImp a0 a1 b)).
(* Goal: forall _ : Derivable (@cons form (Atom a0) context) (nf2form (NImp_NF (NImp a0 a1 b))), Derivable (@cons form (Atom a0) context) (nf2form (AImp a1 b)) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros der.
(* Goal: Derivable context (nf2form b) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (rev_app dni ni) ai a context *)
(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply derivable_a_a_imp_b__derivable_b with (Imp (Atom a0) (Atom a1)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply derivable_a_context_b__derivable_a_imp_b; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply nsound_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: nminimal work ds (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.

(* Goal: nminimal (@cons normal_form b work) ds ni3 ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_eqv with (rev_app dni ni).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: nminimal (@cons normal_form b work) ds (rev_app dni ni) ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_cons_work_weak with (NImp_NF (NImp a0 a1 b)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; simpl in |- *; apply forces_b__forces_a_imp_b_t; assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply nminimal_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: nminimal work ds (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.

(* left premiss yields a counter-model *)
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
clear right_premiss.
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni2 ai a k) (_ : forall _ : forces_t k (Atom a1), False), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma k_nonforces_goal.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim (le_app0 ni3 (rev_app dni NNil) ni).
(* Goal: forall (ni11 ni12 : nested_imps) (_ : @eq nested_imps ni3 (@app nested_imp ni11 ni12)) (_ : @eq nat (@length nested_imp ni11) (@length nested_imp (rev_app dni NNil))), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni31 ni32 eq_ni3 len.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim (fail0 (ni31 ++ Decorated (NImp a0 a1 b) k :: ni32) k); clear fail0.
(* Goal: forall (ni1 : nested_imps) (_ : le_ni ni1 (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32))) (_ : deco_sound work ds ni1 ai a) (_ : nsearch_spec_result_aux goal work ds ni1 ai a context), nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros ni5 le5 complete5 spec5.
(* Goal: nsearch_spec_result goal work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a context *)
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply NSearch_Res with ni5.
(* Goal: le_ni ni5 (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: deco_sound work ds ni5 ai a *)
(* Goal: nsearch_spec_result_aux goal work ds ni5 ai a context *)
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_trans with (ni31 ++ Decorated (NImp a0 a1 b) k :: ni32).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_app_dn; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3; try assumption.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* side premisses: Elim (fail0 ... )  *)
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
simpl in |- *.
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni)) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Decorated (NImp a0 a1 b) k :: ni)).
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni)) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_app_dd.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3; try assumption.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni). 
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_nirni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply k_deco_sound_intro; try assumption.
(* Goal: forces_ngamma work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a k *)
(* Goal: forall _ : forces_t k (Imp (Atom a0) (Atom a1)), False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_shift_work_ni_x_ni.
(* Goal: nminimal (@cons normal_form (NImp_NF (nested_imp2nimp (Decorated (NImp a0 a1 b) k))) work) ds (@app nested_imp ni31 ni32) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3.
(* Goal: forces_ngamma (@cons normal_form (NImp_NF (nested_imp2nimp (Decorated (NImp a0 a1 b) k))) work) ds ni3 ai a k *)
(* Goal: forall _ : forces_t k (Imp (Atom a0) (Atom a1)), False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_cons_work_weak2 with (AImp a1 b) (NAtom a0).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
intros; simpl in |- *; apply forces_a1_imp_b__forces_a0_imp_a1_imp_b_t;
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_ngamma_eqv with ni2; try assumption.
(* Goal: forall _ : forces_t k (Imp (Atom a0) (Atom a1)), False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros forces_a0a1.
(* Goal: False *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds (@app nested_imp ni31 ni32) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply k_nonforces_goal.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_a_a_imp_b__forces_b_t with (Atom a0); try assumption.
(* Goal: forces_t k (Atom a0) *)
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply k_forces_ngamma with (c := NAtom a0).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (NAtom a0) *)
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_tail.
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: nminimal (@cons normal_form (NImp_NF (nested_imp2nimp (Decorated (NImp a0 a1 b) k))) work) ds (@app nested_imp ni31 ni32) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_inf with dni_ni ni2; try assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply deco_sound_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)); assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_weak2 with (AImp a1 b) (NAtom a0); try assumption.
intros; simpl in |- *; apply forces_a1_imp_b__forces_a0_imp_a1_imp_b_t;
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 assumption.

(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
unfold nsound in |- *.
(* Goal: forall (c : normal_form) (_ : in_ngamma work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a c), Derivable context (nf2form c) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros c in_ngamma.
(* Goal: Derivable context (nf2form c) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply sound.
(* Goal: In_NGamma.in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a c *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
elim in_ngamma; clear in_ngamma c.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros n x nth; apply In_Work with n; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros n i j nth; apply In_Disjs with n; assumption.
(* Goal: forall (n : nat) (x : nimp) (_ : my_nth nimp n (nested_imps2nimps (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32))) x), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NImp_NF x) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros n x nth; apply In_Nested_Imps with n.
 rewrite <-
 (eqv_nimps_eq (ni31 ++ Decorated (NImp a0 a1 b) k :: ni32)
    (rev_app dni (Undecorated (NImp a0 a1 b) :: ni)))
 .
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)).
(* Goal: eqv_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv.
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (@app nested_imp (rev_app dni NNil) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_ni_app_dn.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (nested_imp2nimp (Decorated (NImp a0 a1 b) k))) work) ds (@app nested_imp ni31 ni32) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni).
(* Goal: le_ni ni3 (rev_app dni ni) *)
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: forall (i : Int) (b0 : normal_form) (n : nat) (bs : nf_list) (_ : LOOKUP nf_list i ai bs) (_ : my_nth normal_form n bs b0), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (AImp i b0) *)
(* Goal: forall (i : Int) (_ : LOOKUP unit i a tt), in_ngamma work ds (rev_app dni (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni)) ai a (NAtom i) *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros i b0 n bs lookup0 nth.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply In_Atomic_Imps with n bs; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros i lookup; apply In_Atoms; assumption.

(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_work_ni_x_ni.
(* Goal: nminimal (@cons normal_form (NImp_NF (nested_imp2nimp (Decorated (NImp a0 a1 b) k))) work) ds (@app nested_imp ni31 ni32) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- eq_ni3.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_eqv with dni_ni; try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply nminimal_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)); assumption.
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni ni). 
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply eqv_ni_trans with ni1.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ge_eqv; assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- dni_ni_eq; assumption.

(* side premiss: Elim left_premiss with ni1 dni1 H0 H1  *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
clear right_premiss fail0.
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_cons_work_strength with (NImp_NF (NImp a0 a1 b)).
(* Goal: le_ni (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) (rev_app (@cons (prod nimp kripke_tree) (@pair nimp kripke_tree (NImp a0 a1 b) k) dni) ni) *)
(* Goal: deco_sound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a *)
(* Goal: nsound work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: nminimal work ds (@app nested_imp ni31 (@cons nested_imp (Decorated (NImp a0 a1 b) k) ni32)) ai a context *)
(* Goal: le_ni ni3 (@app nested_imp (rev_app dni NNil) ni) *)
(* Goal: eqv_ni dni_ni ni2 *)
(* Goal: le_ni (rev_app dni ni) ni1 *)
(* Goal: deco_sound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros; simpl in |- *. 
apply forces_a0_imp_a1_imp_b__forces_a1_imp_b_t with (Atom a0);
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: forces_t k (Atom a0) *)
(* Goal: forces_t k (Imp (Imp (Atom a0) (Atom a1)) (nf2form b)) *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply H0 with (c := NAtom a0).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (NAtom a0) *)
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_tail.
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: forces_t k (Imp (Imp (Atom a0) (Atom a1)) (nf2form b)) *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply H0 with (c := NImp_NF (NImp a0 a1 b)).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_ni_work with (x := Undecorated (NImp a0 a1 b)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_filter_deco; try assumption.
(* Goal: forall (x : nimp) (k : kripke_tree) (_ : @In nested_imp (Decorated x k) (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1)), forces_t k (Atom a0) *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1) ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros x k in_x.
(* Goal: forces_t k (Atom a0) *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1) ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply forces_a0 with x.
(* Goal: @In nested_imp (Decorated x k) ni1 *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1) ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
inversion_clear in_x.
(* Goal: @In nested_imp (Decorated x k) ni1 *)
(* Goal: @In nested_imp (Decorated x k) ni1 *)
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1) ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 discriminate H.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: deco_sound work ds (@cons nested_imp (Undecorated (NImp a0 a1 b)) ni1) ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_shift_work_ni0.
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds ni1 ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply deco_sound_le with dni_ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
assumption.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
apply deco_sound_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b));
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)); assumption.

(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_le with dni_ni; try assumption.
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_work_weak with (NImp_NF (NImp a0 a1 b)).
(* Goal: forall _ : Derivable (@cons form (Atom a0) context) (nf2form (NImp_NF (NImp a0 a1 b))), Derivable (@cons form (Atom a0) context) (nf2form (AImp a1 b)) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
intros der.
(* Goal: forall (t : proof_term) (_ : derives context t (nf2form NFalsum)), Derivable context (Atom goal) *)
(* Goal: in_ngamma (@cons normal_form NFalsum work) ds ni ai a NFalsum *)
elim der; clear der; intros t der_t.
apply
 Derivable_Intro
  with
    (Abs (Atom a1)
       (App (Imp (Atom a0) (Atom a1)) (Shift t)
          (Abs (Atom a0) (Shift (Var 0))))).
(* Goal: derives (@cons form (Atom a0) context) (Abs (Atom a1) (App (Imp (Atom a0) (Atom a1)) (Shift t) (Abs (Atom a0) (Shift (Var O))))) (nf2form (AImp a1 b)) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
simpl in |- *; apply ImpIntro.
(* Goal: derives (@cons form (Atom a1) (@cons form (Atom a0) context)) (App (Imp (Atom a0) (Atom a1)) (Shift t) (Abs (Atom a0) (Shift (Var O)))) (nf2form b) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ImpElim.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ShiftIntro; assumption.
(* Goal: derives (@cons form (Atom a1) (@cons form (Atom a0) context)) (Abs (Atom a0) (Shift (Var O))) (Imp (Atom a0) (Atom a1)) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ImpIntro.
(* Goal: derives (@cons form (Atom a0) (@cons form (Atom a1) (@cons form (Atom a0) context))) (Shift (Var O)) (Atom a1) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ShiftIntro.
(* Goal: derives (@cons form (Atom a1) (@cons form (Atom a0) context)) (Var O) (Atom a1) *)
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply ByAssumption; apply My_NthO.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
(* Goal: nsound (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (@app nested_imp (rev_app dni NNil) ni) ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nsound_cons_work_cons_context with (c := NAtom a0); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)); assumption.

(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_eqv with dni_ni.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply le_eqv; assumption.
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply nminimal_cons_work_strength with (NImp_NF (NImp a0 a1 b)).
(* Goal: forall (k : kripke_tree) (_ : Is_Monotone_kripke_tree k) (_ : forces_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a k), forces_t k (nf2form (NImp_NF (NImp a0 a1 b))) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
intros k k_is_mon k_forces_ngamma.
simpl in |- *; apply forces_a1_imp_b__forces_a0_imp_a1_imp_b_t;
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 try assumption.
(* Goal: forces_t k (Atom a0) *)
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply k_forces_ngamma with (c := NAtom a0).
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (NAtom a0) *)
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_tail.
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: forces_t k (Imp (Atom a1) (nf2form b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
change (forces_t k (nf2form (AImp a1 b))) in |- *.
(* Goal: forces_t k (nf2form (AImp a1 b)) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply k_forces_ngamma.
(* Goal: in_ngamma (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (AImp a1 b) *)
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
apply in_ngamma_cons_work_head.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds dni_ni ai a (@cons form (Atom a0) context) *)
 rewrite dni_ni_eq.
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (rev_app dni ni) ai a (@cons form (Atom a0) context) *)
 rewrite (rev_app_app dni ni).
(* Goal: nminimal (@cons normal_form (NImp_NF (NImp a0 a1 b)) (@cons normal_form (NAtom a0) work)) ds (@app nested_imp (rev_app dni NNil) ni) ai a (@cons form (Atom a0) context) *)
apply nminimal_shift_ni_x_ni_work with (x := Undecorated (NImp a0 a1 b)).
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
apply nminimal_cons_work_cons_context with (c := NAtom a0); try assumption.
(* Goal: le_ni dni_ni ni1 *)
(* Goal: deco_sound (@cons normal_form (NImp_NF (NImp a0 a1 b)) work) ds dni_ni ai a *)
(* Goal: nsound (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
(* Goal: nminimal (@cons normal_form (AImp a1 b) (@cons normal_form (NAtom a0) work)) ds ni1 ai a (@cons form (Atom a0) context) *)
 rewrite <- (rev_app_app dni (Undecorated (NImp a0 a1 b) :: ni)); assumption.
Qed.



