l3lab/ntp-mathlib huggingface dataset:
theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).IsLocal := by
  constructor
  · apply AffineTargetMorphismProperty.respectsIso_mk <;> rintro X Y Z e _ _ H
    exacts [@Homeomorph.compactSpace _ _ _ _ H (TopCat.homeoOfIso (asIso e.inv.1.base)), H]
  · introv H
    dsimp [affineProperty] at H ⊢
    change CompactSpace ((Opens.map f.val.base).obj (Y.basicOpen r))
    rw [Scheme.preimage_basicOpen f r]
    erw [← isCompact_iff_compactSpace]
    rw [← isCompact_univ_iff] at H
    apply isCompact_basicOpen
    exact H
  · rintro X Y H f S hS hS'
    rw [← IsAffineOpen.basicOpen_union_eq_self_iff] at hS
    delta QuasiCompact.affineProperty
    rw [← isCompact_univ_iff]
    change IsCompact ((Opens.map f.val.base).obj ⊤).1
    rw [← hS]
    dsimp [Opens.map]
    

Proof state:
case ofBasicOpenCover
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y : Scheme
H : IsAffine Y
f : X ⟶ Y
S : Finset ↑(Y.presheaf.obj (op ⊤))
hS : ⨆ f, Y.basicOpen ↑f = ⊤
hS' : ∀ (r : { x // x ∈ S }), affineProperty (f ∣_ Y.basicOpen ↑r)
⊢ IsCompact (⇑f.val.base ⁻¹' ↑(⨆ f, Y.basicOpen ↑f))
case ofBasicOpenCover.hU
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y : Scheme
H : IsAffine Y
f : X ⟶ Y
S : Finset ↑(Y.presheaf.obj (op ⊤))
hS : Ideal.span ↑S = ⊤
hS' : ∀ (r : { x // x ∈ S }), affineProperty (f ∣_ Y.basicOpen ↑r)
⊢ IsAffineOpen ⊤

Next tactic:
simp only [Opens.iSup_mk, Opens.carrier_eq_coe, Opens.coe_mk, Set.preimage_iUnion]
theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).IsLocal := by
  constructor
  · apply AffineTargetMorphismProperty.respectsIso_mk <;> rintro X Y Z e _ _ H
    exacts [@Homeomorph.compactSpace _ _ _ _ H (TopCat.homeoOfIso (asIso e.inv.1.base)), H]
  · introv H
    dsimp [affineProperty] at H ⊢
    change CompactSpace ((Opens.map f.val.base).obj (Y.basicOpen r))
    rw [Scheme.preimage_basicOpen f r]
    erw [← isCompact_iff_compactSpace]
    rw [← isCompact_univ_iff] at H
    apply isCompact_basicOpen
    exact H
  · rintro X Y H f S hS hS'
    rw [← IsAffineOpen.basicOpen_union_eq_self_iff] at hS
    delta QuasiCompact.affineProperty
    rw [← isCompact_univ_iff]
    change IsCompact ((Opens.map f.val.base).obj ⊤).1
    rw [← hS]
    dsimp [Opens.map]
    simp only [Opens.iSup_mk, Opens.carrier_eq_coe, Opens.coe_mk, Set.preimage_iUnion]
    

Proof state:
case ofBasicOpenCover
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y : Scheme
H : IsAffine Y
f : X ⟶ Y
S : Finset ↑(Y.presheaf.obj (op ⊤))
hS : ⨆ f, Y.basicOpen ↑f = ⊤
hS' : ∀ (r : { x // x ∈ S }), affineProperty (f ∣_ Y.basicOpen ↑r)
⊢ IsCompact (⋃ i, ⇑f.val.base ⁻¹' ↑(Y.basicOpen ↑i))
case ofBasicOpenCover.hU
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y : Scheme
H : IsAffine Y
f : X ⟶ Y
S : Finset ↑(Y.presheaf.obj (op ⊤))
hS : Ideal.span ↑S = ⊤
hS' : ∀ (r : { x // x ∈ S }), affineProperty (f ∣_ Y.basicOpen ↑r)
⊢ IsAffineOpen ⊤

Next tactic:
exacts [isCompact_iUnion fun i => isCompact_iff_compactSpace.mpr (hS' i),
      topIsAffineOpen _]
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  

Proof state:
X Y : Scheme
f : X ⟶ Y
⊢ AffineTargetMorphismProperty.StableUnderBaseChange affineProperty

Next tactic:
intro X Y S _ _ f g h
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : affineProperty g
⊢ affineProperty pullback.fst

Next tactic:
rw [QuasiCompact.affineProperty] at h ⊢
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
⊢ CompactSpace ↑↑(pullback f g).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
⊢ CompactSpace ↑↑(pullback f g).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
have : Finite 𝒰.J := by dsimp; infer_instance
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
⊢ Finite 𝒰.J

Next tactic:
dsimp
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
⊢ Finite (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)).J

Next tactic:
infer_instance
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; infer_instance
  

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
this : Finite 𝒰.J
⊢ CompactSpace ↑↑(pullback f g).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; infer_instance
  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
this : Finite 𝒰.J
⊢ ∀ (i : 𝒰.J), CompactSpace ↑↑(Scheme.OpenCover.obj 𝒰 i).toPresheafedSpace

Next tactic:
intro i
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; infer_instance
  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
this : Finite 𝒰.J
i : 𝒰.J
⊢ CompactSpace ↑↑(Scheme.OpenCover.obj 𝒰 i).toPresheafedSpace

Next tactic:
dsimp
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; infer_instance
  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; 

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
this : Finite 𝒰.J
i : 𝒰.J
⊢ CompactSpace
    ↑↑(pullback f
                (Scheme.OpenCover.map (Scheme.affineCover Y) (Scheme.OpenCover.f (Scheme.affineCover Y) ↑i) ≫
                  g)).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
infer_instance
theorem QuasiCompact.affineProperty_stableUnderBaseChange :
    QuasiCompact.affineProperty.StableUnderBaseChange := by
  intro X Y S _ _ f g h
  rw [QuasiCompact.affineProperty] at h ⊢
  let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
  have : Finite 𝒰.J := by dsimp; infer_instance
  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
  

Proof state:
X✝ Y✝ : Scheme
f✝ : X✝ ⟶ Y✝
X Y S : Scheme
inst✝¹ : IsAffine S
inst✝ : IsAffine X
f : X ⟶ S
g : Y ⟶ S
h : CompactSpace ↑↑Y.toPresheafedSpace
𝒰 : Scheme.OpenCover (pullback f g) :=
  Scheme.Pullback.openCoverOfRight (Scheme.OpenCover.finiteSubcover (Scheme.affineCover Y)) f g
this✝ : Finite 𝒰.J
this : ∀ (i : 𝒰.J), CompactSpace ↑↑(Scheme.OpenCover.obj 𝒰 i).toPresheafedSpace
⊢ CompactSpace ↑↑(pullback f g).toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace

Next tactic:
exact 𝒰.compactSpace
@[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
  

Proof state:
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
⊢ P S

Next tactic:
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]
    exact iSup_insert
@[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
  

Proof state:
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
h₁ : P ⊥
h₂ : ∀ (S : Opens ↑↑X.toPresheafedSpace), IsCompact S.carrier → ∀ (U : ↑(Scheme.affineOpens X)), P S → P (S ⊔ ↑U)
⊢ P S

Next tactic:
obtain ⟨s, hs, hs'⟩ := (isCompact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
@[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⟩
  

Proof state:
case intro.intro
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
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' : S.carrier = ⋃ i ∈ s, ↑↑i
⊢ P S

Next tactic:
replace hs' : S = iSup fun i : s => (i : Opens X.carrier) := by ext1; simpa using hs'
@[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 

Proof state:
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
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' : S.carrier = ⋃ i ∈ s, ↑↑i
⊢ S = ⨆ i, ↑↑i

Next tactic:
ext1
@[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; 

Proof state:
case h
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
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' : S.carrier = ⋃ i ∈ s, ↑↑i
⊢ ↑S = ↑(⨆ i, ↑↑i)

Next tactic:
simpa using hs'
@[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'
  

Proof state:
case intro.intro
X Y : Scheme
f : X ⟶ Y
Z : Scheme
P : Opens ↑↑X.toPresheafedSpace → Prop
S : Opens ↑↑X.toPresheafedSpace
hS : IsCompact S.carrier
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' : S = ⨆ i, ↑↑i
⊢ P S

Next tactic:
subst hs'
@[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'
  

Proof state:
case intro.intro
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
⊢ P (⨆ i, ↑↑i)

Next tactic:
apply @Set.Finite.induction_on _ _ _ hs
@[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
  · 

Proof state:
case intro.intro.H0
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
⊢ P (⨆ i, ↑↑i)

Next tactic:
convert 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₁; 

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
⊢ ⨆ i, ↑↑i = ⊥

Next tactic:
rw [iSup_eq_bot]
@[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]; 

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
⊢ ∀ (i : ↑∅), ↑↑i = ⊥

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

Proof state:
case h.e'_1.mk
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
val✝ : ↑(Scheme.affineOpens X)
h : val✝ ∈ ∅
⊢ ↑↑{ val := val✝, property := h } = ⊥

Next tactic:
exact h.elim
@[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
  · 

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
⊢ ∀ {a : ↑(Scheme.affineOpens X)} {s : Set ↑(Scheme.affineOpens X)}, a ∉ s → Set.Finite s → P (⨆ i, ↑↑i) → P (⨆ i, ↑↑i)

Next tactic:
intro x s _ hs 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₄
    

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)
⊢ P (⨆ i, ↑↑i)

Next tactic:
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⟩
@[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
      

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)
⊢ IsCompact (⨆ i, ↑↑i).carrier

Next tactic:
refine' ((isCompact_open_iff_eq_finset_affine_union _).mpr _).1
@[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; 

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)
⊢ ∃ s_1, Set.Finite s_1 ∧ (⨆ i, ↑↑i).carrier = ⋃ i ∈ s_1, ↑↑i

Next tactic:
exact ⟨s, hs, by simp⟩