I do not see why it is important to include the condition that only vertices of degree less than $4$ are leaves. I am going to prove a general statement. Note that this proof can be rewritten so that it is an inductive proof

**Proposition.** Let $k\geq 1$ and $d\geq 2$ be integers. Let $T$ be a (finite) tree with exactly $k$ vertices of degree $d$. Then, $T$ has at least $(d-2)k+2$ leaves.

Suppose on the contrary that, for some positive integer $k$, there exists a tree with exactly $k$ vertices of degree $d$ but with fewer than $(d-2)k+2$ leaves. Take $T$ to be such a tree with the smallest possible $k$. If $k>1$, then let $u$ be a vertex of $T$ with degree $d$. Suppose that $v_1,v_2,\ldots,v_d$ are the neighbors of $u$. Let $C_i$ be the connected component of $T-u$ containing $v_i$, for $i=1,2,\ldots,d$. Take $T_i$ to be the tree with vertices from $C_i$ and an extra vertex $u_i$, which is a leaf and adjacent to $v_i$.

For a graph $G$, let $n_t(G)$ denote the number of vertices of degree $t\in\mathbb{Z}_{\geq 0}$ in $G$. Clearly, we have
$$\sum_{i=1}^d\,n_1(T_i)=n_1(T)+d<\big((d-2)k+2\big)+d\,.$$
Since $T$ is a tree with the smallest $k=n_d(T)$ that violates the claim, we must have
$$n_1(T_i)\geq (d-2)\,n_d(T_i)+2$$
for all $i=1,2,\ldots,d$. This shows that
$$\begin{align}\big((d-2)k+2\big)+d&>\sum_{i=1}^d\,n_1(T_i)\geq \sum_{i=1}^d\,\big((d-2)\,n_d(T_i)+2\big)
\\&=(d-2)\,\sum_{i=1}^d\,n_d(T_i)+2d=(d-2)\,(k-1)+2d\\&=\big((d-2)k+2\big)+d\,.\end{align}$$
This is absurd, so the assumption that $k>1$ cannot be true. Hence, $k=1$.

However, it is easy to show that every tree with exactly $1$ vertex of degree $d$ as at least $d$ leaves. Thus, $k=1$ cannot hold either, and the proposition must be true. (Note that the minimum number of leaves $(d-2)k+2$ is achieved if and only if $T$ has only vertices of degree $1$ or $d$. In such cases, $T$ has $(d-1)k+2$ vertices and $(d-1)k+1$ edges.)

**Corollary.** For integers $d_1,d_2,\ldots,d_m$ with $1<d_1<d_2<\ldots<d_m$, we have $$n_1(T)\geq \sum_{i=1}^m\,(d_i-2)\,n_{d_i}(T)+2$$ for every tree $T$ with at least two vertices.

As before, $n_t(G)$ denote the number of vertices of degree $t\in\mathbb{Z}_{\geq 0}$ in a finite graph $G$. In the corollary, the equality holds iff $n_t(T)=0$ for every integer $t\geq 2$ such that $t\notin \{d_1,d_2,\ldots,d_m\}$. In this case, $T$ has exactly $\displaystyle\sum_{i=1}^m\,(d_i-1)\,n_{d_i}(T)+2$ vertices and $\displaystyle\sum_{i=1}^m\,(d_i-1)\,n_{d_i}(T)+1$ edges.