Let $K$ be a finite extension of $F$ with char $F = p > 0$ and $K^p\subseteq F$. Thus, $K/F$ is purely inseparable. A set $\{a_1,\dots, a_n\}\subseteq K$ is said to be a $p$-basis for $K/F$ provided that there is a chain of proper extensions
$$F\subset F(a_1) \subset F(a_1, a_2) \subset \dots \subset F(a_1, \dots , a_n) = K.$$ Show that if $\{a_1, \dots ,a_n\}$ is a $p$-basis for $K/F$, then $[K: F] = p^n$, and conclude that the number of elements in a $p$-basis is uniquely determined by $K/F$. The number $n$ is called the $p$-dimension of $K/F$. Also, show that any finite purely inseparable extension has a $p$-basis.
Note: This has already been posted in the following link: Show that any finite purely inseparable extensions has a $p-$basis., but in an incorrect and incomplete way. They have not given an answer, so I ask the question again in a corrected way.
My attempt: \begin{align} [K:F]&=[F(a_1,\dots, a_n):F]\\ &=[F(a_1,\dots, a_n):F(a_1,\dots, a_{n-1})][F(a_1,\dots, a_{n-1}):F(a_1,\dots, a_{n-2})] \cdots [F(a_1,a_2):F(a_1)][F(a_1):F]. \end{align} So, we would have to show that the minimal polynomial of each $a_i$ is $x^p-a_i^p=(x-a_i)^p$. I am not sure of this; with this will the first part of this exercise be solved?
For the second part, if $K$ is a purely inseparable finite extension then $K=F(a_1,\dots, a_n)$ where each $a_i$ is purely inseparable over $F$ and so $F\subset F(a_1) \subset F(a_1, a_2) \subset \dots \subset F(a_1, \dots , a_n) = K$.