Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Coq: rewriting under a pointwise_relation

I want to rewrite s in the term Forall (P s) l but it fails with my current instance declarations. Did I miss something with the morphisms?

From Coq Require Import List Streams Setoid Morphisms.

Parameter T A : Type.
Parameter P : Stream T -> A -> Prop.

Add Parametric Morphism : P
    with signature @EqSt T ==> @eq A ==> iff
      as P_morph.
Admitted.

Add Parametric Morphism : (@Forall A)
    with signature pointwise_relation A iff ==> (@eq (list A)) ==> iff
      as Forall_morph.
Admitted.

Example problematic :
  forall s1 s2 l,
    EqSt s2 s1 ->
    Forall (P s1) l ->
    Forall (P s2) l.
Proof.
  intros * Heq Hf.
  Fail setoid_rewrite Heq.
Abort.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

P‘s signature should also use pointwise_relation.

Add Parametric Morphism : P
    with signature @EqSt T ==> pointwise_relation A iff
      as P_morph.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading