Theorem: bernoulli_spec'
File: Mathlib/NumberTheory/Bernoulli.lean

tactic: cases' n with n n
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ k in antidiagonal n, ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = if n = 0 then 1 else 0

tactic: rw [if_neg (succ_ne_zero _)]
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst =
    if succ n = 0 then 1 else 0

tactic: have h₁ : (1, n) ∈ antidiagonal n.succ := by simp [mem_antidiagonal, add_comm]
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = 0

tactic: have h₂ : (n : ℚ) + 1 ≠ 0 := by norm_cast; exact succ_ne_zero _
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = 0

tactic: have h₃ : (1 + n).choose n = n + 1 := by simp [add_comm]
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = 0

tactic: have H := bernoulli'_spec' n.succ
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = 0

tactic: rw [sum_eq_add_sum_diff_singleton h₁] at H⊢
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H : ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli' k.fst = 1
⊢ ∑ k in antidiagonal (succ n), ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst = 0

tactic: apply add_eq_of_eq_sub'
state_before: case succ
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
⊢ ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli x.fst =
    0

tactic: convert eq_sub_of_add_eq' H using 1
state_before: case succ.h
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
⊢ ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli x.fst =
    0 - ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli (1, n).fst

tactic: simp
state_before: case zero
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
⊢ ∑ k in antidiagonal zero, ↑(Nat.choose (k.fst + k.snd) k.snd) / (↑k.snd + 1) * bernoulli k.fst =
    if zero = 0 then 1 else 0

tactic: simp [mem_antidiagonal, add_comm]
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
⊢ (1, n) ∈ antidiagonal (succ n)

tactic: norm_cast
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
⊢ ↑n + 1 ≠ 0

tactic: exact succ_ne_zero _
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
⊢ ¬n + 1 = 0

tactic: simp [add_comm]
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
⊢ Nat.choose (1 + n) n = n + 1

tactic: refine' sum_congr rfl fun p h => _
state_before: case h.e'_2
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
⊢ ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli x.fst =
    ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst

tactic: obtain ⟨h', h''⟩ : p ∈ _ ∧ p ≠ _ := by rwa [mem_sdiff, mem_singleton] at h
state_before: case h.e'_2
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
p : ℕ × ℕ
h : p ∈ antidiagonal (succ n) \ {(1, n)}
⊢ ↑(Nat.choose (p.fst + p.snd) p.snd) / (↑p.snd + 1) * bernoulli p.fst =
    ↑(Nat.choose (p.fst + p.snd) p.snd) / (↑p.snd + 1) * bernoulli' p.fst

tactic: simp [bernoulli_eq_bernoulli'_of_ne_one ((not_congr (antidiagonal_congr h' h₁)).mp h'')]
state_before: case h.e'_2.intro
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
p : ℕ × ℕ
h : p ∈ antidiagonal (succ n) \ {(1, n)}
h' : p ∈ ?m.656139
h'' : p ≠ ?m.656186
⊢ ↑(Nat.choose (p.fst + p.snd) p.snd) / (↑p.snd + 1) * bernoulli p.fst =
    ↑(Nat.choose (p.fst + p.snd) p.snd) / (↑p.snd + 1) * bernoulli' p.fst

tactic: rwa [mem_sdiff, mem_singleton] at h
state_before: A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
p : ℕ × ℕ
h : p ∈ antidiagonal (succ n) \ {(1, n)}
⊢ p ∈ ?m.656139 ∧ p ≠ ?m.656186

tactic: field_simp [h₃]
state_before: case h.e'_3
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
⊢ 0 - ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli (1, n).fst =
    1 - ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst

tactic: norm_num
state_before: case h.e'_3
A : Type ?u.640965
inst✝¹ : CommRing A
inst✝ : Algebra ℚ A
n : ℕ
h₁ : (1, n) ∈ antidiagonal (succ n)
h₂ : ↑n + 1 ≠ 0
h₃ : Nat.choose (1 + n) n = n + 1
H :
  ↑(Nat.choose ((1, n).fst + (1, n).snd) (1, n).snd) / (↑(1, n).snd + 1) * bernoulli' (1, n).fst +
      ∑ x in antidiagonal (succ n) \ {(1, n)}, ↑(Nat.choose (x.fst + x.snd) x.snd) / (↑x.snd + 1) * bernoulli' x.fst =
    1
⊢ 1 = 2 - 1