The areas / V26. Homological algebra
Mathlib.Algebra.Homology.ComplexShape
44 declarations. Mathlib docs · Source
Shapes of homological complexes
We define a structure ComplexShape ι for describing the shapes of homological complexes
indexed by a type ι.
This is intended to capture chain complexes and cochain complexes, indexed by either ℕ or ℤ,
as well as more exotic examples.
Rather than insisting that the indexing type has a succ function
specifying where differentials should go,
inside c : ComplexShape we have c.Rel : ι → ι → Prop,
and when we define HomologicalComplex
we only allow nonzero differentials d i j from i to j if c.Rel i j.
Further, we require that { j // c.Rel i j } and { i // c.Rel i j } are subsingletons.
This means that the shape consists of some union of lines, rays, intervals, and circles.
Convenience functions c.next and c.prev provide these related elements
when they exist, and return their input otherwise.
This design aims to avoid certain problems arising from dependent type theory.
In particular we never have to ensure morphisms d i : X i ⟶ X (succ i) compose as
expected (which would often require rewriting by equations in the indexing type).
Instead such identities become separate proof obligations when verifying that a
complex we've constructed is of the desired shape.
If α is an AddRightCancelSemigroup, then we define up α : ComplexShape α,
the shape appropriate for cohomology, so d : X i ⟶ X j is nonzero only when j = i + 1,
as well as down α : ComplexShape α, appropriate for homology,
so d : X i ⟶ X j is nonzero only when i = j + 1.
(Later we'll introduce CochainComplex and ChainComplex as abbreviations for
HomologicalComplex with one of these shapes baked in.)
def ComplexShape.ctorIdx E1 #
{ι : Type u_1} → ComplexShape ι → ℕ
theorem ComplexShape.mk.inj E1 #
∀ {ι : Type u_1} {Rel : ι → ι → Prop} {next_eq : ∀ {i j j' : ι}, Rel i j → Rel i j' → j = j'}
{prev_eq : ∀ {i i' j : ι}, Rel i j → Rel i' j → i = i'} {Rel_1 : ι → ι → Prop}
{next_eq_1 : ∀ {i j j' : ι}, Rel_1 i j → Rel_1 i j' → j = j'}
{prev_eq_1 : ∀ {i i' j : ι}, Rel_1 i j → Rel_1 i' j → i = i'},
{ Rel := Rel, next_eq := next_eq, prev_eq := prev_eq } =
{ Rel := Rel_1, next_eq := next_eq_1, prev_eq := prev_eq_1 } →
Rel = Rel_1
theorem ComplexShape.mk.injEq E0 #
∀ {ι : Type u_1} (Rel : ι → ι → Prop) (next_eq : ∀ {i j j' : ι}, Rel i j → Rel i j' → j = j')
(prev_eq : ∀ {i i' j : ι}, Rel i j → Rel i' j → i = i') (Rel_1 : ι → ι → Prop)
(next_eq_1 : ∀ {i j j' : ι}, Rel_1 i j → Rel_1 i j' → j = j')
(prev_eq_1 : ∀ {i i' j : ι}, Rel_1 i j → Rel_1 i' j → i = i'),
({ Rel := Rel, next_eq := next_eq, prev_eq := prev_eq } =
{ Rel := Rel_1, next_eq := next_eq_1, prev_eq := prev_eq_1 }) =
(Rel = Rel_1)
structure ComplexShape E3 #
Type u_1 → Type u_1
A c : ComplexShape ι describes the shape of a chain complex,
with chain groups indexed by ι.
Typically ι will be ℕ, ℤ, or Fin n.
There is a relation Rel : ι → ι → Prop,
and we will only allow a non-zero differential from i to j when Rel i j.
There are axioms which imply { j // c.Rel i j } and { i // c.Rel i j } are subsingletons.
This means that the shape consists of some union of lines, rays, intervals, and circles.
Below we define c.next and c.prev which provide these related elements.
theorem ComplexShape.ext_iff E0 #
∀ {ι : Type u_1} {x y : ComplexShape ι}, x = y ↔ x.Rel = y.Rel
theorem ComplexShape.ext E1 #
∀ {ι : Type u_1} {x y : ComplexShape ι}, x.Rel = y.Rel → x = y
ctor ComplexShape.mk E0 #
{ι : Type u_1} →
(Rel : ι → ι → Prop) →
(∀ {i j j' : ι}, Rel i j → Rel i j' → j = j') → (∀ {i i' j : ι}, Rel i j → Rel i' j → i = i') → ComplexShape ι
abbrev ComplexShape.Rel E1 #
{ι : Type u_1} → ComplexShape ι → ι → ι → Prop
Nonzero differentials X i ⟶ X j shall be allowed
on homological complexes when Rel i j holds.
theorem ComplexShape.next_eq E0 #
∀ {ι : Type u_1} (self : ComplexShape ι) {i j j' : ι}, self.Rel i j → self.Rel i j' → j = j'
There is at most one nonzero differential from X i.
theorem ComplexShape.prev_eq E0 #
∀ {ι : Type u_1} (self : ComplexShape ι) {i i' j : ι}, self.Rel i j → self.Rel i' j → i = i'
There is at most one nonzero differential to X j.
def ComplexShape.refl E1 #
(ι : Type u_2) → ComplexShape ι
The complex shape where only differentials from each X.i to itself are allowed.
This is mostly only useful so we can describe the relation of "related in k steps" below.
theorem ComplexShape.refl_Rel E0 #
∀ (ι : Type u_2) (i j : ι), (ComplexShape.refl ι).Rel i j = (i = j)
def ComplexShape.symm E1 #
{ι : Type u_1} → ComplexShape ι → ComplexShape ι
The reverse of a ComplexShape.
theorem ComplexShape.symm_Rel E0 #
∀ {ι : Type u_1} (c : ComplexShape ι) (i j : ι), c.symm.Rel i j = c.Rel j i
def ComplexShape.decidableRelSymm E1 #
{α : Type u_2} → (c : ComplexShape α) → [DecidableRel c.Rel] → DecidableRel c.symm.Rel
If c : ComplexShape α is such that c.Rel is decidable, it is also the
case of c.symm.Rel.
theorem ComplexShape.symm_symm E0 #
∀ {ι : Type u_1} (c : ComplexShape ι), c.symm.symm = c
theorem ComplexShape.symm_bijective E1 #
∀ {ι : Type u_1}, Function.Bijective ComplexShape.symm
def ComplexShape.trans E1 #
{ι : Type u_1} → ComplexShape ι → ComplexShape ι → ComplexShape ι
The "composition" of two ComplexShapes.
We need this to define "related in k steps" later.
instance ComplexShape.subsingleton_prev E0 #
∀ {ι : Type u_1} (c : ComplexShape ι) (i : ι), Subsingleton { j // c.Rel j i }
instance ComplexShape.subsingleton_next E0 #
∀ {ι : Type u_1} (c : ComplexShape ι) (i : ι), Subsingleton { j // c.Rel i j }
def ComplexShape.next E1 #
{ι : Type u_1} → ComplexShape ι → ι → ι
An arbitrary choice of index j such that Rel i j, if such exists.
Returns i otherwise.
def ComplexShape.prev E1 #
{ι : Type u_1} → ComplexShape ι → ι → ι
An arbitrary choice of index i such that Rel i j, if such exists.
Returns j otherwise.
theorem ComplexShape.prev_eq' E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) {i j : ι}, c.Rel j i → c.prev i = j
theorem ComplexShape.next_eq' E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) {i j : ι}, c.Rel i j → c.next i = j
theorem ComplexShape.prev_eq_self' E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) (j : ι), (∀ (k : ι), ¬c.Rel k j) → c.prev j = j
theorem ComplexShape.next_eq_self' E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) (j : ι), (∀ (k : ι), ¬c.Rel j k) → c.next j = j
theorem ComplexShape.next_eq_self E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) (j : ι), ¬c.Rel j (c.next j) → c.next j = j
theorem ComplexShape.prev_eq_self E1 #
∀ {ι : Type u_1} (c : ComplexShape ι) (j : ι), ¬c.Rel (c.prev j) j → c.prev j = j
def ComplexShape.up' E1 #
{α : Type u_2} → [inst : Add α] → [IsRightCancelAdd α] → α → ComplexShape α
The ComplexShape allowing differentials from X i to X (i+a).
(For example when a = 1, a cohomology theory indexed by ℕ or ℤ)
def ComplexShape.down' E1 #
{α : Type u_2} → [inst : Add α] → [IsRightCancelAdd α] → α → ComplexShape α
The ComplexShape allowing differentials from X (j+a) to X j.
(For example when a = 1, a homology theory indexed by ℕ or ℤ)
theorem ComplexShape.down'_Rel E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] (a j i : α), (ComplexShape.down' a).Rel j i = (i + a = j)
theorem ComplexShape.up'_Rel E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] (a i j : α), (ComplexShape.up' a).Rel i j = (i + a = j)
theorem ComplexShape.down'_mk E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] (a j i : α), i + a = j → (ComplexShape.down' a).Rel j i
theorem ComplexShape.up'_mk E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] (a i j : α), i + a = j → (ComplexShape.up' a).Rel i j
def ComplexShape.up E1 #
(α : Type u_2) → [inst : Add α] → [IsRightCancelAdd α] → [One α] → ComplexShape α
The ComplexShape appropriate for cohomology, so d : X i ⟶ X j only when j = i + 1.
theorem ComplexShape.down_Rel E0 #
∀ (α : Type u_2) [inst : Add α] [inst_1 : IsRightCancelAdd α] [inst_2 : One α] (j i : α),
(ComplexShape.down α).Rel j i = (i + 1 = j)
theorem ComplexShape.up_Rel E0 #
∀ (α : Type u_2) [inst : Add α] [inst_1 : IsRightCancelAdd α] [inst_2 : One α] (i j : α),
(ComplexShape.up α).Rel i j = (i + 1 = j)
def ComplexShape.down E1 #
(α : Type u_2) → [inst : Add α] → [IsRightCancelAdd α] → [One α] → ComplexShape α
The ComplexShape appropriate for homology, so d : X i ⟶ X j only when i = j + 1.
theorem ComplexShape.up_mk E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] [inst_2 : One α] (i j : α),
i + 1 = j → (ComplexShape.up α).Rel i j
theorem ComplexShape.down_mk E0 #
∀ {α : Type u_2} [inst : Add α] [inst_1 : IsRightCancelAdd α] [inst_2 : One α] (j i : α),
i + 1 = j → (ComplexShape.down α).Rel j i
instance ComplexShape.instDecidableRelRelUp' E0 #
(α : Type u_1) → [inst : AddRightCancelSemigroup α] → [DecidableEq α] → (a : α) → DecidableRel (ComplexShape.up' a).Rel
instance ComplexShape.instDecidableRelRelDown' E0 #
(α : Type u_1) →
[inst : AddRightCancelSemigroup α] →
[DecidableEq α] → (a : α) → DecidableRel fun a_1 a_2 ↦ (ComplexShape.down' a).Rel a_2 a_1
instance ComplexShape.instDecidableRelRelDown E0 #
(α : Type u_1) →
[inst : AddRightCancelSemigroup α] →
[DecidableEq α] → [inst_2 : One α] → DecidableRel fun a a_1 ↦ (ComplexShape.down α).Rel a_1 a
instance ComplexShape.instDecidableRelRelUp E0 #
(α : Type u_1) →
[inst : AddRightCancelSemigroup α] → [DecidableEq α] → [inst_2 : One α] → DecidableRel (ComplexShape.up α).Rel