intros ni1 ni21 ni22.
generalize ni1; clear ni1.
elim ni21; clear ni21.
simpl in |- *; intros ni1 le.
exists NNil ni1.
trivial.
trivial.
intros x ni21 ih ni1.
case ni1; clear ni1.
intros le; elimtype False; inversion_clear le.
simpl in |- *; intros x' ni1 le1.
elim (ih ni1); clear ih.
intros ni11 ni12 eq len.
exists (x' :: ni11) ni12.
rewrite eq.
trivial.
simpl in |- *.
rewrite len; trivial.
inversion_clear le1; assumption.
Qed.

Lemma le_ni_app_nn :
forall (ni1 ni2 ni3 ni4 : nested_imps) (x : nimp),
length ni1 = length ni3 ->
le_ni (ni1 ++ ni2) (ni3 ++ ni4) ->
le_ni (ni1 ++ Undecorated x :: ni2) (ni3 ++ Undecorated x :: ni4).