coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Math Prover <mathprover AT gmail.com>
- To: Yucheng Zhang <yczhang89 AT gmail.com>
- Cc: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k"
- Date: Fri, 31 May 2013 23:50:36 -0700
Very nice/clever, thanks!
On Fri, May 31, 2013 at 11:39 PM, Yucheng Zhang <yczhang89 AT gmail.com> wrote:
On Jun 1, 2013, at 12:56 PM, Math Prover <mathprover AT gmail.com> wrote:I've got a "magic" that's close to your need.
> Now, I want to tactic "magic", s.t. "magic n k" gives me the cases: n=0, n=1, ..., n=k-1, and n>=k.
Ltac magic n k :=
match k with
| O => idtac
| S ?k' => destruct n; [ | magic n k' ]
end.
(* An example *)
Parameter P : nat -> Prop.
Goal forall n:nat, P n.
Proof.
intro.
magic n 10.
Abort.
- [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/01/2013
- [Coq-Club] Re: Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/01/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Yucheng Zhang, 06/01/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/01/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Pierre Courtieu, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Yucheng Zhang, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Yucheng Zhang, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Pierre Courtieu, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Math Prover, 06/01/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", gallais, 06/03/2013
- Re: [Coq-Club] Destructing a "nat" into 0, 1, 2, 3, ..., k-1 and ">= k", Vincent Demange, 06/03/2013
Archive powered by MHonArc 2.6.18.