I am learning a little bit about Dehn functions of group presentations and I came across a question that is probably pretty basic but that I was giving me trouble. I'll set some notation but essentially I want to understand why being able to compute an upper bound for the Dehn function means that the word problem is solvable.

Let $\phi: F(A) \to G$ be a surjective homomorphism of groups where $A$ is a finite set and $F(A)$ is the free group on $A$. Also assume that the kernel of this homomorphism is normally generated by a finite set $R$. In other words, we are given a finite presentation of $G$. Let $\delta : \mathbb{N} \to \mathbb{N}$ be the Dehn function of this presentation, namely, $\delta(n)$ is the smallest number such that every element $w \in F(A)$, with $\ell(w) \leq n$ and $\phi(w) = 1$, as the product of conjugates of $\delta(n)$ elements of $R$ (or there inverses). Namely, for such $w$, we have $$w = \prod_{i=1}^M p_i r_i^{\epsilon_i} p_i^{-1}$$ with $p_i \in F(A)$, where the above equality is in $F(A)$.

I was told that we can assume that there is a way to find such an expression with $M \leq \delta(n)$ and $\ell(p_i) \leq \ell(w) + M \rho$ where $\rho$ is the max length of the elements in $R$. Why is this the case?

I was thinking of this in terms of van Kampen diagrams where I see equations of the above from as "flowers". The Dehn function tells us how many "petals" we need. But I was hoping to have short "petals" (and not too many). Can you help me shorten the petals?