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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Monomorphisms over right semimodules
Taneb committed Jun 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 1a3107b4a40cdf33df57fb0620538dccd07b380d
139 changes: 139 additions & 0 deletions src/Algebra/Module/Morphism/RightSemimoduleMonomorphism.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Consequences of a monomomorphism between right semimodules
------------------------------------------------------------------------

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

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

module Algebra.Module.Morphism.RightSemimoduleMonomorphism
{r a b ℓ₁ ℓ₂} {R : Set r} {M : RawRightSemimodule R a ℓ₁} {N : RawRightSemimodule R b ℓ₂} {⟦_⟧}
(isRightSemimoduleMonomorphism : IsRightSemimoduleMonomorphism M N ⟦_⟧)
where

open IsRightSemimoduleMonomorphism isRightSemimoduleMonomorphism
private
module M = RawRightSemimodule M
module N = RawRightSemimodule N

open import Algebra.Core
import Algebra.Module.Definitions.Right as RightDefs
open import Algebra.Module.Structures
open import Algebra.Structures
open import Function.Base
open import Level
open import Relation.Binary.Core
import Relation.Binary.Reasoning.Setoid as SetoidReasoning

private
variable
ℓr : Level
_≈_ : Rel R ℓr
_+_ _*_ : Op₂ R
0# 1# : R

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
)

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

module _ (+ᴹ-isMonoid : IsMonoid N._≈ᴹ_ N._+ᴹ_ N.0ᴹ) where

open IsMonoid +ᴹ-isMonoid
using (setoid)
renaming (∙-cong to +ᴹ-cong′)
open SetoidReasoning setoid

module MDefs = RightDefs R M._≈ᴹ_
module NDefs = RightDefs R N._≈ᴹ_

*ᵣ-cong : NDefs.Congruent _≈_ N._*ᵣ_ → MDefs.Congruent _≈_ M._*ᵣ_
*ᵣ-cong *ᵣ-cong {x} {y} {u} {v} x≈ᴹy u≈v = injective $ begin
⟦ x M.*ᵣ u ⟧ ≈⟨ *ᵣ-homo u x ⟩
⟦ x ⟧ N.*ᵣ u ≈⟨ *ᵣ-cong (⟦⟧-cong x≈ᴹy) u≈v ⟩
⟦ y ⟧ N.*ᵣ v ≈˘⟨ *ᵣ-homo v y ⟩
⟦ y M.*ᵣ v ⟧ ∎

