A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ p =
    ∑ i in range (p + 1), bernoulli' i * ↑(Nat.choose (p + 1) i) * ↑n ^ (p + 1 - i) / ↑(succ p)
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ p =
    ∑ i in range (p + 1), bernoulli' i * ↑(Nat.choose (p + 1) i) * ↑n ^ (p + 1 - i) / (↑p + 1)
rw [← Nat.cast_succ]
case zero
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ zero =
    ∑ i in range (zero + 1), bernoulli' i * ↑(Nat.choose (zero + 1) i) * ↑n ^ (zero + 1 - i) / ↑(succ zero)

case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ p =
    ∑ i in range (p + 1), bernoulli' i * ↑(Nat.choose (p + 1) i) * ↑n ^ (p + 1 - i) / ↑(succ p)
cases' p with p p
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
let f i := bernoulli i * p.succ.succ.choose i * (n : ℚ) ^ (p.succ.succ - i) / p.succ.succ
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
let f' i := bernoulli' i * p.succ.succ.choose i * (n : ℚ) ^ (p.succ.succ - i) / p.succ.succ
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
suffices (∑ k in Ico 1 n.succ, (k : ℚ) ^ p.succ) = ∑ i in range p.succ.succ, f' i by convert this
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
have hle := Nat.le_add_left 1 n
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
have hne : (p + 1 + 1 : ℚ) ≠ 0 := by norm_cast; exact succ_ne_zero p.succ
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
have h1 : ∀ r : ℚ, r * (p + 1 + 1) * (n : ℚ) ^ p.succ / (p + 1 + 1 : ℚ) = r * (n : ℚ) ^ p.succ :=
    fun r => by rw [mul_div_right_comm, mul_div_cancel _ hne]
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
have h2 : f 1 + (n : ℚ) ^ p.succ = 1 / 2 * (n : ℚ) ^ p.succ := by
  simp_rw [bernoulli_one, choose_one_right, succ_sub_succ_eq_sub, cast_succ, tsub_zero, h1]
  ring
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
have :
  (∑ i in range p, bernoulli (i + 2) * (p + 2).choose (i + 2) * (n : ℚ) ^ (p - i) / ↑(p + 2)) =
    ∑ i in range p, bernoulli' (i + 2) * (p + 2).choose (i + 2) * (n : ℚ) ^ (p - i) / ↑(p + 2) :=
  sum_congr rfl fun i _ => by rw [bernoulli_eq_bernoulli'_of_ne_one (succ_succ_ne_one i)]
no goals
case succ
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
calc
  (∑ k in Ico 1 n.succ, (k : ℚ) ^ p.succ) = ∑ k in range n.succ, (k : ℚ) ^ p.succ :=
    by simp [sum_Ico_eq_sub _ hle, succ_ne_zero]
  _ = (∑ k in range n, (k : ℚ) ^ p.succ) + (n : ℚ) ^ p.succ :=
    by rw [sum_range_succ]
  _ = (∑ i in range p.succ.succ, f i) + (n : ℚ) ^ p.succ :=
    by simp [sum_range_pow]
  _ = (∑ i in range p, f i.succ.succ) + f 1 + f 0 + (n : ℚ) ^ p.succ :=
    by simp_rw [sum_range_succ']
      _ = (∑ i in range p, f i.succ.succ) + (f 1 + (n : ℚ) ^ p.succ) + f 0 := by ring
      _ = (∑ i in range p, f i.succ.succ) + 1 / 2 * (n : ℚ) ^ p.succ + f 0 := by rw [h2]
  _ = (∑ i in range p, f' i.succ.succ) + f' 1 + f' 0 :=
    by simpa [h1, fun i => show i + 2 = i + 1 + 1 from rfl]
  _ = ∑ i in range p.succ.succ, f' i :=
    by simp_rw [sum_range_succ']
no goals
case zero
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ zero =
    ∑ i in range (zero + 1), bernoulli' i * ↑(Nat.choose (zero + 1) i) * ↑n ^ (zero + 1 - i) / ↑(succ zero)
simp
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
this : ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ i in range (succ (succ p)), f' i
⊢ ∑ k in Ico 1 (n + 1), ↑k ^ succ p =
    ∑ i in range (succ p + 1), bernoulli' i * ↑(Nat.choose (succ p + 1) i) * ↑n ^ (succ p + 1 - i) / ↑(succ (succ p))
convert this
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
⊢ ¬p + 1 + 1 = 0
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
⊢ ↑p + 1 + 1 ≠ 0
norm_cast
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
⊢ ¬p + 1 + 1 = 0
exact succ_ne_zero p.succ
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
r : ℚ
⊢ r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
rw [mul_div_right_comm, mul_div_cancel _ hne]
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
⊢ -1 / 2 * ↑n ^ succ p + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
⊢ f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
simp_rw [bernoulli_one, choose_one_right, succ_sub_succ_eq_sub, cast_succ, tsub_zero, h1]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
⊢ -1 / 2 * ↑n ^ succ p + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
ring
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
i : ℕ
x✝ : i ∈ range p
⊢ bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
rw [bernoulli_eq_bernoulli'_of_ne_one (succ_succ_ne_one i)]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ k in Ico 1 (succ n), ↑k ^ succ p = ∑ k in range (succ n), ↑k ^ succ p
simp [sum_Ico_eq_sub _ hle, succ_ne_zero]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ k in range (succ n), ↑k ^ succ p = ∑ k in range n, ↑k ^ succ p + ↑n ^ succ p
rw [sum_range_succ]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ k in range n, ↑k ^ succ p + ↑n ^ succ p = ∑ i in range (succ (succ p)), f i + ↑n ^ succ p
simp [sum_range_pow]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ i in range (succ (succ p)), f i + ↑n ^ succ p = ∑ i in range p, f (succ (succ i)) + f 1 + f 0 + ↑n ^ succ p
simp_rw [sum_range_succ']
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ i in range p, f (succ (succ i)) + f 1 + f 0 + ↑n ^ succ p =
    ∑ i in range p, f (succ (succ i)) + (f 1 + ↑n ^ succ p) + f 0
ring
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ i in range p, f (succ (succ i)) + (f 1 + ↑n ^ succ p) + f 0 =
    ∑ i in range p, f (succ (succ i)) + 1 / 2 * ↑n ^ succ p + f 0
rw [h2]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ i in range p, f (succ (succ i)) + 1 / 2 * ↑n ^ succ p + f 0 = ∑ i in range p, f' (succ (succ i)) + f' 1 + f' 0
simpa [h1, fun i => show i + 2 = i + 1 + 1 from rfl]
no goals
A : Type ?u.1099012
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n p : ℕ
f : ℕ → ℚ := fun i => bernoulli i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
f' : ℕ → ℚ := fun i => bernoulli' i * ↑(Nat.choose (succ (succ p)) i) * ↑n ^ (succ (succ p) - i) / ↑(succ (succ p))
hle : 1 ≤ n + 1
hne : ↑p + 1 + 1 ≠ 0
h1 : ∀ (r : ℚ), r * (↑p + 1 + 1) * ↑n ^ succ p / (↑p + 1 + 1) = r * ↑n ^ succ p
h2 : f 1 + ↑n ^ succ p = 1 / 2 * ↑n ^ succ p
this :
  ∑ i in range p, bernoulli (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2) =
    ∑ i in range p, bernoulli' (i + 2) * ↑(Nat.choose (p + 2) (i + 2)) * ↑n ^ (p - i) / ↑(p + 2)
⊢ ∑ i in range p, f' (succ (succ i)) + f' 1 + f' 0 = ∑ i in range (succ (succ p)), f' i
simp_rw [sum_range_succ']