File: Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean

full_name: TopCat.Presheaf.IsSheafPairwiseIntersections
code: /-- An alternative formulation of the sheaf condition
(which we prove equivalent to the usual one below as
`isSheaf_iff_isSheafPairwiseIntersections`).

A presheaf is a sheaf if `F` sends the cone `(Pairwise.cocone U).op` to a limit cone.
(Recall `Pairwise.cocone U` has cone point `iSup U`, mapping down to the `U i` and the `U i ⊓ U j`.)
-/
def IsSheafPairwiseIntersections (F : Presheaf C X) : Prop 
goal: Prop

full_name: TopCat.Presheaf.IsSheafPreservesLimitPairwiseIntersections
code: /-- An alternative formulation of the sheaf condition
(which we prove equivalent to the usual one below as
`isSheaf_iff_isSheafPreservesLimitPairwiseIntersections`).

A presheaf is a sheaf if `F` preserves the limit of `Pairwise.diagram U`.
(Recall `Pairwise.diagram U` is the diagram consisting of the pairwise intersections
`U i ⊓ U j` mapping into the open sets `U i`. This diagram has limit `iSup U`.)
-/
def IsSheafPreservesLimitPairwiseIntersections (F : Presheaf C X) : Prop 
goal: Prop

full_name: TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverObj
code: /-- Implementation detail:
the object level of `pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U`
-/
@[simp]
def pairwiseToOpensLeCoverObj : Pairwise ι → OpensLeCover U
  
goal: CategoryTheory.Pairwise ι → TopCat.Presheaf.SheafCondition.OpensLeCover U

full_name: TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverMap
code: /-- Implementation detail:
the morphism level of `pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U`
-/
def pairwiseToOpensLeCoverMap :
    ∀ {V W : Pairwise ι}, (V ⟶ W) → (pairwiseToOpensLeCoverObj U V ⟶ pairwiseToOpensLeCoverObj U W)
  
goal: (V ⟶ W) →
  (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverObj U V ⟶
    TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverObj U W)

full_name: TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover
code: /-- The category of single and double intersections of the `U i` maps into the category
of open sets below some `U i`.
-/
@[simps]
def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U 
goal: CategoryTheory.Pairwise ι ⥤ TopCat.Presheaf.SheafCondition.OpensLeCover U

full_name: TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover_map
code: /-- The category of single and double intersections of the `U i` maps into the category
of open sets below some `U i`.
-/
@[simps]
def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U 
goal: (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U).map i =
  TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverMap U i

full_name: TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover_obj
code: /-- The category of single and double intersections of the `U i` maps into the category
of open sets below some `U i`.
-/
@[simps]
def pairwiseToOpensLeCover : Pairwise ι ⥤ OpensLeCover U 
goal: ∀ (a : CategoryTheory.Pairwise ι),
  (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U).obj a =
    TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCoverObj U a

full_name: TopCat.Presheaf.SheafCondition.instNonemptyStructuredArrowPairwiseOpensLeCoverPairwiseToOpensLeCover
code: instance (V : OpensLeCover U) : Nonempty (StructuredArrow V (pairwiseToOpensLeCover U)) 
goal: Nonempty (CategoryTheory.StructuredArrow V (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U))

full_name: TopCat.Presheaf.SheafCondition.instFinalPairwiseOpensLeCoverPairwiseToOpensLeCover
code: /-- The diagram consisting of the `U i` and `U i ⊓ U j` is cofinal in the diagram
of all opens contained in some `U i`.
-/
instance : Functor.Final (pairwiseToOpensLeCover U) 
goal: (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U).Final

full_name: TopCat.Presheaf.SheafCondition.pairwiseDiagramIso
code: /-- The diagram in `Opens X` indexed by pairwise intersections from `U` is isomorphic
(in fact, equal) to the diagram factored through `OpensLeCover U`.
-/
def pairwiseDiagramIso :
    Pairwise.diagram U ≅ pairwiseToOpensLeCover U ⋙ fullSubcategoryInclusion _ 
goal: CategoryTheory.Pairwise.diagram U ≅
  TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U ⋙
    CategoryTheory.fullSubcategoryInclusion fun V => ∃ i, V ≤ U i

full_name: TopCat.Presheaf.SheafCondition.pairwiseCoconeIso
code: /--
The cocone `Pairwise.cocone U` with cocone point `iSup U` over `Pairwise.diagram U` is isomorphic
to the cocone `opensLeCoverCocone U` (with the same cocone point)
after appropriate whiskering and postcomposition.
-/
def pairwiseCoconeIso :
    (Pairwise.cocone U).op ≅
      (Cones.postcomposeEquivalence (NatIso.op (pairwiseDiagramIso U : _) : _)).functor.obj
        ((opensLeCoverCocone U).op.whisker (pairwiseToOpensLeCover U).op) 
