how to calculate Leontief demand functions from first order conditions of a CES function when sigma tends to 0?

This question is NOT about how to approximate a CES function to a leontief function.

Knowing that:

$$i= good (\begin{array}{*{20}{c}} {1}&{or}&{2} \end{array})$$

$$j= firm (\begin{array}{*{20}{c}} {1}&{or}&{2} \end{array})$$

I have this optimization problem:

$$\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} {\mathop {Maximize}\limits_{{Z_j},{Y_j},{X_{i,j}}} }&{\pi _j^z} \end{array} = p_j^z{Z_j} - \left( {p_j^y{Y_j} + \sum\limits_i {p_i^q{X_{i,j}}} } \right)}&{(0.1)} \end{array}$$

subject to

$$\begin{array}{*{20}{c}} {{Z_j} = \min \left( {\frac{{{X_{1,j}}}}{{a{x_{1,j}}}},\frac{{{X_{2,j}}}}{{a{x_{2,j}}}},\frac{{{Y_j}}}{{a{y_j}}}} \right)}&{(0.2)} \end{array}$$

In the book that I am following, they arrive at the following first-order conditions:

$$\begin{array}{l} \begin{array}{*{20}{c}} {{X_{i,j}} = a{x_{i,j}}{Z_j}}&{\forall i,j}&{(1)} \end{array}\\ \begin{array}{*{20}{c}} {{Y_{j}} = a{y_i}Z}&{\forall j}&{(2)} \end{array}\\ \begin{array}{*{20}{c}} {{Z_j} = \min \left( {\frac{{{X_{1,j}}}}{{a{x_{1,j}}}},\frac{{{X_{2,j}}}}{{a{x_{2,j}}}},\frac{{{Y_j}}}{{a{y_j}}}} \right)}&{\forall j}&{(3)} \end{array} \end{array}$$

Then in a footnote they say the following: "we cannot solve this profit-maximization problem by simply applying the Lagrange multiplier method because the Leontief-type production function $$(0)$$ is not differentiable.To derive the intermediate input demand function $$(1)$$ and the composite factor demand function $$(2)$$, we have to use a constant elasticity of substitution (CES) function, which is a generalized functional form of the Leontief-type function, and derive these first-order conditions. When the elasticity of substitution in the CES function tends to zero, the derived first-order conditions approach the expressions of $$(0)$$, $$(1)$$ and $$(3)$$."

What I understand from the bolded part above is that you first solve the optimization problem represented by the equations $$(0.1)$$ and $$(0.2)$$ but using a CES function instead of $$(0.2)$$. I approach the problem as follows:

Knowing that:

$$\begin{array}{*{20}{c}} {\sigma = \frac{1}{{1 - \rho }}}& \wedge &{\rho = \frac{{\sigma - 1}}{\sigma }} \end{array}$$

The problem is:

$$L({Z_j},{Y_j},{X_{i,j}}) = p_j^z{Z_j} - \left( {p_j^y{Y_j} + \sum\limits_i {p_i^q{X_{i,j}}} } \right) + {\psi _i}\left[ {{{\left( {\frac{{X_{1,j}^\rho }}{{a{x_{1,j}}}}+\frac{{X_{2,j}^\rho }}{{a{x_{2,j}}}}+\frac{{Y_j^\rho }}{{a{y_j}}}} \right)}^{\frac{1}{\rho }}} - {Z_j}} \right]$$

Later, I understand that once you get the optimal demands with the first order conditions of this problem, then you evaluate what happens to these when sigma tends to 0 and these functions should approximate $$(1)$$ and $$(2)$$. I already solved this problem, but I don't know how from the first-order conditions of the above problem we arrive at equations (1) and (2). Can someone please tell me how to do this?

This is the first order condition:

$${X_{1,j}} = {Z_j}{\left[ {\frac{1}{{a{x_{1,j}}}} + \frac{1}{{a{x_{2,j}}}}{{\left( {\frac{{p_2^q}}{{p_1^q}}} \right)}^{\frac{\rho }{{\rho - 1}}}}{{\left( {\frac{{a{x_{2,j}}}}{{a{x_{1,j}}}}} \right)}^{\frac{\rho }{{\rho - 1}}}} + \frac{1}{{a{y_j}}}{{\left( {\frac{{p_2^y}}{{p_1^q}}} \right)}^{\frac{\rho }{{\rho - 1}}}}{{\left( {\frac{{a{y_j}}}{{a{x_{1,j}}}}} \right)}^{\frac{\rho }{{\rho - 1}}}}} \right]^{( - )\frac{1}{\rho }}}$$

• What book is this taken from? – Michael Greinecker Jul 3 at 16:24
• The book is "Textbook of Computable General Equilibrium Modelling_ Programming and Simulations" on the page 90 of the book. This is the reference: Hosoe, N., Gasawa, K., & Hashimoto, H. (2010). Textbook of computable general equilibrium modeling: programming and simulations. Springer. – Jose Tapias Jul 3 at 18:17
• The way you stated your question left a few things out that are in the book, such as the intermediate goods and the definition of $Y_j$. It should certainly be easier to obtain the conditions directly; see here how one can work with maximizing $\min$-functions in the context of a consumer problem. – Michael Greinecker Jul 3 at 18:35
• I know where to get the functions intuitively, the first stage is not important for the solution of this problem, $Y_j$ is simply another production cost (compound production factor). But in the footnote number 7 of that chapter (chapter 6), they say that they first solve the problem restricted to a CES and then take out the limit of the first order conditions. Can you read it? What I understand from that page request is what I am trying to do because it seems to me a cleaner way to get to the demands. – Jose Tapias Jul 3 at 20:27
• In the link, I explain how to formally prove what the optimum is. This is actually more rigorous than proving that some condition is a limit of first-order conditions for CES functions. – Michael Greinecker Jul 3 at 20:31