Simple Random Variable

If $P$ is a probability measure on $A '$ respect to $A$ ( i have supposed $( A$ $A ')$ is a measurable space) and if $f$ is a function from $A$ to $R$ (real numbers set ,sorry for my poor Latex too) , if the set $\{ f (b) \mid b \in A\}$ is finite , if $f$ is measurable respect to $( A$ $A ')$ and $( R$ $Borel R )$ ,if $n$ is a natural $\neq 0$ , $\forall i \in \{ 1,...,n\} B_{i}\in A'$ such that $\forall b\in A$ $f(b)= \sum_ {i=1}^{n} d_{i}*I(B_ {i}(b))$ where $d_{i}$ are real numbers and $I(B_ {i})$ denotes the indicator function of $B_{i}$ and ,analogously $n'$ is a natural $\neq 0$ , $\forall i \in \{ 1,...,n'\} C_{i}\in A'$ such that $\forall b\in A$ $f(b)= \sum_ {i=1}^{n'} e_{i}*I(C_ {i}(b))$ where $e_{i}$ are real numbers ,how can i prove that $\sum_{i=1}^{n} d_{i}*P(B_{i})$ $= \sum_{i=1}^{n'} e_{i}*P(C_{i})$ ? . My idea was to account the standard representation of f setting $\{ f (b) \mid b \in A\} =\{k_{1},...,k_{r}\}$ where $r$ ,natural $\neq 0$, is the cardinality of $\{ f (b) \mid b \in A\}$ , $\forall i\in\{1,..,r \}$ let $F_{i} =\{b \in A \mid f(b)=k_ {i}\}$ so there is the standard representation of $f$ $f(b)= \sum_ {i=1}^{r} k_{i}*I(F_ {i}(b))$ ,and i tried to show $\sum_ {i=1}^{r} k_{i}*P(F_ {i})$ is equal to one between $\sum_ {i=1}^{n} d_{i}*P(B_ {i})$ and $\sum_ {i=1}^{n'} e_{i}*P(C_ {i})$ .To make this i observed : $k{1}*P(F_{1}) +...+k_{r}*P(F_{r}) = (d_{1}*IB_{1}(p_{1}) +...+d{n}*IB_{n}(p_{1})) * P(F_{1}) +...+(d_{1}*IB_{1}(p_{r}) +...+d{n}*IB_{n}(p_{r}) * P(F_{r})= d_{1}*[(P(F_{1})*IB_{1}(p_{1})+...+(P(F_{r}*IB_{1}(p_{r})] +...+d_{n}*[(P(F_{1}*IB_{n}(p_{1})+...+(P(F_{r}*IB_{n}(p_{r})]$ where $p_{i}$ are fixed in $F_{i}$ .Intuitively it results $[(P(F_{1)}*IB_{i}(p_{1})+...+(P(F_{r})*IB_{i}(p_{r} )] = P(B_{i})$ ma i can't prove it.I hope someone help me ,thank you so much.