English
If l is Pairwise R, then the set {x | x ∈ l} is Pairwise R provided R is symmetric.
Русский
Если список l является Pairwise R, то множество {x | x ∈ l} является Pairwise R при условии симметричности R.
LaTeX
$$$\\text{Pairwise}(R, l) \\Rightarrow \\text{Symmetric}(R) \\Rightarrow \\{x \\mid x \\in l\\}.\\text{Pairwise}(R).$$$
Lean4
theorem of_reverse_eq {l : List α} : reverse l = l → Palindrome l :=
by
refine bidirectionalRecOn l (fun _ => Palindrome.nil) (fun a _ => Palindrome.singleton a) ?_
intro x l y hp hr
rw [reverse_cons, reverse_append] at hr
rw [head_eq_of_cons_eq hr]
have : Palindrome l := hp (append_inj_left' (tail_eq_of_cons_eq hr) rfl)
exact Palindrome.cons_concat x this