File: Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean

full_name: CategoryTheory.Equalizer.FirstObj
code: /--
The middle object of the fork diagram given in Equation (3) of [MM92], as well as the fork diagram
of <https://stacks.math.columbia.edu/tag/00VM>.
-/
def FirstObj : Type max v u 
goal: Type (max v u)

full_name: CategoryTheory.Equalizer.FirstObj.ext
code: @[ext]
lemma FirstObj.ext (z₁ z₂ : FirstObj P R) (h : ∀ (Y : C) (f : Y ⟶ X)
    (hf : R f), (Pi.π _ ⟨Y, f, hf⟩ : FirstObj P R ⟶ _) z₁ =
      (Pi.π _ ⟨Y, f, hf⟩ : FirstObj P R ⟶ _) z₂) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CategoryTheory.Equalizer.firstObjEqFamily_hom
code: /-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/
@[simps]
def firstObjEqFamily : FirstObj P R ≅ R.FamilyOfElements P 
goal: (CategoryTheory.Equalizer.firstObjEqFamily P R).hom t f hf =
  CategoryTheory.Limits.Pi.π (fun f => P.obj (Opposite.op f.fst)) ⟨Y, ⟨f, hf⟩⟩ t

full_name: CategoryTheory.Equalizer.firstObjEqFamily_inv
code: /-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/
@[simps]
def firstObjEqFamily : FirstObj P R ≅ R.FamilyOfElements P 
goal: ∀ (a : CategoryTheory.Presieve.FamilyOfElements P R),
  (CategoryTheory.Equalizer.firstObjEqFamily P R).inv a = CategoryTheory.Limits.Pi.lift (fun f x => x ↑f.snd ⋯) a

full_name: CategoryTheory.Equalizer.firstObjEqFamily
code: /-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/
@[simps]
def firstObjEqFamily : FirstObj P R ≅ R.FamilyOfElements P 
goal: CategoryTheory.Equalizer.FirstObj P R ≅ CategoryTheory.Presieve.FamilyOfElements P R

full_name: CategoryTheory.Equalizer.instInhabitedFirstObjBotPresieve
code: instance : Inhabited (FirstObj P (⊥ : Presieve X)) 
goal: Inhabited (CategoryTheory.Equalizer.FirstObj P ⊥)

full_name: CategoryTheory.Equalizer.instInhabitedFirstObjArrowsBotSieve
code: instance : Inhabited (FirstObj P ((⊥ : Sieve X) : Presieve X)) 
goal: Inhabited (CategoryTheory.Equalizer.FirstObj P ⊥.arrows)

full_name: CategoryTheory.Equalizer.forkMap
code: /--
The left morphism of the fork diagram given in Equation (3) of [MM92], as well as the fork diagram
of <https://stacks.math.columbia.edu/tag/00VM>.
-/
def forkMap : P.obj (op X) ⟶ FirstObj P R 
goal: P.obj (Opposite.op X) ⟶ CategoryTheory.Equalizer.FirstObj P R

full_name: CategoryTheory.Equalizer.Sieve.SecondObj
code: /-- The rightmost object of the fork diagram of Equation (3) [MM92], which contains the data used
to check a family is compatible.
-/
def SecondObj : Type max v u 
goal: Type (max v u)

full_name: CategoryTheory.Equalizer.Sieve.SecondObj.ext
code: @[ext]
lemma SecondObj.ext (z₁ z₂ : SecondObj P S) (h : ∀ (Y Z : C) (g : Z ⟶ Y) (f : Y ⟶ X)
    (hf : S.arrows f), (Pi.π _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟶ _) z₁ =
      (Pi.π _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟶ _) z₂) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CategoryTheory.Equalizer.Sieve.firstMap
code: /-- The map `p` of Equations (3,4) [MM92]. -/
def firstMap : FirstObj P (S : Presieve X) ⟶ SecondObj P S 
goal: CategoryTheory.Equalizer.FirstObj P S.arrows ⟶ CategoryTheory.Equalizer.Sieve.SecondObj P S

full_name: CategoryTheory.Equalizer.Sieve.instInhabitedSecondObjBotSieve
code: instance : Inhabited (SecondObj P (⊥ : Sieve X)) 
goal: Inhabited (CategoryTheory.Equalizer.Sieve.SecondObj P ⊥)

full_name: CategoryTheory.Equalizer.Sieve.secondMap
code: /-- The map `a` of Equations (3,4) [MM92]. -/
def secondMap : FirstObj P (S : Presieve X) ⟶ SecondObj P S 
goal: CategoryTheory.Equalizer.FirstObj P S.arrows ⟶ CategoryTheory.Equalizer.Sieve.SecondObj P S

