Skip to content

Commit 07946e8

Browse files
committed
feat: WithVal v and WithVal w are isomorphic as uniform spaces when v and w are equivalent valuations (leanprover-community#30133)
1 parent 51a7cdb commit 07946e8

3 files changed

Lines changed: 101 additions & 0 deletions

File tree

Mathlib/Algebra/Order/Hom/Ring.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ theorem symm_symm (e : α ≃+*o β) : e.symm.symm = e := rfl
388388
theorem symm_bijective : Bijective (OrderRingIso.symm : (α ≃+*o β) → β ≃+*o α) :=
389389
Function.bijective_iff_has_inverse.mpr ⟨_, symm_symm, symm_symm⟩
390390

391+
@[simp]
392+
theorem symm_apply_apply (e : α ≃+*o β) (a : α) : e.symm (e a) = a :=
393+
e.toRingEquiv.symm_apply_apply a
394+
395+
@[simp]
396+
theorem apply_symm_apply (e : α ≃+*o β) (b : β) : e (e.symm b) = b :=
397+
e.toRingEquiv.apply_symm_apply b
398+
391399
/-- Composition of `OrderRingIso`s as an `OrderRingIso`. -/
392400
@[trans]
393401
protected def trans (f : α ≃+*o β) (g : β ≃+*o γ) : α ≃+*o γ :=
@@ -420,6 +428,18 @@ theorem symm_trans_self (e : α ≃+*o β) : e.symm.trans e = OrderRingIso.refl
420428

421429
end LE
422430

431+
section Preorder
432+
433+
variable {R S : Type*} [Mul R] [Add R] [Mul S] [Add S] [Preorder R] [Preorder S]
434+
435+
theorem lt_symm_apply (e : R ≃+*o S) {x : R} {y : S} : x < e.symm y ↔ e x < y := by
436+
simpa using e.toOrderIso.lt_symm_apply
437+
438+
theorem symm_apply_lt (e : R ≃+*o S) {x : R} {y : S} : e.symm y < x ↔ y < e x := by
439+
simpa using e.toOrderIso.symm_apply_lt
440+
441+
end Preorder
442+
423443
section NonAssocSemiring
424444

425445
variable [NonAssocSemiring α] [Preorder α] [NonAssocSemiring β] [Preorder β]

Mathlib/RingTheory/Valuation/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ lemma lt_one_iff_lt_one (h : v₁.IsEquiv v₂) {x : R} :
594594
v₁ x < 1 ↔ v₂ x < 1 := by
595595
rw [← v₁.map_one, h.lt_iff_lt, map_one]
596596

597+
lemma pos_iff (h : v₁.IsEquiv v₂) {x : R} :
598+
0 < v₁ x ↔ 0 < v₂ x := by
599+
rw [zero_lt_iff, zero_lt_iff, h.ne_zero]
600+
597601
end IsEquiv
598602

599603
-- end of namespace

Mathlib/Topology/Algebra/Valued/WithVal.lean

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ instance {P S : Type*} [Ring S] [Semiring P] [Module P R] [Module P S]
8080
[Algebra R S] [IsScalarTower P R S] :
8181
IsScalarTower P (WithVal v) S := inferInstanceAs (IsScalarTower P R S)
8282

83+
instance [Ring R] {Γ₀ : Type*} [LinearOrderedCommGroupWithZero Γ₀]
84+
{v : Valuation R Γ₀} : Preorder (WithVal v) := v.toPreorder
85+
8386
end Instances
8487

8588
section Ring
@@ -94,13 +97,37 @@ def valuation : Valuation (WithVal v) Γ₀ := v.comap (equiv v)
9497

9598
@[simp] lemma valuation_equiv_symm (x : R) : valuation v ((equiv v).symm x) = v x := rfl
9699

100+
variable {Γ'₀ : Type*} [LinearOrderedCommGroupWithZero Γ'₀]
101+
102+
/-- Canonical ring equivalence between `WithVal v` and `WithVal w`. -/
103+
def equivWithVal (v : Valuation R Γ₀) (w : Valuation R Γ'₀) :
104+
WithVal v ≃+* WithVal w :=
105+
(equiv v).trans (equiv w).symm
106+
107+
theorem equivWithVal_symm (v : Valuation R Γ₀) (w : Valuation R Γ'₀) :
108+
(equivWithVal v w).symm = equivWithVal w v := rfl
109+
110+
@[simp]
111+
theorem equivWithVal_apply (v : Valuation R Γ₀) (w : Valuation R Γ'₀) {x : WithVal v} :
112+
equivWithVal v w x = (equiv w).symm (equiv v x) := rfl
113+
114+
@[simp]
115+
theorem equivWithVal_symm_apply (v : Valuation R Γ₀) (w : Valuation R Γ'₀) {x : WithVal w} :
116+
(equivWithVal v w).symm x = (equiv v).symm (equiv w x) := rfl
117+
97118
instance {R} [Ring R] (v : Valuation R Γ₀) : Valued (WithVal v) Γ₀ :=
98119
Valued.mk' (valuation v)
99120

100121
theorem apply_equiv (r : WithVal v) : v (equiv v r) = Valued.v r := rfl
101122

102123
@[simp] theorem apply_symm_equiv (r : R) : Valued.v ((equiv v).symm r) = v r := rfl
103124

125+
theorem le_def {v : Valuation R Γ₀} {a b : WithVal v} :
126+
a ≤ b ↔ v (equiv v a) ≤ v (equiv v b) := .rfl
127+
128+
theorem lt_def {v : Valuation R Γ₀} {a b : WithVal v} :
129+
a < b ↔ v (equiv v a) < v (equiv v b) := .rfl
130+
104131
end Ring
105132

106133
section CommRing
@@ -128,6 +155,56 @@ abbrev Completion := UniformSpace.Completion (WithVal v)
128155
instance : Coe R v.Completion :=
129156
inferInstanceAs <| Coe (WithVal v) (UniformSpace.Completion (WithVal v))
130157

158+
section Equivalence
159+
160+
/-! The uniform isomorphism between `WithVal v` and `WithVal w` when `v` and `w` are
161+
equivalent. -/
162+
163+
variable {R Γ₀ Γ₀' : Type*} [Ring R] [LinearOrderedCommGroupWithZero Γ₀]
164+
[LinearOrderedCommGroupWithZero Γ₀'] {v : Valuation R Γ₀} {w : Valuation R Γ₀'}
165+
166+
/-- If two valuations `v` and `w` are equivalent then `WithVal v` is order-isomorphic
167+
to `WithVal w`. -/
168+
def IsEquiv.orderRingIso (h : v.IsEquiv w) :
169+
WithVal v ≃+*o WithVal w where
170+
__ := equivWithVal v w
171+
map_le_map_iff' := h.symm ..
172+
173+
@[simp]
174+
theorem IsEquiv.orderRingIso_apply (h : v.IsEquiv w) (x : WithVal v) :
175+
h.orderRingIso x = (equivWithVal v w) x := rfl
176+
177+
@[simp]
178+
theorem IsEquiv.orderRingIso_symm_apply (h : v.IsEquiv w) (x : WithVal w) :
179+
h.orderRingIso.symm x = (equivWithVal v w).symm x := rfl
180+
181+
-- TODO: remove hw when we have range bases for Valued's ValuativeRel #27314
182+
theorem IsEquiv.uniformContinuous_equivWithVal
183+
(hw : ∀ γ : Γ₀'ˣ, ∃ r s, 0 < w r ∧ 0 < w s ∧ w r / w s = γ) (h : v.IsEquiv w) :
184+
UniformContinuous (equivWithVal v w) := by
185+
refine uniformContinuous_of_continuousAt_zero _ ?_
186+
rw [ContinuousAt, map_zero, (Valued.hasBasis_nhds_zero _ _).tendsto_iff
187+
(Valued.hasBasis_nhds_zero _ _)]
188+
intro γ _
189+
obtain ⟨r, s, hr₀, hs₀, hr⟩ := hw γ
190+
use .mk0 (v r / v s) (by simp [h.ne_zero, hr₀.ne.symm, hs₀.ne.symm]), trivial, fun x hx ↦ ?_
191+
rw [← hr, Set.mem_setOf_eq, ← WithVal.apply_equiv, ← (equiv w).apply_symm_apply r,
192+
lt_div_iff₀ hs₀, ← (equiv w).apply_symm_apply s, ← map_mul, ← map_mul, ← lt_def,
193+
← h.orderRingIso_apply, ← h.orderRingIso.apply_symm_apply ((equiv w).symm s), ← map_mul,
194+
← h.orderRingIso.lt_symm_apply]
195+
simpa [lt_def, lt_div_iff₀ (h.pos_iff.2 hs₀)] using hx
196+
197+
/-- If two valuations `v` and `w` are equivalent then `WithVal v` and `WithVal w` are
198+
isomorphic as uniform spaces. -/
199+
def IsEquiv.uniformEquiv (hv : ∀ γ : Γ₀ˣ, ∃ r s, 0 < v r ∧ 0 < v s ∧ v r / v s = γ)
200+
(hw : ∀ γ : Γ₀'ˣ, ∃ r s, 0 < w r ∧ 0 < w s ∧ w r / w s = γ)
201+
(h : v.IsEquiv w) : WithVal v ≃ᵤ WithVal w where
202+
__ := equivWithVal v w
203+
uniformContinuous_toFun := h.uniformContinuous_equivWithVal hw
204+
uniformContinuous_invFun := h.symm.uniformContinuous_equivWithVal hv
205+
206+
end Equivalence
207+
131208
end Valuation
132209

133210
namespace NumberField.RingOfIntegers

0 commit comments

Comments
 (0)