*ᵣ-zeroʳ : NDefs.RightZero 0# N.0ᴹ N._*ᵣ_ → MDefs.RightZero 0# M.0ᴹ M._*ᵣ_
*ᵣ-zeroʳ {0# = 0#} *ᵣ-zeroʳ x = injective $ begin
⟦ x M.*ᵣ 0# ⟧ ≈⟨ *ᵣ-homo 0# x ⟩
⟦ x ⟧ N.*ᵣ 0# ≈⟨ *ᵣ-zeroʳ ⟦ x ⟧ ⟩
N.0ᴹ ≈˘⟨ 0ᴹ-homo ⟩
⟦ M.0ᴹ ⟧ ∎

*ᵣ-distribˡ : N._*ᵣ_ NDefs.DistributesOverˡ _+_ ⟶ N._+ᴹ_ → M._*ᵣ_ MDefs.DistributesOverˡ _+_ ⟶ M._+ᴹ_
*ᵣ-distribˡ {_+_ = _+_} *ᵣ-distribˡ x m n = injective $ begin
⟦ x M.*ᵣ (m + n) ⟧ ≈⟨ *ᵣ-homo (m + n) x ⟩
⟦ x ⟧ N.*ᵣ (m + n) ≈⟨ *ᵣ-distribˡ ⟦ x ⟧ m n ⟩
⟦ x ⟧ N.*ᵣ m N.+ᴹ ⟦ x ⟧ N.*ᵣ n ≈˘⟨ +ᴹ-cong′ (*ᵣ-homo m x) (*ᵣ-homo n x) ⟩
⟦ x M.*ᵣ m ⟧ N.+ᴹ ⟦ x M.*ᵣ n ⟧ ≈˘⟨ +ᴹ-homo (x M.*ᵣ m) (x M.*ᵣ n) ⟩
⟦ x M.*ᵣ m M.+ᴹ x M.*ᵣ n ⟧ ∎

*ᵣ-identityʳ : NDefs.RightIdentity 1# N._*ᵣ_ → MDefs.RightIdentity 1# M._*ᵣ_
*ᵣ-identityʳ {1# = 1#} *ᵣ-identityʳ m = injective $ begin
⟦ m M.*ᵣ 1# ⟧ ≈⟨ *ᵣ-homo 1# m ⟩
⟦ m ⟧ N.*ᵣ 1# ≈⟨ *ᵣ-identityʳ ⟦ m ⟧ ⟩
⟦ m ⟧ ∎

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

*ᵣ-zeroˡ : NDefs.RightCongruent N._*ᵣ_ → NDefs.LeftZero N.0ᴹ N._*ᵣ_ → MDefs.LeftZero M.0ᴹ M._*ᵣ_
*ᵣ-zeroˡ *ᵣ-congʳ *ᵣ-zeroˡ x = injective $ begin
⟦ M.0ᴹ M.*ᵣ x ⟧ ≈⟨ *ᵣ-homo x M.0ᴹ ⟩
⟦ M.0ᴹ ⟧ N.*ᵣ x ≈⟨ *ᵣ-congʳ 0ᴹ-homo ⟩
N.0ᴹ N.*ᵣ x ≈⟨ *ᵣ-zeroˡ x ⟩
N.0ᴹ ≈˘⟨ 0ᴹ-homo ⟩
⟦ M.0ᴹ ⟧ ∎

*ᵣ-distribʳ : NDefs.RightCongruent N._*ᵣ_ → N._*ᵣ_ NDefs.DistributesOverʳ N._+ᴹ_ → M._*ᵣ_ MDefs.DistributesOverʳ M._+ᴹ_
*ᵣ-distribʳ *ᵣ-congʳ *ᵣ-distribʳ x m n = injective $ begin
⟦ (m M.+ᴹ n) M.*ᵣ x ⟧ ≈⟨ *ᵣ-homo x (m M.+ᴹ n) ⟩
⟦ m M.+ᴹ n ⟧ N.*ᵣ x ≈⟨ *ᵣ-congʳ (+ᴹ-homo m n) ⟩
(⟦ m ⟧ N.+ᴹ ⟦ n ⟧) N.*ᵣ x ≈⟨ *ᵣ-distribʳ x ⟦ m ⟧ ⟦ n ⟧ ⟩
⟦ m ⟧ N.*ᵣ x N.+ᴹ ⟦ n ⟧ N.*ᵣ x ≈˘⟨ +ᴹ-cong′ (*ᵣ-homo x m) (*ᵣ-homo x n) ⟩
⟦ m M.*ᵣ x ⟧ N.+ᴹ ⟦ n M.*ᵣ x ⟧ ≈˘⟨ +ᴹ-homo (m M.*ᵣ x) (n M.*ᵣ x) ⟩
⟦ m M.*ᵣ x M.+ᴹ n M.*ᵣ x ⟧ ∎

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

isRightSemimodule :
(R-isSemiring : IsSemiring _≈_ _+_ _*_ 0# 1#)
(let R-semiring = record { isSemiring = R-isSemiring })
→ IsRightSemimodule R-semiring N._≈ᴹ_ N._+ᴹ_ N.0ᴹ N._*ᵣ_
→ IsRightSemimodule R-semiring M._≈ᴹ_ M._+ᴹ_ M.0ᴹ M._*ᵣ_
isRightSemimodule isSemiring isRightSemimodule = record
{ +ᴹ-isCommutativeMonoid = +ᴹ-isCommutativeMonoid NN.+ᴹ-isCommutativeMonoid
; isPrerightSemimodule = record
{ *ᵣ-cong = *ᵣ-cong NN.+ᴹ-isMonoid NN.*ᵣ-cong
; *ᵣ-zeroʳ = *ᵣ-zeroʳ NN.+ᴹ-isMonoid NN.*ᵣ-zeroʳ
; *ᵣ-distribˡ = *ᵣ-distribˡ NN.+ᴹ-isMonoid NN.*ᵣ-distribˡ
; *ᵣ-identityʳ = *ᵣ-identityʳ NN.+ᴹ-isMonoid NN.*ᵣ-identityʳ
; *ᵣ-assoc = *ᵣ-assoc NN.+ᴹ-isMonoid NN.*ᵣ-congʳ NN.*ᵣ-assoc
; *ᵣ-zeroˡ = *ᵣ-zeroˡ NN.+ᴹ-isMonoid NN.*ᵣ-congʳ NN.*ᵣ-zeroˡ
; *ᵣ-distribʳ = *ᵣ-distribʳ NN.+ᴹ-isMonoid NN.*ᵣ-congʳ NN.*ᵣ-distribʳ
}
} where module NN = IsRightSemimodule isRightSemimodule