l3lab/ntp-mathlib huggingface dataset:
theorem carrier.smul_mem (c x : A) (hx : x ∈ carrier f_deg q) : c • x ∈ carrier f_deg q := by
  revert c
  refine' DirectSum.Decomposition.inductionOn 𝒜 _ _ _
  · rw [zero_smul]; exact carrier.zero_mem f_deg hm _
  · rintro n ⟨a, ha⟩ i
    simp_rw [proj_apply, smul_eq_mul, coe_decompose_mul_of_left_mem 𝒜 i ha]
    -- Porting note: having trouble with Mul instance
    let product : A⁰_ f :=
      Mul.mul (Quotient.mk'' ⟨_, ⟨a ^ m, pow_mem_graded m ha⟩, ⟨_, ?_⟩, ⟨n, rfl⟩⟩ : A⁰_ f)
          (Quotient.mk'' ⟨_, ⟨proj 𝒜 (i - n) x ^ m, by mem_tac⟩, ⟨_, ?_⟩, ⟨i - n, rfl⟩⟩ : A⁰_ f)
    split_ifs with h
    · convert_to product ∈ q.1
      · dsimp
        erw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.mul_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.val_mk'']
        simp_rw [mul_pow]; rw [Localization.mk_mul]
        congr; erw [← pow_add, Nat.add_sub_of_le h]
        · rw [(_ : m • n = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
        · rw [(_ : m • (i - n) = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
      · apply Ideal.mul_mem_left (α := A⁰_ f) _ _ (hx _)
    · simp_rw [zero_pow hm]; convert carrier.zero_mem f_deg hm q i; 

Proof state:
case h.e'_4.h.e'_3.h.e'_10.h.e'_3
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 : A
hx : x ∈ carrier f_deg q
n : ℕ
a : A
ha : a ∈ 𝒜 n
i : ℕ
product : A⁰_ f :=
  Mul.mul
    (Quotient.mk''
      { deg := m • n, num := { val := a ^ m, property := (_ : a ^ 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)) }) })
    (Quotient.mk''
      { deg := m • (i - n),
        num := { val := (proj 𝒜 (i - n)) x ^ m, property := (_ : (proj 𝒜 (i - n)) x ^ m ∈ 𝒜 (m • (i - n))) },
        den := { val := f ^ (i - n), property := (_ : f ^ (i - n) ∈ 𝒜 (m • (i - n))) },
        den_mem :=
          (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ (i - n), property := (_ : f ^ (i - n) ∈ 𝒜 (m • (i - n))) }) })
h : ¬n ≤ i
⊢ 0 = (proj 𝒜 i) 0 ^ m

Next tactic:
rw [map_zero, zero_pow hm]
theorem carrier.smul_mem (c x : A) (hx : x ∈ carrier f_deg q) : c • x ∈ carrier f_deg q := by
  revert c
  refine' DirectSum.Decomposition.inductionOn 𝒜 _ _ _
  · rw [zero_smul]; exact carrier.zero_mem f_deg hm _
  · rintro n ⟨a, ha⟩ i
    simp_rw [proj_apply, smul_eq_mul, coe_decompose_mul_of_left_mem 𝒜 i ha]
    -- Porting note: having trouble with Mul instance
    let product : A⁰_ f :=
      Mul.mul (Quotient.mk'' ⟨_, ⟨a ^ m, pow_mem_graded m ha⟩, ⟨_, ?_⟩, ⟨n, rfl⟩⟩ : A⁰_ f)
          (Quotient.mk'' ⟨_, ⟨proj 𝒜 (i - n) x ^ m, by mem_tac⟩, ⟨_, ?_⟩, ⟨i - n, rfl⟩⟩ : A⁰_ f)
    split_ifs with h
    · convert_to product ∈ q.1
      · dsimp
        erw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.mul_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.val_mk'']
        simp_rw [mul_pow]; rw [Localization.mk_mul]
        congr; erw [← pow_add, Nat.add_sub_of_le h]
        · rw [(_ : m • n = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
        · rw [(_ : m • (i - n) = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
      · apply Ideal.mul_mem_left (α := A⁰_ f) _ _ (hx _)
    · simp_rw [zero_pow hm]; convert carrier.zero_mem f_deg hm q i; rw [map_zero, zero_pow hm]
  · 

Proof state:
case refine'_3
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 : A
hx : x ∈ carrier f_deg q
⊢ ∀ (m_1 m' : A), m_1 • x ∈ carrier f_deg q → m' • x ∈ carrier f_deg q → (m_1 + m') • x ∈ carrier f_deg q

Next tactic:
simp_rw [add_smul]
theorem carrier.smul_mem (c x : A) (hx : x ∈ carrier f_deg q) : c • x ∈ carrier f_deg q := by
  revert c
  refine' DirectSum.Decomposition.inductionOn 𝒜 _ _ _
  · rw [zero_smul]; exact carrier.zero_mem f_deg hm _
  · rintro n ⟨a, ha⟩ i
    simp_rw [proj_apply, smul_eq_mul, coe_decompose_mul_of_left_mem 𝒜 i ha]
    -- Porting note: having trouble with Mul instance
    let product : A⁰_ f :=
      Mul.mul (Quotient.mk'' ⟨_, ⟨a ^ m, pow_mem_graded m ha⟩, ⟨_, ?_⟩, ⟨n, rfl⟩⟩ : A⁰_ f)
          (Quotient.mk'' ⟨_, ⟨proj 𝒜 (i - n) x ^ m, by mem_tac⟩, ⟨_, ?_⟩, ⟨i - n, rfl⟩⟩ : A⁰_ f)
    split_ifs with h
    · convert_to product ∈ q.1
      · dsimp
        erw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.mul_val, HomogeneousLocalization.val_mk'',
          HomogeneousLocalization.val_mk'']
        simp_rw [mul_pow]; rw [Localization.mk_mul]
        congr; erw [← pow_add, Nat.add_sub_of_le h]
        · rw [(_ : m • n = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
        · rw [(_ : m • (i - n) = _)]; mem_tac; simp only [smul_eq_mul, mul_comm]
      · apply Ideal.mul_mem_left (α := A⁰_ f) _ _ (hx _)
    · simp_rw [zero_pow hm]; convert carrier.zero_mem f_deg hm q i; rw [map_zero, zero_pow hm]
  · simp_rw [add_smul]; 

Proof state:
case refine'_3
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 : A
hx : x ∈ carrier f_deg q
⊢ ∀ (m_1 m' : A), m_1 • x ∈ carrier f_deg q → m' • x ∈ carrier f_deg q → m_1 • x + m' • x ∈ carrier f_deg q

Next tactic:
exact fun _ _ => carrier.add_mem f_deg q
theorem carrier.asIdeal.homogeneous : (carrier.asIdeal f_deg hm q).IsHomogeneous 𝒜 :=
  fun i a ha j =>
  (em (i = j)).elim (fun h => h ▸ 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
hm : 0 < m
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
i : ℕ
a : A
ha : a ∈ asIdeal f_deg hm q
j : ℕ
h : i = j
⊢ Quotient.mk''
      { deg := m * i,
        num :=
          { val := (proj 𝒜 i) ↑(((decompose 𝒜) a) i) ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜)))
                        ↑(((decompose 𝒜) a) i)) ^
                    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:
simpa only [proj_apply, decompose_coe, of_eq_same] using ha _
theorem carrier.asIdeal.homogeneous : (carrier.asIdeal f_deg hm q).IsHomogeneous 𝒜 :=
  fun i a ha j =>
  (em (i = j)).elim (fun h => h ▸ by simpa only [proj_apply, decompose_coe, of_eq_same] using ha _)
    fun h => 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
hm : 0 < m
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
i : ℕ
a : A
ha : a ∈ asIdeal f_deg hm q
j : ℕ
h : ¬i = j
⊢ Quotient.mk''
      { deg := m * j,
        num :=
          { val := (proj 𝒜 j) ↑(((decompose 𝒜) a) i) ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply j) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜)))
                        ↑(((decompose 𝒜) a) i)) ^
                    m ∈
                  𝒜 (m • j)) },
        den := { val := f ^ j, property := (_ : f ^ j ∈ 𝒜 (m * j)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ j, property := (_ : f ^ j ∈ 𝒜 (m * j)) }) } ∈
    q.asIdeal

Next tactic:
simp only [proj_apply, decompose_of_mem_ne 𝒜 (Submodule.coe_mem (decompose 𝒜 a i)) h,
      zero_pow hm]
theorem carrier.asIdeal.homogeneous : (carrier.asIdeal f_deg hm q).IsHomogeneous 𝒜 :=
  fun i a ha j =>
  (em (i = j)).elim (fun h => h ▸ by simpa only [proj_apply, decompose_coe, of_eq_same] using ha _)
    fun h => by
    simp only [proj_apply, decompose_of_mem_ne 𝒜 (Submodule.coe_mem (decompose 𝒜 a i)) h,
      zero_pow hm]
    

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
hm : 0 < m
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
i : ℕ
a : A
ha : a ∈ asIdeal f_deg hm q
j : ℕ
h : ¬i = j
⊢ Quotient.mk''
      { deg := m * j, num := { val := 0, property := (_ : (fun x => x ∈ 𝒜 (m * j)) 0) },
        den := { val := f ^ j, property := (_ : f ^ j ∈ 𝒜 (m * j)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ j, property := (_ : f ^ j ∈ 𝒜 (m * j)) }) } ∈
    q.asIdeal

Next tactic:
convert carrier.zero_mem f_deg hm q j
theorem carrier.asIdeal.homogeneous : (carrier.asIdeal f_deg hm q).IsHomogeneous 𝒜 :=
  fun i a ha j =>
  (em (i = j)).elim (fun h => h ▸ by simpa only [proj_apply, decompose_coe, of_eq_same] using ha _)
    fun h => by
    simp only [proj_apply, decompose_of_mem_ne 𝒜 (Submodule.coe_mem (decompose 𝒜 a i)) h,
      zero_pow hm]
    convert carrier.zero_mem f_deg hm q j; 

Proof state:
case h.e'_4.h.e'_3.h.e'_10.h.e'_3
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
i : ℕ
a : A
ha : a ∈ asIdeal f_deg hm q
j : ℕ
h : ¬i = j
⊢ 0 = (proj 𝒜 j) 0 ^ m

Next tactic:
rw [map_zero, zero_pow hm]
theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q := fun rid =>
  q.IsPrime.ne_top <|
    (Ideal.eq_top_iff_one _).mpr
      (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
hm : 0 < m
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
rid : f ∈ asIdeal f_deg hm q
⊢ 1 ∈ q.asIdeal

Next tactic:
convert rid m
theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q := fun rid =>
  q.IsPrime.ne_top <|
    (Ideal.eq_top_iff_one _).mpr
      (by
        convert rid m
        

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
rid : f ∈ asIdeal f_deg hm q
e_1✝ :
  ↑(CommRingCat.of (A⁰_ f)) =
    Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f)))
