Skip to content

[Merged by Bors] - feat: bundled C^n maps supported in a fixed compact set#30197

Closed
luigi-massacci wants to merge 17 commits intoleanprover-community:masterfrom
luigi-massacci:LM_PR_ContDiff_I
Closed

[Merged by Bors] - feat: bundled C^n maps supported in a fixed compact set#30197
luigi-massacci wants to merge 17 commits intoleanprover-community:masterfrom
luigi-massacci:LM_PR_ContDiff_I

Conversation

@luigi-massacci
Copy link
Copy Markdown
Collaborator

@luigi-massacci luigi-massacci commented Oct 4, 2025

Add a type of n-times continuously differentiable maps supported in a fixed compact set and related notation.
Co-authored by: @ADedecker


Open in Gitpod

@github-actions github-actions bot added the t-analysis Analysis (normed *, calculus) label Oct 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 4, 2025

PR summary 928504d552

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.Distribution.ContDiffMapSupportedIn (new file) 1755

Declarations diff

+ ContDiffMapSupportedIn
+ ContDiffMapSupportedInClass
+ Simps.apply
+ coe_copy
+ compact_supp
+ contDiff
+ copy
+ copy_eq
+ ext
+ toContDiffMapSupportedInClass
+ toFun_eq_coe
+ zero_on_compl
++ instance (B : Type*) (E F : outParam <| Type*)

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@grunweg grunweg changed the title feat(Analysis/Distribution/ContDiffMapSupportedIn): Add a type of n-times continuously differentiable maps supported in a fixed compact. feat: add a type of n-times continuously differentiable maps supported in a fixed compact. Oct 4, 2025
@grunweg grunweg changed the title feat: add a type of n-times continuously differentiable maps supported in a fixed compact. feat: bundled C^n maps supported in a fixed compact set Oct 4, 2025
Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

Thanks for getting this work started! Here are a first few minor comments (just about the docs so far).
Most importantly, this file defines a type of bundled functions (while we often use unbundled functions in mathlib). Can you mention why we do this, namely because this will be related to the space of test functions for defining distributions? Thanks!

@grunweg grunweg added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 4, 2025
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Oct 4, 2025

Should this PR be Co-authored-by: Anatole (or perhaps, adding an empty commit with him as the author)?

@luigi-massacci
Copy link
Copy Markdown
Collaborator Author

luigi-massacci commented Oct 4, 2025

Should this PR be Co-authored-by: Anatole (or perhaps, adding an empty commit with him as the author)?

The commit should already be there? It's 64effd6. But let me add it to the text description too to be clear.

/-- The underlying function. Use coercion instead. -/
protected toFun : E → F
protected contDiff' : ContDiff ℝ n toFun
protected zero_on_compl' : EqOn toFun 0 Kᶜ
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 would have expected this condition to be tsupport toFun ⊆ K. Is that more annoying to use?

Copy link
Copy Markdown
Collaborator Author

@luigi-massacci luigi-massacci Oct 5, 2025

Choose a reason for hiding this comment

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

The choice to write it that way was made by @ADedecker a long time ago, maybe he has a more sophisticated explanation, but for myself, I certainly found it very convenient when working with integrals as it makes it much more direct to rewrite (eg: turn an integral over E to one over just K, etc), and my impression is that tsupport was a bit more awkward to use, though that might be be only an argument in favor of adding more API

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.

Yes, this is precisely the point: while those are only a few rewrites away, this is the condition which is most elementary to manipulate IMHO. One key point is that we don't want to be constantly rewriting between tsupport toFun ⊆ K and support toFun ⊆ K (using that K is closed).

Now, looking at the current state at the API for tsupport I can see that it is indeed much better than it was a few years ago (e.g we have docs#tsupport_iteratedFDeriv_subset), but I still think that this condition will be more natural in general.

Of course this could just be solved with API, so if you really prefer the definition to be in terms of tsupport this can be changed.


/-- The type of `n`-times continuously differentiable maps which vanish outside of a fixed
compact `K`. -/
structure ContDiffMapSupportedIn (n : ℕ∞) (K : Compacts E) : Type _ where
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.

Here I would have assumed that we define it for arbitrary subsets and just use the assumption that K is compact whenever that is actually needed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not opposed to it, but I think the answer to "wherever it is actually needed" is "everywhere". Certainly the topology requires compactness. If K is not compact I'm not sure there is a lot more value in defining a separate structure (on which one can pile on instances) as opposed to just using ContDiffOn on an unbundled function.

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 main point was indeed instances, because typeclass search does not work with extra non-instance parameters. Of course you could assume [CompactSpace K], but I think this is a bit artificial.

Also, note that people will essentially never (I think?) have K be their favourite compact set: this will appear in the continuity criterion for distributions, so either you will have to work with arbitrary K : Compacts E or with a specific element of an exhaustion, both of which have essentially been proven compact already at this point.

(Although maybe we should make the FunLike instance of CompactExhaustion land in Compacts to make this even easier, but this can wait)

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

I took another pass over the code: just very minor comments (and one question for my own understanding).

@grunweg grunweg added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 9, 2025
@luigi-massacci luigi-massacci removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 9, 2025
Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

Can you fix my two style comments and perhaps use inherit_doc, and then this is good?
maintainer delegate

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Oct 9, 2025

I decided to be slightly pushy and applied my style tweaks myself. Feel free to revert any that you disagree with!

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Oct 9, 2025

maintainer delegate

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 9, 2025

🚀 Pull request has been placed on the maintainer queue by grunweg.

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Oct 9, 2025
@RemyDegenne
Copy link
Copy Markdown
Contributor

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 11, 2025

✌️ luigi-massacci can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Oct 11, 2025
@luigi-massacci
Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Oct 11, 2025
Add a type of n-times continuously differentiable maps supported in a fixed compact set and related notation.
Co-authored by: @ADedecker

Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 11, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: bundled C^n maps supported in a fixed compact set [Merged by Bors] - feat: bundled C^n maps supported in a fixed compact set Oct 11, 2025
@mathlib-bors mathlib-bors bot closed this Oct 11, 2025
BeibeiX0 pushed a commit to BeibeiX0/mathlib4 that referenced this pull request Nov 7, 2025
…ommunity#30197)

Add a type of n-times continuously differentiable maps supported in a fixed compact set and related notation.
Co-authored by: @ADedecker

Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com>
Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants