Theorem: AlgebraicGeometry.AffineTargetMorphismProperty.IsLocal.targetAffineLocally_isLocal
File: Mathlib/AlgebraicGeometry/Morphisms/Basic.lean

tactic: constructor
state_before: P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ PropertyIsLocalAtTarget (targetAffineLocally P)
state_after: case RespectsIso
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ (targetAffineLocally P).RespectsIso

case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ ∀ {X Y : Scheme} (f : X ⟶ Y) (U : Opens ↑↑Y.toPresheafedSpace),
    targetAffineLocally P f → targetAffineLocally P (f ∣_ U)

case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ ∀ {X Y : Scheme} (f : X ⟶ Y) (𝒰 : Y.OpenCover),
    (∀ (i : 𝒰.J), targetAffineLocally P pullback.snd) → targetAffineLocally P f

tactic: exact targetAffineLocally_respectsIso hP.1
state_before: case RespectsIso
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ (targetAffineLocally P).RespectsIso
state_after: no goals

tactic: intro X Y f U H V
state_before: case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ ∀ {X Y : Scheme} (f : X ⟶ Y) (U : Opens ↑↑Y.toPresheafedSpace),
    targetAffineLocally P f → targetAffineLocally P (f ∣_ U)
state_after: case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P (f ∣_ U ∣_ ↑V)

tactic: rw [← P.toProperty_apply (i := V.2), hP.1.arrow_mk_iso_iff (morphismRestrictRestrict f _ _)]
state_before: case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P (f ∣_ U ∣_ ↑V)
state_after: case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P.toProperty (f ∣_ Scheme.ιOpens U ''ᵁ ↑V)

tactic: convert H ⟨_, V.2.image_of_isOpenImmersion (Y.ofRestrict _)⟩
state_before: case restrict
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P.toProperty (f ∣_ Scheme.ιOpens U ''ᵁ ↑V)
state_after: case a
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P.toProperty (f ∣_ Scheme.ιOpens U ''ᵁ ↑V) ↔ P (f ∣_ ↑⟨Y.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩)

tactic: rw [← P.toProperty_apply]
state_before: case a
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
U : Opens ↑↑Y.toPresheafedSpace
H : targetAffineLocally P f
V : ↑(Y ∣_ᵤ U).affineOpens
⊢ P.toProperty (f ∣_ Scheme.ιOpens U ''ᵁ ↑V) ↔ P (f ∣_ ↑⟨Y.ofRestrict ⋯ ''ᵁ ↑V, ⋯⟩)
state_after: no goals

tactic: rintro X Y f 𝒰 h𝒰
state_before: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
⊢ ∀ {X Y : Scheme} (f : X ⟶ Y) (𝒰 : Y.OpenCover),
    (∀ (i : 𝒰.J), targetAffineLocally P pullback.snd) → targetAffineLocally P f
state_after: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
⊢ targetAffineLocally P f

tactic: have h01 := (hP.affine_openCover_TFAE f).out 0 1
state_before: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
⊢ targetAffineLocally P f
state_after: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ targetAffineLocally P f

tactic: rw [h01]
state_before: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ targetAffineLocally P f
state_after: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd

tactic: refine ⟨𝒰.bind fun _ => Scheme.affineCover _, ?_, ?_⟩
state_before: case of_openCover
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
state_after: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∀ (i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J), IsAffine ((𝒰.bind fun x => (𝒰.obj x).affineCover).obj i)

case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∀ (i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J), P pullback.snd

tactic: intro i
state_before: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∀ (i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J), IsAffine ((𝒰.bind fun x => (𝒰.obj x).affineCover).obj i)
state_after: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ IsAffine ((𝒰.bind fun x => (𝒰.obj x).affineCover).obj i)

tactic: dsimp [Scheme.OpenCover.bind]
state_before: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ IsAffine ((𝒰.bind fun x => (𝒰.obj x).affineCover).obj i)
state_after: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ IsAffine ((𝒰.obj i.fst).affineCover.obj i.snd)

tactic: infer_instance
state_before: case of_openCover.refine_1
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ IsAffine ((𝒰.obj i.fst).affineCover.obj i.snd)
state_after: no goals

tactic: intro i
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
⊢ ∀ (i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J), P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ P pullback.snd

tactic: specialize h𝒰 i.1
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h𝒰 : ∀ (i : 𝒰.J), targetAffineLocally P pullback.snd
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : targetAffineLocally P pullback.snd
⊢ P pullback.snd

tactic: have h02 := (hP.affine_openCover_TFAE (pullback.snd : pullback f (𝒰.map i.fst) ⟶ _)).out 0 2
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : targetAffineLocally P pullback.snd
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : targetAffineLocally P pullback.snd
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
⊢ P pullback.snd

tactic: rw [h02] at h𝒰
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : targetAffineLocally P pullback.snd
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
⊢ P pullback.snd

tactic: specialize h𝒰 (Scheme.affineCover _) i.2
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h𝒰 : ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ P pullback.snd

tactic: let e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
    pullback (pullback.snd : pullback f (𝒰.map i.fst) ⟶ _)
      ((𝒰.obj i.fst).affineCover.map i.snd) := by
  refine (pullbackSymmetry _ _).hom ≫ ?_
  refine (pullbackRightPullbackFstIso _ _ _).inv ≫ ?_
  refine (pullbackSymmetry _ _).hom ≫ ?_
  refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_ <;>
  simp only [Category.comp_id, Category.id_comp, pullbackSymmetry_hom_comp_snd]
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
⊢ P pullback.snd

tactic: rw [← affine_cancel_left_isIso hP.1 e] at h𝒰
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
⊢ P pullback.snd
state_after: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
h𝒰 : P (e ≫ pullback.snd)
⊢ P pullback.snd

tactic: convert h𝒰 using 1
state_before: case of_openCover.refine_2
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
h𝒰 : P (e ≫ pullback.snd)
⊢ P pullback.snd
state_after: case h.e'_3.h
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
h𝒰 : P (e ≫ pullback.snd)
e_1✝ :
  pullback f ((𝒰.bind fun x => (𝒰.obj x).affineCover).map i) =
    pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)
e_2✝ : (𝒰.bind fun x => (𝒰.obj x).affineCover).obj i = (𝒰.obj i.fst).affineCover.obj i.snd
⊢ pullback.snd = e ≫ pullback.snd

tactic: simp [e]
state_before: case h.e'_3.h
P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
e : pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
  pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd) :=
  (pullbackSymmetry f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)).hom ≫
    (pullbackRightPullbackFstIso (𝒰.map i.fst) f ((𝒰.obj i.fst).affineCover.map i.snd)).inv ≫
      (pullbackSymmetry ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst).hom ≫
        pullback.map pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) pullback.snd
          ((𝒰.obj i.fst).affineCover.map i.snd) (pullbackSymmetry (𝒰.map i.fst) f).hom
          (𝟙 ((𝒰.obj i.fst).affineCover.obj i.snd)) (𝟙 (𝒰.obj i.fst)) ⋯ ⋯
h𝒰 : P (e ≫ pullback.snd)
e_1✝ :
  pullback f ((𝒰.bind fun x => (𝒰.obj x).affineCover).map i) =
    pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst)
e_2✝ : (𝒰.bind fun x => (𝒰.obj x).affineCover).obj i = (𝒰.obj i.fst).affineCover.obj i.snd
⊢ pullback.snd = e ≫ pullback.snd
state_after: no goals

tactic: refine (pullbackSymmetry _ _).hom ≫ ?_
state_before: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback f ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)
state_after: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) f ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)

tactic: refine (pullbackRightPullbackFstIso _ _ _).inv ≫ ?_
state_before: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback ((𝒰.obj i.fst).affineCover.map i.snd ≫ 𝒰.map i.fst) f ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)
state_after: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)

tactic: refine (pullbackSymmetry _ _).hom ≫ ?_
state_before: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback ((𝒰.obj i.fst).affineCover.map i.snd) pullback.fst ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)
state_after: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)

tactic: refine pullback.map _ _ _ _ (pullbackSymmetry _ _).hom (𝟙 _) (𝟙 _) ?_ ?_ <;>
simp only [Category.comp_id, Category.id_comp, pullbackSymmetry_hom_comp_snd]
state_before: P : AffineTargetMorphismProperty
hP : P.IsLocal
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
h01 : targetAffineLocally P f ↔ ∃ 𝒰, ∃ (x : ∀ (i : 𝒰.J), IsAffine (𝒰.obj i)), ∀ (i : 𝒰.J), P pullback.snd
i : (𝒰.bind fun x => (𝒰.obj x).affineCover).J
h02 :
  targetAffineLocally P pullback.snd ↔
    ∀ (𝒰_1 : (𝒰.obj i.fst).OpenCover) [inst : ∀ (i_1 : 𝒰_1.J), IsAffine (𝒰_1.obj i_1)] (i_1 : 𝒰_1.J), P pullback.snd
h𝒰 : P pullback.snd
⊢ pullback pullback.fst ((𝒰.obj i.fst).affineCover.map i.snd) ⟶
    pullback pullback.snd ((𝒰.obj i.fst).affineCover.map i.snd)
state_after: no goals