Skip to content

Commit 6e0f391

Browse files
committed
chore: mark AlgebraicGeometry.PrimeSpectrum.Top as implicit_reducible (#42740)
This PR marks `AlgebraicGeometry.PrimeSpectrum.Top` as `implicit_reducible`, because a lot of declarations depend on unfolding it.
1 parent 4d6abae commit 6e0f391

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

Mathlib/AlgebraicGeometry/StructureSheaf.lean

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ namespace AlgebraicGeometry
6666

6767
variable (R) in
6868
/-- The prime spectrum as an object of `TopCat`. -/
69+
@[implicit_reducible]
6970
def PrimeSpectrum.Top : TopCat := TopCat.of (PrimeSpectrum R)
7071

7172
namespace StructureSheaf
7273

7374
variable {P : PrimeSpectrum.Top R}
7475

75-
set_option backward.isDefEq.respectTransparency.types false in
7676
variable (M P) in
7777
/-- The type family over `PrimeSpectrum R` consisting of the localization over each point. -/
7878
abbrev Localizations : Type u := LocalizedModule P.asIdeal.primeCompl M
@@ -113,7 +113,6 @@ so we replace his circumlocution about functions into a disjoint union with
113113
def isLocallyFraction : LocalPredicate (Localizations (R := R) M) :=
114114
(isFractionPrelocal R M).sheafify
115115

116-
set_option backward.isDefEq.respectTransparency.types false in
117116
variable (M) in
118117
/-- The functions satisfying `isLocallyFraction` form a submodule. -/
119118
def sectionsSubmodule (U : (Opens (PrimeSpectrum.Top R))) :
@@ -133,7 +132,6 @@ def sectionsSubmodule (U : (Opens (PrimeSpectrum.Top R))) :
133132
exact ⟨V, m, i, r • ra, sa, fun x ↦ ⟨(wa x).1,
134133
congr(r • $((wa x).2)).trans (LocalizedModule.smul'_mk ..)⟩⟩
135134

136-
set_option backward.isDefEq.respectTransparency.types false in
137135
variable (A) in
138136
/-- The functions satisfying `isLocallyFraction` form a subalgebra. -/
139137
def sectionsSubalgebra (U : (Opens (PrimeSpectrum.Top R))) :
@@ -277,7 +275,6 @@ def const (f : M) (g : R) (U : Opens (PrimeSpectrum.Top R))
277275
Γ(M, U) :=
278276
fun x => .mk f ⟨g, hu x.2⟩, fun x ↦ ⟨U, x.2, 𝟙 _, f, g, fun y ↦ ⟨hu y.2, rfl⟩⟩⟩
279277

280-
set_option backward.isDefEq.respectTransparency.types false in
281278
@[simp]
282279
theorem const_apply (f : M) (g : R) (U : Opens (PrimeSpectrum.Top R))
283280
(hu : ∀ x ∈ U, g ∈ (x : PrimeSpectrum.Top R).asIdeal.primeCompl) (x : U) :
@@ -320,12 +317,10 @@ theorem const_algebraMap (f : R) (U hu) : const (algebraMap R A f) f U hu = 1 :=
320317
theorem const_self (f : R) (U hu) : const f f U hu = 1 :=
321318
const_algebraMap ..
322319

323-
set_option backward.isDefEq.respectTransparency false in
324320
@[simp]
325321
theorem const_one (U) : const (1 : A) (1 : R) U (by simp) = 1 := by
326322
simpa using const_algebraMap 1 (A := A) U
327323

328-
set_option backward.isDefEq.respectTransparency false in
329324
theorem const_add (f₁ f₂ : M) (g₁ g₂ : R) (U hu₁ hu₂) :
330325
const f₁ g₁ U hu₁ + const f₂ g₂ U hu₂ =
331326
const (g₂ • f₁ + g₁ • f₂) (g₁ * g₂) U (by simp [*, PrimeSpectrum.basicOpen_mul]) :=
@@ -335,7 +330,6 @@ theorem smul_const (f : M) (r g : R) (U hu) :
335330
r • const f g U hu = const (r • f) g U hu :=
336331
Subtype.ext <| funext fun _ ↦ LocalizedModule.smul'_mk _ _ _
337332

338-
set_option backward.isDefEq.respectTransparency false in
339333
theorem const_mul (f₁ f₂ : A) (g₁ g₂ : R) (U hu₁ hu₂) :
340334
const f₁ g₁ U hu₁ * const f₂ g₂ U hu₂ =
341335
const (f₁ * f₂) (g₁ * g₂) U (by simp [*, PrimeSpectrum.basicOpen_mul]) :=
@@ -365,7 +359,6 @@ theorem const_eq_const_of_smul_eq_smul (f₁ f₂ : M) (g₁ g₂ : R) (U hu₁
365359
Subtype.ext (funext fun x ↦ by
366360
simp [LocalizedModule.mk_eq, Localizations, Submonoid.smul_def, H])
367361

368-
set_option backward.isDefEq.respectTransparency false in
369362
variable (R M) in
370363
/-- The canonical linear map interpreting an element of `M` as
371364
a section of the structure sheaf. -/
@@ -375,7 +368,6 @@ def toOpenₗ (U : Opens (PrimeSpectrum.Top R)) :
375368
map_add' _ _ := by simp [const_add]
376369
map_smul' _ _ := by simp [smul_const]
377370

378-
set_option backward.isDefEq.respectTransparency false in
379371
theorem toOpenₗ_eq_const (U : Opens (PrimeSpectrum.Top R)) (f : M) :
380372
toOpenₗ R M U f = const f 1 U (by simp) := rfl
381373

@@ -390,7 +382,6 @@ namespace StructureSheaf
390382

391383
section basicOpen
392384

393-
set_option backward.isDefEq.respectTransparency false in
394385
lemma isUnit_basicOpen (f : R) :
395386
IsUnit ((algebraMap R Γ(R, basicOpen f)) f) :=
396387
isUnit_iff_exists_inv.mpr ⟨const 1 f _ le_rfl, const_mul_rev _ _ _ (by simp) _⟩
@@ -414,7 +405,6 @@ def toBasicOpenₗ (f : R) :
414405
exact Submonoid.powers_le (P := (IsUnit.submonoid _).comap (algebraMap R _)).mpr
415406
(isUnit_basicOpen_end ..)
416407

417-
set_option backward.isDefEq.respectTransparency.types false in
418408
@[simp]
419409
theorem toBasicOpenₗ_mk (s : R) (f : M) (g : Submonoid.powers s) :
420410
toBasicOpenₗ R M s (.mk f g) = const f g.1 (basicOpen s) (by
@@ -445,7 +435,6 @@ theorem toBasicOpenₗ_injective (f : R) : Function.Injective (toBasicOpenₗ R
445435
rw [PrimeSpectrum.mem_zeroLocus, Set.not_subset]
446436
exact ⟨u.1, by simpa [sub_eq_zero, smul_sub], u.2
447437

448-
set_option backward.isDefEq.respectTransparency false in
449438
/-
450439
Auxiliary lemma for surjectivity of `toBasicOpen`.
451440
A local representation of a section `s` as fractions `a i / h i` on finitely many basic opens
@@ -493,7 +482,6 @@ theorem exists_le_iSup_basicOpen_and_smul_eq_smul_and_eq_const
493482
simp [Submonoid.smul_def, pow_succ', mul_smul]
494483
· simp
495484

496-
set_option backward.isDefEq.respectTransparency false in
497485
theorem toBasicOpenₗ_surjective (f : R) : Function.Surjective (toBasicOpenₗ R M f) := by
498486
intro s
499487
obtain ⟨ι, _, a, b, ibU, iU, hab, H⟩ := exists_le_iSup_basicOpen_and_smul_eq_smul_and_eq_const _
@@ -529,7 +517,6 @@ instance isIso_toBasicOpenₗ (f : R) :
529517
IsIso (ModuleCat.ofHom (toBasicOpenₗ R M f)) :=
530518
(ConcreteCategory.isIso_iff_bijective _).mpr ⟨toBasicOpenₗ_injective _, toBasicOpenₗ_surjective _⟩
531519

532-
set_option backward.isDefEq.respectTransparency false in
533520
public lemma toOpenₗ_top_bijective : Function.Bijective (toOpenₗ R M ⊤) := by
534521
have : IsLocalizedModule ⊥ (toOpenₗ R M ⊤) := by
535522
convert! (inferInstance : IsLocalizedModule (.powers 1) (toOpenₗ R M (basicOpen 1)))
@@ -558,9 +545,6 @@ the stalk of `structureSheaf R` at `x`. -/
558545
CommRingCat.of R ⟶ (structurePresheafInCommRingCat R).stalk x :=
559546
CommRingCat.ofHom (algebraMap _ _) ≫ (structurePresheafInCommRingCat R).germ ⊤ x trivial
560547

561-
#adaptation_note
562-
/-- `respectTransparency.types true` changes the auto-generated lemmas' signature -/
563-
set_option backward.isDefEq.respectTransparency.types false in
564548
@[elementwise, reassoc]
565549
public lemma algebraMap_germ
566550
(U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.Top R) (hxU : x ∈ U) :
@@ -670,7 +654,6 @@ theorem isUnit_toStalkₗ' (x : PrimeSpectrum.Top R) (f : R) (hf : x ∈ basicOp
670654
simp only [Module.algebraMap_end_apply]
671655
rw [toStalk_smul]
672656

673-
set_option backward.isDefEq.respectTransparency.types false in
674657
variable (R M) in
675658
/-- The canonical ring homomorphism from the localization of `R` at `p` to the stalk
676659
of the structure sheaf at the point `p`. -/
@@ -695,7 +678,6 @@ theorem localizationtoStalkₗ_mk (x : PrimeSpectrum.Top R) (f : M) (s) :
695678
congr 1
696679
exact const_eq_const_of_smul_eq_smul (H := by simp) ..
697680

698-
set_option backward.isDefEq.respectTransparency.types false in
699681
variable (R M) in
700682
/-- The ring homomorphism that takes a section of the structure sheaf of `R` on the open set `U`,
701683
implemented as a subtype of dependent functions to localizations at prime ideals, and evaluates
@@ -708,7 +690,6 @@ def openToLocalizationₗ (U : Opens (PrimeSpectrum.Top R)) (x : PrimeSpectrum.T
708690
map_smul' _ _ := rfl
709691
map_add' _ _ := rfl }
710692

711-
set_option backward.isDefEq.respectTransparency.types false in
712693
variable (R M) in
713694
/-- The ring homomorphism from the stalk of the structure sheaf of `R` at a point corresponding to
714695
a prime ideal `p` to the localization of `R` at `p`,
@@ -782,7 +763,6 @@ theorem localizationToStalk_stalkToFiberRingHom (x : PrimeSpectrum.Top R) :
782763
localizationtoStalkₗ R M x ≫ stalkToLocalizationₗ R M x = 𝟙 _ :=
783764
(stalkIsoₗ R M x).inv_hom_id
784765

785-
set_option backward.isDefEq.respectTransparency.types false in
786766
instance (x : PrimeSpectrum.Top R) :
787767
IsLocalizedModule x.asIdeal.primeCompl (toStalkₗ' R M x).hom := by
788768
convert!
@@ -811,7 +791,6 @@ def toStalkₗ (x : PrimeSpectrum.Top R) :
811791
congr 1
812792
exact (IsScalarTower.algebraMap_smul Γ(R, _) (M := Γ(M, _)) _ _).symm
813793

814-
set_option backward.isDefEq.respectTransparency.types false in
815794
public
816795
instance (x : PrimeSpectrum.Top R) : IsLocalizedModule x.asIdeal.primeCompl (toStalkₗ R M x) := by
817796
convert!
@@ -864,7 +843,6 @@ def commRingCatStalkEquivModuleStalk (x : PrimeSpectrum.Top R) :
864843
rfl
865844
· exact congr($this _).symm
866845

867-
set_option backward.isDefEq.respectTransparency.types false in
868846
public instance (x : PrimeSpectrum.Top R) :
869847
IsLocalization.AtPrime ((structurePresheafInCommRingCat R).stalk x) x.asIdeal := by
870848
refine (isLocalizedModule_iff_isLocalization' _ _).mp ?_
@@ -889,7 +867,6 @@ public instance (x : PrimeSpectrum.Top R) :
889867
exact (((structurePresheafInCommRingCat R).germ ⊤ x (by simp)).hom.comp
890868
(algebraMap R Γ(R, _))).map_one.symm
891869

892-
set_option backward.isDefEq.respectTransparency.types false in
893870
variable (R) in
894871
/-- The stalk of `Spec R` at `x` is isomorphic to `Rₚ`,
895872
where `p` is the prime corresponding to `x`. -/
@@ -935,23 +912,19 @@ theorem stalkAlgebra_map (p : PrimeSpectrum R) (r : R) :
935912
algebraMap R ((structureSheaf R).presheaf.stalk p) r = toStalk R p r :=
936913
rfl
937914

938-
set_option backward.isDefEq.respectTransparency.types false in
939915
/-- Stalk of the structure sheaf at a prime p as localization of R -/
940916
instance IsLocalization.to_stalk (p : PrimeSpectrum R) :
941917
IsLocalization.AtPrime ((structureSheaf R).presheaf.stalk p) p.asIdeal :=
942918
inferInstanceAs (IsLocalization.AtPrime ((structurePresheafInCommRingCat R).stalk p) p.asIdeal)
943919

944-
set_option backward.isDefEq.respectTransparency.types false in
945920
instance openAlgebra (U : (Opens (PrimeSpectrum R))ᵒᵖ) : Algebra R ((structureSheaf R).obj.obj U) :=
946921
inferInstanceAs (Algebra R ((structureSheafInType R R).presheaf.obj _))
947922

948-
set_option backward.isDefEq.respectTransparency.types false in
949923
/-- Sections of the structure sheaf of Spec R on a basic open as localization of R -/
950924
instance IsLocalization.to_basicOpen (r : R) :
951925
IsLocalization.Away r ((structureSheaf R).obj.obj (op <| basicOpen r)) :=
952926
inferInstanceAs (IsLocalization.Away r Γ(R, basicOpen r))
953927

954-
set_option backward.isDefEq.respectTransparency.types false in
955928
instance to_basicOpen_epi (r : R) :
956929
Epi (CommRingCat.ofHom <|
957930
algebraMap R ((structureSheaf R).obj.obj (op <| basicOpen r))) :=
@@ -1105,7 +1078,6 @@ theorem comapₗ_eq_localRingHom (f : R →+* S) (U : Opens (PrimeSpectrum.Top R
11051078
convert_to! Localization.mk _ _ = Localization.localRingHom _ _ _ _ (Localization.mk _ _)
11061079
simp [Localization.mk_eq_mk']
11071080

1108-
set_option backward.isDefEq.respectTransparency.types false in
11091081
/-- For a ring homomorphism `f : R →+* S` and open sets `U` and `V` of the prime spectra of `R` and
11101082
`S` such that `V ⊆ (comap f) ⁻¹ U`, the induced ring homomorphism from the structure sheaf of `R`
11111083
at `U` to the structure sheaf of `S` at `V`.
@@ -1131,7 +1103,6 @@ def comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) (V : Opens (PrimeSpe
11311103
simp only [comapₗ_eq_localRingHom, PrimeSpectrum.comap_asIdeal]
11321104
exact (Localization.localRingHom ..).map_zero
11331105

1134-
set_option backward.isDefEq.respectTransparency.types false in
11351106
@[simp]
11361107
theorem comap_apply (f : R →+* S) (U : Opens (PrimeSpectrum.Top R))
11371108
(V : Opens (PrimeSpectrum.Top S)) (hUV : V.1 ⊆ PrimeSpectrum.comap f ⁻¹' U.1)
@@ -1205,7 +1176,6 @@ theorem toOpen_comp_comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) :
12051176
rw [comap_apply]
12061177
exact Localization.localRingHom_to_map _ _ _ _ _
12071178

1208-
set_option backward.isDefEq.respectTransparency.types false in
12091179
lemma comap_basicOpen (f : R →+* S) (x : R) :
12101180
comap f (PrimeSpectrum.basicOpen x) (PrimeSpectrum.basicOpen (f x))
12111181
(PrimeSpectrum.comap_basicOpen f x).le =

0 commit comments

Comments
 (0)