# Congruence relations on rings #

This file defines congruence relations on rings, which extend Con and AddCon on monoids and additive monoids.

Most of the time you likely want to use the Ideal.Quotient API that is built on top of this.

## Main Definitions #

• RingCon R: the type of congruence relations respecting + and *.
• RingConGen r: the inductively defined smallest ring congruence relation containing a given binary relation.

## TODO #

• Use this for RingQuot too.
• Copy across more API from Con and AddCon in GroupTheory/Congruence.lean.
structure RingCon (R : Type u_1) [Add R] [Mul R] extends :
Type u_1

A congruence relation on a type with an addition and multiplication is an equivalence relation which preserves both.

Instances For
@[reducible]
abbrev RingCon.toAddCon {R : Type u_1} [Add R] [Mul R] (self : ) :

The induced additive congruence from a RingCon.

Equations
Instances For
inductive RingConGen.Rel {R : Type u_2} [Add R] [Mul R] (r : RRProp) :
RRProp

The inductively defined smallest ring congruence relation containing a given binary relation.

• of: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} (x y : R), r x y
• refl: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} (x : R),
• symm: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} {x y : R},
• trans: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} {x y z : R},
• add: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} {w x y z : R}, RingConGen.Rel r (w + y) (x + z)
• mul: ∀ {R : Type u_2} [inst : Add R] [inst_1 : Mul R] {r : RRProp} {w x y z : R}, RingConGen.Rel r (w * y) (x * z)
Instances For
def ringConGen {R : Type u_2} [Add R] [Mul R] (r : RRProp) :

The inductively defined smallest ring congruence relation containing a given binary relation.

Equations
• = { r := , iseqv := , mul' := , add' := }
Instances For
instance RingCon.instFunLikeForallProp {R : Type u_2} [Add R] [Mul R] :
FunLike () R (RProp)

A coercion from a congruence relation to its underlying binary relation.

