Skip to content

Add iterated Space derivatives indexed by multi-indices#1027

Draft
juanjfndz wants to merge 2 commits intoleanprover-community:masterfrom
juanjfndz:codex/pr2-iterated-derivatives-i
Draft

Add iterated Space derivatives indexed by multi-indices#1027
juanjfndz wants to merge 2 commits intoleanprover-community:masterfrom
juanjfndz:codex/pr2-iterated-derivatives-i

Conversation

@juanjfndz
Copy link
Copy Markdown
Contributor

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:

  • multi-indices and iterated derivatives,
  • admissible compactly supported variations,
  • local jets,
  • total derivatives,
  • local lagrangians and the action functional,
  • the local Euler--Lagrange operator,
  • and finally the first-variation criterion.

The Zulip discussion for this development is here:

The previous PR, #1021, introduced the reusable MultiIndex API. This PR uses it to define iterated coordinate derivatives on Space d.

What This PR Adds

This PR adds Physlib/SpaceAndTime/Space/Derivatives/Iterated.lean, together with its import in Physlib.lean.

Concretely, it provides:

  • MultiIndex.tail,
  • MultiIndex.toList,
  • the definition Space.iteratedDeriv,
  • and the first basic lemmas identifying the order-zero and one-step cases.

In particular, the API already gives the expected specializations

iteratedDeriv 0 f = f

and

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 f

by 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_I

and 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 MultiIndex and 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:

  • linearity lemmas,
  • smoothness preservation lemmas,
  • or support lemmas for iterated derivatives.

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.lean
  • lake build Physlib.SpaceAndTime.Space.Derivatives.Iterated
  • lake build Physlib
  • lake exe check_file_imports

-/

/-- 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⟩
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.

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

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 nice to define some notation for this, so we don't have to use iteratedDeriv everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 f while 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.

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 the first one is good, keeping the brackets might make it easier to define.

@juanjfndz
Copy link
Copy Markdown
Contributor Author

juanjfndz commented Apr 7, 2026

Thanks — I have now updated this accordingly.

Concretely:

  • the purely combinatorial MultiIndex material (tail, toList, and the associated lemmas) has been moved into Physlib/SpaceAndTime/Space/Derivatives/MultiIndex.lean,
  • and the iterated-derivative notation has been added in the form ∂^[I].


@[simp]
lemma iteratedDeriv_zero [AddCommGroup M] [Module ℝ M] [TopologicalSpace M]
(f : Space d → M) : iteratedDeriv (0 : MultiIndex d) f = f := by
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.

could use the notation here aswell.

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.

2 participants