/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import Mathlib.Algebra.BigOperators.Finprod
public import Mathlib.Algebra.Category.ModuleCat.Abelian
public import Mathlib.Algebra.Category.ModuleCat.Monoidal.Closed
public import Mathlib.Algebra.Category.ModuleCat.Projective
public import Mathlib.CategoryTheory.Monoidal.Tor
public import Mathlib.RingTheory.LengthSerre's intersection multiplicity
For a commutative ring R and R-modules M, N, this file defines Serre's intersection
multiplicity
$$\chi(M, N) = \sum_{i \ge 0} (-1)^i \ell_R(\operatorname{Tor}_i^R(M, N)),$$
using CategoryTheory.Tor on ModuleCat R.
The definition is meaningful when R is a regular local ring, M and N are finitely generated
and M ⊗[R] N has finite length: then Tor_i vanishes for i > dim R, so the sum is finite, and
every Tor_i has finite length, so ENat.toNat truncates nothing.
Main declarations
Module.intersectionMultiplicity R M N: the alternating sum above.
Module.intersectionMultiplicity_of_projective: if N is projective, χ(M, N) = ℓ(M ⊗ N).
Module.intersectionMultiplicity_eq_zero_of_subsingleton: if M = 0, then χ(M, N) = 0.
Module.intersectionMultiplicity_self_self: over a field k, χ(k, k) = 1.
@[expose] public sectionopen CategoryTheory Limits MonoidalCategory TensorProductuniverse unamespace Modulevariable (R : Type u) [CommRing R]
(M N : Type u) [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N]
The intersection multiplicity of two modules M and N over a commutative ring R,
$$\chi(M, N) = \sum_{i \ge 0} (-1)^i \ell_R(\operatorname{Tor}_i^R(M, N)).$$
Here Tor is CategoryTheory.Tor on ModuleCat R, the sum is a finsum over ℕ, and the
length of each Tor module is converted to a natural number by ENat.toNat.
noncomputable def intersectionMultiplicity : ℤ :=
∑ᶠ i : ℕ, (-1 : ℤ) ^ i *
(Module.length R (((Tor (ModuleCat.{u} R) i).obj (ModuleCat.of R M)).obj
(ModuleCat.of R N))).toNatvariable {R M N}
If N is projective, only Tor₀(M, N) = M ⊗ N contributes to χ(M, N).
R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Projective R Ne:((Tor (ModuleCat R) 0).obj (ModuleCat.of R M)).obj (ModuleCat.of R N) ≅ ModuleCat.of R M ⊗ ModuleCat.of R N⊢ ↑(length R ↑(ModuleCat.of R M ⊗ ModuleCat.of R N)).toNat = ↑(length R (M ⊗[R] N)).toNat
rfl All goals completed! 🐙
· R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Projective R N⊢ ∀ (x : ℕ),
x ≠ 0 → (-1) ^ x * ↑(length R ↑(((Tor (ModuleCat R) x).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0 intro i hi R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Projective R Ni:ℕhi:i ≠ 0⊢ (-1) ^ i * ↑(length R ↑(((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hi R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Projective R Nn:ℕhi:n.succ ≠ 0⊢ (-1) ^ n.succ * ↑(length R ↑(((Tor (ModuleCat R) n.succ).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
have : Subsingleton (((Tor (ModuleCat.{u} R) (n + 1)).obj (ModuleCat.of R M)).obj
(ModuleCat.of R N)) :=
ModuleCat.isZero_iff_subsingleton.mp
(isZero_Tor_succ_of_projective (ModuleCat.{u} R) (ModuleCat.of R M) (ModuleCat.of R N) n) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Projective R Nn:ℕhi:n.succ ≠ 0this:Subsingleton ↑(((Tor (ModuleCat R) (n + 1)).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ (-1) ^ n.succ * ↑(length R ↑(((Tor (ModuleCat R) n.succ).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
simp All goals completed! 🐙
If M is the zero module, then χ(M, N) = 0: the functor M ⊗ - is zero, so all its left
derived functors vanish.
theorem intersectionMultiplicity_eq_zero_of_subsingleton [Subsingleton M] :
intersectionMultiplicity R M N = 0 := by R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton M⊢ intersectionMultiplicity R M N = 0
have hM := ModuleCat.isZero_of_subsingleton (ModuleCat.of R M) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)⊢ intersectionMultiplicity R M N = 0
have hTor (i : ℕ) : IsZero (((Tor (ModuleCat.{u} R) i).obj (ModuleCat.of R M)).obj
(ModuleCat.of R N)) := by
refine IsZero.of_iso ?_ ((projectiveResolution (ModuleCat.of R N)).isoLeftDerivedObj _ i) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)i:ℕ⊢ IsZero
((HomologicalComplex.homologyFunctor (ModuleCat R) (ComplexShape.down ℕ) i).obj
((((tensoringLeft (ModuleCat R)).obj (ModuleCat.of R M)).mapHomologicalComplex (ComplexShape.down ℕ)).obj
(projectiveResolution (ModuleCat.of R N)).complex)) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ intersectionMultiplicity R M N = 0
exact ShortComplex.isZero_homology_of_isZero_X₂ _
(((tensoringRight (ModuleCat.{u} R)).obj _).map_isZero hM) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ intersectionMultiplicity R M N = 0 R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ intersectionMultiplicity R M N = 0
unfold intersectionMultiplicity R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ ∑ᶠ (i : ℕ), (-1) ^ i * ↑(length R ↑(((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
refine finsum_eq_zero_of_forall_eq_zero fun i => ?_ R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))i:ℕ⊢ (-1) ^ i * ↑(length R ↑(((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
have := ModuleCat.isZero_iff_subsingleton.mp (hTor i) R:Type uinst✝⁵:CommRing RM:Type uN:Type uinst✝⁴:AddCommGroup Minst✝³:Module R Minst✝²:AddCommGroup Ninst✝¹:Module R Ninst✝:Subsingleton MhM:IsZero (ModuleCat.of R M)hTor:∀ (i : ℕ), IsZero (((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))i:ℕthis:Subsingleton ↑(((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))⊢ (-1) ^ i * ↑(length R ↑(((Tor (ModuleCat R) i).obj (ModuleCat.of R M)).obj (ModuleCat.of R N))).toNat = 0
simp All goals completed! 🐙
Normalisation: over a field k, χ(k, k) = 1.
theorem intersectionMultiplicity_self_self (k : Type u) [Field k] :
intersectionMultiplicity k k k = 1 := by k:Type uinst✝:Field k⊢ intersectionMultiplicity k k k = 1
rw [intersectionMultiplicity_of_projective, k:Type uinst✝:Field k⊢ ↑(length k (k ⊗[k] k)).toNat = 1 k:Type uinst✝:Field k⊢ ↑(ENat.toNat 1) = 1 (TensorProduct.lid k k).length_eq, k:Type uinst✝:Field k⊢ ↑(length k k).toNat = 1 k:Type uinst✝:Field k⊢ ↑(ENat.toNat 1) = 1
Module.length_eq_one k:Type uinst✝:Field k⊢ ↑(ENat.toNat 1) = 1 k:Type uinst✝:Field k⊢ ↑(ENat.toNat 1) = 1] k:Type uinst✝:Field k⊢ ↑(ENat.toNat 1) = 1
rfl All goals completed! 🐙end Module