Theorem: RingHom.PropertyIsLocal.affineLocally_isStableUnderComposition
File: Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean

tactic: 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
state_before: 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)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ affineLocally P (f ≫ g)

tactic: apply (@affine_openCover_iff _ hP _ _ (f ≫ g) S.affineCover _ ?_ ?_).mpr
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ affineLocally P (f ≫ g)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J),
    P (Scheme.Γ.map ((?m.185609 i).map 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ (i : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover

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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J), IsAffine ((?m.185609 i).obj j)

tactic: rotate_left
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J),
    P (Scheme.Γ.map ((?m.185609 i).map 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ (i : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover

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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J), IsAffine ((?m.185609 i).obj j)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ (i : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover

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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J), IsAffine ((?m.185609 i).obj j)

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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (?m.185609 i).J),
    P (Scheme.Γ.map ((?m.185609 i).map j ≫ pullback.snd).op)

tactic: intro i
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover

tactic: apply Scheme.OpenCover.pushforwardIso _
  (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ (pullback f pullback.fst).OpenCover

tactic: apply Scheme.Pullback.openCoverOfRight
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ (pullback f pullback.fst).OpenCover
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ (pullback g (S.affineCover.map i)).OpenCover

tactic: exact (pullback g (S.affineCover.map i)).affineCover
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J
⊢ (pullback g (S.affineCover.map i)).OpenCover
state_after: no goals

tactic: exact 𝒰
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ (i : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover
state_after: no goals

tactic: intro i j
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (𝒰 i).J), IsAffine ((𝒰 i).obj j)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine ((𝒰 i).obj j)

tactic: dsimp [𝒰] at *
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine ((𝒰 i).obj j)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine
    ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j.fst ≫ pullback.fst)).affineCover.obj j.snd)

tactic: infer_instance
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j : (𝒰 i).J
⊢ IsAffine
    ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j.fst ≫ pullback.fst)).affineCover.obj j.snd)
state_after: no goals

tactic: rintro i ⟨j, k⟩
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
⊢ ∀ (i : (S.affineCover.pullbackCover (f ≫ g)).J) (j : (𝒰 i).J), P (Scheme.Γ.map ((𝒰 i).map j ≫ pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j :
  ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
      (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).J
k :
  ((fun i_1 =>
        (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f
                    pullback.fst).pushforwardIso
                (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
            i_1).affineCover)
      j).J
⊢ P (Scheme.Γ.map ((𝒰 i).map ⟨j, k⟩ ≫ pullback.snd).op)

tactic: dsimp at i j k
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : (S.affineCover.pullbackCover (f ≫ g)).J
j :
  ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
      (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).J
k :
  ((fun i_1 =>
        (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f
                    pullback.fst).pushforwardIso
                (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
            i_1).affineCover)
      j).J
⊢ P (Scheme.Γ.map ((𝒰 i).map ⟨j, k⟩ ≫ pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P (Scheme.Γ.map ((𝒰 i).map ⟨j, k⟩ ≫ pullback.snd).op)

tactic: 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]
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P (Scheme.Γ.map ((𝒰 i).map ⟨j, k⟩ ≫ pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      (((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
            pullback.map f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst) f pullback.fst (𝟙 X)
                ((pullback g (S.affineCover.map i)).affineCover.map j) (𝟙 Y) ⋯ ⋯ ≫
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom) ≫
          pullback.snd).op)

tactic: rw [Category.assoc, Category.assoc, pullbackRightPullbackFstIso_hom_snd,
  pullback.lift_snd_assoc, Category.assoc, ← Category.assoc, op_comp, Functor.map_comp]
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      (((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
            pullback.map f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst) f pullback.fst (𝟙 X)
                ((pullback g (S.affineCover.map i)).affineCover.map j) (𝟙 Y) ⋯ ⋯ ≫
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom) ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.snd).op ≫
      Scheme.Γ.map
        ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
            pullback.snd).op)

tactic: apply hP.StableUnderComposition
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.snd).op ≫
      Scheme.Γ.map
        ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
            pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P (Scheme.Γ.map ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.snd).op)

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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: apply hP.affine_openCover_iff _ _ _|>.mp
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P (Scheme.Γ.map ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ affineLocally P g

tactic: exact hg
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ affineLocally P g
state_after: no goals

tactic: delta affineLocally at hf
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: have := (hP.isLocal_sourceAffineLocally.affine_openCover_TFAE f).out 0 3
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.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
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: rw [this] at hf
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.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
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.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
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: have : IsOpenImmersion <|
    ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst) :=
  LocallyRingedSpace.IsOpenImmersion.comp _ _
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.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
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: specialize hf ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf : sourceAffineLocally P pullback.snd
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: have := (hP.affine_openCover_TFAE
  (pullback.snd : pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫
  pullback.fst) ⟶ _)).out 0 3
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf : sourceAffineLocally P pullback.snd
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf : sourceAffineLocally P pullback.snd
this :
  sourceAffineLocally P pullback.snd ↔
    ∀ {U : Scheme} (g_1 : U ⟶ pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: rw [this] at hf
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf : sourceAffineLocally P pullback.snd
this :
  sourceAffineLocally P pullback.snd ↔
    ∀ {U : Scheme} (g_1 : U ⟶ pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf :
  ∀ {U : Scheme} (g_1 : U ⟶ pullback f ((pullback g (S.affineCover.map i)).affineCover.map 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 ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)

tactic: apply hf
state_before: 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 : (S.affineCover.pullbackCover (f ≫ g)).J) → ((S.affineCover.pullbackCover (f ≫ g)).obj i).OpenCover :=
  fun i =>
    ((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
          (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).bind
      fun i_1 =>
      (((Scheme.Pullback.openCoverOfRight (pullback g (S.affineCover.map i)).affineCover f pullback.fst).pushforwardIso
              (pullbackRightPullbackFstIso g (S.affineCover.map i) f).hom).obj
          i_1).affineCover
i : S.affineCover.J
j : (pullback g (S.affineCover.map i)).affineCover.J
k : (pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.J
this✝¹ :
  targetAffineLocally (sourceAffineLocally P) f ↔
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsAffine U] [inst_1 : IsOpenImmersion g], sourceAffineLocally P pullback.snd
this✝ : IsOpenImmersion ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)
hf :
  ∀ {U : Scheme} (g_1 : U ⟶ pullback f ((pullback g (S.affineCover.map i)).affineCover.map 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 ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst))
      [inst : IsAffine U] [inst : IsOpenImmersion g_1], P (Scheme.Γ.map (g_1 ≫ pullback.snd).op)
⊢ P
    (Scheme.Γ.map
      ((pullback f ((pullback g (S.affineCover.map i)).affineCover.map j ≫ pullback.fst)).affineCover.map k ≫
          pullback.snd).op)
state_after: no goals