[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
⊢ ∀ (x : ↑(toTopCat X)),
    ∃ U R, Nonempty (restrict X (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅ Spec.toLocallyRingedSpace.obj (op R))
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
⊢ ∃ U R, Nonempty (restrict X (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅ Spec.toLocallyRingedSpace.obj (op R))
[PROOFSTEP]
obtain ⟨R, f, h₁, h₂⟩ := h x
[GOAL]
case intro.intro.intro
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ ∃ U R, Nonempty (restrict X (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅ Spec.toLocallyRingedSpace.obj (op R))
[PROOFSTEP]
refine' ⟨⟨⟨_, h₂.base_open.open_range⟩, h₁⟩, R, ⟨_⟩⟩
[GOAL]
case intro.intro.intro
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ restrict X
      (_ :
        OpenEmbedding
          ↑(Opens.inclusion
              { obj := { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) },
                  property := h₁ }.obj)) ≅
    Spec.toLocallyRingedSpace.obj (op R)
[PROOFSTEP]
apply LocallyRingedSpace.isoOfSheafedSpaceIso
[GOAL]
case intro.intro.intro.f
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ (restrict X
        (_ :
          OpenEmbedding
            ↑(Opens.inclusion
                { obj := { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) },
                    property := h₁ }.obj))).toSheafedSpace ≅
    (Spec.toLocallyRingedSpace.obj (op R)).toSheafedSpace
[PROOFSTEP]
refine' SheafedSpace.forgetToPresheafedSpace.preimageIso _
[GOAL]
case intro.intro.intro.f
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ SheafedSpace.forgetToPresheafedSpace.obj
      (restrict X
          (_ :
            OpenEmbedding
              ↑(Opens.inclusion
                  { obj := { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) },
                      property := h₁ }.obj))).toSheafedSpace ≅
    SheafedSpace.forgetToPresheafedSpace.obj (Spec.toLocallyRingedSpace.obj (op R)).toSheafedSpace
[PROOFSTEP]
skip
[GOAL]
case intro.intro.intro.f
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ SheafedSpace.forgetToPresheafedSpace.obj
      (restrict X
          (_ :
            OpenEmbedding
              ↑(Opens.inclusion
                  { obj := { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) },
                      property := h₁ }.obj))).toSheafedSpace ≅
    SheafedSpace.forgetToPresheafedSpace.obj (Spec.toLocallyRingedSpace.obj (op R)).toSheafedSpace
[PROOFSTEP]
apply PresheafedSpace.IsOpenImmersion.isoOfRangeEq (PresheafedSpace.ofRestrict _ _) f.1
[GOAL]
case intro.intro.intro.f
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ Set.range ↑(PresheafedSpace.ofRestrict X.toPresheafedSpace ?m.3415).base = Set.range ↑f.val.base
[PROOFSTEP]
exact Subtype.range_coe_subtype
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : LocallyRingedSpace
h : ∀ (x : ↑(toTopCat X)), ∃ R f, x ∈ Set.range ↑f.val.base ∧ IsOpenImmersion f
x : ↑(toTopCat X)
R : CommRingCat
f : Spec.toLocallyRingedSpace.obj (op R) ⟶ X
h₁ : x ∈ Set.range ↑f.val.base
h₂ : IsOpenImmersion f
⊢ OpenEmbedding
    ↑(Opens.inclusion
        { obj := { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) },
            property := h₁ }.obj)
