Theorem: AlgebraicGeometry.PropertyIsLocalAtTarget.openCover_iff
File: Mathlib/AlgebraicGeometry/Morphisms/Basic.lean

tactic: refine ⟨fun H => let h := ((hP.openCover_TFAE f).out 0 2).mp H; fun i => ?_,
  fun H => let h := ((hP.openCover_TFAE f).out 1 0).mp; ?_⟩
state_before: P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
⊢ P f ↔ ∀ (i : 𝒰.J), P pullback.snd
state_after: case refine_1
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
H : P f
h : ∀ (𝒰 : Y.OpenCover) (i : 𝒰.J), P pullback.snd :=
  (List.TFAE.out (openCover_TFAE hP f) 0 2
        (Eq.refl
          ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
            0))
        (Eq.refl
          ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
            2))).mp
    H
i : 𝒰.J
⊢ P pullback.snd

case refine_2
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
H : ∀ (i : 𝒰.J), P pullback.snd
h : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f :=
  (List.TFAE.out (openCover_TFAE hP f) 1 0
      (Eq.refl
        ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
          1))
      (Eq.refl
        ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
          0))).mp
⊢ P f

tactic: exact h 𝒰 i
state_before: case refine_1
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
H : P f
h : ∀ (𝒰 : Y.OpenCover) (i : 𝒰.J), P pullback.snd :=
  (List.TFAE.out (openCover_TFAE hP f) 0 2
        (Eq.refl
          ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
            0))
        (Eq.refl
          ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
            2))).mp
    H
i : 𝒰.J
⊢ P pullback.snd
state_after: no goals

tactic: exact h ⟨𝒰, H⟩
state_before: case refine_2
P : MorphismProperty Scheme
hP : PropertyIsLocalAtTarget P
X Y : Scheme
f : X ⟶ Y
𝒰 : Y.OpenCover
H : ∀ (i : 𝒰.J), P pullback.snd
h : (∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd) → P f :=
  (List.TFAE.out (openCover_TFAE hP f) 1 0
      (Eq.refl
        ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
          1))
      (Eq.refl
        ([P f, ∃ 𝒰, ∀ (i : 𝒰.J), P pullback.snd, ∀ (𝒰 : Y.OpenCover) (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)].get?
          0))).mp
⊢ P f
state_after: no goals