[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ P (Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op) ↔
    P
      (IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
        (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))) (Scheme.Γ.map f.op) r)
[PROOFSTEP]
rw [Γ_map_morphismRestrict, hP.cancel_left_isIso, hP.cancel_right_isIso, ←
  hP.cancel_right_isIso (f.val.c.app (Opposite.op (Y.basicOpen r)))
    (X.presheaf.map (eqToHom (Scheme.preimage_basicOpen f r).symm).op),
  ← eq_iff_iff]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ P
      (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫
        X.presheaf.map
          (eqToHom
              (_ :
                Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) =
                  (Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op) =
    P
      (IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
        (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))) (Scheme.Γ.map f.op) r)
[PROOFSTEP]
congr
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) =
                (Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op =
    IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
      (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))) (Scheme.Γ.map f.op) r
[PROOFSTEP]
delta IsLocalization.Away.map
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫
      X.presheaf.map
        (eqToHom
            (_ :
              Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) =
                (Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op =
    IsLocalization.map (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
      (Scheme.Γ.map f.op)
      (_ : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r)))
[PROOFSTEP]
refine' IsLocalization.ringHom_ext (Submonoid.powers r) _
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ comp
      (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫
        X.presheaf.map
          (eqToHom
              (_ :
                Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) =
                  (Opens.map f.val.base).obj (Scheme.basicOpen Y r))).op)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
    comp
      (IsLocalization.map (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
        (Scheme.Γ.map f.op)
        (_ : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))))
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
generalize_proofs h1 h2 h3
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
⊢ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫ X.presheaf.map (eqToHom h1).op)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
    comp
      (IsLocalization.map (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
        (Scheme.Γ.map f.op) h3)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
haveI i1 :=
  @isLocalization_away_of_isAffine X _
    (Scheme.Γ.map f.op r)
      -- Porting note : needs to be very explicit here
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
i1 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
⊢ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫ X.presheaf.map (eqToHom h1).op)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
    comp
      (IsLocalization.map (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
        (Scheme.Γ.map f.op) h3)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
[PROOFSTEP]
convert
  (@IsLocalization.map_comp (hy := h3) (Y.presheaf.obj <| Opposite.op (Scheme.basicOpen Y r)) _ _
      (isLocalization_away_of_isAffine _) _ _ _ i1).symm using
  1
[GOAL]
case h.e'_2.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
i1 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
e_1✝ :
  (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r))))) =
    (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
⊢ comp (NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫ X.presheaf.map (eqToHom h1).op)
      (algebraMap ↑(Y.presheaf.obj (Opposite.op ⊤)) ↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r)))) =
    comp
      (algebraMap ((fun x => ↑(X.presheaf.obj (Opposite.op ⊤))) r)
        ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
      (Scheme.Γ.map f.op)
[PROOFSTEP]
change Y.presheaf.map _ ≫ _ = _ ≫ X.presheaf.map _
[GOAL]
case h.e'_2.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
i1 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
e_1✝ :
  (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r))))) =
    (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
⊢ Y.presheaf.map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r ≤ ⊤)).op ≫
      NatTrans.app f.val.c (Opposite.op (Scheme.basicOpen Y r)) ≫ X.presheaf.map (eqToHom h1).op =
    Scheme.Γ.map f.op ≫
      X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (↑(Scheme.Γ.map f.op) r) ≤ ⊤)).op
[PROOFSTEP]
rw [f.val.c.naturality_assoc]
[GOAL]
case h.e'_2.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
i1 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
e_1✝ :
  (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r))))) =
    (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
⊢ NatTrans.app f.val.c (Opposite.op ⊤) ≫
      (f.val.base _* X.presheaf).map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r ≤ ⊤)).op ≫
        X.presheaf.map (eqToHom h1).op =
    Scheme.Γ.map f.op ≫
      X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (↑(Scheme.Γ.map f.op) r) ≤ ⊤)).op
[PROOFSTEP]
erw [← X.presheaf.map_comp]
[GOAL]
case h.e'_2.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
h1 : Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r) = (Opens.map f.val.base).obj (Scheme.basicOpen Y r)
h2 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
h3 : Submonoid.powers r ≤ Submonoid.comap (Scheme.Γ.map f.op) (Submonoid.powers (↑(Scheme.Γ.map f.op) r))
i1 :
  IsLocalization.Away (↑(Scheme.Γ.map f.op) r)
    ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))
e_1✝ :
  (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r))))) =
    (↑(Y.presheaf.obj (Opposite.op ⊤)) →+*
      ↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)))))
⊢ NatTrans.app f.val.c (Opposite.op ⊤) ≫
      X.presheaf.map
        ((Opens.map f.val.base).op.map (homOfLE (_ : RingedSpace.basicOpen Y.toSheafedSpace r ≤ ⊤)).op ≫
          (eqToHom h1).op) =
    Scheme.Γ.map f.op ≫
      X.presheaf.map (homOfLE (_ : RingedSpace.basicOpen X.toSheafedSpace (↑(Scheme.Γ.map f.op) r) ≤ ⊤)).op
[PROOFSTEP]
congr 1
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ P (Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op) ↔ P (Localization.awayMap (Scheme.Γ.map f.op) r)
[PROOFSTEP]
refine
  (hP.basicOpen_iff _ _).trans
    ?_
      -- Porting note : was a one line term mode proof, but this `dsimp` is vital so the term mode
        -- one liner is not possible
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ P
      (IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
        (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r))))) (Scheme.Γ.map f.op) r) ↔
    P (Localization.awayMap (Scheme.Γ.map f.op) r)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝¹ : IsAffine X
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
⊢ P
      (IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Scheme.basicOpen Y r))))
        (↑(X.presheaf.obj (Opposite.op (Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r)))))
        (NatTrans.app f.val.c (Opposite.op ⊤)) r) ↔
    P (Localization.awayMap (NatTrans.app f.val.c (Opposite.op ⊤)) r)
[PROOFSTEP]
rw [← hP.is_localization_away_iff]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
V :
  Opens
    ↑↑(Scheme.restrict X
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        ((Opens.map f.val.base).obj
                          (Scheme.basicOpen Y r))))).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace
e :
  V =
    (Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
      U
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ : OpenEmbedding ↑(Opens.inclusion V)) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
subst e
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
letI a1 :
  Algebra (Scheme.Γ.obj (Opposite.op Y)) (Scheme.Γ.obj (Opposite.op (Y.restrict (Y.basicOpen r).openEmbedding))) :=
  ΓRestrictAlgebra _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
let U' :=
  ((Opens.map (X.ofRestrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).val.base).obj U).openEmbedding
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
letI a2 :
  Algebra (Scheme.Γ.obj (Opposite.op (X.restrict U.openEmbedding)))
    (Scheme.Γ.obj <|
      Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U') :=
  by
  apply RingHom.toAlgebra
  refine X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) ?_).op
  rw [← SetLike.coe_subset_coe, Functor.op_obj]
  dsimp [Opens.inclusion]
  simp only [Set.image_univ, Set.image_subset_iff, Subtype.range_val]
  rw [ContinuousMap.coe_mk, Subtype.range_val, ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val]
  rfl
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
[PROOFSTEP]
apply RingHom.toAlgebra
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U))))) →+*
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
[PROOFSTEP]
refine X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) ?_).op
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
      ((IsOpenMap.functor
                (_ :
                  IsOpenMap
                    ↑(Opens.inclusion
                        ((Opens.map
                              (Scheme.ofRestrict X
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                          U)))).op.obj
          (Opposite.op ⊤)).unop ≤
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop
[PROOFSTEP]
rw [← SetLike.coe_subset_coe, Functor.op_obj]
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
        (Opposite.op
            ((IsOpenMap.functor
                  (_ :
                    IsOpenMap
                      ↑(Opens.inclusion
                          ((Opens.map
                                (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion
                                              ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                            U)))).obj
              (Opposite.op ⊤).unop)).unop) ⊆
    ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)
[PROOFSTEP]
dsimp [Opens.inclusion]
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ ↑(ContinuousMap.mk Subtype.val) '' (↑(ContinuousMap.mk Subtype.val) '' Set.univ) ⊆
    ↑(ContinuousMap.mk Subtype.val) '' Set.univ
[PROOFSTEP]
simp only [Set.image_univ, Set.image_subset_iff, Subtype.range_val]
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ Set.range ↑(ContinuousMap.mk Subtype.val) ⊆
    ↑(ContinuousMap.mk Subtype.val) ⁻¹' Set.range ↑(ContinuousMap.mk Subtype.val)
[PROOFSTEP]
rw [ContinuousMap.coe_mk, Subtype.range_val, ContinuousMap.coe_mk, ContinuousMap.coe_mk, Subtype.range_val]
[GOAL]
case i
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
⊢ ↑((Opens.map (ContinuousMap.mk Subtype.val)).obj U) ⊆ Subtype.val ⁻¹' ↑U
[PROOFSTEP]
rfl
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
have i1 := AlgebraicGeometry.Γ_restrict_isLocalization Y r
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
have i2 :
  IsLocalization.Away ((Scheme.Γ.map (X.ofRestrict U.openEmbedding ≫ f).op) r)
    (Scheme.Γ.obj <|
      Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U') :=
  by
  rw [← U.openEmbedding_obj_top] at hU 
  dsimp [Scheme.Γ_obj_op, Scheme.Γ_map_op, Scheme.restrict]
  apply AlgebraicGeometry.isLocalization_of_eq_basicOpen _ hU
  rw [Opens.openEmbedding_obj_top, Opens.functor_obj_map_obj]
  convert (X.basicOpen_res (Scheme.Γ.map f.op r) (homOfLE le_top).op).symm using 1
  rw [Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top, inf_comm, Scheme.Γ_map_op]
    -- Porting note : changed `rw` to `erw`
  erw [← Scheme.preimage_basicOpen]
    -- Porting note : have to add many explicit variables
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
[PROOFSTEP]
rw [← U.openEmbedding_obj_top] at hU 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
[PROOFSTEP]
dsimp [Scheme.Γ_obj_op, Scheme.Γ_map_op, Scheme.restrict]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ IsLocalization.Away
    (↑(NatTrans.app f.val.c (Opposite.op ⊤) ≫
          X.presheaf.map
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                ((Opens.map f.val.base).obj ⊤)).op)
      r)
    ↑(X.presheaf.obj
        (Opposite.op
          ((IsOpenMap.functor
                (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
            ((IsOpenMap.functor
                  (_ :
                    IsOpenMap
                      ↑(Opens.inclusion
                          ((Opens.map (Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).obj
                            U)))).obj
              ⊤))))
[PROOFSTEP]
apply AlgebraicGeometry.isLocalization_of_eq_basicOpen _ hU
[GOAL]
case e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
      ((IsOpenMap.functor
            (_ :
              IsOpenMap
                ↑(Opens.inclusion
                    ((Opens.map (Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).obj U)))).obj
        ⊤) =
    Scheme.basicOpen X
      (↑(NatTrans.app f.val.c (Opposite.op ⊤) ≫
            X.presheaf.map
              (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((Opens.map f.val.base).obj ⊤)).op)
        r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top, Opens.functor_obj_map_obj]
[GOAL]
case e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj ⊤ ⊓ U =
    Scheme.basicOpen X
      (↑(NatTrans.app f.val.c (Opposite.op ⊤) ≫
            X.presheaf.map
              (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit
                  ((Opens.map f.val.base).obj ⊤)).op)
        r)
[PROOFSTEP]
convert (X.basicOpen_res (Scheme.Γ.map f.op r) (homOfLE le_top).op).symm using 1
[GOAL]
case h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj ⊤ ⊓ U =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤ ⊓ Scheme.basicOpen X (↑(Scheme.Γ.map f.op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top, inf_comm, Scheme.Γ_map_op]
  -- Porting note : changed `rw` to `erw`
[GOAL]
case h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj ⊤)
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
⊢ U ⊓ (Opens.map f.val.base).obj (Scheme.basicOpen Y r) =
    U ⊓ Scheme.basicOpen X (↑(NatTrans.app f.val.c (Opposite.op ⊤)) r)
[PROOFSTEP]
erw [← Scheme.preimage_basicOpen]
  -- Porting note : have to add many explicit variables
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
have :=
  @RespectsIso.is_localization_away_iff (hP := hP) (R := Scheme.Γ.obj <| Opposite.op Y) (S :=
    Scheme.Γ.obj (Opposite.op (X.restrict U.openEmbedding))) (R' :=
    Scheme.Γ.obj (Opposite.op (Y.restrict (Y.basicOpen r).openEmbedding))) (S' :=
    Scheme.Γ.obj <| Opposite.op <| (X.restrict ((Opens.map f.val.base).obj (Y.basicOpen r)).openEmbedding).restrict U')
    _ _ _ _ _ _ (Scheme.Γ.map (X.ofRestrict U.openEmbedding ≫ f).op) r
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) ↔
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
rw [this, iff_iff_eq]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ P
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op) =
    P
      (IsLocalization.Away.map
        (↑(Scheme.Γ.obj
            (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
        (↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U'))))
        (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
[PROOFSTEP]
congr 1
[GOAL]
case e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ((Opens.map
                          (Scheme.ofRestrict X
                                (_ :
                                  OpenEmbedding
                                    ↑(Opens.inclusion
                                        ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                      U))) ≫
          f ∣_ Scheme.basicOpen Y r).op =
    IsLocalization.Away.map
      (↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
      (↑(Scheme.Γ.obj
          (Opposite.op
            (Scheme.restrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              U'))))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r
[PROOFSTEP]
apply IsLocalization.ringHom_ext (R := Scheme.Γ.obj (Opposite.op Y)) (Submonoid.powers r) _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ comp
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op)
      (algebraMap ↑(Scheme.Γ.obj (Opposite.op Y))
        ↑(Scheme.Γ.obj
            (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))) =
    comp
      (IsLocalization.Away.map
        (↑(Scheme.Γ.obj
            (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
        (↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U'))))
        (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
      (algebraMap ↑(Scheme.Γ.obj (Opposite.op Y))
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
[PROOFSTEP]
rw [IsLocalization.Away.map, IsLocalization.map_comp, RingHom.algebraMap_toAlgebra]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ comp
      (Scheme.Γ.map
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U))) ≫
            f ∣_ Scheme.basicOpen Y r).op)
      (Scheme.Γ.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
    comp
      (algebraMap ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        ((Opens.map
                              (Scheme.ofRestrict X
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                          U)))))))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op)
[PROOFSTEP]
rw [op_comp, op_comp, Functor.map_comp, Functor.map_comp]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ comp
      (Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op ≫
        Scheme.Γ.map
          (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U)))).op)
      (Scheme.Γ.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
    comp
      (algebraMap ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        ((Opens.map
                              (Scheme.ofRestrict X
                                    (_ :
                                      OpenEmbedding
                                        ↑(Opens.inclusion
                                            ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                          U)))))))
      (Scheme.Γ.map f.op ≫ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).op)
[PROOFSTEP]
change _ = comp (X.presheaf.map _) _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ comp
      (Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op ≫
        Scheme.Γ.map
          (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U)))).op)
      (Scheme.Γ.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).op) =
    comp
      (X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor
                      (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                  ((IsOpenMap.functor
                            (_ :
                              IsOpenMap
                                ↑(Opens.inclusion
                                    ((Opens.map
                                          (Scheme.ofRestrict X
                                                (_ :
                                                  OpenEmbedding
                                                    ↑(Opens.inclusion
                                                        ((Opens.map f.val.base).obj
                                                          (Scheme.basicOpen Y r))))).val.base).obj
                                      U)))).op.obj
                      (Opposite.op ⊤)).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
      (Scheme.Γ.map f.op ≫ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).op)
[PROOFSTEP]
refine' (@Category.assoc CommRingCat _ _ _ _ _ _ _ _).symm.trans _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ (Scheme.Γ.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).op ≫
        Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op) ≫
      Scheme.Γ.map
        (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ((Opens.map
                          (Scheme.ofRestrict X
                                (_ :
                                  OpenEmbedding
                                    ↑(Opens.inclusion
                                        ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                      U)))).op =
    comp
      (X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor
                      (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                  ((IsOpenMap.functor
                            (_ :
                              IsOpenMap
                                ↑(Opens.inclusion
                                    ((Opens.map
                                          (Scheme.ofRestrict X
                                                (_ :
                                                  OpenEmbedding
                                                    ↑(Opens.inclusion
                                                        ((Opens.map f.val.base).obj
                                                          (Scheme.basicOpen Y r))))).val.base).obj
                                      U)))).op.obj
                      (Opposite.op ⊤)).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
      (Scheme.Γ.map f.op ≫ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).op)
[PROOFSTEP]
refine' Eq.trans _ (@Category.assoc CommRingCat _ _ _ _ _ _ _ _)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ (Scheme.Γ.map (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).op ≫
        Scheme.Γ.map (f ∣_ Scheme.basicOpen Y r).op) ≫
      Scheme.Γ.map
        (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ((Opens.map
                          (Scheme.ofRestrict X
                                (_ :
                                  OpenEmbedding
                                    ↑(Opens.inclusion
                                        ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                      U)))).op =
    (Scheme.Γ.map f.op ≫ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).op) ≫
      X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor
                      (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                  ((IsOpenMap.functor
                            (_ :
                              IsOpenMap
                                ↑(Opens.inclusion
                                    ((Opens.map
                                          (Scheme.ofRestrict X
                                                (_ :
                                                  OpenEmbedding
                                                    ↑(Opens.inclusion
                                                        ((Opens.map f.val.base).obj
                                                          (Scheme.basicOpen Y r))))).val.base).obj
                                      U)))).op.obj
                      (Opposite.op ⊤)).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op
[PROOFSTEP]
dsimp only [Scheme.Γ_map, Quiver.Hom.unop_op]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ (NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).val.c
          (Opposite.op ⊤) ≫
        NatTrans.app (f ∣_ Scheme.basicOpen Y r).val.c (Opposite.op ⊤)) ≫
      NatTrans.app
        (Scheme.ofRestrict
              (Scheme.restrict X
                (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion
                                          ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                        U)))).val.c
        (Opposite.op ⊤) =
    (NatTrans.app f.val.c (Opposite.op ⊤) ≫
        NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c (Opposite.op ⊤)) ≫
      X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor
                      (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                  ((IsOpenMap.functor
                            (_ :
                              IsOpenMap
                                ↑(Opens.inclusion
                                    ((Opens.map
                                          (Scheme.ofRestrict X
                                                (_ :
                                                  OpenEmbedding
                                                    ↑(Opens.inclusion
                                                        ((Opens.map f.val.base).obj
                                                          (Scheme.basicOpen Y r))))).val.base).obj
                                      U)))).op.obj
                      (Opposite.op ⊤)).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op
[PROOFSTEP]
rw [morphismRestrict_c_app, Category.assoc, Category.assoc, Category.assoc]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ NatTrans.app (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))).val.c
        (Opposite.op ⊤) ≫
      NatTrans.app f.val.c
          (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen Y r)))).obj ⊤)) ≫
        X.presheaf.map
            (eqToHom
                (_ :
                  (IsOpenMap.functor
                          (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                      ((Opens.map (f ∣_ Scheme.basicOpen Y r).val.base).obj ⊤) =
                    (Opens.map f.val.base).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen Y r)))).obj ⊤))).op ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  (_ :
                    OpenEmbedding
                      ↑(Opens.inclusion
                          ((Opens.map
                                (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion
                                              ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                            U)))).val.c
            (Opposite.op ⊤) =
    NatTrans.app f.val.c (Opposite.op ⊤) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U))).val.c (Opposite.op ⊤) ≫
        X.presheaf.map
          (homOfLE
              (_ :
                (IsOpenMap.functor
                        (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                    ((IsOpenMap.functor
                              (_ :
                                IsOpenMap
                                  ↑(Opens.inclusion
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ :
                                                    OpenEmbedding
                                                      ↑(Opens.inclusion
                                                          ((Opens.map f.val.base).obj
                                                            (Scheme.basicOpen Y r))))).val.base).obj
                                        U)))).op.obj
                        (Opposite.op ⊤)).unop ≤
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op
[PROOFSTEP]
erw [f.1.c.naturality_assoc, ← X.presheaf.map_comp, ← X.presheaf.map_comp, ← X.presheaf.map_comp]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RespectsIso P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (Opposite.op ⊤))
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
a1 : Algebra ↑(Scheme.Γ.obj (Opposite.op Y))
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))) :=
  ΓRestrictAlgebra (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))