[PROOFSTEP]
exact
  Opens.openEmbedding
    _
      -- Porting note : was `infer_instance`
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
⊢ ∀ (x : ↑↑X.toPresheafedSpace),
    x ∈
      Set.range
        ↑((fun x =>
                  (Nonempty.some
                        (_ :
                          Nonempty
                            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                (_ :
                                  OpenEmbedding
                                    ↑(Opens.inclusion
                                        (Exists.choose
                                            (_ :
                                              ∃ U R,
                                                Nonempty
                                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                    Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                              Spec.toLocallyRingedSpace.obj
                                (op
                                  (Exists.choose
                                    (_ :
                                      ∃ R,
                                        Nonempty
                                          (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      (Exists.choose
                                                          (_ :
                                                            ∃ U R,
                                                              Nonempty
                                                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                                    (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                                  Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                            Spec.toLocallyRingedSpace.obj (op R)))))))).inv ≫
                    LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Exists.choose
                                  (_ :
                                    ∃ U R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))).obj)))
                ((fun x => x) x)).val.base
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range
      ↑((fun x =>
                (Nonempty.some
                      (_ :
                        Nonempty
                          (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                              (_ :
                                OpenEmbedding
                                  ↑(Opens.inclusion
                                      (Exists.choose
                                          (_ :
                                            ∃ U R,
                                              Nonempty
                                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                    (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                  Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                            Spec.toLocallyRingedSpace.obj
                              (op
                                (Exists.choose
                                  (_ :
                                    ∃ R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ :
                                              OpenEmbedding
                                                ↑(Opens.inclusion
                                                    (Exists.choose
                                                        (_ :
                                                          ∃ U R,
                                                            Nonempty
                                                              (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                                  (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                                Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))))))).inv ≫
                  LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)))
              ((fun x => x) x)).val.base
[PROOFSTEP]
erw [coe_comp]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range
      (↑(LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Exists.choose
                            (_ :
                              ∃ U R,
                                Nonempty
                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                    Spec.toLocallyRingedSpace.obj (op R)))).obj))).val.base ∘
        ↑(Nonempty.some
                  (_ :
                    Nonempty
                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                          (_ :
                            OpenEmbedding
                              ↑(Opens.inclusion
                                  (Exists.choose
                                      (_ :
                                        ∃ U R,
                                          Nonempty
                                            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                              Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                        Spec.toLocallyRingedSpace.obj
                          (op
                            (Exists.choose
                              (_ :
                                ∃ R,
                                  Nonempty
                                    (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                        (_ :
                                          OpenEmbedding
                                            ↑(Opens.inclusion
                                                (Exists.choose
                                                    (_ :
                                                      ∃ U R,
                                                        Nonempty
                                                          (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                              (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                            Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                      Spec.toLocallyRingedSpace.obj (op R)))))))).inv.val.base)
[PROOFSTEP]
rw [Set.range_comp, Set.range_iff_surjective.mpr, Set.image_univ]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range
      ↑(LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Exists.choose
                          (_ :
                            ∃ U R,
                              Nonempty
                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                    (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                  Spec.toLocallyRingedSpace.obj (op R)))).obj))).val.base
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ Function.Surjective
    ↑(Nonempty.some
              (_ :
                Nonempty
                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Exists.choose
                                  (_ :
                                    ∃ U R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                    Spec.toLocallyRingedSpace.obj
                      (op
                        (Exists.choose
                          (_ :
                            ∃ R,
                              Nonempty
                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            (Exists.choose
                                                (_ :
                                                  ∃ U R,
                                                    Nonempty
                                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                  Spec.toLocallyRingedSpace.obj (op R)))))))).inv.val.base
[PROOFSTEP]
erw [Subtype.range_coe_subtype]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    {x_1 |
      x_1 ∈
        (Exists.choose
            (_ :
              ∃ U R,
                Nonempty
                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                    Spec.toLocallyRingedSpace.obj (op R)))).obj}
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ Function.Surjective
    ↑(Nonempty.some
              (_ :
                Nonempty
                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Exists.choose
                                  (_ :
                                    ∃ U R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                    Spec.toLocallyRingedSpace.obj
                      (op
                        (Exists.choose
                          (_ :
                            ∃ R,
                              Nonempty
                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            (Exists.choose
                                                (_ :
                                                  ∃ U R,
                                                    Nonempty
                                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                  Spec.toLocallyRingedSpace.obj (op R)))))))).inv.val.base
[PROOFSTEP]
exact (X.local_affine x).choose.2
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ Function.Surjective
    ↑(Nonempty.some
              (_ :
                Nonempty
                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Exists.choose
                                  (_ :
                                    ∃ U R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                    Spec.toLocallyRingedSpace.obj
                      (op
                        (Exists.choose
                          (_ :
                            ∃ R,
                              Nonempty
                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            (Exists.choose
                                                (_ :
                                                  ∃ U R,
                                                    Nonempty
                                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                  Spec.toLocallyRingedSpace.obj (op R)))))))).inv.val.base
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ Epi
    (Nonempty.some
            (_ :
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj
                    (op
                      (Exists.choose
                        (_ :
                          ∃ R,
                            Nonempty
                              (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          (Exists.choose
                                              (_ :
                                                ∃ U R,
                                                  Nonempty
                                                    (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                        (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                      Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                Spec.toLocallyRingedSpace.obj (op R)))))))).inv.val.base
[PROOFSTEP]
change Epi ((SheafedSpace.forget _).map (LocallyRingedSpace.forgetToSheafedSpace.map _))
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ Epi
    ((SheafedSpace.forget CommRingCat).map
      (LocallyRingedSpace.forgetToSheafedSpace.map
        (Nonempty.some
            (_ :
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj
                    (op
                      (Exists.choose
                        (_ :
                          ∃ R,
                            Nonempty
                              (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          (Exists.choose
                                              (_ :
                                                ∃ U R,
                                                  Nonempty
                                                    (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                        (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                      Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                Spec.toLocallyRingedSpace.obj (op R)))))))).inv))
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ IsOpenImmersion
    ((fun x =>
        (Nonempty.some
              (_ :
                Nonempty
                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Exists.choose
                                  (_ :
                                    ∃ U R,
                                      Nonempty
                                        (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                            (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                          Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                    Spec.toLocallyRingedSpace.obj
                      (op
                        (Exists.choose
                          (_ :
                            ∃ R,
                              Nonempty
                                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            (Exists.choose
                                                (_ :
                                                  ∃ U R,
                                                    Nonempty
                                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                  Spec.toLocallyRingedSpace.obj (op R)))))))).inv ≫
          LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    (Exists.choose
                        (_ :
                          ∃ U R,
                            Nonempty
                              (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                  (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                Spec.toLocallyRingedSpace.obj (op R)))).obj)))
      x)
[PROOFSTEP]
apply (config := { allowSynthFailures := true }) PresheafedSpace.IsOpenImmersion.comp
[GOAL]
case hg
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
⊢ PresheafedSpace.IsOpenImmersion
    (LocallyRingedSpace.ofRestrict X.toLocallyRingedSpace
        (_ :
          OpenEmbedding
            ↑(Opens.inclusion
                (Exists.choose
                    (_ :
                      ∃ U R,
                        Nonempty
                          (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                              (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                            Spec.toLocallyRingedSpace.obj (op R)))).obj))).val
[PROOFSTEP]
apply PresheafedSpace.IsOpenImmersion.ofRestrict
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range
      ↑((fun x => map (f x.fst) x.snd ≫ map 𝒰 x.fst)
              ((fun x =>
                  { fst := AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x,
                    snd :=
                      AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                        (Exists.choose
                          (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)) })
                x)).val.base
[PROOFSTEP]
let y := (𝒰.Covers x).choose
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
⊢ x ∈
    Set.range
      ↑((fun x => map (f x.fst) x.snd ≫ map 𝒰 x.fst)
              ((fun x =>
                  { fst := AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x,
                    snd :=
                      AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                        (Exists.choose
                          (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)) })
                x)).val.base
[PROOFSTEP]
have hy : (𝒰.map (𝒰.f x)).val.base y = x := (𝒰.Covers x).choose_spec
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
hy : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base y = x
⊢ x ∈
    Set.range
      ↑((fun x => map (f x.fst) x.snd ≫ map 𝒰 x.fst)
              ((fun x =>
                  { fst := AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x,
                    snd :=
                      AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                        (Exists.choose
                          (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)) })
                x)).val.base
[PROOFSTEP]
rcases(f (𝒰.f x)).Covers y with ⟨z, hz⟩
[GOAL]
case intro
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
hy : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base y = x
z :
  (forget TopCat).obj
    ↑(obj (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
          (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).toPresheafedSpace
hz :
  ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
              (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).val.base
      z =
    y
⊢ x ∈
    Set.range
      ↑((fun x => map (f x.fst) x.snd ≫ map 𝒰 x.fst)
              ((fun x =>
                  { fst := AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x,
                    snd :=
                      AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                        (Exists.choose
                          (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)) })
                x)).val.base
[PROOFSTEP]
change x ∈ Set.range ((f (𝒰.f x)).map ((f (𝒰.f x)).f y) ≫ 𝒰.map (𝒰.f x)).1.base
[GOAL]
case intro
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
hy : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base y = x
z :
  (forget TopCat).obj
    ↑(obj (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
          (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).toPresheafedSpace
hz :
  ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
              (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).val.base
      z =
    y
⊢ x ∈
    Set.range
      ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y) ≫
              map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base
[PROOFSTEP]
use z
[GOAL]
case h
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
hy : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base y = x
z :
  (forget TopCat).obj
    ↑(obj (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
          (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).toPresheafedSpace
hz :
  ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
              (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).val.base
      z =
    y
⊢ ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y) ≫
              map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base
      z =
    x
[PROOFSTEP]
erw [comp_apply]
[GOAL]
case h
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (map 𝒰 x ≫ f✝) g
f : (x : 𝒰.J) → OpenCover (obj 𝒰 x)
x : ↑↑X.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).toPresheafedSpace :=
  Exists.choose (_ : x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base)
hy : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base y = x
z :
  (forget TopCat).obj
    ↑(obj (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
          (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).toPresheafedSpace
hz :
  ↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
              (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).val.base
      z =
    y
⊢ ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base
      (↑(map (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x))
                (AlgebraicGeometry.Scheme.OpenCover.f (f (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) y)).val.base
        z) =
    x
[PROOFSTEP]
rw [hz, hy]
  -- Porting note : weirdly, even though no input is needed, `inferInstance` does not work
    -- `PresheafedSpace.IsOpenImmersion.comp` is marked as `instance`
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ x ∈ Set.range ↑((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
rw [Set.range_iff_surjective.mpr]
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ x ∈ Set.univ
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ Function.Surjective ↑((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
all_goals try trivial
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ x ∈ Set.univ
[PROOFSTEP]
try trivial
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ x ∈ Set.univ
[PROOFSTEP]
trivial
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ Function.Surjective ↑((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
try trivial
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ Function.Surjective ↑((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
trivial
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ Function.Surjective ↑((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰 : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
x : ↑↑Y.toPresheafedSpace
⊢ Epi ((fun x => f) ((fun x => PUnit.unit) x)).val.base
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ Set.range ↑(map ((fun x => ↑e₁.symm (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) x)).val.base
[PROOFSTEP]
rw [e₂, Scheme.comp_val_base, coe_comp, Set.range_comp, Set.range_iff_surjective.mpr, Set.image_univ,
  e₁.rightInverse_symm]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ Set.range ↑(AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base
[PROOFSTEP]
exact 𝒰.Covers x
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
x : ↑↑X.toPresheafedSpace
⊢ Function.Surjective ↑(e₂✝ ((fun x => ↑e₁.symm (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) x)).hom.val.base
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
x : ↑↑X.toPresheafedSpace
⊢ Epi (e₂✝ ((fun x => ↑e₁.symm (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)) x)).hom.val.base
[PROOFSTEP]
infer_instance
  -- Porting note : weirdly, even though no input is needed, `inferInstance` does not work
      -- `PresheafedSpace.IsOpenImmersion.comp` is marked as `instance`
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
i : J
⊢ IsOpenImmersion (map i)
[PROOFSTEP]
rw [e₂]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (AlgebraicGeometry.Scheme.OpenCover.map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
J : Type u_1
obj : J → Scheme
map : (i : J) → obj i ⟶ X
e₁ : J ≃ 𝒰.J
e₂✝ : (i : J) → obj i ≅ AlgebraicGeometry.Scheme.OpenCover.obj 𝒰 (↑e₁ i)
e₂ : ∀ (i : J), map i = (e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i)
i : J
⊢ IsOpenImmersion ((e₂✝ i).hom ≫ AlgebraicGeometry.Scheme.OpenCover.map 𝒰 (↑e₁ i))
[PROOFSTEP]
exact PresheafedSpace.IsOpenImmersion.comp _ _
[GOAL]
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰✝ : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f✝) g
X : Scheme
𝒰 : OpenCover X
Y : Scheme
f : Y ⟶ X
inst✝ : IsOpenImmersion f
⊢ ∀ (x : Option 𝒰.J), IsOpenImmersion ((fun i => Option.rec f 𝒰.map i) x)
[PROOFSTEP]
rintro (_ | _)
[GOAL]
case none
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰✝ : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f✝) g
X : Scheme
𝒰 : OpenCover X
Y : Scheme
f : Y ⟶ X
inst✝ : IsOpenImmersion f
⊢ IsOpenImmersion ((fun i => Option.rec f 𝒰.map i) none)
[PROOFSTEP]
dsimp
[GOAL]
case some
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰✝ : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f✝) g
X : Scheme
𝒰 : OpenCover X
Y : Scheme
f : Y ⟶ X
inst✝ : IsOpenImmersion f
val✝ : 𝒰.J
⊢ IsOpenImmersion ((fun i => Option.rec f 𝒰.map i) (some val✝))
[PROOFSTEP]
dsimp
[GOAL]
case none
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰✝ : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f✝) g
X : Scheme
𝒰 : OpenCover X
Y : Scheme
f : Y ⟶ X
inst✝ : IsOpenImmersion f
⊢ IsOpenImmersion f
[PROOFSTEP]
infer_instance
[GOAL]
case some
C : Type u
inst✝² : Category.{v, u} C
X✝ Y✝ Z : Scheme
𝒰✝ : OpenCover X✝
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
inst✝¹ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f✝) g
X : Scheme
𝒰 : OpenCover X
Y : Scheme
f : Y ⟶ X
inst✝ : IsOpenImmersion f
val✝ : 𝒰.J
⊢ IsOpenImmersion (map 𝒰 val✝)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
R : CommRingCat
f : ↑R
⊢ IsOpenImmersion (Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op)
[PROOFSTEP]
apply SheafedSpace.IsOpenImmersion.of_stalk_iso (H := ?_)
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
R : CommRingCat
f : ↑R
⊢ OpenEmbedding ↑(Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op).val.base
[PROOFSTEP]
exact (PrimeSpectrum.localization_away_openEmbedding (Localization.Away f) f : _)
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
R : CommRingCat
f : ↑R
hf : OpenEmbedding ↑(Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op).val.base
⊢ ∀ (x : ↑↑(Spec.obj (op (CommRingCat.of (Localization.Away f)))).toPresheafedSpace),
    IsIso (PresheafedSpace.stalkMap (Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op).val x)
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f✝ : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f✝) g
R : CommRingCat
f : ↑R
hf : OpenEmbedding ↑(Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op).val.base
x : ↑↑(Spec.obj (op (CommRingCat.of (Localization.Away f)))).toPresheafedSpace
⊢ IsIso (PresheafedSpace.stalkMap (Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away f))).op).val x)
[PROOFSTEP]
exact Spec_map_localization_isIso R (Submonoid.powers f) x
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
R : CommRingCat
r : ↑↑(Spec.obj (op R)).toPresheafedSpace
⊢ r ∈ Set.range ↑((fun r => Spec.map (algebraMap (↑R) (Localization.Away r)).op) ((fun x => 1) r)).val.base
[PROOFSTEP]
rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp _)]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
R : CommRingCat
r : ↑↑(Spec.obj (op R)).toPresheafedSpace
⊢ r ∈ Set.univ
[PROOFSTEP]
exact trivial
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
R : CommRingCat
r : ↑↑(Spec.obj (op R)).toPresheafedSpace
⊢ Epi ((fun r => Spec.map (algebraMap (↑R) (Localization.Away r)).op) ((fun x => 1) r)).val.base
[PROOFSTEP]
change Epi (Spec.map (CommRingCat.ofHom (algebraMap _ _)).op).1.base
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
R : CommRingCat
r : ↑↑(Spec.obj (op R)).toPresheafedSpace
⊢ Epi (Spec.map (CommRingCat.ofHom (algebraMap (↑R) (Localization.Away ((fun x => 1) r)))).op).val.base
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
r :
  ↑(Exists.choose
      (_ :
        ∃ R,
          Nonempty
            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Exists.choose
                            (_ :
                              ∃ U R,
                                Nonempty
                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                    Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
              Spec.toLocallyRingedSpace.obj (op R))))
⊢ Set.range ↑(OpenCover.map (affineBasisCover X) { fst := x, snd := r }).val.base =
    ↑(OpenCover.map (affineCover X) x).val.base '' (PrimeSpectrum.basicOpen r).carrier
[PROOFSTEP]
erw [coe_comp, Set.range_comp]
  -- Porting note : `congr` fails to see the goal is comparing image of the same function
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
r :
  ↑(Exists.choose
      (_ :
        ∃ R,
          Nonempty
            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Exists.choose
                            (_ :
                              ∃ U R,
                                Nonempty
                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                    Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
              Spec.toLocallyRingedSpace.obj (op R))))
⊢ ↑(OpenCover.map (affineCover X) { fst := x, snd := r }.fst).val.base ''
      Set.range
        ↑(OpenCover.map
                ((fun x =>
                    affineBasisCoverOfAffine
                      (Exists.choose
                        (_ :
                          ∃ R,
                            Nonempty
                              (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          (Exists.choose
                                              (_ :
                                                ∃ U R,
                                                  Nonempty
                                                    (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                        (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                      Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                                Spec.toLocallyRingedSpace.obj (op R)))))
                  { fst := x, snd := r }.fst)
                { fst := x, snd := r }.snd).val.base =
    ↑(OpenCover.map (affineCover X) x).val.base '' (PrimeSpectrum.basicOpen r).carrier
[PROOFSTEP]
refine congr_arg (_ '' ·) ?_
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
x : ↑↑X.toPresheafedSpace
r :
  ↑(Exists.choose
      (_ :
        ∃ R,
          Nonempty
            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Exists.choose
                            (_ :
                              ∃ U R,
                                Nonempty
                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                    Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
              Spec.toLocallyRingedSpace.obj (op R))))
⊢ Set.range
      ↑(OpenCover.map
              ((fun x =>
                  affineBasisCoverOfAffine
                    (Exists.choose
                      (_ :
                        ∃ R,
                          Nonempty
                            (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                (_ :
                                  OpenEmbedding
                                    ↑(Opens.inclusion
                                        (Exists.choose
                                            (_ :
                                              ∃ U R,
                                                Nonempty
                                                  (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                                      (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                                    Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                              Spec.toLocallyRingedSpace.obj (op R)))))
                { fst := x, snd := r }.fst)
              { fst := x, snd := r }.snd).val.base =
    (PrimeSpectrum.basicOpen r).carrier
[PROOFSTEP]
exact (PrimeSpectrum.localization_away_comap_range (Localization.Away r) r : _)
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
⊢ IsTopologicalBasis {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base}
[PROOFSTEP]
apply TopologicalSpace.isTopologicalBasis_of_open_of_nhds
[GOAL]
case h_open
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
⊢ ∀ (u : Set ↑↑X.toPresheafedSpace),
    u ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} → IsOpen u
[PROOFSTEP]
rintro _ ⟨a, rfl⟩
[GOAL]
case h_open.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : (affineBasisCover X).J
⊢ IsOpen (Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base)
[PROOFSTEP]
exact IsOpenImmersion.open_range (X.affineBasisCover.map a)
[GOAL]
case h_nhds
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
⊢ ∀ (a : ↑↑X.toPresheafedSpace) (u : Set ↑↑X.toPresheafedSpace),
    a ∈ u →
      IsOpen u → ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ u
[PROOFSTEP]
rintro a U haU hU
[GOAL]
case h_nhds
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
⊢ ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ U
[PROOFSTEP]
rcases X.affineCover.Covers a with ⟨x, e⟩
[GOAL]
case h_nhds.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
⊢ ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ U
[PROOFSTEP]
let U' := (X.affineCover.map (X.affineCover.f a)).1.base ⁻¹' U
[GOAL]
case h_nhds.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
⊢ ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ U
[PROOFSTEP]
have hxU' : x ∈ U' := by rw [← e] at haU ; exact haU
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
⊢ x ∈ U'
[PROOFSTEP]
rw [← e] at haU
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
haU : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x ∈ U
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
⊢ x ∈ U'
[PROOFSTEP]
exact haU
[GOAL]
case h_nhds.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
⊢ ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ U
[PROOFSTEP]
rcases PrimeSpectrum.isBasis_basic_opens.exists_subset_of_mem_open hxU'
    ((X.affineCover.map (X.affineCover.f a)).1.base.continuous_toFun.isOpen_preimage _ hU) with
  ⟨_, ⟨_, ⟨s, rfl⟩, rfl⟩, hxV, hVU⟩
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ ∃ v, v ∈ {x | ∃ a, x = Set.range ↑(OpenCover.map (affineBasisCover X) a).val.base} ∧ a ∈ v ∧ v ⊆ U
[PROOFSTEP]
refine' ⟨_, ⟨⟨_, s⟩, rfl⟩, _, _⟩
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro.refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ a ∈ Set.range ↑(OpenCover.map (affineBasisCover X) { fst := OpenCover.f (affineCover X) a, snd := s }).val.base
[PROOFSTEP]
erw [affineBasisCover_map_range]
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro.refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ Set.range ↑(OpenCover.map (affineBasisCover X) { fst := OpenCover.f (affineCover X) a, snd := s }).val.base ⊆ U
[PROOFSTEP]
erw [affineBasisCover_map_range]
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro.refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ a ∈ ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base '' (PrimeSpectrum.basicOpen s).carrier
[PROOFSTEP]
exact ⟨x, hxV, e⟩
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro.refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base '' (PrimeSpectrum.basicOpen s).carrier ⊆ U
[PROOFSTEP]
rw [Set.image_subset_iff]
[GOAL]
case h_nhds.intro.intro.intro.intro.intro.intro.intro.refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰 : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
X : Scheme
a : ↑↑X.toPresheafedSpace
U : Set ↑↑X.toPresheafedSpace
haU : a ∈ U
hU : IsOpen U
x : (forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace
e : ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base x = a
U' : Set ((forget TopCat).obj ↑(OpenCover.obj (affineCover X) (OpenCover.f (affineCover X) a)).toPresheafedSpace) :=
  ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
hxU' : x ∈ U'
s :
  ↑(op
        (Exists.choose
          (_ :
            ∃ R,
              Nonempty
                (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            (Exists.choose
                                (_ :
                                  ∃ U R,
                                    Nonempty
                                      (LocallyRingedSpace.restrict X.toLocallyRingedSpace
                                          (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
                                        Spec.toLocallyRingedSpace.obj (op R)))).obj)) ≅
                  Spec.toLocallyRingedSpace.obj (op R))))).unop
hxV : x ∈ ↑(PrimeSpectrum.basicOpen s)
hVU : ↑(PrimeSpectrum.basicOpen s) ⊆ U'
⊢ (PrimeSpectrum.basicOpen s).carrier ⊆ ↑(OpenCover.map (affineCover X) (OpenCover.f (affineCover X) a)).val.base ⁻¹' U
[PROOFSTEP]
exact hVU
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
⊢ OpenCover X
[PROOFSTEP]
have :=
  @CompactSpace.elim_nhds_subcover _ _ H (fun x : X => Set.range (𝒰.map (𝒰.f x)).1.base) fun x =>
    (IsOpenImmersion.open_range (𝒰.map (𝒰.f x))).mem_nhds (𝒰.Covers x)
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
⊢ OpenCover X
[PROOFSTEP]
let t := this.choose
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
⊢ OpenCover X
[PROOFSTEP]
have h : ∀ x : X, ∃ y : t, x ∈ Set.range (𝒰.map (𝒰.f y)).1.base :=
  by
  intro x
  have h' : x ∈ (⊤ : Set X) := trivial
  rw [← Classical.choose_spec this, Set.mem_iUnion] at h'
  rcases h' with ⟨y, _, ⟨hy, rfl⟩, hy'⟩
  exact ⟨⟨y, hy⟩, hy'⟩
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
⊢ ∀ (x : ↑↑X.toPresheafedSpace), ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
x : ↑↑X.toPresheafedSpace
⊢ ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
[PROOFSTEP]
have h' : x ∈ (⊤ : Set X) := trivial
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
x : ↑↑X.toPresheafedSpace
h' : x ∈ ⊤
⊢ ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
[PROOFSTEP]
rw [← Classical.choose_spec this, Set.mem_iUnion] at h'
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
x : ↑↑X.toPresheafedSpace
h' :
  ∃ i,
    x ∈
      ⋃ (_ : i ∈ Classical.choose this),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) i
⊢ ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
[PROOFSTEP]
rcases h' with ⟨y, _, ⟨hy, rfl⟩, hy'⟩
[GOAL]
case intro.intro.intro.intro
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
x y : ↑↑X.toPresheafedSpace
hy : y ∈ Classical.choose this
hy' : x ∈ (fun h => (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) y) hy
⊢ ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
[PROOFSTEP]
exact ⟨⟨y, hy⟩, hy'⟩
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ Y Z : Scheme
𝒰✝ : OpenCover X✝
f : X✝ ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰✝.J), HasPullback (map 𝒰✝ x ≫ f) g
X : Scheme
𝒰 : OpenCover X
H : CompactSpace ↑↑X.toPresheafedSpace
this :
  ∃ t,
    ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t),
        (fun x => Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 x)).val.base) x =
      ⊤
t : Finset ↑↑X.toPresheafedSpace := Exists.choose this
h : ∀ (x : ↑↑X.toPresheafedSpace), ∃ y, x ∈ Set.range ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 ↑y)).val.base
⊢ OpenCover X
[PROOFSTEP]
exact
  { J := t
    obj := fun x => 𝒰.obj (𝒰.f x.1)
    map := fun x => 𝒰.map (𝒰.f x.1)
    f := fun x => (h x).choose
    Covers := fun x => (h x).choose_spec }
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
H : CompactSpace ↑↑X.toPresheafedSpace
⊢ Fintype (OpenCover.finiteSubcover 𝒰).J
[PROOFSTEP]
delta OpenCover.finiteSubcover
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
𝒰 : OpenCover X
f : X ⟶ Z
g : Y ⟶ Z
inst✝ : ∀ (x : 𝒰.J), HasPullback (OpenCover.map 𝒰 x ≫ f) g
H : CompactSpace ↑↑X.toPresheafedSpace
⊢ Fintype
    (let_fun this :=
        (_ :
          ∃ t, ⋃ (x : ↑↑X.toPresheafedSpace) (_ : x ∈ t), Set.range ↑(OpenCover.map 𝒰 (OpenCover.f 𝒰 x)).val.base = ⊤);
      let t := Exists.choose this;
      let_fun h :=
        (_ : ∀ (x : ↑↑X.toPresheafedSpace), ∃ y, x ∈ Set.range ↑(OpenCover.map 𝒰 (OpenCover.f 𝒰 ↑y)).val.base);
      OpenCover.mk { x // x ∈ t } (fun x => OpenCover.obj 𝒰 (OpenCover.f 𝒰 ↑x))
        (fun x => OpenCover.map 𝒰 (OpenCover.f 𝒰 ↑x))
        (fun x => Exists.choose (_ : ∃ y, x ∈ Set.range ↑(OpenCover.map 𝒰 (OpenCover.f 𝒰 ↑y)).val.base))
        (_ :
          ∀ (x : ↑↑X.toPresheafedSpace),
            x ∈
              Set.range
                ↑(OpenCover.map 𝒰
                        (OpenCover.f 𝒰
                          ↑(Exists.choose
                              (_ : ∃ y, x ∈ Set.range ↑(OpenCover.map 𝒰 (OpenCover.f 𝒰 ↑y)).val.base)))).val.base)).J
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
⊢ Scheme
[PROOFSTEP]
apply LocallyRingedSpace.IsOpenImmersion.scheme (toLocallyRingedSpace _ f)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
⊢ ∀ (x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))),
    ∃ R f_1, x ∈ Set.range ↑f_1.val.base ∧ LocallyRingedSpace.IsOpenImmersion f_1
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
⊢ ∃ R f_1, x ∈ Set.range ↑f_1.val.base ∧ LocallyRingedSpace.IsOpenImmersion f_1
[PROOFSTEP]
obtain ⟨_, ⟨i, rfl⟩, hx, hi⟩ :=
  Y.affineBasisCover_is_basis.exists_subset_of_mem_open (Set.mem_range_self x) H.base_open.open_range
[GOAL]
case intro.intro.intro.intro
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ ∃ R f_1, x ∈ Set.range ↑f_1.val.base ∧ LocallyRingedSpace.IsOpenImmersion f_1
[PROOFSTEP]
use Y.affineBasisCoverRing i
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ ∃ f_1, x ∈ Set.range ↑f_1.val.base ∧ LocallyRingedSpace.IsOpenImmersion f_1
[PROOFSTEP]
use LocallyRingedSpace.IsOpenImmersion.lift (toLocallyRingedSpaceHom _ f) _ hi
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ x ∈
      Set.range
        ↑(LocallyRingedSpace.IsOpenImmersion.lift (toLocallyRingedSpaceHom Y.toLocallyRingedSpace f)
                (Scheme.OpenCover.map (Scheme.affineBasisCover Y) i) hi).val.base ∧
    LocallyRingedSpace.IsOpenImmersion
      (LocallyRingedSpace.IsOpenImmersion.lift (toLocallyRingedSpaceHom Y.toLocallyRingedSpace f)
        (Scheme.OpenCover.map (Scheme.affineBasisCover Y) i) hi)
[PROOFSTEP]
constructor
[GOAL]
case h.left
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ x ∈
    Set.range
      ↑(LocallyRingedSpace.IsOpenImmersion.lift (toLocallyRingedSpaceHom Y.toLocallyRingedSpace f)
              (Scheme.OpenCover.map (Scheme.affineBasisCover Y) i) hi).val.base
[PROOFSTEP]
rw [LocallyRingedSpace.IsOpenImmersion.lift_range]
[GOAL]
case h.left
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ x ∈
    ↑(toLocallyRingedSpaceHom Y.toLocallyRingedSpace f).val.base ⁻¹'
      Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
[PROOFSTEP]
exact hx
[GOAL]
case h.right
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ LocallyRingedSpace.IsOpenImmersion
    (LocallyRingedSpace.IsOpenImmersion.lift (toLocallyRingedSpaceHom Y.toLocallyRingedSpace f)
      (Scheme.OpenCover.map (Scheme.affineBasisCover Y) i) hi)
[PROOFSTEP]
delta LocallyRingedSpace.IsOpenImmersion.lift
[GOAL]
case h.right
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H : IsOpenImmersion f
x : ↑(LocallyRingedSpace.toTopCat (toLocallyRingedSpace Y.toLocallyRingedSpace f))
i : (Scheme.affineBasisCover Y).J
hx : ↑f.base x ∈ Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base
hi : Set.range ↑(Scheme.OpenCover.map (Scheme.affineBasisCover Y) i).val.base ⊆ Set.range ↑f.base
⊢ LocallyRingedSpace.IsOpenImmersion
    (let_fun this := (_ : IsIso pullback.snd);
    inv pullback.snd ≫ pullback.fst)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ : PresheafedSpace CommRingCat
Y✝ : Scheme
f : X✝ ⟶ Y✝.toPresheafedSpace
H✝ : IsOpenImmersion f
X Y : Scheme
H : X.toLocallyRingedSpace = Y.toLocallyRingedSpace
⊢ X = Y
[PROOFSTEP]
cases X
[GOAL]
case mk
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y✝ : Scheme
f : X ⟶ Y✝.toPresheafedSpace
H✝ : IsOpenImmersion f
Y : Scheme
toLocallyRingedSpace✝ : LocallyRingedSpace
local_affine✝ :
  ∀ (x : ↑(LocallyRingedSpace.toTopCat toLocallyRingedSpace✝)),
    ∃ U R,
      Nonempty
        (LocallyRingedSpace.restrict toLocallyRingedSpace✝ (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
          Spec.toLocallyRingedSpace.obj (op R))
H :
  { toLocallyRingedSpace := toLocallyRingedSpace✝, local_affine := local_affine✝ }.toLocallyRingedSpace =
    Y.toLocallyRingedSpace
⊢ { toLocallyRingedSpace := toLocallyRingedSpace✝, local_affine := local_affine✝ } = Y
[PROOFSTEP]
cases Y
[GOAL]
case mk.mk
C : Type u
inst✝ : Category.{v, u} C
X : PresheafedSpace CommRingCat
Y : Scheme
f : X ⟶ Y.toPresheafedSpace
H✝ : IsOpenImmersion f
toLocallyRingedSpace✝¹ : LocallyRingedSpace
local_affine✝¹ :
  ∀ (x : ↑(LocallyRingedSpace.toTopCat toLocallyRingedSpace✝¹)),
    ∃ U R,
      Nonempty
        (LocallyRingedSpace.restrict toLocallyRingedSpace✝¹ (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
          Spec.toLocallyRingedSpace.obj (op R))
toLocallyRingedSpace✝ : LocallyRingedSpace
local_affine✝ :
  ∀ (x : ↑(LocallyRingedSpace.toTopCat toLocallyRingedSpace✝)),
    ∃ U R,
      Nonempty
        (LocallyRingedSpace.restrict toLocallyRingedSpace✝ (_ : OpenEmbedding ↑(Opens.inclusion U.obj)) ≅
          Spec.toLocallyRingedSpace.obj (op R))
H :
  { toLocallyRingedSpace := toLocallyRingedSpace✝¹, local_affine := local_affine✝¹ }.toLocallyRingedSpace =
    { toLocallyRingedSpace := toLocallyRingedSpace✝, local_affine := local_affine✝ }.toLocallyRingedSpace
⊢ { toLocallyRingedSpace := toLocallyRingedSpace✝¹, local_affine := local_affine✝¹ } =
    { toLocallyRingedSpace := toLocallyRingedSpace✝, local_affine := local_affine✝ }
[PROOFSTEP]
congr
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X✝ : PresheafedSpace CommRingCat
Y✝ : Scheme
f✝ : X✝ ⟶ Y✝.toPresheafedSpace
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
inst✝ : AlgebraicGeometry.IsOpenImmersion f
⊢ toScheme Y f.val = X
[PROOFSTEP]
apply scheme_eq_of_locallyRingedSpace_eq
[GOAL]
case H
C : Type u
inst✝¹ : Category.{v, u} C
X✝ : PresheafedSpace CommRingCat
Y✝ : Scheme
f✝ : X✝ ⟶ Y✝.toPresheafedSpace
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
inst✝ : AlgebraicGeometry.IsOpenImmersion f
⊢ (toScheme Y f.val).toLocallyRingedSpace = X.toLocallyRingedSpace
[PROOFSTEP]
exact locallyRingedSpace_toLocallyRingedSpace f
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
U : TopCat
X : Scheme
f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace
h : OpenEmbedding ↑f
⊢ PresheafedSpace.IsOpenImmersion (PresheafedSpace.ofRestrict X.toPresheafedSpace h)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ IsIso ((inducedFunctor Scheme.toLocallyRingedSpace).map g)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
⊢ IsIso f ↔ IsIso f.val.base ∧ ∀ (x : ↑↑X.toPresheafedSpace), IsIso (PresheafedSpace.stalkMap f.val x)
[PROOFSTEP]
rw [isIso_iff_isOpenImmersion, IsOpenImmersion.iff_stalk_iso, and_comm, ← and_assoc]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
⊢ ((Epi f.val.base ∧ OpenEmbedding ↑f.val.base) ∧
      ∀ (x : ↑↑X.toPresheafedSpace), IsIso (PresheafedSpace.stalkMap f.val x)) ↔
    IsIso f.val.base ∧ ∀ (x : ↑↑X.toPresheafedSpace), IsIso (PresheafedSpace.stalkMap f.val x)
[PROOFSTEP]
refine' and_congr ⟨_, _⟩ Iff.rfl
[GOAL]
case refine'_1
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
⊢ Epi f.val.base ∧ OpenEmbedding ↑f.val.base → IsIso f.val.base
[PROOFSTEP]
rintro ⟨h₁, h₂⟩
[GOAL]
case refine'_1.intro
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
h₁ : Epi f.val.base
h₂ : OpenEmbedding ↑f.val.base
⊢ IsIso f.val.base
[PROOFSTEP]
convert_to
  IsIso
    (TopCat.isoOfHomeo
        (Homeomorph.homeomorphOfContinuousOpen (Equiv.ofBijective _ ⟨h₂.inj, (TopCat.epi_iff_surjective _).mp h₁⟩)
          h₂.continuous h₂.isOpenMap)).hom
[GOAL]
case refine'_1.intro
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
h₁ : Epi f.val.base
h₂ : OpenEmbedding ↑f.val.base
⊢ IsIso
    (TopCat.isoOfHomeo
        (Homeomorph.homeomorphOfContinuousOpen
          (Equiv.ofBijective ↑f.val.base (_ : Function.Injective ↑f.val.base ∧ Function.Surjective ↑f.val.base))
          (_ : Continuous ↑f.val.base) (_ : IsOpenMap ↑f.val.base))).hom
[PROOFSTEP]
infer_instance
[GOAL]
case refine'_2
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
⊢ IsIso f.val.base → Epi f.val.base ∧ OpenEmbedding ↑f.val.base
[PROOFSTEP]
intro H
[GOAL]
case refine'_2
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g : Y✝ ⟶ Z
H✝ : IsOpenImmersion f✝
X Y : Scheme
f : X ⟶ Y
H : IsIso f.val.base
⊢ Epi f.val.base ∧ OpenEmbedding ↑f.val.base
[PROOFSTEP]
exact ⟨inferInstance, (TopCat.homeoOfIso (asIso f.1.base)).openEmbedding⟩
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Mono f
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan f g ⋙ forget)
[PROOFSTEP]
apply @hasLimitOfIso _ _ _ _ _ _ ?_ (diagramIsoCospan.{u} _).symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan ((cospan f g ⋙ forget).map WalkingCospan.Hom.inl) ((cospan f g ⋙ forget).map WalkingCospan.Hom.inr))
[PROOFSTEP]
change HasLimit (cospan ((forget).map f) ((forget).map g))
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan (forget.map f) (forget.map g))
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan g f ⋙ forget)
[PROOFSTEP]
apply @hasLimitOfIso _ _ _ _ _ _ ?_ (diagramIsoCospan.{u} _).symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan ((cospan g f ⋙ forget).map Hom.inl) ((cospan g f ⋙ forget).map Hom.inr))
[PROOFSTEP]
change HasLimit (cospan ((forget).map g) ((forget).map f))
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ HasLimit (cospan (forget.map g) (forget.map f))
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ forget.obj (PresheafedSpace.IsOpenImmersion.toScheme Y pullback.snd.val) =
    limit (cospan ((cospan f g ⋙ forget).map Hom.inl) ((cospan f g ⋙ forget).map Hom.inr))
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ forget.obj (PresheafedSpace.IsOpenImmersion.toScheme Y pullback.fst.val) =
    limit (cospan ((cospan g f ⋙ forget).map Hom.inl) ((cospan g f ⋙ forget).map Hom.inr))
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion pullback.snd
[PROOFSTEP]
have := PreservesPullback.iso_hom_snd forget f g
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this : (PreservesPullback.iso forget f g).hom ≫ pullback.snd = forget.map pullback.snd
⊢ IsOpenImmersion pullback.snd
[PROOFSTEP]
dsimp only [Scheme.forgetToLocallyRingedSpace, inducedFunctor_map] at this
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this : (PreservesPullback.iso (inducedFunctor Scheme.toLocallyRingedSpace) f g).hom ≫ pullback.snd = pullback.snd
⊢ IsOpenImmersion pullback.snd
[PROOFSTEP]
rw [← this]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this : (PreservesPullback.iso (inducedFunctor Scheme.toLocallyRingedSpace) f g).hom ≫ pullback.snd = pullback.snd
⊢ IsOpenImmersion ((PreservesPullback.iso (inducedFunctor Scheme.toLocallyRingedSpace) f g).hom ≫ pullback.snd)
[PROOFSTEP]
change LocallyRingedSpace.IsOpenImmersion _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this : (PreservesPullback.iso (inducedFunctor Scheme.toLocallyRingedSpace) f g).hom ≫ pullback.snd = pullback.snd
⊢ LocallyRingedSpace.IsOpenImmersion
    ((PreservesPullback.iso (inducedFunctor Scheme.toLocallyRingedSpace) f g).hom ≫ pullback.snd)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion pullback.fst
[PROOFSTEP]
rw [← pullbackSymmetry_hom_comp_snd]
  -- Porting note : was just `infer_instance`, it is a bit weird that no explicit class instance is
    -- provided but still class inference fail to find this
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion ((pullbackSymmetry g f).hom ≫ pullback.snd)
[PROOFSTEP]
exact LocallyRingedSpace.IsOpenImmersion.comp (H := inferInstance) _
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
⊢ IsOpenImmersion (limit.π (cospan f g) one)
[PROOFSTEP]
rw [← limit.w (cospan f g) WalkingCospan.Hom.inl]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
⊢ IsOpenImmersion (limit.π (cospan f g) left ≫ (cospan f g).map Hom.inl)
[PROOFSTEP]
change
  IsOpenImmersion
    (_ ≫ f)
      -- Porting note : was just `infer_instance`, it is a bit weird that no explicit class instance is
        -- provided but still class inference fail to find this
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
⊢ IsOpenImmersion (limit.π (cospan f g) left ≫ f)
[PROOFSTEP]
exact LocallyRingedSpace.IsOpenImmersion.comp (H := inferInstance) _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g) Scheme.forgetToTop
[PROOFSTEP]
delta Scheme.forgetToTop
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g) (forget ⋙ LocallyRingedSpace.forgetToTop)
[PROOFSTEP]
apply @Limits.compPreservesLimit (K := cospan f g) (F := forget) (G := LocallyRingedSpace.forgetToTop) ?_ ?_
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g) forget
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g ⋙ forget) LocallyRingedSpace.forgetToTop
[PROOFSTEP]
apply @preservesLimitOfIsoDiagram (F := _) _ _ _ _ _ _ (diagramIsoCospan.{u} _).symm ?_
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan ((cospan f g ⋙ forget).map Hom.inl) ((cospan f g ⋙ forget).map Hom.inr))
    LocallyRingedSpace.forgetToTop
[PROOFSTEP]
dsimp [LocallyRingedSpace.forgetToTop]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g) (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget CommRingCat)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑pullback.snd.val.base =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
rw [← show _ = (pullback.snd : pullback f g ⟶ _).1.base from PreservesPullback.iso_hom_snd Scheme.forgetToTop f g]
  -- Porting note : was `rw`
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑((PreservesPullback.iso Scheme.forgetToTop f g).hom ≫ pullback.snd) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
erw [coe_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range (↑pullback.snd ∘ ↑(PreservesPullback.iso Scheme.forgetToTop f g).hom) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
rw [Set.range_comp, Set.range_iff_surjective.mpr, ←
  @Set.preimage_univ _ _ (pullback.fst : pullback f.1.base g.1.base ⟶ _)]
  -- Porting note : was `rw`
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑pullback.snd '' (↑pullback.fst ⁻¹' Set.univ) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop f g).hom
[PROOFSTEP]
erw [TopCat.pullback_snd_image_fst_preimage]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑(Scheme.forgetToTop.map g) ⁻¹' (↑(Scheme.forgetToTop.map f) '' Set.univ) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop f g).hom
[PROOFSTEP]
rw [Set.image_univ]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑(Scheme.forgetToTop.map g) ⁻¹' Set.range ↑(Scheme.forgetToTop.map f) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop f g).hom
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop f g).hom
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Epi (PreservesPullback.iso Scheme.forgetToTop f g).hom
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑pullback.fst.val.base =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
rw [← show _ = (pullback.fst : pullback g f ⟶ _).1.base from PreservesPullback.iso_hom_fst Scheme.forgetToTop g f]
  -- Porting note : was `rw`
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑((PreservesPullback.iso Scheme.forgetToTop g f).hom ≫ pullback.fst) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
erw [coe_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range (↑pullback.fst ∘ ↑(PreservesPullback.iso Scheme.forgetToTop g f).hom) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
[PROOFSTEP]
rw [Set.range_comp, Set.range_iff_surjective.mpr, ←
  @Set.preimage_univ _ _ (pullback.snd : pullback g.1.base f.1.base ⟶ _)]
  -- Porting note : was `rw`
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑pullback.fst '' (↑pullback.snd ⁻¹' Set.univ) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop g f).hom
[PROOFSTEP]
erw [TopCat.pullback_fst_image_snd_preimage]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑(Scheme.forgetToTop.map g) ⁻¹' (↑(Scheme.forgetToTop.map f) '' Set.univ) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop g f).hom
[PROOFSTEP]
rw [Set.image_univ]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ ↑(Scheme.forgetToTop.map g) ⁻¹' Set.range ↑(Scheme.forgetToTop.map f) =
    ((Opens.map g.val.base).obj
        { carrier := Set.range ↑f.val.base, is_open' := (_ : IsOpen (Set.range ↑f.val.base)) }).carrier
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop g f).hom
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Function.Surjective ↑(PreservesPullback.iso Scheme.forgetToTop g f).hom
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Epi (PreservesPullback.iso Scheme.forgetToTop g f).hom
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑(pullback.fst ≫ f).val.base = Set.range ↑f.val.base ∩ Set.range ↑g.val.base
[PROOFSTEP]
rw [pullback.condition, Scheme.comp_val_base, coe_comp, Set.range_comp, range_pullback_snd_of_left,
  Opens.carrier_eq_coe, Opens.map_obj, Opens.coe_mk, Set.image_preimage_eq_inter_range, Set.inter_comm]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ Set.range ↑(pullback.fst ≫ g).val.base = Set.range ↑g.val.base ∩ Set.range ↑f.val.base
[PROOFSTEP]
rw [Scheme.comp_val_base, coe_comp, Set.range_comp, range_pullback_fst_of_right, Opens.map_obj, Opens.carrier_eq_coe,
  Opens.coe_mk, Set.image_preimage_eq_inter_range, Set.inter_comm]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
e : Set.range ↑f.val.base = Set.range ↑g.val.base
⊢ lift g f (_ : Set.range ↑f.val.base ≤ Set.range ↑g.val.base) ≫
      lift f g (_ : Set.range ↑g.val.base ≤ Set.range ↑f.val.base) =
    𝟙 X
[PROOFSTEP]
rw [← cancel_mono f]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
e : Set.range ↑f.val.base = Set.range ↑g.val.base
⊢ (lift g f (_ : Set.range ↑f.val.base ≤ Set.range ↑g.val.base) ≫
        lift f g (_ : Set.range ↑g.val.base ≤ Set.range ↑f.val.base)) ≫
      f =
    𝟙 X ≫ f
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
e : Set.range ↑f.val.base = Set.range ↑g.val.base
⊢ lift f g (_ : Set.range ↑g.val.base ≤ Set.range ↑f.val.base) ≫
      lift g f (_ : Set.range ↑f.val.base ≤ Set.range ↑g.val.base) =
    𝟙 Y
[PROOFSTEP]
rw [← cancel_mono g]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
e : Set.range ↑f.val.base = Set.range ↑g.val.base
⊢ (lift f g (_ : Set.range ↑g.val.base ≤ Set.range ↑f.val.base) ≫
        lift g f (_ : Set.range ↑f.val.base ≤ Set.range ↑g.val.base)) ≫
      g =
    𝟙 Y ≫ g
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H✝ : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
fg : Y ⟶ X
H : fg = f ≫ g
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ (Opens.map f.val.base).obj V = (Opens.map fg.val.base).obj ((Scheme.Hom.opensFunctor g).obj V)
[PROOFSTEP]
subst H
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ (Opens.map f.val.base).obj V = (Opens.map (f ≫ g).val.base).obj ((Scheme.Hom.opensFunctor g).obj V)
[PROOFSTEP]
rw [Scheme.comp_val_base, Opens.map_comp_obj]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ (Opens.map f.val.base).obj V =
    (Opens.map f.val.base).obj ((Opens.map g.val.base).obj ((Scheme.Hom.opensFunctor g).obj V))
[PROOFSTEP]
congr 1
[GOAL]
case e_a
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ V = (Opens.map g.val.base).obj ((Scheme.Hom.opensFunctor g).obj V)
[PROOFSTEP]
ext1
[GOAL]
case e_a.h
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ ↑V = ↑((Opens.map g.val.base).obj ((Scheme.Hom.opensFunctor g).obj V))
[PROOFSTEP]
exact (Set.preimage_image_eq _ h.base_open.inj).symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H✝ : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
fg : Y ⟶ X
H : fg = f ≫ g
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ NatTrans.app f.val.c (op V) =
    Scheme.Hom.invApp g V ≫
      NatTrans.app fg.val.c (op ((Scheme.Hom.opensFunctor g).obj V)) ≫
        Y.presheaf.map
          (eqToHom
              (_ : (Opens.map f.val.base).obj V = (Opens.map fg.val.base).obj ((Scheme.Hom.opensFunctor g).obj V))).op
[PROOFSTEP]
subst H
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ NatTrans.app f.val.c (op V) =
    Scheme.Hom.invApp g V ≫
      NatTrans.app (f ≫ g).val.c (op ((Scheme.Hom.opensFunctor g).obj V)) ≫
        Y.presheaf.map
          (eqToHom
              (_ :
                (Opens.map f.val.base).obj V = (Opens.map (f ≫ g).val.base).obj ((Scheme.Hom.opensFunctor g).obj V))).op
[PROOFSTEP]
rw [Scheme.comp_val_c_app, Category.assoc, Scheme.Hom.invApp, PresheafedSpace.IsOpenImmersion.invApp_app_assoc,
  f.val.c.naturality_assoc, TopCat.Presheaf.pushforwardObj_map, ← Functor.map_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
⊢ NatTrans.app f.val.c (op V) =
    NatTrans.app f.val.c (op V) ≫
      Y.presheaf.map
        ((Opens.map f.val.base).op.map
            (eqToHom
              (_ :
                op V =
                  op ((Opens.map g.val.base).obj (op ((PresheafedSpace.IsOpenImmersion.openFunctor h).obj V)).unop))) ≫
          (eqToHom
              (_ :
                (Opens.map f.val.base).obj V =
                  (Opens.map (f ≫ g).val.base).obj ((Scheme.Hom.opensFunctor g).obj V))).op)
[PROOFSTEP]
convert (Category.comp_id <| f.1.c.app (op V)).symm
[GOAL]
case h.e'_3.h.e'_7.h
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ Z : Scheme
f✝ : X✝ ⟶ Z
g✝ : Y✝ ⟶ Z
H : IsOpenImmersion f✝
X Y U : Scheme
f : Y ⟶ U
g : U ⟶ X
h : IsOpenImmersion g
V : Opens ↑↑U.toPresheafedSpace
e_5✝ : Y.presheaf.obj (op ((Opens.map f.val.base).obj V)) = (f.val.base _* Y.presheaf).obj (op V)
⊢ Y.presheaf.map
      ((Opens.map f.val.base).op.map
          (eqToHom
            (_ :
              op V =
                op ((Opens.map g.val.base).obj (op ((PresheafedSpace.IsOpenImmersion.openFunctor h).obj V)).unop))) ≫
        (eqToHom
            (_ :
              (Opens.map f.val.base).obj V =
                (Opens.map (f ≫ g).val.base).obj ((Scheme.Hom.opensFunctor g).obj V))).op) =
    𝟙 ((f.val.base _* Y.presheaf).obj (op V))
[PROOFSTEP]
convert Y.presheaf.map_id _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
⊢ (Hom.opensFunctor f).obj (basicOpen X r) = basicOpen Y (↑(Hom.invApp f U) r)
[PROOFSTEP]
have e := Scheme.preimage_basicOpen f (Scheme.Hom.invApp f U r)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(Hom.invApp f U) r)) =
    basicOpen X (↑(NatTrans.app f.val.c (op ((Hom.opensFunctor f).obj U))) (↑(Hom.invApp f U) r))
⊢ (Hom.opensFunctor f).obj (basicOpen X r) = basicOpen Y (↑(Hom.invApp f U) r)
[PROOFSTEP]
rw [Scheme.Hom.invApp] at e
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    basicOpen X
      (↑(NatTrans.app f.val.c (op ((Hom.opensFunctor f).obj U))) (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r))
⊢ (Hom.opensFunctor f).obj (basicOpen X r) = basicOpen Y (↑(Hom.invApp f U) r)
[PROOFSTEP]
erw [PresheafedSpace.IsOpenImmersion.invApp_app_apply] at e
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    basicOpen X
      (↑(X.presheaf.map
            (eqToHom
              (_ :
                op U =
                  op ((Opens.map f.val.base).obj (op ((PresheafedSpace.IsOpenImmersion.openFunctor H).obj U)).unop))))
        r)
⊢ (Hom.opensFunctor f).obj (basicOpen X r) = basicOpen Y (↑(Hom.invApp f U) r)
[PROOFSTEP]
rw [Scheme.basicOpen_res, inf_eq_right.mpr _] at e
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ (Hom.opensFunctor f).obj (basicOpen X r) = basicOpen Y (↑(Hom.invApp f U) r)
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
rw [← e]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ (Hom.opensFunctor f).obj
      ((Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r))) =
    basicOpen Y (↑(Hom.invApp f U) r)
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
ext1
  -- Porting note : this `dsimp` was not necessary
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ ↑((Hom.opensFunctor f).obj
        ((Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)))) =
    ↑(basicOpen Y (↑(Hom.invApp f U) r))
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
dsimp [Opens.map]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ ↑f.val.base '' (↑f.val.base ⁻¹' ↑(basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r))) =
    ↑(basicOpen Y (↑(Hom.invApp f U) r))
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
refine' Set.image_preimage_eq_inter_range.trans _
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ ↑(basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) ∩ Set.range ↑f.val.base =
    ↑(basicOpen Y (↑(Hom.invApp f U) r))
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
erw [Set.inter_eq_left_iff_subset]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e : (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) = basicOpen X r
⊢ ↑(basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) ⊆ Set.range ↑f.val.base
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
refine' Set.Subset.trans (Scheme.basicOpen_le _ _) (Set.image_subset_range _ _)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ basicOpen X r ≤ (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
refine' le_trans (Scheme.basicOpen_le _ _) (le_of_eq _)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ U = (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U)
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
H : IsOpenImmersion f
U : Opens ↑↑X.toPresheafedSpace
r : ↑(X.presheaf.obj (op U))
e :
  (Opens.map f.val.base).obj (basicOpen Y (↑(PresheafedSpace.IsOpenImmersion.invApp H U) r)) =
    (Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U) ⊓ basicOpen X r
⊢ ↑U = ↑((Opens.map f.val.base).obj ((Hom.opensFunctor f).obj U))
[PROOFSTEP]
exact (Set.preimage_image_eq _ H.base_open.inj).symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base
[PROOFSTEP]
dsimp [ofRestrict, LocallyRingedSpace.ofRestrict, Opens.inclusion]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ContinuousMap.mk Subtype.val) ⊆ Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val, Subtype.range_val]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ ↑U ⊆ ↑V
[PROOFSTEP]
exact i.le
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ { obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
          map := fun {U V} i =>
            Over.homMk
              (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ :
                  Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
      (𝟙 U) =
    𝟙
      ({ obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
            map := fun {U V} i =>
              Over.homMk
                (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ :
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.obj
        U)
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ ({ obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
            map := fun {U V} i =>
              Over.homMk
                (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ :
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
        (𝟙 U)).left =
    (𝟙
        ({ obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
              map := fun {U V} i =>
                Over.homMk
                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                    (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ :
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                        Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.obj
          U)).left
[PROOFSTEP]
dsimp only [Over.homMk_left, Over.id_left]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
⊢ IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ :
        Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base) =
    𝟙 (Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))).left
[PROOFSTEP]
rw [← cancel_mono (X.ofRestrict U.openEmbedding), Category.id_comp, IsOpenImmersion.lift_fac]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ { obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
          map := fun {U V} i =>
            Over.homMk
              (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ :
                  Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
      (i ≫ j) =
    { obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
            map := fun {U V} i =>
              Over.homMk
                (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ :
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
        i ≫
      { obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
            map := fun {U V} i =>
              Over.homMk
                (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ :
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
        j
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ ({ obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
            map := fun {U V} i =>
              Over.homMk
                (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ :
                    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
        (i ≫ j)).left =
    ({ obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
              map := fun {U V} i =>
                Over.homMk
                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                    (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ :
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                        Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
          i ≫
        { obj := fun U => Over.mk (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))),
              map := fun {U V} i =>
                Over.homMk
                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                    (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ :
                      Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
                        Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base)) }.map
          j).left
[PROOFSTEP]
dsimp only [Over.homMk_left, Over.comp_left]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
      (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ :
        Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) =
    IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base) ≫
      IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base)
[PROOFSTEP]
rw [← cancel_mono (X.ofRestrict W.openEmbedding), Category.assoc]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) ≫
      ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)) =
    IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base) ≫
      IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base ⊆
              Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) ≫
        ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))
[PROOFSTEP]
iterate 3 rw [IsOpenImmersion.lift_fac]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) ≫
      ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)) =
    IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base) ≫
      IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base ⊆
              Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) ≫
        ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))
[PROOFSTEP]
rw [IsOpenImmersion.lift_fac]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) =
    IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base) ≫
      IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W)))
          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base ⊆
              Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))).val.base) ≫
        ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion W))
[PROOFSTEP]
rw [IsOpenImmersion.lift_fac]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V W : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
j : V ⟶ W
⊢ ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) =
    IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (_ :
          Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
            Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base) ≫
      ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))
[PROOFSTEP]
rw [IsOpenImmersion.lift_fac]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base
[PROOFSTEP]
dsimp [ofRestrict, LocallyRingedSpace.ofRestrict, Opens.inclusion]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ContinuousMap.mk Subtype.val) ⊆ Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val, Subtype.range_val]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ ↑U ⊆ ↑V
[PROOFSTEP]
exact i.le
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base ⊆
    Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base
[PROOFSTEP]
dsimp [ofRestrict, LocallyRingedSpace.ofRestrict, Opens.inclusion]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ Set.range ↑(ContinuousMap.mk Subtype.val) ⊆ Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val, Subtype.range_val]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ ↑U ⊆ ↑V
[PROOFSTEP]
exact i.le
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
⊢ ((restrictFunctor X).map i).left.val.base = (Opens.toTopCat ↑X.toPresheafedSpace).map i
[PROOFSTEP]
ext a
[GOAL]
case w
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
a : (forget TopCat).obj ↑((restrictFunctor X).obj U).left.toPresheafedSpace
⊢ ↑((restrictFunctor X).map i).left.val.base a = ↑((Opens.toTopCat ↑X.toPresheafedSpace).map i) a
[PROOFSTEP]
refine
  Subtype.ext
    ?_
      -- Porting note : `ext` did not pick up `Subtype.ext`
[GOAL]
case w
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
a : (forget TopCat).obj ↑((restrictFunctor X).obj U).left.toPresheafedSpace
⊢ ↑(↑((restrictFunctor X).map i).left.val.base a) = ↑(↑((Opens.toTopCat ↑X.toPresheafedSpace).map i) a)
[PROOFSTEP]
exact (congr_arg (fun f : X.restrict U.openEmbedding ⟶ X => f.1.base a) (X.restrictFunctor_map_ofRestrict i))
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W
[PROOFSTEP]
simp only [← SetLike.coe_subset_coe, IsOpenMap.functor_obj_coe, Set.image_subset_iff, Scheme.restrictFunctor_map_base,
  Opens.map_coe, Opens.inclusion_apply]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
⊢ ↑((Opens.toTopCat ↑X.toPresheafedSpace).map i) ⁻¹' ↑W ⊆
    (fun a => ↑(Opens.inclusion U) a) ⁻¹' ((fun a => ↑(Opens.inclusion V) a) '' ↑W)
[PROOFSTEP]
rintro _ h
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
a✝ : (forget TopCat).obj ((Opens.toTopCat ↑X.toPresheafedSpace).obj U)
h : a✝ ∈ ↑((Opens.toTopCat ↑X.toPresheafedSpace).map i) ⁻¹' ↑W
⊢ a✝ ∈ (fun a => ↑(Opens.inclusion U) a) ⁻¹' ((fun a => ↑(Opens.inclusion V) a) '' ↑W)
[PROOFSTEP]
exact ⟨_, h, rfl⟩
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
⊢ NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
have e₁ := Scheme.congr_app (X.restrictFunctor_map_ofRestrict i) (op <| V.openEmbedding.isOpenMap.functor.obj W)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  NatTrans.app (((restrictFunctor X).map i).left ≫ ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.c
      (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
    NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      ((restrictFunctor X).obj U).left.presheaf.map
        (eqToHom
          (_ :
            (Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
              (Opens.map
                      (((restrictFunctor X).map i).left ≫
                            ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))
⊢ NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
rw [Scheme.comp_val_c_app] at e₁
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      NatTrans.app ((restrictFunctor X).map i).left.val.c
        ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      ((restrictFunctor X).obj U).left.presheaf.map
        (eqToHom
          (_ :
            (Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
              (Opens.map
                      (((restrictFunctor X).map i).left ≫
                            ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))
⊢ NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
have e₂ := (X.restrictFunctor.map i).1.val.c.naturality (eqToHom <| W.map_functor_eq (U := V)).op
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      NatTrans.app ((restrictFunctor X).map i).left.val.c
        ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      ((restrictFunctor X).obj U).left.presheaf.map
        (eqToHom
          (_ :
            (Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
              (Opens.map
                      (((restrictFunctor X).map i).left ≫
                            ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))
e₂ :
  ((restrictFunctor X).obj V).left.presheaf.map
        (eqToHom
            (_ :
              (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                W)).op ≫
      NatTrans.app ((restrictFunctor X).map i).left.val.c
        (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) ≫
      (((restrictFunctor X).map i).left.val.base _* ((restrictFunctor X).obj U).left.presheaf).map
        (eqToHom
            (_ :
              (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                W)).op
⊢ NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
rw [← IsIso.eq_inv_comp] at e₂
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      NatTrans.app ((restrictFunctor X).map i).left.val.c
        ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    NatTrans.app (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) ≫
      ((restrictFunctor X).obj U).left.presheaf.map
        (eqToHom
          (_ :
            (Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
              (Opens.map
                      (((restrictFunctor X).map i).left ≫
                            ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))
e₂ :
  NatTrans.app ((restrictFunctor X).map i).left.val.c
      (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    inv
        (((restrictFunctor X).obj V).left.presheaf.map
          (eqToHom
              (_ :
                (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                  W)).op) ≫
      NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) ≫
        (((restrictFunctor X).map i).left.val.base _* ((restrictFunctor X).obj U).left.presheaf).map
          (eqToHom
              (_ :
                (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                  W)).op
⊢ NatTrans.app ((restrictFunctor X).map i).left.val.c (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
dsimp at e₁ e₂ ⊢
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  X.presheaf.map
        (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion V))).counit
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
      NatTrans.app
        (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
              (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
        (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    X.presheaf.map
        (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
      X.presheaf.map
        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
            (eqToHom
                (_ :
                  op
                      ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                    op
                      ((Opens.map
                            (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                  (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                  (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                        ((Opens.map (Opens.inclusion V)).obj
                          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))).unop).op
e₂ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    inv
        (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).map
              (eqToHom
                (_ :
                  (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                    W))).op) ≫
      NatTrans.app
          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
          (op W) ≫
        X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
              ((Opens.map
                    (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                          (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).map
                (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      W)))).op
⊢ NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
rw [e₂, W.adjunction_counit_map_functor (U := V), ← IsIso.eq_inv_comp, IsIso.inv_comp_eq, ← IsIso.eq_comp_inv] at e₁
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₁ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).map
              (eqToHom
                (_ :
                  (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                    W))).op ≫
        inv
            (X.presheaf.map
              (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V) ⋙ IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      (𝟭 (Opens ↑↑X.toPresheafedSpace)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))).op) ≫
          X.presheaf.map
              (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
            X.presheaf.map
              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
                  (eqToHom
                      (_ :
                        op
                            ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
                              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                          op
                            ((Opens.map
                                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                        (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                              ((Opens.map (Opens.inclusion V)).obj
                                ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))).unop).op) ≫
      inv
        (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
              ((Opens.map
                    (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                          (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).map
                (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      W)))).op)
e₂ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    inv
        (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).map
              (eqToHom
                (_ :
                  (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                    W))).op) ≫
      NatTrans.app
          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
          (op W) ≫
        X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
              ((Opens.map
                    (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                          (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).map
                (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      W)))).op
⊢ NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
simp_rw [eqToHom_map (Opens.map _), eqToHom_map (IsOpenMap.functor _), ← Functor.map_inv, ← Functor.map_comp] at e₁
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₂ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    inv
        (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).map
              (eqToHom
                (_ :
                  (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                    W))).op) ≫
      NatTrans.app
          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
          (op W) ≫
        X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
              ((Opens.map
                    (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                          (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).map
                (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      W)))).op
e₁ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    X.presheaf.map
      (((eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                    ((Opens.map (Opens.inclusion V)).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
          inv
              (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V) ⋙ IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      (𝟭 (Opens ↑↑X.toPresheafedSpace)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))).op ≫
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
                  (eqToHom
                      (_ :
                        op
                            ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
                              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                          op
                            ((Opens.map
                                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                        (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                              ((Opens.map (Opens.inclusion V)).obj
                                ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))).unop).op) ≫
        inv
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      ((Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      W))).op)
⊢ NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
rw [e₁]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : Opens ↑↑X.toPresheafedSpace
i : U ⟶ V
W : Opens { x // x ∈ V }
e₂ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op ((Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
    inv
        (X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).map
              (eqToHom
                (_ :
                  (Opens.map (Opens.inclusion V)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                    W))).op) ≫
      NatTrans.app
          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
          (op W) ≫
        X.presheaf.map
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
              ((Opens.map
                    (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                          (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                          (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).map
                (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      W)))).op
e₁ :
  NatTrans.app
      (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
            (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.c
      (op W) =
    X.presheaf.map
      (((eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                    ((Opens.map (Opens.inclusion V)).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
          inv
              (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V) ⋙ IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      (𝟭 (Opens ↑↑X.toPresheafedSpace)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))).op ≫
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
                  (eqToHom
                      (_ :
                        op
                            ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
                              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                          op
                            ((Opens.map
                                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                        (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                              ((Opens.map (Opens.inclusion V)).obj
                                ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))).unop).op) ≫
        inv
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      ((Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      W))).op)
⊢ X.presheaf.map
      (((eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                    ((Opens.map (Opens.inclusion V)).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
          inv
              (eqToHom
                  (_ :
                    (Opens.map (Opens.inclusion V) ⋙ IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W) =
                      (𝟭 (Opens ↑↑X.toPresheafedSpace)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))).op ≫
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op ≫
              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).map
                  (eqToHom
                      (_ :
                        op
                            ((Opens.map (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
                              ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)) =
                          op
                            ((Opens.map
                                  (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                        (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                        (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                              ((Opens.map (Opens.inclusion V)).obj
                                ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))))).unop).op) ≫
        inv
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      ((Opens.map (Opens.inclusion V)).obj
                        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W))) =
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                    ((Opens.map
                          (IsOpenImmersion.lift (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V)))
                                (ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))
                                (_ : Set.range Subtype.val ⊆ Set.range Subtype.val)).val.base).obj
                      W))).op) =
    X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                ((Opens.map ((restrictFunctor X).map i).left.val.base).obj W) ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V))).obj W)).op
[PROOFSTEP]
congr 1
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
⊢ ∀ {X_1 Y : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ} (f : X_1 ⟶ Y),
    ((restrictFunctor X).op ⋙ (Over.forget X).op ⋙ Γ).map f ≫
        ((fun U =>
              X.presheaf.mapIso
                (Iso.op
                  (eqToIso (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤ = U.unop)).symm))
            Y).hom =
      ((fun U =>
              X.presheaf.mapIso
                (Iso.op
                  (eqToIso (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤ = U.unop)).symm))
            X_1).hom ≫
        X.presheaf.map f
[PROOFSTEP]
intro U V i
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
⊢ ((restrictFunctor X).op ⋙ (Over.forget X).op ⋙ Γ).map i ≫
      ((fun U =>
            X.presheaf.mapIso
              (Iso.op
                (eqToIso (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤ = U.unop)).symm))
          V).hom =
    ((fun U =>
            X.presheaf.mapIso
              (Iso.op
                (eqToIso (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤ = U.unop)).symm))
          U).hom ≫
      X.presheaf.map i
[PROOFSTEP]
dsimp [-Scheme.restrictFunctor_map_left]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
⊢ NatTrans.app ((restrictFunctor X).map i.unop).left.val.c (op ⊤) ≫
      X.presheaf.map (eqToHom (_ : V.unop = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V.unop))).obj ⊤)).op =
    X.presheaf.map (eqToHom (_ : U.unop = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤)).op ≫
      X.presheaf.map i
[PROOFSTEP]
rw [X.restrictFunctor_map_app, ← Functor.map_comp, ← Functor.map_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
U V : (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
i : U ⟶ V
⊢ X.presheaf.map
      ((homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V.unop))).obj
                  ((Opens.map ((restrictFunctor X).map i.unop).left.val.base).obj ⊤) ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤)).op ≫
        (eqToHom (_ : V.unop = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion V.unop))).obj ⊤)).op) =
    X.presheaf.map ((eqToHom (_ : U.unop = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U.unop))).obj ⊤)).op ≫ i)
[PROOFSTEP]
congr 1
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≅
    restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
[PROOFSTEP]
apply
  IsOpenImmersion.isoOfRangeEq (f := X.ofRestrict _ ≫ f) (H :=
    PresheafedSpace.IsOpenImmersion.comp (hf := inferInstance) (hg := inferInstance)) (Y.ofRestrict _) _
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ Set.range ↑(ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫ f).val.base =
    Set.range ↑(ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base
[PROOFSTEP]
dsimp [Opens.inclusion]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ Set.range ↑(ContinuousMap.mk Subtype.val ≫ f.val.base) = Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [coe_comp, Set.range_comp, ContinuousMap.coe_mk, ContinuousMap.coe_mk]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ ↑f.val.base '' Set.range Subtype.val = Set.range Subtype.val
[PROOFSTEP]
dsimp
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ ↑f.val.base '' Set.range Subtype.val = Set.range Subtype.val
[PROOFSTEP]
rw [Subtype.range_val, Subtype.range_coe]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ ↑f.val.base '' ↑((Opens.map f.val.base).obj U) = ↑U
[PROOFSTEP]
refine' @Set.image_preimage_eq _ _ f.1.base U.1 _
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ Function.Surjective ↑f.val.base
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ Epi f.val.base
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ x ∈
    Set.range ↑((fun x => pullback.fst) ((fun x => AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)) x)).val.base
[PROOFSTEP]
rw [←
  show _ = (pullback.fst : pullback f (𝒰.map (𝒰.f (f.1.base x))) ⟶ _).1.base from
    PreservesPullback.iso_hom_fst Scheme.forgetToTop f (𝒰.map (𝒰.f (f.1.base x)))]
  -- Porting note : `rw` to `erw` on this single lemma
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ x ∈
    Set.range
      ↑((PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom ≫
          pullback.fst)
[PROOFSTEP]
erw [coe_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ x ∈
    Set.range
      (↑pullback.fst ∘
        ↑(PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom)
[PROOFSTEP]
rw [Set.range_comp, Set.range_iff_surjective.mpr, Set.image_univ, TopCat.pullback_fst_range]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ x ∈
    {x_1 |
      ∃ y,
        ↑(forgetToTop.map f) x_1 =
          ↑(forgetToTop.map (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))) y}
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ Function.Surjective
    ↑(PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom
[PROOFSTEP]
obtain ⟨y, h⟩ := 𝒰.Covers (f.1.base x)
[GOAL]
case intro
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
y : (forget TopCat).obj ↑(obj 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x))).toPresheafedSpace
h : ↑(map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x))).val.base y = ↑f.val.base x
⊢ x ∈
    {x_1 |
      ∃ y,
        ↑(forgetToTop.map f) x_1 =
          ↑(forgetToTop.map (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))) y}
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ Function.Surjective
    ↑(PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom
[PROOFSTEP]
exact ⟨y, h.symm⟩
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ Function.Surjective
    ↑(PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom
[PROOFSTEP]
rw [← TopCat.epi_iff_surjective]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
W : Scheme
f : W ⟶ X
x : ↑↑W.toPresheafedSpace
⊢ Epi (PreservesPullback.iso forgetToTop f (map 𝒰 (AlgebraicGeometry.Scheme.OpenCover.f 𝒰 (↑f.val.base x)))).hom
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
⊢ ⋃ (i : 𝒰.J), Set.range ↑(map 𝒰 i).val.base = Set.univ
[PROOFSTEP]
rw [Set.eq_univ_iff_forall]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
⊢ ∀ (x : (forget TopCat).obj ↑X.toPresheafedSpace), x ∈ ⋃ (i : 𝒰.J), Set.range ↑(map 𝒰 i).val.base
[PROOFSTEP]
intro x
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
x : (forget TopCat).obj ↑X.toPresheafedSpace
⊢ x ∈ ⋃ (i : 𝒰.J), Set.range ↑(map 𝒰 i).val.base
[PROOFSTEP]
rw [Set.mem_iUnion]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
x : (forget TopCat).obj ↑X.toPresheafedSpace
⊢ ∃ i, x ∈ Set.range ↑(map 𝒰 i).val.base
[PROOFSTEP]
exact ⟨𝒰.f x, 𝒰.Covers x⟩
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
⊢ ↑(⨆ (i : 𝒰.J), Hom.opensRange (map 𝒰 i)) = ↑⊤
[PROOFSTEP]
rw [Opens.coe_iSup]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
⊢ ⋃ (i : 𝒰.J), ↑(Hom.opensRange (map 𝒰 i)) = ↑⊤
[PROOFSTEP]
exact 𝒰.iUnion_range
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
⊢ CompactSpace ↑↑X.toPresheafedSpace
[PROOFSTEP]
cases nonempty_fintype 𝒰.J
[GOAL]
case intro
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
val✝ : Fintype 𝒰.J
⊢ CompactSpace ↑↑X.toPresheafedSpace
[PROOFSTEP]
rw [← isCompact_univ_iff, ← 𝒰.iUnion_range]
[GOAL]
case intro
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
val✝ : Fintype 𝒰.J
⊢ IsCompact (⋃ (i : 𝒰.J), Set.range ↑(map 𝒰 i).val.base)
[PROOFSTEP]
apply isCompact_iUnion
[GOAL]
case intro.h
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
val✝ : Fintype 𝒰.J
⊢ ∀ (i : 𝒰.J), IsCompact (Set.range ↑(map 𝒰 i).val.base)
[PROOFSTEP]
intro i
[GOAL]
case intro.h
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
val✝ : Fintype 𝒰.J
i : 𝒰.J
⊢ IsCompact (Set.range ↑(map 𝒰 i).val.base)
[PROOFSTEP]
rw [isCompact_iff_compactSpace]
[GOAL]
case intro.h
C : Type u
inst✝¹ : Category.{v, u} C
X : Scheme
𝒰 : OpenCover X
inst✝ : Finite 𝒰.J
H : ∀ (i : 𝒰.J), CompactSpace ↑↑(obj 𝒰 i).toPresheafedSpace
val✝ : Fintype 𝒰.J
i : 𝒰.J
⊢ CompactSpace ↑(Set.range ↑(map 𝒰 i).val.base)
[PROOFSTEP]
exact
  @Homeomorph.compactSpace _ _ _ _ (H i)
    (TopCat.homeoOfIso
      (asIso
        (IsOpenImmersion.isoOfRangeEq (𝒰.map i)
                (X.ofRestrict (Opens.openEmbedding ⟨_, (𝒰.IsOpen i).base_open.open_range⟩))
                Subtype.range_coe.symm).hom.1.base))
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰₁ : OpenCover X
𝒰₂ : OpenCover X
x : ↑↑X.toPresheafedSpace
⊢ x ∈ Set.range ↑((fun ij => pullback.fst ≫ map 𝒰₁ ij.fst) ((fun x => (f 𝒰₁ x, f 𝒰₂ x)) x)).val.base
[PROOFSTEP]
rw [IsOpenImmersion.range_pullback_to_base_of_left]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X : Scheme
𝒰₁ : OpenCover X
𝒰₂ : OpenCover X
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range ↑(map 𝒰₁ ((fun x => (f 𝒰₁ x, f 𝒰₂ x)) x).fst).val.base ∩
      Set.range ↑(map 𝒰₂ ((fun x => (f 𝒰₁ x, f 𝒰₂ x)) x).snd).val.base
[PROOFSTEP]
exact
  ⟨𝒰₁.Covers x, 𝒰₂.Covers x⟩
    -- Porting note : was automatic
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
s : Type u_1
X : Scheme
U : s → Opens ↑↑X.toPresheafedSpace
hU : ⨆ (i : s), U i = ⊤
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ⊤
[PROOFSTEP]
triv
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
s : Type u_1
X : Scheme
U : s → Opens ↑↑X.toPresheafedSpace
hU : ⨆ (i : s), U i = ⊤
x : ↑↑X.toPresheafedSpace
⊢ x ∈
    Set.range
      ↑((fun i => ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (U i))))
              ((fun x => Exists.choose (_ : ∃ i, x ∈ U i)) x)).val.base
[PROOFSTEP]
erw [Subtype.range_coe]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
s : Type u_1
X : Scheme
U : s → Opens ↑↑X.toPresheafedSpace
hU : ⨆ (i : s), U i = ⊤
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ↑(U ((fun x => Exists.choose (_ : ∃ i, x ∈ U i)) x))
[PROOFSTEP]
have : x ∈ ⨆ i, U i := hU.symm ▸ show x ∈ (⊤ : Opens X) by triv
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
s : Type u_1
X : Scheme
U : s → Opens ↑↑X.toPresheafedSpace
hU : ⨆ (i : s), U i = ⊤
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ⊤
[PROOFSTEP]
triv
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
s : Type u_1
X : Scheme
U : s → Opens ↑↑X.toPresheafedSpace
hU : ⨆ (i : s), U i = ⊤
x : ↑↑X.toPresheafedSpace
this : x ∈ ⨆ (i : s), U i
⊢ x ∈ ↑(U ((fun x => Exists.choose (_ : ∃ i, x ∈ U i)) x))
[PROOFSTEP]
exact (Opens.mem_iSup.mp this).choose_spec
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ pullback f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) ≅
    Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))
[PROOFSTEP]
refine' IsOpenImmersion.isoOfRangeEq pullback.fst (X.ofRestrict _) _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ Set.range ↑pullback.fst.val.base =
    Set.range ↑(Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.base
[PROOFSTEP]
rw [IsOpenImmersion.range_pullback_fst_of_right]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ ((Opens.map f.val.base).obj
        { carrier := Set.range ↑(Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base,
          is_open' :=
            (_ :
              IsOpen (Set.range ↑(Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base)) }).carrier =
    Set.range ↑(Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.base
[PROOFSTEP]
dsimp [Opens.inclusion]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ ↑f.val.base ⁻¹' Set.range ↑(ContinuousMap.mk Subtype.val) = Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val, Subtype.range_coe]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ ↑f.val.base ⁻¹' ↑U = ↑((Opens.map f.val.base).obj U)
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict f U).inv ≫ pullback.fst =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))
[PROOFSTEP]
delta pullbackRestrictIsoRestrict
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (IsOpenImmersion.isoOfRangeEq pullback.fst
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
          (_ :
            Set.range ↑pullback.fst.val.base =
              Set.range
                ↑(Scheme.ofRestrict X
                        (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.base)).inv ≫
      pullback.fst =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict f U).hom ≫
      Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) =
    pullback.fst
[PROOFSTEP]
delta pullbackRestrictIsoRestrict
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (IsOpenImmersion.isoOfRangeEq pullback.fst
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
          (_ :
            Set.range ↑pullback.fst.val.base =
              Set.range
                ↑(Scheme.ofRestrict X
                        (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.base)).hom ≫
      Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) =
    pullback.fst
[PROOFSTEP]
simp
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)) =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫ f
[PROOFSTEP]
delta morphismRestrict
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ ((pullbackRestrictIsoRestrict f U).inv ≫ pullback.snd) ≫
      Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)) =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫ f
[PROOFSTEP]
rw [Category.assoc, pullback.condition.symm, pullbackRestrictIsoRestrict_inv_fst_assoc]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ IsPullback (f ∣_ U) (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
[PROOFSTEP]
delta morphismRestrict
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ IsPullback ((pullbackRestrictIsoRestrict f U).inv ≫ pullback.snd)
    (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
[PROOFSTEP]
rw [← Category.id_comp f]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ IsPullback ((pullbackRestrictIsoRestrict (𝟙 X ≫ f) U).inv ≫ pullback.snd)
    (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (𝟙 X ≫ f).val.base).obj U))))
    (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) (𝟙 X ≫ f)
[PROOFSTEP]
refine' (IsPullback.of_horiz_isIso ⟨_⟩).paste_horiz (IsPullback.of_hasPullback f (Y.ofRestrict U.openEmbedding)).flip
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict (𝟙 X ≫ f) U).inv ≫ pullback.fst =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (𝟙 X ≫ f).val.base).obj U))) ≫ 𝟙 X
[PROOFSTEP]
erw [pullbackRestrictIsoRestrict_inv_fst]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (𝟙 X ≫ f).val.base).obj U))) =
    Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (𝟙 X ≫ f).val.base).obj U))) ≫ 𝟙 X
