# mathlib3documentation

algebra.ring.prod

# Semiring, ring etc structures on R × S#

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

In this file we define two-binop (semiring, ring etc) structures on R × S. We also prove trivial simp lemmas, and define the following operations on ring_homs and similarly for non_unital_ring_homs:

• fst R S : R × S →+* R, snd R S : R × S →+* S: projections prod.fst and prod.snd as ring_homs;
• f.prod g :R →+* S × T: sendsxto(f x, g x);
• f.prod_map g :R × S → R' × S':prod.map f gas aring_hom, sends(x, y)to(f x, g y).
@[protected, instance]
def prod.distrib {R : Type u_3} {S : Type u_5} [distrib R] [distrib S] :
distrib (R × S)

Product of two distributive types is distributive.

Equations
@[protected, instance]
def prod.non_unital_non_assoc_semiring {R : Type u_3} {S : Type u_5}  :

Product of two non_unital_non_assoc_semirings is a non_unital_non_assoc_semiring.

Equations
@[protected, instance]
def prod.non_unital_semiring {R : Type u_3} {S : Type u_5}  :

Product of two non_unital_semirings is a non_unital_semiring.

Equations
@[protected, instance]
def prod.non_assoc_semiring {R : Type u_3} {S : Type u_5}  :

Product of two non_assoc_semirings is a non_assoc_semiring.

Equations
@[protected, instance]
def prod.semiring {R : Type u_3} {S : Type u_5} [semiring R] [semiring S] :
semiring (R × S)

Product of two semirings is a semiring.

Equations
@[protected, instance]
def prod.non_unital_comm_semiring {R : Type u_3} {S : Type u_5}  :

Product of two non_unital_comm_semirings is a non_unital_comm_semiring.

Equations
@[protected, instance]
def prod.comm_semiring {R : Type u_3} {S : Type u_5}  :

Product of two commutative semirings is a commutative semiring.

Equations
@[protected, instance]
def prod.non_unital_non_assoc_ring {R : Type u_3} {S : Type u_5}  :
Equations
@[protected, instance]
def prod.non_unital_ring {R : Type u_3} {S : Type u_5}  :
Equations
@[protected, instance]
def prod.non_assoc_ring {R : Type u_3} {S : Type u_5}  :
Equations
@[protected, instance]
def prod.ring {R : Type u_3} {S : Type u_5} [ring R] [ring S] :
ring (R × S)

Product of two rings is a ring.

Equations
@[protected, instance]
def prod.non_unital_comm_ring {R : Type u_3} {S : Type u_5}  :

Product of two non_unital_comm_rings is a non_unital_comm_ring.

Equations
@[protected, instance]
def prod.comm_ring {R : Type u_3} {S : Type u_5} [comm_ring R] [comm_ring S] :

Product of two commutative rings is a commutative ring.

Equations
def non_unital_ring_hom.fst (R : Type u_3) (S : Type u_5)  :
R × S →ₙ+* R

Given non-unital semirings R, S, the natural projection homomorphism from R × S to R.

Equations
def non_unital_ring_hom.snd (R : Type u_3) (S : Type u_5)  :
R × S →ₙ+* S

Given non-unital semirings R, S, the natural projection homomorphism from R × S to S.

Equations
@[simp]
theorem non_unital_ring_hom.coe_fst {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem non_unital_ring_hom.coe_snd {R : Type u_3} {S : Type u_5}  :
@[protected]
def non_unital_ring_hom.prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) :
R →ₙ+* S × T

Combine two non-unital ring homomorphisms f : R →ₙ+* S, g : R →ₙ+* T into f.prod g : R →ₙ+* S × T given by (f.prod g) x = (f x, g x)

Equations
@[simp]
theorem non_unital_ring_hom.prod_apply {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) (x : R) :
(f.prod g) x = (f x, g x)
@[simp]
theorem non_unital_ring_hom.fst_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) :
.comp (f.prod g) = f
@[simp]
theorem non_unital_ring_hom.snd_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) :
.comp (f.prod g) = g
theorem non_unital_ring_hom.prod_unique {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S × T) :
T).comp f).prod T).comp f) = f
def non_unital_ring_hom.prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →ₙ+* R') (g : S →ₙ+* S') :
R × S →ₙ+* R' × S'

prod.map as a non_unital_ring_hom.

