Module docstring
{"# Translating pairwise relations on sets to lists
On a list with no duplicates, the condition of Set.Pairwise and List.Pairwise are equivalent.
"}
{"# Translating pairwise relations on sets to lists
On a list with no duplicates, the condition of Set.Pairwise and List.Pairwise are equivalent.
"}
List.Nodup.pairwise_of_set_pairwise
theorem
{l : List α} {r : α → α → Prop} (hl : l.Nodup) (h : {x | x ∈ l}.Pairwise r) : l.Pairwise r
theorem Nodup.pairwise_of_set_pairwise {l : List α} {r : α → α → Prop} (hl : l.Nodup)
(h : {x | x ∈ l}.Pairwise r) : l.Pairwise r :=
hl.pairwise_of_forall_ne h
List.Nodup.pairwise_coe
theorem
[IsSymm α r] (hl : l.Nodup) : {a | a ∈ l}.Pairwise r ↔ l.Pairwise r
@[simp]
theorem Nodup.pairwise_coe [IsSymm α r] (hl : l.Nodup) :
{ a | a ∈ l }{ a | a ∈ l }.Pairwise r ↔ l.Pairwise r := by
induction l with | nil => simp | cons a l ih => ?_
rw [List.nodup_cons] at hl
have : ∀ b ∈ l, ¬a = b → r a b ↔ r a b := fun b hb =>
imp_iff_right (ne_of_mem_of_not_mem hb hl.1).symm
simp [Set.setOf_or, Set.pairwise_insert_of_symmetric fun _ _ ↦ symm_of r, ih hl.2, and_comm,
forall₂_congr this]