Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 92263c0

Browse files
refactor(algebraic_geometry/structure_sheaf): Enclose definitions in structure_sheaf namespace (#8010)
Moves some pretty generic names like `const` and `to_open` to the `structure_sheaf` namespace.
1 parent 5bc18a9 commit 92263c0

File tree

2 files changed

+69
-61
lines changed

2 files changed

+69
-61
lines changed

src/algebraic_geometry/Spec.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ noncomputable theory
3434
namespace algebraic_geometry
3535
open opposite
3636
open category_theory
37+
open structure_sheaf
3738

3839
/--
3940
The spectrum of a commutative ring, as a topological space.
@@ -83,16 +84,16 @@ The induced map of a ring homomorphism on the ring spectra, as a morphism of she
8384
Spec.SheafedSpace_obj S ⟶ Spec.SheafedSpace_obj R :=
8485
{ base := Spec.Top_map f,
8586
c :=
86-
{ app := λ U, structure_sheaf.comap f (unop U)
87-
((topological_space.opens.map (Spec.Top_map f)).obj (unop U)) (λ p, id),
87+
{ app := λ U, comap f (unop U) ((topological_space.opens.map (Spec.Top_map f)).obj (unop U))
88+
(λ p, id),
8889
naturality' := λ U V i, ring_hom.ext $ λ s, subtype.eq $ funext $ λ p, rfl } }
8990

9091
@[simp] lemma Spec.SheafedSpace_map_id {R : CommRing} :
9192
Spec.SheafedSpace_map (𝟙 R) = 𝟙 (Spec.SheafedSpace_obj R) :=
9293
PresheafedSpace.ext _ _ (Spec.Top_map_id R) $ nat_trans.ext _ _ $ funext $ λ U,
9394
begin
9495
dsimp,
95-
erw [PresheafedSpace.id_c_app, structure_sheaf.comap_id], swap,
96+
erw [PresheafedSpace.id_c_app, comap_id], swap,
9697
{ rw [Spec.Top_map_id, topological_space.opens.map_id_obj_unop] },
9798
rw [eq_to_hom_op, eq_to_hom_map, eq_to_hom_trans],
9899
refl,
@@ -104,7 +105,7 @@ PresheafedSpace.ext _ _ (Spec.Top_map_comp f g) $ nat_trans.ext _ _ $ funext $
104105
begin
105106
dsimp,
106107
erw [Top.presheaf.pushforward.comp_inv_app, ← category.assoc, category.comp_id,
107-
(structure_sheaf T).presheaf.map_id, category.comp_id, structure_sheaf.comap_comp],
108+
(structure_sheaf T).presheaf.map_id, category.comp_id, comap_comp],
108109
refl,
109110
end
110111

src/algebraic_geometry/structure_sheaf.lean

Lines changed: 64 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def structure_sheaf : sheaf CommRing (prime_spectrum.Top R) :=
256256
(sheaf_condition_equiv_of_iso (structure_presheaf_comp_forget R).symm
257257
(structure_sheaf_in_Type R).sheaf_condition), }
258258

259+
260+
namespace structure_sheaf
261+
259262
@[simp] lemma res_apply (U V : opens (prime_spectrum.Top R)) (i : V ⟶ U)
260263
(s : (structure_sheaf R).presheaf.obj (op U)) (x : V) :
261264
((structure_sheaf R).presheaf.map i.op s).1 x = (s.1 (i x) : _) :=
@@ -797,30 +800,31 @@ At the moment, we work with arbitrary dependent functions `s : Π x : U, localiz
797800
we prove the predicate `is_locally_fraction` is preserved by this map, hence it can be extended to
798801
a morphism between the structure sheaves of `R` and `S`.
799802
-/
800-
def structure_sheaf.comap_fun (f : R →+* S) (U : opens (prime_spectrum.Top R))
801-
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (comap f) ⁻¹' U.1)
803+
def comap_fun (f : R →+* S) (U : opens (prime_spectrum.Top R))
804+
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (prime_spectrum.comap f) ⁻¹' U.1)
802805
(s : Π x : U, localizations R x) (y : V) : localizations S y :=
803-
localization.local_ring_hom (comap f y.1).as_ideal _ f rfl (s ⟨(comap f y.1), hUV y.2⟩ : _)
806+
localization.local_ring_hom (prime_spectrum.comap f y.1).as_ideal _ f rfl
807+
(s ⟨(prime_spectrum.comap f y.1), hUV y.2⟩ : _)
804808

805-
lemma structure_sheaf.comap_fun_is_locally_fraction (f : R →+* S)
809+
lemma comap_fun_is_locally_fraction (f : R →+* S)
806810
(U : opens (prime_spectrum.Top R)) (V : opens (prime_spectrum.Top S))
807-
(hUV : V.1 ⊆ (comap f) ⁻¹' U.1) (s : Π x : U, localizations R x)
811+
(hUV : V.1 ⊆ (prime_spectrum.comap f) ⁻¹' U.1) (s : Π x : U, localizations R x)
808812
(hs : (is_locally_fraction R).to_prelocal_predicate.pred s) :
809-
(is_locally_fraction S).to_prelocal_predicate.pred (structure_sheaf.comap_fun f U V hUV s) :=
813+
(is_locally_fraction S).to_prelocal_predicate.pred (comap_fun f U V hUV s) :=
810814
begin
811815
rintro ⟨p, hpV⟩,
812-
-- Since `s` is locally fraction, we can find a neighborhood `W` of `comap f p` in `U`, such
813-
-- that `s = a / b` on `W`, for some ring elements `a, b : R`.
814-
rcases hs ⟨comap f p, hUV hpV⟩ with ⟨W, m, iWU, a, b, h_frac⟩,
816+
-- Since `s` is locally fraction, we can find a neighborhood `W` of `prime_spectrum.comap f p`
817+
-- in `U`, such that `s = a / b` on `W`, for some ring elements `a, b : R`.
818+
rcases hs ⟨prime_spectrum.comap f p, hUV hpV⟩ with ⟨W, m, iWU, a, b, h_frac⟩,
815819
-- We claim that we can write our new section as the fraction `f a / f b` on the neighborhood
816820
-- `(comap f) ⁻¹ W ⊓ V` of `p`.
817821
refine ⟨opens.comap (comap_continuous f) W ⊓ V, ⟨m, hpV⟩, opens.inf_le_right _ _, f a, f b, _⟩,
818822
rintro ⟨q, ⟨hqW, hqV⟩⟩,
819823
specialize h_frac ⟨prime_spectrum.comap f q, hqW⟩,
820824
refine ⟨h_frac.1, _⟩,
821-
dsimp only [structure_sheaf.comap_fun],
822-
erw [← localization.local_ring_hom_to_map ((comap f q).as_ideal), ← ring_hom.map_mul,
823-
h_frac.2, localization.local_ring_hom_to_map],
825+
dsimp only [comap_fun],
826+
erw [← localization.local_ring_hom_to_map ((prime_spectrum.comap f q).as_ideal),
827+
← ring_hom.map_mul, h_frac.2, localization.local_ring_hom_to_map],
824828
refl,
825829
end
826830

@@ -832,41 +836,41 @@ at `U` to the structure sheaf of `S` at `V`.
832836
Explicitly, this map is given as follows: For a point `p : V`, if the section `s` evaluates on `p`
833837
to the fraction `a / b`, its image on `V` evaluates on `p` to the fraction `f(a) / f(b)`.
834838
-/
835-
def structure_sheaf.comap (f : R →+* S) (U : opens (prime_spectrum.Top R))
836-
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (comap f) ⁻¹' U.1) :
839+
def comap (f : R →+* S) (U : opens (prime_spectrum.Top R))
840+
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (prime_spectrum.comap f) ⁻¹' U.1) :
837841
(structure_sheaf R).presheaf.obj (op U) →+* (structure_sheaf S).presheaf.obj (op V) :=
838-
{ to_fun := λ s, ⟨structure_sheaf.comap_fun f U V hUV s.1,
839-
structure_sheaf.comap_fun_is_locally_fraction f U V hUV s.1 s.2⟩,
842+
{ to_fun := λ s, ⟨comap_fun f U V hUV s.1, comap_fun_is_locally_fraction f U V hUV s.1 s.2⟩,
840843
map_one' := subtype.ext $ funext $ λ p, by
841-
{ rw [subtype.coe_mk, subtype.val_eq_coe, structure_sheaf.comap_fun,
842-
(sections_subring R (op U)).coe_one, pi.one_apply, ring_hom.map_one], refl },
844+
{ rw [subtype.coe_mk, subtype.val_eq_coe, comap_fun, (sections_subring R (op U)).coe_one,
845+
pi.one_apply, ring_hom.map_one], refl },
843846
map_zero' := subtype.ext $ funext $ λ p, by
844-
{ rw [subtype.coe_mk, subtype.val_eq_coe, structure_sheaf.comap_fun,
845-
(sections_subring R (op U)).coe_zero, pi.zero_apply, ring_hom.map_zero], refl },
847+
{ rw [subtype.coe_mk, subtype.val_eq_coe, comap_fun, (sections_subring R (op U)).coe_zero,
848+
pi.zero_apply, ring_hom.map_zero], refl },
846849
map_add' := λ s t, subtype.ext $ funext $ λ p, by
847-
{ rw [subtype.coe_mk, subtype.val_eq_coe, structure_sheaf.comap_fun,
848-
(sections_subring R (op U)).coe_add, pi.add_apply, ring_hom.map_add], refl },
850+
{ rw [subtype.coe_mk, subtype.val_eq_coe, comap_fun, (sections_subring R (op U)).coe_add,
851+
pi.add_apply, ring_hom.map_add], refl },
849852
map_mul' := λ s t, subtype.ext $ funext $ λ p, by
850-
{ rw [subtype.coe_mk, subtype.val_eq_coe, structure_sheaf.comap_fun,
851-
(sections_subring R (op U)).coe_mul, pi.mul_apply, ring_hom.map_mul], refl }
853+
{ rw [subtype.coe_mk, subtype.val_eq_coe, comap_fun, (sections_subring R (op U)).coe_mul,
854+
pi.mul_apply, ring_hom.map_mul], refl }
852855
}
853856

854857
@[simp]
855-
lemma structure_sheaf.comap_apply (f : R →+* S) (U : opens (prime_spectrum.Top R))
856-
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (comap f) ⁻¹' U.1)
858+
lemma comap_apply (f : R →+* S) (U : opens (prime_spectrum.Top R))
859+
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (prime_spectrum.comap f) ⁻¹' U.1)
857860
(s : (structure_sheaf R).presheaf.obj (op U)) (p : V) :
858-
(structure_sheaf.comap f U V hUV s).1 p =
859-
localization.local_ring_hom (comap f p.1).as_ideal _ f rfl (s.1 ⟨(comap f p.1), hUV p.2⟩ : _) :=
861+
(comap f U V hUV s).1 p =
862+
localization.local_ring_hom (prime_spectrum.comap f p.1).as_ideal _ f rfl
863+
(s.1 ⟨(prime_spectrum.comap f p.1), hUV p.2⟩ : _) :=
860864
rfl
861865

862-
lemma structure_sheaf.comap_const (f : R →+* S) (U : opens (prime_spectrum.Top R))
863-
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (comap f) ⁻¹' U.1)
866+
lemma comap_const (f : R →+* S) (U : opens (prime_spectrum.Top R))
867+
(V : opens (prime_spectrum.Top S)) (hUV : V.1 ⊆ (prime_spectrum.comap f) ⁻¹' U.1)
864868
(a b : R) (hb : ∀ x : prime_spectrum R, x ∈ U → b ∈ x.as_ideal.prime_compl) :
865-
structure_sheaf.comap f U V hUV (const R a b U hb) =
866-
const S (f a) (f b) V (λ p hpV, hb (comap f p) (hUV hpV)) :=
869+
comap f U V hUV (const R a b U hb) =
870+
const S (f a) (f b) V (λ p hpV, hb (prime_spectrum.comap f p) (hUV hpV)) :=
867871
subtype.eq $ funext $ λ p,
868872
begin
869-
rw [structure_sheaf.comap_apply, const_apply, const_apply],
873+
rw [comap_apply, const_apply, const_apply],
870874
erw localization.local_ring_hom_mk',
871875
refl,
872876
end
@@ -878,22 +882,23 @@ identity from OO_X(U) to OO_X(V) equals as the restriction map of the structure
878882
This is a generalization of the fact that, for fixed `U`, the comap of the identity from OO_X(U)
879883
to OO_X(U) is the identity.
880884
-/
881-
lemma structure_sheaf.comap_id_eq_map (U V : opens (prime_spectrum.Top R)) (iVU : V ⟶ U) :
882-
structure_sheaf.comap (ring_hom.id R) U V
885+
lemma comap_id_eq_map (U V : opens (prime_spectrum.Top R)) (iVU : V ⟶ U) :
886+
comap (ring_hom.id R) U V
883887
(λ p hpV, le_of_hom iVU $ by rwa prime_spectrum.comap_id) =
884888
(structure_sheaf R).presheaf.map iVU.op :=
885889
ring_hom.ext $ λ s, subtype.eq $ funext $ λ p,
886890
begin
887-
rw structure_sheaf.comap_apply,
891+
rw comap_apply,
888892
-- Unfortunately, we cannot use `localization.local_ring_hom_id` here, because
889-
-- `comap (ring_hom.id R) p` is not *definitionally* equal to `p`. Instead, we use that we can
890-
-- write `s` as a fraction `a/b` in a small neighborhood around `p`. Since
891-
-- `comap (ring_hom.id R) p` equals `p`, it is also contained in the same neighborhood, hence
892-
-- `s` equals `a/b` there too.
893+
-- `prime_spectrum.comap (ring_hom.id R) p` is not *definitionally* equal to `p`. Instead, we use
894+
-- that we can write `s` as a fraction `a/b` in a small neighborhood around `p`. Since
895+
-- `prime_spectrum.comap (ring_hom.id R) p` equals `p`, it is also contained in the same
896+
-- neighborhood, hence `s` equals `a/b` there too.
893897
obtain ⟨W, hpW, iWU, h⟩ := s.2 (iVU p),
894898
obtain ⟨a, b, h'⟩ := h.eq_mk',
895899
obtain ⟨hb₁, s_eq₁⟩ := h' ⟨p, hpW⟩,
896-
obtain ⟨hb₂, s_eq₂⟩ := h' ⟨comap (ring_hom.id _) p.1, by rwa prime_spectrum.comap_id⟩,
900+
obtain ⟨hb₂, s_eq₂⟩ := h' ⟨prime_spectrum.comap (ring_hom.id _) p.1,
901+
by rwa prime_spectrum.comap_id⟩,
897902
dsimp only at s_eq₁ s_eq₂,
898903
erw [s_eq₂, localization.local_ring_hom_mk', ← s_eq₁, ← res_apply],
899904
end
@@ -903,40 +908,42 @@ The comap of the identity is the identity. In this variant of the lemma, two ope
903908
`V` are given as arguments, together with a proof that `U = V`. This is be useful when `U` and `V`
904909
are not definitionally equal.
905910
-/
906-
lemma structure_sheaf.comap_id (U V : opens (prime_spectrum.Top R)) (hUV : U = V) :
907-
structure_sheaf.comap (ring_hom.id R) U V
908-
(λ p hpV, by rwa [hUV, prime_spectrum.comap_id]) =
911+
lemma comap_id (U V : opens (prime_spectrum.Top R)) (hUV : U = V) :
912+
comap (ring_hom.id R) U V (λ p hpV, by rwa [hUV, prime_spectrum.comap_id]) =
909913
eq_to_hom (show (structure_sheaf R).presheaf.obj (op U) = _, by rw hUV) :=
910-
by erw [structure_sheaf.comap_id_eq_map U V (eq_to_hom hUV.symm), eq_to_hom_op, eq_to_hom_map]
914+
by erw [comap_id_eq_map U V (eq_to_hom hUV.symm), eq_to_hom_op, eq_to_hom_map]
911915

912-
@[simp] lemma structure_sheaf.comap_id' (U : opens (prime_spectrum.Top R)) :
913-
structure_sheaf.comap (ring_hom.id R) U U (λ p hpU, by rwa prime_spectrum.comap_id) =
916+
@[simp] lemma comap_id' (U : opens (prime_spectrum.Top R)) :
917+
comap (ring_hom.id R) U U (λ p hpU, by rwa prime_spectrum.comap_id) =
914918
ring_hom.id _ :=
915-
by { rw structure_sheaf.comap_id U U rfl, refl }
919+
by { rw comap_id U U rfl, refl }
916920

917-
lemma structure_sheaf.comap_comp (f : R →+* S) (g : S →+* P) (U : opens (prime_spectrum.Top R))
921+
lemma comap_comp (f : R →+* S) (g : S →+* P) (U : opens (prime_spectrum.Top R))
918922
(V : opens (prime_spectrum.Top S)) (W : opens (prime_spectrum.Top P))
919-
(hUV : ∀ p ∈ V, comap f p ∈ U) (hVW : ∀ p ∈ W, comap g p ∈ V) :
920-
structure_sheaf.comap (g.comp f) U W (λ p hpW, hUV (comap g p) (hVW p hpW)) =
921-
(structure_sheaf.comap g V W hVW).comp (structure_sheaf.comap f U V hUV) :=
923+
(hUV : ∀ p ∈ V, prime_spectrum.comap f p ∈ U) (hVW : ∀ p ∈ W, prime_spectrum.comap g p ∈ V) :
924+
comap (g.comp f) U W (λ p hpW, hUV (prime_spectrum.comap g p) (hVW p hpW)) =
925+
(comap g V W hVW).comp (comap f U V hUV) :=
922926
ring_hom.ext $ λ s, subtype.eq $ funext $ λ p,
923927
begin
924-
rw structure_sheaf.comap_apply,
925-
erw localization.local_ring_hom_comp _ (comap g p.1).as_ideal,
926-
-- refl works here, because `comap (g.comp f) p` is defeq to `comap f (comap g p)`
928+
rw comap_apply,
929+
erw localization.local_ring_hom_comp _ (prime_spectrum.comap g p.1).as_ideal,
930+
-- refl works here, because `prime_spectrum.comap (g.comp f) p` is defeq to
931+
-- `prime_spectrum.comap f (prime_spectrum.comap g p)`
927932
refl,
928933
end
929934

930935
@[elementwise, reassoc] lemma to_open_comp_comap (f : R →+* S) :
931-
to_open R ⊤ ≫ structure_sheaf.comap f ⊤ ⊤ (λ p hpV, trivial) =
936+
to_open R ⊤ ≫ comap f ⊤ ⊤ (λ p hpV, trivial) =
932937
@category_theory.category_struct.comp _ _ (CommRing.of R) (CommRing.of S) _ f (to_open S ⊤) :=
933938
ring_hom.ext $ λ s, subtype.eq $ funext $ λ p,
934939
begin
935-
simp_rw [comp_apply, structure_sheaf.comap_apply, subtype.val_eq_coe, to_open_apply_coe],
940+
simp_rw [comp_apply, comap_apply, subtype.val_eq_coe, to_open_apply_coe],
936941
erw localization.local_ring_hom_to_map,
937942
refl,
938943
end
939944

940945
end comap
941946

947+
end structure_sheaf
948+
942949
end algebraic_geometry

0 commit comments

Comments
 (0)