theorem carrier.add_mem (q : Spec.T A⁰_ f) {a b : A} (ha : a ∈ carrier f_deg q)
    (hb : b ∈ carrier f_deg q) : a + b ∈ carrier f_deg q := by
  refine' fun i => (q.2.mem_or_mem _).elim id id
  change (Quotient.mk'' ⟨_, _, _, _⟩ : A⁰_ f) ∈ q.1; dsimp only [Subtype.coe_mk]
  simp_rw [← pow_add, map_add, add_pow, mul_comm, ← nsmul_eq_mul]
  let g : ℕ → A⁰_ f := fun j => (m + m).choose j •
      if h2 : m + m < j then (0 : A⁰_ f)
      else
        -- Porting note: inlining `l`, `r` causes a "can't synth HMul A⁰_ f A⁰_ f ?" error
        if h1 : j ≤ m then
          letI l : A⁰_ f := Quotient.mk''
            ⟨m * i, ⟨proj 𝒜 i a ^ j * proj 𝒜 i b ^ (m - j), ?_⟩,
              ⟨_, by rw [mul_comm]; mem_tac⟩, ⟨i, rfl⟩⟩
          letI r : A⁰_ f := Quotient.mk''
            ⟨m * i, ⟨proj 𝒜 i b ^ m, by mem_tac⟩,
              ⟨_, by rw [mul_comm]; mem_tac⟩, ⟨i, rfl⟩⟩
          l * r
        else
          letI l : A⁰_ f := Quotient.mk''
            ⟨m * i, ⟨proj 𝒜 i a ^ m, by mem_tac⟩,
              ⟨_, by rw [mul_comm]; mem_tac⟩, ⟨i, rfl⟩⟩
          letI r : A⁰_ f := Quotient.mk''
            ⟨m * i, ⟨proj 𝒜 i a ^ (j - m) * proj 𝒜 i b ^ (m + m - j), ?_⟩,
              ⟨_, by rw [mul_comm]; mem_tac⟩, ⟨i, rfl⟩⟩
          l * r
  rotate_left
  · rw [(_ : m * i = _)]
    -- Porting note: it seems unification with mul_mem is more fiddly reducing value of mem_tac
    apply GradedMonoid.toGradedMul.mul_mem (i := j • i) (j := (m - j) • i) <;> mem_tac_aux
    rw [← add_smul, Nat.add_sub_of_le h1]; rfl
  · rw [(_ : m * i = _)]
    apply GradedMonoid.toGradedMul.mul_mem (i := (j-m) • i) (j := (m + m - j) • i) <;> mem_tac_aux
    rw [← add_smul]; congr; zify [le_of_not_lt h2, le_of_not_le h1]; abel
  convert_to ∑ i in range (m + m + 1), g i ∈ q.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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a b : A
ha : a ∈ carrier f_deg q
hb : b ∈ carrier f_deg q
i : ℕ
g : ℕ → A⁰_ f :=
  fun j =>
    Nat.choose (m + m) j •
      if h2 : m + m < j then 0
      else
        if h1 : j ≤ m then
          Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) a ^ j * (proj 𝒜 i) b ^ (m - j),
                    property := (_ : (proj 𝒜 i) a ^ j * (proj 𝒜 i) b ^ (m - j) ∈ 𝒜 (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)) }) } *
            Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) b ^ m,
                    property :=
                      (_ :
                        ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) b) ^ 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)) }) }
        else
          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)) }) } *
            Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) a ^ (j - m) * (proj 𝒜 i) b ^ (m + m - j),
                    property := (_ : (proj 𝒜 i) a ^ (j - m) * (proj 𝒜 i) b ^ (m + m - j) ∈ 𝒜 (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)) }) }
e_1✝ : Quotient (Setoid.ker (HomogeneousLocalization.NumDenSameDeg.embedding 𝒜 (Submonoid.powers f))) = A⁰_ f
⊢ Quotient.mk''
      { deg := m * i + m * i,
        num :=
          { val := ∑ x in range (m + m + 1), Nat.choose (m + m) x • ((proj 𝒜 i) a ^ x * (proj 𝒜 i) b ^ (m + m - x)),
            property :=
              (_ :
                (fun x => x ∈ 𝒜 (m * i + m * i))
                  (∑ x in range (m + m + 1), Nat.choose (m + m) x • ((proj 𝒜 i) a ^ x * (proj 𝒜 i) b ^ (m + m - x)))) },
        den := { val := f ^ (i + i), property := (_ : (fun x => x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i))) },
        den_mem :=
          (_ :
            ↑{ val := f ^ (i + i), property := (_ : (fun x => x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i))) } ∈
              Submonoid.powers f) } =
    ∑ i in range (m + m + 1), g i
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
q : ↑↑(Spec A⁰_ f).toSheafedSpace.toPresheafedSpace
a b : A
ha : a ∈ carrier f_deg q
hb : b ∈ carrier f_deg q
i : ℕ
g : ℕ → A⁰_ f :=
  fun j =>
    Nat.choose (m + m) j •
      if h2 : m + m < j then 0
      else
        if h1 : j ≤ m then
          Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) a ^ j * (proj 𝒜 i) b ^ (m - j),
                    property := (_ : (proj 𝒜 i) a ^ j * (proj 𝒜 i) b ^ (m - j) ∈ 𝒜 (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)) }) } *
            Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) b ^ m,
                    property :=
                      (_ :
                        ↑((LinearMap.comp (DFinsupp.lapply i) (AlgHom.toLinearMap ↑(decomposeAlgEquiv 𝒜))) b) ^ 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)) }) }
        else
          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)) }) } *
            Quotient.mk''
              { deg := m * i,
                num :=
                  { val := (proj 𝒜 i) a ^ (j - m) * (proj 𝒜 i) b ^ (m + m - j),
                    property := (_ : (proj 𝒜 i) a ^ (j - m) * (proj 𝒜 i) b ^ (m + m - j) ∈ 𝒜 (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)) }) }
⊢ ∑ i in range (m + m + 1), g i ∈ q.asIdeal

Next tactic:
swap