no goals
α : Type u
hα : Nonempty α
⊢ (∀ (n : ℕ), rotate [] n = []) ↔ ∃ a, [] = replicate (length []) a
simp
no goals
α : Type u
hα : Nonempty α
a : α
l : List α
h : ∀ (n : ℕ), rotate (a :: l) n = a :: l
n : ℕ
h₁ : n < length (a :: l)
h₂ : n < length (replicate (length (a :: l)) a)
⊢ get (a :: l) { val := n, isLt := h₁ } = get (replicate (length (a :: l)) a) { val := n, isLt := h₂ }
rw [get_replicate, ← Option.some_inj, ← get?_eq_get, ← head?_rotate h₁, h, head?_cons]
no goals
α : Type u
hα : Nonempty α
a : α
l : List α
x✝ : ∃ a_1, a :: l = replicate (length (a :: l)) a_1
n : ℕ
b : α
hb : a :: l = replicate (length (a :: l)) b
⊢ rotate (a :: l) n = a :: l
rw [hb, rotate_replicate]