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