English
There is a structured decomposition List.sym showing how to build symmetric elements
Русский
Существует структурированное разложение List.sym, показывающее как строятся симметрические элементы
LaTeX
$$$$ \\text{List.sym is defined recursively by }\\text{...} $$$$
Lean4
/-- `xs.sym n` is all unordered `n`-tuples from the list `xs` in some order. -/
protected def sym : (n : ℕ) → List α → List (Sym α n)
| 0, _ => [.nil]
| _, [] => []
| n + 1, x :: xs => ((x :: xs).sym n |>.map fun p => x ::ₛ p) ++ xs.sym (n + 1)