order.directedMathlib.Order.Directed

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

chore(order/liminf_limsup): Generalise and move lemmas (#18628)

Generalise lemmas from semilattices to codirected orders. Move topology-less lemmas from topology.algebra.order.liminf_limsup to order.liminf_limsup. Also turn arguments to bdd_above_insert and friends implicit.

Diff
@@ -6,7 +6,6 @@ Authors: Johannes Hölzl
 import data.set.image
 import order.lattice
 import order.max
-import order.bounds.basic
 
 /-!
 # Directed indexed families and sets
@@ -259,42 +258,3 @@ instance order_top.to_is_directed_le [has_le α] [order_top α] : is_directed α
 @[priority 100]  -- see Note [lower instance priority]
 instance order_bot.to_is_directed_ge [has_le α] [order_bot α] : is_directed α (≥) :=
 ⟨λ a b, ⟨⊥, bot_le, bot_le⟩⟩
-
-section scott_continuous
-
-variables [preorder α] {a : α}
-
-/--
-A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
-sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
-Scott topology.
-
-The dual notion
-
-```lean
-∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
-```
-
-does not appear to play a significant role in the literature, so is omitted here.
--/
-def scott_continuous [preorder β] (f : α → β) : Prop :=
-∀ ⦃d : set α⦄, d.nonempty → directed_on (≤) d → ∀ ⦃a⦄, is_lub d a → is_lub (f '' d) (f a)
-
-protected lemma scott_continuous.monotone [preorder β] {f : α → β}
-  (h : scott_continuous f) :
-  monotone f :=
-begin
-  intros a b hab,
-  have e1 : is_lub (f '' {a, b}) (f b),
-  { apply h,
-    { exact set.insert_nonempty _ _ },
-    { exact directed_on_pair le_refl hab },
-    { rw [is_lub, upper_bounds_insert, upper_bounds_singleton,
-        set.inter_eq_self_of_subset_right (set.Ici_subset_Ici.mpr hab)],
-      exact is_least_Ici } },
-  apply e1.1,
-  rw set.image_pair,
-  exact set.mem_insert _ _,
-end
-
-end scott_continuous

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(topology/algebra/order/compact): remove conditional completeness assumption in is_compact.exists_forall_le (#18991)
Diff
@@ -131,6 +131,10 @@ lemma directed_on_of_inf_mem [semilattice_inf α] {S : set α}
   (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : directed_on (≥) S :=
 λ a ha b hb, ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
 
+lemma is_total.directed [is_total α r] (f : ι → α) :
+  directed r f :=
+λ i j, or.cases_on (total_of r (f i) (f j)) (λ h, ⟨j, h, refl _⟩) (λ h, ⟨i, refl _, h⟩)
+
 /-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that
 `r a c` and `r b c`. -/
 class is_directed (α : Type*) (r : α → α → Prop) : Prop :=
@@ -150,7 +154,7 @@ lemma directed_on_univ_iff : directed_on r set.univ ↔ is_directed α r :=
 
 @[priority 100]  -- see Note [lower instance priority]
 instance is_total.to_is_directed [is_total α r] : is_directed α r :=
-⟨λ a b, or.cases_on (total_of r a b) (λ h, ⟨b, h, refl _⟩) (λ h, ⟨a, refl _, h⟩)⟩
+by rw ← directed_id_iff; exact is_total.directed _
 
 lemma is_directed_mono [is_directed α r] (h : ∀ ⦃a b⦄, r a b → s a b) : is_directed α s :=
 ⟨λ a b, let ⟨c, ha, hb⟩ := is_directed.directed a b in ⟨c, h ha, h hb⟩⟩

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(order/compactly_generated): For any b, there exists a set of independent atoms s such that Sup s is the complement of b. (#8475)

This new lemma is carved out of the proof that atomistic lattices are complemented.

Also provide directed versions of the interaction between suprema and disjointness.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -52,7 +52,7 @@ by simp [directed, directed_on]; refine ball_congr (λ x hx, by simp; refl)
 
 alias directed_on_iff_directed ↔ directed_on.directed_coe _
 
-theorem directed_on_range {f : β → α} :
+theorem directed_on_range {f : ι → α} :
   directed r f ↔ directed_on r (set.range f) :=
 by simp_rw [directed, directed_on, set.forall_range_iff, set.exists_range_iff]
 

(no changes)

(no changes)

(no changes)

(no changes)

feat(order/directed): Scott continuous functions (#18517)

We prove an insert result for directed sets when the relation is reflexive. This is then used to show that a Scott continuous function is monotone.

This result is required in the construction of the Scott topology on a preorder (see also #18448).

Holding PR for mathlib4: leanprover-community/mathlib4#2543

Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -6,6 +6,7 @@ Authors: Johannes Hölzl
 import data.set.image
 import order.lattice
 import order.max
+import order.bounds.basic
 
 /-!
 # Directed indexed families and sets
@@ -22,6 +23,11 @@ directed iff each pair of elements has a shared upper bound.
 * `directed_on r s`: Predicate stating that the set `s` is `r`-directed.
 * `is_directed α r`: Prop-valued mixin stating that `α` is `r`-directed. Follows the style of the
   unbundled relation classes such as `is_total`.
+* `scott_continuous`: Predicate stating that a function between preorders preserves
+  `is_lub` on directed sets.
+
+## References
+* [Gierz et al, *A Compendium of Continuous Lattices*][GierzEtAl1980]
 -/
 
 open function
@@ -161,6 +167,37 @@ by assumption
 instance order_dual.is_directed_le [has_le α] [is_directed α (≥)] : is_directed αᵒᵈ (≤) :=
 by assumption
 
+section reflexive
+
+lemma directed_on.insert (h : reflexive r) (a : α) {s : set α} (hd : directed_on r s)
+  (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : directed_on r (insert a s) :=
+begin
+  rintros x (rfl | hx) y (rfl | hy),
+  { exact ⟨y, set.mem_insert _ _, h _, h _⟩ },
+  { obtain ⟨w, hws, hwr⟩ := ha y hy,
+    exact ⟨w, set.mem_insert_of_mem _ hws, hwr⟩ },
+  { obtain ⟨w, hws, hwr⟩ := ha x hx,
+    exact ⟨w, set.mem_insert_of_mem _ hws, hwr.symm⟩ },
+  { obtain ⟨w, hws, hwr⟩ := hd x hx y hy,
+    exact ⟨w, set.mem_insert_of_mem _ hws, hwr⟩ },
+end
+
+lemma directed_on_singleton (h : reflexive r) (a : α) : directed_on r ({a} : set α) :=
+λ x hx y hy, ⟨x, hx, h _, hx.symm ▸ hy.symm ▸ h _⟩
+
+lemma directed_on_pair (h : reflexive r) {a b : α} (hab : a ≼ b) :
+  directed_on r ({a, b} : set α) :=
+(directed_on_singleton h _).insert h _ $ λ c hc, ⟨c, hc, hc.symm ▸ hab, h _⟩
+
+lemma directed_on_pair' (h : reflexive r) {a b : α} (hab : a ≼ b) :
+  directed_on r ({b, a} : set α) :=
+begin
+  rw set.pair_comm,
+  apply directed_on_pair h hab,
+end
+
+end reflexive
+
 section preorder
 variables [preorder α] {a : α}
 
@@ -218,3 +255,42 @@ instance order_top.to_is_directed_le [has_le α] [order_top α] : is_directed α
 @[priority 100]  -- see Note [lower instance priority]
 instance order_bot.to_is_directed_ge [has_le α] [order_bot α] : is_directed α (≥) :=
 ⟨λ a b, ⟨⊥, bot_le, bot_le⟩⟩
+
+section scott_continuous
+
+variables [preorder α] {a : α}
+
+/--
+A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
+sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
+Scott topology.
+
+The dual notion
+
+```lean
+∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
+```
+
+does not appear to play a significant role in the literature, so is omitted here.
+-/
+def scott_continuous [preorder β] (f : α → β) : Prop :=
+∀ ⦃d : set α⦄, d.nonempty → directed_on (≤) d → ∀ ⦃a⦄, is_lub d a → is_lub (f '' d) (f a)
+
+protected lemma scott_continuous.monotone [preorder β] {f : α → β}
+  (h : scott_continuous f) :
+  monotone f :=
+begin
+  intros a b hab,
+  have e1 : is_lub (f '' {a, b}) (f b),
+  { apply h,
+    { exact set.insert_nonempty _ _ },
+    { exact directed_on_pair le_refl hab },
+    { rw [is_lub, upper_bounds_insert, upper_bounds_singleton,
+        set.inter_eq_self_of_subset_right (set.Ici_subset_Ici.mpr hab)],
+      exact is_least_Ici } },
+  apply e1.1,
+  rw set.image_pair,
+  exact set.mem_insert _ _,
+end
+
+end scott_continuous

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(category_theory/mittag_leffler): Introduce the Mittag-Leffler condition (#17905)

Co-authored-by: Rémi Bottinelli <bottine@users.noreply.github.com> Co-authored-by: Junyan Xu <junyanxumath@gmail.com>

Diff
@@ -46,6 +46,10 @@ by simp [directed, directed_on]; refine ball_congr (λ x hx, by simp; refl)
 
 alias directed_on_iff_directed ↔ directed_on.directed_coe _
 
+theorem directed_on_range {f : β → α} :
+  directed r f ↔ directed_on r (set.range f) :=
+by simp_rw [directed, directed_on, set.forall_range_iff, set.exists_range_iff]
+
 theorem directed_on_image {s} {f : β → α} :
   directed_on r (f '' s) ↔ directed_on (f ⁻¹'o r) s :=
 by simp only [directed_on, set.ball_image_iff, set.bex_image_iff, order.preimage]
@@ -166,6 +170,14 @@ protected lemma is_min.is_bot [is_directed α (≥)] (h : is_min a) : is_bot a :
 protected lemma is_max.is_top [is_directed α (≤)] (h : is_max a) : is_top a :=
 h.to_dual.is_bot
 
+lemma directed_on.is_bot_of_is_min {s : set α} (hd : directed_on (≥) s)
+  {m} (hm : m ∈ s) (hmin : ∀ a ∈ s, a ≤ m → m ≤ a) : ∀ a ∈ s, m ≤ a :=
+λ a as, let ⟨x, xs, xm, xa⟩ := hd m hm a as in (hmin x xs xm).trans xa
+
+lemma directed_on.is_top_of_is_max {s : set α} (hd : directed_on (≤) s)
+  {m} (hm : m ∈ s) (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m :=
+@directed_on.is_bot_of_is_min αᵒᵈ _ s hd m hm hmax
+
 lemma is_top_or_exists_gt [is_directed α (≤)] (a : α) : is_top a ∨ (∃ b, a < b) :=
 (em (is_max a)).imp is_max.is_top not_is_max_iff.mp
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -60,7 +60,7 @@ variable {r r'}
 
 #print directedOn_iff_directed /-
 theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (coe : s → α) := by
-  simp [Directed, DirectedOn] <;> refine' ball_congr fun x hx => by simp <;> rfl
+  simp [Directed, DirectedOn] <;> refine' forall₂_congr fun x hx => by simp <;> rfl
 #align directed_on_iff_directed directedOn_iff_directed
 -/
 
Diff
@@ -69,13 +69,13 @@ alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
 
 #print directedOn_range /-
 theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
-  simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
+  simp_rw [Directed, DirectedOn, Set.forall_mem_range, Set.exists_range_iff]
 #align directed_on_range directedOn_range
 -/
 
 #print directedOn_image /-
 theorem directedOn_image {s} {f : β → α} : DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
-  simp only [DirectedOn, Set.ball_image_iff, Set.bex_image_iff, Order.Preimage]
+  simp only [DirectedOn, Set.forall_mem_image, Set.exists_mem_image, Order.Preimage]
 #align directed_on_image directedOn_image
 -/
 
Diff
@@ -115,25 +115,25 @@ theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : 
 #align directed.mono_comp Directed.mono_comp
 -/
 
-#print directed_of_sup /-
+#print directed_of_isDirected_le /-
 /-- A monotone function on a sup-semilattice is directed. -/
-theorem directed_of_sup [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
+theorem directed_of_isDirected_le [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
     (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f := fun a b =>
   ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
-#align directed_of_sup directed_of_sup
+#align directed_of_sup directed_of_isDirected_le
 -/
 
 #print Monotone.directed_le /-
 theorem Monotone.directed_le [SemilatticeSup α] [Preorder β] {f : α → β} :
     Monotone f → Directed (· ≤ ·) f :=
-  directed_of_sup
+  directed_of_isDirected_le
 #align monotone.directed_le Monotone.directed_le
 -/
 
 #print Antitone.directed_ge /-
 theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≥ ·) f :=
-  directed_of_sup hf
+  directed_of_isDirected_le hf
 #align antitone.directed_ge Antitone.directed_ge
 -/
 
@@ -161,25 +161,25 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
 #align directed.extend_bot Directed.extend_bot
 -/
 
-#print directed_of_inf /-
+#print directed_of_isDirected_ge /-
 /-- An antitone function on an inf-semilattice is directed. -/
-theorem directed_of_inf [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
+theorem directed_of_isDirected_ge [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
     (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f := fun x y =>
   ⟨x ⊓ y, hf _ _ inf_le_left, hf _ _ inf_le_right⟩
-#align directed_of_inf directed_of_inf
+#align directed_of_inf directed_of_isDirected_ge
 -/
 
 #print Monotone.directed_ge /-
 theorem Monotone.directed_ge [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Monotone f) :
     Directed (· ≥ ·) f :=
-  directed_of_inf hf
+  directed_of_isDirected_ge hf
 #align monotone.directed_ge Monotone.directed_ge
 -/
 
 #print Antitone.directed_le /-
 theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≤ ·) f :=
-  directed_of_inf hf
+  directed_of_isDirected_ge hf
 #align antitone.directed_le Antitone.directed_le
 -/
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 -/
-import Mathbin.Data.Set.Image
-import Mathbin.Order.Lattice
-import Mathbin.Order.Max
+import Data.Set.Image
+import Order.Lattice
+import Order.Max
 
 #align_import order.directed from "leanprover-community/mathlib"@"ffde2d8a6e689149e44fd95fa862c23a57f8c780"
 
Diff
@@ -6,9 +6,8 @@ Authors: Johannes Hölzl
 import Mathbin.Data.Set.Image
 import Mathbin.Order.Lattice
 import Mathbin.Order.Max
-import Mathbin.Order.Bounds.Basic
 
-#align_import order.directed from "leanprover-community/mathlib"@"3efd324a3a31eaa40c9d5bfc669c4fafee5f9423"
+#align_import order.directed from "leanprover-community/mathlib"@"ffde2d8a6e689149e44fd95fa862c23a57f8c780"
 
 /-!
 # Directed indexed families and sets
@@ -424,44 +423,3 @@ instance (priority := 100) OrderBot.to_isDirected_ge [LE α] [OrderBot α] : IsD
 #align order_bot.to_is_directed_ge OrderBot.to_isDirected_ge
 -/
 
-section ScottContinuous
-
-variable [Preorder α] {a : α}
-
-#print ScottContinuous /-
-/-- A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
-sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
-Scott topology.
-
-The dual notion
-
-```lean
-∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
-```
-
-does not appear to play a significant role in the literature, so is omitted here.
--/
-def ScottContinuous [Preorder β] (f : α → β) : Prop :=
-  ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a⦄, IsLUB d a → IsLUB (f '' d) (f a)
-#align scott_continuous ScottContinuous
--/
-
-#print ScottContinuous.monotone /-
-protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : ScottContinuous f) :
-    Monotone f := by
-  intro a b hab
-  have e1 : IsLUB (f '' {a, b}) (f b) := by
-    apply h
-    · exact Set.insert_nonempty _ _
-    · exact directedOn_pair le_refl hab
-    · rw [IsLUB, upperBounds_insert, upperBounds_singleton,
-        Set.inter_eq_self_of_subset_right (set.Ici_subset_Ici.mpr hab)]
-      exact isLeast_Ici
-  apply e1.1
-  rw [Set.image_pair]
-  exact Set.mem_insert _ _
-#align scott_continuous.monotone ScottContinuous.monotone
--/
-
-end ScottContinuous
-
Diff
@@ -65,7 +65,7 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (coe : s
 #align directed_on_iff_directed directedOn_iff_directed
 -/
 
-alias directedOn_iff_directed ↔ DirectedOn.directed_val _
+alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
 #align directed_on.directed_coe DirectedOn.directed_val
 
 #print directedOn_range /-
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 3efd324a3a31eaa40c9d5bfc669c4fafee5f9423
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Set.Image
 import Mathbin.Order.Lattice
 import Mathbin.Order.Max
 import Mathbin.Order.Bounds.Basic
 
+#align_import order.directed from "leanprover-community/mathlib"@"3efd324a3a31eaa40c9d5bfc669c4fafee5f9423"
+
 /-!
 # Directed indexed families and sets
 
Diff
@@ -195,9 +195,11 @@ theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
 #align directed_on_of_inf_mem directedOn_of_inf_mem
 -/
 
+#print IsTotal.directed /-
 theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f := fun i j =>
   Or.cases_on (total_of r (f i) (f j)) (fun h => ⟨j, h, refl _⟩) fun h => ⟨i, refl _, h⟩
 #align is_total.directed IsTotal.directed
+-/
 
 #print IsDirected /-
 /-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit e8cf0cfec5fcab9baf46dc17d30c5e22048468be
+! leanprover-community/mathlib commit 3efd324a3a31eaa40c9d5bfc669c4fafee5f9423
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -195,6 +195,10 @@ theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
 #align directed_on_of_inf_mem directedOn_of_inf_mem
 -/
 
+theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f := fun i j =>
+  Or.cases_on (total_of r (f i) (f j)) (fun h => ⟨j, h, refl _⟩) fun h => ⟨i, refl _, h⟩
+#align is_total.directed IsTotal.directed
+
 #print IsDirected /-
 /-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that
 `r a c` and `r b c`. -/
@@ -239,8 +243,8 @@ theorem directedOn_univ_iff : DirectedOn r Set.univ ↔ IsDirected α r :=
 
 #print IsTotal.to_isDirected /-
 -- see Note [lower instance priority]
-instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r :=
-  ⟨fun a b => Or.cases_on (total_of r a b) (fun h => ⟨b, h, refl _⟩) fun h => ⟨a, refl _, h⟩⟩
+instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r := by
+  rw [← directed_id_iff] <;> exact IsTotal.directed _
 #align is_total.to_is_directed IsTotal.to_isDirected
 -/
 
Diff
@@ -42,7 +42,6 @@ universe u v w
 
 variable {α : Type u} {β : Type v} {ι : Sort w} (r r' s : α → α → Prop)
 
--- mathport name: «expr ≼ »
 local infixl:50 " ≼ " => r
 
 #print Directed /-
@@ -99,20 +98,26 @@ theorem DirectedOn.mono {s : Set α} (h : DirectedOn r s) (H : ∀ {a b}, r a b
 #align directed_on.mono DirectedOn.mono
 -/
 
+#print directed_comp /-
 theorem directed_comp {ι} {f : ι → β} {g : β → α} : Directed r (g ∘ f) ↔ Directed (g ⁻¹'o r) f :=
   Iff.rfl
 #align directed_comp directed_comp
+-/
 
+#print Directed.mono /-
 theorem Directed.mono {s : α → α → Prop} {ι} {f : ι → α} (H : ∀ a b, r a b → s a b)
     (h : Directed r f) : Directed s f := fun a b =>
   let ⟨c, h₁, h₂⟩ := h a b
   ⟨c, H _ _ h₁, H _ _ h₂⟩
 #align directed.mono Directed.mono
+-/
 
+#print Directed.mono_comp /-
 theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
     (hg : ∀ ⦃x y⦄, x ≼ y → rb (g x) (g y)) (hf : Directed r f) : Directed rb (g ∘ f) :=
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
+-/
 
 #print directed_of_sup /-
 /-- A monotone function on a sup-semilattice is directed. -/
@@ -136,12 +141,15 @@ theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (
 #align antitone.directed_ge Antitone.directed_ge
 -/
 
+#print directedOn_of_sup_mem /-
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊔ j ∈ S) : DirectedOn (· ≤ ·) S := fun a ha b hb =>
   ⟨a ⊔ b, H ha hb, le_sup_left, le_sup_right⟩
 #align directed_on_of_sup_mem directedOn_of_sup_mem
+-/
 
+#print Directed.extend_bot /-
 theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι → α}
     (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
     Directed (· ≤ ·) (Function.extend e f ⊥) :=
@@ -155,6 +163,7 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   use e k
   simp only [he.extend_apply, *, true_and_iff]
 #align directed.extend_bot Directed.extend_bot
+-/
 
 #print directed_of_inf /-
 /-- An antitone function on an inf-semilattice is directed. -/
@@ -178,11 +187,13 @@ theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (
 #align antitone.directed_le Antitone.directed_le
 -/
 
+#print directedOn_of_inf_mem /-
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S := fun a ha b hb =>
   ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
 #align directed_on_of_inf_mem directedOn_of_inf_mem
+-/
 
 #print IsDirected /-
 /-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that
@@ -267,6 +278,7 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
 
 section Reflexive
 
+#print DirectedOn.insert /-
 theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
     (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) :=
   by
@@ -279,6 +291,7 @@ theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : Directed
   · obtain ⟨w, hws, hwr⟩ := hd x hx y hy
     exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
 #align directed_on.insert DirectedOn.insert
+-/
 
 #print directedOn_singleton /-
 theorem directedOn_singleton (h : Reflexive r) (a : α) : DirectedOn r ({a} : Set α) :=
Diff
@@ -365,7 +365,7 @@ theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : 
   by
   rcases exists_pair_ne β with ⟨a, b, hne⟩
   rcases isBot_or_exists_lt a with (ha | ⟨c, hc⟩)
-  exacts[⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
+  exacts [⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
 #align exists_lt_of_directed_ge exists_lt_of_directed_ge
 -/
 
Diff
@@ -114,21 +114,27 @@ theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : 
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
 
+#print directed_of_sup /-
 /-- A monotone function on a sup-semilattice is directed. -/
 theorem directed_of_sup [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
     (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f := fun a b =>
   ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
 #align directed_of_sup directed_of_sup
+-/
 
+#print Monotone.directed_le /-
 theorem Monotone.directed_le [SemilatticeSup α] [Preorder β] {f : α → β} :
     Monotone f → Directed (· ≤ ·) f :=
   directed_of_sup
 #align monotone.directed_le Monotone.directed_le
+-/
 
+#print Antitone.directed_ge /-
 theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≥ ·) f :=
   directed_of_sup hf
 #align antitone.directed_ge Antitone.directed_ge
+-/
 
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
@@ -150,21 +156,27 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   simp only [he.extend_apply, *, true_and_iff]
 #align directed.extend_bot Directed.extend_bot
 
+#print directed_of_inf /-
 /-- An antitone function on an inf-semilattice is directed. -/
 theorem directed_of_inf [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
     (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f := fun x y =>
   ⟨x ⊓ y, hf _ _ inf_le_left, hf _ _ inf_le_right⟩
 #align directed_of_inf directed_of_inf
+-/
 
+#print Monotone.directed_ge /-
 theorem Monotone.directed_ge [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Monotone f) :
     Directed (· ≥ ·) f :=
   directed_of_inf hf
 #align monotone.directed_ge Monotone.directed_ge
+-/
 
+#print Antitone.directed_le /-
 theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≤ ·) f :=
   directed_of_inf hf
 #align antitone.directed_le Antitone.directed_le
+-/
 
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
@@ -294,69 +306,93 @@ section Preorder
 
 variable [Preorder α] {a : α}
 
+#print IsMin.isBot /-
 protected theorem IsMin.isBot [IsDirected α (· ≥ ·)] (h : IsMin a) : IsBot a := fun b =>
   let ⟨c, hca, hcb⟩ := exists_le_le a b
   (h hca).trans hcb
 #align is_min.is_bot IsMin.isBot
+-/
 
+#print IsMax.isTop /-
 protected theorem IsMax.isTop [IsDirected α (· ≤ ·)] (h : IsMax a) : IsTop a :=
   h.toDual.IsBot
 #align is_max.is_top IsMax.isTop
+-/
 
+#print DirectedOn.is_bot_of_is_min /-
 theorem DirectedOn.is_bot_of_is_min {s : Set α} (hd : DirectedOn (· ≥ ·) s) {m} (hm : m ∈ s)
     (hmin : ∀ a ∈ s, a ≤ m → m ≤ a) : ∀ a ∈ s, m ≤ a := fun a as =>
   let ⟨x, xs, xm, xa⟩ := hd m hm a as
   (hmin x xs xm).trans xa
 #align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_min
+-/
 
+#print DirectedOn.is_top_of_is_max /-
 theorem DirectedOn.is_top_of_is_max {s : Set α} (hd : DirectedOn (· ≤ ·) s) {m} (hm : m ∈ s)
     (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m :=
   @DirectedOn.is_bot_of_is_min αᵒᵈ _ s hd m hm hmax
 #align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_max
+-/
 
+#print isTop_or_exists_gt /-
 theorem isTop_or_exists_gt [IsDirected α (· ≤ ·)] (a : α) : IsTop a ∨ ∃ b, a < b :=
   (em (IsMax a)).imp IsMax.isTop not_isMax_iff.mp
 #align is_top_or_exists_gt isTop_or_exists_gt
+-/
 
+#print isBot_or_exists_lt /-
 theorem isBot_or_exists_lt [IsDirected α (· ≥ ·)] (a : α) : IsBot a ∨ ∃ b, b < a :=
   @isTop_or_exists_gt αᵒᵈ _ _ a
 #align is_bot_or_exists_lt isBot_or_exists_lt
+-/
 
+#print isBot_iff_isMin /-
 theorem isBot_iff_isMin [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a :=
   ⟨IsBot.isMin, IsMin.isBot⟩
 #align is_bot_iff_is_min isBot_iff_isMin
+-/
 
+#print isTop_iff_isMax /-
 theorem isTop_iff_isMax [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a :=
   ⟨IsTop.isMax, IsMax.isTop⟩
 #align is_top_iff_is_max isTop_iff_isMax
+-/
 
 variable (β) [PartialOrder β]
 
+#print exists_lt_of_directed_ge /-
 theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   by
   rcases exists_pair_ne β with ⟨a, b, hne⟩
   rcases isBot_or_exists_lt a with (ha | ⟨c, hc⟩)
   exacts[⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
 #align exists_lt_of_directed_ge exists_lt_of_directed_ge
+-/
 
+#print exists_lt_of_directed_le /-
 theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   let ⟨a, b, h⟩ := exists_lt_of_directed_ge βᵒᵈ
   ⟨b, a, h⟩
 #align exists_lt_of_directed_le exists_lt_of_directed_le
+-/
 
 end Preorder
 
+#print SemilatticeSup.to_isDirected_le /-
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeSup.to_isDirected_le [SemilatticeSup α] :
     IsDirected α (· ≤ ·) :=
   ⟨fun a b => ⟨a ⊔ b, le_sup_left, le_sup_right⟩⟩
 #align semilattice_sup.to_is_directed_le SemilatticeSup.to_isDirected_le
+-/
 
+#print SemilatticeInf.to_isDirected_ge /-
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeInf.to_isDirected_ge [SemilatticeInf α] :
     IsDirected α (· ≥ ·) :=
   ⟨fun a b => ⟨a ⊓ b, inf_le_left, inf_le_right⟩⟩
 #align semilattice_inf.to_is_directed_ge SemilatticeInf.to_isDirected_ge
+-/
 
 #print OrderTop.to_isDirected_le /-
 -- see Note [lower instance priority]
Diff
@@ -99,91 +99,43 @@ theorem DirectedOn.mono {s : Set α} (h : DirectedOn r s) (H : ∀ {a b}, r a b
 #align directed_on.mono DirectedOn.mono
 -/
 
-/- warning: directed_comp -> directed_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {r : α -> α -> Prop} {ι : Sort.{u3}} {f : ι -> β} {g : β -> α}, Iff (Directed.{u1, u3} α ι r (Function.comp.{u3, succ u2, succ u1} ι β α g f)) (Directed.{u2, u3} β ι (Order.Preimage.{succ u2, succ u1} β α g r) f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u3}} {r : α -> α -> Prop} {ι : Sort.{u1}} {f : ι -> β} {g : β -> α}, Iff (Directed.{u2, u1} α ι r (Function.comp.{u1, succ u3, succ u2} ι β α g f)) (Directed.{u3, u1} β ι (Order.Preimage.{succ u3, succ u2} β α g r) f)
-Case conversion may be inaccurate. Consider using '#align directed_comp directed_compₓ'. -/
 theorem directed_comp {ι} {f : ι → β} {g : β → α} : Directed r (g ∘ f) ↔ Directed (g ⁻¹'o r) f :=
   Iff.rfl
 #align directed_comp directed_comp
 
-/- warning: directed.mono -> Directed.mono is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop} {s : α -> α -> Prop} {ι : Sort.{u2}} {f : ι -> α}, (forall (a : α) (b : α), (r a b) -> (s a b)) -> (Directed.{u1, u2} α ι r f) -> (Directed.{u1, u2} α ι s f)
-but is expected to have type
-  forall {α : Type.{u2}} {r : α -> α -> Prop} {s : α -> α -> Prop} {ι : Sort.{u1}} {f : ι -> α}, (forall (a : α) (b : α), (r a b) -> (s a b)) -> (Directed.{u2, u1} α ι r f) -> (Directed.{u2, u1} α ι s f)
-Case conversion may be inaccurate. Consider using '#align directed.mono Directed.monoₓ'. -/
 theorem Directed.mono {s : α → α → Prop} {ι} {f : ι → α} (H : ∀ a b, r a b → s a b)
     (h : Directed r f) : Directed s f := fun a b =>
   let ⟨c, h₁, h₂⟩ := h a b
   ⟨c, H _ _ h₁, H _ _ h₂⟩
 #align directed.mono Directed.mono
 
-/- warning: directed.mono_comp -> Directed.mono_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} (r : α -> α -> Prop) {ι : Sort.{u3}} {rb : β -> β -> Prop} {g : α -> β} {f : ι -> α}, (forall {{x : α}} {{y : α}}, (r x y) -> (rb (g x) (g y))) -> (Directed.{u1, u3} α ι r f) -> (Directed.{u2, u3} β ι rb (Function.comp.{u3, succ u1, succ u2} ι α β g f))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u3}} (r : α -> α -> Prop) {ι : Sort.{u1}} {rb : β -> β -> Prop} {g : α -> β} {f : ι -> α}, (forall {{x : α}} {{y : α}}, (r x y) -> (rb (g x) (g y))) -> (Directed.{u2, u1} α ι r f) -> (Directed.{u3, u1} β ι rb (Function.comp.{u1, succ u2, succ u3} ι α β g f))
-Case conversion may be inaccurate. Consider using '#align directed.mono_comp Directed.mono_compₓ'. -/
 theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
     (hg : ∀ ⦃x y⦄, x ≼ y → rb (g x) (g y)) (hf : Directed r f) : Directed rb (g ∘ f) :=
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
 
-/- warning: directed_of_sup -> directed_of_sup is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] {f : α -> β} {r : β -> β -> Prop}, (forall {{i : α}} {{j : α}}, (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) i j) -> (r (f i) (f j))) -> (Directed.{u2, succ u1} β α r f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] {f : α -> β} {r : β -> β -> Prop}, (forall {{i : α}} {{j : α}}, (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) i j) -> (r (f i) (f j))) -> (Directed.{u2, succ u1} β α r f)
-Case conversion may be inaccurate. Consider using '#align directed_of_sup directed_of_supₓ'. -/
 /-- A monotone function on a sup-semilattice is directed. -/
 theorem directed_of_sup [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
     (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f := fun a b =>
   ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
 #align directed_of_sup directed_of_sup
 
-/- warning: monotone.directed_le -> Monotone.directed_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (LE.le.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1126 : β) (x._@.Mathlib.Order.Directed._hyg.1128 : β) => LE.le.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1126 x._@.Mathlib.Order.Directed._hyg.1128) f)
-Case conversion may be inaccurate. Consider using '#align monotone.directed_le Monotone.directed_leₓ'. -/
 theorem Monotone.directed_le [SemilatticeSup α] [Preorder β] {f : α → β} :
     Monotone f → Directed (· ≤ ·) f :=
   directed_of_sup
 #align monotone.directed_le Monotone.directed_le
 
-/- warning: antitone.directed_ge -> Antitone.directed_ge is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (GE.ge.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1179 : β) (x._@.Mathlib.Order.Directed._hyg.1181 : β) => GE.ge.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1179 x._@.Mathlib.Order.Directed._hyg.1181) f)
-Case conversion may be inaccurate. Consider using '#align antitone.directed_ge Antitone.directed_geₓ'. -/
 theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≥ ·) f :=
   directed_of_sup hf
 #align antitone.directed_ge Antitone.directed_ge
 
-/- warning: directed_on_of_sup_mem -> directedOn_of_sup_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1249 : α) (x._@.Mathlib.Order.Directed._hyg.1251 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1249 x._@.Mathlib.Order.Directed._hyg.1251) S)
-Case conversion may be inaccurate. Consider using '#align directed_on_of_sup_mem directedOn_of_sup_memₓ'. -/
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊔ j ∈ S) : DirectedOn (· ≤ ·) S := fun a ha b hb =>
   ⟨a ⊔ b, H ha hb, le_sup_left, le_sup_right⟩
 #align directed_on_of_sup_mem directedOn_of_sup_mem
 
-/- warning: directed.extend_bot -> Directed.extend_bot is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u2 u1} (β -> α) (Pi.hasBot.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toHasBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) _inst_2)))))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1323 : α) (x._@.Mathlib.Order.Directed._hyg.1325 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1323 x._@.Mathlib.Order.Directed._hyg.1325) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1342 : α) (x._@.Mathlib.Order.Directed._hyg.1344 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1342 x._@.Mathlib.Order.Directed._hyg.1344) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
-Case conversion may be inaccurate. Consider using '#align directed.extend_bot Directed.extend_botₓ'. -/
 theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι → α}
     (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
     Directed (· ≤ ·) (Function.extend e f ⊥) :=
@@ -198,46 +150,22 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   simp only [he.extend_apply, *, true_and_iff]
 #align directed.extend_bot Directed.extend_bot
 
-/- warning: directed_of_inf -> directed_of_inf is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] {r : β -> β -> Prop} {f : α -> β}, (forall (a₁ : α) (a₂ : α), (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) a₁ a₂) -> (r (f a₂) (f a₁))) -> (Directed.{u2, succ u1} β α r f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] {r : β -> β -> Prop} {f : α -> β}, (forall (a₁ : α) (a₂ : α), (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) a₁ a₂) -> (r (f a₂) (f a₁))) -> (Directed.{u2, succ u1} β α r f)
-Case conversion may be inaccurate. Consider using '#align directed_of_inf directed_of_infₓ'. -/
 /-- An antitone function on an inf-semilattice is directed. -/
 theorem directed_of_inf [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
     (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f := fun x y =>
   ⟨x ⊓ y, hf _ _ inf_le_left, hf _ _ inf_le_right⟩
 #align directed_of_inf directed_of_inf
 
-/- warning: monotone.directed_ge -> Monotone.directed_ge is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (GE.ge.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1627 : β) (x._@.Mathlib.Order.Directed._hyg.1629 : β) => GE.ge.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1627 x._@.Mathlib.Order.Directed._hyg.1629) f)
-Case conversion may be inaccurate. Consider using '#align monotone.directed_ge Monotone.directed_geₓ'. -/
 theorem Monotone.directed_ge [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Monotone f) :
     Directed (· ≥ ·) f :=
   directed_of_inf hf
 #align monotone.directed_ge Monotone.directed_ge
 
-/- warning: antitone.directed_le -> Antitone.directed_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (LE.le.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1681 : β) (x._@.Mathlib.Order.Directed._hyg.1683 : β) => LE.le.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1681 x._@.Mathlib.Order.Directed._hyg.1683) f)
-Case conversion may be inaccurate. Consider using '#align antitone.directed_le Antitone.directed_leₓ'. -/
 theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≤ ·) f :=
   directed_of_inf hf
 #align antitone.directed_le Antitone.directed_le
 
-/- warning: directed_on_of_inf_mem -> directedOn_of_inf_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1751 : α) (x._@.Mathlib.Order.Directed._hyg.1753 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1751 x._@.Mathlib.Order.Directed._hyg.1753) S)
-Case conversion may be inaccurate. Consider using '#align directed_on_of_inf_mem directedOn_of_inf_memₓ'. -/
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S := fun a ha b hb =>
@@ -327,12 +255,6 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
 
 section Reflexive
 
