@@ -545,16 +545,6 @@ intros P a n v. induction v as [|b n v IH].
545545- cbn. rewrite !Forall_cons_iff. tauto.
546546Qed .
547547
548- Lemma rev_append_tail_shiftin A : forall a n (v : t A n) m (w : t A m) k
549- (E1 : Nat.tail_add n m = k) (E2 : Nat.tail_add n (S m) = S k),
550- rew [t A] E2 in rev_append_tail v (shiftin a w) =
551- shiftin a (rew [t A] E1 in rev_append_tail v w).
552- Proof .
553- intros a n v. induction v as [|b n v IH]; intros m w k E1 E2; cbn.
554- - subst k. now rewrite (UIP_refl_nat _ E2).
555- - apply (IH _ (b :: w)).
556- Qed .
557-
558548(** ** Properties of [rev] *)
559549
560550Lemma rev_nil A: rev (nil A) = [].
@@ -567,7 +557,12 @@ Lemma rev_cons A: forall a n (v : t A n), rev (a :: v) = shiftin a (rev v).
567557Proof .
568558intros a n v. unfold rev, rev_append, eq_rect_r.
569559rewrite !rew_compose.
570- apply (rev_append_tail_shiftin A a n v 0 []).
560+ enough (H : forall m (w : t A m) k (E1 : _ = k) E2,
561+ rew [t A] E2 in rev_append_tail v (shiftin a w) =
562+ shiftin a (rew [t A] E1 in rev_append_tail v w)) by apply (H 0 []).
563+ induction v as [|b n v IH]; intros m w k E1 E2; cbn.
564+ - subst k. now rewrite (UIP_refl_nat _ E2).
565+ - apply (IH _ (b :: w)).
571566Qed .
572567
573568Lemma rev_shiftin A: forall a n (v : t A n),
0 commit comments