File: Mathlib/Geometry/RingedSpace/PresheafedSpace/Gluing.lean

full_name: AlgebraicGeometry.PresheafedSpace.GlueData
code: /-- A family of gluing data consists of
1. An index type `J`
2. A presheafed space `U i` for each `i : J`.
3. A presheafed space `V i j` for each `i j : J`.
  (Note that this is `J × J → PresheafedSpace C` rather than `J → J → PresheafedSpace C` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends GlueData (PresheafedSpace.{u, v, v} C) where
  f_open : ∀ i j, IsOpenImmersion (f i j)
goal: Type (max u (v + 1))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.f_open
code: /-- A family of gluing data consists of
1. An index type `J`
2. A presheafed space `U i` for each `i : J`.
3. A presheafed space `V i j` for each `i j : J`.
  (Note that this is `J × J → PresheafedSpace C` rather than `J → J → PresheafedSpace C` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends GlueData (PresheafedSpace.{u, v, v} C) where
  f_open : ∀ i j, IsOpenImmersion (f i j)
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion (self.f i j)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_PresheafedSpace_GlueData_term𝖣_1»
code: local notation "𝖣" => D.toGlueData
goal: Lean.Macro

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_PresheafedSpace_GlueData_termπ₁_,_,__1»
code: local notation "π₁ " i ", " j ", " k => pullback.fst (D.f i j) (D.f i k)
goal: Lean.Macro

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_PresheafedSpace_GlueData_termπ₂_,_,__1»
code: local notation "π₂ " i ", " j ", " k => pullback.snd (D.f i j) (D.f i k)
goal: Lean.Macro

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_PresheafedSpace_GlueData_termπ₁⁻¹_,_,__1»
code: local notation "π₁⁻¹ " i ", " j ", " k =>
  (PresheafedSpace.IsOpenImmersion.pullbackFstOfRight (D.f i j) (D.f i k)).invApp
goal: Lean.Macro

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_PresheafedSpace_GlueData_termπ₂⁻¹_,_,__1»
code: local notation "π₂⁻¹ " i ", " j ", " k =>
  (PresheafedSpace.IsOpenImmersion.pullbackSndOfLeft (D.f i j) (D.f i k)).invApp
goal: Lean.Macro

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.toTopGlueData
code: /-- The glue data of topological spaces associated to a family of glue data of PresheafedSpaces. -/
abbrev toTopGlueData : TopCat.GlueData 
goal: TopCat.GlueData

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ι_openEmbedding
code: theorem ι_openEmbedding [HasLimits C] (i : D.J) : OpenEmbedding (𝖣.ι i).base 
goal: OpenEmbedding ⇑(D.ι i).base

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.pullback_base
code: theorem pullback_base (i j k : D.J) (S : Set (D.V (i, j)).carrier) :
    (π₂ i, j, k) '' ((π₁ i, j, k) ⁻¹' S) = D.f i k ⁻¹' (D.f i j '' S) 
goal: ⇑(CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)).base ''
    (⇑(CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).base ⁻¹' S) =
  ⇑(D.f i k).base ⁻¹' (⇑(D.f i j).base '' S)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.f_invApp_f_app
code: /-- The red and the blue arrows in ![this diagram](https://i.imgur.com/0GiBUh6.png) commute. -/
@[simp, reassoc]
theorem f_invApp_f_app (i j k : D.J) (U : Opens (D.V (i, j)).carrier) :
    (D.f_open i j).invApp U ≫ (D.f i k).c.app _ =
      (π₁ i, j, k).c.app (op U) ≫
        (π₂⁻¹ i, j, k) (unop _) ≫
          (D.V _).presheaf.map
            (eqToHom
              (by
                delta IsOpenImmersion.opensFunctor
                dsimp only [Functor.op, IsOpenMap.functor, Opens.map, unop_op]
                congr
                apply pullback_base)) 
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (D.f i j) U ≫
    (D.f i k).c.app (Opposite.op ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor (D.f i j)).obj U)) =
  (CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map (CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U))))) ≫
      (D.V (i, k)).presheaf.map (CategoryTheory.eqToHom ⋯)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.snd_invApp_t_app'
