File: Mathlib/CategoryTheory/Filtered/Basic.lean

full_name: CategoryTheory.IsFilteredOrEmpty.cocone_maps
code: /-- A category `IsFilteredOrEmpty` if
1. for every pair of objects there exists another object "to the right", and
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal.
-/
class IsFilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the right" -/
  cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True
  /-- for every pair of parallel morphisms there exists a morphism to the right
    so the compositions are equal -/
  cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h
goal: ∃ Z h, CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h

full_name: CategoryTheory.IsFilteredOrEmpty
code: /-- A category `IsFilteredOrEmpty` if
1. for every pair of objects there exists another object "to the right", and
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal.
-/
class IsFilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the right" -/
  cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True
  /-- for every pair of parallel morphisms there exists a morphism to the right
    so the compositions are equal -/
  cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h
goal: Prop

full_name: CategoryTheory.IsFilteredOrEmpty.cocone_objs
code: /-- A category `IsFilteredOrEmpty` if
1. for every pair of objects there exists another object "to the right", and
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal.
-/
class IsFilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the right" -/
  cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True
  /-- for every pair of parallel morphisms there exists a morphism to the right
    so the compositions are equal -/
  cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h
goal: ∃ Z x x, True

full_name: CategoryTheory.IsFiltered.nonempty
code: /-- A category `IsFiltered` if
1. for every pair of objects there exists another object "to the right",
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal, and
3. there exists some object.

See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.)
-/
class IsFiltered extends IsFilteredOrEmpty C : Prop where
  /-- a filtered category must be non empty -/
  [nonempty : Nonempty C]
goal: Nonempty C

full_name: CategoryTheory.IsFiltered
code: /-- A category `IsFiltered` if
1. for every pair of objects there exists another object "to the right",
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal, and
3. there exists some object.

See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.)
-/
class IsFiltered extends IsFilteredOrEmpty C : Prop where
  /-- a filtered category must be non empty -/
  [nonempty : Nonempty C]
goal: Prop

full_name: CategoryTheory.isFilteredOrEmpty_of_semilatticeSup
code: instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] :
    IsFilteredOrEmpty α 
goal: CategoryTheory.IsFilteredOrEmpty α

full_name: CategoryTheory.isFiltered_of_semilatticeSup_nonempty
code: instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α]
    [Nonempty α] : IsFiltered α 
goal: CategoryTheory.IsFiltered α

full_name: CategoryTheory.isFilteredOrEmpty_of_directed_le
code: instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α]
    [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α 
goal: CategoryTheory.IsFilteredOrEmpty α

full_name: CategoryTheory.isFiltered_of_directed_le_nonempty
code: instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α]
    [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α 
goal: CategoryTheory.IsFiltered α

full_name: CategoryTheory.instIsFilteredDiscretePUnit
code: instance : IsFiltered (Discrete PUnit) 
goal: CategoryTheory.IsFiltered (CategoryTheory.Discrete PUnit.{u_1 + 1})

full_name: CategoryTheory.IsFiltered.max
code: /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def max (j j' : C) : C 
goal: C

full_name: CategoryTheory.IsFiltered.leftToMax
code: /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def leftToMax (j j' : C) : j ⟶ max j j' 
goal: j ⟶ CategoryTheory.IsFiltered.max j j'

full_name: CategoryTheory.IsFiltered.rightToMax
code: /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' 
goal: j' ⟶ CategoryTheory.IsFiltered.max j j'

full_name: CategoryTheory.IsFiltered.coeq
code: /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object
which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that
`coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`.
Its existence is ensured by `IsFiltered`.
-/
noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C 
goal: C

full_name: CategoryTheory.IsFiltered.coeqHom
code: /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism
`coeqHom f f' : j' ⟶ coeq f f'` such that
`coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`.
Its existence is ensured by `IsFiltered`.
-/
noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' 
goal: j' ⟶ CategoryTheory.IsFiltered.coeq f f'

full_name: CategoryTheory.IsFiltered.coeq_condition
code: /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that
`f ≫ coeqHom f f' = f' ≫ coeqHom f f'`.
-/
@[reassoc]
theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' 
goal: CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.coeqHom f f') =
  CategoryTheory.CategoryStruct.comp f' (CategoryTheory.IsFiltered.coeqHom f f')

full_name: CategoryTheory.IsFilteredOrEmpty.of_right_adjoint
code: /-- If `C` is filtered or empty, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is
filtered or empty.
-/
theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D 
goal: CategoryTheory.IsFilteredOrEmpty D

full_name: CategoryTheory.IsFilteredOrEmpty.of_isRightAdjoint
code: /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is
filtered or empty. -/
theorem of_isRightAdjoint (R : C ⥤ D) [R.IsRightAdjoint] : IsFilteredOrEmpty D 
goal: CategoryTheory.IsFilteredOrEmpty D

full_name: CategoryTheory.IsFilteredOrEmpty.of_equivalence
code: /-- Being filtered or empty is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D 
goal: CategoryTheory.IsFilteredOrEmpty D

full_name: CategoryTheory.IsFiltered.sup_objs_exists
code: /-- Any finite collection of objects in a filtered category has an object "to the right".
-/
theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) 
goal: ∃ S, ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S)

full_name: CategoryTheory.IsFiltered.sup_exists
code: /-- Given any `Finset` of objects `{X, ...}` and
indexed collection of `Finset`s of morphisms `{f, ...}` in `C`,
there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`,
such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`.
-/
theorem sup_exists :
    ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)),
      ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
        (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H →
          f ≫ T mY = T mX 
goal: ∃ S T,
  ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
    ⟨X, ⟨Y, ⟨mX, ⟨mY, f⟩⟩⟩⟩ ∈ H → CategoryTheory.CategoryStruct.comp f (T mY) = T mX

full_name: CategoryTheory.IsFiltered.sup
code: /-- An arbitrary choice of object "to the right"
of a finite collection of objects `O` and morphisms `H`,
making all the triangles commute.
-/
noncomputable def sup : C 
goal: C

full_name: CategoryTheory.IsFiltered.toSup
code: /-- The morphisms to `sup O H`.
-/
noncomputable def toSup {X : C} (m : X ∈ O) : X ⟶ sup O H 
goal: X ⟶ CategoryTheory.IsFiltered.sup O H

full_name: CategoryTheory.IsFiltered.toSup_commutes
code: /-- The triangles of consisting of a morphism in `H` and the maps to `sup O H` commute.
-/
theorem toSup_commutes {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}
    (mf : (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H) :
    f ≫ toSup O H mY = toSup O H mX 
goal: CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.toSup O H mY) = CategoryTheory.IsFiltered.toSup O H mX

full_name: CategoryTheory.IsFiltered.cocone_nonempty
code: /-- If we have `IsFiltered C`, then for any functor `F : J ⥤ C` with `FinCategory J`,
there exists a cocone over `F`.
-/
theorem cocone_nonempty (F : J ⥤ C) : Nonempty (Cocone F) 
goal: Nonempty (CategoryTheory.Limits.Cocone F)

full_name: CategoryTheory.IsFiltered.cocone
code: /-- An arbitrary choice of cocone over `F : J ⥤ C`, for `FinCategory J` and `IsFiltered C`.
-/
noncomputable def cocone (F : J ⥤ C) : Cocone F 
goal: CategoryTheory.Limits.Cocone F

full_name: CategoryTheory.IsFiltered.of_right_adjoint
code: /-- If `C` is filtered, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered.
-/
theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFiltered D 
goal: CategoryTheory.IsFiltered D

full_name: CategoryTheory.IsFiltered.of_isRightAdjoint
code: /-- If `C` is filtered, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered. -/
theorem of_isRightAdjoint (R : C ⥤ D) [R.IsRightAdjoint] : IsFiltered D 
goal: CategoryTheory.IsFiltered D

full_name: CategoryTheory.IsFiltered.of_equivalence
code: /-- Being filtered is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsFiltered D 
goal: CategoryTheory.IsFiltered D

full_name: CategoryTheory.IsFiltered.of_cocone_nonempty
code: /-- If every finite diagram in `C` admits a cocone, then `C` is filtered. It is sufficient to verify
    this for diagrams whose shape lives in any one fixed universe. -/
theorem of_cocone_nonempty (h : ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C),
    Nonempty (Cocone F)) : IsFiltered C 
goal: CategoryTheory.IsFiltered C

full_name: CategoryTheory.IsFiltered.of_hasFiniteColimits
code: theorem of_hasFiniteColimits [HasFiniteColimits C] : IsFiltered C 
goal: CategoryTheory.IsFiltered C

full_name: CategoryTheory.IsFiltered.of_isTerminal
code: theorem of_isTerminal {X : C} (h : IsTerminal X) : IsFiltered C 
goal: CategoryTheory.IsFiltered C

full_name: CategoryTheory.IsFiltered.of_hasTerminal
code: instance (priority := 100) of_hasTerminal [HasTerminal C] : IsFiltered C 
goal: CategoryTheory.IsFiltered C

full_name: CategoryTheory.IsFiltered.iff_cocone_nonempty
code: /-- For every universe `w`, `C` is filtered if and only if every finite diagram in `C` with shape
    in `w` admits a cocone. -/
theorem iff_cocone_nonempty : IsFiltered C ↔
    ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C), Nonempty (Cocone F) 
goal: CategoryTheory.IsFiltered C ↔
  ∀ {J : Type w} [inst : CategoryTheory.SmallCategory J] [inst_1 : CategoryTheory.FinCategory J]
    (F : CategoryTheory.Functor J C), Nonempty (CategoryTheory.Limits.Cocone F)

full_name: CategoryTheory.IsFiltered.max₃
code: /-- `max₃ j₁ j₂ j₃` is an arbitrary choice of object to the right of `j₁`, `j₂` and `j₃`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def max₃ (j₁ j₂ j₃ : C) : C 
goal: C

full_name: CategoryTheory.IsFiltered.firstToMax₃
code: /-- `firstToMax₃ j₁ j₂ j₃` is an arbitrary choice of morphism from `j₁` to `max₃ j₁ j₂ j₃`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def firstToMax₃ (j₁ j₂ j₃ : C) : j₁ ⟶ max₃ j₁ j₂ j₃ 
goal: j₁ ⟶ CategoryTheory.IsFiltered.max₃ j₁ j₂ j₃

full_name: CategoryTheory.IsFiltered.secondToMax₃
code: /-- `secondToMax₃ j₁ j₂ j₃` is an arbitrary choice of morphism from `j₂` to `max₃ j₁ j₂ j₃`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def secondToMax₃ (j₁ j₂ j₃ : C) : j₂ ⟶ max₃ j₁ j₂ j₃ 
goal: j₂ ⟶ CategoryTheory.IsFiltered.max₃ j₁ j₂ j₃

full_name: CategoryTheory.IsFiltered.thirdToMax₃
code: /-- `thirdToMax₃ j₁ j₂ j₃` is an arbitrary choice of morphism from `j₃` to `max₃ j₁ j₂ j₃`,
whose existence is ensured by `IsFiltered`.
-/
noncomputable def thirdToMax₃ (j₁ j₂ j₃ : C) : j₃ ⟶ max₃ j₁ j₂ j₃ 
goal: j₃ ⟶ CategoryTheory.IsFiltered.max₃ j₁ j₂ j₃

full_name: CategoryTheory.IsFiltered.coeq₃
code: /-- `coeq₃ f g h`, for morphisms `f g h : j₁ ⟶ j₂`, is an arbitrary choice of object
which admits a morphism `coeq₃Hom f g h : j₂ ⟶ coeq₃ f g h` such that
`coeq₃_condition₁`, `coeq₃_condition₂` and `coeq₃_condition₃` are satisfied.
Its existence is ensured by `IsFiltered`.
-/
noncomputable def coeq₃ {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) : C 
goal: C

full_name: CategoryTheory.IsFiltered.coeq₃Hom
code: /-- `coeq₃Hom f g h`, for morphisms `f g h : j₁ ⟶ j₂`, is an arbitrary choice of morphism
`j₂ ⟶ coeq₃ f g h` such that `coeq₃_condition₁`, `coeq₃_condition₂` and `coeq₃_condition₃`
are satisfied. Its existence is ensured by `IsFiltered`.
-/
noncomputable def coeq₃Hom {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) : j₂ ⟶ coeq₃ f g h 
goal: j₂ ⟶ CategoryTheory.IsFiltered.coeq₃ f g h

full_name: CategoryTheory.IsFiltered.coeq₃_condition₁
code: theorem coeq₃_condition₁ {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) :
    f ≫ coeq₃Hom f g h = g ≫ coeq₃Hom f g h 
goal: CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.coeq₃Hom f g h) =
  CategoryTheory.CategoryStruct.comp g (CategoryTheory.IsFiltered.coeq₃Hom f g h)

full_name: CategoryTheory.IsFiltered.coeq₃_condition₂
code: theorem coeq₃_condition₂ {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) :
    g ≫ coeq₃Hom f g h = h ≫ coeq₃Hom f g h 
