Understanding proof of a theorem I was going through the cartesian product of graph. There I read the following theorem....


First part of the proof is clear to me. Can anybody explain the converse part to me? I can't get it as its involving projection $p_i$. Projections are defined as:
PROJECTION: Let * represent either cartesian, the direct or strong product of graphs, and consider a product $G_1 * G_2* ....*G_k$. For any index i 1$\leq$i$\leq$k, a Projection map is defined as :
$p_i$ : $G_1 * G_2* ....*G_k$ $\rightarrow$ $G_i$ where $p_i$($x_1,x_2,...,x_k$)=$x_i$.
Thanks a lot for help. 
 A: The author is wanting you to think of edges as sets of nodes. By definition, edges in $G \square H$ are of one of two forms: $ \{(g,h),(g,h')\} $ for $h \neq h'$ or $\{(g,h),(g',h)\}$ for $g \neq g'$. In the former case, we get $p_G(\{(g,h),(g,h')\} = g$ (or really $\{g\}$) and $p_H(\{(g,h),(g,h')\}) = \{h,h'\}$. Same idea in the latter case, but now $p_G$ maps to the edge $\{g,g'\}$, and $p_H$ maps to the vertex $h$.
Now onto the conclusion.
(Note: In what follows, I'm assuming that in this text the path $R$ is a subgraph (not just a sequence of edges that connect $(g,h)$ and $(g',h')$), and that $E(R)$ denotes the set of edges in this subgraph.)
Now let $(g,h), (g',h') \in G\square H$ and define $R$ as in the text.
From the above observation, it follows that $p_G(R)$ and $p_H(R)$ are graphs with edges 
\begin{align*}
E(p_G(R)) &= \{\{g_1,g_2\} : \{(g_1,h_0),(g_2,h_0)\} \in E(R) \text{ for some }h_0\in H\}, \text{ and}\\
E(p_H(R)) &= \{\{h_1,h_2\} : \{(g_0,h_1),(g_0,h_2)\} \in E(R) \text{ for some }g_0\in G\}.
\end{align*}
From the definition of $G \square H$, the edges in $E(p_G(R))$ are edges in $G$, and they form a path from $g$ to $g'$. So $d_G(g,g') \leq |E(p_G(R))|$. Analogous statements can be made about $H$, and so
$$
    d_G(g,g') + d_H(h,h') \leq |E(p_G(R))| + |E(p_H(R))|
$$
From the above discussion, for all $e \in E(R)$, either $p_G(e)$ is in $E(p_G(R))$ or $p_H(e) \in E(p_H(e))$ (and the "or" here is exclusive), and so
$$
    |E(p_G(R))| + |E(p_H(R))| = |E(R)| = d_{G\square H}((g,h),(g',h')),
$$
the last equality being the definition of $d_{G\square H}$
