Debian Codegraph @

src/Algebra/Morphism/Construct/Initial.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- The unique morphism from the initial object,
5 -- for each of the relevant categories. Since
6 -- `Semigroup` and `Band` are simply `Magma`s
7 -- satisfying additional properties, it suffices to
8 -- define the morphism on the underlying `RawMagma`.
9 ------------------------------------------------------------------------
10
11 {-# OPTIONS --cubical-compatible --safe #-}
12
13 open import Level using (Level)
14
15 module Algebra.Morphism.Construct.Initial {c ℓ : Level} where
16
17 open import Algebra.Bundles.Raw using (RawMagma)
18 open import Algebra.Morphism.Structures
19 using (IsMagmaHomomorphism; IsMagmaMonomorphism)
20 open import Function.Definitions using (Injective)
21 import Relation.Binary.Morphism.Definitions as Rel
22 open import Relation.Binary.Core using (Rel)
23
24 open import Algebra.Construct.Initial {c} {ℓ}
25
26 private
27 variable
28 a m ℓm : Level
29 A : Set a
30 ≈ : Rel A ℓm
31
32 ------------------------------------------------------------------------
33 -- The unique morphism
34
35 zero : ℤero.Carrier → A
36 zero ()
37
38 ------------------------------------------------------------------------
39 -- Basic properties
40
41 cong : (≈ : Rel A ℓm) → Rel.Homomorphic₂ ℤero.Carrier A ℤero._≈_ ≈ zero
42 cong _ {x = ()}
43
44 injective : (≈ : Rel A ℓm) → Injective ℤero._≈_ ≈ zero
45 injective _ {x = ()}
46
47 ------------------------------------------------------------------------
48 -- Morphism structures
49
50 isMagmaHomomorphism : (M : RawMagma m ℓm) →
51 IsMagmaHomomorphism rawMagma M zero
52 isMagmaHomomorphism M = record
53 { isRelHomomorphism = record { cong = cong (RawMagma._≈_ M) }
54 ; homo = λ()
55 }
56
57 isMagmaMonomorphism : (M : RawMagma m ℓm) →
58 IsMagmaMonomorphism rawMagma M zero
59 isMagmaMonomorphism M = record
60 { isMagmaHomomorphism = isMagmaHomomorphism M
61 ; injective = injective (RawMagma._≈_ M)
62 }