[PROOFSTEP]
rw [Category.comp_id]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (f ≫ g) ∣_ U = (f ∣_ (Opens.map g.val.base).obj U) ≫ g ∣_ U
[PROOFSTEP]
delta morphismRestrict
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫ pullback.snd =
    ((pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict g U).inv ≫ pullback.snd
[PROOFSTEP]
rw [← pullbackRightPullbackFstIso_inv_snd_snd]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫
      (pullbackRightPullbackFstIso g (Scheme.ofRestrict Z (_ : OpenEmbedding ↑(Opens.inclusion U))) f).inv ≫
        pullback.snd ≫ pullback.snd =
    ((pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict g U).inv ≫ pullback.snd
[PROOFSTEP]
simp_rw [← Category.assoc]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (((pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫
          (pullbackRightPullbackFstIso g (Scheme.ofRestrict Z (_ : OpenEmbedding ↑(Opens.inclusion U))) f).inv) ≫
        pullback.snd) ≫
      pullback.snd =
    (((pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫ pullback.snd) ≫
        (pullbackRestrictIsoRestrict g U).inv) ≫
      pullback.snd
[PROOFSTEP]
congr 1
[GOAL]
case e_a
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ ((pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫
        (pullbackRightPullbackFstIso g (Scheme.ofRestrict Z (_ : OpenEmbedding ↑(Opens.inclusion U))) f).inv) ≫
      pullback.snd =
    ((pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict g U).inv
[PROOFSTEP]
rw [← cancel_mono pullback.fst]
[GOAL]
case e_a
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (((pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫
          (pullbackRightPullbackFstIso g (Scheme.ofRestrict Z (_ : OpenEmbedding ↑(Opens.inclusion U))) f).inv) ≫
        pullback.snd) ≫
      pullback.fst =
    (((pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫ pullback.snd) ≫
        (pullbackRestrictIsoRestrict g U).inv) ≫
      pullback.fst
[PROOFSTEP]
simp_rw [Category.assoc]
[GOAL]
case e_a
C : Type u
inst✝ : Category.{v, u} C
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
U : Opens ↑↑Z.toPresheafedSpace
⊢ (pullbackRestrictIsoRestrict (f ≫ g) U).inv ≫
      (pullbackRightPullbackFstIso g (Scheme.ofRestrict Z (_ : OpenEmbedding ↑(Opens.inclusion U))) f).inv ≫
        pullback.snd ≫ pullback.fst =
    (pullbackRestrictIsoRestrict f ((Opens.map g.val.base).obj U)).inv ≫
      pullback.snd ≫ (pullbackRestrictIsoRestrict g U).inv ≫ pullback.fst
[PROOFSTEP]
rw [pullbackRestrictIsoRestrict_inv_fst, pullbackRightPullbackFstIso_inv_snd_fst, ← pullback.condition,
  pullbackRestrictIsoRestrict_inv_fst_assoc, pullbackRestrictIsoRestrict_inv_fst_assoc]
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ IsIso (f ∣_ U)
[PROOFSTEP]
delta morphismRestrict
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
inst✝ : IsIso f
U : Opens ↑↑Y.toPresheafedSpace
⊢ IsIso ((pullbackRestrictIsoRestrict f U).inv ≫ pullback.snd)
[PROOFSTEP]
infer_instance
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
      ((Opens.map (f ∣_ U).val.base).obj V) =
    (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
        ((Opens.map (f ∣_ U).val.base).obj V)) =
    ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))
[PROOFSTEP]
ext x
[GOAL]
case h.h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
⊢ x ∈
      ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
          ((Opens.map (f ∣_ U).val.base).obj V)) ↔
    x ∈ ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))
[PROOFSTEP]
constructor
[GOAL]
case h.h.mp
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
⊢ x ∈
      ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
          ((Opens.map (f ∣_ U).val.base).obj V)) →
    x ∈ ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))
