Skip to content

Commit 5c64117

Browse files
authored
refactor: cosmetic improvement over #2546 (#2759)
1 parent 6f8af94 commit 5c64117

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ Additions to existing modules
201201
∙-congʳ : RightCongruent _≈_ _∙_
202202
```
203203

204+
* In `Algebra.Construct.Initial`:
205+
```agda
206+
assoc : Associative _≈_ _∙_
207+
idem : Idempotent _≈_ _∙_
208+
```
209+
204210
* In `Algebra.Construct.Pointwise`:
205211
```agda
206212
isNearSemiring : IsNearSemiring _≈_ _+_ _*_ 0# →

src/Algebra/Construct/Initial.agda

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ open import Algebra.Bundles
1919
open import Algebra.Bundles.Raw
2020
using (RawMagma)
2121
open import Algebra.Core using (Op₂)
22-
open import Algebra.Definitions using (Congruent₂)
22+
open import Algebra.Definitions using (Congruent₂; Associative; Idempotent)
2323
open import Algebra.Structures using (IsMagma; IsSemigroup; IsBand)
2424
open import Data.Empty.Polymorphic using (⊥)
2525
open import Relation.Binary.Core using (Rel)
@@ -63,6 +63,12 @@ module ℤero where
6363
∙-cong : Congruent₂ _≈_ _∙_
6464
∙-cong {x = ()}
6565

66+
assoc : Associative _≈_ _∙_
67+
assoc ()
68+
69+
idem : Idempotent _≈_ _∙_
70+
idem ()
71+
6672
open ℤero
6773

6874
------------------------------------------------------------------------
@@ -75,16 +81,16 @@ rawMagma = record { ℤero }
7581
-- Structures
7682

7783
isEquivalence : IsEquivalence _≈_
78-
isEquivalence = record { refl = refl; sym = sym; trans = λ {k = k} trans {k = k} }
84+
isEquivalence = record { refl = refl; sym = sym; trans = λ where {i = ()} }
7985

8086
isMagma : IsMagma _≈_ _∙_
81-
isMagma = record { isEquivalence = isEquivalence ; ∙-cong = λ {y = y} {u = u} {v = v} ∙-cong {y = y} {v = v} }
87+
isMagma = record { isEquivalence = isEquivalence ; ∙-cong = λ where {x = ()} }
8288

8389
isSemigroup : IsSemigroup _≈_ _∙_
84-
isSemigroup = record { isMagma = isMagma ; assoc = λ () }
90+
isSemigroup = record { isMagma = isMagma ; assoc = assoc }
8591

8692
isBand : IsBand _≈_ _∙_
87-
isBand = record { isSemigroup = isSemigroup ; idem = λ () }
93+
isBand = record { isSemigroup = isSemigroup ; idem = idem }
8894

8995
------------------------------------------------------------------------
9096
-- Bundles

0 commit comments

Comments
 (0)