This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 292
refactor(analysis/calculus/times_cont_diff): massive refactor #2012
Merged
mergify
merged 29 commits into
leanprover-community:master
from
sgouezel:better_times_cont_diff
Feb 28, 2020
Merged
refactor(analysis/calculus/times_cont_diff): massive refactor #2012
mergify
merged 29 commits into
leanprover-community:master
from
sgouezel:better_times_cont_diff
Feb 28, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urkud
reviewed
Feb 19, 2020
kim-em
reviewed
Feb 24, 2020
kim-em
reviewed
Feb 24, 2020
kim-em
reviewed
Feb 24, 2020
kim-em
reviewed
Feb 24, 2020
kim-em
reviewed
Feb 24, 2020
kim-em
reviewed
Feb 24, 2020
Looks fantastic (I only attempted to read the comments and statements, none of the code.) |
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
Co-Authored-By: Scott Morrison <scott@tqft.net>
I understand the mathematical issues and this seems a good resolution of the previous problem. I never attempted to read the actual proofs, but the documentation and statements are great, and I'm happy to trust @sgouezel's judgement constructing nice enough proofs... |
I think we should merge now. |
PatrickMassot
approved these changes
Feb 28, 2020
butterthebuddha
pushed a commit
to butterthebuddha/mathlib
that referenced
this pull request
May 15, 2020
…over-community#2012) * feat(data/fin): append * Update fin.lean * Update fintype.lean * replace but_last with init * cons and append commute * feat(*/multilinear): better multilinear * docstrings * snoc * fix build * comp_snoc and friends * refactor(analysis/calculus/times_cont_diff): massive refactor * fix docstring * move notation * fix build * linter * linter again * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * curryfication -> currying Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
butterthebuddha
pushed a commit
to butterthebuddha/mathlib
that referenced
this pull request
May 16, 2020
…over-community#2012) * feat(data/fin): append * Update fin.lean * Update fintype.lean * replace but_last with init * cons and append commute * feat(*/multilinear): better multilinear * docstrings * snoc * fix build * comp_snoc and friends * refactor(analysis/calculus/times_cont_diff): massive refactor * fix docstring * move notation * fix build * linter * linter again * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * Update src/analysis/calculus/times_cont_diff.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * curryfication -> currying Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
ready-to-merge
All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are three serious problems with the current implementation of
C^n
functions in mathlib:C^n
in a domain is defined by requiring that some choice of the iterated derivative (given byiterated_fderiv
) is continuous up ton
. In a domain where the derivative is not unique, this creates problems (for instance, the sum of twoC^n
functions might not beC^n
). This means that the notion is well behaved only in sets with unique derivatives. As a consequence, further files using this API spend a lot of time checking the unique derivative property, while this could be avoided with a more clever choice of definition.n
-th iterated derivative is defined currently as then-1
-th derivative of the derivative. Hence, it is a function inE -> (E -> (E -> .... (E -> F))...)
, which is pretty much unusable from a practical point of view.n
-th derivative as then-1
-th derivative of the derivative is a definition by induction, but generalizing the target space: to define then
-th derivative of a function fromE
toF
, one needs to know how to define then-1
-th derivative of a function fromE
toE -> F
. Such an inductive definition only makes sense if the spacesF
andE -> F
are in the same universe, i.e., ifE
andF
are in the same universe. This is the choice that is made currently, preventing universe polymorphism.This PR solves these three issues, essentially by rewriting the file
analysis/calculus/times_cont_diff_on
from scratch.C^n
on a domain is now defined as the existence of a sequence of derivatives with the right properties. Being on a domain with unique derivatives becomes irrelevant for most statements.n
-th derivative is now defined as a multilinear map, by adding suitable currification steps in the inductive definition.n
-th derivative as the derivative of then-1
-th derivative. This avoids universe issues, at the cost of having somewhat more complicated proofs in some places (as inductive proofs are not really usable any more). In fact, it turned out to be not so bad. The only tricky place is the proof that the composition ofC^n
maps isC^n
, where the inductive proof is really the good one. In the PR, I do the induction when all spaces are in the same universe, and then I use some lifting trick to generalize it to the general situation.TL;DR The old file is bad. The new file is much better.