l3lab/ntp-mathlib huggingface dataset:
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    

Proof state:
case swap
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
⊢ List.sym2 (y :: x :: xs) ~ List.sym2 (x :: y :: xs)

Next tactic:
simp only [List.sym2, map_cons, cons_append]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    

Proof state:
case swap
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
⊢ ⟦(y, y)⟧ ::
      ⟦(y, x)⟧ ::
        (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ List.sym2 xs)) ~
    ⟦(x, x)⟧ ::
      ⟦(x, y)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ List.sym2 xs))

Next tactic:
conv => enter [1,2,1]; rw [Sym2.eq_swap]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => 

Proof state:
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
| ⟦(y, y)⟧ ::
      ⟦(y, x)⟧ ::
        (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ List.sym2 xs)) ~
    ⟦(x, x)⟧ ::
      ⟦(x, y)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ List.sym2 xs))

Next tactic:
enter [1,2,1]; rw [Sym2.eq_swap]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => 

Proof state:
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
| ⟦(y, y)⟧ ::
      ⟦(y, x)⟧ ::
        (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ List.sym2 xs)) ~
    ⟦(x, x)⟧ ::
      ⟦(x, y)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ List.sym2 xs))

Next tactic:
enter [1,2,1]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; 

Proof state:
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
| ⟦(y, x)⟧

Next tactic:
rw [Sym2.eq_swap]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; rw [Sym2.eq_swap]
    -- Explicit permutation to speed up simps that follow.
    

Proof state:
case swap
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
⊢ ⟦(y, y)⟧ ::
      ⟦(x, y)⟧ ::
        (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ List.sym2 xs)) ~
    ⟦(x, x)⟧ ::
      ⟦(x, y)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ List.sym2 xs))

Next tactic:
refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..))
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; rw [Sym2.eq_swap]
    -- Explicit permutation to speed up simps that follow.
    refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..))
    

Proof state:
case swap
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
⊢ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ List.sym2 xs)) ~
    ⟦(x, x)⟧ :: (List.map (fun y => ⟦(x, y)⟧) xs ++ ⟦(y, y)⟧ :: (List.map (fun y_1 => ⟦(y, y_1)⟧) xs ++ List.sym2 xs))

Next tactic:
simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe,
      ← Multiset.coe_add, ← Multiset.singleton_add]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; rw [Sym2.eq_swap]
    -- Explicit permutation to speed up simps that follow.
    refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..))
    simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe,
      ← Multiset.coe_add, ← Multiset.singleton_add]
    

Proof state:
case swap
α : Type u_1
xs✝ ys : List α
x y : α
xs : List α
⊢ {⟦(y, y)⟧} +
      (↑(List.map (fun y_1 => ⟦(y, y_1)⟧) xs) + ({⟦(x, x)⟧} + (↑(List.map (fun y => ⟦(x, y)⟧) xs) + ↑(List.sym2 xs)))) =
    {⟦(x, x)⟧} +
      (↑(List.map (fun y => ⟦(x, y)⟧) xs) + ({⟦(y, y)⟧} + (↑(List.map (fun y_1 => ⟦(y, y_1)⟧) xs) + ↑(List.sym2 xs))))

Next tactic:
simp only [add_assoc, add_left_comm]
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; rw [Sym2.eq_swap]
    -- Explicit permutation to speed up simps that follow.
    refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..))
    simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe,
      ← Multiset.coe_add, ← Multiset.singleton_add]
    simp only [add_assoc, add_left_comm]
  

Proof state:
case trans
α : Type u_1
xs ys l₁✝ l₂✝ l₃✝ : List α
a✝¹ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
ih1 : List.sym2 l₁✝ ~ List.sym2 l₂✝
ih2 : List.sym2 l₂✝ ~ List.sym2 l₃✝
⊢ List.sym2 l₁✝ ~ List.sym2 l₃✝

Next tactic:
| trans _ _ ih1 ih2 => exact ih1.trans ih2
protected theorem Perm.sym2 {xs ys : List α} (h : xs ~ ys) :
    xs.sym2 ~ ys.sym2 := by
  induction h with
  | nil => rfl
  | cons x h ih =>
    simp only [List.sym2, map_cons, cons_append, perm_cons]
    exact (h.map _).append ih
  | swap x y xs =>
    simp only [List.sym2, map_cons, cons_append]
    conv => enter [1,2,1]; rw [Sym2.eq_swap]
    -- Explicit permutation to speed up simps that follow.
    refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..))
    simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe,
      ← Multiset.coe_add, ← Multiset.singleton_add]
    simp only [add_assoc, add_left_comm]
  | trans _ _ ih1 ih2 => 

