proposition: Lemma app_cancel_same_length_r : forall l1 l2 t1 t2, l1 ++ l2 = t1 ++ t2 -> length l2 = length t2 -> l1 = t1 /\ l2 = t2.
proof: Proof. Proof using. intros l1. induction l1; introv He Hl; rew_list in *. { gen l2. destruct t1; rew_list; intros. { autos*. } { destruct l2 as [|x l2']; inverts He. rew_list in Hl. math. } } { destruct t1; rew_list in *. { subst t2; rew_list in*; try math. } { inverts He. forwards* (->&->): IHl1 H1. } } Qed.
imports: Coq.Classes.Morphisms TLC(LibTactics LibLogic LibReflect LibOperation LibProd LibOption LibNat LibInt LibWf LibMonoid LibRelation)