Library RelationAlgebra.rewriting
rewriting modulo associativity of dot
Lemma ext_leq_2 `{laws} {n m p} (x: X n m) (y: X m p) v: x⋅y ≦ v →
∀ o (u: X o n), u⋅x⋅y ≦ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_leq_3 `{laws} {n m p q} (x: X n m) (y: X m p) (z: X p q) v: x⋅y⋅z ≦ v →
∀ o (u: X o n), u⋅x⋅y⋅z ≦ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_leq_4 `{laws} {n m p q r} (x: X n m) (y: X m p) (z: X p q) (t: X q r) v: x⋅y⋅z⋅t ≦ v →
∀ o (u: X o n), u⋅x⋅y⋅z⋅t ≦ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_weq_2 `{laws} {n m p} (x: X n m) (y: X m p) v: x⋅y ≡ v →
∀ o (u: X o n), u⋅x⋅y ≡ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_weq_3 `{laws} {n m p q} (x: X n m) (y: X m p) (z: X p q) v: x⋅y⋅z ≡ v →
∀ o (u: X o n), u⋅x⋅y⋅z ≡ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_weq_4 `{laws} {n m p q r} (x: X n m) (y: X m p) (z: X p q) (t: X q r) v: x⋅y⋅z⋅t ≡ v →
∀ o (u: X o n), u⋅x⋅y⋅z⋅t ≡ u⋅v.
Proof. intros E ? ?. now rewrite <-E, !dotA. Qed.
Lemma ext_leq_2' `{laws} {n m p} (x: X n m) (y: X m p) v: v ≦ x⋅y →
∀ o (u: X o n), u⋅v ≦ u⋅x⋅y.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Lemma ext_leq_3' `{laws} {n m p q} (x: X n m) (y: X m p) (z: X p q) v: v ≦ x⋅y⋅z →
∀ o (u: X o n), u⋅v ≦ u⋅x⋅y⋅z.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Lemma ext_leq_4' `{laws} {n m p q r} (x: X n m) (y: X m p) (z: X p q) (t: X q r) v: v ≦ x⋅y⋅z⋅t →
∀ o (u: X o n), u⋅v ≦ u⋅x⋅y⋅z⋅t.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Lemma ext_weq_2' `{laws} {n m p} (x: X n m) (y: X m p) v: v ≡ x⋅y →
∀ o (u: X o n), u⋅v ≡ u⋅x⋅y.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Lemma ext_weq_3' `{laws} {n m p q} (x: X n m) (y: X m p) (z: X p q) v: v ≡ x⋅y⋅z →
∀ o (u: X o n), u⋅v ≡ u⋅x⋅y⋅z.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Lemma ext_weq_4' `{laws} {n m p q r} (x: X n m) (y: X m p) (z: X p q) (t: X q r) v: v ≡ x⋅y⋅z⋅t →
∀ o (u: X o n), u⋅v ≡ u⋅x⋅y⋅z⋅t.
Proof. intros E ? ?. now rewrite E, !dotA. Qed.
Declare ML Module "coq-relation-algebra.mrewrite".
User-end rewriting tactics
Tactic Notation "mrewrite" constr(H) :=
rewrite ?dotA; (rewrite H || ra_extend (fun H ⇒ rewrite H) →H); [rewrite ?dotA|..].
Tactic Notation "mrewrite" "<-" constr(H) :=
rewrite ?dotA; (rewrite <-H || ra_extend (fun H ⇒ rewrite <-H) <-H); [rewrite ?dotA|..].
Tactic Notation "mrewrite" constr(H) "in" hyp(H') :=
rewrite ?dotA in H'; (rewrite H in H' || ra_extend (fun H ⇒ rewrite H in H') →H); rewrite ?dotA in H'.
Tactic Notation "mrewrite" "<-" constr(H) "in" hyp(H') :=
rewrite ?dotA in H'; (rewrite <-H in H' || ra_extend (fun H ⇒ rewrite <-H in H') <-H); rewrite ?dotA in H'.