diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-08-08 23:04:24 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-08-08 23:04:24 +0000 |
commit | 022f78302514e071ca60c2e8719a1e2ec66eaed6 (patch) | |
tree | 7942a37a69f7e591324daff14c20dea10f9c6bcb /theories | |
parent | ea09770efde4a7bdd573407a408e54ec2b41b6ad (diff) |
New proposition "rewrite Heq in H" for eq_rect (assuming that there is
a smaller risk that "rewrite" clashes with a name used for constr).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14390 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories')
-rw-r--r-- | theories/Init/Logic.v | 12 | ||||
-rw-r--r-- | theories/Logic/EqdepFacts.v | 8 | ||||
-rw-r--r-- | theories/Vectors/VectorDef.v | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/theories/Init/Logic.v b/theories/Init/Logic.v index 4c4bf6253..00a93efa0 100644 --- a/theories/Init/Logic.v +++ b/theories/Init/Logic.v @@ -334,12 +334,12 @@ Section Logic_lemmas. Defined. End Logic_lemmas. -Notation "'rew' H 'in' H'" := (eq_rect _ _ H' _ H) - (at level 0, H' at level 9). -Notation "'rew' <- H 'in' H'" := (eq_rect_r _ H' H) - (at level 0, H' at level 9). -Notation "'rew' -> H 'in' H'" := (eq_rect _ _ H' _ H) - (at level 0, H' at level 9, only parsing). +Notation "'rewrite' H 'in' H'" := (eq_rect _ _ H' _ H) + (at level 10, H' at level 9). +Notation "'rewrite' <- H 'in' H'" := (eq_rect_r _ H' H) + (at level 10, H' at level 9). +Notation "'rewrite' -> H 'in' H'" := (eq_rect _ _ H' _ H) + (at level 10, H' at level 9, only parsing). Theorem f_equal2 : forall (A1 A2 B:Type) (f:A1 -> A2 -> B) (x1 y1:A1) diff --git a/theories/Logic/EqdepFacts.v b/theories/Logic/EqdepFacts.v index 2646bb5ae..8fbd79fa4 100644 --- a/theories/Logic/EqdepFacts.v +++ b/theories/Logic/EqdepFacts.v @@ -84,7 +84,7 @@ Section Dependent_Equality. equalities *) Inductive eq_dep1 (p:U) (x:P p) (q:U) (y:P q) : Prop := - eq_dep1_intro : forall h:q = p, x = rew h in y -> eq_dep1 p x q y. + eq_dep1_intro : forall h:q = p, x = rewrite h in y -> eq_dep1 p x q y. Lemma eq_dep1_dep : forall (p:U) (x:P p) (q:U) (y:P q), eq_dep1 p x q y -> eq_dep p x q y. @@ -164,7 +164,7 @@ Qed. Set Implicit Arguments. -Lemma eq_sigT_sig_eq : forall X P (x1 x2:X) H1 H2, existT P x1 H1 = existT P x2 H2 <-> {H:x1=x2 | rew H in H1 = H2}. +Lemma eq_sigT_sig_eq : forall X P (x1 x2:X) H1 H2, existT P x1 H1 = existT P x2 H2 <-> {H:x1=x2 | rewrite H in H1 = H2}. Proof. intros; split; intro H. - change x2 with (projT1 (existT P x2 H2)). @@ -186,7 +186,7 @@ Proof. Defined. Lemma eq_sigT_snd : - forall X P (x1 x2:X) H1 H2 (H:existT P x1 H1 = existT P x2 H2), rew (eq_sigT_fst H) in H1 = H2. + forall X P (x1 x2:X) H1 H2 (H:existT P x1 H1 = existT P x2 H2), rewrite (eq_sigT_fst H) in H1 = H2. Proof. intros. unfold eq_sigT_fst. @@ -206,7 +206,7 @@ Proof. Defined. Lemma eq_sig_snd : - forall X P (x1 x2:X) H1 H2 (H:exist P x1 H1 = exist P x2 H2), rew (eq_sig_fst H) in H1 = H2. + forall X P (x1 x2:X) H1 H2 (H:exist P x1 H1 = exist P x2 H2), rewrite (eq_sig_fst H) in H1 = H2. Proof. intros. unfold eq_sig_fst, eq_ind. diff --git a/theories/Vectors/VectorDef.v b/theories/Vectors/VectorDef.v index adc2c09a3..9129b94de 100644 --- a/theories/Vectors/VectorDef.v +++ b/theories/Vectors/VectorDef.v @@ -202,13 +202,13 @@ Import EqdepFacts. (** This one has a better type *) Definition rev_append {A n p} (v: t A n) (w: t A p) :t A (n + p) := - rew <- (plus_tail_plus n p) in (rev_append_tail v w). + rewrite <- (plus_tail_plus n p) in (rev_append_tail v w). (** rev [a₁ ; a₂ ; .. ; an] is [an ; a{n-1} ; .. ; a₁] Caution : There is a lot of rewrite garbage in this definition *) Definition rev {A n} (v : t A n) : t A n := - rew <- (plus_n_O _) in (rev_append v []). + rewrite <- (plus_n_O _) in (rev_append v []). End BASES. Local Notation "v [@ p ]" := (nth v p) (at level 1). |