Skip to content

Commit 3e7682b

Browse files
committed
feat(AlgebraicGeometry): Add global preorder instance for schemes (#26204)
In this PR we added a default preorder instance for schemes, defined to be the specialization order as discussed here: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/dimension.20function.20for.20schemes/near/524997376 for discussion Co-authored-by: Raph-DG <77658801+Raph-DG@users.noreply.github.com>
1 parent bacb344 commit 3e7682b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Mathlib/AlgebraicGeometry/AffineSpace.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,17 @@ lemma isIntegralHom_over_iff_isEmpty : IsIntegralHom (𝔸(n; S) ↘ S) ↔ IsEm
457457
lemma not_isIntegralHom [Nonempty S] [Nonempty n] : ¬ IsIntegralHom (𝔸(n; S) ↘ S) := by
458458
simp [isIntegralHom_over_iff_isEmpty]
459459

460+
lemma spec_le_iff (R : CommRingCat) (p q : Spec R) :
461+
p ≤ q ↔ q.asIdeal ≤ p.asIdeal := by aesop (add simp PrimeSpectrum.le_iff_specializes)
462+
463+
/--
464+
One should bear this equality in mind when breaking the `Spec R/ PrimeSpectrum R` abstraction
465+
boundary, since these instances are not definitionally equal.
466+
-/
467+
example (R : CommRingCat) :
468+
inferInstance (α := Preorder (Spec R)) =
469+
inferInstance (α := Preorder (PrimeSpectrum R)ᵒᵈ) := by aesop (add simp spec_le_iff)
470+
460471
end instances
461472

462473
end AffineSpace

Mathlib/AlgebraicGeometry/Scheme.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ lemma Hom.continuous {X Y : Scheme} (f : X.Hom Y) : Continuous f.base := f.base.
125125
protected abbrev sheaf (X : Scheme) :=
126126
X.toSheafedSpace.sheaf
127127

128+
/--
129+
We give schemes the specialization preorder by default.
130+
-/
131+
instance {X : Scheme.{u}} : Preorder X := specializationPreorder X
132+
133+
lemma le_iff_specializes {X : Scheme.{u}} {a b : X} : a ≤ b ↔ b ⤳ a := by rfl
134+
128135
namespace Hom
129136

130137
variable {X Y : Scheme.{u}} (f : Hom X Y) {U U' : Y.Opens} {V V' : X.Opens}

0 commit comments

Comments
 (0)