⊢ 1 =
    Quotient.mk''
      { deg := m * m,
        num :=
          { val := (proj 𝒜 m) f ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply m) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) f) ^ m ∈
                  𝒜 (m • m)) },
        den := { val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) },
        den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }

Next tactic:
rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.one_val,
          HomogeneousLocalization.val_mk'']
theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q := fun rid =>
  q.IsPrime.ne_top <|
    (Ideal.eq_top_iff_one _).mpr
      (by
        convert rid m
        rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.one_val,
          HomogeneousLocalization.val_mk'']
        

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
rid : f ∈ asIdeal f_deg hm q
e_1✝ :
  ↑(CommRingCat.of (A⁰_ f)) =
    Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f)))
⊢ 1 =
    Localization.mk
      ↑{ deg := m * m,
            num :=
              { val := (proj 𝒜 m) f ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply m) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) f) ^ m ∈
                      𝒜 (m • m)) },
            den := { val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) },
            den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }.num
      {
        val :=
          ↑{ deg := m * m,
                num :=
                  { val := (proj 𝒜 m) f ^ m,
                    property :=
                      (_ :
                        ↑((LinearMap.comp (DFinsupp.lapply m) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) f) ^ m ∈
                          𝒜 (m • m)) },
                den := { val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) },
                den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }.den,
        property :=
          (_ :
            ↑{ deg := m * m,
                    num :=
                      { val := (proj 𝒜 m) f ^ m,
                        property :=
                          (_ :
                            ↑((LinearMap.comp (DFinsupp.lapply m) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) f) ^ m ∈
                              𝒜 (m • m)) },
                    den := { val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) },
                    den_mem :=
                      (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }.den ∈
              Submonoid.powers f) }

Next tactic:
dsimp
theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q := fun rid =>
  q.IsPrime.ne_top <|
    (Ideal.eq_top_iff_one _).mpr
      (by
        convert rid m
        rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.one_val,
          HomogeneousLocalization.val_mk'']
        dsimp
        

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
rid : f ∈ asIdeal f_deg hm q
e_1✝ :
  ↑(CommRingCat.of (A⁰_ f)) =
    Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f)))
⊢ 1 =
    Localization.mk (↑(((decompose 𝒜) f) m) ^ m)
      { val := f ^ m,
        property := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }

Next tactic:
simp_rw [decompose_of_mem_same _ f_deg]
theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q := fun rid =>
  q.IsPrime.ne_top <|
    (Ideal.eq_top_iff_one _).mpr
      (by
        convert rid m
        rw [HomogeneousLocalization.ext_iff_val, HomogeneousLocalization.one_val,
          HomogeneousLocalization.val_mk'']
        dsimp
        simp_rw [decompose_of_mem_same _ f_deg]
        

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
rid : f ∈ asIdeal f_deg hm q
e_1✝ :
  ↑(CommRingCat.of (A⁰_ f)) =
    Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f)))
⊢ 1 =
    Localization.mk (f ^ m)
      { val := f ^ m,
        property := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ m, property := (_ : f ^ m ∈ 𝒜 (m * m)) }) }

Next tactic:
simp only [mk_eq_monoidOf_mk', Submonoid.LocalizationMap.mk'_self]
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
      

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
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
⊢ (∀ (i : ℕ),
      Quotient.mk''
          { deg := m * i,
            num :=
              { val := (proj 𝒜 i) x ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) x) ^ 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 : ℕ),
      Quotient.mk''
          { deg := m * i,
            num :=
              { val := (proj 𝒜 i) y ^ m,
                property :=
                  (_ :
                    ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ 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 [← and_forall_ne nx, and_iff_left, ← and_forall_ne ny, and_iff_left]
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]
      · 

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
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
⊢ Quotient.mk''
        { deg := m * nx,
          num :=
            { val := (proj 𝒜 nx) x ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply nx) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) x) ^ m ∈
                    𝒜 (m • nx)) },
          den := { val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) }) } ∈
      q.asIdeal ∨
    Quotient.mk''
        { deg := m * ny,
          num :=
            { val := (proj 𝒜 ny) y ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply ny) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                    𝒜 (m • ny)) },
          den := { val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) }) } ∈
      q.asIdeal

Next tactic:
apply q.2.mem_or_mem
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; 

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
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
⊢ Quotient.mk''
        { deg := m * nx,
          num :=
            { val := (proj 𝒜 nx) x ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply nx) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) x) ^ m ∈
                    𝒜 (m • nx)) },
          den := { val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) }) } *
      Quotient.mk''
        { deg := m * ny,
          num :=
            { val := (proj 𝒜 ny) y ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply ny) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                    𝒜 (m • ny)) },
          den := { val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) }) } ∈
    q.asIdeal

Next tactic:
convert hxy (nx + ny) using 1
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
        

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
e_1✝ :
  ↑(CommRingCat.of (A⁰_ f)) =
    Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f)))
⊢ Quotient.mk''
        { deg := m * nx,
          num :=
            { val := (proj 𝒜 nx) x ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply nx) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) x) ^ m ∈
                    𝒜 (m • nx)) },
          den := { val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ nx, property := (_ : f ^ nx ∈ 𝒜 (m * nx)) }) } *
      Quotient.mk''
        { deg := m * ny,
          num :=
            { val := (proj 𝒜 ny) y ^ m,
              property :=
                (_ :
                  ↑((LinearMap.comp (DFinsupp.lapply ny) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) y) ^ m ∈
                    𝒜 (m • ny)) },
          den := { val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) },
          den_mem := (_ : ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ ny, property := (_ : f ^ ny ∈ 𝒜 (m * ny)) }) } =
    Quotient.mk''
      { deg := m * (nx + ny),
        num :=
          { val := (proj 𝒜 (nx + ny)) (x * y) ^ m,
            property :=
              (_ :
                ↑((LinearMap.comp (DFinsupp.lapply (nx + ny)) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) (x * y)) ^
                    m ∈
                  𝒜 (m • (nx + ny))) },
        den := { val := f ^ (nx + ny), property := (_ : f ^ (nx + ny) ∈ 𝒜 (m * (nx + ny))) },
        den_mem :=
          (_ :
            ∃ y, (fun x => f ^ x) y = ↑{ val := f ^ (nx + ny), property := (_ : f ^ (nx + ny) ∈ 𝒜 (m * (nx + ny))) }) }

Next tactic:
dsimp