coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Laurent Thery <Laurent.Thery AT inria.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] smarter fold tactic
- Date: Mon, 3 Aug 2020 20:08:05 +0200
Hi,
sure, going under binders is always problematic. There is
the under tactic :
======================
Require Import ZArith.
Require Import ssreflect.
Definition twice (x:Z) : Z := x+x.
Open Scope Z_scope.
Lemma twiceFold (x:Z) : x+x = twice x.
Proof using.
reflexivity.
Qed.
Lemma xx : List.map (fun x => x + x) nil = nil.
Proof.
under List.map_ext => m do rewrite -/(twice _).
=================
but it may not be enough for your use case...
--
Laurent
On 8/3/20 7:14 PM, Abhishek Anand wrote:
> Lemma xx : forall (x:Z), x + x =0.
> Proof using.
> Fail progress rewrite -/(twice _).
> setoid_rewrite twiceFold.
- [Coq-Club] smarter fold tactic, Abhishek Anand, 08/01/2020
- Re: [Coq-Club] smarter fold tactic, Laurent Thery, 08/01/2020
- Re: [Coq-Club] smarter fold tactic, Abhishek Anand, 08/03/2020
- Re: [Coq-Club] smarter fold tactic, jonikelee AT gmail.com, 08/03/2020
- Re: [Coq-Club] smarter fold tactic, Laurent Thery, 08/03/2020
- Re: [Coq-Club] smarter fold tactic, Abhishek Anand, 08/03/2020
- Re: [Coq-Club] smarter fold tactic, Laurent Thery, 08/01/2020
Archive powered by MHonArc 2.6.19+.