#38039 chore(Topology): UniformSpace.Completion renames for morphisms
In plain words
Renames the API for extending maps to the Hausdorff completion UniformSpace.Completion. The functions Completion.extension f : Completion α → β and Completion.map f : Completion α → Completion β become UniformSpace.Function.fromCompletion f and UniformSpace.Function.completion f. Bundled versions follow the pattern FooHom.fromCompletion / FooHom.completion: AddMonoidHom.extension → AddMonoidHom.fromCompletion, NormedAddGroupHom.extension → fromCompletion, Completion.coeRingHom / extensionHom / mapRingHom / mapRingEquiv → UniformSpace.RingHom.toCompletion / RingHom.fromCompletion / RingHom.completion / UniformSpace.RingEquiv.completion, and Completion.mapEquiv → UniformEquiv.completion. The lemmas LipschitzWith/Isometry.completion_extension/completion_map become .fromCompletion/.completion, and Isometry.extensionHom/mapRingHom become ringHomFromCompletion/ringHomCompletion. Every old name stays as a deprecated alias. No mathematical content changes.
Transcriptions are drafted with an LLM from the diff and are a reading aid, not a verified statement: the Lean code is the reference.
PR description
This PR renames the following UniformSpace.Completion morphisms.
The UniformSpace namespace remains for ring morphisms and functions so that we're clear which completion we're talking about. For isometries, UniformEquivs, NormedAddGroupHoms, there's no need for the UniformSpace namespace.
For the isometry definitions, we used Isometry.ringHom{FromCompletion, Completion} instead of RingHom.Isometry.{fromCompletion, completion} so that it won't clash with the function versions (Isometry.{fromCompletion, completion}).
RingHom
- ☐
UniformSpace.Completion.mapRingHom->UniformSpace.RingHom.toCompletion - ☐
UniformSpace.Completion.extensionHom->UniformSpace.RingHom.fromCompletion
RingEquiv
- ☐
UniformSpace.Completion.mapRingEquiv->UniformSpace.RingEquiv.completion
NormedAddGroupHom
- ☐
NormedAddGroupHom.extension->NormedAddGroupHom.fromCompletion
RingHom isometries
- ☐
Isometry.extensionHom->Isometry.ringHomFromCompletion - ☐
Isometry.mapRingHom->Isometry.ringHomCompletion
isometries
- ☐
Isometry.completion_extension->Isometry.fromCompletion - ☐
Isometry.completion_map->Isometry.completion
Functions
- ☐
UniformSpace.Completion.extension->UniformSpace.Function.fromCompletion - ☐
UniformSpace.Completion.map->UniformSpace.Function.completion
UniformEquiv
- ☐
UniformSpace.Completion.mapEquiv->UniformEquiv.completion
See Zulip thread: #mathlib4 > naming convention: undefined morphisms
Conversation on GitHub 12
PR summary c01d21828d
Import changes for modified files
No significant changes to the import graph
<details><summary>Import changes for all files</summary>
|Files|Import difference| |-|-|
</details>
<details><summary>
Declarations diff (regex)
</summary>
+ AddMonoidHom.continuous_fromCompletion
+ AddMonoidHom.fromCompletion
+ AddMonoidHom.fromCompletion_coe
+ Completion.continuous_extension
+ Completion.continuous_map
+ Completion.extension
+ Completion.extension_coe
+ Completion.extension_comp_coe
+ Completion.extension_map
+ Completion.extension_unique
+ Completion.inseparable_extension_coe
+ Completion.isUniformInducing_extension
+ Completion.map
+ Completion.mapEquiv
+ Completion.mapEquiv_coe
+ Completion.mapEquiv_symm
+ Completion.map_coe
+ Completion.map_comp
+ Completion.map_id
+ Completion.map_unique
+ Completion.uniformContinuous_extension
+ Completion.uniformContinuous_map
+ Function.completion
+ Function.completion_coe
+ Function.completion_comp_completion
+ Function.completion_id
+ Function.completion_unique
+ Function.continuous_completion
+ Function.continuous_fromCompletion
+ Function.fromCompletion
+ Function.fromCompletion_coe
+ Function.fromCompletion_comp_coe
+ Function.fromCompletion_comp_completion
+ Function.fromCompletion_unique
+ Function.inseparable_fromCompletion_coe
+ Function.isUniformInducing_fromCompletion
+ Function.uniformContinuous_completion
+ Function.uniformContinuous_fromCompletion
+ Isometry.completion
+ Isometry.fromCompletion
+ Isometry.ringHomCompletion
+ Isometry.ringHomCompletion_coe
+ Isometry.ringHomCompletion_isometry
+ Isometry.ringHomFromCompletion
+ Isometry.ringHomFromCompletion_coe
+ LipschitzWith.completion
+ LipschitzWith.fromCompletion
+ NormedAddGroupHom.fromCompletion
+ NormedAddGroupHom.fromCompletion_coe
+ NormedAddGroupHom.fromCompletion_coe_to_fun
+ NormedAddGroupHom.fromCompletion_def
+ NormedAddGroupHom.fromCompletion_unique
+ _root_.UniformEquiv.completion
+ _root_.UniformEquiv.completion_coe
+ _root_.UniformEquiv.symm_completion
+ _root_.UniformSpace.RingEquiv.completion
+ _root_.UniformSpace.RingHom.coe_completion
+ _root_.UniformSpace.RingHom.completion
+ _root_.UniformSpace.RingHom.completion_apply
+ _root_.UniformSpace.RingHom.completion_coe
+ _root_.UniformSpace.RingHom.completion_comp
+ _root_.UniformSpace.RingHom.completion_id
+ _root_.UniformSpace.RingHom.continuous_toCompletion
+ _root_.UniformSpace.RingHom.fromCompletion
+ _root_.UniformSpace.RingHom.fromCompletion_coe
+ _root_.UniformSpace.RingHom.toCompletion
+ mapRingEquiv_apply
+ mapRingEquiv_symm_apply
- continuous_extension
- continuous_map
- extension
- extension_coe
- extension_comp_coe
- extension_map
- extension_unique
- inseparable_extension_coe
- isUniformInducing_extension
- map
- mapEquiv
- mapEquiv_coe
- mapEquiv_symm
- map_coe
- map_comp
- map_id
- map_unique
- uniformContinuous_extension
- uniformContinuous_map
<details>
<summary>You can run this locally as follows</summary>
## 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>
</details>
The doc-module for scripts/pr_summary/declarations_diff.sh in the undefined repository contains some details about this script.
</details>
Declarations diff (Lean -- pending)
Computed after the build finishes.
<details><summary>Decrease in strong tech debt: (relative, absolute) = (1.00, 0.00)</summary>
|Current number|Change|Type (strong)| |-:|:-:|:-| |6982|-1|backward.isDefEq.respectTransparency| </details> No changes to weak technical debt.
Current commit c01d21828d Reference commit 89e65db458
This script lives in the undefined 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
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
I'm thinking of renaming this again to Isometry.functionFromCompletion and the RingHom version to Isometry.ringHomFromCompletion (same for .completion). This is because if you open Function and RingHom, Lean would get confused which one you want.
This is pretty straightforward, if a bit long. However, there are a few things I think are missing:
- It's not clear why some things end up in the
UniformSpacenamespace and others don't. This needs to be explained (or decided upon, if it wasn't already). - The explanations should be added to the docstrings of
UniformSpace.Function.completionandextensionandcoe. It should say some thing like:
when creating bundled morphisms with this as the underlying function, the name given should be ...
- Not for this PR, but this specialized naming convention should be documented on the website.
It's not clear why some things end up in the UniformSpace namespace and others don't. This needs to be explained (or decided upon, if it wasn't already).
Pretty much the only ones that got the UniformSpace namespace are bare functions and ring morphisms. Just in case people ask "what completion?"
The rest should be clear, I think, so don't need the namespace?
(added explanation to PR description and in the docstrings)
This pull request has conflicts, please merge master and resolve them.
This pull request has conflicts, please merge master and resolve them.
This pull request has conflicts, please merge master and resolve them.
This pull request has conflicts, please merge master and resolve them.
I was very confused about the RingHom situation, and why there were two different things floating around. Here's what I think: Isometry.extensionHom and Isometry.mapRingHom just need to die (i.e., get deprecated) instead of being renamed. I don't think these are currently adding any value whatsoever because they are the same things as the non-isometry variants, but with more stringent hypotheses. Of course, we could then keep Isometry.isometry_mapRingHom but change the statement to be about UniformSpace.Completion.extensionHom instead.
In fact, I just did this myself: #42634
Pretty much the only ones that got the
UniformSpacenamespace are bare functions and ring morphisms. Just in case people ask "what completion?" The rest should be clear, I think, so don't need the namespace?
I think I would likely prefer consistency to a mishmash, and so I would recommend namespacing everything inside UniformSpace. When working with UniformSpace.Completion it is natural to open UniformSpace anyway, so this shouldn't be a tremendous burden.
(but as I indicated before, this is probably better decided on Zulip)
This pull request has conflicts, please merge master and resolve them.
@themathqueen #42634 has been merged, so whenever you get around to merging master and fixing this up, ping me.
Mathlib/Analysis/InnerProductSpace/Completion.lean +2 −2
section UniformSpace.CompletionMathlib/Analysis/Normed/Field/WithAbs.lean +1 −1
Mathlib/Analysis/Normed/Group/Completion.lean +3 −3
namespace CompletionMathlib/Analysis/Normed/Group/HomCompletion.lean +36 −20
variable {G : Type*} [SeminormedAddCommGroup G] {H : Type*} [SeminormedAddCommGrdef normedAddGroupHomCompletionHom :variable {H : Type*} [SeminormedAddCommGroup H] [T0Space H] [CompleteSpace H]Mathlib/Analysis/Normed/Group/SemiNormedGrp/Completion.lean +5 −5
universal property of the completion. -/Mathlib/NumberTheory/NumberField/Completion/FinitePlace.lean +1 −1
variable {K : Type*} [Field K] {R : Type*} [CommRing R] [Algebra R K] [IsDedekinMathlib/NumberTheory/NumberField/Completion/InfinitePlace.lean +9 −7
example : IsTopologicalRing v.Completion := inferInstanceinstance locallyCompactSpace : LocallyCompactSpace (v.Completion) :=namespace Completiontheorem liesOver_extensionEmbedding [ContinuousSMul v.Completion w.Completion]Mathlib/NumberTheory/NumberField/Completion/LiesOverInstances.lean +3 −3
variable [w.LiesOver v]Mathlib/NumberTheory/Padics/Complex.lean +1 −1
theorem isNonarchimedean : IsNonarchimedean (Norm.norm : ℂ_[p] → ℝ) :=Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean +5 −5
equivalent. It is best to do this after `Valued` has been refactored, or at leasnoncomputable def withValEquiv (v : HeightOneSpectrum R) :noncomputable def adicCompletionIntegers.padicIntEquiv (v : HeightOneSpectrum R)Mathlib/NumberTheory/Padics/WithVal.lean +8 −8
the `p`-adic valuation. -/open UniformSpace.Completion inMathlib/RingTheory/DedekindDomain/AdicValuation.lean +3 −3
open UniformSpace innoncomputable instance instAlgebraCompletion : Algebra S ((v.valuation K).Completheorem algebraMap_adicCompletion_toCompletion (r : S) :Mathlib/RingTheory/LaurentSeries.lean +1 −1
theorem LaurentSeries_coe (x : K⟮X⟯) :Mathlib/Topology/Algebra/GroupCompletion.lean +39 −28
instance [Zero α] : Zero (Completion α) :=section IsUniformAddGroupinstance : AddMonoid (Completion α) wherevariable [UniformSpace α] [AddGroup α] [IsUniformAddGroup α] [UniformSpace βMathlib/Topology/Algebra/LinearMapCompletion.lean +4 −4
noncomputable def completion (f : α →SL[σ] β) : Completion α →SL[σ] ComMathlib/Topology/Algebra/UniformMulAction.lean +14 −12
variable [SMul M X]Mathlib/Topology/Algebra/UniformRing.lean +70 −37
noncomputable sectioninstance one : One (Completion α) :=instance ring : Ring (Completion α) :=variable (A : Type*) [Ring A] [UniformSpace A] [IsUniformAddGroup A] [IsTopologinoncomputable def IsDenseInducing.extendRingHom {i : α →+* β} {f : α →+*Mathlib/Topology/Algebra/Valued/ValuedField.lean +1 −1
theorem continuous_extension : Continuous (Valued.extension : hat K → _) := byMathlib/Topology/Algebra/Valued/WithVal.lean +2 −2
theorem restrict_exists_div_eq {K : Type*} [DivisionRing K] {Γ₀ : Type*}Mathlib/Topology/Category/UniformSpace.lean +8 −8
set_option backward.isDefEq.respectTransparency.types false intheorem completionHom_val (X : UniformSpaceCat) (x) : (completionHom X) x = (x :noncomputable def adj : completionFunctor ⊣ forget₂ CpltSepUniformSpace UnifMathlib/Topology/MetricSpace/Completion.lean +53 −28
end UniformSpace.Completionnote that I've golfed this to a one-liner (see line 250)
I could name this Isometry.isometry_ringHomCompletion (I'd usually opt for prefixing names) but it sounds a bit weird.
Mathlib/Topology/UniformSpace/Completion.lean +117 −51
theorem ext' {Y : Type*} [TopologicalSpace Y] [T2Space Y] {f g : Completion α