-- Lean 4 proof step from Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme (goal)
Goal:
A : Type u_1
σ : Type u_2
inst : CommRing A
inst_1 : SetLike σ A
inst_2 : AddSubgroupClass σ A
𝒜 : ℕ → σ
inst_3 : GradedRing 𝒜
f : A
m : ℕ
f_deg : f ∈ 𝒜 m
q : (↑(↑(Spec A⁰_ f).toPresheafedSpace : TopCat) : Type u_1)
a b : A
ha : a ∈ carrier f_deg q
hb : b ∈ carrier f_deg q
i : ℕ
g : ℕ → A⁰_ f :=
  fun (j : ℕ) ↦
    HSMul.hSMul (β := A⁰_ f) ((m + m).choose j)
      (if h2 : m + m < j then 0
      else
        if h1 : j ≤ m then
          HMul.hMul (α := HomogeneousLocalization 𝒜 (Submonoid.powers f))
            (HomogeneousLocalization.mk
              { deg := m * i,
                num :=
                  Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i))
                    (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) j *
                      HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m - j))
                    ⋯,
                den := Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (f ^ i) ⋯, den_mem := ⋯ })
            (HomogeneousLocalization.mk
              { deg := m * i,
                num :=
                  Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) m)
                    ⋯,
                den := Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (f ^ i) ⋯, den_mem := ⋯ })
        else
          HMul.hMul (α := HomogeneousLocalization 𝒜 (Submonoid.powers f))
            (HomogeneousLocalization.mk
              { deg := m * i,
                num :=
                  Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) m)
                    ⋯,
                den := Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (f ^ i) ⋯, den_mem := ⋯ })
            (HomogeneousLocalization.mk
              { deg := m * i,
                num :=
                  Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i))
                    (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) (j - m) *
                      HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m + m - j))
                    ⋯,
                den := Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i)) (f ^ i) ⋯, den_mem := ⋯ }))
⊢ Eq (α := Localization (Submonoid.powers f))
    (Localization.mk
      (↑(NumDenSameDeg.num
            { deg := m * i + m * i,
              num :=
                (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i))
                    (∑ x ∈ range (m + m + 1),
                      (m + m).choose x •
                        (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) x *
                          HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m + m - x)))
                    ⋯ :
                  ↥(𝒜 (m * i + m * i))),
              den := (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i)) ⋯ : ↥(𝒜 (m * i + m * i))),
              den_mem := ⋯ }) :
        A)
      (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
        (↑(NumDenSameDeg.den
              { deg := m * i + m * i,
                num :=
                  (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i))
                      (∑ x ∈ range (m + m + 1),
                        (m + m).choose x •
                          (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) x *
                            HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m + m - x)))
                      ⋯ :
                    ↥(𝒜 (m * i + m * i))),
                den := (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i)) ⋯ : ↥(𝒜 (m * i + m * i))),
                den_mem := ⋯ }) :
          A)
        ⋯))
    (HomogeneousLocalization.val.{0, u_1, u_2} (ι := ℕ) (σ := σ) (𝒜 := 𝒜) (∑ i ∈ range (m + m + 1), g i))
have h : Eq (α := Localization.Away f)
  (Localization.mk
    (↑(NumDenSameDeg.num
          { deg := m * i + m * i,
            num :=
              (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i))
                  (∑ x ∈ range (m + m + 1),
                    (m + m).choose x •
                      (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) x *
                        HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m + m - x)))
                  sorry :
                ↥(𝒜 (m * i + m * i))),
            den := (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i)) sorry : ↥(𝒜 (m * i + m * i))),
            den_mem := sorry }) :
      A)
    (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
      (↑(NumDenSameDeg.den
            { deg := m * i + m * i,
              num :=
                (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i))
                    (∑ x ∈ range (m + m + 1),
                      (m + m).choose x •
                        (HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) a : A) x *
                          HPow.hPow (α := A) ((proj 𝒜 i : (a : A) → A) b : A) (m + m - x)))
                    sorry :
                  ↥(𝒜 (m * i + m * i))),
              den := (Subtype.mk (p := fun (x : A) ↦ x ∈ 𝒜 (m * i + m * i)) (f ^ (i + i)) sorry : ↥(𝒜 (m * i + m * i))),
              den_mem := sorry }) :
        A)
      sorry))
  ((algebraMap (A⁰_ f) (Localization.Away f) : (a : A⁰_ f) → Localization.Away f) (∑ i ∈ range (m + m + 1), g i))
Tactic: change _ = (algebraMap (HomogeneousLocalization.Away 𝒜 f) (Localization.Away f)) _