code: /-- We can prove the `eq` along with the lemma. Thus this is bundled together here, and the
lemma itself is separated below.
-/
theorem snd_invApp_t_app' (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    ∃ eq,
      (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ ≫ (D.V (k, i)).presheaf.map (eqToHom eq) =
        (D.t' k i j).c.app _ ≫ (π₁⁻¹ k, j, i) (unop _) 
goal: ∃ (eq :
  (TopologicalSpace.Opens.map (D.t k i).base).op.obj
      (Opposite.op
        ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
              (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
          U)) =
    Opposite.op
      ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
            (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))).obj
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ })))),
  AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)) U ≫
      (D.t k i).c.app
          (Opposite.op
            ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
                  (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
              U)) ≫
        (D.V (k, i)).presheaf.map (CategoryTheory.eqToHom eq) =
    (D.t' k i j).c.app (Opposite.op U) ≫
      AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ }))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.snd_invApp_t_app
code: /-- The red and the blue arrows in ![this diagram](https://i.imgur.com/q6X1GJ9.png) commute. -/
@[simp, reassoc]
theorem snd_invApp_t_app (i j k : D.J) (U : Opens (pullback (D.f i j) (D.f i k)).carrier) :
    (π₂⁻¹ i, j, k) U ≫ (D.t k i).c.app _ =
      (D.t' k i j).c.app _ ≫
        (π₁⁻¹ k, j, i) (unop _) ≫
          (D.V (k, i)).presheaf.map (eqToHom (D.snd_invApp_t_app' i j k U).choose.symm) 
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)) U ≫
    (D.t k i).c.app
      (Opposite.op
        ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
              (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))).obj
          U)) =
  (D.t' k i j).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.fst (D.f k i) (D.f k j))
        (Opposite.unop
          (Opposite.op { carrier := ⇑(D.t' k i j).base ⁻¹' ↑(Opposite.unop (Opposite.op U)), is_open' := ⋯ })) ≫
      (D.V (k, i)).presheaf.map (CategoryTheory.eqToHom ⋯)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ι_image_preimage_eq
code: theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (opensFunctor (D.f j i)).obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U)) 
goal: (TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U) =
  (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor (D.f j i)).obj
    ((TopologicalSpace.Opens.map (D.t j i).base).obj ((TopologicalSpace.Opens.map (D.f i j).base).obj U))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.opensImagePreimageMap
code: /-- (Implementation). The map `Γ(𝒪_{U_i}, U) ⟶ Γ(𝒪_{U_j}, 𝖣.ι j ⁻¹' (𝖣.ι i '' U))` -/
def opensImagePreimageMap (i j : D.J) (U : Opens (D.U i).carrier) :
    (D.U i).presheaf.obj (op U) ⟶
    (D.U j).presheaf.obj (op <|
      (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U)) 
goal: (D.U i).presheaf.obj (Opposite.op U) ⟶
  (D.U j).presheaf.obj (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U)))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.opensImagePreimageMap_app'
code: theorem opensImagePreimageMap_app' (i j k : D.J) (U : Opens (D.U i).carrier) :
    ∃ eq,
      D.opensImagePreimageMap i j U ≫ (D.f j k).c.app _ =
        ((π₁ j, i, k) ≫ D.t j i ≫ D.f i j).c.app (op U) ≫
          (π₂⁻¹ j, i, k) (unop _) ≫ (D.V (j, k)).presheaf.map (eqToHom eq) 
goal: ∃ (eq :
  Opposite.op
      ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor
            (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))).obj
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map
                    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U)))))) =
    (TopologicalSpace.Opens.map (D.f j k).base).op.obj
      (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U)))),
  D.opensImagePreimageMap i j U ≫
      (D.f j k).c.app (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U))) =
    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).c.app (Opposite.op U) ≫
      AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))
          (Opposite.unop
            (Opposite.op
              ((TopologicalSpace.Opens.map
                      (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
                (Opposite.unop (Opposite.op U))))) ≫
        (D.V (j, k)).presheaf.map (CategoryTheory.eqToHom eq)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.opensImagePreimageMap_app
code: /-- The red and the blue arrows in ![this diagram](https://i.imgur.com/mBzV1Rx.png) commute. -/
theorem opensImagePreimageMap_app (i j k : D.J) (U : Opens (D.U i).carrier) :
    D.opensImagePreimageMap i j U ≫ (D.f j k).c.app _ =
      ((π₁ j, i, k) ≫ D.t j i ≫ D.f i j).c.app (op U) ≫
        (π₂⁻¹ j, i, k) (unop _) ≫
          (D.V (j, k)).presheaf.map (eqToHom (opensImagePreimageMap_app' D i j k U).choose) 
goal: D.opensImagePreimageMap i j U ≫
    (D.f j k).c.app (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U))) =
  (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map
                    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U))))) ≫
      (D.V (j, k)).presheaf.map (CategoryTheory.eqToHom ⋯)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.opensImagePreimageMap_app_assoc
code: theorem opensImagePreimageMap_app_assoc (i j k : D.J) (U : Opens (D.U i).carrier) {X' : C}
    (f' : _ ⟶ X') :
    D.opensImagePreimageMap i j U ≫ (D.f j k).c.app _ ≫ f' =
      ((π₁ j, i, k) ≫ D.t j i ≫ D.f i j).c.app (op U) ≫
        (π₂⁻¹ j, i, k) (unop _) ≫
          (D.V (j, k)).presheaf.map
            (eqToHom (opensImagePreimageMap_app' D i j k U).choose) ≫ f' 
goal: D.opensImagePreimageMap i j U ≫
    (D.f j k).c.app (Opposite.op ((TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U))) ≫ f' =
  (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f j i) (D.f j k))
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map
                    (CategoryTheory.Limits.pullback.fst (D.f j i) (D.f j k) ≫ D.t j i ≫ D.f i j).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U))))) ≫
      (D.V (j, k)).presheaf.map (CategoryTheory.eqToHom ⋯) ≫ f'

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.diagramOverOpen
code: /-- (Implementation) Given an open subset of one of the spaces `U ⊆ Uᵢ`, the sheaf component of
the image `ι '' U` in the glued space is the limit of this diagram. -/
abbrev diagramOverOpen {i : D.J} (U : Opens (D.U i).carrier) :
    -- Porting note : ↓ these need to be explicit
    (WalkingMultispan D.diagram.fstFrom D.diagram.sndFrom)ᵒᵖ ⥤ C 
goal: (CategoryTheory.Limits.WalkingMultispan D.diagram.fstFrom D.diagram.sndFrom)ᵒᵖ ⥤ C

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.diagramOverOpenπ
code: /-- (Implementation)
The projection from the limit of `diagram_over_open` to a component of `D.U j`. -/
abbrev diagramOverOpenπ {i : D.J} (U : Opens (D.U i).carrier) (j : D.J) 
goal: CategoryTheory.Limits.limit (D.diagramOverOpen U) ⟶
  (D.diagramOverOpen U).obj (Opposite.op (CategoryTheory.Limits.WalkingMultispan.right j))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ιInvAppπApp
code: /-- (Implementation) We construct the map `Γ(𝒪_{U_i}, U) ⟶ Γ(𝒪_V, U_V)` for each `V` in the gluing
diagram. We will lift these maps into `ιInvApp`. -/
def ιInvAppπApp {i : D.J} (U : Opens (D.U i).carrier) (j) :
    (𝖣.U i).presheaf.obj (op U) ⟶ (D.diagramOverOpen U).obj (op j) 
goal: (D.U i).presheaf.obj (Opposite.op U) ⟶ (D.diagramOverOpen U).obj (Opposite.op j)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ιInvApp
code: /-- (Implementation) The natural map `Γ(𝒪_{U_i}, U) ⟶ Γ(𝒪_X, 𝖣.ι i '' U)`.
This forms the inverse of `(𝖣.ι i).c.app (op U)`. -/
def ιInvApp {i : D.J} (U : Opens (D.U i).carrier) :
    (D.U i).presheaf.obj (op U) ⟶ limit (D.diagramOverOpen U) 
goal: (D.U i).presheaf.obj (Opposite.op U) ⟶ CategoryTheory.Limits.limit (D.diagramOverOpen U)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ιInvApp_π
code: /-- `ιInvApp` is the left inverse of `D.ι i` on `U`. -/
theorem ιInvApp_π {i : D.J} (U : Opens (D.U i).carrier) :
    ∃ eq, D.ιInvApp U ≫ D.diagramOverOpenπ U i = (D.U i).presheaf.map (eqToHom eq) 
goal: ∃ (eq :
  Opposite.op U =
    Opposite.op
      ((TopologicalSpace.Opens.map
            (CategoryTheory.Limits.colimit.ι D.diagram.multispan
                (Opposite.unop (Opposite.op (CategoryTheory.Limits.WalkingMultispan.right i)))).base).obj
        (⋯.functor.obj U))),
  D.ιInvApp U ≫ D.diagramOverOpenπ U i = (D.U i).presheaf.map (CategoryTheory.eqToHom eq)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ιInvAppπEqMap
