Skip to content

feat(SheafCohomology): add API for Sheaf Cohomology#34742

Open
Brian-Nugent wants to merge 19 commits intoleanprover-community:masterfrom
Brian-Nugent:sheaf_coho
Open

feat(SheafCohomology): add API for Sheaf Cohomology#34742
Brian-Nugent wants to merge 19 commits intoleanprover-community:masterfrom
Brian-Nugent:sheaf_coho

Conversation

@Brian-Nugent
Copy link
Copy Markdown
Collaborator

@Brian-Nugent Brian-Nugent commented Feb 3, 2026

Defines the long exact sequence on cohomology associated to a short exact sequence of sheaves H.longSequence. Also defines H.equiv₀, the additive equivalence between H F 0 and ((sheafSections J AddCommGrpCat).obj (op T)).obj F when the category has a terminal object T.


Open in Gitpod

@github-actions github-actions bot added new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! large-import Automatically added label for PRs with a significant increase in transitive imports labels Feb 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

PR summary b301d257a1

Import changes exceeding 2%

% File
+30.22% Mathlib.Algebra.Category.Grp.ForgetCorepresentable
+31.97% Mathlib.CategoryTheory.Sites.Abelian

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.CategoryTheory.Sites.Abelian 804 1061 +257 (+31.97%)
Mathlib.Algebra.Category.Grp.ForgetCorepresentable 503 655 +152 (+30.22%)
Mathlib.CategoryTheory.Sites.SheafCohomology.Basic 1751 1752 +1 (+0.06%)
Import changes for all files
Files Import difference
21 files Mathlib.CategoryTheory.Abelian.GrothendieckAxioms.Sheaf Mathlib.CategoryTheory.Sites.SheafCohomology.Basic Mathlib.CategoryTheory.Sites.SheafCohomology.MayerVietoris Mathlib.Condensed.AB Mathlib.Condensed.EffectiveEpi Mathlib.Condensed.Epi Mathlib.Condensed.Explicit Mathlib.Condensed.Functors Mathlib.Condensed.Light.AB Mathlib.Condensed.Light.EffectiveEpi Mathlib.Condensed.Light.Epi Mathlib.Condensed.Light.Explicit Mathlib.Condensed.Light.InternallyProjective Mathlib.Condensed.Light.Limits Mathlib.Condensed.Light.Module Mathlib.Condensed.Light.Monoidal Mathlib.Condensed.Light.Small Mathlib.Condensed.Solid Mathlib.Topology.Sheaves.Abelian Mathlib.Topology.Sheaves.AddCommGrpCat Mathlib.Topology.Sheaves.Flasque
1
Mathlib.Condensed.Limits Mathlib.Condensed.Module 22
Mathlib.Topology.Sheaves.MayerVietoris 65
Mathlib.CategoryTheory.Sites.MayerVietorisSquare 146
Mathlib.Algebra.Category.Grp.ForgetCorepresentable 152
Mathlib.CategoryTheory.Sites.Abelian 257

Declarations diff

+ AddCommGrpCat.uliftZMultiplesAddEquiv
+ H.addEquiv₀_comp
+ H.equiv₀
+ H.equiv₀_naturality
+ H.equiv₀_symm_naturality
+ H.map
+ H.map_apply
+ H.map_comp_apply
+ H.map_id_apply
+ functorH
+ instance (F : Sheaf J AddCommGrpCat.{w}) {n : ℕ} [Injective F] : Subsingleton (H F (n + 1))
+ instance (n : ℕ) : (functorH J n).Additive
+ instance : (Functor.const Cᵒᵖ : D ⥤ Cᵒᵖ ⥤ D).Additive
+ instance : (constantSheaf J D).Additive
+ uliftZMultiplesHom.map_add

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


Increase in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
6896 1 backward.isDefEq

Current commit 868205ec99
Reference commit b301d257a1

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@Brian-Nugent Brian-Nugent requested a review from joelriou February 3, 2026 02:04
@alexjbest alexjbest removed their assignment Feb 7, 2026
@joneugster
Copy link
Copy Markdown
Contributor

you can now comment on the PR to add/remove topic labels in cases where the script does not add them correctly:

t-category-theory

@github-actions github-actions bot added the t-category-theory Category theory label Feb 7, 2026
@dagurtomas dagurtomas added the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 12, 2026
@Brian-Nugent Brian-Nugent removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 19, 2026
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 4, 2026
@Brian-Nugent Brian-Nugent removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 4, 2026
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 4, 2026
@Brian-Nugent Brian-Nugent removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 5, 2026
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 5, 2026
@Brian-Nugent Brian-Nugent removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 5, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 12, 2026
@mathlib-merge-conflicts
Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Mar 12, 2026
Copy link
Copy Markdown
Contributor

@adamtopaz adamtopaz left a comment

Choose a reason for hiding this comment

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

Sorry to keep you waiting. This is getting close now!

simp_all only [uliftZMultiplesHom_apply_apply, smul_add, AddMonoidHom.add_apply]

/-- The additive equivalence `(ℤ ⟶ G) ≃+ G` -/
def AddCommGrpCat.uliftZMultiplesAddEquiv (G : AddCommGrpCat) : (of (ULift ℤ) ⟶ G) ≃+ ↑G :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This definition needs a few API lemmas. I don't know whether @[simps!] adds useful lemmas in this case (you can check with @[simps!?]).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It looks like that added two and they look pretty useful to me. Thank you for this tip, I didn't know I could do this!

(h : n₀ + 1 = n₁)

/-- The long exact sequence on sheaf cohomology. -/
noncomputable abbrev H.longSequence (h : n₀ + 1 = n₁ := by lia) :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure this should be an abbrev. Could you say why you made it so?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I initially had it as a def then someone suggested removing it entirely and just working with Ext.covariantSequence directly, but that would cause us to have to write ((constantSheaf J AddCommGrpCat.{w}).obj (AddCommGrpCat.of.{w} (ULift ℤ))) every time so I figured making it an abbrev was a good compromise.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the way I do it in #36218 is better anyway so I can just delete it here.

@adamtopaz adamtopaz added the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 21, 2026
Comment on lines +150 to +151
theorem H.equiv₀_naturality (x : H F 0) :
f.hom.app (op T) (H.equiv₀ F hT x) = H.equiv₀ G hT (H.map f 0 x) := by
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should I tag this with @[simp]? I'm still getting used to when this is useful.

@Brian-Nugent Brian-Nugent removed the awaiting-author A reviewer has asked the author a question or requested changes. label Mar 21, 2026
@Brian-Nugent Brian-Nugent removed the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants