From 08f3f4964014fca0a11902ac9b54f978c3634cd1 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 11 Feb 2024 20:56:21 -0800 Subject: [PATCH] Rename some definitions in Nat and expose bundle Signed-off-by: Danila Fedorin --- Lattice/Nat.agda | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Lattice/Nat.agda b/Lattice/Nat.agda index c3f760a..64f1247 100644 --- a/Lattice/Nat.agda +++ b/Lattice/Nat.agda @@ -18,8 +18,8 @@ private ≡-⊓-cong : ∀ {a₁ a₂ a₃ a₄} → a₁ ≡ a₂ → a₃ ≡ a₄ → (a₁ ⊓ a₃) ≡ (a₂ ⊓ a₄) ≡-⊓-cong a₁≡a₂ a₃≡a₄ rewrite a₁≡a₂ rewrite a₃≡a₄ = refl -NatIsMaxSemilattice : IsSemilattice ℕ _≡_ _⊔_ -NatIsMaxSemilattice = record +isMaxSemilattice : IsSemilattice ℕ _≡_ _⊔_ +isMaxSemilattice = record { ≈-equiv = record { ≈-refl = refl ; ≈-sym = sym @@ -31,8 +31,8 @@ NatIsMaxSemilattice = record ; ⊔-idemp = ⊔-idem } -NatIsMinSemilattice : IsSemilattice ℕ _≡_ _⊓_ -NatIsMinSemilattice = record +isMinSemilattice : IsSemilattice ℕ _≡_ _⊓_ +isMinSemilattice = record { ≈-equiv = record { ≈-refl = refl ; ≈-sym = sym @@ -74,10 +74,18 @@ private helper : x ⊔ (x ⊓ y) ≤ x ⊔ x → x ⊔ x ≡ x → x ⊔ (x ⊓ y) ≤ x helper x⊔x⊓y≤x⊔x x⊔x≡x rewrite x⊔x≡x = x⊔x⊓y≤x⊔x -NatIsLattice : IsLattice ℕ _≡_ _⊔_ _⊓_ -NatIsLattice = record - { joinSemilattice = NatIsMaxSemilattice - ; meetSemilattice = NatIsMinSemilattice +isLattice : IsLattice ℕ _≡_ _⊔_ _⊓_ +isLattice = record + { joinSemilattice = isMaxSemilattice + ; meetSemilattice = isMinSemilattice ; absorb-⊔-⊓ = λ x y → maxmin-absorb {x} {y} ; absorb-⊓-⊔ = λ x y → minmax-absorb {x} {y} } + +lattice : Lattice ℕ +lattice = record + { _≈_ = _≡_ + ; _⊔_ = _⊔_ + ; _⊓_ = _⊓_ + ; isLattice = isLattice + }