Skip to content

Commit

Permalink
Alternative proof of list_drop_app
Browse files Browse the repository at this point in the history
  • Loading branch information
awalterschulze committed Aug 22, 2024
1 parent b29cf96 commit 8661718
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Katydid/Std/Lists.lean
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,20 @@ theorem list_drop_app (n: Nat) (xs ys: List α):
simp
exact ih n

-- list_drop_app's alternative proof using revert instead of generalizing
theorem list_drop_app' (n: Nat) (xs ys: List α):
drop n (xs ++ ys) = (drop n xs) ++ (drop (n - length xs) ys) := by
revert n
induction xs with
| nil => simp
| cons x xs ih =>
intro n
cases n with
| zero => simp
| succ n =>
simp
exact ih n

theorem list_take_length_prefix_is_prefix (xs ys: List α):
take (length xs) (xs ++ ys) = xs := by
induction xs with
Expand Down

0 comments on commit 8661718

Please sign in to comment.