U' : OpenEmbedding
  ↑(Opens.inclusion
      ((Opens.map
            (Scheme.ofRestrict X
                  (_ :
                    OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
        U)) :=
  Opens.openEmbedding
    ((Opens.map
          (Scheme.ofRestrict X (Opens.openEmbedding ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))).val.base).obj
      U)
a2 : Algebra ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion U)))))
  ↑(Scheme.Γ.obj
      (Opposite.op
        (Scheme.restrict
          (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
          U'))) :=
  toAlgebra
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                ((IsOpenMap.functor
                          (_ :
                            IsOpenMap
                              ↑(Opens.inclusion
                                  ((Opens.map
                                        (Scheme.ofRestrict X
                                              (_ :
                                                OpenEmbedding
                                                  ↑(Opens.inclusion
                                                      ((Opens.map f.val.base).obj
                                                        (Scheme.basicOpen Y r))))).val.base).obj
                                    U)))).op.obj
                    (Opposite.op ⊤)).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
i1 :
  IsLocalization.Away r
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))
i2 :
  IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
    ↑(Scheme.Γ.obj
        (Opposite.op
          (Scheme.restrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            U')))
this :
  ∀
    [inst :
      IsLocalization.Away r
        ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r))))))]
    [inst_1 :
      IsLocalization.Away (↑(Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
        ↑(Scheme.Γ.obj
            (Opposite.op
              (Scheme.restrict
                (Scheme.restrict X
                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                U')))],
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r) ↔
      P
        (IsLocalization.Away.map
          (↑(Scheme.Γ.obj
              (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen Y r)))))))
          (↑(Scheme.Γ.obj
              (Opposite.op
                (Scheme.restrict
                  (Scheme.restrict X
                    (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
                  U'))))
          (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U)) ≫ f).op) r)
⊢ NatTrans.app f.val.c (Opposite.op ⊤) ≫
      X.presheaf.map
        ((Opens.map f.val.base).op.map
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen Y r)))).counit
                (Opposite.op ⊤).unop).op ≫
          (eqToHom
                (_ :
                  (IsOpenMap.functor
                          (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                      ((Opens.map (f ∣_ Scheme.basicOpen Y r).val.base).obj ⊤) =
                    (Opens.map f.val.base).obj
                      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen Y r)))).obj ⊤))).op ≫
            (IsOpenMap.functor
                    (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).op.map
              (NatTrans.app
                  (IsOpenMap.adjunction
                      (_ :
                        IsOpenMap
                          ↑(Opens.inclusion
                              ((Opens.map
                                    (Scheme.ofRestrict X
                                          (_ :
                                            OpenEmbedding
                                              ↑(Opens.inclusion
                                                  ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).val.base).obj
                                U)))).counit
                  (Opposite.op ⊤).unop).op) =
    NatTrans.app f.val.c (Opposite.op ⊤) ≫
      X.presheaf.map
        ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion U))).counit (Opposite.op ⊤).unop).op ≫
          (homOfLE
              (_ :
                (IsOpenMap.functor
                        (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))).obj
                    ((IsOpenMap.functor
                              (_ :
                                IsOpenMap
                                  ↑(Opens.inclusion
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ :
                                                    OpenEmbedding
                                                      ↑(Opens.inclusion
                                                          ((Opens.map f.val.base).obj
                                                            (Scheme.basicOpen Y r))))).val.base).obj
                                        U)))).op.obj
                        (Opposite.op ⊤)).unop ≤
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U))).obj (Opposite.op ⊤).unop)).op)
[PROOFSTEP]
congr 1
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
erw [← PreservesPullback.iso_inv_fst AffineScheme.forgetToScheme (AffineScheme.ofHom f) (AffineScheme.ofHom g)]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
⊢ P
    (Scheme.Γ.map
      ((PreservesPullback.iso AffineScheme.forgetToScheme (AffineScheme.ofHom f) (AffineScheme.ofHom g)).inv ≫
          AffineScheme.forgetToScheme.map pullback.fst).op)
[PROOFSTEP]
rw [op_comp, Functor.map_comp, hP'.cancel_right_isIso, AffineScheme.forgetToScheme_map]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
have :=
  _root_.congr_arg Quiver.Hom.unop
    (PreservesPullback.iso_hom_fst AffineScheme.Γ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g))
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
this :
  ((PreservesPullback.iso AffineScheme.Γ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g)).hom ≫
        pullback.fst).unop =
    (AffineScheme.Γ.rightOp.map pullback.fst).unop
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
simp only [Quiver.Hom.unop_op, Functor.rightOp_map, unop_comp] at this 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
this :
  pullback.fst.unop ≫
      (PreservesPullback.iso AffineScheme.Γ.rightOp (AffineScheme.ofHom f) (AffineScheme.ofHom g)).hom.unop =
    AffineScheme.Γ.map pullback.fst.op
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
delta AffineScheme.Γ at this 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
this :
  pullback.fst.unop ≫
      (PreservesPullback.iso (AffineScheme.forgetToScheme.op ⋙ Scheme.Γ).rightOp (AffineScheme.ofHom f)
            (AffineScheme.ofHom g)).hom.unop =
    (AffineScheme.forgetToScheme.op ⋙ Scheme.Γ).map pullback.fst.op
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
simp only [Quiver.Hom.unop_op, Functor.comp_map, AffineScheme.forgetToScheme_map, Functor.op_map] at this 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
this :
  pullback.fst.unop ≫
      (PreservesPullback.iso (AffineScheme.forgetToScheme.op ⋙ Scheme.Γ).rightOp (AffineScheme.ofHom f)
            (AffineScheme.ofHom g)).hom.unop =
    Scheme.Γ.map pullback.fst.op
⊢ P (Scheme.Γ.map pullback.fst.op)
[PROOFSTEP]
rw [← this, hP'.cancel_right_isIso, ← pushoutIsoUnopPullback_inl_hom (Quiver.Hom.unop _) (Quiver.Hom.unop _),
  hP'.cancel_right_isIso]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : StableUnderBaseChange P
hP' : RespectsIso P
X Y S : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Y
inst✝ : IsAffine S
f : X ⟶ S
g : Y ⟶ S
H : P (Scheme.Γ.map g.op)
this :
  pullback.fst.unop ≫
      (PreservesPullback.iso (AffineScheme.forgetToScheme.op ⋙ Scheme.Γ).rightOp (AffineScheme.ofHom f)
            (AffineScheme.ofHom g)).hom.unop =
    Scheme.Γ.map pullback.fst.op
⊢ P pushout.inl
[PROOFSTEP]
exact hP.pushout_inl _ hP' _ _ H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
⊢ MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
[PROOFSTEP]
apply AffineTargetMorphismProperty.respectsIso_mk
[GOAL]
case h₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
⊢ ∀ {X Y Z : Scheme} (e : X ≅ Y) (f : Y ⟶ Z) [inst : IsAffine Z],
    sourceAffineLocally P f → sourceAffineLocally P (e.hom ≫ f)
[PROOFSTEP]
introv H U
[GOAL]
case h₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : X ≅ Y
f : Y ⟶ Z
inst✝ : IsAffine Z
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ e.hom ≫ f).op)
[PROOFSTEP]
rw [← h₁.cancel_right_isIso _ (Scheme.Γ.map (Scheme.restrictMapIso e.inv U.1).hom.op), ← Functor.map_comp, ← op_comp]
[GOAL]
case h₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : X ≅ Y
f : Y ⟶ Z
inst✝ : IsAffine Z
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
⊢ P
    (Scheme.Γ.map
      ((Scheme.restrictMapIso e.inv ↑U).hom ≫
          Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ e.hom ≫ f).op)
[PROOFSTEP]
convert H ⟨_, U.prop.map_isIso e.inv⟩ using 3
  -- Porting note : have to add this instance manually
[GOAL]
case h.e'_5.h.e'_8.h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : X ≅ Y
f : Y ⟶ Z
inst✝ : IsAffine Z
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
⊢ (Scheme.restrictMapIso e.inv ↑U).hom ≫ Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ e.hom ≫ f =
    Scheme.ofRestrict Y
        (_ :
          OpenEmbedding
            ↑(Opens.inclusion
                ↑{ val := (Opens.map e.inv.val.base).obj ↑U,
                    property := (_ : IsAffineOpen ((Opens.map e.inv.val.base).obj ↑U)) })) ≫
      f
[PROOFSTEP]
haveI i1 : IsOpenImmersion (Scheme.ofRestrict Y ((Opens.map e.inv.val.base).obj U.1).openEmbedding ≫ e.inv) :=
  PresheafedSpace.IsOpenImmersion.comp _ _
[GOAL]
case h.e'_5.h.e'_8.h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : X ≅ Y
f : Y ⟶ Z
inst✝ : IsAffine Z
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
i1 :
  IsOpenImmersion
    (Scheme.ofRestrict Y (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map e.inv.val.base).obj ↑U))) ≫ e.inv)
⊢ (Scheme.restrictMapIso e.inv ↑U).hom ≫ Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ e.hom ≫ f =
    Scheme.ofRestrict Y
        (_ :
          OpenEmbedding
            ↑(Opens.inclusion
                ↑{ val := (Opens.map e.inv.val.base).obj ↑U,
                    property := (_ : IsAffineOpen ((Opens.map e.inv.val.base).obj ↑U)) })) ≫
      f
[PROOFSTEP]
rw [IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac_assoc, Category.assoc, e.inv_hom_id_assoc]
[GOAL]
case h₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
⊢ ∀ {X Y Z : Scheme} (e : Y ≅ Z) (f : X ⟶ Y) [h : IsAffine Y],
    sourceAffineLocally P f → sourceAffineLocally P (f ≫ e.hom)
[PROOFSTEP]
introv H U
[GOAL]
case h₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : Y ≅ Z
f : X ⟶ Y
h : IsAffine Y
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f ≫ e.hom).op)
[PROOFSTEP]
rw [← Category.assoc, op_comp, Functor.map_comp, h₁.cancel_left_isIso]
[GOAL]
case h₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
e : Y ≅ Z
f : X ⟶ Y
h : IsAffine Y
H : sourceAffineLocally P f
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
exact H U
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
⊢ affineLocally P f ↔
    ∀ (U : ↑(Scheme.affineOpens Y)) (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U),
      P (Scheme.Hom.appLe f e)
[PROOFSTEP]
apply forall_congr'
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
⊢ ∀ (a : ↑(Scheme.affineOpens Y)),
    sourceAffineLocally P (f ∣_ ↑a) ↔
      ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑a), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
intro U
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P (f ∣_ ↑U) ↔
    ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
delta sourceAffineLocally
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
⊢ (∀
      (U_1 :
        ↑(Scheme.affineOpens
            (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
      P
        (Scheme.Γ.map
          (Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1)) ≫
              f ∣_ ↑U).op)) ↔
    ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
simp_rw [op_comp, Scheme.Γ.map_comp, Γ_map_morphismRestrict, Category.assoc, Scheme.Γ_map_op, hP.cancel_left_isIso]
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
⊢ (∀
      (U_1 :
        ↑(Scheme.affineOpens
            (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
      P
        (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 ≫
            NatTrans.app
              (Scheme.ofRestrict
                    (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                    (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
              (op ⊤))) ↔
    ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
⊢ (∀
      (U_1 :
        ↑(Scheme.affineOpens
            (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
      P
        (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 ≫
            NatTrans.app
              (Scheme.ofRestrict
                    (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                    (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
              (op ⊤))) →
    ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)
[PROOFSTEP]
intro H V e
[GOAL]
case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
⊢ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
let U' := (Opens.map f.val.base).obj U.1
[GOAL]
case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
⊢ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
have e' : U'.openEmbedding.isOpenMap.functor.obj ((Opens.map U'.inclusion).obj V.1) = V.1 :=
  by
  ext1; refine' Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left_iff_subset.mpr _)
  erw [Subtype.range_val]
  convert e
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
[PROOFSTEP]
ext1
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
⊢ ↑((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V)) = ↑↑V
[PROOFSTEP]
refine' Set.image_preimage_eq_inter_range.trans (Set.inter_eq_left_iff_subset.mpr _)
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
⊢ (↑V).1 ⊆ Set.range fun x => ↑(Opens.inclusion U') x
[PROOFSTEP]
erw [Subtype.range_val]
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
⊢ (↑V).1 ⊆ ↑U'
[PROOFSTEP]
convert e
[GOAL]
case h.mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ P (Scheme.Hom.appLe f e)
[PROOFSTEP]
have := H ⟨(Opens.map (X.ofRestrict U'.openEmbedding).1.base).obj V.1, ?_⟩
[GOAL]
case h.mp.refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
        NatTrans.app
          (Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        ↑{
                            val :=
                              (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                ↑V,
                            property := ?h.mp.refine_1 }))).val.c
          (op ⊤))
⊢ P (Scheme.Hom.appLe f e)
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
erw [← X.presheaf.map_comp] at this 
[GOAL]
case h.mp.refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ P (Scheme.Hom.appLe f e)
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc, ← X.presheaf.map_comp]
[GOAL]
case h.mp.refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ P (NatTrans.app f.val.c (op ↑U) ≫ X.presheaf.map ((homOfLE e).op ≫ eqToHom ?m.92694))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ op ↑V = ?m.93449
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ op ↑V = ?m.93449
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property := ?h.mp.refine_1 }))).counit
                (op ⊤).unop).op))
⊢ op ↑V = ?m.93449
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
convert this using 1
[GOAL]
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V ∈
    Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
apply (@isAffineOpen_iff_of_isOpenImmersion _ _ (@Scheme.ofRestrict _ X U'.inclusion _) ?_ _).mp
[GOAL]
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsAffineOpen
    ((PresheafedSpace.IsOpenImmersion.openFunctor ?m.94942).obj
      ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
erw [e']
[GOAL]
case h.mp.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsAffineOpen ↑V
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
apply V.2
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
⊢ IsOpenImmersion (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property :=
                                  (_ :
                                    IsAffineOpen
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                        ↑V)) }))).counit
                (op ⊤).unop).op))
⊢ op ↑V =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      ↑{
                          val :=
                            (Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj ↑V,
                          property :=
                            (_ :
                              IsAffineOpen
                                ((Opens.map
                                      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                  ↑V)) }))).op.obj
        (op ⊤))
[PROOFSTEP]
dsimp only [Functor.op, unop_op]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property :=
                                  (_ :
                                    IsAffineOpen
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                        ↑V)) }))).counit
                (op ⊤).unop).op))
⊢ op ↑V =
    op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).obj
        ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      ((Opens.map
                            (Scheme.ofRestrict X
                                  (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).val.base).obj
                        ↑V)))).obj
          ⊤))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property :=
                                  (_ :
                                    IsAffineOpen
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                        ↑V)) }))).counit
                (op ⊤).unop).op))
⊢ op ↑V =
    op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).obj
        ((Opens.map
              (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).val.base).obj
          ↑V))
[PROOFSTEP]
congr 1
[GOAL]
case e_x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H :
  ∀
    (U_1 :
      ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
    P
      (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 ≫
          NatTrans.app
            (Scheme.ofRestrict
                  (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                  (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
            (op ⊤))
V : ↑(Scheme.affineOpens X)
e : ↑V ≤ (Opens.map f.val.base).obj ↑U
U' : Opens ↑↑X.toPresheafedSpace := (Opens.map f.val.base).obj ↑U
e' : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion U'))).obj ((Opens.map (Opens.inclusion U')).obj ↑V) = ↑V
this :
  P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            ↑{
                                val :=
                                  (Opens.map
                                        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                    ↑V,
                                property :=
                                  (_ :
                                    IsAffineOpen
                                      ((Opens.map
                                            (Scheme.ofRestrict X
                                                  (_ : OpenEmbedding ↑(Opens.inclusion U'))).val.base).obj
                                        ↑V)) }))).counit
                (op ⊤).unop).op))
⊢ ↑V =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).obj
      ((Opens.map
            (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).val.base).obj
        ↑V)
[PROOFSTEP]
apply e'.symm
[GOAL]
case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
⊢ (∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)) →
    ∀
      (U_1 :
        ↑(Scheme.affineOpens
            (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))),
      P
        (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 ≫
            NatTrans.app
              (Scheme.ofRestrict
                    (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                    (_ : OpenEmbedding ↑(Opens.inclusion ↑U_1))).val.c
              (op ⊤))
[PROOFSTEP]
intro H V
[GOAL]
case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
H : ∀ (V : ↑(Scheme.affineOpens X)) (e : ↑V ≤ (Opens.map f.val.base).obj ↑U), P (Scheme.Hom.appLe f e)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
⊢ P
    (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 ≫
        NatTrans.app
          (Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                (_ : OpenEmbedding ↑(Opens.inclusion ↑V))).val.c
          (op ⊤))
[PROOFSTEP]
specialize H ⟨_, V.2.imageIsOpenImmersion (X.ofRestrict _)⟩ (Subtype.coe_image_subset _ _)
[GOAL]
case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ P
    (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 ≫
        NatTrans.app
          (Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))
                (_ : OpenEmbedding ↑(Opens.inclusion ↑V))).val.c
          (op ⊤))
[PROOFSTEP]
erw [← X.presheaf.map_comp]
[GOAL]
case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ P
    (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 ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
            (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑V))).counit (op ⊤).unop).op))
[PROOFSTEP]
rw [← hP.cancel_right_isIso _ (X.presheaf.map (eqToHom _)), Category.assoc, ← X.presheaf.map_comp]
[GOAL]
case h.mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ P
    (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 ≫
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.map
              (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑V))).counit (op ⊤).unop).op) ≫
          eqToHom ?m.96601))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.obj
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑V))).op.obj (op ⊤)) =
    ?m.97455
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.obj
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑V))).op.obj (op ⊤)) =
    ?m.97455
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.obj
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑V))).op.obj (op ⊤)) =
    ?m.97455
[PROOFSTEP]
convert H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).op.obj
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑V))).op.obj (op ⊤)) =
    op
      ↑{
          val :=
            (Scheme.Hom.opensFunctor
                  (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).obj
              ↑V,
          property :=
            (_ :
              IsAffineOpen
                ((Scheme.Hom.opensFunctor
                      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).obj
                  ↑V)) }
[PROOFSTEP]
dsimp only [Functor.op, unop_op]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.RespectsIso P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens Y)
V : ↑(Scheme.affineOpens (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
H : P (Scheme.Hom.appLe f (_ : Subtype.val '' ↑↑V ⊆ ↑((Opens.map f.val.base).obj ↑U)))
⊢ op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))).obj
        ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑V))).obj ⊤)) =
    op
      ((Scheme.Hom.opensFunctor
            (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).obj
        ↑V)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (op ⊤))
H : sourceAffineLocally P f
U :
  ↑(Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫
          f ∣_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
specialize H ⟨_, U.2.imageIsOpenImmersion (X.ofRestrict _)⟩
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (op ⊤))
U :
  ↑(Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
H :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict X
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{
                        val :=
                          (Scheme.Hom.opensFunctor
                                (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
                            ↑U,
                        property :=
                          (_ :
                            IsAffineOpen
                              ((Scheme.Hom.opensFunctor
                                    (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
                                ↑U)) })) ≫
          f).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫
          f ∣_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
letI i1 : Algebra (Y.presheaf.obj <| Opposite.op ⊤) (Localization.Away r) := Localization.algebra
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (op ⊤))
U :
  ↑(Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
H :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict X
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{
                        val :=
                          (Scheme.Hom.opensFunctor
                                (Scheme.ofRestrict X
                                  (_ :
                                    OpenEmbedding
                                      ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
                            ↑U,
                        property :=
                          (_ :
                            IsAffineOpen
                              ((Scheme.Hom.opensFunctor
                                    (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))).obj
                                ↑U)) })) ≫
          f).op)
i1 : Algebra (↑(Y.presheaf.obj (op ⊤))) (Localization.Away r) := Localization.algebra
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫
          f ∣_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
exact
  (h₁.ofRestrict_morphismRestrict_iff f r
        ((Scheme.Hom.opensFunctor (X.ofRestrict ((Opens.map f.1.base).obj <| Y.basicOpen r).openEmbedding)).obj U.1)
        (IsAffineOpen.imageIsOpenImmersion U.2 (X.ofRestrict ((Opens.map f.1.base).obj <| Y.basicOpen r).openEmbedding))
        (Opens.ext (Set.preimage_image_eq _ Subtype.coe_injective).symm)).mpr
    (h₂.away r H)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
⊢ AffineTargetMorphismProperty.IsLocal (sourceAffineLocally P)
[PROOFSTEP]
constructor
[GOAL]
case RespectsIso
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
⊢ MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
[PROOFSTEP]
exact sourceAffineLocally_respectsIso h₁
[GOAL]
case toBasicOpen
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
⊢ ∀ {X Y : Scheme} [inst : IsAffine Y] (f : X ⟶ Y) (r : ↑(Y.presheaf.obj (op ⊤))),
    sourceAffineLocally P f → sourceAffineLocally P (f ∣_ Scheme.basicOpen Y r)
[PROOFSTEP]
introv H U
[GOAL]
case toBasicOpen
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (op ⊤))
H : sourceAffineLocally P f
U :
  ↑(Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r)))))
            (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫
          f ∣_ Scheme.basicOpen Y r).op)
