File: Mathlib/Algebra/Homology/ComplexShape.lean

full_name: ComplexShape
code: /-- 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.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'
goal: Type u_1

full_name: ComplexShape.Rel
code: /-- 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.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'
goal: ι → ι → Prop

full_name: ComplexShape.next_eq
code: /-- 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.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'
goal: self.Rel i j → self.Rel i j' → j = j'

full_name: ComplexShape.prev_eq
code: /-- 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.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'
goal: self.Rel i j → self.Rel i' j → i = i'

full_name: ComplexShape.refl
code: /-- 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.
-/
@[simps]
def refl (ι : Type*) : ComplexShape ι 
goal: ComplexShape ι

full_name: ComplexShape.refl_Rel
code: /-- 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.
-/
@[simps]
def refl (ι : Type*) : ComplexShape ι 
goal: (ComplexShape.refl ι).Rel i j = (i = j)

full_name: ComplexShape.symm
code: /-- The reverse of a `ComplexShape`.
-/
@[simps]
def symm (c : ComplexShape ι) : ComplexShape ι 
goal: ComplexShape ι

full_name: ComplexShape.symm_Rel
code: /-- The reverse of a `ComplexShape`.
-/
@[simps]
def symm (c : ComplexShape ι) : ComplexShape ι 
goal: c.symm.Rel i j = c.Rel j i

full_name: ComplexShape.symm_symm
code: @[simp]
theorem symm_symm (c : ComplexShape ι) : c.symm.symm = c 
goal: c.symm.symm = c

full_name: ComplexShape.symm_bijective
code: theorem symm_bijective :
    Function.Bijective (ComplexShape.symm : ComplexShape ι → ComplexShape ι) 
goal: Function.Bijective ComplexShape.symm

full_name: ComplexShape.trans
code: /-- The "composition" of two `ComplexShape`s.

We need this to define "related in k steps" later.
-/
@[simp]
def trans (c₁ c₂ : ComplexShape ι) : ComplexShape ι 
goal: ComplexShape ι

