intros a0 a1 b work ds ni1 ni2 dni1 ai n eqv12 lt1.
apply lt_S_n.
apply
eq_lt_trans
with
(nweight_Sequent work ds
(rev_app dni1 (Undecorated (NImp a0 a1 b) :: ni1)) ai);
try assumption; clear lt1.
unfold nweight_Sequent in |- *.
generalize (nweight_ai ai); clear ai; intros ai.
generalize (nweight_ds ds); clear ds; intros ds.
rewrite <- (nweight_rev_app dni1 (Undecorated (NImp a0 a1 b) :: ni1)).
simpl in |- *.
fold nf2form in |- *.
generalize (nweight (nf2form b)); clear b; intros b.
rewrite (plus_assoc_reverse b (nweight_ni ni1) (nweight_dni dni1)).
rewrite <- (nweight_eqv_ni (rev_app dni1 ni1) ni2 eqv12).
rewrite <- (nweight_rev_app dni1 ni1).
generalize (nweight_ni ni1 + nweight_dni dni1); clear eqv12 ni1 dni1 ni2 n;
intros n.
generalize (nweight_work work); clear work; intros W.
rewrite (plus_assoc_reverse b n ai).
generalize (n + ai); clear n ai; intros n.
rewrite <- (plus_Snm_nSm ds (S (b + n))).
simpl in |- *.
rewrite <- (plus_Snm_nSm ds (b + n)).
simpl in |- *.
rewrite <- (plus_Snm_nSm W (S (ds + (b + n)))).
simpl in |- *.
rewrite <- (plus_Snm_nSm W (ds + (b + n))).
simpl in |- *.
apply S_reg.
apply S_reg.
rewrite (plus_comm b W).
rewrite (plus_assoc_reverse W b (ds + n)).
apply plus_reg.
rewrite (plus_assoc b ds n).
rewrite (plus_comm b ds).
apply plus_assoc_reverse.
Qed.

(* Specifications: *)
Lemma nweight_sequent_nimp_right :
forall (a0 a1 : Int) (b : normal_form) (work : nf_list)
(ds : disjs) (ni1 ni2 : nested_imps) (dni1 : decorated_nested_imps)
(ai : atomic_imps) (n : nat),
eqv_ni (rev_app dni1 ni1) ni2 ->
nweight_Sequent work ds (rev_app dni1 (Undecorated (NImp a0 a1 b) :: ni1))
ai < S n -> nweight_Sequent (b :: work) ds ni2 ai < n.