A company buys and sells grain in cash. The company has a warehouse with a capacity of $5000$ tons. On the first day of March , the stock balance is $1000$ tons and the account balance is $500$ dollars. The approximate price of grain per ton in the spring is as follows:
\begin{array}{|c|} \hline \text{month} & \text{purchase price in dollars} & \text{sale price in dollars}\\ \hline \text{March}& 2850 & 3100&\\ \hline \text{April}& 3050 & 3250&\\ \hline \text{May}&2900 & 2950&\\ \hline \end{array}
Grain delivered in a month will not be sold until the next month. Purchase and sale are made in cash and on time of delivery. The company wants its final inventory to be $2000$ tons by the end of the May. What policy should we choose for buying and selling in these months to maximize the company's overall profit? Formulate the problem as a mathematical programming problem.
The answer is given by:
Define $x_i$ as the amount of grain purchased in the $i$th month of spring,$y_i$ as the amount of grain sold in the $i$th month of spring and $z_{i-1},z_i $ as the inventory amount at the beginning and end of $i$th month of spring (resp) with $ i \in \{1,2,3\}$,then we are going to maximize $$z=(3100y_1 -2850x_1)+(3250y_2-3050x_2)+(2950y_3-2900x_3)$$ Assuming the following constraints hold:
$$\begin{cases} y_1 \le z_0 \\ y_2 \le z_1 \\ y_3 \le z_2 \end{cases}\;\;\;\color{blue}{\begin{cases} z_0 = 1000 \\ z_1 \le 5000 \\ z_2 \le 5000 \\ z_3 =2000 \end{cases}}\;\;\; \begin{cases} z_0+x_1=z_1+y_1 \\ z_1+x_2=z_2+y_2 \\ z_2+x_3=z_3+y_3 \end{cases}$$ \begin{cases} \small{2850x_1 \le 500+3100y_1} \\ \small{3050x_2 \le 500+3100y_1 -2850x_1+3250y_2} \\ \small{2900x_3 \le 500+3100y_1 -2850x_1+3250y_2 -3050x_2+2950y_3} \end{cases}
I think the blue constraints is equivalent to $$\begin{cases} z_0 = 1000 \\ x_1 \le 5000 -(z_0-y_1) \\ x_2 \le 5000 -(z_1-y_2)\\ x_3 \le 5000 -(z_2-y_3)\\ z_3=2000 \end{cases}\tag{I}$$
However from $x_3=z_3-z_2+y_3$ and $z_3=2000$ we see that $$x_3 = 2000-(z_2-y_3)\le 5000-(z_2-y_3)$$
So instead of $(\text{I})$ we can write $$\begin{cases} z_0 = 1000 \\ x_1 \le 5000 -(z_0-y_1) \\ x_2 \le 5000 -(z_1-y_2)\\ z_3=2000 \end{cases}\tag{II}$$
And I think this is the same as the blue part,so instead of the blue part we could write $(\text{II})$
In addition, I think it should be mentioned in the question that the buying grain in the $i$th month is done after the sale of grain in the same month, otherwise one may have have the constraint $2850x_1 \le 500$ and so on.
I'm not looking for the answer itself, I want to know the equivalency of the blue constraints and $(\text{II})$ , and want to know if it's necessary to be be mentioned in the question that the buying grain in the $i$th month is done after the sale of grain in the same month.
I want to start with the second part of your question. As you stated correctly, the answer assumes that earnings from selling grain in month $i$ are available to buy grain in month $i$. I have to say that "on time of delivery" is a little confusing in the task description provided. However, usually when solving a problem like this based on monthly buy and sales cycles, one assumes that all payments are performed at the same time (e.g., at the end of the current month). This is somewhat equivalent to what you suggested. But it would definitely make things clearer if in the problem statement one would explicitly state that selling is performed before buying.
Now to the first part of your question. First of all, neither (I) or (II) is equivalent to the blue constraints. But I assume that this is also not what you want. What you want is that the set of all constraints is equivalent when replacing the blue part by either (I) or (II).
For (II) this is indeed the case. You are just using the representation of $x_1,x_2$ (respectively $z_1,z_2$) by the equality constraints there.
Even if I don't know how you came up with (I), we have equivalent constraints in this case as well. Since we already know that (II) leads to equivalent constraints, it is sufficient to show that $x_3 \leq 5000 - (2_2-y_3)$ is a redundant constraint. You have already done this. Combining the equality constraints $z_2+x_3 = z_3+y_3$ and $z_3 = 2000$ we obtain $x_3 = 2000-(z_2-y_3)$. Hence the constraint $x_3 \leq 5000 - (2_2-y_3)$ is redundant and the set of all constraints obtained when replacing the blue part with (I) is equivalent to the original constraint set as well.