Zulip Chat Archive

Stream: new members

Topic: Partial Derivatives


Ryland Gross (Feb 25 2026 at 04:39):

Hi all,

It's very nice to introduce myself to the Zulip Chat. I'm Ryland, an undergraduate math student currently taking a class on Lean4. I'm experimenting on the side trying to do some work on Partial Derivatives since I saw they still had not been added to Mathlib.

I've been learning about Frechet Derivatives through Wikipedia and Mathlib and I think I have successfully implemented some of them in a more exact case dealing with R^n, but I also think I can implement them for the more general addcommgroup, k module, topological space version too.

Do you all have any advice on how I should best proceed to keep working on this, even if it is just for my own edification // personal project with lean? I'm under the impression that we are stylistically trying to make everything as general as possible, is the way I described enough?

Thanks!

Ryland Gross (Feb 25 2026 at 04:42):

Sorry forgot to mention (my goal is to eventually prove Clairaut's Theorem)

Bryan Wang (Feb 25 2026 at 05:12):

Hi Ryland :) I think (correct me if wrong) I have seen one version of Clairaut's theorem as docs#Convex.second_derivative_within_at_symmetric

Tomas Skrivan (Feb 25 2026 at 18:24):

The topic of partial derivatives came up multiple times and always fizzles out as people experienced with Lean don't really need them. Some time ago I wrote a guide to partial derivatives, it might clarify a thing or two.

Jireh Loreaux (Feb 25 2026 at 19:46):

@Anne Baanen the guide to partial derivatives that Tomas Skrivan wrote and linked above was supposed to eventually make it onto the community website, but that never happened. Can you add that as a TODO item for the website overhaul? To be clear, I'm not asking you to do the work to add it to the website, only to add it as a tracked item on that document.

Anne Baanen (Feb 26 2026 at 09:27):

Wow, this is great! I'll definitely ensure this gets a proper page.

Tomas Skrivan (Feb 26 2026 at 13:47):

Ok I made a PR, but I just quickly copy pasted the post https://github.com/leanprover-community/leanprover-community.github.io/pull/800 Maybe it should go to MIL, I don't really know where it would be easier to find.

Tomas Skrivan (Feb 26 2026 at 14:27):

Btw there is inactive PR for partial derivatives notation #25427 it might be worth resurrecting and mention it in the guide.

Tomas Skrivan (Feb 26 2026 at 15:01):

Here is my take on partial derivative notation:

-- Index in brackets → EuclideanSpace.single i 1 direction, field ℝ
#check [i] (f · y) x                      -- (∂[i] (f · y)) x = fderiv ℝ (f · y) x (single i 1)
#check [i] x'', (f x'' y)                 -- fun x'' => fderiv ℝ ... x'' (single i 1)
#check [i] (x'' := x), (f x'' y)          -- fderiv ℝ ... x (single i 1)

-- Numeric literal as index (isFin short-circuits on nat literals)
variable [NeZero n]
#check [0] (f · y) x                       -- fderiv ℝ (f · y) x (single (0 : Fin n) 1)

-- Field + index
#check [, i] (g · y') x'                 -- fderiv ℂ (g · y') x' (single i 1)

-- Field only → curried CLM-map; normal application gives the CLM at a point
#check [] (f · y)                         -- fderiv ℝ (f · y)  :  _ → _ →L[ℝ] _
#check [] (f · y) x                       -- (∂[ℝ] (f · y)) x  :  _ →L[ℝ] _
#check [] x'', (f x'' y)                 -- fun x'' => fderiv ℝ (fun x'' => f x'' y) x''
#check [] (x'' := x), (f x'' y)          -- fderiv ℝ (fun x'' => f x'' y) x
#check [] (x'' := x; dx), (f x'' y)      -- fderiv ℝ (fun x'' => f x'' y) x dx

-- No brackets → defaults to ℝ
#check  (f · y)                             -- fderiv ℝ (f · y)
#check  (f · y) x                           -- (∂ (f · y)) x

-- second derivative
#check   (f · y)
#check  (x':=x),  (x'':=x'), (f x'' y)

code

Paul Lezeau (Feb 27 2026 at 09:51):

Tomas Skrivan said:

Btw there is inactive PR for partial derivatives notation #25427 it might be worth resurrecting and mention it in the guide.

I got distracted by other stuff, but I'd be very happy to resurrect this if there is appetite for it!


Last updated: Feb 28 2026 at 14:05 UTC