22-- The Agda standard library
33--
44-- Subgroups of Abelian groups: necessarily Normal
5+ --
6+ -- This is a strict addition/extension to Nathan van Doorn (Taneb)'s PR
7+ -- https://github.com/agda/agda-stdlib/pull/2852
8+ -- and avoids the lemma `Algebra.NormalSubgroup.abelian⇒subgroup-normal`
9+ -- introduced in PR https://github.com/agda/agda-stdlib/pull/2854
10+ -- in favour of the direct definition of the field `normal` below.
511------------------------------------------------------------------------
612
713{-# OPTIONS --safe --cubical-compatible #-}
@@ -10,11 +16,21 @@ open import Algebra.Bundles using (AbelianGroup)
1016
1117module Algebra.Construct.Sub.AbelianGroup {c ℓ} (G : AbelianGroup c ℓ) where
1218
19+ -- As with the corresponding appeal to `IsGroup` in the module
20+ -- `Algebra.Construct.Sub.AbelianGroup`, this import drives the export
21+ -- of the `X` bundle corresponding to the `subX` structure/bundle
22+ -- being defined here.
23+
1324open import Algebra.Morphism.GroupMonomorphism using (isAbelianGroup)
1425
1526private
1627 module G = AbelianGroup G
1728
29+ -- Here, we could chose simply to expose the `NormalSubgroup` definition
30+ -- from `Algebra.Construct.Sub.Group.Normal`, but as this module will use
31+ -- type inference to allow the creation of `NormalSubgroup`s based on their
32+ -- `isNormal` fields alone, it makes sense also to export the type `IsNormal`.
33+
1834open import Algebra.Construct.Sub.Group.Normal G.group
1935 using (IsNormal; NormalSubgroup)
2036
@@ -24,25 +40,39 @@ open import Algebra.Construct.Sub.Group G.group public
2440 using (Subgroup)
2541
2642-- Then, for any such Subgroup:
27- -- * it defines an AbelianGroup
28- -- * and is, in fact, Normal
43+ -- * it is, in fact, Normal
44+ -- * and defines an AbelianGroup, not just a Group
2945
3046module _ {c′ ℓ′} (subgroup : Subgroup c′ ℓ′) where
3147
48+ -- Here, we do need both the underlying function `ι` of the mono, and
49+ -- the proof `ι-monomorphism`, in order to be able to construct an
50+ -- `IsAbelianGroup` structure on the way to the `AbelianGroup` bundle.
51+
3252 open Subgroup subgroup public
3353 using (ι; ι-monomorphism)
3454
35- abelianGroup : AbelianGroup c′ ℓ′
36- abelianGroup = record
37- { isAbelianGroup = isAbelianGroup ι-monomorphism G.isAbelianGroup }
38-
39- open AbelianGroup abelianGroup public
55+ -- Here, we eta-contract the use of `G.comm` in defining the `normal` field.
4056
4157 isNormal : IsNormal subgroup
4258 isNormal = record { normal = λ n → G.comm (ι n) }
4359
60+ -- And the use of `record`s throughout permits this 'boilerplate' construction.
61+
4462 normalSubgroup : NormalSubgroup c′ ℓ′
4563 normalSubgroup = record { isNormal = isNormal }
4664
65+ -- And the `public` re-export of its substructure.
66+
4767 open NormalSubgroup normalSubgroup public
4868 using (conjugate; normal)
69+
70+ -- As with `Algebra.Construct.Sub.Group`, there seems no need to create
71+ -- an intermediate manifest field `isAbelianGroup`, when this may be, and
72+ -- is, obtained by opening the bundle for `public` export.
73+
74+ abelianGroup : AbelianGroup c′ ℓ′
75+ abelianGroup = record
76+ { isAbelianGroup = isAbelianGroup ι-monomorphism G.isAbelianGroup }
77+
78+ open AbelianGroup abelianGroup public
0 commit comments