Skip to content

[Merged by Bors] - feat(AlgebraicGeometry/Birational): Birationality and rationality of schemes#39122

Closed
justus-springer wants to merge 34 commits into
leanprover-community:masterfrom
justus-springer:justus/birational
Closed

[Merged by Bors] - feat(AlgebraicGeometry/Birational): Birationality and rationality of schemes#39122
justus-springer wants to merge 34 commits into
leanprover-community:masterfrom
justus-springer:justus/birational

Conversation

@justus-springer

@justus-springer justus-springer commented May 9, 2026

Copy link
Copy Markdown
Collaborator

This is a first step (of hopefully many) towards some basic birational geometry. This PR adds Birational/Birational.lean, which defines predicates Birational, BirationalOver and IsRationalOver for arbitrary schemes and provides basic API (e.g. that they are equivalence relations, and that affine space is rational).

Some notes on the choice of definitions: There are multiple ways to define what it means for
two schemes to be birational to each other. A common one is: "There exists a
rational map with a rational inverse". However, this would require defining composition of
rational maps, which is not always defined (In order to compose f : X ⤏ Y with g : Y ⤏ Z, you
need at least X preirreducible, Y nonempty and f dominant). On the other hand, I can define
"There exist dense subsets U : Opens X and V : Opens Y such that U ≅ V as schemes" for
any two schemes X and Y, with no conditions. Hence I chose that as a definition. I'm also
working on defining composition of rational maps (#39445), and once that's done, there should be a theorem
connecting the two definitions.


Open in Gitpod

@github-actions github-actions Bot added the t-algebraic-geometry Algebraic geometry label May 9, 2026
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

PR summary 8367f1548c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.AlgebraicGeometry.Birational.Birational (new file) 2511

Declarations diff (regex)

+ Birational
+ Birational.partialIso
+ Birational.refl
+ Birational.symm
+ Birational.trans
+ BirationalOver
+ BirationalOver.isRationalOver
+ BirationalOver.partialIso
+ BirationalOver.partialIso_isOver
+ BirationalOver.refl
+ BirationalOver.symm
+ BirationalOver.trans
+ Hom.birational
+ Hom.birationalOver
+ Hom.partialIso
+ IsOver
+ IsOver.restrictSource
+ IsOver.restrictTarget
+ IsOver.symm
+ IsOver.trans
+ IsOver.trans'
+ IsRationalOver
+ Opens.birationalOver_of_dense
+ Opens.birational_of_dense
+ Opens.isRationalOver_of_dense
+ Opens.partialIsoOfDense
+ PartialIso
+ ext
+ ext_iff
+ instance (S : Scheme.{u}) (n : Type u) : IsRationalOver (𝔸(n; S) ↘ S)
+ ofIso
+ refl
+ restrictSource
+ restrictTarget
+ symm
+ toPartialMap
+ toRationalMap
+ trans
+ trans'
+ ι_comp_over

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 8367f15).

  • +93 new declarations
  • −0 removed declarations
