l3lab/ntp-mathlib huggingface dataset:
theorem other_ne {a : α} {z : Sym2 α} (hd : ¬IsDiag z) (h : a ∈ z) : Mem.other h ≠ a := by
  contrapose! hd
  have h' := Sym2.other_spec h
  rw [hd] at h'
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a : α
z : Sym2 α
h : a ∈ z
hd : Mem.other h = a
h' : ⟦(a, a)⟧ = z
⊢ IsDiag z

Next tactic:
rw [← h']
theorem other_ne {a : α} {z : Sym2 α} (hd : ¬IsDiag z) (h : a ∈ z) : Mem.other h ≠ a := by
  contrapose! hd
  have h' := Sym2.other_spec h
  rw [hd] at h'
  rw [← h']
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a : α
z : Sym2 α
h : a ∈ z
hd : Mem.other h = a
h' : ⟦(a, a)⟧ = z
⊢ IsDiag ⟦(a, a)⟧

Next tactic:
simp
theorem fromRel_bot : fromRel (fun (x y : α) z => z : Symmetric ⊥) = ∅ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ fromRel (_ : ∀ (x y : α), ⊥ x y → ⊥ x y) = ∅

Next tactic:
apply Set.eq_empty_of_forall_not_mem fun e => _
theorem fromRel_bot : fromRel (fun (x y : α) z => z : Symmetric ⊥) = ∅ := by
  apply Set.eq_empty_of_forall_not_mem fun e => _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ ∀ (e : Sym2 α), e ∉ fromRel (_ : ∀ (x y : α), ⊥ x y → ⊥ x y)

Next tactic:
apply Sym2.ind
theorem fromRel_bot : fromRel (fun (x y : α) z => z : Symmetric ⊥) = ∅ := by
  apply Set.eq_empty_of_forall_not_mem fun e => _
  apply Sym2.ind
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∉ fromRel (_ : ∀ (x y : α), ⊥ x y → ⊥ x y)

Next tactic:
simp [-Set.bot_eq_empty, Prop.bot_eq_false]
theorem fromRel_top : fromRel (fun (x y : α) z => z : Symmetric ⊤) = Set.univ := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ fromRel (_ : ∀ (x y : α), ⊤ x y → ⊤ x y) = Set.univ

Next tactic:
apply Set.eq_univ_of_forall fun e => _
theorem fromRel_top : fromRel (fun (x y : α) z => z : Symmetric ⊤) = Set.univ := by
  apply Set.eq_univ_of_forall fun e => _
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ ∀ (e : Sym2 α), e ∈ fromRel (_ : ∀ (x y : α), ⊤ x y → ⊤ x y)

Next tactic:
apply Sym2.ind
theorem fromRel_top : fromRel (fun (x y : α) z => z : Symmetric ⊤) = Set.univ := by
  apply Set.eq_univ_of_forall fun e => _
  apply Sym2.ind
  

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∈ fromRel (_ : ∀ (x y : α), ⊤ x y → ⊤ x y)

Next tactic:
simp [-Set.top_eq_univ, Prop.top_eq_true]
theorem fromRel_ne : fromRel (fun (x y : α) z => z.symm : Symmetric Ne) = {z | ¬IsDiag z} := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
⊢ fromRel (_ : ∀ (x y : α), x ≠ y → y ≠ x) = {z | ¬IsDiag z}

Next tactic:
ext z
theorem fromRel_ne : fromRel (fun (x y : α) z => z.symm : Symmetric Ne) = {z | ¬IsDiag z} := by
  ext z; 

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
z : Sym2 α
⊢ z ∈ fromRel (_ : ∀ (x y : α), x ≠ y → y ≠ x) ↔ z ∈ {z | ¬IsDiag z}

Next tactic:
exact z.ind (by simp)
theorem fromRel_ne : fromRel (fun (x y : α) z => z.symm : Symmetric Ne) = {z | ¬IsDiag z} := by
  ext z; exact z.ind (by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
z : Sym2 α
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∈ fromRel (_ : ∀ (x y : α), x ≠ y → y ≠ x) ↔ ⟦(x, y)⟧ ∈ {z | ¬IsDiag z}

Next tactic:
simp
theorem fromRel_irreflexive {sym : Symmetric r} :
    Irreflexive r ↔ ∀ {z}, z ∈ fromRel sym → ¬IsDiag z :=
  { mp := by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
sym : Symmetric r
⊢ Irreflexive r → ∀ {z : Sym2 α}, z ∈ fromRel sym → ¬IsDiag z

Next tactic:
intro h
theorem fromRel_irreflexive {sym : Symmetric r} :
    Irreflexive r ↔ ∀ {z}, z ∈ fromRel sym → ¬IsDiag z :=
  { mp := by intro h; 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
sym : Symmetric r
h : Irreflexive r
⊢ ∀ {z : Sym2 α}, z ∈ fromRel sym → ¬IsDiag z

Next tactic:
apply Sym2.ind
theorem fromRel_irreflexive {sym : Symmetric r} :
    Irreflexive r ↔ ∀ {z}, z ∈ fromRel sym → ¬IsDiag z :=
  { mp := by intro h; apply Sym2.ind; 

Proof state:
case h
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
sym : Symmetric r
h : Irreflexive r
⊢ ∀ (x y : α), ⟦(x, y)⟧ ∈ fromRel sym → ¬IsDiag ⟦(x, y)⟧

Next tactic:
aesop
theorem toRel_symmetric (s : Set (Sym2 α)) : Symmetric (ToRel s) := fun x y => by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
r : α → α → Prop
s : Set (Sym2 α)
x y : α
⊢ ToRel s x y → ToRel s y x

Next tactic:
simp [eq_swap]
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
⊢ List.Perm [a₁, b₁] [a₂, b₂] → a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂

Next tactic:
simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
⊢ a₁ = a₂ ∧ b₁ = b₂ ∨ ¬a₁ = a₂ ∧ b₁ = a₂ ∧ b₂ = a₁ → a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂

Next tactic:
tauto
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = a₂
h₂ : b₁ = b₂
⊢ List.Perm [a₁, b₁] [a₂, b₂]

Next tactic:
rw [h₁, h₂]
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          

Proof state:

Next tactic:
first | done | apply List.Perm.swap'; rfl
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          first | 

Proof state:

Next tactic:
done
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = b₂
h₂ : b₁ = a₂
⊢ List.Perm [a₁, b₁] [a₂, b₂]

Next tactic:
rw [h₁, h₂]
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = b₂
h₂ : b₁ = a₂
⊢ List.Perm [b₂, a₂] [a₂, b₂]

Next tactic:
first | done | apply List.Perm.swap'; rfl
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          first | 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = b₂
h₂ : b₁ = a₂
⊢ List.Perm [b₂, a₂] [a₂, b₂]

Next tactic:
done
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          first | done | 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = b₂
h₂ : b₁ = a₂
⊢ List.Perm [b₂, a₂] [a₂, b₂]

Next tactic:
apply List.Perm.swap'
private theorem perm_card_two_iff {a₁ b₁ a₂ b₂ : α} :
    [a₁, b₁].Perm [a₂, b₂] ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ a₁ = b₂ ∧ b₁ = a₂ :=
  { mp := by
      simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, Multiset.coe_nil, Multiset.cons_zero,
        Multiset.cons_eq_cons, Multiset.singleton_inj, ne_eq, Multiset.singleton_eq_cons_iff,
        exists_eq_right_right, and_true]
      tauto
    mpr := fun
        | .inl ⟨h₁, h₂⟩ | .inr ⟨h₁, h₂⟩ => by
          rw [h₁, h₂]
          first | done | apply List.Perm.swap'; 

Proof state:
case p
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
a₁ b₁ a₂ b₂ : α
h₁ : a₁ = b₂
h₂ : b₁ = a₂
⊢ List.Perm [] []

Next tactic:
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
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
⊢ ((fun x x_1 => x ≈ x_1) ⇒ fun x x_1 => x ≈ x_1)
    (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) fun x =>
    { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }

Next tactic:
rintro _ _ ⟨_⟩
/-- 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 _ _ ⟨_⟩
        · 

Proof state:
case refl
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ y✝ : α
⊢ (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) (x✝, y✝) ≈
    (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) (x✝, y✝)

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; 

Proof state:
case refl.a
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ y✝ : α
⊢ List.Perm [(x✝, y✝).2] [(x✝, y✝).2]

Next tactic:
apply List.Perm.refl
/-- 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
        

Proof state:
case swap
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ y✝ : α
⊢ (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) (x✝, y✝) ≈
    (fun x => { val := [x.1, x.2], property := (_ : List.length [x.1, x.2] = List.length [x.1, x.2]) }) (y✝, x✝)

Next tactic:
apply List.Perm.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'
        

Proof state:
case swap.p
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x✝ y✝ : α
⊢ List.Perm [] []

Next tactic:
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
        

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
⊢ ((fun x x_1 => x ≈ x_1) ⇒ fun x x_1 => x ≈ x_1) Sym2.fromVector Sym2.fromVector

Next tactic:
rintro ⟨x, hx⟩ ⟨y, hy⟩ h
/-- 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
        

Proof state:
case mk.mk
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
x : List α
hx : List.length x = 2
y : List α
hy : List.length y = 2
h : { val := x, property := hx } ≈ { val := y, property := hy }
⊢ Sym2.fromVector { val := x, property := hx } ≈ Sym2.fromVector { val := y, property := hy }

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; · 

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

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
        

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

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; · 

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

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
        

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

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; 

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

Proof state:
case mk.mk.cons.cons.cons
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
y : List α
hy : List.length y = 2
head✝² head✝¹ head✝ : α
x : List α
hx : List.length (head✝² :: head✝¹ :: head✝ :: x) = 2
h : { val := head✝² :: head✝¹ :: head✝ :: x, property := hx } ≈ { val := y, property := hy }
⊢ Sym2.fromVector { val := head✝² :: head✝¹ :: head✝ :: x, property := hx } ≈
    Sym2.fromVector { val := 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
          

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

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
        

Proof state:
case mk.mk.cons.cons.nil
α : Type u_1
β : Type u_2
γ : Type u_3
e : Sym2 α
f : α → β
y : List α
hy : List.length y = 2
head✝¹ head✝ : α
hx : List.length [head✝¹, head✝] = 2
h : { val := [head✝¹, head✝], property := hx } ≈ { val := y, property := hy }
⊢ Sym2.fromVector { val := [head✝¹, head✝], property := hx } ≈ Sym2.fromVector { val := 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; · 

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

Next tactic:
simp at hy