Skip to content

Commit 18d99ef

Browse files
committed
comment: extensively on AbelianSubgroup
1 parent 4d72ed0 commit 18d99ef

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

src/Algebra/Construct/Sub/AbelianGroup.agda

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
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

1117
module 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+
1324
open import Algebra.Morphism.GroupMonomorphism using (isAbelianGroup)
1425

1526
private
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+
1834
open 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

3046
module _ {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

src/Algebra/Construct/Sub/Group/Normal.agda

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ record IsNormal {c′ ℓ′} (subgroup : Subgroup c′ ℓ′) : Set (c ⊔ ℓ
5757

5858
-- As with `Subgroup` itself, this domain `Carrier` type is canonically inferrable
5959
-- by the typechecker, as in the inline comment. But perhaps this use of `_` might
60-
-- also be usefully documented as `Function.Base.typeOf n`?
60+
-- also be usefully documented as `Function.Base.typeOf n`? Or is that itself too
61+
-- 'occult' a usage?
6162

6263
conjugate : n g _ -- where _ = RawGroup.Carrier (Subgroup.domain subgroup)
6364

@@ -68,7 +69,7 @@ record IsNormal {c′ ℓ′} (subgroup : Subgroup c′ ℓ′) : Set (c ⊔ ℓ
6869

6970
normal : n g ι (conjugate n g) G.∙ g G.≈ g G.∙ ι n
7071

71-
-- NormalSubgroup: a Subgroup which IsNormal (sic)
72+
-- NormalSubgroup: a Subgroup which IsNormal (sic).
7273

7374
record NormalSubgroup c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) where
7475
field
@@ -85,3 +86,12 @@ record NormalSubgroup c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) wh
8586

8687
open Subgroup subgroup public
8788
open IsNormal isNormal public
89+
90+
-- NB. Nowhere does this module define, nor need to, the lemma introduced in
91+
-- Taneb's original PR, viz. `abelian⇒subgroup-normal` of type
92+
-- `Commutative G._≈_ G._∙_ → (subgroup : Subgroup _ _) → IsNormal subgroup`.
93+
--
94+
-- This element of reasoning is itself handled by having a distinct module
95+
-- `Algebra.Construct.Sub.AbelianGroup` which encapsulates such reasoning
96+
-- within the scope of (an `Abelian`!)`Group` `G` in which the premise
97+
-- `Commutative G._≈_ G._∙_` is already known to hold.

0 commit comments

Comments
 (0)