Skip to content

[Merged by Bors] - feat: add ComplexShape.EulerCharSigns for generalized Euler characteristic#31121

Closed
jessealama wants to merge 8 commits intoleanprover-community:masterfrom
jessealama:feat/euler-char-generalized
Closed

[Merged by Bors] - feat: add ComplexShape.EulerCharSigns for generalized Euler characteristic#31121
jessealama wants to merge 8 commits intoleanprover-community:masterfrom
jessealama:feat/euler-char-generalized

Conversation

@jessealama
Copy link
Copy Markdown
Contributor

@jessealama jessealama commented Oct 31, 2025

Add ComplexShape.EulerCharSigns typeclass providing the alternating signs χ : ι → ℤˣ for Euler characteristic computations. Instances are provided for up ℕ, down ℕ, up ℤ, and down ℤ.

The Euler characteristic definition (eulerChar) uses finsum to sum over all indices, with the ComplexShape as an explicit parameter. This allows working with arbitrary index types without requiring a Fintype instance, defaulting to 0 when the support is infinite.

The GradedObject version is the primary definition, with HomologicalComplex.eulerChar and HomologicalComplex.homologyEulerChar as abbreviations that apply the graded object version to C.X and C.homology respectively.

Split from #29713 as suggested by @joelriou.

@github-actions github-actions bot added the t-algebra Algebra (groups, rings, fields, etc) label Oct 31, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 31, 2025

PR summary 088175664f

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Algebra.Homology.EulerCharacteristic (new file) 1320

Declarations diff

+ EulerCharSigns
+ eulerCharSignsDownInt
+ eulerCharSignsDownNat
+ eulerCharSignsUpInt
+ eulerCharSignsUpNat
+ finrankSupport
+ finrankSupport_subset_iff
+ homologyEulerChar
+ homologyEulerChar_eq_sum_finSet_of_finrankSupport_subset
+ mulSupport_eq_univ
+ support_eulerChar_summand
+ support_mul_of_ne_zero_left
+ support_mul_of_ne_zero_right
+ χ
+ χ_next
+ χ_prev
++ eulerChar
++ eulerChar_eq_sum_finSet_of_finrankSupport_subset

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/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).

@jessealama jessealama changed the title feat: generalize Euler characteristic using ComplexShape.EulerCharSigns feat: add ComplexShape.EulerCharSigns for generalized Euler characteristic Oct 31, 2025
@jessealama jessealama force-pushed the feat/euler-char-generalized branch 3 times, most recently from 0e6cabb to 9f13faa Compare November 5, 2025 15:10
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from 9f13faa to 3db3084 Compare November 10, 2025 08:09
@joelriou joelriou added the t-category-theory Category theory label Nov 10, 2025
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from 012aa24 to 8d67eca Compare November 12, 2025 10:28
@ocfnash ocfnash removed their assignment Nov 12, 2025
@joelriou joelriou added the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 12, 2025
@jessealama jessealama force-pushed the feat/euler-char-generalized branch 2 times, most recently from a7f8bb5 to 31ed875 Compare November 12, 2025 21:36
@jessealama jessealama requested a review from joelriou November 12, 2025 21:47
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from a27c882 to 9d20009 Compare November 14, 2025 09:12
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

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

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-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 Nov 19, 2025
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from 9d20009 to 7930a93 Compare November 20, 2025 14:01
@jessealama
Copy link
Copy Markdown
Contributor Author

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

resolved!

@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 Nov 20, 2025
@jessealama jessealama force-pushed the feat/euler-char-generalized branch 2 times, most recently from e34b02c to 08d8d31 Compare November 22, 2025 09:26
@jessealama jessealama force-pushed the feat/euler-char-generalized branch 3 times, most recently from 7fabf67 to 6e07cf2 Compare December 5, 2025 12:24
@jessealama
Copy link
Copy Markdown
Contributor Author

ping @joelriou I took a look at your comment and changed things as suggested. It's ready for another look!

@jessealama
Copy link
Copy Markdown
Contributor Author

-awaiting-author

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 30, 2026
@jessealama
Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Feb 4, 2026
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from 6a290f6 to 6f58056 Compare February 4, 2026 08:23
jessealama and others added 8 commits February 5, 2026 22:14
…istic

Add Euler characteristic for homological complexes with arbitrary index types
and shapes. The typeclass ComplexShape.EulerCharSigns provides alternating
signs for Euler characteristic computations, with instances for up/down N and
up/down Z.

Introduces GradedObject.eulerChar and GradedObject.eulerCharTsum with
ComplexShape as an explicit parameter, with HomologicalComplex versions as
abbreviations.
Co-authored-by: Robin Carlier <57142648+robin-carlier@users.noreply.github.com>
…o lemmas

Add `mulSupport_eq_univ`/`support_eq_univ` for functions that are everywhere
non-one/nonzero, and `support_mul_of_ne_zero_left/right` for products where
one factor is everywhere nonzero.

Simplify `support_eulerChar_summand` using the new lemmas.
Make finsum-based eulerChar the primary definition, remove separate
finite-sum versions. Make support_eulerChar_summand private.

Thanks @robin-carlier for the review feedback.
Add a "Junk values" section to document that `eulerChar` and related
definitions may produce junk values from `finsum` (0 for infinite support)
and `Module.finrank` (0 for modules not free of finite rank).
Co-authored-by: Robin Carlier <57142648+robin-carlier@users.noreply.github.com>
Co-authored-by: Robin Carlier <57142648+robin-carlier@users.noreply.github.com>
@jessealama jessealama force-pushed the feat/euler-char-generalized branch from 6f58056 to f77962c Compare February 5, 2026 21:14
Copy link
Copy Markdown
Contributor

