File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,14 @@ Section Facts.
239
239
intro l; induction l; simpl; auto.
240
240
Qed .
241
241
242
+ Lemma length_app_comm : forall l l' : list A, length (l++l') = length (l'++l).
243
+ Proof .
244
+ intros.
245
+ repeat rewrite length_app.
246
+ rewrite Nat.add_comm.
247
+ reflexivity.
248
+ Qed .
249
+
242
250
Lemma last_length : forall (l : list A) a, length (l ++ [a]) = S (length l).
243
251
Proof .
244
252
intros ; rewrite length_app ; simpl.
@@ -3972,6 +3980,7 @@ Global Hint Rewrite
3972
3980
length_map (* length (map f l) = length l *)
3973
3981
length_seq (* length (seq start len) = len *)
3974
3982
length_app (* length (l ++ l') = length l + length l' *)
3983
+ length_app_comm (* length (l ++ l') = length (l' ++ l) *)
3975
3984
length_rev (* length (rev l) = length l *)
3976
3985
app_nil_r (* l ++ nil = l *)
3977
3986
: list.
You can’t perform that action at this time.
0 commit comments