English
The diagonal of a finite set s is the set of pairs (a,a) with a ∈ s.
Русский
Диагональ множества s — множество пар (a,a) с a ∈ s.
LaTeX
$$def diag := (s \\timesˢ s).filter (fun a : α × α => a.fst = a.snd)$$
Lean4
/-- Given a finite set `s`, the diagonal, `s.diag` is the set of pairs of the form `(a, a)` for
`a ∈ s`. -/
def diag :=
(s ×ˢ s).filter fun a : α × α => a.fst = a.snd