Skip to content

feat(Analysis/Normed/ValuativeRel): helper instance for NormedField#26827

Open
pechersky wants to merge 32 commits intoleanprover-community:masterfrom
pechersky:valuative-normed
Open

feat(Analysis/Normed/ValuativeRel): helper instance for NormedField#26827
pechersky wants to merge 32 commits intoleanprover-community:masterfrom
pechersky:valuative-normed

Conversation

@pechersky
Copy link
Copy Markdown
Contributor

@pechersky pechersky commented Jul 6, 2025

@pechersky pechersky added t-number-theory Number theory (also use t-algebra or t-analysis to specialize) t-analysis Analysis (normed *, calculus) t-algebra Algebra (groups, rings, fields, etc) labels Jul 6, 2025
@github-actions github-actions bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 6, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 6, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 6, 2025

PR summary 586e9c3862

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.NumberTheory.LocalField.Basic Mathlib.Topology.Algebra.Valued.ValuativeRel 1
Mathlib.Analysis.Normed.ValuativeRel (new file) 1868

Declarations diff

+ hasBasis_uniformity
+ instance (priority := low) :
+ instance (priority := low) : IsTopologicalRing R := by
+ instance (priority := low) : IsUltraUniformity R' := by
+ isSymmetricRel_uniformity_ball_le
+ isSymmetricRel_uniformity_ball_lt
+ isTransitiveRel_uniformity_ball_le
+ isTransitiveRel_uniformity_ball_lt
+ norm_pos_posSubmonoid
+ of_hasBasis_zero
+ rel_iff_le
+ toValuativeRel
+ uniformity_ball_le_mem_uniformity
+ uniformity_ball_lt_mem_uniformity
+ valuation'
+ valuation'_apply
- instance (priority := low) : IsTopologicalRing R
- instance (priority := low) {R : Type*} [CommRing R] [ValuativeRel R] [UniformSpace R]

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 6, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 7, 2025
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

Comment on lines +56 to +59
lemma of_hasBasis (h : (𝓝 (0 : R)).HasBasis (fun _ ↦ True)
fun γ : (ValueGroupWithZero R)ˣ ↦ { x | v x < γ }) :
ValuativeTopology R :=
⟨by simp [h.mem_iff]⟩
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this (and possibly a bunch of other things) be done for any compatible valuation? In fact, would it be interesting to change the definition of the topology to not refer to the canonical valuation, by replacing the balls {x | v x < r} with {x | u * x ≤ᵥ y} where y is in R and u in posSubmonoid r? This way it's clear that the topology is still determined by any compatible valuation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamtopaz what do you think of such a redefinition of the class? I can show an iff in the meantime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's not an iff, because u * x ≤ᵥ y means v u * v x ≤ v y, while the topology has a strict inequality.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I meant the strict inequality (so the negation of the converse). That should work right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way it's clear that the topology is still determined by any compatible valuation.

I think that "compatibility" here has to be very powerful. Because on its own, I could have a valuation that maps to Zm0, and another that maps into Zm0 x Zm0 where the first component is always 1. Then something like (-1, 1) is a unit, but everything in the nonzero range of my valuation is greater than that. So this new valuation induces a discrete topology, because there the ideal less than the unit is the {0}.

Here it is formalized:

import Mathlib

open WithZero LinearOrderedCommGroupWithZero

variable {R : Type*} [CommRing R] (v : Valuation R ℤᵐ⁰)

def other : Valuation R (WithZero (ℤᵐ⁰ˣ ×ₗ ℤᵐ⁰ˣ)) where
  toMonoidWithZeroHom := (inr _ _).toMonoidWithZeroHom.comp v.toMonoidWithZeroHom
  map_add_le_max' := by
    intro x y
    simpa using ((inr ℤᵐ⁰ _).monotone' (v.map_add_le_max' x y))

lemma other_apply {x : R} (hx : v x ≠ 0) :
    other v x = WithZero.coe (toLex (1, Units.mk0 (v x) hx)) := by
  -- simp lemmas get in the way
  change (inr _ _) (v x) = _
  simp [inr_eq_coe_inrₗ hx]

lemma isEquiv : v.IsEquiv (other v) := by
  intro r s
  by_cases hr : v r = 0
  · simp [hr, other]
  by_cases hs : v s = 0
  · simp [hs, other]
  simp [other_apply v hr, other_apply v hs, Prod.Lex.toLex_le_toLex, ← Units.val_le_val]

lemma problem :
    ∃ (r : (WithZero (ℤᵐ⁰ˣ ×ₗ ℤᵐ⁰ˣ))ˣ), ∀ x : R, other v x < r → v x = 0 := by
  let r := OrderMonoidHom.inlₗ ℤᵐ⁰ˣ ℤᵐ⁰ˣ
    (OrderMonoidIso.unitsWithZero.symm (Multiplicative.ofAdd (-1)))
  use OrderMonoidIso.unitsWithZero.symm r
  intro x
  contrapose!
  intro hx
  rw [other_apply v hx]
  simp [r, Prod.Lex.toLex_le_toLex, ← Units.val_lt_val, ← Multiplicative.toAdd_lt]

Copy link
Copy Markdown
Member