full_name: ComplexShape.subsingleton_next
code: instance subsingleton_next (c : ComplexShape ι) (i : ι) : Subsingleton { j // c.Rel i j } 
goal: Subsingleton { j // c.Rel i j }

full_name: ComplexShape.subsingleton_prev
code: instance subsingleton_prev (c : ComplexShape ι) (j : ι) : Subsingleton { i // c.Rel i j } 
goal: Subsingleton { i // c.Rel i j }

full_name: ComplexShape.next
code: /-- An arbitrary choice of index `j` such that `Rel i j`, if such exists.
Returns `i` otherwise.
-/
def next (c : ComplexShape ι) (i : ι) : ι 
goal: ι

full_name: ComplexShape.prev
code: /-- An arbitrary choice of index `i` such that `Rel i j`, if such exists.
Returns `j` otherwise.
-/
def prev (c : ComplexShape ι) (j : ι) : ι 
goal: ι

full_name: ComplexShape.next_eq'
code: theorem next_eq' (c : ComplexShape ι) {i j : ι} (h : c.Rel i j) : c.next i = j 
goal: c.next i = j

full_name: ComplexShape.prev_eq'
code: theorem prev_eq' (c : ComplexShape ι) {i j : ι} (h : c.Rel i j) : c.prev j = i 
goal: c.prev j = i

full_name: ComplexShape.next_eq_self'
code: lemma next_eq_self' (c : ComplexShape ι) (j : ι) (hj : ∀ k, ¬ c.Rel j k) :
    c.next j = j 
goal: c.next j = j

full_name: ComplexShape.prev_eq_self'
code: lemma prev_eq_self' (c : ComplexShape ι) (j : ι) (hj : ∀ i, ¬ c.Rel i j) :
    c.prev j = j 
goal: c.prev j = j

full_name: ComplexShape.next_eq_self
code: lemma next_eq_self (c : ComplexShape ι) (j : ι) (hj : ¬ c.Rel j (c.next j)) :
    c.next j = j 
goal: c.next j = j

full_name: ComplexShape.prev_eq_self
code: lemma prev_eq_self (c : ComplexShape ι) (j : ι) (hj : ¬ c.Rel (c.prev j) j) :
    c.prev j = j 
goal: c.prev j = j

full_name: ComplexShape.up'_Rel
code: /-- The `ComplexShape` allowing differentials from `X i` to `X (i+a)`.
(For example when `a = 1`, a cohomology theory indexed by `ℕ` or `ℤ`)
-/
@[simps]
def up' {α : Type*} [AddRightCancelSemigroup α] (a : α) : ComplexShape α 
goal: (ComplexShape.up' a).Rel i j = (i + a = j)

full_name: ComplexShape.up'
code: /-- The `ComplexShape` allowing differentials from `X i` to `X (i+a)`.
(For example when `a = 1`, a cohomology theory indexed by `ℕ` or `ℤ`)
-/
@[simps]
def up' {α : Type*} [AddRightCancelSemigroup α] (a : α) : ComplexShape α 
goal: ComplexShape α

full_name: ComplexShape.down'_Rel
code: /-- The `ComplexShape` allowing differentials from `X (j+a)` to `X j`.
(For example when `a = 1`, a homology theory indexed by `ℕ` or `ℤ`)
-/
@[simps]
def down' {α : Type*} [AddRightCancelSemigroup α] (a : α) : ComplexShape α 
goal: (ComplexShape.down' a).Rel i j = (j + a = i)

full_name: ComplexShape.down'
code: /-- The `ComplexShape` allowing differentials from `X (j+a)` to `X j`.
(For example when `a = 1`, a homology theory indexed by `ℕ` or `ℤ`)
-/
@[simps]
def down' {α : Type*} [AddRightCancelSemigroup α] (a : α) : ComplexShape α 
goal: ComplexShape α

full_name: ComplexShape.down'_mk
code: theorem down'_mk {α : Type*} [AddRightCancelSemigroup α] (a : α) (i j : α) (h : j + a = i) :
    (down' a).Rel i j 
goal: (ComplexShape.down' a).Rel i j

full_name: ComplexShape.up_Rel
code: /-- The `ComplexShape` appropriate for cohomology, so `d : X i ⟶ X j` only when `j = i + 1`.
-/
@[simps!]
def up (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α 
goal: (ComplexShape.up α).Rel i j = (i + 1 = j)

full_name: ComplexShape.up
code: /-- The `ComplexShape` appropriate for cohomology, so `d : X i ⟶ X j` only when `j = i + 1`.
-/
@[simps!]
def up (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α 
goal: ComplexShape α

full_name: ComplexShape.down_Rel
code: /-- The `ComplexShape` appropriate for homology, so `d : X i ⟶ X j` only when `i = j + 1`.
-/
@[simps!]
def down (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α 
goal: (ComplexShape.down α).Rel i j = (j + 1 = i)

full_name: ComplexShape.down
code: /-- The `ComplexShape` appropriate for homology, so `d : X i ⟶ X j` only when `i = j + 1`.
-/
@[simps!]
def down (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α 
goal: ComplexShape α

full_name: ComplexShape.down_mk
code: theorem down_mk {α : Type*} [AddRightCancelSemigroup α] [One α] (i j : α) (h : j + 1 = i) :
    (down α).Rel i j 
goal: (ComplexShape.down α).Rel i j

full_name: ComplexShape.instDecidableRelRelUp'
code: instance (a : α) : DecidableRel (ComplexShape.up' a).Rel 
goal: DecidableRel (ComplexShape.up' a).Rel

full_name: ComplexShape.instDecidableRelRelDown'
code: instance (a : α) : DecidableRel (ComplexShape.down' a).Rel 
goal: DecidableRel (ComplexShape.down' a).Rel

full_name: ComplexShape.instDecidableRelRelUp
code: instance : DecidableRel (ComplexShape.up α).Rel 
goal: DecidableRel (ComplexShape.up α).Rel

full_name: ComplexShape.instDecidableRelRelDown
code: instance : DecidableRel (ComplexShape.down α).Rel 
goal: DecidableRel (ComplexShape.down α).Rel