Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Vectors

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Vectors


chronological Thread 
  • From: S�bastien Hinderer <Sebastien.Hinderer AT loria.fr>
  • To: Coq <coq-club AT pauillac.inria.fr>
  • Subject: [Coq-Club] Vectors
  • Date: Fri, 2 Apr 2004 11:23:32 +0200
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Dear all,

Assume the followng definitions, inspired by the Bvector module of Coq's
standard library :

Section VECTORS.

Variable A : Set.

Inductive vector : nat -> Set :=
  | Vnil : vector 0
  | Vcons : forall (a:A) (n:nat), vector n -> vector (S n).

Implicit Arguments Vcons [n].

Definition Vhead : forall n:nat, vector (S n) -> A.
Proof.
        intros n v; inversion v as [|a p w]; exact a.
Defined.

Implicit Arguments Vhead [n].

Definition Vtail : forall n:nat, vector (S n) -> vector n.
Proof.
        intros n v; inversion v as [| a p w]; exact w.
Defined.

Implicit Arguments Vtail [n].

(How) Is it sossible to prove the following theorem in Coq ?

Theorem VSn_eq :
  forall (n : nat) (v : vector (S n)),
  v = Vcons (Vhead v) (Vtail v).


Thanks in advance for your help,
Sébastien.




Archive powered by MhonArc 2.6.16.

Top of Page