Skip to content

Commit a8cf5fe

Browse files
committed
add List.drop_cons
1 parent ebf455a commit a8cf5fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Init/Data/List/TakeDrop.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ theorem take_cons {l : List α} (h : 0 < i) : (a :: l).take i = a :: l.take (i -
3131
| zero => exact absurd h (Nat.lt_irrefl _)
3232
| succ i => rfl
3333

34+
theorem drop_cons {l : List α} (h : 0 < i) : (a :: l).drop i = l.drop (i - 1) := by
35+
cases i with
36+
| zero => exact absurd h (Nat.lt_irrefl _)
37+
| succ i => rfl
38+
3439
@[simp]
3540
theorem drop_one : ∀ {l : List α}, l.drop 1 = l.tail
3641
| [] | _ :: _ => rfl

0 commit comments

Comments
 (0)