Skip to content

feat: Improve docs on space#959

Open
jstoobysmith wants to merge 8 commits intomasterfrom
SpaceDocs
Open

feat: Improve docs on space#959
jstoobysmith wants to merge 8 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.

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
Collaborator

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.

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
Collaborator

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
Collaborator

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-space-time Space and time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants