-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - feat: relative differentials as a presheaf of modules #14014
Closed
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
1deb982
feat: relative differentials of a presheaf of modules
joelriou 295e945
wip
joelriou 61104fd
wip
joelriou 2c46459
wip
joelriou 3852398
fixing the build
joelriou 6e8e935
Update Mathlib/Algebra/Category/ModuleCat/Presheaf.lean
joelriou 53ef31a
cleaning up
joelriou d2d73b6
new file ModuleCat/Differentials/Basic.lean
joelriou 71e7326
moved lemmas
joelriou d1acf43
fixed comment
joelriou 9735afd
universal property
joelriou 673b878
Merge branch 'presheaf-of-modules-relative-differentials' of github.c…
joelriou d60a13e
cleaning up
joelriou 0adb1f0
feat: differentials as an object in ModuleCat
joelriou dc489ba
added docstring
joelriou b62888a
added docstring
joelriou 1632ed1
Update Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean
joelriou e8447ac
Merge remote-tracking branch 'origin/modulecat-differentials-basic' i…
joelriou 19ac120
followed suggestion from code review
joelriou 4a1a300
fixing the build
joelriou 004a219
fixing the build
joelriou 4c400ed
fixing the build
joelriou 8766d69
fixing the build
joelriou cd8c062
Merge remote-tracking branch 'origin/modulecat-differentials-basic' i…
joelriou 22a9b26
fix
joelriou 18a9e66
Merge remote-tracking branch 'origin/modulecat-differentials-basic' i…
joelriou 7f19518
Merge remote-tracking branch 'origin' into presheaf-of-modules-relati…
joelriou ec03e2a
added Subsingleton instance and more API for Derivation'
joelriou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
231 changes: 231 additions & 0 deletions
231
Mathlib/Algebra/Category/ModuleCat/Differentials/Presheaf.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,231 @@ | ||||||
/- | ||||||
Copyright (c) 2024 Joël Riou. All rights reserved. | ||||||
Released under Apache 2.0 license as described in the file LICENSE. | ||||||
Authors: Joël Riou | ||||||
-/ | ||||||
import Mathlib.Algebra.Category.ModuleCat.Presheaf | ||||||
import Mathlib.Algebra.Category.ModuleCat.Differentials.Basic | ||||||
|
||||||
/-! | ||||||
# The presheaf of differentials of a presheaf of modules | ||||||
|
||||||
In this file, we define the type `M.Derivation φ` of derivations | ||||||
with values in a presheaf of `R`-modules `M` relative to | ||||||
a morphism of `φ : S ⟶ F.op ⋙ R` of presheaves of commutative rings | ||||||
over categories `C` and `D` that are related by a functor `F : C ⥤ D`. | ||||||
We formalize the notion of universal derivation. | ||||||
|
||||||
Geometrically, if `f : X ⟶ S` is a morphisms of schemes (or more generally | ||||||
a morphism of commutative ringed spaces), we would like to apply | ||||||
these definitions in the case where `F` is the pullback functors from | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
open subsets of `S` to open subsets of `X` and `φ` is the | ||||||
morphism $O_S ⟶ f_* O_X$. | ||||||
|
||||||
In order to prove that there exists a universal derivation, the target | ||||||
of which shall be called the presheaf of relative differentials of `φ`, | ||||||
we first study the case where `F` is the identity functor. | ||||||
In this case where we have a morphism of presheaves of commutative | ||||||
rings `φ' : S' ⟶ R`, we construct a derivation | ||||||
`DifferentialsConstruction.derivation'` which is universal. | ||||||
Then, the general case (TODO) shall be obtained by observing that | ||||||
derivations for `S ⟶ F.op ⋙ R` identify to derivations | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
for `S' ⟶ R` where `S'` is the pullback by `F` of the presheaf of | ||||||
commutative rings `S` (the data is the same: it suffices | ||||||
to show that the two vanishing conditions `d_app` are equivalent). | ||||||
|
||||||
-/ | ||||||
|
||||||
universe v u v₁ v₂ u₁ u₂ | ||||||
|
||||||
open CategoryTheory | ||||||
|
||||||
variable {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] | ||||||
|
||||||
namespace PresheafOfModules | ||||||
|
||||||
variable {S : Cᵒᵖ ⥤ CommRingCat.{u}} {F : C ⥤ D} {S' R : Dᵒᵖ ⥤ CommRingCat.{u}} | ||||||
(M N : PresheafOfModules.{v} (R ⋙ forget₂ _ _)) | ||||||
(φ : S ⟶ F.op ⋙ R) (φ' : S' ⟶ R) | ||||||
joelriou marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
/-- Given a morphism of presheaves of commutative rings `φ : S ⟶ F.op ⋙ R`, | ||||||
this is the type of relative `φ`-derivation of a presheaf of `R`-modules `M`. -/ | ||||||
@[ext] | ||||||
structure Derivation where | ||||||
/-- the underlying additive map `R.obj X →+ M.obj X` of a derivation -/ | ||||||
d {X : Dᵒᵖ} : R.obj X →+ M.obj X | ||||||
d_mul {X : Dᵒᵖ} (a b : R.obj X) : d (a * b) = a • d b + b • d a := by aesop_cat | ||||||
d_map {X Y : Dᵒᵖ} (f : X ⟶ Y) (x : R.obj X) : | ||||||
d (R.map f x) = M.map f (d x) := by aesop_cat | ||||||
d_app {X : Cᵒᵖ} (a : S.obj X) : d (φ.app X a) = 0 := by aesop_cat | ||||||
joelriou marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
namespace Derivation | ||||||
|
||||||
-- Note: `d_app` cannot be a simp lemma because `dsimp` would | ||||||
-- simplify the composition of functors `R ⋙ forget₂ _ _` | ||||||
attribute [simp] d_mul d_map | ||||||
|
||||||
variable {M N φ} | ||||||
|
||||||
lemma congr_d {d d' : M.Derivation φ} (h : d = d') {X : Dᵒᵖ} (b : R.obj X) : | ||||||
d.d b = d'.d b := by rw [h] | ||||||
|
||||||
variable (d : M.Derivation φ) | ||||||
|
||||||
@[simp] lemma d_one (X : Dᵒᵖ) : d.d (X := X) 1 = 0 := by | ||||||
simpa using d.d_mul (X := X) 1 1 | ||||||
|
||||||
/-- The postcomposition of a derivation by a morphism of presheaves of modules. -/ | ||||||
@[simps! d_apply] | ||||||
def postcomp (f : M ⟶ N) : N.Derivation φ where | ||||||
d := (f.app _).toAddMonoidHom.comp d.d | ||||||
d_map _ _ := by simp [naturality_apply] | ||||||
d_app {X} a := by | ||||||
dsimp | ||||||
erw [d_app, map_zero] | ||||||
|
||||||
erdOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
/-- The universal property that a derivation `d : M.Derivation φ` must | ||||||
satisfy so that the presheaf of modules `M` can be considered as the presheaf of | ||||||
(relative) differentials of a presheaf of commutative rings `φ : S ⟶ F.op ⋙ R`. -/ | ||||||
structure Universal where | ||||||
joelriou marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
/-- An absolyte derivation of `M'` descends as a morphism `M ⟶ M'`. -/ | ||||||
desc {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)} | ||||||
(d' : M'.Derivation φ) : M ⟶ M' | ||||||
fac {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)} | ||||||
(d' : M'.Derivation φ) : d.postcomp (desc d') = d' := by aesop_cat | ||||||
postcomp_injective {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)} | ||||||
(φ φ' : M ⟶ M') (h : d.postcomp φ = d.postcomp φ') : φ = φ' := by aesop_cat | ||||||
|
||||||
attribute [simp] Universal.fac | ||||||
|
||||||
instance : Subsingleton d.Universal where | ||||||
allEq h₁ h₂ := by | ||||||
suffices ∀ {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)} | ||||||
(d' : M'.Derivation φ), h₁.desc d' = h₂.desc d' by | ||||||
cases h₁ | ||||||
cases h₂ | ||||||
simp only [Universal.mk.injEq] | ||||||
ext : 2 | ||||||
apply this | ||||||
intro M' d' | ||||||
apply h₁.postcomp_injective | ||||||
simp | ||||||
|
||||||
end Derivation | ||||||
|
||||||
/-- The property that there exists a universal derivation for | ||||||
a morphism of presheaves of commutative rings `S ⟶ F.op ⋙ R`. -/ | ||||||
class HasDifferentials : Prop where | ||||||
exists_universal_derivation : ∃ (M : PresheafOfModules.{u} (R ⋙ forget₂ _ _)) | ||||||
(d : M.Derivation φ), Nonempty d.Universal | ||||||
|
||||||
/-- Given a morphism of presheaves of commutative rings `φ : S ⟶ R`, | ||||||
this is the type of relative `φ`-derivation of a presheaf of `R`-modules `M`. -/ | ||||||
abbrev Derivation' : Type _ := M.Derivation (F := 𝟭 D) φ' | ||||||
|
||||||
namespace Derivation' | ||||||
|
||||||
variable {M φ'} | ||||||
|
||||||
@[simp] | ||||||
nonrec lemma d_app (d : M.Derivation' φ') {X : Dᵒᵖ} (a : S'.obj X) : | ||||||
d.d (φ'.app X a) = 0 := | ||||||
d.d_app _ | ||||||
|
||||||
/-- The derivation relative to the morphism of commutative rings `φ'.app X` induced by | ||||||
a derivation relative to a morphism of presheaves of commutative rings. -/ | ||||||
noncomputable def app (d : M.Derivation' φ') (X : Dᵒᵖ) : (M.obj X).Derivation (φ'.app X) := | ||||||
ModuleCat.Derivation.mk (fun b ↦ d.d b) | ||||||
|
||||||
@[simp] | ||||||
lemma app_apply (d : M.Derivation' φ') {X : Dᵒᵖ} (b : R.obj X) : | ||||||
(d.app X).d b = d.d b := rfl | ||||||
|
||||||
section | ||||||
|
||||||
variable (d : ∀ (X : Dᵒᵖ), (M.obj X).Derivation (φ'.app X)) | ||||||
(d_map : ∀ ⦃X Y : Dᵒᵖ⦄ (f : X ⟶ Y) (x : R.obj X), | ||||||
(d Y).d ((R.map f) x) = (M.map f) ((d X).d x)) | ||||||
|
||||||
/-- Given a morphism of presheaves of commutative rings `φ'`, this is the | ||||||
in derivation `M.Derivation' φ'` that is given by a compatible family of derivations | ||||||
with values in the modules `M.obj X` for all `X`. -/ | ||||||
def mk : M.Derivation' φ' where | ||||||
d {X} := AddMonoidHom.mk' (d X).d (by simp) | ||||||
|
||||||
@[simp] | ||||||
lemma mk_app (X : Dᵒᵖ) : (mk d d_map).app X = d X := rfl | ||||||
|
||||||
/-- Constructor for `Derivation.Universal` in the case `F` is the identity functor. -/ | ||||||
def Universal.mk {d : M.Derivation' φ'} | ||||||
(desc : ∀ {M' : PresheafOfModules (R ⋙ forget₂ _ _)} | ||||||
(_ : M'.Derivation' φ'), M ⟶ M') | ||||||
(fac : ∀ {M' : PresheafOfModules (R ⋙ forget₂ _ _)} | ||||||
(d' : M'.Derivation' φ'), d.postcomp (desc d') = d') | ||||||
(postcomp_injective : ∀ {M' : PresheafOfModules (R ⋙ forget₂ _ _)} | ||||||
(α β : M ⟶ M'), d.postcomp α = d.postcomp β → α = β) : d.Universal where | ||||||
desc := desc | ||||||
fac := fac | ||||||
postcomp_injective := postcomp_injective | ||||||
|
||||||
end | ||||||
|
||||||
end Derivation' | ||||||
|
||||||
namespace DifferentialsConstruction | ||||||
|
||||||
/-- Auxiliary definition for `relativeDifferentials'`. -/ | ||||||
noncomputable def relativeDifferentials'BundledCore : | ||||||
BundledCorePresheafOfModules.{u} (R ⋙ forget₂ _ _) where | ||||||
obj X := CommRingCat.KaehlerDifferential (φ'.app X) | ||||||
map f := CommRingCat.KaehlerDifferential.map (φ'.naturality f) | ||||||
|
||||||
/-- The presheaf of relative differentials of a morphism of presheaves of | ||||||
commutative rings. -/ | ||||||
noncomputable def relativeDifferentials' : | ||||||
PresheafOfModules.{u} (R ⋙ forget₂ _ _) := | ||||||
(relativeDifferentials'BundledCore φ').toPresheafOfModules | ||||||
|
||||||
@[simp] | ||||||
lemma relativeDifferentials'_obj (X : Dᵒᵖ) : | ||||||
(relativeDifferentials' φ').obj X = | ||||||
CommRingCat.KaehlerDifferential (φ'.app X) := rfl | ||||||
|
||||||
-- Note: this cannot be a simp lemma because `dsimp` would | ||||||
-- simplify the composition of functors `R ⋙ forget₂ _ _` | ||||||
lemma relativeDifferentials'_map_apply {X Y : Dᵒᵖ} (f : X ⟶ Y) | ||||||
(x : CommRingCat.KaehlerDifferential (φ'.app X)) : | ||||||
(relativeDifferentials' φ').map f x = | ||||||
CommRingCat.KaehlerDifferential.map (φ'.naturality f) x := rfl | ||||||
|
||||||
lemma relativeDifferentials'_map_d {X Y : Dᵒᵖ} (f : X ⟶ Y) | ||||||
(x : R.obj X) : | ||||||
(relativeDifferentials' φ').map f (CommRingCat.KaehlerDifferential.d x) = | ||||||
CommRingCat.KaehlerDifferential.d (R.map f x) := by | ||||||
rw [relativeDifferentials'_map_apply, CommRingCat.KaehlerDifferential.map_d] | ||||||
|
||||||
/-- The universal derivation. -/ | ||||||
noncomputable def derivation' : (relativeDifferentials' φ').Derivation' φ' := | ||||||
Derivation'.mk (fun X ↦ CommRingCat.KaehlerDifferential.D (φ'.app X)) (fun X Y f x ↦ by | ||||||
rw [relativeDifferentials'_map_apply, CommRingCat.KaehlerDifferential.map_d]) | ||||||
|
||||||
/-- The derivation `derivation' φ'` is universal. -/ | ||||||
noncomputable def isUniversal' : (derivation' φ').Universal := | ||||||
Derivation'.Universal.mk | ||||||
(fun {M'} d' ↦ Hom.mk'' (fun X ↦ (d'.app X).desc) (fun X Y f ↦ | ||||||
CommRingCat.KaehlerDifferential.ext (fun b ↦ by | ||||||
dsimp [ModuleCat.ofHom] | ||||||
erw [restrictionApp_apply, restrictionApp_apply] | ||||||
simp only [relativeDifferentials'_map_d, ModuleCat.Derivation.desc_d, | ||||||
d'.app_apply, d'.d_map]))) | ||||||
(fun {M'} d' ↦ by | ||||||
ext X b | ||||||
apply ModuleCat.Derivation.desc_d) | ||||||
(fun {M} α β h ↦ by | ||||||
ext1 X | ||||||
exact CommRingCat.KaehlerDifferential.ext (Derivation.congr_d h)) | ||||||
|
||||||
instance : HasDifferentials (F := 𝟭 D) φ' := ⟨_, _, ⟨isUniversal' φ'⟩⟩ | ||||||
|
||||||
end DifferentialsConstruction | ||||||
|
||||||
end PresheafOfModules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to read this first paragraph, I found myself not knowing what S was, and actually I'm still confused mathematically. If F : C => D then F.op >>> R is a presheaf of rings on D,and I'm guessing that S is a scheme because that's what it is in the next paragraph, and now I don't know what kind of object phi is supposed to be. Please feel free to add explanations so that I understand the first paragraph :-)