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
  · 

Proof state:
case tfae_2_to_1
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
⊢ (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f

Next tactic:
rintro ⟨𝒰, 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⟩; 

Proof state:
case tfae_2_to_1.intro
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Scheme.OpenCover Y
H : ∀ (i : 𝒰.J), P pullback.snd
⊢ P f

Next tactic:
exact hP.3 f 𝒰 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
  

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
    [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 1 → 4
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
  · 

Proof state:
case tfae_1_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
⊢ P f → ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)

Next tactic:
intro H U
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; 

Proof state:
case tfae_1_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
H : P f
U : Opens ↑↑Y.toPresheafedSpace
⊢ P (f ∣_ U)

Next tactic:
exact hP.2 f U 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
  

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
    [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 → 3
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
  · 

Proof state:
case tfae_4_to_3
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)
⊢ (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) → ∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd

Next tactic:
intro H 𝒰 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
    

Proof state:
case tfae_4_to_3
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)
H : ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
𝒰 : Scheme.OpenCover Y
i : 𝒰.J
⊢ P pullback.snd

Next tactic:
rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
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 _)]
    

Proof state:
case tfae_4_to_3
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)
H : ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
𝒰 : Scheme.OpenCover Y
i : 𝒰.J
⊢ P (f ∣_ Scheme.Hom.opensRange (Scheme.OpenCover.map 𝒰 i))

Next tactic:
exact H <| Scheme.Hom.opensRange (𝒰.map 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)
  

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
    [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 3 → 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
  · 

Proof state:
case tfae_3_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
⊢ (∀ (𝒰 : Scheme.OpenCover Y) (i : 𝒰.J), P pullback.snd) → ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd

Next tactic:
exact fun H => ⟨Y.affineCover, H Y.affineCover⟩
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⟩
  

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
    [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 → 5
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
  · 

Proof state:
case tfae_4_to_5
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
⊢ (∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)) →
    ∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd

Next tactic:
intro H U g hg
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
    

Proof state:
case tfae_4_to_5
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
H : ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
U : Scheme
g : U ⟶ Y
hg : IsOpenImmersion g
⊢ P pullback.snd

Next tactic:
rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
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 _)]
    

Proof state:
case tfae_4_to_5
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
H : ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)
U : Scheme
g : U ⟶ Y
hg : IsOpenImmersion g
⊢ P (f ∣_ Scheme.Hom.opensRange g)

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
  

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
    [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 5 → 4
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
  · 

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
⊢ (∀ {U : Scheme} (g : U ⟶ Y) [inst : IsOpenImmersion g], P pullback.snd) →
    ∀ (U : Opens ↑↑Y.toPresheafedSpace), P (f ∣_ U)

Next tactic:
intro H U