Theorem: bernoulli'PowerSeries_mul_exp_sub_one
File: Mathlib/NumberTheory/Bernoulli.lean

tactic: ext n
state_before: A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
⊢ bernoulli'PowerSeries A * (exp A - 1) = X * exp A

tactic: cases' n with n
state_before: case h
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ↑(coeff A n) (bernoulli'PowerSeries A * (exp A - 1)) = ↑(coeff A n) (X * exp A)

tactic: rw [bernoulli'PowerSeries, coeff_mul, mul_comm X, sum_antidiagonal_succ']
state_before: case h.succ
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ↑(coeff A (succ n)) (bernoulli'PowerSeries A * (exp A - 1)) = ↑(coeff A (succ n)) (X * exp A)

tactic: suffices (∑ p in antidiagonal n,
    bernoulli' p.1 / p.1! * ((p.2 + 1) * p.2! : ℚ)⁻¹) = (n ! : ℚ)⁻¹ by
  simpa [map_sum] using congr_arg (algebraMap ℚ A) this
state_before: case h.succ
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ↑(coeff A (n + 1, 0).fst) (PowerSeries.mk fun n => ↑(algebraMap ℚ A) (bernoulli' n / ↑n !)) *
        ↑(coeff A (n + 1, 0).snd) (exp A - 1) +
      ∑ p in antidiagonal n,
        ↑(coeff A (p.fst, p.snd + 1).fst) (PowerSeries.mk fun n => ↑(algebraMap ℚ A) (bernoulli' n / ↑n !)) *
          ↑(coeff A (p.fst, p.snd + 1).snd) (exp A - 1) =
    ↑(coeff A (succ n)) (exp A * X)

tactic: apply eq_inv_of_mul_eq_one_left
state_before: case h.succ
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ p in antidiagonal n, bernoulli' p.fst / ↑p.fst ! * ((↑p.snd + 1) * ↑p.snd !)⁻¹ = (↑n !)⁻¹

tactic: rw [sum_mul]
state_before: case h.succ.h
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ (∑ p in antidiagonal n, bernoulli' p.fst / ↑p.fst ! * ((↑p.snd + 1) * ↑p.snd !)⁻¹) * ↑n ! = 1

tactic: convert bernoulli'_spec' n using 1
state_before: case h.succ.h
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ x in antidiagonal n, bernoulli' x.fst / ↑x.fst ! * ((↑x.snd + 1) * ↑x.snd !)⁻¹ * ↑n ! = 1

tactic: apply sum_congr rfl
state_before: case h.e'_2
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ x in antidiagonal n, bernoulli' x.fst / ↑x.fst ! * ((↑x.snd + 1) * ↑x.snd !)⁻¹ * ↑n ! =
    ∑ k in antidiagonal n, ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli' k.fst

tactic: simp_rw [mem_antidiagonal]
state_before: case h.e'_2
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∀ (x : ℕ × ℕ),
    x ∈ antidiagonal n →
      bernoulli' x.fst / ↑x.fst ! * ((↑x.snd + 1) * ↑x.snd !)⁻¹ * ↑n ! =
        ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst

tactic: rintro ⟨i, j⟩ rfl
state_before: case h.e'_2
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∀ (x : ℕ × ℕ),
    x.fst + x.snd = n →
      bernoulli' x.fst / ↑x.fst ! * ((↑x.snd + 1) * ↑x.snd !)⁻¹ * ↑n ! =
        ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst

tactic: have := factorial_mul_factorial_dvd_factorial_add i j
state_before: case h.e'_2.mk
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
i j : ℕ
⊢ bernoulli' (i, j).fst / ↑(i, j).fst ! * ((↑(i, j).snd + 1) * ↑(i, j).snd !)⁻¹ * ↑((i, j).fst + (i, j).snd)! =
    ↑(Nat.choose ((i, j).fst + (i, j).snd) (i, j).snd) / (↑(i, j).snd + 1) * bernoulli' (i, j).fst

tactic: field_simp [mul_comm _ (bernoulli' i), mul_assoc, add_choose]
state_before: case h.e'_2.mk
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
i j : ℕ
this : i ! * j ! ∣ (i + j)!
⊢ bernoulli' (i, j).fst / ↑(i, j).fst ! * ((↑(i, j).snd + 1) * ↑(i, j).snd !)⁻¹ * ↑((i, j).fst + (i, j).snd)! =
    ↑(Nat.choose ((i, j).fst + (i, j).snd) (i, j).snd) / (↑(i, j).snd + 1) * bernoulli' (i, j).fst

tactic: norm_cast
state_before: case h.e'_2.mk
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
i j : ℕ
this : i ! * j ! ∣ (i + j)!
⊢ bernoulli' i * ↑(i + j)! / (↑i ! * ((↑j + 1) * ↑j !)) = bernoulli' i * ↑(i + j)! / (↑i ! * (↑j ! * (↑j + 1)))

tactic: rw [mul_comm (j + 1), mul_div_assoc, ← mul_assoc]
state_before: case h.e'_2.mk
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
i j : ℕ
this : i ! * j ! ∣ (i + j)!
⊢ bernoulli' i * ↑(i + j)! / ↑(i ! * ((j + 1) * j !)) = bernoulli' i * ↑(i + j)! / ↑(i ! * (j ! * (j + 1)))

tactic: simp
state_before: case h.zero
A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
⊢ ↑(coeff A zero) (bernoulli'PowerSeries A * (exp A - 1)) = ↑(coeff A zero) (X * exp A)

tactic: simpa [map_sum] using congr_arg (algebraMap ℚ A) this
state_before: A : Type u_1
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
this : ∑ p in antidiagonal n, bernoulli' p.fst / ↑p.fst ! * ((↑p.snd + 1) * ↑p.snd !)⁻¹ = (↑n !)⁻¹
⊢ ↑(coeff A (n + 1, 0).fst) (PowerSeries.mk fun n => ↑(algebraMap ℚ A) (bernoulli' n / ↑n !)) *
        ↑(coeff A (n + 1, 0).snd) (exp A - 1) +
      ∑ p in antidiagonal n,
        ↑(coeff A (p.fst, p.snd + 1).fst) (PowerSeries.mk fun n => ↑(algebraMap ℚ A) (bernoulli' n / ↑n !)) *
          ↑(coeff A (p.fst, p.snd + 1).snd) (exp A - 1) =
    ↑(coeff A (succ n)) (exp A * X)