@@ -17,50 +17,103 @@ to facilitate a refactor.
1717
1818-/
1919
20- namespace ValuativeRel
20+ namespace IsValuativeTopology
2121
22- variable {R : Type *} [CommRing R]
22+ section
2323
24- instance [UniformSpace R] [IsUniformAddGroup R] [ValuativeRel R] [IsValuativeTopology R] :
25- Valued R (ValueGroupWithZero R) :=
26- .mk (valuation R) IsValuativeTopology.mem_nhds_iff
24+ /-! # Alternate constructors -/
2725
28- end ValuativeRel
26+ variable {R : Type *} [CommRing R] [ ValuativeRel R] [TopologicalSpace R]
2927
30- namespace IsValuativeTopology
28+ open ValuativeRel TopologicalSpace Filter Topology Set
29+
30+ local notation "v" => valuation R
31+
32+ /-- Assuming `ContinuousConstVAdd R R`, we only need to check the neighbourhood of `0` in order to
33+ prove `IsValuativeTopology R`. -/
34+ theorem of_zero [ContinuousConstVAdd R R]
35+ (h₀ : ∀ s : Set R, s ∈ 𝓝 0 ↔ ∃ γ : (ValueGroupWithZero R)ˣ, { z | v z < γ } ⊆ s) :
36+ IsValuativeTopology R where
37+ mem_nhds_iff {s x} := by
38+ simpa [← vadd_mem_nhds_vadd_iff (t := s) (-x), ← image_vadd, ← image_subset_iff] using
39+ h₀ ((x + ·) ⁻¹' s)
40+
41+ end
3142
3243variable {R : Type *} [CommRing R] [ValuativeRel R] [TopologicalSpace R] [IsValuativeTopology R]
3344
3445open ValuativeRel TopologicalSpace Filter Topology Set
3546
3647local notation "v" => valuation R
3748
49+ /-- A version mentioning subtraction. -/
50+ lemma mem_nhds_iff' {s : Set R} {x : R} :
51+ s ∈ 𝓝 (x : R) ↔
52+ ∃ γ : (ValueGroupWithZero R)ˣ, { z | v (z - x) < γ } ⊆ s := by
53+ convert mem_nhds_iff (s := s) using 4
54+ ext z
55+ simp [neg_add_eq_sub]
56+
57+ @ [deprecated (since := "2025-08-01" )]
58+ alias _root_.ValuativeTopology.mem_nhds := mem_nhds_iff'
59+
60+ lemma mem_nhds_zero_iff (s : Set R) : s ∈ 𝓝 (0 : R) ↔
61+ ∃ γ : (ValueGroupWithZero R)ˣ, { x | v x < γ } ⊆ s := by
62+ convert IsValuativeTopology.mem_nhds_iff' (x := (0 : R))
63+ rw [sub_zero]
64+
65+ @ [deprecated (since := "2025-08-04" )]
66+ alias _root_.ValuativeTopology.mem_nhds_iff := mem_nhds_zero_iff
67+
68+ /-- Helper `Valued` instance when `ValuativeTopology R` over a `UniformSpace R`,
69+ for use in porting files from `Valued` to `ValuativeRel`. -/
70+ instance (priority := low) {R : Type *} [CommRing R] [ValuativeRel R] [UniformSpace R]
71+ [IsUniformAddGroup R] [IsValuativeTopology R] :
72+ Valued R (ValueGroupWithZero R) where
73+ «v » := valuation R
74+ is_topological_valuation := mem_nhds_zero_iff
75+
76+ theorem hasBasis_nhds (x : R) :
77+ (𝓝 x).HasBasis (fun _ => True)
78+ fun γ : (ValueGroupWithZero R)ˣ => { z | v (z - x) < γ } := by
79+ simp [Filter.hasBasis_iff, mem_nhds_iff']
80+
3881variable (R) in
3982theorem hasBasis_nhds_zero :
4083 (𝓝 (0 : R)).HasBasis (fun _ => True)
4184 fun γ : (ValueGroupWithZero R)ˣ => { x | v x < γ } := by
42- simp [Filter.hasBasis_iff, mem_nhds_iff ]
85+ convert hasBasis_nhds ( 0 : R); rw [sub_zero ]
4386
4487@ [deprecated (since := "2025-08-01" )]
4588alias _root_.ValuativeTopology.hasBasis_nhds_zero := hasBasis_nhds_zero
4689
47- variable [IsTopologicalAddGroup R]
48-
49- theorem mem_nhds {s : Set R} {x : R} :
50- s ∈ 𝓝 x ↔ ∃ γ : (ValueGroupWithZero R)ˣ, { y | v (y - x) < γ } ⊆ s := by
51- simp only [← nhds_translation_add_neg x, ← sub_eq_add_neg, preimage_setOf_eq, true_and,
52- ((hasBasis_nhds_zero R).comap fun y => y - x).mem_iff]
53-
54- @ [deprecated (since := "2025-08-01" )]
55- alias _root_.ValuativeTopology.mem_nhds := mem_nhds
90+ variable (R) in
91+ instance (priority := low) isTopologicalAddGroup : IsTopologicalAddGroup R := by
92+ have cts_add : ContinuousConstVAdd R R :=
93+ ⟨fun x ↦ continuous_iff_continuousAt.2 fun z ↦
94+ ((hasBasis_nhds z).tendsto_iff (hasBasis_nhds (x + z))).2 fun γ _ ↦
95+ ⟨γ, trivial, fun y hy ↦ by simpa using hy⟩⟩
96+ have basis := hasBasis_nhds_zero R
97+ refine .of_comm_of_nhds_zero ?_ ?_ fun x₀ ↦ (map_eq_of_inverse (-x₀ + ·) ?_ ?_ ?_).symm
98+ · exact (basis.prod_self.tendsto_iff basis).2 fun γ _ ↦
99+ ⟨γ, trivial, fun ⟨_, _⟩ hx ↦ (v).map_add_lt hx.left hx.right⟩
100+ · exact (basis.tendsto_iff basis).2 fun γ _ ↦ ⟨γ, trivial, fun y hy ↦ by simpa using hy⟩
101+ · ext; simp
102+ · simpa [ContinuousAt] using (cts_add.1 x₀).continuousAt (x := (0 : R))
103+ · simpa [ContinuousAt] using (cts_add.1 (-x₀)).continuousAt (x := x₀)
104+
105+ instance (priority := low) : IsTopologicalRing R :=
106+ letI := IsTopologicalAddGroup.toUniformSpace R
107+ letI := isUniformAddGroup_of_addCommGroup (G := R)
108+ inferInstance
56109
57110theorem isOpen_ball (r : ValueGroupWithZero R) :
58111 IsOpen {x | v x < r} := by
59112 rw [isOpen_iff_mem_nhds]
60113 rcases eq_or_ne r 0 with rfl | hr
61114 · simp
62115 · intro x hx
63- rw [mem_nhds ]
116+ rw [mem_nhds_iff' ]
64117 simp only [setOf_subset_setOf]
65118 exact ⟨Units.mk0 _ hr,
66119 fun y hy => (sub_add_cancel y x).symm ▸ ((v).map_add _ x).trans_lt (max_lt hy hx)⟩
@@ -89,7 +142,7 @@ lemma isOpen_closedBall {r : ValueGroupWithZero R} (hr : r ≠ 0) :
89142 IsOpen {x | v x ≤ r} := by
90143 rw [isOpen_iff_mem_nhds]
91144 intro x hx
92- rw [mem_nhds ]
145+ rw [mem_nhds_iff' ]
93146 simp only [setOf_subset_setOf]
94147 exact ⟨Units.mk0 _ hr, fun y hy => (sub_add_cancel y x).symm ▸
95148 le_trans ((v).map_add _ _) (max_le (le_of_lt hy) hx)⟩
@@ -102,7 +155,7 @@ theorem isClosed_closedBall (r : ValueGroupWithZero R) :
102155 rw [← isOpen_compl_iff, isOpen_iff_mem_nhds]
103156 intro x hx
104157 simp only [mem_compl_iff, mem_setOf_eq, not_le] at hx
105- rw [mem_nhds ]
158+ rw [mem_nhds_iff' ]
106159 have hx' : v x ≠ 0 := ne_of_gt <| lt_of_le_of_lt zero_le' <| hx
107160 exact ⟨Units.mk0 _ hx', fun y hy hy' => ne_of_lt hy <| Valuation.map_sub_swap v x y ▸
108161 (Valuation.map_sub_eq_of_lt_left _ <| lt_of_le_of_lt hy' hx)⟩
@@ -137,19 +190,6 @@ alias _root_.ValuativeTopology.isOpen_sphere := isOpen_sphere
137190
138191end IsValuativeTopology
139192
140- namespace Valued
141-
142- variable {R : Type *} [CommRing R] [ValuativeRel R] [UniformSpace R]
143- [IsUniformAddGroup R] [IsValuativeTopology R]
144-
145- /-- Helper `Valued` instance when `ValuativeTopology R` over a `UniformSpace R`,
146- for use in porting files from `Valued` to `ValuativeRel`. -/
147- scoped instance : Valued R (ValuativeRel.ValueGroupWithZero R) where
148- v := ValuativeRel.valuation R
149- is_topological_valuation := IsValuativeTopology.mem_nhds_iff
150-
151- end Valued
152-
153193namespace ValuativeRel
154194
155195@[inherit_doc]
0 commit comments