/-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau
-/
module
public import Mathlib.Data.Set.Pairwise.Basic
import Mathlib.Data.List.Nodup
set_option doc.verso true
set_option doc.verso.suggestions false
/-!
# Translating pairwise relations on sets to lists
On a list with no duplicates, the condition of `Set.Pairwise` and `List.Pairwise` are equivalent.
-/
public section
variable {α : Type*} {r : α → α → Prop}
namespace List
variable {l : List α}
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
@[simp]
theorem Nodup.pairwise_coe [Std.Symm r] (hl : l.Nodup) :
{ 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.ofPred_or, Set.pairwise_insert_of_symm, ih hl.2, and_comm, forall₂_congr this]
end List
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland