module Order.Diagram.Meet where
private variable
: Level o ā
Meetsš
As mentioned before, in the binary case, we refer to glbs as meets: The meet of and is, if it exists, the greatest element satisfying and
record is-meet (P : Poset o ā) (a b glb : ā P ā) : Type (o ā ā) where
no-eta-equality
open Poset P
field
: glb ā¤ a
meetā¤l : glb ā¤ b
meetā¤r : (lb' : Ob) ā lb' ā¤ a ā lb' ā¤ b ā lb' ā¤ glb
greatest
record Meet (P : Poset o ā) (a b : ā P ā) : Type (o ā ā) where
no-eta-equality
field
: ā P ā
glb : is-meet P a b glb
has-meet open is-meet has-meet public
open is-meet
: Poset o ā ā Type (o ā ā)
Has-meets = ā x y ā Meet P x y Has-meets P
unquoteDecl H-Level-is-meet = declare-record-hlevel 1 H-Level-is-meet (quote is-meet)
module _ {P : Poset o ā} where
open Poset P
open is-glb
open Glb
A shuffling of terms shows that being a meet is precisely being the greatest lower bound of a family of two elements.
: ā {a b glb} ā is-meet P a b glb ā is-glb P (if_then a else b) glb
is-meetāis-glb .glbā¤fam true = meet .meetā¤l
is-meetāis-glb meet .glbā¤fam false = meet .meetā¤r
is-meetāis-glb meet .greatest glb' x = meet .greatest glb' (x true) (x false)
is-meetāis-glb meet
: ā {F : Bool ā Ob} {glb} ā is-glb P F glb ā is-meet P (F true) (F false) glb
is-glbāis-meet .meetā¤l = glb .glbā¤fam true
is-glbāis-meet glb .meetā¤r = glb .glbā¤fam false
is-glbāis-meet glb .greatest lb' lb'<a lb'<b = glb .greatest lb' Ī» where
is-glbāis-meet glb ā lb'<a
true ā lb'<b false
: ā {a b x y} ā is-meet P a b x ā is-meet P a b y ā x ā” y
meet-unique {a = a} {b} x-meet y-meet = glb-unique
meet-unique (is-meetāis-glb x-meet)
(is-meetāis-glb y-meet)
: ā {a b} ā is-prop (Meet P a b)
Meet-is-prop .Meet.glb =
Meet-is-prop p q i (Meet.has-meet p) (Meet.has-meet q) i
meet-unique {a = a} {b = b} p q i .Meet.has-meet =
Meet-is-prop
is-propāpathp{B = Ī» i ā is-meet P a b (meet-unique (Meet.has-meet p) (Meet.has-meet q) i)}
(Ī» i ā hlevel 1)
(Meet.has-meet p) (Meet.has-meet q) i
instance
H-Level-Meet: ā {a b} {n}
ā H-Level (Meet P a b) (suc n)
= prop-instance Meet-is-prop
H-Level-Meet
: ā {a b} ā Meet P a b ā Glb P (if_then a else b)
MeetāGlb .Glb.glb = Meet.glb meet
MeetāGlb meet .Glb.has-glb = is-meetāis-glb (Meet.has-meet meet)
MeetāGlb meet
: ā {a b} ā Glb P (if_then a else b) ā Meet P a b
GlbāMeet .Meet.glb = Glb.glb glb
GlbāMeet glb .Meet.has-meet = is-glbāis-meet (Glb.has-glb glb)
GlbāMeet glb
: ā {a b glb} ā is-equiv (is-meetāis-glb {a} {b} {glb})
is-meetāis-glb = biimp-is-equiv! _ is-glbāis-meet
is-meetāis-glb
: ā {a b} ā is-equiv (MeetāGlb {a} {b})
MeetāGlb = biimp-is-equiv! _ GlbāMeet MeetāGlb
An important lemma about meets is that, if then the greatest lower bound of and is just
: ā {a b} ā a ā¤ b ā is-meet P a b a
leāis-meet .meetā¤l = ā¤-refl
leāis-meet aā¤b .meetā¤r = aā¤b
leāis-meet aā¤b .greatest lb' lb'ā¤a _ = lb'ā¤a
leāis-meet aā¤b
: ā {a b l} ā a ā¤ b ā is-meet P a b l ā a ā” l
le-meet = meet-unique (leāis-meet aā¤b) l le-meet aā¤b l
As productsš
When passing from posets to categories, meets become products: coming from the other direction, if a category has each a proposition, then products in are simply meets.
open is-product
open Product
: ā {a b glb : Ob} ā is-meet P a b glb ā Product (posetācategory P) a b
is-meetāproduct .apex = _
is-meetāproduct glb .Ļā = glb .is-meet.meetā¤l
is-meetāproduct glb .Ļā = glb .is-meet.meetā¤r
is-meetāproduct glb .has-is-product .āØ_,_ā© q<a q<b =
is-meetāproduct glb .is-meet.greatest _ q<a q<b
glb .has-is-product .ĻāāāØā© = prop!
is-meetāproduct glb .has-is-product .ĻāāāØā© = prop!
is-meetāproduct glb .has-is-product .unique _ _ = prop! is-meetāproduct glb