File: Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean

full_name: CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit
code: /--
(Implementation) Given the appropriate product and equalizer cones, build the cone for `F` which is
limiting if the given cones are also.
-/
@[simps]
def buildLimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, s ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.1⟩ ≫ F.map f.2)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, t ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.2⟩)
    (i : Fork s t) : Cone F 
goal: CategoryTheory.Limits.Cone F

full_name: CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit_pt
code: /--
(Implementation) Given the appropriate product and equalizer cones, build the cone for `F` which is
limiting if the given cones are also.
-/
@[simps]
def buildLimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, s ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.1⟩ ≫ F.map f.2)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, t ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.2⟩)
    (i : Fork s t) : Cone F 
goal: (CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit s t hs ht i).pt = i.pt

full_name: CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit_π_app
code: /--
(Implementation) Given the appropriate product and equalizer cones, build the cone for `F` which is
limiting if the given cones are also.
-/
@[simps]
def buildLimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, s ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.1⟩ ≫ F.map f.2)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, t ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.2⟩)
    (i : Fork s t) : Cone F 
goal: (CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit s t hs ht i).π.app j = i.ι ≫ c₁.π.app { as := j }

full_name: CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildIsLimit
code: /--
(Implementation) Show the cone constructed in `buildLimit` is limiting, provided the cones used in
its construction are.
-/
def buildIsLimit (t₁ : IsLimit c₁) (t₂ : IsLimit c₂) (hi : IsLimit i) :
    IsLimit (buildLimit s t hs ht i) 
goal: CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit s t hs ht i)

full_name: CategoryTheory.Limits.limitConeOfEqualizerAndProduct
code: /-- Given the existence of the appropriate (possibly finite) products and equalizers,
we can construct a limit cone for `F`.
(This assumes the existence of all equalizers, which is technically stronger than needed.)
-/
noncomputable def limitConeOfEqualizerAndProduct (F : J ⥤ C) [HasLimit (Discrete.functor F.obj)]
    [HasLimit (Discrete.functor fun f : Σp : J × J, p.1 ⟶ p.2 => F.obj f.1.2)] [HasEqualizers C] :
    LimitCone F 
goal: CategoryTheory.Limits.LimitCone F

full_name: CategoryTheory.Limits.hasLimit_of_equalizer_and_product
code: /--
Given the existence of the appropriate (possibly finite) products and equalizers, we know a limit of
`F` exists.
(This assumes the existence of all equalizers, which is technically stronger than needed.)
-/
theorem hasLimit_of_equalizer_and_product (F : J ⥤ C) [HasLimit (Discrete.functor F.obj)]
    [HasLimit (Discrete.functor fun f : Σp : J × J, p.1 ⟶ p.2 => F.obj f.1.2)] [HasEqualizers C] :
    HasLimit F 
goal: CategoryTheory.Limits.HasLimit F

full_name: CategoryTheory.Limits.limitSubobjectProduct
code: /-- A limit can be realised as a subobject of a product. -/
noncomputable def limitSubobjectProduct [HasLimitsOfSize.{w, w} C] (F : J ⥤ C) :
    limit F ⟶ ∏ᶜ fun j => F.obj j 
goal: CategoryTheory.Limits.limit F ⟶ ∏ᶜ fun j => F.obj j

full_name: CategoryTheory.Limits.limitSubobjectProduct_mono
code: instance limitSubobjectProduct_mono [HasLimitsOfSize.{w, w} C] (F : J ⥤ C) :
    Mono (limitSubobjectProduct F) 
goal: CategoryTheory.Mono (CategoryTheory.Limits.limitSubobjectProduct F)

full_name: CategoryTheory.Limits.has_limits_of_hasEqualizers_and_products
code: /-- Any category with products and equalizers has all limits.

See <https://stacks.math.columbia.edu/tag/002N>.
-/
theorem has_limits_of_hasEqualizers_and_products [HasProducts.{w} C] [HasEqualizers C] :
    HasLimitsOfSize.{w, w} C 
goal: CategoryTheory.Limits.HasLimitsOfSize.{w, w, v, u} C

full_name: CategoryTheory.Limits.hasFiniteLimits_of_hasEqualizers_and_finite_products
code: /-- Any category with finite products and equalizers has all finite limits.

See <https://stacks.math.columbia.edu/tag/002O>.
-/
theorem hasFiniteLimits_of_hasEqualizers_and_finite_products [HasFiniteProducts C]
    [HasEqualizers C] : HasFiniteLimits C 
goal: CategoryTheory.Limits.HasFiniteLimits C

full_name: CategoryTheory.Limits.preservesLimitOfPreservesEqualizersAndProduct
code: /-- If a functor preserves equalizers and the appropriate products, it preserves limits. -/
noncomputable def preservesLimitOfPreservesEqualizersAndProduct : PreservesLimitsOfShape J G 
goal: CategoryTheory.Limits.PreservesLimitsOfShape J G

