Theorem: AlgebraicGeometry.isAffine_of_isAffineOpen_basicOpen
File: Mathlib/AlgebraicGeometry/Morphisms/Affine.lean

Proof steps:
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
⊢ IsAffine X
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
⊢ IsAffine X
tactic: have : QuasiSeparatedSpace X := isAffineOpen_of_isAffineOpen_basicOpen_aux s hs hs₂
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
⊢ IsAffine X
state_after: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
⊢ IsAffine X
tactic: have : CompactSpace X := by
    obtain ⟨s', hs', e⟩ := (Ideal.span_eq_top_iff_finite _).mp hs
    rw [← isCompact_univ_iff, ← Opens.coe_top, ← iSup_basicOpen_of_span_eq_top _ _ e]
    simp only [Finset.mem_coe, Opens.iSup_mk, Opens.carrier_eq_coe, Opens.coe_mk]
    apply s'.isCompact_biUnion
    exact fun i hi ↦ (hs₂ _ (hs' hi)).isCompact
state_before: X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
⊢ IsAffine X
state_after: case affine
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
⊢ IsIso (ΓSpec.adjunction.unit.app X)
tactic: constructor
state_before: case affine
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
⊢ IsIso (ΓSpec.adjunction.unit.app X)
state_after: case affine.refine_1
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
i : ↑s
⊢ PrimeSpectrum.basicOpen ↑i ∈ ((Scheme.Γ.rightOp ⋙ Scheme.Spec).obj X).affineOpens

case affine.refine_2
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
⊢ ⨆ i, ↑((fun i => ⟨PrimeSpectrum.basicOpen ↑i, ⋯⟩) i) = ⊤

case affine.refine_3
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
i : ↑s
⊢ IsAffine ↑(ΓSpec.adjunction.unit.app X ⁻¹ᵁ ↑((fun i => ⟨PrimeSpectrum.basicOpen ↑i, ⋯⟩) i))

case affine.refine_4
X Y Z : Scheme
f : X ⟶ Y
g : Y ⟶ Z
s : Set ↑Γ(X, ⊤)
hs : Ideal.span s = ⊤
hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)
this✝ : QuasiSeparatedSpace ↑↑X.toPresheafedSpace
this : CompactSpace ↑↑X.toPresheafedSpace
i : ↑s
⊢ IsIso (Scheme.Hom.app (ΓSpec.adjunction.unit.app X ∣_ ↑((fun i => ⟨PrimeSpectrum.basicOpen ↑i, ⋯⟩) i)) ⊤)
tactic: refine HasAffineProperty.of_iSup_eq_top (P := MorphismProperty.isomorphisms Scheme)
    (fun i : s ↦ ⟨PrimeSpectrum.basicOpen i.1, ?_⟩) ?_ (fun i ↦ ⟨?_, ?_⟩)