Help understanding example in Papoulis & Pillai-4th Ed I'm at a loss understanding the text of an example 4-18 in the book "Probability,Random Variables and Stochastic Processes" by Papoulis and Pillai, 4th ed 2002, McGraw Hill
The example is posed as a question as follows
Suppose that the probability of heads in a coin-tossing experiment $S$ is not a number,but a random variable $\textbf{p}$ with density $f(p)$ defined in some space $S_c$. The experiment of the toss of a randomly selected coin is a cartesian product $S_c \times S$. In this experiment,the event $H=\{head\}$ consists of all pairs of the form $(\zeta_c,h)$ where $\zeta_c$ is any element of $S_c$ and $h$ is the element heads of the space $S = \{h, t\}$.Show that
\begin{equation}
P(H) = \int_{0}^{1}pf(p)dp
\end{equation}
Here are my doubts:


*

*How is $S$ formed, as a space of single toss of coin or a number of coins.

*What exactly is $\textbf{p}$ and its associated distribution $f(p)$. In this case is $S_c$, an experiment that randomly chooses a point from the interval from $[0,1]$ since $\textbf{p} \in [0,1]$.

*If the the last point is true, why is the assertion $P\{H|\textbf{p}=p\} = p$, true? Since $p$ is randomly chosen number.

 A: The experiment goes on like this: First the experimenter receives a random number $\textbf p$. If $\textbf p=p$ then she creates a coin in the case of which the probability of heads is $p$... So, the actual probability is always a number, and the actual coin is created according to the actual value. 
Say, we have $5$ coins. Then the probability space $[\Omega,\mathscr A, P]$ is formed as follows: $\Omega=I_5\times [0,1]$ where $I_5$ is the set of strings of length $5$ containing $H$s and $T$s. That is, an elementary event is like this $$(0.25,HHHTH)\in \Omega.$$ Meaning: the probability of the heads is $0.25$ and the actual rolls resulted in $HHHTH$. $\mathscr A$ is the product $\sigma$-algebra, product of $2^{I_n}$ and, say, the Borel sets, $\mathscr B$, in $[0,1]$.
From this point on, we will assume that the experiment resulting in a $p$ and the experiment resulting in a head or a tail or a sequence of heads and tails are independent. The first experiment influences the second experiment only through the value of $p$. This is called conditional independence.
Let $B\in \mathscr B$. Then $P(B)$  is given by the integral
$$P(B)=\int_Bf_{\textbf p}(p)\ dp.$$ Now, if $B\in \mathscr B$ and, say,  $A=\{HHHTH\}$ then $P(B\times A)$ is given as $$\int_Bp^3(1-p)f_{\textbf p}(p)\ dp
.$$ If $A$ is a set of strings $i$ like $HHHTH$ then $$P(B\times A)=\sum_{i\in A}\int_Bp^{i_H}(1-p)^{5-i_H}f_{\textbf p}(p)\ dp$$ where $i_H$ is the number of heads in an individual $i\in A$. Finally, the definition of $P$ can be extended to all kinds of sets in the smallest $\sigma$-algebra containing the Cartesian products $B\times A$.
These have been definitions. The question remains: Does this model describe what we have in mind regarding such an experiment. Consider the even that the result of the first roll is $H$. Then
$$P(\{H\})=P(\{H\}\times [0,1])=E[P(\{H\}\times[0,1]\mid \textbf p\ )]=$$
$$=\int_{[0,1]}P(\{H\}\mid \textbf p=p  )f_{\textbf p}(p)\ dp=\int_0^1pf_{\textbf p}(p)\ dp$$
because
$P(\{H\}|\textbf p=p)=p$ and this is not an assertion! This is the definition of $P$ for the special case of $\{H\}$.
