theorem carrier.asIdeal.prime : (carrier.asIdeal f_deg hm q).IsPrime :=
  (carrier.asIdeal.homogeneous f_deg hm q).isPrime_of_homogeneous_mem_or_mem
    (carrier.asIdeal.ne_top f_deg hm q) fun {x y} ⟨nx, hnx⟩ ⟨ny, hny⟩ hxy =>
    show (∀ i, _ ∈ _) ∨ ∀ i, _ ∈ _ by
      rw [← and_forall_ne nx, and_iff_left, ← and_forall_ne ny, and_iff_left]
      · apply q.2.mem_or_mem; convert hxy (nx + ny) using 1
        dsimp
        simp_rw [decompose_of_mem_same 𝒜 hnx, decompose_of_mem_same 𝒜 hny,
          decompose_of_mem_same 𝒜 (SetLike.GradedMonoid.toGradedMul.mul_mem hnx hny),
          mul_pow, pow_add]
        simp only [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.mul_val, mk_mul]
        simp only [Submonoid.mk_mul_mk, mk_eq_monoidOf_mk']
      all_goals
        intro n hn; convert q.1.zero_mem using 1
        rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.zero_val]; 

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
hm : 0 < m
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
x y : A
x✝¹ : Homogeneous 𝒜 x
x✝ : Homogeneous 𝒜 y
hxy : x * y ∈ asIdeal f_deg hm q
nx : ℕ
hnx : x ∈ 𝒜 nx
ny : ℕ
hny : y ∈ 𝒜 ny
n : ℕ
hn : n ≠ ny
e_1✝ :
  Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f))) =
    ↑(CommRingCat.of (A⁰_ f))
⊢ Localization.mk
      ↑{ deg := m * n,
            num :=
              { val := (proj 𝒜 n) y ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply n) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                      𝒜 (m • n)) },
            den := { val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) }) }.num
      {
        val :=
          ↑{ deg := m * n,
                num :=
                  { val := (proj 𝒜 n) y ^ m,
                    property :=
                      (_ :
                        ↑((LinearMap.comp (DFinsupp.lapply n) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                          𝒜 (m • n)) },
                den := { val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) },
                den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) }) }.den,
        property :=
          (_ :
            ↑{ deg := m * n,
                    num :=
                      { val := (proj 𝒜 n) y ^ m,
                        property :=
                          (_ :
                            ↑((LinearMap.comp (DFinsupp.lapply n) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                              𝒜 (m • n)) },
                    den := { val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) },
                    den_mem :=
                      (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ n, property := (_ : f ^ n ∈ 𝒜 (m * n)) }) }.den ∈
              Submonoid.powers f) } =
    0

Next tactic:
simp_rw [proj_apply]