mathlibdocumentation

algebra.homology.complex_shape

Shapes of homological complexes #

We define a structure complex_shape ι 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 : complex_shape we have c.rel : ι → ι → Prop, and when we define homological_complex 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 add_right_cancel_semigroup, then we define up α : complex_shape α, the shape appropriate for cohomology,so d : X i ⟶ X j is nonzero only when j = i + 1, as well as down α : complex_shape α, appropriate for homology, so d : X i ⟶ X j is nonzero only when i = j + 1. (Later we'll introduce cochain_complex and chain_complex as abbreviations for homological_complex with one of these shapes baked in.)

theorem complex_shape.ext {ι : Type u_1} (x y : complex_shape ι) (h : x.rel = y.rel) :
x = y
theorem complex_shape.ext_iff {ι : Type u_1} (x y : complex_shape ι) :
x = y x.rel = y.rel
@[nolint, ext]
structure complex_shape (ι : Type u_1) :
Type u_1
• rel : ι → ι → Prop
• next_eq : ∀ {i j j' : ι}, self.rel i jself.rel i j'j = j'
• prev_eq : ∀ {i i' j : ι}, self.rel i jself.rel i' ji = i'

A c : complex_shape ι 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.

Instances for complex_shape
• complex_shape.has_sizeof_inst
@[simp]
theorem complex_shape.refl_rel (ι : Type u_1) (i j : ι) :
i j = (i = j)
def complex_shape.refl (ι : Type u_1) :

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.

Equations
@[simp]
theorem complex_shape.symm_rel {ι : Type u_1} (c : complex_shape ι) (i j : ι) :
c.symm.rel i j = c.rel j i
def complex_shape.symm {ι : Type u_1} (c : complex_shape ι) :

The reverse of a complex_shape.

Equations
@[simp]
theorem complex_shape.symm_symm {ι : Type u_1} (c : complex_shape ι) :
c.symm.symm = c
@[simp]
def complex_shape.trans {ι : Type u_1} (c₁ c₂ : complex_shape ι) :

The "composition" of two complex_shapes.

We need this to define "related in k steps" later.

Equations
@[protected, instance]
def complex_shape.subsingleton_next {ι : Type u_1} (c : complex_shape ι) (i : ι) :
subsingleton {j // c.rel i j}
@[protected, instance]
def complex_shape.subsingleton_prev {ι : Type u_1} (c : complex_shape ι) (j : ι) :
subsingleton {i // c.rel i j}
noncomputable def complex_shape.next {ι : Type u_1} (c : complex_shape ι) (i : ι) :
ι

An arbitary choice of index j such that rel i j, if such exists. Returns i otherwise.

Equations
• c.next i = dite (∃ (j : ι), c.rel i j) (λ (h : ∃ (j : ι), c.rel i j), h.some) (λ (h : ¬∃ (j : ι), c.rel i j), i)
noncomputable def complex_shape.prev {ι : Type u_1} (c : complex_shape ι) (j : ι) :
ι

An arbitary choice of index i such that rel i j, if such exists. Returns j otherwise.

Equations
• c.prev j = dite (∃ (i : ι), c.rel i j) (λ (h : ∃ (i : ι), c.rel i j), h.some) (λ (h : ¬∃ (i : ι), c.rel i j), j)
theorem complex_shape.next_eq' {ι : Type u_1} (c : complex_shape ι) {i j : ι} (h : c.rel i j) :
c.next i = j
theorem complex_shape.prev_eq' {ι : Type u_1} (c : complex_shape ι) {i j : ι} (h : c.rel i j) :
c.prev j = i
@[simp]
theorem complex_shape.up'_rel {α : Type u_1} (a i j : α) :
.rel i j = (i + a = j)
def complex_shape.up' {α : Type u_1} (a : α) :

The complex_shape allowing differentials from X i to X (i+a). (For example when a = 1, a cohomology theory indexed by or )

Equations
@[simp]
theorem complex_shape.down'_rel {α : Type u_1} (a i j : α) :
i j = (j + a = i)
def complex_shape.down' {α : Type u_1} (a : α) :

The complex_shape allowing differentials from X (j+a) to X j. (For example when a = 1, a homology theory indexed by or )

Equations
theorem complex_shape.down'_mk {α : Type u_1} (a i j : α) (h : j + a = i) :
i j
@[simp]
theorem complex_shape.up_rel (α : Type u_1) [has_one α] (i j : α) :
.rel i j = (i + 1 = j)
def complex_shape.up (α : Type u_1) [has_one α] :

The complex_shape appropriate for cohomology, so d : X i ⟶ X j only when j = i + 1.

Equations
@[simp]
theorem complex_shape.down_rel (α : Type u_1) [has_one α] (i j : α) :
i j = (j + 1 = i)
def complex_shape.down (α : Type u_1) [has_one α] :

The complex_shape appropriate for homology, so d : X i ⟶ X j only when i = j + 1.

Equations
theorem complex_shape.down_mk {α : Type u_1} [has_one α] (i j : α) (h : j + 1 = i) :
i j