Skip to content

feat(RingTheory/Valuation): define the valuation spectrum and its topology#38009

Open
CBirkbeck wants to merge 15 commits intoleanprover-community:masterfrom
CBirkbeck:feat/valuation-spectrum
Open

feat(RingTheory/Valuation): define the valuation spectrum and its topology#38009
CBirkbeck wants to merge 15 commits intoleanprover-community:masterfrom
CBirkbeck:feat/valuation-spectrum

Conversation

@CBirkbeck
Copy link
Copy Markdown
Collaborator

@CBirkbeck CBirkbeck commented Apr 13, 2026

Summary

Define the valuation spectrum Spv A of a commutative ring and equip it with the topology generated by basic open sets, following Wedhorn's Adic Spaces. Also define the pullback (comap) of a ValuativeRel along a ring homomorphism. This is preparation for later defining adic spaces.

Note the code was generated by claude code, but I have cleaned up and pre-reviewed the work.

…ology

Define the valuation spectrum `Spv A` of a commutative ring as the type
of valuative relations on `A`, following Definition 4.1 of Wedhorn's
*Adic Spaces*. Equip it with the topology generated by basic open sets
`{ v | v(f) ≤ v(s) ∧ v(s) ≠ 0 }`.

## New files

* `ValuativeRel/Comap.lean`: Pullback of a `ValuativeRel` along a ring
  homomorphism, and the lemma that units cannot map to zero.
* `ValuationSpectrum.lean`: The valuation spectrum with:
  - basic open sets and their properties
  - contravariant functoriality (`comap`) and its continuity
  - support map `Spv A → Spec A` and its continuity
  - quotient lifting and topological embedding
  - localization lifting and range characterization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

PR summary bc7bce2142

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.RingTheory.Valuation.ValuativeRel.Comap (new file) 1163
Mathlib.RingTheory.Valuation.ValuationSpectrum (new file) 1798

Declarations diff

+ IsUnit.not_vle_zero
+ ValuationSpectrum
+ basicOpen
+ basicOpen_mul_subset
+ basicOpen_one
+ basicOpen_self
+ comap_continuous
+ comap_injective
+ comap_localizationLift
+ comap_localization_range
+ comap_ofValuation
+ comap_preimage_basicOpen
+ comap_quotientLift
+ comap_quotient_isEmbedding
+ comap_quotient_range
+ ideal_le_supp_comap_mk
+ instIsPrimeSupp
+ instTopologicalSpace
+ localizationLift
+ mem_supp_iff
+ not_vle_zero_of_isUnit
+ ofValuation
+ ofValuation_eq_of_isEquiv
+ ofValuation_valuation
+ quotientLift
+ quotientLift_comap
+ submonoid_le_supp_primeCompl_comap_algebraMap
+ supp
+ suppFun
+ suppFun_asIdeal
+ suppFun_comap
+ suppFun_continuous
+ suppFun_preimage_basicOpen
+ supp_eq_valuation_supp
+ supp_ofValuation
+ valuation
+ vle_ofValuation
++ comap
++ comap_comp
++ comap_id
++ comap_vle

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@github-actions github-actions bot added the t-ring-theory Ring theory label Apr 13, 2026
CBirkbeck and others added 9 commits April 13, 2026 16:46
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cstrings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rings

The module docstring already references Wedhorn; no need to repeat it
on individual declarations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both files were missing the `module` keyword, `public import`, and
`@[expose] public section` required by the Lean 4 module system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CBirkbeck CBirkbeck added the LLM-generated PRs with substantial input from LLMs - review accordingly label Apr 14, 2026
@CBirkbeck CBirkbeck marked this pull request as ready for review April 14, 2026 11:57
@riccardobrasca riccardobrasca self-assigned this Apr 14, 2026
Copy link
Copy Markdown
Member

@riccardobrasca riccardobrasca left a comment

Choose a reason for hiding this comment

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

I stopped around line 150 of ValuationSpectrum.lean. In my opinion something is not optimal with the design, there too many let and @. I will have a closer look after the various easy comments are taken into account.

Anyway this is surely a great addition!

Comment thread Mathlib/RingTheory/Valuation/ValuativeRel/Comap.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuativeRel/Comap.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuativeRel/Comap.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuativeRel/Comap.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuativeRel/Comap.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuationSpectrum.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuationSpectrum.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuationSpectrum.lean Outdated
Comment thread Mathlib/RingTheory/Valuation/ValuationSpectrum.lean
Comment thread Mathlib/RingTheory/Valuation/ValuationSpectrum.lean Outdated
CBirkbeck and others added 2 commits April 14, 2026 15:11
Comap.lean:
- @[reducible] → @[implicit_reducible]
- use ≤ᵥ notation in comap field body
- comap_vle now returns ↔ / Iff.rfl (these are Props)
- rename ValuativeRel.not_vle_zero_of_isUnit → IsUnit.not_vle_zero
  (enables dot notation hu.not_vle_zero)
