# Compactness of a set given by two equalities

Let be $$v_1<\cdots and $$\mu\in(v_1,v_n)$$ real numbers. Show that set $$X=\left\{(p_1,\ldots,p_n)\in[0,1]^n\ |\ \sum_{i=1}^np_i=1,\ \sum_{i=1}^np_iv_i=\mu\right\}$$ is compact.

Obviously, $$X$$ is bounded from the definition, but what about the closeness?

My attempt – assume a sequence $$X\ni\boldsymbol{p}^m\to\boldsymbol{p}\in\mathbb{R}^n$$ and I want to show that $$\boldsymbol{p}\in X.$$ We know $$\lim_{m\to\infty}\boldsymbol{p}^m=\boldsymbol{p}\ \Longleftrightarrow\ \forall i\in\{1,\ldots,n\}:\lim_{m\to\infty}p_i^m=p_i,$$ therefore for every index $$i$$ and every (let us say) $$\varepsilon_i\in(0,1)$$ we have some positive integer $$M_i$$ such that for every integer $$m_i>M_i$$ $$p_i^{m_i}-\varepsilon_i holds. Summing these inequalities oves $$i$$ we obtain $$1-\sum_i\varepsilon_i<\sum_i p_i<1+\sum_i\varepsilon_i,$$ but how to proceed? And the other equality is even messier since some $$v_j$$ can be possibly negative.

I don't want a full solution, I'd like to solve it myself, but right now I am stuck...

I suppose that the simples way is to consider the map$$\begin{array}{rccc}F\colon&[0,1]^n&\longrightarrow&\mathbb{R}^2\\&(p_1,\ldots,p_n)&\mapsto&\displaystyle\left(\sum_{k=1}^np_k,\sum_{k=1}^np_kv_k\right).\end{array}$$Then $$F$$ is continuous and your set is $$F^{-1}\bigl(\{(1,\mu)\}\bigr)$$.