Skip to content

Commit

Permalink
feat(data/list/basic): mem_rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHughes24 committed Mar 1, 2019
1 parent 05449a0 commit 4f7853a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data/list/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4266,6 +4266,11 @@ lemma rotate_cons_succ (l : list α) (a : α) (n : ℕ) :
(a :: l : list α).rotate n.succ = (l ++ [a]).rotate n :=
by rw [rotate_eq_rotate', rotate_eq_rotate', rotate'_cons_succ]

@[simp] lemma mem_rotate : ∀ {l : list α} {a : α} {n : ℕ}, a ∈ l.rotate n ↔ a ∈ l
| [] _ n := by simp
| (a::l) _ 0 := by simp
| (a::l) _ (n+1) := by simp [rotate_cons_succ, mem_rotate, or.comm]

@[simp] lemma length_rotate (l : list α) (n : ℕ) : (l.rotate n).length = l.length :=
by rw [rotate_eq_rotate', length_rotate']

Expand Down

0 comments on commit 4f7853a

Please sign in to comment.