Zulip Chat Archive

Stream: new members

Topic: Take derivatives multiple times.


oishi (Dec 23 2024 at 16:12):

image.png
Does anyone know how to translate the process in the image into Lean 4 code? Especially the part that involves taking derivatives multiple times.

Ruben Van de Velde (Dec 23 2024 at 16:34):

If you're formalizing these as polynomials, Polynomial.derivative^[k] p

oishi (Dec 24 2024 at 13:51):

Thanks a lot. And may I ask for another question? Do you know how to differentiate both sides of the equation in Lean4?Alternatively, is there a similar theorem existing in the field of polynomials?

Ruben Van de Velde (Dec 24 2024 at 13:56):

What kind of equation? A goal? A hypothesis?

oishi (Dec 24 2024 at 14:03):

image.png
As shown in this example, the given equation is

(1x)n=k=0n(1)k(nk)xk.(1 - x)^n = \sum_{k=0}^n (-1)^k \binom{n}{k} x^k.

This is an already proven theorem. I would like to build upon this theorem to demonstrate that taking derivatives of both sides of the equation simultaneously will also yield equality.

Ruben Van de Velde (Dec 24 2024 at 14:18):

You can write something like

have h := existing_theorem n
apply_fun Polynomial.derivative^[k] at h

oishi (Dec 24 2024 at 14:21):

Thanks again. I will try.


Last updated: May 02 2025 at 03:31 UTC