File: Mathlib/CategoryTheory/Category/RelCat.lean

full_name: CategoryTheory.RelCat
code: /-- A type synonym for `Type`, which carries the category instance for which
    morphisms are binary relations. -/
def RelCat 
goal: Type (u + 1)

full_name: CategoryTheory.RelCat.inhabited
code: instance RelCat.inhabited : Inhabited RelCat 
goal: Inhabited CategoryTheory.RelCat

full_name: CategoryTheory.rel
code: /-- The category of types with binary relations as morphisms. -/
instance rel : LargeCategory RelCat 
goal: CategoryTheory.LargeCategory CategoryTheory.RelCat

full_name: CategoryTheory.RelCat.hom_ext
code: @[ext] theorem hom_ext {X Y : RelCat} (f g : X ⟶ Y) (h : ∀ a b, f a b ↔ g a b) : f = g 
goal: f = g

full_name: CategoryTheory.RelCat.Hom.rel_id
code: protected theorem rel_id (X : RelCat) : 𝟙 X = (· = ·) 
goal: CategoryTheory.CategoryStruct.id X = fun x x_1 => x = x_1

full_name: CategoryTheory.RelCat.Hom.rel_comp
code: protected theorem rel_comp {X Y Z : RelCat} (f : X ⟶ Y) (g : Y ⟶ Z) : f ≫ g = Rel.comp f g 
goal: CategoryTheory.CategoryStruct.comp f g = Rel.comp f g

full_name: CategoryTheory.RelCat.Hom.rel_id_apply₂
code: theorem rel_id_apply₂ (X : RelCat) (x y : X) : (𝟙 X) x y ↔ x = y 
goal: CategoryTheory.CategoryStruct.id X x y ↔ x = y

full_name: CategoryTheory.RelCat.Hom.rel_comp_apply₂
code: theorem rel_comp_apply₂ {X Y Z : RelCat} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) (z : Z) :
    (f ≫ g) x z ↔ ∃ y, f x y ∧ g y z 
goal: CategoryTheory.CategoryStruct.comp f g x z ↔ ∃ y, f x y ∧ g y z

full_name: CategoryTheory.RelCat.graphFunctor
code: /-- The essentially surjective faithful embedding
from the category of types and functions into the category of types and relations. -/
def graphFunctor : Type u ⥤ RelCat.{u} 
goal: CategoryTheory.Functor (Type u) CategoryTheory.RelCat

full_name: CategoryTheory.RelCat.graphFunctor_map
code: @[simp] theorem graphFunctor_map {X Y : Type u} (f : X ⟶ Y) (x : X) (y : Y) :
    graphFunctor.map f x y ↔ f x = y 
goal: CategoryTheory.RelCat.graphFunctor.map f x y ↔ f x = y

full_name: CategoryTheory.RelCat.graphFunctor_faithful
code: instance graphFunctor_faithful : graphFunctor.Faithful 
goal: CategoryTheory.RelCat.graphFunctor.Faithful

full_name: CategoryTheory.RelCat.graphFunctor_essSurj
code: instance graphFunctor_essSurj : graphFunctor.EssSurj 
goal: CategoryTheory.RelCat.graphFunctor.EssSurj

full_name: CategoryTheory.RelCat.rel_iso_iff
code: /-- A relation is an isomorphism in `RelCat` iff it is the image of an isomorphism in
`Type`. -/
theorem rel_iso_iff {X Y : RelCat} (r : X ⟶ Y) :
    IsIso (C := RelCat) r ↔ ∃ f : (Iso (C := Type) X Y), graphFunctor.map f.hom = r 
goal: CategoryTheory.IsIso r ↔ ∃ f, CategoryTheory.RelCat.graphFunctor.map f.hom = r

full_name: CategoryTheory.RelCat.opFunctor
code: /-- The argument-swap isomorphism from `rel` to its opposite. -/
def opFunctor : RelCat ⥤ RelCatᵒᵖ 
goal: CategoryTheory.Functor CategoryTheory.RelCat CategoryTheory.RelCatᵒᵖ

full_name: CategoryTheory.RelCat.unopFunctor
code: /-- The other direction of `opFunctor`. -/
def unopFunctor : RelCatᵒᵖ ⥤ RelCat 
goal: CategoryTheory.Functor CategoryTheory.RelCatᵒᵖ CategoryTheory.RelCat

full_name: CategoryTheory.RelCat.opFunctor_comp_unopFunctor_eq
code: @[simp] theorem opFunctor_comp_unopFunctor_eq :
    Functor.comp opFunctor unopFunctor = Functor.id _ 
goal: CategoryTheory.RelCat.opFunctor.comp CategoryTheory.RelCat.unopFunctor = CategoryTheory.Functor.id CategoryTheory.RelCat

full_name: CategoryTheory.RelCat.unopFunctor_comp_opFunctor_eq
code: @[simp] theorem unopFunctor_comp_opFunctor_eq :
    Functor.comp unopFunctor opFunctor = Functor.id _ 
goal: CategoryTheory.RelCat.unopFunctor.comp CategoryTheory.RelCat.opFunctor =
  CategoryTheory.Functor.id CategoryTheory.RelCatᵒᵖ

full_name: CategoryTheory.RelCat.opEquivalence_unitIso
code: /-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ 
goal: CategoryTheory.RelCat.opEquivalence.unitIso = CategoryTheory.Iso.refl (CategoryTheory.Functor.id CategoryTheory.RelCat)

full_name: CategoryTheory.RelCat.opEquivalence
code: /-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ 
goal: CategoryTheory.RelCat ≌ CategoryTheory.RelCatᵒᵖ

full_name: CategoryTheory.RelCat.opEquivalence_counitIso
code: /-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ 
goal: CategoryTheory.RelCat.opEquivalence.counitIso =
  CategoryTheory.Iso.refl (CategoryTheory.RelCat.unopFunctor.comp CategoryTheory.RelCat.opFunctor)

full_name: CategoryTheory.RelCat.opEquivalence_functor
code: /-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ 
goal: CategoryTheory.RelCat.opEquivalence.functor = CategoryTheory.RelCat.opFunctor

full_name: CategoryTheory.RelCat.opEquivalence_inverse
code: /-- `rel` is self-dual: The map that swaps the argument order of a
    relation induces an equivalence between `rel` and its opposite. -/
@[simps]
def opEquivalence : Equivalence RelCat RelCatᵒᵖ 
goal: CategoryTheory.RelCat.opEquivalence.inverse = CategoryTheory.RelCat.unopFunctor

full_name: CategoryTheory.RelCat.instIsEquivalenceOppositeOpFunctor
code: instance : opFunctor.IsEquivalence 
goal: CategoryTheory.RelCat.opFunctor.IsEquivalence

full_name: CategoryTheory.RelCat.instIsEquivalenceOppositeUnopFunctor
code: instance : unopFunctor.IsEquivalence 
goal: CategoryTheory.RelCat.unopFunctor.IsEquivalence