Equivalence relations

The first section of the file defines the complete lattice of equivalence relations on a type, results about the inductively defined equivalence closure of a binary relation, and the analogues of some isomorphism theorems for quotients of arbitrary types.

The second section comprises properties of equivalence relations viewed as partitions.

Implementation notes

The function rel and lemmas ending in ' make it easier to talk about different equivalence relations on the same type.

The complete lattice instance for equivalence relations could have been defined by lifting the Galois insertion of equivalence relations on α into binary relations on α, and then using complete_lattice.copy to define a complete lattice instance with more appropriate definitional equalities (a similar example is filter.lattice.complete_lattice in order/filter/basic.lean). This does not save space, however, and is less clear.

Partitions are not defined as a separate structure here; users are encouraged to reason about them using the existing setoid and its infrastructure.

Tags

setoid, equivalence, iseqv, relation, equivalence relation, partition, equivalence class


setoid.rel

A version of setoid.r that takes the equivalence relation as an explicit argument.

quotient.eq_rel

A version of quotient.eq' compatible with setoid.rel, to make rewriting possible.

setoid.eq_iff_rel_eq

Two equivalence relations are equal iff their underlying binary operations are equal.

setoid.has_le

Defining for equivalence relations.

setoid.ker

The kernel of a function is an equivalence relation.

setoid.ker_mk_eq

The kernel of the quotient map induced by an equivalence relation r equals r.

setoid.lattice.has_inf

The infimum of two equivalence relations.

setoid.inf_def

The infimum of 2 equivalence relations r and s is the same relation as the infimum of the underlying binary operations.

setoid.lattice.has_Inf

The infimum of a set of equivalence relations.

setoid.Inf_def

The underlying binary operation of the infimum of a set of equivalence relations is the infimum of the set's image under the map to the underlying binary operation.

setoid.Inf_le

The infimum of a set of equivalence relations is contained in any element of the set.

setoid.le_Inf

If an equivalence relation r is contained in every element of a set of equivalence relations, r is contained in the infimum of the set.

setoid.eqv_gen_eq

The inductively defined equivalence closure of a binary relation r is the infimum of the set of all equivalence relations containing r.

setoid.lattice.has_sup

The supremum of two equivalence relations, defined as the infimum of the set of equivalence relations containing both.

setoid.sup_eq_eqv_gen

The supremum of two equivalence relations r and s is the equivalence closure of the binary relation x is related to y by r or s.

setoid.sup_def

The supremum of 2 equivalence relations r and s is the equivalence closure of the supremum of the underlying binary operations.

setoid.complete_lattice

The complete lattice of equivalence relations on a type, with bottom element = and top element the trivial equivalence relation.

setoid.Sup_eq_eqv_gen

The supremum of a set S of equivalence relations is the equivalence closure of the binary relation there exists r ∈ S relating x and y.

setoid.Sup_def

The supremum of a set of equivalence relations is the equivalence closure of the supremum of the set's image under the map to the underlying binary operation.

setoid.eqv_gen_of_setoid

The equivalence closure of an equivalence relation r is r.

setoid.eqv_gen_idem

Equivalence closure is idempotent.

setoid.eqv_gen_le

The equivalence closure of a binary relation r is contained in any equivalence relation containing r.

setoid.eqv_gen_mono

Equivalence closure of binary relations is monotonic.

setoid.gi

There is a Galois insertion of equivalence relations on α into binary relations on α, with equivalence closure the lower adjoint.

setoid.injective_iff_ker_bot

A function from α to β is injective iff its kernel is the bottom element of the complete lattice of equivalence relations on α.

setoid.ker_apply_eq_preimage

The elements related to x ∈ α by the kernel of f are those in the preimage of f(x) under f.

setoid.lift_unique

The uniqueness part of the universal property for quotients of an arbitrary type.

setoid.injective_ker_lift

Given a map f from α to β, the natural map from the quotient of α by the kernel of f is injective.

setoid.ker_eq_lift_of_injective

Given a map f from α to β, the kernel of f is the unique equivalence relation on α whose induced map from the quotient of α to β is injective.

setoid.quotient_ker_equiv_range

The first isomorphism theorem for sets: the quotient of α by the kernel of a function f bijects with f's image.

setoid.quotient_ker_equiv_of_surjective

The quotient of α by the kernel of a surjective function f bijects with f's codomain.

setoid.quotient_quotient_equiv_quotient

The third isomorphism theorem for sets.

setoid.map

Given a function f whose kernel is contained in an equivalence relation r, the equivalence closure of the relation on f's image defined by x ≈ y ↔ the elements of f⁻¹(x) are related to the elements of f⁻¹(y) by r.

setoid.map_of_surjective

Given a surjective function f whose kernel is contained in an equivalence relation r, the equivalence relation on f's codomain defined by x ≈ y ↔ the elements of f⁻¹(x) are related to the elements of f⁻¹(y) by r.

setoid.map_of_surjective_eq_map

A special case of the equivalence closure of an equivalence relation r equalling r.

setoid.comap

Given an equivalence relation r on α and a map f to the quotient of α by r, an equivalence relation s on the quotient induces an equivalence relation on f's domain defined by x ≈ y ↔ f(x) is related to f(y) by s.

setoid.correspondence

Given an equivalence relation r on α, the order-preserving bijection between the set of equivalence relations containing r and the equivalence relations on the quotient of α by r.

setoid.eq_of_mem_eqv_class

If x ∈ α is in 2 elements of a set of sets partitioning α, those 2 sets are equal.

setoid.mk_classes

Makes an equivalence relation from a set of sets partitioning α.

setoid.classes

Makes the equivalence classes of an equivalence relation.

setoid.eq_iff_classes_eq

Two equivalence relations are equal iff all their equivalence classes are equal.

setoid.classes_inj

Two equivalence relations are equal iff their equivalence classes are equal.

setoid.empty_not_mem_classes

The empty set is not an equivalence class.

setoid.classes_eqv_classes

Equivalence classes partition the type.

setoid.eq_of_mem_classes

If x ∈ α is in 2 equivalence classes, the equivalence classes are equal.

setoid.eq_eqv_class_of_mem

The elements of a set of sets partitioning α are the equivalence classes of the equivalence relation defined by the set of sets.

setoid.eqv_class_mem

The equivalence classes of the equivalence relation defined by a set of sets partitioning α are elements of the set of sets.

setoid.eqv_classes_disjoint

Distinct elements of a set of sets partitioning α are disjoint.

setoid.eqv_classes_of_disjoint_union

A set of disjoint sets covering α partition α (classical).

setoid.setoid_of_disjoint_union

Makes an equivalence relation from a set of disjoints sets covering α.

setoid.mk_classes_classes

The equivalence relation made from the equivalence classes of an equivalence relation r equals r.

setoid.ne_empty_of_mem_partition

A partition of α does not contain the empty set.

setoid.exists_of_mem_partition

All elements of a partition of α are the equivalence class of some y ∈ α.

setoid.classes_mk_classes

The equivalence classes of the equivalence relation defined by a partition of α equal the original partition.

setoid.partition.le

Defining on partitions as the defined on their induced equivalence relations.

setoid.partition.partial_order

Defining a partial order on partitions as the partial order on their induced equivalence relations.

setoid.partition.order_iso

The order-preserving bijection between equivalence relations and partitions of sets.

setoid.partition.complete_lattice

A complete lattice instance for partitions; there is more infrastructure for the equivalent complete lattice on equivalence relations.