Proof state:
case trans
α : Type u_1
xs ys l₁✝ l₂✝ l₃✝ : List α
a✝¹ : l₁✝ ~ l₂✝
a✝ : l₂✝ ~ l₃✝
ih1 : List.sym2 l₁✝ ~ List.sym2 l₂✝
ih2 : List.sym2 l₂✝ ~ List.sym2 l₃✝
⊢ List.sym2 l₁✝ ~ List.sym2 l₃✝

Next tactic:
exact ih1.trans ih2
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  

Proof state:
α : Type u_1
xs ys : List α
h : xs <+ ys
⊢ List.sym2 xs <+ List.sym2 ys

Next tactic:
induction h with
  | slnil => apply slnil
  | cons a h ih =>
    simp only [List.sym2]
    exact Sublist.append (nil_sublist _) ih
  | cons₂ a h ih =>
    simp only [List.sym2, map_cons, cons_append]
    exact cons₂ _ (append (Sublist.map _ h) ih)
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  

Proof state:
case slnil
α : Type u_1
xs ys : List α
⊢ List.sym2 [] <+ List.sym2 []

Next tactic:
| slnil => apply slnil
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => 

Proof state:
case slnil
α : Type u_1
xs ys : List α
⊢ List.sym2 [] <+ List.sym2 []

Next tactic:
apply slnil
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  

Proof state:
case cons
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ List.sym2 l₁✝ <+ List.sym2 (a :: l₂✝)

Next tactic:
| cons a h ih =>
    simp only [List.sym2]
    exact Sublist.append (nil_sublist _) ih
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  | cons a h ih =>
    

Proof state:
case cons
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ List.sym2 l₁✝ <+ List.sym2 (a :: l₂✝)

Next tactic:
simp only [List.sym2]
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  | cons a h ih =>
    simp only [List.sym2]
    

Proof state:
case cons
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ List.sym2 l₁✝ <+ List.map (fun y => ⟦(a, y)⟧) (a :: l₂✝) ++ List.sym2 l₂✝

Next tactic:
exact Sublist.append (nil_sublist _) ih
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  | cons a h ih =>
    simp only [List.sym2]
    exact Sublist.append (nil_sublist _) ih
  

Proof state:
case cons₂
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ List.sym2 (a :: l₁✝) <+ List.sym2 (a :: l₂✝)

Next tactic:
| cons₂ a h ih =>
    simp only [List.sym2, map_cons, cons_append]
    exact cons₂ _ (append (Sublist.map _ h) ih)
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  | cons a h ih =>
    simp only [List.sym2]
    exact Sublist.append (nil_sublist _) ih
  | cons₂ a h ih =>
    

Proof state:
case cons₂
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ List.sym2 (a :: l₁✝) <+ List.sym2 (a :: l₂✝)

Next tactic:
simp only [List.sym2, map_cons, cons_append]
protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by
  induction h with
  | slnil => apply slnil
  | cons a h ih =>
    simp only [List.sym2]
    exact Sublist.append (nil_sublist _) ih
  | cons₂ a h ih =>
    simp only [List.sym2, map_cons, cons_append]
    

Proof state:
case cons₂
α : Type u_1
xs ys l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
ih : List.sym2 l₁✝ <+ List.sym2 l₂✝
⊢ ⟦(a, a)⟧ :: (List.map (fun y => ⟦(a, y)⟧) l₁✝ ++ List.sym2 l₁✝) <+
    ⟦(a, a)⟧ :: (List.map (fun y => ⟦(a, y)⟧) l₂✝ ++ List.sym2 l₂✝)

Next tactic:
exact cons₂ _ (append (Sublist.map _ h) ih)
protected theorem Subperm.sym2 {xs ys : List α} (h : xs <+~ ys) : xs.sym2 <+~ ys.sym2 := by
  

Proof state:
α : Type u_1
xs ys : List α
h : xs <+~ ys
⊢ List.sym2 xs <+~ List.sym2 ys

