Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] injectivity of constructors

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] injectivity of constructors


Chronological Thread 
  • From: Pierre Courtieu <pierre.courtieu AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] injectivity of constructors
  • Date: Fri, 14 Dec 2018 11:14:06 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-ot1-f42.google.com
  • Ironport-phdr: 9a23:b44DnBIqFpYSe5jtatmcpTZWNBhigK39O0sv0rFitYgeK/nxwZ3uMQTl6Ol3ixeRBMOHs6IC07KempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffwZFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLdQgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUjq+8ahkVB7oiD8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfFjfK3SYMkaSHJOUcZfVSNPAo2yYYgSAeQfIelWoJLwp0cXrRakGQWgGP/jxz1Oi3Tr3aM6yeMhEQTe0QI6HtIBrm7UrM/rO6wPT+21y7TIzS/fb/NXxzj99ZXDfxc5ofGNQ71wa9DRxlc1GwzZiVWQtJblPy+U1usTrmiW9OVgVee1hG4mrwF9uCSgxsApioTQgI8e117K9SJ8wIkvJN24TlZ2Yd+iEJtKtiGVLZF6Qs04Q2xupS00yaUGtIalcCQWzJkr3R3SZvydf4SW/x7vSPydLDhmiH9jZbmxnQy98VK6xe35TsS00EhFri5CktTUs3ACzR3T6syeRvt64ketxC+D1w7c5+1aO0w0mq3bK5kuwr40iJUfq1jMHijzmEnuja+WcFsr+vSw5uj5frnrooWQOox0hw3kLKgih9CzDf43PwQQR2Sb/P6z1Lzn/U33WrVKifg2n7HBsJDbO8sbvLS5DBFP3ok/7Ba/Ei2m0MgZnXYZMVJIYx2Hj43zNFHPJPD0F+uwg1OpkDtz3fDJIqXhAonRLnjEiLruYbF961dFxAUvydBf+olbB6oaIPPzX0/xrMbXAgU4Mwyy2ebnCc9y2pkQWWKVUeelN/b5tkbAzeYyKaHYb4gM/T35NvIN5vj0jHZ/l0VLLoez2p5CUHG1BO5ra26efGDwg9ocWTMSvwckVuGsg1qfSyJSamuaUKc15zV9A4WjW9SQDruxiaCMiX/oVqZdYXpLXxXVSS+xJte0HswUYSfXGfdP1zkNVLyvUYgkjEj8uwrzyr4hJe3RqHRB6cDTkeNt7uiWrikcsCRuBp3EgW6IRmBw2GgPQm1uhf0tkQlG0l6GlJNArblYGNhUva4bVw47Mdvb07U/BYyoHA3GediNRRCtRdD0WTw=

While it is true that f_equal has nothing to do with constructors it
is generally safe to apply it for constructors of for function known
to be injective. In other cases it must be used carefully because it
can transform a provable goal into a unprovable one.

I wonder if there is a list of such "safe" tactics.

For instance "destruct" is safe on variables but unsafe on other
expressions. Whereas "destruct eqn:" is always safe.
P.
Le ven. 14 déc. 2018 à 09:07, Dominique Larchey-Wendling
<dominique.larchey-wendling AT loria.fr>
a écrit :
>
> Hi Jeremy,
>
> You can try (apply f_equal with ...), injectivity or inversion
>
> Best,
>
> D.
>
> --------------
>
> Section eq.
>
> Variable (X : Type) (a b c d : X).
>
> Fact eq1 : (a,b) = (c,d) -> a=c.
> Proof.
> intros H.
> apply f_equal with (f := fst) in H.
> simpl in H.
> trivial.
> Qed.
>
> Fact eq2 : (a,b) = (c,d) -> a=c.
> Proof.
> injection 1.
> trivial.
> Qed.
>
> Fact eq3 : (a,b) = (c,d) -> a=c.
> Proof.
> inversion 1.
> trivial.
> Qed.
>
> End eq.
>
> ----- Mail original -----
> > De: "Jeremy Dawson"
> > <Jeremy.Dawson AT anu.edu.au>
> > À: "coq-club"
> > <coq-club AT inria.fr>
> > Envoyé: Vendredi 14 Décembre 2018 04:14:13
> > Objet: Re: [Coq-Club] injectivity of constructors
>
> > Thanks all for the various replies, but injection doesn't work,
> > giving error
> > Ltac call to "injection" failed.
> > Error: Not a negated primitive equality.
> >
> > Jeremy
> >
> > On 12/14/2018 02:07 PM, Jasper Hugunin wrote:
> >> `injection` seems to fit your description, see
> >> https://coq.inria.fr/refman/proof-engine/tactics.html#coq:tacn.injection.
> >>
> >> - Jasper Hugunin
> >>
> >> On Thu, Dec 13, 2018 at 4:54 PM Lily Chung
> >> <ikdc AT mit.edu
> >> <mailto:ikdc AT mit.edu>>
> >> wrote:
> >>
> >> That follows from general properties of equality, and has nothing to
> >> do with constructors. Try f_equal.



Archive powered by MHonArc 2.6.18.

Top of Page