[PROOFSTEP]
rintro ⟨⟨x, hx⟩, hx' : (f ∣_ U).1.base _ ∈ V, rfl⟩
[GOAL]
case h.h.mp.intro.mk.intro
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : x ∈ (Opens.map f.val.base).obj U
hx' : ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V
⊢ ↑(Opens.inclusion ((Opens.map f.val.base).obj U)) { val := x, property := hx } ∈
    ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))
[PROOFSTEP]
refine'
  ⟨⟨_, hx⟩, _, rfl⟩
    -- Porting note : this rewrite was not necessary
[GOAL]
case h.h.mp.intro.mk.intro
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : x ∈ (Opens.map f.val.base).obj U
hx' : ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V
⊢ { val := ↑f.val.base x, property := hx } ∈ ↑V
[PROOFSTEP]
rw [SetLike.mem_coe]
[GOAL]
case h.h.mp.intro.mk.intro
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : x ∈ (Opens.map f.val.base).obj U
hx' : ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V
⊢ { val := ↑f.val.base x, property := hx } ∈ V
[PROOFSTEP]
convert hx'
[GOAL]
case h.e'_4.h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : x ∈ (Opens.map f.val.base).obj U
hx' : ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V
e_1✝ :
  (forget TopCat).obj ((Opens.toTopCat ↑Y.toPresheafedSpace).obj U) =
    (fun x =>
        (forget TopCat).obj
          ↑(Scheme.restrict Y
                    (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace)
      { val := x, property := hx }
⊢ { val := ↑f.val.base x, property := hx } = ↑(f ∣_ U).val.base { val := x, property := hx }
[PROOFSTEP]
refine Subtype.ext ?_
[GOAL]
case h.e'_4.h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : x ∈ (Opens.map f.val.base).obj U
hx' : ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V
e_1✝ :
  (forget TopCat).obj ((Opens.toTopCat ↑Y.toPresheafedSpace).obj U) =
    (fun x =>
        (forget TopCat).obj
          ↑(Scheme.restrict Y
                    (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace)
      { val := x, property := hx }
⊢ ↑{ val := ↑f.val.base x, property := hx } = ↑(↑(f ∣_ U).val.base { val := x, property := hx })
[PROOFSTEP]
exact (morphismRestrict_base_coe f U ⟨x, hx⟩).symm
[GOAL]
case h.h.mpr
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) →
    x ∈
      ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
          ((Opens.map (f ∣_ U).val.base).obj V))
[PROOFSTEP]
rintro ⟨⟨x, hx⟩, hx' : _ ∈ V.1, rfl : x = _⟩
[GOAL]
case h.h.mpr.intro.mk.intro
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : ↑f.val.base x ∈ U
hx' : { val := ↑f.val.base x, property := hx } ∈ V.carrier
⊢ x ∈
    ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
        ((Opens.map (f ∣_ U).val.base).obj V))
[PROOFSTEP]
refine' ⟨⟨_, hx⟩, (_ : (f ∣_ U).1.base ⟨x, hx⟩ ∈ V.1), rfl⟩
[GOAL]
case h.h.mpr.intro.mk.intro
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : ↑f.val.base x ∈ U
hx' : { val := ↑f.val.base x, property := hx } ∈ V.carrier
⊢ ↑(f ∣_ U).val.base { val := x, property := hx } ∈ V.carrier
[PROOFSTEP]
convert hx'
[GOAL]
case h.e'_4.h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : ↑f.val.base x ∈ U
hx' : { val := ↑f.val.base x, property := hx } ∈ V.carrier
e_1✝ :
  (fun x =>
        (forget TopCat).obj
          ↑(Scheme.restrict Y
                    (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace)
      { val := x, property := hx } =
    { x // x ∈ U }
⊢ ↑(f ∣_ U).val.base { val := x, property := hx } = { val := ↑f.val.base x, property := hx }
[PROOFSTEP]
refine Subtype.ext ?_
[GOAL]
case h.e'_4.h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
x : ↑↑X.toPresheafedSpace
hx : ↑f.val.base x ∈ U
hx' : { val := ↑f.val.base x, property := hx } ∈ V.carrier
e_1✝ :
  (fun x =>
        (forget TopCat).obj
          ↑(Scheme.restrict Y
                    (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace)
      { val := x, property := hx } =
    { x // x ∈ U }
⊢ ↑(↑(f ∣_ U).val.base { val := x, property := hx }) = ↑{ val := ↑f.val.base x, property := hx }
[PROOFSTEP]
exact morphismRestrict_base_coe f U ⟨x, hx⟩
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
have := Scheme.congr_app (morphismRestrict_ι f U) (op (U.openEmbedding.isOpenMap.functor.obj V))
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
      (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
    NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫ f).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (Scheme.restrict X
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            ((Opens.map f.val.base).obj
                              U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
        (eqToHom
          (_ :
            (Opens.map
                      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                            f).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
              (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
rw [Scheme.comp_val_c_app, Scheme.comp_val_c_app_assoc] at this
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
have e : (Opens.map U.inclusion).obj (U.openEmbedding.isOpenMap.functor.obj V) = V := by ext1;
  exact Set.preimage_image_eq _ Subtype.coe_injective
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
⊢ (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
⊢ ↑((Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) = ↑V
[PROOFSTEP]
exact Set.preimage_image_eq _ Subtype.coe_injective
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
have : _ ≫ X.presheaf.map _ = _ := (((f ∣_ U).1.c.naturality (eqToHom e).op).symm.trans ?_).trans this
[GOAL]
case refine_2
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this✝ :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
this :
  NatTrans.app (f ∣_ U).val.c (op V) ≫
      X.presheaf.map
        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
          ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op)) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
rw [← IsIso.eq_comp_inv, ← Functor.map_inv, Category.assoc] at this
[GOAL]
case refine_2
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this✝ :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
this :
  NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
            ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
          (Scheme.restrict X
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                ((Opens.map f.val.base).obj
                                  U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        X.presheaf.map
          (inv
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
              ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op)))
⊢ NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
rw [this]
[GOAL]
case refine_2
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this✝ :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
this :
  NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
            ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
          (Scheme.restrict X
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                ((Opens.map f.val.base).obj
                                  U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        X.presheaf.map
          (inv
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
              ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op)))
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
            ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
          (Scheme.restrict X
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                ((Opens.map f.val.base).obj
                                  U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        X.presheaf.map
          (inv
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
              ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
congr 1
[GOAL]
case refine_2.e_a
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this✝ :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
this :
  NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
            ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
          (Scheme.restrict X
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                ((Opens.map f.val.base).obj
                                  U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        X.presheaf.map
          (inv
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
              ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op)))
⊢ (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
      X.presheaf.map
        (inv
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
            ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op))) =
    X.presheaf.map
      (eqToHom
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                ((Opens.map (f ∣_ U).val.base).obj V) =
              (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
erw [← X.presheaf.map_comp, ← X.presheaf.map_comp]
[GOAL]
case refine_2.e_a
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this✝ :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
this :
  NatTrans.app (f ∣_ U).val.c (op V) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      (NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
            ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
          (Scheme.restrict X
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                ((Opens.map f.val.base).obj
                                  U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        X.presheaf.map
          (inv
            ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
              ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op)))
⊢ X.presheaf.map
      (((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).counit
              ((Opens.map f.val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).unop).op ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
            (eqToHom
              (_ :
                (Opens.map
                          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                                f).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                  (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                    (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))) ≫
        inv
          ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).op.map
            ((Opens.map (f ∣_ U).val.base).op.map (eqToHom e).op))) =
    X.presheaf.map
      (eqToHom
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                ((Opens.map (f ∣_ U).val.base).obj V) =
              (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))).op
[PROOFSTEP]
congr 1
[GOAL]
case refine_1
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
⊢ (Scheme.restrict Y
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
        (eqToHom e).op ≫
      NatTrans.app (f ∣_ U).val.c
        (op ((Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)))
[PROOFSTEP]
change Y.presheaf.map _ ≫ _ = Y.presheaf.map _ ≫ _
[GOAL]
case refine_1
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
this :
  NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c
        (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).val.c
          ((Opens.map f.val.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) ≫
        (Scheme.restrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              ((Opens.map f.val.base).obj
                                U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
          (eqToHom
            (_ :
              (Opens.map
                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) ≫
                              f).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) =
                (Opens.map ((f ∣_ U) ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
                  (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))))
e : (Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V) = V
⊢ Y.presheaf.map ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).op.map (eqToHom e).op) ≫
      NatTrans.app (f ∣_ U).val.c
        (op ((Opens.map (Opens.inclusion U)).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) =
    Y.presheaf.map
        (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
            (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)).unop).op ≫
      NatTrans.app (f ∣_ U).val.c
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).op.obj
          (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)))
[PROOFSTEP]
congr 1
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ Scheme.Γ.map (f ∣_ U).op =
    Y.presheaf.map (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)).op ≫
      NatTrans.app f.val.c (op U) ≫
        X.presheaf.map
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj ⊤ =
                  (Opens.map f.val.base).obj U)).op
[PROOFSTEP]
rw [Scheme.Γ_map_op, morphismRestrict_c_app f U ⊤, f.val.c.naturality_assoc]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj ⊤) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤))).op =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)) ≫
      (f.val.base _* X.presheaf).map
          (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)).op ≫
        X.presheaf.map
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj ⊤ =
                  (Opens.map f.val.base).obj U)).op
[PROOFSTEP]
erw [← X.presheaf.map_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj ⊤) =
                (Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤))).op =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)) ≫
      X.presheaf.map
        ((Opens.map f.val.base).op.map
            (eqToHom (_ : U = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)).op ≫
          (eqToHom
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj ⊤ =
                  (Opens.map f.val.base).obj U)).op)