code: /-- The `eqToHom` given by `ιInvApp_π`. -/
abbrev ιInvAppπEqMap {i : D.J} (U : Opens (D.U i).carrier) 
goal: (D.U i).presheaf.obj
    (Opposite.op
      ((TopologicalSpace.Opens.map
            (CategoryTheory.Limits.colimit.ι D.diagram.multispan
                (Opposite.unop (Opposite.op (CategoryTheory.Limits.WalkingMultispan.right i)))).base).obj
        (⋯.functor.obj U))) ⟶
  (D.U i).presheaf.obj (Opposite.op U)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.π_ιInvApp_π
code: /-- `ιInvApp` is the right inverse of `D.ι i` on `U`. -/
theorem π_ιInvApp_π (i j : D.J) (U : Opens (D.U i).carrier) :
    D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U ≫ D.diagramOverOpenπ U j =
      D.diagramOverOpenπ U j 
goal: D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U ≫ D.diagramOverOpenπ U j = D.diagramOverOpenπ U j

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.π_ιInvApp_eq_id
code: /-- `ιInvApp` is the inverse of `D.ι i` on `U`. -/
theorem π_ιInvApp_eq_id (i : D.J) (U : Opens (D.U i).carrier) :
    D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U = 𝟙 _ 
goal: D.diagramOverOpenπ U i ≫ D.ιInvAppπEqMap U ≫ D.ιInvApp U = 𝟙 (CategoryTheory.Limits.limit (D.diagramOverOpen U))

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.componentwise_diagram_π_isIso
code: instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) :
    IsIso (D.diagramOverOpenπ U i) 
goal: CategoryTheory.IsIso (D.diagramOverOpenπ U i)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ιIsOpenImmersion
code: instance ιIsOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) 
goal: AlgebraicGeometry.PresheafedSpace.IsOpenImmersion (D.ι i)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.vPullbackConeIsLimit
code: /-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) 
goal: CategoryTheory.Limits.IsLimit (D.vPullbackCone i j)

full_name: AlgebraicGeometry.PresheafedSpace.GlueData.ι_jointly_surjective
code: theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : D.J) (y : D.U i), (𝖣.ι i).base y = x 
goal: ∃ i y, (D.ι i).base y = x

full_name: AlgebraicGeometry.SheafedSpace.GlueData
code: /-- A family of gluing data consists of
1. An index type `J`
2. A sheafed space `U i` for each `i : J`.
3. A sheafed space `V i j` for each `i j : J`.
  (Note that this is `J × J → SheafedSpace C` rather than `J → J → SheafedSpace C` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends CategoryTheory.GlueData (SheafedSpace.{u, v, v} C) where
  f_open : ∀ i j, SheafedSpace.IsOpenImmersion (f i j)
goal: Type (max u (v + 1))

full_name: AlgebraicGeometry.SheafedSpace.GlueData.f_open
code: /-- A family of gluing data consists of
1. An index type `J`
2. A sheafed space `U i` for each `i : J`.
3. A sheafed space `V i j` for each `i j : J`.
  (Note that this is `J × J → SheafedSpace C` rather than `J → J → SheafedSpace C` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends CategoryTheory.GlueData (SheafedSpace.{u, v, v} C) where
  f_open : ∀ i j, SheafedSpace.IsOpenImmersion (f i j)
goal: AlgebraicGeometry.SheafedSpace.IsOpenImmersion (self.f i j)

full_name: AlgebraicGeometry.SheafedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_SheafedSpace_GlueData_term𝖣_1»
code: local notation "𝖣" => D.toGlueData
goal: Lean.Macro

full_name: AlgebraicGeometry.SheafedSpace.GlueData.toPresheafedSpaceGlueData
code: /-- The glue data of presheafed spaces associated to a family of glue data of sheafed spaces. -/
abbrev toPresheafedSpaceGlueData : PresheafedSpace.GlueData C 
goal: AlgebraicGeometry.PresheafedSpace.GlueData C

full_name: AlgebraicGeometry.SheafedSpace.GlueData.isoPresheafedSpace
code: /-- The gluing as sheafed spaces is isomorphic to the gluing as presheafed spaces. -/
abbrev isoPresheafedSpace :
    𝖣.glued.toPresheafedSpace ≅ D.toPresheafedSpaceGlueData.toGlueData.glued 
goal: D.glued.toPresheafedSpace ≅ D.toPresheafedSpaceGlueData.glued

full_name: AlgebraicGeometry.SheafedSpace.GlueData.ι_isoPresheafedSpace_inv
code: theorem ι_isoPresheafedSpace_inv (i : D.J) :
    D.toPresheafedSpaceGlueData.toGlueData.ι i ≫ D.isoPresheafedSpace.inv = 𝖣.ι i 
goal: D.toPresheafedSpaceGlueData.ι i ≫ D.isoPresheafedSpace.inv = D.ι i

full_name: AlgebraicGeometry.SheafedSpace.GlueData.ιIsOpenImmersion
code: instance ιIsOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) 
goal: AlgebraicGeometry.SheafedSpace.IsOpenImmersion (D.ι i)

full_name: AlgebraicGeometry.SheafedSpace.GlueData.ι_jointly_surjective
code: theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : D.J) (y : D.U i), (𝖣.ι i).base y = x 
goal: ∃ i y, (D.ι i).base y = x

