Zulip Chat Archive

Stream: Is there code for X?

Topic: combinatorial sums?


Ralf Stephan (Jul 04 2024 at 09:15):

[xn]P(x)k=n1+n2++nk=nan1an2ank[x^n] P(x)^k = \sum_{n_1 + n_2 + \cdots + n_k = n} a_{n_1} a_{n_2} \cdots a_{n_k}
Is this in Mathlib? How to state the sum term? Is a proof out of reach at the moment?

Yaël Dillies (Jul 04 2024 at 09:39):

This exists, but can you give the LHS as a Lean expression? There are many ways you could formalise your current statement and I'm not sure which one you want

Ralf Stephan (Jul 04 2024 at 10:02):

import Mathlib
set_option autoImplicit false
open PowerSeries

example (k n : ) (φ : X) (hC : constantCoeff  φ = 1) : coeff  n (φ ^ k) = RHS := by sorry

Ralf Stephan (Jul 04 2024 at 14:43):

(deleted)

Ralf Stephan (Jul 05 2024 at 08:07):

Is this coeff_prod (f := φ) (d := n) (s := range k)?

Ralf Stephan (Jul 05 2024 at 13:58):

lemma coeff_pow (k n : ) (φ : RX) :
    coeff  n (φ ^ k) =  l  finsuppAntidiag (range k) n,  i  range k, coeff R (l i) φ := by
  have h₁ (i : ) : Function.const  φ i = φ := rfl
  have h₂ (i : ) :  j  range i, Function.const  φ j = φ ^ i := by
    apply prod_range_induction (fun _ => φ) (fun i => φ ^ i) rfl (congrFun rfl) i
  rw [ h₂,  h₁ k]
  apply coeff_prod (f := Function.const  φ) (d := n) (s := range k)

Ralf Stephan (Jul 05 2024 at 14:00):

Any objections against submitting this to Mathlib?

Yaël Dillies (Jul 05 2024 at 14:06):

Looks fine except for the fact that you should generalise away from Rat

Ralf Stephan (Jul 05 2024 at 16:10):

Part of #14452.


Last updated: May 02 2025 at 03:31 UTC