goal: (CategoryTheory.Pairwise.cocone U).op ≅
  (CategoryTheory.Limits.Cones.postcomposeEquivalence
          (CategoryTheory.NatIso.op (TopCat.Presheaf.SheafCondition.pairwiseDiagramIso U))).functor.obj
    (CategoryTheory.Limits.Cone.whisker (TopCat.Presheaf.SheafCondition.pairwiseToOpensLeCover U).op
      (TopCat.Presheaf.SheafCondition.opensLeCoverCocone U).op)

full_name: TopCat.Presheaf.isSheafOpensLeCover_iff_isSheafPairwiseIntersections
code: /-- The sheaf condition
in terms of a limit diagram over all `{ V : Opens X // ∃ i, V ≤ U i }`
is equivalent to the reformulation
in terms of a limit diagram over `U i` and `U i ⊓ U j`.
-/
theorem isSheafOpensLeCover_iff_isSheafPairwiseIntersections :
    F.IsSheafOpensLeCover ↔ F.IsSheafPairwiseIntersections 
goal: F.IsSheafOpensLeCover ↔ F.IsSheafPairwiseIntersections

full_name: TopCat.Presheaf.isSheaf_iff_isSheafPairwiseIntersections
code: /-- The sheaf condition in terms of an equalizer diagram is equivalent
to the reformulation in terms of a limit diagram over `U i` and `U i ⊓ U j`.
-/
theorem isSheaf_iff_isSheafPairwiseIntersections : F.IsSheaf ↔ F.IsSheafPairwiseIntersections 
goal: F.IsSheaf ↔ F.IsSheafPairwiseIntersections

full_name: TopCat.Presheaf.isSheaf_iff_isSheafPreservesLimitPairwiseIntersections
code: /-- The sheaf condition in terms of an equalizer diagram is equivalent
to the reformulation in terms of the presheaf preserving the limit of the diagram
consisting of the `U i` and `U i ⊓ U j`.
-/
theorem isSheaf_iff_isSheafPreservesLimitPairwiseIntersections :
    F.IsSheaf ↔ F.IsSheafPreservesLimitPairwiseIntersections 
goal: F.IsSheaf ↔ F.IsSheafPreservesLimitPairwiseIntersections

full_name: TopCat.Sheaf.interUnionPullbackCone
code: /-- For a sheaf `F`, `F(U ⊔ V)` is the pullback of `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)`.
This is the pullback cone. -/
def interUnionPullbackCone :
    PullbackCone (F.1.map (homOfLE inf_le_left : U ⊓ V ⟶ _).op)
      (F.1.map (homOfLE inf_le_right).op) 
goal: CategoryTheory.Limits.PullbackCone (F.val.map (CategoryTheory.homOfLE ⋯).op) (F.val.map (CategoryTheory.homOfLE ⋯).op)

full_name: TopCat.Sheaf.interUnionPullbackCone_pt
code: @[simp]
theorem interUnionPullbackCone_pt : (interUnionPullbackCone F U V).pt = F.1.obj (op <| U ⊔ V) 
goal: (F.interUnionPullbackCone U V).pt = F.val.obj (Opposite.op (U ⊔ V))

full_name: TopCat.Sheaf.interUnionPullbackCone_fst
code: @[simp]
theorem interUnionPullbackCone_fst :
    (interUnionPullbackCone F U V).fst = F.1.map (homOfLE le_sup_left).op 
goal: (F.interUnionPullbackCone U V).fst = F.val.map (CategoryTheory.homOfLE ⋯).op

full_name: TopCat.Sheaf.interUnionPullbackCone_snd
code: @[simp]
theorem interUnionPullbackCone_snd :
    (interUnionPullbackCone F U V).snd = F.1.map (homOfLE le_sup_right).op 
goal: (F.interUnionPullbackCone U V).snd = F.val.map (CategoryTheory.homOfLE ⋯).op

full_name: TopCat.Sheaf.interUnionPullbackConeLift
code: /-- (Implementation).
Every cone over `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)` factors through `F(U ⊔ V)`.
-/
def interUnionPullbackConeLift : s.pt ⟶ F.1.obj (op (U ⊔ V)) 
goal: s.pt ⟶ F.val.obj (Opposite.op (U ⊔ V))

full_name: TopCat.Sheaf.interUnionPullbackConeLift_left
code: theorem interUnionPullbackConeLift_left :
    interUnionPullbackConeLift F U V s ≫ F.1.map (homOfLE le_sup_left).op = s.fst 
