Here are your labeled lines.
There are other ways to shift nodes but IMO the transform canvas
is the most direct, so you are doing fine for that aspect.
To label a line, you can add a node command at the end of the line specification. The label may be placed above
or below
and you can specify where along the line with keywords such as midway
or the more general pos=<fraction along line>
. I also shifted the diagonal lines so that they may both be seen (since one was dashed).
I added a macro to simplify the shifting of the diagonal lines.
\documentclass[border=5pt]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[node distance=2.8cm, auto]
\pgfmathsetmacro{\shift}{0.3ex}
\node (P) {$\mathfrak{P}=\bigoplus_{i\in I}\mathfrak{P_{i}}$};
\node(Q)[right of=P] {$\mathfrak{P_{j}}$};
\node (B) [below of=P] {$\mathfrak{B}$};
\node (C) [right of=B] {$\mathfrak{C}$};
\draw[transform canvas={yshift=0.5ex},->] (P) --(Q) node[above,midway] {\tiny top};
\draw[transform canvas={yshift=-0.5ex},->](Q) -- (P) node[below,midway] {\tiny bottom};
\draw[->](Q) to node {$a$}(C);
\draw[->] (P) to node[swap] {$\pi_{j}$} (B);
\draw[->,dashed] (B) to node {$\psi$} (C);
\draw[->,transform canvas={xshift=-\shift,yshift=\shift}](Q) to node {$a$}(B);
\draw[->, dashed,transform canvas={xshift=\shift,yshift=-\shift}] (Q) to node[swap] {$g$} (B);
\end{tikzpicture}
\end{document}
You can use draw,double=<color>,double distance = <dimen>
in every node
style.:
\documentclass{article}
\setlength{\parindent}{0mm}
\usepackage{paralist}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[every node/.style = {shape = rectangle,
rounded corners,
draw, %% here
double=red, %% here
double distance =1pt, %% here
fill = black!30!white,
minimum width = 3cm,
minimum height = 1.5cm,
align = center,
text = black},
black edge/.style = { -,
ultra thick,
black,
shorten >= 2pt}]
% the nodes : possible \newcommand*\dx{5} \newcommand*\dy{2}
\node(0;0) at (5,0) {Patients};
\node(1;1) at (10, 2) {Treatment $A_1$};
\node(1;-1) at (10,-2) {Treatment $A_2$};
\foreach \j in {-1,1}
{ \draw[black edge] (0;0.east) -- (1;\j.west); }
\end{tikzpicture}
\end{document}
If you don't want color, use simple double
instead of double=<color>
.
Best Answer
Doing this for entertainment :)