  We introduce the notion of double Courant-Dorfman algebra and prove that it
satisfies the so-called Kontsevich-Rosenberg principle, that is, a double
Courant-Dorfman algebra induces Roytenberg's Courant-Dorfman algebras on the
affine schemes parametrizing finite-dimensional representations of a
noncommutative algebra. The main example is given by the direct sum of double
derivations and noncommutative differential 1-forms, possibly twisted by a
closed Karoubi-de Rham 3-form. To show that this basic example satisfies the
required axioms, we first prove a variant of the Cartan identity
$[L_X,L_Y]=L_{[X,Y]}$ for double derivations and Van den Bergh's double
Schouten-Nijenhuis bracket. This new identity, together with noncommutative
versions of the other Cartan identities already proved by
Crawley-Boevey-Etingof-Ginzburg and Van den Bergh, establish the differential
calculus on noncommutative differential forms and double derivations and should
be of independent interest. Motivated by applications in the theory of
noncommutative Hamiltonian PDEs, we also prove a one-to-one correspondence
between double Courant-Dorfman algebras and double Poisson vertex algebras,
introduced by De Sole-Kac-Valeri, that are freely generated in degrees 0 and 1.