full_name: CategoryTheory.Equalizer.Sieve.w
code: theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P S.arrows)
    (CategoryTheory.Equalizer.Sieve.firstMap P S) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P S.arrows)
    (CategoryTheory.Equalizer.Sieve.secondMap P S)

full_name: CategoryTheory.Equalizer.Sieve.compatible_iff
code: /--
The family of elements given by `x : FirstObj P S` is compatible iff `firstMap` and `secondMap`
map it to the same point.
-/
theorem compatible_iff (x : FirstObj P S) :
    ((firstObjEqFamily P S).hom x).Compatible ↔ firstMap P S x = secondMap P S x 
goal: ((CategoryTheory.Equalizer.firstObjEqFamily P S.arrows).hom x).Compatible ↔
  CategoryTheory.Equalizer.Sieve.firstMap P S x = CategoryTheory.Equalizer.Sieve.secondMap P S x

full_name: CategoryTheory.Equalizer.Sieve.equalizer_sheaf_condition
code: /-- `P` is a sheaf for `S`, iff the fork given by `w` is an equalizer. -/
theorem equalizer_sheaf_condition :
    Presieve.IsSheafFor P (S : Presieve X) ↔ Nonempty (IsLimit (Fork.ofι _ (w P S))) 
goal: CategoryTheory.Presieve.IsSheafFor P S.arrows ↔
  Nonempty
    (CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.Fork.ofι (CategoryTheory.Equalizer.forkMap P S.arrows) ⋯))

full_name: CategoryTheory.Equalizer.Presieve.SecondObj
code: /--
The rightmost object of the fork diagram of https://stacks.math.columbia.edu/tag/00VM, which
contains the data used to check a family of elements for a presieve is compatible.
-/
@[simp] def SecondObj : Type max v u 
goal: Type (max v u)

full_name: CategoryTheory.Equalizer.Presieve.firstMap
code: /-- The map `pr₀*` of <https://stacks.math.columbia.edu/tag/00VL>. -/
def firstMap : FirstObj P R ⟶ SecondObj P R 
goal: CategoryTheory.Equalizer.FirstObj P R ⟶ CategoryTheory.Equalizer.Presieve.SecondObj P R

full_name: CategoryTheory.Equalizer.Presieve.instInhabitedSecondObjBotPresieve
code: instance [HasPullbacks C] : Inhabited (SecondObj P (⊥ : Presieve X)) 
goal: Inhabited (CategoryTheory.Equalizer.Presieve.SecondObj P ⊥)

full_name: CategoryTheory.Equalizer.Presieve.secondMap
code: /-- The map `pr₁*` of <https://stacks.math.columbia.edu/tag/00VL>. -/
def secondMap : FirstObj P R ⟶ SecondObj P R 
goal: CategoryTheory.Equalizer.FirstObj P R ⟶ CategoryTheory.Equalizer.Presieve.SecondObj P R

full_name: CategoryTheory.Equalizer.Presieve.w
code: theorem w : forkMap P R ≫ firstMap P R = forkMap P R ≫ secondMap P R 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P R)
    (CategoryTheory.Equalizer.Presieve.firstMap P R) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P R)
    (CategoryTheory.Equalizer.Presieve.secondMap P R)

full_name: CategoryTheory.Equalizer.Presieve.compatible_iff
code: /--
The family of elements given by `x : FirstObj P S` is compatible iff `firstMap` and `secondMap`
map it to the same point.
-/
theorem compatible_iff (x : FirstObj P R) :
    ((firstObjEqFamily P R).hom x).Compatible ↔ firstMap P R x = secondMap P R x 
goal: ((CategoryTheory.Equalizer.firstObjEqFamily P R).hom x).Compatible ↔
  CategoryTheory.Equalizer.Presieve.firstMap P R x = CategoryTheory.Equalizer.Presieve.secondMap P R x

full_name: CategoryTheory.Equalizer.Presieve.sheaf_condition
code: /-- `P` is a sheaf for `R`, iff the fork given by `w` is an equalizer.
See <https://stacks.math.columbia.edu/tag/00VM>.
-/
theorem sheaf_condition : R.IsSheafFor P ↔ Nonempty (IsLimit (Fork.ofι _ (w P R))) 
goal: CategoryTheory.Presieve.IsSheafFor P R ↔
  Nonempty (CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.Fork.ofι (CategoryTheory.Equalizer.forkMap P R) ⋯))

full_name: CategoryTheory.Equalizer.Presieve.Arrows.FirstObj
code: /--
The middle object of the fork diagram of <https://stacks.math.columbia.edu/tag/00VM>.
The difference between this and `Equalizer.FirstObj P (ofArrows X π)` arrises if the family of
arrows `π` contains duplicates. The `Presieve.ofArrows` doesn't see those.
-/
def FirstObj : Type w 
goal: Type w