- golf not_vle_zero proof to a single simpa

ValuationSpectrum.lean:
- fix Wedhorn bib key (wedhorn_adic)
- basicOpen_mul_subset: refactor with refine + simpa
- docstrings: Spv(φ) → comap φ, v ∈ Spv A → v : Spv A
- comap_id, comap_comp: by ext; rfl
- instIsPrimeSupp: term-mode inferInstanceAs
- add @[simp] rfl lemma vle_ofValuation and eliminate change in supp_ofValuation
- replace let := with letI := for typeclass instance bindings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ValuativeRel.comap_id and ValuativeRel.comap_comp in Comap.lean as named
rfl lemmas. Use them in ValuationSpectrum.comap_id / comap_comp via
congr_arg (·.vle), rather than closing the underlying goal with a bare rfl.

Addresses reviewer comment on line 117.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@adamtopaz
Copy link
Copy Markdown
Contributor

Pinging @dagurtomas and @chrisflav since they have been working on similar things.

@dagurtomas
Copy link
Copy Markdown
Contributor

dagurtomas commented Apr 15, 2026

All that we have done so far lives in the draft PR #30978. I haven't touched it in a while, but it certainly contains the definition of Spv, the topology, and comap.

@CBirkbeck
Copy link
Copy Markdown
Collaborator Author

All that we have done so far lives in the draft PR #30978. I haven't touched it in a while, but it certainly contains the definition of Spv, the topology, and comap.

Oh interesting, I didnt know about this PR. I'm working towards proving Tate acyclicity and defining the adic Fargues--Fontaine curve, so there will likely be lots of overlap, so maybe we should coordinate. I see that in #30978 the Spv definition is def Spv (R : Type u) [CommRing R] : Type u := ValuativeRel R is this what we would want then?

@chrisflav
Copy link
Copy Markdown
Member

chrisflav commented Apr 15, 2026

I think your definition is strictly better, it has better def-eq hygiene and it is what we have been doing with all the recent refactors, e.g. WithVal.

Concerning scope: I was mostly interested in testing a framework for analytification of schemes, for which adic spaces would provide one target category. But I am quite busy with other things at the moment, so I also did not work more on this.

@riccardobrasca
Copy link
Copy Markdown
Member

On the other hand I don't have an opinion wrt the type synonym, the two approached should be more or less equivalent.

Copy link
Copy Markdown
Contributor

@faenuccio faenuccio left a comment

Choose a reason for hiding this comment

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

Some comments on my side as well.


/-- The topology on `Spv A` generated by the basic open sets `basicOpen f s`
for `f, s : A`. -/
instance instTopologicalSpace : TopologicalSpace (Spv A) :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
instance instTopologicalSpace : TopologicalSpace (Spv A) :=
instance : TopologicalSpace (Spv A) :=

Why do you want to give it an explicit name (which coincides with the automatically generated one, btw)?

ofValuation v₁ = ofValuation v₂ :=
ValuationSpectrum.ext (funext₂ fun x y ↦ propext (h x y))

/-- The basic open subset `Spv(A)(f/s) = { v ∈ Spv A | v(f) ≤ v(s) ∧ v(s) ≠ 0 }`. -/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/-- The basic open subset `Spv(A)(f/s) = { v ∈ Spv A | v(f) ≤ v(s)v(s) ≠ 0 }`. -/
/-- The basic open subset `Spv(A)(f/s) = { v ∈ Spv A | f ≤ᵥ s¬ s =ᵥ 0 }`. -/

Change also all other occurrencies please.


@[expose] public section

-- This is defined as a structure extending `ValuativeRel A` rather than a type synonym, since we
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think that @riccardobrasca's point makes sense: we want also to discourage copying the API for ValuativeRel to ValuationSpectrum, IMHO. Otherwise it will be a sort of "defeq under the hood".

ValuativeRel.supp_def x

/-- The support of a point `v : Spv A` is a prime ideal. -/
instance instIsPrimeSupp (v : Spv A) : v.supp.IsPrime :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you need a name?

end Quotient

/-- If `f` is a unit, then no valuative relation sends `f` to zero. -/
lemma not_vle_zero_of_isUnit {f : A} (hu : IsUnit f) (v : Spv A) : ¬ v.vle f 0 :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This kind of statements seems to abuse defeq, no?

@CBirkbeck
Copy link
Copy Markdown
Collaborator Author

Ok so do you prefer what the draft does here #38042 ?

@CBirkbeck
Copy link
Copy Markdown
Collaborator Author

CBirkbeck commented Apr 15, 2026

One thing to note is that we maybe still want to think of elements of Spv as valuations, not points, since when it comes to defining Spa(A,A^+) we need to add that they are continuous (and <= 1 on A^+), and defining a point to be continuous feels weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly t-ring-theory Ring theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants