-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: add instances of MetricSpace, NormedAddGroup, and NormedAddCommGroup for DirectLimit #39673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
bcf33a3
b8ce6ff
12f2b05
286d813
fc170d6
98c336a
b0e4bea
8e35650
c243914
24ee6ab
ea02f04
b394832
d0e0b4f
b09c2aa
a5ce1cf
572df6a
4ab90f8
e265879
5e688ed
2d606d8
947769b
12252bf
0d08ac8
579e942
0e28c84
8203924
a74866d
4703329
506ed18
b5ef65e
f54956e
fcbc4e5
40b3149
c6e97a3
a0c8075
47f4c30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /- | ||
| Copyright (c) 2026 Matthew Corbelli. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Matthew Corbelli | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Analysis.Normed.Group.Basic | ||
| public import Mathlib.Algebra.Colimit.DirectLimit | ||
| public import Mathlib.Topology.MetricSpace.DirectLimit | ||
|
|
||
| /-! | ||
| # Direct Limit of normed additive groups | ||
|
|
||
| We introduct instances of `NormedAddGroup` and `NormedAddCommGroup` on `DirectLimit`, | ||
| under the assumption that the types `T h` that the maps in the directed system come from, | ||
| all have instances of `IsometryClass`. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| namespace DirectLimit | ||
|
|
||
| variable {ι : Type*} [Preorder ι] {G : ι → Type*} | ||
| variable {T : ∀ ⦃i j : ι⦄, i ≤ j → Type*} {f : ∀ _ _ h, T h} | ||
| variable [∀ i j (h : i ≤ j), FunLike (T h) (G i) (G j)] [DirectedSystem G (f · · ·)] | ||
| variable [IsDirectedOrder ι] | ||
| variable [Nonempty ι] | ||
|
|
||
| section SeminormedGroup | ||
|
|
||
| variable [∀ i, SeminormedGroup (G i)] | ||
| variable [∀ i j h, MonoidHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| @[to_additive] | ||
| noncomputable instance : SeminormedGroup (DirectLimit G f) where | ||
| norm := DirectLimit.lift f (ih := fun i x ↦ ‖x‖) (fun i j h x ↦ by | ||
| simpa [SeminormedGroup.dist_eq] using (IsometryClass.dist_eq (f i j h) 1 x).symm) | ||
| dist_eq := DirectLimit.induction₂ f (fun i x y ↦ by | ||
| rw [dist_def, SeminormedGroup.dist_eq, inv_def, mul_def, DirectLimit.lift_def]) | ||
|
|
||
| @[to_additive norm_def] | ||
| lemma mul_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 | ||
|
|
||
| @[to_additive nnnorm_def] | ||
| lemma mul_nnnorm_def (i : ι) (x : G i) : ‖(⟦⟨i, x⟩⟧ : DirectLimit G f)‖₊ = ‖x‖₊ := by | ||
| simp_rw [← @norm_toNNReal', mul_norm_def] | ||
|
|
||
| @[to_additive enorm_def] | ||
| lemma mul_enorm_def (i : ι) (x : G i) : ‖(⟦⟨i, x⟩⟧ : DirectLimit G f)‖ₑ = ‖x‖ₑ := by | ||
| rw [@enorm'_eq_iff_norm_eq, mul_norm_def] | ||
|
|
||
| end SeminormedGroup | ||
|
|
||
| section NormedGroup | ||
|
|
||
| variable [∀ i, NormedGroup (G i)] | ||
| variable [∀ i j h, MonoidHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| @[to_additive] | ||
| noncomputable instance : NormedGroup (DirectLimit G f) where | ||
| __ := (inferInstance : SeminormedGroup (DirectLimit G f)) | ||
| __ := (inferInstance : MetricSpace (DirectLimit G f)) | ||
|
|
||
| end NormedGroup | ||
|
|
||
| section SeminormedCommGroup | ||
|
|
||
| variable [∀ i, SeminormedCommGroup (G i)] | ||
| variable [∀ i j h, MonoidHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| @[to_additive] | ||
| noncomputable instance : SeminormedCommGroup (DirectLimit G f) where | ||
| __ := (inferInstance : SeminormedGroup (DirectLimit G f)) | ||
| __ := (inferInstance : CommGroup (DirectLimit G f)) | ||
|
|
||
| end SeminormedCommGroup | ||
|
|
||
| section NormedCommGroup | ||
|
|
||
| variable [∀ i, NormedCommGroup (G i)] | ||
| variable [∀ i j h, MonoidHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| @[to_additive] | ||
| noncomputable instance : NormedCommGroup (DirectLimit G f) where | ||
| __ := (inferInstance : NormedGroup (DirectLimit G f)) | ||
| __ := (inferInstance : CommGroup (DirectLimit G f)) | ||
|
|
||
| end NormedCommGroup | ||
|
|
||
| end DirectLimit | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /- | ||
| Copyright (c) 2026 Matthew Corbelli. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Matthew Corbelli | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Analysis.Normed.Group.DirectLimit | ||
| public import Mathlib.Analysis.Normed.Ring.Basic | ||
| public import Mathlib.Algebra.Colimit.DirectLimit | ||
|
|
||
| /-! | ||
| # Direct Limit of normed rings | ||
|
|
||
| We introduct instances of `NormedRing` and `NonUnitalNormedRing` on `DirectLimit`, | ||
| under the assumption that the types `T h` that the maps in the directed system come from, | ||
| all have instances of `IsometryClass`. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| namespace DirectLimit | ||
|
|
||
| variable {ι : Type*} [Preorder ι] {G : ι → Type*} | ||
| variable {T : ∀ ⦃i j : ι⦄, i ≤ j → Type*} {f : ∀ _ _ h, T h} | ||
| variable [∀ i j (h : i ≤ j), FunLike (T h) (G i) (G j)] [DirectedSystem G (f · · ·)] | ||
| variable [IsDirectedOrder ι] | ||
| variable [Nonempty ι] | ||
|
|
||
| section NonUnitalNormedRing | ||
|
|
||
| variable [∀ i, NonUnitalNormedRing (G i)] | ||
| variable [∀ i j h, NonUnitalRingHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : NonUnitalNormedRing (DirectLimit G f) where | ||
| __ := (inferInstance : NormedAddCommGroup (DirectLimit G f)) | ||
| __ := (inferInstance : NonUnitalRing (DirectLimit G f)) | ||
| norm_mul_le := DirectLimit.induction₂ f | ||
| fun i x y ↦ by simp_rw [mul_def, norm_def]; exact norm_mul_le x y | ||
|
|
||
| end NonUnitalNormedRing | ||
|
|
||
| section NormedRing | ||
|
|
||
| variable [∀ i, NormedRing (G i)] | ||
| variable [∀ i j h, RingHomClass (T h) (G i) (G j)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : NormedRing (DirectLimit G f) where | ||
| __ := (inferInstance : Ring (DirectLimit G f)) | ||
| __ := (inferInstance : NonUnitalNormedRing (DirectLimit G f)) | ||
|
|
||
| end NormedRing | ||
|
|
||
|
|
||
| end DirectLimit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| /- | ||
| Copyright (c) 2026 Matthew Corbelli. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Matthew Corbelli | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Order.DirectedInverseSystem | ||
| public import Mathlib.Topology.MetricSpace.Isometry | ||
|
|
||
| /-! | ||
| # Metrics on direct limits | ||
|
|
||
| This file defines a `MetricSpace` instance on `DirectLimit G f` when `G` and `f` form a directed | ||
| system of metric spaces and the transition maps `f` are isometries (using `IsometryClass`). | ||
|
|
||
| See also `Metric.InductiveLimit` in `Mathlib/Topology/MetricSpace/Gluing.lean`, which | ||
| handles sequential inductive limits of metric spaces. | ||
| -/ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| @[expose] public section | ||
|
|
||
| namespace DirectLimit | ||
|
|
||
| variable {ι : Type*} [Preorder ι] {G : ι → Type*} | ||
| variable {T : ∀ ⦃i j : ι⦄, i ≤ j → Type*} {f : ∀ _ _ h, T h} | ||
| variable [∀ i j (h : i ≤ j), FunLike (T h) (G i) (G j)] [DirectedSystem G (f · · ·)] | ||
| variable [IsDirectedOrder ι] | ||
|
|
||
| section PseudoEMetricSpace | ||
|
|
||
| variable [∀ i, PseudoEMetricSpace (G i)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : PseudoEMetricSpace (DirectLimit G f) where | ||
| edist := DirectLimit.lift₂ f f (fun i ↦ edist (α := G i)) | ||
| (fun i j h x y ↦ (IsometryClass.edist_eq (f i j h) x y).symm) | ||
| edist_self := DirectLimit.induction f fun i x ↦ by rw [← edist_self x, lift₂_def] | ||
| edist_comm := DirectLimit.induction₂ f fun i x y ↦ by simp_rw [lift₂_def, edist_comm x y] | ||
| edist_triangle := DirectLimit.induction₃ f fun i x y z ↦ by simp_rw [lift₂_def, edist_triangle] | ||
|
|
||
| lemma edist_def (i : ι) (x y : G i) : | ||
| edist (α := DirectLimit G f) ⟦⟨i,x⟩⟧ ⟦⟨i,y⟩⟧ = edist x y := by | ||
| change DirectLimit.lift₂ f f _ | ||
| (fun i j h x y ↦ (IsometryClass.edist_eq (f i j h) x y).symm) | ||
| ⟦⟨i, x⟩⟧ ⟦⟨i, y⟩⟧ = edist x y | ||
| rw [lift₂_def] | ||
|
|
||
| end PseudoEMetricSpace | ||
|
|
||
| section EMetricSpace | ||
|
|
||
| variable [∀ i, EMetricSpace (G i)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : EMetricSpace (DirectLimit G f) where | ||
| __ := (inferInstance : PseudoEMetricSpace (DirectLimit G f)) | ||
| eq_of_edist_eq_zero {x y} h := DirectLimit.induction₂ f (fun i x' y' h' ↦ by | ||
| rw [edist_def] at h' | ||
| simp [eq_of_edist_eq_zero h']) x y h | ||
|
|
||
| end EMetricSpace | ||
|
|
||
| section PseudoMetricSpace | ||
|
|
||
| variable [∀ i, PseudoMetricSpace (G i)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| 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] | ||
|
Comment on lines
+68
to
+73
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you also need
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test you need to pass (which we should commit) is:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I'm a bit confused here. |
||
|
|
||
| lemma dist_def (i : ι) (x y : G i) : | ||
| dist (α := DirectLimit G f) ⟦⟨i,x⟩⟧ ⟦⟨i,y⟩⟧ = dist x y := by | ||
| change DirectLimit.lift₂ f f _ | ||
| (fun i j h x y ↦ (IsometryClass.dist_eq (f i j h) x y).symm) | ||
| ⟦⟨i, x⟩⟧ ⟦⟨i, y⟩⟧ = dist x y | ||
| rw [lift₂_def] | ||
|
eric-wieser marked this conversation as resolved.
|
||
|
|
||
| lemma nndist_def (i : ι) (x y : G i) : | ||
| nndist (α := DirectLimit G f) ⟦⟨i,x⟩⟧ ⟦⟨i,y⟩⟧ = nndist x y := by | ||
| simp_rw [nndist_dist, dist_def] | ||
|
|
||
| end PseudoMetricSpace | ||
|
|
||
| section MetricSpace | ||
|
|
||
| variable [∀ i, MetricSpace (G i)] | ||
| variable [∀ i j h, IsometryClass (T h) (G i) (G j)] | ||
|
|
||
| noncomputable instance : MetricSpace (DirectLimit G f) where | ||
| __ := (inferInstance : PseudoMetricSpace (DirectLimit G f)) | ||
| eq_of_dist_eq_zero {x y} h := DirectLimit.induction₂ f (fun i x' y' h' ↦ by | ||
| rw [dist_def] at h' | ||
| simp [eq_of_dist_eq_zero h']) x y h | ||
|
|
||
| end MetricSpace | ||
|
|
||
| end DirectLimit | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing
SeminormedCommGroup?