[PROOFSTEP]
apply scheme_restrict_basicOpen_of_localizationPreserves h₁ h₂
[GOAL]
case toBasicOpen.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
r : ↑(Y.presheaf.obj (op ⊤))
H : sourceAffineLocally P f
U :
  ↑(Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y r))))))
⊢ sourceAffineLocally P f
[PROOFSTEP]
assumption
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
⊢ ∀ {X Y : Scheme} [inst : IsAffine Y] (f : X ⟶ Y) (s : Finset ↑(Y.presheaf.obj (op ⊤))),
    Ideal.span ↑s = ⊤ →
      (∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)) → sourceAffineLocally P f
[PROOFSTEP]
introv hs hs' U
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
skip
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
apply h₃ _ _ hs
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
⊢ ∀ (r : ↑↑s),
    P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) ↑r)
[PROOFSTEP]
intro r
[GOAL]
case ofBasicOpenCover
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
⊢ P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) ↑r)
[PROOFSTEP]
have := hs' r ⟨(Opens.map (X.ofRestrict _).1.base).obj U.1, ?_⟩
[GOAL]
case ofBasicOpenCover.refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
this :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{
                        val :=
                          (Opens.map
                                (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion
                                              ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
                            ↑U,
                        property := ?ofBasicOpenCover.refine_1 })) ≫
          f ∣_ Scheme.basicOpen Y ↑r).op)
⊢ P (Localization.awayMap (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) ↑r)
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
⊢ (Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
      ↑U ∈
    Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
[PROOFSTEP]
rwa [h₁.ofRestrict_morphismRestrict_iff] at this 
[GOAL]
case ofBasicOpenCover.refine_2.hU
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
this :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{
                        val :=
                          (Opens.map
                                (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion
                                              ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
                            ↑U,
                        property := ?ofBasicOpenCover.refine_1 })) ≫
          f ∣_ Scheme.basicOpen Y ↑r).op)
⊢ IsAffineOpen ↑U
[PROOFSTEP]
exact U.2
[GOAL]
case ofBasicOpenCover.refine_2.e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
this :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict
            (Scheme.restrict X
              (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{
                        val :=
                          (Opens.map
                                (Scheme.ofRestrict X
                                      (_ :
                                        OpenEmbedding
                                          ↑(Opens.inclusion
                                              ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
                            ↑U,
                        property := ?ofBasicOpenCover.refine_1 })) ≫
          f ∣_ Scheme.basicOpen Y ↑r).op)
⊢ ↑{
        val :=
          (Opens.map
                (Scheme.ofRestrict X
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
            ↑U,
        property := ?ofBasicOpenCover.refine_1 } =
    (Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
      ↑U
[PROOFSTEP]
rfl
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
⊢ (Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
      ↑U ∈
    Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
[PROOFSTEP]
suffices
  ∀ (V) (_ : V = (Opens.map f.val.base).obj (Y.basicOpen r.val)),
    IsAffineOpen ((Opens.map (X.ofRestrict V.openEmbedding).1.base).obj U.1)
  by exact this _ rfl
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
this :
  ∀ (V : Opens ↑↑X.toPresheafedSpace),
    V = (Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r) →
      IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).obj ↑U)
⊢ (Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r))))).val.base).obj
      ↑U ∈
    Scheme.affineOpens
      (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)))))
[PROOFSTEP]
exact this _ rfl
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
⊢ ∀ (V : Opens ↑↑X.toPresheafedSpace),
    V = (Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r) →
      IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).obj ↑U)
[PROOFSTEP]
intro V hV
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
V : Opens ↑↑X.toPresheafedSpace
hV : V = (Opens.map f.val.base).obj (Scheme.basicOpen Y ↑r)
⊢ IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).obj ↑U)
[PROOFSTEP]
rw [Scheme.preimage_basicOpen] at hV 
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
V : Opens ↑↑X.toPresheafedSpace
hV : V = Scheme.basicOpen X (↑(NatTrans.app f.val.c (op ⊤)) ↑r)
⊢ IsAffineOpen ((Opens.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion V))).val.base).obj ↑U)
[PROOFSTEP]
subst hV
[GOAL]
case ofBasicOpenCover.refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
h₁ : RingHom.RespectsIso P
h₂ : RingHom.LocalizationPreserves P
h₃ : RingHom.OfLocalizationSpan P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
s : Finset ↑(Y.presheaf.obj (op ⊤))
hs : Ideal.span ↑s = ⊤
hs' : ∀ (r : { x // x ∈ s }), sourceAffineLocally P (f ∣_ Scheme.basicOpen Y ↑r)
U : ↑(Scheme.affineOpens X)
r : ↑↑s
⊢ IsAffineOpen
    ((Opens.map
          (Scheme.ofRestrict X
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion (Scheme.basicOpen X (↑(NatTrans.app f.val.c (op ⊤)) ↑r))))).val.base).obj
      ↑U)
[PROOFSTEP]
exact U.2.mapRestrictBasicOpen (Scheme.Γ.map f.op r.1)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs : Ideal.span s = ⊤
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
apply_fun Ideal.map (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op) at hs 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.map (X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
      (Ideal.span s) =
    Ideal.map (X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) ⊤
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
rw [Ideal.map_span, Ideal.map_top] at hs 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
apply h₃ _ _ hs
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
⊢ ∀
    (r :
      ↑(↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) ''
          s)),
    P
      (RingHom.comp
        (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
          (Localization.Away ↑r))
        (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
rintro ⟨s, r, hr, hs⟩
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s✝ : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s✝),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs✝ :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) ''
        s✝) =
    ⊤
s : ↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s✝
hs : ↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r = s
⊢ P
    (RingHom.comp
      (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
        (Localization.Away
          ↑{ val := s,
              property :=
                (_ :
                  ∃ a,
                    a ∈ s✝ ∧
                      ↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          a =
                        s) }))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
have :=
  (@Localization.algEquiv _ _ _ _ _ _
      (@AlgebraicGeometry.Γ_restrict_isLocalization _ U.2 s)).toRingEquiv.toCommRingCatIso
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s✝ : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s✝),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs✝ :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) ''
        s✝) =
    ⊤
s : ↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s✝
hs : ↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r = s
this :
  CommRingCat.of (Localization (Submonoid.powers s)) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))) s))))))
⊢ P
    (RingHom.comp
      (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
        (Localization.Away
          ↑{ val := s,
              property :=
                (_ :
                  ∃ a,
                    a ∈ s✝ ∧
                      ↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          a =
                        s) }))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
refine
  (h₁.cancel_right_isIso _
        (@Localization.algEquiv _ _ _ _ _ _
            (@AlgebraicGeometry.Γ_restrict_isLocalization _ U.2 s)).toRingEquiv.toCommRingCatIso.hom).mp
    ?_
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s✝ : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s✝),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs✝ :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) ''
        s✝) =
    ⊤
s : ↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s✝
hs : ↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r = s
this :
  CommRingCat.of (Localization (Submonoid.powers s)) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))) s))))))
⊢ P
    (RingHom.comp
        (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
          (Localization.Away
            ↑{ val := s,
                property :=
                  (_ :
                    ∃ a,
                      a ∈ s✝ ∧
                        ↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            a =
                          s) }))
        (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) ≫
      (RingEquiv.toCommRingCatIso
          (AlgEquiv.toRingEquiv
            (Localization.algEquiv (Submonoid.powers s)
              ↑(Scheme.Γ.obj
                  (op
                    (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                s))))))))).hom)
[PROOFSTEP]
subst hs
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (RingHom.comp
        (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
          (Localization.Away
            ↑{
                val :=
                  ↑(X.presheaf.map
                        (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                    r,
                property :=
                  (_ :
                    ∃ a,
                      a ∈ s ∧
                        ↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            a =
                          ↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            r) }))
        (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) ≫
      (RingEquiv.toCommRingCatIso
          (AlgEquiv.toRingEquiv
            (Localization.algEquiv
              (Submonoid.powers
                (↑(X.presheaf.map
                      (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                  r))
              ↑(Scheme.Γ.obj
                  (op
                    (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                      (_ :
                        OpenEmbedding
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                (↑(X.presheaf.map
                                      (eqToHom
                                          (_ :
                                            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                  r)))))))))).hom)
[PROOFSTEP]
rw [CommRingCat.comp_eq_ring_hom_comp, ← RingHom.comp_assoc]
  -- Porting note: here is where it gets bad; previously `erw [IsLocalization.map_comp]`
    -- ask Lean to synthesize instances and it runs away
    -- we also have to pass in one `Localization` instance now (and not before)
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (RingHom.comp
      (RingHom.comp
        (RingEquiv.toCommRingCatIso
            (AlgEquiv.toRingEquiv
              (Localization.algEquiv
                (Submonoid.powers
                  (↑(X.presheaf.map
                        (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                    r))
                ↑(Scheme.Γ.obj
                    (op
                      (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (_ :
                          OpenEmbedding
                            ↑(Opens.inclusion
                                (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                  (↑(X.presheaf.map
                                        (eqToHom
                                            (_ :
                                              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                    r)))))))))).hom
        (algebraMap (↑(X.presheaf.obj (op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
          (Localization.Away
            ↑{
                val :=
                  ↑(X.presheaf.map
                        (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                    r,
                property :=
                  (_ :
                    ∃ a,
                      a ∈ s ∧
                        ↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            a =
                          ↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            r) })))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
erw [@IsLocalization.map_comp _ _ _ _ _ (_) (Scheme.Γ.obj (Opposite.op (X.restrict U.1.openEmbedding))) _ (_) _
    (Submonoid.powers (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r))
    ((Scheme.Γ.obj
      (Opposite.op
        ((X.restrict U.1.openEmbedding).restrict
          ((X.restrict U.1.openEmbedding).basicOpen
              (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r)).openEmbedding))))
    _ (le_of_eq rfl) (_) (@AlgebraicGeometry.Γ_restrict_isLocalization _ U.2 _)]
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (RingHom.comp
      (RingHom.comp
        (algebraMap ↑(Scheme.Γ.obj (op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
          ↑(Scheme.Γ.obj
              (op
                (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                  (_ :
                    OpenEmbedding
                      ↑(Opens.inclusion
                          (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                            (↑(X.presheaf.map
                                  (eqToHom
                                      (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                              r))))))))
        ↑(RingEquiv.refl ↑(Scheme.Γ.obj (op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
erw [RingHom.comp_id]
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (RingHom.comp
      (algebraMap ↑(Scheme.Γ.obj (op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        ↑(Scheme.Γ.obj
            (op
              (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                          (↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            r))))))))
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op))
[PROOFSTEP]
rw [RingHom.algebraMap_toAlgebra, op_comp, Functor.map_comp, ← CommRingCat.comp_eq_ring_hom_comp, Scheme.Γ_map_op,
  Scheme.Γ_map_op, Scheme.Γ_map_op, Category.assoc]
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (NatTrans.app f.val.c (op ⊤) ≫
      NatTrans.app (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))).val.c (op ⊤) ≫
        NatTrans.app
          (Scheme.ofRestrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                (_ :
                  OpenEmbedding
                    ↑(Opens.inclusion
                        (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                          (↑(X.presheaf.map
                                (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                            r))))).val.c
          (op ⊤))
[PROOFSTEP]
erw [← X.presheaf.map_comp]
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    (NatTrans.app f.val.c (op ⊤) ≫
      X.presheaf.map
        ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit (op ⊤).unop).op ≫
          (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.map
            (NatTrans.app
                (IsOpenMap.adjunction
                    (_ :
                      IsOpenMap
                        ↑(Opens.inclusion
                            (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                              (↑(X.presheaf.map
                                    (eqToHom
                                        (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                r))))).counit
                (op ⊤).unop).op))
[PROOFSTEP]
rw [← h₁.cancel_right_isIso _ (X.presheaf.map (eqToHom _))]
[GOAL]
case mk.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ P
    ((NatTrans.app f.val.c (op ⊤) ≫
        X.presheaf.map
          ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit (op ⊤).unop).op ≫
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.map
              (NatTrans.app
                  (IsOpenMap.adjunction
                      (_ :
                        IsOpenMap
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                (↑(X.presheaf.map
                                      (eqToHom
                                          (_ :
                                            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                  r))))).counit
                  (op ⊤).unop).op)) ≫
      X.presheaf.map (eqToHom ?m.148221))
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (Opens ↑↑X.toPresheafedSpace)ᵒᵖ
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    ?m.148220
[PROOFSTEP]
convert hs' ⟨r, hr⟩ using 1
[GOAL]
case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
e_4✝ :
  CommRingCat.instCommRingα
      (X.presheaf.obj
        ((IsOpenMap.functor
                (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
          (op ⊤))) =
    CommRingCat.instCommRingα
      (Scheme.Γ.obj
        (op
          (Scheme.restrict X
            (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr }))))))
⊢ (NatTrans.app f.val.c (op ⊤) ≫
        X.presheaf.map
          ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit (op ⊤).unop).op ≫
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.map
              (NatTrans.app
                  (IsOpenMap.adjunction
                      (_ :
                        IsOpenMap
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                (↑(X.presheaf.map
                                      (eqToHom
                                          (_ :
                                            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                  r))))).counit
                  (op ⊤).unop).op)) ≫
      X.presheaf.map (eqToHom ?m.148221) =
    Scheme.Γ.map
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr }))) ≫
          f).op
[PROOFSTEP]
erw [Category.assoc]
[GOAL]
case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
e_4✝ :
  CommRingCat.instCommRingα
      (X.presheaf.obj
        ((IsOpenMap.functor
                (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
          (op ⊤))) =
    CommRingCat.instCommRingα
      (Scheme.Γ.obj
        (op
          (Scheme.restrict X
            (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr }))))))
⊢ NatTrans.app f.val.c (op ⊤) ≫
      X.presheaf.map
          ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit (op ⊤).unop).op ≫
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.map
              (NatTrans.app
                  (IsOpenMap.adjunction
                      (_ :
                        IsOpenMap
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                (↑(X.presheaf.map
                                      (eqToHom
                                          (_ :
                                            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                  r))))).counit
                  (op ⊤).unop).op) ≫
        X.presheaf.map (eqToHom ?m.148221) =
    Scheme.Γ.map
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr }))) ≫
          f).op
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
[PROOFSTEP]
rw [← X.presheaf.map_comp, op_comp, Scheme.Γ.map_comp, Scheme.Γ_map_op, Scheme.Γ_map_op]
[GOAL]
case h.e'_5.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
e_4✝ :
  CommRingCat.instCommRingα
      (X.presheaf.obj
        ((IsOpenMap.functor
                (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
          (op ⊤))) =
    CommRingCat.instCommRingα
      (Scheme.Γ.obj
        (op
          (Scheme.restrict X
            (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr }))))))
⊢ NatTrans.app f.val.c (op ⊤) ≫
      X.presheaf.map
        (((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit (op ⊤).unop).op ≫
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.map
              (NatTrans.app
                  (IsOpenMap.adjunction
                      (_ :
                        IsOpenMap
                          ↑(Opens.inclusion
                              (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                                (↑(X.presheaf.map
                                      (eqToHom
                                          (_ :
                                            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                                  r))))).counit
                  (op ⊤).unop).op) ≫
          eqToHom ?m.148221) =
    NatTrans.app f.val.c (op ⊤) ≫
      NatTrans.app
        (Scheme.ofRestrict X
              (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).val.c
        (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
[PROOFSTEP]
congr!
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
[PROOFSTEP]
all_goals
  · dsimp [Functor.op]
    conv_lhs => rw [Opens.openEmbedding_obj_top]
    conv_rhs => rw [Opens.openEmbedding_obj_top]
    erw [Scheme.image_basicOpen (X.ofRestrict U.1.openEmbedding)]
    erw [PresheafedSpace.IsOpenImmersion.ofRestrict_invApp_apply]
    rw [Scheme.basicOpen_res_eq]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).op.obj
      ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).op.obj
        (op ⊤)) =
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X ↑{ val := r, property := hr })))).op.obj
      (op ⊤)
[PROOFSTEP]
dsimp [Functor.op]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
        ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r))))).obj
          ⊤)) =
    op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)
[PROOFSTEP]
conv_lhs => rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op
    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
      ((IsOpenMap.functor
            (_ :
              IsOpenMap
                ↑(Opens.inclusion
                    (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                      (↑(X.presheaf.map
                            (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                        r))))).obj
        ⊤))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op
    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
      ((IsOpenMap.functor
            (_ :
              IsOpenMap
                ↑(Opens.inclusion
                    (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                      (↑(X.presheaf.map
                            (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                        r))))).obj
        ⊤))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op
    ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
      ((IsOpenMap.functor
            (_ :
              IsOpenMap
                ↑(Opens.inclusion
                    (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                      (↑(X.presheaf.map
                            (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                        r))))).obj
        ⊤))
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
        (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) =
    op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)
[PROOFSTEP]
conv_rhs => rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
| op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ op
      ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj
        (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) =
    op (Scheme.basicOpen X r)
[PROOFSTEP]
erw [Scheme.image_basicOpen (X.ofRestrict U.1.openEmbedding)]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ op
      (Scheme.basicOpen X
        (↑(Scheme.Hom.invApp (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))) ⊤)
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) =
    op (Scheme.basicOpen X r)
[PROOFSTEP]
erw [PresheafedSpace.IsOpenImmersion.ofRestrict_invApp_apply]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
h₃ : RingHom.OfLocalizationSpanTarget P
X Y : Scheme
f : X ⟶ Y
U : ↑(Scheme.affineOpens X)
s : Set ↑(X.presheaf.obj (op ↑U))
hs' :
  ∀ (r : ↑s),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X ↑r))) ≫ f).op)
hs :
  Ideal.span
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) '' s) =
    ⊤
r : ↑(X.presheaf.obj (op ↑U))
hr : r ∈ s
this :
  CommRingCat.of
      (Localization
        (Submonoid.powers
          (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
            r))) ≅
    CommRingCat.of
      ↑(Scheme.Γ.obj
          (op
            (Scheme.restrict (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      (Scheme.basicOpen (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
                        (↑(X.presheaf.map
                              (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
                          r)))))))
⊢ op
      (Scheme.basicOpen X
        (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)) =
    op (Scheme.basicOpen X r)
[PROOFSTEP]
rw [Scheme.basicOpen_res_eq]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ P (Scheme.Γ.map (f ≫ g).op)
[PROOFSTEP]
rw [← h₁.cancel_right_isIso _ (Scheme.Γ.map (IsOpenImmersion.isoOfRangeEq (Y.ofRestrict _) f _).hom.op), ←
  Functor.map_comp, ← op_comp]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ P (Scheme.Γ.map ((IsOpenImmersion.isoOfRangeEq (Scheme.ofRestrict Y ?m.164260) f ?m.164267).hom ≫ f ≫ g).op)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ TopCat
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ ?m.164258 ⟶ TopCat.of ↑↑Y.toPresheafedSpace
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ OpenEmbedding ↑?m.164259
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ Set.range ↑(Scheme.ofRestrict Y ?m.164260).val.base = Set.range ↑f.val.base
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ TopCat
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ ?m.164258 ⟶ TopCat.of ↑↑Y.toPresheafedSpace
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ OpenEmbedding ↑?m.164259
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ Set.range ↑(Scheme.ofRestrict Y ?m.164260).val.base = Set.range ↑f.val.base
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ TopCat
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ ?m.164258 ⟶ TopCat.of ↑↑Y.toPresheafedSpace
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ OpenEmbedding ↑?m.164259
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ Set.range ↑(Scheme.ofRestrict Y ?m.164260).val.base = Set.range ↑f.val.base
[PROOFSTEP]
convert h₂ ⟨_, rangeIsAffineOpenOfOpenImmersion f⟩ using 3
[GOAL]
case h.e'_5.h.h.e'_8.h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ (IsOpenImmersion.isoOfRangeEq
          (Scheme.ofRestrict Y
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{ val := Scheme.Hom.opensRange f, property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) })))
          f ?m.164267).hom ≫
      f ≫ g =
    Scheme.ofRestrict Y
        (_ :
          OpenEmbedding
            ↑(Opens.inclusion
                ↑{ val := Scheme.Hom.opensRange f, property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) })) ≫
      g
[PROOFSTEP]
rw [IsOpenImmersion.isoOfRangeEq_hom, IsOpenImmersion.lift_fac_assoc]
[GOAL]
case h.e'_5.h.h.e'_8.h.e'_5.e
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : RingHom.PropertyIsLocal P
h₁ : RingHom.RespectsIso P
X Y Z : Scheme
inst✝² : IsAffine X
inst✝¹ : IsAffine Z
f : X ⟶ Y
inst✝ : IsOpenImmersion f
g : Y ⟶ Z
h₂ : sourceAffineLocally P g
⊢ Set.range
      ↑(Scheme.ofRestrict Y
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ↑{ val := Scheme.Hom.opensRange f,
                          property := (_ : IsAffineOpen (Scheme.Hom.opensRange f)) }))).val.base =
    Set.range ↑f.val.base
[PROOFSTEP]
exact Subtype.range_coe
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ sourceAffineLocally P f
[PROOFSTEP]
let S i :=
  (⟨⟨Set.range (𝒰.map i).1.base, (𝒰.IsOpen i).base_open.open_range⟩, rangeIsAffineOpenOfOpenImmersion (𝒰.map i)⟩ :
    X.affineOpens)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
⊢ sourceAffineLocally P f
[PROOFSTEP]
intro U
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
apply of_affine_open_cover (P := fun V => P (Scheme.Γ.map (X.ofRestrict (Opens.openEmbedding V.val) ≫ f).op)) U
[GOAL]
case hP₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑(Scheme.affineOpens X)) (f_1 : ↑(X.presheaf.obj (Opposite.op ↑U))),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) →
      P
        (Scheme.Γ.map
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X f_1))) ≫ f).op)
case hP₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑(Scheme.affineOpens X)) (s : Finset ↑(X.presheaf.obj (Opposite.op ↑U))),
    Ideal.span ↑s = ⊤ →
      (∀ (f_1 : { x // x ∈ s }),
          P
            (Scheme.Γ.map
              (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X ↑f_1))) ≫ f).op)) →
        P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
case hS
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ⋃ (i : ↑?S), ↑↑↑i = Set.univ
case hS'
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑?S), P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑↑U)) ≫ f).op)
case S
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ Set ↑(Scheme.affineOpens X)
[PROOFSTEP]
pick_goal 5
[GOAL]
case S
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ Set ↑(Scheme.affineOpens X)
[PROOFSTEP]
exact Set.range S
[GOAL]
case hP₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑(Scheme.affineOpens X)) (f_1 : ↑(X.presheaf.obj (Opposite.op ↑U))),
    P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op) →
      P
        (Scheme.Γ.map
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X f_1))) ≫ f).op)
[PROOFSTEP]
intro U r H
[GOAL]
case hP₁
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r))) ≫ f).op)
[PROOFSTEP]
convert
  hP.StableUnderComposition (S := Scheme.Γ.obj (Opposite.op (X.restrict <| Opens.openEmbedding U.val))) (T :=
    Scheme.Γ.obj (Opposite.op (X.restrict <| Opens.openEmbedding (X.basicOpen r)))) ?_ ?_ H ?_ using
  1
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r))) ≫ f).op =
    comp ?hP₁.convert_1 (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
case hP₁.convert_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) →+*
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X r))))))
case hP₁.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ P ?hP₁.convert_1
[PROOFSTEP]
swap
[GOAL]
case hP₁.convert_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) →+*
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
refine' X.presheaf.map (@homOfLE _ _ ((IsOpenMap.functor _).obj _) ((IsOpenMap.functor _).obj _) _).op
[GOAL]
case hP₁.convert_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
    (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop
[PROOFSTEP]
rw [unop_op, unop_op, Opens.openEmbedding_obj_top, Opens.openEmbedding_obj_top]
[GOAL]
case hP₁.convert_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.basicOpen X r ≤ ↑U
[PROOFSTEP]
exact X.basicOpen_le _
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r))) ≫ f).op =
    comp
      (X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op)
      (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
rw [op_comp, op_comp, Functor.map_comp, Functor.map_comp]
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.Γ.map f.op ≫
      Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r)))).op =
    comp
      (X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op)
      (Scheme.Γ.map f.op ≫ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))).op)
[PROOFSTEP]
refine' (Eq.trans _ (Category.assoc (obj := CommRingCat) _ _ _).symm : _)
[GOAL]
case h.e'_5
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.Γ.map f.op ≫
      Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r)))).op =
    Scheme.Γ.map f.op ≫
      Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))).op ≫
        X.presheaf.map
          (homOfLE
              (_ :
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
                  (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op
[PROOFSTEP]
congr 1
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X r)))).op =
    Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))).op ≫
      X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op
[PROOFSTEP]
dsimp
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ X.presheaf.map
      (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).counit ⊤).op =
    X.presheaf.map (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit ⊤).op ≫
      X.presheaf.map
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)).op
[PROOFSTEP]
refine' Eq.trans _ (X.presheaf.map_comp _ _)
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ X.presheaf.map
      (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).counit ⊤).op =
    X.presheaf.map
      ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit ⊤).op ≫
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)).op)
[PROOFSTEP]
change X.presheaf.map _ = _
[GOAL]
case h.e'_5.e_a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ X.presheaf.map
      (NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).counit ⊤).op =
    X.presheaf.map
      ((NatTrans.app (IsOpenMap.adjunction (_ : IsOpenMap ↑(Opens.inclusion ↑U))).counit ⊤).op ≫
        (homOfLE
            (_ :
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ ≤
                (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)).op)
[PROOFSTEP]
congr!
  -- Porting note: need to pass Algebra through explicitly
[GOAL]
case hP₁.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ P
    (X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op)
[PROOFSTEP]
convert
  @HoldsForLocalizationAway _ hP _ (Scheme.Γ.obj (Opposite.op (X.restrict (X.basicOpen r).openEmbedding))) _ _ ?_
    (X.presheaf.map (eqToHom U.1.openEmbedding_obj_top).op r) ?_
[GOAL]
case h.e'_5.h.h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
e_1✝ :
  ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) =
    (fun x =>
        (forget CommRingCat).obj
          (X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
      r
he✝ :
  CommRingCat.instCommRingα (Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) =
    CommRingCat.instCommRing'
      (X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
⊢ X.presheaf.map
      (homOfLE
          (_ :
            (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj (Opposite.op ⊤).unop ≤
              (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj (Opposite.op ⊤).unop)).op =
    algebraMap
      ((fun x =>
          (forget CommRingCat).obj
            (X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))))
        r)
      ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
exact
  RingHom.algebraMap_toAlgebra (R := Scheme.Γ.obj <| Opposite.op <| X.restrict (U.1.openEmbedding)) (S :=
      Scheme.Γ.obj (Opposite.op <| X.restrict (X.affineBasicOpen r).1.openEmbedding)) _ |>.symm
[GOAL]
case hP₁.convert_2.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ IsLocalization.Away
    (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
    ↑(Scheme.Γ.obj (Opposite.op (Scheme.restrict X (_ : OpenEmbedding ↑(Opens.inclusion (Scheme.basicOpen X r))))))
[PROOFSTEP]
dsimp [Scheme.Γ]
[GOAL]
case hP₁.convert_2.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
⊢ IsLocalization.Away
    (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
    ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)))
[PROOFSTEP]
have := U.2
[GOAL]
case hP₁.convert_2.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : ↑U ∈ Scheme.affineOpens X
⊢ IsLocalization.Away
    (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
    ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)))
[PROOFSTEP]
rw [← U.1.openEmbedding_obj_top] at this 
[GOAL]
case hP₁.convert_2.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
⊢ IsLocalization.Away
    (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
    ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤)))
[PROOFSTEP]
convert (config := { typeEqs := true, transparency := .default }) isLocalization_basicOpen this _ using 5
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7✝ :
  Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤) =
    Opposite.op
      (RingedSpace.basicOpen X.toSheafedSpace
        (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
all_goals rw [Opens.openEmbedding_obj_top]; exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_4.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
⊢ Scheme.basicOpen X r =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_5.e'_2.e'_1.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
⊢ Scheme.basicOpen X r =
    Scheme.basicOpen X
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_2.h.e'_2.h.e'_6.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ Scheme.basicOpen X r =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_5.h.e'_7.h.e'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
⊢ Scheme.basicOpen X r =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7✝ :
  Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤) =
    Opposite.op
      (RingedSpace.basicOpen X.toSheafedSpace
        (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r))
⊢ (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤ =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
rw [Opens.openEmbedding_obj_top]
[GOAL]
case h.e'_6.e'_5.h.e'_8.e'_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H✝ : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
r : ↑(X.presheaf.obj (Opposite.op ↑U))
H : P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
this : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ ∈ Scheme.affineOpens X
e_4✝¹ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (Scheme.basicOpen X
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
e_5✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_1✝ :
  ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤))) =
    ↑(X.presheaf.obj (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤)))
e_2✝ :
  ↑(X.presheaf.obj
        (Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤))) =
    ↑(X.presheaf.obj
        (Opposite.op
          (RingedSpace.basicOpen X.toSheafedSpace
            (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op)
              r))))
he✝ : CommRing.toCommSemiring = CommRing.toCommSemiring
e_4✝ : HEq CommRing.toCommSemiring CommRing.toCommSemiring
e_7✝ :
  Opposite.op ((IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion (Scheme.basicOpen X r)))).obj ⊤) =
    Opposite.op
      (RingedSpace.basicOpen X.toSheafedSpace
        (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r))
⊢ Scheme.basicOpen X r =
    RingedSpace.basicOpen X.toSheafedSpace
      (↑(X.presheaf.map (eqToHom (_ : (IsOpenMap.functor (_ : IsOpenMap ↑(Opens.inclusion ↑U))).obj ⊤ = ↑U)).op) r)
[PROOFSTEP]
exact (Scheme.basicOpen_res_eq _ _ _).symm
[GOAL]
case hP₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑(Scheme.affineOpens X)) (s : Finset ↑(X.presheaf.obj (Opposite.op ↑U))),
    Ideal.span ↑s = ⊤ →
      (∀ (f_1 : { x // x ∈ s }),
          P
            (Scheme.Γ.map
              (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X ↑f_1))) ≫ f).op)) →
        P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
introv hs hs'
[GOAL]
case hP₂
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U✝ U : ↑(Scheme.affineOpens X)
s : Finset ↑(X.presheaf.obj (Opposite.op ↑U))
hs : Ideal.span ↑s = ⊤
hs' :
  ∀ (f_1 : { x // x ∈ s }),
    P
      (Scheme.Γ.map
        (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(Scheme.affineBasicOpen X ↑f_1))) ≫ f).op)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑U)) ≫ f).op)
[PROOFSTEP]
exact sourceAffineLocally_of_source_open_cover_aux hP.respectsIso hP.2 _ _ _ hs hs'
[GOAL]
case hS
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ⋃ (i : ↑(Set.range S)), ↑↑↑i = Set.univ
[PROOFSTEP]
rw [Set.eq_univ_iff_forall]
[GOAL]
case hS
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (x : ↑↑X.toPresheafedSpace), x ∈ ⋃ (i : ↑(Set.range S)), ↑↑↑i
[PROOFSTEP]
intro x
[GOAL]
case hS
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
x : ↑↑X.toPresheafedSpace
⊢ x ∈ ⋃ (i : ↑(Set.range S)), ↑↑↑i
[PROOFSTEP]
rw [Set.mem_iUnion]
[GOAL]
case hS
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
x : ↑↑X.toPresheafedSpace
⊢ ∃ i, x ∈ ↑↑↑i
[PROOFSTEP]
exact ⟨⟨_, 𝒰.f x, rfl⟩, 𝒰.Covers x⟩
[GOAL]
case hS'
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
⊢ ∀ (U : ↑(Set.range S)), P (Scheme.Γ.map (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑↑U)) ≫ f).op)
[PROOFSTEP]
rintro ⟨_, i, rfl⟩
[GOAL]
case hS'.mk.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
i : 𝒰.J
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑↑{ val := S i, property := (_ : ∃ y, S y = S i) })) ≫
          f).op)
[PROOFSTEP]
specialize H i
[GOAL]
case hS'.mk.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
i : 𝒰.J
H : P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑↑{ val := S i, property := (_ : ∃ y, S y = S i) })) ≫
          f).op)
[PROOFSTEP]
rw [←
  hP.respectsIso.cancel_right_isIso _
    (Scheme.Γ.map
      (IsOpenImmersion.isoOfRangeEq (𝒰.map i) (X.ofRestrict (S i).1.openEmbedding) Subtype.range_coe.symm).inv.op)] at
  H 
[GOAL]
case hS'.mk.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
S : 𝒰.J → { x // x ∈ Scheme.affineOpens X } :=
  fun i =>
    {
      val :=
        { carrier := Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base,
          is_open' := (_ : IsOpen (Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base)) },
      property := (_ : IsAffineOpen (Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))) }
U : ↑(Scheme.affineOpens X)
i : 𝒰.J
H :
  P
    (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op ≫
      Scheme.Γ.map
        (IsOpenImmersion.isoOfRangeEq (Scheme.OpenCover.map 𝒰 i)
              (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑(S i))))
              (_ : Set.range ↑(Scheme.OpenCover.map 𝒰 i).val.base = Set.range Subtype.val)).inv.op)
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ↑↑{ val := S i, property := (_ : ∃ y, S y = S i) })) ≫
          f).op)
[PROOFSTEP]
rwa [← Scheme.Γ.map_comp, ← op_comp, IsOpenImmersion.isoOfRangeEq_inv, IsOpenImmersion.lift_fac_assoc] at H 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
        P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)]
[PROOFSTEP]
tfae_have 1 → 4
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
⊢ sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
intro H U g _ hg
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
H : sourceAffineLocally P f
U : Scheme
g : U ⟶ X
inst✝ : IsAffine U
hg : IsOpenImmersion g
⊢ P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
H : sourceAffineLocally P f
U : Scheme
g : U ⟶ X
inst✝ : IsAffine U
hg : IsOpenImmersion g
⊢ P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
specialize H ⟨⟨_, hg.base_open.open_range⟩, rangeIsAffineOpenOfOpenImmersion g⟩
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
U : Scheme
g : U ⟶ X
inst✝ : IsAffine U
hg : IsOpenImmersion g
H :
  P
    (Scheme.Γ.map
      (Scheme.ofRestrict X
            (_ :
              OpenEmbedding
                ↑(Opens.inclusion
                    ↑{ val := { carrier := Set.range ↑g.val.base, is_open' := (_ : IsOpen (Set.range ↑g.val.base)) },
                        property := (_ : IsAffineOpen (Scheme.Hom.opensRange g)) })) ≫
          f).op)
⊢ P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
rw [←
  hP.respectsIso.cancel_right_isIso _
    (Scheme.Γ.map
      (IsOpenImmersion.isoOfRangeEq g (X.ofRestrict (Opens.openEmbedding ⟨_, hg.base_open.open_range⟩))
          Subtype.range_coe.symm).hom.op),
  ← Scheme.Γ.map_comp, ← op_comp, IsOpenImmersion.isoOfRangeEq_hom] at H 
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
U : Scheme
g : U ⟶ X
inst✝ : IsAffine U
hg : IsOpenImmersion g
H :
  P
    (Scheme.Γ.map
      (IsOpenImmersion.lift
            (Scheme.ofRestrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      { carrier := Set.range ↑g.val.base, is_open' := (_ : IsOpen (Set.range ↑g.val.base)) })))
            g
            (_ :
              Set.range ↑g.val.base ≤
                Set.range
                  ↑(Scheme.ofRestrict X
                          (_ :
                            OpenEmbedding
                              ↑(Opens.inclusion
                                  { carrier := Set.range ↑g.val.base,
                                    is_open' := (_ : IsOpen (Set.range ↑g.val.base)) }))).val.base) ≫
          Scheme.ofRestrict X
              (_ :
                OpenEmbedding
                  ↑(Opens.inclusion
                      ↑{ val := { carrier := Set.range ↑g.val.base, is_open' := (_ : IsOpen (Set.range ↑g.val.base)) },
                          property := (_ : IsAffineOpen (Scheme.Hom.opensRange g)) })) ≫
            f).op)
⊢ P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
erw [IsOpenImmersion.lift_fac_assoc] at H 
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
U : Scheme
g : U ⟶ X
inst✝ : IsAffine U
hg : IsOpenImmersion g
H : P (Scheme.Γ.map (g ≫ f).op)
⊢ P (Scheme.Γ.map (g ≫ f).op)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
        P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)]
[PROOFSTEP]
tfae_have 4 → 3
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
⊢ (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
intro H 𝒰 _ i
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
i : 𝒰.J
⊢ P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝¹ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
i : 𝒰.J
⊢ P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
        P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)]
[PROOFSTEP]
tfae_have 3 → 2
[GOAL]
case tfae_3_to_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ (∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) →
    ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
intro H
[GOAL]
case tfae_3_to_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
H :
  ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
    P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
refine' ⟨X.affineCover, inferInstance, H _⟩
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) →
    ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
        P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)]
[PROOFSTEP]
tfae_have 2 → 1
[GOAL]
case tfae_2_to_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) →
    ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ (∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) → sourceAffineLocally P f
[PROOFSTEP]
rintro ⟨𝒰, _, h𝒰⟩
[GOAL]
case tfae_2_to_1.intro.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) →
    ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
𝒰 : Scheme.OpenCover X
w✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
h𝒰 : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ sourceAffineLocally P f
[PROOFSTEP]
exact sourceAffineLocally_of_source_openCover hP f 𝒰 h𝒰
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f →
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)) →
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) →
    ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
tfae_2_to_1 : (∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) → sourceAffineLocally P f
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
        P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)]
[PROOFSTEP]
tfae_finish
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)]
[PROOFSTEP]
tfae_have 1 → 4
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
⊢ sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
[PROOFSTEP]
intro H U g hg V
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : sourceAffineLocally P f
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g ≫ f).op)
[PROOFSTEP]
skip
  -- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : sourceAffineLocally P f
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g ≫ f).op)
[PROOFSTEP]
have := (hP.affine_openCover_TFAE f).out 0 3
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : sourceAffineLocally P f
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
this :
  sourceAffineLocally P f ↔
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g ≫ f).op)
[PROOFSTEP]
rw [this] at H 
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
this :
  sourceAffineLocally P f ↔
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
⊢ P (Scheme.Γ.map (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g ≫ f).op)
[PROOFSTEP]
haveI : IsAffine _ := V.2
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
this✝ :
  sourceAffineLocally P f ↔
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
this : IsAffine (Scheme.restrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)))
⊢ P (Scheme.Γ.map (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g ≫ f).op)
[PROOFSTEP]
rw [← Category.assoc]
  -- Porting note: Lean could find this previously
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
this✝ :
  sourceAffineLocally P f ↔
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
this : IsAffine (Scheme.restrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)))
⊢ P (Scheme.Γ.map ((Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g) ≫ f).op)
[PROOFSTEP]
have : IsOpenImmersion <| (Scheme.ofRestrict U (Opens.openEmbedding V.val)) ≫ g :=
  LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case tfae_1_to_4
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
U : Scheme
g : U ⟶ X
hg : IsOpenImmersion g
V : ↑(Scheme.affineOpens U)
this✝¹ :
  sourceAffineLocally P f ↔
    ∀ {U : Scheme} (g : U ⟶ X) [inst : IsAffine U] [inst : IsOpenImmersion g], P (Scheme.Γ.map (g ≫ f).op)
this✝ : IsAffine (Scheme.restrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)))
this : IsOpenImmersion (Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g)
⊢ P (Scheme.Γ.map ((Scheme.ofRestrict U (_ : OpenEmbedding ↑(Opens.inclusion ↑V)) ≫ g) ≫ f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)]
[PROOFSTEP]
tfae_have 4 → 3
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
⊢ (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
[PROOFSTEP]
intro H 𝒰 _ i
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
𝒰 : Scheme.OpenCover X
i✝ : 𝒰.J
i : ↑(Scheme.affineOpens (Scheme.OpenCover.obj 𝒰 i✝))
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict (Scheme.OpenCover.obj 𝒰 i✝) (_ : OpenEmbedding ↑(Opens.inclusion ↑i)) ≫
          Scheme.OpenCover.map 𝒰 i✝ ≫ f).op)
[PROOFSTEP]
skip
[GOAL]
case tfae_4_to_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
H : ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
𝒰 : Scheme.OpenCover X
i✝ : 𝒰.J
i : ↑(Scheme.affineOpens (Scheme.OpenCover.obj 𝒰 i✝))
⊢ P
    (Scheme.Γ.map
      (Scheme.ofRestrict (Scheme.OpenCover.obj 𝒰 i✝) (_ : OpenEmbedding ↑(Opens.inclusion ↑i)) ≫
          Scheme.OpenCover.map 𝒰 i✝ ≫ f).op)
[PROOFSTEP]
apply H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)]
[PROOFSTEP]
tfae_have 3 → 2
[GOAL]
case tfae_3_to_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
[PROOFSTEP]
intro H
[GOAL]
case tfae_3_to_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
H : ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
[PROOFSTEP]
refine' ⟨X.affineCover, H _⟩
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)]
[PROOFSTEP]
tfae_have 2 → 1
[GOAL]
case tfae_2_to_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ (∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) → sourceAffineLocally P f
[PROOFSTEP]
rintro
  ⟨𝒰, h𝒰⟩
      -- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
