Let s ∈ N, T 1 , T 2 ∈ R, T 1 < T 2 , and Ω, ω be bounded domains in R n , n ≥ 1, such that ω ⊂ Ω and the complement Ω \ ω has no (non-empty) compact components in Ω. We prove that this is the necessary and sufficient condition for the space H 2s,s H (Ω × (T 1 , T 2 )) of solutions to the heat operator H in a cylinder domain Ω×(T 1 , T 2 ) from the anisotropic Sobolev space H 2s,s (Ω× (T 1 , T 2 )) to be dense in the space L 2 H (ω×(T 1 , T 2 )), consisting of solutions in the domain ω ×(T 1 , T 2 ) from the Lebesgue class L 2 (ω ×(T 1 , T 2 )). As an important corollary we obtain the theorem on the existence of a basis with the double orthogonality property for the pair of the Hilbert spaces H 2s,s H (Ω × (T 1 , T 2 )) and L 2 H (ω × (T 1 , T 2 )) .