Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Re: problem with dependant types (june andronick)

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Re: problem with dependant types (june andronick)


chronological Thread 
  • From: casteran AT labri.fr
  • To: Yves Bertot <Yves.Bertot AT sophia.inria.fr>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Re: problem with dependant types (june andronick)
  • Date: Sat, 13 Nov 2004 08:50:07 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hi Yves,


Selon Yves Bertot 
<Yves.Bertot AT sophia.inria.fr>:

> This message may be redundant with Pierre Castéran's answers, but I did
> try to stay very close to your development so that it may still be useful.


Not at all :-)

I think both approaches will make a beautiful case study on dependant
types. By the way, I improved slightly the approach of using
recursion principles for vectors of equal length.
Once vector_double_rect defined, and used to define the mapping
of a binary operation to vectors of length n, it is easy to use
it to prove June's theorem. This makes a very short
proof, and all the machinery about vectors of length 0 and  (S n)
remains encapsulated in the derivation of vector_double-rect.


Lemma nth_op : forall  (A:Set)(bin_op : A -> A -> A)
      (n:nat)  (v1 v2: vector A  (S n)) i  a b,
      vector_nth i v1 = Some a ->
      vector_nth i v2 = Some b ->
      vector_nth i (vector_bin_op A bin_op _ v1 v2) = Some (bin_op a b).
Proof.
 intros A bin_op n v1 v2; pattern (S n),v1,v2.
 apply vector_double_rect.
 simpl.
 destruct i; discriminate 1.
 destruct i; simpl;auto.
 injection 1; injection 2;intros; subst a; subst b; auto.
Qed.



Pierre




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




Archive powered by MhonArc 2.6.16.

Top of Page