⊢ sourceAffineLocally P f
[PROOFSTEP]
have := (hP.affine_openCover_TFAE f).out 0 1
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ sourceAffineLocally P f
[PROOFSTEP]
rw [this]
[GOAL]
case tfae_2_to_1.intro
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
refine' ⟨𝒰.bind fun _ => Scheme.affineCover _, _, _⟩
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ ∀ (i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J),
    IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i)
[PROOFSTEP]
intro i
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
⊢ IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i)
[PROOFSTEP]
dsimp
[GOAL]
case tfae_2_to_1.intro.refine'_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
⊢ IsAffine (Scheme.OpenCover.obj (Scheme.affineCover (Scheme.OpenCover.obj 𝒰 i.fst)) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ ∀ (i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J),
    P
      (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i ≫
            f).op)
[PROOFSTEP]
intro i
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
h𝒰 : ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i ≫ f).op)
[PROOFSTEP]
specialize
  h𝒰
    i.1
      -- Porting note: this has metavariable if I put it directly into rw
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 : sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i ≫ f).op)
[PROOFSTEP]
have := (hP.affine_openCover_TFAE (𝒰.map i.fst ≫ f)).out 0 3
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 : sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f)
this :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i ≫ f).op)
[PROOFSTEP]
rw [this] at h𝒰 
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 :
  ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
    P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i ≫ f).op)
[PROOFSTEP]
erw [Category.assoc]
  -- Porting note: this was discharged after the apply previously
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 :
  ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
    P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map ((fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i.fst) i.snd ≫
          Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
[PROOFSTEP]
have :
  IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind 𝒰 fun x ↦ Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i) :=
  by dsimp; infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 :
  ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
    P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
⊢ IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 :
  ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
    P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
⊢ IsAffine (Scheme.OpenCover.obj (Scheme.affineCover (Scheme.OpenCover.obj 𝒰 i.fst)) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
case tfae_2_to_1.intro.refine'_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
𝒰 : Scheme.OpenCover X
this✝¹ : sourceAffineLocally P f ↔ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
i : (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)).J
h𝒰 :
  ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
    P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this✝ :
  sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i.fst ≫ f) ↔
    ∀ {U : Scheme} (g : U ⟶ Scheme.OpenCover.obj 𝒰 i.fst) [inst : IsAffine U] [inst : IsOpenImmersion g],
      P (Scheme.Γ.map (g ≫ Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
this :
  IsAffine (Scheme.OpenCover.obj (Scheme.OpenCover.bind 𝒰 fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map ((fun x => Scheme.affineCover (Scheme.OpenCover.obj 𝒰 x)) i.fst) i.snd ≫
          Scheme.OpenCover.map 𝒰 i.fst ≫ f).op)
[PROOFSTEP]
apply @h𝒰 _ (show _ from _)
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
inst✝ : IsAffine Y
f : X ⟶ Y
tfae_1_to_4 :
  sourceAffineLocally P f → ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)
tfae_4_to_3 :
  (∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)) →
    ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_3_to_2 :
  (∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) →
    ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) → sourceAffineLocally P f
⊢ List.TFAE
    [sourceAffineLocally P f, ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ (𝒰 : Scheme.OpenCover X) (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f),
      ∀ {U : Scheme} (g : U ⟶ X) [inst : IsOpenImmersion g], sourceAffineLocally P (g ≫ f)]
[PROOFSTEP]
tfae_finish
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y Z : Scheme
inst✝¹ : IsAffine Z
f : X ⟶ Y
g : Y ⟶ Z
inst✝ : IsOpenImmersion f
H : sourceAffineLocally P g
⊢ sourceAffineLocally P (f ≫ g)
[PROOFSTEP]
have := (hP.openCover_TFAE g).out 0 3
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y Z : Scheme
inst✝¹ : IsAffine Z
f : X ⟶ Y
g : Y ⟶ Z
inst✝ : IsOpenImmersion f
H : sourceAffineLocally P g
this :
  sourceAffineLocally P g ↔ ∀ {U : Scheme} (g_1 : U ⟶ Y) [inst : IsOpenImmersion g_1], sourceAffineLocally P (g_1 ≫ g)
⊢ sourceAffineLocally P (f ≫ g)
[PROOFSTEP]
apply this.mp H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
⊢ sourceAffineLocally P f ↔ ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
refine ⟨fun H => ?_, fun H => ?_⟩
[GOAL]
case refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : sourceAffineLocally P f
⊢ ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
have h := (hP.affine_openCover_TFAE f).out 0 2
[GOAL]
case refine_1
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : sourceAffineLocally P f
h :
  sourceAffineLocally P f ↔
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
apply h.mp
[GOAL]
case refine_1.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : sourceAffineLocally P f
h :
  sourceAffineLocally P f ↔
    ∀ (𝒰 : Scheme.OpenCover X) [inst : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)] (i : 𝒰.J),
      P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ sourceAffineLocally P f
[PROOFSTEP]
exact H
[GOAL]
case refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
⊢ sourceAffineLocally P f
[PROOFSTEP]
have h := (hP.affine_openCover_TFAE f).out 1 0
[GOAL]
case refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
h : (∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) ↔ sourceAffineLocally P f
⊢ sourceAffineLocally P f
[PROOFSTEP]
apply h.mp
[GOAL]
case refine_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
inst✝¹ : IsAffine Y
𝒰 : Scheme.OpenCover X
inst✝ : ∀ (i : 𝒰.J), IsAffine (Scheme.OpenCover.obj 𝒰 i)
H : ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
h : (∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)) ↔ sourceAffineLocally P f
⊢ ∃ 𝒰 x, ∀ (i : 𝒰.J), P (Scheme.Γ.map (Scheme.OpenCover.map 𝒰 i ≫ f).op)
[PROOFSTEP]
use 𝒰
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
⊢ affineLocally P f ↔ ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
[PROOFSTEP]
constructor
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
⊢ affineLocally P f → ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
[PROOFSTEP]
intro H i U
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P ((Scheme.OpenCover.map 𝒰 i ≫ f) ∣_ ↑U)
[PROOFSTEP]
rw [morphismRestrict_comp]
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P ((Scheme.OpenCover.map 𝒰 i ∣_ (Opens.map f.val.base).obj ↑U) ≫ f ∣_ ↑U)
[PROOFSTEP]
delta morphismRestrict
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
[PROOFSTEP]
have : IsAffine (Scheme.restrict Y <| Opens.openEmbedding U.val) := U.property
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
[PROOFSTEP]
have :
  IsOpenImmersion
    ((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) :=
  LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case mp
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
this✝ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
this :
  IsOpenImmersion
    ((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd)
⊢ sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
[PROOFSTEP]
apply hP.sourceAffineLocally_comp_of_isOpenImmersion
[GOAL]
case mp.H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : affineLocally P f
i : 𝒰.J
U : ↑(Scheme.affineOpens Y)
this✝ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
this :
  IsOpenImmersion
    ((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd)
⊢ sourceAffineLocally P ((pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
[PROOFSTEP]
apply H
[GOAL]
case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
⊢ (∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)) → affineLocally P f
[PROOFSTEP]
intro H U
[GOAL]
case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P (f ∣_ ↑U)
[PROOFSTEP]
haveI : IsAffine _ := U.2
[GOAL]
case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ sourceAffineLocally P (f ∣_ ↑U)
[PROOFSTEP]
apply ((hP.openCover_TFAE (f ∣_ U.1)).out 1 0).mp
[GOAL]
case mpr
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ ∃ 𝒰, ∀ (i : 𝒰.J), sourceAffineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f ∣_ ↑U)
[PROOFSTEP]
use 𝒰.pullbackCover (X.ofRestrict _)
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ ∀
    (i :
      (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J),
    sourceAffineLocally P
      (Scheme.OpenCover.map
          (Scheme.OpenCover.pullbackCover 𝒰
            (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
          i ≫
        f ∣_ ↑U)
[PROOFSTEP]
intro i
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
H : ∀ (i : 𝒰.J), affineLocally P (Scheme.OpenCover.map 𝒰 i ≫ f)
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
specialize H i U
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
H : sourceAffineLocally P ((Scheme.OpenCover.map 𝒰 i ≫ f) ∣_ ↑U)
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
rw [morphismRestrict_comp] at H 
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
H : sourceAffineLocally P ((Scheme.OpenCover.map 𝒰 i ∣_ (Opens.map f.val.base).obj ↑U) ≫ f ∣_ ↑U)
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
delta morphismRestrict at H 
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
U : ↑(Scheme.affineOpens Y)
this : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
have := sourceAffineLocally_respectsIso hP.respectsIso
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
U : ↑(Scheme.affineOpens Y)
this✝ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
H :
  sourceAffineLocally P
    (((pullbackRestrictIsoRestrict (Scheme.OpenCover.map 𝒰 i) ((Opens.map f.val.base).obj ↑U)).inv ≫ pullback.snd) ≫
      (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
rw [Category.assoc, affine_cancel_left_isIso this, ← affine_cancel_left_isIso this (pullbackSymmetry _ _).hom,
  pullbackSymmetry_hom_comp_snd_assoc] at H 
[GOAL]
case h
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover X
U : ↑(Scheme.affineOpens Y)
this✝ : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i :
  (Scheme.OpenCover.pullbackCover 𝒰
      (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U))))).J
H✝ : sourceAffineLocally P (pullback.snd ≫ (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
H : sourceAffineLocally P (pullback.fst ≫ (pullbackRestrictIsoRestrict f ↑U).inv ≫ pullback.snd)
this : MorphismProperty.RespectsIso (AffineTargetMorphismProperty.toProperty (sourceAffineLocally P))
⊢ sourceAffineLocally P
    (Scheme.OpenCover.map
        (Scheme.OpenCover.pullbackCover 𝒰
          (Scheme.ofRestrict X (_ : OpenEmbedding ↑(Opens.inclusion ((Opens.map f.val.base).obj ↑U)))))
        i ≫
      f ∣_ ↑U)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
⊢ affineLocally P f
[PROOFSTEP]
intro U
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
⊢ sourceAffineLocally P (f ∣_ ↑U)
[PROOFSTEP]
haveI H : IsAffine _ := U.2
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ sourceAffineLocally P (f ∣_ ↑U)
[PROOFSTEP]
rw [← Category.comp_id (f ∣_ U)]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ sourceAffineLocally P ((f ∣_ ↑U) ≫ 𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
[PROOFSTEP]
apply hP.sourceAffineLocally_comp_of_isOpenImmersion
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ sourceAffineLocally P (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
[PROOFSTEP]
rw [@source_affine_openCover_iff _ hP _ _ _ _ (Scheme.openCoverOfIsIso (𝟙 _)) (_)]
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ ∀ (i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J),
    P
      (Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) i ≫
            𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))).op)
[PROOFSTEP]
intro i
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
            i ≫
          𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))).op)
[PROOFSTEP]
erw [Category.id_comp, op_id, Scheme.Γ.map_id]
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
⊢ P (𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))))
[PROOFSTEP]
let esto := Scheme.Γ.obj (Opposite.op (Y.restrict <| Opens.openEmbedding U.val))
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
⊢ P (𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))))
[PROOFSTEP]
let eso :=
  Scheme.Γ.obj
    (Opposite.op ((Scheme.openCoverOfIsIso (𝟙 (Y.restrict <| Opens.openEmbedding U.val))).obj i))
      -- Porting note: Lean this needed this spelled out before
          -- convert hP.HoldsAwayLocalizationAway _ (1 : Scheme.Γ.obj _) _
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
⊢ P (𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))))
[PROOFSTEP]
have : 𝟙 (Scheme.Γ.obj (Opposite.op (Y.restrict <| Opens.openEmbedding U.val))) = @algebraMap esto eso _ _ (_) :=
  (RingHom.algebraMap_toAlgebra _).symm
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
this :
  𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) = algebraMap ↑esto ↑eso
⊢ P (𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))))
[PROOFSTEP]
rw [this]
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
this :
  𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) = algebraMap ↑esto ↑eso
⊢ P (algebraMap ↑esto ↑eso)
[PROOFSTEP]
have := hP.HoldsForLocalizationAway
[GOAL]
case H
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
this✝ :
  𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) = algebraMap ↑esto ↑eso
this : RingHom.HoldsForLocalizationAway P
⊢ P (algebraMap ↑esto ↑eso)
[PROOFSTEP]
convert @this esto eso _ _ ?_ ?_ ?_
[GOAL]
case H.convert_2
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
this✝ :
  𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) = algebraMap ↑esto ↑eso
this : RingHom.HoldsForLocalizationAway P
⊢ ↑esto
[PROOFSTEP]
exact
  1
    -- Porting note: again we have to bypass TC synthesis to keep Lean from running away
[GOAL]
case H.convert_3
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
esto : CommRingCat := Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))
eso : CommRingCat :=
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i))
this✝ :
  𝟙 (Scheme.Γ.obj (Opposite.op (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))) = algebraMap ↑esto ↑eso
this : RingHom.HoldsForLocalizationAway P
⊢ IsLocalization.Away 1 ↑eso
[PROOFSTEP]
refine' @IsLocalization.away_of_isUnit_of_bijective _ _ _ _ (_) _ isUnit_one Function.bijective_id
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
⊢ ∀ (i : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J),
    IsAffine
      (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
        i)
[PROOFSTEP]
intro
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP✝ hP : PropertyIsLocal P
X Y : Scheme
f : X ⟶ Y
hf : IsOpenImmersion f
U : ↑(Scheme.affineOpens Y)
H : IsAffine (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))
i✝ : (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U))))).J
⊢ IsAffine
    (Scheme.OpenCover.obj (Scheme.openCoverOfIsIso (𝟙 (Scheme.restrict Y (_ : OpenEmbedding ↑(Opens.inclusion ↑U)))))
      i✝)
