English
The symmetric square is equivalent to the type of 2-element vectors up to permutation.
Русский
Симметрическая пара эквивалентна множеству двуэлементных векторов по перестановке элементов.
LaTeX
$$$\\mathrm{Sym}^2(\\alpha) \\simeq \\mathrm{Sym}'(\\alpha,2)$$$
Lean4
/-- The symmetric square is equivalent to length-2 vectors up to permutations. -/
def sym2EquivSym' : Equiv (Sym2 α) (Sym' α 2)
where
toFun :=
Quot.map (fun x : α × α => ⟨[x.1, x.2], rfl⟩)
(by
rintro _ _ ⟨_⟩
· constructor; apply List.Perm.refl
apply List.Perm.swap'
rfl)
invFun :=
Quot.map fromVector
(by
rintro ⟨x, hx⟩ ⟨y, hy⟩ h
rcases x with - | ⟨_, x⟩; · simp at hx
rcases x with - | ⟨_, x⟩; · simp at hx
rcases x with - | ⟨_, x⟩; swap
· exfalso
simp at hx
rcases y with - | ⟨_, y⟩; · simp at hy
rcases y with - | ⟨_, y⟩; · simp at hy
rcases 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 x.recOnSubsingleton fun x => ?_
obtain ⟨x, hx⟩ := x
obtain - | ⟨-, x⟩ := x
· simp at hx
rcases x with - | ⟨_, x⟩
· simp at hx
rcases x with - | ⟨_, x⟩
swap
· exfalso
simp at hx
rfl