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: Saulo Araujo <saulo2 AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Doubt about In
  • Date: Mon, 22 Feb 2016 18:42:35 -0300
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=saulo2 AT gmail.com; spf=Pass smtp.mailfrom=saulo2 AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f178.google.com
  • Ironport-phdr: 9a23:xJyCYRblks8KAoh79ryTX0L/LSx+4OfEezUN459isYplN5qZpc++bnLW6fgltlLVR4KTs6sC0LqJ9f28EjVcsN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDtvcCPKFwU1XKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrtBST8iLmod5cvxtBCFQxHcyGEbVzAtmwdMBEDs9hjnXJC55jDzq+56ggGVOMT3SfY/XjH0vPQjcwPhlCpSb21xy2rQkMEl1K8=

Hi Clément,

Thanks for pointing out that the theorem is true in a non-constructive setting.

Sincerely,
Saulo

On Mon, Feb 22, 2016 at 2:51 PM, Clément Pit--Claudel <clement.pit AT gmail.com> wrote:
Indeed, this theorem does not seem to be true in general. Could it be that it looks intuitively true because it holds in the classical framework?

Require Import List.
Require Import Classical.

Theorem strong_in_inv:
  forall E (l: list E) e f,
    In f (e :: l) -> e = f \/ (e <> f /\ In f l).
Proof.
  intros.
  simpl in H.
  destruct H.
  left; assumption.
  classical_right; tauto.
Qed.

Note how ‘classical_right’ (instead of ‘right’ in your proof) gives you ‘not (e = f)’.

Clément.

On 02/22/2016 12:32 PM, Arthur Azevedo de Amorim wrote:
> 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 <mailto: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