Theorem: Polynomial.bernoulli_eval_one_add
File: Mathlib/NumberTheory/BernoulliPolynomials.lean

Proof steps:
state_before: n : ℕ
x : ℚ
⊢ eval (1 + x) (bernoulli n) = eval x (bernoulli n) + ↑n * x ^ (n - 1)
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
⊢ eval (1 + x) (bernoulli d) = eval x (bernoulli d) + ↑d * x ^ (d - 1)
tactic: refine Nat.strong_induction_on n fun d hd => ?_
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
⊢ eval (1 + x) (bernoulli d) = eval x (bernoulli d) + ↑d * x ^ (d - 1)
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) (bernoulli d) = eval x (bernoulli d) + ↑d * x ^ (d - 1)
tactic: have nz : ((d.succ : ℕ) : ℚ) ≠ 0 := by
    norm_cast
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) (bernoulli d) = eval x (bernoulli d) + ↑d * x ^ (d - 1)
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ ↑d.succ * eval (1 + x) (bernoulli d) = ↑d.succ * (eval x (bernoulli d) + ↑d * x ^ (d - 1))
tactic: apply (mul_right_inj' nz).1
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ ↑d.succ * eval (1 + x) (bernoulli d) = ↑d.succ * (eval x (bernoulli d) + ↑d * x ^ (d - 1))
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) - ∑ i ∈ range d, eval (1 + x) (↑((d + 1).choose i) • bernoulli i) =
    eval x ((monomial d) ↑d.succ - ∑ k ∈ range d, ↑((d + 1).choose k) • bernoulli k) + ↑d.succ * (↑d * x ^ (d - 1))
tactic: rw [← smul_eq_mul, ← eval_smul, bernoulli_eq_sub_sum, mul_add, ← smul_eq_mul, ← eval_smul,
    bernoulli_eq_sub_sum, eval_sub, eval_finset_sum]
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) -
      ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • (eval x (bernoulli x_1) + ↑x_1 * x ^ (x_1 - 1)) =
    eval x ((monomial d) ↑d.succ - ∑ k ∈ range d, ↑((d + 1).choose k) • bernoulli k) + ↑d.succ * (↑d * x ^ (d - 1))
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) -
      ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • (eval x (bernoulli x_1) + ↑x_1 * x ^ (x_1 - 1)) =
    eval x ((monomial d) ↑d.succ) - ∑ i ∈ range d, eval x (↑((d + 1).choose i) • bernoulli i) +
      ↑d.succ * (↑d * x ^ (d - 1))
tactic: rw [eval_sub, eval_finset_sum]
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) -
      ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • (eval x (bernoulli x_1) + ↑x_1 * x ^ (x_1 - 1)) =
    eval x ((monomial d) ↑d.succ) - ∑ i ∈ range d, eval x (↑((d + 1).choose i) • bernoulli i) +
      ↑d.succ * (↑d * x ^ (d - 1))
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) -
      ∑ x_1 ∈ range d,
        (↑((d + 1).choose x_1) • eval x (bernoulli x_1) + ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1))) =
    eval x ((monomial d) ↑d.succ) - ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • eval x (bernoulli x_1) +
      ↑d.succ * (↑d * x ^ (d - 1))
tactic: simp_rw [eval_smul, smul_add]
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) -
      ∑ x_1 ∈ range d,
        (↑((d + 1).choose x_1) • eval x (bernoulli x_1) + ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1))) =
    eval x ((monomial d) ↑d.succ) - ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • eval x (bernoulli x_1) +
      ↑d.succ * (↑d * x ^ (d - 1))
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) - eval x ((monomial d) ↑d.succ) =
    ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1)) + ↑d.succ * (↑d * x ^ (d - 1))
tactic: rw [sum_add_distrib, sub_add, sub_eq_sub_iff_sub_eq_sub, _root_.add_sub_sub_cancel]
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ eval (1 + x) ((monomial d) ↑d.succ) - eval x ((monomial d) ↑d.succ) =
    ∑ x_1 ∈ range d, ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1)) + ↑((d + 1).choose d) * (↑d * x ^ (d - 1))
state_after: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ ∑ x_1 ∈ range (d + 1), ↑((d + 1).choose x_1) * (↑x_1 * x ^ (x_1 - 1)) =
    ∑ x_1 ∈ range (d + 1), ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1))
tactic: rw [Nat.cast_succ, ← smul_eq_mul, ← sum_range_succ _ d, eval_monomial_one_add_sub]
state_before: n : ℕ
x : ℚ
d : ℕ
hd : ∀ m < d, eval (1 + x) (bernoulli m) = eval x (bernoulli m) + ↑m * x ^ (m - 1)
nz : ↑d.succ ≠ 0
⊢ ∑ x_1 ∈ range (d + 1), ↑((d + 1).choose x_1) * (↑x_1 * x ^ (x_1 - 1)) =
    ∑ x_1 ∈ range (d + 1), ↑((d + 1).choose x_1) • (↑x_1 * x ^ (x_1 - 1))
state_after: no goals
tactic: simp_rw [smul_eq_mul]