File: Mathlib/CategoryTheory/Sites/Coherent/RegularSheaves.lean

full_name: CategoryTheory.Presieve.regular.single_epi
code: /-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
  /-- `R` consists of a single epimorphism. -/
  single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
    (fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
goal: ∃ Y f, (R = CategoryTheory.Presieve.ofArrows (fun x => Y) fun x => f) ∧ CategoryTheory.EffectiveEpi f

full_name: CategoryTheory.Presieve.regular
code: /-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
  /-- `R` consists of a single epimorphism. -/
  single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
    (fun (_ : Unit) ↦ f) ∧ EffectiveEpi f
goal: Prop

full_name: CategoryTheory.regularTopology.equalizerCondition_w
code: lemma equalizerCondition_w (P : Cᵒᵖ ⥤ D) {X B : C} {π : X ⟶ B} (c : PullbackCone π π) :
    P.map π.op ≫ P.map c.fst.op = P.map π.op ≫ P.map c.snd.op 
goal: CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map c.fst.op) =
  CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map c.snd.op)

full_name: CategoryTheory.regularTopology.SingleEqualizerCondition
code: /--
A contravariant functor on `C` satisifies `SingleEqualizerCondition` with respect to a morphism `π`
if it takes its kernel pair to an equalizer diagram.
-/
def SingleEqualizerCondition (P : Cᵒᵖ ⥤ D) ⦃X B : C⦄ (π : X ⟶ B) : Prop 
goal: Prop

full_name: CategoryTheory.regularTopology.EqualizerCondition
code: /--
A contravariant functor on `C` satisfies `EqualizerCondition` if it takes kernel pairs of effective
epimorphisms to equalizer diagrams.
-/
def EqualizerCondition (P : Cᵒᵖ ⥤ D) : Prop 
goal: Prop

full_name: CategoryTheory.regularTopology.equalizerCondition_of_natIso
code: /-- The equalizer condition is preserved by natural isomorphism. -/
theorem equalizerCondition_of_natIso {P P' : Cᵒᵖ ⥤ D} (i : P ≅ P')
    (hP : EqualizerCondition P) : EqualizerCondition P' 
goal: CategoryTheory.regularTopology.EqualizerCondition P'

full_name: CategoryTheory.regularTopology.equalizerCondition_precomp_of_preservesPullback
code: /-- Precomposing with a pullback-preserving functor preserves the equalizer condition. -/
theorem equalizerCondition_precomp_of_preservesPullback (P : Cᵒᵖ ⥤ D) (F : E ⥤ C)
    [∀ {X B} (π : X ⟶ B) [EffectiveEpi π], PreservesLimit (cospan π π) F]
    [F.PreservesEffectiveEpis] (hP : EqualizerCondition P) : EqualizerCondition (F.op ⋙ P) 
goal: CategoryTheory.regularTopology.EqualizerCondition (F.op.comp P)

full_name: CategoryTheory.regularTopology.MapToEqualizer
code: /-- The canonical map to the explicit equalizer. -/
def MapToEqualizer (P : Cᵒᵖ ⥤ Type*) {W X B : C} (f : X ⟶ B)
    (g₁ g₂ : W ⟶ X) (w : g₁ ≫ f = g₂ ≫ f) :
    P.obj (op B) → { x : P.obj (op X) | P.map g₁.op x = P.map g₂.op x } 
goal: P.obj (Opposite.op B) → ↑{x | P.map g₁.op x = P.map g₂.op x}

full_name: CategoryTheory.regularTopology.EqualizerCondition.bijective_mapToEqualizer_pullback
code: theorem EqualizerCondition.bijective_mapToEqualizer_pullback (P : Cᵒᵖ ⥤ Type*)
    (hP : EqualizerCondition P) : ∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π],
    Function.Bijective
      (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) pullback.condition) 
goal: Function.Bijective
  (CategoryTheory.regularTopology.MapToEqualizer P π (CategoryTheory.Limits.pullback.fst π π)
    (CategoryTheory.Limits.pullback.snd π π) ⋯)

