I'm trying to prove something in coq
I have and Inductive prop type named in_order_merge which is a relation between three lists that shows third one is in_order merge of first two, here is the definition.
Inductive in_order_merge {X : Type} : list X -> list X -> list X -> Prop :=
| iom_nil : in_order_merge [ ] [ ] [ ]
| iom_merge_l x l1 l2 l (H: in_order_merge l1 l2 l) :
in_order_merge (x :: l1) l2 (x :: l)
| iom_merge_r x l1 l2 l (H: in_order_merge l1 l2 l) :
in_order_merge l1 (x :: l2) (x :: l).
I want to prove that if one of the lists is empty then this preposition means the non-empty one equals the third list. clearly induction on hypothesis (constructors) is the way to go but my problem comes when i get to second constructor and the fact that one of the lists is empty is completely demolished.
here is the lemma and it's proof:
Lemma iom_l_nil: forall X : Type, forall l2 l : list X, in_order_merge [ ] l2 l -> l2 = l.
Proof. intros. induction H.
- reflexivity.
- admit.
- rewrite IHin_order_merge. reflexivity.
Admitted.
and this is my proof-view on second branch:
X: Type
x: X
l1, l2, l: list X
H: in_order_merge l1 l2 l
IHin_order_merge: l2 = l
1/1
l2 = x :: l
can anyone help me with what i can do to avoid this issue.