coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Edsko de Vries <devriese AT cs.tcd.ie>
- To: St�phane Lescuyer <lescuyer AT lri.fr>
- Cc: Julien Forest <forest AT ensiie.fr>, anabelcesar <anabelcesar AT gmail.com>, coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] families of sets extension
- Date: Mon, 30 Mar 2009 14:19:39 +0100
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hi,
On 30 Mar 2009, at 13:21, Stéphane Lescuyer wrote:
To rebound on Julien's reply, just a more general remark : it is
almost always harder to reason about tail-recursive functions because
you need to manually introduce the adequate invariant on the
accumulator (in that case, the function F) in your induction
principles.
For instance, to prove your lemma, you could have proven the following
(more general) result by induction on n, by adding a property on F :
Lemma for_aa : forall (n nf : nat) (F : nat -> Set),
(forall m, m < nf -> F m = unit) ->
forall m, m <= n+nf -> iterated_unit_ext F n m = unit.
A good way to proceed is Julien's : start by writing a lemma showing
that your function is equal to the non tail-recursive version you
could have written. Then use this lemma to rewrite instead of using
conversion.
I just wanted to emphasize that you can use Julien's solution in many
cases since it is more general that it may look.
That is very interesting, thanks for that remark. Are you aware of other examples of this that I could look up?
Edsko
- [Coq-Club] families of sets extension, anabelcesar
- Re: [Coq-Club] families of sets extension,
Julien Forest
- Re: [Coq-Club] families of sets extension, anabelcesar
- Re: [Coq-Club] families of sets extension,
Stéphane Lescuyer
- Re: [Coq-Club] families of sets extension, Edsko de Vries
- Re: [Coq-Club] families of sets extension,
Stéphane Lescuyer
- Re: [Coq-Club] families of sets extension,
James McKinna
- Re: [Coq-Club] families of sets extension, Sean Wilson
- Re: [Coq-Club] families of sets extension,
James McKinna
- Re: [Coq-Club] families of sets extension,
Stéphane Lescuyer
- Re: [Coq-Club] families of sets extension, Edsko de Vries
- <Possible follow-ups>
- Re: [Coq-Club] families of sets extension, Sean Wilson
- Re: [Coq-Club] families of sets extension,
Julien Forest
Archive powered by MhonArc 2.6.16.