awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
⊢ HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s})
          (∑ x ∈ range p, a ^ (x - 1) * (a ^ (p - 1 - x) * ((↑p : R) * (b * (↑x : R))))) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s})) =
    HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * ∑ x ∈ range p, a ^ (p - 2) * (↑x : R)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
have simp : HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
    HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s})
        (∑ x ∈ range p, a ^ (x - 1 + (p - 1 - x)) * (↑p : R) * b * (↑x : R)) :
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
      HasQuotient.Quotient R (B := Ideal R) (span {s})) =
  HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
    HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (∑ x ∈ range p, (↑p : R) * b * a ^ (p - 2) * (↑x : R)) :
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
Tactic: simp only [Finset.mul_sum, ← mul_assoc, ← pow_add]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
⊢ HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s})
          (∑ x ∈ range p, a ^ (x - 1 + (p - 1 - x)) * (↑p : R) * b * (↑x : R)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s})) =
    HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (∑ x ∈ range p, (↑p : R) * b * a ^ (p - 2) * (↑x : R)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
have rw : ∀ x ∈ range p, a ^ (x - 1 + (p - 1 - x)) * (↑p : R) * b * (↑x : R) = (↑p : R) * b * a ^ (p - 2) * (↑x : R)
Tactic: rw [Finset.sum_congr rfl]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
hx : 0 ∈ range p
⊢ a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * (↑0 : R) = (↑p : R) * b * a ^ (p - 2) * (↑0 : R)
have zero : a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * 0 = (↑p : R) * b * a ^ (p - 2) * 0
Tactic: rw [Nat.cast_zero, mul_zero, mul_zero]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
hx : 0 ∈ range p
zero : a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * 0 = (↑p : R) * b * a ^ (p - 2) * 0
⊢ a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * (↑0 : R) = (↑p : R) * b * a ^ (p - 2) * (↑0 : R)
have zero₁ : 0 = (↑p : R) * b * a ^ (p - 2) * 0
Tactic: rw [Nat.cast_zero, mul_zero, mul_zero]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
hx : 0 ∈ range p
zero : a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * 0 = (↑p : R) * b * a ^ (p - 2) * 0
zero₁ : 0 = (↑p : R) * b * a ^ (p - 2) * 0
⊢ a ^ (HSub.hSub (α := ℕ) 0 1 + (p - 1 - 0)) * (↑p : R) * b * (↑0 : R) = (↑p : R) * b * a ^ (p - 2) * (↑0 : R)
have zero₂ : Eq.{u_1 + 1} (α := R) 0 0
Tactic: rw [Nat.cast_zero, mul_zero, mul_zero]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
x : ℕ
hx : x + 1 ∈ range p
⊢ x.succ - 1 + (p - 1 - x.succ) = p - 2
have rw : x.succ - 1 + (p - 1) - (x + 1) = p - 2
Tactic: rw [← Nat.add_sub_assoc (Nat.le_sub_one_of_lt (Finset.mem_range.mp hx))]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (hypothesis)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
x : ℕ
hx : x + 1 ∈ range p
⊢ a ^ (x + 1 - 1 + (p - 1 - (x + 1))) * (↑p : R) * b * (↑(x + 1) : R) = (↑p : R) * b * a ^ (p - 2) * (↑(x + 1) : R)
have this : x.succ - 1 + (p - 1 - x.succ) = p - 2
Tactic: have : x.succ - 1 + (p - 1 - x.succ) = p - 2 := by
          rw [← Nat.add_sub_assoc (Nat.le_sub_one_of_lt (Finset.mem_range.mp hx))]
          exact congr_arg Nat.pred (Nat.add_sub_cancel_left _ _)
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
x : ℕ
hx : x + 1 ∈ range p
this : x.succ - 1 + (p - 1 - x.succ) = p - 2
⊢ a ^ (x + 1 - 1 + (p - 1 - (x + 1))) * (↑p : R) * b * (↑(x + 1) : R) = (↑p : R) * b * a ^ (p - 2) * (↑(x + 1) : R)
have succ : a ^ (p - 2) * (↑p : R) * b * (↑(x + 1) : R) = (↑p : R) * b * a ^ (p - 2) * (↑(x + 1) : R)
Tactic: rw [this]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (hypothesis)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
⊢ HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * ∑ x ∈ range p, a ^ (p - 2) * (↑x : R)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s})) =
    (Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1))
have this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
Tactic: have : Finset.sum (range p) (fun (x : ℕ) ↦ (x : R)) =
          ((Finset.sum (range p) (fun (x : ℕ) ↦ (x : ℕ)))) := by simp only [Nat.cast_sum]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
⊢ HAdd.hAdd (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * ∑ x ∈ range p, a ^ (p - 2) * (↑x : R)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s})) =
    (Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * a ^ (p - 1))
have simp : Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
  ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * (a ^ (p - 2) * (↑(∑ x ∈ range p, x) : R))) :
    HasQuotient.Quotient R (B := Ideal R) (span {s}))
  (0 : HasQuotient.Quotient R (B := Ideal R) (span {s}))
Tactic: simp only [add_eq_right, ← Finset.mul_sum, this]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
⊢ Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s})
        ((↑p : R) * b * (a ^ (p - 2) * (↑(∑ x ∈ range p, x) : R))) :
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
    (0 : HasQuotient.Quotient R (B := Ideal R) (span {s}))
have simp : Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
  ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * (a ^ (p - 2) * (↑(p * (p - 1) / 2) : R))) :
    HasQuotient.Quotient R (B := Ideal R) (span {s}))
  (0 : HasQuotient.Quotient R (B := Ideal R) (span {s}))
Tactic: simp only [Finset.sum_range_id]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
⊢ Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
    ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) ((↑p : R) * b * (a ^ (p - 2) * (↑(p * (p - 1) / 2) : R))) :
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
    (0 : HasQuotient.Quotient R (B := Ideal R) (span {s}))
have simp : HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
      HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) b : HasQuotient.Quotient R (B := Ideal R) (span {s})) *
    HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (a ^ (p - 2)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
      (HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑((p - 1) / 2) : R))) =
  0
Tactic: simp only [Nat.cast_mul, map_mul,
          Nat.mul_div_assoc p (even_iff_two_dvd.mp (Nat.Odd.sub_odd hp odd_one))]
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
⊢ HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R) :
          HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) b : HasQuotient.Quotient R (B := Ideal R) (span {s})) *
      HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (a ^ (p - 2)) :
          HasQuotient.Quotient R (B := Ideal R) (span {s}))
        (HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
          ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R))
          ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑((p - 1) / 2) : R))) =
    0
have ring_nf : HMul.hMul (β := HasQuotient.Quotient R (B := Ideal R) (span {s}))
      (HMul.hMul (β := HasQuotient.Quotient R (B := Ideal R) (span {s}))
        (HPow.hPow (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β := ℕ)
          ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R)) 2)
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) b : HasQuotient.Quotient R (B := Ideal R) (span {s})))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (a ^ (p - 2)) :
        HasQuotient.Quotient R (B := Ideal R) (span {s})) *
    (Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑((p - 1) / 2) : R) =
  0
Tactic: ring_nf
-- Lean 4 proof step from Mathlib.NumberTheory.Multiplicity (goal)
Goal:
R : Type u_1
inst : CommRing R
a b : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    Eq (α := HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          ((a + (↑p : R) * b) ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
      ((Ideal.Quotient.mk (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}) : (a : R) → R ⧸ span {(↑p : R) ^ 2})
          (a ^ (i - 1) * ((↑p : R) * b) * (↑i : R) + a ^ i) :
        HasQuotient.Quotient R (B := Ideal R) (span {HPow.hPow (α := R) (β := ℕ) (↑p : R) 2}))
s : R := HPow.hPow (α := R) (β := ℕ) (↑p : R) 2
this : Eq.{u_1 + 1} (α := R) (∑ x ∈ range p, (↑x : R)) (↑(∑ x ∈ range p, x) : R)
⊢ HMul.hMul (β := HasQuotient.Quotient R (B := Ideal R) (span {s}))
        (HMul.hMul (β := HasQuotient.Quotient R (B := Ideal R) (span {s}))
          (HPow.hPow (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β := ℕ)
            ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R)) 2)
          ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) b :
            HasQuotient.Quotient R (B := Ideal R) (span {s})))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (a ^ (p - 2)) :
          HasQuotient.Quotient R (B := Ideal R) (span {s})) *
      (Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑((p - 1) / 2) : R) =
    0
have rw : HPow.hPow (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β := ℕ)
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑p : R)) 2 *
    HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s}))
      ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) b : HasQuotient.Quotient R (B := Ideal R) (span {s}))
      (HMul.hMul (α := HasQuotient.Quotient R (B := Ideal R) (span {s})) (β :=
        HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (a ^ (p - 2)) :
          HasQuotient.Quotient R (B := Ideal R) (span {s}))
        ((Ideal.Quotient.mk (span {s}) : (a : R) → R ⧸ span {s}) (↑((p - 1) / 2) : R) :
          HasQuotient.Quotient R (B := Ideal R) (span {s}))) =
  0
Tactic: rw [mul_assoc, mul_assoc]