-- Lean 4 proof step from Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization (goal)
Goal:
A : Type u_2
σ : Type u_3
inst : CommRing A
inst_1 : SetLike σ A
inst_2 : AddSubgroupClass σ A
𝒜 : ℕ → σ
inst_3 : GradedRing 𝒜
f : A
d : ℕ
hf : f ∈ 𝒜 d
ι' : Type u_4
inst_4 : Fintype ι'
v : ι' → A
hx : Eq (α := Subalgebra (↥(𝒜 0)) A) (Algebra.adjoin (↥(𝒜 0)) (Set.range v)) ⊤
dv : ι' → ℕ
hxd : ∀ (i : ι'), v i ∈ 𝒜 (dv i)
hxd' : ∀ (i : ι'), 0 < dv i
a : ℕ
ai : ι' → ℕ
hai : ∑ i : ι', ai i • dv i = a • d
H₀ : (a - ∑ i : ι', dv i * (ai i / d)) • d = ∑ k : ι', (ai k % d) • dv k
H :
  Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯ =
    HMul.hMul (α := Away 𝒜 f) (Away.mk 𝒜 hf (a - ∑ i : ι', dv i * (ai i / d)) (∏ i : ι', v i ^ (ai i % d)) ⋯)
      (∏ i : ι', HPow.hPow (α := Away 𝒜 f) (isLocalizationElem hf ⋯) (ai i / d))
hy :
  ∀ (j : ι'),
    Membership.mem (γ := Subalgebra (↥(𝒜 0)) (Away 𝒜 f))
      (Algebra.adjoin ↥(𝒜 0)
        {x : Away 𝒜 f |
          ∃ (a : ℕ) (ai : ι' → ℕ) (hai : ∑ i : ι', ai i • dv i = a • d) (_ : ∀ (i : ι'), ai i ≤ d),
            Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯ = x})
      (HPow.hPow (α := Away 𝒜 f) (isLocalizationElem hf ⋯) (ai j / d))
hy₁ :
  ∀ (j : ι'),
    Membership.mem (γ := Subalgebra (↥(𝒜 0)) (Away 𝒜 f))
      (Algebra.adjoin ↥(𝒜 0)
        {x : Away 𝒜 f |
          ∃ (a : ℕ) (ai : ι' → ℕ) (hai : ∑ i : ι', ai i • dv i = a • d) (_ : ∀ (i : ι'), ai i ≤ d),
            Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯ = x})
      (isLocalizationElem hf ⋯)
hy₂ :
  ∀ (j : ι'),
    Membership.mem (γ := Set (Away 𝒜 f))
      {x : Away 𝒜 f |
        ∃ (a : ℕ) (ai : ι' → ℕ) (hai : ∑ i : ι', ai i • dv i = a • d) (_ : ∀ (i : ι'), ai i ≤ d),
          Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯ = x}
      (isLocalizationElem hf ⋯)
hy₃ : ∀ (j : ι'), ∑ i : ι', HSMul.hSMul (α := ℕ) (Pi.single (M := fun (a : ι') ↦ ℕ) j d i : ℕ) (dv i) = dv j • d
hy₄ : ∀ (j i : ι'), Pi.single (M := fun (a : ι') ↦ ℕ) j d i ≤ d
hy₅ :
  ∀ (j : ι'),
    Eq (α := Away 𝒜 f)
      (Away.mk 𝒜 hf (dv j) (∏ i : ι', HPow.hPow (β := ℕ) (v i) (Pi.single (M := fun (a : ι') ↦ ℕ) j d i : ℕ)) ⋯)
      (isLocalizationElem hf ⋯)
hy₆ : ∀ (j i : ι'), Pi.single (M := fun (a : ι') ↦ ℕ) j d i ≤ d
hy₇ hy₈ :
  ∀ (j : ι'),
    Eq (α := Away 𝒜 f)
      (Away.mk 𝒜 hf (dv j) (∏ i : ι', HPow.hPow (β := ℕ) (v i) (Pi.single (M := fun (a : ι') ↦ ℕ) j d i : ℕ)) ⋯)
      (isLocalizationElem hf ⋯)
⊢ ∀ (c : ι'),
    Membership.mem (γ := Finset ι') Finset.univ c →
      Membership.mem (γ := Subalgebra (↥(𝒜 0)) (Away 𝒜 f))
        (Algebra.adjoin ↥(𝒜 0)
          {x : Away 𝒜 f |
            ∃ (a : ℕ) (ai : ι' → ℕ) (hai : ∑ i : ι', ai i • dv i = a • d) (_ : ∀ (i : ι'), ai i ≤ d),
              Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯ = x})
        (HPow.hPow (α := Away 𝒜 f) (isLocalizationElem hf ⋯) (ai c / d))
have hy₉ : ∀ (j : ι'),
  Eq (α := at Submonoid.powers f)
    (val (Away.mk 𝒜 hf (dv j) (∏ i : ι', HPow.hPow (β := ℕ) (v i) (Pi.single (M := fun (a : ι') ↦ ℕ) j d i : ℕ)) sorry))
    (val (isLocalizationElem hf sorry))
Tactic: classical
    rintro j -
    apply pow_mem
    apply Algebra.subset_adjoin
    refine ⟨dv j, Pi.single j d, ?_, ?_, ?_⟩
    · simp [Pi.single_apply, mul_comm]
    · aesop (add simp Pi.single_apply)
    ext
    simp [Pi.single_apply]