+AlgebraicGeometry.Scheme.Birational
+AlgebraicGeometry.Scheme.Birational.partialIso
+AlgebraicGeometry.Scheme.Birational.refl
+AlgebraicGeometry.Scheme.Birational.symm
+AlgebraicGeometry.Scheme.Birational.trans
+AlgebraicGeometry.Scheme.BirationalOver
+AlgebraicGeometry.Scheme.BirationalOver.isRationalOver
+AlgebraicGeometry.Scheme.BirationalOver.partialIso
+AlgebraicGeometry.Scheme.BirationalOver.partialIso_isOver
+AlgebraicGeometry.Scheme.BirationalOver.refl
+AlgebraicGeometry.Scheme.BirationalOver.symm
+AlgebraicGeometry.Scheme.BirationalOver.trans
+AlgebraicGeometry.Scheme.Hom.birational
+AlgebraicGeometry.Scheme.Hom.birationalOver
+AlgebraicGeometry.Scheme.Hom.partialIso
+AlgebraicGeometry.Scheme.Hom.partialIso_iso
+AlgebraicGeometry.Scheme.Hom.partialIso_source
+AlgebraicGeometry.Scheme.Hom.partialIso_target
+AlgebraicGeometry.Scheme.IsRationalOver
+AlgebraicGeometry.Scheme.IsRationalOver.casesOn
+AlgebraicGeometry.Scheme.IsRationalOver.exists_birationalOver_affineSpace
+AlgebraicGeometry.Scheme.IsRationalOver.mk
+AlgebraicGeometry.Scheme.IsRationalOver.rec
+AlgebraicGeometry.Scheme.IsRationalOver.recOn
+AlgebraicGeometry.Scheme.Opens.birationalOver_of_dense
+AlgebraicGeometry.Scheme.Opens.birational_of_dense
+AlgebraicGeometry.Scheme.Opens.isRationalOver_of_dense
+AlgebraicGeometry.Scheme.Opens.partialIsoOfDense
+AlgebraicGeometry.Scheme.Opens.partialIsoOfDense_iso
+AlgebraicGeometry.Scheme.Opens.partialIsoOfDense_source
+AlgebraicGeometry.Scheme.Opens.partialIsoOfDense_target
+AlgebraicGeometry.Scheme.Opens.ι_comp_over
+AlgebraicGeometry.Scheme.PartialIso
+AlgebraicGeometry.Scheme.PartialIso.IsOver
+AlgebraicGeometry.Scheme.PartialIso.IsOver.restrictSource
+AlgebraicGeometry.Scheme.PartialIso.IsOver.restrictTarget
+AlgebraicGeometry.Scheme.PartialIso.IsOver.symm
+AlgebraicGeometry.Scheme.PartialIso.IsOver.trans
+AlgebraicGeometry.Scheme.PartialIso.IsOver.trans'
+AlgebraicGeometry.Scheme.PartialIso.casesOn
+AlgebraicGeometry.Scheme.PartialIso.ctorIdx
+AlgebraicGeometry.Scheme.PartialIso.dense_source
+AlgebraicGeometry.Scheme.PartialIso.dense_target
+AlgebraicGeometry.Scheme.PartialIso.ext
+AlgebraicGeometry.Scheme.PartialIso.ext_iff
+AlgebraicGeometry.Scheme.PartialIso.iso
+AlgebraicGeometry.Scheme.PartialIso.mk
+AlgebraicGeometry.Scheme.PartialIso.mk.congr_simp
+AlgebraicGeometry.Scheme.PartialIso.mk.inj
+AlgebraicGeometry.Scheme.PartialIso.mk.injEq
+AlgebraicGeometry.Scheme.PartialIso.mk.noConfusion
+AlgebraicGeometry.Scheme.PartialIso.mk.sizeOf_spec
+AlgebraicGeometry.Scheme.PartialIso.noConfusion
+AlgebraicGeometry.Scheme.PartialIso.noConfusionType
+AlgebraicGeometry.Scheme.PartialIso.ofIso
+AlgebraicGeometry.Scheme.PartialIso.ofIso_iso
+AlgebraicGeometry.Scheme.PartialIso.ofIso_source
+AlgebraicGeometry.Scheme.PartialIso.ofIso_target
+AlgebraicGeometry.Scheme.PartialIso.rec
+AlgebraicGeometry.Scheme.PartialIso.recOn
+AlgebraicGeometry.Scheme.PartialIso.refl
+AlgebraicGeometry.Scheme.PartialIso.refl_iso
+AlgebraicGeometry.Scheme.PartialIso.refl_source
+AlgebraicGeometry.Scheme.PartialIso.refl_target
+AlgebraicGeometry.Scheme.PartialIso.restrictSource
+AlgebraicGeometry.Scheme.PartialIso.restrictSource_iso
+AlgebraicGeometry.Scheme.PartialIso.restrictSource_source
+AlgebraicGeometry.Scheme.PartialIso.restrictSource_target
+AlgebraicGeometry.Scheme.PartialIso.restrictTarget
+AlgebraicGeometry.Scheme.PartialIso.restrictTarget.congr_simp
+AlgebraicGeometry.Scheme.PartialIso.restrictTarget_iso
+AlgebraicGeometry.Scheme.PartialIso.restrictTarget_source
+AlgebraicGeometry.Scheme.PartialIso.restrictTarget_target
+AlgebraicGeometry.Scheme.PartialIso.source
+AlgebraicGeometry.Scheme.PartialIso.symm
+AlgebraicGeometry.Scheme.PartialIso.symm_iso
+AlgebraicGeometry.Scheme.PartialIso.symm_source
+AlgebraicGeometry.Scheme.PartialIso.symm_target
+AlgebraicGeometry.Scheme.PartialIso.target
+AlgebraicGeometry.Scheme.PartialIso.toPartialMap
+AlgebraicGeometry.Scheme.PartialIso.toPartialMap_domain
+AlgebraicGeometry.Scheme.PartialIso.toPartialMap_hom
+AlgebraicGeometry.Scheme.PartialIso.toRationalMap
+AlgebraicGeometry.Scheme.PartialIso.trans
+AlgebraicGeometry.Scheme.PartialIso.trans'
+AlgebraicGeometry.Scheme.PartialIso.trans'_iso
+AlgebraicGeometry.Scheme.PartialIso.trans'_source
+AlgebraicGeometry.Scheme.PartialIso.trans'_target
+AlgebraicGeometry.Scheme.PartialIso.trans_iso
+AlgebraicGeometry.Scheme.PartialIso.trans_source
+AlgebraicGeometry.Scheme.PartialIso.trans_target
+AlgebraicGeometry.Scheme.instIsRationalOverOverAffineSpaceInferInstanceOverClass
+AlgebraicGeometry.Scheme.isRationalOver_iff

Increase in strong tech debt: (relative, absolute) = (6.00, 0.00)
Current number Change Type (strong)
4510 6 backward.defeqAttrib.useBackward
Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
4967 1 exposed public sections

Current commit 8367f1548c
Reference commit 008653f6c0

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/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 file-removed A Lean module was (re)moved without a `deprecated_module` annotation label May 9, 2026
@justus-springer justus-springer changed the title feat(AlgebraicGeometry/): Birational and rational schemes feat(AlgebraicGeometry/): Birationality and rationality of schemes May 10, 2026

@chrisflav chrisflav left a comment

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.

Thanks for working on this! Looking forward to a lot more birational geometry in mathlib! Some initial comments, I have not looked at the rest of the code closely yet because it depends on these comments.

Comment thread Mathlib/AlgebraicGeometry/Birational/Birational.lean Outdated
Comment thread Mathlib/AlgebraicGeometry/Birational/Birational.lean
Comment thread Mathlib/AlgebraicGeometry/Birational/Birational.lean
@chrisflav chrisflav added the awaiting-author A reviewer has asked the author a question or requested changes. label May 12, 2026

@erdOne erdOne left a comment

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.

Not a detailed review but some design questions worth thinking about (even if not addressed in this PR)

  1. Should you be working with PartialMap or RationalMap? In particular isext_iff right? Or do you only want equality on a dense subset?
  2. Do we still want to work with OverClass (I hate it now and I presume @chrisflav agrees)?
  3. How will this mesh with "birational morphisms"? Do we want an IsBirational predicate on rational maps also? (and then IsBirational f.toRationalMap)
  4. How far are we from rational <=> function field is rational? I would hope we can do this in this very PR or a follow up?

@justus-springer

justus-springer commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you both for the comments! @erdOne, here are my thoughts to your points.
Also note that I'm working on composition of rational maps and birational maps
on this branch.

  1. PartialIso is a two-sided version of PartialMap (no quotient yet), so the
    ext-lemma is analogous to the one from PartialMap. One could define an
    equivalence relation on PartialIso similar to the one on PartialMap and the
    resulting quotient would be a possible definition of BirationalMap. However, I
    (currently) think a better definition of BirationalMap would be: "A dominant
    rational map admitting an inverse". That definition requires composition of
    rational maps though, which I'm going to PR soon. For the purposes of defining
    when two schemes are "birational" as I'm doing in this PR (which just claims the
    existence of a birational map), there is no need to pass to the quotient.

  2. I don't have a preference, but I would believe you if you think OverClass
    causes more pain down the road. Just to be clear, the alternative would be to
    take in the structure morphisms as arguments explicitly? E.g. BirationalOver
    would take in sX : X ⟶ S and sY : Y ⟶ S? I can certainly try out how that
    goes. It seems to me the file RationalMap.lean is currently inconsistent with
    this, e.g. we have both RationalMap.equivFunctionField and
    RationalMap.equivFunctionFieldOver, which have basically the same content.

