This repository was archived by the owner on Jul 24, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ namespace list
28
28
@[simp] theorem nodup_cons {a : α} {l : list α} : nodup (a::l) ↔ a ∉ l ∧ nodup l :=
29
29
by simp only [nodup, pairwise_cons, forall_mem_ne]
30
30
31
+ protected lemma pairwise.nodup {l : list α} {r : α → α → Prop } [is_irrefl α r] (h : pairwise r l) :
32
+ nodup l :=
33
+ h.imp $ λ a b, ne_of_irrefl
34
+
31
35
lemma rel_nodup {r : α → β → Prop } (hr : relator.bi_unique r) : (forall₂ r ⇒ (↔)) nodup nodup
32
36
| _ _ forall₂.nil := by simp only [nodup_nil]
33
37
| _ _ (forall₂.cons hab h) :=
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ rel_of_pairwise_cons
49
49
sorted r (a :: l) ↔ (∀ b ∈ l, r a b) ∧ sorted r l :=
50
50
pairwise_cons
51
51
52
+ protected theorem sorted.nodup {r : α → α → Prop } [is_irrefl α r] {l : list α} (h : sorted r l) :
53
+ nodup l :=
54
+ h.nodup
55
+
52
56
theorem eq_of_perm_of_sorted [is_antisymm α r]
53
57
{l₁ l₂ : list α} (p : l₁ ~ l₂) (s₁ : sorted r l₁) (s₂ : sorted r l₂) : l₁ = l₂ :=
54
58
begin
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ instance [linear_order α] : is_trichotomous α (>) := is_trichotomous.swap _
83
83
instance order_dual.is_total_le [has_le α] [is_total α (≤)] : is_total (order_dual α) (≤) :=
84
84
@is_total.swap α _ _
85
85
86
+ lemma ne_of_irrefl {r} [is_irrefl α r] : ∀ {x y : α}, r x y → x ≠ y
87
+ | _ _ h rfl := irrefl _ h
88
+
86
89
lemma trans_trichotomous_left [is_trans α r] [is_trichotomous α r] {a b c : α} :
87
90
¬r b a → r b c → r a c :=
88
91
begin
You can’t perform that action at this time.
0 commit comments