Equations
• RingCon.instFunLikeForallProp = { coe := fun (c : ) => Setoid.r, coe_injective' := }
theorem RingCon.rel_eq_coe {R : Type u_2} [Add R] [Mul R] (c : ) :
Setoid.r = c
@[simp]
theorem RingCon.toCon_coe_eq_coe {R : Type u_2} [Add R] [Mul R] (c : ) :
c.toCon = c
theorem RingCon.refl {R : Type u_2} [Add R] [Mul R] (c : ) (x : R) :
c x x
theorem RingCon.symm {R : Type u_2} [Add R] [Mul R] (c : ) {x : R} {y : R} :
c x yc y x
theorem RingCon.trans {R : Type u_2} [Add R] [Mul R] (c : ) {x : R} {y : R} {z : R} :
c x yc y zc x z
theorem RingCon.add {R : Type u_2} [Add R] [Mul R] (c : ) {w : R} {x : R} {y : R} {z : R} :
c w xc y zc (w + y) (x + z)
theorem RingCon.mul {R : Type u_2} [Add R] [Mul R] (c : ) {w : R} {x : R} {y : R} {z : R} :
c w xc y zc (w * y) (x * z)
instance RingCon.instInhabited {R : Type u_2} [Add R] [Mul R] :
Equations
• RingCon.instInhabited = { default := ringConGen EmptyRelation }
@[simp]
theorem RingCon.rel_mk {R : Type u_2} [Add R] [Mul R] {s : Con R} {h : ∀ {w x y z : R}, Setoid.r w xSetoid.r y zSetoid.r (w + y) (x + z)} {a : R} {b : R} :
{ toCon := s, add' := h } a b s a b
theorem RingCon.ext' {R : Type u_2} [Add R] [Mul R] {c : } {d : } (H : c = d) :
c = d

The map sending a congruence relation to its underlying binary relation is injective.

theorem RingCon.ext {R : Type u_2} [Add R] [Mul R] {c : } {d : } (H : ∀ (x y : R), c x y d x y) :
c = d

Extensionality rule for congruence relations.

def RingCon.Quotient {R : Type u_2} [Add R] [Mul R] (c : ) :
Type u_2

Defining the quotient by a congruence relation of a type with addition and multiplication.

Equations
Instances For
def RingCon.toQuotient {R : Type u_2} [Add R] [Mul R] {c : } (r : R) :
c.Quotient

The morphism into the quotient by a congruence relation

Equations
• r =
Instances For
instance RingCon.instCoeTCQuotient {R : Type u_2} [Add R] [Mul R] (c : ) :
CoeTC R c.Quotient

Coercion from a type with addition and multiplication to its quotient by a congruence relation.

See Note [use has_coe_t].

Equations
• c.instCoeTCQuotient = { coe := RingCon.toQuotient }
@[instance 500]
instance RingCon.instDecidableEqQuotientOfDecidableCoeForallProp {R : Type u_2} [Add R] [Mul R] (c : ) [_d : (a b : R) → Decidable (c a b)] :
DecidableEq c.Quotient

The quotient by a decidable congruence relation has decidable equality.

Equations
@[simp]
theorem RingCon.quot_mk_eq_coe {R : Type u_2} [Add R] [Mul R] (c : ) (x : R) :
Quot.mk (c) x = x
@[simp]
theorem RingCon.eq {R : Type u_2} [Add R] [Mul R] (c : ) {a : R} {b : R} :
a = b c a b

Two elements are related by a congruence relation c iff they are represented by the same element of the quotient by c.

### Basic notation #

The basic algebraic notation, 0, 1, +, *, -, ^, descend naturally under the quotient

instance RingCon.instAddQuotient {R : Type u_2} [Add R] [Mul R] (c : ) :
Equations
@[simp]
theorem RingCon.coe_add {R : Type u_2} [Add R] [Mul R] (c : ) (x : R) (y : R) :
(x + y) = x + y
instance RingCon.instMulQuotient {R : Type u_2} [Add R] [Mul R] (c : ) :
Mul c.Quotient
Equations
@[simp]
theorem RingCon.coe_mul {R : Type u_2} [Add R] [Mul R] (c : ) (x : R) (y : R) :
(x * y) = x * y
instance RingCon.instZeroQuotient {R : Type u_2} [] [Mul R] (c : ) :
Zero c.Quotient
Equations
@[simp]
theorem RingCon.coe_zero {R : Type u_2} [] [Mul R] (c : ) :
0 = 0
instance RingCon.instOneQuotient {R : Type u_2} [Add R] [] (c : ) :
One c.Quotient
Equations
@[simp]
theorem RingCon.coe_one {R : Type u_2} [Add R] [] (c : ) :
1 = 1
instance RingCon.instSMulQuotient {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) :
SMul α c.Quotient
Equations
@[simp]
theorem RingCon.coe_smul {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) (a : α) (x : R) :
(a x) = a x
instance RingCon.instNegQuotient {R : Type u_2} [] [Mul R] (c : ) :
Neg c.Quotient
Equations
@[simp]
theorem RingCon.coe_neg {R : Type u_2} [] [Mul R] (c : ) (x : R) :
(-x) = -x
instance RingCon.instSubQuotient {R : Type u_2} [] [Mul R] (c : ) :
Sub c.Quotient
Equations
@[simp]
theorem RingCon.coe_sub {R : Type u_2} [] [Mul R] (c : ) (x : R) (y : R) :
(x - y) = x - y
instance RingCon.hasZSMul {R : Type u_2} [] [Mul R] (c : ) :
SMul c.Quotient
Equations
@[simp]
theorem RingCon.coe_zsmul {R : Type u_2} [] [Mul R] (c : ) (z : ) (x : R) :
(z x) = z x
instance RingCon.hasNSMul {R : Type u_2} [] [Mul R] (c : ) :
SMul c.Quotient
Equations
@[simp]
theorem RingCon.coe_nsmul {R : Type u_2} [] [Mul R] (c : ) (n : ) (x : R) :
(n x) = n x
instance RingCon.instPowQuotientNat {R : Type u_2} [Add R] [] (c : ) :
Pow c.Quotient
Equations
@[simp]
theorem RingCon.coe_pow {R : Type u_2} [Add R] [] (c : ) (x : R) (n : ) :
(x ^ n) = x ^ n
instance RingCon.instNatCastQuotient {R : Type u_2} [] [Mul R] (c : ) :
NatCast c.Quotient
Equations
• c.instNatCastQuotient = { natCast := fun (n : ) => n }
@[simp]
theorem RingCon.coe_natCast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n
@[deprecated RingCon.coe_natCast]
theorem RingCon.coe_nat_cast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n

Alias of RingCon.coe_natCast.

instance RingCon.instIntCastQuotient {R : Type u_2} [] [Mul R] (c : ) :
IntCast c.Quotient
Equations
• c.instIntCastQuotient = { intCast := fun (z : ) => z }
@[simp]
theorem RingCon.coe_intCast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n
@[deprecated RingCon.coe_intCast]
theorem RingCon.coe_int_cast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n

Alias of RingCon.coe_intCast.

instance RingCon.instInhabitedQuotient {R : Type u_2} [] [Add R] [Mul R] (c : ) :
Inhabited c.Quotient
Equations
• c.instInhabitedQuotient = { default := default }

### Algebraic structure #

The operations above on the quotient by c : RingCon R preserve the algebraic structure of R.

Equations
instance RingCon.instNonAssocSemiringQuotient {R : Type u_2} [] (c : ) :
NonAssocSemiring c.Quotient
Equations
instance RingCon.instNonUnitalSemiringQuotient {R : Type u_2} (c : ) :
Equations
instance RingCon.instSemiringQuotient {R : Type u_2} [] (c : ) :
Semiring c.Quotient
Equations
instance RingCon.instCommSemiringQuotient {R : Type u_2} [] (c : ) :
CommSemiring c.Quotient
Equations
Equations
instance RingCon.instNonAssocRingQuotient {R : Type u_2} [] (c : ) :
NonAssocRing c.Quotient
Equations
instance RingCon.instNonUnitalRingQuotient {R : Type u_2} [] (c : ) :
NonUnitalRing c.Quotient
Equations
instance RingCon.instRingQuotient {R : Type u_2} [Ring R] (c : ) :
Ring c.Quotient
Equations
instance RingCon.instCommRingQuotient {R : Type u_2} [] (c : ) :
CommRing c.Quotient
Equations
instance RingCon.isScalarTower_right {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) :
IsScalarTower α c.Quotient c.Quotient
Equations
• =
instance RingCon.smulCommClass {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] [] (c : ) :
SMulCommClass α c.Quotient c.Quotient
Equations
• =
instance RingCon.smulCommClass' {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] [] (c : ) :
SMulCommClass c.Quotient α c.Quotient
Equations
• =
instance RingCon.instDistribMulActionQuotientOfIsScalarTower {α : Type u_1} {R : Type u_2} [] [] [] [] (c : ) :
DistribMulAction α c.Quotient
Equations
• c.instDistribMulActionQuotientOfIsScalarTower = let __src := c.mulAction;
instance RingCon.instMulSemiringActionQuotientOfIsScalarTower {α : Type u_1} {R : Type u_2} [] [] [] [] (c : ) :
MulSemiringAction α c.Quotient
Equations
• c.instMulSemiringActionQuotientOfIsScalarTower =
def RingCon.mk' {R : Type u_2} [] (c : ) :
R →+* c.Quotient

The natural homomorphism from a ring to its quotient by a congruence relation.

Equations
• c.mk' = { toFun := RingCon.toQuotient, map_one' := , map_mul' := , map_zero' := , map_add' := }
Instances For

### Lattice structure #

The API in this section is copied from Mathlib/GroupTheory/Congruence.lean

instance RingCon.instLE {R : Type u_2} [Add R] [Mul R] :
LE ()

For congruence relations c, d on a type M with multiplication and addition, c ≤ d iff ∀ x y ∈ M, x is related to y by d if x is related to y by c.

Equations
• RingCon.instLE = { le := fun (c d : ) => ∀ ⦃x y : R⦄, c x yd x y }
theorem RingCon.le_def {R : Type u_2} [Add R] [Mul R] {c : } {d : } :
c d ∀ {x y : R}, c x yd x y

Definition of ≤ for congruence relations.

instance RingCon.instInfSet {R : Type u_2} [Add R] [Mul R] :

The infimum of a set of congruence relations on a given type with multiplication and addition.

Equations
• RingCon.instInfSet = { sInf := fun (S : Set ()) => { r := fun (x y : R) => cS, c x y, iseqv := , mul' := , add' := } }
theorem RingCon.sInf_toSetoid {R : Type u_2} [Add R] [Mul R] (S : Set ()) :
(sInf S).toSetoid = sInf ((fun (x : ) => x.toSetoid) '' S)

The infimum of a set of congruence relations is the same as the infimum of the set's image under the map to the underlying equivalence relation.

@[simp]
theorem RingCon.coe_sInf {R : Type u_2} [Add R] [Mul R] (S : Set ()) :
(sInf S) = sInf (DFunLike.coe '' S)

The infimum of a set of congruence relations is the same as the infimum of the set's image under the map to the underlying binary relation.

@[simp]
theorem RingCon.coe_iInf {R : Type u_2} [Add R] [Mul R] {ι : Sort u_3} (f : ι) :
(iInf f) = ⨅ (i : ι), (f i)
instance RingCon.instPartialOrder {R : Type u_2} [Add R] [Mul R] :
Equations
• RingCon.instPartialOrder =
instance RingCon.instCompleteLattice {R : Type u_2} [Add R] [Mul R] :

The complete lattice of congruence relations on a given type with multiplication and addition.

Equations
@[simp]
theorem RingCon.coe_top {R : Type u_2} [Add R] [Mul R] :
=
@[simp]
theorem RingCon.coe_bot {R : Type u_2} [Add R] [Mul R] :
= Eq
@[simp]
theorem RingCon.coe_inf {R : Type u_2} [Add R] [Mul R] {c : } {d : } :
(c d) = c d

The infimum of two congruence relations equals the infimum of the underlying binary operations.

theorem RingCon.inf_iff_and {R : Type u_2} [Add R] [Mul R] {c : } {d : } {x : R} {y : R} :
(c d) x y c x y d x y

Definition of the infimum of two congruence relations.

instance RingCon.instNontrivial {R : Type u_2} [Add R] [Mul R] [] :
Equations
• =
theorem RingCon.ringConGen_eq {R : Type u_2} [Add R] [Mul R] (r : RRProp) :
= sInf {s : | ∀ (x y : R), r x ys x y}

The inductively defined smallest congruence relation containing a binary relation r equals the infimum of the set of congruence relations containing r.

theorem RingCon.ringConGen_le {R : Type u_2} [Add R] [Mul R] {r : RRProp} {c : } (h : ∀ (x y : R), r x yc x y) :
c

The smallest congruence relation containing a binary relation r is contained in any congruence relation containing r.

theorem RingCon.ringConGen_mono {R : Type u_2} [Add R] [Mul R] {r : RRProp} {s : RRProp} (h : ∀ (x y : R), r x ys x y) :

Given binary relations r, s with r contained in s, the smallest congruence relation containing s contains the smallest congruence relation containing r.

theorem RingCon.ringConGen_of_ringCon {R : Type u_2} [Add R] [Mul R] (c : ) :
= c

Congruence relations equal the smallest congruence relation in which they are contained.

theorem RingCon.ringConGen_idem {R : Type u_2} [Add R] [Mul R] (r : RRProp) :
ringConGen () =

The map sending a binary relation to the smallest congruence relation in which it is contained is idempotent.

theorem RingCon.sup_eq_ringConGen {R : Type u_2} [Add R] [Mul R] (c : ) (d : ) :
c d = ringConGen fun (x y : R) => c x y d x y

The supremum of congruence relations c, d equals the smallest congruence relation containing the binary relation 'x is related to y by c or d'.

theorem RingCon.sup_def {R : Type u_2} [Add R] [Mul R] {c : } {d : } :
c d = ringConGen (c d)

The supremum of two congruence relations equals the smallest congruence relation containing the supremum of the underlying binary operations.

theorem RingCon.sSup_eq_ringConGen {R : Type u_2} [Add R] [Mul R] (S : Set ()) :
sSup S = ringConGen fun (x y : R) => cS, c x y

The supremum of a set of congruence relations S equals the smallest congruence relation containing the binary relation 'there exists c ∈ S such that x is related to y by c'.

theorem RingCon.sSup_def {R : Type u_2} [Add R] [Mul R] {S : Set ()} :
sSup S = ringConGen (sSup (DFunLike.coe '' S))

The supremum of a set of congruence relations is the same as the smallest congruence relation containing the supremum of the set's image under the map to the underlying binary relation.

def RingCon.gi (R : Type u_2) [Add R] [Mul R] :
GaloisInsertion ringConGen DFunLike.coe

There is a Galois insertion of congruence relations on a type with multiplication and addition R into binary relations on R.

Equations
• = { choice := fun (r : RRProp) (_h : () r) => , gc := , le_l_u := , choice_eq := }
Instances For