l3lab/ntp-mathlib huggingface dataset:
theorem preimage_eq (a b : A) (k : ℕ) (a_mem : a ∈ 𝒜 k) (b_mem1 : b ∈ 𝒜 k)
    (b_mem2 : b ∈ Submonoid.powers f) :
    toFun f ⁻¹'
        (@PrimeSpectrum.basicOpen (A⁰_ f) _ (Quotient.mk'' ⟨k, ⟨a, a_mem⟩, ⟨b, b_mem1⟩, b_mem2⟩) :
          Set (PrimeSpectrum (HomogeneousLocalization.Away 𝒜 f))) =
      {x | x.1 ∈ (pbo f) ⊓ pbo a} := by
  classical
  ext1 y
  constructor <;> intro hy
  · refine' ⟨y.2, _⟩
    rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
    rw [ProjectiveSpectrum.mem_coe_basicOpen]
    intro a_mem_y
    apply hy
    rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
    dsimp; rcases b_mem2 with ⟨k, hk⟩
    dsimp at hk
    simp only [show (mk a ⟨b, ⟨k, hk⟩⟩ : Away f) =
      Localization.mk 1 (⟨f ^ k, ⟨_, rfl⟩⟩ : Submonoid.powers f) * mk a 1 by
        rw [mk_mul, one_mul, mul_one]; congr; rw [hk]]
    exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, a_mem_y, rfl⟩)
  · change y.1 ∈ ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 a at hy
    rcases hy with ⟨hy1, hy2⟩
    rw [ProjectiveSpectrum.mem_coe_basicOpen] at hy1 hy2
    rw [Set.mem_preimage, toFun, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen]
    intro rid; dsimp at rid
    rcases MemCarrier.clear_denominator _ rid with ⟨c, N, acd, eq1⟩
    

Proof state:
case h.mpr.intro.intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
a b : A
k : ℕ
a_mem : a ∈ 𝒜 k
b_mem1 : b ∈ 𝒜 k
b_mem2 : b ∈ Submonoid.powers f
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
hy1 : f ∉ (↑y).asHomogeneousIdeal
hy2 : a ∉ (↑y).asHomogeneousIdeal
rid :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    carrier y
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y_1 : Away f) → y_1 ∈ image (⇑c) c.support → A
eq1 :
  f ^ N •
      HomogeneousLocalization.val
        (Quotient.mk''
          { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
            den_mem := b_mem2 }) =
    (algebraMap A (Away f))
      (∑ i in attach c.support,
        acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
          Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal))
⊢ False

Next tactic:
rw [Algebra.smul_def] at eq1
theorem preimage_eq (a b : A) (k : ℕ) (a_mem : a ∈ 𝒜 k) (b_mem1 : b ∈ 𝒜 k)
    (b_mem2 : b ∈ Submonoid.powers f) :
    toFun f ⁻¹'
        (@PrimeSpectrum.basicOpen (A⁰_ f) _ (Quotient.mk'' ⟨k, ⟨a, a_mem⟩, ⟨b, b_mem1⟩, b_mem2⟩) :
          Set (PrimeSpectrum (HomogeneousLocalization.Away 𝒜 f))) =
      {x | x.1 ∈ (pbo f) ⊓ pbo a} := by
  classical
  ext1 y
  constructor <;> intro hy
  · refine' ⟨y.2, _⟩
    rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
    rw [ProjectiveSpectrum.mem_coe_basicOpen]
    intro a_mem_y
    apply hy
    rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
    dsimp; rcases b_mem2 with ⟨k, hk⟩
    dsimp at hk
    simp only [show (mk a ⟨b, ⟨k, hk⟩⟩ : Away f) =
      Localization.mk 1 (⟨f ^ k, ⟨_, rfl⟩⟩ : Submonoid.powers f) * mk a 1 by
        rw [mk_mul, one_mul, mul_one]; congr; rw [hk]]
    exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, a_mem_y, rfl⟩)
  · change y.1 ∈ ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 a at hy
    rcases hy with ⟨hy1, hy2⟩
    rw [ProjectiveSpectrum.mem_coe_basicOpen] at hy1 hy2
    rw [Set.mem_preimage, toFun, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen]
    intro rid; dsimp at rid
    rcases MemCarrier.clear_denominator _ rid with ⟨c, N, acd, eq1⟩
    rw [Algebra.smul_def] at eq1
    