-/- warning: directed_on.insert -> DirectedOn.insert is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, (Reflexive.{succ u1} α r) -> (forall (a : α) {s : Set.{u1} α}, (DirectedOn.{u1} α r s) -> (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (Exists.{succ u1} α (fun (c : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) c s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) c s) => And (r a c) (r b c))))) -> (DirectedOn.{u1} α r (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s)))
-but is expected to have type
-  forall {α : Type.{u1}} {r : α -> α -> Prop}, (Reflexive.{succ u1} α r) -> (forall (a : α) {s : Set.{u1} α}, (DirectedOn.{u1} α r s) -> (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (Exists.{succ u1} α (fun (c : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) c s) (And (r a c) (r b c))))) -> (DirectedOn.{u1} α r (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s)))
-Case conversion may be inaccurate. Consider using '#align directed_on.insert DirectedOn.insertₓ'. -/
 theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
     (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) :=
   by
@@ -372,98 +294,44 @@ section Preorder
 
 variable [Preorder α] {a : α}
 
-/- warning: is_min.is_bot -> IsMin.isBot is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], (IsMin.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) -> (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3039 : α) (x._@.Mathlib.Order.Directed._hyg.3041 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3039 x._@.Mathlib.Order.Directed._hyg.3041)], (IsMin.{u1} α (Preorder.toLE.{u1} α _inst_1) a) -> (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
-Case conversion may be inaccurate. Consider using '#align is_min.is_bot IsMin.isBotₓ'. -/
 protected theorem IsMin.isBot [IsDirected α (· ≥ ·)] (h : IsMin a) : IsBot a := fun b =>
   let ⟨c, hca, hcb⟩ := exists_le_le a b
   (h hca).trans hcb
 #align is_min.is_bot IsMin.isBot
 
-/- warning: is_max.is_top -> IsMax.isTop is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], (IsMax.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) -> (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3128 : α) (x._@.Mathlib.Order.Directed._hyg.3130 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3128 x._@.Mathlib.Order.Directed._hyg.3130)], (IsMax.{u1} α (Preorder.toLE.{u1} α _inst_1) a) -> (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
-Case conversion may be inaccurate. Consider using '#align is_max.is_top IsMax.isTopₓ'. -/
 protected theorem IsMax.isTop [IsDirected α (· ≤ ·)] (h : IsMax a) : IsTop a :=
   h.toDual.IsBot
 #align is_max.is_top IsMax.isTop
 
-/- warning: directed_on.is_bot_of_is_min -> DirectedOn.is_bot_of_is_min is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) s) -> (forall {m : α}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a)) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3181 : α) (x._@.Mathlib.Order.Directed._hyg.3183 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3181 x._@.Mathlib.Order.Directed._hyg.3183) s) -> (forall {m : α}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m s) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a)) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a)))
-Case conversion may be inaccurate. Consider using '#align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_minₓ'. -/
 theorem DirectedOn.is_bot_of_is_min {s : Set α} (hd : DirectedOn (· ≥ ·) s) {m} (hm : m ∈ s)
     (hmin : ∀ a ∈ s, a ≤ m → m ≤ a) : ∀ a ∈ s, m ≤ a := fun a as =>
   let ⟨x, xs, xm, xa⟩ := hd m hm a as
   (hmin x xs xm).trans xa
 #align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_min
 
