l3lab/ntp-mathlib huggingface dataset:
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x ∈ z :: l
h✝¹ : ¬(formPerm (z :: l)) x = y
h✝ : (formPerm (z :: l)) x = z
h : y ∈ y :: z :: l
⊢ x ∈ y :: z :: l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x ∈ z :: l
h✝¹ : ¬(formPerm (z :: l)) x = y
h✝ : ¬(formPerm (z :: l)) x = z
h : (formPerm (z :: l)) x ∈ y :: z :: l
⊢ x ∈ y :: z :: l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
h : (formPerm (y :: z :: l)) x ∈ y :: z :: l
hx : (formPerm (z :: l)) x ∉ z :: l
⊢ x ∈ y :: z :: l

Next tactic:
replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
h : (formPerm (y :: z :: l)) x ∈ y :: z :: l
hx : (formPerm (z :: l)) x = x
⊢ x ∈ y :: z :: l

Next tactic:
simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h :
  (if x = y then z else if x = z then y else x) = y ∨
    (¬x = y → (if x = z then y else x) = z) ∨ (if x = y then z else if x = z then y else x) ∈ l
⊢ x ∈ y :: z :: l

Next tactic:
simp only [List.mem_cons]
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h :
  (if x = y then z else if x = z then y else x) = y ∨
    (¬x = y → (if x = z then y else x) = z) ∨ (if x = y then z else if x = z then y else x) ∈ l
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
rcases h with h | h | h
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> 

Proof state:
case neg.inl
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h : (if x = y then z else if x = z then y else x) = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
split_ifs at h with h1
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> 

Proof state:
case neg.inr.inl
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h : ¬x = y → (if x = z then y else x) = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
split_ifs at h with h1
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> 

Proof state:
case neg.inr.inr
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h : (if x = y then z else if x = z then y else x) ∈ l
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
split_ifs at h with h1
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = y
h : z = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = y
h : z = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
{ aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try { 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = y
h : z = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : x = z
h : y = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : x = z
h : y = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
{ aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try { 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : x = z
h : y = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : ¬x = z
h : x = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : ¬x = z
h : x = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
{ aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try { 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = y
h✝ : ¬x = z
h : x = y
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = z
h : ¬x = y → y = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = z
h : ¬x = y → y = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
{ aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try { 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = z
h : ¬x = y → y = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = z
h : ¬x = y → x = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = z
h : ¬x = y → x = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
{ aesop }
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> try { 

Proof state:
case neg
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : ¬x = z
h : ¬x = y → x = z
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
  cases' l with y l
  · simp at h
  induction' l with z l IH generalizing x y
  · simpa using h
  · by_cases hx : (z :: l).formPerm x ∈ z :: l
    · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
      split_ifs at h <;> aesop
    · replace hx :=
        (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
      simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
        List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
      simp only [List.mem_cons]
      rcases h with h | h | h <;> split_ifs at h with h1 <;> 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ z : α
l : List α
IH : ∀ (x y : α), (formPerm (y :: l)) x ∈ y :: l → x ∈ y :: l
x y : α
hx : (formPerm (z :: l)) x = x
h1 : x = y
h : z ∈ l
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
try { aesop }