7
7
8
8
{-# OPTIONS --without-K --safe #-}
9
9
10
- module Algebra.Module where
10
+ module Algebra.Module.Bundles where
11
11
12
- open import Algebra
13
- open import Algebra.Structures. Module
12
+ open import Algebra.Bundles
13
+ open import Algebra.Module.Structures
14
14
open import Algebra.FunctionProperties.Core
15
15
import Algebra.FunctionProperties.LeftAction as LFP
16
16
import Algebra.FunctionProperties.RightAction as RFP
17
- open import Function
17
+ open import Function.Base
18
18
open import Level
19
19
open import Relation.Binary
20
20
@@ -152,6 +152,80 @@ record RightModule {r ℓr} (ring : Ring r ℓr) m ℓm
152
152
using ()
153
153
renaming (group to +ᴹ-group)
154
154
155
+ ------------------------------------------------------------------------
156
+ -- Bimodules
157
+ ------------------------------------------------------------------------
158
+
159
+ record Bisemimodule {r s ℓr ℓs} (R-semiring : Semiring r ℓr)
160
+ (S-semiring : Semiring s ℓs) m ℓm
161
+ : Set (r ⊔ s ⊔ ℓr ⊔ ℓs ⊔ suc (m ⊔ ℓm)) where
162
+ private
163
+ module R = Semiring R-semiring
164
+ module S = Semiring S-semiring
165
+
166
+ infixr 7 _*ₗ_
167
+ infixl 6 _+ᴹ_
168
+ infix 4 _≈ᴹ_
169
+
170
+ field
171
+ Carrierᴹ : Set m
172
+ _≈ᴹ_ : Rel Carrierᴹ ℓm
173
+ _+ᴹ_ : Op₂ Carrierᴹ
174
+ _*ₗ_ : Opₗ R.Carrier Carrierᴹ
175
+ _*ᵣ_ : Opᵣ S.Carrier Carrierᴹ
176
+ 0ᴹ : Carrierᴹ
177
+ isBisemimodule : IsBisemimodule _≈ᴹ_ R-semiring S-semiring _+ᴹ_ _*ₗ_ _*ᵣ_ 0ᴹ
178
+
179
+ open IsBisemimodule isBisemimodule public
180
+
181
+ leftSemimodule : LeftSemimodule R-semiring m ℓm
182
+ leftSemimodule = record { isLeftSemimodule = isLeftSemimodule }
183
+
184
+ rightSemimodule : RightSemimodule S-semiring m ℓm
185
+ rightSemimodule = record { isRightSemimodule = isRightSemimodule }
186
+
187
+ open LeftSemimodule leftSemimodule public
188
+ using ( +ᴹ-commutativeMonoid; +ᴹ-monoid; +ᴹ-semigroup; +ᴹ-magma; +ᴹ-rawMagma
189
+ ; +ᴹ-rawMonoid)
190
+
191
+ record Bimodule {r s ℓr ℓs} (R-ring : Ring r ℓr) (S-ring : Ring s ℓs) m ℓm
192
+ : Set (r ⊔ s ⊔ ℓr ⊔ ℓs ⊔ suc (m ⊔ ℓm)) where
193
+ private
194
+ module R = Ring R-ring
195
+ module S = Ring S-ring
196
+
197
+ infixr 7 _*ₗ_
198
+ infixl 6 _+ᴹ_
199
+ infix 4 _≈ᴹ_
200
+
201
+ field
202
+ Carrierᴹ : Set m
203
+ _≈ᴹ_ : Rel Carrierᴹ ℓm
204
+ _+ᴹ_ : Op₂ Carrierᴹ
205
+ _*ₗ_ : Opₗ R.Carrier Carrierᴹ
206
+ _*ᵣ_ : Opᵣ S.Carrier Carrierᴹ
207
+ 0ᴹ : Carrierᴹ
208
+ -ᴹ_ : Op₁ Carrierᴹ
209
+ isBimodule : IsBimodule _≈ᴹ_ R-ring S-ring _+ᴹ_ _*ₗ_ _*ᵣ_ 0ᴹ -ᴹ_
210
+
211
+ open IsBimodule isBimodule public
212
+
213
+ leftModule : LeftModule R-ring m ℓm
214
+ leftModule = record { isLeftModule = isLeftModule }
215
+
216
+ rightModule : RightModule S-ring m ℓm
217
+ rightModule = record { isRightModule = isRightModule }
218
+
219
+ open LeftModule leftModule public
220
+ using ( +ᴹ-abelianGroup; +ᴹ-commutativeMonoid; +ᴹ-group; +ᴹ-monoid
221
+ ; +ᴹ-semigroup; +ᴹ-magma; +ᴹ-rawMagma; +ᴹ-rawMonoid)
222
+
223
+ bisemimodule : Bisemimodule R.semiring S.semiring m ℓm
224
+ bisemimodule = record { isBisemimodule = isBisemimodule }
225
+
226
+ open Bisemimodule bisemimodule public
227
+ using (leftSemimodule; rightSemimodule)
228
+
155
229
------------------------------------------------------------------------
156
230
-- Modules over commutative structures
157
231
------------------------------------------------------------------------
@@ -170,24 +244,23 @@ record Semimodule {r ℓr} (commutativeSemiring : CommutativeSemiring r ℓr) m
170
244
_≈ᴹ_ : Rel Carrierᴹ ℓm
171
245
_+ᴹ_ : Op₂ Carrierᴹ
172
246
_*ₗ_ : Opₗ Carrier Carrierᴹ
247
+ _*ᵣ_ : Opᵣ Carrier Carrierᴹ
173
248
0ᴹ : Carrierᴹ
174
- isSemimodule : IsSemimodule _≈ᴹ_ commutativeSemiring _+ᴹ_ _*ₗ_ 0ᴹ
249
+ isSemimodule : IsSemimodule _≈ᴹ_ commutativeSemiring _+ᴹ_ _*ₗ_ _*ᵣ_ 0ᴹ
175
250
176
251
open IsSemimodule isSemimodule public
177
252
178
253
private
179
254
module L = LFP Carrier _≈ᴹ_
180
255
module R = RFP Carrier _≈ᴹ_
181
256
182
- leftSemimodule : LeftSemimodule semiring m ℓm
183
- leftSemimodule = record { isLeftSemimodule = isLeftSemimodule }
184
-
185
- open LeftSemimodule leftSemimodule public
186
- using ( +ᴹ-commutativeMonoid; +ᴹ-monoid; +ᴹ-semigroup; +ᴹ-magma
187
- ; +ᴹ-rawMonoid; +ᴹ-rawMagma)
257
+ bisemimodule : Bisemimodule semiring semiring m ℓm
258
+ bisemimodule = record { isBisemimodule = isBisemimodule }
188
259
189
- _*ᵣ_ : Opᵣ Carrier Carrierᴹ
190
- _*ᵣ_ = flip _*ₗ_
260
+ open Bisemimodule bisemimodule public
261
+ using ( leftSemimodule; rightSemimodule
262
+ ; +ᴹ-commutativeMonoid; +ᴹ-monoid; +ᴹ-semigroup; +ᴹ-magma; +ᴹ-rawMagma
263
+ ; +ᴹ-rawMonoid)
191
264
192
265
*ₗ-comm : L.Commutative _*ₗ_
193
266
*ₗ-comm x y m =
@@ -196,26 +269,10 @@ record Semimodule {r ℓr} (commutativeSemiring : CommutativeSemiring r ℓr) m
196
269
(*ₗ-assoc y x m))
197
270
198
271
*ᵣ-comm : R.Commutative _*ᵣ_
199
- *ᵣ-comm m x y = *ₗ-comm y x m
200
-
201
- isRightSemimodule : IsRightSemimodule _≈ᴹ_ semiring _+ᴹ_ _*ᵣ_ 0ᴹ
202
- isRightSemimodule = record
203
- { +ᴹ-isCommutativeMonoid = +ᴹ-isCommutativeMonoid
204
- ; *ᵣ-cong = flip *ₗ-cong
205
- ; *ᵣ-zeroʳ = *ₗ-zeroˡ
206
- ; *ᵣ-distribˡ = λ m x y → *ₗ-distribʳ m x y
207
- ; *ᵣ-identityʳ = λ m → *ₗ-identityˡ m
208
- ; *ᵣ-assoc = λ m x y → M-trans (*ₗ-comm y x m) (M-sym (*ₗ-assoc x y m))
209
- ; *ᵣ-zeroˡ = *ₗ-zeroʳ
210
- ; *ᵣ-distribʳ = λ x m n → *ₗ-distribˡ x m n
211
- }
212
-
213
- rightSemimodule : RightSemimodule semiring m ℓm
214
- rightSemimodule = record { isRightSemimodule = isRightSemimodule }
215
-
216
- open RightSemimodule rightSemimodule public
217
- using ( *ᵣ-cong; *ᵣ-zeroʳ; *ᵣ-distribˡ; *ᵣ-identityʳ; *ᵣ-assoc; *ᵣ-zeroˡ
218
- ; *ᵣ-distribʳ)
272
+ *ᵣ-comm m x y =
273
+ M-trans (*ᵣ-assoc m x y)
274
+ (M-trans (*ᵣ-cong M-refl (*-comm _ _))
275
+ (M-sym (*ᵣ-assoc m y x)))
219
276
220
277
record Module {r ℓr} (commutativeRing : CommutativeRing r ℓr) m ℓm
221
278
: Set (r ⊔ ℓr ⊔ suc (m ⊔ ℓm)) where
@@ -231,43 +288,34 @@ record Module {r ℓr} (commutativeRing : CommutativeRing r ℓr) m ℓm
231
288
_≈ᴹ_ : Rel Carrierᴹ ℓm
232
289
_+ᴹ_ : Op₂ Carrierᴹ
233
290
_*ₗ_ : Opₗ Carrier Carrierᴹ
291
+ _*ᵣ_ : Opᵣ Carrier Carrierᴹ
234
292
0ᴹ : Carrierᴹ
235
293
-ᴹ_ : Op₁ Carrierᴹ
236
- isModule : IsModule _≈ᴹ_ commutativeRing _+ᴹ_ _*ₗ_ 0ᴹ -ᴹ_
294
+ isModule : IsModule _≈ᴹ_ commutativeRing _+ᴹ_ _*ₗ_ _*ᵣ_ 0ᴹ -ᴹ_
237
295
238
296
open IsModule isModule public
239
297
298
+ {- TODO: #898
240
299
semimodule : Semimodule commutativeSemiring m ℓm
241
300
semimodule = record { isSemimodule = isSemimodule }
242
301
243
302
open Semimodule semimodule public
244
303
using ( leftSemimodule; isLeftSemimodule; rightSemimodule
245
304
; isRightSemimodule; _*ᵣ_; *ₗ-comm; *ᵣ-comm; *ᵣ-cong
246
305
; *ᵣ-zeroʳ; *ᵣ-distribˡ; *ᵣ-identityʳ; *ᵣ-assoc; *ᵣ-zeroˡ
247
- ; *ᵣ-distribʳ; +ᴹ-commutativeMonoid; +ᴹ-monoid; +ᴹ-semigroup
248
- ; +ᴹ-magma ; +ᴹ-rawMonoid; +ᴹ-rawMagma)
306
+ ; *ᵣ-distribʳ)
307
+ -}
249
308
250
309
leftModule : LeftModule ring m ℓm
251
310
leftModule = record { isLeftModule = isLeftModule }
252
311
253
312
open LeftModule leftModule public
254
- using (+ᴹ-abelianGroup; +ᴹ-group)
255
-
256
- isRightModule : IsRightModule _≈ᴹ_ ring _+ᴹ_ _*ᵣ_ 0ᴹ -ᴹ_
257
- isRightModule = record
258
- { isRightSemimodule = record
259
- { +ᴹ-isCommutativeMonoid = +ᴹ-isCommutativeMonoid
260
- ; *ᵣ-cong = *ᵣ-cong
261
- ; *ᵣ-zeroʳ = *ᵣ-zeroʳ
262
- ; *ᵣ-distribˡ = *ᵣ-distribˡ
263
- ; *ᵣ-identityʳ = *ᵣ-identityʳ
264
- ; *ᵣ-assoc = *ᵣ-assoc
265
- ; *ᵣ-zeroˡ = *ᵣ-zeroˡ
266
- ; *ᵣ-distribʳ = *ᵣ-distribʳ
267
- }
268
- ; -ᴹ‿cong = -ᴹ‿cong
269
- ; -ᴹ‿inverse = -ᴹ‿inverse
270
- }
313
+ using ( leftSemimodule
314
+ ; +ᴹ-abelianGroup; +ᴹ-group; +ᴹ-commutativeMonoid; +ᴹ-monoid
315
+ ; +ᴹ-semigroup; +ᴹ-magma ; +ᴹ-rawMonoid; +ᴹ-rawMagma)
271
316
272
317
rightModule : RightModule ring m ℓm
273
318
rightModule = record { isRightModule = isRightModule }
319
+
320
+ open RightModule rightModule public
321
+ using (rightSemimodule)
0 commit comments