diff options
| author | Olivier Laurent | 2019-11-26 19:43:42 +0100 |
|---|---|---|
| committer | Olivier Laurent | 2019-12-06 14:34:30 +0100 |
| commit | d7ee99a2d73a83fe02d49c0faa53d12894486a78 (patch) | |
| tree | e3107062fe66d4f5863799c36835a03446cb374f | |
| parent | c4e906383824dad74083a89013b65d03ae530cc9 (diff) | |
add elt_eq_unit
| -rw-r--r-- | theories/Lists/List.v | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/theories/Lists/List.v b/theories/Lists/List.v index f6bd7d1460..5aea97dd6b 100644 --- a/theories/Lists/List.v +++ b/theories/Lists/List.v @@ -199,6 +199,14 @@ Section Facts. apply app_cons_not_nil in H1 as []. Qed. + Lemma elt_eq_unit : forall l1 l2 (a b : A), + l1 ++ a :: l2 = [b] -> a = b /\ l1 = [] /\ l2 = []. + Proof. + intros l1 l2 a b Heq. + apply app_eq_unit in Heq. + now destruct Heq as [[Heq1 Heq2]|[Heq1 Heq2]]; inversion_clear Heq2. + Qed. + Lemma app_inj_tail : forall (x y:list A) (a b:A), x ++ [a] = y ++ [b] -> x = y /\ a = b. Proof. |
