Documentation

Mathlib.CategoryTheory.EquivalenceRelation

Equivalence relations #

We define internal equivalence relations (sometimes called congruences) in any category C, as a structure on pairs of parallel morphisms p₁, p₂ : R ⟶ X . We also define effective and universally effective equivalence relations.

We prove that equivalence relations on types provide internal equivalence relation structures in the category of types. In general, kernel pairs in any category are internal equivalence relations.

References #

class CategoryTheory.JointlyMono₂ {C : Type u_1} [Category.{v_1, u_1} C] {R X₁ X₂ : C} (p₁ : R X₁) (p₂ : R X₂) :

A typeclass for pairs of morphisms that are jointly monic.

Instances
    structure CategoryTheory.ReflexiveRelation {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} (p₁ p₂ : R X) extends CategoryTheory.JointlyMono₂ p₁ p₂ :
    Type v_1

    A reflexive relation is a jointly monic pair of parallel morphisms p₁, p₂ : R ⟶ X, together with a section r : X ⟶ R of both p₁ and p₂.

    Instances For
      @[simp]
      theorem CategoryTheory.ReflexiveRelation.reflexivity₁_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : ReflexiveRelation p₁ p₂) {Z : C} (h : X Z) :
      @[simp]
      theorem CategoryTheory.ReflexiveRelation.reflexivity₂_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : ReflexiveRelation p₁ p₂) {Z : C} (h : X Z) :
      @[simp]
      theorem CategoryTheory.ReflexiveRelation.reflexivity₂_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : ReflexiveRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier X) :
      @[simp]
      theorem CategoryTheory.ReflexiveRelation.reflexivity₁_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : ReflexiveRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier X) :
      structure CategoryTheory.SymmetricRelation {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} (p₁ p₂ : R X) extends CategoryTheory.JointlyMono₂ p₁ p₂ :
      Type v_1

      A symmetric relation is a jointly monic pair of parallel morphisms p₁, p₂ : R ⟶ X together with a morphism s : R ⟶ R which interchanges p₁ and p₂.

      Instances For
        @[simp]
        theorem CategoryTheory.SymmetricRelation.symmetry₁_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : SymmetricRelation p₁ p₂) {Z : C} (h : X Z) :
        @[simp]
        theorem CategoryTheory.SymmetricRelation.symmetry₂_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : SymmetricRelation p₁ p₂) {Z : C} (h : X Z) :
        @[simp]
        theorem CategoryTheory.SymmetricRelation.symmetry₂_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : SymmetricRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier R) :
        @[simp]
        theorem CategoryTheory.SymmetricRelation.symmetry₁_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : SymmetricRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier R) :
        structure CategoryTheory.TransitiveRelation {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} (p₁ p₂ : R X) extends CategoryTheory.JointlyMono₂ p₁ p₂ :
        Type (max u_1 v_1)

        A transitive relation is a jointly monic pair of parallel morphisms p₁, p₂ : R ⟶ X, together with a limiting pullback cone c for p₁ and p₂ and a map c.pt ⟶ R which factors the two projections c.pt ⟶ X through R.

        Instances For
          @[simp]
          theorem CategoryTheory.TransitiveRelation.transitivity₁_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : TransitiveRelation p₁ p₂) {Z : C} (h : X Z) :
          @[simp]
          theorem CategoryTheory.TransitiveRelation.transitivity₂_assoc {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : TransitiveRelation p₁ p₂) {Z : C} (h : X Z) :
          @[simp]
          theorem CategoryTheory.TransitiveRelation.transitivity₁_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : TransitiveRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier self.c.pt) :
          @[simp]
          theorem CategoryTheory.TransitiveRelation.transitivity₂_apply {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} {p₁ p₂ : R X} (self : TransitiveRelation p₁ p₂) {F : CCType uF} {carrier : CType w} {instFunLike : (X Y : C) → FunLike (F X Y) (carrier X) (carrier Y)} [inst : ConcreteCategory C F] (x : carrier self.c.pt) :
          structure CategoryTheory.EquivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} (p₁ p₂ : R X) extends CategoryTheory.ReflexiveRelation p₁ p₂, CategoryTheory.SymmetricRelation p₁ p₂, CategoryTheory.TransitiveRelation p₁ p₂ :
          Type (max u_1 v_1)

          An equivalence relation is a reflexive, symmetric and transitive relation.

          Instances For
            class CategoryTheory.IsEquivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {R X : C} (p₁ p₂ : R X) :

            The typeclass associated with the structure EquivalenceRelation.

            Instances
              noncomputable def CategoryTheory.IsKernelPair.equivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {X Y : C} (f : X Y) {R : C} (p₁ p₂ : R X) {t : Limits.PullbackCone p₂ p₁} (ht : Limits.IsLimit t) (h : IsKernelPair f p₁ p₂) :

              A kernel pair gives rise to an equivalence relation.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def CategoryTheory.ReflexiveRelation.map {C : Type u_1} [Category.{v_1, u_1} C] {D : Type u_2} [Category.{v_2, u_2} D] {R X : C} {p₁ p₂ : R X} (e : ReflexiveRelation p₁ p₂) (F : Functor C D) [JointlyMono₂ (F.map p₁) (F.map p₂)] :
                ReflexiveRelation (F.map p₁) (F.map p₂)

                Given a functor F : C ⥤ D, if F.map p₁ and F.map p₂ form a jointly monic pair of morphisms, then F preserves reflexive relations.

                Equations
                • e.map F = { toJointlyMono₂ := inst✝, r := F.map e.r, reflexivity₁ := , reflexivity₂ := }
                Instances For
                  def CategoryTheory.SymmetricRelation.map {C : Type u_1} [Category.{v_1, u_1} C] {D : Type u_2} [Category.{v_2, u_2} D] {R X : C} {p₁ p₂ : R X} (e : SymmetricRelation p₁ p₂) (F : Functor C D) [JointlyMono₂ (F.map p₁) (F.map p₂)] :
                  SymmetricRelation (F.map p₁) (F.map p₂)

                  Given a functor F : C ⥤ D, if F.map p₁ and F.map p₂ form a jointly monic pair of morphisms, then F preserves symmetric relations.

                  Equations
                  • e.map F = { toJointlyMono₂ := inst✝, s := F.map e.s, symmetry₁ := , symmetry₂ := }
                  Instances For
                    noncomputable def CategoryTheory.TransitiveRelation.map {C : Type u_1} [Category.{v_1, u_1} C] {D : Type u_2} [Category.{v_2, u_2} D] {R X : C} {p₁ p₂ : R X} (e : TransitiveRelation p₁ p₂) (F : Functor C D) [JointlyMono₂ (F.map p₁) (F.map p₂)] [Limits.PreservesLimitsOfShape Limits.WalkingCospan F] :
                    TransitiveRelation (F.map p₁) (F.map p₂)

                    Given a functor F : C ⥤ D, if F.map p₁ and F.map p₂ form a jointly monic pair of morphisms, and if F preserves pullbacks, then F preserves reflexive relations.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[reducible, inline]
                      abbrev TypeCat.ROfRel {X : Type w} (φ : XXProp) :

                      The subtype of X × X corresponding to a relation φ : X → X → Prop.

                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev TypeCat.p₁OfRel {X : Type w} (φ : XXProp) :
                        ROfRel φ X

                        The first projection ROfRel ⟶ X.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev TypeCat.p₂OfRel {X : Type w} (φ : XXProp) :
                          ROfRel φ X

                          The second projection ROfRel ⟶ X.

                          Equations
                          Instances For

                            Standard reflexive relations on types are internal reflexive relations in the category of types.

                            Equations
                            Instances For

                              Standard symmetric relations on types are internal symmetric relations in the category of types.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Standard transitive relations on types are internal transitive relations in the category of types.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  Standard equivalence relations on types are internal equivalence relations in the category of types.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[reducible, inline]
                                    abbrev TypeCat.Rel.ofPair {X R : Type w} (p₁ p₂ : R X) (x₁ x₂ : X) :

                                    The relation on a type X coming from a pair of maps R ⟶ X.

                                    Equations
                                    Instances For
                                      theorem TypeCat.refl_of_reflexiveRelation {X R : Type w} {p₁ p₂ : R X} (e : CategoryTheory.ReflexiveRelation p₁ p₂) :
                                      Std.Refl (Rel.ofPair p₁ p₂)

                                      An internal reflexive relation in the category of types gives rise to a standard reflexive relation.

                                      theorem TypeCat.symm_of_symmetricRelation {X R : Type w} {p₁ p₂ : R X} (e : CategoryTheory.SymmetricRelation p₁ p₂) :
                                      Std.Symm (Rel.ofPair p₁ p₂)

                                      An internal symmetric relation in the category of types gives rise to a standard symmetric relation.

                                      @[deprecated TypeCat.symm_of_symmetricRelation (since := "2026-06-10")]
                                      theorem TypeCat.symmetric_of_symmetricRelation {X R : Type w} {p₁ p₂ : R X} (e : CategoryTheory.SymmetricRelation p₁ p₂) :
                                      Std.Symm (Rel.ofPair p₁ p₂)

                                      Alias of TypeCat.symm_of_symmetricRelation.


                                      An internal symmetric relation in the category of types gives rise to a standard symmetric relation.

                                      theorem TypeCat.isTrans_of_transitiveRelation {X R : Type w} {p₁ p₂ : R X} (e : CategoryTheory.TransitiveRelation p₁ p₂) :
                                      IsTrans X (Rel.ofPair p₁ p₂)

                                      An internal transitive relation in the category of types gives rise to a standard transitive relation.

                                      theorem TypeCat.equivalence_of_equivalenceRelation {X R : Type w} {p₁ p₂ : R X} (e : CategoryTheory.EquivalenceRelation p₁ p₂) :

                                      An internal equivalence relation in the category of types gives rise to a standard equivalence relation.

                                      structure CategoryTheory.EffectiveEquivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {R A : C} (p₁ p₂ : R A) extends CategoryTheory.EquivalenceRelation p₁ p₂ :
                                      Type (max u_1 v_1)

                                      An effective equivalence relation is an equivalence relation p₁, p₂ : R ⟶ A together with a morphism π : A ⟶ B such that the resulting square is both a pullback square and a pushout square.

                                      Instances For
                                        class CategoryTheory.IsEffectiveEquivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {R A : C} (p₁ p₂ : R A) :

                                        The typeclass associated with the structure EffectiveEquivalenceRelation.

                                        Instances

                                          Given an effective equivalence relation structure e on p₁, p₂ : R ⟶ A, the morphism e.π : A ⟶ e.B makes e.B a coequalizer of p₁ and p₂.

                                          Equations
                                          Instances For
                                            instance CategoryTheory.instIsRegularEpiπ_1 {C : Type u_1} [Category.{v_1, u_1} C] {R A : C} (p₁ p₂ : R A) (e : EffectiveEquivalenceRelation p₁ p₂) :
                                            structure CategoryTheory.UniversallyEffectiveEquivalenceRelation {C : Type u_1} [Category.{v_1, u_1} C] {R A : C} (p₁ p₂ : R A) extends CategoryTheory.EffectiveEquivalenceRelation p₁ p₂ :
                                            Type (max u_1 v_1)

                                            A universally effective equivalence relation is an effective equivalence relation p₁, p₂ : R ⟶ A such that the corresponding morphism π : A ⟶ B is a universal effective epimorphism.

                                            Instances For

                                              The typeclass associated with the structure UniversallyEffectiveEquivalenceRelation.

                                              Instances

                                                A category C is a universally exact category if all equivalence relations in C are universally effective equivalence relations.

                                                Instances