coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Frederic Chyzak <frederic.chyzak AT inria.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] an awkward question about "case" tactic
- Date: Tue, 10 Feb 2015 17:54:20 +0100
Hi,
Following:
On Tue, 2015-02-10 at 16:33 +0000, Matej Kosik wrote:
> Why is the third occurrence of the free variable "a" in the original
> goal treated in a different way than its first and the second
> occurrences?
I tried using destruct (which was described to me as the “smart case”)
and e- variants instead of case, leading to further related questions:
(* Why will destruct fail on error here, while it does not in foo3
below? *)
Lemma foo1 (a : nat) : (fun c : nat => c + a + a = 42) a.
Proof.
Fail destruct a.
Abort.
(* This yields the same result as with case. What more does the 'e' do
here? *)
Lemma foo2 (a : nat) : (fun c : nat => c + a + a = 42) a.
Proof.
edestruct a.
Abort.
(* Both following variants replace all occurrences of a. Why is it now
possible? *)
Lemma foo3 (a : nat) : (fun c : nat => c + a + a = 42) a -> False.
Proof.
destruct a.
Abort.
Lemma foo4 (a : nat) : (fun c : nat => c + a + a = 42) a -> False.
Proof.
edestruct a.
Abort.
(* Just for reference: ssreflect does it with the three replacements. *)
Require Import ssreflect.
Lemma foo5 (a : nat) : (fun c : nat => c + a + a = 42) a.
Proof.
case: a.
Abort.
Frédéric
- [Coq-Club] an awkward question about "case" tactic, Matej Kosik, 02/10/2015
- Re: [Coq-Club] an awkward question about "case" tactic, Jonathan Leivent, 02/10/2015
- Re: [Coq-Club] an awkward question about "case" tactic, Jean-Francois Monin, 02/10/2015
- Re: [Coq-Club] an awkward question about "case" tactic, Frederic Chyzak, 02/10/2015
- Re: [Coq-Club] an awkward question about "case" tactic, Enrico Tassi, 02/11/2015
- Re: [Coq-Club] an awkward question about "case" tactic, Jonathan Leivent, 02/10/2015
Archive powered by MHonArc 2.6.18.