Add iterated Space derivatives indexed by multi-indices#1027
Add iterated Space derivatives indexed by multi-indices#1027juanjfndz wants to merge 2 commits intoleanprover-community:masterfrom
Conversation
| -/ | ||
|
|
||
| /-- The tail of a multi-index on `d + 1` coordinates, dropping the `0`-th coordinate. -/ | ||
| def tail (I : MultiIndex d.succ) : MultiIndex d := ⟨fun i => I i.succ⟩ |
There was a problem hiding this comment.
These results about MultiIndex are probably best placed in that file not this one.
| noncomputable def iteratedDeriv [AddCommGroup M] [Module ℝ M] [TopologicalSpace M] | ||
| (I : MultiIndex d) (f : Space d → M) : Space d → M := | ||
| I.toList.foldr (fun i g => deriv i g) f | ||
|
|
There was a problem hiding this comment.
I think it would be nice to define some notation for this, so we don't have to use iteratedDeriv everywhere.
There was a problem hiding this comment.
That makes sense. Before changing the API, two notation candidates that seem most natural to me here are:
∂^[I] f, to stay close to the standard mathematical notation∂^I fwhile still making the multi-index argument visually explicit in Lean;∂[I] f, as the lighter-weight option, in continuity with the existing first-order notation∂[i] f.
My preference would currently be the first one, but I would be happy to go with either if you think one fits PhysLib style better.
There was a problem hiding this comment.
I think the first one is good, keeping the brackets might make it easier to define.
|
Thanks — I have now updated this accordingly. Concretely:
|
|
|
||
| @[simp] | ||
| lemma iteratedDeriv_zero [AddCommGroup M] [Module ℝ M] [TopologicalSpace M] | ||
| (f : Space d → M) : iteratedDeriv (0 : MultiIndex d) f = f := by |
There was a problem hiding this comment.
could use the notation here aswell.
Summary
This PR is the second step in a planned local Classical Field Theory development for PhysLib, aimed at a formalization of the local Euler--Lagrange criterion appearing as Theorem 5.2 in Cortés--Haupt, Chapter 5.
The overall local stack is intended to proceed through:
The Zulip discussion for this development is here:
The previous PR, #1021, introduced the reusable
MultiIndexAPI. This PR uses it to define iterated coordinate derivatives onSpace d.What This PR Adds
This PR adds
Physlib/SpaceAndTime/Space/Derivatives/Iterated.lean, together with its import inPhyslib.lean.Concretely, it provides:
MultiIndex.tail,MultiIndex.toList,Space.iteratedDeriv,In particular, the API already gives the expected specializations
iteratedDeriv 0 f = fand
iteratedDeriv (increment I 0) f = ∂[0] (iteratedDeriv I f)as well as the single-direction case
iteratedDeriv (increment 0 i) f = ∂[i] f.Why This Is Needed
The previous PR, #1021, provided the combinatorial indexing layer. This PR supplies the corresponding analytic notion of iterated coordinate derivative.
Later PRs will use iterated derivatives to define the local jet evaluation
j^k_x fby collecting the derivative coordinates of a field up to order
k.These derivatives are also the local analytic input for the jet coordinates
u^a_Iand hence for local lagrangians depending on derivatives up to order
k.So this PR is the first analytic bridge between the reusable indexing object from
MultiIndexand the later local field-theory constructions.Scope Of This PR
This PR is intentionally limited to the core definition and its first basic recursion/specialization lemmas.
It does not yet add:
Those will appear in the follow-up PR, so that the basic notion of iterated derivative can be reviewed separately before adding the later technical API needed for local jets and first variation.
Build
Locally checked with:
python3 scripts/lint-style.py Physlib/SpaceAndTime/Space/Derivatives/Iterated.leanlake build Physlib.SpaceAndTime.Space.Derivatives.Iteratedlake build Physliblake exe check_file_imports