[PROOFSTEP]
congr
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
⊢ Arrow.mk (f ∣_ Scheme.Hom.opensRange g) ≅ Arrow.mk pullback.snd
[PROOFSTEP]
let V : Opens Y := Scheme.Hom.opensRange g
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
⊢ Arrow.mk (f ∣_ Scheme.Hom.opensRange g) ≅ Arrow.mk pullback.snd
[PROOFSTEP]
let e := IsOpenImmersion.isoOfRangeEq g (Y.ofRestrict V.openEmbedding) Subtype.range_coe.symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
⊢ Arrow.mk (f ∣_ Scheme.Hom.opensRange g) ≅ Arrow.mk pullback.snd
[PROOFSTEP]
let t : pullback f g ⟶ pullback f (Y.ofRestrict V.openEmbedding) :=
  pullback.map _ _ _ _ (𝟙 _) e.hom (𝟙 _) (by rw [Category.comp_id, Category.id_comp])
    (by rw [Category.comp_id, IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac])
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
⊢ f ≫ 𝟙 Y = 𝟙 X ≫ f
[PROOFSTEP]
rw [Category.comp_id, Category.id_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
⊢ g ≫ 𝟙 Y = e.hom ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))
[PROOFSTEP]
rw [Category.comp_id, IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
t : pullback f g ⟶ pullback f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) :=
  pullback.map f g f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) (𝟙 X) e.hom (𝟙 Y)
    (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f) (_ : g ≫ 𝟙 Y = e.hom ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
⊢ Arrow.mk (f ∣_ Scheme.Hom.opensRange g) ≅ Arrow.mk pullback.snd
[PROOFSTEP]
symm
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
t : pullback f g ⟶ pullback f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) :=
  pullback.map f g f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) (𝟙 X) e.hom (𝟙 Y)
    (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f) (_ : g ≫ 𝟙 Y = e.hom ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
⊢ Arrow.mk pullback.snd ≅ Arrow.mk (f ∣_ Scheme.Hom.opensRange g)
[PROOFSTEP]
refine' Arrow.isoMk (asIso t ≪≫ pullbackRestrictIsoRestrict f V) e _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y U : Scheme
f : X ⟶ Y
g : U ⟶ Y
hg : IsOpenImmersion g
V : Opens ↑↑Y.toPresheafedSpace := Scheme.Hom.opensRange g
e : U ≅ Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)) :=
  IsOpenImmersion.isoOfRangeEq g (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
    (_ : Set.range ↑g.val.base = Set.range Subtype.val)
t : pullback f g ⟶ pullback f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) :=
  pullback.map f g f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V))) (𝟙 X) e.hom (𝟙 Y)
    (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f) (_ : g ≫ 𝟙 Y = e.hom ≫ Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion V)))
