awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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 : ∀ (i : ι'), ai i • dv i
| ∑ i : ι', ai i • dv i - (∑ i : ι', dv i * (ai i / d)) * d = ∑ k : ι', (ai k % d) • dv k

Tactic:
enter [1, 1, 2, i]
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
i : ι'
h : (ai i % d + d * (ai i / d)) • dv i
| ai i • dv i

Tactic:
rw [← Nat.mod_add_div (ai i) d]

Premises used: Nat.mod_add_div
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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 : ∀ (i : ι'), (ai i % d + d * (ai i / d)) • dv i
| ∑ i : ι', ai i • dv i - (∑ i : ι', dv i * (ai i / d)) * d = ∑ k : ι', (ai k % d) • dv k

Tactic:
enter [1, 1, 2, i]; rw [← Nat.mod_add_div (ai i) d]
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
conv : ∑ i : ι', (ai i % d + d * (ai i / d)) • dv i - (∑ i : ι', dv i * (ai i / d)) * d = ∑ k : ι', (ai k % d) • dv k
⊢ ∑ i : ι', ai i • dv i - (∑ i : ι', dv i * (ai i / d)) * d = ∑ k : ι', (ai k % d) • dv k

Tactic:
conv => enter [1, 1, 2, i]; rw [← Nat.mod_add_div (ai i) d]
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
simp_rw :
  ∑ x : ι', ai x % d * dv x + (∑ x : ι', dv x * (ai x / d)) * d - (∑ i : ι', dv i * (ai i / d)) * d =
    ∑ x : ι', ai x % d * dv x
⊢ ∑ i : ι', (ai i % d + d * (ai i / d)) • dv i - (∑ i : ι', dv i * (ai i / d)) * d = ∑ k : ι', (ai k % d) • dv k

Tactic:
simp_rw [smul_eq_mul, add_mul, Finset.sum_add_distrib,
      mul_assoc, ← Finset.mul_sum, mul_comm d, mul_comm (_ / _)]

Premises used: add_mul, Finset.mul_sum, Finset.sum_add_distrib, mul_assoc, HDiv.hDiv, mul_comm, smul_eq_mul
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
⊢ ∑ x : ι', ai x % d * dv x + (∑ x : ι', dv x * (ai x / d)) * d - (∑ i : ι', dv i * (ai i / d)) * d =
    ∑ x : ι', ai x % d * dv x

Tactic:
simp only [add_tsub_cancel_right]

Premises used: add_tsub_cancel_right
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
⊢ (a - ∑ i : ι', dv i * (ai i / d)) • d = ∑ k : ι', (ai k % d) • dv k

Tactic:
have H₀ : (a - ∑ i : ι', dv i * (ai i / d)) • d = ∑ k : ι', (ai k % d) • dv k := by
    rw [smul_eq_mul, tsub_mul, ← smul_eq_mul, ← hai]
    conv => enter [1, 1, 2, i]; rw [← Nat.mod_add_div (ai i) d]
    simp_rw [smul_eq_mul, add_mul, Finset.sum_add_distrib,
      mul_assoc, ← Finset.mul_sum, mul_comm d, mul_comm (_ / _)]
    simp only [add_tsub_cancel_right]
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ :
  Eq (α := Localization.Away f)
    ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
        (Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯) :
      Localization.Away f)
    ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
        (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))) :
      Localization.Away f)
⊢ 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))

Tactic:
apply (show Function.Injective (algebraMap (Away 𝒜 f) (Localization.Away f))
      from val_injective _)

Premises used: HomogeneousLocalization.val_injective, Submonoid.powers
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ :
  (algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
      (Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯) =
    HMul.hMul (α := Localization.Away f) (β := Localization.Away f)
      ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
          (Away.mk 𝒜 hf (a - ∑ i : ι', dv i * (ai i / d)) (∏ i : ι', v i ^ (ai i % d)) ⋯) :
        Localization.Away f)
      (∏ x : ι',
          HPow.hPow (α := Localization.Away f)
            ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
                (isLocalizationElem hf ⋯) :
              Localization.Away f)
            (ai x / d) :
        Localization.Away f)
⊢ Eq (α := Localization.Away f)
    ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
        (Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯) :
      Localization.Away f)
    ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
        (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))) :
      Localization.Away f)

Tactic:
simp only [map_pow, map_prod, map_mul]

