Skip to content

Commit c8f5859

Browse files
committed
refactor(Order): make CompletePartialOrder extend OrderBot (#34477)
Make `CompletePartialOrder` extend `OrderBot`, and add a constructor `completePartialOrderOfLubOfDirected`. Previously, `CompletePartialOrder` had an implicit bottom element but did not extend OrderBot explicitly. Breaking change: `CompletePartialOrder` instances must provide `⊥` and `bot_le`, or use the constructor. See discussion in [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/.3E.20complete.20partial.20order.20and.20domain.20theory.20formalization).
1 parent e5c478f commit c8f5859

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Mathlib/Order/CompletePartialOrder.lean

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Christopher Hoskin
55
-/
66
module
77

8+
public import Mathlib.Order.BoundedOrder.Basic
89
public import Mathlib.Order.OmegaCompletePartialOrder
910
public import Mathlib.Order.ConditionallyCompletePartialOrder.Defs
1011

@@ -42,10 +43,24 @@ section CompletePartialOrder
4243
/--
4344
Complete partial orders are partial orders where every directed set has a least upper bound.
4445
-/
45-
class CompletePartialOrder (α : Type*) extends PartialOrder α, SupSet α where
46+
class CompletePartialOrder (α : Type*) extends PartialOrder α, SupSet α, OrderBot α where
4647
/-- For each directed set `d`, `sSup d` is the least upper bound of `d`. -/
4748
lubOfDirected : ∀ d, DirectedOn (· ≤ ·) d → IsLUB d (sSup d)
4849

50+
/-- Create a `CompletePartialOrder` from a `PartialOrder` and `SupSet`
51+
such that for every directed set `d`, `sSup d` is the least upper bound of `d`.
52+
53+
The bottom element is defined as `sSup ∅`.
54+
-/
55+
@[reducible]
56+
def CompletePartialOrder.ofLubOfDirected (α : Type*) [H1 : PartialOrder α] [H2 : SupSet α]
57+
(lub_of_directed : ∀ d : Set α, DirectedOn (· ≤ ·) d → IsLUB d (sSup d)) :
58+
CompletePartialOrder α where
59+
__ := H1; __ := H2
60+
bot := sSup ∅
61+
bot_le := isLUB_empty_iff.mp <| lub_of_directed ∅ IsChain.empty.directedOn
62+
lubOfDirected := lub_of_directed
63+
4964
variable [CompletePartialOrder α] [Preorder β] {f : ι → α} {d : Set α} {a : α}
5065

5166
protected lemma DirectedOn.isLUB_sSup : DirectedOn (· ≤ ·) d → IsLUB d (sSup d) :=

0 commit comments

Comments
 (0)