-/- warning: directed_on.is_top_of_is_max -> DirectedOn.is_top_of_is_max is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) s) -> (forall {m : α}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m)) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3326 : α) (x._@.Mathlib.Order.Directed._hyg.3328 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3326 x._@.Mathlib.Order.Directed._hyg.3328) s) -> (forall {m : α}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m s) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m)) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m)))
-Case conversion may be inaccurate. Consider using '#align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_maxₓ'. -/
 theorem DirectedOn.is_top_of_is_max {s : Set α} (hd : DirectedOn (· ≤ ·) s) {m} (hm : m ∈ s)
     (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m :=
   @DirectedOn.is_bot_of_is_min αᵒᵈ _ s hd m hm hmax
 #align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_max
 
-/- warning: is_top_or_exists_gt -> isTop_or_exists_gt is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))] (a : α), Or (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) a b))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3428 : α) (x._@.Mathlib.Order.Directed._hyg.3430 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3428 x._@.Mathlib.Order.Directed._hyg.3430)] (a : α), Or (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align is_top_or_exists_gt isTop_or_exists_gtₓ'. -/
 theorem isTop_or_exists_gt [IsDirected α (· ≤ ·)] (a : α) : IsTop a ∨ ∃ b, a < b :=
   (em (IsMax a)).imp IsMax.isTop not_isMax_iff.mp
 #align is_top_or_exists_gt isTop_or_exists_gt
 
-/- warning: is_bot_or_exists_lt -> isBot_or_exists_lt is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))] (a : α), Or (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) b a))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3497 : α) (x._@.Mathlib.Order.Directed._hyg.3499 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3497 x._@.Mathlib.Order.Directed._hyg.3499)] (a : α), Or (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) b a))
-Case conversion may be inaccurate. Consider using '#align is_bot_or_exists_lt isBot_or_exists_ltₓ'. -/
 theorem isBot_or_exists_lt [IsDirected α (· ≥ ·)] (a : α) : IsBot a ∨ ∃ b, b < a :=
   @isTop_or_exists_gt αᵒᵈ _ _ a
 #align is_bot_or_exists_lt isBot_or_exists_lt
 
-/- warning: is_bot_iff_is_min -> isBot_iff_isMin is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], Iff (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (IsMin.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3562 : α) (x._@.Mathlib.Order.Directed._hyg.3564 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3562 x._@.Mathlib.Order.Directed._hyg.3564)], Iff (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (IsMin.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
-Case conversion may be inaccurate. Consider using '#align is_bot_iff_is_min isBot_iff_isMinₓ'. -/
 theorem isBot_iff_isMin [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a :=
   ⟨IsBot.isMin, IsMin.isBot⟩
 #align is_bot_iff_is_min isBot_iff_isMin
 
-/- warning: is_top_iff_is_max -> isTop_iff_isMax is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], Iff (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (IsMax.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3615 : α) (x._@.Mathlib.Order.Directed._hyg.3617 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3615 x._@.Mathlib.Order.Directed._hyg.3617)], Iff (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (IsMax.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
-Case conversion may be inaccurate. Consider using '#align is_top_iff_is_max isTop_iff_isMaxₓ'. -/
 theorem isTop_iff_isMax [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a :=
   ⟨IsTop.isMax, IsMax.isTop⟩
 #align is_top_iff_is_max isTop_iff_isMax
 
 variable (β) [PartialOrder β]
 
-/- warning: exists_lt_of_directed_ge -> exists_lt_of_directed_ge is a dubious translation:
-lean 3 declaration is
-  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (GE.ge.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)))] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
-but is expected to have type
-  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (fun (x._@.Mathlib.Order.Directed._hyg.3699 : β) (x._@.Mathlib.Order.Directed._hyg.3701 : β) => GE.ge.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) x._@.Mathlib.Order.Directed._hyg.3699 x._@.Mathlib.Order.Directed._hyg.3701)] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
-Case conversion may be inaccurate. Consider using '#align exists_lt_of_directed_ge exists_lt_of_directed_geₓ'. -/
 theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   by
   rcases exists_pair_ne β with ⟨a, b, hne⟩
