coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Daniel Schepler <dschepler AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] setoid rewriting -- naive questions
- Date: Thu, 20 Nov 2014 22:15:45 -0800
On Thu, Nov 20, 2014 at 7:58 PM, Vadim Zaliva <vzaliva AT cmu.edu> wrote:
While I am still studying Daniel’s solution which is quite involved I could not help thinking that should be an easier way to do this.I want to use simple setoid rewriting here. For example, why it does not work here:Proof state:1 subgoals, subgoal 1 (ID 1804)B : TypeH : Equiv BA : Typef : A → A → BCO : ∀ x y : A, f x y = f y xSB : Setoid Bn : nata : vector A (S n)b : vector A (S n)IHn : ∀ a0 b0 : vector A n, map2 f a0 b0 = map2 f b0 a0============================VConsR (map2 f (Vtail a) (Vtail b)) (f (Vhead a) (Vhead b)) = map2 f b aI want to swap arguments of ‘f'. Using standard ‘eq’ I could easily do that by:setoid_replace (f (Vhead a) (Vhead b)) with (f (Vhead b) (Vhead a)) using relation (@eq B).and I will get(… same context as above ...)============================VConsR (map2 f (Vtail a) (Vtail b)) (f (Vhead b) (Vhead a)) = map2 f b asubgoal 2 (ID 1821) is:f (Vhead a) (Vhead b) ≡ f (Vhead b) (Vhead a)Which is what I expect. However if I try to do the same trick using ‘equiv’:setoid_replace (f (Vhead a) (Vhead b)) with (f (Vhead b) (Vhead a)) using relation (@equiv B).
@equiv is of type (forall (A:Type), Equiv A -> (A -> A -> Prop)). You probably want (@equiv B _) to let it autoresolve the instance of Equiv B to fill in for the second argument.
By the way, we finally figured out how to get rewriting to work as expected: it turned out to be a case where putting in a copy of the original Proper instance, but with slightly relabeled type, allowed the system to resolve the properness. i.e. the original was Proper ((=) ==> vector_equiv ==> vector_equiv), the copy was Proper ((=) ==> (=) ==> (=)).
--
Daniel Schepler
- Re: [Coq-Club] setoid rewriting -- naive questions, (continued)
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Daniel Schepler, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Jonathan, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Daniel Schepler, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Robbert Krebbers, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Daniel Schepler, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/21/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Daniel Schepler, 11/21/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/19/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/22/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/22/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Matthieu Sozeau, 11/23/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/23/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/25/2014
- Re: [Coq-Club] setoid rewriting -- naive questions, Vadim Zaliva, 11/23/2014
Archive powered by MHonArc 2.6.18.