Next tactic:
obtain ⟨xs', hx, h⟩ := h
protected theorem Subperm.sym2 {xs ys : List α} (h : xs <+~ ys) : xs.sym2 <+~ ys.sym2 := by
  obtain ⟨xs', hx, h⟩ := h
  

Proof state:
case intro.intro
α : Type u_1
xs ys xs' : List α
hx : xs' ~ xs
h : xs' <+ ys
⊢ List.sym2 xs <+~ List.sym2 ys

Next tactic:
exact hx.sym2.symm.subperm.trans h.sym2.subperm
theorem length_sym2 {xs : List α} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
  

Proof state:
α : Type u_1
xs : List α
⊢ length (List.sym2 xs) = Nat.choose (length xs + 1) 2

Next tactic:
induction xs with
  | nil => rfl
  | cons x xs ih =>
    rw [List.sym2, length_append, length_map, length_cons,
        Nat.choose_succ_succ, ← ih, Nat.choose_one_right]
theorem length_sym2 {xs : List α} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
  induction xs with
  

Proof state:
case nil
α : Type u_1
⊢ length (List.sym2 []) = Nat.choose (length [] + 1) 2

Next tactic:
| nil => rfl
theorem length_sym2 {xs : List α} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
  induction xs with
  | nil => 

Proof state:
case nil
α : Type u_1
⊢ length (List.sym2 []) = Nat.choose (length [] + 1) 2

Next tactic:
rfl
theorem length_sym2 {xs : List α} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
  induction xs with
  | nil => rfl
  

Proof state:
case cons
α : Type u_1
x : α
xs : List α
ih : length (List.sym2 xs) = Nat.choose (length xs + 1) 2
⊢ length (List.sym2 (x :: xs)) = Nat.choose (length (x :: xs) + 1) 2

Next tactic:
| cons x xs ih =>
    rw [List.sym2, length_append, length_map, length_cons,
        Nat.choose_succ_succ, ← ih, Nat.choose_one_right]
theorem length_sym2 {xs : List α} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
  induction xs with
  | nil => rfl
  | cons x xs ih =>
    

Proof state:
case cons
α : Type u_1
x : α
xs : List α
ih : length (List.sym2 xs) = Nat.choose (length xs + 1) 2
⊢ length (List.sym2 (x :: xs)) = Nat.choose (length (x :: xs) + 1) 2

Next tactic:
rw [List.sym2, length_append, length_map, length_cons,
        Nat.choose_succ_succ, ← ih, Nat.choose_one_right]
theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil) := by
  

Proof state:
α : Type u_1
xs ys : List α
n : ℕ
⊢ List.sym 1 xs = map (fun x => x ::ₛ Sym.nil) xs

Next tactic:
induction xs with
  | nil => rfl
  | cons x xs ih =>
    rw [map_cons, ← ih, List.sym, List.sym, map_singleton, singleton_append]
theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil) := by
  induction xs with
  

Proof state:
case nil
α : Type u_1
xs ys : List α
n : ℕ
⊢ List.sym 1 [] = map (fun x => x ::ₛ Sym.nil) []

Next tactic:
| nil => rfl
theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil) := by
  induction xs with
  | nil => 

Proof state:
case nil
α : Type u_1
xs ys : List α
n : ℕ
⊢ List.sym 1 [] = map (fun x => x ::ₛ Sym.nil) []

Next tactic:
rfl
theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil) := by
  induction xs with
  | nil => rfl
  

Proof state:
case cons
α : Type u_1
xs✝ ys : List α
n : ℕ
x : α
xs : List α
ih : List.sym 1 xs = map (fun x => x ::ₛ Sym.nil) xs
⊢ List.sym 1 (x :: xs) = map (fun x => x ::ₛ Sym.nil) (x :: xs)

Next tactic:
| cons x xs ih =>
    rw [map_cons, ← ih, List.sym, List.sym, map_singleton, singleton_append]
theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil) := by
  induction xs with
  | nil => rfl
  | cons x xs ih =>
    

Proof state:
case cons
α : Type u_1
xs✝ ys : List α
n : ℕ
x : α
xs : List α
ih : List.sym 1 xs = map (fun x => x ::ₛ Sym.nil) xs
⊢ List.sym 1 (x :: xs) = map (fun x => x ::ₛ Sym.nil) (x :: xs)

Next tactic:
rw [map_cons, ← ih, List.sym, List.sym, map_singleton, singleton_append]
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  

Proof state:
α : Type u_1
xs ys : List α
n : ℕ
⊢ map (⇑(Sym2.equivSym α)) (List.sym2 xs) = List.sym 2 xs

Next tactic:
induction xs with
  | nil => rfl
  | cons x xs ih =>
    rw [List.sym, ← ih, sym_one_eq, map_map, List.sym2, map_append, map_map]
    rfl
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  induction xs with
  

Proof state:
case nil
α : Type u_1
xs ys : List α
n : ℕ
⊢ map (⇑(Sym2.equivSym α)) (List.sym2 []) = List.sym 2 []

Next tactic:
| nil => rfl
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  induction xs with
  | nil => 

Proof state:
case nil
α : Type u_1
xs ys : List α
n : ℕ
⊢ map (⇑(Sym2.equivSym α)) (List.sym2 []) = List.sym 2 []

Next tactic:
rfl
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  induction xs with
  | nil => rfl
  

Proof state:
case cons
α : Type u_1
xs✝ ys : List α
n : ℕ
x : α
xs : List α
ih : map (⇑(Sym2.equivSym α)) (List.sym2 xs) = List.sym 2 xs
⊢ map (⇑(Sym2.equivSym α)) (List.sym2 (x :: xs)) = List.sym 2 (x :: xs)

Next tactic:
| cons x xs ih =>
    rw [List.sym, ← ih, sym_one_eq, map_map, List.sym2, map_append, map_map]
    rfl
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  induction xs with
  | nil => rfl
  | cons x xs ih =>
    

Proof state:
case cons
α : Type u_1
xs✝ ys : List α
n : ℕ
x : α
xs : List α
ih : map (⇑(Sym2.equivSym α)) (List.sym2 xs) = List.sym 2 xs
⊢ map (⇑(Sym2.equivSym α)) (List.sym2 (x :: xs)) = List.sym 2 (x :: xs)

Next tactic:
rw [List.sym, ← ih, sym_one_eq, map_map, List.sym2, map_append, map_map]
theorem sym2_eq_sym_two : xs.sym2.map (Sym2.equivSym α) = xs.sym 2 := by
  induction xs with
  | nil => rfl
  | cons x xs ih =>
    rw [List.sym, ← ih, sym_one_eq, map_map, List.sym2, map_append, map_map]
    

Proof state:
case cons
α : Type u_1
xs✝ ys : List α
n : ℕ
x : α
xs : List α
ih : map (⇑(Sym2.equivSym α)) (List.sym2 xs) = List.sym 2 xs
⊢ map (⇑(Sym2.equivSym α) ∘ fun y => ⟦(x, y)⟧) (x :: xs) ++ map (⇑(Sym2.equivSym α)) (List.sym2 xs) =
    map ((fun p => x ::ₛ p) ∘ fun x => x ::ₛ Sym.nil) (x :: xs) ++ map (⇑(Sym2.equivSym α)) (List.sym2 xs)

Next tactic:
rfl
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝ : ℕ
β : Type u_2
f : α → β
n : ℕ
xs x✝ : List α
⊢ List.sym 0 (map f x✝) = map (Sym.map f) (List.sym 0 x✝)

Next tactic:
simp only [List.sym]
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝ : ℕ
β : Type u_2
f : α → β
n : ℕ
xs x✝ : List α
⊢ [Sym.nil] = map (Sym.map f) [Sym.nil]

Next tactic:
rfl
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by 

Proof state:
α : Type u_1
xs✝ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs : List α
n : ℕ
⊢ List.sym (n + 1) (map f []) = map (Sym.map f) (List.sym (n + 1) [])

Next tactic:
simp [List.sym]
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ List.sym (n + 1) (map f (x :: xs)) = map (Sym.map f) (List.sym (n + 1) (x :: xs))

Next tactic:
rw [map_cons, List.sym, ← map_cons, sym_map f n (x :: xs), sym_map f (n + 1) xs]
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [map_cons, List.sym, ← map_cons, sym_map f n (x :: xs), sym_map f (n + 1) xs]
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ map (fun p => f x ::ₛ p) (map (Sym.map f) (List.sym n (x :: xs))) ++ map (Sym.map f) (List.sym (n + 1) xs) =
    map (Sym.map f) (List.sym (n + 1) (x :: xs))

Next tactic:
simp only [map_map, List.sym, map_append, append_cancel_right_eq]
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [map_cons, List.sym, ← map_cons, sym_map f n (x :: xs), sym_map f (n + 1) xs]
    simp only [map_map, List.sym, map_append, append_cancel_right_eq]
    

Proof state:
α : Type u_1
xs✝¹ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ map ((fun p => f x ::ₛ p) ∘ Sym.map f) (List.sym n (x :: xs)) =
    map (Sym.map f ∘ fun p => x ::ₛ p) (List.sym n (x :: xs))

Next tactic:
congr
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [map_cons, List.sym, ← map_cons, sym_map f n (x :: xs), sym_map f (n + 1) xs]
    simp only [map_map, List.sym, map_append, append_cancel_right_eq]
    congr
    

Proof state:
case e_f
α : Type u_1
xs✝¹ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
⊢ (fun p => f x ::ₛ p) ∘ Sym.map f = Sym.map f ∘ fun p => x ::ₛ p

Next tactic:
ext s
theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f) :=
  match n, xs with
  | 0, _ => by simp only [List.sym]; rfl
  | n + 1, [] => by simp [List.sym]
  | n + 1, x :: xs => by
    rw [map_cons, List.sym, ← map_cons, sym_map f n (x :: xs), sym_map f (n + 1) xs]
    simp only [map_map, List.sym, map_append, append_cancel_right_eq]
    congr
    ext s
    

Proof state:
case e_f.h.h
α : Type u_1
xs✝¹ ys : List α
n✝¹ : ℕ
β : Type u_2
f : α → β
n✝ : ℕ
xs✝ : List α
n : ℕ
x : α
xs : List α
s : Sym α n
⊢ ↑(((fun p => f x ::ₛ p) ∘ Sym.map f) s) = ↑((Sym.map f ∘ fun p => x ::ₛ p) s)

Next tactic:
simp only [Function.comp_apply, Sym.map_cons]
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by 

Proof state:
α : Type u_1
xs✝¹ ys✝¹ : List α
n✝ n : ℕ
xs✝ ys✝ : List α
h : xs✝ <+ ys✝
ys xs : List α
x✝ : xs <+ ys
⊢ List.sym 0 xs <+ List.sym 0 ys

Next tactic:
simp [List.sym]
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    

Proof state:
α : Type u_1
xs✝¹ ys✝ : List α
n✝¹ n✝ : ℕ
xs✝ ys : List α
h✝ : xs✝ <+ ys
xs : List α
n : ℕ
l₂✝ : List α
a : α
h : xs <+ l₂✝
⊢ List.sym (n + 1) xs <+ List.sym (n + 1) (a :: l₂✝)

Next tactic:
rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    

Proof state:
α : Type u_1
xs✝¹ ys✝ : List α
n✝¹ n✝ : ℕ
xs✝ ys : List α
h✝ : xs✝ <+ ys
xs : List α
n : ℕ
l₂✝ : List α
a : α
h : xs <+ l₂✝
⊢ [] ++ List.sym (n + 1) xs <+ List.map (fun p => a ::ₛ p) (List.sym n (a :: l₂✝)) ++ List.sym (n + 1) l₂✝

Next tactic:
apply Sublist.append (nil_sublist _)
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    apply Sublist.append (nil_sublist _)
    

Proof state:
α : Type u_1
xs✝¹ ys✝ : List α
n✝¹ n✝ : ℕ
xs✝ ys : List α
h✝ : xs✝ <+ ys
xs : List α
n : ℕ
l₂✝ : List α
a : α
h : xs <+ l₂✝
⊢ List.sym (n + 1) xs <+ List.sym (n + 1) l₂✝

Next tactic:
exact h.sym (n + 1)
protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n :=
  match n, h with
  | 0, _ => by simp [List.sym]
  | n + 1, .slnil => .slnil
  | n + 1, .cons a h => by
    rw [List.sym, ← nil_append (List.sym (n + 1) xs)]
    apply Sublist.append (nil_sublist _)
    exact h.sym (n + 1)
  | n + 1, .cons₂ a h => by
    

Proof state:
α : Type u_1
xs✝ ys✝ : List α
n✝¹ n✝ : ℕ
xs ys : List α
h✝ : xs <+ ys
n : ℕ
l₁✝ l₂✝ : List α
a : α
h : l₁✝ <+ l₂✝
⊢ List.sym (n + 1) (a :: l₁✝) <+ List.sym (n + 1) (a :: l₂✝)

Next tactic:
rw [List.sym, List.sym]