feat(Algebra/Homology): add Euler characteristic definition for chain complexes#29646
Closed
jessealama wants to merge 1 commit intoleanprover-community:masterfrom
Closed
feat(Algebra/Homology): add Euler characteristic definition for chain complexes#29646jessealama wants to merge 1 commit intoleanprover-community:masterfrom
jessealama wants to merge 1 commit intoleanprover-community:masterfrom
Conversation
PR summary 82ba83d8bcImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
497d89e to
53df353
Compare
53df353 to
e7701ae
Compare
joelriou
reviewed
Sep 14, 2025
Contributor
Author
|
I'm not quite sure what the build error is saying. Things seem to be clean, but there's an unexplained failure at the |
07894ac to
344a309
Compare
Contributor
Author
Ah, I found the error. I needed to run |
083b947 to
ccbcb5e
Compare
joelriou
reviewed
Sep 15, 2025
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 15, 2025
- Rename eulerChar to boundedEulerChar for finite sums (0 to n-1) - Add new eulerChar as infinite sum over all naturals - Add boundedEulerChar_zero lemma for empty sum case - Add boundedEulerChar_succ lemma for induction step - Add theorem stating equivalence when modules eventually vanish (with sorry) Based on feedback from PR leanprover-community#29646
43187d5 to
18e36b1
Compare
Thanks @joelriou for suggesting a number of improvements! This introduces the Euler characteristic for chain complexes: - `boundedEulerChar`: The finite alternating sum ∑_{k=0}^{n-1} (-1)^k rank(C_k) - `eulerChar`: The infinite alternating sum ∑_{k=0}^∞ (-1)^k rank(C_k) using tsum Key lemmas: - `eulerChar_zero`: The bounded characteristic at 0 is 0 (empty sum) - `eulerChar_succ`: Recursive formula for the bounded characteristic - `eulerChar_eq_boundedEulerChar`: The two definitions agree when the complex eventually vanishes Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr>
18e36b1 to
76f9bd8
Compare
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
This PR adds the Euler-Poincaré formula for bounded chain complexes of finite-dimensional vector spaces over a field, following feedback from @joelriou in leanprover-community#29639. The main result states that for a bounded complex C that vanishes after position n: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This builds upon the Euler characteristic definitions from leanprover-community#29646. Key additions: - Basic lemmas about chain complex differentials at boundaries (dFrom 0, dTo n) - Relationship between dTo/dFrom and the underlying differentials - General telescoping lemma for alternating sums - The rank-nullity decomposition for chain complexes - The main Euler-Poincaré theorem Thanks to @joelriou for the valuable feedback that guided this implementation. Co-authored-by: joelriou <joelriou@users.noreply.github.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Adopt the exact EulerCharacteristic.lean file from PR leanprover-community#29646 to maintain consistency. This file defines the Euler characteristic of chain complexes with both bounded and infinite sum versions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the homological Euler characteristic definition needed for the Euler-Poincaré formula. This matches the structure from PR leanprover-community#29646 while including the necessary definitions for our proof. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
Add the Euler-Poincaré formula proving that for bounded complexes of finite-dimensional vector spaces, the alternating sum of dimensions equals the alternating sum of homology dimensions. This PR adds: - `EulerCharacteristic.lean`: Defines Euler characteristic for chain complexes (adopted from PR leanprover-community#29646) - `EulerPoincare.lean`: Proves the Euler-Poincaré formula - Helper lemmas in `HomologicalComplex.lean` for bounded complexes The main theorem shows that for a bounded complex C of finite-dimensional vector spaces over a field k, if C vanishes after position n, then: ∑_{i=0}^n (-1)^i dim(C_i) = ∑_{i=0}^n (-1)^i dim(H_i) This is a key result in algebraic topology and will be used as the foundation for proving Euler's polyhedron formula (Wiedijk leanprover-community#13). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Move chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean - Keep HomologicalComplex.lean unchanged This prepares for the Euler-Poincaré formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Prove boundedEulerChar_eq_homologyBoundedEulerChar theorem (Euler-Poincaré formula) - Add chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean This prepares for the Euler polyhedron formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Prove boundedEulerChar_eq_homologyBoundedEulerChar theorem (Euler-Poincaré formula) - Add chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean This prepares for the Euler polyhedron formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Prove boundedEulerChar_eq_homologyBoundedEulerChar theorem (Euler-Poincaré formula) - Add chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean This prepares for the Euler polyhedron formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 16, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Prove boundedEulerChar_eq_homologyBoundedEulerChar theorem (Euler-Poincaré formula) - Add chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean for both EulerCharacteristic and EulerPoincare This prepares for the Euler polyhedron formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
jessealama
added a commit
to jessealama/mathlib4
that referenced
this pull request
Sep 17, 2025
- Add new file Mathlib/Algebra/Homology/EulerCharacteristic.lean with: * boundedEulerChar: bounded Euler characteristic up to index n * eulerChar: infinite sum Euler characteristic * homologyBoundedEulerChar: homological Euler characteristic - Prove boundedEulerChar_eq_homologyBoundedEulerChar theorem (Euler-Poincaré formula) - Add chain complex helper lemmas to EulerPoincare.lean - Add import to Mathlib.lean for both EulerCharacteristic and EulerPoincare This prepares for the Euler polyhedron formula by defining the Euler characteristic following the approach in PR leanprover-community#29646.
Contributor
Author
|
Definitions generalized and moved to #29713 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a definition of the Euler characteristic for chain complexes.
The definition computes the Euler characteristic up to index n as the alternating sum ∑_{k=0}^n (-1)^k rank(C_k). It works over any ring R (using
Module.finrank).I'm interested in feedback on whether this is the right level of generality and whether the parameterization by index
nis the preferred approach. This definition is extracted from work on PR #29639 (Euler's polyhedron formula).This is a minimal PR containing only the definition - I thought it might be useful to discuss the design before adding lemmas and theorems.