Theorem: List.formPerm_rotate_one
File: Mathlib/GroupTheory/Perm/List.lean

tactic: have h' : Nodup (l.rotate 1) := by simpa using h
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
⊢ (l.rotate 1).formPerm = l.formPerm
state_after: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
⊢ (l.rotate 1).formPerm = l.formPerm

tactic: ext x
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
⊢ (l.rotate 1).formPerm = l.formPerm
state_after: case H
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
⊢ (l.rotate 1).formPerm x = l.formPerm x

tactic: by_cases hx : x ∈ l.rotate 1
state_before: case H
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
⊢ (l.rotate 1).formPerm x = l.formPerm x
state_after: case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∈ l.rotate 1
⊢ (l.rotate 1).formPerm x = l.formPerm x

case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∉ l.rotate 1
⊢ (l.rotate 1).formPerm x = l.formPerm x

tactic: simpa using h
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
⊢ (l.rotate 1).Nodup
state_after: no goals

tactic: obtain ⟨⟨k, hk⟩, rfl⟩ := get_of_mem hx
state_before: case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∈ l.rotate 1
⊢ (l.rotate 1).formPerm x = l.formPerm x
state_after: case pos.intro.mk
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
k : ℕ
hk : k < (l.rotate 1).length
hx : (l.rotate 1).get ⟨k, hk⟩ ∈ l.rotate 1
⊢ (l.rotate 1).formPerm ((l.rotate 1).get ⟨k, hk⟩) = l.formPerm ((l.rotate 1).get ⟨k, hk⟩)

tactic: rw [formPerm_apply_get _ h', get_rotate l, get_rotate l, formPerm_apply_get _ h]
state_before: case pos.intro.mk
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
k : ℕ
hk : k < (l.rotate 1).length
hx : (l.rotate 1).get ⟨k, hk⟩ ∈ l.rotate 1
⊢ (l.rotate 1).formPerm ((l.rotate 1).get ⟨k, hk⟩) = l.formPerm ((l.rotate 1).get ⟨k, hk⟩)
state_after: case pos.intro.mk
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
k : ℕ
hk : k < (l.rotate 1).length
hx : (l.rotate 1).get ⟨k, hk⟩ ∈ l.rotate 1
⊢ l.get ⟨(↑⟨(↑⟨k, hk⟩ + 1) % (l.rotate 1).length, ⋯⟩ + 1) % l.length, ⋯⟩ =
    l.get ⟨(↑⟨(↑⟨k, hk⟩ + 1) % l.length, ⋯⟩ + 1) % l.length, ⋯⟩

tactic: simp
state_before: case pos.intro.mk
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
k : ℕ
hk : k < (l.rotate 1).length
hx : (l.rotate 1).get ⟨k, hk⟩ ∈ l.rotate 1
⊢ l.get ⟨(↑⟨(↑⟨k, hk⟩ + 1) % (l.rotate 1).length, ⋯⟩ + 1) % l.length, ⋯⟩ =
    l.get ⟨(↑⟨(↑⟨k, hk⟩ + 1) % l.length, ⋯⟩ + 1) % l.length, ⋯⟩
state_after: no goals

tactic: rw [formPerm_apply_of_not_mem hx, formPerm_apply_of_not_mem]
state_before: case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∉ l.rotate 1
⊢ (l.rotate 1).formPerm x = l.formPerm x
state_after: case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∉ l.rotate 1
⊢ x ∉ l

tactic: simpa using hx
state_before: case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
h : l.Nodup
h' : (l.rotate 1).Nodup
x : α
hx : x ∉ l.rotate 1
⊢ x ∉ l
state_after: no goals