full_name: CategoryTheory.Equalizer.Presieve.Arrows.FirstObj.ext
code: @[ext]
lemma FirstObj.ext (z₁ z₂ : FirstObj P X) (h : ∀ i, (Pi.π _ i : FirstObj P X ⟶ _) z₁ =
    (Pi.π _ i : FirstObj P X ⟶ _) z₂) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CategoryTheory.Equalizer.Presieve.Arrows.SecondObj
code: /--
The rightmost object of the fork diagram of https://stacks.math.columbia.edu/tag/00VM.
The difference between this and `Equalizer.Presieve.SecondObj P (ofArrows X π)` arrises if the
family of arrows `π` contains duplicates. The `Presieve.ofArrows` doesn't see those.
-/
def SecondObj : Type w  
goal: Type w

full_name: CategoryTheory.Equalizer.Presieve.Arrows.SecondObj.ext
code: @[ext]
lemma SecondObj.ext (z₁ z₂ : SecondObj P X π) (h : ∀ ij, (Pi.π _ ij : SecondObj P X π ⟶ _) z₁ =
    (Pi.π _ ij : SecondObj P X π ⟶ _) z₂) : z₁ = z₂ 
goal: z₁ = z₂

full_name: CategoryTheory.Equalizer.Presieve.Arrows.forkMap
code: /--
The left morphism of the fork diagram.
-/
def forkMap : P.obj (op B) ⟶ FirstObj P X 
goal: P.obj (Opposite.op B) ⟶ CategoryTheory.Equalizer.Presieve.Arrows.FirstObj P X

full_name: CategoryTheory.Equalizer.Presieve.Arrows.firstMap
code: /--
The first of the two parallel morphisms of the fork diagram, induced by the first projection in
each pullback.
-/
def firstMap : FirstObj P X ⟶ SecondObj P X π 
goal: CategoryTheory.Equalizer.Presieve.Arrows.FirstObj P X ⟶ CategoryTheory.Equalizer.Presieve.Arrows.SecondObj P X π

full_name: CategoryTheory.Equalizer.Presieve.Arrows.secondMap
code: /--
The second of the two parallel morphisms of the fork diagram, induced by the second projection in
each pullback.
-/
def secondMap : FirstObj P X ⟶ SecondObj P X π 
goal: CategoryTheory.Equalizer.Presieve.Arrows.FirstObj P X ⟶ CategoryTheory.Equalizer.Presieve.Arrows.SecondObj P X π

full_name: CategoryTheory.Equalizer.Presieve.Arrows.w
code: theorem w : forkMap P X π ≫ firstMap P X π = forkMap P X π ≫ secondMap P X π 
goal: CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.Presieve.Arrows.forkMap P X π)
    (CategoryTheory.Equalizer.Presieve.Arrows.firstMap P X π) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.Presieve.Arrows.forkMap P X π)
    (CategoryTheory.Equalizer.Presieve.Arrows.secondMap P X π)

full_name: CategoryTheory.Equalizer.Presieve.Arrows.compatible_iff
code: /--
The family of elements given by `x : FirstObj P S` is compatible iff `firstMap` and `secondMap`
map it to the same point.
-/
theorem compatible_iff (x : FirstObj P X) : (Arrows.Compatible P π ((Types.productIso _).hom x)) ↔
    firstMap P X π x = secondMap P X π x 
goal: CategoryTheory.Presieve.Arrows.Compatible P π
    ((CategoryTheory.Limits.Types.productIso fun i => P.obj (Opposite.op (X i))).hom x) ↔
  CategoryTheory.Equalizer.Presieve.Arrows.firstMap P X π x = CategoryTheory.Equalizer.Presieve.Arrows.secondMap P X π x

full_name: CategoryTheory.Equalizer.Presieve.Arrows.sheaf_condition
code: /--
`P` is a sheaf for `Presieve.ofArrows X π`, iff the fork given by `w` is an equalizer.
See <https://stacks.math.columbia.edu/tag/00VM>.
-/
theorem sheaf_condition : (Presieve.ofArrows X π).IsSheafFor P ↔
    Nonempty (IsLimit (Fork.ofι (forkMap P X π) (w P X π))) 
goal: CategoryTheory.Presieve.IsSheafFor P (CategoryTheory.Presieve.ofArrows X π) ↔
  Nonempty
    (CategoryTheory.Limits.IsLimit
      (CategoryTheory.Limits.Fork.ofι (CategoryTheory.Equalizer.Presieve.Arrows.forkMap P X π) ⋯))