Much work has gone into the construction of cohomology theories which are defined on algebraic varieties (étale, crystalline, etc.) and comparison isomorphisms between them. 


Say $X$ is an algebraic variety over $\mathbb Z$. I am interested in computing $H^\*\_{\rm sing}(X\_{\mathbb C}, \mathbb{Z}\_p)$ using a variant of the de Rham complex. However, the obvious integral version of de Rham cohomology, gives the completely wrong answer even for $X = \mathbb A^1$. 


This is surprising to me, because (if I am reading the literature correctly, as a non-expert) the de Rham complex of $X\_{\mathbb Z\_p}$ computes the crystalline cohomology of $X\_{\mathbb F\_p}$. And crystalline cohomology is often claimed to be the "correct" $p$-adic replacement for the etale cohomology groups $H^\*\_{et}(X\_{\overline{\mathbb F\_p}}, \mathbb Z\_l)$. However, it seems that crystalline cohomology/de Rham cohomology groups of affine space are "**wrong**", in the moral sense of not lining up with what I would naively expect.


Is there a correction/explanation for this discrepancy? Is there a variant of de Rham/crystalline cohomology which computes the "right" cohomology for $\mathbb A^1$? Morally, is there a reason why we would want integral crystalline cohomology to carry so much extraneous torsion? Is there something I'm missing? 



Is there a version of algebraic de Rham cohomology that can be used to calculate torsion classes?
You should read the introduction to Bhargav Bhatt's lecture notes on prismatic cohomology: [available here](http://www-personal.umich.edu/~bhattb/teaching/prismatic-columbia/lecture1-overview.pdf). This is a new cohomology theory introduced by Bhatt-Scholze (closely related to prior work by Bhatt-Morrow-Scholze) for explaining these torsion phenomena. 


The presence of extra torsion in de Rham (or crystalline etc.) cohomology is unavoidable, as SashaP's answer demonstrates. These cohomology theories are only supposed to be reasonable analogues of singular cohomology (i.e. Weil cohomology theories) when you use torsion free coefficients.


However, we can explain where the extra torsion "comes from" (relative to the "true" etale/singular cohomology with e.g. $\mathbf F\_p$ coefficients) with a certain long exact sequence. 


Let $X$ be a reasonable variety over (e.g.) $\mathbf Z$. Then we can consider its etale cohomology $H^i(X\_{{\overline{\mathbf{Q}}}}, \mathbf Z\_p)$. This agrees as a module with the singular cohomology of $X\_{\mathbf{C}}$, so it's the "right answer" (in particular it's $\mathbf A\_1$-invariant). 


On the other hand, we can consider the algebraic de Rham cohomology of $X\_{\mathbf Z\_p}$ (this is essentially the algebraic de Rham cohomology of $X$ tensored with $\mathbf Z\_p$), $H^i\_{\mathrm{dR}}(X/\mathbf Z\_p)$. This agrees with the crystalline cohomology of the special fiber - in particular it only depends on the special fiber, so we shouldn't expect it to capture the same information as the etale/singular cohomology of the generic fiber. 


These two $\mathbf Z\_p$-modules have the same rank by Fontaine's comparison theorem (at least in the proper case, but if you use some sort of log theory you can extend to the open case), but in general the de Rham cohomology has extra $p$-torsion. 


To explain this, Bhatt-Scholze construct a third cohomology theory for schemes over $\mathbf Z\_p$ (it's essentially a variant of the construction of crystalline cohomology), valued in modules over the ring $\mathbf Z\_p[[u]]$. Let's call this $\mathcal{H}(X)$. Then:


* $\mathcal{H}(X)/u$ is isomorphic to de Rham cohomology of $X\_{\mathbf{Z}\_p}$ (equivalently, it's isomorphic to the crystalline cohomology of $X\_{\mathbf{F}\_p}$).
* $\mathcal{H}(X)[1/u]$ is non-canonically isomorphic to the etale cohomology with $\mathbf Z\_p$ coefficients of $X\_{{\overline{\mathbf Q}}}$ (equivalently to singular cohomology of $X\_{\mathbf C}$), tensored with $\mathbf Z\_p((u))$.
* $\mathcal{H}(X)$ (at least after some scalar extension) can in principle be computed using a "q-de Rham complex"


(I'm sweeping some homological algebra consideration, about e.g. exactness of modding out by u, under the rug - see the Bhatt-Scholze paper for precise statements. You really need to use derived categories everywhere.)


