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 <;> 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ 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 ∈ l
⊢ x = y ∨ x = z ∨ x ∈ l

Next tactic:
aesop
@[simp]
theorem formPerm_cons_concat_apply_last (x y : α) (xs : List α) :
    formPerm (x :: (xs ++ [y])) y = x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x y : α
xs : List α
⊢ (formPerm (x :: (xs ++ [y]))) y = x

Next tactic:
induction' xs with z xs IH generalizing x y
@[simp]
theorem formPerm_cons_concat_apply_last (x y : α) (xs : List α) :
    formPerm (x :: (xs ++ [y])) y = x := by
  induction' xs with z xs IH generalizing x y
  · 

Proof state:
case nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x y : α
⊢ (formPerm (x :: ([] ++ [y]))) y = x

Next tactic:
simp
@[simp]
theorem formPerm_cons_concat_apply_last (x y : α) (xs : List α) :
    formPerm (x :: (xs ++ [y])) y = x := by
  induction' xs with z xs IH generalizing x y
  · simp
  · 

Proof state:
case cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ z : α
xs : List α
IH : ∀ (x y : α), (formPerm (x :: (xs ++ [y]))) y = x
x y : α
⊢ (formPerm (x :: (z :: xs ++ [y]))) y = x

Next tactic:
simp [IH]
@[simp]
theorem formPerm_apply_getLast (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).getLast (cons_ne_nil x xs)) = x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
xs : List α
⊢ (formPerm (x :: xs)) (getLast (x :: xs) (_ : x :: xs ≠ [])) = x

Next tactic:
induction' xs using List.reverseRecOn with xs y _ generalizing x
@[simp]
theorem formPerm_apply_getLast (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).getLast (cons_ne_nil x xs)) = x := by
  induction' xs using List.reverseRecOn with xs y _ generalizing x <;> 

Proof state:
case H0
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
⊢ (formPerm [x]) (getLast [x] (_ : [x] ≠ [])) = x

Next tactic:
simp
@[simp]
theorem formPerm_apply_getLast (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).getLast (cons_ne_nil x xs)) = x := by
  induction' xs using List.reverseRecOn with xs y _ generalizing x <;> 

Proof state:
case H1
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
xs : List α
y : α
a✝ : ∀ (x : α), (formPerm (x :: xs)) (getLast (x :: xs) (_ : x :: xs ≠ [])) = x
x : α
⊢ (formPerm (x :: (xs ++ [y]))) (getLast (x :: (xs ++ [y])) (_ : x :: (xs ++ [y]) ≠ [])) = x

Next tactic:
simp
set_option linter.deprecated false in
@[simp]
theorem formPerm_apply_nthLe_length (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).nthLe xs.length (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
xs : List α
⊢ length xs < length (x :: xs)

Next tactic:
simp
set_option linter.deprecated false in
@[simp]
theorem formPerm_apply_nthLe_length (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).nthLe xs.length (by simp)) = x := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
xs : List α
⊢ (formPerm (x :: xs)) (nthLe (x :: xs) (length xs) (_ : length xs < Nat.succ (length xs))) = x

Next tactic:
rw [nthLe_cons_length, formPerm_apply_getLast]
set_option linter.deprecated false in
@[simp]
theorem formPerm_apply_nthLe_length (x : α) (xs : List α) :
    formPerm (x :: xs) ((x :: xs).nthLe xs.length (by simp)) = x := by
  rw [nthLe_cons_length, formPerm_apply_getLast]; 

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
xs : List α
⊢ length xs = length xs

Next tactic:
rfl
theorem formPerm_apply_head (x y : α) (xs : List α) (h : Nodup (x :: y :: xs)) :
    formPerm (x :: y :: xs) x = y := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x y : α
xs : List α
h : Nodup (x :: y :: xs)
⊢ (formPerm (x :: y :: xs)) x = y

Next tactic:
simp [formPerm_apply_of_not_mem _ _ h.not_mem]
set_option linter.deprecated false in
theorem formPerm_apply_nthLe_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l (l.nthLe 0 (zero_lt_one.trans hl)) = l.nthLe 1 hl := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : Nodup l
hl : 1 < length l
⊢ (formPerm l) (nthLe l 0 (_ : 0 < length l)) = nthLe l 1 hl

Next tactic:
rcases l with (_ | ⟨x, _ | ⟨y, tl⟩⟩)
set_option linter.deprecated false in
theorem formPerm_apply_nthLe_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l (l.nthLe 0 (zero_lt_one.trans hl)) = l.nthLe 1 hl := by
  rcases l with (_ | ⟨x, _ | ⟨y, tl⟩⟩)
  · 

Proof state:
case nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
h : Nodup []
hl : 1 < length []
⊢ (formPerm []) (nthLe [] 0 (_ : 0 < length [])) = nthLe [] 1 hl

