Skip to content

Commit 22f13b5

Browse files
authored
Merge pull request #75 from NicholasBHubbard/add-lemma-length_app_comm
add lemma length_app_comm
2 parents 3b4519b + a71c168 commit 22f13b5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- in `List.v`
2+
3+
+ lemma `length_app_comm`
4+
(`#75 <https://github.com/coq/stdlib/pull/75>`_,
5+
by Nicholas Hubbard).

theories/Lists/List.v

+8
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ Section Facts.
239239
intro l; induction l; simpl; auto.
240240
Qed.
241241

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+
242250
Lemma last_length : forall (l : list A) a, length (l ++ [a]) = S (length l).
243251
Proof.
244252
intros ; rewrite length_app ; simpl.

0 commit comments

Comments
 (0)