full_name: AlgebraicGeometry.SheafedSpace.GlueData.vPullbackConeIsLimit
code: /-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) 
goal: CategoryTheory.Limits.IsLimit (D.vPullbackCone i j)

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData
code: /-- A family of gluing data consists of
1. An index type `J`
2. A locally ringed space `U i` for each `i : J`.
3. A locally ringed space `V i j` for each `i j : J`.
  (Note that this is `J × J → LocallyRingedSpace` rather than `J → J → LocallyRingedSpace` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends CategoryTheory.GlueData LocallyRingedSpace where
  f_open : ∀ i j, LocallyRingedSpace.IsOpenImmersion (f i j)
goal: Type (u_1 + 1)

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.f_open
code: /-- A family of gluing data consists of
1. An index type `J`
2. A locally ringed space `U i` for each `i : J`.
3. A locally ringed space `V i j` for each `i j : J`.
  (Note that this is `J × J → LocallyRingedSpace` rather than `J → J → LocallyRingedSpace` to
  connect to the limits library easier.)
4. An open immersion `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure GlueData extends CategoryTheory.GlueData LocallyRingedSpace where
  f_open : ∀ i j, LocallyRingedSpace.IsOpenImmersion (f i j)
goal: AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion (self.f i j)

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.«_aux_Mathlib_Geometry_RingedSpace_PresheafedSpace_Gluing___macroRules_AlgebraicGeometry_LocallyRingedSpace_GlueData_term𝖣_1»
code: local notation "𝖣" => D.toGlueData
goal: Lean.Macro

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.toSheafedSpaceGlueData
code: /-- The glue data of ringed spaces associated to a family of glue data of locally ringed spaces. -/
abbrev toSheafedSpaceGlueData : SheafedSpace.GlueData CommRingCat 
goal: AlgebraicGeometry.SheafedSpace.GlueData CommRingCat

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.isoSheafedSpace
code: /-- The gluing as locally ringed spaces is isomorphic to the gluing as ringed spaces. -/
abbrev isoSheafedSpace : 𝖣.glued.toSheafedSpace ≅ D.toSheafedSpaceGlueData.toGlueData.glued 
goal: D.glued.toSheafedSpace ≅ D.toSheafedSpaceGlueData.glued

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.ι_isoSheafedSpace_inv
code: theorem ι_isoSheafedSpace_inv (i : D.J) :
    D.toSheafedSpaceGlueData.toGlueData.ι i ≫ D.isoSheafedSpace.inv = (𝖣.ι i).1 
goal: D.toSheafedSpaceGlueData.ι i ≫ D.isoSheafedSpace.inv = (D.ι i).val

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.ι_isOpenImmersion
code: instance ι_isOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) 
goal: AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion (D.ι i)

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.instPreservesLimitSheafedSpaceCommRingCatWalkingCospanCospanFForgetToSheafedSpace
code: instance (i j k : D.J) : PreservesLimit (cospan (𝖣.f i j) (𝖣.f i k)) forgetToSheafedSpace 
goal: CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k))
  AlgebraicGeometry.LocallyRingedSpace.forgetToSheafedSpace

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.ι_jointly_surjective
code: theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : D.J) (y : D.U i), (𝖣.ι i).1.base y = x 
goal: ∃ i y, (D.ι i).val.base y = x

full_name: AlgebraicGeometry.LocallyRingedSpace.GlueData.vPullbackConeIsLimit
code: /-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) 
goal: CategoryTheory.Limits.IsLimit (D.vPullbackCone i j)