feat(Algebra/Homology): add Euler–Poincaré formula#29713
feat(Algebra/Homology): add Euler–Poincaré formula#29713jessealama wants to merge 7 commits intoleanprover-community:masterfrom
Conversation
PR summary 9ea9209725Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
0679a12 to
c9ece47
Compare
4d1e774 to
36439f8
Compare
b48d5c1 to
d402fb9
Compare
d402fb9 to
e42702d
Compare
e42702d to
48a1b5b
Compare
fb43799 to
e04637c
Compare
|
(btw --- don't mark things as "draft" unless you specifically do not want review yet.) |
|
(My suggestions are not necessary conditions for merging this. We can generalize later.) |
Thanks for taking a look! I think working with Grothendieck groups might be a bit of a stretch, at this point. I think this is a decent result as it stands, though I definitely agree that an integer generalization is even better and should be possible. |
e04637c to
4ae31ae
Compare
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
9e4e7b7 to
413feba
Compare
413feba to
8d4bcbb
Compare
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
8d4bcbb to
e9f8473
Compare
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
|
This pull request has conflicts, please merge |
e9f8473 to
9eb54eb
Compare
resolved! |
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
…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 ℕ and up/down ℤ. New file EulerCharacteristic.lean defines eulerChar and homologyEulerChar for HomologicalComplex (ModuleCat R) c where c has an EulerCharSigns instance. Both finite and infinite sum versions are provided. Split from leanprover-community#29713 as suggested by @joelriou.
9eb54eb to
53503de
Compare
|
This pull request has conflicts, please merge |
…complexes Prove `ChainComplex.eulerChar_eq_homologyEulerChar`: for ℤ-indexed bounded chain complexes of finite-dimensional modules over a division ring, the Euler characteristic (alternating sum of dimensions) equals the homological Euler characteristic (alternating sum of homology dimensions). The proof uses a telescoping sum argument: the dimension of each chain module decomposes via rank-nullity as kernel + image, and the kernel further decomposes as homology + boundaries. The boundary terms telescope and cancel at adjacent degrees, leaving only the homology terms. This builds on the `finsum`-based Euler characteristic infrastructure from `Mathlib.Algebra.Homology.EulerCharacteristic`.
…duplication - Replace hand-rolled Subsingleton proof with ModuleCat.subsingleton_of_isZero - Delete cycles_dimension_decomposition wrapper, inline as ← homology_finrank_formula - Golf chain_dimension_decomposition proof using omega - Simplify Finset interval helpers to one-liners (ext; simp; omega) - Extract isZero_outside_Ico helper to deduplicate IsZero logic in main theorem - Generalize dimension lemmas from ChainComplex to HomologicalComplex
Reduce EulerPoincare.lean from 368 to 302 lines: - Remove/shorten docstrings on trivial and private lemmas - Inline temporary `have` bindings in `sum_Ico_alternating_shift_decomp` - Replace 36-line `calc` in `homology_finrank_formula` with direct proof - Eliminate `let`/`change` pattern in main theorem via inline lambdas - Use `rcases`/`<;>` and `exact_mod_cast` for shorter tactic blocks - Merge consecutive `rw` calls
…se existing Ico splits Remove 4 custom utility lemmas from EulerPoincare.lean and replace with: - `Finset.sum_Ico_add_sum_Ico_shift_neg_cancel` (new, in Intervals.lean) - Existing `insert_Ico_add_one_left_eq_Ico` / `insert_Ico_right_eq_Ico_add_one` - `Int.negOnePow_succ` + `Int.coe_negOnePow` for sign alternation
…r-Poincaré Replace `simp [xNext]` and `simp [xPrev]` with `simp only` followed by explicit `rw` using `next_eq'`/`prev_eq'` to satisfy the `linter.style.flexible` check.
This PR builds on the generalized Euler characteristic framework from #31121 to prove the Euler-Poincaré formula for chain complexes.
PR #31121 defines the Euler characteristic for general homological complexes. This PR specializes those definitions to ℤ-indexed chain complexes and proves the main Euler-Poincaré theorem.
Main result (in
EulerPoincare.lean)ChainComplex.eulerChar_eq_homologyEulerChar: For ℤ-indexed bounded chain complexes of finite-dimensional modules over a division ring, the alternating sum of chain dimensions equals the alternating sum of homology dimensions.Supporting lemmas
The file also provides dimension lemmas generalized to arbitrary
HomologicalComplex (ModuleCat k) c(not just ℤ-indexed chain complexes):HomologicalComplex.dFrom_zero_range/dTo_zero_range: zero range when the target/source object is zeroHomologicalComplex.dFrom_range_finrank_eq_d/dTo_range_finrank_eq_d: range ofdFrom/dTohas the same dimension as the underlying differentialHomologicalComplex.range_dTo_le_ker_dFrom: range ofdTois contained in the kernel ofdFromBuilds on: #31121
Related to: #29639, #29643, #29646