goal: F.interUnionPullbackConeLift U V s ≫ F.val.map (CategoryTheory.homOfLE ⋯).op = s.fst

full_name: TopCat.Sheaf.interUnionPullbackConeLift_right
code: theorem interUnionPullbackConeLift_right :
    interUnionPullbackConeLift F U V s ≫ F.1.map (homOfLE le_sup_right).op = s.snd 
goal: F.interUnionPullbackConeLift U V s ≫ F.val.map (CategoryTheory.homOfLE ⋯).op = s.snd

full_name: TopCat.Sheaf.isLimitPullbackCone
code: /-- For a sheaf `F`, `F(U ⊔ V)` is the pullback of `F(U) ⟶ F(U ⊓ V)` and `F(V) ⟶ F(U ⊓ V)`. -/
def isLimitPullbackCone : IsLimit (interUnionPullbackCone F U V) 
goal: CategoryTheory.Limits.IsLimit (F.interUnionPullbackCone U V)

full_name: TopCat.Sheaf.isProductOfDisjoint
code: /-- If `U, V` are disjoint, then `F(U ⊔ V) = F(U) × F(V)`. -/
def isProductOfDisjoint (h : U ⊓ V = ⊥) :
    IsLimit
      (BinaryFan.mk (F.1.map (homOfLE le_sup_left : _ ⟶ U ⊔ V).op)
        (F.1.map (homOfLE le_sup_right : _ ⟶ U ⊔ V).op)) 
goal: CategoryTheory.Limits.IsLimit
  (CategoryTheory.Limits.BinaryFan.mk (F.val.map (CategoryTheory.homOfLE ⋯).op)
    (F.val.map (CategoryTheory.homOfLE ⋯).op))

full_name: TopCat.Sheaf.objSupIsoProdEqLocus
code: /-- `F(U ⊔ V)` is isomorphic to the `eq_locus` of the two maps `F(U) × F(V) ⟶ F(U ⊓ V)`. -/
def objSupIsoProdEqLocus {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) :
    F.1.obj (op <| U ⊔ V) ≅ CommRingCat.of <|
    -- Porting note: Lean 3 is able to figure out the ring homomorphism automatically
    RingHom.eqLocus
      (RingHom.comp (F.val.map (homOfLE inf_le_left : U ⊓ V ⟶ U).op)
        (RingHom.fst (F.val.obj <| op U) (F.val.obj <| op V)))
      (RingHom.comp (F.val.map (homOfLE inf_le_right : U ⊓ V ⟶ V).op)
        (RingHom.snd (F.val.obj <| op U) (F.val.obj <| op V))) 
goal: F.val.obj (Opposite.op (U ⊔ V)) ≅
  CommRingCat.of
    ↥((RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
            (RingHom.fst ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V)))).eqLocus
        (RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
          (RingHom.snd ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V)))))

full_name: TopCat.Sheaf.objSupIsoProdEqLocus_hom_fst
code: theorem objSupIsoProdEqLocus_hom_fst {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) (x) :
    ((F.objSupIsoProdEqLocus U V).hom x).1.fst = F.1.map (homOfLE le_sup_left).op x 
goal: (↑((F.objSupIsoProdEqLocus U V).hom x)).1 = (F.val.map (CategoryTheory.homOfLE ⋯).op) x

full_name: TopCat.Sheaf.objSupIsoProdEqLocus_hom_snd
code: theorem objSupIsoProdEqLocus_hom_snd {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) (x) :
    ((F.objSupIsoProdEqLocus U V).hom x).1.snd = F.1.map (homOfLE le_sup_right).op x 
goal: (↑((F.objSupIsoProdEqLocus U V).hom x)).2 = (F.val.map (CategoryTheory.homOfLE ⋯).op) x

full_name: TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst
code: theorem objSupIsoProdEqLocus_inv_fst {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) (x) :
    F.1.map (homOfLE le_sup_left).op ((F.objSupIsoProdEqLocus U V).inv x) = x.1.1 
goal: (F.val.map (CategoryTheory.homOfLE ⋯).op) ((F.objSupIsoProdEqLocus U V).inv x) = (↑x).1

full_name: TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd
code: theorem objSupIsoProdEqLocus_inv_snd {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) (x) :
    F.1.map (homOfLE le_sup_right).op ((F.objSupIsoProdEqLocus U V).inv x) = x.1.2 
goal: (F.val.map (CategoryTheory.homOfLE ⋯).op) ((F.objSupIsoProdEqLocus U V).inv x) = (↑x).2