Skip to Content.
Sympa Menu

coq-club - Re: RE : Re: [Coq-Club]Type system in Coq

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: RE : Re: [Coq-Club]Type system in Coq


chronological Thread 
  • From: Roland Zumkeller <Roland.Zumkeller AT polytechnique.fr>
  • To: nouvid-coq AT yahoo.fr
  • Cc: Coq Club <coq-club AT pauillac.inria.fr>
  • Subject: Re: RE : Re: [Coq-Club]Type system in Coq
  • Date: Wed, 7 Jun 2006 17:50:19 +0200
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=fH2E2cP0nw4+IBtidxS9HoGnxVZQ/e7xSOONu7HLMQx+u3X3XraAdpkEkl8qVseUdK48TYEW7pa2NH47MMa2ohFwjdoKukqqQcxPhGIULh52WoHV01kwzhASYrCmbx4CkFk3uyDvCdKPHDqvjjl3Apd++SzTJ/VQcjL5ARhW42s=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

On Jun 7, 2006, at 2:09 PM, Fabrice Lemercier wrote:
Unfortunately my example was
too simplified compare to the original type system I
am dealing with. Here is a less simplified version.
Can you prove the goal?

  Inductive Trm : Set :=
    trm : nat->Trm.

  Inductive Typ : Trm*nat->Set :=
    axiom : forall n, Typ (trm n, n).

You'll need to provide an elimination predicate. Think of "eq_rec" as a type cast here. To get rid of it one can use Streicher's axiom K, which happens to be verified by types with decidable equality.

  Goal forall t:Trm, forall n, forall x y:Typ (t,n), x=y.
  intros; refine(
match x as x0 in Typ tn0, y as y0 in Typ tn1 return forall (H:tn0=tn1), eq_rec _ Typ x0 _ H = y0 with
    | axiom _, axiom _ => fun H => _
    end (refl_equal _)).
  generalize H.
  inversion H.
  Require Import Eqdep_dec.
  intros; pattern H0; apply K_dec_set.
    repeat (decide equality).
    apply refl_equal.
  Qed.

However this is likely to become rather complicated when you try to prove more interesting things. If you tell us a little more about your type system, perhaps someone could suggest a different way to do describe it in Coq.

Best,

Roland

--
http://www.lix.polytechnique.fr/~zumkeller/





Archive powered by MhonArc 2.6.16.

Top of Page