⊢ (asIso t ≪≫ pullbackRestrictIsoRestrict f V).hom ≫ (Arrow.mk (f ∣_ Scheme.Hom.opensRange g)).hom =
    (Arrow.mk pullback.snd).hom ≫ e.hom
[PROOFSTEP]
rw [Iso.trans_hom, asIso_hom, ← Iso.comp_inv_eq, ← cancel_mono g, Arrow.mk_hom, Arrow.mk_hom,
  IsOpenImmersion.isoOfRangeEq_inv, Category.assoc, Category.assoc, Category.assoc, IsOpenImmersion.lift_fac, ←
  pullback.condition, morphismRestrict_ι, pullbackRestrictIsoRestrict_hom_restrict_assoc, pullback.lift_fst_assoc,
  Category.comp_id]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U V : Opens ↑↑Y.toPresheafedSpace
e : U = V
⊢ Arrow.mk (f ∣_ U) = Arrow.mk (f ∣_ V)
[PROOFSTEP]
subst e
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
⊢ Arrow.mk (f ∣_ U) = Arrow.mk (f ∣_ U)
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
set g := ((Y.restrict U.openEmbedding).ofRestrict (V.openEmbedding (X := TopCat.of U)) ≫ Y.ofRestrict U.openEmbedding)
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
have i1 : IsOpenImmersion g := PresheafedSpace.IsOpenImmersion.comp _ _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
have i2 : HasPullback f g := IsOpenImmersion.hasPullback_of_right g f
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
set h : _ ⟶ pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry _ _).hom ≫
      pullback.map _ _ _ _ (𝟙 _) ((pullbackRestrictIsoRestrict f U).inv ≫ (pullbackSymmetry _ _).hom) (𝟙 _)
          ((Category.comp_id _).trans (Category.id_comp _).symm) (by aesop_cat) ≫
        (pullbackRightPullbackFstIso _ _ _).hom ≫ (pullbackSymmetry _ _).hom
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
⊢ (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
    ((pullbackRestrictIsoRestrict f U).inv ≫
        (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
      pullback.fst
[PROOFSTEP]
aesop_cat
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
have i3 : IsIso h
[GOAL]
case i3
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
⊢ IsIso h
[PROOFSTEP]
repeat apply (config := { allowSynthFailures := true }) IsIso.comp_isIso
[GOAL]
case i3
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
⊢ IsIso h
[PROOFSTEP]
apply (config := { allowSynthFailures := true }) IsIso.comp_isIso
[GOAL]
case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
⊢ IsIso
    ((pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom)
[PROOFSTEP]
apply (config := { allowSynthFailures := true }) IsIso.comp_isIso
[GOAL]
case inst
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
⊢ IsIso
    (pullback.map
        (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
          (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (f ∣_ U)
        (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
          (_ : OpenEmbedding ↑(Opens.inclusion V)))
        pullback.fst
        (𝟙
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V))))
        ((pullbackRestrictIsoRestrict f U).inv ≫
          (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
        (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
        (_ :
          Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
              𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
            𝟙
                (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
              Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))
        (_ :
          (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
            ((pullbackRestrictIsoRestrict f U).inv ≫
                (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
              pullback.fst) ≫
      (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
            (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
        (pullbackSymmetry
            (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
              Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            f).hom)
[PROOFSTEP]
apply (config := { allowSynthFailures := true }) IsIso.comp_isIso
[GOAL]

[PROOFSTEP]
apply (config := { allowSynthFailures := true }) IsIso.comp_isIso
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
have : (f ∣_ U ∣_ V) ≫ (Iso.refl _).hom = (asIso h).hom ≫ pullback.snd (f := f) (g := g)
[GOAL]
case this
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
⊢ (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
[PROOFSTEP]
simp only [Category.comp_id, pullbackRightPullbackFstIso_hom_fst, Iso.refl_hom, Category.assoc,
  pullbackSymmetry_hom_comp_snd, asIso_hom, pullback.lift_fst, pullbackSymmetry_hom_comp_fst]
[GOAL]
case this
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
⊢ f ∣_ U ∣_ V = (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫ pullback.snd
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ Arrow.mk (f ∣_ U ∣_ V) ≅ Arrow.mk (f ∣_ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
refine' Arrow.isoMk' _ _ _ _ this.symm ≪≫ (morphismRestrictOpensRange _ _).symm ≪≫ morphismRestrictEq _ _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ Scheme.Hom.opensRange g = (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ ↑(Scheme.Hom.opensRange g) = ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)
[PROOFSTEP]
dsimp
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ Set.range ↑(Opens.inclusion V ≫ Opens.inclusion U) = ↑(Opens.inclusion U) '' ↑V
[PROOFSTEP]
rw [coe_comp, Set.range_comp]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ ↑(Opens.inclusion U) '' Set.range ↑(Opens.inclusion V) = ↑(Opens.inclusion U) '' ↑V
[PROOFSTEP]
apply congr_arg (U.inclusion '' ·)
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
V : Opens { x // x ∈ U }
g : Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
    (_ : OpenEmbedding ↑(Opens.inclusion V)) ⟶
  Y :=
  Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
    Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))
i1 : IsOpenImmersion g
i2 : HasPullback f g
h : Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))))
    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map (f ∣_ U).val.base).obj V))) ⟶
  pullback f g :=
  (pullbackRestrictIsoRestrict (f ∣_ U) V).inv ≫
    (pullbackSymmetry (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
      pullback.map
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (f ∣_ U)
          (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))
          pullback.fst
          (𝟙
            (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              (_ : OpenEmbedding ↑(Opens.inclusion V))))
          ((pullbackRestrictIsoRestrict f U).inv ≫
            (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom)
          (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))))
          (_ :
            Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              𝟙
                  (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                    (_ : OpenEmbedding ↑(Opens.inclusion V))) ≫
                Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)))
          (_ :
            (f ∣_ U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) =
              ((pullbackRestrictIsoRestrict f U).inv ≫
                  (pullbackSymmetry f (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))).hom) ≫
                pullback.fst) ≫
        (pullbackRightPullbackFstIso (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))) f
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom ≫
          (pullbackSymmetry
              (Scheme.ofRestrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
                  (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
                Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
              f).hom
i3 : IsIso h
this :
  (f ∣_ U ∣_ V) ≫
      (Iso.refl
          (Scheme.restrict (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
            (_ : OpenEmbedding ↑(Opens.inclusion V)))).hom =
    (asIso h).hom ≫ pullback.snd
⊢ Set.range ↑(Opens.inclusion V) = ↑V
[PROOFSTEP]
exact Subtype.range_val
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
⊢ Arrow.mk
      (f ∣_ U ∣_
        Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
          (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op) r)) ≅
    Arrow.mk (f ∣_ Scheme.basicOpen Y r)
[PROOFSTEP]
refine' morphismRestrictRestrict _ _ _ ≪≫ morphismRestrictEq _ _
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op) r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
have e := Scheme.preimage_basicOpen (Y.ofRestrict U.openEmbedding) r
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c (op U)) r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op) r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
erw [Scheme.ofRestrict_val_c_app, Opens.adjunction_counit_app_self, eqToHom_op] at e
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op) r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
rw [← (Y.restrict U.openEmbedding).basicOpen_res_eq _ (eqToHom U.inclusion_map_eq_top).op]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑((Scheme.restrict Y
                          (_ :
                            OpenEmbedding
                              ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
              (eqToHom (_ : (Opens.map (Opens.inclusion U)).obj U = ⊤)).op)
          (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op)
            r))) =
    Scheme.basicOpen Y r
