# Documentation

Mathlib.Algebra.Ring.Prod

# Semiring, ring etc structures on R × S#

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 RingHoms and similarly for NonUnitalRingHoms:

• fst R S : R × S →+* R, snd R S : R × S →+* S: projections Prod.fst and Prod.snd as RingHoms;
• f.prod g : R →+* S × T: sends x to (f x, g x);
• f.prod_map g : R × S → R' × S': Prod.map f g as a RingHom, sends (x, y) to (f x, g y).
instance Prod.instDistrib {R : Type u_3} {S : Type u_5} [] [] :
Distrib (R × S)

Product of two distributive types is distributive.

instance Prod.instNonUnitalNonAssocSemiring {R : Type u_3} {S : Type u_5} :

Product of two NonUnitalNonAssocSemirings is a NonUnitalNonAssocSemiring.

instance Prod.instNonUnitalSemiring {R : Type u_3} {S : Type u_5} :

Product of two NonUnitalSemirings is a NonUnitalSemiring.

instance Prod.instNonAssocSemiring {R : Type u_3} {S : Type u_5} [] [] :

Product of two NonAssocSemirings is a NonAssocSemiring.

instance Prod.instSemiring {R : Type u_3} {S : Type u_5} [] [] :
Semiring (R × S)

Product of two semirings is a semiring.

Product of two NonUnitalCommSemirings is a NonUnitalCommSemiring.

instance Prod.instCommSemiring {R : Type u_3} {S : Type u_5} [] [] :

Product of two commutative semirings is a commutative semiring.

instance Prod.instNonUnitalRing {R : Type u_3} {S : Type u_5} [] [] :
instance Prod.instNonAssocRing {R : Type u_3} {S : Type u_5} [] [] :
instance Prod.instRing {R : Type u_3} {S : Type u_5} [Ring R] [Ring S] :
Ring (R × S)

Product of two rings is a ring.

instance Prod.instNonUnitalCommRing {R : Type u_3} {S : Type u_5} :

Product of two NonUnitalCommRings is a NonUnitalCommRing.

instance Prod.instCommRing {R : Type u_3} {S : Type u_5} [] [] :
CommRing (R × S)

Product of two commutative rings is a commutative ring.

def NonUnitalRingHom.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.

Instances For
def NonUnitalRingHom.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.

Instances For
@[simp]
theorem NonUnitalRingHom.coe_fst {R : Type u_3} {S : Type u_5} :
↑() = Prod.fst
@[simp]
theorem NonUnitalRingHom.coe_snd {R : Type u_3} {S : Type u_5} :
↑() = Prod.snd
def NonUnitalRingHom.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)

