Skip to content

Commit

Permalink
feat(data/list/basic): nth_zero (#5513)
Browse files Browse the repository at this point in the history
  • Loading branch information
digama0 committed Dec 28, 2020
1 parent 5c8c122 commit 6d0b415
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/data/list/basic.lean
Expand Up @@ -1017,6 +1017,8 @@ theorem mem_iff_nth_le {a} {l : list α} : a ∈ l ↔ ∃ n h, nth_le l n h = a
theorem mem_iff_nth {a} {l : list α} : a ∈ l ↔ ∃ n, nth l n = some a :=
mem_iff_nth_le.trans $ exists_congr $ λ n, nth_eq_some.symm

lemma nth_zero (l : list α) : l.nth 0 = l.head' := by cases l; refl

lemma nth_injective {α : Type u} {xs : list α} {i j : ℕ}
(h₀ : i < xs.length)
(h₁ : nodup xs)
Expand Down

0 comments on commit 6d0b415

Please sign in to comment.