l3lab/ntp-mathlib huggingface dataset:
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by 

Proof state:
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
⊢ (⨆ i, ↑↑i).carrier = ⋃ i ∈ s, ↑↑i

Next tactic:
simp
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
    

Proof state:
case intro.intro.H1
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
this : IsCompact (⨆ i, ↑↑i).carrier
⊢ P (⨆ i, ↑↑i)

Next tactic:
convert h₂ _ this x h₄
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
    convert h₂ _ this x h₄
    

Proof state:
case h.e'_1
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
this : IsCompact (⨆ i, ↑↑i).carrier
⊢ ⨆ i, ↑↑i = (⨆ i, ↑↑i) ⊔ ↑x

Next tactic:
rw [iSup_subtype, sup_comm]
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
    convert h₂ _ this x h₄
    rw [iSup_subtype, sup_comm]
    

Proof state:
case h.e'_1
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
this : IsCompact (⨆ i, ↑↑i).carrier
⊢ ⨆ i, ⨆ (h : i ∈ insert x s), ↑↑{ val := i, property := h } = ↑x ⊔ ⨆ i, ↑↑i

Next tactic:
conv_rhs => rw [iSup_subtype]
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
    convert h₂ _ this x h₄
    rw [iSup_subtype, sup_comm]
    conv_rhs => 

Proof state:
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
this : IsCompact (⨆ i, ↑↑i).carrier
| ↑x ⊔ ⨆ i, ↑↑i

Next tactic:
rw [iSup_subtype]
@[elab_as_elim]
theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
    (hS : IsCompact S.1) (h₁ : P ⊥)
    (h₂ : ∀ (S : Opens X.carrier) (_ : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
    P S := by
  classical
  obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
  replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
  subst hs'
  apply @Set.Finite.induction_on _ _ _ hs
  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
  · intro x s _ hs h₄
    have : IsCompact (⨆ i : s, (i : Opens X.carrier)).1 := by
      refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
    convert h₂ _ this x h₄
    rw [iSup_subtype, sup_comm]
    conv_rhs => rw [iSup_subtype]
    

Proof state:
case h.e'_1
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
s✝ : Set ↑(Scheme.affineOpens X)
hs✝ : Set.Finite s✝
hS : IsCompact (⨆ i, ↑↑i).carrier
x : ↑(Scheme.affineOpens X)
s : Set ↑(Scheme.affineOpens X)
a✝ : x ∉ s
hs : Set.Finite s
h₄ : P (⨆ i, ↑↑i)
this : IsCompact (⨆ i, ↑↑i).carrier
⊢ ⨆ i, ⨆ (h : i ∈ insert x s), ↑↑{ val := i, property := h } = ↑x ⊔ ⨆ i, ⨆ (h : i ∈ s), ↑↑{ val := i, property := h }

Next tactic:
exact iSup_insert
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
    {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z : Scheme
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
⊢ ∃ n, f ^ n * x = 0

Next tactic:
rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
    {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z : Scheme
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) 0
⊢ ∃ n, f ^ n * x = 0

Next tactic:
obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq H
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
    {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
  obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq H
  

Proof state:
case intro.mk.intro
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z : Scheme
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) 0
n : ℕ
e :
  ↑{ val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) } * x =
    ↑{ val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) } * 0
⊢ ∃ n, f ^ n * x = 0

Next tactic:
exact ⟨n, by simpa [mul_comm x] using e⟩
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
    {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
  obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq H
  exact ⟨n, by 

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z : Scheme
X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsAffineOpen U
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = (X.presheaf.map (homOfLE (_ : X.basicOpen f ≤ U)).op) 0
n : ℕ
e :
  ↑{ val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) } * x =
    ↑{ val := (fun x => f ^ x) n, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n) } * 0
⊢ f ^ n * x = 0

Next tactic:
simpa [mul_comm x] using e
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
⊢ ∃ n, f ^ n * x = 0

Next tactic:
obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  

Proof state:
case intro.intro
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U.carrier = ⋃ i ∈ s, ↑↑i
⊢ ∃ n, f ^ n * x = 0

Next tactic:
replace e : U = iSup fun i : s => (i : Opens X.carrier)
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · 

Proof state:
case e
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U.carrier = ⋃ i ∈ s, ↑↑i
⊢ U = ⨆ i, ↑↑i

Next tactic:
ext1
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; 

Proof state:
case e.h
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U.carrier = ⋃ i ∈ s, ↑↑i
⊢ ↑U = ↑(⨆ i, ↑↑i)

Next tactic:
simpa using e
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  

Proof state:
case intro.intro
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
⊢ ∃ n, f ^ n * x = 0

Next tactic:
have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    rw [e]
    -- porting note: `exact le_iSup _ _` no longer works
    exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
⊢ ∀ (i : ↑s), ↑↑i ≤ U

Next tactic:
intro i
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
i : ↑s
⊢ ↑↑i ≤ U

Next tactic:
change (i : Opens X.carrier) ≤ U
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
i : ↑s
⊢ ↑↑i ≤ U

Next tactic:
rw [e]
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    rw [e]
    -- porting note: `exact le_iSup _ _` no longer works
    

Proof state:
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
i : ↑s
⊢ ↑↑i ≤ ⨆ i, ↑↑i

Next tactic:
exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    rw [e]
    -- porting note: `exact le_iSup _ _` no longer works
    exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
  

Proof state:
case intro.intro
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
h₁ : ∀ (i : ↑s), ↑↑i ≤ U
⊢ ∃ n, f ^ n * x = 0

Next tactic:
have H' := fun i : s =>
    exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen X i.1.2
      (X.presheaf.map (homOfLE (h₁ i)).op x) (X.presheaf.map (homOfLE (h₁ i)).op f) ?_
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    rw [e]
    -- porting note: `exact le_iSup _ _` no longer works
    exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
  have H' := fun i : s =>
    exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen X i.1.2
      (X.presheaf.map (homOfLE (h₁ i)).op x) (X.presheaf.map (homOfLE (h₁ i)).op f) ?_
  

Proof state:
case intro.intro.refine_2
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
h₁ : ∀ (i : ↑s), ↑↑i ≤ U
H' :
  ∀ (i : ↑s), ∃ n, (X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) f ^ n * (X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) x = 0
⊢ ∃ n, f ^ n * x = 0
case intro.intro.refine_1
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
h₁ : ∀ (i : ↑s), ↑↑i ≤ U
i : ↑s
⊢ (X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) x |_ X.basicOpen ((X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) f) = 0

Next tactic:
swap
/-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
`f ^ n * x = 0` for some `n`. -/
theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
    {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
    (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
  obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
  replace e : U = iSup fun i : s => (i : Opens X.carrier)
  · ext1; simpa using e
  have h₁ : ∀ i : s, i.1.1 ≤ U := by
    intro i
    change (i : Opens X.carrier) ≤ U
    rw [e]
    -- porting note: `exact le_iSup _ _` no longer works
    exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
  have H' := fun i : s =>
    exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen X i.1.2
      (X.presheaf.map (homOfLE (h₁ i)).op x) (X.presheaf.map (homOfLE (h₁ i)).op f) ?_
  swap
  · 

Proof state:
case intro.intro.refine_1
X✝ Y : Scheme
f✝ : X✝ ⟶ Y
Z X : Scheme
U : Opens ↑↑X.toPresheafedSpace
hU : IsCompact U.carrier
x f : ↑(X.presheaf.obj (op U))
H : x |_ X.basicOpen f = 0
s : Set ↑(Scheme.affineOpens X)
hs : Set.Finite s
e : U = ⨆ i, ↑↑i
h₁ : ∀ (i : ↑s), ↑↑i ≤ U
i : ↑s
⊢ (X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) x |_ X.basicOpen ((X.presheaf.map (homOfLE (_ : ↑↑i ≤ U)).op) f) = 0

Next tactic:
delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict at H ⊢