goal: CategoryTheory.CategoryStruct.comp g (CategoryTheory.IsFiltered.coeq₃Hom f g h) =
  CategoryTheory.CategoryStruct.comp h (CategoryTheory.IsFiltered.coeq₃Hom f g h)

full_name: CategoryTheory.IsFiltered.coeq₃_condition₃
code: theorem coeq₃_condition₃ {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) : f ≫ coeq₃Hom f g h = h ≫ coeq₃Hom f g h 
goal: CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.coeq₃Hom f g h) =
  CategoryTheory.CategoryStruct.comp h (CategoryTheory.IsFiltered.coeq₃Hom f g h)

full_name: CategoryTheory.IsFiltered.span
code: /-- For every span `j ⟵ i ⟶ j'`, there
   exists a cocone `j ⟶ k ⟵ j'` such that the square commutes. -/
theorem span {i j j' : C} (f : i ⟶ j) (f' : i ⟶ j') :
    ∃ (k : C) (g : j ⟶ k) (g' : j' ⟶ k), f ≫ g = f' ≫ g' 
goal: ∃ k g g', CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f' g'

full_name: CategoryTheory.IsFiltered.bowtie
code: /-- Given a "bowtie" of morphisms
```
 j₁   j₂
 |\  /|
 | \/ |
 | /\ |
 |/  \∣
 vv  vv
 k₁  k₂
```
in a filtered category, we can construct an object `s` and two morphisms from `k₁` and `k₂` to `s`,
making the resulting squares commute.
-/
theorem bowtie {j₁ j₂ k₁ k₂ : C} (f₁ : j₁ ⟶ k₁) (g₁ : j₁ ⟶ k₂) (f₂ : j₂ ⟶ k₁) (g₂ : j₂ ⟶ k₂) :
    ∃ (s : C) (α : k₁ ⟶ s) (β : k₂ ⟶ s), f₁ ≫ α = g₁ ≫ β ∧ f₂ ≫ α = g₂ ≫ β 
goal: ∃ s α β,
  CategoryTheory.CategoryStruct.comp f₁ α = CategoryTheory.CategoryStruct.comp g₁ β ∧
    CategoryTheory.CategoryStruct.comp f₂ α = CategoryTheory.CategoryStruct.comp g₂ β

full_name: CategoryTheory.IsFiltered.tulip
code: /-- Given a "tulip" of morphisms
```
 j₁    j₂    j₃
 |\   / \   / |
 | \ /   \ /  |
 |  vv    vv  |
 \  k₁    k₂ /
  \         /
   \       /
    \     /
     \   /
      v v
       l
```
in a filtered category, we can construct an object `s` and three morphisms from `k₁`, `k₂` and `l`
to `s`, making the resulting squares commute.
-/
theorem tulip {j₁ j₂ j₃ k₁ k₂ l : C} (f₁ : j₁ ⟶ k₁) (f₂ : j₂ ⟶ k₁) (f₃ : j₂ ⟶ k₂) (f₄ : j₃ ⟶ k₂)
    (g₁ : j₁ ⟶ l) (g₂ : j₃ ⟶ l) :
    ∃ (s : C) (α : k₁ ⟶ s) (β : l ⟶ s) (γ : k₂ ⟶ s),
      f₁ ≫ α = g₁ ≫ β ∧ f₂ ≫ α = f₃ ≫ γ ∧ f₄ ≫ γ = g₂ ≫ β 
goal: ∃ s α β γ,
  CategoryTheory.CategoryStruct.comp f₁ α = CategoryTheory.CategoryStruct.comp g₁ β ∧
    CategoryTheory.CategoryStruct.comp f₂ α = CategoryTheory.CategoryStruct.comp f₃ γ ∧
      CategoryTheory.CategoryStruct.comp f₄ γ = CategoryTheory.CategoryStruct.comp g₂ β

full_name: CategoryTheory.IsCofilteredOrEmpty
code: /-- A category `IsCofilteredOrEmpty` if
1. for every pair of objects there exists another object "to the left", and
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal.
-/
class IsCofilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the left" -/
  cone_objs : ∀ X Y : C, ∃ (W : _) (_ : W ⟶ X) (_ : W ⟶ Y), True
  /-- for every pair of parallel morphisms there exists a morphism to the left
    so the compositions are equal -/
  cone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (W : _) (h : W ⟶ X), h ≫ f = h ≫ g
goal: Prop

full_name: CategoryTheory.IsCofilteredOrEmpty.cone_maps
code: /-- A category `IsCofilteredOrEmpty` if
1. for every pair of objects there exists another object "to the left", and
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal.
-/
class IsCofilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the left" -/
  cone_objs : ∀ X Y : C, ∃ (W : _) (_ : W ⟶ X) (_ : W ⟶ Y), True
  /-- for every pair of parallel morphisms there exists a morphism to the left
    so the compositions are equal -/
  cone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (W : _) (h : W ⟶ X), h ≫ f = h ≫ g
goal: ∃ W h, CategoryTheory.CategoryStruct.comp h f = CategoryTheory.CategoryStruct.comp h g

full_name: CategoryTheory.IsCofilteredOrEmpty.cone_objs
code: /-- A category `IsCofilteredOrEmpty` if
1. for every pair of objects there exists another object "to the left", and
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal.
-/
class IsCofilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the left" -/
  cone_objs : ∀ X Y : C, ∃ (W : _) (_ : W ⟶ X) (_ : W ⟶ Y), True
  /-- for every pair of parallel morphisms there exists a morphism to the left
    so the compositions are equal -/
  cone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (W : _) (h : W ⟶ X), h ≫ f = h ≫ g
goal: ∃ W x x, True

full_name: CategoryTheory.IsCofiltered.nonempty
code: /-- A category `IsCofiltered` if
1. for every pair of objects there exists another object "to the left",
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal, and
3. there exists some object.

See <https://stacks.math.columbia.edu/tag/04AZ>.
-/
class IsCofiltered extends IsCofilteredOrEmpty C : Prop where
  /-- a cofiltered category must be non empty -/
  [nonempty : Nonempty C]
goal: Nonempty C

full_name: CategoryTheory.IsCofiltered
code: /-- A category `IsCofiltered` if
1. for every pair of objects there exists another object "to the left",
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal, and
3. there exists some object.

See <https://stacks.math.columbia.edu/tag/04AZ>.
-/
class IsCofiltered extends IsCofilteredOrEmpty C : Prop where
  /-- a cofiltered category must be non empty -/
  [nonempty : Nonempty C]
goal: Prop

full_name: CategoryTheory.isCofilteredOrEmpty_of_semilatticeInf
code: instance (priority := 100) isCofilteredOrEmpty_of_semilatticeInf (α : Type u) [SemilatticeInf α] :
    IsCofilteredOrEmpty α 
goal: CategoryTheory.IsCofilteredOrEmpty α

full_name: CategoryTheory.isCofiltered_of_semilatticeInf_nonempty
code: instance (priority := 100) isCofiltered_of_semilatticeInf_nonempty (α : Type u) [SemilatticeInf α]
    [Nonempty α] : IsCofiltered α 
goal: CategoryTheory.IsCofiltered α

full_name: CategoryTheory.isCofilteredOrEmpty_of_directed_ge
code: instance (priority := 100) isCofilteredOrEmpty_of_directed_ge (α : Type u) [Preorder α]
    [IsDirected α (· ≥ ·)] : IsCofilteredOrEmpty α 
goal: CategoryTheory.IsCofilteredOrEmpty α

full_name: CategoryTheory.isCofiltered_of_directed_ge_nonempty
code: instance (priority := 100) isCofiltered_of_directed_ge_nonempty (α : Type u) [Preorder α]
    [IsDirected α (· ≥ ·)] [Nonempty α] : IsCofiltered α 
goal: CategoryTheory.IsCofiltered α

full_name: CategoryTheory.instIsCofilteredDiscretePUnit
code: instance : IsCofiltered (Discrete PUnit) 
goal: CategoryTheory.IsCofiltered (CategoryTheory.Discrete PUnit.{u_1 + 1})

full_name: CategoryTheory.IsCofiltered.min
code: /-- `min j j'` is an arbitrary choice of object to the left of both `j` and `j'`,
whose existence is ensured by `IsCofiltered`.
-/
noncomputable def min (j j' : C) : C 
goal: C

full_name: CategoryTheory.IsCofiltered.minToLeft
code: /-- `minToLeft j j'` is an arbitrary choice of morphism from `min j j'` to `j`,
whose existence is ensured by `IsCofiltered`.
-/
noncomputable def minToLeft (j j' : C) : min j j' ⟶ j 
goal: CategoryTheory.IsCofiltered.min j j' ⟶ j

full_name: CategoryTheory.IsCofiltered.minToRight
code: /-- `minToRight j j'` is an arbitrary choice of morphism from `min j j'` to `j'`,
whose existence is ensured by `IsCofiltered`.
-/
noncomputable def minToRight (j j' : C) : min j j' ⟶ j' 
goal: CategoryTheory.IsCofiltered.min j j' ⟶ j'

full_name: CategoryTheory.IsCofiltered.eq
code: /-- `eq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object
which admits a morphism `eqHom f f' : eq f f' ⟶ j` such that
`eq_condition : eqHom f f' ≫ f = eqHom f f' ≫ f'`.
Its existence is ensured by `IsCofiltered`.
-/
noncomputable def eq {j j' : C} (f f' : j ⟶ j') : C 
goal: C

full_name: CategoryTheory.IsCofiltered.eqHom
code: /-- `eqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism
`eqHom f f' : eq f f' ⟶ j` such that
`eq_condition : eqHom f f' ≫ f = eqHom f f' ≫ f'`.
Its existence is ensured by `IsCofiltered`.
-/
noncomputable def eqHom {j j' : C} (f f' : j ⟶ j') : eq f f' ⟶ j 
goal: CategoryTheory.IsCofiltered.eq f f' ⟶ j

full_name: CategoryTheory.IsCofiltered.eq_condition
code: /-- `eq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that
`eqHom f f' ≫ f = eqHom f f' ≫ f'`.
-/
@[reassoc]
theorem eq_condition {j j' : C} (f f' : j ⟶ j') : eqHom f f' ≫ f = eqHom f f' ≫ f' 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.eqHom f f') f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.eqHom f f') f'

full_name: CategoryTheory.IsCofiltered.cospan
code: /-- For every cospan `j ⟶ i ⟵ j'`,
 there exists a cone `j ⟵ k ⟶ j'` such that the square commutes. -/
theorem cospan {i j j' : C} (f : j ⟶ i) (f' : j' ⟶ i) :
    ∃ (k : C) (g : k ⟶ j) (g' : k ⟶ j'), g ≫ f = g' ≫ f' 
goal: ∃ k g g', CategoryTheory.CategoryStruct.comp g f = CategoryTheory.CategoryStruct.comp g' f'

full_name: CategoryTheory.Functor.ranges_directed
code: theorem _root_.CategoryTheory.Functor.ranges_directed (F : C ⥤ Type*) (j : C) :
    Directed (· ⊇ ·) fun f : Σ'i, i ⟶ j => Set.range (F.map f.2) 
goal: Directed (fun x x_1 => x ⊇ x_1) fun f => Set.range (F.map f.snd)

full_name: CategoryTheory.IsCofilteredOrEmpty.of_left_adjoint
code: /-- If `C` is cofiltered or empty, and we have a functor `L : C ⥤ D` with a right adjoint,
then `D` is cofiltered or empty.
-/
theorem of_left_adjoint {L : C ⥤ D} {R : D ⥤ C} (h : L ⊣ R) : IsCofilteredOrEmpty D 
goal: CategoryTheory.IsCofilteredOrEmpty D

full_name: CategoryTheory.IsCofilteredOrEmpty.of_isLeftAdjoint
code: /-- If `C` is cofiltered or empty, and we have a left adjoint functor `L : C ⥤ D`, then `D` is
cofiltered or empty. -/
theorem of_isLeftAdjoint (L : C ⥤ D) [L.IsLeftAdjoint] : IsCofilteredOrEmpty D 
goal: CategoryTheory.IsCofilteredOrEmpty D

full_name: CategoryTheory.IsCofilteredOrEmpty.of_equivalence
code: /-- Being cofiltered or empty is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsCofilteredOrEmpty D 
goal: CategoryTheory.IsCofilteredOrEmpty D

full_name: CategoryTheory.IsCofiltered.inf_objs_exists
code: /-- Any finite collection of objects in a cofiltered category has an object "to the left".
-/
theorem inf_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (S ⟶ X) 
goal: ∃ S, ∀ {X : C}, X ∈ O → Nonempty (S ⟶ X)

full_name: CategoryTheory.IsCofiltered.inf_exists
code: /-- Given any `Finset` of objects `{X, ...}` and
indexed collection of `Finset`s of morphisms `{f, ...}` in `C`,
there exists an object `S`, with a morphism `T X : S ⟶ X` from each `X`,
such that the triangles commute: `T X ≫ f = T Y`, for `f : X ⟶ Y` in the `Finset`.
-/
theorem inf_exists :
    ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (S ⟶ X)),
      ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
        (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H →
          T mX ≫ f = T mY 
goal: ∃ S T,
  ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y},
    ⟨X, ⟨Y, ⟨mX, ⟨mY, f⟩⟩⟩⟩ ∈ H → CategoryTheory.CategoryStruct.comp (T mX) f = T mY

full_name: CategoryTheory.IsCofiltered.inf
code: /-- An arbitrary choice of object "to the left"
of a finite collection of objects `O` and morphisms `H`,
making all the triangles commute.
-/
noncomputable def inf : C 
goal: C

full_name: CategoryTheory.IsCofiltered.infTo
code: /-- The morphisms from `inf O H`.
-/
noncomputable def infTo {X : C} (m : X ∈ O) : inf O H ⟶ X 
goal: CategoryTheory.IsCofiltered.inf O H ⟶ X

full_name: CategoryTheory.IsCofiltered.infTo_commutes
code: /-- The triangles consisting of a morphism in `H` and the maps from `inf O H` commute.
-/
theorem infTo_commutes {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}
    (mf : (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H) :
    infTo O H mX ≫ f = infTo O H mY 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.infTo O H mX) f =
  CategoryTheory.IsCofiltered.infTo O H mY

full_name: CategoryTheory.IsCofiltered.cone_nonempty
code: /-- If we have `IsCofiltered C`, then for any functor `F : J ⥤ C` with `FinCategory J`,
there exists a cone over `F`.
-/
theorem cone_nonempty (F : J ⥤ C) : Nonempty (Cone F) 
goal: Nonempty (CategoryTheory.Limits.Cone F)

full_name: CategoryTheory.IsCofiltered.cone
code: /-- An arbitrary choice of cone over `F : J ⥤ C`, for `FinCategory J` and `IsCofiltered C`.
-/
noncomputable def cone (F : J ⥤ C) : Cone F 
goal: CategoryTheory.Limits.Cone F

full_name: CategoryTheory.IsCofiltered.of_left_adjoint
code: /-- If `C` is cofiltered, and we have a functor `L : C ⥤ D` with a right adjoint,
then `D` is cofiltered.
-/
theorem of_left_adjoint {L : C ⥤ D} {R : D ⥤ C} (h : L ⊣ R) : IsCofiltered D 
goal: CategoryTheory.IsCofiltered D

full_name: CategoryTheory.IsCofiltered.of_isLeftAdjoint
code: /-- If `C` is cofiltered, and we have a left adjoint functor `L : C ⥤ D`, then `D` is cofiltered. -/
theorem of_isLeftAdjoint (L : C ⥤ D) [L.IsLeftAdjoint] : IsCofiltered D 
goal: CategoryTheory.IsCofiltered D

full_name: CategoryTheory.IsCofiltered.of_equivalence
code: /-- Being cofiltered is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsCofiltered D 
goal: CategoryTheory.IsCofiltered D

full_name: CategoryTheory.IsCofiltered.of_cone_nonempty
code: /-- If every finite diagram in `C` admits a cone, then `C` is cofiltered. It is sufficient to
    verify this for diagrams whose shape lives in any one fixed universe. -/
theorem of_cone_nonempty (h : ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C),
    Nonempty (Cone F)) : IsCofiltered C 
goal: CategoryTheory.IsCofiltered C

full_name: CategoryTheory.IsCofiltered.of_hasFiniteLimits
code: theorem of_hasFiniteLimits [HasFiniteLimits C] : IsCofiltered C 
goal: CategoryTheory.IsCofiltered C

full_name: CategoryTheory.IsCofiltered.of_isInitial
code: theorem of_isInitial {X : C} (h : IsInitial X) : IsCofiltered C 
goal: CategoryTheory.IsCofiltered C

full_name: CategoryTheory.IsCofiltered.of_hasInitial
code: instance (priority := 100) of_hasInitial [HasInitial C] : IsCofiltered C 
goal: CategoryTheory.IsCofiltered C

full_name: CategoryTheory.IsCofiltered.iff_cone_nonempty
code: /-- For every universe `w`, `C` is filtered if and only if every finite diagram in `C` with shape
    in `w` admits a cocone. -/
theorem iff_cone_nonempty : IsCofiltered C ↔
    ∀ {J : Type w} [SmallCategory J] [FinCategory J] (F : J ⥤ C), Nonempty (Cone F) 
goal: CategoryTheory.IsCofiltered C ↔
  ∀ {J : Type w} [inst : CategoryTheory.SmallCategory J] [inst_1 : CategoryTheory.FinCategory J]
    (F : CategoryTheory.Functor J C), Nonempty (CategoryTheory.Limits.Cone F)

full_name: CategoryTheory.isCofilteredOrEmpty_op_of_isFilteredOrEmpty
code: instance isCofilteredOrEmpty_op_of_isFilteredOrEmpty [IsFilteredOrEmpty C] :
    IsCofilteredOrEmpty Cᵒᵖ 
goal: CategoryTheory.IsCofilteredOrEmpty Cᵒᵖ

full_name: CategoryTheory.isCofiltered_op_of_isFiltered
code: instance isCofiltered_op_of_isFiltered [IsFiltered C] : IsCofiltered Cᵒᵖ 
goal: CategoryTheory.IsCofiltered Cᵒᵖ

full_name: CategoryTheory.isFilteredOrEmpty_op_of_isCofilteredOrEmpty
code: instance isFilteredOrEmpty_op_of_isCofilteredOrEmpty [IsCofilteredOrEmpty C] :
    IsFilteredOrEmpty Cᵒᵖ 
goal: CategoryTheory.IsFilteredOrEmpty Cᵒᵖ

full_name: CategoryTheory.isFiltered_op_of_isCofiltered
code: instance isFiltered_op_of_isCofiltered [IsCofiltered C] : IsFiltered Cᵒᵖ 
goal: CategoryTheory.IsFiltered Cᵒᵖ

full_name: CategoryTheory.isCofilteredOrEmpty_of_isFilteredOrEmpty_op
code: /-- If Cᵒᵖ is filtered or empty, then C is cofiltered or empty. -/
lemma isCofilteredOrEmpty_of_isFilteredOrEmpty_op [IsFilteredOrEmpty Cᵒᵖ] : IsCofilteredOrEmpty C 
goal: CategoryTheory.IsCofilteredOrEmpty C

full_name: CategoryTheory.isFilteredOrEmpty_of_isCofilteredOrEmpty_op
code: /-- If Cᵒᵖ is cofiltered or empty, then C is filtered or empty. -/
lemma isFilteredOrEmpty_of_isCofilteredOrEmpty_op [IsCofilteredOrEmpty Cᵒᵖ] : IsFilteredOrEmpty C 
goal: CategoryTheory.IsFilteredOrEmpty C

full_name: CategoryTheory.isCofiltered_of_isFiltered_op
code: /-- If Cᵒᵖ is filtered, then C is cofiltered. -/
lemma isCofiltered_of_isFiltered_op [IsFiltered Cᵒᵖ] : IsCofiltered C 
goal: CategoryTheory.IsCofiltered C

full_name: CategoryTheory.isFiltered_of_isCofiltered_op
code: /-- If Cᵒᵖ is cofiltered, then C is filtered. -/
lemma isFiltered_of_isCofiltered_op [IsCofiltered Cᵒᵖ] : IsFiltered C 
goal: CategoryTheory.IsFiltered C

full_name: CategoryTheory.instIsFilteredULift
code: instance [IsFiltered C] : IsFiltered (ULift.{u₂} C) 
goal: CategoryTheory.IsFiltered (ULift.{u₂, u} C)

full_name: CategoryTheory.instIsCofilteredULift
code: instance [IsCofiltered C] : IsCofiltered (ULift.{u₂} C) 
goal: CategoryTheory.IsCofiltered (ULift.{u₂, u} C)

full_name: CategoryTheory.instIsFilteredULiftHom
code: instance [IsFiltered C] : IsFiltered (ULiftHom C) 
goal: CategoryTheory.IsFiltered (CategoryTheory.ULiftHom C)

full_name: CategoryTheory.instIsCofilteredULiftHom
code: instance [IsCofiltered C] : IsCofiltered (ULiftHom C) 
goal: CategoryTheory.IsCofiltered (CategoryTheory.ULiftHom C)

full_name: CategoryTheory.instIsFilteredAsSmall
code: instance [IsFiltered C] : IsFiltered (AsSmall C) 
goal: CategoryTheory.IsFiltered (CategoryTheory.AsSmall C)

full_name: CategoryTheory.instIsCofilteredAsSmall
code: instance [IsCofiltered C] : IsCofiltered (AsSmall C) 
goal: CategoryTheory.IsCofiltered (CategoryTheory.AsSmall C)