coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: William Mansky <wmansky AT seas.upenn.edu>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] typeclasses and rewriting
- Date: Thu, 28 Apr 2016 13:02:32 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=wmansky AT seas.upenn.edu; spf=Pass smtp.mailfrom=wmansky AT seas.upenn.edu; spf=None smtp.helo=postmaster AT hound.seas.upenn.edu
- Ironport-phdr: 9a23:Ec+dFRMrYvQO/BzDNyol6mtUPXoX/o7sNwtQ0KIMzox0KPj5rarrMEGX3/hxlliBBdydsKIUzbqK+Pm4BiQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTnkbDusMSLPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvdKMhCLdcET4OMmYv5cStuwOQYxGI4y4jU2ESkxNNSy3M6gr5T9+lrS7zsPF+yQGBMMTtC60sVDKkqapnVUm72288Kzcl/TSP2YRLh6VBrUf5qg==
Hello,
I've been trying to use typeclasses to carry around contexts of definitions and assumptions. Mostly, this works as I would like (i.e., as with locales in Isabelle), but I've run into some problems when proving an equation in one section and trying to rewrite with it in another. Here's a minimal example:
Require Import Setoid.
Class test := {A : Type; a : A; b : A; Heq : a = b}.
Section test.
Context {T : test}.
Lemma test_iff : forall c, a = c <-> b = c.
Proof.
rewrite Heq; split; intro; auto.
Qed.
End test.
Section test2.
Context {T : test}.
Lemma test2 : forall d, a = d -> b = d.
Proof.
intros.
try rewrite test_iff in *. (* This doesn't work. *)
rewrite test_iff in H. (* This does. *)
auto.
Qed.
End test2.
This problem doesn't show up if both lemmas are in a single section, but I want to be able to use the same context across multiple files, so that doesn't really help. Does anyone have any suggestions?
Thanks,
William
- [Coq-Club] typeclasses and rewriting, William Mansky, 04/28/2016
- Re: [Coq-Club] typeclasses and rewriting, Jonathan Leivent, 04/28/2016
- Re: [Coq-Club] typeclasses and rewriting, Abhishek Anand, 04/28/2016
- Re: [Coq-Club] typeclasses and rewriting, Jonathan Leivent, 04/28/2016
- Re: [Coq-Club] typeclasses and rewriting, Matthieu Sozeau, 04/28/2016
- Re: [Coq-Club] typeclasses and rewriting, Jonathan Leivent, 04/28/2016
Archive powered by MHonArc 2.6.18.