[Merged by Bors] - feat: further extensions of the differential geometry elaborators#30413
[Merged by Bors] - feat: further extensions of the differential geometry elaborators#30413grunweg wants to merge 30 commits intoleanprover-community:masterfrom
Conversation
PR summary 50c7f343a1Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
e667c0b to
f803f97
Compare
0e64472 to
079afd9
Compare
|
This pull request has conflicts, please merge |
|
This PR/issue depends on: |
079afd9 to
2c86a5a
Compare
2c86a5a to
4f360bd
Compare
thorimur
left a comment
There was a problem hiding this comment.
A first pass (hopefully most of the way there!); I've got to step away from my machine for a bit, but wanted to make these visible. :)
| fromCLM : TermElabM Expr := do | ||
| match_expr e with | ||
| | ContinuousLinearMap k S _ _ _σ _E _ _ _F _ _ _ _ => | ||
| if ← isDefEq k S then |
There was a problem hiding this comment.
Hmm, I want to be sure that isDefEq at this transparency doesn't make any necessary instance synthesis break. Can you please write a test for this and for the one in fromRealInterval where isDefEq nontrivially succeeds (but withReducible <| isDefEq wouldn't)? E.g., wrapping in a def, such as using def RealCopy := Real for α in the fromRealInterval test.
There was a problem hiding this comment.
Good point, thanks! I'll add such a test (but possibly only after your second review pass).
There was a problem hiding this comment.
Great! Also, if isDefEq turns out to be fine, we should document that we know it's fine near its invocation in a short comment. :)
There was a problem hiding this comment.
I added a test for the fromRealInterval case --- I needed to re-add the TopologicalSpace, Preorder and ChartedSpace instances manually (as these work for Real, but not RealCopy) - then the elaborator worked fine. I'm not sure if that's the desired behaviour; what do you think?
There was a problem hiding this comment.
I also pushed a test for the continuousLinearMap case; this already breaks earlier (at the synthesis of a NormedSpace instance for the space of maps. 🤔
(Edit: I pushed a modification; my first attempt failed at a really basic level. I don't understand any more why the instances fail now.)
There was a problem hiding this comment.
I added a test for the fromRealInterval case --- I needed to re-add the TopologicalSpace, Preorder and ChartedSpace instances manually (as these work for Real, but not RealCopy) - then the elaborator worked fine. I'm not sure if that's the desired behaviour; what do you think?
Hmmm, I'm not sure. Suppose there's a type WeirdReal that's defined as Real, but with a totally different topology/preorder/etc.--is modelWithCornersEuclideanHalfSpace still the right model with corners for a closed interval on it? My thought is "no": the type of modelWithCornersEuclideanHalfSpace refers to the topology on Real, not WeirdReal.
But I'm still familiarizing myself with how exactly ModelWithCorners work on a formal level, so I could be wrong. Do you feel confident one way or the other about whether it would be the correct model with corners in this case?
There was a problem hiding this comment.
Thanks; that's the right question to ask!
The answers is indeed no. (Consider for example WeirdReal, the real numbers endowed with the indiscrete topology. Everything is still a normed space over WeirdReal (as that doesn't use the topology on R), but modelWithCornersEuclideanHalfSpace is not a model with corners any more, as continuous_toFun fails: the only continuous functions from the indiscrete topology are the constant ones.
There was a problem hiding this comment.
I'm not sure what this means, though: when the base field is the real numbers, I would expect it to really be the real numbers (not "the real numbers with a weird topology"), so inferring the same model makes sense.
I have added a comment in those locations.
There was a problem hiding this comment.
After more thinking and talking to Floris, it's become clear that the defeq check should be changed to withReducible (not semi-reducible transparency). Using a type synonym to put a different topology/algebraic structure (or, in this case, smooth structure) on a type is a standard mathlib pattern. Seeing through that would be counter-productive. Indeed, apparently there was a past exercise defining a different smooth structure on the interval, and we want to allow this. I'll change the check, again.
Thanks a lot for asking the right question here!
There was a problem hiding this comment.
Changed the check and updated the tests to clearly test this.
6023cef to
d719ae8
Compare
|
LGTM pending these changes and those |
478c9e8 to
54885c4
Compare
fc6acf9 to
d6100e9
Compare
229a890 to
a5db2dd
Compare
|
I updated the defEq check and the tests: now, they are finally testing what they are supposed to test (and are failing accordingly). I've chosen to also test the trace errors (since they should indicate what is going on), and this made the diff grow by another 100 lines. But I hope this PR is now, finally, ready for good. |
|
Wonderful! I gave it a final once-over, and it indeed looks ready to me. :) maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by thorimur. |
|
bors r+ |
…0413) Also infer the model with corners on - a space of continuous linear equivalences - a closed real interval (Set.Icc) - the complex upper half plane And add elaborators for `HasMFDeriv(Within)At` analogous to the `mfderiv(Within)` ones. Further cases, as well as products, disjoint unions or open subsets, will be covered in future PRs.
|
Pull request successfully merged into master. Build succeeded: |
…anprover-community#30413) Also infer the model with corners on - a space of continuous linear equivalences - a closed real interval (Set.Icc) - the complex upper half plane And add elaborators for `HasMFDeriv(Within)At` analogous to the `mfderiv(Within)` ones. Further cases, as well as products, disjoint unions or open subsets, will be covered in future PRs.
…anprover-community#30413) Also infer the model with corners on - a space of continuous linear equivalences - a closed real interval (Set.Icc) - the complex upper half plane And add elaborators for `HasMFDeriv(Within)At` analogous to the `mfderiv(Within)` ones. Further cases, as well as products, disjoint unions or open subsets, will be covered in future PRs.
Also infer the model with corners on
And add elaborators for
HasMFDeriv(Within)Atanalogous to themfderiv(Within)ones.Further cases, as well as products, disjoint unions or open subsets, will be covered in future PRs.