Skip to content

feat: Improve docs on space#959

Merged
jstoobysmith merged 9 commits intomasterfrom
SpaceDocs
Mar 2, 2026
Merged

feat: Improve docs on space#959
jstoobysmith merged 9 commits intomasterfrom
SpaceDocs

Conversation

@jstoobysmith
Copy link
Member

Improving the documentation on Space in accordance with the conversation here:

https://leanprover.zulipchat.com/#narrow/channel/479953-PhysLean/topic/Space.20vs.20EuclideanSpace/with/575332888

@jstoobysmith jstoobysmith added the t-space-time Space and time label Feb 24, 2026
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
of a zero), a future refactor should give `Space d` only the instance of an `AddTorsor`
(an affine space) which does not require the choice of a zero. This has not been done
yet since `fderiv` requires a `Module` instance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Similarly, `Norm` `InnerProductSpace` instances should be replaced by the `MetricSpace` instance giving directly the Euclidean distance.

if only "physical" quantities are allowed.

Copy link
Member

Choose a reason for hiding this comment

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

NormedAddTorsor is probably the right thing to mention.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated this, would appreciate it if one of you could check what I have written.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good to me!

@jstoobysmith jstoobysmith added the awaiting-author A reviewer has asked the author a question or requested changes label Feb 25, 2026
jstoobysmith and others added 4 commits February 25, 2026 13:05
Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>
Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>
Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>
@jstoobysmith jstoobysmith removed the awaiting-author A reviewer has asked the author a question or requested changes label Feb 25, 2026

There is a choice between defining `Space d` as an `abbrev` of `EuclideanSpace ℝ (Fin d)`,
as a `def` of a type with value `EuclideanSpace ℝ (Fin d)` or as a structure
with a field `val : Fin d → ℝ`.
Copy link
Member

Choose a reason for hiding this comment

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

Arguably val : EuclideanSpace ℝ (Fin d) is a nicer option here, which means you don't have to redefine all the structure.

Copy link
Member Author

Choose a reason for hiding this comment

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

But I think it means you have to use WithLp.ofLp etc. everywhere. Could one not get the same benefit in terms of structure by defining an equivalence from Space d to EuclideanSpace ℝ (Fin d)?

Copy link
Member

Choose a reason for hiding this comment

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

Can you give an example of where you'd need to write WithLp.ofLp? I think it's registered as a function coercion so that you don't have to write it.

Copy link
Member Author

Choose a reason for hiding this comment

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

My bad, I meant WithLp.toLp, I agree that you shouldn't need WithLp.ofLp

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@jstoobysmith jstoobysmith requested a review from zhikaip February 27, 2026 10:34
Copy link
Collaborator

@zhikaip zhikaip left a comment

Choose a reason for hiding this comment

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

some minor suggestions otherwise looks good

@zhikaip zhikaip added the awaiting-author A reviewer has asked the author a question or requested changes label Mar 1, 2026
@zhikaip zhikaip self-assigned this Mar 1, 2026
Copy link
Collaborator

@zhikaip zhikaip left a comment

Choose a reason for hiding this comment

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

Thanks, approved.

@jstoobysmith jstoobysmith merged commit fc156d2 into master Mar 2, 2026
3 checks passed
@jstoobysmith jstoobysmith deleted the SpaceDocs branch March 2, 2026 10:19
@jstoobysmith jstoobysmith added ready-to-merge This PR is approved and will be merged shortly and removed awaiting-author A reviewer has asked the author a question or requested changes labels Mar 2, 2026
JayYarlott pushed a commit to Complex-Quantum-Systems-Research-Group/PhysLean that referenced this pull request Mar 3, 2026
* feat: Improve docs on space

* feat: Add add and zero paragraph

* Update PhysLean/SpaceAndTime/Space/Basic.lean

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

* Update PhysLean/SpaceAndTime/Space/Basic.lean

Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>

* Update PhysLean/SpaceAndTime/Space/Basic.lean

Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>

* Update PhysLean/SpaceAndTime/Space/Basic.lean

Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>

* refactor: Update docs

* Update PhysLean/SpaceAndTime/Space/Basic.lean

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

* refactor: Review comments

---------

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Yoh Tanimoto <57562556+yoh-tanimoto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR is approved and will be merged shortly t-space-time Space and time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants