# Documentation

Mathlib.RingTheory.Congruence

# 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, such as:
• The CompleteLattice structure.
• The conGen_eq lemma, stating that ringConGen r = sInf {s : RingCon M | ∀ x y, r x y → s x y}.
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.

Instances For
inductive RingConGen.Rel {R : Type u_2} [Add R] [Mul R] (r : RRProp) :
RRProp
• 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)

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

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.

Instances For
instance RingCon.instFunLikeRingConForAllProp {R : Type u_2} [Add R] [Mul R] :
FunLike () R fun x => RProp

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

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)
@[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 Setoid.r a b
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.

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

The morphism into the quotient by a congruence relation

Instances For
instance RingCon.instCoeTCQuotient {R : Type u_2} [Add R] [Mul R] (c : ) :

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

See Note [use has_coe_t].

instance RingCon.instDecidableEqQuotient {R : Type u_2} [Add R] [Mul R] (c : ) [_d : (a b : R) → Decidable (c a b)] :

The quotient by a decidable congruence relation has decidable equality.

@[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 : ) :
@[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 : ) :
@[simp]
theorem RingCon.coe_mul {R : Type u_2} [Add R] [Mul R] (c : ) (x : R) (y : R) :
↑(x * y) = x * y
instance RingCon.instZeroQuotientToAdd {R : Type u_2} [] [Mul R] (c : ) :
@[simp]
theorem RingCon.coe_zero {R : Type u_2} [] [Mul R] (c : ) :
0 = 0
instance RingCon.instOneQuotientToMul {R : Type u_2} [Add R] [] (c : ) :
@[simp]
theorem RingCon.coe_one {R : Type u_2} [Add R] [] (c : ) :
1 = 1
instance RingCon.instSMulQuotientToMul {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) :
SMul α ()
@[simp]
theorem RingCon.coe_smul {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) (a : α) (x : R) :
↑(a x) = a x
@[simp]
theorem RingCon.coe_neg {R : Type u_2} [] [Mul R] (c : ) (x : R) :
↑(-x) = -x
@[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 : ) :
@[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 : ) :
@[simp]
theorem RingCon.coe_nsmul {R : Type u_2} [] [Mul R] (c : ) (n : ) (x : R) :
↑(n x) = n x
@[simp]
theorem RingCon.coe_pow {R : Type u_2} [Add R] [] (c : ) (x : R) (n : ) :
↑(x ^ n) = x ^ n
@[simp]
theorem RingCon.coe_nat_cast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n
@[simp]
theorem RingCon.coe_int_cast {R : Type u_2} [] [Mul R] (c : ) (n : ) :
n = n
instance RingCon.instInhabitedQuotient {R : Type u_2} [] [Add R] [Mul R] (c : ) :

### Algebraic structure #

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

instance RingCon.isScalarTower_right {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] (c : ) :
instance RingCon.smulCommClass {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] [] (c : ) :
instance RingCon.smulCommClass' {α : Type u_1} {R : Type u_2} [Add R] [] [SMul α R] [] [] (c : ) :
def RingCon.mk' {R : Type u_2} [] (c : ) :

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

Instances For