feat: add instances of MetricSpace, NormedAddGroup, and NormedAddCommGroup for DirectLimit#39673
feat: add instances of MetricSpace, NormedAddGroup, and NormedAddCommGroup for DirectLimit#39673drocta wants to merge 36 commits into
Conversation
… MetricSpace for a DirectLimit of MetricSpace s
…def by making an argument inferred
… dist_triangle in instance
… eq_of_dist_eq_zero in instance
… proof of eq_of_dist_eq_zero in instance
…rom other instances
…ription and unnecessary arguments x y in rw step
…nstNormedAddCommGroup
… for NormedAddCommGroup as well
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary 47f4c30346Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
…r than between the imports and it
| lemma norm_def (i : ι) (x : G i) : ‖(⟦⟨i, x⟩⟧ : DirectLimit G f)‖ = ‖x‖ := by | ||
| change DirectLimit.lift f (ih := fun i x ↦ ‖x‖) _ ⟦⟨i, x⟩⟧ = ‖x‖ | ||
| apply DirectLimit.lift_def |
There was a problem hiding this comment.
Could you add the nnnorm and enorm lemmas too?
There was a problem hiding this comment.
For nnnorm_def/enorm_def, it looks like NormedGroup does not provide an NNNorm/ENorm instance?
There was a problem hiding this comment.
SeminormedGroup.toNNNorm exists, so I'm not sure I agree.
There was a problem hiding this comment.
Whoops, I assumed that if the instance existed it would already be in the scope of what I already had imported. Silly me. Thanks for the correction.
| namespace NormedAddGroup | ||
|
|
||
| variable [∀ i, NormedAddGroup (G i)] | ||
| variable [∀ i j h, AddMonoidHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance instNormedAddGroup : NormedAddGroup (DirectLimit G f) where |
There was a problem hiding this comment.
Does this also hold for SeminormedAddGroup? Can you to_additive it and use SeminormedGroup?
| variable [∀ i, MetricSpace (G i)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : MetricSpace (DirectLimit G f) where |
There was a problem hiding this comment.
Does this genrealize to PseudoMetricSpace?
There was a problem hiding this comment.
It does, yes. Will do.
There was a problem hiding this comment.
Do you also want the instances for PseudoEMetricSpace and EMetricSpace?
(I believe copy/pasting the code and adding a handful of "e"s before things would make that work. I don't see a way to reduce redundancy by making the (Pseudo)MetricSpace instances use the (Pseudo)EMetricSpace code, or visa versa though. )
There was a problem hiding this comment.
Yes, those would be great too; though perhaps slightly more work.
eric-wieser
left a comment
There was a problem hiding this comment.
I think it should be pretty easy to add the normed ring instances too, assuming they work how I think they do. Could you do that in this PR as well?
Sure, can do, I was planning to make that be in a separate PR, but happy to do it in this one. |
… the instance of MetricSpace, and making the instance of MetricSpace use it.
|
I think this looks good modulo Eric's suggestions. Thanks! |
… PseudoMetricSpace and MetricSpace into section blocks
…well as to_additive versions)
… excess whitespace
…move the separate instance (and namespace) specific to the NormedAddGroup version
…nce for NormedAddCommGroup with section and instance with to_additive of NormedCommGroup
| dist := DirectLimit.lift₂ f f (fun i ↦ dist (α := G i)) | ||
| (fun i j h x y ↦ (IsometryClass.dist_eq (f i j h) x y).symm) |
There was a problem hiding this comment.
I would guess you can drop this line now?
There was a problem hiding this comment.
I can, if I replace the rw [lift₂_def] at h' with rw [dist_def] at h' .
Happy to make that change if preferred.
I had guessed (with low confidence) that it might be preferable to leave the definition of dist more directly exposed by doing it this way, but sounds like the other way around maybe?
There was a problem hiding this comment.
We shouldn't define the distance twice, so please make that change.
| apply DirectLimit.lift_def | ||
|
|
||
| end SeminormedGroup | ||
|
|
There was a problem hiding this comment.
I think you're missing SeminormedCommGroup?
|
|
||
| See also `Metric.InductiveLimit` in `Mathlib/Topology/MetricSpace/Gluing.lean`, which | ||
| handles sequential inductive limits of metric spaces. | ||
| -/ |
There was a problem hiding this comment.
Let's add a remark that for now the only uniform space and bornology available on a DirectLimit are the ones induced through the metric.
| noncomputable instance : PseudoMetricSpace (DirectLimit G f) where | ||
| dist := DirectLimit.lift₂ f f (fun i ↦ dist (α := G i)) | ||
| (fun i j h x y ↦ (IsometryClass.dist_eq (f i j h) x y).symm) | ||
| dist_self := DirectLimit.induction f fun i x ↦ by rw [← dist_self x, lift₂_def] | ||
| dist_comm := DirectLimit.induction₂ f fun i x y ↦ by simp_rw [lift₂_def, dist_comm x y] | ||
| dist_triangle := DirectLimit.induction₃ f fun i x y z ↦ by simp_rw [lift₂_def, dist_triangle] |
There was a problem hiding this comment.
Here you also need toTopologicalSpace := inferInstance, which will no doubt create a headache.
There was a problem hiding this comment.
The test you need to pass (which we should commit) is:
example : (UniformSpace.toTopologicalSpace : TopologicalSpace (DirectLimit G f)) = instTopologicalSpaceQuotient :=
rfl
There was a problem hiding this comment.
Sorry, I'm a bit confused here.
When I try to set toTopologicalSpace := inferInstance in there, it tells me that "toTopologicalSpace is not a field of structure PseudoMetricSpace" .
…f dist from the instance of PseudoMetricSpace instead of redefining it.
…ed.Group.Basic instead of Analysis.Normed.Group.Defs)
…d/Ring/DirectLimit.lean
add files
Topology/MetricSpace/DirectLimit.lean(with an instance ofMetricSpacefor aDirectLimitof a directed system ofMetricSpaces withIsometryClassmap types between them) andAnalysis/Normed/Group/DirectLimit.lean(with instances ofNormedAddGroupandNormedAddCommGrouponDirectLimit)also lemmas
dist_defandnorm_deffor these.This PR is part of a project of adding support for direct limits of$C^*$ -algebras (as I described on Zulip ).
This PR uses
IsometryClassto implement the requirement that the directed systems preserve theNormon theNormedAddGroups, following the advice I got this Zulip thread .Use of AI:
I again used ChatGPT a bit for some advice when writing this (for example, for ideas for simplifying parts of proofs that I suspected could be simpler/shorter, and for advice on which of a couple options would be more idiomatic).
I can personally vouch for all of these contributions, and that I understand this code.