Premises used: map_pow, map_prod, map_mul
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ :
  Eq.{u_2 + 1} (α := Localization.Away f)
    (Localization.mk (∏ i : ι', v i ^ ai i)
      (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ a) ⋯))
    (Localization.mk (∏ x : ι', v x ^ (ai x % d + d * (ai x / d)))
      (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
          (f ^ (a - ∑ i : ι', dv i * (ai i / d))) ⋯ *
        ∏ i : ι',
          Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ dv i) ⋯ ^
            (ai i / d)))
⊢ (algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
      (Away.mk 𝒜 hf a (∏ i : ι', v i ^ ai i) ⋯) =
    HMul.hMul (α := Localization.Away f) (β := Localization.Away f)
      ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
          (Away.mk 𝒜 hf (a - ∑ i : ι', dv i * (ai i / d)) (∏ i : ι', v i ^ (ai i % d)) ⋯) :
        Localization.Away f)
      (∏ x : ι',
          HPow.hPow (α := Localization.Away f)
            ((algebraMap (Away 𝒜 f) (Localization.Away f) : (a : Away 𝒜 f) → Localization.Away f)
                (isLocalizationElem hf ⋯) :
              Localization.Away f)
            (ai x / d) :
        Localization.Away f)

Tactic:
simp only [HomogeneousLocalization.algebraMap_apply, val_mk,
      Localization.mk_pow, Localization.mk_prod, Localization.mk_mul,
      ← Finset.prod_mul_distrib, ← pow_add, ← pow_mul]

Premises used: Finset.prod_mul_distrib, pow_add, pow_mul, Localization.mk_prod, HomogeneousLocalization.Away.val_mk, Localization.mk_pow, Localization.mk_mul, HomogeneousLocalization.algebraMap_apply
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ : Eq (α := ι' → A) (fun (i : ι') ↦ v i ^ ai i) fun (x : ι') ↦ v x ^ (ai x % d + d * (ai x / d))
a₂ :
  f ^ a =
    (↑(Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
            (f ^ (a - ∑ i : ι', dv i * (ai i / d))) ⋯) :
        A) *
      (↑(∏ i : ι',
            Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ dv i) ⋯ ^
              (ai i / d)) :
        A)
⊢ Eq.{u_2 + 1} (α := Localization.Away f)
    (Localization.mk (∏ i : ι', v i ^ ai i)
      (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ a) ⋯))
    (Localization.mk (∏ x : ι', v x ^ (ai x % d + d * (ai x / d)))
      (Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
          (f ^ (a - ∑ i : ι', dv i * (ai i / d))) ⋯ *
        ∏ i : ι',
          Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ dv i) ⋯ ^
            (ai i / d)))

Tactic:
congr
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ : ∀ (i : ι'), v i ^ ai i = v i ^ (ai i % d + d * (ai i / d))
⊢ Eq (α := ι' → A) (fun (i : ι') ↦ v i ^ ai i) fun (x : ι') ↦ v x ^ (ai x % d + d * (ai x / d))

Tactic:
ext i
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
i : ι'
a₁ : ai i = ai i % d + d * (ai i / d)
⊢ v i ^ ai i = v i ^ (ai i % d + d * (ai i / d))

Tactic:
congr
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
i : ι'
⊢ ai i = ai i % d + d * (ai i / d)

Tactic:
Eq.symm (Nat.mod_add_div (ai i) d)

Premises used: Nat.mod_add_div, Eq.symm
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
i : ι'
⊢ ai i = ai i % d + d * (ai i / d)

Tactic:
exact Eq.symm (Nat.mod_add_div (ai i) d)

Premises used: Nat.mod_add_div, Eq.symm
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ : f ^ a = f ^ (a - ∑ i : ι', dv i * (ai i / d) + ∑ i : ι', dv i * (ai i / d))
⊢ f ^ a =
    (↑(Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x)
            (f ^ (a - ∑ i : ι', dv i * (ai i / d))) ⋯) :
        A) *
      (↑(∏ i : ι',
            Subtype.mk (p := fun (x : A) ↦ Membership.mem (γ := Submonoid A) (Submonoid.powers f) x) (f ^ dv i) ⋯ ^
              (ai i / d)) :
        A)

Tactic:
simp only [SubmonoidClass.coe_finsetProd, ← pow_add, ← pow_mul,
        Finset.prod_pow_eq_pow_sum, SubmonoidClass.coe_pow]

Premises used: SubmonoidClass.coe_finsetProd, pow_add, pow_mul, Finset.prod_pow_eq_pow_sum, SubmonoidClass.coe_pow
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ : ∑ i : ι', dv i * (ai i / d) ≤ a
⊢ f ^ a = f ^ (a - ∑ i : ι', dv i * (ai i / d) + ∑ i : ι', dv i * (ai i / d))

Tactic:
rw [tsub_add_cancel_of_le]

Premises used: tsub_add_cancel_of_le
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
a₁ : ∀ (hd : d = 0), ∑ i : ι', dv i * (ai i / d) ≤ a
a₂ : ∀ (hd : d > 0), ∑ i : ι', dv i * (ai i / d) ≤ a
⊢ ∑ i : ι', dv i * (ai i / d) ≤ a

Tactic:
rcases d.eq_zero_or_pos with hd | hd

Premises used: Nat.eq_zero_or_pos
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d = 0
⊢ ∑ i : ι', dv i * (ai i / d) ≤ a

Tactic:
simp [hd]
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d > 0
a₁ : LE.le (α := ℕ) (∑ i : ι', dv i * (ai i / d) * d) (∑ i : ι', ai i • dv i)
⊢ ∑ i : ι', dv i * (ai i / d) ≤ a

Tactic:
rw [← mul_le_mul_iff_of_pos_right hd, ← smul_eq_mul (a := a), ← hai, Finset.sum_mul]

Premises used: mul_le_mul_iff_of_pos_right, smul_eq_mul, Finset.sum_mul
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d > 0
a₁ : LE.le (α := ℕ) (∑ x : ι', dv x * (ai x / d * d)) (∑ x : ι', dv x * ai x)
⊢ LE.le (α := ℕ) (∑ i : ι', dv i * (ai i / d) * d) (∑ i : ι', ai i • dv i)

Tactic:
simp_rw [smul_eq_mul, mul_comm (ai _), mul_assoc]

Premises used: mul_assoc, mul_comm, smul_eq_mul
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d > 0
a₁ : ∀ (i : ι'), Membership.mem (γ := Finset ι') Finset.univ i → ai i / d * d ≤ ai i
⊢ LE.le (α := ℕ) (∑ x : ι', dv x * (ai x / d * d)) (∑ x : ι', dv x * ai x)

Tactic:
gcongr
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d > 0
i : ι'
h : Membership.mem (γ := Finset ι') Finset.univ i
⊢ ai i / d * d ≤ ai i

Tactic:
Nat.div_mul_le_self (ai _) d

Premises used: Nat.div_mul_le_self
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
hd : d > 0
i : ι'
h : Membership.mem (γ := Finset ι') Finset.univ i
⊢ ai i / d * d ≤ ai i

Tactic:
exact Nat.div_mul_le_self (ai _) d

Premises used: Nat.div_mul_le_self
-- Module: Mathlib.RingTheory.GradedAlgebra.HomogeneousLocalization
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
⊢ 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))

Tactic:
have H : Away.mk 𝒜 hf a (∏ i, v i ^ ai i)
      (hai ▸ SetLike.prod_pow_mem_graded _ _ _ _ fun i _ ↦ hxd i) =
      Away.mk 𝒜 hf (a - ∑ i : ι', dv i * (ai i / d)) (∏ i, v i ^ (ai i % d))
      (H₀ ▸ SetLike.prod_pow_mem_graded _ _ _ _ fun i _ ↦ hxd i) *
      ∏ i, Away.isLocalizationElem hf (hxd i) ^ (ai i / d) := by
    apply (show Function.Injective (algebraMap (Away 𝒜 f) (Localization.Away f))
      from val_injective _)
    simp only [map_pow, map_prod, map_mul]
    simp only [HomogeneousLocalization.algebraMap_apply, val_mk,
      Localization.mk_pow, Localization.mk_prod, Localization.mk_mul,
      ← Finset.prod_mul_distrib, ← pow_add, ← pow_mul]
    congr
    · ext i
      congr
      exact Eq.symm (Nat.mod_add_div (ai i) d)
    · simp only [SubmonoidClass.coe_finsetProd, ← pow_add, ← pow_mul,
        Finset.prod_pow_eq_pow_sum, SubmonoidClass.coe_pow]
      rw [tsub_add_cancel_of_le]
      rcases d.eq_zero_or_pos with hd | hd
      · simp [hd]
      rw [← mul_le_mul_iff_of_pos_right hd, ← smul_eq_mul (a := a), ← hai, Finset.sum_mul]
      simp_rw [smul_eq_mul, mul_comm (ai _), mul_assoc]
      gcongr
      exact Nat.div_mul_le_self (ai _) d