Debian Codegraph @

src/Algebra/Construct/NaturalChoice/MaxOp.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties of a max operator derived from a spec over a total
5 -- preorder.
6 ------------------------------------------------------------------------
7
8 {-# OPTIONS --cubical-compatible --safe #-}
9
10 open import Algebra.Construct.NaturalChoice.Base using (MaxOperator; MaxOp⇒MinOp)
11 open import Relation.Binary.Bundles using (TotalPreorder)
12
13 module Algebra.Construct.NaturalChoice.MaxOp
14 {a ℓ₁ ℓ₂} {O : TotalPreorder a ℓ₁ ℓ₂} (maxOp : MaxOperator O)
15 where
16
17 import Algebra.Construct.NaturalChoice.MinOp as MinOp
18 open import Algebra.Core using (Op₂)
19 open import Function.Base using (flip)
20 open MaxOperator maxOp
21 open import Relation.Binary.Core using (_Preserves_⟶_)
22 open import Relation.Binary.Construct.Flip.EqAndOrd using ()
23 renaming (totalPreorder to flipOrder)
24 open TotalPreorder O renaming (Carrier to A; _≲_ to _≤_)
25
26 -- Max is just min with a flipped order
27
28 private
29 module Min = MinOp (MaxOp⇒MinOp maxOp)
30
31 open Min public
32 using ()
33 renaming
34 ( ⊓-cong to ⊔-cong
35 ; ⊓-congʳ to ⊔-congʳ
36 ; ⊓-congˡ to ⊔-congˡ
37 ; ⊓-idem to ⊔-idem
38 ; ⊓-sel to ⊔-sel
39 ; ⊓-assoc to ⊔-assoc
40 ; ⊓-comm to ⊔-comm
41
42 ; ⊓-identityˡ to ⊔-identityˡ
43 ; ⊓-identityʳ to ⊔-identityʳ
44 ; ⊓-identity to ⊔-identity
45 ; ⊓-zeroˡ to ⊔-zeroˡ
46 ; ⊓-zeroʳ to ⊔-zeroʳ
47 ; ⊓-zero to ⊔-zero
48
49 ; ⊓-isMagma to ⊔-isMagma
50 ; ⊓-isSemigroup to ⊔-isSemigroup
51 ; ⊓-isCommutativeSemigroup to ⊔-isCommutativeSemigroup
52 ; ⊓-isBand to ⊔-isBand
53 ; ⊓-isMonoid to ⊔-isMonoid
54 ; ⊓-isSelectiveMagma to ⊔-isSelectiveMagma
55
56 ; ⊓-magma to ⊔-magma
57 ; ⊓-semigroup to ⊔-semigroup
58 ; ⊓-commutativeSemigroup to ⊔-commutativeSemigroup
59 ; ⊓-band to ⊔-band
60 ; ⊓-monoid to ⊔-monoid
61 ; ⊓-selectiveMagma to ⊔-selectiveMagma
62
63 ; x⊓y≈y⇒y≤x to x⊔y≈y⇒x≤y
64 ; x⊓y≈x⇒x≤y to x⊔y≈x⇒y≤x
65 ; x⊓y≤x to x≤x⊔y
66 ; x⊓y≤y to x≤y⊔x
67 ; x≤y⇒x⊓z≤y to x≤y⇒x≤y⊔z
68 ; x≤y⇒z⊓x≤y to x≤y⇒x≤z⊔y
69 ; x≤y⊓z⇒x≤y to x⊔y≤z⇒x≤z
70 ; x≤y⊓z⇒x≤z to x⊔y≤z⇒y≤z
71
72 ; ⊓-glb to ⊔-lub
73 ; ⊓-triangulate to ⊔-triangulate
74 ; ⊓-mono-≤ to ⊔-mono-≤
75 ; ⊓-monoˡ-≤ to ⊔-monoˡ-≤
76 ; ⊓-monoʳ-≤ to ⊔-monoʳ-≤
77 )
78
79 mono-≤-distrib-⊔ : ∀ {f} → f Preserves _≈_ ⟶ _≈_ → f Preserves _≤_ ⟶ _≤_ →
80 ∀ x y → f (x ⊔ y) ≈ f x ⊔ f y
81 mono-≤-distrib-⊔ cong pres = Min.mono-≤-distrib-⊓ cong pres