Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 85eb12d

Browse files
committed
feat(algebra/algebra/basic): product of two algebras (#4632)
1 parent 82ff1e5 commit 85eb12d

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/algebra/algebra/basic.lean

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rfl
7474

7575
namespace algebra
7676

77-
variables {R : Type u} {S : Type v} {A : Type w}
77+
variables {R : Type u} {S : Type v} {A : Type w} {B : Type*}
7878

7979
/-- Let `R` be a commutative semiring, let `A` be a semiring with a `semimodule R` structure.
8080
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])
100100

101101
section semiring
102102

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]
104105

105106
lemma smul_def'' (r : R) (x : A) : r • x = algebra_map R A r * x :=
106107
algebra.smul_def' r x
@@ -203,6 +204,22 @@ namespace id
203204

204205
end id
205206

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+
206223
/-- Algebra over a subsemiring. -/
207224
instance of_subsemiring (S : subsemiring R) : algebra S A :=
208225
{ smul := λ s x, (s : R) • x,

0 commit comments

Comments
 (0)