(* Check that dependent rewrite applies on arbitrary terms *)
Inductive listn : nat -> Set :=
| niln : listn 0
| consn : forall n : nat, nat -> listn n -> listn (S n).
Axiom
ax :
forall (n n' : nat) (l : listn (n + n')) (l' : listn (n' + n)),
existT _ (n + n') l = existT _ (n' + n) l'.
(* Used to raise an anomaly instead of an error in 8.1 *)
(* Submitted by Y. Makarov *)
Parameter N : Set.
Parameter E : N -> N -> Prop.
intro x. try rewrite e.
Abort.
(* Behavior of rewrite wrt conversion *)
Goal forall n, 0 + n = n -> True.
intros n H.
rewrite plus_0_l in H.
Abort.
(* Rewrite dependent proofs from left-to-right *)
intros x y H P H0.
rewrite H.
rewrite H in H0.
assumption.
Qed.
(* Rewrite dependent proofs from right-to-left *)
intros x y H P H0.
rewrite <- H.
rewrite <- H in H0.
assumption.
Qed.
(* Check rewriting dependent proofs with non-symmetric equalities *)

Lemma l3:forall x (H:eq_true x) (P:forall x, eq_true x -> Type), P x H -> P x H.