Skip to content

Commit 00a4b72

Browse files
Alternative proof of list_drop_app
1 parent b29cf96 commit 00a4b72

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Katydid/Std/Lists.lean

+14
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,20 @@ theorem list_drop_app (n: Nat) (xs ys: List α):
825825
simp
826826
exact ih n
827827

828+
-- list_drop_app's alternative proof using revert instead of generalizing
829+
theorem list_drop_app' (n: Nat) (xs ys: List α):
830+
drop n (xs ++ ys) = (drop n xs) ++ (drop (n - length xs) ys) := by
831+
revert n
832+
induction xs with
833+
| nil => simp
834+
| cons x xs ih =>
835+
intro n
836+
cases n with
837+
| zero => simp
838+
| succ n =>
839+
simp
840+
exact ih n
841+
828842
theorem list_take_length_prefix_is_prefix (xs ys: List α):
829843
take (length xs) (xs ++ ys) = xs := by
830844
induction xs with

0 commit comments

Comments
 (0)