coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gaetan Gilbert <gaetan.gilbert AT ens-lyon.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Is there a tactic to do this in a convenient way?
- Date: Sat, 12 Nov 2016 18:27:57 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT ens-lyon.fr; spf=Pass smtp.mailfrom=gaetan.gilbert AT ens-lyon.fr; spf=None smtp.helo=postmaster AT labbe.ens-lyon.fr
- Ironport-phdr: 9a23:+sHCIRf2/1YhYeSB+4ZDsTuDlGMj4u6mDksu8pMizoh2WeGdxcu8Zx7h7PlgxGXEQZ/co6odzbGH6Oa4BidZuc/JmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanb75/KBu7oR/NusQUjoduN7o9xgbUqXZUZupawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnFVguP+2ATUn4KnRpSAgjK9w/1U5HsuSbnrOV92S2aPcrrTbAoXDmp8qlmRAP0hCoBKjU09nzchM5tg6JBuB+vugJxw4DUbo+WOvRxcKzSctEGSmRORctRSy9MD5mgY4cTAecMP+BVpJT9qVsUqhu+ABGhCuL1xTBWmn/5x6s62PkgHwHH2AwvBMwBsG7IrN7oM6oSXvq6w7fUzTrZafNawzj96InMch86v/6MR65wfNHPxkkpDAPJl1GQqIziPzOTzOgNvXKb4vNmWOmyiGAnsxl8riWgy8swkIXEhIAYxkrZ+Sh4wos5P8O0RFBlbdK8E5ZdtDuWO5Z1T888WW1ltjo2xqcItJO5eiUB1Y4pyATFa/OddoiF+hLjW/iVITd/nH9lfKiwiA2p/ke+0OHzSM+00E1ToipBktjMsXYN2wbd6sidUvd9/0Gh1iiT1w3L9+1JLlw4mbDZJpMj2LI8i5sevEbZEiPohkn6kreadkA+9eip7+TnbK/mppiZN4JshQHxKLohmtClDuQ+KAQOUGmb+eCn27L95035XK5HgeMwkqnCqZzaIcQapqm/AwNP3IYj8Q6zDy2639QAgXkHMFVFdQqbgIjuIlHCOez3DfOig1u3izpr3PDHPrj5AprXNHTDkbHhfax860FG0gYzw8pftNpoDeQKJ+u2UUvsvvTZCAU4Okq62bXJEtJ4g6wXVH6GBOe2MafYvEWUrrYgKuSQbYlTtzf5IfU/+9bji2R8nU4ae++nx81EOziDAv16LhDBMjLXidAbHDJSsw==
How about using an evar:
Variables (A B C : Type).
Hypothesis long_term : A -> B -> C.
Variable some_goal : Type.
Goal some_goal.
Proof.
evar (Hty : Type).
assert (H : Hty).
- red. (* apply doesn't unfold [Hty := ?Hty] and therefore doesn't figure out that it can unify. *)
apply long_term.
+ admit. (* A *)
+ admit. (* B *)
- subst Hty. (* get rid of Hty := C *)
admit. (* finish the proof, now with an hypothesis H : C *)
Abort.
As you can see we don't need to refer to A/B/C and long_term only appears once.
Gaëtan Gilbert
On 12/11/2016 16:42, Chris Dams wrote:
Dear all,
In a proof I have a long and complicated term (let us call it long_and_complicated_term) that is of a type that is of the form A -> B -> C where all of A, B, and C are also long and complicated. Because these terms are long and complicated I do not want to cut and paste them into my proof script. I don't mind having long_and_complicated_term in my proof script because it cannot really be avoided but I do want to have it only once. I would like to have a tactic that adds C as hypothesis and generates A and B as goals of the proof and then allows me to continue with the proof of the actual goal with C now a hypothesis that can be used. If A, B, and C were not so long and complicated I would have done 'assert (H: C)' and 'apply long_and_complicated_term' and be happily on my way. If C actually were of the form (D /\ E) it would also have been pretty simple. I would have done 'destruct long_and_complicated_term as [H1 H2]' because that actually generates A and B as proof obligations. I am not aware of a tactic that makes this convenient. What I am looking for is kind of a combination of pose and refine. Is it possible?
Many thanks!
Chris
- [Coq-Club] Is there a tactic to do this in a convenient way?, Chris Dams, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Xavier Leroy, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Jonathan Leivent, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Jonathan Leivent, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Gabriel Scherer, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Dominique Larchey-Wendling, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Laurent Thery, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Gabriel Scherer, 11/12/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Chris Dams, 11/13/2016
- Re: [Coq-Club] Is there a tactic to do this in a convenient way?, Gaetan Gilbert, 11/12/2016
Archive powered by MHonArc 2.6.18.