Instances For
@[simp]
theorem NonUnitalRingHom.prod_apply {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) (x : R) :
↑() x = (f x, g x)
@[simp]
theorem NonUnitalRingHom.fst_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) :
@[simp]
theorem NonUnitalRingHom.snd_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S) (g : R →ₙ+* T) :
theorem NonUnitalRingHom.prod_unique {R : Type u_3} {S : Type u_5} {T : Type u_7} (f : R →ₙ+* S × T) :
def NonUnitalRingHom.prodMap {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 NonUnitalRingHom.

Instances For
theorem NonUnitalRingHom.prodMap_def {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →ₙ+* R') (g : S →ₙ+* S') :
@[simp]
theorem NonUnitalRingHom.coe_prodMap {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} (f : R →ₙ+* R') (g : S →ₙ+* S') :
↑() = Prod.map f g
theorem NonUnitalRingHom.prod_comp_prodMap {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') :
def RingHom.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.

Instances For
def RingHom.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.

Instances For
@[simp]
theorem RingHom.coe_fst {R : Type u_3} {S : Type u_5} [] [] :
↑() = Prod.fst
@[simp]
theorem RingHom.coe_snd {R : Type u_3} {S : Type u_5} [] [] :
↑() = Prod.snd
def RingHom.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)

Instances For
@[simp]
theorem RingHom.prod_apply {R : Type u_3} {S : Type u_5} {T : Type u_7} [] [] [] (f : R →+* S) (g : R →+* T) (x : R) :
↑() x = (f x, g x)
@[simp]
theorem RingHom.fst_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} [] [] [] (f : R →+* S) (g : R →+* T) :
RingHom.comp () () = f
@[simp]
theorem RingHom.snd_comp_prod {R : Type u_3} {S : Type u_5} {T : Type u_7} [] [] [] (f : R →+* S) (g : R →+* T) :
RingHom.comp () () = g
theorem RingHom.prod_unique {R : Type u_3} {S : Type u_5} {T : Type u_7} [] [] [] (f : R →+* S × T) :
def RingHom.prodMap {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 RingHom.

Instances For
theorem RingHom.prodMap_def {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} [] [] [] [] (f : R →+* R') (g : S →+* S') :
@[simp]
theorem RingHom.coe_prodMap {R : Type u_3} {R' : Type u_4} {S : Type u_5} {S' : Type u_6} [] [] [] [] (f : R →+* R') (g : S →+* S') :
↑() = Prod.map f g
theorem RingHom.prod_comp_prodMap {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') :
def RingEquiv.prodComm {R : Type u_3} {S : Type u_5} [] [] :
R × S ≃+* S × R

Swapping components as an equivalence of (semi)rings.

Instances For
@[simp]
theorem RingEquiv.coe_prodComm {R : Type u_3} {S : Type u_5} [] [] :
RingEquiv.prodComm = Prod.swap
@[simp]
theorem RingEquiv.coe_prodComm_symm {R : Type u_3} {S : Type u_5} [] [] :
↑(RingEquiv.symm RingEquiv.prodComm) = Prod.swap
@[simp]
theorem RingEquiv.fst_comp_coe_prodComm {R : Type u_3} {S : Type u_5} [] [] :
RingHom.comp () RingEquiv.prodComm =
@[simp]
theorem RingEquiv.snd_comp_coe_prodComm {R : Type u_3} {S : Type u_5} [] [] :
RingHom.comp () RingEquiv.prodComm =
@[simp]
theorem RingEquiv.prodProdProdComm_apply (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) [] [] [] [] (rrss : (R × R') × S × S') :
def RingEquiv.prodProdProdComm (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.

Instances For
@[simp]
theorem RingEquiv.prodProdProdComm_symm (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) [] [] [] [] :
@[simp]
theorem RingEquiv.prodProdProdComm_toAddEquiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) [] [] [] [] :
↑() =
@[simp]
theorem RingEquiv.prodProdProdComm_toMulEquiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) [] [] [] [] :
↑() =
@[simp]
theorem RingEquiv.prodProdProdComm_toEquiv (R : Type u_3) (R' : Type u_4) (S : Type u_5) (S' : Type u_6) [] [] [] [] :
↑() = Equiv.prodProdProdComm R R' S S'
@[simp]
theorem RingEquiv.prodZeroRing_symm_apply (R : Type u_3) (S : Type u_5) [] [] [] (self : R × S) :
↑() self = self.fst
@[simp]
theorem RingEquiv.prodZeroRing_apply (R : Type u_3) (S : Type u_5) [] [] [] (x : R) :
↑() x = (x, 0)
def RingEquiv.prodZeroRing (R : Type u_3) (S : Type u_5) [] [] [] :
R ≃+* R × S

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

Instances For
@[simp]
theorem RingEquiv.zeroRingProd_symm_apply (R : Type u_3) (S : Type u_5) [] [] [] (self : S × R) :
↑() self = self.snd
@[simp]
theorem RingEquiv.zeroRingProd_apply (R : Type u_3) (S : Type u_5) [] [] [] (x : R) :
↑() x = (0, x)
def RingEquiv.zeroRingProd (R : Type u_3) (S : Type u_5) [] [] [] :
R ≃+* S × R

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

Instances For
theorem false_of_nontrivial_of_product_domain (R : Type u_9) (S : Type u_10) [Ring R] [Ring S] [IsDomain (R × S)] [] [] :

The product of two nontrivial rings is not a domain

### Order #

instance instOrderedSemiringProd {α : Type u_1} {β : Type u_2} [] [] :
instance instOrderedCommSemiringProd {α : Type u_1} {β : Type u_2} :
instance instOrderedRingProd {α : Type u_1} {β : Type u_2} [] [] :
OrderedRing (α × β)
instance instOrderedCommRingProd {α : Type u_1} {β : Type u_2} [] [] :