l3lab/ntp-mathlib huggingface dataset:
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'_2
α : 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'_2
α : 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]
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 ⊢
            simp [hm]
      · 

Proof state:
case neg
α : 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:
simp only [not_not, Set.mem_setOf_eq] at 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
        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 ⊢
            simp [hm]
      · simp only [not_not, Set.mem_setOf_eq] at h
        

Proof state:
case neg
α : 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 : (prod (zipWith swap l l')) x = x
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
simp only [h, Set.mem_setOf_eq] at 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
      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 ⊢
            simp [hm]
      · simp only [not_not, Set.mem_setOf_eq] at h
        simp only [h, Set.mem_setOf_eq] at hx
        

Proof state:
case neg
α : 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 : α
h : (prod (zipWith swap l l')) x = x
hx : (swap y z) x ≠ x
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
rw [swap_apply_ne_self_iff] at 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
      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 ⊢
            simp [hm]
      · simp only [not_not, Set.mem_setOf_eq] at h
        simp only [h, Set.mem_setOf_eq] at hx
        rw [swap_apply_ne_self_iff] at hx
        

Proof state:
case neg
α : 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 : α
h : (prod (zipWith swap l l')) x = x
hx : y ≠ z ∧ (x = y ∨ x = z)
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (z :: l'))

Next tactic:
rcases hx with ⟨hyz, rfl | rfl⟩
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 ⊢
            simp [hm]
      · simp only [not_not, Set.mem_setOf_eq] at h
        simp only [h, Set.mem_setOf_eq] at hx
        rw [swap_apply_ne_self_iff] at hx
        rcases hx with ⟨hyz, rfl | rfl⟩ <;> 

Proof state:
case neg.intro.inl
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
l : List α
hl : ∀ (l' : List α), {x | (prod (zipWith swap l l')) x ≠ x} ⊆ ↑(toFinset l ⊔ toFinset l')
z : α
l' : List α
x : α
h : (prod (zipWith swap l l')) x = x
hyz : x ≠ z
⊢ x ∈ ↑(toFinset (x :: l) ⊔ toFinset (z :: 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
  · 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 ⊢
            simp [hm]
      · simp only [not_not, Set.mem_setOf_eq] at h
        simp only [h, Set.mem_setOf_eq] at hx
        rw [swap_apply_ne_self_iff] at hx
        rcases hx with ⟨hyz, rfl | rfl⟩ <;> 

Proof state:
case neg.intro.inr
α : 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 : α
h : (prod (zipWith swap l l')) x = x
hyz : y ≠ x
⊢ x ∈ ↑(toFinset (y :: l) ⊔ toFinset (x :: l'))

Next tactic:
simp
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
    (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l✝ : List α
x : α
inst✝ : Fintype α
l l' : List α
⊢ support (prod (zipWith swap l l')) ≤ toFinset l ⊔ toFinset l'

Next tactic:
intro x hx
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
    (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
  intro x hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l✝ : List α
x✝ : α
inst✝ : Fintype α
l l' : List α
x : α
hx : x ∈ support (prod (zipWith swap l l'))
⊢ x ∈ toFinset l ⊔ toFinset l'

Next tactic:
have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by simpa using hx
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
    (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
  intro x hx
  have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l✝ : List α
x✝ : α
inst✝ : Fintype α
l l' : List α
x : α
hx : x ∈ support (prod (zipWith swap l l'))
⊢ x ∈ {x | (prod (zipWith swap l l')) x ≠ x}

Next tactic:
simpa using hx
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
    (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
  intro x hx
  have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by simpa using hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l✝ : List α
x✝ : α
inst✝ : Fintype α
l l' : List α
x : α
hx : x ∈ support (prod (zipWith swap l l'))
hx' : x ∈ {x | (prod (zipWith swap l l')) x ≠ x}
⊢ x ∈ toFinset l ⊔ toFinset l'

Next tactic:
simpa using zipWith_swap_prod_support' _ _ hx'
theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset := by
  

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

Next tactic:
refine' (zipWith_swap_prod_support' l l.tail).trans _
theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset := by
  refine' (zipWith_swap_prod_support' l l.tail).trans _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
⊢ ↑(toFinset l ⊔ toFinset (tail l)) ≤ ↑(toFinset l)

Next tactic:
simpa [Finset.subset_iff] using tail_subset l
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l : List α
x : α
inst✝ : Fintype α
⊢ support (formPerm l) ≤ toFinset l

Next tactic:
intro x hx
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
  intro x hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l : List α
x✝ : α
inst✝ : Fintype α
x : α
hx : x ∈ support (formPerm l)
⊢ x ∈ toFinset l

Next tactic:
have hx' : x ∈ { x | formPerm l x ≠ x } := by simpa using hx
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
  intro x hx
  have hx' : x ∈ { x | formPerm l x ≠ x } := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l : List α
x✝ : α
inst✝ : Fintype α
x : α
hx : x ∈ support (formPerm l)
⊢ x ∈ {x | (formPerm l) x ≠ x}

Next tactic:
simpa using hx
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
  intro x hx
  have hx' : x ∈ { x | formPerm l x ≠ x } := by simpa using hx
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : DecidableEq α
l : List α
x✝ : α
inst✝ : Fintype α
x : α
hx : x ∈ support (formPerm l)
hx' : x ∈ {x | (formPerm l) x ≠ x}
⊢ x ∈ toFinset l

Next tactic:
simpa using support_formPerm_le' _ hx'
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : Nodup xs
n : ℕ
hn : n + 1 < length xs
⊢ (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn

Next tactic:
induction' n with n IH generalizing xs
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · 

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : Nodup xs
hn : Nat.zero + 1 < length xs
⊢ (formPerm xs) (nthLe xs Nat.zero (_ : Nat.zero < length xs)) = nthLe xs (Nat.zero + 1) hn

Next tactic:
simpa using formPerm_apply_nthLe_zero _ h _
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · 

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
xs : List α
h : Nodup xs
hn : Nat.succ n + 1 < length xs
⊢ (formPerm xs) (nthLe xs (Nat.succ n) (_ : Nat.succ n < length xs)) = nthLe xs (Nat.succ n + 1) hn

Next tactic:
rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · 

Proof state:
case succ.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
h : Nodup []
hn : Nat.succ n + 1 < length []
⊢ (formPerm []) (nthLe [] (Nat.succ n) (_ : Nat.succ n < length [])) = nthLe [] (Nat.succ n + 1) hn

Next tactic:
simp at hn
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · 

Proof state:
case succ.cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x : α
h : Nodup [x]
hn : Nat.succ n + 1 < length [x]
⊢ (formPerm [x]) (nthLe [x] (Nat.succ n) (_ : Nat.succ n < length [x])) = nthLe [x] (Nat.succ n + 1) hn

Next tactic:
simp
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · 

Proof state:
case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
⊢ (formPerm (x :: y :: l)) (nthLe (x :: y :: l) (Nat.succ n) (_ : Nat.succ n < length (x :: y :: l))) =
    nthLe (x :: y :: l) (Nat.succ n + 1) hn

Next tactic:
specialize IH (y :: l) h.of_cons _
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · specialize IH (y :: l) h.of_cons _
      · 

Proof state:
case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
⊢ n + 1 < length (y :: l)

Next tactic:
simpa [Nat.succ_lt_succ_iff] using hn
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · specialize IH (y :: l) h.of_cons _
      · simpa [Nat.succ_lt_succ_iff] using hn
      

Proof state:
case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  (formPerm (y :: l)) (nthLe (y :: l) n (_ : n < length (y :: l))) =
    nthLe (y :: l) (n + 1) (_ : n + 1 < length (y :: l))
⊢ (formPerm (x :: y :: l)) (nthLe (x :: y :: l) (Nat.succ n) (_ : Nat.succ n < length (x :: y :: l))) =
    nthLe (x :: y :: l) (Nat.succ n + 1) hn

Next tactic:
simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · specialize IH (y :: l) h.of_cons _
      · simpa [Nat.succ_lt_succ_iff] using hn
      simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
      

Proof state:
case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), (formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  (formPerm (y :: l)) (nthLe (y :: l) n (_ : n < length (y :: l))) =
    nthLe (y :: l) (n + 1) (_ : n + 1 < length (y :: l))
⊢ (formPerm (y :: l)) (nthLe (x :: y :: l) (Nat.succ n) (_ : Nat.succ n < length (x :: y :: l))) =
    (swap x y) (nthLe (x :: y :: l) (Nat.succ n + 1) hn)

Next tactic:
simp only [nthLe, get_cons_succ] at *
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · specialize IH (y :: l) h.of_cons _
      · simpa [Nat.succ_lt_succ_iff] using hn
      simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
      simp only [nthLe, get_cons_succ] at *
      

Proof state:
case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        (formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  (formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
⊢ (formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    (swap x y) (get l { val := n, isLt := (_ : n < length l) })

Next tactic:
rw [← IH, swap_apply_of_ne_of_ne]
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
  induction' n with n IH generalizing xs
  · simpa using formPerm_apply_nthLe_zero _ h _
  · rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
    · simp at hn
    · simp
    · specialize IH (y :: l) h.of_cons _
      · simpa [Nat.succ_lt_succ_iff] using hn
      simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
      simp only [nthLe, get_cons_succ] at *
      rw [← IH, swap_apply_of_ne_of_ne] <;>
      · 

Proof state:
case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        (formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  (formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
⊢ (formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) ≠ x

Next tactic:
intro hx