Next tactic:
simp at hl
set_option linter.deprecated false in
theorem formPerm_apply_nthLe_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l (l.nthLe 0 (zero_lt_one.trans hl)) = l.nthLe 1 hl := by
  rcases l with (_ | ⟨x, _ | ⟨y, tl⟩⟩)
  · simp at hl
  · 

Proof state:
case cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x : α
h : Nodup [x]
hl : 1 < length [x]
⊢ (formPerm [x]) (nthLe [x] 0 (_ : 0 < length [x])) = nthLe [x] 1 hl

Next tactic:
simp
set_option linter.deprecated false in
theorem formPerm_apply_nthLe_zero (l : List α) (h : Nodup l) (hl : 1 < l.length) :
    formPerm l (l.nthLe 0 (zero_lt_one.trans hl)) = l.nthLe 1 hl := by
  rcases l with (_ | ⟨x, _ | ⟨y, tl⟩⟩)
  · simp at hl
  · simp
  · 

Proof state:
case cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x y : α
tl : List α
h : Nodup (x :: y :: tl)
hl : 1 < length (x :: y :: tl)
⊢ (formPerm (x :: y :: tl)) (nthLe (x :: y :: tl) 0 (_ : 0 < length (x :: y :: tl))) = nthLe (x :: y :: tl) 1 hl

Next tactic:
simpa using formPerm_apply_head _ _ _ h
theorem formPerm_eq_head_iff_eq_getLast (x y : α) :
    formPerm (y :: l) x = y ↔ x = getLast (y :: l) (cons_ne_nil _ _) :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ x y : α
⊢ (formPerm (y :: l)) x = y ↔ (formPerm (y :: l)) x = (formPerm (y :: l)) (getLast (y :: l) (_ : y :: l ≠ []))

Next tactic:
rw [formPerm_apply_getLast]
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l l' : List α
⊢ {x | (prod (zipWith swap l l')) x ≠ x} ≤ ↑(toFinset l ⊔ toFinset l')

Next tactic:
simp only [Set.sup_eq_union, Set.le_eq_subset]
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x : α
l l' : List α
⊢ {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')

Next tactic:
induction' l with y l hl generalizing l'
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · 

Proof state:
case nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
l' : List α
⊢ {x | (prod (zipWith swap [] l')) x ≠ x} ⊆ ↑(toFinset [] ⊔ toFinset l')

Next tactic:
simp
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · 

Proof state:
case cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
l' : List α
⊢ {x | (prod (zipWith swap (y :: l) l')) x ≠ x} ⊆ ↑(toFinset (y :: l) ⊔ toFinset l')

Next tactic:
cases' l' with z l'
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · 

Proof state:
case cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
⊢ {x | (prod (zipWith swap (y :: l) [])) x ≠ x} ⊆ ↑(toFinset (y :: l) ⊔ toFinset [])

Next tactic:
simp
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · 

Proof state:
case cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
⊢ {x | (prod (zipWith swap (y :: l) (z :: l'))) x ≠ x} ⊆ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
intro x
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      

Proof state:
case cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
x : α
⊢ x ∈ {x | (prod (zipWith swap (y :: l) (z :: l'))) x ≠ x} → x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      

Proof state:
case cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
x : α
⊢ x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x} → x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
intro hx
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      

Proof state:
case cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
      · 

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
h : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
specialize hl l' h
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
      · specialize hl l' h
        

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
h : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
hl : x ∈ ↑(toFinset l ⊔ toFinset l')
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
simp only [ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.coe_union,
          coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
      · specialize hl l' h
        simp only [ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.coe_union,
          coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
        

Proof state:
case pos
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
h : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
hl : x ∈ l ∨ x ∈ l'
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
refine' Or.elim hl (fun hm => _) fun hm => _
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
      · specialize hl l' h
        simp only [ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.coe_union,
          coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
        refine' Or.elim hl (fun hm => _) fun hm => _ <;>
          · 

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
h : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
hl : x ∈ l ∨ x ∈ l'
hm : x ∈ l
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, toFinset_cons,
              mem_toFinset] at hm ⊢
theorem zipWith_swap_prod_support' (l l' : List α) :
    { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
  simp only [Set.sup_eq_union, Set.le_eq_subset]
  induction' l with y l hl generalizing l'
  · simp
  · cases' l' with z l'
    · simp
    · intro x
      simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
        mul_apply]
      intro hx
      by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
      · specialize hl l' h
        simp only [ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.coe_union,
          coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
        refine' Or.elim hl (fun hm => _) fun hm => _ <;>
          · simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, toFinset_cons,
              mem_toFinset] at hm ⊢
            

Proof state:
case pos.refine'_1
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ y : α
l : List α
z : α
l' : List α
x : α
hx : x ∈ {x | (swap y z) ((prod (zipWith swap l l')) x) ≠ x}
h : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
hl : x ∈ l ∨ x ∈ l'
hm : x ∈ l
⊢ x ∈ insert y (toFinset l) ⊔ insert z (toFinset l')

Next tactic:
simp [hm]