l3lab/ntp-mathlib huggingface dataset:
/-- 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]
    · intro hz; 

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))
hz : z ∈ {x | ↑x ∈ (pbo f) ⊓ pbo a}
⊢ z ∈ Subtype.val ⁻¹' ((pbo f).carrier ⊓ (pbo a).carrier)

Next tactic:
simpa only [Set.inf_eq_inter,Set.mem_inter_iff,Set.mem_preimage]
/-- The function from `Spec A⁰_f` to `Proj|D(f)` is defined by `q ↦ {a | aᵢᵐ/fⁱ ∈ q}`, i.e. sending
`q` a prime ideal in `A⁰_f` to the homogeneous prime relevant ideal containing only and all the
elements `a : A` such that for every `i`, the degree 0 element formed by dividing the `m`-th power
of the `i`-th projection of `a` by the `i`-th power of the degree-`m` homogeneous element `f`,
lies in `q`.

The set `{a | aᵢᵐ/fⁱ ∈ q}`
* is an ideal, as proved in `carrier.asIdeal`;
* is homogeneous, as proved in `carrier.asHomogeneousIdeal`;
* is prime, as proved in `carrier.asIdeal.prime`;
* is relevant, as proved in `carrier.relevant`.
-/
def carrier (q : Spec.T A⁰_ f) : Set A :=
  {a | ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ (proj 𝒜 i) a ^ m ∈ 𝒜 (m * i)

Next tactic:
mem_tac
/-- The function from `Spec A⁰_f` to `Proj|D(f)` is defined by `q ↦ {a | aᵢᵐ/fⁱ ∈ q}`, i.e. sending
`q` a prime ideal in `A⁰_f` to the homogeneous prime relevant ideal containing only and all the
elements `a : A` such that for every `i`, the degree 0 element formed by dividing the `m`-th power
of the `i`-th projection of `a` by the `i`-th power of the degree-`m` homogeneous element `f`,
lies in `q`.

The set `{a | aᵢᵐ/fⁱ ∈ q}`
* is an ideal, as proved in `carrier.asIdeal`;
* is homogeneous, as proved in `carrier.asHomogeneousIdeal`;
* is prime, as proved in `carrier.asIdeal.prime`;
* is relevant, as proved in `carrier.relevant`.
-/
def carrier (q : Spec.T A⁰_ f) : Set A :=
  {a | ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, by mem_tac⟩,
              ⟨f ^ i, 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ f ^ i ∈ 𝒜 (m * i)

Next tactic:
rw [mul_comm]
/-- The function from `Spec A⁰_f` to `Proj|D(f)` is defined by `q ↦ {a | aᵢᵐ/fⁱ ∈ q}`, i.e. sending
`q` a prime ideal in `A⁰_f` to the homogeneous prime relevant ideal containing only and all the
elements `a : A` such that for every `i`, the degree 0 element formed by dividing the `m`-th power
of the `i`-th projection of `a` by the `i`-th power of the degree-`m` homogeneous element `f`,
lies in `q`.

The set `{a | aᵢᵐ/fⁱ ∈ q}`
* is an ideal, as proved in `carrier.asIdeal`;
* is homogeneous, as proved in `carrier.asHomogeneousIdeal`;
* is prime, as proved in `carrier.asIdeal.prime`;
* is relevant, as proved in `carrier.relevant`.
-/
def carrier (q : Spec.T A⁰_ f) : Set A :=
  {a | ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, by mem_tac⟩,
              ⟨f ^ i, by rw [mul_comm]; 

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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ f ^ i ∈ 𝒜 (i * m)

Next tactic:
mem_tac
theorem mem_carrier_iff (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔ ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ (proj 𝒜 i) a ^ m ∈ 𝒜 (m * i)

Next tactic:
mem_tac
theorem mem_carrier_iff (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔ ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, by mem_tac⟩,
      ⟨f ^ i, 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ f ^ i ∈ 𝒜 (m * i)

Next tactic:
rw [mul_comm]
theorem mem_carrier_iff (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔ ∀ i, (Quotient.mk'' ⟨m * i, ⟨proj 𝒜 i a ^ m, by mem_tac⟩,
      ⟨f ^ i, by rw [mul_comm]; 

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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
⊢ f ^ i ∈ 𝒜 (i * m)

Next tactic:
mem_tac
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
⊢ (∀ (i : ℕ),
      Quotient.mk''
          { deg := m * i,
            num :=
              { val := (proj 𝒜 i) a ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                      𝒜 (m • i)) },
            den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
        q.asIdeal) ↔
    ∀ (i : ℕ),
      Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
        ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}

Next tactic:
constructor
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
⊢ (∀ (i : ℕ),
      Quotient.mk''
          { deg := m * i,
            num :=
              { val := (proj 𝒜 i) a ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                      𝒜 (m • i)) },
            den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
        q.asIdeal) →
    ∀ (i : ℕ),
      Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
        ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}

Next tactic:
intro h i
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
⊢ (∀ (i : ℕ),
      Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
        ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}) →
    ∀ (i : ℕ),
      Quotient.mk''
          { deg := m * i,
            num :=
              { val := (proj 𝒜 i) a ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                      𝒜 (m • i)) },
            den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
        q.asIdeal

Next tactic:
intro h i
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
h :
  ∀ (i : ℕ),
    Quotient.mk''
        { deg := m * i,
          num :=
            { val := (proj 𝒜 i) a ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                    𝒜 (m • i)) },
          den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
      q.asIdeal
i : ℕ
⊢ Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
    ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}

Next tactic:
specialize h i
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
h :
  ∀ (i : ℕ),
    Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
      ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}
i : ℕ
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal

Next tactic:
specialize h i
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
h :
  Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal
⊢ Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
    ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}

Next tactic:
rw [Set.mem_image]
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
h :
  Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal
⊢ ∃ x ∈ {s | s ∈ q.asIdeal},
    (algebraMap (A⁰_ f) (Away f)) x =
      Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) }

Next tactic:
refine' ⟨_, h, rfl⟩
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; refine' ⟨_, h, rfl⟩
      · 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
h :
  Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) } ∈
    ⇑(algebraMap (A⁰_ f) (Away f)) '' {s | s ∈ q.asIdeal}
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal

Next tactic:
rw [Set.mem_image] at h
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; refine' ⟨_, h, rfl⟩
      · rw [Set.mem_image] at h; 

Proof state:
case 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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
h :
  ∃ x ∈ {s | s ∈ q.asIdeal},
    (algebraMap (A⁰_ f) (Away f)) x =
      Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) }
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal

Next tactic:
rcases h with ⟨x, h, hx⟩
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; refine' ⟨_, h, rfl⟩
      · rw [Set.mem_image] at h; rcases h with ⟨x, h, hx⟩
        

Proof state:
case mpr.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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
x : A⁰_ f
h : x ∈ {s | s ∈ q.asIdeal}
hx :
  (algebraMap (A⁰_ f) (Away f)) x =
    Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) }
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal

Next tactic:
change x ∈ q.asIdeal at h
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; refine' ⟨_, h, rfl⟩
      · rw [Set.mem_image] at h; rcases h with ⟨x, h, hx⟩
        change x ∈ q.asIdeal at h
        

Proof state:
case mpr.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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
x : A⁰_ f
hx :
  (algebraMap (A⁰_ f) (Away f)) x =
    Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) }
h : x ∈ q.asIdeal
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } ∈
    q.asIdeal

Next tactic:
convert h
theorem mem_carrier_iff' (q : Spec.T A⁰_ f) (a : A) :
    a ∈ carrier f_deg q ↔
      ∀ i, (Localization.mk (proj 𝒜 i a ^ m) ⟨f ^ i, ⟨i, rfl⟩⟩ : Localization.Away f) ∈
          algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f) '' { s | s ∈ q.1 } :=
  (mem_carrier_iff f_deg q a).trans
    (by
      constructor <;> intro h i <;> specialize h i
      · rw [Set.mem_image]; refine' ⟨_, h, rfl⟩
      · rw [Set.mem_image] at h; rcases h with ⟨x, h, hx⟩
        change x ∈ q.asIdeal at h
        convert h
        

Proof state:
case h.e'_4.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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a : A
i : ℕ
x : A⁰_ f
hx :
  (algebraMap (A⁰_ f) (Away f)) x =
    Localization.mk ((proj 𝒜 i) a ^ m) { val := f ^ i, property := (_ : ∃ y, (fun x => f ^ x) y = f ^ i) }
h : x ∈ q.asIdeal
e_1✝ : Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f))) = A⁰_ f
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) a ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) a) ^ m ∈
                  𝒜 (m • i)) },
        den := { val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ i, property := (_ : f ^ i ∈ 𝒜 (m * i)) }) } =
    x

Next tactic:
rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'']