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 ConGen).
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.
Implementation notes #
The inductive definition of a congruence relation could be a nested inductive type, defined using
the equivalence closure of a binary relation EqvGen, 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 EqvGen.
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
A congruence relation on a type with an addition is an equivalence relation which preserves addition.
- iseqv : Equivalence ⇑self.toSetoid
Additive congruence relations are closed under addition
Instances For
A congruence relation on a type with a multiplication is an equivalence relation which preserves multiplication.
- iseqv : Equivalence ⇑self.toSetoid
Congruence relations are closed under multiplication
Instances For
The inductively defined smallest additive congruence relation containing a given binary relation.
- of {M : Type u_1} [Add M] {r : M → M → Prop} (x y : M) : r x y → Rel r x y
- refl {M : Type u_1} [Add M] {r : M → M → Prop} (x : M) : Rel r x x
- symm {M : Type u_1} [Add M] {r : M → M → Prop} {x y : M} : Rel r x y → Rel r y x
- trans {M : Type u_1} [Add M] {r : M → M → Prop} {x y z : M} : Rel r x y → Rel r y z → Rel r x z
- add {M : Type u_1} [Add M] {r : M → M → Prop} {w x y z : M} : Rel r w x → Rel r y z → Rel r (w + y) (x + z)
Instances For
The inductively defined smallest multiplicative congruence relation containing a given binary relation.
- of {M : Type u_1} [Mul M] {r : M → M → Prop} (x y : M) : r x y → Rel r x y
- refl {M : Type u_1} [Mul M] {r : M → M → Prop} (x : M) : Rel r x x
- symm {M : Type u_1} [Mul M] {r : M → M → Prop} {x y : M} : Rel r x y → Rel r y x
- trans {M : Type u_1} [Mul M] {r : M → M → Prop} {x y z : M} : Rel r x y → Rel r y z → Rel r x z
- mul {M : Type u_1} [Mul M] {r : M → M → Prop} {w x y z : M} : Rel r w x → Rel r y z → Rel r (w * y) (x * z)
Instances For
Equations
A coercion from a congruence relation to its underlying binary relation.
Equations
A coercion from an additive congruence relation to its underlying binary relation.
Equations
Additive congruence relations are reflexive.
Additive congruence relations are symmetric.
Additive congruence relations are transitive.
Given a type M with a multiplication, a congruence relation c on M, and elements of M
x, y, (x, y) ∈ M × M iff x is related to y by c.
Equations
Given a type M with an addition, x, y ∈ M, and an additive congruence relation
c on M, (x, y) ∈ M × M iff x is related to y by c.
Equations
Two congruence relations are equal iff their underlying binary relations are equal.
Two additive congruence relations are equal iff their underlying binary relations are equal.
Defining the quotient by a congruence relation of a type with a multiplication.
Equations
Instances For
Defining the quotient by an additive congruence relation of a type with an addition.
Equations
Instances For
The morphism into the quotient by a congruence relation
Equations
Instances For
The morphism into the quotient by an additive congruence relation
Equations
Instances For
Coercion from a type with a multiplication to its quotient by a congruence relation.
See Note [use has_coe_t].
Equations
Coercion from a type with an addition to its quotient by an additive congruence relation
Equations
The quotient by a decidable congruence relation has decidable equality.
Equations
The quotient by a decidable additive congruence relation has decidable equality.
Equations
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
Instances For
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
Instances For
A version of Quotient.hrecOn₂' for quotients by Con.
Equations
Instances For
A version of Quotient.hrecOn₂' for quotients by AddCon.
Equations
Instances For
The multiplication induced on the quotient by a congruence relation on a type with a multiplication.
Equations
The addition induced on the quotient by an additive congruence relation on a type with an addition.
Equations
The coercion to the quotient of a congruence relation commutes with multiplication (by definition).
The coercion to the quotient of an additive congruence relation commutes with addition (by definition).
For congruence relations c, d on a type M with a multiplication, c ≤ d iff ∀ x y ∈ M,
x is related to y by d if x is related to y by c.
Equations
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.
Equations
Definition of ≤ for congruence relations.
Definition of ≤ for additive congruence relations.
The infimum of a set of congruence relations on a given type with a multiplication.
Equations
The infimum of a set of additive congruence relations on a given type with an addition.
Equations
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
Equations
The complete lattice of congruence relations on a given type with a multiplication.
Equations
The complete lattice of additive congruence relations on a given type with an addition.
Equations
The infimum of two congruence relations equals the infimum of the underlying binary operations.
The infimum of two additive congruence relations equals the infimum of the underlying binary operations.
Definition of the infimum of two congruence relations.
Definition of the infimum of two additive congruence relations.
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 congruence relation containing a binary relation r is contained in any
congruence relation 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 congruence relation
containing s contains the smallest 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.
Congruence relations equal the smallest congruence relation in which they are contained.
Additive congruence relations equal the smallest additive congruence relation in which they are contained.
The map sending a binary relation to the smallest congruence relation in which it is contained is idempotent.
The map sending a binary relation to the smallest additive congruence relation in which it is contained is idempotent.
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'.
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 congruence relations equals the smallest congruence relation containing the supremum of the underlying binary operations.
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 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 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 is the same as the smallest congruence relation containing the supremum of the set's image under the map to the underlying binary relation.
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.
There is a Galois insertion of congruence relations on a type with a multiplication M into
binary relations on M.
Equations
Instances For
There is a Galois insertion of additive congruence relations on a type with
an addition M into binary relations on M.
Equations
Instances For
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.'
Equations
Instances For
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.'
Equations
Instances For
The quotient of a monoid by a congruence relation is a monoid.
Equations
The quotient of an AddMonoid by an additive congruence relation is
an AddMonoid.
Equations
The 1 of the quotient of a monoid by a congruence relation is the equivalence class of the monoid's 1.
There exists an element of the quotient of a monoid by a congruence relation (namely 1).
Equations
There exists an element of the quotient of an AddMonoid by a congruence relation
(namely 0).
Equations
Additive congruence relations preserve natural scaling.
Equations
Equations
Equations
The quotient of a semigroup by a congruence relation is a semigroup.
Equations
The quotient of an AddSemigroup by an additive congruence relation is
an AddSemigroup.
Equations
The quotient of a commutative magma by a congruence relation is a commutative magma.
Equations
The quotient of an AddCommMagma by an additive congruence relation is
an AddCommMagma.
Equations
The quotient of a commutative semigroup by a congruence relation is a semigroup.
Equations
The quotient of an AddCommSemigroup by an additive congruence relation is
an AddCommSemigroup.
Equations
The quotient of a monoid by a congruence relation is a monoid.
Equations
The quotient of a CommMonoid by a congruence relation is a CommMonoid.
Equations
The quotient of an AddCommMonoid by an additive congruence
relation is an AddCommMonoid.
Equations
Sometimes, a group is defined as a quotient of a monoid by a congruence relation.
Usually, the inverse operation is defined as Setoid.map f _ for some f.
This lemma allows to avoid code duplication in the definition of the inverse operation:
instead of proving both ∀ x y, c x y → c (f x) (f y) (to define the operation)
and ∀ x, c (f x * x) 1 (to prove the group laws), one can only prove the latter.
Sometimes, an additive group is defined as a quotient of a monoid
by an additive congruence relation.
Usually, the inverse operation is defined as Setoid.map f _ for some f.
This lemma allows to avoid code duplication in the definition of the inverse operation:
instead of proving both ∀ x y, c x y → c (f x) (f y) (to define the operation)
and ∀ x, c (f x + x) 0 (to prove the group laws), one can only prove the latter.
Additive congruence relations preserve negation.
Additive congruence relations preserve subtraction.
Additive congruence relations preserve integer scaling.
The inversion induced on the quotient by a congruence relation on a type with an inversion.
Equations
The negation induced on the quotient by an additive congruence relation on a type with a negation.
Equations
The division induced on the quotient by a congruence relation on a type with a division.
Equations
The subtraction induced on the quotient by an additive congruence relation on a type with a subtraction.
Equations
The integer scaling induced on the quotient by a congruence relation on a type with a subtraction.
Equations
The integer power induced on the quotient by a congruence relation on a type with a division.
Equations
The quotient of an AddCommGroup by an additive congruence
relation is an AddCommGroup.
Equations
In order to define a function (Con.Quotient c)ˣ → α on the units of Con.Quotient c,
where c : Con M is a multiplicative congruence on a monoid, it suffices to define a function f
that takes elements x y : M with proofs of c (x * y) 1 and c (y * x) 1, and returns an element
of α provided that f x y _ _ = f x' y' _ _ whenever c x x' and c y y'.
Equations
Instances For
In order to define a function (Con.Quotient c)ˣ → α on the units of Con.Quotient c,
where c : Con M is a multiplicative congruence on a monoid, it suffices to define a function f
that takes elements x y : M with proofs of c (x * y) 1 and c (y * x) 1, and returns an element
of α provided that f x y _ _ = f x' y' _ _ whenever c x x' and c y y'.