Skip to content

[Merged by Bors] - feat(Topology/MetricSpace): the L^p direct sum of metric spaces - #40212

Closed
YaelDillies wants to merge 7 commits into
leanprover-community:masterfrom
YaelDillies:finsupp_metric_space
Closed

YaelDillies wants to merge 7 commits into
leanprover-community:masterfrom
YaelDillies:finsupp_metric_space

Conversation

@YaelDillies

@YaelDillies YaelDillies commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Endow the direct sum ι →₀ X of ι-many copies of a metric space X with the L^p metric for any 1 ≤ p < ∞.

p = ∞ is theoretically possible too but currently annoying due to defects in our tactics/WithTop API. I am leaving it as future work.

Zulip


Open in Gitpod

@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

PR summary 32cd402342

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.Normed.Lp.Finsupp (new file) 1842

Declarations diff (regex)

+ dist_def
+ edist_def
+ ext_iff
+ instance [EMetricSpace X] : EMetricSpace (WithLp p <| ι →₀ X)
+ instance [MetricSpace X] : MetricSpace (WithLp p <| ι →₀ X)
+ instance [PseudoEMetricSpace X] : PseudoEMetricSpace (WithLp p <| ι →₀ X)
+ instance [PseudoMetricSpace X] : PseudoMetricSpace (WithLp p <| ι →₀ X)
+ nndist_def
+ not_toReal_neg
+ recTopCoe_ofNNReal
+ recTopCoe_top
+ sup'_eq_one
+ sup_eq_one
- sup'_eq_zero
- sup_eq_zero

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 32cd402).

  • +13 new declarations
  • −0 removed declarations
+ENNReal.recTopCoe_ofNNReal
+ENNReal.recTopCoe_top
+Finset.sup'_eq_one
+Finset.sup_eq_one
+Finsupp.dist_def
+Finsupp.edist_def
+Finsupp.instEMetricSpaceWithLpOfNNReal
+Finsupp.instMetricSpaceWithLpOfNNReal
+Finsupp.instPseudoEMetricSpaceWithLpOfNNReal
+Finsupp.instPseudoMetricSpaceWithLpOfNNReal
+Finsupp.nndist_def
+NNReal.not_toReal_neg
+WithLp.ext_iff

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 32cd402342
Reference commit 2da222063c

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@github-actions github-actions Bot added the t-topology Topological spaces, uniform spaces, metric spaces, filters label Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026 •

Copy link
Copy Markdown

✅ PR Title Formatted Correctly

The title of this PR has been updated to match our commit style conventions.
Thank you!

@YaelDillies
YaelDillies temporarily deployed to cache-upload-forks June 4, 2026 08:12 — with GitHub Actions Inactive
@YaelDillies YaelDillies changed the title feat(Topology/MetricSpace): L^1 direct sum of metric spaces feat(Topology/MetricSpace): the L^1 direct sum of metric spaces Jun 4, 2026
@YaelDillies
YaelDillies force-pushed the finsupp_metric_space branch from e218e81 to ceebb37 Compare June 4, 2026 08:51
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jun 4, 2026
@YaelDillies
YaelDillies temporarily deployed to cache-upload-forks June 4, 2026 09:11 — with GitHub Actions Inactive
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jun 4, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

This PR/issue depends on:

Comment thread Mathlib/Analysis/Normed/Lp/Finsupp.lean Outdated
Comment on lines +27 to +28
/-- The L^1 extended metric on `ι`-many copies of a metric space `X` -/
noncomputable instance [PseudoEMetricSpace X] : PseudoEMetricSpace (ι →₀ X) where

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should make this be the L^∞ metric instead since that's what we do for the pi type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought about this and I in fact I believe L^1 is the right choice: The dual of a direct sum is a pi type, and therefore it makes sense for the dual norm of a direct sum to be the L^infty norm that we put on the pi type. The dual norm of the L^1 is the L^infty, which is why I think the direct sum should be equipped with the L^1 norm.

What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting angle.

I think it is more likely that people will be in a situation where ι is finite and want an isometry than they are to be in a situation where the duality matters. This might be worth raising on Zulip though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay so I generalised to an arbitrary p in the range [1, ∞). Unfortunately, p = ∞ is more annoying to cover because of defects in our tactics/WithTop API. I would rather leave it as future work.

Note that this also addresses Anatole's concern on Zulip that ι →₀ X shouldn't have any metric by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

bors d+

@ocfnash ocfnash added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 4, 2026
@YaelDillies YaelDillies removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 4, 2026
@YaelDillies
YaelDillies force-pushed the finsupp_metric_space branch from ceebb37 to ee41824 Compare June 25, 2026 09:24
@YaelDillies YaelDillies changed the title feat(Topology/MetricSpace): the L^1 direct sum of metric spaces feat(Topology/MetricSpace): the L^p direct sum of metric spaces Jun 25, 2026
@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jun 27, 2026
@mathlib-bors

mathlib-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

✌️ YaelDillies can now approve this pull request until 2026-07-11 11:02 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@YaelDillies

Copy link
Copy Markdown
Contributor Author

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Jun 27, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
Endow the direct sum `ι →₀ X` of `ι`-many copies of a metric space `X` with the L^p metric for any `1 ≤ p < ∞`.

`p = ∞` is theoretically possible too but currently annoying due to defects in our tactics/`WithTop` API. I am leaving it as future work.

[Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/What.20topology.20on.20Finsupp.3F/with/600119738)
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Jun 27, 2026
@mathlib-bors

mathlib-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Topology/MetricSpace): the L^p direct sum of metric spaces [Merged by Bors] - feat(Topology/MetricSpace): the L^p direct sum of metric spaces Jun 27, 2026
@mathlib-bors mathlib-bors Bot closed this Jun 27, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jun 27, 2026
@YaelDillies
YaelDillies deleted the finsupp_metric_space branch June 27, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-topology Topological spaces, uniform spaces, metric spaces, filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants