Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Proving List with Concatenation operation is monoid.

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Proving List with Concatenation operation is monoid.


Chronological Thread 
  • From: mukesh tiwari <mukeshtiwari.iiitm AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Proving List with Concatenation operation is monoid.
  • Date: Mon, 8 Sep 2014 13:26:06 +0530

Thank you Beta Ziliani and Casteran Pierre.

On Mon, Sep 8, 2014 at 12:46 PM, Beta Ziliani
<beta AT mpi-sws.org>
wrote:
> More importantly, Mukesh, you need to know that the very purpose of Coq is
> to check proofs: if it accepted your proof at Qed, then that is a valid
> proof.
>
> Best,
> Beta

The hesitation was because of I never used exists.

>
>
>
>
> On Mon, Sep 8, 2014 at 9:08 AM, Casteran Pierre
> <pierre.casteran AT labri.fr>
> wrote:
>>
>> Hi,
>>
>> I think your proof is correct, but too complex.
>> Since list concatenation is already a function (if you use Standard
>> Library's one), you don't need to do a proof by cases.
>>
>>
>> Require Import List.
>> Theorem list_monoid : forall ( X : Type ) ( l1 l2 : list X ), exists (
>> l3 : list X ),
>> l1 ++ l2 = l3.
>> Proof.
>> intros X l1 l2 ; now exists (l1 ++ l2).
>> Qed.
>>
>>
>> Pierre

Right now I am learning Coq from software foundation so no import of
library. Thank you for simple and elegant proof.

-Mukesh Tiwari
>>
>>
>>
>>
>>
>> Le 08/09/2014 08:31, mukesh tiwari a écrit :
>>
>>> intros X l1 l2. destruct l1 as [ | h' l1'].
>>> Case "l1 = nil".
>>> simpl. exists l2. reflexivity.
>>> Case "l1 = cons h' l1'".
>>> simpl. exists ( h' :: l1' ++ l2 ). reflexivity.
>>
>>
>



Archive powered by MHonArc 2.6.18.

Top of Page