full_name: CategoryTheory.Limits.preservesFiniteLimitsOfPreservesEqualizersAndFiniteProducts
code: /-- If G preserves equalizers and finite products, it preserves finite limits. -/
noncomputable def preservesFiniteLimitsOfPreservesEqualizersAndFiniteProducts [HasEqualizers C]
    [HasFiniteProducts C] (G : C ⥤ D) [PreservesLimitsOfShape WalkingParallelPair G]
    [PreservesFiniteProducts G] : PreservesFiniteLimits G 
goal: CategoryTheory.Limits.PreservesFiniteLimits G

full_name: CategoryTheory.Limits.preservesLimitsOfPreservesEqualizersAndProducts
code: /-- If G preserves equalizers and products, it preserves all limits. -/
noncomputable def preservesLimitsOfPreservesEqualizersAndProducts [HasEqualizers C]
    [HasProducts.{w} C] (G : C ⥤ D) [PreservesLimitsOfShape WalkingParallelPair G]
    [∀ J, PreservesLimitsOfShape (Discrete.{w} J) G] : PreservesLimitsOfSize.{w, w} G 
goal: CategoryTheory.Limits.PreservesLimitsOfSize.{w, w, v, v₂, u, u₂} G

full_name: CategoryTheory.Limits.hasFiniteLimits_of_hasTerminal_and_pullbacks
code: theorem hasFiniteLimits_of_hasTerminal_and_pullbacks [HasTerminal C] [HasPullbacks C] :
    HasFiniteLimits C 
goal: CategoryTheory.Limits.HasFiniteLimits C

full_name: CategoryTheory.Limits.preservesFiniteLimitsOfPreservesTerminalAndPullbacks
code: /-- If G preserves terminal objects and pullbacks, it preserves all finite limits. -/
noncomputable def preservesFiniteLimitsOfPreservesTerminalAndPullbacks [HasTerminal C]
    [HasPullbacks C] (G : C ⥤ D) [PreservesLimitsOfShape (Discrete.{0} PEmpty) G]
    [PreservesLimitsOfShape WalkingCospan G] : PreservesFiniteLimits G 
goal: CategoryTheory.Limits.PreservesFiniteLimits G

full_name: CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit_pt
code: /-- (Implementation) Given the appropriate coproduct and coequalizer cocones,
build the cocone for `F` which is colimiting if the given cocones are also.
-/
@[simps]
def buildColimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ s = F.map f.2 ≫ c₂.ι.app ⟨f.1.2⟩)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ t = c₂.ι.app ⟨f.1.1⟩)
    (i : Cofork s t) : Cocone F 
goal: (CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit s t hs ht i).pt = i.pt

full_name: CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit_ι_app
code: /-- (Implementation) Given the appropriate coproduct and coequalizer cocones,
build the cocone for `F` which is colimiting if the given cocones are also.
-/
@[simps]
def buildColimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ s = F.map f.2 ≫ c₂.ι.app ⟨f.1.2⟩)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ t = c₂.ι.app ⟨f.1.1⟩)
    (i : Cofork s t) : Cocone F 
goal: (CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit s t hs ht i).ι.app j =
  c₂.ι.app { as := j } ≫ i.π

full_name: CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit
code: /-- (Implementation) Given the appropriate coproduct and coequalizer cocones,
build the cocone for `F` which is colimiting if the given cocones are also.
-/
@[simps]
def buildColimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ s = F.map f.2 ≫ c₂.ι.app ⟨f.1.2⟩)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, c₁.ι.app ⟨f⟩ ≫ t = c₂.ι.app ⟨f.1.1⟩)
    (i : Cofork s t) : Cocone F 
goal: CategoryTheory.Limits.Cocone F

full_name: CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildIsColimit
code: /-- (Implementation) Show the cocone constructed in `buildColimit` is colimiting,
provided the cocones used in its construction are.
-/
def buildIsColimit (t₁ : IsColimit c₁) (t₂ : IsColimit c₂) (hi : IsColimit i) :
    IsColimit (buildColimit s t hs ht i) 
goal: CategoryTheory.Limits.IsColimit
  (CategoryTheory.Limits.HasColimitOfHasCoproductsOfHasCoequalizers.buildColimit s t hs ht i)

full_name: CategoryTheory.Limits.colimitCoconeOfCoequalizerAndCoproduct
code: /-- Given the existence of the appropriate (possibly finite) coproducts and coequalizers,
we can construct a colimit cocone for `F`.
(This assumes the existence of all coequalizers, which is technically stronger than needed.)
-/
noncomputable def colimitCoconeOfCoequalizerAndCoproduct (F : J ⥤ C)
    [HasColimit (Discrete.functor F.obj)]
    [HasColimit (Discrete.functor fun f : Σp : J × J, p.1 ⟶ p.2 => F.obj f.1.1)]
    [HasCoequalizers C] : ColimitCocone F 
goal: CategoryTheory.Limits.ColimitCocone F

full_name: CategoryTheory.Limits.hasColimit_of_coequalizer_and_coproduct
code: /-- Given the existence of the appropriate (possibly finite) coproducts and coequalizers,
we know a colimit of `F` exists.
(This assumes the existence of all coequalizers, which is technically stronger than needed.)
-/
theorem hasColimit_of_coequalizer_and_coproduct (F : J ⥤ C) [HasColimit (Discrete.functor F.obj)]
    [HasColimit (Discrete.functor fun f : Σp : J × J, p.1 ⟶ p.2 => F.obj f.1.1)]
    [HasCoequalizers C] : HasColimit F 
goal: CategoryTheory.Limits.HasColimit F

full_name: CategoryTheory.Limits.colimitQuotientCoproduct
code: /-- A colimit can be realised as a quotient of a coproduct. -/
noncomputable def colimitQuotientCoproduct [HasColimitsOfSize.{w, w} C] (F : J ⥤ C) :
    ∐ (fun j => F.obj j) ⟶ colimit F 
goal: (∐ fun j => F.obj j) ⟶ CategoryTheory.Limits.colimit F

full_name: CategoryTheory.Limits.colimitQuotientCoproduct_epi
code: instance colimitQuotientCoproduct_epi [HasColimitsOfSize.{w, w} C] (F : J ⥤ C) :
    Epi (colimitQuotientCoproduct F) 
goal: CategoryTheory.Epi (CategoryTheory.Limits.colimitQuotientCoproduct F)

full_name: CategoryTheory.Limits.has_colimits_of_hasCoequalizers_and_coproducts
code: /-- Any category with coproducts and coequalizers has all colimits.

See <https://stacks.math.columbia.edu/tag/002P>.
-/
theorem has_colimits_of_hasCoequalizers_and_coproducts [HasCoproducts.{w} C] [HasCoequalizers C] :
    HasColimitsOfSize.{w, w} C 
goal: CategoryTheory.Limits.HasColimitsOfSize.{w, w, v, u} C

full_name: CategoryTheory.Limits.hasFiniteColimits_of_hasCoequalizers_and_finite_coproducts
code: /-- Any category with finite coproducts and coequalizers has all finite colimits.

See <https://stacks.math.columbia.edu/tag/002Q>.
-/
theorem hasFiniteColimits_of_hasCoequalizers_and_finite_coproducts [HasFiniteCoproducts C]
    [HasCoequalizers C] : HasFiniteColimits C 
goal: CategoryTheory.Limits.HasFiniteColimits C

full_name: CategoryTheory.Limits.preservesColimitOfPreservesCoequalizersAndCoproduct
code: /-- If a functor preserves coequalizers and the appropriate coproducts, it preserves colimits. -/
noncomputable def preservesColimitOfPreservesCoequalizersAndCoproduct :
    PreservesColimitsOfShape J G 
goal: CategoryTheory.Limits.PreservesColimitsOfShape J G

full_name: CategoryTheory.Limits.preservesFiniteColimitsOfPreservesCoequalizersAndFiniteCoproducts
code: /-- If G preserves coequalizers and finite coproducts, it preserves finite colimits. -/
noncomputable def preservesFiniteColimitsOfPreservesCoequalizersAndFiniteCoproducts
    [HasCoequalizers C] [HasFiniteCoproducts C] (G : C ⥤ D)
    [PreservesColimitsOfShape WalkingParallelPair G]
    [PreservesFiniteCoproducts G] : PreservesFiniteColimits G 
goal: CategoryTheory.Limits.PreservesFiniteColimits G

full_name: CategoryTheory.Limits.preservesColimitsOfPreservesCoequalizersAndCoproducts
code: /-- If G preserves coequalizers and coproducts, it preserves all colimits. -/
noncomputable def preservesColimitsOfPreservesCoequalizersAndCoproducts [HasCoequalizers C]
    [HasCoproducts.{w} C] (G : C ⥤ D) [PreservesColimitsOfShape WalkingParallelPair G]
    [∀ J, PreservesColimitsOfShape (Discrete.{w} J) G] : PreservesColimitsOfSize.{w} G 
goal: CategoryTheory.Limits.PreservesColimitsOfSize.{w, w, v, v₂, u, u₂} G

full_name: CategoryTheory.Limits.hasFiniteColimits_of_hasInitial_and_pushouts
code: theorem hasFiniteColimits_of_hasInitial_and_pushouts [HasInitial C] [HasPushouts C] :
    HasFiniteColimits C 
goal: CategoryTheory.Limits.HasFiniteColimits C

full_name: CategoryTheory.Limits.preservesFiniteColimitsOfPreservesInitialAndPushouts
code: /-- If G preserves initial objects and pushouts, it preserves all finite colimits. -/
noncomputable def preservesFiniteColimitsOfPreservesInitialAndPushouts [HasInitial C]
    [HasPushouts C] (G : C ⥤ D) [PreservesColimitsOfShape (Discrete.{0} PEmpty) G]
    [PreservesColimitsOfShape WalkingSpan G] : PreservesFiniteColimits G 
goal: CategoryTheory.Limits.PreservesFiniteColimits G