Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Pattern matching on vectors

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Pattern matching on vectors


chronological Thread 
  • From: Laurent Th�ry <Laurent.Thery AT sophia.inria.fr>
  • To: Jeff Vaughan <jeff AT seas.harvard.edu>
  • Cc: Coq List <coq-club AT pauillac.inria.fr>
  • Subject: Re: [Coq-Club] Pattern matching on vectors
  • Date: Fri, 09 Oct 2009 02:17:16 +0200
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi,

yep you have to break the dependance in the equality.
Adam's idea but with tactic:

Lemma openVector: forall A n (v: vector A (S n)),
   exists a, exists v0, v = vcons a v0.
intros A n v.
change
((fun n: nat => match n return vector A n -> Prop with
  O => fun _ => True (* what you want *)
| S n1 => fun v =>
     exists a : A, exists v0 : vector A n1, v = vcons a v0
end) (S n) v).
dependent inversion v as [|n1 a1 v1].
exists a1; exists v1; auto.
Qed.






Archive powered by MhonArc 2.6.16.

Top of Page