Definition list_length_induction :
  forall P : list A -> Type,
  (forall l1 : list A,
   (forall l2 : list A, length l2 < length l1 -> P l2) -> P l1) ->
  forall l : list A, P l.

Theorem app_inv_app2 : forall l1 l2 l3 l4 a b, l1 ++ l2 = l3 ++ a :: b :: l4 -> (exists l5 : list A, l1 = l3 ++ a :: b :: l5) \/ (exists l5 : _, l2 = l5 ++ a :: b :: l4) \/ l1 = l3 ++ a :: nil /\ l2 = b :: l4.