@@ -471,12 +339,6 @@ theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : 
   exacts[⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
 #align exists_lt_of_directed_ge exists_lt_of_directed_ge
 
-/- warning: exists_lt_of_directed_le -> exists_lt_of_directed_le is a dubious translation:
-lean 3 declaration is
-  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)))] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
-but is expected to have type
-  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (fun (x._@.Mathlib.Order.Directed._hyg.3802 : β) (x._@.Mathlib.Order.Directed._hyg.3804 : β) => LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) x._@.Mathlib.Order.Directed._hyg.3802 x._@.Mathlib.Order.Directed._hyg.3804)] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
-Case conversion may be inaccurate. Consider using '#align exists_lt_of_directed_le exists_lt_of_directed_leₓ'. -/
 theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   let ⟨a, b, h⟩ := exists_lt_of_directed_ge βᵒᵈ
   ⟨b, a, h⟩
@@ -484,24 +346,12 @@ theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : 
 
 end Preorder
 
-/- warning: semilattice_sup.to_is_directed_le -> SemilatticeSup.to_isDirected_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α], IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α], IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3905 : α) (x._@.Mathlib.Order.Directed._hyg.3907 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.3905 x._@.Mathlib.Order.Directed._hyg.3907)
-Case conversion may be inaccurate. Consider using '#align semilattice_sup.to_is_directed_le SemilatticeSup.to_isDirected_leₓ'. -/
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeSup.to_isDirected_le [SemilatticeSup α] :
     IsDirected α (· ≤ ·) :=
   ⟨fun a b => ⟨a ⊔ b, le_sup_left, le_sup_right⟩⟩
 #align semilattice_sup.to_is_directed_le SemilatticeSup.to_isDirected_le
 
-/- warning: semilattice_inf.to_is_directed_ge -> SemilatticeInf.to_isDirected_ge is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α], IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α], IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3966 : α) (x._@.Mathlib.Order.Directed._hyg.3968 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.3966 x._@.Mathlib.Order.Directed._hyg.3968)
-Case conversion may be inaccurate. Consider using '#align semilattice_inf.to_is_directed_ge SemilatticeInf.to_isDirected_geₓ'. -/
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeInf.to_isDirected_ge [SemilatticeInf α] :
     IsDirected α (· ≥ ·) :=
Diff
@@ -190,11 +190,9 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   by
   intro a b
   rcases(em (∃ i, e i = a)).symm with (ha | ⟨i, rfl⟩)
-  · use b
-    simp [Function.extend_apply' _ _ _ ha]
+  · use b; simp [Function.extend_apply' _ _ _ ha]
   rcases(em (∃ i, e i = b)).symm with (hb | ⟨j, rfl⟩)
-  · use e i
-    simp [Function.extend_apply' _ _ _ hb]
+  · use e i; simp [Function.extend_apply' _ _ _ hb]
   rcases hf i j with ⟨k, hi, hj⟩
   use e k
   simp only [he.extend_apply, *, true_and_iff]
Diff
@@ -132,31 +132,43 @@ theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : 
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
 
-#print directed_of_sup /-
+/- warning: directed_of_sup -> directed_of_sup is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] {f : α -> β} {r : β -> β -> Prop}, (forall {{i : α}} {{j : α}}, (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) i j) -> (r (f i) (f j))) -> (Directed.{u2, succ u1} β α r f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] {f : α -> β} {r : β -> β -> Prop}, (forall {{i : α}} {{j : α}}, (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) i j) -> (r (f i) (f j))) -> (Directed.{u2, succ u1} β α r f)
+Case conversion may be inaccurate. Consider using '#align directed_of_sup directed_of_supₓ'. -/
 /-- A monotone function on a sup-semilattice is directed. -/
 theorem directed_of_sup [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
     (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f := fun a b =>
   ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
 #align directed_of_sup directed_of_sup
--/
 
-#print Monotone.directed_le /-
+/- warning: monotone.directed_le -> Monotone.directed_le is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (LE.le.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1126 : β) (x._@.Mathlib.Order.Directed._hyg.1128 : β) => LE.le.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1126 x._@.Mathlib.Order.Directed._hyg.1128) f)
+Case conversion may be inaccurate. Consider using '#align monotone.directed_le Monotone.directed_leₓ'. -/
 theorem Monotone.directed_le [SemilatticeSup α] [Preorder β] {f : α → β} :
     Monotone f → Directed (· ≤ ·) f :=
   directed_of_sup
 #align monotone.directed_le Monotone.directed_le
--/
 
-#print Antitone.directed_ge /-
+/- warning: antitone.directed_ge -> Antitone.directed_ge is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (GE.ge.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeSup.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1179 : β) (x._@.Mathlib.Order.Directed._hyg.1181 : β) => GE.ge.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1179 x._@.Mathlib.Order.Directed._hyg.1181) f)
+Case conversion may be inaccurate. Consider using '#align antitone.directed_ge Antitone.directed_geₓ'. -/
 theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≥ ·) f :=
   directed_of_sup hf
 #align antitone.directed_ge Antitone.directed_ge
--/
 
 /- warning: directed_on_of_sup_mem -> directedOn_of_sup_mem is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1249 : α) (x._@.Mathlib.Order.Directed._hyg.1251 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1249 x._@.Mathlib.Order.Directed._hyg.1251) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_sup_mem directedOn_of_sup_memₓ'. -/
@@ -168,7 +180,7 @@ theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
 
 /- warning: directed.extend_bot -> Directed.extend_bot is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u2 u1} (β -> α) (Pi.hasBot.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toHasBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
+  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u2 u1} (β -> α) (Pi.hasBot.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toHasBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) _inst_2)))))
 but is expected to have type
   forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1323 : α) (x._@.Mathlib.Order.Directed._hyg.1325 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1323 x._@.Mathlib.Order.Directed._hyg.1325) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1342 : α) (x._@.Mathlib.Order.Directed._hyg.1344 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1342 x._@.Mathlib.Order.Directed._hyg.1344) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
 Case conversion may be inaccurate. Consider using '#align directed.extend_bot Directed.extend_botₓ'. -/
@@ -188,31 +200,43 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   simp only [he.extend_apply, *, true_and_iff]
 #align directed.extend_bot Directed.extend_bot
 
-#print directed_of_inf /-
+/- warning: directed_of_inf -> directed_of_inf is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] {r : β -> β -> Prop} {f : α -> β}, (forall (a₁ : α) (a₂ : α), (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) a₁ a₂) -> (r (f a₂) (f a₁))) -> (Directed.{u2, succ u1} β α r f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] {r : β -> β -> Prop} {f : α -> β}, (forall (a₁ : α) (a₂ : α), (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) a₁ a₂) -> (r (f a₂) (f a₁))) -> (Directed.{u2, succ u1} β α r f)
+Case conversion may be inaccurate. Consider using '#align directed_of_inf directed_of_infₓ'. -/
 /-- An antitone function on an inf-semilattice is directed. -/
 theorem directed_of_inf [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
     (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f := fun x y =>
   ⟨x ⊓ y, hf _ _ inf_le_left, hf _ _ inf_le_right⟩
 #align directed_of_inf directed_of_inf
--/
 
-#print Monotone.directed_ge /-
+/- warning: monotone.directed_ge -> Monotone.directed_ge is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (GE.ge.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Monotone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1627 : β) (x._@.Mathlib.Order.Directed._hyg.1629 : β) => GE.ge.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1627 x._@.Mathlib.Order.Directed._hyg.1629) f)
+Case conversion may be inaccurate. Consider using '#align monotone.directed_ge Monotone.directed_geₓ'. -/
 theorem Monotone.directed_ge [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Monotone f) :
     Directed (· ≥ ·) f :=
   directed_of_inf hf
 #align monotone.directed_ge Monotone.directed_ge
--/
 
-#print Antitone.directed_le /-
+/- warning: antitone.directed_le -> Antitone.directed_le is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (LE.le.{u2} β (Preorder.toHasLe.{u2} β _inst_2)) f)
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : SemilatticeInf.{u1} α] [_inst_2 : Preorder.{u2} β] {f : α -> β}, (Antitone.{u1, u2} α β (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)) _inst_2 f) -> (Directed.{u2, succ u1} β α (fun (x._@.Mathlib.Order.Directed._hyg.1681 : β) (x._@.Mathlib.Order.Directed._hyg.1683 : β) => LE.le.{u2} β (Preorder.toLE.{u2} β _inst_2) x._@.Mathlib.Order.Directed._hyg.1681 x._@.Mathlib.Order.Directed._hyg.1683) f)
+Case conversion may be inaccurate. Consider using '#align antitone.directed_le Antitone.directed_leₓ'. -/
 theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Antitone f) :
     Directed (· ≤ ·) f :=
   directed_of_inf hf
 #align antitone.directed_le Antitone.directed_le
--/
 
 /- warning: directed_on_of_inf_mem -> directedOn_of_inf_mem is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
   forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1751 : α) (x._@.Mathlib.Order.Directed._hyg.1753 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1751 x._@.Mathlib.Order.Directed._hyg.1753) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_inf_mem directedOn_of_inf_memₓ'. -/
@@ -350,93 +374,141 @@ section Preorder
 
 variable [Preorder α] {a : α}
 
-#print IsMin.isBot /-
+/- warning: is_min.is_bot -> IsMin.isBot is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], (IsMin.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) -> (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3039 : α) (x._@.Mathlib.Order.Directed._hyg.3041 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3039 x._@.Mathlib.Order.Directed._hyg.3041)], (IsMin.{u1} α (Preorder.toLE.{u1} α _inst_1) a) -> (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
+Case conversion may be inaccurate. Consider using '#align is_min.is_bot IsMin.isBotₓ'. -/
 protected theorem IsMin.isBot [IsDirected α (· ≥ ·)] (h : IsMin a) : IsBot a := fun b =>
   let ⟨c, hca, hcb⟩ := exists_le_le a b
   (h hca).trans hcb
 #align is_min.is_bot IsMin.isBot
--/
 
-#print IsMax.isTop /-
+/- warning: is_max.is_top -> IsMax.isTop is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], (IsMax.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) -> (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3128 : α) (x._@.Mathlib.Order.Directed._hyg.3130 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3128 x._@.Mathlib.Order.Directed._hyg.3130)], (IsMax.{u1} α (Preorder.toLE.{u1} α _inst_1) a) -> (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
+Case conversion may be inaccurate. Consider using '#align is_max.is_top IsMax.isTopₓ'. -/
 protected theorem IsMax.isTop [IsDirected α (· ≤ ·)] (h : IsMax a) : IsTop a :=
   h.toDual.IsBot
 #align is_max.is_top IsMax.isTop
--/
 
-#print DirectedOn.is_bot_of_is_min /-
+/- warning: directed_on.is_bot_of_is_min -> DirectedOn.is_bot_of_is_min is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) s) -> (forall {m : α}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a)) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a)))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3181 : α) (x._@.Mathlib.Order.Directed._hyg.3183 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3181 x._@.Mathlib.Order.Directed._hyg.3183) s) -> (forall {m : α}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m s) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a)) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a)))
+Case conversion may be inaccurate. Consider using '#align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_minₓ'. -/
 theorem DirectedOn.is_bot_of_is_min {s : Set α} (hd : DirectedOn (· ≥ ·) s) {m} (hm : m ∈ s)
     (hmin : ∀ a ∈ s, a ≤ m → m ≤ a) : ∀ a ∈ s, m ≤ a := fun a as =>
   let ⟨x, xs, xm, xa⟩ := hd m hm a as
   (hmin x xs xm).trans xa
 #align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_min
--/
 
-#print DirectedOn.is_top_of_is_max /-
+/- warning: directed_on.is_top_of_is_max -> DirectedOn.is_top_of_is_max is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1)) s) -> (forall {m : α}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) m s) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) m a) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m)) -> (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a m)))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {s : Set.{u1} α}, (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3326 : α) (x._@.Mathlib.Order.Directed._hyg.3328 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3326 x._@.Mathlib.Order.Directed._hyg.3328) s) -> (forall {m : α}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) m s) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) m a) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m)) -> (forall (a : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) a s) -> (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) a m)))
+Case conversion may be inaccurate. Consider using '#align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_maxₓ'. -/
 theorem DirectedOn.is_top_of_is_max {s : Set α} (hd : DirectedOn (· ≤ ·) s) {m} (hm : m ∈ s)
     (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m :=
   @DirectedOn.is_bot_of_is_min αᵒᵈ _ s hd m hm hmax
 #align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_max
--/
 
-#print isTop_or_exists_gt /-
+/- warning: is_top_or_exists_gt -> isTop_or_exists_gt is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))] (a : α), Or (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) a b))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3428 : α) (x._@.Mathlib.Order.Directed._hyg.3430 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3428 x._@.Mathlib.Order.Directed._hyg.3430)] (a : α), Or (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) a b))
+Case conversion may be inaccurate. Consider using '#align is_top_or_exists_gt isTop_or_exists_gtₓ'. -/
 theorem isTop_or_exists_gt [IsDirected α (· ≤ ·)] (a : α) : IsTop a ∨ ∃ b, a < b :=
   (em (IsMax a)).imp IsMax.isTop not_isMax_iff.mp
 #align is_top_or_exists_gt isTop_or_exists_gt
--/
 
-#print isBot_or_exists_lt /-
+/- warning: is_bot_or_exists_lt -> isBot_or_exists_lt is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))] (a : α), Or (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toHasLt.{u1} α _inst_1) b a))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3497 : α) (x._@.Mathlib.Order.Directed._hyg.3499 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3497 x._@.Mathlib.Order.Directed._hyg.3499)] (a : α), Or (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (Exists.{succ u1} α (fun (b : α) => LT.lt.{u1} α (Preorder.toLT.{u1} α _inst_1) b a))
+Case conversion may be inaccurate. Consider using '#align is_bot_or_exists_lt isBot_or_exists_ltₓ'. -/
 theorem isBot_or_exists_lt [IsDirected α (· ≥ ·)] (a : α) : IsBot a ∨ ∃ b, b < a :=
   @isTop_or_exists_gt αᵒᵈ _ _ a
 #align is_bot_or_exists_lt isBot_or_exists_lt
--/
 
-#print isBot_iff_isMin /-
+/- warning: is_bot_iff_is_min -> isBot_iff_isMin is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], Iff (IsBot.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (IsMin.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3562 : α) (x._@.Mathlib.Order.Directed._hyg.3564 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3562 x._@.Mathlib.Order.Directed._hyg.3564)], Iff (IsBot.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (IsMin.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
+Case conversion may be inaccurate. Consider using '#align is_bot_iff_is_min isBot_iff_isMinₓ'. -/
 theorem isBot_iff_isMin [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a :=
   ⟨IsBot.isMin, IsMin.isBot⟩
 #align is_bot_iff_is_min isBot_iff_isMin
--/
 
-#print isTop_iff_isMax /-
+/- warning: is_top_iff_is_max -> isTop_iff_isMax is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α _inst_1))], Iff (IsTop.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a) (IsMax.{u1} α (Preorder.toHasLe.{u1} α _inst_1) a)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : Preorder.{u1} α] {a : α} [_inst_2 : IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3615 : α) (x._@.Mathlib.Order.Directed._hyg.3617 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.3615 x._@.Mathlib.Order.Directed._hyg.3617)], Iff (IsTop.{u1} α (Preorder.toLE.{u1} α _inst_1) a) (IsMax.{u1} α (Preorder.toLE.{u1} α _inst_1) a)
+Case conversion may be inaccurate. Consider using '#align is_top_iff_is_max isTop_iff_isMaxₓ'. -/
 theorem isTop_iff_isMax [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a :=
   ⟨IsTop.isMax, IsMax.isTop⟩
 #align is_top_iff_is_max isTop_iff_isMax
--/
 
 variable (β) [PartialOrder β]
 
-#print exists_lt_of_directed_ge /-
+/- warning: exists_lt_of_directed_ge -> exists_lt_of_directed_ge is a dubious translation:
+lean 3 declaration is
+  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (GE.ge.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)))] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
+but is expected to have type
+  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (fun (x._@.Mathlib.Order.Directed._hyg.3699 : β) (x._@.Mathlib.Order.Directed._hyg.3701 : β) => GE.ge.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) x._@.Mathlib.Order.Directed._hyg.3699 x._@.Mathlib.Order.Directed._hyg.3701)] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
+Case conversion may be inaccurate. Consider using '#align exists_lt_of_directed_ge exists_lt_of_directed_geₓ'. -/
 theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   by
   rcases exists_pair_ne β with ⟨a, b, hne⟩
   rcases isBot_or_exists_lt a with (ha | ⟨c, hc⟩)
   exacts[⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
 #align exists_lt_of_directed_ge exists_lt_of_directed_ge
--/
 
-#print exists_lt_of_directed_le /-
+/- warning: exists_lt_of_directed_le -> exists_lt_of_directed_le is a dubious translation:
+lean 3 declaration is
+  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (LE.le.{u1} β (Preorder.toHasLe.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)))] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toHasLt.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
+but is expected to have type
+  forall (β : Type.{u1}) [_inst_2 : PartialOrder.{u1} β] [_inst_3 : IsDirected.{u1} β (fun (x._@.Mathlib.Order.Directed._hyg.3802 : β) (x._@.Mathlib.Order.Directed._hyg.3804 : β) => LE.le.{u1} β (Preorder.toLE.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) x._@.Mathlib.Order.Directed._hyg.3802 x._@.Mathlib.Order.Directed._hyg.3804)] [_inst_4 : Nontrivial.{u1} β], Exists.{succ u1} β (fun (a : β) => Exists.{succ u1} β (fun (b : β) => LT.lt.{u1} β (Preorder.toLT.{u1} β (PartialOrder.toPreorder.{u1} β _inst_2)) a b))
+Case conversion may be inaccurate. Consider using '#align exists_lt_of_directed_le exists_lt_of_directed_leₓ'. -/
 theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
   let ⟨a, b, h⟩ := exists_lt_of_directed_ge βᵒᵈ
   ⟨b, a, h⟩
 #align exists_lt_of_directed_le exists_lt_of_directed_le
--/
 
 end Preorder
 
-#print SemilatticeSup.to_isDirected_le /-
+/- warning: semilattice_sup.to_is_directed_le -> SemilatticeSup.to_isDirected_le is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α], IsDirected.{u1} α (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α], IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3905 : α) (x._@.Mathlib.Order.Directed._hyg.3907 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.3905 x._@.Mathlib.Order.Directed._hyg.3907)
+Case conversion may be inaccurate. Consider using '#align semilattice_sup.to_is_directed_le SemilatticeSup.to_isDirected_leₓ'. -/
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeSup.to_isDirected_le [SemilatticeSup α] :
     IsDirected α (· ≤ ·) :=
   ⟨fun a b => ⟨a ⊔ b, le_sup_left, le_sup_right⟩⟩
 #align semilattice_sup.to_is_directed_le SemilatticeSup.to_isDirected_le
--/
 
-#print SemilatticeInf.to_isDirected_ge /-
+/- warning: semilattice_inf.to_is_directed_ge -> SemilatticeInf.to_isDirected_ge is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α], IsDirected.{u1} α (GE.ge.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α], IsDirected.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.3966 : α) (x._@.Mathlib.Order.Directed._hyg.3968 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.3966 x._@.Mathlib.Order.Directed._hyg.3968)
+Case conversion may be inaccurate. Consider using '#align semilattice_inf.to_is_directed_ge SemilatticeInf.to_isDirected_geₓ'. -/
 -- see Note [lower instance priority]
 instance (priority := 100) SemilatticeInf.to_isDirected_ge [SemilatticeInf α] :
     IsDirected α (· ≥ ·) :=
   ⟨fun a b => ⟨a ⊓ b, inf_le_left, inf_le_right⟩⟩
 #align semilattice_inf.to_is_directed_ge SemilatticeInf.to_isDirected_ge
--/
 
 #print OrderTop.to_isDirected_le /-
 -- see Note [lower instance priority]
Diff
@@ -158,7 +158,7 @@ theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1251 : α) (x._@.Mathlib.Order.Directed._hyg.1253 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1251 x._@.Mathlib.Order.Directed._hyg.1253) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1249 : α) (x._@.Mathlib.Order.Directed._hyg.1251 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1249 x._@.Mathlib.Order.Directed._hyg.1251) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_sup_mem directedOn_of_sup_memₓ'. -/
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
@@ -170,7 +170,7 @@ theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u2 u1} (β -> α) (Pi.hasBot.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toHasBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
 but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1325 : α) (x._@.Mathlib.Order.Directed._hyg.1327 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1325 x._@.Mathlib.Order.Directed._hyg.1327) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1344 : α) (x._@.Mathlib.Order.Directed._hyg.1346 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1344 x._@.Mathlib.Order.Directed._hyg.1346) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
+  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1323 : α) (x._@.Mathlib.Order.Directed._hyg.1325 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1323 x._@.Mathlib.Order.Directed._hyg.1325) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1342 : α) (x._@.Mathlib.Order.Directed._hyg.1344 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1342 x._@.Mathlib.Order.Directed._hyg.1344) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
 Case conversion may be inaccurate. Consider using '#align directed.extend_bot Directed.extend_botₓ'. -/
 theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι → α}
     (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
@@ -214,7 +214,7 @@ theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1753 : α) (x._@.Mathlib.Order.Directed._hyg.1755 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1753 x._@.Mathlib.Order.Directed._hyg.1755) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1751 : α) (x._@.Mathlib.Order.Directed._hyg.1753 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1751 x._@.Mathlib.Order.Directed._hyg.1753) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_inf_mem directedOn_of_inf_memₓ'. -/
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
Diff
@@ -72,15 +72,11 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (coe : s
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
 #align directed_on.directed_coe DirectedOn.directed_val
 
-/- warning: directed_on_range -> directedOn_range is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {ι : Sort.{u2}} {r : α -> α -> Prop} {f : ι -> α}, Iff (Directed.{u1, u2} α ι r f) (DirectedOn.{u1} α r (Set.range.{u1, u2} α ι f))
-but is expected to have type
-  forall {α : Type.{u1}} {ι : Type.{u2}} {r : α -> α -> Prop} {f : ι -> α}, Iff (Directed.{u1, succ u2} α ι r f) (DirectedOn.{u1} α r (Set.range.{u1, succ u2} α ι f))
-Case conversion may be inaccurate. Consider using '#align directed_on_range directedOn_rangeₓ'. -/
+#print directedOn_range /-
 theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
   simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
 #align directed_on_range directedOn_range
+-/
 
 #print directedOn_image /-
 theorem directedOn_image {s} {f : β → α} : DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
@@ -162,7 +158,7 @@ theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1249 : α) (x._@.Mathlib.Order.Directed._hyg.1251 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1249 x._@.Mathlib.Order.Directed._hyg.1251) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1251 : α) (x._@.Mathlib.Order.Directed._hyg.1253 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1251 x._@.Mathlib.Order.Directed._hyg.1253) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_sup_mem directedOn_of_sup_memₓ'. -/
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
@@ -174,7 +170,7 @@ theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1)) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u2 u1} (β -> α) (Pi.hasBot.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toHasBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
 but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1323 : α) (x._@.Mathlib.Order.Directed._hyg.1325 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1323 x._@.Mathlib.Order.Directed._hyg.1325) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1342 : α) (x._@.Mathlib.Order.Directed._hyg.1344 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1342 x._@.Mathlib.Order.Directed._hyg.1344) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
+  forall {α : Type.{u1}} {β : Type.{u2}} {ι : Sort.{u3}} [_inst_1 : Preorder.{u1} α] [_inst_2 : OrderBot.{u1} α (Preorder.toLE.{u1} α _inst_1)] {e : ι -> β} {f : ι -> α}, (Directed.{u1, u3} α ι (fun (x._@.Mathlib.Order.Directed._hyg.1325 : α) (x._@.Mathlib.Order.Directed._hyg.1327 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1325 x._@.Mathlib.Order.Directed._hyg.1327) f) -> (Function.Injective.{u3, succ u2} ι β e) -> (Directed.{u1, succ u2} α β (fun (x._@.Mathlib.Order.Directed._hyg.1344 : α) (x._@.Mathlib.Order.Directed._hyg.1346 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α _inst_1) x._@.Mathlib.Order.Directed._hyg.1344 x._@.Mathlib.Order.Directed._hyg.1346) (Function.extend.{u3, succ u2, succ u1} ι β α e f (Bot.bot.{max u1 u2} (β -> α) (Pi.instBotForAll.{u2, u1} β (fun (ᾰ : β) => α) (fun (i : β) => OrderBot.toBot.{u1} α (Preorder.toLE.{u1} α _inst_1) _inst_2)))))
 Case conversion may be inaccurate. Consider using '#align directed.extend_bot Directed.extend_botₓ'. -/
 theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι → α}
     (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
@@ -218,7 +214,7 @@ theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1751 : α) (x._@.Mathlib.Order.Directed._hyg.1753 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1751 x._@.Mathlib.Order.Directed._hyg.1753) S)
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1753 : α) (x._@.Mathlib.Order.Directed._hyg.1755 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1753 x._@.Mathlib.Order.Directed._hyg.1755) S)
 Case conversion may be inaccurate. Consider using '#align directed_on_of_inf_mem directedOn_of_inf_memₓ'. -/
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
Diff
@@ -309,6 +309,12 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
 
 section Reflexive
 
+/- warning: directed_on.insert -> DirectedOn.insert is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {r : α -> α -> Prop}, (Reflexive.{succ u1} α r) -> (forall (a : α) {s : Set.{u1} α}, (DirectedOn.{u1} α r s) -> (forall (b : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) b s) -> (Exists.{succ u1} α (fun (c : α) => Exists.{0} (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) c s) (fun (H : Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) c s) => And (r a c) (r b c))))) -> (DirectedOn.{u1} α r (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s)))
+but is expected to have type
+  forall {α : Type.{u1}} {r : α -> α -> Prop}, (Reflexive.{succ u1} α r) -> (forall (a : α) {s : Set.{u1} α}, (DirectedOn.{u1} α r s) -> (forall (b : α), (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) b s) -> (Exists.{succ u1} α (fun (c : α) => And (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) c s) (And (r a c) (r b c))))) -> (DirectedOn.{u1} α r (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.instInsertSet.{u1} α) a s)))
+Case conversion may be inaccurate. Consider using '#align directed_on.insert DirectedOn.insertₓ'. -/
 theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
     (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) :=
   by
@@ -322,19 +328,25 @@ theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : Directed
     exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
 #align directed_on.insert DirectedOn.insert
 
+#print directedOn_singleton /-
 theorem directedOn_singleton (h : Reflexive r) (a : α) : DirectedOn r ({a} : Set α) :=
   fun x hx y hy => ⟨x, hx, h _, hx.symm ▸ hy.symm ▸ h _⟩
 #align directed_on_singleton directedOn_singleton
+-/
 
+#print directedOn_pair /-
 theorem directedOn_pair (h : Reflexive r) {a b : α} (hab : a ≼ b) : DirectedOn r ({a, b} : Set α) :=
   (directedOn_singleton h _).insert h _ fun c hc => ⟨c, hc, hc.symm ▸ hab, h _⟩
 #align directed_on_pair directedOn_pair
+-/
 
+#print directedOn_pair' /-
 theorem directedOn_pair' (h : Reflexive r) {a b : α} (hab : a ≼ b) :
     DirectedOn r ({b, a} : Set α) := by
   rw [Set.pair_comm]
   apply directedOn_pair h hab
 #align directed_on_pair' directedOn_pair'
+-/
 
 end Reflexive
 
@@ -448,6 +460,7 @@ section ScottContinuous
 
 variable [Preorder α] {a : α}
 
+#print ScottContinuous /-
 /-- A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
 sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
 Scott topology.
@@ -463,7 +476,9 @@ does not appear to play a significant role in the literature, so is omitted here
 def ScottContinuous [Preorder β] (f : α → β) : Prop :=
   ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a⦄, IsLUB d a → IsLUB (f '' d) (f a)
 #align scott_continuous ScottContinuous
+-/
 
+#print ScottContinuous.monotone /-
 protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : ScottContinuous f) :
     Monotone f := by
   intro a b hab
@@ -478,6 +493,7 @@ protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : Sc
   rw [Set.image_pair]
   exact Set.mem_insert _ _
 #align scott_continuous.monotone ScottContinuous.monotone
