leanprover-community / leanprover-community/physlib

Add analytic structures for WithDim

Open
#1,628 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
749
Forks
189
Avg merge
1d 21h
Merged PRs (30d)
75

Description

Motivation

I would like to work on analytic structures for WithDim d M as a separate contribution from #1626.

At 45336685, Physlib/Units/WithDim/Basic.lean already provides additive and order structures, an NNReal action, dimension-changing multiplication/division, and casts. It ends with a TODO for further inherited structures, including topology. It does not yet provide the real-module and normed-space structures needed to use dimension-tagged values directly with the calculus API.

Physlib/Units/FDeriv.lean already proves dimensional correctness of the Fréchet derivative under its stated hypotheses. I would reuse that theory rather than introduce a competing definition of differentiability.

Proposed first PR

Keep the WithDim representation and existing operations, and add a coherent analytic layer:

  • Lift the scalar/module structure needed for real analysis, preserving the existing NNReal action and avoiding competing scalar-action instances.
  • Transport the normed additive-group and normed-space structures from the underlying value type, with explicit coordinate equivalences and basic projection/construction lemmas. Keep this basis-generic where the existing type is basis-generic.
  • Include integration examples using continuity and HasFDerivAt on tagged values, plus regression tests for existing unit rescaling, casts, and rejection of mixed-dimension assignments/addition.

The aim is one usable foundation PR, not a collection of unrelated instance additions. I would reuse Mathlib's transport constructions where suitable, without replacing the existing additive operations with a second incompatible instance hierarchy.

Boundaries

The transported norm is the norm of the chosen numerical representation; it is not claimed to be invariant under a change of units. The first PR would not redesign UnitSystem, generalize the existing LTMCT unit-scaling layer, or introduce a Ring/Field instance on an arbitrary fixed physical dimension.

A scalar derivative tagged by output dimension divided by input dimension, together with position/velocity/acceleration examples, would be a follow-up. Normed-space instances alone do not give an ordinary fderiv that quotient-dimension tag, nor do they make an arbitrary differentiable function dimensionally correct.

Question

Would this be an appropriate first scope for addressing the WithDim TODO? My preference is to keep only necessary algebraic additions in WithDim/Basic.lean and place the analytic layer in a focused adjacent module, subject to the preferred import layout.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Physlib/Units/WithDim/Basic.lean at commit 45336685 and its TODO, then review Physlib/Units/FDeriv.lean to understand the existing dimensional derivative theory. A completed contribution would provide the agreed analytic layer without replacing existing operations or redesigning UnitSystem, with integration examples and regression coverage for the listed existing behaviors.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.