Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] using a hypothesis

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] using a hypothesis


Chronological Thread 
  • From: Théo Zimmermann <theo.zimmi AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] using a hypothesis
  • Date: Tue, 8 Jan 2019 18:02:38 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=theo.zimmi AT gmail.com; spf=Pass smtp.mailfrom=theo.zimmi AT gmail.com; spf=None smtp.helo=postmaster AT mail-vs1-f53.google.com
  • Ironport-phdr: 9a23:2p5clBemoj0+30yPwZbLVWahlGMj4u6mDksu8pMizoh2WeGdxcuzZh7h7PlgxGXEQZ/co6odzbaO4+a4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahYr5+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTyNOAo2+YIUPAeQPPvtWoZfhqFYVtxSyGROhCfnzxjNUhHL727Ax3eQ7EQHB2QwtB8wAsHTOq9XyLKgdUuG1zKzNzTrddfNW3C3y6I7Ochs8pvyMQbJwftTWyUU1FgLFj1CQqYnkPz6O2eQNtnKU7+tkVe61l2EnrARxryGpy8wxhIfJgYcVxUrF9SV/2Is1Kty4SFJ7Yd65C5RcrT2VN4xzQs4kXmpmuz46x6UYtZKneCUG0pcqyh7FZ/CZboSF4AjvWeafLDp+mXlrYqiwhwyo/kil0uD8Vte70FJNriddl9nDrHEN1xjK5siZUftx416t2TiP2g3d8O1ELkc0la3UK54l3LE8jIYcsUPGHiPumUX2irGZdlk89+S29+jqZq/qq5ycOoNulA3yL6Yjlta/DOk2KgQOWnKU+eW41L3t5035R7BKg+UqkqnZrp/aIt4Xp6+4Aw9Q14Yj6g2yDzij0NsCnHkHKEhJdw6Aj4jsI13OOuz3De+jg1Swlzdm3+zJPrr4ApnUMnfDlKrhcq1m5k5HyAszyMhf6IhOBrEAJvLzQE7xu8bCAh83KQzni9rgXf56z8s1XX+FSvuSN7qXuluV7MouJfONbckbomCuBeIi4qvSjf4+rm0ceKykx54ebnbwSuhmLkLfc3vph9YpHmIDvw54R+vv3g7RGQVPbmq/CvpvrgowD5irWMKaHtj00e6xmRyjF5gTXVhoT1WFEHPmbYKBAq5eZyebI8snmTsBB+H4F90RkCq2vQq/8IJJa/LO83RB553m3dlxoebUkENqrGEmP4Gmy2iIClpMsCYISjsxhv0tpEV8zhKdyvE9jaEDU9NU4PxNX0ExMpuOl+E=

Hi all,

Marko, I did not know about this library. I've added it to the list at https://github.com/coq/stdlib2/wiki/Other-%22standard%22-libraries. If someone could complete the new bullet point with some more info about it, that would be nice.

Li-yao, your solution

match type of H with
| ?A -> _ =>
   assert (I : A); [| apply H in I ]
end.

can be written (equivalently I think) as:

eassert _ as I%H.

For some reason, this also works (since 8.7) with assert (no need for eassert), but I wonder if this change of semantics is not a bug that was introduced at the time of adding eassert...

Finally, note the related issue https://github.com/coq/coq/issues/7412 requesting a new “especialize” tactic.

Théo

Le mar. 8 janv. 2019 à 15:41, Marko Doko <mdoko AT mpi-sws.org> a écrit :
On 2019-01-08 07:17 UTC+0100 Jeremy Dawson wrote:
>
> given a hypothesis, such as
> H : A -> B
> how do I get this to two subgoals, one with B as a hypothesis,
> and the other with A as the conclusion
> (where either A and B are too long to type in, or where I want to do
> this inside an Ltac tactic, where A and B may vary)
>

Here a tactic from Hahn library (https://github.com/vafeiadis/hahn) that
achieves the above (and a bit more):

Tactic Notation "specialize_full" ident(H) :=
  let foo := fresh in
  evar (foo : Prop); cut (foo); subst foo; cycle 1;
  [eapply H|try clear H; intro H].


If you call

  specialize_full H

you will get two goals. The first one will require you to prove A, and the
second one will contain hupothesis H: B.


--
Marko



Archive powered by MHonArc 2.6.18.

Top of Page