[PROOFSTEP]
exact H
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
⊢ affineLocally P f
[PROOFSTEP]
let 𝒰 : ∀ i, ((Z.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  by
  intro i
  refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
  apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
  apply Scheme.Pullback.openCoverOfRight
  exact (pullback g (Z.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
⊢ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
    Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i)
[PROOFSTEP]
intro i
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J
⊢ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i)
[PROOFSTEP]
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J
⊢ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i)
[PROOFSTEP]
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (Z.affineCover.map i) f).hom
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J
⊢ Scheme.OpenCover (pullback f pullback.fst)
[PROOFSTEP]
apply Scheme.Pullback.openCoverOfRight
[GOAL]
case 𝒰
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J
⊢ Scheme.OpenCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))
[PROOFSTEP]
exact (pullback g (Z.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
⊢ affineLocally P f
[PROOFSTEP]
have h𝒰 : ∀ i j, IsAffine ((𝒰 i).obj j) := by dsimp; infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.affineCover Z).J)
    (j :
      (i_1 : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J) ×
        (Scheme.affineCover
            (pullback f
              (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                  i_1 ≫
                pullback.fst))).J),
    IsAffine
      (Scheme.OpenCover.obj
        (Scheme.affineCover
          (pullback f
            (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                j.fst ≫
              pullback.fst)))
        j.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
⊢ affineLocally P f
[PROOFSTEP]
let 𝒰' := (Z.affineCover.pullbackCover g).bind fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
⊢ affineLocally P f
[PROOFSTEP]
have h𝒰' : ∀ i, IsAffine (𝒰'.obj i) := by dsimp; infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
⊢ ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
[PROOFSTEP]
dsimp
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
⊢ ∀
    (i :
      (i : (Scheme.affineCover Z).J) ×
        (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J),
    IsAffine
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i.fst))) i.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
⊢ affineLocally P f
[PROOFSTEP]
rw [hP.affine_openCover_iff f 𝒰' fun i => Scheme.affineCover _]
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
h : affineLocally P (f ≫ g)
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover 𝒰' f).J)
    (j : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) i)).J),
    P
      (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) i)) j ≫
            pullback.snd).op)
[PROOFSTEP]
rw [hP.affine_openCover_iff (f ≫ g) Z.affineCover 𝒰] at h 
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) j ≫ pullback.snd).op)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover 𝒰' f).J)
    (j : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) i)).J),
    P
      (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) i)) j ≫
            pullback.snd).op)
[PROOFSTEP]
rintro ⟨i, j⟩ k
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) j ≫ pullback.snd).op)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g).J
j :
  ((fun i => Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)) i).J
k : (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) { fst := i, snd := j })).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) { fst := i, snd := j })) k ≫
          pullback.snd).op)
[PROOFSTEP]
dsimp at i j k 
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) j ≫ pullback.snd).op)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) { fst := i, snd := j })) k ≫
          pullback.snd).op)
[PROOFSTEP]
specialize h i ⟨j, k⟩
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h : P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) { fst := j, snd := k } ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover 𝒰' f) { fst := i, snd := j })) k ≫
          pullback.snd).op)
[PROOFSTEP]
dsimp only [Scheme.OpenCover.bind_map, Scheme.OpenCover.pushforwardIso_obj, Scheme.Pullback.openCoverOfRight_obj,
  Scheme.OpenCover.pushforwardIso_map, Scheme.Pullback.openCoverOfRight_map, Scheme.OpenCover.bind_obj,
  Scheme.OpenCover.pullbackCover_obj, Scheme.OpenCover.pullbackCover_map] at h ⊢
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h :
  P
    (Scheme.Γ.map
      ((Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.map f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                    j ≫
                  pullback.fst)
                f pullback.fst (𝟙 X)
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                  j)
                (𝟙 Y) (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f)
                (_ :
                  (Scheme.OpenCover.map
                          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                        pullback.fst) ≫
                      𝟙 Y =
                    Scheme.OpenCover.map
                        (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                      pullback.fst) ≫
              (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom) ≫
          pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
rw [Category.assoc, Category.assoc, pullbackRightPullbackFstIso_hom_snd, pullback.lift_snd_assoc, Category.assoc, ←
  Category.assoc, op_comp, Functor.map_comp] at h 
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h :
  P
    (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
            pullback.snd).op ≫
      Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
let f' :=
  Scheme.Γ.map
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
        pullback.snd).op
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h :
  P
    (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
            pullback.snd).op ≫
      Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.snd).op)
f' : Scheme.Γ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) ⟶
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
  Scheme.Γ.map
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
        pullback.snd).op
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
let g' :=
  Scheme.Γ.map
    (Scheme.OpenCover.map
          (Scheme.affineCover
            (pullback f
              (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                  j ≫
                pullback.fst)))
          k ≫
        pullback.snd).op
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h :
  P
    (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
            pullback.snd).op ≫
      Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.snd).op)
f' : Scheme.Γ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) ⟶
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
  Scheme.Γ.map
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
        pullback.snd).op
g' : Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) ⟶
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj
        (Scheme.affineCover
          (pullback f
            (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
              pullback.fst)))
        k)) :=
  Scheme.Γ.map
    (Scheme.OpenCover.map
          (Scheme.affineCover
            (pullback f
              (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                  j ≫
                pullback.fst)))
          k ≫
        pullback.snd).op
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
convert H f' g' ?_
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
H :
  ∀ {R S T : Type u} [inst : CommRing R] [inst_1 : CommRing S] [inst_2 : CommRing T] (f : R →+* S) (g : S →+* T),
    P (comp g f) → P g
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover Z) i) f).hom)
          i_1)
h𝒰 :
  ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
𝒰' : Scheme.OpenCover Y :=
  Scheme.OpenCover.bind (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) fun i =>
    Scheme.affineCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover Z) g) i)
h𝒰' : ∀ (i : 𝒰'.J), IsAffine (Scheme.OpenCover.obj 𝒰' i)
i : (Scheme.affineCover Z).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
          pullback.fst))).J
h :
  P
    (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
            pullback.snd).op ≫
      Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.snd).op)
f' : Scheme.Γ.obj (Opposite.op (Scheme.OpenCover.obj (Scheme.affineCover Z) i)) ⟶
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) :=
  Scheme.Γ.map
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
        pullback.snd).op
g' : Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j)) ⟶
  Scheme.Γ.obj
    (Opposite.op
      (Scheme.OpenCover.obj
        (Scheme.affineCover
          (pullback f
            (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i))) j ≫
              pullback.fst)))
        k)) :=
  Scheme.Γ.map
    (Scheme.OpenCover.map
          (Scheme.affineCover
            (pullback f
              (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover Z) i)))
                  j ≫
                pullback.fst)))
          k ≫
        pullback.snd).op
⊢ P (comp g' f')
[PROOFSTEP]
exact h
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
⊢ MorphismProperty.StableUnderComposition (affineLocally P)
[PROOFSTEP]
intro X Y S f g hf hg
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
⊢ affineLocally P (f ≫ g)
[PROOFSTEP]
let 𝒰 : ∀ i, ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  by
  intro i
  refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
  apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom
  apply Scheme.Pullback.openCoverOfRight
  exact (pullback g (S.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
⊢ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
    Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i)
[PROOFSTEP]
intro i
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
⊢ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i)
[PROOFSTEP]
refine' Scheme.OpenCover.bind _ fun i => Scheme.affineCover _
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
⊢ Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i)
[PROOFSTEP]
apply Scheme.OpenCover.pushforwardIso _ (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
⊢ Scheme.OpenCover (pullback f pullback.fst)
[PROOFSTEP]
apply Scheme.Pullback.openCoverOfRight
[GOAL]
case 𝒰
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
⊢ Scheme.OpenCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))
[PROOFSTEP]
exact (pullback g (S.affineCover.map i)).affineCover
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ affineLocally P (f ≫ g)
[PROOFSTEP]
apply (@affine_openCover_iff _ hP _ _ (f ≫ g) S.affineCover _ ?_ ?_).mpr
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) (j : (?m.591569 i).J),
    P (Scheme.Γ.map (Scheme.OpenCover.map (?m.591569 i) j ≫ pullback.snd).op)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
    Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i)
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) (j : (?m.591569 i).J),
    IsAffine (Scheme.OpenCover.obj (?m.591569 i) j)
[PROOFSTEP]
rotate_left
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
    Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i)
[PROOFSTEP]
exact 𝒰
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) (j : (𝒰 i).J),
    IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
[PROOFSTEP]
intro i j
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine (Scheme.OpenCover.obj (𝒰 i) j)
[PROOFSTEP]
dsimp at *
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine
    (Scheme.OpenCover.obj
      (Scheme.affineCover
        (pullback f
          (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
              j.fst ≫
            pullback.fst)))
      j.snd)
[PROOFSTEP]
infer_instance
[GOAL]
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
⊢ ∀ (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) (j : (𝒰 i).J),
    P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) j ≫ pullback.snd).op)
[PROOFSTEP]
rintro i ⟨j, k⟩
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J
j :
  (Scheme.OpenCover.pushforwardIso
      (Scheme.Pullback.openCoverOfRight
        (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
      (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom).J
k :
  ((fun i_1 =>
        Scheme.affineCover
          (Scheme.OpenCover.obj
            (Scheme.OpenCover.pushforwardIso
              (Scheme.Pullback.openCoverOfRight
                (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
              (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
            i_1))
      j).J
⊢ P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) { fst := j, snd := k } ≫ pullback.snd).op)
[PROOFSTEP]
dsimp at i j k 
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P (Scheme.Γ.map (Scheme.OpenCover.map (𝒰 i) { fst := j, snd := k } ≫ pullback.snd).op)
[PROOFSTEP]
dsimp only [Scheme.OpenCover.bind_map, Scheme.OpenCover.pushforwardIso_obj, Scheme.Pullback.openCoverOfRight_obj,
  Scheme.OpenCover.pushforwardIso_map, Scheme.Pullback.openCoverOfRight_map, Scheme.OpenCover.bind_obj]
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
      ((Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.map f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)
                f pullback.fst (𝟙 X)
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                  j)
                (𝟙 Y) (_ : f ≫ 𝟙 Y = 𝟙 X ≫ f)
                (_ :
                  (Scheme.OpenCover.map
                          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
                        pullback.fst) ≫
                      𝟙 Y =
                    Scheme.OpenCover.map
                        (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
                      pullback.fst) ≫
              (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom) ≫
          pullback.snd).op)
[PROOFSTEP]
rw [Category.assoc, Category.assoc, pullbackRightPullbackFstIso_hom_snd, pullback.lift_snd_assoc, Category.assoc, ←
  Category.assoc, op_comp, Functor.map_comp]
[GOAL]
case mk
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
            pullback.snd).op ≫
      Scheme.Γ.map
        (Scheme.OpenCover.map
              (Scheme.affineCover
                (pullback f
                  (Scheme.OpenCover.map
                      (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
                    pullback.fst)))
              k ≫
            pullback.snd).op)
[PROOFSTEP]
apply hP.StableUnderComposition
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.snd).op)
[PROOFSTEP]
apply hP.affine_openCover_iff _ _ _ |>.mp
[GOAL]
case mk.x.a
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ affineLocally P g
[PROOFSTEP]
exact hg
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : affineLocally P f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
delta affineLocally at hf 
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : targetAffineLocally (sourceAffineLocally P) f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
have := (hP.isLocal_sourceAffineLocally.affine_openCover_TFAE f).out 0 3
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : targetAffineLocally (sourceAffineLocally P) f
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
rw [this] at hf 
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
have : IsOpenImmersion <| ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst) :=
  LocallyRingedSpace.IsOpenImmersion.comp _ _
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hf : ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this :
  IsOpenImmersion
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
      pullback.fst)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
specialize
  hf
    ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
      -- Porting note: again strange behavior of TFAE
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this :
  IsOpenImmersion
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
      pullback.fst)
hf : sourceAffineLocally P pullback.snd
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
have :=
  (hP.affine_openCover_TFAE
        (pullback.snd : pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst) ⟶ _)).out
    0 3
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ :
  IsOpenImmersion
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
      pullback.fst)
hf : sourceAffineLocally P pullback.snd
this :
  sourceAffineLocally P pullback.snd ↔
    ∀ {U : Scheme}
      (g_1 :
        U ⟶
          pullback f
            (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
              pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
rw [this] at hf 
[GOAL]
case mk.x
P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop
hP : PropertyIsLocal P
X Y S : Scheme
f : X ⟶ Y
g : Y ⟶ S
hg : affineLocally P g
𝒰 : (i : (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)).J) →
  Scheme.OpenCover (Scheme.OpenCover.obj (Scheme.OpenCover.pullbackCover (Scheme.affineCover S) (f ≫ g)) i) :=
  fun i =>
    Scheme.OpenCover.bind
      (Scheme.OpenCover.pushforwardIso
        (Scheme.Pullback.openCoverOfRight
          (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
        (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
      fun i_1 =>
      Scheme.affineCover
        (Scheme.OpenCover.obj
          (Scheme.OpenCover.pushforwardIso
            (Scheme.Pullback.openCoverOfRight
              (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) f pullback.fst)
            (pullbackRightPullbackFstIso g (Scheme.OpenCover.map (Scheme.affineCover S) i) f).hom)
          i_1)
i : (Scheme.affineCover S).J
j : (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))).J
k :
  (Scheme.affineCover
      (pullback f
        (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
          pullback.fst))).J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ :
  IsOpenImmersion
    (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
      pullback.fst)
hf :
  ∀ {U : Scheme}
    (g_1 :
      U ⟶
        pullback f
          (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
            pullback.fst))
    [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
this :
  sourceAffineLocally P pullback.snd ↔
    ∀ {U : Scheme}
      (g_1 :
        U ⟶
          pullback f
            (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i))) j ≫
              pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      (Scheme.OpenCover.map
            (Scheme.affineCover
              (pullback f
                (Scheme.OpenCover.map (Scheme.affineCover (pullback g (Scheme.OpenCover.map (Scheme.affineCover S) i)))
                    j ≫
                  pullback.fst)))
            k ≫
          pullback.snd).op)
[PROOFSTEP]
apply hf
