Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] (Not) About mutual recursion

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] (Not) About mutual recursion


chronological Thread 
  • From: Jean-Francois Monin <jean-francois.monin AT imag.fr>
  • To: Gyesik Lee <leegys AT gmail.com>
  • Cc: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] (Not) About mutual recursion
  • Date: Tue, 12 Oct 2010 23:40:21 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=iGDoQz5l+rEERPX9HdpTBWEmqbk4vuthOST3eQDjyJRfWTFvA+Oc8CHwRLYQhquGWG 5zgFNfL5odognrI1QMUg7Zdz55gyDngHXS3S3TMuADedVEU8KyB39FtDCVU6tbMQRA0F Q3jR5d6HQMjHXoH9rBXIwqmqqJRlRe2qNw2xU=

Hello,

There is a simple solution without bool.

Fixpoint VarInk (t:toto) : Prop -> Prop :=
  fun A => 
  match t with
    | Var        => True
    | Unit       => A
    | Plus t0 t1 => (VarInk t0 (VarInk t1 A))
  end.

What you want is (VarInk t False).

Proving 

Lemma VarInk_unicity : 
  forall (t : toto) (A: Prop), unicity A -> unicity (VarInk t A).

is a piece of cake.

Of course
Definition unicity (P:Prop) := forall (p q: P), p=q.


If you need the equivalence with your
original definition, just prove (rather simple):

Lemma varin_varink : forall t A, VarIn t \/ A -> VarInk t A.
Lemma varink_varin : forall t A, VarInk t A -> VarIn t \/ A.

Hope this helps,
JF

On Tue, Oct 12, 2010 at 02:40:28AM +0900, Gyesik Lee wrote:
> Hi,
> 
> I am not sure if the title of the message is adequate, so I apologize
> in advance for any possible confusion.
> 
> ========================
> 
> (* Consider the following inductive definition.*)
> 
> Inductive toto : Type :=
>   Var   : toto
> | Unit  : toto
> | Plus  : toto -> toto -> toto.
> 
> (* Now I would like to check if a (t : toto) contains [Var] or not.
> One possible definition is as follows *)
> 
> Fixpoint VarIn (t:toto) : Prop :=
>   match r with
>     | Var        => True
>     | Unit       => False
>     | Plus t0 t1 => (VarIn t0) \/ (VarIn t1)
>   end.
> 
> (* What I don't like with this definition is that I don't have the
> proof unicity without using proof-irrelevance.
> This doesn't mean that I don't like proof-irrelevance.
> 
> Lemma VarIn_unicity : forall (t : toto) (p q : VarIn t), p = q.
> 
> 

-- 
Jean-Francois Monin
CNRS-LIAMA, Project FORMES  &  Universite de Grenoble 1

Office 3-605, FIT, Tsinghua University
Haidian District, Beijing 100084, CHINA
Tel: +86 10 62 79 69 79 ext 605
Fax@LIAMA:
 +86 10 6264 7458



Archive powered by MhonArc 2.6.16.

Top of Page