Equivalent definitions of foliation I am having trouble proving the equivalence of two different definitions of foliation. The first one is the one where you define a k-foliation on a smooth manifold $M$ with k-dimensional leaves such that every point has a local chart that sends all these submanifolds in "horizontal subspaces" of $\mathbb{R}^n$. The second definition is the one where you require an atlas with transition functions like $\phi_{ij}(x,y)=(\phi^1 _{ij}(x,y), \phi^2 _{ij}(y))$. I am not being formal because I think these are quite common definitions, and you know what I am talking about.
The problem is proving that the second definition implies the first. The teacher suggests taking different topologies on $\mathbb{R}^k$ and $\mathbb{R}^{n-k}$ and then the product topology, but it is a quite short hint and I really don't understand what to do. Also, it is pointed out that the biggest problem here would be the second countability, but I can't understand the reasoning I should do. 
This equivalence is stated right after the two definitions are given, so there shouldn't be any need of particular results concerning foliations.
 A: Given an atlas $\Phi_i = (\Phi_i^1, \Phi_i^2)$ as you described, define the foliation locally by the preimage of the horizontal subspaces. The condition on the cocycles (transition functions) will imply that these local submanifolds glue together to make the leaves. In particular, for any point $p$ in the domain of a $\Phi_j$, then this chart send the foliation around $p$ to the foliation of horizontal subspaces.  As seen in the following image

taken from page 22 of Camacho, Lins Neto - Geometric Theory of Foliations.
ADDED: As requested by the OP, we need to show how these leaves are in fact immersed submanifolds. It is not really trivial. I'll try to sketch the idea but for a precise proof I refer to Lemma 1.2.16 in Candel, Colon - Foliations I 
We give another structure to $M$ using the given the atlas $(U_i,\Phi_i)$.
First we give $\mathbb{R}^k$ the standard topology and give $\mathbb{R}^{n-k}$ the discrete topology. Then consider $\mathbb{R}^n =\mathbb{R}^k\times \mathbb{R}^{n-k}$ with the product topology. This leads to a structure of $k$-dimensional manifold in  $\mathbb{R}^n$. 
By the condition on the transition functions (which says that $(U_i,\Phi_i)$ is a coherent foliated atlas) we can extend this sctucture to $M$.  Then $M$ will be a $k$-dimensional manifold whose connected components are exactly the leaves of the foliation, here enters the problem with the 2nd countability.
Let $x\in M$ and consider the leaf $L_x$ defined by the equivalence relation $x\sim y$ if there is a finite chain of plaques joining $x and y$. The foliated atlas $(U_i,\Phi_i)$ is locally finite by the $n$-manifold structure of $M$. Then each plaque $\Phi_i^{-1}(\{y=c\})$ intersect only a finite number of neighboring plaques. Since each plaque is itself 2nd countable, $L_x$ will be 2nd countable as well. 
Then both $L_x$ and $M$ are the $k$-dimensional manifolds with this new structure and the inclusion is naturally an smooth embedding. This amounts to the inclusion of $L_x$ in $M$ being an immersion if $M$ is considered with the original $n$-dimension structure.
