Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit cab5a45

Browse files
committed
refactor(order/directed): use (≥) instead of swap (≤) (#14474)
1 parent b5973ba commit cab5a45

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/analysis/convex/quasiconvex.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ lemma quasiconvex_on.convex [is_directed β (≤)] (hf : quasiconvex_on 𝕜 s f
7878
λ x y hx hy a b ha hb hab,
7979
let ⟨z, hxz, hyz⟩ := exists_ge_ge (f x) (f y) in (hf _ ⟨hx, hxz⟩ ⟨hy, hyz⟩ ha hb hab).1
8080

81-
lemma quasiconcave_on.convex [is_directed β (swap (≤))] (hf : quasiconcave_on 𝕜 s f) : convex 𝕜 s :=
81+
lemma quasiconcave_on.convex [is_directed β ()] (hf : quasiconcave_on 𝕜 s f) : convex 𝕜 s :=
8282
hf.dual.convex
8383

8484
end ordered_add_comm_monoid

src/category_theory/filtered.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,14 @@ instance is_cofiltered_of_semilattice_inf_nonempty
481481

482482
@[priority 100]
483483
instance is_cofiltered_or_empty_of_directed_ge (α : Type u) [preorder α]
484-
[is_directed α (swap (≤))] :
484+
[is_directed α ()] :
485485
is_cofiltered_or_empty α :=
486486
{ cocone_objs := λ X Y, let ⟨Z, hX, hY⟩ := exists_le_le X Y in
487487
⟨Z, hom_of_le hX, hom_of_le hY, trivial⟩,
488488
cocone_maps := λ X Y f g, ⟨X, 𝟙 _, by simp⟩ }
489489

490490
@[priority 100]
491-
instance is_cofiltered_of_directed_ge_nonempty (α : Type u) [preorder α] [is_directed α (swap (≤))]
491+
instance is_cofiltered_of_directed_ge_nonempty (α : Type u) [preorder α] [is_directed α ()]
492492
[nonempty α] :
493493
is_cofiltered α := {}
494494

src/order/directed.lean

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,38 +119,38 @@ lemma is_directed_mono [is_directed α r] (h : ∀ ⦃a b⦄, r a b → s a b) :
119119
lemma exists_ge_ge [has_le α] [is_directed α (≤)] (a b : α) : ∃ c, a ≤ c ∧ b ≤ c :=
120120
directed_of (≤) a b
121121

122-
lemma exists_le_le [has_le α] [is_directed α (swap (≤))] (a b : α) : ∃ c, c ≤ a ∧ c ≤ b :=
123-
directed_of (swap (≤)) a b
122+
lemma exists_le_le [has_le α] [is_directed α ()] (a b : α) : ∃ c, c ≤ a ∧ c ≤ b :=
123+
directed_of () a b
124124

125-
instance order_dual.is_directed_ge [has_le α] [is_directed α (≤)] : is_directed αᵒᵈ (swap (≤)) :=
125+
instance order_dual.is_directed_ge [has_le α] [is_directed α (≤)] : is_directed αᵒᵈ () :=
126126
by assumption
127127

128-
instance order_dual.is_directed_le [has_le α] [is_directed α (swap (≤))] : is_directed αᵒᵈ (≤) :=
128+
instance order_dual.is_directed_le [has_le α] [is_directed α ()] : is_directed αᵒᵈ (≤) :=
129129
by assumption
130130

131131
section preorder
132132
variables [preorder α] {a : α}
133133

134-
protected lemma is_min.is_bot [is_directed α (swap (≤))] (h : is_min a) : is_bot a :=
134+
protected lemma is_min.is_bot [is_directed α ()] (h : is_min a) : is_bot a :=
135135
λ b, let ⟨c, hca, hcb⟩ := exists_le_le a b in (h hca).trans hcb
136136

137137
protected lemma is_max.is_top [is_directed α (≤)] (h : is_max a) : is_top a :=
138-
λ b, let ⟨c, hac, hbc⟩ := exists_ge_ge a b in hbc.trans $ h hac
138+
h.to_dual.is_bot
139139

140140
lemma is_top_or_exists_gt [is_directed α (≤)] (a : α) : is_top a ∨ (∃ b, a < b) :=
141141
(em (is_max a)).imp is_max.is_top not_is_max_iff.mp
142142

143-
lemma is_bot_or_exists_lt [is_directed α (swap (≤))] (a : α) : is_bot a ∨ (∃ b, b < a) :=
143+
lemma is_bot_or_exists_lt [is_directed α ()] (a : α) : is_bot a ∨ (∃ b, b < a) :=
144144
@is_top_or_exists_gt αᵒᵈ _ _ a
145145

146-
lemma is_bot_iff_is_min [is_directed α (swap (≤))] : is_bot a ↔ is_min a :=
146+
lemma is_bot_iff_is_min [is_directed α ()] : is_bot a ↔ is_min a :=
147147
⟨is_bot.is_min, is_min.is_bot⟩
148148

149149
lemma is_top_iff_is_max [is_directed α (≤)] : is_top a ↔ is_max a := ⟨is_top.is_max, is_max.is_top⟩
150150

151151
variables (β) [partial_order β]
152152

153-
theorem exists_lt_of_directed_ge [is_directed β (swap (≤))] [nontrivial β] : ∃ a b : β, a < b :=
153+
theorem exists_lt_of_directed_ge [is_directed β ()] [nontrivial β] : ∃ a b : β, a < b :=
154154
begin
155155
rcases exists_pair_ne β with ⟨a, b, hne⟩,
156156
rcases is_bot_or_exists_lt a with ha|⟨c, hc⟩,
@@ -167,13 +167,13 @@ instance semilattice_sup.to_is_directed_le [semilattice_sup α] : is_directed α
167167
⟨λ a b, ⟨a ⊔ b, le_sup_left, le_sup_right⟩⟩
168168

169169
@[priority 100] -- see Note [lower instance priority]
170-
instance semilattice_inf.to_is_directed_ge [semilattice_inf α] : is_directed α (swap (≤)) :=
170+
instance semilattice_inf.to_is_directed_ge [semilattice_inf α] : is_directed α () :=
171171
⟨λ a b, ⟨a ⊓ b, inf_le_left, inf_le_right⟩⟩
172172

173173
@[priority 100] -- see Note [lower instance priority]
174174
instance order_top.to_is_directed_le [has_le α] [order_top α] : is_directed α (≤) :=
175175
⟨λ a b, ⟨⊤, le_top, le_top⟩⟩
176176

177177
@[priority 100] -- see Note [lower instance priority]
178-
instance order_bot.to_is_directed_ge [has_le α] [order_bot α] : is_directed α (swap (≤)) :=
178+
instance order_bot.to_is_directed_ge [has_le α] [order_bot α] : is_directed α () :=
179179
⟨λ a b, ⟨⊥, bot_le, bot_le⟩⟩

src/order/ideal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ and nonempty. -/
124124
@[mk_iff] class is_maximal (I : ideal P) extends is_proper I : Prop :=
125125
(maximal_proper : ∀ ⦃J : ideal P⦄, I < J → (J : set P) = univ)
126126

127-
lemma inter_nonempty [is_directed P (swap (≤))] (I J : ideal P) : (I ∩ J : set P).nonempty :=
127+
lemma inter_nonempty [is_directed P ()] (I J : ideal P) : (I ∩ J : set P).nonempty :=
128128
begin
129129
obtain ⟨a, ha⟩ := I.nonempty,
130130
obtain ⟨b, hb⟩ := J.nonempty,
131-
obtain ⟨c, hac, hbc⟩ := directed_of (swap (≤)) a b,
131+
obtain ⟨c, hac, hbc⟩ := exists_le_le a b,
132132
exact ⟨c, I.lower hac ha, J.lower hbc hb⟩,
133133
end
134134

@@ -237,7 +237,7 @@ let ⟨z, hz, hx, hy⟩ := s.directed x hx y hy in s.lower (sup_le hx hy) hz
237237
end semilattice_sup
238238

239239
section semilattice_sup_directed
240-
variables [semilattice_sup P] [is_directed P (swap (≤))] {x : P} {I J K s t : ideal P}
240+
variables [semilattice_sup P] [is_directed P ()] {x : P} {I J K s t : ideal P}
241241

242242
/-- The infimum of two ideals of a co-directed order is their intersection. -/
243243
instance : has_inf (ideal P) :=

0 commit comments

Comments
 (0)