Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Rewrites using iffT

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Rewrites using iffT


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Rewrites using iffT
  • Date: Wed, 30 Oct 2019 03:13:30 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-ed1-f53.google.com
  • Ironport-phdr: 9a23:eDA/KROTXW4hc6XD96wl6mtUPXoX/o7sNwtQ0KIMzox0Lf76rarrMEGX3/hxlliBBdydt6sfzbOO6eu5ATBIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfL1/IA+roQnNqMUajpZuJro+xxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuB2upxJ9zIDUbo+bN+dwcL3Bct4BX2VNQtxcWjZdDo+gbYYCCfcKM+ZCr4n6olsDtR+wChO3BOPozD9Dm3743bc90+Q6CgHNwQstH9AUv3TPq9X1MqgSUfqyzKnT1jXOa+hb2Tj46IfScxAhpeuAUq53ccrU0EQiER7OgFaIqYH9IT+ZyuAAv3KY4udgT+6jlXIrpgJrrjWvyMohjJTCiJgPxVDe7yp5xZ44Jd2mR05/Zt6pCJ5QuDubN4tyW88tXXxntDsjxr0IuZO2cjIGyJsgxx7YZPyHd5aH7gj/W+aWJDd0nHNleLShiBau6UWs1PHwW82u3FtJridJiMfAumwO2hDJ6sWKRONx/kK71jaO0wDT5PtEIUcxlafDKZ4u2KUwlp0VsUTMBC/2n172jLSSe0g/9eio7v7oYrTippOGK4B0jQT+Prw0msOjGeQ4LhQOX2+D9Oug073j5FT1T6lOjv0riabUq4vaJMQepq6hGQBZyIcj6xClDzenytsUh3cHLEgWMC6A2oPuIhTFJO3yRaO0hE3pmzN2zdjHOKfgC9PDNC6Qvq3meONf4lVbzkIc19dE/NoACLgaJ/T8QEjqr43wARowMgjyyOHiXoYunrgCUH6CV/fKeJjZtkWFs7p2cru8IbQNsTO4EMALovvnjHs3g1gYJPD70p4eaXT+FfNjcRzAPSjcx+wZGGJPhTIQCfTwgQTbAzFWbne2Gak742NjUd/0PcL4XomoxYe58mK7E5lRPD0UD1mNFTLle9zBVapXLi2VJcBln3oPUr3zE4I=

I suspect this is a bug in Coq, and probably worth reporting.  Note that if you replace `Lemma lem_iffT_P` with `Polymorphic Lemma lem_iffT_P` (similarly for your `_T` version), then the rewrites go through fine.  So there is some sort of universe issue, but I don't see why the polymorphic status of the lemma should matter, which is why I suspect this is a bug.

On Wed, Oct 30, 2019 at 2:35 AM Caitlin D'Abrera <Caitlin.Dabrera AT anu.edu.au> wrote:
Hi all,

I'm trying to rewrite using iffT in hypotheses. Rewriting in the conclusion works as well as in the context of an arbitrary Proper P. But I can't see why the rewrites in lem_iffT_P and lem_iffT below Fail. Any ideas on how to make these rewrites work?

Thanks in advance,
Caitlin

--------------------------------------------------------

Require Import Setoid.
Require Import Coq.Classes.CRelationClasses.
Require Import Coq.Classes.CMorphisms.

Parameter B C : Type.
Parameter P : Type -> Type -> Type.

(* This is used for rewrites for lem_P and lem_P_iffT. *)
Instance P_Proper : Proper (iffT ==> iffT ==> iffT) (P).
Admitted.

Lemma lem_P : forall A, iffT A B -> P A C -> P B C.
Proof.
  intros A H1 H2.
  rewrite H1 in H2. (* Comment out iffT_P_Proper to see this fail. *)
Abort.

Lemma lem_P_iffT : forall A, iffT A B -> P A C -> iffT B C.
Proof.
  intros A H1 H2.
  setoid_rewrite H1 in H2.  (* Comment out iffT_P_Proper to see this fail. *)
Abort.

(* Trying to do the same with iffT instead of P. *)
Instance iffT_Proper : Proper (iffT ==> iffT ==> iffT) iffT.
Admitted.

(* Just in case? *)
Instance arrow_Proper  : Proper (iffT ==> iffT ==> iffT ) (arrow).
Admitted.

Lemma lem_iffT_P : forall A, iffT A B -> iffT A C -> P B C.
Proof.
  intros A H1 H2.  
  Fail rewrite H1 in H2.
Abort.

Lemma lem_iffT : forall A, iffT A B -> iffT A C -> iffT B C.
Proof.
  intros A H1 H2.
  Fail setoid_rewrite H1 in H2.
Abort.




Archive powered by MHonArc 2.6.18.

Top of Page