+-/
 
 end ScottContinuous
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 485b24ed47b1b7978d38a1e445158c6224c3f42c
+! leanprover-community/mathlib commit e8cf0cfec5fcab9baf46dc17d30c5e22048468be
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -72,11 +72,15 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (coe : s
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
 #align directed_on.directed_coe DirectedOn.directed_val
 
-#print directedOn_range /-
-theorem directedOn_range {f : β → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
+/- warning: directed_on_range -> directedOn_range is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {ι : Sort.{u2}} {r : α -> α -> Prop} {f : ι -> α}, Iff (Directed.{u1, u2} α ι r f) (DirectedOn.{u1} α r (Set.range.{u1, u2} α ι f))
+but is expected to have type
+  forall {α : Type.{u1}} {ι : Type.{u2}} {r : α -> α -> Prop} {f : ι -> α}, Iff (Directed.{u1, succ u2} α ι r f) (DirectedOn.{u1} α r (Set.range.{u1, succ u2} α ι f))
+Case conversion may be inaccurate. Consider using '#align directed_on_range directedOn_rangeₓ'. -/
+theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
   simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
 #align directed_on_range directedOn_range
--/
 
 #print directedOn_image /-
 theorem directedOn_image {s} {f : β → α} : DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
Diff
@@ -4,13 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 6cb77a8eaff0ddd100e87b1591c6d3ad319514ff
+! leanprover-community/mathlib commit 485b24ed47b1b7978d38a1e445158c6224c3f42c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.Set.Image
 import Mathbin.Order.Lattice
 import Mathbin.Order.Max
+import Mathbin.Order.Bounds.Basic
 
 /-!
 # Directed indexed families and sets
@@ -27,6 +28,11 @@ directed iff each pair of elements has a shared upper bound.
 * `directed_on r s`: Predicate stating that the set `s` is `r`-directed.
 * `is_directed α r`: Prop-valued mixin stating that `α` is `r`-directed. Follows the style of the
   unbundled relation classes such as `is_total`.
+* `scott_continuous`: Predicate stating that a function between preorders preserves
+  `is_lub` on directed sets.
+
+## References
+* [Gierz et al, *A Compendium of Continuous Lattices*][GierzEtAl1980]
 -/
 
 
@@ -297,6 +303,37 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
 #align order_dual.is_directed_le OrderDual.isDirected_le
 -/
 
+section Reflexive
+
+theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
+    (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) :=
+  by
+  rintro x (rfl | hx) y (rfl | hy)
+  · exact ⟨y, Set.mem_insert _ _, h _, h _⟩
+  · obtain ⟨w, hws, hwr⟩ := ha y hy
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
+  · obtain ⟨w, hws, hwr⟩ := ha x hx
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr.symm⟩
+  · obtain ⟨w, hws, hwr⟩ := hd x hx y hy
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
+#align directed_on.insert DirectedOn.insert
+
+theorem directedOn_singleton (h : Reflexive r) (a : α) : DirectedOn r ({a} : Set α) :=
+  fun x hx y hy => ⟨x, hx, h _, hx.symm ▸ hy.symm ▸ h _⟩
+#align directed_on_singleton directedOn_singleton
+
+theorem directedOn_pair (h : Reflexive r) {a b : α} (hab : a ≼ b) : DirectedOn r ({a, b} : Set α) :=
+  (directedOn_singleton h _).insert h _ fun c hc => ⟨c, hc, hc.symm ▸ hab, h _⟩
+#align directed_on_pair directedOn_pair
+
+theorem directedOn_pair' (h : Reflexive r) {a b : α} (hab : a ≼ b) :
+    DirectedOn r ({b, a} : Set α) := by
+  rw [Set.pair_comm]
+  apply directedOn_pair h hab
+#align directed_on_pair' directedOn_pair'
+
+end Reflexive
+
 section Preorder
 
 variable [Preorder α] {a : α}
@@ -403,3 +440,40 @@ instance (priority := 100) OrderBot.to_isDirected_ge [LE α] [OrderBot α] : IsD
 #align order_bot.to_is_directed_ge OrderBot.to_isDirected_ge
 -/
 
+section ScottContinuous
+
+variable [Preorder α] {a : α}
+
+/-- A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
+sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
+Scott topology.
+
+The dual notion
+
+```lean
+∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
+```
+
+does not appear to play a significant role in the literature, so is omitted here.
+-/
+def ScottContinuous [Preorder β] (f : α → β) : Prop :=
+  ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a⦄, IsLUB d a → IsLUB (f '' d) (f a)
+#align scott_continuous ScottContinuous
+
+protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : ScottContinuous f) :
+    Monotone f := by
+  intro a b hab
+  have e1 : IsLUB (f '' {a, b}) (f b) := by
+    apply h
+    · exact Set.insert_nonempty _ _
+    · exact directedOn_pair le_refl hab
+    · rw [IsLUB, upperBounds_insert, upperBounds_singleton,
+        Set.inter_eq_self_of_subset_right (set.Ici_subset_Ici.mpr hab)]
+      exact isLeast_Ici
+  apply e1.1
+  rw [Set.image_pair]
+  exact Set.mem_insert _ _
+#align scott_continuous.monotone ScottContinuous.monotone
+
+end ScottContinuous
+
Diff
@@ -148,13 +148,17 @@ theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (
 #align antitone.directed_ge Antitone.directed_ge
 -/
 
-#print directedOn_of_sup_mem /-
+/- warning: directed_on_of_sup_mem -> directedOn_of_sup_mem is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toHasSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1)))) S)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeSup.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Sup.sup.{u1} α (SemilatticeSup.toSup.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1249 : α) (x._@.Mathlib.Order.Directed._hyg.1251 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeSup.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1249 x._@.Mathlib.Order.Directed._hyg.1251) S)
+Case conversion may be inaccurate. Consider using '#align directed_on_of_sup_mem directedOn_of_sup_memₓ'. -/
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊔ j ∈ S) : DirectedOn (· ≤ ·) S := fun a ha b hb =>
   ⟨a ⊔ b, H ha hb, le_sup_left, le_sup_right⟩
 #align directed_on_of_sup_mem directedOn_of_sup_mem
--/
 
 /- warning: directed.extend_bot -> Directed.extend_bot is a dubious translation:
 lean 3 declaration is
@@ -200,13 +204,17 @@ theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (
 #align antitone.directed_le Antitone.directed_le
 -/
 
-#print directedOn_of_inf_mem /-
+/- warning: directed_on_of_inf_mem -> directedOn_of_inf_mem is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) i S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) j S) -> (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toHasInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1)))) S)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : SemilatticeInf.{u1} α] {S : Set.{u1} α}, (forall {{i : α}} {{j : α}}, (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) i S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) j S) -> (Membership.mem.{u1, u1} α (Set.{u1} α) (Set.instMembershipSet.{u1} α) (Inf.inf.{u1} α (SemilatticeInf.toInf.{u1} α _inst_1) i j) S)) -> (DirectedOn.{u1} α (fun (x._@.Mathlib.Order.Directed._hyg.1751 : α) (x._@.Mathlib.Order.Directed._hyg.1753 : α) => GE.ge.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (SemilatticeInf.toPartialOrder.{u1} α _inst_1))) x._@.Mathlib.Order.Directed._hyg.1751 x._@.Mathlib.Order.Directed._hyg.1753) S)
+Case conversion may be inaccurate. Consider using '#align directed_on_of_inf_mem directedOn_of_inf_memₓ'. -/
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S := fun a ha b hb =>
   ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
 #align directed_on_of_inf_mem directedOn_of_inf_mem
--/
 
 #print IsDirected /-
 /-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that

Changes in mathlib4