[PROOFSTEP]
erw [← comp_apply]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op ≫
              (Scheme.restrict Y
                            (_ :
                              OpenEmbedding
                                ↑(Opens.inclusion
                                    U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.map
                (eqToHom (_ : (Opens.map (Opens.inclusion U)).obj U = ⊤)).op)
          r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
erw [← Y.presheaf.map_comp]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map
              ((eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ = U)).op ≫
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).op.map
                  (eqToHom (_ : (Opens.map (Opens.inclusion U)).obj U = ⊤)).op))
          r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
rw [eqToHom_op, eqToHom_op, eqToHom_map, eqToHom_trans]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      (Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
        (↑(Y.presheaf.map
              (eqToHom
                (_ :
                  op U =
                    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).op.obj
                      (op ((Opens.map (Opens.inclusion U)).obj U)))))
          r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
erw [← e]
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
      ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r)) =
    Scheme.basicOpen Y r
[PROOFSTEP]
ext1
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
        ((Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj
          (Scheme.basicOpen Y r))) =
    ↑(Scheme.basicOpen Y r)
[PROOFSTEP]
dsimp [Opens.map, Opens.inclusion]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ ↑(ContinuousMap.mk Subtype.val) '' (↑(ContinuousMap.mk Subtype.val) ⁻¹' ↑(Scheme.basicOpen Y r)) =
    ↑(Scheme.basicOpen Y r)
[PROOFSTEP]
rw [Set.image_preimage_eq_inter_range, Set.inter_eq_left_iff_subset, ContinuousMap.coe_mk, Subtype.range_val]
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
r : ↑(Y.presheaf.obj (op U))
e :
  (Opens.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).val.base).obj (Scheme.basicOpen Y r) =
    Scheme.basicOpen (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U)))
      (↑(Y.presheaf.map
            (eqToHom
              (_ :
                op (op U).unop =
                  op
                    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj
                      ((Opens.map (Opens.inclusion U)).obj (op U).unop)))))
        r)
