Congruence relations
This file defines congruence relations: equivalence relations that preserve a binary operation,
which in this case is multiplication or addition. The principal definition is a structure
extending a setoid
(an equivalence relation), and the inductive definition of the smallest
congruence relation containing a binary relation is also given (see con_gen
).
The file also proves basic properties of the quotient of a type by a congruence relation, and the
complete lattice of congruence relations on a type. We then establish an order-preserving bijection
between the set of congruence relations containing a congruence relation c
and the set of
congruence relations on the quotient by c
.
The second half of the file concerns congruence relations on monoids, in which case the quotient by the congruence relation is also a monoid. There are results about the universal property of quotients of monoids, and the isomorphism theorems for monoids.
Implementation notes
The inductive definition of a congruence relation could be a nested inductive type, defined using
the equivalence closure of a binary relation eqv_gen
, but the recursor generated does not work.
A nested inductive definition could conceivably shorten proofs, because they would allow invocation
of the corresponding lemmas about eqv_gen
.
The lemmas refl
, symm
and trans
are not tagged with @[refl]
, @[symm]
, and @[trans]
respectively as these tags do not work on a structure coerced to a binary relation.
There is a coercion from elements of a type to the element's equivalence class under a congruence relation.
A congruence relation on a monoid M
can be thought of as a submonoid of M × M
for which
membership is an equivalence relation, but whilst this fact is established in the file, it is not
used, since this perspective adds more layers of definitional unfolding.
Tags
congruence, congruence relation, quotient, quotient by congruence relation, monoid, quotient monoid, isomorphism theorems
- of : ∀ {M : Type u_1} [_inst_1 : has_add M] (r : M → M → Prop) (x y : M), r x y → add_con_gen.rel r x y
- refl : ∀ {M : Type u_1} [_inst_1 : has_add M] (r : M → M → Prop) (x : M), add_con_gen.rel r x x
- symm : ∀ {M : Type u_1} [_inst_1 : has_add M] (r : M → M → Prop) (x y : M), add_con_gen.rel r x y → add_con_gen.rel r y x
- trans : ∀ {M : Type u_1} [_inst_1 : has_add M] (r : M → M → Prop) (x y z : M), add_con_gen.rel r x y → add_con_gen.rel r y z → add_con_gen.rel r x z
- add : ∀ {M : Type u_1} [_inst_1 : has_add M] (r : M → M → Prop) (w x y z : M), add_con_gen.rel r w x → add_con_gen.rel r y z → add_con_gen.rel r (w + y) (x + z)
The inductively defined smallest additive congruence relation containing a given binary relation.
- of : ∀ {M : Type u_1} [_inst_1 : has_mul M] (r : M → M → Prop) (x y : M), r x y → con_gen.rel r x y
- refl : ∀ {M : Type u_1} [_inst_1 : has_mul M] (r : M → M → Prop) (x : M), con_gen.rel r x x
- symm : ∀ {M : Type u_1} [_inst_1 : has_mul M] (r : M → M → Prop) (x y : M), con_gen.rel r x y → con_gen.rel r y x
- trans : ∀ {M : Type u_1} [_inst_1 : has_mul M] (r : M → M → Prop) (x y z : M), con_gen.rel r x y → con_gen.rel r y z → con_gen.rel r x z
- mul : ∀ {M : Type u_1} [_inst_1 : has_mul M] (r : M → M → Prop) (w x y z : M), con_gen.rel r w x → con_gen.rel r y z → con_gen.rel r (w * y) (x * z)
The inductively defined smallest multiplicative congruence relation containing a given binary relation.
The inductively defined smallest additive congruence relation containing a given binary relation.
Equations
A coercion from an additive congruence relation to its underlying binary relation.
A coercion from a congruence relation to its underlying binary relation.
Additive congruence relations are reflexive.
Given types with multiplications M, N
, the product of two congruence relations c
on M
and
d
on N
: (x₁, x₂), (y₁, y₂) ∈ M × N
are related by c.prod d
iff x₁
is related to y₁
by c
and x₂
is related to y₂
by d
.
Given types with additions M, N
, the product of two congruence relations
c
on M
and d
on N
: (x₁, x₂), (y₁, y₂) ∈ M × N
are related by c.prod d
iff x₁
is related to y₁
by c
and x₂
is related to y₂
by d
.
The product of an indexed collection of additive congruence relations.
Defining the quotient by an additive congruence relation of a type with an addition.
Coercion from a type with a multiplication to its quotient by a congruence relation.
See Note [use has_coe_t].
The quotient of a type with decidable equality by an additive congruence relation also has decidable equality.
The quotient of a type with decidable equality by a congruence relation also has decidable equality.
Equations
The function on the quotient by a congruence relation c
induced by a function that is
constant on c
's equivalence classes.
Equations
- con.lift_on q f h = quotient.lift_on' q f h
The binary function on the quotient by a congruence relation c
induced by a binary function
that is constant on c
's equivalence classes.
Equations
- con.lift_on₂ q r f h = quotient.lift_on₂' q r f h
The binary function on the quotient by a congruence relation c
induced by a binary function that is constant on c
's equivalence classes.
A version of add_con.induction_on
for predicates which take
two arguments.
The kernel of the quotient map induced by a congruence relation c
equals c
.
The kernel of the quotient map induced by an additive congruence relation
c
equals c
.
Definition of the function on the quotient by a congruence relation c
induced by a function
that is constant on c
's equivalence classes.
Definition of the function on the quotient by an additive congruence
relation c
induced by a function that is constant on c
's equivalence classes.
Makes an isomorphism of quotients by two congruence relations, given that the relations are equal.
Equations
- con.congr h = {to_fun := (quotient.congr (equiv.refl M) _).to_fun, inv_fun := (quotient.congr (equiv.refl M) _).inv_fun, left_inv := _, right_inv := _, map_mul' := _}
For additive congruence relations c, d
on a type M
with an addition, c ≤ d
iff
∀ x y ∈ M
, x
is related to y
by d
if x
is related to y
by c
.
The infimum of a set of additive congruence relations on a given type with an addition.
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.
The infimum of a set of additive congruence relations is the same as the infimum of the set's image under the map to the underlying equivalence relation.
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.
The infimum of a set of additive congruence relations is the same as the infimum of the set's image under the map to the underlying binary relation.
Equations
- con.partial_order = {le := has_le.le con.has_le, lt := λ (c d : con M), c ≤ d ∧ ¬d ≤ c, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _}
The complete lattice of additive congruence relations on a given type with an addition.
The complete lattice of congruence relations on a given type with a multiplication.
Equations
- con.complete_lattice = {sup := complete_lattice.sup (complete_lattice_of_Inf (con M) con.complete_lattice._proof_1), le := complete_lattice.le (complete_lattice_of_Inf (con M) con.complete_lattice._proof_1), lt := complete_lattice.lt (complete_lattice_of_Inf (con M) con.complete_lattice._proof_1), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := λ (c d : con M), {r := setoid.r (c.to_setoid ⊓ d.to_setoid), iseqv := _, mul' := _}, inf_le_left := _, inf_le_right := _, le_inf := _, top := {r := setoid.r complete_lattice.top, iseqv := _, mul' := _}, le_top := _, bot := {r := setoid.r complete_lattice.bot, iseqv := _, mul' := _}, bot_le := _, Sup := complete_lattice.Sup (complete_lattice_of_Inf (con M) con.complete_lattice._proof_1), Inf := complete_lattice.Inf (complete_lattice_of_Inf (con M) con.complete_lattice._proof_1), le_Sup := _, Sup_le := _, Inf_le := _, le_Inf := _}
The inductively defined smallest congruence relation containing a binary relation r
equals
the infimum of the set of congruence relations containing r
.
The inductively defined smallest additive congruence relation
containing a binary relation r
equals the infimum of the set of additive congruence relations
containing r
.
The smallest additive congruence relation containing a binary
relation r
is contained in any additive congruence relation containing r
.
Given binary relations r, s
with r
contained in s
, the
smallest additive congruence relation containing s
contains the smallest additive congruence
relation containing r
.
Additive congruence relations equal the smallest additive congruence relation in which they are contained.
The map sending a binary relation to the smallest additive congruence relation in which it is contained is idempotent.
The supremum of additive congruence relations c, d
equals the
smallest additive congruence relation containing the binary relation 'x
is related to y
by c
or d
'.
The supremum of two additive congruence relations equals the smallest additive congruence relation containing the supremum of the underlying binary operations.
The supremum of a set of additive congruence relations S
equals
the smallest additive congruence relation containing the binary relation 'there exists c ∈ S
such that x
is related to y
by c
'.
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
'.
The supremum of a set of additive congruence relations is the same as the smallest additive congruence relation containing the supremum of the set's image under the map to the underlying binary relation.
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.
There is a Galois insertion of additive congruence relations on a type with
an addition M
into binary relations on M
.
There is a Galois insertion of congruence relations on a type with a multiplication M
into
binary relations on M
.
Given a function f
, the smallest congruence relation containing the binary relation on f
's
image defined by 'x ≈ y
iff the elements of f⁻¹(x)
are related to the elements of f⁻¹(y)
by a congruence relation c
.'
Given a function f
, the smallest additive congruence relation containing the
binary relation on f
's image defined by 'x ≈ y
iff the elements of f⁻¹(x)
are related to the
elements of f⁻¹(y)
by an additive congruence relation c
.'
Given a surjective multiplicative-preserving function f
whose kernel is contained in a
congruence relation c
, the congruence relation on f
's codomain defined by 'x ≈ y
iff the
elements of f⁻¹(x)
are related to the elements of f⁻¹(y)
by c
.'
Equations
- c.map_of_surjective f H h hf = {r := setoid.r (c.to_setoid.map_of_surjective f h hf), iseqv := _, mul' := _}
Given a surjective addition-preserving function f
whose kernel is contained in
an additive congruence relation c
, the additive congruence relation on f
's codomain defined
by 'x ≈ y
iff the elements of f⁻¹(x)
are related to the elements of f⁻¹(y)
by c
.'
A specialization of 'the smallest additive congruence relation containing
an additive congruence relation c
equals c
'.
A specialization of 'the smallest congruence relation containing a congruence relation c
equals c
'.
Given types with multiplications M, N
and a congruence relation c
on N
, a
multiplication-preserving map f : M → N
induces a congruence relation on f
's domain
defined by 'x ≈ y
iff f(x)
is related to f(y)
by c
.'
Given types with additions M, N
and an additive congruence relation c
on N
,
an addition-preserving map f : M → N
induces an additive congruence relation on f
's domain
defined by 'x ≈ y
iff f(x)
is related to f(y)
by c
.'
Given an additive congruence relation c
on a type M
with an addition,
the order-preserving bijection between the set of additive congruence relations containing c
and
the additive congruence relations on the quotient of M
by c
.
Given a congruence relation c
on a type M
with a multiplication, the order-preserving
bijection between the set of congruence relations containing c
and the congruence relations
on the quotient of M
by c
.
The quotient of an add_monoid
by an additive congruence relation is
an add_monoid
.
The quotient of a comm_monoid
by a congruence relation is a comm_monoid
.
Equations
- c.comm_monoid = {mul := monoid.mul c.monoid, mul_assoc := _, one := monoid.one c.monoid, one_mul := _, mul_one := _, mul_comm := _}
The quotient of an add_comm_monoid
by an additive congruence
relation is an add_comm_monoid
.
The 0 of the quotient of an add_monoid
by an additive congruence relation
is the equivalence class of the add_monoid
's 0.
The add_submonoid
of M × M
defined by an additive congruence
relation on an add_monoid
M
.
The additive congruence relation on an add_monoid
M
from
an add_submonoid
of M × M
for which membership is an equivalence relation.
The congruence relation on a monoid M
from a submonoid of M × M
for which membership
is an equivalence relation.
Coercion from a congruence relation c
on a monoid M
to the submonoid of M × M
whose
elements are (x, y)
such that x
is related to y
by c
.
Equations
- con.to_submonoid = {coe := λ (c : con M), con.submonoid M c}
Coercion from a congruence relation c
on an add_monoid
M
to the add_submonoid
of M × M
whose elements are (x, y)
such that x
is related to y
by c
.
The kernel of an add_monoid
homomorphism as an additive congruence relation.
The definition of the additive congruence relation defined by an add_monoid
homomorphism's kernel.
There exists an element of the quotient of an add_monoid
by a congruence relation
(namely 0).
The natural homomorphism from an add_monoid
to its quotient by an additive
congruence relation.
The kernel of the natural homomorphism from an add_monoid
to its quotient by
an additive congruence relation c
equals c
.
The natural homomorphism from a monoid to its quotient by a congruence relation is surjective.
The natural homomorphism from an add_monoid
to its quotient by a congruence
relation is surjective.
The elements related to x ∈ M
, M
an add_monoid
, by the kernel of
an add_monoid
homomorphism are those in the preimage of f(x)
under f
.
Given an add_monoid
homomorphism f : N → M
and an additive congruence relation
c
on M
, the additive congruence relation induced on N
by f
equals the kernel of c
's
quotient homomorphism composed with f
.
Given a monoid homomorphism f : N → M
and a congruence relation c
on M
, the congruence
relation induced on N
by f
equals the kernel of c
's quotient homomorphism composed with
f
.
The homomorphism on the quotient of an add_monoid
by an additive congruence
relation c
induced by a homomorphism constant on c
's equivalence classes.
The diagram describing the universal property for quotients of add_monoid
s
commutes.
The diagram describing the universal property for quotients of add_monoid
s
commutes.
The diagram describing the universal property for quotients of add_monoid
s
commutes.
Given a homomorphism f
from the quotient of an add_monoid
by an additive
congruence relation, f
equals the homomorphism on the quotient induced by f
composed with the
natural map from the add_monoid
to the quotient.
Given a homomorphism f
from the quotient of a monoid by a congruence relation, f
equals the
homomorphism on the quotient induced by f
composed with the natural map from the monoid to
the quotient.
Homomorphisms on the quotient of an add_monoid
by an additive congruence relation
are equal if they are equal on elements that are coercions from the add_monoid
.
The uniqueness part of the universal property for quotients of add_monoid
s.
Given an additive congruence relation c
on an add_monoid
and a homomorphism f
constant on c
's equivalence classes, f
has the same image as the homomorphism that f
induces
on the quotient.
Surjective add_monoid
homomorphisms constant on an additive congruence
relation c
's equivalence classes induce a surjective homomorphism on c
's quotient.
Surjective monoid homomorphisms constant on a congruence relation c
's equivalence classes
induce a surjective homomorphism on c
's quotient.
Given an add_monoid
homomorphism f
from M
to P
, the kernel of f
is the unique additive congruence relation on M
whose induced map from the quotient of M
to P
is injective.
Given a monoid homomorphism f
from M
to P
, the kernel of f
is the unique congruence
relation on M
whose induced map from the quotient of M
to P
is injective.
The homomorphism induced on the quotient of an add_monoid
by the kernel
of an add_monoid
homomorphism.
The diagram described by the universal property for quotients of monoids, when the congruence relation is the kernel of the homomorphism, commutes.
The diagram described by the universal property for quotients
of add_monoid
s, when the additive congruence relation is the kernel of the homomorphism,
commutes.
Given an add_monoid
homomorphism f
, the induced homomorphism
on the quotient by f
's kernel has the same image as f
.
Given a monoid homomorphism f
, the induced homomorphism on the quotient by f
's kernel has
the same image as f
.
An add_monoid
homomorphism f
induces an injective homomorphism on the quotient
by f
's kernel.
A monoid homomorphism f
induces an injective homomorphism on the quotient by f
's kernel.
Given additive congruence relations c, d
on an add_monoid
such that d
contains c
, d
's quotient map induces a homomorphism from the quotient by c
to the quotient
by d
.
Given congruence relations c, d
on a monoid such that d
contains c
, the definition of
the homomorphism from the quotient by c
to the quotient by d
induced by d
's quotient
map.
Given additive congruence relations c, d
on an add_monoid
such that d
contains c
, the definition of the homomorphism from the quotient by c
to the quotient by d
induced by d
's quotient map.
The first isomorphism theorem for monoids.
Equations
- con.quotient_ker_equiv_range f = {to_fun := (equiv.of_bijective ⇑((mul_equiv.submonoid_congr con.ker_lift_range_eq).to_monoid_hom.comp (con.ker_lift f).mrange_restrict) _).to_fun, inv_fun := (equiv.of_bijective ⇑((mul_equiv.submonoid_congr con.ker_lift_range_eq).to_monoid_hom.comp (con.ker_lift f).mrange_restrict) _).inv_fun, left_inv := _, right_inv := _, map_mul' := _}
The first isomorphism theorem for add_monoid
s.
The first isomorphism theorem for monoids in the case of a surjective homomorphism.
Equations
- con.quotient_ker_equiv_of_surjective f hf = {to_fun := (equiv.of_bijective ⇑(con.ker_lift f) _).to_fun, inv_fun := (equiv.of_bijective ⇑(con.ker_lift f) _).inv_fun, left_inv := _, right_inv := _, map_mul' := _}
The first isomorphism theorem for add_monoid
s in the case of a surjective
homomorphism.
The second isomorphism theorem for monoids.
Equations
- c.comap_quotient_equiv f = (con.congr con.comap_eq).trans (con.quotient_ker_equiv_range (c.mk'.comp f))
The second isomorphism theorem for add_monoid
s.
The third isomorphism theorem for monoids.
The third isomorphism theorem for add_monoid
s.