| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Consequences of a monomorphism between bisemimodules |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --safe --cubical-compatible #-} |
| 8 |
|
| 9 |
open import Algebra.Module.Bundles.Raw using (RawBisemimodule) |
| 10 |
open import Algebra.Module.Morphism.Structures using (IsBisemimoduleMonomorphism) |
| 11 |
|
| 12 |
module Algebra.Module.Morphism.BisemimoduleMonomorphism |
| 13 |
{r s a b ℓ₁ ℓ₂} {R : Set r} {S : Set s} {M : RawBisemimodule R S a ℓ₁} {N : RawBisemimodule R S b ℓ₂} {⟦_⟧} |
| 14 |
(isBisemimoduleMonomorphism : IsBisemimoduleMonomorphism M N ⟦_⟧) |
| 15 |
where |
| 16 |
|
| 17 |
open IsBisemimoduleMonomorphism isBisemimoduleMonomorphism |
| 18 |
private |
| 19 |
module M = RawBisemimodule M |
| 20 |
module N = RawBisemimodule N |
| 21 |
|
| 22 |
open import Algebra.Bundles using (Semiring) |
| 23 |
open import Algebra.Core using (Op₂) |
| 24 |
import Algebra.Module.Definitions.Bi as BiDefs using (Associative) |
| 25 |
import Algebra.Module.Definitions.Left as LeftDefs using (LeftCongruent) |
| 26 |
import Algebra.Module.Definitions.Right as RightDefs using (RightCongruent) |
| 27 |
open import Algebra.Module.Structures using (IsBisemimodule) |
| 28 |
open import Algebra.Structures using (IsMagma; IsSemiring) |
| 29 |
open import Function.Base using (flip; _$_) |
| 30 |
open import Relation.Binary.Core using (Rel) |
| 31 |
import Relation.Binary.Reasoning.Setoid as SetoidReasoning |
| 32 |
|
| 33 |
------------------------------------------------------------------------ |
| 34 |
-- Re-exports |
| 35 |
|
| 36 |
open import Algebra.Morphism.MonoidMonomorphism |
| 37 |
+ᴹ-isMonoidMonomorphism public |
| 38 |
using () |
| 39 |
renaming |
| 40 |
( cong to +ᴹ-cong |
| 41 |
; assoc to +ᴹ-assoc |
| 42 |
; comm to +ᴹ-comm |
| 43 |
; identityˡ to +ᴹ-identityˡ |
| 44 |
; identityʳ to +ᴹ-identityʳ |
| 45 |
; identity to +ᴹ-identity |
| 46 |
; isMagma to +ᴹ-isMagma |
| 47 |
; isSemigroup to +ᴹ-isSemigroup |
| 48 |
; isMonoid to +ᴹ-isMonoid |
| 49 |
; isCommutativeMonoid to +ᴹ-isCommutativeMonoid |
| 50 |
) |
| 51 |
|
| 52 |
open import Algebra.Module.Morphism.LeftSemimoduleMonomorphism |
| 53 |
isLeftSemimoduleMonomorphism public |
| 54 |
using |
| 55 |
( *ₗ-cong |
| 56 |
; *ₗ-zeroˡ |
| 57 |
; *ₗ-distribʳ |
| 58 |
; *ₗ-identityˡ |
| 59 |
; *ₗ-assoc |
| 60 |
; *ₗ-zeroʳ |
| 61 |
; *ₗ-distribˡ |
| 62 |
; isLeftSemimodule |
| 63 |
) |
| 64 |
|
| 65 |
open import Algebra.Module.Morphism.RightSemimoduleMonomorphism |
| 66 |
isRightSemimoduleMonomorphism public |
| 67 |
using |
| 68 |
( *ᵣ-cong |
| 69 |
; *ᵣ-zeroʳ |
| 70 |
; *ᵣ-distribˡ |
| 71 |
; *ᵣ-identityʳ |
| 72 |
; *ᵣ-assoc |
| 73 |
; *ᵣ-zeroˡ |
| 74 |
; *ᵣ-distribʳ |
| 75 |
; isRightSemimodule |
| 76 |
) |
| 77 |
|
| 78 |
------------------------------------------------------------------------ |
| 79 |
-- Properties |
| 80 |
|
| 81 |
module _ (+ᴹ-isMagma : IsMagma N._≈ᴹ_ N._+ᴹ_) where |
| 82 |
|
| 83 |
open IsMagma +ᴹ-isMagma |
| 84 |
using (setoid) |
| 85 |
renaming (∙-cong to +ᴹ-cong) |
| 86 |
open SetoidReasoning setoid |
| 87 |
|
| 88 |
private |
| 89 |
module MDefs = BiDefs R S M._≈ᴹ_ |
| 90 |
module NDefs = BiDefs R S N._≈ᴹ_ |
| 91 |
module LDefs = LeftDefs R N._≈ᴹ_ |
| 92 |
module RDefs = RightDefs S N._≈ᴹ_ |
| 93 |
|
| 94 |
*ₗ-*ᵣ-assoc |
| 95 |
: LDefs.LeftCongruent N._*ₗ_ → RDefs.RightCongruent N._*ᵣ_ |
| 96 |
→ NDefs.Associative N._*ₗ_ N._*ᵣ_ |
| 97 |
→ MDefs.Associative M._*ₗ_ M._*ᵣ_ |
| 98 |
*ₗ-*ᵣ-assoc *ₗ-congˡ *ᵣ-congʳ *ₗ-*ᵣ-assoc x m y = injective $ begin |
| 99 |
⟦ (x M.*ₗ m) M.*ᵣ y ⟧ ≈⟨ *ᵣ-homo y (x M.*ₗ m) ⟩ |
| 100 |
⟦ x M.*ₗ m ⟧ N.*ᵣ y ≈⟨ *ᵣ-congʳ (*ₗ-homo x m) ⟩ |
| 101 |
(x N.*ₗ ⟦ m ⟧) N.*ᵣ y ≈⟨ *ₗ-*ᵣ-assoc x ⟦ m ⟧ y ⟩ |
| 102 |
x N.*ₗ (⟦ m ⟧ N.*ᵣ y) ≈˘⟨ *ₗ-congˡ (*ᵣ-homo y m) ⟩ |
| 103 |
x N.*ₗ ⟦ m M.*ᵣ y ⟧ ≈˘⟨ *ₗ-homo x (m M.*ᵣ y) ⟩ |
| 104 |
⟦ x M.*ₗ (m M.*ᵣ y) ⟧ ∎ |
| 105 |
|
| 106 |
------------------------------------------------------------------------ |
| 107 |
-- Structures |
| 108 |
|
| 109 |
module _ |
| 110 |
{ℓr} {_≈r_ : Rel R ℓr} {_+r_ _*r_ 0r 1r} |
| 111 |
{ℓs} {_≈s_ : Rel S ℓs} {_+s_ _*s_ 0s 1s} |
| 112 |
(R-isSemiring : IsSemiring _≈r_ _+r_ _*r_ 0r 1r) |
| 113 |
(S-isSemiring : IsSemiring _≈s_ _+s_ _*s_ 0s 1s) |
| 114 |
where |
| 115 |
|
| 116 |
private |
| 117 |
R-semiring : Semiring _ _ |
| 118 |
R-semiring = record { isSemiring = R-isSemiring } |
| 119 |
|
| 120 |
S-semiring : Semiring _ _ |
| 121 |
S-semiring = record { isSemiring = S-isSemiring } |
| 122 |
|
| 123 |
isBisemimodule |
| 124 |
: IsBisemimodule R-semiring S-semiring N._≈ᴹ_ N._+ᴹ_ N.0ᴹ N._*ₗ_ N._*ᵣ_ |
| 125 |
→ IsBisemimodule R-semiring S-semiring M._≈ᴹ_ M._+ᴹ_ M.0ᴹ M._*ₗ_ M._*ᵣ_ |
| 126 |
isBisemimodule isBisemimodule = record |
| 127 |
{ +ᴹ-isCommutativeMonoid = +ᴹ-isCommutativeMonoid NN.+ᴹ-isCommutativeMonoid |
| 128 |
; isPreleftSemimodule = record |
| 129 |
{ *ₗ-cong = *ₗ-cong NN.+ᴹ-isMagma NN.*ₗ-cong |
| 130 |
; *ₗ-zeroˡ = *ₗ-zeroˡ NN.+ᴹ-isMagma NN.*ₗ-zeroˡ |
| 131 |
; *ₗ-distribʳ = *ₗ-distribʳ NN.+ᴹ-isMagma NN.*ₗ-distribʳ |
| 132 |
; *ₗ-identityˡ = *ₗ-identityˡ NN.+ᴹ-isMagma NN.*ₗ-identityˡ |
| 133 |
; *ₗ-assoc = *ₗ-assoc NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-assoc |
| 134 |
; *ₗ-zeroʳ = *ₗ-zeroʳ NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-zeroʳ |
| 135 |
; *ₗ-distribˡ = *ₗ-distribˡ NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ₗ-distribˡ |
| 136 |
} |
| 137 |
; isPrerightSemimodule = record |
| 138 |
{ *ᵣ-cong = *ᵣ-cong NN.+ᴹ-isMagma NN.*ᵣ-cong |
| 139 |
; *ᵣ-zeroʳ = *ᵣ-zeroʳ NN.+ᴹ-isMagma NN.*ᵣ-zeroʳ |
| 140 |
; *ᵣ-distribˡ = *ᵣ-distribˡ NN.+ᴹ-isMagma NN.*ᵣ-distribˡ |
| 141 |
; *ᵣ-identityʳ = *ᵣ-identityʳ NN.+ᴹ-isMagma NN.*ᵣ-identityʳ |
| 142 |
; *ᵣ-assoc = *ᵣ-assoc NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-assoc |
| 143 |
; *ᵣ-zeroˡ = *ᵣ-zeroˡ NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-zeroˡ |
| 144 |
; *ᵣ-distribʳ = *ᵣ-distribʳ NN.+ᴹ-isMagma NN.*ᵣ-congʳ NN.*ᵣ-distribʳ |
| 145 |
} |
| 146 |
; *ₗ-*ᵣ-assoc = *ₗ-*ᵣ-assoc NN.+ᴹ-isMagma NN.*ₗ-congˡ NN.*ᵣ-congʳ NN.*ₗ-*ᵣ-assoc |
| 147 |
} |
| 148 |
where |
| 149 |
module NN = IsBisemimodule isBisemimodule |