full_name: CategoryTheory.regularTopology.EqualizerCondition.mk
code: theorem EqualizerCondition.mk (P : Cᵒᵖ ⥤ Type*)
    (hP : ∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π], Function.Bijective
    (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π)
    pullback.condition)) : EqualizerCondition P 
goal: CategoryTheory.regularTopology.EqualizerCondition P

full_name: CategoryTheory.regularTopology.equalizerCondition_w'
code: lemma equalizerCondition_w' (P : Cᵒᵖ ⥤ Type*) {X B : C} (π : X ⟶ B)
    [HasPullback π π] : P.map π.op ≫ P.map (pullback.fst π π).op =
    P.map π.op ≫ P.map (pullback.snd π π).op 
goal: CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map (CategoryTheory.Limits.pullback.fst π π).op) =
  CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map (CategoryTheory.Limits.pullback.snd π π).op)

full_name: CategoryTheory.regularTopology.mapToEqualizer_eq_comp
code: lemma mapToEqualizer_eq_comp (P : Cᵒᵖ ⥤ Type*) {X B : C} (π : X ⟶ B) [HasPullback π π] :
    MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) pullback.condition =
    equalizer.lift (P.map π.op) (equalizerCondition_w' P π) ≫
    (Types.equalizerIso _ _).hom 
goal: CategoryTheory.regularTopology.MapToEqualizer P π (CategoryTheory.Limits.pullback.fst π π)
    (CategoryTheory.Limits.pullback.snd π π) ⋯ =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.equalizer.lift (P.map π.op) ⋯)
    (CategoryTheory.Limits.Types.equalizerIso (P.map (CategoryTheory.Limits.pullback.fst π π).op)
        (P.map (CategoryTheory.Limits.pullback.snd π π).op)).hom

full_name: CategoryTheory.regularTopology.equalizerCondition_iff_isIso_lift
code: /-- An alternative phrasing of the explicit equalizer condition, using more categorical language. -/
theorem equalizerCondition_iff_isIso_lift (P : Cᵒᵖ ⥤ Type*) : EqualizerCondition P ↔
    ∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π],
      IsIso (equalizer.lift (P.map π.op) (equalizerCondition_w' P π)) 
goal: CategoryTheory.regularTopology.EqualizerCondition P ↔
  ∀ (X B : C) (π : X ⟶ B) [inst : CategoryTheory.EffectiveEpi π] [inst : CategoryTheory.Limits.HasPullback π π],
    CategoryTheory.IsIso (CategoryTheory.Limits.equalizer.lift (P.map π.op) ⋯)

full_name: CategoryTheory.regularTopology.equalizerCondition_iff_of_equivalence
code: /-- `P` satisfies the equalizer condition iff its precomposition by an equivalence does. -/
theorem equalizerCondition_iff_of_equivalence (P : Cᵒᵖ ⥤ D)
    (e : C ≌ E) : EqualizerCondition P ↔ EqualizerCondition (e.op.inverse ⋙ P) 
goal: CategoryTheory.regularTopology.EqualizerCondition P ↔
  CategoryTheory.regularTopology.EqualizerCondition (e.op.inverse.comp P)

full_name: CategoryTheory.regularTopology.parallelPair_pullback_initial
code: theorem parallelPair_pullback_initial {X B : C} (π : X ⟶ B)
    (c : PullbackCone π π) (hc : IsLimit c) :
    (parallelPair (C := (Sieve.ofArrows (fun (_ : Unit) => X) (fun _ => π)).arrows.categoryᵒᵖ)
    (Y := op ((Presieve.categoryMk _ (c.fst ≫ π) ⟨_, c.fst, π, ofArrows.mk (), rfl⟩)))
    (X := op ((Presieve.categoryMk _ π (Sieve.ofArrows_mk _ _ Unit.unit))))
    (Quiver.Hom.op (Over.homMk c.fst))
    (Quiver.Hom.op (Over.homMk c.snd c.condition.symm))).Initial 
goal: (CategoryTheory.Limits.parallelPair (CategoryTheory.Over.homMk c.fst ⋯).op
    (CategoryTheory.Over.homMk c.snd ⋯).op).Initial

full_name: CategoryTheory.regularTopology.isLimit_forkOfι_equiv
code: /--
Given a limiting pullback cone, the fork in `SingleEqualizerCondition` is limiting iff the diagram
in `Presheaf.isSheaf_iff_isLimit_coverage` is limiting.
-/
noncomputable def isLimit_forkOfι_equiv (P : Cᵒᵖ ⥤ D) {X B : C} (π : X ⟶ B)
    (c : PullbackCone π π) (hc : IsLimit c) :
    IsLimit (Fork.ofι (P.map π.op) (equalizerCondition_w P c)) ≃
    IsLimit (P.mapCone (Sieve.ofArrows (fun (_ : Unit) ↦ X) fun _ ↦ π).arrows.cocone.op) 
goal: CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.Fork.ofι (P.map π.op) ⋯) ≃
  CategoryTheory.Limits.IsLimit (P.mapCone (CategoryTheory.Sieve.ofArrows (fun x => X) fun x => π).arrows.cocone.op)

full_name: CategoryTheory.regularTopology.equalizerConditionMap_iff_nonempty_isLimit
code: lemma equalizerConditionMap_iff_nonempty_isLimit (P : Cᵒᵖ ⥤ D) ⦃X B : C⦄ (π : X ⟶ B)
    [HasPullback π π] : SingleEqualizerCondition P π ↔
      Nonempty (IsLimit (P.mapCone
        (Sieve.ofArrows (fun (_ : Unit) => X) (fun _ => π)).arrows.cocone.op)) 
goal: CategoryTheory.regularTopology.SingleEqualizerCondition P π ↔
  Nonempty
    (CategoryTheory.Limits.IsLimit (P.mapCone (CategoryTheory.Sieve.ofArrows (fun x => X) fun x => π).arrows.cocone.op))

full_name: CategoryTheory.regularTopology.equalizerCondition_iff_isSheaf
code: lemma equalizerCondition_iff_isSheaf (F : Cᵒᵖ ⥤ D) [Preregular C]
    [∀ {Y X : C} (f : Y ⟶ X) [EffectiveEpi f], HasPullback f f] :
    EqualizerCondition F ↔ Presheaf.IsSheaf (regularTopology C) F 
goal: CategoryTheory.regularTopology.EqualizerCondition F ↔
  CategoryTheory.Presheaf.IsSheaf (CategoryTheory.regularTopology C) F

full_name: CategoryTheory.regularTopology.isSheafFor_regular_of_projective
code: lemma isSheafFor_regular_of_projective {X : C} (S : Presieve X) [S.regular] [Projective X]
    (F : Cᵒᵖ ⥤ Type*) : S.IsSheafFor F 
goal: CategoryTheory.Presieve.IsSheafFor F S

full_name: CategoryTheory.regularTopology.isSheaf_of_projective
code: /-- Every presheaf is a sheaf for the regular topology if every object of `C` is projective. -/
theorem isSheaf_of_projective (F : Cᵒᵖ ⥤ D) [Preregular C] [∀ (X : C), Projective X] :
    Presheaf.IsSheaf (regularTopology C) F 
goal: CategoryTheory.Presheaf.IsSheaf (CategoryTheory.regularTopology C) F

full_name: CategoryTheory.regularTopology.isSheaf_yoneda_obj
code: /-- Every Yoneda-presheaf is a sheaf for the regular topology. -/
lemma isSheaf_yoneda_obj [Preregular C] (W : C)  :
    Presieve.IsSheaf (regularTopology C) (yoneda.obj W) 
goal: CategoryTheory.Presieve.IsSheaf (CategoryTheory.regularTopology C) (CategoryTheory.yoneda.obj W)

full_name: CategoryTheory.regularTopology.subcanonical
code: /-- The regular topology on any preregular category is subcanonical. -/
theorem subcanonical [Preregular C] : Sheaf.Subcanonical (regularTopology C) 
goal: CategoryTheory.Sheaf.Subcanonical (CategoryTheory.regularTopology C)