4. For any integer $n(n \geqslant 4)$, consider $m$ subsets $A_{1}, A_{2}, \cdots, A_{m}$ of the set $\{1,2, \cdots, n\}$, where $A_{1}$ has one element, $A_{2}$ has two elements, $\cdots \cdots A_{m}$ has $m$ elements, and no subset is contained in another subset. Find the maximum value of $m$.


4. The maximum value of $m$ is $n-2$.

First, construct $n-2$ subsets of the set $\{1,2, \cdots, n\}$ that satisfy the required conditions, and call such subsets "good".
When $n=4$, we can take $A_{1}=\{1\}, A_{2}=\{2,3\}$.
When $n=5$, we can take
$$
A_{1}=\{1\}, A_{2}=\{2,3\}, A_{3}=\{2,4,5\} \text {. }
$$

Next, prove that for $n$, if there exist $n-2$ good subsets, then for $n+2$ there exist $n$ good subsets.
Assume for $n$, $A_{1}, A_{2}, \cdots, A_{n-2}$ are good subsets, consider
$B_{1}=\{n+2\}$,
$B_{i+1}=A_{i} \cup\{n+1\}(1 \leqslant i \leqslant n-2)$,
$B_{n}=\{1,2, \cdots, n\}$.
It is easy to see that $B_{1}, B_{2}, \cdots, B_{n}$ are good subsets.
Finally, prove that for $n$, constructing $n-1$ good subsets is impossible.
Proof by contradiction.
Assume for $n$, $A_{1}, A_{2}, \cdots, A_{n-1}$ are good subsets.
If $A_{1}=\{x\}$, then
$A_{n-1}=\{1,2, \cdots, n\} \backslash\{x\}$.
Since $A_{2}$ contains two elements different from $x$, and these elements are in $A_{n-1}$, it follows that $A_{2} \subset A_{n-1}$, which is a contradiction.