Equations
theorem non_unital_ring_hom.prod_map_def {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →ₙ+* R') (g : S →ₙ+* S') :
f.prod_map g = (f.comp S)).prod (g.comp S))
@[simp]
theorem non_unital_ring_hom.coe_prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →ₙ+* R') (g : S →ₙ+* S') :
theorem non_unital_ring_hom.prod_comp_prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} {T : Type u_7} (f : T →ₙ+* R) (g : T →ₙ+* S) (f' : R →ₙ+* R') (g' : S →ₙ+* S') :
(f'.prod_map g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)
def ring_hom.fst (R : Type u_3) (S : Type u_5)  :
R × S →+* R

Given semirings R, S, the natural projection homomorphism from R × S to R.

Equations
def ring_hom.snd (R : Type u_3) (S : Type u_5)  :
R × S →+* S

Given semirings R, S, the natural projection homomorphism from R × S to S.

Equations
@[simp]
theorem ring_hom.coe_fst {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem ring_hom.coe_snd {R : Type u_3} {S : Type u_5}  :
@[protected]
def ring_hom.prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →+* S) (g : R →+* T) :
R →+* S × T

Combine two ring homomorphisms f : R →+* S, g : R →+* T into f.prod g : R →+* S × T given by (f.prod g) x = (f x, g x)

Equations
@[simp]
theorem ring_hom.prod_apply {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →+* S) (g : R →+* T) (x : R) :
(f.prod g) x = (f x, g x)
@[simp]
theorem ring_hom.fst_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →+* S) (g : R →+* T) :
T).comp (f.prod g) = f
@[simp]
theorem ring_hom.snd_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →+* S) (g : R →+* T) :
T).comp (f.prod g) = g
theorem ring_hom.prod_unique {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →+* S × T) :
((ring_hom.fst S T).comp f).prod ((ring_hom.snd S T).comp f) = f
def ring_hom.prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →+* R') (g : S →+* S') :
R × S →+* R' × S'

prod.map as a ring_hom.

Equations
theorem ring_hom.prod_map_def {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →+* R') (g : S →+* S') :
f.prod_map g = (f.comp S)).prod (g.comp S))
@[simp]
theorem ring_hom.coe_prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →+* R') (g : S →+* S') :
theorem ring_hom.prod_comp_prod_map {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} {T : Type u_7} (f : T →+* R) (g : T →+* S) (f' : R →+* R') (g' : S →+* S') :
(f'.prod_map g').comp (f.prod g) = (f'.comp f).prod (g'.comp g)
def ring_equiv.prod_comm {R : Type u_3} {S : Type u_5}  :
R × S ≃+* S × R

Swapping components as an equivalence of (semi)rings.

Equations
@[simp]
theorem ring_equiv.coe_prod_comm {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem ring_equiv.coe_prod_comm_symm {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem ring_equiv.fst_comp_coe_prod_comm {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem ring_equiv.snd_comp_coe_prod_comm {R : Type u_3} {S : Type u_5}  :
@[simp]
theorem ring_equiv.prod_prod_prod_comm_apply (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) (rrss : (R × R') × S × S') :
def ring_equiv.prod_prod_prod_comm (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6)  :
(R × R') × S × S' ≃+* (R × S) × R' × S'

Four-way commutativity of prod. The name matches mul_mul_mul_comm.

Equations
@[simp]
theorem ring_equiv.prod_prod_prod_comm_symm (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6)  :
S').symm = S'
@[simp]
theorem ring_equiv.prod_prod_prod_comm_to_add_equiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6)  :
@[simp]
theorem ring_equiv.prod_prod_prod_comm_to_mul_equiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6)  :
S').to_mul_equiv = S'
@[simp]
theorem ring_equiv.prod_prod_prod_comm_to_equiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6)  :
S').to_equiv = S'
def ring_equiv.prod_zero_ring (R : Type u_3) (S : Type u_5) [subsingleton S] :
R ≃+* R × S

A ring R is isomorphic to R × S when S is the zero ring

Equations
@[simp]
theorem ring_equiv.prod_zero_ring_symm_apply (R : Type u_3) (S : Type u_5) [subsingleton S] (self : R × S) :
.symm) self = self.fst
@[simp]
theorem ring_equiv.prod_zero_ring_apply (R : Type u_3) (S : Type u_5) [subsingleton S] (x : R) :
x = (x, 0)
def ring_equiv.zero_ring_prod (R : Type u_3) (S : Type u_5) [subsingleton S] :
R ≃+* S × R

A ring R is isomorphic to S × R when S is the zero ring

Equations
@[simp]
theorem ring_equiv.zero_ring_prod_apply (R : Type u_3) (S : Type u_5) [subsingleton S] (x : R) :
x = (0, x)
@[simp]
theorem ring_equiv.zero_ring_prod_symm_apply (R : Type u_3) (S : Type u_5) [subsingleton S] (self : S × R) :
.symm) self = self.snd
theorem false_of_nontrivial_of_product_domain (R : Type u_1) (S : Type u_2) [ring R] [ring S] [is_domain (R × S)] [nontrivial R] [nontrivial S] :

The product of two nontrivial rings is not a domain

### Order #

@[protected, instance]
def prod.ordered_semiring {α : Type u_1} {β : Type u_2}  :
Equations
@[protected, instance]
def prod.ordered_comm_semiring {α : Type u_1} {β : Type u_2}  :
Equations
@[protected, instance]
def prod.ordered_ring {α : Type u_1} {β : Type u_2} [ordered_ring α] [ordered_ring β] :
Equations
@[protected, instance]
def prod.ordered_comm_ring {α : Type u_1} {β : Type u_2}  :
Equations