Skip to Content.
Sympa Menu

coq-club - RE: [Coq-Club] Elegant way to show Equivalence (fun m n => Nat.eqb m n = true) from standard library lemmas?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

RE: [Coq-Club] Elegant way to show Equivalence (fun m n => Nat.eqb m n = true) from standard library lemmas?


Chronological Thread 
  • From: "Soegtrop, Michael" <michael.soegtrop AT intel.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: RE: [Coq-Club] Elegant way to show Equivalence (fun m n => Nat.eqb m n = true) from standard library lemmas?
  • Date: Thu, 2 Jun 2016 17:36:09 +0000
  • Accept-language: de-DE, en-US
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=michael.soegtrop AT intel.com; spf=Pass smtp.mailfrom=michael.soegtrop AT intel.com; spf=None smtp.helo=postmaster AT mga01.intel.com
  • Ironport-phdr: 9a23:/3rckhV7UaMUhZs+4H4Q2WHLmEXV8LGtZVwlr6E/grcLSJyIuqrYZhOEt8tkgFKBZ4jH8fUM07OQ6PCxHzFRqs/Z4TgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2CJVgZz2PlMPtbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN/dwcbsNRj8hKiU+4NDhnRjFVwqGoHUGGC1CmR1RRgPB8RvSX5HrsyK8uPAriweAOsijB4szVDu+9aBzDFfNiSwHPjM9uimDj817jKtWpFS6oBFw35TTeKmUMuZzeuXWetZMFjkJZdpYSyEUWtD0VIAIFedUZes=

Dear Abishek,

 

perfect, thanks! So I just have to prove this for all structures I am interested in to solves my issues.

 

Best regards,

 

Michael

 

From: coq-club-request AT inria.fr [mailto:coq-club-request AT inria.fr] On Behalf Of Abhishek Anand
Sent: Thursday, June 2, 2016 7:29 PM
To: coq-club <coq-club AT inria.fr>
Subject: Re: [Coq-Club] Elegant way to show Equivalence (fun m n => Nat.eqb m n = true) from standard library lemmas?

 

To make your rewrite succeed, you need to show that Equivalence respects pointwise iff between relations, which is essentially what the error message suggests.

I merely proved the missing constraint in the error message (after generalizing nat to A), and your rewrite then succeeds:

 

Global Instance pr {A} : Proper

        (pointwise_relation A (pointwise_relation A iff) ==> Basics.flip Basics.impl)

        Equivalence.

Proof.

  intros ? ? ? ?.

  unfold pointwise_relation in H.

  constructor; intros ?; intros; rewrite H in *; eauto with relations.

  eapply transitivity; eauto.

Qed.

 

 

Lemma eqb_equiv : Equivalence (fun m n => Nat.eqb m n = true).

Proof.

  setoid_rewrite Nat.eqb_eq.

 

 

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928




Archive powered by MHonArc 2.6.18.

Top of Page