-- Mathlib/RingTheory/Nilpotent/Exp.lean
theorem exp_add_of_commute {a b : A} (h₁ : Commute a b) (h₂ : IsNilpotent a) (h₃ : IsNilpotent b) :
    exp (a + b) = exp a * exp b

Proof state:
case calc_3
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
⊢ ∑ x ∈ (range (2 * N + 1)).sigma fun i => range (i + 1),
      ((↑x.snd !)⁻¹ * (↑(x.fst - x.snd)!)⁻¹) • (a ^ x.snd * b ^ (x.fst - x.snd)) =
    ∑ ij ∈ filter (fun ij => ij.1 + ij.2 ≤ 2 * N) (range (2 * N + 1) ×ˢ range (2 * N + 1)),
      ((↑ij.1!)⁻¹ * (↑ij.2!)⁻¹) • (a ^ ij.1 * b ^ ij.2)

Tactic:
apply sum_bij (fun ⟨i, j⟩ _ ↦ (j, i - j))

Result:
case calc_3.hi
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
⊢ ∀ (a : (_ : ℕ) × ℕ) (ha : a ∈ (range (2 * N + 1)).sigma fun i => range (i + 1)),
    (match a, ha with
      | ⟨i, j⟩, x => (j, i - j)) ∈
      filter (fun ij => ij.1 + ij.2 ≤ 2 * N) (range (2 * N + 1) ×ˢ range (2 * N + 1))

case calc_3.i_inj
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
⊢ ∀ (a₁ : (_ : ℕ) × ℕ) (ha₁ : a₁ ∈ (range (2 * N + 1)).sigma fun i => range (i + 1)) (a₂ : (_ : ℕ) × ℕ)
    (ha₂ : a₂ ∈ (range (2 * N + 1)).sigma fun i => range (i + 1)),
    ((match a₁, ha₁ with
        | ⟨i, j⟩, x => (j, i - j)) =
        match a₂, ha₂ with
        | ⟨i, j⟩, x => (j, i - j)) →
      a₁ = a₂

case calc_3.i_surj
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
⊢ ∀ b ∈ filter (fun ij => ij.1 + ij.2 ≤ 2 * N) (range (2 * N + 1) ×ˢ range (2 * N + 1)),
    ∃ a,
      ∃ (ha : a ∈ (range (2 * N + 1)).sigma fun i => range (i + 1)),
        (match a, ha with
          | ⟨i, j⟩, x => (j, i - j)) =
          b

case calc_3.h
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
⊢ ∀ (a_1 : (_ : ℕ) × ℕ) (ha : a_1 ∈ (range (2 * N + 1)).sigma fun i => range (i + 1)),
    ((↑a_1.snd !)⁻¹ * (↑(a_1.fst - a_1.snd)!)⁻¹) • (a ^ a_1.snd * b ^ (a_1.fst - a_1.snd)) =
      ((↑(match a_1, ha with
                  | ⟨i, j⟩, x => (j, i - j)).1!)⁻¹ *
          (↑(match a_1, ha with
                  | ⟨i, j⟩, x => (j, i - j)).2!)⁻¹) •
        (a ^
            (match a_1, ha with
              | ⟨i, j⟩, x => (j, i - j)).1 *
          b ^
            (match a_1, ha with
              | ⟨i, j⟩, x => (j, i - j)).2)

Proof state:
case h.h
A : Type u_1
inst✝¹ : Ring A
inst✝ : Algebra ℚ A
a b : A
h₁ : Commute a b
n₁ : ℕ
hn₁ : a ^ n₁ = 0
n₂ : ℕ
hn₂ : b ^ n₂ = 0
N : ℕ := n₁ ⊔ n₂
h₄ : a ^ (N + 1) = 0
h₅ : b ^ (N + 1) = 0
R2N : Finset ℕ := range (2 * N + 1)
hR2N : R2N = range (2 * N + 1)
RN : Finset ℕ := range (N + 1)
hRN : RN = range (N + 1)
s₁ :
  ∑ i ∈ R2N, (↑i !)⁻¹ • (a + b) ^ i =
    ∑ x ∈ filter (fun x => x.1 ≤ N ∧ x.2 ≤ N) (R2N ×ˢ R2N), ((↑x.1!)⁻¹ * (↑x.2!)⁻¹) • (a ^ x.1 * b ^ x.2)
z₁ : ∑ ij ∈ filter (fun ij => ¬ij.1 + ij.2 ≤ 2 * N) (R2N ×ˢ R2N), ((↑ij.1!)⁻¹ * (↑ij.2!)⁻¹) • (a ^ ij.1 * b ^ ij.2) = 0
split₁ :
  ∑ x ∈ filter (fun x => x.1 + x.2 ≤ 2 * N) (R2N ×ˢ R2N), ((↑x.1!)⁻¹ * (↑x.2!)⁻¹) • (a ^ x.1 * b ^ x.2) =
    ∑ x ∈ R2N ×ˢ R2N, ((↑x.1!)⁻¹ * (↑x.2!)⁻¹) • (a ^ x.1 * b ^ x.2)
z₂ :
  ∑ ij ∈ filter (fun ij => ¬(ij.1 ≤ N ∧ ij.2 ≤ N)) (R2N ×ˢ R2N), ((↑ij.1!)⁻¹ * (↑ij.2!)⁻¹) • (a ^ ij.1 * b ^ ij.2) = 0
split₂ :
  ∑ x ∈ filter (fun x => x.1 ≤ N ∧ x.2 ≤ N) (R2N ×ˢ R2N), ((↑x.1!)⁻¹ * (↑x.2!)⁻¹) • (a ^ x.1 * b ^ x.2) =
    ∑ x ∈ R2N ×ˢ R2N, ((↑x.1!)⁻¹ * (↑x.2!)⁻¹) • (a ^ x.1 * b ^ x.2)
x : ℕ × ℕ
⊢ (x.1 < 2 * N + 1 ∧ x.2 < 2 * N + 1) ∧ x.1 ≤ N ∧ x.2 ≤ N ↔ x.1 < N + 1 ∧ x.2 < N + 1

Tactic:
omega

Result:
no goals