⊢ ↑(Scheme.basicOpen Y r) ⊆ ↑U
[PROOFSTEP]
exact Y.basicOpen_le r
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ Arrow.mk (PresheafedSpace.stalkMap (f ∣_ U).val x) ≅ Arrow.mk (PresheafedSpace.stalkMap f.val ↑x)
[PROOFSTEP]
fapply Arrow.isoMk'
[GOAL]
case e₁
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ PresheafedSpace.stalk
      (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
      (↑(f ∣_ U).val.base x) ≅
    PresheafedSpace.stalk Y.toPresheafedSpace (↑f.val.base ↑x)
[PROOFSTEP]
refine' Y.restrictStalkIso U.openEmbedding ((f ∣_ U).1.1 x) ≪≫ TopCat.Presheaf.stalkCongr _ _
[GOAL]
case e₁
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ Inseparable (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) (↑f.val.base ↑x)
[PROOFSTEP]
apply Inseparable.of_eq
[GOAL]
case e₁.e
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ ↑(Opens.inclusion U) (↑(f ∣_ U).val.base x) = ↑f.val.base ↑x
[PROOFSTEP]
exact morphismRestrict_base_coe f U x
[GOAL]
case e₂
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ PresheafedSpace.stalk
      (Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
      x ≅
    PresheafedSpace.stalk X.toPresheafedSpace ↑x
[PROOFSTEP]
exact X.restrictStalkIso (Opens.openEmbedding _) _
[GOAL]
case h
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ autoParam
    ((PresheafedSpace.restrictStalkIso Y.toPresheafedSpace (_ : OpenEmbedding ↑(Opens.inclusion U))
              (↑(f ∣_ U).val.base x) ≪≫
            TopCat.Presheaf.stalkCongr Y.presheaf
              (_ : Inseparable (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) (↑f.val.base ↑x))).hom ≫
        PresheafedSpace.stalkMap f.val ↑x =
      PresheafedSpace.stalkMap (f ∣_ U).val x ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom)
    _auto✝
[PROOFSTEP]
apply TopCat.Presheaf.stalk_hom_ext
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
⊢ ∀
    (U_1 :
      Opens
        ↑↑(Scheme.restrict Y
                    (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace)
    (hxU : ↑(f ∣_ U).val.base x ∈ U_1),
    TopCat.Presheaf.germ
          (Scheme.restrict Y
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := ↑(f ∣_ U).val.base x, property := hxU } ≫
        (PresheafedSpace.restrictStalkIso Y.toPresheafedSpace (_ : OpenEmbedding ↑(Opens.inclusion U))
                (↑(f ∣_ U).val.base x) ≪≫
              TopCat.Presheaf.stalkCongr Y.presheaf
                (_ : Inseparable (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) (↑f.val.base ↑x))).hom ≫
          PresheafedSpace.stalkMap f.val ↑x =
      TopCat.Presheaf.germ
          (Scheme.restrict Y
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := ↑(f ∣_ U).val.base x, property := hxU } ≫
        PresheafedSpace.stalkMap (f ∣_ U).val x ≫
          (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
intro V hxV
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ TopCat.Presheaf.germ
        (Scheme.restrict Y
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
        { val := ↑(f ∣_ U).val.base x, property := hxV } ≫
      (PresheafedSpace.restrictStalkIso Y.toPresheafedSpace (_ : OpenEmbedding ↑(Opens.inclusion U))
              (↑(f ∣_ U).val.base x) ≪≫
            TopCat.Presheaf.stalkCongr Y.presheaf
              (_ : Inseparable (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) (↑f.val.base ↑x))).hom ≫
        PresheafedSpace.stalkMap f.val ↑x =
    TopCat.Presheaf.germ
        (Scheme.restrict Y
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
        { val := ↑(f ∣_ U).val.base x, property := hxV } ≫
      PresheafedSpace.stalkMap (f ∣_ U).val x ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
simp only [TopCat.Presheaf.stalkCongr_hom, CategoryTheory.Category.assoc, CategoryTheory.Iso.trans_hom]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ TopCat.Presheaf.germ
        (Scheme.restrict Y
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
        { val := ↑(f ∣_ U).val.base x, property := hxV } ≫
      (PresheafedSpace.restrictStalkIso Y.toPresheafedSpace (_ : OpenEmbedding ↑(Opens.inclusion U))
            (↑(f ∣_ U).val.base x)).hom ≫
        TopCat.Presheaf.stalkSpecializes Y.presheaf
            (_ : nhds (↑f.val.base ↑x) ≤ nhds (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x))) ≫
          PresheafedSpace.stalkMap f.val ↑x =
    TopCat.Presheaf.germ
        (Scheme.restrict Y
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
        { val := ↑(f ∣_ U).val.base x, property := hxV } ≫
      PresheafedSpace.stalkMap (f ∣_ U).val x ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
erw [PresheafedSpace.restrictStalkIso_hom_eq_germ_assoc]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ TopCat.Presheaf.germ Y.presheaf
        { val := ↑(Opens.inclusion U) (↑(f ∣_ U).val.base x),
          property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) } ≫
      TopCat.Presheaf.stalkSpecializes Y.presheaf
          (_ : nhds (↑f.val.base ↑x) ≤ nhds (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x))) ≫
        PresheafedSpace.stalkMap f.val ↑x =
    TopCat.Presheaf.germ
        (Scheme.restrict Y
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
        { val := ↑(f ∣_ U).val.base x, property := hxV } ≫
      PresheafedSpace.stalkMap (f ∣_ U).val x ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
erw [PresheafedSpace.stalkMap_germ_assoc _ V ⟨_, hxV⟩]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ TopCat.Presheaf.germ Y.presheaf
        { val := ↑(Opens.inclusion U) (↑(f ∣_ U).val.base x),
          property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑(Opens.inclusion U) (↑(f ∣_ U).val.base x)) } ≫
      TopCat.Presheaf.stalkSpecializes Y.presheaf
          (_ : nhds (↑f.val.base ↑x) ≤ nhds (↑(Opens.inclusion U) (↑(f ∣_ U).val.base x))) ≫
        PresheafedSpace.stalkMap f.val ↑x =
    NatTrans.app (f ∣_ U).val.c (op V) ≫
      TopCat.Presheaf.germ
          (Scheme.restrict X
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            ((Opens.map f.val.base).obj
                              U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := x, property := hxV } ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
rw [TopCat.Presheaf.germ_stalk_specializes'_assoc]
  -- Porting note : explicit variables and proofs were not necessary
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ TopCat.Presheaf.germ Y.presheaf
        { val := ↑f.val.base ↑x,
          property := (_ : ↑f.val.base ↑x ∈ ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) } ≫
      PresheafedSpace.stalkMap f.val ↑x =
    NatTrans.app (f ∣_ U).val.c (op V) ≫
      TopCat.Presheaf.germ
          (Scheme.restrict X
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            ((Opens.map f.val.base).obj
                              U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := x, property := hxV } ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
erw [PresheafedSpace.stalkMap_germ _ (U.openEmbedding.isOpenMap.functor.obj V) ⟨x.1, ⟨⟨f.1.base x.1, x.2⟩, _, rfl⟩⟩]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      TopCat.Presheaf.germ X.presheaf
        { val := ↑x, property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑f.val.base ↑x) } =
    NatTrans.app (f ∣_ U).val.c (op V) ≫
      TopCat.Presheaf.germ
          (Scheme.restrict X
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            ((Opens.map f.val.base).obj
                              U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := x, property := hxV } ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ { val := ↑f.val.base ↑x, property := (_ : ↑x ∈ (Opens.map f.val.base).obj U) } ∈ ↑V
[PROOFSTEP]
swap
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ { val := ↑f.val.base ↑x, property := (_ : ↑x ∈ (Opens.map f.val.base).obj U) } ∈ ↑V
[PROOFSTEP]
rw [morphismRestrict_val_base] at hxV
[GOAL]
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : Set.restrictPreimage U.carrier (↑f.val.base) x ∈ V
⊢ { val := ↑f.val.base ↑x, property := (_ : ↑x ∈ (Opens.map f.val.base).obj U) } ∈ ↑V
[PROOFSTEP]
exact hxV
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      TopCat.Presheaf.germ X.presheaf
        { val := ↑x, property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑f.val.base ↑x) } =
    NatTrans.app (f ∣_ U).val.c (op V) ≫
      TopCat.Presheaf.germ
          (Scheme.restrict X
                    (_ :
                      OpenEmbedding
                        ↑(Opens.inclusion
                            ((Opens.map f.val.base).obj
                              U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf
          { val := x, property := hxV } ≫
        (PresheafedSpace.restrictStalkIso X.toPresheafedSpace
            (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj U))) x).hom
[PROOFSTEP]
erw [PresheafedSpace.restrictStalkIso_hom_eq_germ]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      TopCat.Presheaf.germ X.presheaf
        { val := ↑x, property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑f.val.base ↑x) } =
    NatTrans.app (f ∣_ U).val.c (op V) ≫
      TopCat.Presheaf.germ X.presheaf
        { val := ↑(Opens.inclusion ((Opens.map f.val.base).obj U)) x,
          property :=
            (_ :
              ↑(Opens.inclusion ((Opens.map f.val.base).obj U)) x ∈
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                  ((Opens.map (f ∣_ U).val.base).obj V)) }
[PROOFSTEP]
rw [morphismRestrict_c_app, Category.assoc, TopCat.Presheaf.germ_res]
[GOAL]
case h.ih
C : Type u
inst✝ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
x :
  ↑↑(Scheme.restrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map f.val.base).obj U)))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
V :
  Opens
    ↑↑(Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion U))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
hxV : ↑(f ∣_ U).val.base x ∈ V
⊢ NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      TopCat.Presheaf.germ X.presheaf
        { val := ↑x, property := (_ : ∃ a, a ∈ ↑V ∧ ↑(Opens.inclusion U) a = ↑f.val.base ↑x) } =
    NatTrans.app f.val.c (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V)) ≫
      TopCat.Presheaf.germ X.presheaf
        ((fun x =>
            { val := ↑x,
              property :=
                (_ :
                  ↑x ∈
                    ↑((Opens.map f.val.base).obj ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj V))) })
          { val := ↑(Opens.inclusion ((Opens.map f.val.base).obj U)) x,
            property :=
              (_ :
                ↑(Opens.inclusion ((Opens.map f.val.base).obj U)) x ∈
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj U)))).obj
                    ((Opens.map (f ∣_ U).val.base).obj V)) })
[PROOFSTEP]
rfl
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
inst✝ : IsOpenImmersion f
⊢ IsOpenImmersion (f ∣_ U)
[PROOFSTEP]
delta morphismRestrict
[GOAL]
C : Type u
inst✝¹ : Category.{v, u} C
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
inst✝ : IsOpenImmersion f
⊢ IsOpenImmersion ((pullbackRestrictIsoRestrict f U).inv ≫ pullback.snd)
[PROOFSTEP]
refine PresheafedSpace.IsOpenImmersion.comp _ _