Proof state:
case h.mpr.intro.intro.intro.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
a b : A
k : ℕ
a_mem : a ∈ 𝒜 k
b_mem1 : b ∈ 𝒜 k
b_mem2 : b ∈ Submonoid.powers f
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
hy1 : f ∉ (↑y).asHomogeneousIdeal
hy2 : a ∉ (↑y).asHomogeneousIdeal
rid :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    carrier y
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y_1 : Away f) → y_1 ∈ image (⇑c) c.support → A
eq1 :
  (algebraMap A (Localization (Submonoid.powers f))) (f ^ N) *
      HomogeneousLocalization.val
        (Quotient.mk''
          { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
            den_mem := b_mem2 }) =
    (algebraMap A (Away f))
      (∑ i in attach c.support,
        acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
          Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal))
⊢ False

Next tactic:
change Localization.mk (f ^ N) 1 * Localization.mk _ _ = Localization.mk _ _ at eq1
theorem preimage_eq (a b : A) (k : ℕ) (a_mem : a ∈ 𝒜 k) (b_mem1 : b ∈ 𝒜 k)
    (b_mem2 : b ∈ Submonoid.powers f) :
    toFun f ⁻¹'
        (@PrimeSpectrum.basicOpen (A⁰_ f) _ (Quotient.mk'' ⟨k, ⟨a, a_mem⟩, ⟨b, b_mem1⟩, b_mem2⟩) :
          Set (PrimeSpectrum (HomogeneousLocalization.Away 𝒜 f))) =
      {x | x.1 ∈ (pbo f) ⊓ pbo a} := by
  classical
  ext1 y
  constructor <;> intro hy
  · refine' ⟨y.2, _⟩
    rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
    rw [ProjectiveSpectrum.mem_coe_basicOpen]
    intro a_mem_y
    apply hy
    rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
    dsimp; rcases b_mem2 with ⟨k, hk⟩
    dsimp at hk
    simp only [show (mk a ⟨b, ⟨k, hk⟩⟩ : Away f) =
      Localization.mk 1 (⟨f ^ k, ⟨_, rfl⟩⟩ : Submonoid.powers f) * mk a 1 by
        rw [mk_mul, one_mul, mul_one]; congr; rw [hk]]
    exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, a_mem_y, rfl⟩)
  · change y.1 ∈ ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 a at hy
    rcases hy with ⟨hy1, hy2⟩
    rw [ProjectiveSpectrum.mem_coe_basicOpen] at hy1 hy2
    rw [Set.mem_preimage, toFun, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen]
    intro rid; dsimp at rid
    rcases MemCarrier.clear_denominator _ rid with ⟨c, N, acd, eq1⟩
    rw [Algebra.smul_def] at eq1
    change Localization.mk (f ^ N) 1 * Localization.mk _ _ = Localization.mk _ _ at eq1
    rw [mk_mul, one_mul, mk_eq_mk', IsLocalization.eq] at eq1
    rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
    rw [Submonoid.coe_one, one_mul] at eq1
    simp only [Subtype.coe_mk] at eq1
    

Proof state:
case h.mpr.intro.intro.intro.intro.intro.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
a b : A
k : ℕ
a_mem : a ∈ 𝒜 k
b_mem1 : b ∈ 𝒜 k
b_mem2 : b ∈ Submonoid.powers f
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
hy1 : f ∉ (↑y).asHomogeneousIdeal
hy2 : a ∉ (↑y).asHomogeneousIdeal
rid :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    carrier y
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y_1 : Away f) → y_1 ∈ image (⇑c) c.support → A
M : ℕ
eq1 :
  f ^ M * (f ^ N * a) =
    f ^ M *
      (b *
        (algebraMap A A)
          (∑ i in attach c.support,
            acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
              Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)))
⊢ False

Next tactic:
have : a * f ^ N * f ^ M ∈ y.val.asHomogeneousIdeal.toIdeal := by
      rw [mul_comm _ (f ^ N), mul_comm _ (f ^ M), eq1]
      refine' mul_mem_left _ _ (mul_mem_left _ _ (sum_mem _ fun i _ => mul_mem_left _ _ _))
      generalize_proofs h₁ h₂; exact (Classical.choose_spec h₂).1
