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

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 (f ∣_ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i))

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

Proof state:
case h.e'_1.h.e'_1.h.e'_6.h.e'_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)
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
⊢ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i) = U i

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

Proof state:
case h.e'_1.h.e'_1.h.e'_6.h.e'_6.h
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
⊢ ↑(Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) = ↑(U i)

Next tactic:
exact Subtype.range_coe
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
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    convert H i
    all_goals 

Proof state:
case h.e'_1.h.e'_3.e'_2.h.e'_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)
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
e_1✝ :
  (Opens.toTopCat ↑X.toPresheafedSpace).obj
      (f⁻¹ᵁ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) =
    (Opens.toTopCat ↑X.toPresheafedSpace).obj (f⁻¹ᵁ U i)
⊢ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i) = U i

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

Proof state:
case h.e'_1.h.e'_3.e'_2.h.e'_6.h
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
e_1✝ :
  (Opens.toTopCat ↑X.toPresheafedSpace).obj
      (f⁻¹ᵁ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) =
    (Opens.toTopCat ↑X.toPresheafedSpace).obj (f⁻¹ᵁ U i)
⊢ ↑(Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) = ↑(U i)

Next tactic:
exact Subtype.range_coe
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
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    convert H i
    all_goals 

Proof state:
case h.e'_2.h.e'_1.h.e'_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)
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
⊢ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i) = U i

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

Proof state:
case h.e'_2.h.e'_1.h.e'_6.h
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
⊢ ↑(Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) = ↑(U i)

Next tactic:
exact Subtype.range_coe
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
    rw [← hP.1.arrow_mk_iso_iff (morphismRestrictOpensRange f _)]
    convert H i
    all_goals 

Proof state:
case h.e'_2.h.e'_3.e'_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)
ι : Type u
U : ι → Opens ↑↑Y.toPresheafedSpace
hU : iSup U = ⊤
H : ∀ (i : ι), P (f ∣_ U i)
i : (Scheme.openCoverOfSuprEqTop Y U hU).J
e_1✝ :
  (Opens.toTopCat ↑Y.toPresheafedSpace).obj
      (Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) =
    (Opens.toTopCat ↑Y.toPresheafedSpace).obj (U i)
⊢ Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i) = U i

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

Proof state:
case h.e'_2.h.e'_3.e'_2.h
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
e_1✝ :
  (Opens.toTopCat ↑Y.toPresheafedSpace).obj
      (Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) =
    (Opens.toTopCat ↑Y.toPresheafedSpace).obj (U i)
⊢ ↑(Scheme.Hom.opensRange (Scheme.OpenCover.map (Scheme.openCoverOfSuprEqTop Y U hU) i)) = ↑(U i)

Next tactic:
exact Subtype.range_coe