Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] proof with as

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] proof with as


Chronological Thread 
  • From: Dominique Larchey-Wendling <dominique.larchey-wendling AT loria.fr>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] proof with as
  • Date: Tue, 18 May 2021 09:59:20 +0200 (CEST)
  • Ironport-hdrordr: A9a23:epEMiq21PlkWBhU/QGl3iQqjBIwkLtp133Aq2lEZdPUzSL3gqynOpoV86faQslsssR4b+OyoFI2hbBrnhPlICOUqTNSftXDdyQ+VxeNZgbcKsgePJ8SWzIc0vpuIFZIOauEYZmIK6PoSjjPZLz6JrePszEnRv4jj80s=

Hi Patricia,

In the context of the request H0, ys is *defined* as ys := x::s
hence eq_refl would give you a valid proof term for H0. 
For instance, you could try this:

Require Import List Arith Lia.

Theorem neq_nil_cons (A:Type) (x:A)(y:list A)(z:list A)(p:cons x y = z): not (z=nil).
Proof. now subst. Qed.

Fixpoint proof1 (A:Type)(l:list A) : 2 <= length l -> tail l <> nil.
Proof.
  refine( match l with 
    | x :: (y :: s) as ys => fun _ => neq_nil_cons A y s ys _
    | _ => _
  end).
  1,2: now simpl; lia. (* here are the other cases nil and _::nil *)
  reflexivity. (* here is the place of H0 *)
Qed.

Best,

Dominique


De: "Patricia Peratto" <psperatto AT vera.com.uy>
À: "coq-club" <coq-club AT inria.fr>
Envoyé: Lundi 17 Mai 2021 19:55:30
Objet: [Coq-Club] proof with as

I have proved a theorem:


Theorem neq_nil_cons (A:Type(x:A)(y:list A)(z:list A)(p:cons x y = z): not (z=nil).


I have a Fixpoint:


Fixpoint proof1 (A:Type)(l:list A) :=

match l with

| x :: (y :: s) as ys => neq_nil_cons A y s ys H0

| _ => something

end.


In the place of H0 I need a proof that (cons y s)=ys.


How I can do this?


Regards,

Patricia





Archive powered by MHonArc 2.6.19+.

Top of Page