@ADedecker ADedecker Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the usual codomain issue right? By "the topology is determined by any compatible valuation", I indeed meant that you would only take radii in the nonzero range of the valuation.

My reasoning behind this proposal is that, I assumed, there will be cases where there's one convenient valuation at hand to study the topology (e.g the one coming from the Haar measure for local fields, or the p-adic one on p-adics, etc...), and it would be a pain to always have to translate back to the "canonical" valuation associated to the ValuativeRel. But I'm no number theorist, so I may well be completely wrong about the way you think about this.

Copy link
Copy Markdown
Contributor

@adamtopaz adamtopaz Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of ValuativeRel is to avoid having to keep around another type for the codomain of the valuation. IMO, ValuativeTopology should only involve the underlying type of the ring itself, so I don't think we should define it in terms of some arbitrary compatible valuation. If you want to define a $$&lt;_v$$ in terms of $$\le_v$$ and use that to define ValuativeTopology, then that's something I would support.

I understand that in practice there would be rings which obtain a topology from some seminorm, but I think in such cases ValuativeRel would also be defined in terms of the seminorm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, nothing should be defined in terms of an arbitrary valuation. My point is that we should be able to study the topology by means of any preferred valuation which is compatible.

@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 4, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 4, 2025
Comment on lines +26 to +44
lemma isSymmetricRel_uniformity_ball_lt (r : Γ₀) :
IsSymmetricRel { p : R × R | v (p.2 - p.1) < r } := by
simp [IsSymmetricRel, Valuation.map_sub_swap]

lemma isSymmetricRel_uniformity_ball_le (r : Γ₀) :
IsSymmetricRel { p : R × R | v (p.2 - p.1) ≤ r } := by
simp [IsSymmetricRel, Valuation.map_sub_swap]

lemma isTransitiveRel_uniformity_ball_lt (r : Γ₀) :
IsTransitiveRel { p : R × R | v (p.2 - p.1) < r } := by
intro _ _ _ h h'
refine (Valuation.map_add_lt v h h').trans_eq' ?_
simp

lemma isTransitiveRel_uniformity_ball_le (r : Γ₀) :
IsTransitiveRel { p : R × R | v (p.2 - p.1) ≤ r } := by
intro _ _ _ h h'
refine (Valuation.map_add_le v h h').trans_eq' ?_
simp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be separate definitions (and not abbrev, very importantly)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kckennylau what do you mean? These are lemmas not data.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant that { p : R × R | v (p.2 - p.1) < r } etc. should be definitions

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 13, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 13, 2025
Comment on lines +26 to +44
lemma isSymmetricRel_uniformity_ball_lt (r : Γ₀) :
IsSymmetricRel { p : R × R | v (p.2 - p.1) < r } := by
simp [IsSymmetricRel, Valuation.map_sub_swap]

lemma isSymmetricRel_uniformity_ball_le (r : Γ₀) :
IsSymmetricRel { p : R × R | v (p.2 - p.1) ≤ r } := by
simp [IsSymmetricRel, Valuation.map_sub_swap]

lemma isTransitiveRel_uniformity_ball_lt (r : Γ₀) :
IsTransitiveRel { p : R × R | v (p.2 - p.1) < r } := by
intro _ _ _ h h'
refine (Valuation.map_add_lt v h h').trans_eq' ?_
simp

lemma isTransitiveRel_uniformity_ball_le (r : Γ₀) :
IsTransitiveRel { p : R × R | v (p.2 - p.1) ≤ r } := by
intro _ _ _ h h'
refine (Valuation.map_add_le v h h').trans_eq' ?_
simp
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kckennylau what do you mean? These are lemmas not data.

Copy link
Copy Markdown
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my confusion about why a definition about normed rings is in the normed field namespace, this looks fine. What do you think about Kenny's idea?


namespace NormedField

/-- The valuation on a nonarchimedean normed field `K` defined as `nnnorm`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's about a normed commring R? Should this be in the NormedField namespace? Confused.

Copy link
Copy Markdown
Contributor Author

@pechersky pechersky Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is NormedCommRing + NormOneClass + NormMulClass, which gives the multiplicative normed structure, as opposed to the submultiplicative norm (‖x * y‖ ≤ ‖x‖ ‖y‖) property. I'll change the docstring. However, I think it still makes sense to keep the NormedField namespace because of this. And this file uses Normed.Field.Lemmas.


lemma rel_iff_le (x y : R) : x ≤ᵥ y ↔ ‖x‖ ≤ ‖y‖ := Iff.rfl

lemma norm_pos_posSubmonoid (x : (ValuativeRel.posSubmonoid R)) :
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma norm_pos_posSubmonoid (x : (ValuativeRel.posSubmonoid R)) :
lemma norm_pos_posSubmonoid (x : ValuativeRel.posSubmonoid R) :

This lemma looks quite weird to me. I think we shouldn't work with bundled ValuativeRel.posSubmonoid R in the first place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get such bundled terms from ValuativeRel.exists_valuation_div_valuation_eq and friends.

@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-algebra Algebra (groups, rings, fields, etc) t-analysis Analysis (normed *, calculus) t-number-theory Number theory (also use t-algebra or t-analysis to specialize)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants