15 lines
425 B
Coq
15 lines
425 B
Coq
From mathcomp Require Import all_ssreflect.
|
|
|
|
(** * Using [exists] *)
|
|
(* https://coq.zulipchat.com/#narrow/stream/237977-Coq-users/topic/exists.20with.20ssreflect *)
|
|
Goal forall w:seq nat,
|
|
(exists w1 w2: seq nat, w = (w1 ++ w2)%list /\ (length w)==0%nat) -> w = [::].
|
|
Proof.
|
|
move=> w [w1 [w2]].
|
|
by case; case: w; case: w1; case: w2. (* ✓ *)
|
|
Restart.
|
|
move=> w [w1 [w2]] [_].
|
|
rewrite size_eq0.
|
|
by apply/eqP.
|
|
Qed.
|