[step:Run the Dynkin class argument from the half-line generator]We prove that any Dynkin class containing a $\pi$-system contains the sigma algebra generated by that $\pi$-system, and then apply this to $\mathcal P\subset\mathcal D$.
Let $\mathcal L$ denote the intersection of all Dynkin classes on $\mathbb R$ that contain $\mathcal P$. Then $\mathcal L$ is itself a Dynkin class, $\mathcal P\subset\mathcal L$, and $\mathcal L\subset\mathcal D$ because $\mathcal D$ is a Dynkin class containing $\mathcal P$.
We first show that $\mathcal L$ is closed under intersections. Fix $E\in\mathcal P$ and define
\begin{align*}
\mathcal L_E:=\{A\in\mathcal L:A\cap E\in\mathcal L\}.
\end{align*}
Because $\mathcal P$ is a $\pi$-system, if $P\in\mathcal P$, then $P\cap E\in\mathcal P\subset\mathcal L$; hence $\mathcal P\subset\mathcal L_E$. We verify that $\mathcal L_E$ is a Dynkin class. First, $\mathbb R\in\mathcal L_E$ because $\mathbb R\cap E=E\in\mathcal P\subset\mathcal L$. If $A\in\mathcal L_E$, then $A\cap E\in\mathcal L$. Since $E\in\mathcal L$ and $A\cap E\subset E$, the sets $A\cap E$ and $E\setminus(A\cap E)$ are disjoint and their union is $E$. Closure of the Dynkin class $\mathcal L$ under complements in $\mathbb R$ and under countable disjoint unions implies closure under differences $F\setminus G$ whenever $G,F\in\mathcal L$ and $G\subset F$; applying this with $G=A\cap E$ and $F=E$ gives
\begin{align*}
A^c\cap E=E\setminus(A\cap E)\in\mathcal L.
\end{align*}
Thus $A^c\in\mathcal L_E$. If $(A_n)_{n\in\mathbb N}$ is pairwise disjoint in $\mathcal L_E$, then $(A_n\cap E)_{n\in\mathbb N}$ is pairwise disjoint in $\mathcal L$, and distributivity gives
\begin{align*}
\left(\bigcup_{n=1}^{\infty}A_n\right)\cap E=\bigcup_{n=1}^{\infty}(A_n\cap E).
\end{align*}
The Dynkin property of $\mathcal L$ gives $\bigcup_{n=1}^{\infty}(A_n\cap E)\in\mathcal L$, so $\bigcup_{n=1}^{\infty}A_n\in\mathcal L_E$. Therefore $\mathcal L_E$ is a Dynkin class. By the minimality of $\mathcal L$, we have $\mathcal L\subset\mathcal L_E$. Therefore $A\cap E\in\mathcal L$ for every $A\in\mathcal L$ and every $E\in\mathcal P$.
Now fix $A\in\mathcal L$ and define
\begin{align*}
\mathcal L_A:=\{B\in\mathcal L:A\cap B\in\mathcal L\}.
\end{align*}
The previous paragraph gives $\mathcal P\subset\mathcal L_A$. We verify directly that $\mathcal L_A$ is a Dynkin class. First, $\mathbb R\in\mathcal L_A$ because $A\cap\mathbb R=A\in\mathcal L$. If $B\in\mathcal L_A$, then $A\cap B\in\mathcal L$. Since $A\in\mathcal L$ and $A\cap B\subset A$, the relative-difference property for included members of a Dynkin class gives
\begin{align*}
A\cap B^c=A\setminus(A\cap B)\in\mathcal L.
\end{align*}
Thus $B^c\in\mathcal L_A$. If $(B_n)_{n\in\mathbb N}$ is pairwise disjoint in $\mathcal L_A$, then $(A\cap B_n)_{n\in\mathbb N}$ is pairwise disjoint in $\mathcal L$, and
\begin{align*}
A\cap\left(\bigcup_{n=1}^{\infty}B_n\right)=\bigcup_{n=1}^{\infty}(A\cap B_n).
\end{align*}
The Dynkin property of $\mathcal L$ gives the right-hand side in $\mathcal L$, so $\bigcup_{n=1}^{\infty}B_n\in\mathcal L_A$. Therefore $\mathcal L_A$ is a Dynkin class. Hence $\mathcal L\subset\mathcal L_A$, so $A\cap B\in\mathcal L$ for all $A,B\in\mathcal L$. Thus $\mathcal L$ is both a Dynkin class and a $\pi$-system.
Since $\mathcal L$ is closed under complements and finite intersections, it is closed under finite unions. If $(A_n)_{n\in\mathbb N}$ is any sequence in $\mathcal L$, define
\begin{align*}
B_1:=A_1
\end{align*}
and, for $n\ge 2$,
\begin{align*}
B_n:=A_n\cap\left(\bigcup_{k=1}^{n-1}A_k\right)^c.
\end{align*}
Each $B_n$ belongs to $\mathcal L$, the sets $(B_n)_{n\in\mathbb N}$ are pairwise disjoint, and
\begin{align*}
\bigcup_{n=1}^{\infty}A_n=\bigcup_{n=1}^{\infty}B_n.
\end{align*}
The Dynkin property gives $\bigcup_{n=1}^{\infty}A_n\in\mathcal L$. Hence $\mathcal L$ is a sigma algebra. Therefore $\sigma(\mathcal P)\subset\mathcal L\subset\mathcal D$.[/step]