mathlib3
mathlib4
chore: remove more bex and ball from lemma names (#11615)

Follow-up to #10816.

Remaining places containing such lemmas are

  • Option.bex_ne_none and Option.ball_ne_none: defined in Lean core
  • Nat.decidableBallLT and Nat.decidableBallLE: defined in Lean core
  • bef_def is still used in a number of places and could be renamed
  • BAll.imp_{left,right}, BEx.imp_{left,right}, BEx.intro and BEx.elim

I only audited the first ~150 lemmas mentioning "ball"; too many lemmas named after Metric.ball/openBall/closedBall.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -57,7 +57,7 @@ variable {r r'}
 
 theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype.val : s → α) := by
   simp only [DirectedOn, Directed, Subtype.exists, exists_and_left, exists_prop, Subtype.forall]
-  exact ball_congr fun x _ => by simp [And.comm, and_assoc]
+  exact forall₂_congr fun x _ => by simp [And.comm, and_assoc]
 #align directed_on_iff_directed directedOn_iff_directed
 
 alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
style: remove redundant instance arguments (#11581)

I removed some redundant instance arguments throughout Mathlib. To do this, I used VS Code's regex search. See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/repeating.20instances.20from.20variable.20command I closed the previous PR for this and reopened it.

Diff
@@ -312,7 +312,7 @@ theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : 
   ⟨b, a, h⟩
 #align exists_lt_of_directed_le exists_lt_of_directed_le
 
-variable [PartialOrder β] {f : α → β} {s : Set α}
+variable {f : α → β} {s : Set α}
 
 -- TODO: Generalise the following two lemmas to connected orders
 
chore: more squeeze_simps arising from linter (#11259)

The squeezing continues! All found by the linter at #11246.

Diff
@@ -56,7 +56,8 @@ def DirectedOn (s : Set α) :=
 variable {r r'}
 
 theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype.val : s → α) := by
-  simp [Directed, DirectedOn]; refine' ball_congr fun x _ => by simp [And.comm, and_assoc]
+  simp only [DirectedOn, Directed, Subtype.exists, exists_and_left, exists_prop, Subtype.forall]
+  exact ball_congr fun x _ => by simp [And.comm, and_assoc]
 #align directed_on_iff_directed directedOn_iff_directed
 
 alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -63,7 +63,7 @@ alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
 #align directed_on.directed_coe DirectedOn.directed_val
 
 theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
-  simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
+  simp_rw [Directed, DirectedOn, Set.forall_mem_range, Set.exists_range_iff]
 #align directed_on_range directedOn_range
 
 -- Porting note: This alias was misplaced in `order/compactly_generated.lean` in mathlib3
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -66,11 +66,11 @@ theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.ra
   simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
 #align directed_on_range directedOn_range
 
--- porting note: This alias was misplaced in `order/compactly_generated.lean` in mathlib3
+-- Porting note: This alias was misplaced in `order/compactly_generated.lean` in mathlib3
 alias ⟨Directed.directedOn_range, _⟩ := directedOn_range
 #align directed.directed_on_range Directed.directedOn_range
 
--- porting note: `attribute [protected]` doesn't work
+-- Porting note: `attribute [protected]` doesn't work
 -- attribute [protected] Directed.directedOn_range
 
 theorem directedOn_image {s : Set β} {f : β → α} :
feat(Topology/Algebra/Order): continuous injective function on interval is strictly monotone (#7018)

Suppose f : [a, b] → δ or f : (a, b) → δ is continuous and injective. Then f is strictly monotone.

Co-authored-by: Johan Commelin <johan@commelin.net>

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com> Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -1,11 +1,9 @@
 /-
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
-Authors: Johannes Hölzl
+Authors: Johannes Hölzl, Yaël Dillies
 -/
 import Mathlib.Data.Set.Image
-import Mathlib.Order.Lattice
-import Mathlib.Order.Max
 
 #align_import order.directed from "leanprover-community/mathlib"@"ffde2d8a6e689149e44fd95fa862c23a57f8c780"
 
@@ -24,6 +22,11 @@ directed iff each pair of elements has a shared upper bound.
 * `ScottContinuous`: Predicate stating that a function between preorders preserves `IsLUB` on
   directed sets.
 
+## TODO
+
+Define connected orders (the transitive symmetric closure of `≤` is everything) and show that
+(co)directed orders are connected.
+
 ## References
 * [Gierz et al, *A Compendium of Continuous Lattices*][GierzEtAl1980]
 -/
@@ -308,6 +311,23 @@ theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : 
   ⟨b, a, h⟩
 #align exists_lt_of_directed_le exists_lt_of_directed_le
 
+variable [PartialOrder β] {f : α → β} {s : Set α}
+
+-- TODO: Generalise the following two lemmas to connected orders
+
+/-- If `f` is monotone and antitone on a directed order, then `f` is constant. -/
+lemma constant_of_monotone_antitone [IsDirected α (· ≤ ·)] (hf : Monotone f) (hf' : Antitone f)
+    (a b : α) : f a = f b := by
+  obtain ⟨c, hac, hbc⟩ := exists_ge_ge a b
+  exact le_antisymm ((hf hac).trans $ hf' hbc) ((hf hbc).trans $ hf' hac)
+
+/-- If `f` is monotone and antitone on a directed set `s`, then `f` is constant on `s`. -/
+lemma constant_of_monotoneOn_antitoneOn (hf : MonotoneOn f s) (hf' : AntitoneOn f s)
+    (hs : DirectedOn (· ≤ ·) s) : ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → f a = f b := by
+  rintro a ha b hb
+  obtain ⟨c, hc, hac, hbc⟩ := hs _ ha _ hb
+  exact le_antisymm ((hf ha hc hac).trans $ hf' hb hc hbc) ((hf hb hc hbc).trans $ hf' ha hc hac)
+
 end Preorder
 
 -- see Note [lower instance priority]
feat: Scott topology on a preorder (#2508)

Introduce the Scott topology on a preorder, defined in terms of directed sets.

There is already a related notion of Scott topology defined in topology.omega_complete_partial_order, where it is defined on ω-complete partial orders in terms of ω-chains. In some circumstances the definition given here coincides with that given in topology.omega_complete_partial_order but in general they are different. Abramsky and Jung ([Domain Theory, 2.2.4][abramsky_gabbay_maibaum_1994]) argue that the ω-chain approach has pedagogical advantages, but the directed sets approach is more appropriate as a theoretical foundation.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com> Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -82,9 +82,9 @@ theorem DirectedOn.mono' {s : Set α} (hs : DirectedOn r s)
   ⟨z, hz, h hx hz hxz, h hy hz hyz⟩
 #align directed_on.mono' DirectedOn.mono'
 
-theorem DirectedOn.mono {s : Set α} (h : DirectedOn r s) (H : ∀ {a b}, r a b → r' a b) :
+theorem DirectedOn.mono {s : Set α} (h : DirectedOn r s) (H : ∀ ⦃a b⦄, r a b → r' a b) :
     DirectedOn r' s :=
-  h.mono' fun _ _ _ _ => H
+  h.mono' fun _ _ _ _ h ↦ H h
 #align directed_on.mono DirectedOn.mono
 
 theorem directed_comp {ι} {f : ι → β} {g : β → α} : Directed r (g ∘ f) ↔ Directed (g ⁻¹'o r) f :=
feat: generalize some lemmas to directed types (#7852)

New lemmas / instances

  • An archimedean ordered semiring is directed upwards.
  • Filter.hasAntitoneBasis_atTop;
  • Filter.HasAntitoneBasis.iInf_principal;

Fix typos

  • Docstrings: "if the agree" -> "if they agree".
  • ProbabilityTheory.measure_eq_zero_or_one_of_indepSetCat_self -> ProbabilityTheory.measure_eq_zero_or_one_of_indepSet_self.

Weaken typeclass assumptions

From a semilattice to a directed type

  • MeasureTheory.tendsto_measure_iUnion;
  • MeasureTheory.tendsto_measure_iInter;
  • Monotone.directed_le, Monotone.directed_ge;
  • Antitone.directed_le, Antitone.directed_ge;
  • directed_of_sup, renamed to directed_of_isDirected_le;
  • directed_of_inf, renamed to directed_of_isDirected_ge;

From a strict ordered semiring to an ordered semiring

  • tendsto_nat_cast_atTop_atTop;
  • Filter.Eventually.nat_cast_atTop;
  • atTop_hasAntitoneBasis_of_archimedean;
Diff
@@ -103,22 +103,6 @@ theorem Directed.mono_comp (r : α → α → Prop) {ι} {rb : β → β → Pro
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
 
-/-- A monotone function on a sup-semilattice is directed. -/
-theorem directed_of_sup [SemilatticeSup α] {f : α → β} {r : β → β → Prop}
-    (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f := fun a b =>
-  ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
-#align directed_of_sup directed_of_sup
-
-theorem Monotone.directed_le [SemilatticeSup α] [Preorder β] {f : α → β} :
-    Monotone f → Directed (· ≤ ·) f :=
-  directed_of_sup
-#align monotone.directed_le Monotone.directed_le
-
-theorem Antitone.directed_ge [SemilatticeSup α] [Preorder β] {f : α → β} (hf : Antitone f) :
-    Directed (· ≥ ·) f :=
-  directed_of_sup hf
-#align antitone.directed_ge Antitone.directed_ge
-
 /-- A set stable by supremum is `≤`-directed. -/
 theorem directedOn_of_sup_mem [SemilatticeSup α] {S : Set α}
     (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊔ j ∈ S) : DirectedOn (· ≤ ·) S := fun a ha b hb =>
@@ -140,26 +124,10 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
   simp only [he.extend_apply, *, true_and_iff]
 #align directed.extend_bot Directed.extend_bot
 
-/-- An antitone function on an inf-semilattice is directed. -/
-theorem directed_of_inf [SemilatticeInf α] {r : β → β → Prop} {f : α → β}
-    (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f := fun x y =>
-  ⟨x ⊓ y, hf _ _ inf_le_left, hf _ _ inf_le_right⟩
-#align directed_of_inf directed_of_inf
-
-theorem Monotone.directed_ge [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Monotone f) :
-    Directed (· ≥ ·) f :=
-  directed_of_inf hf
-#align monotone.directed_ge Monotone.directed_ge
-
-theorem Antitone.directed_le [SemilatticeInf α] [Preorder β] {f : α → β} (hf : Antitone f) :
-    Directed (· ≤ ·) f :=
-  directed_of_inf hf
-#align antitone.directed_le Antitone.directed_le
-
 /-- A set stable by infimum is `≥`-directed. -/
 theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
-    (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S := fun a ha b hb =>
-  ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
+    (H : ∀ ⦃i j⦄, i ∈ S → j ∈ S → i ⊓ j ∈ S) : DirectedOn (· ≥ ·) S :=
+  directedOn_of_sup_mem (α := αᵒᵈ) H
 #align directed_on_of_inf_mem directedOn_of_inf_mem
 
 theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f := fun i j =>
@@ -178,7 +146,7 @@ theorem directed_of (r : α → α → Prop) [IsDirected α r] (a b : α) : ∃
   IsDirected.directed _ _
 #align directed_of directed_of
 
-theorem directed_id [IsDirected α r] : Directed r id := by convert directed_of r
+theorem directed_id [IsDirected α r] : Directed r id := directed_of r
 #align directed_id directed_id
 
 theorem directed_id_iff : Directed r id ↔ IsDirected α r :=
@@ -199,8 +167,8 @@ theorem directedOn_univ_iff : DirectedOn r Set.univ ↔ IsDirected α r :=
 #align directed_on_univ_iff directedOn_univ_iff
 
 -- see Note [lower instance priority]
-instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r := by
-  rw [← directed_id_iff]; exact IsTotal.directed _
+instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r :=
+  directed_id_iff.1 <| IsTotal.directed _
 #align is_total.to_is_directed IsTotal.to_isDirected
 
 theorem isDirected_mono [IsDirected α r] (h : ∀ ⦃a b⦄, r a b → s a b) : IsDirected α s :=
@@ -225,6 +193,38 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
   assumption
 #align order_dual.is_directed_le OrderDual.isDirected_le
 
+/-- A monotone function on an upwards-directed type is directed. -/
+theorem directed_of_isDirected_le [LE α] [IsDirected α (· ≤ ·)] {f : α → β} {r : β → β → Prop}
+    (H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : Directed r f :=
+  directed_id.mono_comp H
+#align directed_of_sup directed_of_isDirected_le
+
+theorem Monotone.directed_le [Preorder α] [IsDirected α (· ≤ ·)] [Preorder β] {f : α → β} :
+    Monotone f → Directed (· ≤ ·) f :=
+  directed_of_isDirected_le
+#align monotone.directed_le Monotone.directed_le
+
+theorem Antitone.directed_ge [Preorder α] [IsDirected α (· ≤ ·)] [Preorder β] {f : α → β}
+    (hf : Antitone f) : Directed (· ≥ ·) f :=
+  directed_of_isDirected_le hf
+#align antitone.directed_ge Antitone.directed_ge
+
+/-- An antitone function on a downwards-directed type is directed. -/
+theorem directed_of_isDirected_ge [LE α] [IsDirected α (· ≥ ·)] {r : β → β → Prop} {f : α → β}
+    (hf : ∀ a₁ a₂, a₁ ≤ a₂ → r (f a₂) (f a₁)) : Directed r f :=
+  directed_of_isDirected_le (α := αᵒᵈ) fun _ _ ↦ hf _ _
+#align directed_of_inf directed_of_isDirected_ge
+
+theorem Monotone.directed_ge [Preorder α] [IsDirected α (· ≥ ·)] [Preorder β] {f : α → β}
+    (hf : Monotone f) : Directed (· ≥ ·) f :=
+  directed_of_isDirected_ge hf
+#align monotone.directed_ge Monotone.directed_ge
+
+theorem Antitone.directed_le [Preorder α] [IsDirected α (· ≥ ·)] [Preorder β] {f : α → β}
+    (hf : Antitone f) : Directed (· ≤ ·) f :=
+  directed_of_isDirected_ge hf
+#align antitone.directed_le Antitone.directed_le
+
 section Reflexive
 
 protected theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
chore: missing spaces after rcases, convert and congrm (#7725)

Replace rcases( with rcases (. Same thing for convert( and congrm(. No other change.

Diff
@@ -129,10 +129,10 @@ theorem Directed.extend_bot [Preorder α] [OrderBot α] {e : ι → β} {f : ι
     (hf : Directed (· ≤ ·) f) (he : Function.Injective e) :
     Directed (· ≤ ·) (Function.extend e f ⊥) := by
   intro a b
-  rcases(em (∃ i, e i = a)).symm with (ha | ⟨i, rfl⟩)
+  rcases (em (∃ i, e i = a)).symm with (ha | ⟨i, rfl⟩)
   · use b
     simp [Function.extend_apply' _ _ _ ha]
-  rcases(em (∃ i, e i = b)).symm with (hb | ⟨j, rfl⟩)
+  rcases (em (∃ i, e i = b)).symm with (hb | ⟨j, rfl⟩)
   · use e i
     simp [Function.extend_apply' _ _ _ hb]
   rcases hf i j with ⟨k, hi, hj⟩
chore: Generalise and move liminf/limsup lemmas (#6846)

Forward-ports https://github.com/leanprover-community/mathlib/pull/18628

Diff
@@ -6,9 +6,8 @@ Authors: Johannes Hölzl
 import Mathlib.Data.Set.Image
 import Mathlib.Order.Lattice
 import Mathlib.Order.Max
-import Mathlib.Order.Bounds.Basic
 
-#align_import order.directed from "leanprover-community/mathlib"@"3efd324a3a31eaa40c9d5bfc669c4fafee5f9423"
+#align_import order.directed from "leanprover-community/mathlib"@"ffde2d8a6e689149e44fd95fa862c23a57f8c780"
 
 /-!
 # Directed indexed families and sets
@@ -332,40 +331,3 @@ instance (priority := 100) OrderTop.to_isDirected_le [LE α] [OrderTop α] : IsD
 instance (priority := 100) OrderBot.to_isDirected_ge [LE α] [OrderBot α] : IsDirected α (· ≥ ·) :=
   ⟨fun _ _ => ⟨⊥, bot_le _, bot_le _⟩⟩
 #align order_bot.to_is_directed_ge OrderBot.to_isDirected_ge
-
-section ScottContinuous
-
-variable [Preorder α] {a : α}
-
-/-- A function between preorders is said to be Scott continuous if it preserves `IsLUB` on directed
-sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
-Scott topology.
-
-The dual notion
-
-```lean
-∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≥ ·) d → ∀ ⦃a⦄, IsGLB d a → IsGLB (f '' d) (f a)
-```
-
-does not appear to play a significant role in the literature, so is omitted here.
--/
-def ScottContinuous [Preorder β] (f : α → β) : Prop :=
-  ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a⦄, IsLUB d a → IsLUB (f '' d) (f a)
-#align scott_continuous ScottContinuous
-
-protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : ScottContinuous f) :
-    Monotone f := by
-  intro a b hab
-  have e1 : IsLUB (f '' {a, b}) (f b) := by
-    apply h
-    · exact Set.insert_nonempty _ _
-    · exact directedOn_pair le_refl hab
-    · rw [IsLUB, upperBounds_insert, upperBounds_singleton,
-        Set.inter_eq_self_of_subset_right (Set.Ici_subset_Ici.mpr hab)]
-      exact isLeast_Ici
-  apply e1.1
-  rw [Set.image_pair]
-  exact Set.mem_insert _ _
-#align scott_continuous.monotone ScottContinuous.monotone
-
-end ScottContinuous
feat: patch for new alias command (#6172)
Diff
@@ -57,7 +57,7 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype
   simp [Directed, DirectedOn]; refine' ball_congr fun x _ => by simp [And.comm, and_assoc]
 #align directed_on_iff_directed directedOn_iff_directed
 
-alias directedOn_iff_directed ↔ DirectedOn.directed_val _
+alias ⟨DirectedOn.directed_val, _⟩ := directedOn_iff_directed
 #align directed_on.directed_coe DirectedOn.directed_val
 
 theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
@@ -65,7 +65,7 @@ theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.ra
 #align directed_on_range directedOn_range
 
 -- porting note: This alias was misplaced in `order/compactly_generated.lean` in mathlib3
-alias directedOn_range ↔ Directed.directedOn_range _
+alias ⟨Directed.directedOn_range, _⟩ := directedOn_range
 #align directed.directed_on_range Directed.directedOn_range
 
 -- porting note: `attribute [protected]` doesn't work
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -169,7 +169,7 @@ theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f := fun i
 
 /-- `IsDirected α r` states that for any elements `a`, `b` there exists an element `c` such that
 `r a c` and `r b c`. -/
-class IsDirected (α : Type _) (r : α → α → Prop) : Prop where
+class IsDirected (α : Type*) (r : α → α → Prop) : Prop where
   /-- For every pair of elements `a` and `b` there is a `c` such that `r a c` and `r b c` -/
   directed (a b : α) : ∃ c, r a c ∧ r b c
 #align is_directed IsDirected
chore(*): add protected to *.insert theorems (#6142)

Otherwise code like

theorem ContMDiffWithinAt.mythm (h : x ∈ insert y s) : _ = _

interprets insert as ContMDiffWithinAt.insert, not Insert.insert.

Diff
@@ -228,7 +228,7 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
 
 section Reflexive
 
-theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
+protected theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
     (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) := by
   rintro x (rfl | hx) y (rfl | hy)
   · exact ⟨y, Set.mem_insert _ _, h _, h _⟩
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 3efd324a3a31eaa40c9d5bfc669c4fafee5f9423
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Image
 import Mathlib.Order.Lattice
 import Mathlib.Order.Max
 import Mathlib.Order.Bounds.Basic
 
+#align_import order.directed from "leanprover-community/mathlib"@"3efd324a3a31eaa40c9d5bfc669c4fafee5f9423"
+
 /-!
 # Directed indexed families and sets
 
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -57,7 +57,7 @@ def DirectedOn (s : Set α) :=
 variable {r r'}
 
 theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype.val : s → α) := by
-  simp [Directed, DirectedOn] ; refine' ball_congr fun x _ => by simp [And.comm, and_assoc]
+  simp [Directed, DirectedOn]; refine' ball_congr fun x _ => by simp [And.comm, and_assoc]
 #align directed_on_iff_directed directedOn_iff_directed
 
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
remove conditional completeness assumption in IsCompact.exists_isMinOn (#5388)

Also rename 2 lemmas

  • IsCompact.exists_local_min_mem_open -> IsCompact.exists_isLocalMin_mem_open;
  • Metric.exists_local_min_mem_ball -> Metric.exists_isLocal_min_mem_ball.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit e8cf0cfec5fcab9baf46dc17d30c5e22048468be
+! leanprover-community/mathlib commit 3efd324a3a31eaa40c9d5bfc669c4fafee5f9423
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -166,6 +166,10 @@ theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
   ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
 #align directed_on_of_inf_mem directedOn_of_inf_mem
 
+theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f := fun i j =>
+  Or.casesOn (total_of r (f i) (f j)) (fun h => ⟨j, h, refl _⟩) fun h => ⟨i, refl _, h⟩
+#align is_total.directed IsTotal.directed
+
 /-- `IsDirected α r` states that for any elements `a`, `b` there exists an element `c` such that
 `r a c` and `r b c`. -/
 class IsDirected (α : Type _) (r : α → α → Prop) : Prop where
@@ -199,8 +203,8 @@ theorem directedOn_univ_iff : DirectedOn r Set.univ ↔ IsDirected α r :=
 #align directed_on_univ_iff directedOn_univ_iff
 
 -- see Note [lower instance priority]
-instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r :=
-  ⟨fun a b => Or.casesOn (total_of r a b) (fun h => ⟨b, h, refl _⟩) fun h => ⟨a, refl _, h⟩⟩
+instance (priority := 100) IsTotal.to_isDirected [IsTotal α r] : IsDirected α r := by
+  rw [← directed_id_iff]; exact IsTotal.directed _
 #align is_total.to_is_directed IsTotal.to_isDirected
 
 theorem isDirected_mono [IsDirected α r] (h : ∀ ⦃a b⦄, r a b → s a b) : IsDirected α s :=
chore: add space after exacts (#4945)

Too often tempted to change these during other PRs, so doing a mass edit here.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -300,7 +300,7 @@ variable (β) [PartialOrder β]
 theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : ∃ a b : β, a < b := by
   rcases exists_pair_ne β with ⟨a, b, hne⟩
   rcases isBot_or_exists_lt a with (ha | ⟨c, hc⟩)
-  exacts[⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
+  exacts [⟨a, b, (ha b).lt_of_ne hne⟩, ⟨_, _, hc⟩]
 #align exists_lt_of_directed_ge exists_lt_of_directed_ge
 
 theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : ∃ a b : β, a < b :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 485b24ed47b1b7978d38a1e445158c6224c3f42c
+! leanprover-community/mathlib commit e8cf0cfec5fcab9baf46dc17d30c5e22048468be
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -63,10 +63,17 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
 #align directed_on.directed_coe DirectedOn.directed_val
 
-theorem directedOn_range {f : β → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
+theorem directedOn_range {f : ι → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
   simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
 #align directed_on_range directedOn_range
 
+-- porting note: This alias was misplaced in `order/compactly_generated.lean` in mathlib3
+alias directedOn_range ↔ Directed.directedOn_range _
+#align directed.directed_on_range Directed.directedOn_range
+
+-- porting note: `attribute [protected]` doesn't work
+-- attribute [protected] Directed.directedOn_range
+
 theorem directedOn_image {s : Set β} {f : β → α} :
     DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
   simp only [DirectedOn, Set.mem_image, exists_exists_and_eq_and, forall_exists_index, and_imp,
feat: forward-port leanprover-community/mathlib#18517 (#2543)

Matches https://github.com/leanprover-community/mathlib/pull/18517

This result is required in #2508.

Co-authored-by: Yaël Dillies <yael.dillies@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,13 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
+! leanprover-community/mathlib commit 485b24ed47b1b7978d38a1e445158c6224c3f42c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Image
 import Mathlib.Order.Lattice
 import Mathlib.Order.Max
+import Mathlib.Order.Bounds.Basic
 
 /-!
 # Directed indexed families and sets
@@ -24,6 +25,11 @@ directed iff each pair of elements has a shared upper bound.
 * `DirectedOn r s`: Predicate stating that the set `s` is `r`-directed.
 * `IsDirected α r`: Prop-valued mixin stating that `α` is `r`-directed. Follows the style of the
   unbundled relation classes such as `IsTotal`.
+* `ScottContinuous`: Predicate stating that a function between preorders preserves `IsLUB` on
+  directed sets.
+
+## References
+* [Gierz et al, *A Compendium of Continuous Lattices*][GierzEtAl1980]
 -/
 
 
@@ -212,6 +218,36 @@ instance OrderDual.isDirected_le [LE α] [IsDirected α (· ≥ ·)] : IsDirecte
   assumption
 #align order_dual.is_directed_le OrderDual.isDirected_le
 
+section Reflexive
+
+theorem DirectedOn.insert (h : Reflexive r) (a : α) {s : Set α} (hd : DirectedOn r s)
+    (ha : ∀ b ∈ s, ∃ c ∈ s, a ≼ c ∧ b ≼ c) : DirectedOn r (insert a s) := by
+  rintro x (rfl | hx) y (rfl | hy)
+  · exact ⟨y, Set.mem_insert _ _, h _, h _⟩
+  · obtain ⟨w, hws, hwr⟩ := ha y hy
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
+  · obtain ⟨w, hws, hwr⟩ := ha x hx
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr.symm⟩
+  · obtain ⟨w, hws, hwr⟩ := hd x hx y hy
+    exact ⟨w, Set.mem_insert_of_mem _ hws, hwr⟩
+#align directed_on.insert DirectedOn.insert
+
+theorem directedOn_singleton (h : Reflexive r) (a : α) : DirectedOn r ({a} : Set α) :=
+  fun x hx _ hy => ⟨x, hx, h _, hx.symm ▸ hy.symm ▸ h _⟩
+#align directed_on_singleton directedOn_singleton
+
+theorem directedOn_pair (h : Reflexive r) {a b : α} (hab : a ≼ b) : DirectedOn r ({a, b} : Set α) :=
+  (directedOn_singleton h _).insert h _ fun c hc => ⟨c, hc, hc.symm ▸ hab, h _⟩
+#align directed_on_pair directedOn_pair
+
+theorem directedOn_pair' (h : Reflexive r) {a b : α} (hab : a ≼ b) :
+    DirectedOn r ({b, a} : Set α) := by
+  rw [Set.pair_comm]
+  apply directedOn_pair h hab
+#align directed_on_pair' directedOn_pair'
+
+end Reflexive
+
 section Preorder
 
 variable [Preorder α] {a : α}
@@ -288,3 +324,40 @@ instance (priority := 100) OrderTop.to_isDirected_le [LE α] [OrderTop α] : IsD
 instance (priority := 100) OrderBot.to_isDirected_ge [LE α] [OrderBot α] : IsDirected α (· ≥ ·) :=
   ⟨fun _ _ => ⟨⊥, bot_le _, bot_le _⟩⟩
 #align order_bot.to_is_directed_ge OrderBot.to_isDirected_ge
+
+section ScottContinuous
+
+variable [Preorder α] {a : α}
+
+/-- A function between preorders is said to be Scott continuous if it preserves `IsLUB` on directed
+sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
+Scott topology.
+
+The dual notion
+
+```lean
+∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≥ ·) d → ∀ ⦃a⦄, IsGLB d a → IsGLB (f '' d) (f a)
+```
+
+does not appear to play a significant role in the literature, so is omitted here.
+-/
+def ScottContinuous [Preorder β] (f : α → β) : Prop :=
+  ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (· ≤ ·) d → ∀ ⦃a⦄, IsLUB d a → IsLUB (f '' d) (f a)
+#align scott_continuous ScottContinuous
+
+protected theorem ScottContinuous.monotone [Preorder β] {f : α → β} (h : ScottContinuous f) :
+    Monotone f := by
+  intro a b hab
+  have e1 : IsLUB (f '' {a, b}) (f b) := by
+    apply h
+    · exact Set.insert_nonempty _ _
+    · exact directedOn_pair le_refl hab
+    · rw [IsLUB, upperBounds_insert, upperBounds_singleton,
+        Set.inter_eq_self_of_subset_right (Set.Ici_subset_Ici.mpr hab)]
+      exact isLeast_Ici
+  apply e1.1
+  rw [Set.image_pair]
+  exact Set.mem_insert _ _
+#align scott_continuous.monotone ScottContinuous.monotone
+
+end ScottContinuous
feat: port RingTheory.Subsemiring.Basic (#1862)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Vierkantor <vierkantor@vierkantor.com>

Diff
@@ -88,8 +88,9 @@ theorem Directed.mono {s : α → α → Prop} {ι} {f : ι → α} (H : ∀ a b
   ⟨c, H _ _ h₁, H _ _ h₂⟩
 #align directed.mono Directed.mono
 
-theorem Directed.mono_comp {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
-    (hg : ∀ ⦃x y⦄, x ≼ y → rb (g x) (g y)) (hf : Directed r f) : Directed rb (g ∘ f) :=
+-- Porting note: due to some interaction with the local notation, `r` became explicit here in lean3
+theorem Directed.mono_comp (r : α → α → Prop) {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
+    (hg : ∀ ⦃x y⦄, r x y → rb (g x) (g y)) (hf : Directed r f) : Directed rb (g ∘ f) :=
   directed_comp.2 <| hf.mono hg
 #align directed.mono_comp Directed.mono_comp
 
feat: port GroupTheory.Submonoid.Membership (#1699)

Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>

Diff
@@ -55,6 +55,7 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype
 #align directed_on_iff_directed directedOn_iff_directed
 
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
+#align directed_on.directed_coe DirectedOn.directed_val
 
 theorem directedOn_range {f : β → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
   simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
chore: remove iff_self from simp only after lean4#1933 (#1406)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -63,7 +63,7 @@ theorem directedOn_range {f : β → α} : Directed r f ↔ DirectedOn r (Set.ra
 theorem directedOn_image {s : Set β} {f : β → α} :
     DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
   simp only [DirectedOn, Set.mem_image, exists_exists_and_eq_and, forall_exists_index, and_imp,
-    forall_apply_eq_imp_iff₂, Order.Preimage, iff_self]
+    forall_apply_eq_imp_iff₂, Order.Preimage]
 #align directed_on_image directedOn_image
 
 theorem DirectedOn.mono' {s : Set α} (hs : DirectedOn r s)
chore: Update some synchronization SHAs (#1377)

Note that the SHA for Data.Set.Function has not be bumped to HEAD since some functions introduced in https://github.com/leanprover-community/mathlib/commit/d1723c047a091ae3fca0af8aeab1743e1a898611 are missing.

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
 
 ! This file was ported from Lean 3 source module order.directed
-! leanprover-community/mathlib commit cf9386b56953fb40904843af98b7a80757bbe7f9
+! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
feat: synchronize with mathlib3 #17905 (#1280)

mathlib3 SHA: 6cb77a8e


[mathlib#17905](https://github.com/leanprover-community/mathlib/pull/17905/files#diff-[deb01ba1](https://github.com/leanprover-community/mathlib/commit/deb01ba12632f4703c3dc29a10a34bd3a7d2a1c0)2dcf8b44d3e561fe3bde06fe) has been approved, so I think reviewers don't need to check the mathematical content.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -56,6 +56,10 @@ theorem directedOn_iff_directed {s} : @DirectedOn α r s ↔ Directed r (Subtype
 
 alias directedOn_iff_directed ↔ DirectedOn.directed_val _
 
+theorem directedOn_range {f : β → α} : Directed r f ↔ DirectedOn r (Set.range f) := by
+  simp_rw [Directed, DirectedOn, Set.forall_range_iff, Set.exists_range_iff]
+#align directed_on_range directedOn_range
+
 theorem directedOn_image {s : Set β} {f : β → α} :
     DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s := by
   simp only [DirectedOn, Set.mem_image, exists_exists_and_eq_and, forall_exists_index, and_imp,
@@ -219,6 +223,17 @@ protected theorem IsMax.isTop [IsDirected α (· ≤ ·)] (h : IsMax a) : IsTop
   h.toDual.isBot
 #align is_max.is_top IsMax.isTop
 
+lemma DirectedOn.is_bot_of_is_min {s : Set α} (hd : DirectedOn (· ≥ ·) s)
+    {m} (hm : m ∈ s) (hmin : ∀ a ∈ s, a ≤ m → m ≤ a) : ∀ a ∈ s, m ≤ a := fun a as =>
+  let ⟨x, xs, xm, xa⟩ := hd m hm a as
+  (hmin x xs xm).trans xa
+#align directed_on.is_bot_of_is_min DirectedOn.is_bot_of_is_min
+
+lemma DirectedOn.is_top_of_is_max {s : Set α} (hd : DirectedOn (· ≤ ·) s)
+    {m} (hm : m ∈ s) (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m :=
+  @DirectedOn.is_bot_of_is_min αᵒᵈ _ s hd m hm hmax
+#align directed_on.is_top_of_is_max DirectedOn.is_top_of_is_max
+
 theorem isTop_or_exists_gt [IsDirected α (· ≤ ·)] (a : α) : IsTop a ∨ ∃ b, a < b :=
   (em (IsMax a)).imp IsMax.isTop not_isMax_iff.mp
 #align is_top_or_exists_gt isTop_or_exists_gt
chore: fix more casing errors per naming scheme (#1232)

I've avoided anything under Tactic or test.

In correcting the names, I found Option.isNone_iff_eq_none duplicated between Std and Mathlib, so the Mathlib one has been removed.

Co-authored-by: Reid Barton <rwbarton@gmail.com>

Diff
@@ -147,7 +147,7 @@ theorem directedOn_of_inf_mem [SemilatticeInf α] {S : Set α}
   ⟨a ⊓ b, H ha hb, inf_le_left, inf_le_right⟩
 #align directed_on_of_inf_mem directedOn_of_inf_mem
 
-/-- `is_directed α r` states that for any elements `a`, `b` there exists an element `c` such that
+/-- `IsDirected α r` states that for any elements `a`, `b` there exists an element `c` such that
 `r a c` and `r b c`. -/
 class IsDirected (α : Type _) (r : α → α → Prop) : Prop where
   /-- For every pair of elements `a` and `b` there is a `c` such that `r a c` and `r b c` -/
@@ -227,13 +227,13 @@ theorem isBot_or_exists_lt [IsDirected α (· ≥ ·)] (a : α) : IsBot a ∨ 
   @isTop_or_exists_gt αᵒᵈ _ _ a
 #align is_bot_or_exists_lt isBot_or_exists_lt
 
-theorem isBot_iff_is_min [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a :=
+theorem isBot_iff_isMin [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a :=
   ⟨IsBot.isMin, IsMin.isBot⟩
-#align is_bot_iff_is_min isBot_iff_is_min
+#align is_bot_iff_is_min isBot_iff_isMin
 
-theorem isTop_iff_is_max [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a :=
+theorem isTop_iff_isMax [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a :=
   ⟨IsTop.isMax, IsMax.isTop⟩
-#align is_top_iff_is_max isTop_iff_is_max
+#align is_top_iff_is_max isTop_iff_isMax
 
 variable (β) [PartialOrder β]
 
chore: add source headers to ported theory files (#1094)

The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl
+
+! This file was ported from Lean 3 source module order.directed
+! leanprover-community/mathlib commit cf9386b56953fb40904843af98b7a80757bbe7f9
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Image
 import Mathlib.Order.Lattice

Dependencies 37

38 files ported (100.0%)
21012 lines ported (100.0%)

All dependencies are ported!