l3lab/ntp-mathlib huggingface dataset:
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    

Proof state:
case tfae_5_to_4
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
H : ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
U : Opens ↑↑Y.toPresheafedSpace
⊢ P (f ∣_ U)

Next tactic:
erw [hP.1.cancel_left_isIso]
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    

Proof state:
case tfae_5_to_4
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
H : ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
U : Opens ↑↑Y.toPresheafedSpace
⊢ P pullback.snd

Next tactic:
apply H
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  

Proof state:
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
⊢ TFAE
    [P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd,
      ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U),
      ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd,
      ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)]

Next tactic:
tfae_have 4 → 6
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · 

Proof state:
case tfae_4_to_6
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
⊢ (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)

Next tactic:
intro H
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; 

Proof state:
case tfae_4_to_6
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
H : ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
⊢ ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)

Next tactic:
exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
  

Proof state:
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_6 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)
⊢ TFAE
    [P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd,
      ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U),
      ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd,
      ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)]

Next tactic:
tfae_have 6 → 2
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
  tfae_have 6 → 2
  · 

Proof state:
case tfae_6_to_2
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_6 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)
⊢ (∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd

Next tactic:
rintro ⟨ι, U, hU, H⟩
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
  tfae_have 6 → 2
  · rintro ⟨ι, U, hU, H⟩
    

Proof state:
case tfae_6_to_2.intro.intro.intro
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_6 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)
ι : Type u
U : ι → Opens ↑↑Y.toPresheafedSpace
hU : iSup U = ⊤
H : ∀ (i : ι), P (f ∣_ U i)
⊢ ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd

Next tactic:
refine' ⟨Y.openCoverOfSuprEqTop U hU, _⟩
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
  tfae_have 6 → 2
  · rintro ⟨ι, U, hU, H⟩
    refine' ⟨Y.openCoverOfSuprEqTop U hU, _⟩
    

Proof state:
case tfae_6_to_2.intro.intro.intro
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_6 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)
ι : Type u
U : ι → Opens ↑↑Y.toPresheafedSpace
hU : iSup U = ⊤
H : ∀ (i : ι), P (f ∣_ U i)
⊢ ∀ (i : (Scheme.openCoverOfSuprEqTop Y U hU).J), P pullback.snd

Next tactic:
intro i
open List in
theorem PropertyIsLocalAtTarget.openCover_TFAE {P : MorphismProperty Scheme}
    (hP : PropertyIsLocalAtTarget P) {X Y : Scheme.{u}} (f : X ⟶ Y) :
    TFAE
      [P f,
        ∃ 𝒰 : Scheme.OpenCover.{u} Y,
          ∀ i : 𝒰.J, P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
          P (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
        ∀ U : Opens Y.carrier, P (f ∣_ U),
        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g], P (pullback.snd : pullback f g ⟶ U),
        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, P (f ∣_ U i)] := by
  tfae_have 2 → 1
  · rintro ⟨𝒰, H⟩; exact hP.3 f 𝒰 H
  tfae_have 1 → 4
  · intro H U; exact hP.2 f U H
  tfae_have 4 → 3
  · intro H 𝒰 i
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    exact H <| Scheme.Hom.opensRange (𝒰.map i)
  tfae_have 3 → 2
  · exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
  tfae_have 4 → 5
  · intro H U g hg
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    apply H
  tfae_have 5 → 4
  · intro H U
    erw [hP.1.cancel_left_isIso]
    apply H
  tfae_have 4 → 6
  · intro H; exact ⟨PUnit, fun _ => ⊤, ciSup_const, fun _ => H _⟩
  tfae_have 6 → 2
  · rintro ⟨ι, U, hU, H⟩
    refine' ⟨Y.openCoverOfSuprEqTop U hU, _⟩
    intro i
    

Proof state:
case tfae_6_to_2.intro.intro.intro
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
tfae_2_to_1 : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f
tfae_1_to_4 : P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_3 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd
tfae_3_to_2 : (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd
tfae_4_to_5 :
  (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd
tfae_5_to_4 :
  (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
tfae_4_to_6 : (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∃ ι U, ∃ (_ : iSup U = ⊤), ∀ (i : ι), P (f ∣_ U i)
ι : Type u
U : ι → Opens ↑↑Y.toPresheafedSpace
hU : iSup U = ⊤
H : ∀ (i : ι), P (f ∣_ U i)
i : (Scheme.openCoverOfSuprEqTop Y U hU).J
⊢ P pullback.snd

Next tactic:
rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]