Edit: I replaced uses of OverClass by explicitly taking the morphisms.
I think this makes it better (also removed the need for
isDefeq.respectTransparency in these instances).

  1. This is basically the same question of whether we want to use IsIso f or
    Iso in category theory. I'm not sure we need both IsBirational and
    BirationalMap, but we'll see. A further complication is that there is also a
    more general predicate "is birational" on morphisms of schemes, see
    stacks#01RO. It's more general because it works on schemes with finitely many
    irreducible components, not just on irreducible schemes.

  2. A more general statement would be: Two schemes X,Y over a field K are
    Spec(K)-birational iff their function fields are isomorphic as
    K-algebras. I.e. birational maps between X and Y correspond to
    K-algebra isomorphisms between their function fields. So this is the
    "bi"-version of RationalMap.equivFunctionField, which I'm definitely trying to
    do once birational maps are defined.

@justus-springer justus-springer removed the awaiting-author A reviewer has asked the author a question or requested changes. label May 13, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels May 13, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

This PR/issue depends on:

@justus-springer
justus-springer temporarily deployed to cache-upload-forks June 5, 2026 13:42 — with GitHub Actions Inactive
@chrisflav

Copy link
Copy Markdown
Member

Thanks!
maintainer merge

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by chrisflav.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jun 5, 2026
@joelriou

Copy link
Copy Markdown
Contributor

Could you merge again with master as there were some disrupting changes recently?

@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 17, 2026
@justus-springer justus-springer added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 17, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 17, 2026
@justus-springer justus-springer added the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 22, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 22, 2026
@justus-springer

Copy link
Copy Markdown
Collaborator Author

@joelriou I merged master again today, no changes were necessary. Do you think this is mergeable soon?

Comment thread Mathlib/AlgebraicGeometry/Birational/Birational.lean Outdated
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Jun 25, 2026
@justus-springer justus-springer added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. and removed awaiting-author A reviewer has asked the author a question or requested changes. labels Jun 25, 2026
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 25, 2026
@joelriou

Copy link
Copy Markdown
Contributor

Thanks!

bors merge

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Jun 27, 2026
@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jun 27, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…schemes (#39122)

This is a first step (of hopefully many) towards some basic birational geometry. This PR adds `Birational/Birational.lean`, which defines predicates `Birational`, `BirationalOver` and `IsRationalOver` for arbitrary schemes and provides basic API (e.g. that they are equivalence relations, and that affine space is rational).

Some notes on the choice of definitions: There are multiple ways to define what it means for
two schemes to be birational to each other. A common one is: "There exists a
rational map with a rational inverse". However, this would require defining composition of
rational maps, which is not always defined (In order to compose `f : X ⤏ Y` with `g : Y ⤏ Z`, you
need at least `X` preirreducible, `Y` nonempty and `f` dominant). On the other hand, I can define
"There exist dense subsets `U : Opens X` and `V : Opens Y` such that `U ≅ V` as schemes" for
any two schemes `X` and `Y`, with no conditions. Hence I chose that as a definition. I'm also
working on defining composition of rational maps (#39445), and once that's done, there should be a theorem
connecting the two definitions.

- [x] depends on: #39316

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Jun 27, 2026
@mathlib-bors

mathlib-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(AlgebraicGeometry/Birational): Birationality and rationality of schemes [Merged by Bors] - feat(AlgebraicGeometry/Birational): Birationality and rationality of schemes Jun 27, 2026
@mathlib-bors mathlib-bors Bot closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-algebraic-geometry Algebraic geometry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants