AFTD Auto-Formalizing Theoretical Domains

trace_binomial_gap_of_commute

theoremverified

For any natural number k and any two commuting complex d by d matrices A and B, the trace binomial gap Delta_k(A, B) is zero.

Statement

theorem trace_binomial_gap_of_commute
    {d : ℕ} (k : ℕ) (A B : Matrix (Fin d) (Fin d) ℂ) (h : Commute A B) :
    traceBinomialGap k A B = 0
Source
arXiv:2411.33774
Verified
27 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • traceBinomialGapFor d by d complex matrices A and B and a natural number k, the trace binomial gap Delta_k(A, B) is the difference between the binomial…

Read back from the Lean

For any dimension $d \in \mathbb{N}$, any natural number $k$, and any pair of $d \times d$ complex matrices $A$ and $B$, if $A$ and $B$ commute (that is, $AB = BA$), then $\operatorname{traceBinomialGap}(k, A, B) = 0$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

By definition, the trace binomial gap is the difference between the weighted binomial sum of traces of $A^j B^{k-j}$ and the real trace of $(A+B)^k$. Since $A$ and $B$ commute, the binomial theorem expands $(A+B)^k$, and by linearity of the matrix trace, its trace expands into the corresponding sum of traces. Taking real parts and pulling out the real binomial coefficients reveals that the two sums are identical, so their difference is zero.

  1. The goal is to show that $\sum_{j=0}^k \binom{k}{j} \operatorname{Re}(\operatorname{tr}(A^j B^{k-j})) - \operatorname{Re}(\operatorname{tr}((A+B)^k)) = 0$.

    Unfolding the definition of `traceBinomialGap` expresses the trace binomial gap as the difference between the weighted sum of traces $\sum_{j=0}^k \binom{k}{j} \operatorname{Re}(\operatorname{tr}(A^j B^{k-j}))$ and the real trace $\operatorname{Re}(\operatorname{tr}((A+B)^k))$.

    line 5

      unfold traceBinomialGap
  2. The trace of $(A + B)^k$ equals the binomial sum $\sum_{j=0}^k \binom{k}{j} \operatorname{tr}(A^j B^{k-j})$.

    Because $A$ and $B$ commute, $(A+B)^k$ expands via the binomial theorem (`h.add_pow`). Distributing the trace over the finite sum by linearity (`Matrix.trace_sum`) and pulling the scalar factor $\binom{k}{j}$ out of each term's trace using scalar multiplication properties (`nsmul_eq_mul'`, `Matrix.trace_smul`, `nsmul_eq_mul`) shows that the trace of the power is the binomial sum of the traces.

    lines 6–12

    uses h.add_pow, Matrix.trace_sum, nsmul_eq_mul', Matrix.trace_smul, nsmul_eq_mul

      have htrace : Matrix.trace ((A + B) ^ k) =
          ∑ j ∈ Finset.range (k + 1), (k.choose j : ℂ) * Matrix.trace (A ^ j * B ^ (k - j)) := by
        rw [h.add_pow k]
        rw [Matrix.trace_sum]
        congr 1
        ext j
        rw [← nsmul_eq_mul', Matrix.trace_smul, nsmul_eq_mul]
  3. The goal reduces to $\sum_{j=0}^k \binom{k}{j} \operatorname{Re}(\operatorname{tr}(A^j B^{k-j})) - \sum_{j=0}^k \operatorname{Re}\bigl(\binom{k}{j} \operatorname{tr}(A^j B^{k-j})\bigr) = 0$.

    Substituting the expanded trace expression `htrace` into the goal and using the fact that the real part commutes with finite sums (`Complex.re_sum`), $\operatorname{Re}(\operatorname{tr}((A+B)^k))$ becomes $\sum_{j=0}^k \operatorname{Re}\bigl(\binom{k}{j} \operatorname{tr}(A^j B^{k-j})\bigr)$.

    line 13

    uses Complex.re_sum

      rw [htrace, Complex.re_sum]
  4. For each index $j$, $\operatorname{Re}\bigl(\binom{k}{j} \operatorname{tr}(A^j B^{k-j})\bigr) = \binom{k}{j} \operatorname{Re}(\operatorname{tr}(A^j B^{k-j}))$.

    Since the binomial coefficient $\binom{k}{j}$ is a natural number coerced to $\mathbb{C}$, its real part is itself (`Complex.natCast_re`) and its imaginary part is zero (`Complex.natCast_im`). The formula for the real part of a complex product (`Complex.mul_re`) along with $0 \cdot a = 0$ (`zero_mul`) and $a - 0 = a$ (`sub_zero`) simplifies the real part of the product to the real binomial coefficient times the real part of the trace.

    lines 14–17

    uses Complex.mul_re, Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero

      have hterm : (fun j => (↑(k.choose j) * Matrix.trace (A ^ j * B ^ (k - j))).re) =
          (fun j => (k.choose j : ℝ) * (Matrix.trace (A ^ j * B ^ (k - j))).re) := by
        ext j
        simp only [Complex.mul_re, Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero]
  5. The trace binomial gap is zero.

    Rewriting the second summation with the term identity `hterm` makes the two sums identical. Subtracting identical expressions yields zero (`sub_self`).

    lines 18–19

    uses sub_self

      rw [hterm]
      exact sub_self _
h.add_pow
For commuting elements $A$ and $B$, the binomial theorem expands $(A + B)^k$ as $\sum_{m=0}^k A^m B^{k-m} \binom{k}{m}$.
Matrix.trace_sum
The trace of a finite sum of matrices is the sum of their individual traces.
nsmul_eq_mul'
Natural-number scalar multiplication on the left, $n • a$, equals right multiplication $a * n$.
Matrix.trace_smul
The trace of a scalar multiple of a matrix is the scalar times the trace of the matrix.
nsmul_eq_mul
Natural-number scalar multiplication $n • a$ equals left multiplication $n * a$.
Complex.re_sum
The real part of a finite sum of complex numbers is the sum of the real parts.
Complex.mul_re
The real part of a product of complex numbers $z w$ is $\operatorname{Re}(z)\operatorname{Re}(w) - \operatorname{Im}(z)\operatorname{Im}(w)$.
Complex.natCast_re
The real part of a natural number coerced to the complex numbers is the number itself as a real.
Complex.natCast_im
The imaginary part of a natural number coerced to the complex numbers is zero.
zero_mul
Multiplying zero by any element yields zero.
sub_zero
Subtracting zero from any element leaves it unchanged.
sub_self
Subtracting an element from itself yields zero.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The trace binomial gap vanishes for commuting matrices. -/theorem trace_binomial_gap_of_commute    {d : ℕ} (k : ℕ) (A B : Matrix (Fin d) (Fin d) ℂ) (h : Commute A B) :    traceBinomialGap k A B = 0 := by  unfold traceBinomialGap  have htrace : Matrix.trace ((A + B) ^ k) =      ∑ j ∈ Finset.range (k + 1), (k.choose j : ℂ) * Matrix.trace (A ^ j * B ^ (k - j)) := by    rw [h.add_pow k]    rw [Matrix.trace_sum]    congr 1    ext j    rw [← nsmul_eq_mul', Matrix.trace_smul, nsmul_eq_mul]  rw [htrace, Complex.re_sum]  have hterm : (fun j => (↑(k.choose j) * Matrix.trace (A ^ j * B ^ (k - j))).re) =      (fun j => (k.choose j : ℝ) * (Matrix.trace (A ^ j * B ^ (k - j))).re) := by    ext j    simp only [Complex.mul_re, Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero]  rw [hterm]  exact sub_self _
See it in the graphDiscuss this resultChallenge it