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

tactic: rcases l with (_ | ⟨x, _ | ⟨y, l⟩⟩)
state_before: α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l✝ : List α
x : α
l l' : List α
hl : Nodup l
hl' : Nodup l'
⊢ formPerm l = formPerm l' ↔ l ~r l' ∨ length l ≤ 1 ∧ length l' ≤ 1

tactic: suffices l'.length ≤ 1 ↔ l' = nil ∨ l'.length ≤ 1 by
  simpa [eq_comm, formPerm_eq_one_iff, hl, hl', length_eq_zero]
state_before: case nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
hl' : Nodup l'
hl : Nodup []
⊢ formPerm [] = formPerm l' ↔ [] ~r l' ∨ length [] ≤ 1 ∧ length l' ≤ 1

tactic: refine' ⟨fun h => Or.inr h, _⟩
state_before: case nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
hl' : Nodup l'
hl : Nodup []
⊢ length l' ≤ 1 ↔ l' = [] ∨ length l' ≤ 1

tactic: rintro (rfl | h)
state_before: case nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
hl' : Nodup l'
hl : Nodup []
⊢ l' = [] ∨ length l' ≤ 1 → length l' ≤ 1

tactic: simpa [eq_comm, formPerm_eq_one_iff, hl, hl', length_eq_zero]
state_before: α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
hl' : Nodup l'
hl : Nodup []
this : length l' ≤ 1 ↔ l' = [] ∨ length l' ≤ 1
⊢ formPerm [] = formPerm l' ↔ [] ~r l' ∨ length [] ≤ 1 ∧ length l' ≤ 1

tactic: simp
state_before: case nil.inl
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
hl hl' : Nodup []
⊢ length [] ≤ 1

tactic: exact h
state_before: case nil.inr
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
hl' : Nodup l'
hl : Nodup []
h : length l' ≤ 1
⊢ length l' ≤ 1

tactic: suffices l'.length ≤ 1 ↔ [x] ~r l' ∨ l'.length ≤ 1 by
  simpa [eq_comm, formPerm_eq_one_iff, hl, hl', length_eq_zero, le_rfl]
state_before: case cons.nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
⊢ formPerm [x] = formPerm l' ↔ [x] ~r l' ∨ length [x] ≤ 1 ∧ length l' ≤ 1

tactic: refine' ⟨fun h => Or.inr h, _⟩
state_before: case cons.nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
⊢ length l' ≤ 1 ↔ [x] ~r l' ∨ length l' ≤ 1

tactic: rintro (h | h)
state_before: case cons.nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
⊢ [x] ~r l' ∨ length l' ≤ 1 → length l' ≤ 1

tactic: simpa [eq_comm, formPerm_eq_one_iff, hl, hl', length_eq_zero, le_rfl]
state_before: α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
this : length l' ≤ 1 ↔ [x] ~r l' ∨ length l' ≤ 1
⊢ formPerm [x] = formPerm l' ↔ [x] ~r l' ∨ length [x] ≤ 1 ∧ length l' ≤ 1

tactic: simp [← h.perm.length_eq]
state_before: case cons.nil.inl
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
h : [x] ~r l'
⊢ length l' ≤ 1

tactic: exact h
state_before: case cons.nil.inr
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l : List α
x✝ : α
l' : List α
hl' : Nodup l'
x : α
hl : Nodup [x]
h : length l' ≤ 1
⊢ length l' ≤ 1

tactic: rcases l' with (_ | ⟨x', _ | ⟨y', l'⟩⟩)
state_before: case cons.cons
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l' : List α
hl' : Nodup l'
x y : α
l : List α
hl : Nodup (x :: y :: l)
⊢ formPerm (x :: y :: l) = formPerm l' ↔ (x :: y :: l) ~r l' ∨ length (x :: y :: l) ≤ 1 ∧ length l' ≤ 1

tactic: simp [formPerm_eq_one_iff _ hl, -formPerm_cons_cons]
state_before: case cons.cons.nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l✝ : List α
x✝ x y : α
l : List α
hl : Nodup (x :: y :: l)
hl' : Nodup []
⊢ formPerm (x :: y :: l) = formPerm [] ↔ (x :: y :: l) ~r [] ∨ length (x :: y :: l) ≤ 1 ∧ length [] ≤ 1

tactic: simp [formPerm_eq_one_iff _ hl, -formPerm_cons_cons]
state_before: case cons.cons.cons.nil
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l✝ : List α
x✝ x y : α
l : List α
hl : Nodup (x :: y :: l)
x' : α
hl' : Nodup [x']
⊢ formPerm (x :: y :: l) = formPerm [x'] ↔ (x :: y :: l) ~r [x'] ∨ length (x :: y :: l) ≤ 1 ∧ length [x'] ≤ 1

tactic: simp [-formPerm_cons_cons, formPerm_ext_iff hl hl', Nat.succ_le_succ_iff]
state_before: case cons.cons.cons.cons
α : Type u_1
β : Type ?u.820291
inst✝ : DecidableEq α
l✝ : List α
x✝ x y : α
l : List α
hl : Nodup (x :: y :: l)
x' y' : α
l' : List α
hl' : Nodup (x' :: y' :: l')
⊢ formPerm (x :: y :: l) = formPerm (x' :: y' :: l') ↔
    (x :: y :: l) ~r (x' :: y' :: l') ∨ length (x :: y :: l) ≤ 1 ∧ length (x' :: y' :: l') ≤ 1