74
74
75
75
namespace algebra
76
76
77
- variables {R : Type u} {S : Type v} {A : Type w}
77
+ variables {R : Type u} {S : Type v} {A : Type w} {B : Type *}
78
78
79
79
/-- Let `R` be a commutative semiring, let `A` be a semiring with a `semimodule R` structure.
80
80
If `(r • 1) * x = x * (r • 1) = r • x` for all `r : R` and `x : A`, then `A` is an `algebra`
@@ -100,7 +100,8 @@ of_semimodule' (λ r x, by rw [h₁, one_mul]) (λ r x, by rw [h₂, mul_one])
100
100
101
101
section semiring
102
102
103
- variables [comm_semiring R] [comm_semiring S] [semiring A] [algebra R A]
103
+ variables [comm_semiring R] [comm_semiring S]
104
+ variables [semiring A] [algebra R A] [semiring B] [algebra R B]
104
105
105
106
lemma smul_def'' (r : R) (x : A) : r • x = algebra_map R A r * x :=
106
107
algebra.smul_def' r x
@@ -203,6 +204,22 @@ namespace id
203
204
204
205
end id
205
206
207
+ section prod
208
+ variables (R A B)
209
+
210
+ instance : algebra R (A × B) :=
211
+ { commutes' := by { rintro r ⟨a, b⟩, dsimp, rw [commutes r a, commutes r b] },
212
+ smul_def' := by { rintro r ⟨a, b⟩, dsimp, rw [smul_def r a, smul_def r b] },
213
+ .. prod.semimodule,
214
+ .. ring_hom.prod (algebra_map R A) (algebra_map R B) }
215
+
216
+ variables {R A B}
217
+
218
+ @[simp] lemma algebra_map_prod_apply (r : R) :
219
+ algebra_map R (A × B) r = (algebra_map R A r, algebra_map R B r) := rfl
220
+
221
+ end prod
222
+
206
223
/-- Algebra over a subsemiring. -/
207
224
instance of_subsemiring (S : subsemiring R) : algebra S A :=
208
225
{ smul := λ s x, (s : R) • x,
0 commit comments