-
Notifications
You must be signed in to change notification settings - Fork 260
Add subgroups and submodules #2852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- The Agda standard library | ||
| -- | ||
| -- Definition of subgroups | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| {-# OPTIONS --safe --cubical-compatible #-} | ||
|
|
||
| open import Algebra.Bundles using (Group; RawGroup) | ||
|
|
||
| module Algebra.Construct.Sub.Group {c ℓ} (G : Group c ℓ) where | ||
|
|
||
| private | ||
| module G = Group G | ||
|
|
||
| open import Algebra.Structures using (IsGroup) | ||
| open import Algebra.Morphism.Structures using (IsGroupMonomorphism) | ||
| import Algebra.Morphism.GroupMonomorphism as GroupMonomorphism | ||
| open import Level using (suc; _⊔_) | ||
|
|
||
| record Subgroup c′ ℓ′ : Set (c ⊔ ℓ ⊔ suc (c′ ⊔ ℓ′)) where | ||
| field | ||
| Sub : RawGroup c′ ℓ′ | ||
|
|
||
| private | ||
| module Sub = RawGroup Sub | ||
|
|
||
| field | ||
| ι : Sub.Carrier → G.Carrier | ||
| ι-monomorphism : IsGroupMonomorphism Sub G.rawGroup ι | ||
|
|
||
| module ι = IsGroupMonomorphism ι-monomorphism | ||
|
|
||
| isGroup : IsGroup Sub._≈_ Sub._∙_ Sub.ε Sub._⁻¹ | ||
| isGroup = GroupMonomorphism.isGroup ι-monomorphism G.isGroup | ||
|
|
||
| group : Group _ _ | ||
| group = record { isGroup = isGroup } | ||
|
|
||
| open Group group public hiding (isGroup) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| ------------------------------------------------------------------------ | ||
| -- The Agda standard library | ||
| -- | ||
| -- Definition of submodules | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| {-# OPTIONS --cubical-compatible --safe #-} | ||
|
|
||
| open import Algebra.Bundles using (CommutativeRing) | ||
| open import Algebra.Module.Bundles using (Module; RawModule) | ||
|
|
||
| module Algebra.Module.Construct.Sub.Module {c ℓ cm ℓm} {R : CommutativeRing c ℓ} (M : Module R cm ℓm) where | ||
|
||
|
|
||
| private | ||
| module R = CommutativeRing R | ||
| module M = Module M | ||
|
|
||
| open import Algebra.Construct.Sub.Group M.+ᴹ-group | ||
| open import Algebra.Module.Structures using (IsModule) | ||
| open import Algebra.Module.Morphism.Structures using (IsModuleMonomorphism) | ||
| import Algebra.Module.Morphism.ModuleMonomorphism as ModuleMonomorphism | ||
| open import Level using (suc; _⊔_) | ||
|
|
||
| record Submodule cm′ ℓm′ : Set (c ⊔ cm ⊔ ℓm ⊔ suc (cm′ ⊔ ℓm′)) where | ||
| field | ||
| Sub : RawModule R.Carrier cm′ ℓm′ | ||
|
||
|
|
||
| private | ||
| module Sub = RawModule Sub | ||
|
|
||
| field | ||
| ι : Sub.Carrierᴹ → M.Carrierᴹ | ||
| ι-monomorphism : IsModuleMonomorphism Sub M.rawModule ι | ||
|
|
||
| module ι = IsModuleMonomorphism ι-monomorphism | ||
|
|
||
| isModule : IsModule R Sub._≈ᴹ_ Sub._+ᴹ_ Sub.0ᴹ Sub.-ᴹ_ Sub._*ₗ_ Sub._*ᵣ_ | ||
| isModule = ModuleMonomorphism.isModule ι-monomorphism R.isCommutativeRing M.isModule | ||
|
|
||
| ⟨module⟩ : Module R _ _ | ||
| ⟨module⟩ = record { isModule = isModule } | ||
|
|
||
| open Module ⟨module⟩ public hiding (isModule) | ||
|
|
||
| subgroup : Subgroup cm′ ℓm′ | ||
| subgroup = record | ||
| { Sub = Sub.+ᴹ-rawGroup | ||
| ; ι = ι | ||
| ; ι-monomorphism = ι.+ᴹ-isGroupMonomorphism | ||
| } | ||
Taneb marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name
Algebra.Construct.Sub.*is fine, even good. I think the nameSubas a field name is not.group? Because it is a group, it has an independent existing as a group, and acquires a new one when inserted into this record.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm willing to change the name but I don't like the name
group- there's already another group lurking in the background and I'm worried they'll be confusedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. I'll try to come up with other suggestions. (I did not propose
rawgroupbecause I dislike that quite a bit myself.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking what I actually wrote, I use
groupfor the embellishment ofSubwith laws