theorem preimage_eq (a b : A) (k : ℕ) (a_mem : a ∈ 𝒜 k) (b_mem1 : b ∈ 𝒜 k)
    (b_mem2 : b ∈ Submonoid.powers f) :
    toFun f ⁻¹'
        (@PrimeSpectrum.basicOpen (A⁰_ f) _ (Quotient.mk'' ⟨k, ⟨a, a_mem⟩, ⟨b, b_mem1⟩, b_mem2⟩) :
          Set (PrimeSpectrum (HomogeneousLocalization.Away 𝒜 f))) =
      {x | x.1 ∈ (pbo f) ⊓ pbo a} := by
  classical
  ext1 y
  constructor <;> intro hy
  · refine' ⟨y.2, _⟩
    rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
    rw [ProjectiveSpectrum.mem_coe_basicOpen]
    intro a_mem_y
    apply hy
    rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
    dsimp; rcases b_mem2 with ⟨k, hk⟩
    dsimp at hk
    simp only [show (mk a ⟨b, ⟨k, hk⟩⟩ : Away f) =
      Localization.mk 1 (⟨f ^ k, ⟨_, rfl⟩⟩ : Submonoid.powers f) * mk a 1 by
        rw [mk_mul, one_mul, mul_one]; congr; rw [hk]]
    exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, a_mem_y, rfl⟩)
  · change y.1 ∈ ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 a at hy
    rcases hy with ⟨hy1, hy2⟩
    rw [ProjectiveSpectrum.mem_coe_basicOpen] at hy1 hy2
    rw [Set.mem_preimage, toFun, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen]
    intro rid; dsimp at rid
    rcases MemCarrier.clear_denominator _ rid with ⟨c, N, acd, eq1⟩
    rw [Algebra.smul_def] at eq1
    change Localization.mk (f ^ N) 1 * Localization.mk _ _ = Localization.mk _ _ at eq1
    rw [mk_mul, one_mul, mk_eq_mk', IsLocalization.eq] at eq1
    rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
    rw [Submonoid.coe_one, one_mul] at eq1
    simp only [Subtype.coe_mk] at eq1
    have : a * f ^ N * f ^ M ∈ y.val.asHomogeneousIdeal.toIdeal := by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
a b : A
k : ℕ
a_mem : a ∈ 𝒜 k
b_mem1 : b ∈ 𝒜 k
b_mem2 : b ∈ Submonoid.powers f
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
hy1 : f ∉ (↑y).asHomogeneousIdeal
hy2 : a ∉ (↑y).asHomogeneousIdeal
rid :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    carrier y
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y_1 : Away f) → y_1 ∈ image (⇑c) c.support → A
M : ℕ
eq1 :
  f ^ M * (f ^ N * a) =
    f ^ M *
      (b *
        (algebraMap A A)
          (∑ i in attach c.support,
            acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
              Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)))
⊢ a * f ^ N * f ^ M ∈ HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal

Next tactic:
rw [mul_comm _ (f ^ N), mul_comm _ (f ^ M), eq1]
theorem preimage_eq (a b : A) (k : ℕ) (a_mem : a ∈ 𝒜 k) (b_mem1 : b ∈ 𝒜 k)
    (b_mem2 : b ∈ Submonoid.powers f) :
    toFun f ⁻¹'
        (@PrimeSpectrum.basicOpen (A⁰_ f) _ (Quotient.mk'' ⟨k, ⟨a, a_mem⟩, ⟨b, b_mem1⟩, b_mem2⟩) :
          Set (PrimeSpectrum (HomogeneousLocalization.Away 𝒜 f))) =
      {x | x.1 ∈ (pbo f) ⊓ pbo a} := by
  classical
  ext1 y
  constructor <;> intro hy
  · refine' ⟨y.2, _⟩
    rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
    rw [ProjectiveSpectrum.mem_coe_basicOpen]
    intro a_mem_y
    apply hy
    rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
    dsimp; rcases b_mem2 with ⟨k, hk⟩
    dsimp at hk
    simp only [show (mk a ⟨b, ⟨k, hk⟩⟩ : Away f) =
      Localization.mk 1 (⟨f ^ k, ⟨_, rfl⟩⟩ : Submonoid.powers f) * mk a 1 by
        rw [mk_mul, one_mul, mul_one]; congr; rw [hk]]
    exact Ideal.mul_mem_left _ _ (Ideal.subset_span ⟨_, a_mem_y, rfl⟩)
  · change y.1 ∈ ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 a at hy
    rcases hy with ⟨hy1, hy2⟩
    rw [ProjectiveSpectrum.mem_coe_basicOpen] at hy1 hy2
    rw [Set.mem_preimage, toFun, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen]
    intro rid; dsimp at rid
    rcases MemCarrier.clear_denominator _ rid with ⟨c, N, acd, eq1⟩
    rw [Algebra.smul_def] at eq1
    change Localization.mk (f ^ N) 1 * Localization.mk _ _ = Localization.mk _ _ at eq1
    rw [mk_mul, one_mul, mk_eq_mk', IsLocalization.eq] at eq1
    rcases eq1 with ⟨⟨_, ⟨M, rfl⟩⟩, eq1⟩
    rw [Submonoid.coe_one, one_mul] at eq1
    simp only [Subtype.coe_mk] at eq1
    have : a * f ^ N * f ^ M ∈ y.val.asHomogeneousIdeal.toIdeal := by
      rw [mul_comm _ (f ^ N), mul_comm _ (f ^ M), eq1]
      refine' mul_mem_left _ _ (mul_mem_left _ _ (sum_mem _ fun i _ => mul_mem_left _ _ _))
      

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
x : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
a b : A
k : ℕ
a_mem : a ∈ 𝒜 k
b_mem1 : b ∈ 𝒜 k
b_mem2 : b ∈ Submonoid.powers f
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
hy1 : f ∉ (↑y).asHomogeneousIdeal
hy2 : a ∉ (↑y).asHomogeneousIdeal
rid :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    carrier y
c : ↑(⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) →₀ Away f
N : ℕ
acd : (y_1 : Away f) → y_1 ∈ image (⇑c) c.support → A
M : ℕ
eq1 :
  f ^ M * (f ^ N * a) =
    f ^ M *
      (b *
        (algebraMap A A)
          (∑ i in attach c.support,
            acd (c ↑i) (_ : c ↑i ∈ image (⇑c) c.support) *
              Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)))
i : { x // x ∈ c.support }
x✝ : i ∈ attach c.support
⊢ Exists.choose (_ : ↑↑i ∈ ⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal) ∈
    HomogeneousIdeal.toIdeal (↑y).asHomogeneousIdeal

Next tactic:
generalize_proofs h₁ h₂
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
⊢ Continuous (ToSpec.toFun f)

Next tactic:
apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    

Proof state:
case hf
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
⊢ ∀ s ∈ Set.range fun r => ↑(sbo r), IsOpen (ToSpec.toFun f ⁻¹' s)

Next tactic:
rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; 

Proof state:
case hf.intro.mk.mk.mk.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
⊢ IsOpen
    (ToSpec.toFun f ⁻¹'
      (fun r => ↑(sbo r))
        (Quot.mk Setoid.r
          { deg := k, num := { val := a, property := ha }, den := { val := b, property := hb1 },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := b, property := hb1 }) }))

Next tactic:
dsimp
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    

Proof state:
case hf.intro.mk.mk.mk.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
⊢ IsOpen
    (ToSpec.toFun f ⁻¹'
      ↑(sbo
          Quot.mk Setoid.r
            { deg := k, num := { val := a, property := ha }, den := { val := b, property := hb1 },
              den_mem := (_ : ∃ y, f ^ y = b) }))

Next tactic:
erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    

Proof state:
case hf.intro.mk.mk.mk.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
⊢ IsOpen {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
    

Proof state:
case hf.intro.mk.mk.mk.mk.intro
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
⊢ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier) = {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
ext z
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
    ext z; 

Proof state:
case hf.intro.mk.mk.mk.mk.intro.h
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
z : ↑((Opens.toTopCat Proj.T).obj (pbo f))
⊢ z ∈ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier) ↔ z ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
constructor
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
    ext z; constructor
    · 

Proof state:
case hf.intro.mk.mk.mk.mk.intro.h.mp
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
z : ↑((Opens.toTopCat Proj.T).obj (pbo f))
⊢ z ∈ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier) → z ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
intro hz
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
    ext z; constructor
    · intro hz; 

Proof state:
case hf.intro.mk.mk.mk.mk.intro.h.mp
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
z : ↑((Opens.toTopCat Proj.T).obj (pbo f))
hz : z ∈ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier)
⊢ z ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
simpa [Set.mem_preimage]
/-- The continuous function between the basic open set `D(f)` in `Proj` to the corresponding basic
open set in `Spec A⁰_f`.
-/
def toSpec {f : A} : (Proj.T| pbo f) ⟶ Spec.T A⁰_ f where
  toFun := ToSpec.toFun f
  continuous_toFun := by
    apply IsTopologicalBasis.continuous PrimeSpectrum.isTopologicalBasis_basic_opens
    rintro _ ⟨⟨k, ⟨a, ha⟩, ⟨b, hb1⟩, ⟨k', hb2⟩⟩, rfl⟩; dsimp
    erw [ToSpec.preimage_eq f a b k ha hb1 ⟨k', hb2⟩]
    refine' isOpen_induced_iff.mpr ⟨(pbo f).1 ⊓ (pbo a).1, IsOpen.inter (pbo f).2 (pbo a).2, _⟩
    ext z; constructor
    · intro hz; simpa [Set.mem_preimage]
    · 

Proof state:
case hf.intro.mk.mk.mk.mk.intro.h.mpr
R : Type u_1
A : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing A
inst✝¹ : Algebra R A
𝒜 : ℕ → Submodule R A
inst✝ : GradedAlgebra 𝒜
f : A
w✝ : ↑(CommRingCat.of (A⁰_ f))
k : ℕ
a : A
ha : a ∈ 𝒜 k
b : A
hb1 : b ∈ 𝒜 k
k' : ℕ
hb2 : (fun x => f ^ x) k' = ↑{ val := b, property := hb1 }
z : ↑((Opens.toTopCat Proj.T).obj (pbo f))
⊢ z ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a} → z ∈ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier)

Next tactic:
intro hz