+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Stable Homotopy theory
+--{: .hide}
[[!include stable homotopy theory - contents]]
=--
#### Homological algebra
+--{: .hide}
[[!include homological algebra - contents]]
=--
=--
=--

#Contents#
* table of contenta
{:toc}

## Idea

Each [[filtered object|filtering]] on an [[object]] $X$ in a suitable [[stable (∞,1)-category]] $\mathcal{C}$ (a _[[stable homotopy type]]_ $X$ such as a [[spectrum object]], in particular possibly a [[chain complex]]) induces a [[spectral sequence]] whose first page consists of the [[homotopy groups]] of the [[homotopy cofibers]] of the filtering and which under suitable conditions converges to the [[homotopy groups]] of the total object $X$.

This is a generalization of the traditional [[spectral sequence of a filtered complex]] to which it reduces for $\mathcal{C} = Ch_\bullet(\mathcal{A})$ an [[(∞,1)-category of chain complexes]] [[presentable (infinity,1)-category|presented]] in the projective [[model structure on chain complexes]]. Therefore the whole zoo of traditional spectral sequences that in turn are special cases of that of a filtered complex (see at _[spectral sequence -- Examples](spectral+sequence#Examples)_) is all subsumed by the concept of spectral sequence of a filtered stable homotopy type.

Moreover, by applying general [[(∞,1)-category theory|(∞,1)-categorical]] notion to naturally arising towers (such as the [[Whitehead tower]], the [[chromatic tower]]) it naturally produces more specialized spectral sequences (such as the [[Atiyah-Hirzebruch spectral sequence]], the [[chromatic spectral sequence]], etc.). Specifically, applied to a [[coskeleton]] tower of a dual [[Cech nerve]] of an [[E-∞ algebra]] $E$ it naturally produces the $E$-[[Adams spectral sequence]]. See the discussion of the _[Examples](#Examples)_ below.

Therefore in [[(∞,1)-category theory]] one finds a lucky coincidence of historical terminology: _[[spectral sequences]] are essentially [[sequential diagram|sequences]] of [[spectra]]_, when considered on homotopy groups.

The general construction can be summarized as follows:

+-- {: .standout}
Any [[homological functor]]

$$ \mathcal{C}\to\mathcal{A} $$

from a [[stable (∞,1)-category]] to an [[abelian category]] induces a functor

$$ Filt(\mathcal{C}) \to SpSeq(\mathcal{A}) $$

from the stable (∞,1)-category of [[filtered object in an (∞,1)-category|filtered objects]] in $\mathcal{C}$ to the abelian category of bigraded [[spectral sequence|spectral sequences]] in $\mathcal{A}$.
=--

## Definition

Let throughout $\mathcal{C}$ be a [[stable (∞,1)-category]], $\mathcal{A}$ an [[abelian category]], and $\pi \;\colon\; \mathcal{C}\longrightarrow \mathcal{A}$ a [[homological functor]] on $\mathcal{C}$, i.e., a functor that transforms every [[cofiber sequence]]

$$ X\to Y\to Z\to \Sigma X $$

in $\mathcal{C}$ into a long exact sequence

$$ \dots \to \pi(X)\to \pi(Y)\to \pi(Z)\to \pi(\Sigma X) \to \dots $$

in $\mathcal{A}$. We write $\pi_n=\pi\circ \Sigma^{-n}$.

+-- {: .num_example}
###### Example

* $\mathcal{C}$ is arbitrary, $\mathcal{A}$ is the category of [[abelian groups]] and $\pi$ is taking the 0th [[homotopy group]] $\pi_0 \mathcal{C}(S,-)$ of the [[mapping spectrum]] out of some [[object]] $S\in\mathcal{C}$

* $\mathcal{C}$ is equipped with a [[t-structure]], $\mathcal{A}$ is the [[heart of a stable (∞,1)-category|heart]] of the t-structure, and $\pi$ is the canonical functor.

* $\mathcal{C} = D(\mathcal{A})$ is the [[derived category]] of the abelian category $\mathcal{A}$ and $\pi=H_0$ is the degree-0  [[chain homology]] functor.

* Any of the above with $\mathcal{C}$ and $\mathcal{A}$ replaced by their [[opposite categories]].

=--

### (Co-)Filtered objects and their (co-)chain complexes
 {#FilteredObjectsAndTheirChainComplexes}

+-- {: .num_defn #GeneralizedFilteredObject}
###### Definition

A _[[filtered object in an (∞,1)-category]]_ in $\mathcal{C}$ is
an [[object]] $X \in \mathcal{C}$ together with
a [[sequential diagram]] $X \colon (\mathbb{Z}, \lt) \to \mathcal{C}$

$$
  \cdots
  X_{n-1} \to X_n \to X_{n+1} \to \cdots
$$

and an [[equivalence in an (infinity,1)-category|equivalence]]

$$
  X \coloneqq \underset{\rightarrow}{\lim}_n X_n
$$

between $X$ and the [[(∞,1)-colimit]] of this sequence.
(The sequence itself is _the filtering on $X$_.)

Dually, a _[[filtered object in an (∞,1)-category|co-filtered object in an (∞,1)-category]]_ in $\mathcal{C}$ is
an [[object]] $X \in \mathcal{C}$ together with
a [[sequential diagram]] $X \colon (\mathbb{Z}, \lt) \to \mathcal{C}$

$$
  \cdots
  X_{n-1} \to X_n \to X_{n+1} \to \cdots
$$

and an [[equivalence in an (infinity,1)-category|equivalence]]

$$
  X \coloneqq \underset{\leftarrow}{\lim}_n X_n
$$

between $X$ and the [[(∞,1)-limit]] of this sequence.
(The sequence itself is _the co-filtering on $X$_.)

=--

This appears as ([[Higher Algebra|Higher Algebra, def. 1.2.2.9]]).
The notions are equivalent under replacing $\mathcal{C}$ by its [[opposite category]] $\mathcal{C}^{op}$.

+-- {: .num_remark #FilteredObjectInModelCategory}
###### Remark

If $\mathcal{C}$ is [[presentable (infinity,1)-category|presented]] by a
sufficiently nice [[model category]] $C$ (for instance a [[combinatorial  model category]]), then [[(∞,1)-colimits]] in $\mathcal{C}$ are computed by [[homotopy colimits]] in $C$. These in turn are computed as ordinary [[colimits]] in $C$ over a cofibrant [[diagram]] in the [[projective model structure on functors]].

Specifically, as discussed at _[homotopy limit -- Examples -- Over sequential diagrams](homotopy+limit#SequentialHocolims)_ a cofibrant resolution of a [[sequential diagram]] $(\mathbb{N}, \leq) \to C$ is a sequential diagram all whose whose objects are cofibrant and all whose morphisms are cofibrations in $C$

$$
  \emptyset \stackrel{cof}{\to} X_0 \stackrel{cof}{\to} \cdots \to X^C_{n-1} \stackrel{cof}{\to} X_{n}^C \stackrel{cof}{\to} X_{n+1}^C \to \cdots
  \,,
$$

where $X_n^C \in C$ denotes an object in the model category presenting the given object $X_n \in \mathcal{C}$.

Moreover, in many [[model categories]] that appear in practice the cofibrations are in particular [[monomorphisms]], this is the case in particular in a projective [[model structure on chain complexes]]. In these cases then a filtering on an object $X \in \mathcal{C}$ in the abstract sense of [[(∞,1)-categories]] is presented by a [[filtered object]] $X^C \in C$ in the sense of plain [[category theory]].

The intrinsic definition \ref{GeneralizedFilteredObject} makes manifest however that the [[monomorphism]]-aspect here is just a means of a presentation of the filtering and not an intrinsic aspect of the [[homotopy theory]].

=--

+-- {: .num_defn #ChainComplexInStableInfinityCategory}
###### Definition

Let $I$ be a [[linearly ordered set]]. An _$I$-chain complex_ in a [[stable (∞,1)-category]] $\mathcal{C}$ is an [[(∞,1)-functor]]

$$
  F \;\colon\; I^{\Delta[1]} \longrightarrow \mathcal{C}
$$

from the subposet of $I \times I$ on pairs of elements $i \leq j$, such that

1. for each $n \in I$, $F(n,n) \simeq 0$ is the [[zero object]];

1. for all $i \leq j \leq k$ the induced [[diagram]]

   $$
     \array{
        & F(i,j) &\longrightarrow& F(i,k)
        \\
        & \downarrow && \downarrow
        \\
        0 \simeq & F(j,j) &\longrightarrow& F(j,k)
     }
   $$

   is a [[homotopy pushout]] square (hence equivalently, by [[stable (infinity,1)-category|stability]], a [[homotopy pullback]]).

Write

$$
  Gap(I,\mathcal{C}) \hookrightarrow Func(I^{\Delta[1]}, \mathcal{C})
$$

for the [[full sub-(∞,1)-category]] of diagrams satisfying these conditions.

=--

This is [[Higher Algebra|Higher Algebra, def. 1.2.2.2]].

+-- {: .num_remark #MoreSquaresArePushouts}
###### Remark

The conditions in def. \ref{ChainComplexInStableInfinityCategory} imply
by the [[pasting law]] that also all squares

$$
  \array{
     F(i,k) &\longrightarrow& F(i,l)
     \\
     \downarrow && \downarrow
     \\
     F(j,k) &\longrightarrow& F(j,l)
  }
$$

for all $i \leq k$ and $k \leq l$  are [[homotopy pushout]] squares.

=--

+-- {: .num_defn #ChainComplexInducedFromZComplex}
###### Definition

Given a $\mathbb{Z}$-chain complex $F$ in $\mathcal{C}$ as in def. \ref{ChainComplexInStableInfinityCategory},
define a [[sequential diagram]] in the ([[triangulated category|triangulated]]) [[homotopy category of an (infinity,1)-category|homotopy category]] $Ho(\mathcal{C})$ of $\mathcal{C}$

$$
  C_\bullet

  \;\colon\;
  (\mathbb{Z}, \leq)^{op}
    \longrightarrow
  Ho(\mathcal{C})
$$

by setting

$$
  C_n \coloneqq \Sigma^{-n} F(n-1,n) \in Ho(\mathcal{C})
$$

and taking

$$
  d_n \coloneqq \Sigma^{-n} \delta_n \;\colon\; C_n \longrightarrow C_{n-1}
$$

to be the $n$-fold de-[[suspension]] of the [[connecting homomorphisms]] of the defining [[homotopy fiber sequences]]

$$
  F(n-1,n) \to F(n-1, n+1) \to F(n,n+1)
  \,,
$$

hence the $(n+1)$-fold de-[[suspension]] of the morphism $\delta_n$  in the following [[pasting]] of [[homotopy pushouts]]

$$
  \array{
    F(n-1,n) &\longrightarrow& F(n-1,n+1) &\to& 0
    \\
    \downarrow && \downarrow && \downarrow
    \\
    0 &\longrightarrow& F(n,n+1) &\stackrel{\delta_n}{\longrightarrow}& \Sigma F(n-1,n)
  }
$$

where the total outer [[homotopy pushout]] exhibits the [[suspension]] of $F(n-1,n)$, by the [[pasting law]].

=--

+-- {: .num_prop #ZComplexInCInducedChainComplexInHoC}
###### Proposition

The sequence $C_\bullet$ in def. \ref{ChainComplexInducedFromZComplex} is a [[chain complex]] in that the $d_\bullet$ are [[differentials]], hence in that for all $n \in \mathbb{Z}$ we have that the composite

$$
  d_n \circ d_{n+1} = 0
$$

is the [[zero morphism]] in the [[triangulated category]] $Ho(\mathcal{C})$.

=--

([[Higher Algebra|Higher Algebra, remark 1.2.2.3]])

+-- {: .proof}
###### Proof

Consider the [[pasting]] [[diagram]]

$$
  \array{
    F(n-2,n) &\longrightarrow& F(n-2,n+1) &\longrightarrow& 0
    \\
    \downarrow &(c)& \downarrow && \downarrow
    \\
    F(n-1,n) &\longrightarrow& F(n-1,n+1) &\longrightarrow& 0
    \\
    \downarrow &(c)& \downarrow &(c)& \downarrow
    \\
    0 &\longrightarrow& F(n,n+1) &\underset{\delta_n}{\longrightarrow}& \Sigma F(n-1,n)
  }
$$

where the squares labeled "c" are (co-)cartesian ([[homotopy pushouts]]) ( by def. \ref{ChainComplexInducedFromZComplex} and by remark \ref{MoreSquaresArePushouts} and ).
Notice that the [[homotopy pushout]] of the outermost [[span]] gives the [[suspension]]

$$
  \array{
     F(n-2,n) &\longrightarrow& 0
     \\
     \downarrow &(c)& \downarrow
     \\
     0 &\longrightarrow& \Sigma F(n-2,n)
  }
  \,.
$$

Therefore we have two paths of morphisms of span diagrams, the first is

$$
  \left(
    \array{
       F(n-2,n) &\to& F(n-2,n+1)
       \\
       \downarrow
       \\
       0
    }
  \right)
  \to
  \left(
    \array{
       F(n-2,n) &\to& 0
       \\
       \downarrow
       \\
       0
    }
  \right)
  \to
  \left(
    \array{
       F(n-1,n) &\to& 0
       \\
       \downarrow
       \\
       0
    }
  \right)
$$

which gives on [[homotopy pushouts]]

$$
  F(n,n+1) \longrightarrow \Sigma F(n-2,n) \longrightarrow \Sigma F(n-1,n)
$$

and the second is

$$
  \left(
    \array{
       F(n-2,n) &\to& F(n-2,n+1)
       \\
       \downarrow
       \\
       0
    }
  \right)
  \to
  \left(
    \array{
       F(n-1,n) &\to& F(n-1,n+1)
       \\
       \downarrow
       \\
       0
    }
  \right)
  \to
  \left(
    \array{
       F(n-1,n) &\to& 0
       \\
       \downarrow
       \\
       0
    }
  \right)
$$

which on homotopy pushouts is

$$
  F(n,n+1) \stackrel{\simeq}{\longrightarrow} F(n,n+1) \stackrel{\delta_n}{\longrightarrow} \Sigma F(n-1,n)
$$

(all by the [[pasting law]]). By the commutativity of the original pasting diagram these two paths are equivalent. Therefore on homotopy pushouts this exhibits a factorization of $\delta_n$ through $\Sigma F(n-2,n)$:

$$
  \array{
    F(n,n+1) &\longrightarrow& \Sigma F(n-2,n)
    \\
    & {}_{\mathllap{\delta_n}}\searrow & \downarrow
    \\
    && \Sigma F(n-1,n)
  }
  \,.
$$

Pasting this to the homotopy pushout that defines $\Sigma \delta_{n-1}$

$$
  \array{
    F(n,n+1) &\longrightarrow& \Sigma F(n-2,n)  &\longrightarrow& 0
    \\
    & {}_{\mathllap{\delta_n}}\searrow & \downarrow &(c)& \downarrow
    \\
    && \Sigma F(n-1,n) &\underset{\Sigma \delta_{n-1}}{\longrightarrow}&
    \Sigma^2 F(n-2,n-1)
  }
$$

and then suspending the result $n$ times yields a diagram that exhibits a null-homotopy

$$
  d_{n-1}  \circ d_n \simeq 0
$$

in $\mathcal{C}$.

=--

The following proposition observes that the $\mathbb{Z}$-chain complexes of def. \ref{ChainComplexInStableInfinityCategory} are, despite the explict appearance of square diagrams, equivalently already determined by a [[sequential diagram]].

+-- {: .num_prop #ChainComplexesFromFilteredObjects}
###### Proposition

Consider the inclusion of [[posets]]

$$
  (\mathbb{Z}, \leq)
  \to
  (\mathbb{Z}, \leq)^{\Delta[1]}
$$

given by

$$
  n \mapsto (-\infty, n)
  \,.

$$

The induced [[(∞,1)-functor]]

$$
  Func((\mathbb{Z}\cup \{-\infty\}, \leq)^{\Delta[1]} , \mathcal{C})
  \longrightarrow
  Func((\mathbb{Z}, \leq), \mathcal{C})
$$

restricts to an [[equivalence of (∞,1)-categories|equivalence]] between the (∞,1)-category $Gap(\mathbb{Z},\mathcal{C})$ of $\mathbb{Z}\cup \{\infty\}$-chain complexes in $\mathcal{C}$ (def. \ref{ChainComplexInStableInfinityCategory}) and that of filtered objects in $\mathcal{C}$ (def. \ref{GeneralizedFilteredObject}). The equivalence is given by left and right [[(∞,1)-Kan extension]].

=--

This is [[Higher Algebra|Higher Algebra, lemma 1.2.2.4]].

+-- {: .num_remark #FromSequencesToZComplexes}
###### Remark

The inverse functor can be described informally as follows:

given a filtered object $X_\bullet$, the associated chain complex $X(\bullet,\bullet)$ is given by taking each entry $X(n,n+r)$ to be given by the [[homotopy cofiber]] of $X_n \to X_{n+r}$

$$ X(n, n+r) = \operatorname{cofib}(X_n\to X_{n+r})$$

because that makes the squares

$$
  \array{
    & X(-\infty,n) &\longrightarrow& X(-\infty,n+r)
    \\
    & \downarrow && \downarrow
    \\
    0 \simeq & X(n, n) &\longrightarrow& X(n,n+r)
  }
$$

be [[homotopy pushout]] squares.

=--

### Spectral sequence of a filtered object
 {#SpectralSequenceOfAFilteredObject}

We discuss now how in the presence of [[sequential colimits]],
every [[filtered object in an (infinity,1)-category|filtered object]]
induces a [[spectral sequence]] which converges to its [[homotopy groups]], equipped with the induced filtering. The discussion for co-filtered objects is formally dual, but also spelled out [below](#SpectralSequenceOfACofilteredObject), for reference.

+-- {: .num_remark #LongExactSequencesOfHomotopyGroups}
###### Remark

Let $X_\bullet$ be a filtered object in the sense of def. \ref{GeneralizedFilteredObject}. Write $X(\bullet,\bullet)$ for the corresponding $\mathbb{Z}$-complex, according to prop. \ref{ChainComplexesFromFilteredObjects}.
Then for all $i \leq j \leq k$ there is a [[long exact sequence of homotopy groups]] in $\mathcal{A}$ of the form

$$
  \cdots \to
  \pi_n X(i,j)
  \to
  \pi_n X(i,k)
  \to
  \pi_n X(j,k)
  \to
  \pi_{n-1}X(i,j)
  \to \cdots
  \,.
$$

=--

+-- {: .num_defn #TheSpectralSequence}
###### Definition

Define for $p,q \in \mathbb{Z}$ and $r \geq 1$ an object $E_r^{p,q} \in \mathcal{A}$ by the canonical [epi-mono factorization](abelian+category#FactorizationOfMorphisms)

$$
    \pi_{p+q} X(p-r,p)
    \twoheadrightarrow
    E_r^{p,q}
    \hookrightarrow
    \pi_{p+q} X(p-1, p+r-1)
$$

in the [[abelian category]] $\mathcal{A}$, of the morphism $X((p-r,p) \leq (p-1,p+r-1))$, so that $E_r^{p,q}$ is the [[image]] of this morphism. Moreover, define [[morphisms]]

$$
  d_r \;\colon\; E_r^{p,q} \to E_r^{p-r, q+r-1}
$$

to be the restriction (the [[image]] on morphisms) of the [[connecting homomorphism]]

$$
  \array{
     \pi_{p+q} X(p-r, p)
     &\longrightarrow&
     E_r^{p,q}
     &\longrightarrow&
     \pi_{p+q} X(p-1, p+r-1)
     \\
     {}^{\mathllap{\delta}}\downarrow && \downarrow^{\mathrlap{d_r}} && \downarrow^{\mathrlap{\delta}}
     \\
     \pi_{p+q-1} X(p-2r, p-r)
     &\longrightarrow&
     E_r^{p-r,q+r-1}
     &\longrightarrow&
     \pi_{p+q-1} X(p-r-1, p-1)
  }
$$

in the [[long exact sequence of homotopy groups]] of remark \ref{LongExactSequencesOfHomotopyGroups},

* on the left for the case $(i \leq j \leq k) = (p-2r \leq p - r \leq p)$

* on the right for the case $(i \leq j \leq k) = (p - r - 1 \leq p - 1 \leq p + r - 1)$.

=--

+-- {: .num_remark #FirstPageOfTheSpectralSequence}
###### Remark

For $r = 1$ def. \ref{TheSpectralSequence} reduces to

$$
  \begin{aligned}
    E_1^{p,q}
      & \simeq
    \pi_{p+q} X(p-1,p)
      \\
      & \simeq
    \pi_{q} (\Sigma^{-p} X(p-1,p))
      \\
      & \simeq
    \pi_{q} (C_{p})
  \end{aligned}
$$

where $C_p$ is the $p$th element in the [[chain complex]]
associated with $X(\bullet,\bullet)$
according to def. \ref{ChainComplexInducedFromZComplex}.

=--

([[Higher Algebra|Higher Algebra, construction 1.2.2.6]])

+-- {: .num_prop #ExistenceOfTheSpectralSequence}
###### Proposition

In def. \ref{TheSpectralSequence}
we have $d^r\circ d^r = 0$ for all $r \geq 1$ and all $p,q \in \mathbb{Z}$.

Moreover, there are [[natural isomorphisms]]
(natural in $X_\bullet$)

$$
  E_{r+1}^{p,q}
  \simeq
  \frac{
   ker(d_r \colon E_r^{p,q} \to E_r^{p-r, q+r-1})
  }{
   im(d_r \colon E_r^{p+r, q-r+1} \to E_r^{p,q})
  }
  \,.
$$

Thus, $\{E_r^{\bullet,\bullet}\}_{r\geq 1}$ is a homology [[spectral sequence]]  in the [[abelian category]] $\mathcal{A}$, functorial in the filtered object $X_\bullet$, with first page

$$
  \begin{aligned}
    E_1^{p,q}
     &=
    \pi_{p+q} \operatorname{cofib}(X_{p-1}\to X_{p})
    \\
    & \simeq \pi_q (C_p)
  \end{aligned}
  \,.
$$

=--

([[Higher Algebra|Higher Algebra, prop. 1.2.2.7]])

+-- {: .proof}
###### Proof

Since $d_r$ is by definition the [[image]] morphism of a [[connecting homomorphism]], for showing $d_r \circ d_r = 0$ it suffices to show that the connecting homomorphisms compose to the [[zero morphism]],
$\delta_r \circ \delta_r \simeq 0$. This is the same argument
as in the proof of prop. \ref{ZComplexInCInducedChainComplexInHoC}, generalized from vertical steps of length 1 to vertical steps of length $r$.

Explicitly, we have the pasting diagram

$$
  \array{
    F(p-2r,p) &\longrightarrow& F(p-2r,p+1) &\longrightarrow& 0
    \\
    \downarrow &(c)& \downarrow && \downarrow
    \\
    F(p-r,n) &\longrightarrow& F(p-r,p+1) &\longrightarrow& 0
    \\
    \downarrow &(c)& \downarrow &(c)& \downarrow
    \\
    0 &\longrightarrow& F(p,p+r) &\underset{\delta_r}{\longrightarrow}& \Sigma F(p-r,p)
  }
$$

where the squares labeled "c" are (co-)cartesian ([[homotopy pushouts]]).
By the [[universal property]] of the pushout, this induces a factorization

$$
  \array{
    F(p,p+1) &\longrightarrow& \Sigma F(p-2r,p)
    \\
    & {}_{\mathllap{\delta_r}}\searrow & \downarrow
    \\
    && \Sigma F(p-r,p)
  }
  \,.
$$

Pasting this in turn to the homotopy pushout that defines $\Sigma \delta_{p-r}$

$$
  \array{
    F(p,p+1) &\longrightarrow& \Sigma F(p-2r,p)  &\longrightarrow& 0
    \\
    & {}_{\mathllap{\delta_r}}\searrow & \downarrow &(c)& \downarrow
    \\
    && \Sigma F(p-r,p) &\underset{\Sigma \delta_{r}}{\longrightarrow}&
    \Sigma^2 F(p-2r,p-1)
  }
$$

and then suspending the result $n$ times yields a diagram that exhibits a null-homotopy

$$
  \delta_{r}  \circ \delta_r \simeq 0
$$

in $\mathcal{C}$.

Next, to show the homology isomorphisms; consider for fixed $p,q,r$ the usual abbreviation

$$
  C \coloneqq E_r^{p,q}
$$

for the $r$-relative [[chains]],

$$
   Z \coloneqq ker(d_r \colon E_r^{p,q} \to E_r^{p-r, q+r-1})
$$

for the $r$-relative [[cycles]] and

$$
  B \coloneqq im(d_r \colon E_r^{p+r, q-r+1} \to E_r^{p,q})
$$

for the $r$-relative boundaries, all in bidegree $p,q$.

We claim that the canonical maps induce a sequence of morphisms in $\mathcal{A}$ of the form

$$
  \pi_{p+q} X(p-r-1, p)
   \stackrel{\phi}{\to}
  Z
   \stackrel{\phi'}{\to}
  Z/B
   \stackrel{\psi'}{\to}
  C/B
   \stackrel{\psi}{\to}
  \pi_{p+q} X(p-1, p+r)
$$

and that $\phi'\circ \phi$ is an [[epimorphism]] and $\psi \circ \phi'$ is a [[monomorphism]]. By the uniqueness of the [[image]] factorization in the [[abelian category]] $\mathcal{A}$, this will prove the proposition.

To see that $\pi_{p+q} X(p-r-1,p)$ is indeed in the [[kernel]] of $d_r$ consider the [[commuting diagram]]

$$
  \array{
    \pi_{p+q} X(p-r-1,p) &\longrightarrow& \pi_{p+q-1} X(p-2r, p- r-1)
    \\
    \downarrow && \downarrow & \searrow
    \\
    \pi_{p+q} X(p-r, p) &\longrightarrow& \pi_{p+q-1}X(p-2r, p-r)
    \\
    \downarrow && \downarrow
    \\
    E_r^{p,q} &\stackrel{d_r}{\longrightarrow}& E_r^{p-r, q+r-1}
    && \pi_{p+q-1} X(p - 2r, p-r)
    \\
    && \downarrow & \swarrow
    \\
    && \pi_{p+q-1} X(p - r - 1, p - 1)
  }
  \,.
$$

Since the bottom right morphism is a [[monomorphism]] by construction, the claim is equivalently that the total composite from top-left to bottom right is zero. By commutativity of the diagram this factors through the composite from top-right to bottom-right. As indicated, this in turn factors through two consecutive morphisms of an $(i \leq j \leq k)$-square, which by definition of $\mathbb{Z}$-chain complex is null-homotopic.

By a dual argument one has that $\pi_{p+q}X(p-1, p+r)$ is in the [[coimage]] of $d_r$. This shows that we indeed have the above sequence of morphisms $\stackrel{\phi}{\to}\stackrel{\phi'}{\to}\stackrel{\psi'}{\to}\stackrel{\psi}{\to}$.

It now remains to show that $\phi$ is an [[epimorphism]] (dually $\psi$ will be a [[monomorphism]].) (...[[Higher Algebra|Higher Algebra, p. 41]]...)

=--

We can now consider the convergence of the spectral sequence of prop. \ref{ExistenceOfTheSpectralSequence}. To state that efficiently, first consider the following definition

+-- {: .num_defn #FilteringOnHomotopyGroups}
###### Definition

Given a [[filtered object in an (∞,1)-category|filtered object]], def. \ref{GeneralizedFilteredObject}, $X \simeq \underset{\longrightarrow}{\lim}_n X_n \in \mathcal{C}$, say that the induced [[filtered object|filtering]] on its [[homotopy groups]] $F^\bullet \pi_\bullet X$ is given by the [[images]] of the homotopy groups of the [[strata]] of $X$

$$
  F^p \pi_{p+q}X
   \coloneqq
  im\left(
    \pi_{p+q} X_{p} \to \pi_{p+q} X
  \right)
  \,\,\,
  \in \mathcal{A}
  \,.
$$

=--

([[Higher Algebra|Higher Algebra, p. 43]])

+-- {: .num_prop #ConvergenceOfTheSpectralSequence}
###### Proposition

Assume that  $\mathcal{C}$ admits all [[sequential colimits]] and that $\pi$ preserves these. Let $X \simeq \underset{\longrightarrow}{\lim}_n X_n$ be a [[filtered object in an (∞,1)-category|filtered object]], def. \ref{GeneralizedFilteredObject}, for filtering with $X_{n \lt 0} \simeq 0$. Then the spectral sequence of prop. \ref{ExistenceOfTheSpectralSequence}, converges to the [[homotopy groups]] of $X$

$$

    E_1^{p,q}
    =
    \pi_{p+q} \operatorname{cofib}(X_{p-1}\to X_{p})
    \simeq \pi_q (C_p)
    \;\;\Rightarrow\;\;
    \pi_{p+q} X
  \,,
$$

where the first page is identified following remark \ref{FirstPageOfTheSpectralSequence}.

In detail, for all $p,q \in \mathbb{Z}$ the [[differentials]] $d_r \colon E_r^{p,q} \to E_r^{p-r, q+r-1}$ vanish for $r \gt p$, and the [[colimit]] (in $\mathcal{A}$)

$$
  E^{p,q}_\infty \coloneqq \underset{\longrightarrow}{\lim}_{r \gt p} E_r
$$

is [[isomorphism|isomorphic]] to the [[associated graded object]] of the filtered homotopy groups of def. \ref{FilteringOnHomotopyGroups}:

$$
  E^{p,q}_\infty \simeq F^p \pi_{p+q}(X) / F^{p-1} \pi_{p+q}(X)
  \,.
$$

=--

This is due to ([[Higher Algebra|Higher Algebra, prop. 1.2.2.14]]). A quick review is in ([Wilson 13, theorem 1.2.1](#Wilson13)).

+-- {: .proof}
###### Proof

The assumption $X_{n \lt 0} \simeq 0$  implies that for $i,j \lt 0$ we have, by remark \ref{FromSequencesToZComplexes},

$$
  X(i,j) \simeq cofib(X_i \to X_j) \simeq 0 \;\;\;\; for\, i,j \lt 0
$$

and therefore it follows that $E_r^{p-r,q+r-1}$, being a [[quotient]] of $\pi_{p+q} X(p-2r, p-r)$, vanishes for $r \gt p$.

The same assumption implies that

$$
  X(p-r,p) \simeq X_p \;\;\;\; for\, p \gt r
$$

and so $E_\infty^{p,q}$ is

$$
  E_\infty^{p,q}
    \simeq
  im\left(
    \pi_{p+q} X_p \to \pi_{p+q} Y
  \right)
$$

for

$$
  Y \coloneqq \underset{\longrightarrow}{\lim}_r X(p-1,p+r)
  \,.
$$

We need to show that this image is the [[associated graded object]] of the filtered homotopy groups.

To that end, observe that the [[homotopy fiber sequences]]

$$
  X_{p-1} \to X_{p+r} \to X(p-1,p+r)
$$

for all $r$ give a homotopy fiber sequence under the colimit over $r$ of the form

$$
  X_{p-1} \to X \to Y
  \,.
$$

The corresponding [[long exact sequence of homotopy groups]]
truncates on the left to read

$$
  0 \to F^{p-1} \pi_{p+q}(X) \stackrel{ker(f')}{\hookrightarrow} \pi_{p+q} X \stackrel{f'}{\to} \pi_{p+q}Y
  \,.
$$

By construction the morphism $f'$ appearing here factors the morphism $f$ whose image we need to compute as

$$
  \array{
    && \pi_{p+q}X
    \\
    & {}^{\mathllap{g}}\nearrow && \searrow^{\mathrlap{f'}}
    \\
    \pi_{p+q} X(p)
    &&
      \stackrel{f}{\longrightarrow}
    &&
    \pi_{p+q} Y
  }
$$

Using these relation we can now express $E_\infty^{p,q} \simeq im(f)$ as:

$$
  \begin{aligned}
    E_\infty^{p,q}
      & \simeq
    im(f)
      \\
      & \simeq
    im(f'|_{im(g)})
      \\
      & \simeq
    im(f'|_{F^p \pi_{p+q} X})
      \\
       & \simeq
     F^p \pi_{p+q}X/ker(f')
      \\
      & \simeq
     F^p \pi_{p+q} X/F^{p-1} \pi_{p+q}X
  \end{aligned}
  \,.
$$

=--

+-- {: .num_remark}
###### Remark

While historically the appearances of the root "spectr-" in "[[spectral sequence]]" and in "[[spectrum]]" ([[stable homotopy types]]) are unrelated,
prop. \ref{ExistenceOfTheSpectralSequence} and prop. \ref{ConvergenceOfTheSpectralSequence} say that there is a lucky coincidence of terminology:

_Every sequence of spectra manifests itself on homotopy groups in a spectral sequence_.

Moreover, the discussion below in _[Examples](#Examples)_ shows that also conversely, essentially every spectral sequence that appears in practice comes from a sequence of spectra this way.

(See also the title of ([Wilson 13](#Wilson13))).

=--

+-- {: .num_remark }
###### Remark

The spectral sequence above itself only actually depends to the [[triangulated category|triangulated]] [[homotopy category of an (infinity,1)-category|homotopy category]] $Ho(\mathcal{C})$. But its $\infty$-functorial dependence on the filtered object needs the full structure of the [[(∞,1)-category]] $\mathcal{C}$

=--

### Spectral sequence of a cofiltered object
 {#SpectralSequenceOfACofilteredObject}

We discuss here the dual notion to the spectral sequence
of a filtered object above, now for a cofiltered object.

> The following does not just dualize but also change the indexing convention on top of dualization. Needs further discussion/harmonization.

+-- {: .num_prop}
###### Proposition

Consider the inclusion of [[posets]]

$$
  (\mathbb{Z}, \leq)
  \to
  (\mathbb{Z}\cup \{\infty\}, \leq)^{\Delta[1]}
$$

given by

$$
  n \mapsto (n,\infty)
  \,.

$$

The induced [[(∞,1)-functor]]

$$
  Func((\mathbb{Z}\cup \{\infty\}, \leq)^{\Delta[1]}, \mathcal{C})
  \longrightarrow
  Func((\mathbb{Z}, \leq), \mathcal{C})
$$

restricts to an [[equivalence of (∞,1)-categories|equivalence]] between the (∞,1)-category of $\mathbb{Z}\cup \{\infty\}$-chain complexes in $\mathcal{C}$ (def. \ref{ChainComplexInStableInfinityCategory}) and that of generalized filtered objects in $\mathcal{C}$ (def. \ref{GeneralizedFilteredObject}).

=--

Given a filtered object $X_\bullet$, the associated chain complex $X(\bullet,\bullet)$ is given by the [[homotopy fiber]]

$$ X(n, n+r) = \operatorname{fib}(X_n\to X_{n+r}). $$

+-- {: .num_defn #ExactCoupleForFilteredObject}
###### Definition

For a cofiltered object $X_\bullet$, def. \ref{GeneralizedFilteredObject}, write

$$
  K_n \coloneqq fib(X_n \to X_{n+1})
$$

for the [[homotopy fiber]] of the $n$th structure map, for all $n \in \mathbb{Z}$, and define an [[exact couple]]

$$
  \array{
    && \pi_\bullet(K_\bullet)
    \\
    & \swarrow && \nwarrow
    \\
    \pi_\bullet(X_\bullet)
    &&
       \stackrel{}{\longrightarrow}
    &&
    \pi_\bullet(X_\bullet)
  }
$$

where the maps are given by the long exact sequences

$$
  \cdots
  \to
  \pi_\bullet(X_{n+1})
  \to
  \pi_\bullet(K_n) \to  \pi_\bullet(X_n) \to \pi_\bullet(X_{n+1}) \to \pi_{\bullet+1}(K_n) \to \cdots
$$

=--

This exact couple gives rise in the usual way to a spectral sequence.

Let $X_\bullet$ be a cofiltered object.

+-- {: .num_defn }
###### Definition

Define for $p,q \in \mathbb{Z}$ and $r \geq 1$ the object $E^r_{p,q}$ by the canonical [epi-mono factorization](abelian+category#FactorizationOfMorphisms)

$$
    \pi_{p} X(q-r+1,q+1)
    \twoheadrightarrow
    E^r_{p,q}
    \hookrightarrow
    \pi_{p} X(q, q+r)
$$

in the abelian category $\mathcal{A}$, and define the [[differential]]

$$
  d^r \;\colon\; E_{p,q}^r \to E_{p-1, q-r}^r
$$

to be the restriction of the [[connecting homomorphism]]

$$
 \pi_{p} X(q,q+r) \to \pi_{p-1} X(q-r, q)
$$

from the long exact sequence of remark \ref{LongExactSequencesOfHomotopyGroups},
for the case  $i=q-r$, $j=q$, and $k=q+r$.

=--

+-- {: .num_prop}
###### Proposition

$d^r\circ d^r = 0$ and there are natural (in $X_\bullet$) isomorphisms

$$
E^{r+1}\cong \operatorname{ker}(d^r)/\operatorname{im}(d^r).
$$

Thus, $\{E^r_{*,*}\}_{r\geq 1}$ is a bigraded [[spectral sequence]]  in the [[abelian category]] $\mathcal{A}$, functorial in the filtered object $X_\bullet$, with

$$ E^1_{p,q} = \pi_p \operatorname{fib}(X_q\to X_{q+1}), \qquad d^r: E^r_{p,q}\to E^r_{p-1,q-r}. $$

=--

If [[sequential limits]] and [[sequential colimits]] exist in $\mathcal{A}$, we can form the limiting term $E^\infty_{*,*}$ of this spectral sequence.

On the other hand, the [[graded object]] $\pi_\bullet (X)$ admits a [[filtered object|filtration]] by

$$ F_q \pi_p (X) = \operatorname{ker}(\pi_p (X)\to \pi_p(X_q)) $$

and we would like to compare $E^\infty_{*,*}$ with the [[associated graded]] of this filtration. We say that

+-- {: .num_defn #WeakAndStrongConvergence}
###### Definition

The spectral sequence **converges weakly** if there is a canonical isomorphism

$$ E^\infty_{p,q} \cong F_q\pi_p(X)/ F_{q-1}\pi_p(X) $$

for every $p,q\in\mathbb{Z}$.

We say that the spectral sequence **converges strongly** if it converges weakly and if, in addition, the filtration $F_\bullet\pi_p(X)$ is complete on both sides, that is:

$$
\underset{\rightarrow}{\lim}_q F_q\pi_p (X)
\simeq
\pi_p(X)
\simeq
\underset{\leftarrow}{\lim}_q F^q\pi_p (X),
$$

where $F^\bullet$ is the cofiltration.

=--

+-- {: .num_remark}
###### Remark

The meaning of the word *canonical* in def. \ref{WeakAndStrongConvergence} is somewhat subtle since, in general, there is no map from one side to the other. However, there always exists a canonical *[[relation]]* between the two, and we ask that this relation be an isomorphism (see [Hilton-Stammbach, VIII.7](#HiltonStammbach)).

=--

+-- {: .num_prop #FiltrationSpectralSequence}
###### Proposition

Let $\mathcal{C}$ be a [[stable (∞,1)-category]] and let $\pi:\mathcal{C}\to\mathcal{A}$ be a homological functor where $\mathcal{A}$ is an [[abelian category]] which admits [[sequential limits]]. Let $X_\bullet$ be a filtered object in $\mathcal{C}$ such that $\underset{\leftarrow}{\lim} X_\bullet$ exists. Suppose further that:

1. For every $n$, the diagram $r\mapsto \operatorname{fib}(X_{n-r}\to X_n)$ has a limit in $\mathcal{C}$ and that limit is preserved by $\pi$.
2. For every $n$, $\pi_n(X_r)=0$ for $r\gg 0$.

Then the [[spectral sequence]] $\{E^r_{*,*}\}_{r\geq 1}$ in $\mathcal{A}$ converges strongly (def. \ref{WeakAndStrongConvergence}). We write:

$$
  E_{p,q}^1
  =
  \pi_{p} \operatorname{fib}(X_q\to X_{q+1})
  \Rightarrow
  \pi_{p} (\underset{\leftarrow}{\lim} X_\bullet)
$$

=--

There is also a dual statement in which limits are replaced by colimits, but it is in fact a special case of the proposition with $\pi$ replaced by $\pi^{op}$. A proof of this proposition (in dual form) is given in ([[Higher Algebra|Higher Algebra, prop. 1.2.2.14]]). Review is in ([Wilson 13, theorem 1.2.1](#Wilson13)).

## Examples
 {#Examples}

### General

[[!include Lurie spectral sequences -- table]]

+-- {: .num_example }
###### Example

For $\mathcal{A}$ a good [[abelian category]] and $\mathcal{C} = Ch_\bullet(\mathcal{A})$ the [[(∞,1)-category of chain complexes]] in $\mathcal{A}$, we recover, by \ref{FilteredObjectInModelCategory},
the traditional notion of a _[[spectral sequence of a filtered complex]]_.

=--

([[Higher Algebra|Higher Algebra, example 1.2.2.11]]).

+-- {: .num_example }
###### Example

Let $\mathcal{C} = Spec^{op}$ be the opposite (∞,1)-category of spectra, let $\mathcal{A}$ be the opposite category of abelian groups, and let $\pi$ be the functor $[K,-]$ where $K$ is spectrum. Then condition (1) in Proposition \ref{FiltrationSpectralSequence} holds for all filtered objects if and only if $K$ is a [[finite spectrum]]. When the filtered object is the [[Whitehead tower]] of a spectrum $E$, the associated spectral sequence is the [[Atiyah-Hirzebruch spectral sequence]] with target $E^*(K)$. It is thus strongly convergent if $K$ is a finite spectrum.

=--

+-- {: .num_example #SpectralSequenceOfASimplicialStableHomotopyType}
###### Example

For $\mathcal{C}$ a [[stable (∞,1)-category]] and $X_\bullet$ a [[simplicial object in an (∞,1)-category]] in $\mathcal{C}$, then the [[simplicial skeleta]] of $X$ give it the structure of a [[filtered object in an (∞,1)-category]]. The corresponding [[spectral sequence of a filtered stable homotopy type]] has as its first page the [[Moore complexes]] of the corresponding [[simplicial objects]] of [[homotopy groups]].

See at _[[spectral sequence of a simplicial stable homotopy type]]_.

=--

As a special case of example \ref{SpectralSequenceOfASimplicialStableHomotopyType} we have:

+-- {: .num_example }
###### Example

The $E$-based [[Adams spectral sequence]] that approximates homotopy classes of maps between two spectra $X$ and $Y$ using a [[ring spectrum]] $E$ is a special case of the above spectral sequence, with $\mathcal{C}=Spec$, $\pi=[X,-]$, and the filtered object associated with the cosimplicial spectrum $E^{\wedge\bullet+1}\wedge Y$. Bousfield's theorems on the convergence of the Adams spectral sequence can be rephrased as giving sufficient conditions on $X$, $Y$, and $E$ for condition (1) in Proposition \ref{FiltrationSpectralSequence} to hold (see [Bousfield, Theorems 6.6 and 6.10](#Bousfield)).

See _[[J-homomorphism and chromatic homotopy]]_ for an exposition.

=--

### Canonical cosimplicial resolution of $E_\infty$-algebras
 {#CanonicalCosimplicialResolutionOfEInfinityAlgebras}

We discuss now the special case of coskeletally filtered
totalizations coming from the canonical cosimplicial objects
induced from [[E-∞ algebras]] (dual [[Cech nerves]]/[[Sweedler corings]]/[[Amitsur complexes]]).

In this form this appears as ([Lurie 10, theorem 2](#LurieLecture)). A review is in ([Wilson 13, 1.3](#Wilson13)). For the analog of this in the traditional formulation see ([Ravenel, ch. 3, prop. 3.1.2](#Ravenel)).

+-- {: .num_defn #FiltrationOfTotalizationByTotalizationOfCoskeleta}
###### Definition

Given an [[cosimplicial object in an (∞,1)-category]]  with [[(∞,1)-colimits]]

$$
  Y \;\colon\; \Delta  \longrightarrow \mathcal{C}
$$

its [[totalization]] $Tot Y \simeq \underset{\leftarrow}{\lim}_n Y_n$
is [[filtered object in an (infinity,1)-category|filtered]], def. \ref{GeneralizedFilteredObject}, by the
totalizations of its [[coskeleta]]

$$
  Tot Y
  \to
  \cdots
  \to
  Tot (cosk_2 Y)
  \to
  Tot (cosk_1 Y)
  \to
  Tot (cosk_0 Y)
  \to 0
  \,.
$$

=--

+-- {: .num_defn #SpectralSequenceOfSimplicialStableHomotopyType}
###### Definition

The [[spectral sequence of a filtered stable homotopy type|filtration spectral sequence]], prop. \ref{FiltrationSpectralSequence},
applied to the filtration of a [[totalization]] by [[coskeleton|coskeleta]] as in def. \ref{FiltrationOfTotalizationByTotalizationOfCoskeleta}, we call the _[[spectral sequence of a simplicial stable homotopy type]]_.

=--

([[Higher Algebra|Higher Algebra, prop. 1.2.4.5]])

+-- {: .num_prop #E2PageByMooreComplex}
###### Proposition

The [[spectral sequence of a simplicial stable homotopy type]] has as first page/$E_1$-term the [[cohomology groups]] of the [[Moore complex]] associated with the [[cosimplicial objects]] of [[homotopy groups]]

$$
  E_2^{p,q}
  =
  H^p(\pi_q(Tot (cosk_\bullet(Y))))
  \Rightarrow
  \pi_{p-q} Tot(Y)
  \,.
$$

=--

By the discussion at _[[∞-Dold-Kan correspondence]]_ and _[[spectral sequence of a filtered stable homotopy type]]_. This appears as ([[Higher Algebra|Higher Algebra, remark 1.2.4.4]]). Review is around  ([Wilson 13, theorem 1.2.4](#Wilson13)).

+-- {: .num_defn}
###### Definition

Let $S$ be an [[E-∞ ring]] and let $E$ be an [[E-∞ algebra]] over $S$, hence an [[E-∞ ring]] equipped with a [[homomorphism]]

$$
  S \longrightarrow E
  \,.
$$

The _canonical [[cosimplicial object]]_
associated to this (the $\infty$-[[Cech nerve]]/[[Sweedler coring]]/[[Amitsur complex]]) is that given by the iterated [[smash product]]/[[tensor product]] over $S$:

$$
  E^{\wedge^{\bullet+1}_S} \;\colon\; \Delta \to \mathcal{C}
  \,.
$$

More generally, for $X$ an $S$-[[∞-module]], the canonical [[cosimplicial object]] is

$$
  E^{\wedge^{\bullet+1}_S}\wedge_S X \;\colon\; \Delta \to \mathcal{C}
  \,.
$$

=--

+-- {: .num_prop #FlatnessCondition}
###### Proposition

If $E$ is such that the self-[[generalized homology]]
$E_\bullet(E) \coloneqq \pi_\bullet(E \wedge_S E)$ (the dual $E$-[[Steenrod operations]]) is such that as a [[module]] over $E_\bullet \coloneqq \pi_\bullet(E)$ it is a [[flat module]], then there is a [[natural equivalence]]

$$
  \pi_\bullet
  \left(
    E^{\wedge^{n+1}_S}
    \wedge_S
    X
  \right)
  \simeq
  E_\bullet(E^{\wedge^n_S})
  \otimes_{E_\bullet}
  E_\bullet(X)
  \,.
$$

=--

Reviewed for instance as ([Wilson 13, prop. 1.3.1](#Wilson13)).

+-- {: .num_remark}
###### Remark

This makes $(E_\bullet, E_\bullet(E))$ be
the [[commutative Hopf algebroid]]
formed by the  $E$-[[Steenrod algebra]]. See there for more on this.

=--

+-- {: .num_example}
###### Example

The condition in prop. \ref{FlatnessCondition} is
satisfied for

* $E = H \mathbb{F}_p$ an [[Eilenberg-MacLane spectrum]] with $mod\;p$ [[coefficients]];

* $E = B P$ the [[Brown-Peterson spectrum]];

* $E = MU$ the [[complex cobordism cohomology theory|complec cobordism spectrum]].

It is NOT satisfied for

* $E = H \mathbb{Z}$ the [[Eilenberg-MacLane spectrum]] for [[integer|integers]] [[coefficients]];

* $E = M S U$.

=--

+-- {: .num_remark #ExtGroupsByMooreComplex}
###### Remark

Under good conditions (...), $\pi_\bullet$ of the canonical [[cosimplicial object]] provides a [[resolution]] of [[comodule]] [[tensor product]] and hence computes the [[Ext]]-groups over the [[commutative Hopf algebroid]]:

$$
  H^p(\pi_q(Tot(cosk_\bullet(E^{\wedge^{\bullet+1}_S } \wedge_S X))))
  \simeq
  Ext^p_{E_\bullet(E)}(\Sigma^q E_\bullet, E_\bullet(X))
  \,.
$$

(...)

=--

+-- {: .num_remark #CanonicalMapFromELocalizationToTotalization}
###### Remark

There is a canonical map

$$
  L_E X \stackrel{}{\longrightarrow} \underset{\leftarrow}{\lim}_n (E^{\wedge^{n+1}_S}\wedge_S X)
$$

from the $E$-[[Bousfield localization of spectra]] of $X$ into the [[totalization]].

=--

([Lurie 10, lecture 30, prop. 1](LurieLecture))

We consider now conditions for this morphism to be an [[equivalence]].

+-- {: .num_defn #CoreOfARing}
###### Definition

For $R$ a [[ring]], its _core_ $c R$ is the [[equalizer]] in

$$
  c R
    \longrightarrow
  R
    \stackrel{\longrightarrow}{\longrightarrow}
  R \otimes R
  \,.
$$

=--

+-- {: .num_prop #SufficientConditionsForTotalizationToBeELocalization}
###### Proposition

Let $E$ be a [[connective spectrum|connective]] [[E-∞ ring]] such that the core or $\pi_0(E)$, def. \ref{CoreOfARing} is either of

* the [[localization of a ring|localization]] of the [[integers]] at a set $J$ of [[primes]], $c \pi_0(E) \simeq \matbb{Z}[J^{-1}]$;

* $\mathbb{Z}_n$ for $n \geq 2$.

Then the map in remark \ref{CanonicalMapFromELocalizationToTotalization} is an equivalence

$$
  L_E X \stackrel{\simeq}{\longrightarrow}
  \underset{\leftarrow}{\lim}_n (E^{\wedge^{n+1}_S}\wedge_S X)
  \,.
$$

=--

([Bousfield 79](Bousfield+localization+of+spectra#Bousfield79), [Lurie 10, lecture 30, prop. 3](LurieLecture), [Lurie 10, lecture 31, ](LurieLecture)).

## Related concepts

[[!include filtered objects -- contents]]

## References

The general theory is set up in section 1.2.2 of

* [[Jacob Lurie]], _[[Higher Algebra]]_.

A quick exposition of that is for instance in section 1.2 of

* [[Dylan Wilson]] _Spectral Sequences from Sequences of Spectra: Towards the Spectrum of the Category of Spectra_ lecture at [2013 Pre-Talbot Seminar](http://math.northwestern.edu/~htanaka/pretalbot2013/index.php) ([pdf](http://math.northwestern.edu/~htanaka/pretalbot2013/notes/2013-03-21-Dylan-Wilson-ANSS.pdf))
 {#Wilson13}

The case of the derived category of an arbitrary abelian category is discussed in details in Chapter VIII of

* P. Hilton, U. Stammbach, *A Course in Homological Algebra*, Graduate Texts in Mathematics 4
{#HiltonStammbach}

The traditional discussion of the [[Adams spectral sequence]] in this style originates in

* [[Aldridge Bousfield]], *The localization of spectra with respect to homology*, Topology vol 18 (1979) ([pdf](http://www.math.uwo.ca/~mfrankla/Bousfield_LocalnSpectraHomol.pdf))
{#Bousfield}

see also at _[[Bousfield localization of spectra]]_. The formulation of this in modern [[chromatic homotopy theory]] is discussed in

* [[Jacob Lurie]], _[[Chromatic Homotopy Theory]]_, lecture notes (2010)
 {#LurieLecture}

[[!redirects spectral sequence of a filtered object in a stable (∞,1)-category]]
[[!redirects spectral sequence of a filtered object in a stable (infinity,1)-category]]

[[!redirects filtered stable homotopy type]]
[[!redirects filtered stable homotopy types]]

[[!redirects Lurie spectral sequence]]
[[!redirects Lurie spectral sequences]]

[[!redirects spectral sequence of a filtered spectrum]]
[[!redirects spectral sequence of a cofiltered spectrum]]

[[!redirects spectral sequences of filtered spectra]]


spectral sequence of a simplicial stable homotopy type

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Stable Homotopy theory
+--{: .hide}
[[!include stable homotopy theory - contents]]
=--
#### Homological algebra
+--{: .hide}
[[!include homological algebra - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

For $\mathcal{C}$ a [[stable (∞,1)-category]] and $X_\bullet$ a [[simplicial object in an (∞,1)-category]] in $\mathcal{C}$, then the [[simplicial skeleta]] of $X$ give it the structure of a [[filtered object in an (∞,1)-category]]. The corresponding [[spectral sequence of a filtered stable homotopy type]] has as its first page the [[Moore complexes]] of the corresponding [[simplicial objects]] of [[homotopy groups]].

## Examples

* for the [[Cech nerve]] of an [[E-∞ algebra]] $E$ this yields the $E$-[[Adams spectral sequence]].

## Related concepts

[[!include Lurie spectral sequences -- table]]

## References

The general theory is developed in

* [[Jacob Lurie]], section 1.2.4 of _[[Higher Algebra]]_

Quick review is in

* {#Wilson13} [[Dylan Wilson]] section 1.2 of _Spectral Sequences from Sequences of Spectra: Towards the Spectrum of the Category of Spectra_ lecture at _[2013 Pre-Talbot Seminar](http://math.northwestern.edu/~htanaka/pretalbot2013/index.php)_ ([pdf](http://math.northwestern.edu/~htanaka/pretalbot2013/notes/2013-03-21-Dylan-Wilson-ANSS.pdf))


spectral sequence of a tower of fibrations

#Contents#
* table of contents
{:toc}

## Idea

Given a [[tower of fibrations]] of [[homotopy types]], its degreewise [[homotopy groups]] naturally form an [[exact couple]]. The [induced spectral sequence](exact+couple#SpectralSequencesFromExactCouples) is the [[spectral sequence]] of the tower.

[[!include Lurie spectral sequences -- table]]

## Related concepts

[[!include filtered objects -- contents]]

## References

* [[Paul Goerss]], [[Rick Jardine]], section VI.2 (in the 1999 version) or section VII.6 (in the 1996 version) of _[[Simplicial homotopy theory]]_

* [[Mike Shulman]], _[[homotopytypetheory:spectral sequences]]_ (2013)

[[!redirects tower spectral sequence]]
[[!redirects tower spectral sequences]]


spectral sequences in homotopy type theory

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
#### Homotopy theory
+-- {: .hide}
[[!include homotopy - contents]]
=--
=--
=--

> This page is about formalizing the notion of [[spectral sequences]] in [[homotopy type theory]].  For now, it contains mainly a fixed version of two blog posts, one at the [n-category cafe](http://golem.ph.utexas.edu/category/2013/08/what_is_a_spectral_sequence.html) and the other on the [HoTT blog](http://homotopytypetheory.org/2013/08/08/spectral-sequences/). For more see the References [below](#References).

# Spectral sequences in homotopy type theory
* table of contents
{: toc}

## What is a spectral sequence?

There are many answers to "what is a [[spectral sequence]]?", but the one I'm proposing right now is the following analogy.  (In my experience, category theorists tend to like analogies --- possibly because, as John Baez once said, every sufficiently good analogy is yearning to become a functor.  This one is no exception.)

> Spectral sequences are to long exact sequences as iterated extensions are to extensions.

(Without knowing anything else, the terminology suggests that spectral sequences could also be called "iterated long exact sequences".)

There are four phrases here that I need to explain, and two more concepts that have a ghostly presence (fibration sequences and iterated fibration sequences).  First of all, an *extension* is a sequence of morphisms of abelian groups (for simplicity --- more generally we could be in any abelian category):
$$ A \xrightarrow{f} B \xrightarrow{g} C$$
such that $f$ is the inclusion of the kernel of $g$, and $g$ is the quotient of $B$ by the image of $f$.  Equivalently, $f$ is injective, $g$ is surjective, and the image of $f$ is equal to the kernel of $g$.  The simplest example is
$$ A \xrightarrow{(id,0)} A\oplus C \xrightarrow{proj_2} C.$$
An extension that's isomorphic to one of this form is said to be *split*.  In general, we can regard an extension as exhibiting $B$ as "put together" in some more general way from $A$ and $C$; we say that $B$ is an "extension of $C$ by $A$".  The underlying set of $B$ is always isomorphic to the cartesian product $A\times C$, so we can think of $B$ as a sort of "twisted product" of $A$ and $C$.  (In fact, as usual in this sort of situtaion, the twisting is measured by a cohomology class, living in $Ext^1(C,A)$, but we won't need that today.)

Thinking of $B$ as put together from $A$ and $C$, we can draw certain conclusions about the one from the other, or the other from the one.  The most obvious is that if $A=C=0$, then also $B=0$.  The converse also holds: if $B=0$, then $A=C=0$.  If only $A=0$, then we can conclude $B=C$, and similarly if $C=0$ we have $A=B$.  We can also say fancier things of this sort, e.g. $B$ is finite, or finitely generated, if and only if both $A$ and $C$ are.

Next, a *long exact sequence* (LES) is a longer sequence of morphisms of abelian groups
$$ \cdots \xrightarrow{f_{n+1}} A_{n+1} \xrightarrow{f_n} A_n \xrightarrow{f_{n-1}} \cdots $$
such that for each $n$, the image of $f_n$ is equal to the kernel of $f_{n-1}$ (called "exactness at $A_n$").  The sequence might be infinite or finite in either direction.  How are LES's related to extensions?  Well, one obvious relationship is that an extension can equivalently be described as an exact sequence of the form
$$ 0 \to A \xrightarrow{f} B \xrightarrow{g} C \to 0$$
(a "short exact sequence"), since in such a sequence, exactness at $A$ just means injectivity of $f$, and exactness at $C$ just means surjectivity of $g$.  However, what I want to focus on instead is the basic homotopical origin of LES's, namely fibration sequences.  A *fibration sequence* is a sequence of maps of pointed spaces
$$ X \xrightarrow{f} Y \xrightarrow{g} Z $$
such that $f$ is (up to homotopy) the inclusion of the homotopy fiber of $g$ over the basepoint.  (By "space" I really mean "$\infty$-groupoid", which a classical topologist could read as "topological space up to weak homotopy equivalence" or "simplicial set up to weak homotopy equivalence", and a homotopy type theorist could read as "type".)  The simplest example is
$$ X \to X\times Z \to Z,$$
the "trivial bundle" over $Z$ with fiber $X$.  In general, we can think of $Y$ as being "put together" from $X$ and $Z$ in some more general way, as a "twisted product".  Note that this is very similar to how we think of an extension, except that we've replaced our abelian groups with spaces.

Of course, a space is not exactly an abelian group, but it contains many abelian groups, namely its homotopy groups.  So we might expect that if $Y$ is a twisted product of $X$ and $Z$ as above, that its homotopy groups $\pi_n(Y)$ would be twisted products of $\pi_n(X)$ and $\pi_n(Z)$, i.e. that there would be extensions $\pi_n(X) \to \pi_n(Y) \to \pi_n(Z)$.  This is not true, since the various dimensions $n$ can "interact" in a nontrivial way; but instead we have a *long* exact sequence
$$ \cdots \to \pi_{n+1}(X) \to \pi_{n+1}(Y) \to \pi_{n+1}(Z) \to \pi_n(X) \to \pi_n(Y) \to \pi_n(Z) \to \cdots. $$
This LES can be regarded as expressing a way in which the groups $\pi_n(Y)$, considered as a whole, are "put together" out of the $\pi_n(X)$'s and $\pi_n(Z)$'s.  We get some of the same sorts of results, e.g. if $\pi_n(X)=0$ for all $n$, then $\pi_n(Y) = \pi_n(Z)$ for all $n$, and dually.  But some different things happen, e.g. if $\pi_n(Y)=0$ for all $n$, rather than $\pi_n(X) = 0 = \pi_n(Z)$ we get $\pi_n(X) = \pi_{n+1}(Z)$ for all $n$ (and indeed, if $Y$ is contractible, then $X = \Omega Z$).

Another way to express the LES of a fibration, which looks more like what we'll see for spectral sequences later on, is that there exist maps $\delta_n : \pi_n(Z) \to \pi_{n-1}(X)$ and extensions
$$ im(\delta_{n+1}) \to \pi_n(Y) \to ker(\delta_n). $$
In other words, instead of $\pi_n(Y)$ being put together from $\pi_n(X)$ and $\pi_n(Z)$, it's put together from a *subgroup* of $\pi_n(Z)$ and a *quotient* of $\pi_n(X)$.  This allows us to fulfil the yearnings of the analogy between fibration sequences and extensions: for each $n$ there's a functor from the category of fibration sequences to the category of extensions, sending $X\to Y\to Z$ to the above extension.

Of course, $\pi_n$ is only an abelian group for $n\ge 2$.  Some of what we do with abelian groups can be extended to the case of groups ($n=1$) and pointed sets ($n=0$), but I don't want to get into that.  Feel free to assume all spaces are simply connected.  Another way to avoid nonabelianness is to replace spaces with *spectra*, in which case $\pi_n$ is an abelian group not only for all $n\ge 0$ but for all $n\in \mathbb{Z}$.  In this case, the LES of a fibration sequence extends infinitely in both directions.

Now let's move on to the other side of the analogy, starting with iterated extensions.  By an *iterated extension* I mean a sequence of extensions of the following form:
$$\array{
  \vdots \\
  A_{s+1} \to B_{s+1} \to B_s\\
  A_s \to B_{s} \to B_{s-1} \\
  A_{s-1} \to B_{s-1} \to B_{s-2}\\
  \vdots
}$$
The intent here is to regard $B :\equiv \lim (\cdots \to B_{s+1} \to B_s \to \cdots)$ as "put together" from the $A_s$'s and from $C :\equiv \colim (\cdots \to B_{s+1} \to B_s \to \cdots)$.  In many cases, the sequence of $A_s$'s will be eventually zero in one direction or the other, so that the sequence of $B_s$'s will similarly be eventually constant.  Eventual constancy as $s\to\infty$ implies that $B$ is the eventual value, while eventual constancy as $s\to-\infty$ implies that $C$ is that eventual value.  In the latter case it simplifies things with no essential loss of generality to end with
$$\array{
  \vdots \\
  A_{1} \to B_{1} \to B_0\\
  B_0 \to B_{0} \to 0 \\
  0 \to 0 \to 0 \\
  \vdots
}$$
so that $C=0$ and the $A_s$'s are the only "ingredients" of $B$ (with $A_0 = B_0$).  I'm going to focus mostly on the case where this holds and the sequence is also eventually constant in the other direction, so we have only finitely many extensions.  In this case it's easy to draw some of the same sorts of conclusions as in a single extension, e.g. $B=0$ if and only if all $A_s=0$, and so on; the general case is sometimes trickier but often works out, although "$\lim^1$" terms start to pop up.

It's more common to describe iterated extensions in terms of *filtrations*.  From any iterated extension as above, we have a sequence of subgroups
$$ \cdots \subseteq F_s B \subseteq F_{s-1} B \subseteq \cdots \subseteq B $$
where $F_s B$ is the kernel of the projection $B \to B_s$.  Since this projection is surjective, we have $B_s = B/F_s B$, and hence $A_s = F_{s-1} B/F_s B$.  Thus, the whole iterated extension can be recovered from the filtration:
$$\array{
  \vdots\\
  F_s B / F_{s+1} B \to B / F_{s+1}B \to B/F_s B\\
  F_{s-1} B / F_{s} B \to B / F_{s}B \to B/F_{s-1} B\\
  \vdots
}$$
One problem with this point of view is that just having a filtration doesn't ensure that $B$ is the limit $\lim_s B/ F_s B$.  When this is the case, one says that the filtration is *complete and Hausdorff*.  (As you might guess, these words refer to a [uniformity](http://ncatlab.org/nlab/show/uniform+space) induced on $B$ by the filtration.)  The other condition we might want is that $C = B / \bigcup_s F_s B$ is zero, i.e. that $\bigcup_s F_s B = B$; a filtration with this property is called *exhaustive*.  For *finite* iterated extensions, however, these conditions are all automatic.

A more serious problem with the filtration point of view is that it relies on the fact that the quotient of the kernel of a surjection is that same surjection --- otherwise we couldn't recover $B_s$ from $F_s B$.  This is no longer true when we replace abelian groups by pointed spaces and extensions by fibration sequences.  Thus, in that case we *have* to consider instead an *iterated fibration sequence*, consisting of a sequence of fibration sequences:
$$\array{
  \vdots \\
  X_{s+1} \to Y_{s+1} \to Y_s\\
  X_s \to Y_s \to Y_{s-1}\\
  X_{s-1} \to Y_{s-1} \to Y_{s-2}\\
  \vdots
}$$
As before, we view this as expressing the limit $Y :\equiv \lim_s (\cdots \to Y_{s+1}\to Y_s \to \cdots)$ as put together out of the $X_s$'s.  It's more common to describe this as a *tower of fibrations*
$$ \cdots \to Y_{s+1}\to Y_s \to Y_{s-1} \to \cdots $$
since $X_s$ is determined as the (homotopy) fiber of the map $Y_s \to Y_{s-1}$.  But by talking about iterated extensions instead of filtrations, and iterated fibration sequences instead of towers of fibrations, we can see the analogy much more easily.

(If we were working with spectra instead of spaces, then from an iterated fibration sequence we could define a "filtration" of the limit $Y$, where $F_s Y$ is the fiber of the map $Y\to Y_s$.  Then $Y_s$ *would* be the cofiber of $F_s Y \to Y$.  However, $F_s Y \to Y$ would not necessarily be "injective" in any sense.)

The goal now is to extract some algebraic relationship among the groups $\pi_n(X_s)$ and $\pi_n(Y)$ in an iterated fibration sequence, which relate to iterated extensions just as LES's relate to extensions.  Of course, the first thing we get is a sequence of LES's:
$$\array{
  \vdots\\
  \cdots \to \pi_n(X_{s+1}) \to \pi_n(Y_{s+1}) \to \pi_n(Y_s) \to \pi_{n-1}(X_{s+1}) \to \cdots \\
  \cdots \to \pi_n(X_{s}) \to \pi_n(Y_{s}) \to \pi_n(Y_{s-1}) \to \pi_{n-1}(X_{s}) \to \cdots \\
  \vdots
}$$
These sequences are related in that each group $\pi_n(Y_s)$ appears in *two* of them.  This enables us to construct the following composite "connecting maps"
$$ \pi_n(X_s) \to \pi_n(Y_s) \to \pi_{n-1}(X_{s+1}). $$
relating the homotopy groups of the fibers $X_s$.  For reasons that will become clear later, we'll call these maps $d^2$ (note that this does *not* mean the square of a map $d$; the superscript $2$ is just an index).  The first interesting thing we notice about them is that they satisfy $d^2 \circ d^2 = 0$, since in the composite
$$ \pi_n(X_s) \to \pi_n(Y_s) \to \pi_{n-1}(X_{s+1}) \to \pi_{n-1}(Y_{s+1}) \to \pi_{n-2}(X_{s+2}) $$
the middle two maps are adjacent in a LES, hence compose to $0$.  Thus, for every value of $n+s$, we have a *chain complex*
$$ \cdots \xrightarrow{d^2} \pi_n(X_s) \xrightarrow{d^2} \pi_{n-1}(X_{s+1}) \xrightarrow{d^2} \pi_{n-2}(X_{s+2}) \xrightarrow{d^2} \cdots. $$
Of course, if we're experienced homological-algebraists, the first thing that we want to do with a chain complex is take its homology, but let's step back a second to make sure that that's a sensible thing to do.

A *cycle* in this chain complex is an element $x\in \pi_n(X_s)$ that becomes zero in $\pi_{n-1}(X_{s+1})$.  This means that when we map $x$ into $\pi_n(Y_s)$, it lands in the kernel of $\pi_n(Y_s) \to \pi_{n-1}(X_{s+1})$.  But since the sequence
$$ \cdots \to \pi_n(X_{s+1}) \to \pi_n(Y_{s+1}) \to \pi_n(Y_s) \to \pi_{n-1}(X_{s+1}) \to \cdots $$
is exact, that means exactly that the image of $x$ in $\pi_n(Y_s)$ lies in the image of $\pi_n(Y_{s+1})$.  In other words, an element $x\in \pi_n(X_s)$ automatically gives us an element of $\pi_n(Y_s)$, while $d^2(x)$ is precisely the "obstruction" to lifting that to an element of $\pi_n(Y_{s+1})$.  This naturally seems like the "first step" towards lifting it to an element of $\pi_n(Y)$, which is what we're really interested in.

Similarly, a *boundary* in this chain complex is an element of $\pi_n(X_s)$ that's in the image of $\pi_{n+1}(X_{s-1})$, and hence in particular in the image of $\pi_{n+1}(Y_{s-1})$.  But since the sequence
$$  \cdots \to \pi_{n+1}(Y_{s-1}) \to \pi_n(X_{s}) \to \pi_n(Y_{s}) \to \pi_n(Y_{s-1}) \to \cdots $$
is exact, any such element must map to zero in $\pi_n(Y_{s})$, and hence also lift to zero in $\pi_n(Y_{s+1})$.  So the homology at $\pi_n(X_s)$ (the group of cycles modulo the group of boundaries) is indeed a reasonable "second approximation" to "what we can learn about $\pi_n(Y)$ from $\pi_n(X_s)$".

For a "third approximation", we can more or less repeat the process.  Given something in this homology "$H_{n,s}(\pi_\ast(X_\ast))$", we can lift it to $\pi_n(Y_{s+1})$, then map it into $\pi_{n-1}(X_{s+2})$.  The result is not well-defined because the lift is not well-defined, but its indeterminacy is precisely that of the lift, which by exactness is just an element of $\pi_n(X_{s+1})$.  Thus, we do have a well-defined element of the quotient of $\pi_{n-1}(X_{s+2})$ by the image of $d^2$, which happens to also lie in the kernel of $d^2$, and hence a map $d^3 : H_{n,s}(\pi_\ast(X_\ast)) \to H_{n-1,s+2}(\pi_\ast(X_\ast))$.  I'll leave it to you to check that these maps make $H_{n,s}(\pi_\ast(X_\ast))$ into another chain complex, and that elements of its homology can be lifted to $\pi_n(Y_{s+2})$.

In order to describe these higher approximations uniformly, let's introduce a bit more terminology.  Recall that if $G$ is an abelian group, then a *$G$-graded abelian group* is just a family $(A_g)_{g\in G}$ of abelian groups indexed by the underlying set of $G$.  If $A$ and $B$ are $G$-graded abelian groups and $h\in G$, then a *degree-$h$ map* $f:A\to B$ consists of maps $f_g : A_g \to B_{g+h}$ for all $g$.  The composite of a degree-$h_1$ map with a degree-$h_2$ map is a degree-$(h_1+h_2)$ map.  For example, an unbounded chain complex may be defined as a $\mathbb{Z}$-graded abelian group equipped with a degree-1 (or degree-$(-1)$) endomap $d$ such that $d \circ d = 0$ (an equality of maps of degree 2 or $(-2)$).

Now, the groups $\pi_n(X_s)$ and $\pi_n(Y_s)$ can be assembled into a pair of $(\mathbb{Z}\times \mathbb{Z})$-graded abelian groups $D$ and $E$, and three maps between them $i$, $j$, and $k$.  The obvious grading is by $n$ and $s$, but for historical reasons, I'm going to choose a different basis of $\mathbb{Z}\times \mathbb{Z}$, and write $(p,q)$ for the indexing elements.
$$ E_{p,q} :\equiv \pi_{p+q}(X_q) $$
$$ D_{p,q} :\equiv \pi_{p+q}(Y_q) $$
If $p+q\lt 0$, then by convention we set $\pi_{p+q}=0$ (unless we are working with spectra, in which case no special convention is needed).  Now each long exact sequence
$$ \cdots \to \pi_n(X_{s}) \to \pi_n(Y_{s}) \to \pi_n(Y_{s-1}) \to \pi_{n-1}(X_{s}) \to \cdots $$
can be rewritten as
$$ \cdots \to E_{n-s,s} \xrightarrow{k_{n-s,s}} D_{n-s,s} \xrightarrow{i_{n-s,s}} D_{n-s+1,s-1} \xrightarrow{j_{n-s+1,s-1}} E_{n-s-1,s} \to \cdots $$
Together, the maps in these LES's assemble into three graded maps
$$\array{
  D & & \xrightarrow{i} & & D\\
  & _{k}\nwarrow & & \swarrow_j\\
  && E
}$$
where $i$, $j$, and $k$ have degrees $(1,-1)$, $(-2,1)$, and $0$ respectively.  Moreover, the exactness of the LES's implies that this triangle is exact at each vertex.  This structure (two graded groups $D$ and $E$ and maps $i:D\to D$, $j:D\to E$, and $k:E\to D$ of some degrees such that the above triangle is exact at each vertex) is called an *exact couple*.

Now we can formalize the above process of successive approximation through passage to homology as follows.  Given any exact couple $(D,E,i,j,k)$, we construct a new *derived* exact couple as follows.

* The composite $d :\equiv j k : E \to E$ satisfies $d d = j k j k = 0$, so we can define $E' :\equiv ker(d)/im(d)$ to be its homology.
* Let $D' = im(i) \subseteq D$.  (Of course, both of these should be interpreted "degreewise", remembering that $i$ and $d$ may have nonzero degrees.)
* Let $i':D'\to D'$ be the restriction of $i$ to $D'$ (which obviously lands inside $D'$).
* Define $j':D'\to E'$ as follows.  Given $x\in D'$, we have $x = i(y)$ for some $y\in D$; let $j'(x)$ be the homology class determined by $j(y)$ (which is a cycle since $k j = 0$).  This is well-defined since if $x = i(y')$ as well, then $i(y-y') = 0$, hence $y-y' = k(z)$ for some $z\in E$, and thus $j(y) - j(y') = d(z)$ is a boundary.
* Define $k':E'\to D'$ by restricting $k$ to $ker(d)$ (which lands inside $D'$ since if $d(x) = j(k(x)) = 0$, then $k(x)$ lies in the image of $i$ by exactness) and then passing to the quotient (which is well-defined since $k j = 0$).
* I'll leave it as an exercise to check the exactness of $i'$, $j'$, and $k'$.  Note that $deg(i') = deg(i)$ and $deg(k')=deg(k)$, but $deg(j')=deg(j) - deg(i)$.

We can thus iterate this process.  We write $(D^r,E^r,i^r,j^r,k^r)$ for the exact couple obtained by $r-2$ iterations.  In particular, we have graded abelian groups $E^r$, each of which is equipped with a differential $d^r : E^r \to E^r$ of degree $deg(j) + deg(k) - (r-2)\cdot deg(i)$ satisfying $d\circ d = 0$, and such that $E^{r+1}$ is the homology of $(E^r,d)$.  This structure is called a *spectral sequence*.

Note that I've chosen the indexing so that $E^2$ is the graded group $E$ we started with.  Like the change from $(n,s)$ to $(p,q)$, this is to match the convention used in the literature.  (And that, in turn, is because some other ways of constructing spectral sequences begin with an $E^1$ whose homology is $E^2$.  And that, I guess, is because someone a long time ago thought that the natural numbers started with $1$, since I've never heard of an "$E^0$".  Although no doubt someone in the comments will point out a spectral sequence that starts with $E^0$.)

When the groups in a spectral sequence are $(\mathbb{Z}\times\mathbb{Z})$-graded, as in our example and in most cases, it is usual to draw them in a lattice on the plane, with $p$ the horizontal coordinate and $q$ the vertical one.  For instance, $E^2$ can be drawn like this:
$$\array{
  & \vdots & \vdots & \vdots & \vdots & \\
  \cdots & E_{-1,2}^2 & E_{0,2}^2 & E_{1,2}^2 & E_{2,2}^2 & \cdots\\
  \cdots & E_{-1,1}^2 & E_{0,1}^2 & E_{1,1}^2 & E_{2,1}^2 & \cdots\\
  \cdots & E_{-1,0}^2 & E_{0,0}^2 & E_{1,0}^2 & E_{2,0}^2 & \cdots\\
  \cdots & E_{-1,-1}^2 & E_{0,-1}^2 & E_{1,-1}^2 & E_{2,-1}^2 & \cdots\\
  & \vdots & \vdots & \vdots & \vdots &
}$$
We call this the $E^2$ *page* of the spectral sequence.  When the degrees of the differentials are as they are in our example (which is, again, the most common situation), we can draw the differential $d^2$ on this lattice as moving two steps left and one step up.  The best picture I've been able to find of this online is [here](http://mathworld.wolfram.com/SpectralSequence.html), although it's of the dual "cohomologically indexed" case where the arrows go down and right instead of up and left.

Just to keep ourselves a bit more grounded, here's what the $E^2$ page looks like in the case of an iterated fibration sequence of spaces:
$$\array{
  & \vdots & \vdots & \vdots & \vdots & \\
  \cdots & \pi_1(X_2) & \pi_2(X_2) & \pi_3(X_2) & \pi_4(X_2) & \cdots\\
  \cdots & \pi_0(X_1) & \pi_1(X_1) & \pi_2(X_1) & \pi_3(X_1) & \cdots\\
  \cdots & 0 & \pi_0(X_0) & \pi_1(X_0) & \pi_2(X_0) & \cdots\\
  \cdots & 0 & 0 & 0 & 0 & \cdots\\
  & \vdots & \vdots & \vdots & \vdots &
}$$
With spectra, the zero groups above would be replaced by negative homotopy groups such as $\pi_{-1}(X_0)$, etc.

We then obtain the $E^3$ page by replacing each entry $E^2_{p q}$ of the $E^2$ page by the homology of $d^2$ at that spot, i.e. the kernel of the outgoing differential modulo the image of the incoming one.  The $E^3$ page then has its own differential $d^3$ which goes *three* steps left and *two* steps up, and we repeat.  We then "take the limit" of $E^r$ as $r\to\infty$, and hope that the resulting "$E^\infty$" terms are useful --- in our example, we hope they tell us something about the groups $\pi_n(Y)$.

First of all, we have to address the question of what it means to "take the limit", since in general $E^{r+1}$ is neither a subobject nor a quotient object of $E^r$, but a *subquotient* (a quotient of a subobject, or equivalently a subobject of a quotient).  One can make sense of this in general, but in many (perhaps most) applications of spectral sequences, there's a much simpler answer.  Namely, it often happens that for each grading $(p,q)$, the groups $E^r_{p q}$ eventually stabilize as $r\to\infty$, so that we can define $E^\infty_{p q}$ to be their eventual value.  (The $r$ at which this happens generally depends on $(p,q)$, so that interesting things are still happening *somewhere* in $E^r$ for arbitrarily large values of $r$.)

Of course, having $E^{r+1}_{p q} = E^r_{p q}$ means that the differentials coming into and out of $E^r_{p q}$ are zero, and a good reason for this is if their domain and codomain are respectively the zero group.  Note that when the differentials have the usual degrees, they always move from one diagonal $p+q=n$ to the next lower one $p+q=n-1$.  Thus, if each diagonal in the $E^2$ page (hence also in every other page) contains only finitely many nonzero groups, then the groups $E^r_{p q}$ will eventually stabilize for each $(p,q)$.

In particular, this is the case in the example arising from a *finite* iterated fibration sequence, where the nonzero part of the spectral sequence lives entirely in a finite strip $0\le q\le Q$.  It's also the case for a bounded *above* fibration sequence (which stabilizes above some point $s=T$ but extends infinitely downwards) as long as for every $n$, there is a point below which $\pi_n(X_s) = \pi_n(Y_s)=0$, such as if the truncatedness of $Y_s$ decreases, or their connectedness increases, as $s\to-\infty$.  In this case, we have the following.

**Convergence Theorem:** Suppose given a bounded-above iterated fibration sequence
$$\array{
  X_{T} \to Y_{T} \to Y_{T-1}\\
  \vdots \\
  X_s \to Y_s \to Y_{s-1}\\
  X_{s-1} \to Y_{s-1} \to Y_{s-2}\\
  \vdots
}$$
such that for every $n$, there is an $R$ such that $\pi_n(X_s) =\pi_n(Y_s)=0$ for $s\le R$, and let $Y = \lim_s Y_s = Y_T$.  Then for every $n$, there is a finite iterated extension:
$$\array{
  E^\infty_{n-T,T} \to B_{n,T} \to B_{n,T-1}\\
  \vdots \\
  E^\infty_{n-s,s} \to B_{n,s} \to B_{n,s-1}\\
  E^\infty_{n-s+1,s-1} \to B_{n,s-1} \to B_{n,s-2}\\
  \vdots\\
  E^\infty_{n-R,R} \to B_{n,R} \to 0
}
$$
such that $B_n = \lim_s B_{n,s}= B_{n,T}$ is equal to $\pi_n(Y)$.

This theorem makes our second analogy also into a functor between suitable categories of iterated fibration sequences and iterated extensions.

Note that the $E^\infty$ groups appearing in the iterated extension for $\pi_n(Y)$ are those on the diagonal $p+q=n$.  Thus, the theorem says that when $Y$ is put together out of the $X_s$'s, then $\pi_n(Y)$ is put together out of the groups on this diagonal, which are computed from the homotopy groups of the $X_s$'s in some way (encoded by the spectral sequence).  It's traditional to write this sort of "convergence" as
$$ E^2_{p,q} = \pi_{p+q}(X_q) \;\Rightarrow\; \pi_{p+q}(Y) $$
to indicate which $E^\infty$ groups are the "ingredients" of which group in the target.

At this point I should remind you that we're either assuming all spaces are simply connected, or working with spectra instead of spaces.  The notion of "convergence" is a lot trickier when you have to deal with nonabelianness of $\pi_1$ and nongroupness of $\pi_0$.  There are also fancier convergence theorems that allow more infinite behavior, such as when $E^r_{p q}$ doesn't stabilize but still has a "limit".  Finally, with an unbounded-above iterated fibration sequence we would also have to deal with the fact that $\pi_n(\lim_s Y_s)$ may not equal $\lim_s \pi_n(Y_s)$.

**Proof of convergence theorem:** For any $(p,q)$, let $r \ge max(T-q+3,q-R+1)$.  Then $E^r_{p q}$ has stabilized, so that $E^\infty_{p q} = E^r_{p q}$.  For such an $r$, $D^r_{p q}$ is the $(r-2)$-fold image of $i:D^2\to D^2$, i.e. those elements in $D^2$ of the form $i(i(\cdots i(x)\cdots ))$ with $(r-2)$ copies of $i$.  Since $i$ consists of the maps $\pi_n(Y_s) \to \pi_n(Y_{s-1})$, and $\pi_n(Y_s) = \pi_n(Y)$ for $s\ge T$, this means $D^r_{p q}$ is the image of $\pi_{p+q}(Y)$ in $\pi_{p+q}(Y_q)$ (and in particular is independent of $r$ sufficiently large).  Let $B_{n,s}= D^r_{n-s,s}$ for any such $r$, i.e. the image of $\pi_n(Y)$ in $\pi_n(Y_s)$.

It remains to construct the extensions $E^\infty_{n-s,s} \to B_{n,s} \to B_{n,s-1}$ displayed above.  However, just as we put together the exact couple $(D^2,E^2,i^2,j^2,k^2)$ from long exact sequences, from the exact couple $(D^{r},E^{r},i^{r},j^{r},k^{r})$ we can extract some other long exact sequences.  Note that by iterating the above formulas for degrees in a derived exact couple, we have $deg(i^{r}) = (1,-1)$ and $deg(k^{r}) = 0$, but $deg(j^{r}) = (-r,r-1)$.  Thus, we have LES's
$$ \cdots \to D^{r}_{p+r,q-r+1} \xrightarrow{j} E^{r}_{p,q} \xrightarrow{k} D^{r}_{p,q} \xrightarrow{i} D^{r}_{p+1,q-1} \xrightarrow{j} E^{r}_{p-r+1,q+r-2} \to\cdots $$
If we choose $r \ge max(T-s+4,s-R+1)$, then all three terms in the middle have stabilized, while the two on the ends are zero.  Thus, inside this LES we have a short exact sequence
$$0 \to E^\infty_{n-s,s} \to B_{n,s} \to B_{n,s-1} \to 0 $$
which is the extension that we wanted.  $\Box$

This is all very abstract, so let's look at a couple of degenerate cases.  First, in the case of a finite iterated fibration sequence with $T=1$, we have
$$\array{
  X_1 \to Y \to X_0\\
  X_0 \to X_0 \to \ast
}$$
hence essentially just a single fibration sequence.  The spectral sequence is confined to the strip $q\in \{0,1\}$, with $E^2$ page looking like:
$$\array{
\cdots & \pi_0(X_1) & \pi_1(X_1) & \pi_2(X_1) & \pi_3(X_1) & \cdots \\
\cdots & 0 & \pi_0(X_0) & \pi_1(X_0) & \pi_2(X_0) & \cdots
}$$
The differentials on this page go, as always, left two and up one, hence from $\pi_n(X_0) \to \pi_{n-1}(X_1)$; these are exactly the "connecting maps" $\delta_n$ in the ordinary LES of the fibration.  Since the differentials entering $\pi_n(X_0)$ come from zero, and those leaving $\pi_n(X_1)$ go to zero, on passage to homology we get the $E^3$ page
$$\array{
  \cdots & im(\delta_1) & im(\delta_2) & im(\delta_3) & im(\delta_4) & \cdots \\
  \cdots & 0 & ker(\delta_0) & ker(\delta_1) & ker(\delta_2) & \cdots
}$$
We have $E^3 = E^\infty$ since all the remaining differentials hit zero on one side or the other, so that $E^\infty_{p,0} = ker(\delta_p)$ and $E^\infty_{p,1} = im(\delta_{p+2})$.  The theorem then gives an iterated extension
$$ \array{
  im(\delta_{n+1}) \to \pi_n(Y) \to ker(\delta_n)\\
  ker(\delta_n) \to ker(\delta_n) \to 0
  }$$
which is just the ordinary extension we observed above as coming from an LES.

Another degenerate case is when the iterated fibration sequence is the *Postnikov tower* of a space (or spectrum) $Y$.  Suppose $Y$ is an $m$-type, i.e. $\pi_n(Y)=0$ for $n\gt m$.  Then for any $n\le m$ we have an $n$-type ${\Vert Y\Vert}_n$, with fibration sequences
$$ X_n \to {\Vert Y\Vert}_n \to {\Vert Y\Vert}_{n-1} $$
where $X_n = K(\pi_n(Y),n)$ is an Eilenberg-Mac Lane space, with $\pi_n(X_n) = \pi_n(Y)$ and $\pi_i(X_n) = 0$ for $i\neq n$.  Together these form an iterated fibration sequence with limit $Y$.  When $Y$ is an $m$-type space, it is a finite sequence; when $Y$ is an $m$-type spectrum it is bounded above and satisfies the condition on downward homotopy groups; thus the convergence theorem applies.  Since each fiber $X_n$ is an Eilenberg-Mac Lane space of dimension $n$, the $E^2$ page of the spectral sequence is concentrated on the line $p=0$, looking like this:
$$\array{
  \vdots \\
  \pi_2(Y)\\
  \pi_1(Y) \\
  \pi_0(Y)\\
  \vdots
}$$
There is no room for any nontrivial differentials, $E^2=E^\infty$, and for each $n$ we obtain the trivial iterated extension
$$\array{
  0 \to \pi_n(Y) \to \pi_n(Y) \\
  \vdots\\
  0 \to \pi_n(Y) \to \pi_n(Y) \\
  \pi_n(Y) \to \pi_n(Y) \to 0 \\
  0 \to 0 \to 0 \\
  \vdots\\
  0 \to 0 \to 0.
}$$

Of course, the *interesting* applications of spectral sequences are less trivial, but this post is already quite long enough.  In the companion post on the HoTT blog, I'll talk about how to use this spectral sequence (with spectra) to extract versions of the Atiyah-Hirzebruch and Serre spectral sequences, and see what they can do for us.

One final teaser: note that while the groups in the $E^{r+1}$ page of a spectral sequence are determined by the groups and the differentials in the $E^r$ page, the differential in the $E^{r+1}$ page is not so determined.  To figure out what it is, we need to know about the rest of the $r^{\mathrm{th}}$ exact couple, which can be tedious to work out.  In many applications it suffices to know that such a differential *exists*, without knowing anything about it; but sometimes the values of the differential do matter.  However, if we had a fully *constructive* definition of the whole exact couple and spectral sequence, as we would obtain by implementing the definition in a hypothetical fully constructive version of homotopy type theory, then the definition would be a program, and we could simply ask the computer to evaluate it on any input we cared about.  This suggests to me a vague possibility of a way that homotopy type theory might conceivably one day be useful even to the "working algebraic topologist".

## Spectral Sequences in HoTT

Now we want to construct the cohomological Serre spectral sequence of a fibration (i.e. a type family).  First recall that a **spectrum** is a family of pointed types $ Y : \mathbb{N} \to \mathsf{Type}_\ast$ such that $ Y_n = \Omega Y_{n+1}$ for all $n$.  Last time I defined the **cohomology** of a type $X$ with coefficients in a spectrum $Y$ to be

$$ H^n(X;Y) :\equiv \Vert X \to \Omega^{k-n} Y_k \Vert_0$$

for $k$ sufficiently large that $ k-n \ge 0$.  An equivalent way to define this is as

$$ H^n(X;Y) :\equiv \pi_{-n} (\mathsf{SpMap}(X,Y))$$

where $ \mathsf{SpMap}(X,Y)$ is the *mapping spectrum* defined by $ \mathsf{SpMap}(X,Y)_n :\equiv (X\to Y_n)$, and the homotopy groups of a spectrum $Z$ are defined by

$$ \pi_n (Z) :\equiv \pi_{k+n}( Z_k)$$

for any $ n \in \mathbb{Z}$ and any $k$ sufficiently large that $ n+k\ge 0$.  Again, the definition of a spectrum makes this independent of $k$.  In general, we can "do homotopy theory" with spectra just as we can with types.  A map of spectra is, of course, a fiberwise pointed map $ f : \prod_{(n:\mathbb{N})} Y_n \to Z_n$ such that the evident squares commute relating it to the equivalences $ Y_n = \Omega Y_{n+1}$ and $ Z_n = \Omega Z_{n+1}$.  Similarly, the *fiber* of such a map is defined levelwise, with $ \mathsf{fib}(f)_n :\equiv \mathsf{fib}(f_n)$.  It's easy to see that this inherits a spectrum structure.  Moreover, the long exact sequences of homotopy groups for the fiber sequences $ \mathsf{fib}(f_n) \to Y_n \to Z_n$ splice together into a long exact sequence

$$ \cdots \to \pi_n(\mathsf{fib}(f)) \to \pi_n(Y) \to \pi_n(Z) \to \cdots $$

which is infinite in *both* directions, with all entries being abelian groups.

Now in part one above, I explained how from an iterated fibration sequence

$$ \array{\vdots \\
     X_{s+1} \to Y_{s+1} \to Y_s\\
     X_s \to Y_s \to Y_{s-1}\\
     X_{s-1} \to Y_{s-1} \to Y_{s-2}\\
     \vdots}
$$

we obtain a spectral sequence with $ E^2_{p q} = \pi_{p+q}(X_q)$.  Moreover, if the iterated fibration sequence stabilizes as $ s\to \infty$ (i.e. for $ s\gt T$ it becomes $ \mathbf{1} \to Y \to Y$) and eventually becomes zero at each homotopy group separately as $ s \to -\infty$, then this spectral sequence "converges" to the homotopy groups of $Y$, in the sense that for each $n$ we have a finite iterated extension

$$\array{
  E^\infty_{n-T,T} \to \pi_n(Y) \to B_{n,T-1}\\
  \vdots\\
  E^\infty_{n-s,s} \to B_{n,s} \to B_{n,s-1}\\
  E^\infty_{n-s+1,s-1} \to B_{n,s-1} \to B_{n,s-2} \\
  \vdots\\
  E^\infty_{n-R,R} \to E^\infty_{n-R,R} \to 0
}
$$

in which the $ E^\infty$ terms occurring are precisely the nonzero ones on the diagonal $ p+q=n$ of the $ E^\infty$ page.  (There are fancier sorts of convergence that apply to more general situations, but I don't want to get into that right now.)  One writes this as

$$ E^2_{p,q} = \pi_{p+q}(X_q) \Rightarrow \pi_{p+q}(Y) $$

The only homotopical input required was the long exact sequences of homotopy groups associated to the iterated fibration sequence, which as we've seen applies just as well to spectra as to types.  After that, it was only homological algebra of abelian groups, which was fully constructive, and hence formalizable using sets in homotopy type theory, with higher inductive types for quotients and images.

Part one was kind of light on examples, though.  I mentioned the obvious example of an iterated fibration sequence, namely the Postnikov tower of $Y$:

$$\array{
  K(\pi_s(Y),s) \to {\Vert Y\Vert}_s \to {\Vert Y\Vert}_{s-1}\\
  K(\pi_{s-1}(Y),s-1) \to {\Vert Y\Vert}_{s-1} \to {\Vert Y\Vert}_{s-2}\\
  \vdots
}
$$

If $Y$ is an $m$-type for some $ m\lt \infty$, then this satisfies our simple hypotheses for convergence.  A spectrum also has a Postnikov tower, with $ (\Vert Y \Vert_s)_n$ defined to be $ \Vert Y_n\Vert_{n+s}$.  This makes sense for any $ s \in \mathbb{Z}$, as long as we make the convention that $ \Vert X\Vert_{m} = \mathbf{1}$ if $ m \lt  -1$.  If we define an **$m$-type spectrum** to be one for which $ Y_n$ is an ordinary $ (n+m)$-type for all $ n \ge -m-2$, then the Postnikov tower of such a $Y$ also satisfies our simple hypotheses for convergence despite potentially being infinite downwards (an $m$-type spectrum can have nontrivial $ \pi_n$ for all $ -\infty \lt  n \le m$).

The Postnikov tower of a space or spectrum doesn't give rise to an interesting or useful spectral sequence.  However, mapping out of a type preserves fibration sequences, so for any type $X$ and spectrum $Y$ we have an induced iterated fibration sequence

$$\array{
\mathsf{SpMap}(X,K(\pi_s(Y),s)) \to \mathsf{SpMap}(X,{\Vert Y\Vert}_s) \to \mathsf{SpMap}(X,{\Vert Y\Vert}_{s-1}) \\
\mathsf{SpMap}(X,K(\pi_{s-1}(Y),s-1)) \to \mathsf{SpMap}(X,{\Vert Y\Vert}_{s-1}) \to \mathsf{SpMap}(X,{\Vert Y\Vert}_{s-2}) \\
\vdots
}
$$

where $ K(A,s)$ denotes the spectrum whose $ n^{\mathrm{th}}$ space is the usual Eilenberg-Mac Lane space $ K(A,s+n)$ if $ s+n\ge 0$, and contractible otherwise.  Note that the spectrum $ K(A,0)$ is the Eilenberg-Mac Lane spectrum that we denoted $ H A$ last time.

Hence, we have a spectral sequence with

$$\begin{aligned}
    E^2_{p q} &= \pi_{p+q}(\mathsf{SpMap}(X,K(\pi_q(Y),q)))\\
             &= \pi_p(\mathsf{SpMap}(X,H(\pi_q(y)))\\
             &= H^{-p}(X;\pi_q(Y))
  \end{aligned}$$

the "ordinary" $ (-p)^{\mathrm{th}}$ cohomology of $X$ with coefficients in the abelian group $ \pi_q(Y)$.  If $Y$ is an $m$-type spectrum for some $m$, then this spectral sequence converges in the above sense to the homotopy groups $ \pi_n( \mathsf{SpMap}(X,Y))$, which as remarked above are the cohomology $ H^{-n}(X;Y)$.

This is called the *Atiyah-Hirzebruch spectral sequence*.  It says that for any (sufficiently nice) spectrum $Y$, the cohomology of any type $X$ with coefficients in $Y$ (what algebraic topologists call "generalized cohomology") can be put together out of the "ordinary" cohomology of $X$ with coefficients in the homotopy groups of $Y$.  One usually flips the sign of $p$ and $q$ in "cohomological" spectral sequences of this sort, simultaneously switching the subscripts and superscripts; thus we write instead

$$ E_2^{p q} = H^p(X;\pi_{-q}(Y)) \Rightarrow H^{p+q}(X;Y)$$

Graphically, this corresponds to rotating all the "pages" of the spectral sequence by 180 degrees about the origin.  This causes the differentials to go down and right rather than left and up.  (Note also that $ \pi_{-q}(Y) = H^q(\mathbf{1};Y)$ is also the $ q^{\mathrm{th}}$ cohomology of a point with coefficients in $Y$.)

Of course, this may not seem very interesting unless you have some spectra up your sleeve other than $ H A$ whose cohomology you care about.  However, we can also use it to construct the Serre spectral sequence, which is interesting even as a statement only about ordinary cohomology.

First we have to generalize our notion of cohomology a bit.  In the language of classical algebraic topology, we're going to define *parametrized* cohomology theories, including as a special case *cohomology with local coefficients*.  However, in type-theoretic language, what's going on is extremely simple and natural: replacing function types with *dependent* function types.

Thus, suppose $X$ is a type and $ Y : X \to \mathsf{Spectrum}$ is an $X$-indexed family of spectra.  We define the cohomology of $X$ with coefficients in $Y$ to be

$$ H^n(X;Y) :\equiv \pi_{-n} (\mathsf{SpSect}(X,Y))$$

where $ \mathsf{SpSect}(X,Y)$ is the "spectrum of sections of $Y$" defined by $ \mathsf{SpSect}(X,Y)_n :\equiv \prod_{(x:X)} Y(x)_n)$.  As usual with dependent function types, when $Y$ is a constant family this reduces to the previously defined notion of cohomology.

Where do families of spectra come from?  One place they come from is families of abelian groups.  If $ A : X \to \mathsf{AbGp}$ is such, then composing it with the "Eilenberg-Mac Lane spectrum" function $ H : \mathsf{ApGp}\to \mathsf{Spectrum}$ we obtain an $X$-indexed family of spectra, $ H A$.  Note that since abelian groups are sets, $ \mathsf{AbGp}$ is a 1-type, and hence any such $A$ factors through $ \Vert X \Vert_1$, the "fundamental groupoid" of $X$.  This is the homotopy-type-theory version of what classical algebraic topologists would call a *local system* on $X$.  If $X$ is pointed and connected, then $ \Vert X \Vert_1 = K(\pi_1(X),1)$, and so (using the univalence axiom) we can further reduce a local system to a single abelian group with an action by $ \pi_1(X)$, the most classical notion.  The cohomology of $X$ with coefficients in $ H A$ is called *cohomology with local coefficients*.

Where do local systems come from?  One place they come from is homotopy groups of families of types (or spectra).  We can compose $ \pi_n : \mathsf{Type}_\ast \to \mathsf{AbGp}$ or $ \pi_n : \mathsf{Spectrum} \to \mathsf{AbGp}$ with any family $ Y : X \to \mathsf{Type}_\ast$ of pointed types or $ Y : X \to \mathsf{Spectrum}$ of spectra to obtain a local system.  I think the ease with which we can pass back and forth between local systems and families of spectra is a good example of the value of the type-theoretic framework.

In the same way, we can construct the "fiberwise" Postnikov tower of a family of spectra $ Y : X \to \mathsf{Spectrum}$, obtaining an $X$-indexed family of iterated fibration sequences.  The fibers of these fibration sequences are loopings or deloopings of "parametrized Eilenberg-Mac Lane spectra" associated to the local systems $ \pi_q(Y) : X \to \mathsf{AbGp}$.  Sinc $ \mathsf{SpSect}$, like $ \mathsf{SpMap}$, preserves fibration sequences, we get a more general Atiyah-Hirzebruch spectral sequence with $ E^{p q}_2 = H^{p}(X;\pi_{-q}(Y))$ (meaning the cohomology with local coefficients in the local system $ \pi_{-q}(Y)$), which converges to $ H^{p+q}(X;Y)$ if $Y$ is a family of $m$-type spectra.

Now we're ready to deduce the Serre spectral sequence.  Let $Y$ be an ordinary spectrum, such as $H A$, and let $ F : X \to \mathsf{Type}$ be a type family.  Then $ x\mapsto \mathsf{SpMap}(F_x,Y)$ is an $X$-indexed family of spectra, which are $m$-type spectra if $Y$ is.  Thus, we have the above "parametrized" Atiyah-Hirzebruch spectral sequence:

$$ H^p(X;\lambda x.\pi_{-q}(\mathsf{SpMap}(F_x,Y))) \Rightarrow H^{p+q}(X;\lambda x.\mathsf{SpMap}(F_x,Y)).$$

On the left, we have $ \pi_{-q}(\mathsf{SpMap}(F_x,Y)) = H^q(F_x;Y)$ by definition.  And as for the right side, we have

$$
\begin{aligned}
  H^n(X;\lambda x.\mathsf{SpMap}(F_x,Y)) &= \pi_{-n}(\mathsf{SpSect}(X,\lambda x.\mathsf{SpMap}(F_x,Y)))\\
  &= \pi_{-n}(\mathsf{SpMap}(\sum_{(x:X)} F_x, Y))\\
  &= H^n(\sum_{(x:X)}F_x;F)
\end{aligned}
$$

the cohomology of the total space of the fibration *F* with coefficients in $Y$.  (The second step is a spectral version of the ordinary universal mapping property of $ \Sigma$-types, $ ((\sum_{(x;X)} F_x) \to Z) = \prod_{(x:X)} (F_x \to Z)$.)  Thus, our spectral sequence becomes

$$ H^p(X;\lambda x. H^q(F_x;Y)) \Rightarrow H^{p+q}(\sum_{(x:X)} F_x;Y)$$

which is the usual cohomological Serre spectral sequence, relating the cohomology of the base, with local coefficients in the cohomology of the fiber, to the cohomology of the total space.  Note that if $X$ is pointed and simply connected, so that $ \Vert X \Vert_1 = \mathbf{1}$, then any local system on $X$ is constant, and so the cohomology with local coefficients in the domain reduces simply to the ordinary cohomology of $X$ with coefficients in the cohomology of the fiber over the basepoint.

After all of this theory, I ought to give you at least one application to justify it all.  Here's a fairly easy one.  Suppose we have a fibration of spheres, i.e. a fiber sequence $ S^a \to S^b \to S^c$ in which all three types are spheres of some dimension, and suppose that $ c\gt1$ so that $ S^c$ is simply connected and that $ a\gt0$ and $ b\gt0$ for nontriviality.  Then we have a Serre spectral sequence

$$ H^p(S^c; H^q(S^a;\mathbb{Z})) \Rightarrow H^{p+q}(S^b;\mathbb{Z}).$$

The Eilenberg-Steenrod axioms for ordinary cohomology (i.e. with coefficients in $ H \mathbb{Z}$) easily imply that $ H^n(S^m;\mathbb{Z})$ is $ \mathbb{Z}$ when $ n=0$ and $ n=m$, and zero otherwise.  Thus, the $ E_2$ page of this spectral sequence is $ \mathbb{Z}$ at $ (0,0), (c,0), (0,a), (c,a)$, and zero everywhere else.  The only possible nontrivial differential would be a map from $ E^r_{0,a}$ to $ E^r_{c,0}$, and this is only possible if $ c = a+1$.  If there is *no* such differential, then $ E_\infty = E_2$, and so the target $ H^n(S^b;\mathbb{Z})$ will be built out of nontrivial groups for $ n = 0,a,c,a+c$.  However, we know that $ H^n(S^b;\mathbb{Z})$ is zero unless $ n = 0,b$, so this is impossible.  Therefore, $ c = a+1$, the differential $ E^r_{0,a} \to E^r_{c,0}$ is an isomorphism and "kills" both of these groups, and $ b = a+c = 2a+1$.  (This argument by contradiction is valid constructively, since natural numbers have decidable equality.)

In conclusion, *the only possible fibrations of spheres are of the form* $ S^a \to S^{2a+1}\to S^{a+1}$.  When $ a=1$ we do have such a fibration, namely the Hopf fibration.  (Classically, there are also such fibrations for $ a=3,7$ and no other positive values of $a$ --- the latter is a famous theorem called the "Hopf invariant one problem".)

There are lots of other applications of spectral sequences; it'll be fun to see how many of them we can reproduce.  Many of them require homology in addition to cohomology, though, which would be a whole other post.

One last comment deserves to be made.  I claimed that this "is" the Serre spectral sequence, but actually I haven't proven that.  It has the same groups in its $ E_2$ page, and converges to the same thing, but that doesn't imply that the whole spectral sequence is the same (although it strongly suggests it).  And I haven't seen this construction of the Serre SS anywhere in the classical algebraic topology literature (although I'd be surprised if it were new) --- most constructions use instead a CW decomposition of $X$, which is unavailable to us.  So does this "Serre spectral sequence" agree with the classical one when interpreted in the simplicial model?  I'm not sure how to go about trying to prove that.  *(Edit: See [below](#Maunder)!)*

## On indexing choices

The "natural" indexing of the spectral sequence $\pi_n(X_s)$ constructed above is by $n$ and $s$, and in this indexing the initial differential has degree $(-1,1)$.  We chose to reindex it by writing $n = p+q$ and $s=q$, in which case the initial differential has $(p,q)$ degree $(-2,1)$, thereby matching the indexing and degrees for the $E_2$ page of some known spectral sequences (such as the Serre and Atiyah-Hirzebruch SS).

However, there are other ways to do the reindexing.  For instance, if we instead set $n = t-s$, then the initial differential will have $(s,t)$ degree $(1,0)$, which looks more like the $E_1$ page of a spectral sequence.  For instance, the Adams spectral sequence can be obtained in this way from a suitably chosen tower of fibrations (although usually in that case one talk about cofibers rather than fibers, which in the world of spectra are the same up to a furtherh degree shift).  Thanks to [[nlab:Urs Schreiber]] for pointing this out.

## Notes

Some notes not in the original blog posts:

* In the section on Spectral Sequences on HoTT it is ambiguous whether $\mathsf{SpMap}(X,Y)$ and $\mathsf{SpSect}(X,Y)$ consists of pointed or unpointed maps. Most steps taken are true both when they are interpreted as pointed or as unpointed maps. If $\mathsf{SpMap}(X,Y)$ is unpointed then $X$ is unpointed and $\pi_{-n} (\mathsf{SpMap}(X,Y))$ is the unreduced cohomology of $X$ (with coefficients in $Y$). If $\mathsf{SpMap}(X,Y)$ is pointed then $X$ is interpreted as a pointed type and $\pi_{-n} (\mathsf{SpMap}(X,Y))$ is the reduced cohomology. Everything in the proof of the Atiyah-Hirzebruch spectral sequence holds for both cases, so the Atiyah-Hirzebruch spectral sequence exists for both reduced and unreduced cohomology. However, the Serre Spectral sequence is only valid for unreduced cohomology, since the equivalence
$$\mathsf{SpSect}(X,\lambda x.\mathsf{SpMap}(F_x,Y)) = \mathsf{SpMap}(\sum_{(x:X)} F_x, Y)$$
used in the proof is only true for unpointed maps.

* {#Maunder} [[Urs Schreiber]] has [pointed out](https://homotopytypetheory.org/2013/08/08/spectral-sequences/#comment-100544) that this construction of the AHSS appears in [C. R. F. Maunder (1963)](Atiyah–Hirzebruch+spectral+sequence#Maunder63), who also shows that it agrees with the standard construction by constructing an isomorphism of [[exact couples]]. It seems likely that a similar method would work for the Serre SS.

## References
 {#References}

* {#Shulman13} [[Mike Shulman]], _Spectral sequences_ (2013) [[part I](https://golem.ph.utexas.edu/category/2013/08/what_is_a_spectral_sequence.html), [part II](http://homotopytypetheory.org/2013/08/08/spectral-sequences/)]

* [[Floris van Doorn]], §5 in: *On the Formalization of Higher Inductive Types and Synthetic Homotopy Theory* (2018) [[arXiv:1808.10690](https://arxiv.org/abs/1808.10690)]

Formalization in [[Lean]]:

* {#vanDoornSpectral} [[Floris van Doorn]], [[Egbert Rijke]], [[Ulrik Buchholtz]], [[Favonia]], [[Steve Awodey]], [[Jeremy Avigad]], [[Mike Shulman]], [[Jonas Frey]],  *Spectral* [[github.com/cmu-phil/Spectral](https://github.com/cmu-phil/Spectral)]

category: homotopy theory