Skip to content

Commit 561308e

Browse files
committed
move maxLUB and minGLB to Data.Nat.Order, remove unnecessary imports
1 parent 4a415d5 commit 561308e

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

Cubical/Data/Nat/Order.agda

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,20 @@ min-≤-right {zero} {n} = zero-≤
277277
min-≤-right {suc m} {zero} = ≤-refl
278278
min-≤-right {suc m} {suc n} = subst (_≤ _) (sym minSuc) $ suc-≤-suc $ min-≤-right {m} {n}
279279

280+
maxLUB : {x} m ≤ x n ≤ x max m n ≤ x
281+
maxLUB {zero} {n} _ n≤x = n≤x
282+
maxLUB {suc m} {zero} sm≤x _ = sm≤x
283+
maxLUB {suc m} {suc n} sm≤x sn≤x with m <ᵇ n
284+
... | false = sm≤x
285+
... | true = sn≤x
286+
287+
minGLB : {x} x ≤ m x ≤ n x ≤ min m n
288+
minGLB {zero} {n} x≤0 _ = x≤0
289+
minGLB {suc m} {zero} _ x≤0 = x≤0
290+
minGLB {suc m} {suc n} x≤sm x≤sn with m <ᵇ n
291+
... | false = x≤sn
292+
... | true = x≤sm
293+
280294
-- Boolean order relations and their conversions to/from ≤ and <
281295

282296
_≤ᵇ_ : Bool

Cubical/Relation/Binary/Order/Pseudolattice/Instances/Int.agda

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ open import Cubical.Data.Int.Order renaming (_≤_ to _≤ℤ_)
88
open import Cubical.Relation.Binary.Order.Poset.Instances.Int
99
open import Cubical.Relation.Binary.Order.Pseudolattice
1010

11-
open PseudolatticeStr
12-
1311
ℤ≤Pseudolattice : Pseudolattice ℓ-zero ℓ-zero
1412
ℤ≤Pseudolattice = makePseudolatticeFromPoset ℤ≤Poset min max
1513
min≤

Cubical/Relation/Binary/Order/Pseudolattice/Instances/Nat.agda

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,12 @@ module Cubical.Relation.Binary.Order.Pseudolattice.Instances.Nat where
22

33
open import Cubical.Foundations.Prelude
44

5-
open import Cubical.Data.Bool.Base
6-
75
open import Cubical.Data.Nat
86
open import Cubical.Data.Nat.Order renaming (_≤_ to _≤ℕ_)
97

108
open import Cubical.Relation.Binary.Order.Poset.Instances.Nat
119
open import Cubical.Relation.Binary.Order.Pseudolattice
1210

13-
open PseudolatticeStr
14-
15-
private
16-
minGLB : {m n x} x ≤ℕ m x ≤ℕ n x ≤ℕ min m n
17-
minGLB {zero} {n} x≤0 _ = x≤0
18-
minGLB {suc m} {zero} _ x≤0 = x≤0
19-
minGLB {suc m} {suc n} x≤sm x≤sn with m <ᵇ n
20-
... | false = x≤sn
21-
... | true = x≤sm
22-
23-
maxLUB : {m n x} m ≤ℕ x n ≤ℕ x max m n ≤ℕ x
24-
maxLUB {zero} {n} _ n≤x = n≤x
25-
maxLUB {suc m} {zero} sm≤x _ = sm≤x
26-
maxLUB {suc m} {suc n} sm≤x sn≤x with m <ᵇ n
27-
... | false = sm≤x
28-
... | true = sn≤x
29-
3011
ℕ≤Pseudolattice : Pseudolattice ℓ-zero ℓ-zero
3112
ℕ≤Pseudolattice = makePseudolatticeFromPoset ℕ≤Poset min max
3213
min-≤-left

0 commit comments

Comments
 (0)