|
| 1 | +------------------------------------------------------------------------ |
| 2 | +-- The Agda standard library |
| 3 | +-- |
| 4 | +-- `Pointed` intermediate between `Monoid` and `SemiringWithoutAnnihilatingZero` |
| 5 | +------------------------------------------------------------------------ |
| 6 | + |
| 7 | +{-# OPTIONS --cubical-compatible --safe #-} |
| 8 | + |
| 9 | +open import Algebra.Bundles |
| 10 | +open import Algebra.Bundles.Raw |
| 11 | +open import Algebra.Core |
| 12 | +open import Algebra.Structures.Pointed as Pointed using (IsPointedMonoid) |
| 13 | +import Algebra.Properties.Monoid.Mult as Mult |
| 14 | +open import Data.Nat.Base as ℕ using (ℕ) |
| 15 | +open import Data.Unit.Base |
| 16 | +open import Level using (Level; suc; _⊔_; Lift) |
| 17 | +open import Relation.Binary.Core using (Rel) |
| 18 | + |
| 19 | +module Algebra.Bundles.Pointed where |
| 20 | + |
| 21 | +private |
| 22 | + variable |
| 23 | + c ℓ : Level |
| 24 | + |
| 25 | +------------------------------------------------------------------------ |
| 26 | +-- Bundles with 1 binary operation & 2 elements |
| 27 | +------------------------------------------------------------------------ |
| 28 | + |
| 29 | +record PointedMonoid c ℓ : Set (suc (c ⊔ ℓ)) where |
| 30 | + field |
| 31 | + rawMonoid : RawMonoid c ℓ |
| 32 | + open RawMonoid rawMonoid using (Carrier) |
| 33 | + field |
| 34 | + • : Carrier |
| 35 | + isPointedMonoid : IsPointedMonoid rawMonoid • |
| 36 | + |
| 37 | + open IsPointedMonoid isPointedMonoid public |
| 38 | + |
| 39 | +------------------------------------------------------------------------ |
| 40 | +-- instance from any SemiringWithoutAnnihilatingZero |
| 41 | + |
| 42 | +pointedMonoid : SemiringWithoutAnnihilatingZero c ℓ → PointedMonoid c ℓ |
| 43 | +pointedMonoid semiringWithoutAnnihilatingZero |
| 44 | + = record { isPointedMonoid = isPointedMonoid } |
| 45 | + where |
| 46 | + open SemiringWithoutAnnihilatingZero semiringWithoutAnnihilatingZero |
| 47 | + using (1#; +-rawMonoid; +-isMonoid) |
| 48 | + isPointedMonoid : IsPointedMonoid +-rawMonoid 1# |
| 49 | + isPointedMonoid = record { isMonoid = +-isMonoid } |
| 50 | + |
0 commit comments