Skip to content

partial derivatives guide#800

Open
lecopivo wants to merge 3 commits into
leanprover-community:lean4from
lecopivo:partial_derivatives
Open

partial derivatives guide#800
lecopivo wants to merge 3 commits into
leanprover-community:lean4from
lecopivo:partial_derivatives

Conversation

@lecopivo
Copy link
Copy Markdown

@lecopivo lecopivo commented Feb 26, 2026

Added guide for partial derivatives based on my Zulip post #new members > partial derivative of a vector field @ 💬

Comment thread templates/theories/partial_derivatives.md
Comment thread templates/theories/partial_derivatives.md Outdated
Comment thread templates/theories/partial_derivatives.md
Comment thread templates/theories/partial_derivatives.md Outdated
Comment thread templates/theories/partial_derivatives.md
Comment thread templates/theories/partial_derivatives.md Outdated
Comment thread templates/theories/partial_derivatives.md
Comment thread templates/theories/partial_derivatives.md Outdated
Comment thread templates/theories/partial_derivatives.md Outdated
Comment thread templates/theories/partial_derivatives.md Outdated
Looks good

Co-authored-by: Snir Broshi <26556598+SnirBroshi@users.noreply.github.com>
Comment thread templates/theories/partial_derivatives.md Outdated
Co-authored-by: Snir Broshi <26556598+SnirBroshi@users.noreply.github.com>
@PatrickMassot
Copy link
Copy Markdown
Member

Thanks Tomáš! I think this is useful but you should clearly say this guide is intended for downstream users, not further contributions to Mathlib, and explicitly point out that the Mathlib way is to replace EuclideanSpace ℝ (Fin n) with a real normed space (most often not even finite dimensional) and work with that instead.

Copy link
Copy Markdown
Member

@mcdoll mcdoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think it would be good, that this is more a recommendation for repos downstream of mathlib that are more about concreteness and applied maths (in the broad sense)

Edit: sorry, missed Patrick's comment...

Comment on lines +7 to +10
Given a function $$f : \mathbb{R}^n \to \mathbb{R}^m$$, how do you write $$\frac{\partial f}{\partial x_i}$$ in Lean?

Lean represents $$\mathbb{R}^n$$ as `EuclideanSpace ℝ (Fin n)`. You can express partial derivatives using the `fderiv` function and the basis vector `single i 1`:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be really great, if this was qualified somewhat: if you want to contribute to mathlib, in almost all cases $$\mathbb{R}^n$$ should be written as {E : Type*} [NormedAddCommGroup E] [InnerProductSpace \R E] [FiniteDimensional \R E] and you can just work with the derivative and it is generally possible to rephrase your theorem in terms of fderiv. If you are not in mathlib and really want to talk about the concrete EuclideanSpace ℝ (Fin n), then the above applies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants