Debian Codegraph @

src/Relation/Binary/Lattice/Properties/BoundedJoinSemilattice.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties satisfied by bounded join semilattices
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Relation.Binary.Lattice
10
11 module Relation.Binary.Lattice.Properties.BoundedJoinSemilattice
12 {c ℓ₁ ℓ₂} (J : BoundedJoinSemilattice c ℓ₁ ℓ₂) where
13
14 open import Data.Product.Base using (_,_)
15 open import Function.Base using (_∘_; flip)
16
17 open BoundedJoinSemilattice J
18
19 open import Algebra.Definitions _≈_
20 using (LeftIdentity; RightIdentity; Identity)
21 open import Relation.Binary.Properties.Poset poset
22 using (≥-isPartialOrder)
23
24
25 -- Bottom is an identity of the meet operation.
26
27 identityˡ : LeftIdentity ⊥ _∨_
28 identityˡ x =
29 let _ , x≤⊥∨x , least = supremum ⊥ x
30 in antisym (least x (minimum x) refl) x≤⊥∨x
31
32 identityʳ : RightIdentity ⊥ _∨_
33 identityʳ x =
34 let x≤x∨⊥ , _ , least = supremum x ⊥
35 in antisym (least x refl (minimum x)) x≤x∨⊥
36
37 identity : Identity ⊥ _∨_
38 identity = identityˡ , identityʳ
39
40
41 -- The dual construction is a bounded meet semilattice.
42
43 dualIsBoundedMeetSemilattice : IsBoundedMeetSemilattice _≈_ (flip _≤_) _∨_ ⊥
44 dualIsBoundedMeetSemilattice = record
45 { isMeetSemilattice = record
46 { isPartialOrder = ≥-isPartialOrder
47 ; infimum = supremum
48 }
49 ; maximum = minimum
50 }
51
52 dualBoundedMeetSemilattice : BoundedMeetSemilattice c ℓ₁ ℓ₂
53 dualBoundedMeetSemilattice = record
54 { ⊤ = ⊥
55 ; isBoundedMeetSemilattice = dualIsBoundedMeetSemilattice
56 }