@robin-carlier robin-carlier left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 6, 2026

🚀 Pull request has been placed on the maintainer queue by robin-carlier.

@mathlib-triage mathlib-triage bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Feb 6, 2026
@joelriou
Copy link
Copy Markdown
Contributor

joelriou commented Feb 6, 2026

Thanks!

bors merge

@mathlib-triage mathlib-triage bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 6, 2026
@jessealama
Copy link
Copy Markdown
Contributor Author

Thanks!

Thanks for the help!

mathlib-bors bot pushed a commit that referenced this pull request Feb 6, 2026
…istic (#31121)

Add `ComplexShape.EulerCharSigns` typeclass providing the alternating signs `χ : ι → ℤˣ` for Euler characteristic computations. Instances are provided for `up ℕ`, `down ℕ`, `up ℤ`, and `down ℤ`.

The Euler characteristic definition (`eulerChar`) uses `finsum` to sum over all indices, with the `ComplexShape` as an explicit parameter. This allows working with arbitrary index types without requiring a `Fintype` instance, defaulting to 0 when the support is infinite.

The `GradedObject` version is the primary definition, with `HomologicalComplex.eulerChar` and `HomologicalComplex.homologyEulerChar` as abbreviations that apply the graded object version to `C.X` and `C.homology` respectively.

Split from #29713 as suggested by @joelriou.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 6, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add ComplexShape.EulerCharSigns for generalized Euler characteristic [Merged by Bors] - feat: add ComplexShape.EulerCharSigns for generalized Euler characteristic Feb 6, 2026
@mathlib-bors mathlib-bors bot closed this Feb 6, 2026
michaellee94 pushed a commit to michaellee94/mathlib4 that referenced this pull request Feb 15, 2026
…istic (leanprover-community#31121)

Add `ComplexShape.EulerCharSigns` typeclass providing the alternating signs `χ : ι → ℤˣ` for Euler characteristic computations. Instances are provided for `up ℕ`, `down ℕ`, `up ℤ`, and `down ℤ`.

The Euler characteristic definition (`eulerChar`) uses `finsum` to sum over all indices, with the `ComplexShape` as an explicit parameter. This allows working with arbitrary index types without requiring a `Fintype` instance, defaulting to 0 when the support is infinite.

The `GradedObject` version is the primary definition, with `HomologicalComplex.eulerChar` and `HomologicalComplex.homologyEulerChar` as abbreviations that apply the graded object version to `C.X` and `C.homology` respectively.

Split from leanprover-community#29713 as suggested by @joelriou.
rao107 pushed a commit to rao107/mathlib4 that referenced this pull request Feb 18, 2026
…istic (leanprover-community#31121)

Add `ComplexShape.EulerCharSigns` typeclass providing the alternating signs `χ : ι → ℤˣ` for Euler characteristic computations. Instances are provided for `up ℕ`, `down ℕ`, `up ℤ`, and `down ℤ`.

The Euler characteristic definition (`eulerChar`) uses `finsum` to sum over all indices, with the `ComplexShape` as an explicit parameter. This allows working with arbitrary index types without requiring a `Fintype` instance, defaulting to 0 when the support is infinite.

The `GradedObject` version is the primary definition, with `HomologicalComplex.eulerChar` and `HomologicalComplex.homologyEulerChar` as abbreviations that apply the graded object version to `C.X` and `C.homology` respectively.

Split from leanprover-community#29713 as suggested by @joelriou.
Maldooor pushed a commit to Maldooor/mathlib4 that referenced this pull request Feb 25, 2026
…istic (leanprover-community#31121)

Add `ComplexShape.EulerCharSigns` typeclass providing the alternating signs `χ : ι → ℤˣ` for Euler characteristic computations. Instances are provided for `up ℕ`, `down ℕ`, `up ℤ`, and `down ℤ`.

The Euler characteristic definition (`eulerChar`) uses `finsum` to sum over all indices, with the `ComplexShape` as an explicit parameter. This allows working with arbitrary index types without requiring a `Fintype` instance, defaulting to 0 when the support is infinite.

The `GradedObject` version is the primary definition, with `HomologicalComplex.eulerChar` and `HomologicalComplex.homologyEulerChar` as abbreviations that apply the graded object version to `C.X` and `C.homology` respectively.

Split from leanprover-community#29713 as suggested by @joelriou.
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…istic (leanprover-community#31121)

Add `ComplexShape.EulerCharSigns` typeclass providing the alternating signs `χ : ι → ℤˣ` for Euler characteristic computations. Instances are provided for `up ℕ`, `down ℕ`, `up ℤ`, and `down ℤ`.

The Euler characteristic definition (`eulerChar`) uses `finsum` to sum over all indices, with the `ComplexShape` as an explicit parameter. This allows working with arbitrary index types without requiring a `Fintype` instance, defaulting to 0 when the support is infinite.

The `GradedObject` version is the primary definition, with `HomologicalComplex.eulerChar` and `HomologicalComplex.homologyEulerChar` as abbreviations that apply the graded object version to `C.X` and `C.homology` respectively.

Split from leanprover-community#29713 as suggested by @joelriou.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc) t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants