l3lab/ntp-mathlib huggingface dataset:
/-- The function between the basic open set `D(f)` in `Proj` to the corresponding basic open set in
`Spec A⁰_f`. This is bundled into a continuous map in `TopComponent.forward`.
-/
def toFun (x : Proj.T| pbo f) : Spec.T A⁰_ f :=
  ⟨carrier x, carrier_ne_top x, fun {x1 x2} hx12 => by
    classical
    rw [mem_carrier_iff] at hx12
    let J := span ((algebraMap A (Away f) : A → (Away f)) '' x.val.asHomogeneousIdeal)
    suffices h : ∀ x y : Localization.Away f, x * y ∈ J → x ∈ J ∨ y ∈ J
    · rw [HomogeneousLocalization.mul_val] at hx12; exact h x1.val x2.val hx12
    clear x1 x2 hx12
    intro x1 x2 hx12
    induction' x1 using Localization.induction_on with data_x1
    induction' x2 using Localization.induction_on with data_x2
    

Proof state:
case h.H.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
m : ℕ
f_deg : f ∈ 𝒜 m
x✝ : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
x : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
J : Ideal (Away f) := span (⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal)
data_x1 data_x2 : A × ↥(Submonoid.powers f)
hx12 : Localization.mk data_x1.1 data_x1.2 * Localization.mk data_x2.1 data_x2.2 ∈ J
⊢ Localization.mk data_x1.1 data_x1.2 ∈ J ∨ Localization.mk data_x2.1 data_x2.2 ∈ J

Next tactic:
rcases data_x1, data_x2 with ⟨⟨a1, _, ⟨n1, rfl⟩⟩, ⟨a2, _, ⟨n2, rfl⟩⟩⟩
/-- The function between the basic open set `D(f)` in `Proj` to the corresponding basic open set in
`Spec A⁰_f`. This is bundled into a continuous map in `TopComponent.forward`.
-/
def toFun (x : Proj.T| pbo f) : Spec.T A⁰_ f :=
  ⟨carrier x, carrier_ne_top x, fun {x1 x2} hx12 => by
    classical
    rw [mem_carrier_iff] at hx12
    let J := span ((algebraMap A (Away f) : A → (Away f)) '' x.val.asHomogeneousIdeal)
    suffices h : ∀ x y : Localization.Away f, x * y ∈ J → x ∈ J ∨ y ∈ J
    · rw [HomogeneousLocalization.mul_val] at hx12; exact h x1.val x2.val hx12
    clear x1 x2 hx12
    intro x1 x2 hx12
    induction' x1 using Localization.induction_on with data_x1
    induction' x2 using Localization.induction_on with data_x2
    rcases data_x1, data_x2 with ⟨⟨a1, _, ⟨n1, rfl⟩⟩, ⟨a2, _, ⟨n2, rfl⟩⟩⟩
    

Proof state:
case h.H.H.mk.mk.intro.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
m : ℕ
f_deg : f ∈ 𝒜 m
x✝ : ↑(LocallyRingedSpace.toTopCat (LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))))
x : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
J : Ideal (Away f) := span (⇑(algebraMap A (Away f)) '' ↑(↑x).asHomogeneousIdeal)
a1 : A
n1 : ℕ
a2 : A
n2 : ℕ
hx12 :
  Localization.mk
        (a1, { val := (fun x => f ^ x) n1, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n1) }).1
        (a1, { val := (fun x => f ^ x) n1, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n1) }).2 *
      Localization.mk
        (a2, { val := (fun x => f ^ x) n2, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n2) }).1
        (a2, { val := (fun x => f ^ x) n2, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n2) }).2 ∈
    J
⊢ Localization.mk
        (a1, { val := (fun x => f ^ x) n1, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n1) }).1
        (a1, { val := (fun x => f ^ x) n1, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n1) }).2 ∈
      J ∨
    Localization.mk
        (a2, { val := (fun x => f ^ x) n2, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n2) }).1
        (a2, { val := (fun x => f ^ x) n2, property := (_ : ∃ y, (fun x => f ^ x) y = (fun x => f ^ x) n2) }).2 ∈
      J

Next tactic:
rcases MemCarrier.clear_denominator' x hx12 with ⟨c, N, acd, 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
  

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
⊢ toFun f ⁻¹'
      ↑(sbo
          Quotient.mk''
            { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
              den_mem := b_mem2 }) =
    {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
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 _ _ _))
      generalize_proofs h₁ h₂; exact (Classical.choose_spec h₂).1
    rcases y.1.isPrime.mem_or_mem this with (H1 | H3)
    rcases y.1.isPrime.mem_or_mem H1 with (H1 | H2)
    · exact hy2 H1
    · exact y.2 (y.1.isPrime.mem_of_pow_mem N H2)
    · exact y.2 (y.1.isPrime.mem_of_pow_mem M H3)
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
  

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
⊢ toFun f ⁻¹'
      ↑(sbo
          Quotient.mk''
            { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
              den_mem := b_mem2 }) =
    {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
ext1 y
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
  

Proof state:
case 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
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
⊢ y ∈
      toFun f ⁻¹'
        ↑(sbo
            Quotient.mk''
              { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
                den_mem := b_mem2 }) ↔
    y ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

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

Proof state:
case 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
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
⊢ y ∈
      toFun f ⁻¹'
        ↑(sbo
            Quotient.mk''
              { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
                den_mem := b_mem2 }) →
    y ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
intro hy
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 <;> 

Proof state:
case 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
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
⊢ y ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a} →
    y ∈
      toFun f ⁻¹'
        ↑(sbo
            Quotient.mk''
              { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
                den_mem := b_mem2 })

Next tactic:
intro hy
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
  · 

Proof state:
case 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
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
hy :
  y ∈
    toFun f ⁻¹'
      ↑(sbo
          Quotient.mk''
            { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
              den_mem := b_mem2 })
⊢ y ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}

Next tactic:
refine' ⟨y.2, _⟩
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, _⟩
    

Proof state:
case 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
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
hy :
  y ∈
    toFun f ⁻¹'
      ↑(sbo
          Quotient.mk''
            { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
              den_mem := b_mem2 })
⊢ ↑y ∈ ↑(pbo a)

Next tactic:
rw [Set.mem_preimage, SetLike.mem_coe, PrimeSpectrum.mem_basicOpen] at hy
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
    

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
⊢ ↑y ∈ ↑(pbo a)

Next tactic:
rw [ProjectiveSpectrum.mem_coe_basicOpen]
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]
    

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
⊢ a ∉ (↑y).asHomogeneousIdeal

Next tactic:
intro a_mem_y
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
    

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
a_mem_y : a ∈ (↑y).asHomogeneousIdeal
⊢ False

Next tactic:
apply hy
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
    

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
a_mem_y : a ∈ (↑y).asHomogeneousIdeal
⊢ Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∈
    (toFun f y).asIdeal

Next tactic:
rw [toFun, mem_carrier_iff, HomogeneousLocalization.val_mk'', Subtype.coe_mk]
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]
    

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
a_mem_y : a ∈ (↑y).asHomogeneousIdeal
⊢ Localization.mk a
      {
        val :=
          ↑{ deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
                den_mem := b_mem2 }.den,
        property :=
          (_ :
            ↑{ deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
                    den_mem := b_mem2 }.den ∈
              Submonoid.powers f) } ∈
    span (⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)

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

Proof state:
case 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
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
hy :
  Quotient.mk''
      { deg := k, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 }, den_mem := b_mem2 } ∉
    (toFun f y).asIdeal
a_mem_y : a ∈ (↑y).asHomogeneousIdeal
⊢ Localization.mk a { val := b, property := b_mem2 } ∈ span (⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)

Next tactic:
rcases b_mem2 with ⟨k, hk⟩
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⟩
    

Proof state:
case h.mp.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✝
y : ↑↑(LocallyRingedSpace.restrict Proj (_ : OpenEmbedding ⇑(Opens.inclusion (pbo f)))).toSheafedSpace.toPresheafedSpace
a_mem_y : a ∈ (↑y).asHomogeneousIdeal
k : ℕ
hk : (fun x => f ^ x) k = b
hy :
  Quotient.mk''
      { deg := k✝, num := { val := a, property := a_mem }, den := { val := b, property := b_mem1 },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = b) } ∉
    (toFun f y).asIdeal
⊢ Localization.mk a { val := b, property := (_ : ∃ y, (fun x => f ^ x) y = b) } ∈
    span (⇑(algebraMap A (Away f)) '' ↑(↑y).asHomogeneousIdeal)

Next tactic:
dsimp at hk