Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Doubt about In

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Doubt about In


Chronological Thread 
  • From: Arthur Azevedo de Amorim <arthur.aa AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Doubt about In
  • Date: Mon, 22 Feb 2016 17:32:46 +0000
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=arthur.aa AT gmail.com; spf=Pass smtp.mailfrom=arthur.aa AT gmail.com; spf=None smtp.helo=postmaster AT mail-oi0-f51.google.com
  • Ironport-phdr: 9a23:7aCT/BzCOSCYBmXXCy+O+j09IxM/srCxBDY+r6Qd0e4fIJqq85mqBkHD//Il1AaPBtWEra8YwLOO6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6NyZnrnLnqo9X6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVWqLjOq88ULZwDTI8Mmlz6te4mwPESF6m/GccT39euwhFHQXJ61n2U9/Ytyzgt+81jCCAIc3rV/Y9UByt6q5qTFnjjyJRZG1xy33elsEl1PETmxmmvREqm4M=

Hi Saulo,

In order to prove this theorem, you need to assume that E has decidable equality:

Require Import Coq.Lists.List.
Import ListNotations.

Theorem strong_in_inv:
  forall E (l: list E) e f,
    (forall x y : E, x = y \/ x <> y) ->
    In f (e :: l) -> e = f \/ (e <> f /\ In f l).
Proof.
  intros R l e f eq_dec.
  simpl.
  destruct (eq_dec e f) as [H | H].
  - intros _. left. trivial.
  - intros [? | H']; try congruence.
    now right; split; trivial.
Qed.

Em seg, 22 de fev de 2016 às 12:27, Saulo Araujo <saulo2 AT gmail.com> escreveu:
Hi,

I am in the middle of a proof in which I need the following theorem:

Theorem strong_in_inv:
  forall E (l: list E) e f,
    In f (e :: l) -> e = f \/ (e <> f /\ In f l).

Unfortunately, I was not able to complete the proof below:

Proof.
  intros.
  simpl in H.
  destruct H.
  {
    left.
    apply H.
  }
  {
    right.
    split.
    {
(* I am stuck here! *)
    }
    {
      apply H.
    }
  }
Qed.




Archive powered by MHonArc 2.6.18.

Top of Page