Skip to content

Commit c456702

Browse files
committed
Add commutative law to modules
1 parent eda81db commit c456702

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/Algebra/Module/Structures.agda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ module _ (commutativeSemiring : CommutativeSemiring r ℓr)
171171
: Set (r ⊔ m ⊔ ℓr ⊔ ℓm) where
172172
field
173173
isBisemimodule : IsBisemimodule semiring semiring ≈ᴹ +ᴹ 0ᴹ *ₗ *ᵣ
174+
*ₗ-*ᵣ-comm : x m ≈ᴹ (*ₗ x m) (*ᵣ m x)
174175

175176
open IsBisemimodule isBisemimodule public
176177

@@ -285,8 +286,9 @@ module _ (commutativeRing : CommutativeRing r ℓr)
285286
record IsModule (*ₗ : Opₗ R M) (*ᵣ : Opᵣ R M) : Set (r ⊔ m ⊔ ℓr ⊔ ℓm) where
286287
field
287288
isBimodule : IsBimodule ring ring ≈ᴹ +ᴹ 0ᴹ -ᴹ *ₗ *ᵣ
289+
*ₗ-*ᵣ-comm : x m ≈ᴹ (*ₗ x m) (*ᵣ m x)
288290

289291
open IsBimodule isBimodule public
290292

291293
isSemimodule : IsSemimodule commutativeSemiring ≈ᴹ +ᴹ 0ᴹ *ₗ *ᵣ
292-
isSemimodule = record { isBisemimodule = isBisemimodule }
294+
isSemimodule = record { isBisemimodule = isBisemimodule; *ₗ-*ᵣ-comm = *ₗ-*ᵣ-comm }

src/Algebra/Module/Structures/Biased.agda

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ module _ (commutativeSemiring : CommutativeSemiring r ℓr) where
5555
}
5656

5757
isSemimodule : IsSemimodule commutativeSemiring ≈ᴹ +ᴹ 0ᴹ *ₗ (flip *ₗ)
58-
isSemimodule = record { isBisemimodule = isBisemimodule }
58+
isSemimodule = record
59+
{ isBisemimodule = isBisemimodule
60+
; *ₗ-*ᵣ-comm = λ _ _ ≈ᴹ-refl
61+
}
5962

6063
-- Similarly, a right semimodule over a commutative semiring
6164
-- is already a semimodule.
@@ -86,7 +89,10 @@ module _ (commutativeSemiring : CommutativeSemiring r ℓr) where
8689
}
8790

8891
isSemimodule : IsSemimodule commutativeSemiring ≈ᴹ +ᴹ 0ᴹ (flip *ᵣ) *ᵣ
89-
isSemimodule = record { isBisemimodule = isBisemimodule }
92+
isSemimodule = record
93+
{ isBisemimodule = isBisemimodule
94+
; *ₗ-*ᵣ-comm = λ _ _ ≈ᴹ-refl
95+
}
9096

9197

9298
module _ (commutativeRing : CommutativeRing r ℓr) where
@@ -111,6 +117,7 @@ module _ (commutativeRing : CommutativeRing r ℓr) where
111117
; -ᴹ‿cong = -ᴹ‿cong
112118
; -ᴹ‿inverse = -ᴹ‿inverse
113119
}
120+
; *ₗ-*ᵣ-comm = λ _ _ ≈ᴹ-refl
114121
}
115122

116123
-- Similarly, a right module over a commutative ring is already a module.
@@ -132,4 +139,5 @@ module _ (commutativeRing : CommutativeRing r ℓr) where
132139
; -ᴹ‿cong = -ᴹ‿cong
133140
; -ᴹ‿inverse = -ᴹ‿inverse
134141
}
142+
; *ₗ-*ᵣ-comm = λ _ _ ≈ᴹ-refl
135143
}

0 commit comments

Comments
 (0)