Can one glue De Rham cohomology classes on a differential manifolds? Let $M$ be a differential manifold and $\mathcal H^k$ the presheaf of real vector spaces associating to the open subset $U\subset M$ the $k$-th de Rham cohomology vector space: $\mathcal H^k(U)=H^k_{DR}(U)$. Is this presheaf a sheaf?
Of course not! Indeed, given any non-zero cohomology class $0\neq[\omega]\in \mathcal H^k(U)$ represented by the closed $k$-form $\omega\in \Omega^k_M(U)$ there exists (by Poincaré's Lemma) a covering  $(U_i)_{i\in I}$ of $U$ by open subsets $U_i\subset U$ such that $[\omega]\vert U_i=[\omega\vert U_i]=0\in \mathcal H^k(U_i)$, and thus the first axiom  for a presheaf to be a sheaf is violated.
But what about the second axiom?
My question:
Suppose we are given a differential manifold M, a covering $(U_\lambda)_{\lambda \in \Lambda}$of $M$ by open subsets $U_\lambda \subset M$, closed differential $k-$forms $\omega_\lambda \in \Omega^k_M(U_\lambda)$ satisfying $[\omega_\lambda]\vert U_\lambda \cap U_\mu=[\omega_\mu]\vert U_\lambda \cap U_\mu\in \mathcal H^k(U_\lambda\cap U\mu)$ for all $\lambda,\mu \in \Lambda$.
Does there then exist a closed differential form $\omega\in \Omega^k(M)$ such that we have for the restrictions in cohomology: $[\omega]\vert U_\lambda=[\omega _\lambda]\in \mathcal H^k(U_\lambda)$ for all $\lambda\in \Lambda$ ?
Remarks

*

*This is an extremely naïve question which, to my embarrassment, I cannot solve.
I have extensively browsed the literature and consulted some of my friends, all brilliant geometers (albeit not differential topologists), but they didn't know the answer offhand.
For what it's worth, I would guess (but not conjecture!) that such glueing is impossible.

*If the covering of $X$ has only two opens then we can glue.
This follows immediately from Mayer-Vietoris's long exact sequence
$$\cdots  \to \mathcal H^k(M) \to \mathcal H^k(U_1) \oplus   \mathcal H^k(U_2) \to \mathcal H^k(U_1\cap U_2)\to \cdots$$
Update
My brilliant friends didn't answer offhand but a few hours later, unsurprisingly, they came back to me with splendid counterexamples! See below.
 A: Here is the solution obtained by one of my brilliant geometer friends evoked in the question:
Take $X=S^2$, the unit $2$-sphere with equation $x_1^2+x_2 ^2+x_3^2=1$, and cover it by the three open strips $U_i=\{(x_1,x_2,x_3)\in S^2\vert \vert x_i \vert \leq \frac 35 \}$.

*

*The $U_i$'s do cover $S^2$: a point on the unit sphere can't have its three
coordinates  $\geq \frac 35$ .

*For all $i\neq j$ it we see, by projecting on the coordinate planes, that  $U_i\cap U_j$ is the disjoint sum of two antipodal open spherical quadrilaterals homeomorphic to squares, so that $\mathcal H^1(U_i\cap U_j)=0$.

*Each $U_i$ deformation retracts to its central great circle,  so that  each $H_{DR}^1(U_i)=\mathbb Z$.

It is then clear that given arbitrary nonzero De Rham cohomology classes De Rham $0\neq [\omega_i]\in H_{DR}^1(U_i)$ the glueing condition is vacuously satisfied because of 1.
Nevertheless these cohomolgy classes can't be glued to a cohomology class in $S^2$ since $\mathcal H^1(S^2)=0$.
Important remark
My contribution to this answer is: zero, nada, zilch, que dalle...
A: Here is the great answer given by another of my brilliant friends:
Let $X$ be $\mathbb C, U_0$ be the open complement in $X$ of the closed disk $\bar D=\{z\in \mathbb C\vert \vert z\vert \leq1 \}$
and add a few open discs $U_1,\cdots, U_n$ of radius $\lt 1$ covering $\bar D$ in order to obtain an open covering  $U_0,U_1,\cdots U_n$  of $X$.
Now let $[0]\neq[\omega _0]\in \mathcal H^1(U_0)\cong \mathbb Z$ be a nonzero cohomology clas and define (no choice here!) $0=[\omega_i]\in \mathcal H^1(U_i)=0$.
The compatibility conditions are trivially satisfied since all intersections $U_i\cap U_j (i\neq j)$ are contractible, so that $\mathcal H^1(U_i\cap U_j )=0$.
Nevertheless we can't glue our cohomology classes $[\omega_i]$ to a global cohomology class $[\omega] \in \mathcal H^1(X)$  since the only global cohomology class on $X$ is $0\in \mathcal H^1(X)=0$, which does not restrict to $[\omega _0]\neq 0\in \mathcal H^1(U_0)$.
Remark
Here too the answer is entirely due to my geometer friend.
A: No.
Make $M$ by gluing three strips to two discs to form a thrice-punctured sphere. Take three open sets $U_\lambda$, each made by both discs and two of the strips. Then each $U_\lambda$ is homeomorphic to annulus and thus has $1$-dimensional $H^1$.
The pairwise intersections, made from one strip connecting two discs, are contractible and so their $H^1$ vanishes. Thus, for $k=1$, the agreement condition on the pairwise intersections is vacuous.
If your claim held, then we could choose a $1$-form on $M$ that restricts to an arbitrary cohomology class on each of the three $U_\lambda$, making the first de Rham cohomology of $M$ at least three-dimensional. But in fact it is only two-dimensional. Instead, there is a relation where the integrals around three clockwise loops around the three punctures sum to $0$, because these loops form the boundary of a particular subset of $M$.
It's true if the intersections $U_\lambda \cap U_\kappa \cap U_\mu$ are empty for all distinct $\lambda,\kappa,\mu$, by iteratively applying the Mayer-Vietoris sequence or applying a single exact sequence in sheaf cohomology.
A: This answer provides a positive answer to a refinement of the original question.
Recall that two closed differential $k$-forms $ω_0$, $ω_1$ on a smooth manifold $M$
have the same de Rham cohomology class if and only if they are concordant, i.e., there is a closed differential $k$-form $τ$ on $\def\R{{\bf R}} \R⨯M$
such that the pullbacks of $τ$ to $\{0\}⨯M$ and $\{1\}⨯M$ are equal to $ω_0$ and $ω_1$ respectively.
Thus, the given data can be reformulated as a collection of closed differential forms on $\{U_λ\}_{λ∈Λ}$ whose restrictions to pairwise intersections $U_λ∩U_μ$ are concordant.
In order to get a good descent-type statement, we make two modifications that are standard in sheaf theory:

*

*We introduce the additional data of (a specific choice of) a concordance $ω_{λ,μ}$ between $ω_λ$ and $ω_μ$ on the open subset $U_λ∩U_μ$.


*More generally, for every $(n+1)$-tuple $T$ of indices in $Λ$ we introduce an $n$-dimensional concordance, given by a closed differential $k$-form $ω_T$ on $Δ^n⨯(U_{T_0}∩⋯∩U_{T_n})$, which must be compatible with forms assigned to various faces of $T$.
It is this type of data that can be glued together.
In fact, a much more general statement is true, where the sheaf of closed differential $k$-forms is replaced by any simplicial presheaf on the site of smooth manifolds:
Theorem (Theorem 1.1 in arXiv:1912.10544):

Suppose $F$ is a presheaf of simplicial sets on the site of smooth manifolds and smooth maps of manifolds, equipped with the usual Grothendieck topology of open covers.  Define the simplicial presheaf $\def\B{{\rm B}} \B F$ via the formula $$\def\op{{\rm op}} \def\hocolim{\mathop{\rm hocolim}} \B F(M) = \hocolim_{n∈Δ^\op} F(Δ^n⨯M).$$  If $F$ is an ∞-sheaf (i.e., satisfies the homotopy descent condition), then so is $\B F$.
Furthermore, $\B F$ is representable by the space $\B F(\R^0)$: the canonical map $$\def\R{{\bf R}} \def\Map{\mathop{\rm Map}} \B F(M)→\R\Map(M,\B F(\R^0))$$ is a weak equivalence.

This implies the desired statement: the data of forms on $U_λ$ together with concordances on $U_λ∩U_μ$ etc., defines a Čech descent data for the simplicial presheaf $\B F$, where $F$ is the sheaf of closed differential $n$-forms.  According to the above theorem, this descent property of $\B F$ allows us to glue this data to a single section of $\B F$ (and therefore of $F$) over $M$, as desired.
Taking other simplicial presheaves $F$ produces similar gluing statements for other geometric objects, e.g., principal $G$-bundles with connection, bundles $d$-gerbes with connection, etc.
In particular, we see that the original statement is true if all triple intersections $U_λ∩U_μ∩U_ν$ are empty, since in this case there are no higher concordances to choose.
