Skip to content

feat(Topology/MetricSpace): the L^1 direct sum of metric spaces#40212

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

feat(Topology/MetricSpace): the L^1 direct sum of metric spaces#40212
YaelDillies wants to merge 3 commits into
leanprover-community:masterfrom
YaelDillies:finsupp_metric_space

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies commented Jun 4, 2026

Endow the direct sum ι →₀ X of ι-many copies of a metric space X with the L^1 metric.


It would be similarly easy to use the L^infty metric instead, but L^1 feels more appropriate as the default for the direct sum.

Open in Gitpod

Also fix the variable implicitness and and names of a few existing declarations.

Renames:
* `coe_finsetSum` to `ofNNReal_finsetSum`
* `coe_finsetProd` to `ofNNReal_finsetProd`
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

PR summary ceebb372a9

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.NNReal.Basic 927 940 +13 (+1.40%)
Mathlib.Data.ENNReal.BigOperators 936 949 +13 (+1.39%)
Mathlib.Topology.Algebra.InfiniteSum.ENNReal 1317 1323 +6 (+0.46%)
Import changes for all files
Files Import difference
75 files Mathlib.Algebra.Order.Archimedean.Real.Hom Mathlib.Algebra.Order.Star.Real Mathlib.Algebra.Star.CHSH Mathlib.Analysis.Asymptotics.Defs Mathlib.Analysis.BoxIntegral.Box.Basic Mathlib.Analysis.BoxIntegral.Partition.Basic Mathlib.Analysis.BoxIntegral.Partition.Split Mathlib.Analysis.BoxIntegral.Partition.Tagged Mathlib.Analysis.Calculus.TangentCone.Basic Mathlib.Analysis.Calculus.TangentCone.Defs Mathlib.Analysis.Calculus.TangentCone.Prod Mathlib.Analysis.Complex.Exponential Mathlib.Analysis.Complex.Norm Mathlib.Analysis.Complex.Order Mathlib.Analysis.Complex.Trigonometric Mathlib.Analysis.Normed.Field.Basic Mathlib.Analysis.Normed.Field.TransferInstance Mathlib.Analysis.Normed.Group.AddTorsor Mathlib.Analysis.Normed.Group.Basic Mathlib.Analysis.Normed.Group.Bounded Mathlib.Analysis.Normed.Group.CocompactMap Mathlib.Analysis.Normed.Group.Constructions Mathlib.Analysis.Normed.Group.Continuity Mathlib.Analysis.Normed.Group.Indicator Mathlib.Analysis.Normed.Group.Int Mathlib.Analysis.Normed.Group.Rat Mathlib.Analysis.Normed.Group.Real Mathlib.Analysis.Normed.Group.Subgroup Mathlib.Analysis.Normed.Group.Submodule Mathlib.Analysis.Normed.Module.ENormedSpace Mathlib.Analysis.Normed.Module.MStructure Mathlib.Analysis.Normed.Order.Basic Mathlib.Analysis.Normed.Order.Hom.Basic Mathlib.Analysis.Normed.Order.Hom.Ultra Mathlib.Analysis.Normed.Ring.Basic Mathlib.Analysis.Normed.Ring.Finite Mathlib.Analysis.Normed.Ring.TransferInstance Mathlib.Analysis.Normed.Ring.WithAbs Mathlib.Analysis.NormedSpace.Alternating.Basic Mathlib.Analysis.NormedSpace.Alternating.Curry Mathlib.Analysis.NormedSpace.Alternating.Uncurry.Fin Mathlib.Analysis.NormedSpace.Connected Mathlib.Analysis.NormedSpace.ENormedSpace Mathlib.Analysis.NormedSpace.Extr Mathlib.Analysis.NormedSpace.MStructure Mathlib.Analysis.NormedSpace.Multilinear.Basic Mathlib.Analysis.NormedSpace.Multilinear.Curry Mathlib.Analysis.NormedSpace.Normalize Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm Mathlib.Analysis.NormedSpace.PiTensorProduct.ProjectiveSeminorm Mathlib.Analysis.NormedSpace.RieszLemma Mathlib.Analysis.Rat.NatSqrt.Real Mathlib.Analysis.Real.Sqrt Mathlib.Analysis.SpecialFunctions.Log.ERealExp Mathlib.Analysis.SumOverResidueClass Mathlib.Data.Real.CompleteField Mathlib.InformationTheory.Hamming Mathlib.MeasureTheory.OuterMeasure.AE Mathlib.MeasureTheory.OuterMeasure.Basic Mathlib.MeasureTheory.OuterMeasure.BorelCantelli Mathlib.MeasureTheory.OuterMeasure.Operations Mathlib.Tactic.NormNum.RealSqrt Mathlib.Topology.Algebra.InfiniteSum.ENNReal Mathlib.Topology.Algebra.InfiniteSum.Field Mathlib.Topology.Algebra.InfiniteSum.Real Mathlib.Topology.Compactness.HilbertCubeEmbedding Mathlib.Topology.EMetricSpace.BoundedVariation Mathlib.Topology.Instances.ENNReal.ENatENNReal Mathlib.Topology.Instances.ENNReal.Lemmas Mathlib.Topology.Instances.EReal.Lemmas Mathlib.Topology.Instances.NNReal.Lemmas Mathlib.Topology.MetricSpace.CauSeqFilter Mathlib.Topology.Metrizable.CompletelyMetrizable Mathlib.Topology.Semicontinuity.Basic Mathlib.Topology.Semicontinuity.Lindelof
6
4 files Mathlib.Algebra.Order.Floor.Extended Mathlib.Data.ENNReal.BigOperators Mathlib.Data.NNReal.Basic Mathlib.Topology.Metrizable.Uniformity
13
Mathlib.Topology.MetricSpace.Finsupp (new file) 1116

Declarations diff

+ dist_def
+ edist_def
+ instance [EMetricSpace X] : EMetricSpace (ι →₀ X)
+ instance [MetricSpace X] : MetricSpace (ι →₀ X)
+ instance [PseudoEMetricSpace X] : PseudoEMetricSpace (ι →₀ X)
+ instance [PseudoMetricSpace X] : PseudoMetricSpace (ι →₀ X)
+ nndist_def
+ ofNNReal_finsetProd
+ ofNNReal_finsetSum
+ ofNNReal_finsuppProd
+ ofNNReal_finsuppSum
+ toReal_finsuppProd
+ toReal_finsuppSum

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.


No changes to strong technical debt.
No changes to weak technical debt.

Current commit ceebb372a9
Reference commit e577c1669e

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
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

✅ PR Title Formatted Correctly

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

@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 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.

@ocfnash ocfnash added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 4, 2026
@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-topology Topological spaces, uniform spaces, metric spaces, filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants