Debian Codegraph @

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

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties satisfied by meet semilattices
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Relation.Binary.Lattice
10
11 module Relation.Binary.Lattice.Properties.MeetSemilattice
12 {c ℓ₁ ℓ₂} (M : MeetSemilattice c ℓ₁ ℓ₂) where
13
14 open import Function.Base using (flip)
15 open import Relation.Binary.Structures using (IsDecPartialOrder)
16 open import Relation.Binary.Definitions using (Decidable)
17
18 open MeetSemilattice M
19
20 open import Relation.Binary.Properties.Poset poset using (≥-isPartialOrder)
21 import Relation.Binary.Lattice.Properties.JoinSemilattice as J
22
23 -- The dual construction is a join semilattice.
24
25 dualIsJoinSemilattice : IsJoinSemilattice _≈_ (flip _≤_) _∧_
26 dualIsJoinSemilattice = record
27 { isPartialOrder = ≥-isPartialOrder
28 ; supremum = infimum
29 }
30
31 dualJoinSemilattice : JoinSemilattice c ℓ₁ ℓ₂
32 dualJoinSemilattice = record
33 { _∨_ = _∧_
34 ; isJoinSemilattice = dualIsJoinSemilattice
35 }
36
37 open J dualJoinSemilattice public
38 using (isAlgSemilattice; algSemilattice)
39 renaming
40 ( ∨-monotonic to ∧-monotonic
41 ; ∨-cong to ∧-cong
42 ; ∨-comm to ∧-comm
43 ; ∨-assoc to ∧-assoc
44 ; ∨-idempotent to ∧-idempotent
45 ; x≤y⇒x∨y≈y to y≤x⇒x∧y≈y
46 ; ≈-dec⇒≤-dec to ≈-dec⇒≥-dec
47 )
48
49 -- If ≈ is decidable then so is ≤
50
51 ≈-dec⇒≤-dec : Decidable _≈_ → Decidable _≤_
52 ≈-dec⇒≤-dec _≟_ = flip (≈-dec⇒≥-dec _≟_)
53
54 ≈-dec⇒isDecPartialOrder : Decidable _≈_ → IsDecPartialOrder _≈_ _≤_
55 ≈-dec⇒isDecPartialOrder _≟_ = record
56 { isPartialOrder = isPartialOrder
57 ; _≟_ = _≟_
58 ; _≤?_ = ≈-dec⇒≤-dec _≟_
59 }