Skip to content

feat(AlgebraicGeometry/Modules): flat sheaves of modules#8

Open
chrisflav wants to merge 6 commits into
chrisflav:masterfrom
chrisflav-agents:flat-sheaves-of-modules
Open

feat(AlgebraicGeometry/Modules): flat sheaves of modules#8
chrisflav wants to merge 6 commits into
chrisflav:masterfrom
chrisflav-agents:flat-sheaves-of-modules

Conversation

@chrisflav

Copy link
Copy Markdown
Owner

Port the definition of relative flatness of a sheaf of modules on a scheme over a base from chrisflav/mathlib4#2 (closes #7).

For a morphism f : X ⟶ S and an 𝒪_X-module F, define AlgebraicGeometry.Scheme.Modules.Flat f F: at every point x, the stalk F_x is flat over the local ring 𝒪_{S, f(x)} acting through f.stalkMap x. Main results: the affine criteria flat_tilde_iff and flat_tilde_iff_of_algebra, transitivity along a flat base Flat.comp, locality on the base flat_comp_isOpenImmersion_iff, and locality on the source flat_iff_forall_openCover.

The supporting flatness lemmas are mirrored into the corresponding files: Module.compHom_smul, Module.Flat.tensor_tower, Module.flat_iff_forall_localizedModule_prime and friends, and Module.Flat.trans_compHom / Module.Flat.compHom_bijective_iff.

The two change tactics used upstream are replaced to satisfy the staging bannedTactics linter: the semilinearity proof derives directly from restrictStalkNatIso_hom_smul via Module.compHom_smul, and flatAt_restrict_iff phrases its module structures over (ι ≫ f).base u so the goal matches Module.Flat.equiv_iff without a change.

Port the definition of relative flatness of a sheaf of modules on a
scheme over a base, from chrisflav/mathlib4#2.

Adds `AlgebraicGeometry.Scheme.Modules.Flat f F`: for a morphism
`f : X ⟶ S` and an `𝒪_X`-module `F`, every stalk `F_x` is flat over the
local ring `𝒪_{S, f(x)}` acting through `f.stalkMap x`. Main results:
the affine criteria (`flat_tilde_iff`, `flat_tilde_iff_of_algebra`),
transitivity along a flat base (`Flat.comp`), locality on the base
(`flat_comp_isOpenImmersion_iff`) and on the source
(`flat_iff_forall_openCover`).

Also mirrors the supporting flatness lemmas: `Module.compHom_smul`,
`Module.Flat.tensor_tower`, `Module.flat_iff_forall_localizedModule_prime`
and friends, and `Module.Flat.trans_compHom` /
`Module.Flat.compHom_bijective_iff`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrisflav chrisflav added the awaiting-auto-review This pull request is scheduled to receive an automatic review through orchestra. label Jun 28, 2026
- Generalize `Module.Flat.tensor_tower` to a flat `S`-module `A` (not a ring/algebra)
- Derive `flat_iff_forall_localizedModule_prime` from the `_of_algebra` version and reorder
- `stalkModule`: use `abbrev`; document why the explicit instance (not `inferInstance`) is pinned
- Factor `stalkMap_comp_hom` helper and reuse it; drop semicolon-chained tactics
- `haveI` -> `have` in tactic proofs; inline the trivial `e1`
- Add module/instance docstrings; document `instModuleStalk` and the `backward.*` options

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrisflav-agent
chrisflav-agent Bot force-pushed the flat-sheaves-of-modules branch from c5b5a88 to 29f56b5 Compare June 28, 2026 21:27
Comment thread MathlibStaging/RingTheory/Flat/Stability.lean
Comment thread MathlibStaging/RingTheory/RingHom/Flat.lean
@chrisflav chrisflav removed the awaiting-auto-review This pull request is scheduled to receive an automatic review through orchestra. label Jun 28, 2026
Comment thread MathlibStaging/RingTheory/Flat/Localization.lean
Comment thread MathlibStaging/RingTheory/Flat/Localization.lean Outdated
Comment thread MathlibStaging/RingTheory/Flat/Localization.lean Outdated
Comment thread MathlibStaging/AlgebraicGeometry/Modules/Flat.lean Outdated
@chrisflav chrisflav added the awaiting-orchestra Pull request is awaiting action by orchestra. label Jun 28, 2026
- RingHom/Flat: state the bijective-scalar criterion for an Algebra + scalar
  tower (Module.Flat.iff_of_bijective_algebraMap) and derive the compHom version.
- Flat/Localization: index the local-global criterion by maximal ideals and drop
  the unused prime-indexed special case.
- AlgebraicGeometry/Modules/Flat: avoid the bare rfl in stalkMap_comp_hom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrisflav chrisflav removed the awaiting-orchestra Pull request is awaiting action by orchestra. label Jun 28, 2026
@chrisflav

Copy link
Copy Markdown
Owner Author

Fix the merge conflict and address the open review comments.

@chrisflav chrisflav added awaiting-orchestra Pull request is awaiting action by orchestra. and removed awaiting-orchestra Pull request is awaiting action by orchestra. labels Jun 30, 2026
@chrisflav

Copy link
Copy Markdown
Owner Author

Fix the merge conflict.

@chrisflav chrisflav added the awaiting-orchestra Pull request is awaiting action by orchestra. label Jun 30, 2026
@chrisflav chrisflav removed the awaiting-orchestra Pull request is awaiting action by orchestra. label Jun 30, 2026
Introduce ModuleCat.flat : ObjectProperty (ModuleCat R) with an API for
restriction of scalars (preservation along flat ring homs, reflection
along bijective ones, compatibility with composition), and redefine
Scheme.Modules.FlatAt through it, replacing the letI-based definition
and proofs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines +76 to +81
/-- The pointwise flatness condition at a single point `x ∈ X`: the stalk `F_x` is flat over the
local ring `𝒪_{S, f(x)}`, where the latter acts by restriction of scalars along the stalk map
`f.stalkMap x`. -/
def FlatAt {X S : Scheme.{u}} (f : X ⟶ S) (F : X.Modules) (x : X) : Prop :=
ModuleCat.flat (S.presheaf.stalk (f.base x))
((ModuleCat.restrictScalars (f.stalkMap x).hom).obj (F.stalk x))

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor this file by removing the morphism and S argument from FlatAt and Flat. Show that for a X-module M, the restriction of scalars of M to f^{-1} S is flat if and only if for every stalk, M_x is a flat O_{S, f(x)}-module.

@chrisflav chrisflav added the awaiting-orchestra Pull request is awaiting action by orchestra. label Jul 6, 2026
Make FlatAt/Flat absolute (flatness of F_x over 𝒪_{X,x}, no morphism/base
arguments), per review. Relative flatness over a base S via f : X ⟶ S is kept
as FlatAtOver/FlatOver (restriction of scalars along the stalk map), with
flatOver_id_iff identifying the absolute notion as the f = 𝟙 X case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrisflav chrisflav removed the awaiting-orchestra Pull request is awaiting action by orchestra. label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flat sheaves of modules

1 participant