l3lab/ntp-mathlib huggingface dataset:
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        

Proof state:
case mk.mk.cons.cons.nil.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝² head✝¹ : α
hx : List.length [head✝², head✝¹] = 2
head✝ : α
y : List α
hy : List.length (head✝ :: y) = 2
h : { val := [head✝², head✝¹], property := hx } ≈ { val := head✝ :: y, property := hy }
⊢ Sym2.fromVector { val := [head✝², head✝¹], property := hx } ≈ Sym2.fromVector { val := head✝ :: y, property := hy }

Next tactic:
cases' y with _ y
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · 

Proof state:
case mk.mk.cons.cons.nil.cons.nil
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝² head✝¹ : α
hx : List.length [head✝², head✝¹] = 2
head✝ : α
hy : List.length [head✝] = 2
h : { val := [head✝², head✝¹], property := hx } ≈ { val := [head✝], property := hy }
⊢ Sym2.fromVector { val := [head✝², head✝¹], property := hx } ≈ Sym2.fromVector { val := [head✝], property := hy }

Next tactic:
simp at hy
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        

Proof state:
case mk.mk.cons.cons.nil.cons.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝³ head✝² : α
hx : List.length [head✝³, head✝²] = 2
head✝¹ head✝ : α
y : List α
hy : List.length (head✝¹ :: head✝ :: y) = 2
h : { val := [head✝³, head✝²], property := hx } ≈ { val := head✝¹ :: head✝ :: y, property := hy }
⊢ Sym2.fromVector { val := [head✝³, head✝²], property := hx } ≈
    Sym2.fromVector { val := head✝¹ :: head✝ :: y, property := hy }

Next tactic:
cases' y with _ y
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; 

Proof state:
case mk.mk.cons.cons.nil.cons.cons.nil
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝³ head✝² : α
hx : List.length [head✝³, head✝²] = 2
head✝¹ head✝ : α
hy : List.length [head✝¹, head✝] = 2
h : { val := [head✝³, head✝²], property := hx } ≈ { val := [head✝¹, head✝], property := hy }
⊢ Sym2.fromVector { val := [head✝³, head✝²], property := hx } ≈
    Sym2.fromVector { val := [head✝¹, head✝], property := hy }
case mk.mk.cons.cons.nil.cons.cons.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝⁴ head✝³ : α
hx : List.length [head✝⁴, head✝³] = 2
head✝² head✝¹ head✝ : α
y : List α
hy : List.length (head✝² :: head✝¹ :: head✝ :: y) = 2
h : { val := [head✝⁴, head✝³], property := hx } ≈ { val := head✝² :: head✝¹ :: head✝ :: y, property := hy }
⊢ Sym2.fromVector { val := [head✝⁴, head✝³], property := hx } ≈
    Sym2.fromVector { val := head✝² :: head✝¹ :: head✝ :: y, property := hy }

Next tactic:
swap
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · 

Proof state:
case mk.mk.cons.cons.nil.cons.cons.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝⁴ head✝³ : α
hx : List.length [head✝⁴, head✝³] = 2
head✝² head✝¹ head✝ : α
y : List α
hy : List.length (head✝² :: head✝¹ :: head✝ :: y) = 2
h : { val := [head✝⁴, head✝³], property := hx } ≈ { val := head✝² :: head✝¹ :: head✝ :: y, property := hy }
⊢ Sym2.fromVector { val := [head✝⁴, head✝³], property := hx } ≈
    Sym2.fromVector { val := head✝² :: head✝¹ :: head✝ :: y, property := hy }

Next tactic:
exfalso
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          

Proof state:
case mk.mk.cons.cons.nil.cons.cons.cons.h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝⁴ head✝³ : α
hx : List.length [head✝⁴, head✝³] = 2
head✝² head✝¹ head✝ : α
y : List α
hy : List.length (head✝² :: head✝¹ :: head✝ :: y) = 2
h : { val := [head✝⁴, head✝³], property := hx } ≈ { val := head✝² :: head✝¹ :: head✝ :: y, property := hy }
⊢ False

Next tactic:
simp at hy
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        

Proof state:
case mk.mk.cons.cons.nil.cons.cons.nil
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝³ head✝² : α
hx : List.length [head✝³, head✝²] = 2
head✝¹ head✝ : α
hy : List.length [head✝¹, head✝] = 2
h : { val := [head✝³, head✝²], property := hx } ≈ { val := [head✝¹, head✝], property := hy }
⊢ Sym2.fromVector { val := [head✝³, head✝²], property := hx } ≈
    Sym2.fromVector { val := [head✝¹, head✝], property := hy }

Next tactic:
rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · 

Proof state:
case mk.mk.cons.cons.nil.cons.cons.nil.inl.intro
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝¹ head✝ : α
hx hy : List.length [head✝¹, head✝] = 2
h : { val := [head✝¹, head✝], property := hx } ≈ { val := [head✝¹, head✝], property := hy }
⊢ Sym2.fromVector { val := [head✝¹, head✝], property := hx } ≈
    Sym2.fromVector { val := [head✝¹, head✝], property := hy }

Next tactic:
constructor
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        

Proof state:
case mk.mk.cons.cons.nil.cons.cons.nil.inr.intro
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
head✝¹ head✝ : α
hx : List.length [head✝¹, head✝] = 2
hy : List.length [head✝, head✝¹] = 2
h : { val := [head✝¹, head✝], property := hx } ≈ { val := [head✝, head✝¹], property := hy }
⊢ Sym2.fromVector { val := [head✝¹, head✝], property := hx } ≈
    Sym2.fromVector { val := [head✝, head✝¹], property := hy }

Next tactic:
apply Sym2.Rel.swap
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
⊢ LeftInverse
    (Quotient.map Sym2.fromVector
      (_ :
        ∀ ⦃a b : Vector α 2⦄,
          (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b)))
    (Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b))

Next tactic:
apply Sym2.ind
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; 

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
⊢ ∀ (x y : α),
    Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        (Quotient.map
          (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
          (_ :
            ∀ ⦃a b : α × α⦄,
              a ≈ b →
                (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
                  (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
          ⟦(x, y)⟧) =
      ⟦(x, y)⟧

Next tactic:
aesop (add norm unfold [Sym2.fromVector])
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; aesop (add norm unfold [Sym2.fromVector])
  right_inv x := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x : Sym' α 2
⊢ Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
      (Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        x) =
    x

Next tactic:
refine' Quotient.recOnSubsingleton x fun x => _
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; aesop (add norm unfold [Sym2.fromVector])
  right_inv x := by
    refine' Quotient.recOnSubsingleton x fun x => _
    · 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ : Sym' α 2
x : Vector α 2
⊢ Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
      (Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        ⟦x⟧) =
    ⟦x⟧

Next tactic:
cases' x with x hx
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; aesop (add norm unfold [Sym2.fromVector])
  right_inv x := by
    refine' Quotient.recOnSubsingleton x fun x => _
    · cases' x with x hx
      

Proof state:
case mk
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ : Sym' α 2
x : List α
hx : List.length x = 2
⊢ Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
      (Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        ⟦{ val := x, property := hx }⟧) =
    ⟦{ val := x, property := hx }⟧

Next tactic:
cases' x with _ x
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; aesop (add norm unfold [Sym2.fromVector])
  right_inv x := by
    refine' Quotient.recOnSubsingleton x fun x => _
    · cases' x with x hx
      cases' x with _ x
      · 

Proof state:
case mk.nil
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x : Sym' α 2
hx : List.length [] = 2
⊢ Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
      (Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        ⟦{ val := [], property := hx }⟧) =
    ⟦{ val := [], property := hx }⟧

Next tactic:
simp at hx
/-- The symmetric square is equivalent to length-2 vectors up to permutations.
-/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
    where
  toFun :=
    Quotient.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
      (by
        rintro _ _ ⟨_⟩
        · constructor; apply List.Perm.refl
        apply List.Perm.swap'
        rfl)
  invFun :=
    Quotient.map fromVector
      (by
        rintro ⟨x, hx⟩ ⟨y, hy⟩ h
        cases' x with _ x; · simp at hx
        cases' x with _ x; · simp at hx
        cases' x with _ x; swap
        · exfalso
          simp at hx
        cases' y with _ y; · simp at hy
        cases' y with _ y; · simp at hy
        cases' y with _ y; swap
        · exfalso
          simp at hy
        rcases perm_card_two_iff.mp h with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
        · constructor
        apply Sym2.Rel.swap)
  left_inv := by apply Sym2.ind; aesop (add norm unfold [Sym2.fromVector])
  right_inv x := by
    refine' Quotient.recOnSubsingleton x fun x => _
    · cases' x with x hx
      cases' x with _ x
      · simp at hx
      

Proof state:
case mk.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ : Sym' α 2
head✝ : α
x : List α
hx : List.length (head✝ :: x) = 2
⊢ Quotient.map (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) })
      (_ :
        ∀ ⦃a b : α × α⦄,
          a ≈ b →
            (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) a ≈
              (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) b)
      (Quotient.map Sym2.fromVector
        (_ :
          ∀ ⦃a b : Vector α 2⦄,
            (fun x x_1 => x ≈ x_1) a b → (fun x x_1 => x ≈ x_1) (Sym2.fromVector a) (Sym2.fromVector b))
        ⟦{ val := head✝ :: x, property := hx }⟧) =
    ⟦{ val := head✝ :: x, property := hx }⟧

Next tactic:
cases' x with _ x