Skip to content
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

Consequences of module monomorphisms #2276

Merged
merged 24 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
05dbfcc
First shot at left semimodule monomorphism consequences
Taneb Feb 3, 2024
0d8421b
Weaken arguments of properties
Taneb Feb 3, 2024
51938b2
Remember I made a variable declaration for this
Taneb Feb 3, 2024
f59ce63
Left module monomorphisms
Taneb Feb 3, 2024
1c02b7c
Attempt using qualified names rather than renaming
Taneb Feb 13, 2024
bc5ee42
Mark modules as private
Taneb Feb 13, 2024
9db52ac
Typo
Taneb Jun 8, 2024
b2ea2d9
These modules should be private
Taneb Jun 8, 2024
1a3107b
Monomorphisms over right semimodules
Taneb Jun 9, 2024
169e3ae
Monomorphisms over right modules
Taneb Jun 9, 2024
5350002
Add properties of bisemimodule monomorphisms
Taneb Jun 9, 2024
9edd034
Make these modules private
Taneb Jun 9, 2024
5f72cb5
Properties of bimodule monomorphisms
Taneb Jun 9, 2024
9fe0efd
Properties of semimodule monomorphisms
Taneb Jun 9, 2024
ef48161
Move modules to the right location
Taneb Jun 9, 2024
b58ecd8
Add missing options
Taneb Jun 9, 2024
bbac769
Properties of module monomorphisms
Taneb Jun 9, 2024
1d0f482
Fix somewhitespace
Taneb Jun 9, 2024
c18b715
Merge remote-tracking branch 'origin/master' into modules-monomorphis…
Taneb Jun 9, 2024
ae20eac
Use IsMagma rather than IsMonoid in several places
Taneb Jun 9, 2024
be46a21
Spell re-exports consistently
Taneb Jun 9, 2024
5fe2637
Use modules to make type signatures of structures clearer
Taneb Jun 17, 2024
f57cbbd
[ changelog ] listing the new modules
gallais Dec 6, 2024
655e5eb
Merge branch 'master' into modules-monomorphism-properties
gallais Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ New modules
Algebra.Properties.IdempotentCommutativeMonoid
```

* Consequences of module monomorphisms
```agda
Algebra.Module.Morphism.BimoduleMonomorphism
Algebra.Module.Morphism.BisemimoduleMonomorphism
Algebra.Module.Morphism.LeftModuleMonomorphism
Algebra.Module.Morphism.LeftSemimoduleMonomorphism
Algebra.Module.Morphism.ModuleMonomorphism
Algebra.Module.Morphism.RightModuleMonomorphism
Algebra.Module.Morphism.RightSemimoduleMonomorphism
Algebra.Module.Morphism.SemimoduleMonomorphism
```

* Refactoring of the `Algebra.Solver.*Monoid` implementations, via
a single `Solver` module API based on the existing `Expr`, and
a common `Normal`-form API:
Expand Down
73 changes: 73 additions & 0 deletions src/Algebra/Module/Morphism/BimoduleMonomorphism.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of a monomorphism between bimodules
------------------------------------------------------------------------

{-# OPTIONS --safe --cubical-compatible #-}

open import Algebra.Module.Bundles.Raw
open import Algebra.Module.Morphism.Structures

module Algebra.Module.Morphism.BimoduleMonomorphism
{r s a b ℓ₁ ℓ₂} {R : Set r} {S : Set s} {M : RawBimodule R S a ℓ₁} {N : RawBimodule R S b ℓ₂} {⟦_⟧}
(isBimoduleMonomorphism : IsBimoduleMonomorphism M N ⟦_⟧)
where

open IsBimoduleMonomorphism isBimoduleMonomorphism
private
module M = RawBimodule M
module N = RawBimodule N

open import Algebra.Bundles
open import Algebra.Core
open import Algebra.Module.Structures
open import Algebra.Structures
open import Relation.Binary.Core

------------------------------------------------------------------------
-- Re-exports

open import Algebra.Morphism.GroupMonomorphism +ᴹ-isGroupMonomorphism public
using () renaming
( inverseˡ to -ᴹ‿inverseˡ
; inverseʳ to -ᴹ‿inverseʳ
; inverse to -ᴹ‿inverse
; ⁻¹-cong to -ᴹ‿cong
; ⁻¹-distrib-∙ to -ᴹ‿distrib-+ᴹ
; isGroup to +ᴹ-isGroup
; isAbelianGroup to +ᴹ-isAbelianGroup
)
open import Algebra.Module.Morphism.BisemimoduleMonomorphism isBisemimoduleMonomorphism public

------------------------------------------------------------------------
-- Structures

module _
{ℓr} {_≈r_ : Rel R ℓr} {_+r_ _*r_ -r_ 0r 1r}
{ℓs} {_≈s_ : Rel S ℓs} {_+s_ _*s_ -s_ 0s 1s}
(R-isRing : IsRing _≈r_ _+r_ _*r_ -r_ 0r 1r)
(S-isRing : IsRing _≈s_ _+s_ _*s_ -s_ 0s 1s)
where

private
R-ring : Ring _ _
R-ring = record { isRing = R-isRing }

S-ring : Ring _ _
S-ring = record { isRing = S-isRing }

module R = IsRing R-isRing
module S = IsRing S-isRing
jamesmckinna marked this conversation as resolved.
Show resolved Hide resolved

isBimodule
: IsBimodule R-ring S-ring N._≈ᴹ_ N._+ᴹ_ N.0ᴹ N.-ᴹ_ N._*ₗ_ N._*ᵣ_
→ IsBimodule R-ring S-ring M._≈ᴹ_ M._+ᴹ_ M.0ᴹ M.-ᴹ_ M._*ₗ_ M._*ᵣ_
jamesmckinna marked this conversation as resolved.
Show resolved Hide resolved
isBimodule isBimodule = record
{ isBisemimodule = isBisemimodule R.isSemiring S.isSemiring NN.isBisemimodule
; -ᴹ‿cong = -ᴹ‿cong NN.+ᴹ-isMagma NN.-ᴹ‿cong
; -ᴹ‿inverse = -ᴹ‿inverse NN.+ᴹ-isMagma NN.-ᴹ‿inverse
}
where
module NN = IsBimodule isBimodule

149 changes: 149 additions & 0 deletions src/Algebra/Module/Morphism/BisemimoduleMonomorphism.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Consequences of a monomorphism between bisemimodules
------------------------------------------------------------------------

{-# OPTIONS --safe --cubical-compatible #-}

open import Algebra.Module.Bundles.Raw
open import Algebra.Module.Morphism.Structures

module Algebra.Module.Morphism.BisemimoduleMonomorphism
{r s a b ℓ₁ ℓ₂} {R : Set r} {S : Set s} {M : RawBisemimodule R S a ℓ₁} {N : RawBisemimodule R S b ℓ₂} {⟦_⟧}
(isBisemimoduleMonomorphism : IsBisemimoduleMonomorphism M N ⟦_⟧)
where

open IsBisemimoduleMonomorphism isBisemimoduleMonomorphism
private
module M = RawBisemimodule M
module N = RawBisemimodule N

open import Algebra.Bundles
open import Algebra.Core
import Algebra.Module.Definitions.Bi as BiDefs
import Algebra.Module.Definitions.Left as LeftDefs
import Algebra.Module.Definitions.Right as RightDefs
open import Algebra.Module.Structures
open import Algebra.Structures
open import Function.Base
open import Relation.Binary.Core
import Relation.Binary.Reasoning.Setoid as SetoidReasoning

------------------------------------------------------------------------
-- Re-exports

open import Algebra.Morphism.MonoidMonomorphism
+ᴹ-isMonoidMonomorphism public
using ()
renaming
( cong to +ᴹ-cong
; assoc to +ᴹ-assoc
; comm to +ᴹ-comm
; identityˡ to +ᴹ-identityˡ
; identityʳ to +ᴹ-identityʳ
; identity to +ᴹ-identity
; isMagma to +ᴹ-isMagma
; isSemigroup to +ᴹ-isSemigroup
; isMonoid to +ᴹ-isMonoid
; isCommutativeMonoid to +ᴹ-isCommutativeMonoid
)

open import Algebra.Module.Morphism.LeftSemimoduleMonomorphism
isLeftSemimoduleMonomorphism public
using
( *ₗ-cong
; *ₗ-zeroˡ
; *ₗ-distribʳ
; *ₗ-identityˡ
; *ₗ-assoc
; *ₗ-zeroʳ
; *ₗ-distribˡ
; isLeftSemimodule
)

open import Algebra.Module.Morphism.RightSemimoduleMonomorphism
isRightSemimoduleMonomorphism public
using
( *ᵣ-cong
; *ᵣ-zeroʳ
; *ᵣ-distribˡ
; *ᵣ-identityʳ
; *ᵣ-assoc
; *ᵣ-zeroˡ
; *ᵣ-distribʳ
; isRightSemimodule
)

------------------------------------------------------------------------
-- Properties

module _ (+ᴹ-isMagma : IsMagma N._≈ᴹ_ N._+ᴹ_) where

open IsMagma +ᴹ-isMagma
using (setoid)
renaming (∙-cong to +ᴹ-cong)
open SetoidReasoning setoid

private
module MDefs = BiDefs R S M._≈ᴹ_
module NDefs = BiDefs R S N._≈ᴹ_
module LDefs = LeftDefs R N._≈ᴹ_
module RDefs = RightDefs S N._≈ᴹ_

*ₗ-*ᵣ-assoc
: LDefs.LeftCongruent N._*ₗ_ → RDefs.RightCongruent N._*ᵣ_
→ NDefs.Associative N._*ₗ_ N._*ᵣ_
→ MDefs.Associative M._*ₗ_ M._*ᵣ_
*ₗ-*ᵣ-assoc *ₗ-congˡ *ᵣ-congʳ *ₗ-*ᵣ-assoc x m y = injective $ begin
⟦ (x M.*ₗ m) M.*ᵣ y ⟧ ≈⟨ *ᵣ-homo y (x M.*ₗ m) ⟩
⟦ x M.*ₗ m ⟧ N.*ᵣ y ≈⟨ *ᵣ-congʳ (*ₗ-homo x m) ⟩
(x N.*ₗ ⟦ m ⟧) N.*ᵣ y ≈⟨ *ₗ-*ᵣ-assoc x ⟦ m ⟧ y ⟩
x N.*ₗ (⟦ m ⟧ N.*ᵣ y) ≈˘⟨ *ₗ-congˡ (*ᵣ-homo y m) ⟩
x N.*ₗ ⟦ m M.*ᵣ y ⟧ ≈˘⟨ *ₗ-homo x (m M.*ᵣ y) ⟩
⟦ x M.*ₗ (m M.*ᵣ y) ⟧ ∎

------------------------------------------------------------------------
-- Structures

module _
{ℓr} {_≈r_ : Rel R ℓr} {_+r_ _*r_ 0r 1r}
{ℓs} {_≈s_ : Rel S ℓs} {_+s_ _*s_ 0s 1s}
(R-isSemiring : IsSemiring _≈r_ _+r_ _*r_ 0r 1r)
(S-isSemiring : IsSemiring _≈s_ _+s_ _*s_ 0s 1s)
where

private
R-semiring : Semiring _ _
R-semiring = record { isSemiring = R-isSemiring }

S-semiring : Semiring _ _
S-semiring = record { isSemiring = S-isSemiring }

isBisemimodule
: IsBisemimodule R-semiring S-semiring N._≈ᴹ_ N._+ᴹ_ N.0ᴹ N._*ₗ_ N._*ᵣ_
→ IsBisemimodule R-semiring S-semiring M._≈ᴹ_ M._+ᴹ_ M.0ᴹ M._*ₗ_ M._*ᵣ_
isBisemimodule isBisemimodule = record
{ +ᴹ-isCommutativeMonoid = +ᴹ-isCommutativeMonoid NN.+ᴹ-isCommutativeMonoid
; isPreleftSemimodule = record
{ *ₗ-cong = *ₗ-cong NN.+ᴹ-isMagma NN.*ₗ-cong
; *ₗ-zeroˡ = *ₗ-zeroˡ NN.+ᴹ-isMagma NN.*ₗ-zeroˡ
; *ₗ-distribʳ = *ₗ-distribʳ NN.+ᴹ-isMagma NN.*ₗ-distribʳ
; *ₗ-identityˡ = *ₗ-identityˡ NN.+ᴹ-isMagma NN.*ₗ-identityˡ
; *ₗ-assoc = *ₗ-assoc NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-assoc
; *ₗ-zeroʳ = *ₗ-zeroʳ NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-zeroʳ
; *ₗ-distribˡ = *ₗ-distribˡ NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-distribˡ
}
; isPrerightSemimodule = record
{ *ᵣ-cong = *ᵣ-cong NN.+ᴹ-isMagma NN.*ᵣ-cong
; *ᵣ-zeroʳ = *ᵣ-zeroʳ NN.+ᴹ-isMagma NN.*ᵣ-zeroʳ
; *ᵣ-distribˡ = *ᵣ-distribˡ NN.+ᴹ-isMagma NN.*ᵣ-distribˡ
; *ᵣ-identityʳ = *ᵣ-identityʳ NN.+ᴹ-isMagma NN.*ᵣ-identityʳ
; *ᵣ-assoc = *ᵣ-assoc NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-assoc
; *ᵣ-zeroˡ = *ᵣ-zeroˡ NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-zeroˡ
; *ᵣ-distribʳ = *ᵣ-distribʳ NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-distribʳ
}
; *ₗ-*ᵣ-assoc = *ₗ-*ᵣ-assoc NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ᵣ-congʳ NN.*ₗ-*ᵣ-assoc
}
where
module NN = IsBisemimodule isBisemimodule
62 changes: 62 additions & 0 deletions src/Algebra/Module/Morphism/LeftModuleMonomorphism.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Consequences of a monomorphism between left modules
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

open import Algebra.Module.Bundles.Raw
open import Algebra.Module.Morphism.Structures

module Algebra.Module.Morphism.LeftModuleMonomorphism
{r a b ℓ₁ ℓ₂} {R : Set r} {M : RawLeftModule R a ℓ₁} {N : RawLeftModule R b ℓ₂} {⟦_⟧}
(isLeftModuleMonomorphism : IsLeftModuleMonomorphism M N ⟦_⟧)
where

open IsLeftModuleMonomorphism isLeftModuleMonomorphism
private
module M = RawLeftModule M
module N = RawLeftModule N

open import Algebra.Bundles
open import Algebra.Core
open import Algebra.Module.Structures
open import Algebra.Structures
open import Relation.Binary.Core

------------------------------------------------------------------------
-- Re-exports

open import Algebra.Morphism.GroupMonomorphism +ᴹ-isGroupMonomorphism public
using () renaming
( inverseˡ to -ᴹ‿inverseˡ
; inverseʳ to -ᴹ‿inverseʳ
; inverse to -ᴹ‿inverse
; ⁻¹-cong to -ᴹ‿cong
; ⁻¹-distrib-∙ to -ᴹ‿distrib-+ᴹ
; isGroup to +ᴹ-isGroup
; isAbelianGroup to +ᴹ-isAbelianGroup
)
open import Algebra.Module.Morphism.LeftSemimoduleMonomorphism isLeftSemimoduleMonomorphism public

------------------------------------------------------------------------
-- Structures

module _ {ℓr} {_≈_ : Rel R ℓr} {_+_ _*_ -_ 0# 1#} (R-isRing : IsRing _≈_ _+_ _*_ -_ 0# 1#) where

private
R-ring : Ring _ _
R-ring = record { isRing = R-isRing }
open IsRing R-isRing
jamesmckinna marked this conversation as resolved.
Show resolved Hide resolved

isLeftModule
: IsLeftModule R-ring N._≈ᴹ_ N._+ᴹ_ N.0ᴹ N.-ᴹ_ N._*ₗ_
→ IsLeftModule R-ring M._≈ᴹ_ M._+ᴹ_ M.0ᴹ M.-ᴹ_ M._*ₗ_
isLeftModule isLeftModule = record
{ isLeftSemimodule = isLeftSemimodule isSemiring NN.isLeftSemimodule
jamesmckinna marked this conversation as resolved.
Show resolved Hide resolved
; -ᴹ‿cong = -ᴹ‿cong NN.+ᴹ-isMagma NN.-ᴹ‿cong
; -ᴹ‿inverse = -ᴹ‿inverse NN.+ᴹ-isMagma NN.-ᴹ‿inverse
}
where
module NN = IsLeftModule isLeftModule
Loading
Loading