On an Optimal Extraction Problem with Regime Switching
Giorgio Ferrari\thanks{Corresponding author. Center for Mathematical Economics
Bielefeld University
Germany; giorgio.ferrari@uni-bielefeld.de
Ferrari_Yang_2016_-Revised.tex
\documentclass[11pt,a4paper,english]{article}

\newcommand{\beq}{\begin{equation}}
\newcommand{\eeq}{\end{equation}}
\newcommand{\cvd}{$\quad\Box $
                  \medskip

                 }
\newcommand{\Paavo}{\textcolor{red}}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{color}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{graphicx}
\usepackage{dsfont}
\usepackage{longtable}

\setlength{\textheight}{22.5cm} %20%

\setlength{\textwidth}{16cm} %16%

\setlength{\voffset}{-1cm}

\setlength{\hoffset}{-1,8cm} %-1.8%


\DeclareMathOperator*{\essinf}{ess\,inf}
\DeclareMathOperator*{\esssup}{ess\,sup}
\DeclareMathOperator*{\argsup}{arg\,sup}
\DeclareMathOperator*{\inter}{int}


\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
%%%%   Remember to set contents of both Definition and
%%%%   Remark to roman type (\rm).
\newtheorem{definition}[theorem]{Definition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{Assumptions}[theorem]{Assumption}
% \newcommand{\qed}{\nolinebreak{\hfill  $\Box$}}
%\newenvironment{proof}{ {\bf Proof: }}{\qed \bigskip\par}
\newcommand{\pa}{\textcolor{red}}
\newcommand{\RR}{ \mathbb{R}}
\newcommand{\PP}{ \mathbb{P}}
\newcommand{\EE}{ \mathbb{E}}
\pagestyle{myheadings}
\markright{ \sc Optimal Extraction with Regime Switching}

\makeatletter  % so @ will be a letter
\@addtoreset{equation}{section}
\def\theequation{\arabic{section}.\arabic{equation}}
\def \ep{\hbox{ }\hfill$\Box$}
\makeatother  % so  @ will not be a letter
\setcounter{section}{0}
\setcounter{equation}{0}

\begin{document} 
\title{\textbf{On an Optimal Extraction Problem with Regime Switching}}
\author{Giorgio Ferrari\thanks{Corresponding author. Center for Mathematical Economics, Bielefeld University, Germany; \texttt{giorgio.ferrari@uni-bielefeld.de}}
\and Shuzhen Yang \thanks{Institution of Financial Studies, Shandong University, P.R.C., and Center for Mathematical Economics, Bielefeld University, Germany; \texttt{shuzhen.yang@uni-bielefeld.de }}}
\date{\today}
\maketitle

\vspace{0.5cm}

{\textbf{Abstract.}} This paper studies an optimal irreversible extraction problem of an exhaustible commodity in presence of regime shifts. A company extracts a natural resource from a reserve with finite capacity, and sells it in the market at a spot price that evolves according to a Brownian motion with volatility modulated by a two state Markov chain. In this setting, the company aims at finding the extraction rule that maximizes its expected, discounted net cash flow. The problem is set up as a finite-fuel two-dimensional degenerate singular stochastic control problem over an infinite time-horizon. We provide explicit expressions both for the value function and for the optimal control. We show that the latter prescribes a Skorokhod reflection of the optimally controlled state process at a certain state and price dependent threshold. This curve is given in terms of the optimal stopping boundary of an auxiliary family of perpetual optimal selling problems with regime switching. The techniques are those of stochastic calculus and stochastic optimal control theory.

\smallskip

{\textbf{Key words}}:
singular stochastic control, optimal stopping, regime switching, Hamilton-Jacobi-Bellman equation, free-boundary, commodity extraction, optimal selling.

\smallskip

{\textbf{MSC2010 subsject classification}}: 93E20, 60G40, 49L20, 60J27, 91G80, 91B76

\smallskip

{\textbf{JEL classification}}: C61, Q32, G11



\section{Introduction}
\label{introduction}

Since the seminal work \cite{BrennanSchwartz}, both the literature in Applied Mathematics and that in Economics have seen numerous papers on optimal extraction problems of non-renewable resources under uncertainty. Some of these works formulate the extraction problem as an optimal timing problem (see, e.g., \cite{DixitPindyck}, \cite{Trigeorgis} and references therein); some as a combined absolutely continuous/impulse stochastic control problem (e.g., \cite{BrekkeOksendal} and \cite{LumleyZervos}); and some others as a stochastic optimal control problem only with classical absolutely continuous controls (cf.\ \cite{Insley1} and \cite{Feliz}, among many others), but with commodity price dynamics possibly described by a Markov regime switching model (cf., e.g., \cite{Insley2}). The latter kind of dynamics, firstly introduced in \cite{Hamilton}, may indeed help to explain boom and bust periods of commodity prices in terms of different regimes in a unique stochastic process.

In this paper we provide the explicit solution to a stochastic irreversible extraction problem in presence of regime shifts in the underlying commodity spot price process. The problem we have in mind is that of a company extracting continuously in time a commodity from a reserve with finite capacity, and selling the natural resource in the spot market. The reserve level can be decreased at any time at a given proportional cost, following extraction policies which do not need be rates. Moreover, the company also faces a cost for reserve's maintenance at a rate that is dependent on the reserve level. The company aims at finding the extraction rule that maximizes the expected discounted net cash flow in presence of market uncertainty and macroeconomic cycles. The latter are described through regime shifts in the volatility of the commodity spot price dynamics.

We set up the optimal extraction problem as a finite-fuel two-dimensional degenerate singular stochastic control problem under Markov regime switching. It is two-dimensional because for any regime $i$ the state variable consists in the value of the spot price, $x$, and the level of the reserve, $y$. It is a problem of singular stochastic control with finite-fuel since extraction does not need be performed at rates, and the commodity reserve has a finite capacity. Finally, it is degenerate as the amount of natural resource extracted does not have a market impact. 

While the literature on optimal stopping problems under regime switching is relatively rich (see, e.g., \cite{Bensoussanetal}, \cite{Buffington}, \cite{Guo01}, \cite{GuoZhang}, \cite{ZhangZhu}, among others), that on explicit solutions to singular stochastic control problems with regime switching is still quite limited. We refer, e.g., to \cite{Pistorius}, \cite{Jiang} and \cite{CadSot} where the optimal dividend problem of actuarial science is formulated as a one-dimensional problem under Markov regime switching. If we then further restrict our attention to singular stochastic control problems with two-dimensional state space and regime shifts, to the best of our knowledge \cite{Guoetal} is the only paper available in the literature. That work addresses an optimal irreversible investment problem in which the growth and the volatility of the decision variable jump between two states at independent exponentially distributed random times. However, although in \cite{Guoetal} the authors provide a detailed discussion on the structure of the candidate solution and on the economic implications of regime switching for capital accumulation and growth, they do not tackle a complete verification theorem confirming their guess.

%focuses on understanding the economic effects of regime switching in the optimal capacity expansion policy, rather than to 

%provides an interesting discussion on the structure of the candidate optimal control and of the control problem's value function, value examines interesting focuses on understanding the economic effects of regime switching in the optimal capacity expansion policy, without providing a complete proof to the optimality of their control problem's candidate value function.

In this paper, with the aim of an analytical study, we assume that the commodity spot price $X$ evolves according to a Bachelier model with regime switching between two states. Under suitable restrictions on the parameters of the model, we show that the optimal extraction rule is of threshold type and we provide an explicit expression for the value function. 
%To the best of our knowledge a similar result appears here for the first time.  

The Hamilton-Jacobi-Bellman (HJB) equation for our optimal extraction problem takes the form of a system of two coupled variational inequalities with state dependent gradient constraints. The coupling is through the transition rates of the underlying continuous-time Markov chain $\varepsilon$, and it makes the problem of finding an explicit solution much harder than in the standard case without regime switching. We associate to the singular control problem a family of optimal stopping problems for the Markov process $(X,\varepsilon)$. Such family is parametrized through the initial reserve level $y$. We explicitly solve the related free boundary problem and we characterize the geometry of stopping and continuation regions. As it is usual in optimal stopping theory we show that the first time the underlying process leaves the continuation region is an optimal stopping rule. For any given and fixed $y$, such time takes the form of the first hitting time of $X$ to a regime dependent boundary $x^*_{i}(y)$, $i=1,2$, which is monotonic as a function of $y$. Under some conditions on the model parameters, these boundaries are found as unique solutions to a system of nonlinear algebraic equations derived by imposing the well known smooth-fit principle. 

We then show that a suitable integral of the stopping problem value function solves the HJB equation of the original optimal control problem, thus providing a candidate value function. Such guess is finally tested against a verification theorem which confirms its actual optimality. As a byproduct we also provide the explicit form of the optimal extraction policy. It keeps at any time the optimally controlled reserve level below a certain critical value $b^*$ with minimal effort, i.e.\ according to a Skorokhod reflection. Such threshold depends on the spot price and the market regime, and is the inverse of the optimal stopping boundary previously determined. As already discussed in \cite{Guoetal}, we prove that the optimal control has jumps at times of regime shifts, thus prescribing a lump-sum extraction at those instants. This feature is not observed in singular control problems in a diffusive setting without regime switching, where jumps in the optimal control are typically observed (possibly) only at initial time. We also show, that in presence of macroeconomic cycles, the company is more reluctant (resp.\ favourable) to extract and then sell the commodity, relative to the case in which the market were always in the good (resp.\ bad) regime with the lowest (resp.\ highest) volatility. The previous economic results are discussed in a final section of the paper.

Our findings hinge on suitable restrictions on the model parameters that allow us to prove the optimality of a regime-dependent barrier strategy for the family of optimal stopping problems involved in our analysis. Unfortunately, without these requirements we did not succeed to prove existence and uniqueness of the solution to the nonlinear smooth-fit equations characterizing the candidate optimal stopping boundaries, and then to verify their actual optimality. By means of a numerical study we show that the set of parameters fulfilling our assumptions is definitely nonempty (see Remark \ref{rem:parameters}). Moreover, numerically solving the nonlinear system characterizing the optimal stopping boundaries $x^*_i$, $i=1,2$, we also provide an illustrative plot of the optimal extraction rule in Figure \ref{fig:1} below. 

The study of the auxiliary family of optimal stopping problems performed in this paper has a financial interest on its own. Each stopping problem takes indeed the form of a perpetual optimal selling problem under regime switching that we explicitly solve. It is worth noticing that most of the papers dealing with optimal stopping problems with regime switching, and following a guess and verify approach, assume existence of a solution of the smooth-fit equations and additional properties of the candidate value function in order to perform a verification theorem (see, e.g., \cite{GuoZhang} and \cite{ZhangZhu}). An abstract and nonconstructive approach, based on a thorough analysis of the involved variational inequality, is adopted in \cite{Bensoussanetal}. Here, instead, we \emph{construct} a solution to the free boundary problem, and we then prove all the properties needed to verify that such solution is actually the value function of our optimal stopping problem with regime switching (see our Theorems \ref{candidate-w} and \ref{thm:verifying} below). We believe that also such result represents an interesting contribution to the literature.

The rest of the paper is organized as follows. In Section \ref{sec:problem} we formulate the optimal extraction problem, we introduce the associated HJB equation and we discuss the solution approach. The family of optimal stopping problems is then solved in Section \ref{sec:OS}, whereas the optimal control is provided in Section \ref{sec:solSSC}. A comparison with the optimal extraction rule that one would find in the no-regime-switching case is contained in Section \ref{comparison}. Appendix \ref{someproofs} collects the proofs of some results of Section \ref{sec:OS}, whereas in Appendix \ref{app} one can find an auxiliary result needed in the paper.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Problem Formulation and Solution Approach}
\label{sec:problem}

\subsection{The Optimal Extraction Problem}

Let $(\Omega,\mathcal{F}, \mathbb{P})$ be a complete probability space, rich enough to accommodate a one-dimensional Brownian motion $\{W_t, t\geq 0\}$ and a continuous-time Markov chain $\{\varepsilon_t, t\geq 0\}$ with state space $E:=\{1,2\}$ and with irreducible generator matrix 
\begin{equation}
\label{Lambdamatrix} 
Q:=
\begin{pmatrix}
-\lambda_1 & \lambda_1 \\
\lambda_2 & -\lambda_2 
\end{pmatrix},
\end{equation}
for some $\lambda_1, \lambda_2 > 0$. The Markov chain $\varepsilon$ jumps between the two states at exponentially distributed random times, and the constant $\lambda_i$ represents the rate of leaving state $i=1,2$. We take $\varepsilon$ independent of $W$ and denote by $\mathbb{F}:=\{\mathcal{F}_t, t\geq 0\}$ the filtration jointly generated by $W$ and $\varepsilon$, as usual augmented by $\mathbb{P}$-null sets.

Assume that the spot price of the commodity evolves according to a Bachelier model \cite{Bachelier} with regime switching; i.e.\
\beq
\label{dyn:X}
dX_t = \sigma_{\varepsilon_t} dW_t, \quad t>0, \qquad X_0=x \in \mathbb{R},
\eeq
where for every state $i=1,2$ $\sigma_i > 0$ is a known finite constant. The choice of an arithmetic dynamics allows us also to capture the fact - unusual in other areas of mathematical finance - that certain commodities can be traded at negative spot prices \cite{Fenton}.

$(X,\varepsilon)$ is a strong Markov process (see \cite{ZhuYin}, Remark 3.11) and we denote by $\mathbb{P}_{(x,i)}(\,\cdot\,):=\mathbb{P}(\,\cdot\,| X_0=x, \varepsilon_0=i)$, and by $\mathbb{E}_{(x,i)}$ the corresponding expectation operator. From Section $3.1$ in \cite{ZhuYin} we also know that $(X,\varepsilon)$ is regular, in the sense that the sequence of stopping times $\{\beta_n, n\in \mathbb{N}\}$, with $\beta_n:=\inf\{t\geq 0: |X_t| =n\}$, is such that $\lim_{n\uparrow \infty} \beta_n = +\infty$, $\mathbb{P}_{(x,i)}$-a.s.

The level of the commodity reserve is such that
\beq
\label{dyn:Y}
dY^{\nu}_t = -d\nu_t, \quad t>0, \qquad Y^{\nu}_0 = y \in [0,1].
\eeq
Taking $y \leq 1$ we model the fact that the reserve level has a finite capacity, normalized to $1$ without loss of generality. Here $\nu_t$ represents the cumulative quantity of commodity extracted up to time $t\geq 0$. We say that an extraction policy is admissible if it belongs to the nonempty convex set
\begin{eqnarray}
\label{admissiblecontrols}
\mathcal{A}_y \hspace{-0.2cm}&:=&\hspace{-0.2cm} \{\nu:\Omega \times \mathbb{R}_{+} \mapsto  \mathbb{R}_{+}, ({\nu_{t}(\omega) := \nu(\omega,t)})_{t \geq 0}\mbox{ is nondecreasing,\,\,left-continuous, adapted} \nonumber \\
&& \hspace{5cm} \mbox{ with} \,\,y- \nu_t\geq 0\,\,\,\forall \; t \geq 0,\,\,\nu_0=0\,\,\,\,\PP-\mbox{a.s.}\}. 
\end{eqnarray}
Moreover, we let $\mathbb{P}_{(x,y,i)}(\,\cdot\,):=\mathbb{P}(\,\cdot\,| X_0=x, Y_0=y, \varepsilon_0=i)$ and $\mathbb{E}_{(x,y,i)}$ the corresponding expectation operator.

While extracting, the company faces two types of costs: the first one is proportional through a constant $c>0$ to the amount of commodity extracted; the second one is a running cost for the maintenance of the reserve. The latter is measured by a function $f$ of the reserve level satisfying the following assumption.
\begin{Assumptions}
\label{Asscost}
$f:\mathbb{R} \to \mathbb{R}_+$, lies in $C^1(\mathbb{R})$ and is strictly increasing, strictly convex and such that $f(0)=0$.
\end{Assumptions}
\noindent Assumption \ref{Asscost} will be standing throughout this paper.

\newpage

\begin{remark}
\begin{enumerate}\hspace{10cm}
\item Notice that the requirement $f(0)=0$ is without loss of generality, since if $f(0)=f_o>0$ then one can always set $\hat{f}(y):=f(y)-f(0)$ and write $f(y)=\hat{f}(y)+f_o$, so that the firms's optimization problem (cf.\ \eqref{value} below) remains unchanged up to an additive constant.
\item Cost functions of the form $f(y)=\alpha_o y^2 + \beta_o y$ for some $\alpha_o,\beta_o>0$, or $f(y)=\gamma_o(e^y-1)$, for some $\gamma_o>0$, clearly meet Assumption \ref{Asscost}.
\end{enumerate}
\end{remark}

Following an extraction policy $\nu \in \mathcal{A}_y$ and selling the extracted amount in the spot market at price $X$, the expected discounted cash flow of the company, net of extraction and maintenance costs, is
\beq
\label{functional}
\mathcal{J}_{x,y,i}(\nu):=\mathbb{E}_{(x,y,i)}\bigg[\int_0^{\infty} e^{-\rho t} \big(X_t - c\big)d\nu_t - \int_0^{\infty} e^{-\rho t}f(Y^{\nu}_t)dt\bigg],\qquad (x,y,i) \in \mathcal{O},
\eeq
where $\rho > 0$ is a given discount factor and $\mathcal{O}:=\mathbb{R}\times [0,1] \times \{1,2\}$. Throughout this paper, for $t > 0$ and $\nu \in \mathcal{A}_y$ we will make use of the notation $\int_0^{t} e^{-\rho s}(X^x_s-c) d\nu_s$ to indicate the Stieltjes integral $\int_{[0,t)} e^{-\rho s} (X^x_s-c) d\nu_s$ with respect to $\nu$.

The company manager aims at choosing an admissible extraction rule so to maximize \eqref{functional}; that is, she faces the optimization problem
\beq
\label{value}
V(x,y,i) := \sup_{\nu \in \mathcal{A}_y}\mathcal{J}_{x,y,i}(\nu), \qquad (x,y,i) \in \mathcal{O}.
\eeq

Notice that due to the convexity of $\mathcal{A}_y$, the linearity of $\nu \mapsto Y^{\nu}$ and the strict convexity of $f(\cdot)$, the functional $\mathcal{J}_{x,y,i}(\cdot)$ is strictly concave. Hence, if a solution to problem \eqref{value} does exist, then it is unique. Moreover, it is easy to see that convexity of $\mathcal{A}_y$ and concavity of $\mathcal{J}_{x,y,i}(\cdot)$ imply in turn concavity of $y\mapsto V(x,y,i)$. Finally, if $y=0$ then no control can be exerted, i.e.\ $\mathcal{A}_0 = \{\nu\equiv 0\}$, and therefore $V(x,0,i)= \mathcal{J}_{x,0,i}(0) =0$, for any $(x,i) \in \mathbb{R} \times \{1,2\}$.

Problem \eqref{value} falls into the class of singular stochastic control problems, i.e.\ problems in which admissible controls need not be absolutely continuous with respect to Lebesgue measure (see \cite{Shreve88} for an introduction). In particular, it is a finite-fuel two-dimensional degenerate singular stochastic control problem under Markov regime switching. It is degenerate as the control variable does not affect directly the dynamics of $(X,\varepsilon)$, and it is finite-fuel since the controls stay bounded.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{The Hamilton-Jacobi-Bellman Equation and the Solution Approach}
\label{sec:HJB}

In light of classical results in stochastic control (see, e.g., Chapter VIII in \cite{FlemingSoner}), we expect that for any $i=1,2$ the value function $V(\cdot,i)$ suitably satisfies the Hamilton-Jacobi-Bellman (HJB) equation
\beq
\label{HJB}
\max\Big\{\big(\mathcal{G} - \rho\big)U(x,y,i) - f(y), (x-c) - U_y(x,y,i)\Big\} =0,
\eeq
for $(x,y) \in \mathbb{R} \times (0,1)$ and with boundary condition $U(x,0,i)=0$. 
Here $\mathcal{G}$ is the infinitesimal generator of $(X,\varepsilon)$. It acts on functions $h: \mathbb{R} \times \{1,2\} \to \mathbb{R}$ with $h(\cdot, i) \in C^2(\mathbb{R})$ for any given and fixed $i \in \{1,2\}$ as
\beq
\label{generator}
\mathcal{G} h(x,i):= \frac{1}{2}\sigma^2_i h_{xx}(x,i) + \lambda_i \big(h(x,3-i) - h(x,i)\big).
\eeq
It is worth noting that \eqref{HJB} is actually a system of two variational inequalities with state-dependent gradient constraints, coupled through the transition rates $\lambda_1,\lambda_2$. 

To have an heuristic justification of \eqref{HJB} one can proceed as follows. Assuming that an optimal extraction rule does exist, at initial time the company manager has to choose between two options: \emph{(a)} extract immediately an amount $\delta>0$ of commodity, sell it in the spot market and then continue optimally; \emph{(b)} do not extract the commodity for a small amount of time $\Delta t$ and then continue following the optimal extraction policy. Both these two strategies are a priori suboptimal. In particular, the first action is associated to the inequality
$$V(x,y,i) \geq (x-c) \delta + V(x,y-\delta,i),$$
that is, dividing by $\delta$ and taking limits as $\delta \downarrow 0$
\beq
\label{HJB-1}
V_y(x,y,i) \geq (x-c).
\eeq

On the other hand, following action \emph{(b)} we obtain 
$$V(x,y,i) \geq \mathbb{E}_{(x,y,i)}\bigg[-\int_0^{\Delta t} e^{-\rho s} f(y) ds + e^{-\rho \Delta t}V(X_{\Delta t}, y, \varepsilon_{\Delta t})\bigg].$$
Supposing that $V$ is regular enough to apply Dynkin's formula to the second term in the expectation above, we have after rearranging terms
\beq
\label{HJB-2}
0 \geq \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\Delta t} e^{-\rho s} \big[\big(\mathcal{G} - \rho\big)V(X_s,y,\varepsilon_s) - f(y)\big] ds \bigg].
\eeq
Dividing \eqref{HJB-2} by $\Delta t$, invoking mean value theorem and taking limits as $\Delta t \downarrow 0$ we obtain 
\beq
\label{HJB-3}
\big(\mathcal{G} - \rho\big)V(x,y,i) - f(y) \leq 0.
\eeq
Given the Markovian nature of the setting, one of the two actions \emph{(a)}-\emph{(b)} should be optimal and one of \eqref{HJB-1}-\eqref{HJB-3} should be an equality, thus leading to \eqref{HJB}.

%Consistently with the heuristics discussed above, we now introduce the so-called waiting, $\mathcal{W}$, and extraction, $\mathcal{E}$, regions
%\beq
%\label{def:inaction-action}
%\mathcal{W}:=\big\{(x,y,i) \in \mathcal{O}\,:\,U_y(x,y,i) > x-c\big\}, \qquad \mathcal{E}:=\big\{(x,y,i) \in \mathcal{O}\,:\,U_y(x,y,i) = x-c\big\}
%\eeq
As it is commonly observed in the singular stochastic control literature (see, e.g., \cite{Alvarez01}, \cite{KaratzasBaldursson}, \cite{Benth} and references therein), also here we expect a connection between our \eqref{value} and a certain optimal stopping problem. In particular, formally differentiating \eqref{HJB} with respect to $y$ inside the region where $(\mathcal{G} - \rho)V(x,y,i) - f(y) =0$, one sees that for any $i=1,2$ $V_y$ should identify with an appropriate solution to the variational inequality
\beq
\label{HJB-OS}
\max\Big\{\big(\mathcal{G} - \rho\big) \zeta(x,i;y) - f'(y), x-c - \zeta(x,i;y)\Big\} =0,
\eeq
for $x \in \mathbb{R}$ and any given $y\in [0,1]$. 

As well as \eqref{HJB}, we notice that also \eqref{HJB-OS} is actually a system of variational inequalities. It is indeed the variational inequality associated to the parameter-dependent (as $y$ enters only as a parameter) optimal stopping problem with regime switching
\begin{equation}
\label{value-OS}
v(x,i;y):=\sup_{\tau \geq 0}\mathbb{E}_{(x,i)}\Big[e^{-\rho \tau}(X_{\tau}-c) - \int_{0}^{\tau} e^{-\rho s} f'(y) ds\Big],\qquad y \in [0,1],
\end{equation}
where $f'$ denotes the derivative of the cost function $f$ and the optimization is taken over all $\mathbb{P}_{(x,i)}$-a.s.\ finite $\mathbb{F}$-stopping times. 
%In \eqref{value-OS} above we adopt the convention $e^{-\rho \tau}(X_{\tau}-c) := \limsup_{t \rightarrow \infty}e^{-\rho t}(X_{t}-c)$ on $\{\tau = +\infty\}$.

In the rest of this paper we will solve \eqref{value} by relying on its - so far only guessed - connection with problem \eqref{value-OS}. In particular,
\begin{itemize}
\item[(i)] Under suitable assumptions on the model parameters, we will solve \eqref{value-OS} and we will show that its optimal solution is triggered by suitable regime dependent stopping boundaries $x^*_i(y)$, $y\in [0,1]$, which are monotonic functions of the parameter $y$. These boundaries are completely characterized as unique solutions to a system of nonlinear algebraic equations. \item[(ii)] We will then show that the function $U(x,y,i):=\int_0^y v(x,i;u)du$ is a classical solution to \eqref{HJB} and that it actually coincides with the value function $V$ of \eqref{value}. As a byproduct we will also provide the optimal control $\nu^*$ as a Skorokhod reflection at the inverse of $x^*_i(\cdot)$.
\end{itemize}

As it will become clear reading the next sections, the solution to the optimal extraction problem under regime switching is much more complex than that one obtains in absence of regime shifts (see Section \ref{comparison}). To deal with such complexity we needed to impose suitable restrictions on the model's parameters, i.e.\ Assumptions \ref{assm-1} and \ref{assm-2} below. These conditions allow us to rigorously solve the problem, and to provide the optimal extraction rule as a threshold policy in terms of a price and regime dependent barrier (see equation \eqref{candidateoptimalcontrol}). Even if we believe that a similar policy is optimal for all the parameters' values, unfortunately we have not been able to prove that.

%\section{Preliminary Properties and the Hamilton-Jacobi-Bellman Equation}
%\label{sec:prelV}

%We start with some simple preliminary properties of $V$.
%\begin{proposition}
%\label{prop:prelV}
%The value function $V$ of \eqref{value} is such that 
%\begin{enumerate}
%	\item $|V(x,y,i)| \leq C(1+|x|)$ for any $(x,y,i) \in \mathcal{O}$ and for some $C>0$;
%	\item $y \mapsto V(x,y,i)$ is concave for any $(x,i) \in \mathbb{R} \times \{1,2\}$.
%	\item $V(x,0,i)=0$ for any $(x,i) \in \mathbb{R} \times \{1,2\}$.
%\end{enumerate}
%\end{proposition}
%\begin{proof}
%Fix $(x,y,i) \in \mathcal{O}$, take an arbitrary $\nu \in \mathcal{A}_y$ and notice that thanks to an integration by parts we can write
%\beq
%\label{finite-0}
%\mathbb{E}_{(x,y,i)}\bigg[\int_0^{\infty} e^{-\rho t} \big(X_t - c\big)d\nu_t\bigg] = \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\infty} \rho e^{-\rho t} \big(X_t - c\big)\nu_t dt\bigg].
%\eeq
%Equation \eqref{finite-0} above follows by recalling that $\nu_t \leq y \leq 1$ for any $t\geq 0$ a.s.\ by admissibility, by observing that $M_t:=\int_0^t \sigma_{\varepsilon_s} dW_s$ is a real $\mathcal{F}_t$-martingale since $\sigma_1 \wedge \sigma_2 \leq \sigma_{\varepsilon_t} \leq \sigma_1 \vee \sigma_2$ for any $t\geq 0$ a.s., and by noticing that that $\lim_{t\uparrow\infty} e^{-\rho t} X_t = 0$ a.s. To prove the latter limit we rely on a time-change. By \eqref{dyn:X} $X_t=x + M_t$ and observe that the quadratic variation of $M$, $\langle M \rangle_t:= \int_0^t \sigma^2(\varepsilon_u)du$, diverges as $t$ diverges to infinity because $\langle M \rangle_t \in [(\sigma^2(1) \wedge \sigma^2(2)) t, (\sigma^2(1) \vee \sigma^2(2))t]$ a.s.\ for any $t\geq 0$. Hence, by Proposition 3.4.6 in \cite{KS} we have that $M_t = B_{\langle M \rangle_t}$ a.s.\ for any $t\geq 0$, where $B$ denotes a standard one-dimensional $\mathcal{F}_{\langle M \rangle_t}$-Brownian motion. We can thus conclude that $\lim_{t\uparrow \infty} e^{-\rho t} X_t = \lim_{t\uparrow\infty}e^{-\rho t} B_{\langle M \rangle_t} =0$ a.s.\ by the law of iterated logarithm at infinity.
%
%Using \eqref{finite-0} in \eqref{functional} and recalling that $X_t=x + \int_0^t \sigma_{\varepsilon_s} dW_s$ by \eqref{dyn:X}, it follows that 
%\begin{eqnarray*}
%\label{finite-1}
%|\mathcal{J}_{x,y,i}(\nu)| & \hspace{-0.25cm} \leq \hspace{-0.25cm} & \mathbb{E}_{(x,i)}\bigg[\int_0^{\infty} \rho e^{-\rho t} \Big(|x| + c + \Big|\int_0^t \sigma_{\varepsilon_s} dW_s\Big|\Big) dt\bigg] + \frac{f(1)}{\rho} \nonumber \\
%& \hspace{-0.25cm} \leq \hspace{-0.25cm} & |x| + c + \int_0^{\infty} \rho e^{-\rho t} \mathbb{E}_{(x,i)}\bigg[\Big|\int_0^t \sigma_{\varepsilon_s} dW_s\Big|^2\bigg]^{1/2} dt + \frac{f(1)}{\rho} \nonumber \\
%& \hspace{-0.25cm} \leq \hspace{-0.25cm} & |x| + c + \big(\sigma^2(1) \vee \sigma^2(2)\big)^{\frac{1}{2}}\int_0^{\infty} \rho \sqrt{t} e^{-\rho t} dt + \frac{f(1)}{\rho} \leq C(1 +|x|), \nonumber
%\end{eqnarray*}
%for some $C>0$ independent of $(x,y,i)$ and $\nu$. The first step above uses that $0 \leq f(y) \leq f(1)$ for any $y\in [0,1]$ (cf.\ Assumption \ref{Asscost}), Tonelli's theorem and H\"{o}lder's inequality have been employed in the second step, whereas It\^o isometry justifies the third passage. Taking supremum over all $\nu \in \mathcal{A}_y$, we obtain the first claim.
%
%The second claim easily follows from convexity of $\mathcal{A}_y$ and concavity of linearity of $\mathcal{J}_{x,y,i}(\cdot)$. Finally, the third property is a straightforward consequence of the fact that if $Y^{\nu}_0=y=0$, then no control can be exerted.
%\end{proof}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{The Associated Family of Optimal Selling Problems}
\label{sec:OS}

In this section we will explicitly solve the parameter-dependent optimal stopping problem with regime switching \eqref{value-OS}. In the following $y$ will be given and fixed in $[0,1]$. It is immediate to see that \eqref{value-OS} can be rewritten as
\begin{equation}
\label{value-OS-1}
v(x,i;y)=u(x,i;y) - \frac{f'(y)}{\rho},
\end{equation}
where we have introduced 
\beq
\label{def-u}
u(x,i;y):=\sup_{\tau \geq 0}\mathbb{E}_{(x,i)}\Big[e^{-\rho \tau}(X_{\tau}-\hat{c}(y))\Big]
\eeq
with
\beq
\label{hat-c}
\hat{c}(y):=c - \frac{f'(y)}{\rho}.
\eeq

The results of this section are of interest on their own since problem \eqref{def-u} takes the form of an optimal selling problem in a Bachelier model with regime switching and with a transaction cost $\hat{c}$ that is parameter-dependent. Some preliminary properties of $u(\cdot;y)$ are stated in the next proposition. These will be important in the following when constructing the solution to \eqref{def-u}, hence of \eqref{value-OS}.
\begin{proposition}
\label{preliminary:OS}
For any $(x,i) \in \mathbb{R} \times \{1,2\}$ one has
\begin{enumerate}
	\item $u(x,i;y) \geq x-\hat{c}(y)$;
	\item $|u(x,i;y)| \leq K(1+ |x|)$ for some $K>0$.
%\item $x\mapsto v(x,i;y)$ is continuous for any $i=1,2$.
\end{enumerate}
\end{proposition}
\begin{proof}
The first claim immediately follows by taking the admissible $\tau=0$. 
As for the second property, let $\tau$ be an $\mathbb{F}$-stopping time and notice that by It\^o's formula we can write 
\beq
\label{boundOS-1}
e^{-\rho \tau}(X_{\tau}-\hat{c}(y)) = (x- \hat{c}(y)) - \int_0^{\tau} \rho e^{-\rho s} \Big(X_s-\hat{c}(y)\Big) ds + \int_0^{\tau} e^{-\rho s} \sigma_{\varepsilon_s}dW_s.
\eeq
Denoting $M_t:=\int_0^{t} e^{-\rho s} \sigma_{\varepsilon_s}dW_s$, $t\geq 0$, and recalling boundedness of $\sigma_{\varepsilon_{\cdot}}$, $M$ is uniformly bounded in $L^2(\Omega,\mathbb{P}_{(x,i)})$ and therefore $\mathbb{P}_{(x,i)}$-uniformly integrable. Therefore we can take expectations in \eqref{boundOS-1}, apply optional stopping Theorem 3.2 in \cite{RevuzYor} and obtain
\beq
\label{boundOS-1-bis}
\mathbb{E}_{(x,i)}\Big[e^{-\rho \tau}(X_{\tau}-\hat{c}(y))\Big] = (x- \hat{c}(y)) - \mathbb{E}_{(x,i)}\bigg[\int_0^{\tau} \rho e^{-\rho s} \Big(X_s-\hat{c}(y)\Big) ds\bigg].
\eeq
Recalling \eqref{dyn:X} it then follows from \eqref{boundOS-1-bis}
\begin{align}
\label{boundOS-2}
& \Big|\mathbb{E}_{(x,i)}\Big[e^{-\rho \tau}(X_{\tau}-\hat{c}(y))\Big]\Big| \leq |x| + |\hat{c}(y)| + \mathbb{E}_{(x,i)}\bigg[\int_0^{\infty} \rho e^{-\rho s} \big|X_s-\hat{c}(y)\big| ds\bigg] \nonumber \\
& \leq 2(|x| + |\hat{c}(y)|) + \int_0^{\infty} \rho e^{-\rho s}\mathbb{E}_{(x,i)}\bigg[\Big|\int_0^s \sigma_{\varepsilon_u}dW_u\Big|^2\bigg]^{\frac{1}{2}} ds \\
& \leq 2(|x| + |\hat{c}(y)|) + (\sigma_1^2 \vee \sigma_2^2)^{\frac{1}{2}}\int_0^{\infty} \rho \sqrt{s} e^{-\rho s} ds \nonumber \leq K(1 + |x|), 
\nonumber
\end{align}
for some $K>0$. Tonelli's Theorem and H\"older's inequality imply the second step above, the third step is guaranteed by It\^o's isometry, whereas the last one employs monotonicity and convexity of $f(\cdot)$ to have $|\hat{c}(y)| \leq c + f'(1)/\rho$. The second claim of the proposition then easily follows from \eqref{boundOS-2}.
\end{proof}

In line with the standard theory of optimal stopping (see, e.g., \cite{PeskShir}) we expect $u$ to suitably satisfy the variational inequality (cf.\ \eqref{HJB-OS})
\beq
\label{HJB-OS-u}
\max\Big\{\big(\mathcal{G} - \rho\big) w(x,i;y), x-\hat{c}(y) - w(x,i;y)\Big\} =0,
\eeq
for $(x,i) \in \mathbb{R} \times \{1,2\}$ and any given $y\in [0,1]$, and we define the continuation and stopping region of \eqref{def-u} as
\begin{equation*}
\label{cont-stop}
\mathcal{C}:=\Big\{(x,i) \in \mathbb{R} \times \{1,2\}: u(x,i;y) > x-\hat{c}(y)\Big\}, \quad \mathcal{S}:=\Big\{(x,i) \in \mathbb{R} \times \{1,2\}: u(x,i;y) = x-\hat{c}(y)\Big\},
\end{equation*}
respectively. Given the structure of optimal stopping problem \eqref{def-u} we also expect that 
\begin{equation}
\label{cont-b}
\mathcal{C}:=\Big\{(x,1): x < x^*_1(y)\Big\} \cup \Big\{(x,2): x < x^*_2(y)\Big\},
\end{equation}
for some thresholds, $x^*_i(y)$, $i=1,2$, such that $x^*_i(y) \geq \hat{c}(y)$, $i=1,2$, and depending parametrically on $y\in [0,1]$.
%\begin{equation}
%\label{stopping-b}
%\mathcal{S}:=\Big\{(x,i) \in \mathbb{R} \times \{1,2\}: x \geq x^*(i;y)\Big\},
%\end{equation}
According to this conjecture three configurations are possible: (A) $x^*_1(y) < x^*_2(y)$, (B) $x^*_1(y) = x^*_2(y)$, and (C) $x^*_1(y) > x^*_2(y)$. We now explicitly solve \eqref{HJB-OS-u} in cases (A) and (B). Case (C) is completely symmetric to case (A) and can be treated with similar arguments. We therefore omit its discussion in this paper in the interest of length. In a second step, by a verification argument, we will show that the solution $w$ to \eqref{HJB-OS-u} satisfies $w\equiv u$. As a byproduct we will also provide the optimal stopping rule $\tau^*$. 

\subsection{Case (A):\, $x^*_1(y) < x^*_2(y)$}

We rewrite \eqref{HJB-OS-u} in the form of a free boundary problem to find $(w(x,1;y),w(x,2;y), x^*_1(y), x^*_2(y))$, with $w\in C^1(\RR)$ and $w_{xx}\in L^{\infty}_{loc}(\RR)$ for any $i=1,2$, solving
\begin{align}
\label{FBP-1}
\left\{
\begin{array}{ll}
\tfrac{1}{2}\sigma_i^2 w_{xx}(x,i;y)-\rho w(x,i;y) + \lambda_i(w(x,3-i;y)-w(x,i;y)) =0 & \text{for $x<x^*_1(y)$ and $i=1,2$}\\[+4pt]
%\tfrac{1}{2}\sigma^2(2) w_{xx}(x,2;y)-\rho w(x,2;y) + \lambda_2(w(x,1;y)-w(x,2;y)) =0 & \text{for $x<x^*_1(y)$}\\[+4pt]
\tfrac{1}{2}\sigma_2^2 w_{xx}(x,2;y)-\rho w(x,2;y) + \lambda_2(w(x,1;y)-w(x,2;y)) =0 & \text{for $x^*_1(y)<x<x^*_2(y)$}\\[+4pt]
w(x,1;y) = x-\hat{c}(y) & \text{for $x^*_1(y)\leq x \leq x^*_2(y)$}\\[+4pt]
w(x,1;y) = x-\hat{c}(y) = w(x,2;y) & \text{for $x \geq x^*_2(y)$}\\[+4pt]
w_x(x,1;y) = 1 & \text{for $x = x^*_1(y)$}\\[+4pt]
w(x-,2;y) = w(x+,2;y) & \text{for $x = x^*_1(y)$}\\[+4pt]
w_x(x-,2;y) = w_x(x+,2;y) & \text{for $x = x^*_1(y)$}\\[+4pt]
w_x(x,2;y) = 1 & \text{for $x = x^*_2(y)$}\\[+4pt]
\tfrac{1}{2}\sigma_i^2 w_{xx}(x,i;y)-\rho w(x,i;y) + \lambda_i(w(x,3-i;y)-w(x,i;y)) \leq 0 & \text{for a.e.\ $x \in \mathbb{R}$ and $i=1,2$}\\[+4pt]
w(x,i;y) \geq x -\hat{c}(y), & \text{for $x \in \mathbb{R}$ and $i=1,2$}\\[+4pt]
\end{array}
\right.
\end{align}
where $w(\cdot\, \pm,i;y):=\lim_{h \downarrow 0}w(\cdot \pm h,i;y)$ and $w_x(\cdot\, \pm,i;y):=\lim_{h \downarrow 0}w_x(\cdot \pm h,i;y)$.

\medskip

Recalling that $\sigma_i>0$ and $\lambda_i>0$, $i=1,2$, let $\alpha_1 < \alpha_2 < 0 < \alpha_3 < \alpha_4$ be the roots of the fourth-order equation $\Phi_1(\alpha)\Phi_2(\alpha) - \lambda_1\lambda_2=0$, with $\Phi_i(\alpha):=-\frac{1}{2}\sigma_i^2\alpha^2+\rho+\lambda_i$, $i=1,2$ (see \cite{Guo01}, Remark 2.1, and \cite{CadSot}, Lemma 3.1). Then the general solution to the first equation of \eqref{FBP-1} is given by
\begin{align}
\label{eq:jointcont}
\left\{
\begin{array}{ll}
w(x,1;y)=A_1(y)e^{\alpha_1 x}+A_2(y)e^{\alpha_2 x}+A_3(y)e^{\alpha_3 x}+A_4(y)e^{\alpha_4 x}\\[+4pt]
w(x,2;y)=B_1(y)e^{\alpha_1 x}+B_2(y)e^{\alpha_2 x}+B_3(y)e^{\alpha_3 x}+B_4(y)e^{\alpha_4 x},
\end{array}
\right.
\end{align}
for any $x<x^*_1(y)$, $x^*_1(y)$ to be found, and where $B_j(y) :=\frac{\Phi_1(\alpha_j)}{\lambda_1}A_j(y) = \frac{\lambda_2}{\Phi_2(\alpha_j)}A_j(y)$, $j=1,2,3,4$, with $A_j(y)$ to be determined. Since the value function \eqref{def-u} diverges at most linearly (cf.\ Proposition \ref{preliminary:OS}) we set $A_1(y)=0=A_2(y)$ so that also $B_1(y)=0=B_2(y)$.
\smallskip

On the other hand, the general solution to the second and the third of \eqref{FBP-1} is given on $(x^*_1(y),x^*_2(y))$ by
\begin{align}
\label{eq:cont-stop}
\left\{
\begin{array}{ll}
w(x,1;y)=x-\hat{c}(y)\\[+4pt]
w(x,2;y)=B_5(y) e^{\alpha_5 x} + B_6(y) e^{-\alpha_5 x}+\lambda_2\left(\frac{x-\hat{c}(y)}{\rho+\lambda_2}\right),
\end{array}
\right.
\end{align}
with $\alpha_5=\sqrt{\frac{2(\rho+\lambda_2)}{\sigma_2^2}}$ and for some $B_5(y)$ and $B_6(y)$ to be found.
\smallskip

Finally, for any $x\geq x^*_2(y)$ we have (cf.\ the fourth of \eqref{FBP-1})
\begin{equation}
\label{eq:stopstop}
w(x,1;y) = x - \hat{c}(y) = w(x,2;y).
\end{equation}

It remains now to find the constants $A_3(y), A_4(y), B_5(y), B_6(y)$ and the two threshold values $x^*_1(y), x^*_2(y)$. To do so we impose that $w(\cdot,1;y)$ is continuous with continuous first-order derivative at $x=x^*_1(y)$ and that $w(\cdot,2;y)$ is continuous with continuous first-order derivative at $x=x^*_1(y)$ and $x=x^*_2(y)$. Then we find from \eqref{eq:jointcont}--\eqref{eq:stopstop} the nonlinear system
\begin{align}
\label{system}
\left\{
\begin{array}{ll}
A_3(y) e^{\alpha_3 x^{*}_1(y)}+A_4(y)e^{\alpha_4 x^*_1(y)}=x^*_1(y)-\hat{c}(y)\\[+5pt]
\alpha_3 A_3(y) e^{\alpha_3 x^{*}_1(y)}+\alpha_4 A_4(y) e^{\alpha_4 x^*_1(y)}=1 \\[+5pt]
 B_3(y)e^{\alpha_3 x^*_1(y)}+B_4(y)e^{\alpha_4 x^*_1(y)} = B_5(y)e^{\alpha_5 x^*_1(y)}+B_6(y)e^{-\alpha_5 x^*_1(y)}+\lambda_2\left(\frac{x^*_1(y)-\hat{c}(y)}{\rho+\lambda_2}\right) \\[+5pt]
\alpha_3 B_3(y)e^{\alpha_3 x^*_1(y)}+\alpha_4 B_4(y)e^{\alpha_4 x^*_1(y)} = \alpha_5 B_5(y) e^{\alpha_5 x^*_1(y)}-\alpha_5 B_6(y) e^{-\alpha_5 x^*_1(y)}+\frac{\lambda_2}{\rho+\lambda_2}\\ [+4pt] B_5(y) e^{\alpha_5 x^*_2(y)}+B_6(y) e^{-\alpha_5 x^*_2(y)}+\lambda_2\left(\frac{x^*_2(y)-\hat{c}(y)}{\rho+\lambda_2}\right)=x^*_2(y)-\hat{c}(y) \\[+5pt]
\alpha_5 B_5(y)e^{\alpha_5 x^*_2(y)}-\alpha_5 B_6(y) e^{-\alpha_5 x^*_2(y)}+\frac{\lambda_2}{\rho+\lambda_2}=1.
\end{array}
\right.
\end{align}

Solving the first two equations of \eqref{system} with respect to $A_3(y)$ and $A_4(y)$ we obtain after some simple algebra
\begin{equation}
\label{A3-A4}
A_3(y) = \Big[\frac{\alpha_4(x^*_1(y)-\hat{c}(y))-1}{\alpha_4-\alpha_3}\Big]e^{-\alpha_3 x^*_1(y)}, \quad A_4(y) = \Big[\frac{1-\alpha_3(x^*_1(y)-\hat{c}(y))}{\alpha_4-\alpha_3}\Big]e^{-\alpha_4 x^*_1(y)}.
\end{equation}
Analogously, the solution to the fifth and the sixth equations of \eqref{system} is given in terms of the unknown $x^*_2(y)$ as
\begin{align}
\label{B5-B6}
\left\{
\begin{array}{ll}
\displaystyle B_5(y)=\frac{\rho}{\rho+\lambda_2}\left[\frac{e^{-\alpha_5 x^*_2(y)}(1+\alpha_5(x^*_2(y)-\hat{c}(y)))}{2\alpha_5}\right]\\[+4pt]
\\ [+4pt]
\displaystyle B_6(y)=\frac{\rho}{\rho+\lambda_2}\left[\frac{e^{\alpha_5 x^*_2(y)}(\alpha_5(x^*_2(y)-\hat{c}(y))-1)}{2\alpha_5}\right].
\end{array}
\right.
\end{align}
Finally, plugging \eqref{A3-A4} and \eqref{B5-B6} into the third and the fourth equations of \eqref{system}, recalling that $B_3(y)=\frac{\Phi_1(\alpha_3)}{\lambda_1}A_3(y)$ and $B_4(y)=\frac{\Phi_1(\alpha_4)}{\lambda_1}A_4(y)$, we find after some algebra that $(x^*_1(y),x^*_2(y))$ should satisfy
\beq
\label{system-boundaries}
F_1(x^*_1(y),x^*_2(y);y)=0 \qquad \mbox{and} \qquad F_2(x^*_1(y),x^*_2(y);y)=0,
\eeq
where we have set
\begin{align}
\label{F1F2}
\left\{
\begin{array}{ll}
F_1(u,v;y):=\frac{\rho}{\rho+\lambda_2}\Big[(v-\hat{c}(y))\cosh\Big(\alpha_5(v-u)\Big)-\frac{1}{\alpha_5}\sinh\Big(\alpha_5(v-u)\Big)\Big]+a_1(u-\hat{c}(y))+a_2\\[+6pt]
\\ [+2pt]
F_2(u,v;y):=\frac{\rho}{\rho+\lambda_2}\Big[\cosh\Big(\alpha_5(v-u)\Big)-{\alpha_5}(v-\hat{c}(y))\sinh\Big(\alpha_5(v-u)\Big)\Big]+a_3(u-\hat{c}(y))+a_4,
\end{array}
\right.
\end{align}
with $a_i:=a_i(\rho, \lambda_1,\lambda_2,\sigma_1, \sigma_2)$, $i=1,2,3,4$, given by
\begin{align}
\label{a1-a4}
\left\{
\begin{array}{ll}
\displaystyle a_1:=-\frac{\alpha_4\Phi_1(\alpha_3)-\alpha_3\Phi_1(\alpha_4)}{\lambda_1(\alpha_4-\alpha_3)}+\frac{\rho}{\rho+\lambda_2}, & \quad \displaystyle a_2:=\frac{\Phi_1(\alpha_3)-\Phi_1(\alpha_4)}{\lambda_1(\alpha_4-\alpha_3)},\\[+5pt]
\displaystyle a_3:=\frac{\alpha_3\alpha_4}{\lambda_1(\alpha_4-\alpha_3)}[\Phi_1(\alpha_4)-\Phi_1(\alpha_3)],& \quad
\displaystyle a_4:=\frac{\alpha_3\Phi_1(\alpha_3)-\alpha_4\Phi_1(\alpha_4)}{\lambda_1(\alpha_4-\alpha_3)} +\frac{\lambda_2}{\rho+\lambda_2}.
\end{array}
\right.
\end{align}
Notice that $a_1 <0$, $a_2>0$, $a_3 <0$ and $a_4>0$ by Lemma \ref{lemm:valuesai} in Appendix \ref{app}. 

Since we are looking for $x^*_i(y)$, $i=1,2$, such that $x^*_2(y) > x^*_1(y) \geq \hat{c}(y)$, it is natural to check if \eqref{system-boundaries} admits a solution in $(\hat{c}(y), \infty) \times (\hat{c}(y), \infty)$.
So far we do not know about existence, and in case uniqueness, of such a solution.
To investigate this fact we define $z^*_1(y):=x_1^*(y)-\hat{c}(y)$ and $z^*_2(y):=x_2^*(y)-x_1^*(y)$, so that $x_2^*(y)-\hat{c}(y)= z^*_1(y) + z^*_2(y)$, and we notice that with such definition the explicit dependence with respect to $y$ in \eqref{system-boundaries} disappears. We can thus drop the $y$-dependence in $z^*_i(y)$, $i=1,2$, and set $(z^*_1,z^*_2)$ as the solution, if it does exist, of the equivalent system
\beq
\label{system-boundaries-2}
G_1(u,v)=0 \qquad \mbox{and} \qquad G_2(u,v)=0,
\eeq
with
\begin{align}
\label{G1G2}
\left\{
\begin{array}{ll}
G_1(u,v):=(a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v))u-\frac{\rho}{\alpha_5(\rho+\lambda_2)}[\sinh(\alpha_5 v)-v\cosh(\alpha_5 v)]+a_2\\[+4pt]
\\ [+2pt]
G_2(u,v):=(a_3-\frac{\rho\alpha_5}{(\rho+\lambda_2)}\sinh(\alpha_5v))u - \frac{\rho}{(\rho+\lambda_2)}[v\alpha_5\sinh(\alpha_5v)-\cosh(\alpha_5v)]+a_4,
\end{array}
\right.
\end{align}
for $u,v\geq 0$.

The following requirements on the parameters of our model suffice to determine a unique solution to \eqref{system-boundaries-2}.

\begin{Assumptions}
\label{assm-1}
\begin{enumerate}\hspace{10cm}
\item $\alpha_5 \leq 1$;
\item $a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)} < 0$;
\item $a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(1) \geq 0$;
\item $\frac{1}{a_3}\Big(\frac{\rho}{\rho+\lambda_2}+a_4\Big)-\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}}<0$.
\end{enumerate}
\end{Assumptions}

\begin{remark}
\label{rem:parameters}
Noticing that $a_i$, $i=1,2,3,4$ (cf.\ \eqref{a1-a4}) and $\alpha_i$, $i=3,4,5$, are functions of $\rho$, $\lambda_1$, $\lambda_2$, $\sigma_1$ and $\sigma_2$, Assumption \ref{assm-1} should be read as a requirement on these parameters. Expressing the conditions in Assumption \ref{assm-1} as explicit analytical relations between the parameters of the problem is an hard task. However, it is a simple numerical exercise to find ranges of parameters' values satisfying 1.--4.\ above. As an example, picking model parameters in either of the following ranges, Assumption \ref{assm-1} holds true.
\begin{longtable}{|c|c|c|c|c|}
\hline
\endfirsthead
\endfoot
\endhead
\hline
\endlastfoot
$\rho$ & $\sigma_1$ &  $\sigma_2$ &  $\lambda_1$ &  $\lambda_2$ \\
\hline 
\rule[-4mm]{0mm}{1cm}
$[0.030,  0.033]$ &   $[0.023, 0.026]$ &  $[0.76, 0.80]$ &  $[0.015, 0.017]$ &  $[0.014, 0.016]$ \\
\hline 
\rule[-4mm]{0mm}{1cm}
$[0.025, 0.027]$ &  $[0.038, 0.040]$ &  $[0.63, 0.66]$ &  $[0.40, 0.47]$ &  $[0.042, 0.044]$ \\
\hline 
\rule[-4mm]{0mm}{1cm}
$[0.32, 0.35]$ &  $[0.18, 0.38]$ & $[1.6, 1.9]$ & $[1.5, 1.7]$ & $[0.42, 0.44]$\\
\end{longtable}

In the next plot we visualize in grey all the values of $(\sigma_1,\sigma_2)$ that verify Assumption \ref{assm-1} when we take, e.g., $\rho= 0.03$, $\lambda_1= 0.017$ and $\lambda_2=0.016$.
\begin{figure}[!ht]
\centering
\includegraphics[scale=0.7]{sigma.pdf}
\caption{\small For $\rho= 0.03$, $\lambda_1= 0.017$, $\lambda_2=0.016$, any $(\sigma_1,\sigma_2)$ taken in the grey region satisfies Assumption \ref{assm-1}.}
\label{fig:sigma}
\end{figure}
\end{remark}

\newpage

\begin{proposition}
\label{prop:existence}
Let Assumption \ref{assm-1} hold and let $\hat{z}_2$ be the unique positive solution to the equation
$$a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v) =0, \quad v \geq 0,$$
with $a_1$ as in \eqref{a1-a4} and $\alpha_5=\sqrt{\frac{2(\rho+\lambda_2)}{\sigma_2^2}}$.
Then there exists a unique couple $(z^*_1,z^*_2)$ solving \eqref{system-boundaries-2} in $(0,\infty) \times (0, \hat{z}_2)$. Moreover $z^*_1$ is such that 
$$-\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}} < z^*_1 < -\frac{\frac{\rho}{\rho+\lambda_2}+a_4}{a_3}.$$
\end{proposition}

\begin{proof}

The proof is organised in three steps. In each step we point out the conditions needed on the parameters so to help the reader understanding the role played by the requirements of Assumption \ref{assm-1}.
\medskip

\emph{Step 1.} It is matter of direct calculations to show that if $\alpha_5 \leq 1$ then the function $f(v):=\frac{\rho}{\alpha_5(\rho+\lambda_2)}[\sinh(\alpha_5 v)-v\cosh(\alpha_5 v)] - a_2$, $v\geq 0$, is strictly decreasing and therefore strictly negative for any $v\geq 0$ since $f(0) = - a_2 < 0$. On the other hand, because $v \mapsto a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v)$ is a strictly increasing function, it follows that under the condition $\alpha_5 \leq 1$ the equation $G(\cdot,v)=0$, $v\geq 0$, cannot have a positive solution if $a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)} \geq 0$.
\medskip

\emph{Step 2.} Assume then $\alpha_5 \leq 1$ and $a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)} < 0$. We start proving that the equation $h(v)=0$ with $h(v):=a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v)$, $v \geq 0$, has a unique solution $\hat{z}_2 > 0$. For this it suffices to notice that $h(0)=a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)} <0$, and $v\mapsto h(v)$ is strictly increasing with $\lim_{v\rightarrow \infty}h(v) = +\infty$.
For any $v \in [0,\hat{z}_2)$ we can thus rewrite \eqref{system-boundaries-2} in the equivalent form 
$$u = M_1(v), \qquad M_1(v) - M_2(v) =0,$$
with
\begin{align}
\label{eq:M1M2}
\left\{
\begin{array}{ll}
\displaystyle M_1(v):=\frac{\frac{\rho}{\alpha_5(\rho+\lambda_2)}[\sinh(\alpha_5v)-v\cosh(\alpha_5 v)]-a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v)}\\[+4pt]
\\ [+2pt]
\displaystyle M_2(v):=\frac{\frac{\rho}{\rho+\lambda_2}[v\alpha_5\sinh(\alpha_5v)-\cosh(\alpha_5v)]-a_4}{a_3-\frac{\rho\alpha_5}{(\rho+\lambda_2)}\sinh(\alpha_5v)},
\end{array}
\right.
\end{align}
and where we have used the fact that $a_3-\frac{\rho\alpha_5}{(\rho+\lambda_2)}\sinh(\alpha_5v) \neq 0$ on $[0,\infty)$ being $a_3<0$ (see again Lemma \ref{lemm:valuesai} in Appendix \ref{app}).

The numerator of $M_1$ in \eqref{eq:M1M2} is strictly negative on $v\geq 0$ by \emph{Step 1}. Using this fact, and noticing that $a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}\cosh(\alpha_5 v) <0$ on $[0, \hat{z}_2)$, by direct calculations one can observe that $v \mapsto M_1(v)$ strictly increases to $+\infty$ in $[0, \hat{z}_2)$. On the other hand we claim (and prove later) that under the third of Assumption \ref{assm-1} $v\mapsto M_2(v)$ strictly decreases in $[0,\hat{z}_2]$. Because $M_1(0)-M_2(0)=\frac{1}{a_3}\Big(\frac{\rho}{\rho+\lambda_2}+a_4\Big)-\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}} < 0$ by the fourth of Assumption \ref{assm-1}, and $v\mapsto M_1(v)-M_2(v)$ strictly increases on $[0,\hat{z}_2)$ and diverges to $+\infty$ as $z$ approaches $\hat{z}_2$, it follows that there exists a unique $z^*_2 \in (0, \hat{z}_2)$ solving $M_1(v) - M_2(v) =0$. Hence $z^*_1 = M_1(z^*_2)$ or, equivalently, $z^*_1=M_2(z^*_2)$. $z^*_1$ is strictly positive as $M_1(v) \geq M_1(0) > 0$ on $[0, \hat{z}_2)$. Moreover, since $M_1(\cdot)$ is strictly increasing and $M_2(\cdot)$ is strictly decreasing on $[0,\hat{z}_2)$ and $z_2^* < \hat{z}_2$, one has $M_1(0) < z^*_1 < M_2(0)$, i.e.
\begin{equation}
\label{w1convex-2-a}
0< -\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}} < z^*_1 < -\frac{\frac{\rho}{\rho+\lambda_2}+a_4}{a_3}.
\end{equation}
\medskip

\emph{Step 3.} To complete the proof we need to show that under Assumption \ref{assm-1}, $v\mapsto M_2(v)$ is strictly decreasing in $[0,\hat{z}_2]$.
By direct calculations one can see that the latter monotonicity property holds if
\beq
\label{def:r}
r(v):=\frac{\rho}{(\rho+\lambda_2)}\big{[}v\alpha_5\sinh(\alpha_5v)-\cosh(\alpha_5v)\big{]}-a_4<0, \qquad \text{on}\,\,[0,\hat{z}_2].
\eeq
Using the definition of $\hat{z}_2$ and the third of Assumption \ref{assm-1} one has
$$\cosh(\alpha_5 \hat{z}_2) = -a_1\Big[\frac{\alpha_5(\rho + \lambda_2)}{\rho}\Big] \leq \cosh(1),$$
which in turn implies $\alpha_5 \hat{z}_2 \leq 1$, and therefore
\beq
\label{rhatz2}
r(\hat{z}_2)=\frac{\rho}{(\rho+\lambda_2)}\Big[\hat{z}_2 \alpha_5 \sinh(\alpha_5\hat{z}_2) - \cosh(\alpha_5 \hat{z}_2)\Big]-a_4 <0,
\eeq
since $a_4>0$ and $\sinh(v) \leq \cosh(v)$. Equation \eqref{rhatz2}, together with $r(0)= - \frac{\rho}{(\rho+\lambda_2)} - a_4 <0$ and $r'(v)=\frac{\rho}{(\rho+\lambda_2)} v\alpha_5^2\cosh(\alpha_5 v) > 0$, imply \eqref{def:r} and thus completes the proof.
\end{proof}

\begin{remark}
Notice that if $\alpha_5 >1$, the function $f(\cdot)$ defined in Step 1 of the proof above does not have a definite sign. The subsequent analysis becomes then much more complex and very difficult to be analytically tackled, if possible at all. The complexity of the smooth-fit equations arising in optimal stopping problems with regime switching is the main reason behind the common approach (see, e.g., \cite{GuoZhang} and \cite{ZhangZhu}) consisting of assuming existence of their solution.
\end{remark}

The proof of the next corollary can be found in Appendix \ref{someproofs}.
\begin{corollary}
\label{cor:boundary-system}
Under Assumption \ref{assm-1} there exists a unique solution $(x_1^*(y), x_2^*(y)) \in (\hat{c}(y), + \infty) \times (\hat{c}(y), + \infty)$ with $x_2^*(y) > x_1^*(y)$ solving \eqref{system-boundaries}. Moreover, the mappings $y \mapsto x_i^*(y)$ are continuously strictly decreasing on $[0,1]$.
\end{corollary}

In the following assumption we slightly strenghten the requirement on $\alpha_5$. This condition will be employed in the proof of Theorem \ref{candidate-w} below.
\begin{Assumptions}
\label{assm-2}
$\displaystyle \alpha_5 \leq \frac{\lambda_2 \wedge \rho}{\lambda_2}.$
\end{Assumptions}

%%%
%We require
%\begin{enumerate}
%\item $\displaystyle  - \frac{1}{a_3}\Big(\frac{\rho}{\rho+\lambda_2}+ a_4\Big) - \frac{1}{\alpha_3} \leq \frac{1}{\alpha_4} \leq -\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}};$
%\item $\displaystyle \frac{\sigma_1^2(\alpha_3+\alpha_4)}{\sigma_1^2\alpha_3\alpha_4+2\rho}
%\leq -\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}};$
%\item $\displaystyle -\frac{\frac{\rho}{\rho+\lambda_2}+a_4}{a_3}
%\leq \frac{2\lambda_1}{\alpha_3\alpha_4\sigma_1^2(\alpha_4+\alpha_3)}\Big[1+\frac{\alpha_3\Phi_1(\alpha_3)-\alpha_4\Phi_1(\alpha_4)}{\lambda_1(\alpha_4 -\alpha_3)}\Big].$
%\end{enumerate}
%%%%%

Theorem \ref{candidate-w} below proves that under our assumptions $(w(x,1;y), w(x,2;y),x^*_1(y), x^*_2(y))$ solves free boundary problem \eqref{FBP-1}. Its proof is quite long and technical, and for this reason it is postoponed to Appendix \ref{someproofs}.

\begin{theorem}
\label{candidate-w}
\textbf{[The Candidate Value Function]} Let Assumption \ref{assm-1} hold and let $(x_1^*(y), x_2^*(y))$ with $x_2^*(y) > x_1^*(y)$ be the unique solution to \eqref{system-boundaries} in $(\hat{c}(y), + \infty) \times (\hat{c}(y), + \infty)$. Define $A_3(y)$ and $A_4(y)$ as in \eqref{A3-A4}, $B_3(y):=\frac{\Phi_1(\alpha_3)}{\lambda_1}A_3(y)$ and $B_4(y):=\frac{\Phi_1(\alpha_4)}{\lambda_1}A_4(y)$, and $B_5(y)$ and $B_6(y)$ as in \eqref{B5-B6}. Then the functions
\begin{align}
\label{eq:candidatevalue1}
w(x,1;y):=
\left\{
\begin{array}{ll}
A_3(y)e^{\alpha_3 x}+A_4(y)e^{\alpha_4 x}, & \quad x \leq x^*_1(y)\\[+5pt]
x - \hat{c}(y), & \quad x \geq x^*_1(y),
\end{array}
\right.
\end{align}
and 
\begin{align}
\label{eq:candidatevalue2}
w(x,2;y):=
\left\{
\begin{array}{ll}
B_3(y)e^{\alpha_3 x}+B_4(y)e^{\alpha_4 x}, & \quad x \leq x^*_1(y)\\[+5pt]
B_5(y) e^{\alpha_5 x} + B_6(y) e^{-\alpha_5 x}+\lambda_2\left(\frac{x-\hat{c}(y)}{\rho+\lambda_2}\right), & \quad x^*_1(y) \leq x \leq x^*_2(y)\\[+5pt]
x - \hat{c}(y), & \quad x \geq x^*_2(y),
\end{array}
\right.
\end{align}
belong to $C^1(\mathbb{R})$ with $w_{xx}(x,i;y) \in L^{\infty}_{loc}(\mathbb{R})$, and are such that $|w(x,i;y)|\leq \kappa_i(1 + |x|)$ for some $\kappa_i > 0$.

If also Assumption \ref{assm-2} holds true then $(w(x,1;y), w(x,2;y),x^*_1(y), x^*_2(y))$ solves free boundary problem \eqref{FBP-1}.
\end{theorem}

We now verify the actual optimality of the candidate value function constructed in the previous section. The proof of this result is quite standard and it is contained in Appendix \ref{someproofs} for the sake of completeness.

\begin{theorem}
\label{thm:verifying}
\textbf{[The Verification Theorem]} Let Assumption \ref{assm-1} and \ref{assm-2} hold and let $\mathcal{C}=\{(x,1): x < x_1^*(y)\} \cup \{(x,2): x < x_2^*(y)\}$. Then, for $w$ as in Theorem \ref{candidate-w} and for $u$ as in \eqref{def-u}, one has $w \equiv u$ on $\mathbb{R}\times \{1,2\}$ and
\beq
\label{tau-optimal}
\tau^*:=\inf\{t\geq 0 : (X_{t},\varepsilon_{t})\not \in \mathcal{C}\},\quad \mathbb{P}_{(x,i)}-a.s.,
\eeq
is an optimal stopping time.
\end{theorem}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{Case (B):\, $x^*_1(y)= x^*_2(y)$}
\label{caseB}

In this section we study the case in which the two boundaries $x^*_1(y)$ and $x^*_2(y)$ coincide and equal some $x^*(y)$ to be found. 

We rewrite \eqref{HJB-OS-u} in the form of a free boundary problem to find $(w(x,1;y),w(x,2;y), x^*(y))$, with $w\in C^1(\RR)$ and $w_{xx}\in L^{\infty}_{loc}(\RR)$ for any $i=1,2$, solving
\begin{align}
\label{FBP-equal}
\left\{
\begin{array}{ll}
\tfrac{1}{2}\sigma_i^2 w_{xx}(x,i;y)-\rho w(x,i;y) + \lambda_i(w(x,3-i;y)-w(x,i;y)) =0 & \text{for $x<x^*(y)$}\\[+4pt]
%\tfrac{1}{2}\sigma^2(2) w_{xx}(x,2;y)-\rho w(x,2;y) + \lambda_2(w(x,1;y)-w(x,2;y)) =0 & \text{for $x<x^*(1;y)$}\\[+4pt]
%\tfrac{1}{2}\sigma^2(2) w_{xx}(x,2;y)-\rho w(x,2;y) + \lambda_2(w(x,1;y)-w(x,2;y)) =0 & \text{for $x^*(1;y)<x<x^*(2;y)$}\\[+4pt]
w(x,i;y) = x-\hat{c}(y) & \text{for $x \geq x^*(y)$}\\[+4pt]
%w(x,1;y) = x-\hat{c}(y) = w(x,2;y) & \text{for $x \geq x^*(2;y)$}\\[+4pt]
w_x(x,i;y) = 1 & \text{for $x = x^*(y)$}\\[+4pt]
%w(x-,2;y) = w(x+,2;y) & \text{for $x = x^*(1;y)$}\\[+4pt]
%w_x(x-,2;y) = w_x(x+,2;y) & \text{for $x = x^*(1;y)$}\\[+4pt]
%w_x(x,2;y) = 1 & \text{for $x \geq x^*(2;y)$}\\[+4pt]
\tfrac{1}{2}\sigma_i^2 w_{xx}(x,i;y)-\rho w(x,i;y) + \lambda_i(w(x,3-i;y)-w(x,i;y)) \leq 0 & \text{for a.e.\ $x \in \mathbb{R}$ and $i=1,2$}\\[+4pt]
w(x,i;y) \geq x -\hat{c}(y), & \text{for $x \in \mathbb{R}$ and $i=1,2$}.\\[+4pt]
\end{array}
\right.
\end{align}

Let $\beta_{1,2}:=\frac{-b_o \pm \sqrt{b_o^2-4a_oc_o }}{2a_o}$ be the solutions of $a_o\zeta^2 + b_o\zeta + c_o=0$, where we have defined $a_o:=\frac{1}{4}\sigma_1^2\sigma_2^2$, $b_o:=-\frac{1}{2}\sigma_1^2(\rho+\lambda_2)-\frac{1}{2}\sigma_2^2(\rho+\lambda_1)$ and $c_o:=(\rho+\lambda_1)(\rho+\lambda_2)-\lambda_1\lambda_2$. Notice that $\beta_1>0$ and $\beta_2>0$ since $\beta_1 + \beta_2 = -b_o/a_o>0$ and $\beta_1\beta_2=c_o/a_o>0$ (cf.\ Vieta's formulas). Therefore we can introduce
$\alpha_1 < \alpha_2 <0 <\alpha_3 < \alpha_4$ as
$$-\alpha_1=\alpha_4=\sqrt{\beta_1}, \qquad -\alpha_2=\alpha_3=\sqrt{\beta_2}.$$
The general solution of the first equation of \eqref{FBP-equal} is given for any $x<x^*(y)$ by
\begin{equation}
\label{valuecontin}
\left\{
\begin{array}{ll}
w(x,1;y)=\widetilde{A}_1(y)e^{\alpha_1x}+\widetilde{A}_2(y)e^{\alpha_2x}+\widetilde{A}_3(y)e^{\alpha_3x}+\widetilde{A}_4(y)e^{\alpha_4x}\\[+4pt]
w(x,2;y)=\widetilde{B}_1(y)e^{\alpha_1x}+\widetilde{B}_2(y)e^{\alpha_2x}+\widetilde{B}_3(y)e^{\alpha_3x}+\widetilde{B}_4(y)e^{\alpha_4x},\\
\end{array}
\right.
\end{equation}
with
\beq
\label{Bjs}
\widetilde{B}_j(y)=\frac{\Phi_1(\alpha_j)}{\lambda_1}\widetilde{A}_j(y)=\frac{\lambda_2}{\Phi_2(\alpha_j)}\widetilde{A}_j(y),\quad j=1,2,3,4,
\eeq
and where
\beq
\label{def:Phiequal}
\Phi_i(\alpha)=-\frac{1}{2}\sigma_i^2\alpha^2+\rho+\lambda_i,\quad i=1,2.
\eeq
Notice that by the expressions of $\alpha_3$ and $\alpha_4$ we have $\Phi_1(\alpha_3)>0$ and $\Phi_1(\alpha_4)<0$.
Since for $x \to -\infty$, the value function diverges at most with linear growth (cf.\ Proposition \ref{preliminary:OS}) we set $\widetilde{A}_1=\widetilde{A}_2 = 0 = \widetilde{B}_1=\widetilde{B}_2$.

In the stopping region $x \in [x^*(y),+\infty)$ we have from \eqref{FBP-equal}
\begin{equation}
\label{valuestopping}
w(x,1;y)=x-\hat{c}(y) = w(x,2;y).
\end{equation}

It now remains to find $\widetilde{A}_3(y)$, $\widetilde{A}_4(y)$ and $x^*(y)$, since $\widetilde{B}_3(y)$ and $\widetilde{B}_4(y)$ are related to $\widetilde{A}_3(y)$ and $\widetilde{A}_4(y)$ via \eqref{Bjs}.
To do so, we impose that $w(\cdot, i;y)$, $i=1,2$, is continuous across $x^*(y)$ together with its first derivative and we find
\begin{equation}
\label{system-C1}
\left\{
\begin{array}{ll}
\widetilde{A}_3(y) e^{\alpha_3 x^{*}(y)}+\widetilde{A}_4(y)e^{\alpha_4 x^*(y)}=x^*(y)-\hat{c}(y) \\ \\
\alpha_3 \widetilde{A}_3(y) e^{\alpha_3 x^{*}(y)}+\alpha_4 \widetilde{A}_4(y) e^{\alpha_4 x^*(y)}= 1\\ \\
\widetilde{B}_3(y) e^{\alpha_3 x^{*}(y)}+\widetilde{B}_4(y) e^{\alpha_4 x^*(y)}=x^*(y)-\hat{c}(y) \\ \\
\alpha_3 \widetilde{B}_3(y) e^{\alpha_3 x^{*}(y)}+\alpha_4 \widetilde{B}_4(y) e^{\alpha_4 x^*(y)}=1.
\end{array}
\right.
\end{equation}

Solving the first two of \eqref{system-C1} for $\widetilde{A}_3(y)$ and $\widetilde{A}_4(y)$ one has
\beq
\label{A3A4equal}
\widetilde{A}_3(y)=\frac{\alpha_4(x^*(y)-\hat{c}(y))-1}{(\alpha_4-\alpha_3)e^{\alpha_3 x^*(y)}}\qquad \widetilde{A}_4(y)=\frac{1-\alpha_3(x^*(y)-\hat{c}(y))}{(\alpha_4-\alpha_3)e^{\alpha_4 x^*(y)}}.
\eeq
On the other hand, recalling \eqref{Bjs} and plugging $\widetilde{A}_3(y)$ and $\widetilde{A}_4(y)$ from \eqref{A3A4equal} into the third of equation \eqref{system-C1} some simple algebra leads to
\beq
\label{xstar}
x^*(y)=\frac{\frac{1}{2}\sigma_1^2(\alpha_3+\alpha_4)}{\rho+\frac{1}{2}\sigma_1^2\alpha_3\alpha_4}+\hat{c}(y),
\eeq
where \eqref{def:Phiequal} has been used.
Similarly, inserting $\widetilde{A}_3(y)$ and $\widetilde{A}_4(y)$ of \eqref{A3A4equal} into the fourth of \eqref{system-C1} and using \eqref{def:Phiequal} one obtains
\beq
\label{xstar2}
x^*(y)=\frac{\frac{1}{2}\sigma_1^2(\alpha_3^2+\alpha_4^2+\alpha_3\alpha_4) - \rho}
{\frac{1}{2}\sigma_1^2\alpha_3\alpha_4(\alpha_3+\alpha_4)}+\hat{c}(y).
\eeq
Equations \eqref{xstar} and \eqref{xstar2} then imply that system \eqref{system-C1} admits a solution (which is then unique) if and only if
\beq
\label{consistency}
\frac{\frac{1}{2}\sigma_1^2(\alpha_3+\alpha_4)}{\rho+\frac{1}{2}\sigma_1^2\alpha_3\alpha_4}
=\frac{\frac{1}{2}\sigma_1^2(\alpha^2_3+\alpha^2_4+\alpha_3\alpha_4) - \rho}
{\frac{1}{2}\sigma_1^2\alpha_3\alpha_4(\alpha_3+\alpha_4)}.
\eeq
Using that $(\alpha_3\alpha_4)^2 =\beta_1\beta_2 = c_o/a_o$ and $\alpha^2_3 + \alpha^2_4 = \beta_1 + \beta_2$, simple algebra shows that the latter is equivalent to $\sigma^2_1 = \sigma^2_2=:\sigma^2$, i.e.\ to the case in which there is no jump. 
In such case, it is not hard to check by direct calculations that 
$\alpha^2_3=2\rho/\sigma^2$ and $\alpha^2_4=2(\rho+\lambda_1+\lambda_2)/\sigma^2$. With regard to \eqref{Bjs} this in turn gives 
\beq
\label{Bjs-bis}
\widetilde{B}_3(y) = \widetilde{A}_3(y), \qquad \widetilde{B}_4(y) = -\frac{\lambda_2}{\lambda_1}\widetilde{A}_4(y).
\eeq
The proof of the next result follows by using $\alpha^2_3=2\rho/\sigma^2$ and $\alpha^2_4=2(\rho+\lambda_1+\lambda_2)/\sigma^2$ in \eqref{xstar}, and from the properties of $\hat{c}(\cdot)$.

\begin{corollary}
\label{cor:boundaryequal}
One has
\beq
\label{bd-equal}
x^*(y) = \frac{\sigma}{\sqrt{2\rho}} + \hat{c}(y) > \hat{c}(y)
\eeq
Moreover, the mapping $y \mapsto x^*(y)$ is continuously strictly decreasing on $[0,1]$.
\end{corollary}

We will show and comment in Section \ref{comparison} that the boundary $x^*$ of \eqref{bd-equal} coincides with that one would obtain in a model without regime switching. The next result, whose proof is contained in Appendix \ref{someproofs}, shows however that the (candidate) optimal value is regime-dependent and differs from that one has in a no-regime-switching case.

\begin{theorem}
\label{candidate-w-equal}
\textbf{[The Candidate Value Function]} Let $\sigma_1=\sigma_2$. Let $x^*(y) \in (\hat{c}(y), + \infty)$ be given by \eqref{xstar} (or equivalently by \eqref{xstar2}), define $\widetilde{A}_3(y)$ and $\widetilde{A}_4(y)$ as in \eqref{A3A4equal} and recall \eqref{Bjs-bis}. Then the functions 
\begin{align}
\label{eq:candidatevalue1-equal}
w(x,1,y):=
\left\{
\begin{array}{ll}
\widetilde{A}_3(y)e^{\alpha_3 x}+\widetilde{A}_4(y)e^{\alpha_4 x}, & \quad x \leq x^*(y)\\[+5pt]
x - \hat{c}(y), & \quad x \geq x^*(y),
\end{array}
\right.
\end{align}
and 
\begin{align}
\label{eq:candidatevalue2-equal}
w(x,2;y):=
\left\{
\begin{array}{ll}
\widetilde{A}_3(y)e^{\alpha_3 x} - \frac{\lambda_2}{\lambda_1}\widetilde{A}_4(y)e^{\alpha_4 x}, & \quad x \leq x^*(y)\\[+5pt]
x - \hat{c}(y), & \quad x \geq x^*(y),
\end{array}
\right.
\end{align}
belong to $C^1(\mathbb{R})$ with $w_{xx}(x,i;y) \in L^{\infty}_{loc}(\mathbb{R})$, and are such that $|w(x,i;y)|\leq \kappa_i(1 + |x|)$ for some $\kappa_i > 0$. Moreover, $(w(x,1;y), w(x,2;y),x^*(y))$ solves free boundary problem \eqref{FBP-equal}.
\end{theorem}

By arguing as in the proof of Theorem \ref{thm:verifying}, one can also show the following theorem.

\begin{theorem}
\label{thm:verifying-equal}
\textbf{[The Verification Theorem]} Let $\mathcal{C}=\{(x,i) \in \mathbb{R} \times \{1,2\}: x < x^*(y)\}$. Under the same conditions of Theorem \ref{candidate-w-equal} and with $u$ as in \eqref{def-u} one has $w \equiv u$ on $\mathbb{R}\times \{1,2\}$ and
\beq
\label{tau-optimal-equal}
\tau^*:=\inf\{t\geq 0: (X_{t},\varepsilon_{t})\not \in \mathcal{C}\},\quad \mathbb{P}_{(x,i)}-a.s.,
\eeq
is an optimal stopping time.
\end{theorem}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{The Optimal Extraction Policy}
\label{sec:solSSC}

In this section we provide the solution to the finite-fuel singular stochastic control problem \eqref{value} in terms of the solution of the optimal stopping problem with regime switching studied in Section \ref{sec:OS}. 
%The assumption on the model parameters we have made in Section \ref{sec:OS} are assumed to hold throughout this section as well.

By Corollary \ref{cor:boundary-system} (see also Corollary \ref{cor:boundaryequal} in the case $x^*_1(y)=x^*_2(y)=x^*(y)$) we know that for any $i=1,2$, $y \mapsto x^*_i(y)$ is strictly decreasing and so has a decreasing inverse with respect to $y$. For $i \in \{1,2\}$, define
\begin{align}\label{def-bstar}
b^*_i(x):=
\left\{
\begin{array}{ll}
1, & x\le x^*_i(1)\\[+2pt]
 (x^*_i)^{-1}(x), & x\in(x^*_i(1),x^*_i(0))\\[+2pt]
0, & x\ge x^*_i(0).
\end{array}
\right.
\end{align}
Clearly $b^*_i: \mathbb{R} \to [0,1]$ is continuous and decreasing. Notice that also case (B) of Section \ref{sec:OS} in which $x^*_1(y) = x^*_2(y)$ can be accommodate in \eqref{def-bstar}. Indeed, in such case we simply have $b^*_1=b^*_2$.
%Moreover, since $\beta_* \in C^1$ and $\beta_*' < 0$ (cf.\ again Theorem \ref{verifthm01}), then $g_*'$ exists almost everywhere and it is bounded.

We now aim at providing a candidate value function for problem \eqref{value}. To this end, for $v$ of \eqref{value-OS} and $u$ as in Theorems \ref{thm:verifying} or \ref{thm:verifying-equal}, we introduce the function
\beq
\label{def-U}
U(x,y,i) := \int_0^y v(x, i;z)dz = \int_0^y u(x, i;z)dz - \frac{f(y)}{\rho},
\eeq
where the last equality follows from \eqref{value-OS-1}, upon recalling that $f(0)=0$ (cf.\ Assumption \ref{Asscost}).
We expect that $U(x,y,i)=V(x,y,i)$ for all $(x,y,i) \in \mathcal{O}$, with $V$ as defined in \eqref{value}.
\begin{proposition}
\label{listprops}
The function $U$ of \eqref{def-U} is such that $U(\cdot, i) \in C^{2,1}(\mathbb{R}\times[0,1])$ for any $i=1,2$ and the following bounds hold
\begin{align}
\label{boundsF}
\big|U(x,y,i)\big| + \big|U_y(x,y,i)\big|\le C(1+|x|),\quad \big|U_x(x,y,i)\big| + \big|U_{xx}(x,y,i)\big|\le \kappa
\end{align}
for $(x,y,i)\in\mathcal{O}$ and some positive constants $C$ and $\kappa$ (possibly depending on $i$).
\end{proposition}
\begin{proof}
It is easy to verify from \eqref{eq:candidatevalue1} and \eqref{eq:candidatevalue2}, and from \eqref{eq:candidatevalue1-equal} and \eqref{eq:candidatevalue2-equal} (upon recalling also Theorems \ref{thm:verifying} and \ref{thm:verifying-equal}) that $u$ is of the form $u(x,i;y)=\zeta_i(y)G_i(x)+\eta_i(y)H_i(x)$ for some continuous functions $\zeta_i$, $\eta_i$, $G_i$ and $H_i$. It thus follows that $(x,y)\mapsto U(x,y,i)$ is continuous on $\mathbb{R}\times[0,1]$ and $y \mapsto U_y(x,y,i)$ is continuous on $[0,1]$.
Also, from \eqref{eq:candidatevalue1} and \eqref{eq:candidatevalue2}, and from \eqref{eq:candidatevalue1-equal} and \eqref{eq:candidatevalue2-equal}, one can see that for any $x$ in a bounded set $K\subset\mathbb{R}$ and for any $i=1,2$ the derivatives $|u_x|$ and $|u_{xx}|$ are at least bounded by a function $F_K(y)\in L^1(0,1)$. It follows that to determine $U_x$ and $U_{xx}$ one can invoke dominate convergence theorem and evaluate derivatives inside the integral in \eqref{def-U} so to obtain
\begin{align}
\label{Ux}
U_x(x,y,i) = \int_{0}^{b^*_1(x) \wedge y} u_x(x,i;z)dz + \int_{b^*_1(x) \wedge y}^{b^*_2(x) \wedge y}u_x(x,i;z)dz + \int_{b^*_2(x) \wedge y}^{y}u_x(x,i;z)dz
\end{align}
and
\begin{align}
\label{Uxx}
U_{xx}(x,y,i) = \int_{0}^{b^*_1(x) \wedge y} u_{xx}(x,i;z)dz + \int_{b^*_1(x) \wedge y}^{b^*_2(x) \wedge y}u_{xx}(x,i;z)dz,
\end{align}
where the second integrals on the right hand side of \eqref{Ux} and \eqref{Uxx} equal zero in case $b^*_1=b^*_2$.
Therefore $U(\cdot, i) \in C^{2,1}$ for $i=1,2$ by \eqref{eq:candidatevalue1} and \eqref{eq:candidatevalue2}, \eqref{eq:candidatevalue1-equal} and \eqref{eq:candidatevalue2-equal}, Theorems \ref{thm:verifying} and \ref{thm:verifying-equal}, and continuity of $b^*_i(\cdot)$ (cf.\ \eqref{def-bstar}).
Finally, bounds \eqref{boundsF} follow from \eqref{eq:candidatevalue1} and \eqref{eq:candidatevalue2}, \eqref{eq:candidatevalue1-equal} and \eqref{eq:candidatevalue2-equal}, \eqref{def-U}, \eqref{Ux} and \eqref{Uxx}.
\end{proof}

From \eqref{def-U}, the fact that $u$ of \eqref{def-u} identifies with a solution in the a.e.\ sense of \eqref{HJB-OS} (cf.\ Theorems \ref{thm:verifying} and \ref{thm:verifying-equal}) and from Proposition \ref{listprops}, the next result follows.
\begin{proposition}
\label{prop6}
$U$ is a classical solution of \eqref{HJB} for all $(x,y,i) \in \mathbb{R} \times (0,1] \times \{1,2\}$ and satisfies the boundary condition $U(x,0,i)=0$ for $(x,i) \in \mathbb{R} \times \{1,2\}$.
\end{proposition}

Satisfying \eqref{HJB} and the boundary condition $U(x,0,i)=0$ for $(x,i) \in \mathbb{R} \times \{1,2\}$, $U$ is clearly a candidate value function for problem \eqref{value}. We now introduce a candidate optimal control process. Let $(x,y,i) \in \mathcal{O}$, recall $b^*_i$ of \eqref{def-bstar} and consider the process
\beq
\label{candidateoptimalcontrol}
\nu_t^*=\Big[y - \inf_{0 \leq s < t}b^*_{\varepsilon_s}\big(X_s\big)\Big]^+, \qquad t>0, \quad
\nu_0^*= 0,
\eeq
where $[\,\cdot\,]^+$ denotes the positive part.

\begin{proposition}
\label{admissiblenustar}
The process $\nu^*$ of \eqref{candidateoptimalcontrol} is an admissbile control.
\end{proposition}
\begin{proof}
Recall \eqref{admissiblecontrols}. For any given and fixed $\omega\in\Omega$, $t\mapsto \nu^*_t(\omega)$ is clearly nondecreasing and such that $Y^{\nu^*}_t(\omega) \geq 0$, for any $t\geq 0$, since $b^*_i(x) \in [0,1]$ for any $x\in \mathbb{R}$. 
Moreover, since $(X, \varepsilon)$ is right-continuous with left-limits (cf.\ Lemma 3.6 in \cite{ZhuYin}) and $(x,i)\mapsto b^*_i(x)$ is continuous, $t \mapsto \nu^*_t(\omega)$ is left-continuous. Finally, $\mathbb{F}$-progressively measurability of $(X, \varepsilon)$ and measurability of $b^*$ imply that $\nu^*$ is $\mathbb{F}$-progressively measurable by \cite{DM}, Theorem IV.33, whence $\mathbb{F}$-adapted.
\end{proof}

%Recalling that $\mathcal{W}=\big\{(x,y,i) \in \mathcal{O}\,:\,U_y(x,y,i) > x-c\big\} $ is the waiting region (cf.\ \eqref{def:inaction-action}), one has from \eqref{def-U}, \eqref{def-u} and \eqref{hat-c} that $\mathcal{W}= \{(x,y,i) \in \mathcal{O}\,:\,u(x,y,i) > x-\hat{c}(y)\big\} = \{(x,y,i) \in \mathcal{O}\,:\,y < b^*_i(x)\}$, and the relation between $\mathcal{W}$ and $\mathcal{C}$ of \eqref{cont-b} clearly follows due to \eqref{def-bstar}.

Process $\nu^*$ is the minimal effort needed to have $Y^{\nu^*}_t \leq b^*_{\varepsilon_t}(X_t)$ at any time $t$. In particular it is a standard result (see, e.g., Proposition 2.7 in \cite{DeAFeMo15} and references therein for a proof in a similar setting) that $\nu^*$ of \eqref{candidateoptimalcontrol} solves the Skorokhod reflection problem (SRP)
\begin{enumerate}
\item $\displaystyle Y^*_t \leq b^*_{\varepsilon_t}(X_t)$, $\mathbb{P}_{(x,y,i)}$-almost surely, for each $t > 0$;
\item $\displaystyle \int_0^T\, \mathds{1}_{\{Y^*_t < b^*_{\varepsilon_t}(X_t)\}}d\nu_t^*=0$ almost surely, for all $T \geq 0$, 
\end{enumerate}
where $Y^*:=Y^{\nu^*}$. An illustration of the (candidate) optimal policy $\nu^*$ is provided in Figure \ref{fig:1}.

\begin{figure}[!ht]
\centering
\includegraphics[scale=0.75]{Figure1.pdf}
\caption{\small %A plot of the extraction/waiting regions and of the optimal control $\nu^*$ (see \eqref{candidateoptimalcontrol}). 
Adopting the terminology of \cite{Guoetal}, the boundaries $b^*_i$, $i=1,2$, split the state space into the \textsl{inaction region} ($y<b^*_1(x)$), \textsl{transient region} ($b^*_1(x)<y<b^*_2(x)$) and \textsl{action region} ($y > b^*_2(x)$). When the initial state is $(x,y,i) \in \mathcal{O}$ with $y<b^*_i(x)$ one observes a Skorokhod reflection of $(X,Y^{*},\varepsilon)$ at $b^*_i$ in the vertical direction up to when all the fuel is spent. If the system is reflected at the upper boundary, at a time of regime switch $\nu^*$ prescribes an immediate jump of $Y^{*}$ from the upper to the lower boundary (whenever they are different). This plot was obtained solving with Matlab the nonlinear system \eqref{system-boundaries-2} when $f(y)=\frac{1}{3}(e^y-1)$ and with $\sigma_1=0.38$, $\sigma_2=1.9$, $\lambda_1=1.7$, $\lambda_2=0.44$, $\rho=1/3$ and $c=0.5$.}
\label{fig:1}
\end{figure}

\begin{theorem}\label{theorem8}
\textbf{[The Verification Theorem]} The control $\nu^*$ of \eqref{candidateoptimalcontrol} is optimal for problem \eqref{value}, and $U$ of \eqref{def-U} is such that $U \equiv V$.
\end{theorem}

\begin{proof}
The proof is organized into two steps and it is based on a verification argument.\vspace{+8pt}

{\em Step 1.}
Fix $(x,y,i)\in \mathcal{O}$ and take an arbitary $R>0$. Set $\tau_{R}:=\inf\big\{t\ge 0\,:\,X_t\notin(-R,R)\big\}$, pick an admissible control $\nu$, and note the regularity results for $U$ of Proposition \ref{listprops}. Then recalling \eqref{generator}, It\^o's formula up to the stopping time $\tau_R \wedge T$, for some $T>0$, leads to
\begin{align*}
U(x,y,i) =& \mathbb{E}_{(x,y,i)}\bigg[e^{-\rho(\tau_{R}\wedge T)}U(X_{\tau_{R}\wedge T}^x, {Y}_{\tau_{R}\wedge T}^{\nu}, \varepsilon_{\tau_{R}\wedge T})-\int_0^{\tau_{R}\wedge T}e^{-\rho s}(\mathcal{G}-\rho)
U(X,{Y}^{\nu}_s, \varepsilon_s)ds\bigg] \\
&  + \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s}U_y(X_s,{Y}^{\nu}_s, \varepsilon_s)d\nu_s\bigg]
\\ &  - \mathbb{E}_{(x,y,i)}\Big[\sum_{0\leq s < \tau_{R}\wedge T}e^{-\rho s}
\left(U(X_s,{Y}^{\nu}_{s+}, \varepsilon_{s})-U(X_s,{Y}^{\nu}_s,\varepsilon_{s})-U_y(X_s,{Y}^{\nu}_s, \varepsilon_s)\Delta Y_s\right)\Big],
\end{align*}
where $\Delta Y_s := Y_{s+} - Y_s = -\Delta \nu_s = -(\nu_{s+} - \nu_s)$ and the expectation of the stochastic integral vanishes since $U_x$ is bounded on $(x,y,i)\in[-R,R]\times[0,1] \times \{1,2\}$.

Now, noticing that any admissible control $\nu$ can be written as the sum of its continuous part and of its pure jump part, i.e.\ $d\nu=d\nu^{cont}+ \Delta \nu$ (see \cite{FlemingSoner}, Chapter 8, Section VIII.4, Theorem 4.1 at pp.\ 301-302), one has 
\begin{align*}
U(x,y,i) = & \mathbb{E}_{(x,y,i)}\bigg[e^{-\rho(\tau_{R}\wedge T)}U(X_{\tau_{R}\wedge T}, Y_{\tau_{R}\wedge T}^{\nu}, \varepsilon_{\tau_{R}\wedge T}) - \int_0^{\tau_{R}\wedge T}e^{-\rho s}(\mathcal{G}-\rho)U(X_s,Y^{\nu}_s, \varepsilon_s)ds\bigg] \\
&  + \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s}U_y(X_s,Y^{\nu}_s, \varepsilon_s)d\nu_s^{cont}\bigg] \\
& - \mathbb{E}_{(x,y,i)}\Big[\sum_{0\le s < \tau_{R}\wedge T}e^{-\rho s}
\left(U(X_s,Y^{\nu}_{s+}, \varepsilon_{s})-U(X_s,Y^{\nu}_{s}, \varepsilon_{s})\right)\Big].
\end{align*}
Since by Proposition \ref{prop6} $U$ satisfies the HJB equation \eqref{HJB}, and because
\begin{equation}
\label{jump}
U(X_s,Y^{\nu}_{s+},\varepsilon_{s})-U(X_s, Y^{\nu}_{s},\varepsilon_{s})=
-\int_0^{|\Delta Y_s|} U_y(X_s,Y^{\nu}_{s} - |\Delta Y_s| + z , \varepsilon_s)dz,
\end{equation}
one obtains
\begin{align}
\label{verif04}
U(x,y,i) \geq &\mathbb{E}_{(x,y,i)}\left[e^{-\rho(\tau_{R}\wedge T)}U(X_{\tau_{R}\wedge T}, Y_{\tau_{R}\wedge T}^{\nu}, \varepsilon_{\tau_{R}\wedge T})\right]-\mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s} f(Y^{\nu}_s)ds\bigg]\nonumber \\
& + \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s} (X_s-c) d\nu_s^{cont}\bigg]
 + \mathbb{E}_{(x,y,i)}\Big[\sum_{0\leq s < \tau_{R}\wedge T}e^{-\rho s}
(X_s-c) \Delta \nu_s \Big] \\
 = &\mathbb{E}_{(x,y,i)}\bigg[e^{-\rho(\tau_{R}\wedge T)}U(X_{\tau_{R}\wedge T}, Y_{\tau_{R}\wedge T}^{\nu}, \varepsilon_{\tau_{R}\wedge T}) + \int_0^{\tau_{R}\wedge T}e^{-\rho s}(X^x_s-c) d\nu_s\bigg] \nonumber \\
 & - \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s}f(Y^{\nu}_s)ds \bigg],\nonumber
\end{align}
where the fact that $|\Delta Y_s| = \Delta \nu_s$ has been used.

By H\"older's inequality, \eqref{dyn:X}, and It\^o's isometry we have
\begin{eqnarray*}
\mathbb{E}_{(x,y,i)}\Big[e^{-\rho(\tau_{R}\wedge T)}|X_{\tau_{R}\wedge T}|\Big] & \hspace{-0.25cm} \leq \hspace{-0.25cm} & \mathbb{E}_{(x,y,i)}\Big[e^{-2\rho(\tau_{R}\wedge T)}\Big]^{\frac{1}{2}}\mathbb{E}_{(x,y,i)}\Big[|X_{\tau_{R}\wedge T}|^2\Big]^{\frac{1}{2}} \nonumber \\
& \hspace{-0.25cm} \leq \hspace{-0.25cm} & \sqrt{2}\mathbb{E}_{(x,y,i)}\Big[e^{-2\rho(\tau_{R}\wedge T)}\Big]^{\frac{1}{2}}\bigg(|x|^2 + \mathbb{E}_{(x,y,i)}\bigg[\Big|\int_0^{\tau_{R}\wedge T} \sigma_{\varepsilon_u} dW_u\Big|^2\bigg]\bigg)^{\frac{1}{2}} \nonumber \\
& \hspace{-0.25cm} \leq \hspace{-0.25cm} &  \sqrt{2}\mathbb{E}_{(x,y,i)}\Big[e^{-2\rho(\tau_{R}\wedge T)}\Big]^{\frac{1}{2}}\Big(|x|^2 + (\sigma_1^2 \vee \sigma_2^2)T\Big)^{\frac{1}{2}}.\nonumber
\end{eqnarray*}
The latter estimate, together with the sub-linear growth property of $U$ (cf.~\eqref{boundsF}), then imply
\begin{eqnarray*}
&& \mathbb{E}_{(x,y,i)}\Big[e^{-\rho(\tau_{R}\wedge T)}U(X_{\tau_{R}\wedge T}, Y_{\tau_{R}\wedge T}^{\nu}, \varepsilon_{\tau_{R}\wedge T})\Big] \geq  - C \mathbb{E}_{(x,y,i)}\Big[e^{-\rho(\tau_{R}\wedge T)}\Big] \nonumber \\
&& - \sqrt{2} C \mathbb{E}_{(x,y,i)}\Big[e^{-2\rho(\tau_{R}\wedge T)}\Big]^{\frac{1}{2}}\Big(|x|^2 + (\sigma_1^2 \vee \sigma_2^2)T\Big)^{\frac{1}{2}},
\end{eqnarray*}
for some constant $C>0$. 
Hence
\begin{eqnarray}
\label{verif04-bis}
&& U(x,y,i) \geq - C \mathbb{E}_{(x,y,i)}\Big[e^{-\rho(\tau_{R}\wedge T)}\Big] - \sqrt{2} C \mathbb{E}_{(x,y,i)}\Big[e^{-2\rho(\tau_{R}\wedge T)}\Big]^{\frac{1}{2}}\Big(|x|^2 + (\sigma^2_1 \vee \sigma^2_2)T\Big)^{\frac{1}{2}} \nonumber \\
&& \hspace{+0.5cm} + \mathbb{E}_{(x,y,i)}\bigg[ \int_0^{\tau_{R}\wedge T}e^{-\rho s}(X^x_s-c) d\nu_s\bigg] -\mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_{R}\wedge T}e^{-\rho s}f(Y^{\nu}_s)ds \bigg].
\end{eqnarray}
When taking limits as $R\to\infty$ we have $\tau_{R}\wedge T \rightarrow T$, $\mathbb{P}_{(x,y,i)}$-a.s.\ by regularity of $(X,\varepsilon)$. Then letting $R\to\infty$ and then $T\to\infty$, and employing monotone convergence theorem for  the integral terms on the right-hand side of \eqref{verif04-bis} we obtain
%By Lemma \ref{lemma:UI} in the Appendix, the integral terms on the right-hand side of \eqref{verif04-bis} are uniformly integrable. We can thus invoke Vitali's convergence theorem to take limits as $R\to\infty$ and then as $T\to\infty$ to obtain
\begin{align}
\label{final-part1}
U(x,y,i) \geq \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\infty}e^{-\rho s} (X_s-c) d\nu_s - \int_0^{\infty}e^{-\rho s}f(Y^{\nu}_s)ds \bigg].
\end{align}
Since \eqref{final-part1} holds for any $\nu \in \mathcal{A}_y$ we have $U(x,y,i) \geq V(x,y,i)$.
\vspace{+8pt}

{\em Step 2.} If $y=0$ then $U(x,0,i) = 0 =V(x,0,i)$. Take then $y\in(0,1]$, $Y^*:=Y^{\nu^*}$ with $\nu^*$ as in \eqref{admissiblenustar} and define $\vartheta:=\inf\big\{t\ge 0\,:\,\nu^*_t = y\big\}$. We can repeat arguments of \emph{Step 1} on It\^o's formula with $\tau_R$ replaced by $\tau_R \wedge \vartheta$ to obtain
\begin{align*}
U(x,y,i) =& \mathbb{E}_{(x,y,i)}\bigg[e^{-\rho\,(\tau_R\wedge\vartheta)}U(X_{\tau_R\wedge\vartheta}, Y^*_{\tau_R\wedge\vartheta}, \varepsilon_{\tau_R\wedge\vartheta})-\int_0^{\tau_R\wedge\vartheta}e^{-\rho s}(\mathcal{G}-\rho)
U(X_s,Y^*_s,\varepsilon_s)ds\bigg] \\
&  + \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\tau_R\wedge\vartheta}e^{-\rho s}U_y(X_s,Y^*_s, \varepsilon_s)d\nu_s^{*,cont}\bigg]\\
& - \mathbb{E}_{(x,y,i)}\left[\sum_{0\le s < \tau_R\wedge\vartheta}e^{-\rho s}
\left(U(X_s,Y^*_{s+}, \varepsilon_s)-U(X_s,Y^*_s,\varepsilon_s)\right)\right].
\end{align*}
If we now recall Proposition \ref{prop6}, \eqref{jump} and the fact that $\nu^*$ solves the Skorokhod reflection problem (SRP), then from the above we obtain
\begin{align}
\label{verif07}
U(x,y,i) =& \mathbb{E}_{(x,y,i)}\bigg[e^{-\rho\,(\tau_R\wedge\vartheta)}U(X_{\tau_R\wedge\vartheta}, Y^*_{\tau_R\wedge\vartheta}, \varepsilon_{\tau_R\wedge\vartheta}) + \int_0^{\tau_R\wedge\vartheta}e^{-\rho s}(X_s-c) d\nu^*_s \\
& - \int_0^{\tau_R\wedge\vartheta}e^{-\rho s}f(Y^*_s)ds \bigg].\nonumber
\end{align}
As $R\to\infty$, again $\tau_R\to\infty$, and clearly $\tau_R\wedge\vartheta\to \vartheta$, $\mathbb{P}_{(x,y,i)}$-a.s. Moreover, we can use sub-linear growth property of $U$ (cf.~\eqref{boundsF}) and estimates as in the last part of the proof of Theorem \ref{thm:verifying} to apply dominated convergence theorem and have $\lim_{R \uparrow \infty}\mathbb{E}_{(x,y,i)}\left[e^{-\rho\,(\tau_R\wedge\vartheta)}U(X_{\tau_R\wedge\vartheta}, Y^*_{\tau_R\wedge\vartheta}, \varepsilon_{\tau_R\wedge\vartheta})\right] = \mathbb{E}_{(x,y,i)}\left[e^{-\rho\vartheta}U(X_{\vartheta}, Y^*_{\vartheta}, \varepsilon_{\vartheta})\right] = 0$. Finally, we also notice that since $d\,\nu^*_s\equiv0$ and $f(Y^*_s)\equiv0$ for $s>\vartheta$ the integrals in \eqref{verif07} may be extended beyond $\vartheta$ up to $+\infty$ to get
\begin{align}
\label{verif08}
U(x,y,i) =& \mathbb{E}_{(x,y,i)}\bigg[\int_0^{\infty}e^{-\rho s}(X_s-c) d\nu^*_s -\int_0^{\infty}e^{-\rho s}
f(Y^*_s)ds\bigg]=\mathcal{J}_{x;c}(\nu^*).
\end{align}
Then $U \equiv V$ and $\nu^*$ is optimal.
\end{proof}

\section{A Comparison to the No-Regime-Switching Case}
\label{comparison}

It is quite immediate to solve our optimal extraction problem when there is no regime switching. In particular, in this case it can be checked that the optimal extraction rule reads as 
\beq
\label{extraction1reg}
\nu^{\scriptstyle{\#}}_t:=\Big[y - \inf_{0 \leq s < t}b^{\scriptstyle{\#}}\big(X_s\big)\Big]^+, \qquad t>0, \quad
\nu^{\scriptstyle{\#}}_0= 0,
\eeq
where $[\,\cdot\,]^+$ denotes the positive part. Here, the optimal boundary $b^{\scriptstyle{\#}}$ is given by
\begin{align}
\label{def-cancello}
b^{\scriptstyle{\#}}(x):=
\left\{
\begin{array}{ll}
1, & x\le x^{\scriptstyle{\#}}(1)\\[+2pt]
(x^{\scriptstyle{\#}})^{-1}(x), & x\in(x^{\scriptstyle{\#}}(1),x^{\scriptstyle{\#}}(0))\\[+2pt]
0, & x\ge x^{\scriptstyle{\#}}(0),
\end{array}
\right.
\end{align}
where
\beq
\label{xcancello}
x^{\scriptstyle{\#}}(y):= \frac{\sigma}{\sqrt{2\rho}} + \hat{c}(y).
\eeq

A first observation that is worth making is that $x^{\scriptstyle{\#}} = x^*$, with $x^*$ as in \eqref{bd-equal}. To understand this, recall that in Section \ref{caseB} we have obtained that the two regime-dependent boundaries $x^*_i$, $i=1,2$, coincide and areg iven by \eqref{bd-equal} if and only if $\sigma_1 = \sigma_2$. In such case the price process does not jump and it therefore behaves as if we had not regime-switching. It is then reasonable to obtain for such setting the same optimal selling price that we would obtain in absence of regime shifts, although the associated optimal value is still regime-dependent.

In general, although qualitatively similar to \eqref{extraction1reg}, the optimal extraction rule $\nu^*$ of the two regimes case (cf.\ \eqref{candidateoptimalcontrol}) shows an important feature which is not present in the single regime case. 
Indeed, $\nu^*$ of \eqref{candidateoptimalcontrol} jumps at the moments of regime shifts from state $2$ to state $1$, thus implying a lump-sum extraction at those instants. This fact is not observed in \eqref{extraction1reg} where a jump can happen only at initial time. We also refer to the detailed discussion in \cite{Guoetal}.

It is also interesting to see how the presence of regime shifts is reflected into the optimal investment boundaries. This is shown in Figure \ref{fig:2}.
\begin{figure}[!ht]
\centering
\includegraphics[scale=0.75]{Figure2.pdf}
\caption{\small The dashed curve $b^{\scriptstyle{\#}}_i(x)$, $i=1,2$, is the optimal extraction boundary \eqref{def-cancello} of the single regime case when the volatility is $\sigma_i$. The solid curves are the optimal extraction boundaries $(b^*_1,b^*_2)$ when there is regime switching in the spot price process. To generate this plot with Matlab we have taken $f(y)=\frac{1}{3}(e^y-1)$ and with $\sigma_1=0.38$, $\sigma_2=1.9$, $\lambda_1=1.7$, $\lambda_2=0.44$, $\rho=1/3$ and $c=0.5$.}
\label{fig:2}
\end{figure}
There we have a plot of the optimal boundaries in the case of regime switching, $b^*_i$, $i=1,2$ (solid curves), and in the case of a single regime, $b^{\scriptstyle{\#}}_i$ with volatility $\sigma_i$ (dashed curves), $i=1,2$. Taking $\sigma_1 < \sigma_2$ we observe, that under macroeconomic cycles, the value at which the reserve level should be kept is higher than the one at which it would be kept if the volatility were always $\sigma_1$. On the other hand, the value at which the reserve level should be maintained when business cycles are present, is lower than the one at which it would be kept if the volatility were always $\sigma_2$. To some extent, this fact can be thought of as an \emph{average effect} of the regime switching. For example, if the market volatility assumes at any time the highest value possible (i.e.\ it is always equal to $\sigma_2$), then the company would be more reluctant to extract and sell the commodity in the spot market relative to the case in which the volatility could jump to the lower value $\sigma_1$. A symmetric argument applies to explain $b^{\scriptstyle{\#}}_1 < b^{*}_i$, $i=1,2$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\section{Conclusion}
%\label{Sec:Conclusion}
%
%In this paper we have considered the problem of a company that extracts an exhaustible commodity, sells it in the spot market, and aims at maximizing the resulting expected, net cash flow. The dynamics of the commodity spot price is given by a Brownian motion whose volatility is modulated by a continuous-time Markov chain with two states. We have set up the extraction problem as a finite fuel two-dimensional degenerate singular stochastic control problem that we have explicitly solved. Under suitable restrictions on the parameters, we show that the optimal extraction rule is triggered by a price and regime dependent boundary that we have characterized in terms of the optimal stopping boundary of (a family of) perpetual optimal selling problems under regime switching. A comparison with the solution one would obtain in the single regime case shows interesting economic effects of regime switching in the optimal extraction rule.
%
%There are several directions towards which our work can be extended. A first natural extension would be to consider a company which is price maker, in the sense that the amount of commodity extracted has a market impact and affects the dynamics of commodity spot price, e.g., in an additive way. Taking into account such feature, the gradient constraint in the HJB equation associated to the optimal extraction problem will not involve anymore only $V_y$, but will modify into a condition on both $V_x$ and $V_y$. A similar structure of the gradient constraint appears in the HJB equation considered in the recent work \cite{GuoZervos} (see eq.\ (5.2) in \cite{GuoZervos}). There the authors solve a two-dimensional degenerate singular stochastic control problem modeling an optimal execution problem with multiplicative price impact, but without regime shifts in the price dynamics. As a second extension, it would be interesting to investigate if the problem can be still solved if allowing for semi-Markov switching (i.e.\ not exponentially distributed sojourn times), or if considering correlation between the different sources of uncertainty of our model. All these questions are left for future research.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bigskip

\textbf{Acknowledgments.} Financial support by the German Research Foundation (DFG) via grant Ri 1128-4-2 is gratefully acknowledged by the first author. The secod named author is supported by the China Scholarship Council (CSC). The first named author thanks Maria B.\ Chiarolla for having introduced him to the literature on optimal extraction problems under regime switching.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\appendix
\section{Some Proofs from Section \ref{sec:OS}}
\label{someproofs}
\renewcommand{\theequation}{A-\arabic{equation}}


\emph{Proof of Corollary \ref{cor:boundary-system}}
\vspace{0.15cm}

Recalling that $z^*_1:=x_1^*(y)-\hat{c}(y)$ and $z^*_2:=x_2^*(y)-x_1^*(y)$ so that $x_1^*(y) = z^*_1 + \hat{c}(y) > \hat{c}(y)$ and $x_2^*(y):= z^*_2 + x_1^*(y) > x_1^*(y) > \hat{c}(y)$, the first part of the statement follows from Proposition \ref{prop:existence}. As for the second claim, it suffices to notice that the only dependence with respect to $y$ in $x_1^*(y)$ and $x_2^*(y)$ is via $\hat{c}$ and therefore these two thresholds have the same monotonicity and regularity of $\hat{c}(y):=c-f'(y)/\rho$, i.e.\ they are strictly decreasing and continuous on $[0,1]$.
\ep

\vspace{0.25cm}

\emph{Proof of Theorem \ref{candidate-w}}
\vspace{0.15cm}

\emph{Step 1.}\, The fact that $w(\cdot, i;y) \in C^1(\mathbb{R})$ for $i=1,2$ follows by construction. It is also easy to verify from \eqref{eq:candidatevalue1} and \eqref{eq:candidatevalue2} that $w(\cdot, i;y)$, $i=1,2$, grows at most linearly and that $w_{xx}(\cdot,i;y)$ are bounded on any compact subset of $\mathbb{R}$.
\smallskip

We now show that if also Assumption \ref{assm-2} holds, then $(w(x,1;y), w(x,2;y), x^*_1(y), x^*_2(y))$ solves free boundary problem \eqref{FBP-1}.
Since by construction $(w(x,1;y), w(x,2;y), x^*_1(y), x^*_2(y))$ solves the first eight conditions of \eqref{FBP-1}, then it suffices to prove that also the last two of \eqref{FBP-1} are fulfilled. This part of the proof is organized in the next steps.
\medskip

\emph{Step 2.}\, Here we show that $w(x,1;y) \geq x - \hat{c}(y)$ for any $x \in \mathbb{R}$. This is clearly true with equality by \eqref{eq:candidatevalue1} for any $x\geq x^*_1(y)$. To prove the claim when $x < x^*_1(y)$ we show that $w(\cdot,1;y)$ is convex therein. Indeed such property together with the fact that $w_x(x^*_1(y),1;y) - 1 =0$ implies that $w_x(x,1;y) - 1 \leq 0$ for any $x < x^*_1(y)$ and therefore that $w(x,1;y) \geq x - \hat{c}(y)$ for $x < x^*_1(y)$ since also $w(x^*_1(y),1;y) - (x^*_1(y)-\hat{c}(y)) =0$.

To complete, we need to show that $w(\cdot,1;y)$ is convex on $x < x^*_1(y)$.
To this end note that for any $x<x^*_1(y)$ we have from \eqref{eq:candidatevalue1}
\beq
\label{w1convex-1}
w_{xx}(x,1;y)(\alpha_4-\alpha_3)=\alpha_3^2(\alpha_4(x_1^*(y)-\hat{c}(y))-1)e^{\alpha_3(x-x_1^*(y))}
+\alpha_4^2(1-\alpha_3(x_1^*(y)-\hat{c}(y)))e^{\alpha_4(x-x_1^*(y))}.
\eeq
Moreover, some algebra gives
\begin{equation}
\label{w1convex-3}
\alpha_3^2(\alpha_4(x_1^*(y)-\hat{c}(y))-1) +\alpha_4^2(1-\alpha_3(x_1^*(y)-\hat{c}(y)))=(\alpha_4-\alpha_3)\Big[\alpha_4+\alpha_3-\alpha_3\alpha_4(x_1^*(y)-\hat{c}(y))\Big].
\end{equation}
Also (by simple but tedious algebra) one has
\beq
\label{ex-ass-1}
\displaystyle  - \frac{1}{a_3}\Big(\frac{\rho}{\rho+\lambda_2}+ a_4\Big) - \frac{1}{\alpha_3} \leq \frac{1}{\alpha_4} \quad \Longleftrightarrow \quad \frac{\rho}{\lambda_1} \geq 0,
\eeq
and
\beq
\label{ex-ass-1-bis}
\displaystyle \frac{1}{\alpha_4} \leq -\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}} \quad \Longleftrightarrow \quad \Phi_1(\alpha_4) \leq \frac{\rho\lambda_1}{\rho + \lambda_2}(1 + \alpha_5).
\eeq
It thus follows that the inequalities on the left hand-side of \eqref{ex-ass-1} and \eqref{ex-ass-1-bis} are verified for any choice of the parameters
(being $\Phi_1(\alpha_4) < 0$ by direct check). Then recalling that $x_1^*(y)-\hat{c}(y) = z_1^*$, using bounds \eqref{w1convex-2-a} (cf.\ proof of Proposition \ref{prop:existence}) and the inequalities on the left hand side of \eqref{ex-ass-1} and \eqref{ex-ass-1-bis} into \eqref{w1convex-3} we get $(\alpha_4-\alpha_3)[\alpha_4+\alpha_3-\alpha_3\alpha_4(x_1^*(y)-\hat{c}(y))] \geq 0$, whence
%The latter follows from some of the results obtained in the proof of Proposition \ref{prop:existence}. Indeed recall that $x_1^*(y)-\hat{c}(y) = z_1^*$, \eqref{eq:M1M2}, and that $z_1^* = M_1(z_2^*) = M_2(z_2^*)$, as $z_2^*$ is such that $M_1(z_2^*)-M_2(z_2^*)=0$. Then, since $M_1(\cdot)$ is strictly increasing and $M_2(\cdot)$ is strictly decreasing on $[0,\hat{z}_2)$ and $z_2^* < \hat{z}_2$, one has $M_1(0) < x_1^*(y)-\hat{c}(y) < M_2(0)$, i.e.\ \eqref{w1convex-2}.  
\begin{equation*}
\alpha_3^2(\alpha_4(x_1^*(y)-\hat{c}(y))-1) +\alpha_4^2(1-\alpha_3(x_1^*(y)-\hat{c}(y)))=(\alpha_4-\alpha_3)\Big[\alpha_4+\alpha_3-\alpha_3\alpha_4(x_1^*(y)-\hat{c}(y))\Big] \geq 0.
\end{equation*}
Therefore
$$\alpha_4^2(1-\alpha_3(x_1^*(y)-\hat{c}(y))) \geq - \alpha_3^2(\alpha_4(x_1^*(y)-\hat{c}(y))-1),$$
which substituted into \eqref{w1convex-1} yields
\beq
\label{w1convex-4}
w_{xx}(x,1;y)(\alpha_4-\alpha_3) \geq \alpha_3^2(\alpha_4(x_1^*(y)-\hat{c}(y))-1)\Big[e^{\alpha_3(x-x_1^*(y))}
-e^{\alpha_4(x-x_1^*(y))}\Big] \geq 0,
\eeq
where \eqref{w1convex-2-a}, \eqref{ex-ass-1}, and the fact that $\alpha_3 < \alpha_4$ but $x<x^*_1(y)$ have been employed for the last estimate.
\medskip

\emph{Step 3.}\, In this step we prove that $w(x^*_1(y),2;y) \geq x^*_1(y)-\hat{c}(y)$ and $w_{x}(x^*_1(y),2;y) \leq 1$. These estimates will be needed to show that $w(x,2;y) \geq x-\hat{c}(y)$ for any $x\in \mathbb{R}$. From \eqref{eq:candidatevalue2} and using that $B_3(y):=\frac{\Phi_1(\alpha_3)}{\lambda_1}A_3(y)$, $B_4(y):=\frac{\Phi_1(\alpha_4)}{\lambda_1}A_4(y)$, with $A_3(y)$ and $A_4(y)$ as in \eqref{A3-A4}, one easily finds
\beq
\label{w2x1}
w(x^*_1(y),2;y)=\frac{\Phi_1(\alpha_3)[\alpha_4(x_1^*(y)-\hat{c}(y))-1]}{\lambda_1(\alpha_4-\alpha_3)}
+\frac{\Phi_1(\alpha_4)[1-\alpha_3(x_1^*(y)-\hat{c}(y))]}{\lambda_1(\alpha_4-\alpha_3)}\nonumber
\eeq
and
\beq
\label{w2xx1}
w_x(x^*_1(y),2;y)=\frac{\alpha_3\Phi_1(\alpha_3)[\alpha_4(x_1^*(y)-\hat{c}(y))-1]}{\lambda_1(\alpha_4-\alpha_3)}
+\frac{\alpha_4\Phi_1(\alpha_4)[1-\alpha_3(x_1^*(y)-\hat{c}(y))]}{\lambda_1(\alpha_4-\alpha_3)}.\nonumber
\eeq
Recalling that $\Phi_i(z)= -\frac{1}{2}\sigma_i^2 z^2 + \rho + \lambda_i$, $i=1,2$, a simple calculation yields
\beq
\label{w2x1-bis}
w(x^*_1(y),2;y)=\frac{-\frac{1}{2}\sigma_1^2(\alpha_3+\alpha_4)+(x_1^*(y)-\hat{c}(y))
(\frac{1}{2}\sigma_1^2\alpha_3\alpha_4+\rho+\lambda_1)}{\lambda_1}
\eeq
and
\beq
\label{w2xx1-bis}
w_x(x^*_1(y),2;y)=\frac{\alpha_4\Phi(\alpha_4)-\alpha_3\Phi(\alpha_3)}{\lambda_1(\alpha_4-\alpha_3)}
+\frac{\alpha_3\alpha_4\sigma_1^2(x_1^*(y)-\hat{c}(y))(\alpha_4+\alpha_3)}{2\lambda_1}.
\eeq
%Proceeding as in the proof of Lemma \ref{lemm:valuesai} in Appendix (see, in particular, the proof of $a_4>0$), it is not hard to show that
%\begin{equation}
%\label{ess-1}
%\frac{\alpha_4\Phi_1(\alpha_4)-\alpha_3\Phi_1(\alpha_3)}{\lambda_1(\alpha_4-\alpha_3)}<0.
%\end{equation}
It is now matter of algebraic manipulation to show that 
\beq
\label{1}
\frac{\sigma_1^2(\alpha_3+\alpha_4)}{\sigma_1^2\alpha_3\alpha_4+2\rho}
\leq -\frac{a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}}
\eeq
is verified under Assumption \ref{assm-2} since it is equivalent to $\alpha_5 \leq \rho/\lambda_2$, whereas
\beq
\label{2}
\displaystyle -\frac{\frac{\rho}{\rho+\lambda_2}+a_4}{a_3}
\leq \frac{2\lambda_1}{\alpha_3\alpha_4\sigma_1^2(\alpha_4+\alpha_3)}\Big[1+\frac{\alpha_3\Phi_1(\alpha_3)-\alpha_4\Phi_1(\alpha_4)}{\lambda_1(\alpha_4 -\alpha_3)}\Big]
\eeq
is always satisfied. Then by \eqref{w1convex-2-a}, \eqref{1} and \eqref{2} we obtain
\begin{equation*}
\label{ess-2}
\frac{\sigma_1^2(\alpha_3+\alpha_4)}{\sigma_1^2\alpha_3\alpha_4+2\rho}
\leq  x_1^*(y)-\hat{c}(y)
\leq \frac{2\lambda_1}{\alpha_3\alpha_4\sigma_1^2(\alpha_4+\alpha_3)}\left[1+\frac{\alpha_3\Phi(\alpha_3)-\alpha_4\Phi(\alpha_4)}{\lambda_1(\alpha_4 -\alpha_3)}\right],
\end{equation*}
which, used into \eqref{w2x1-bis} and \eqref{w2xx1-bis} yield $w(x^*_1(y),2;y) \geq x^*_1(y)-\hat{c}(y)$ and $w_x(x^*_1(y),2;y) \leq 1$, respectively.
\medskip

%Then take $x < x^*_1(y)$ and notice that therein $w(x,1;y)=A_3(y)e^{\alpha_3 x}+A_4(y)e^{\alpha_4 x}$ (cf.\ again \eqref{eq:candidatevalue1}) with (see \eqref{A3-A4})
%$$A_3(y)=\frac{\alpha_4(x_1^*(y)-\hat{c}(y))-1}{(\alpha_4-\alpha_3)e^{\alpha_3x_1^*(y)}},\quad A_4(y)=\frac{1-\alpha_3(x_1^*(y)-\hat{c}(y))}{(\alpha_4-\alpha_3)e^{\alpha_4x_1^*(y)}}.$$
%Moreover the following estimates hold
%\begin{equation}
%\label{equa-2}
%\frac{-a_2}{a_1+\frac{\rho}{\alpha_5(\rho+\lambda_2)}}<x_1^*(y)-\hat{c}(y)=z_2^*<\frac{\frac{\rho}{\rho+\lambda_2}+a_4}{-a_3},
%\end{equation}
%by [WHY? PLEASE JUSTIFY].
%Setting
%\begin{eqnarray}
%\label{def:u}
%& & u(x;y):=(\alpha_4 -\alpha_3)\big[w(x,1;y) - (x-\hat{c}(y))\big]\\
%&& =(\alpha_4(x_1^*(y)-\hat{c}(y))-1)e^{\alpha_3(x-x_1^*(y))}+(1-\alpha_3(x_1^*(y)-\hat{c}(y)))e^{\alpha_4(x-x_1^*(y))}-(x-\hat{c}(y))(\alpha_4-\alpha_3)\nonumber
%\end{eqnarray}
%it is easy to see that $u(x_1^*(y);y)=0$, by the fourth of \eqref{FBP-1}. Also 
%$$u_x(x;y)=\alpha_3(\alpha_4(x_1^*(y)-\hat{c}(y))-1)e^{\alpha_3(x-x_1^*(y))}+\alpha_4(1-\alpha_3(x_1^*(y)-\hat{c}(y)))e^{\alpha_4(x-x_1^*(y))}-(\alpha_4-\alpha_3).
%$$
%and $u_x(x_1^*(y);y)=0$, by the sixth of \eqref{FBP-1}. By Assumption \ref{assm-2} and equation \eqref{equa-2}, we conclude $u_x(x;y)\leq 0$ so that $u(x;y) \geq 0$ for any $x < x^*_1(y)$. Therefore $w(x,1;y)\geq x-\hat{c}(y)$ for any $x < x^*_1(y)$ and thus for any $x\in \mathbb{R}$.

\emph{Step 4.}\, We now show that $w(x,2;y)\geq x-\hat{c}(y)$ for $x < x^*_2(y)$ and therefore for any $x\in \mathbb{R}$ due to the fourth of \eqref{FBP-1}. On $x \in (-\infty, x^*_1(y)) \cup (x^*_1(y), x^*_2(y))$ one has from \eqref{FBP-1}
\beq
\label{check-1}
\frac{1}{2}\sigma_2^2 w_{xx}(x,2;y) + \lambda_2(w(x,1;y) - w(x,2;y)) - \rho w(x,2;y) =0.
\eeq
Setting $\widehat{w}(x,i;y)=w(x,i;y)-(x-\hat{c}(y))$, $i=1,2$, it follows that on $(-\infty, x^*_1(y)) \cup (x^*_1(y), x^*_2(y))$
\beq
\label{check-2}
\frac{1}{2}\sigma_2^2\widehat{w}_{xx}(x,2;y) + \lambda_2(\widehat{w}(x,1;y) - \widehat{w}(x,2;y)) - \rho \widehat{w}(x,2;y) = \rho(x-\hat{c}(y)).
\eeq
We now consider separately the two cases $x \in (-\infty, x^*_1(y))$ and $x \in (x^*_1(y), x^*_2(y))$. For $x \in (-\infty, x^*_1(y))$ we can differentiate \eqref{check-2} once more with respect to $x$ so to obtain
$$
\frac{1}{2}\sigma_2^2\widehat{w}_{xxx}(x,2;y) + \lambda_2(\widehat{w}_x(x,1;y) - \widehat{w}_x(x,2;y)) - \rho \widehat{w}_x(x,2;y) = \rho.
$$
Setting $\tau_1:=\inf\{t\geq 0: (X,\varepsilon) \notin \mathcal{D}_1\}$ $\mathbb{P}_{(x,i)}$-a.s., where $\mathcal{D}_1:=\{(x,i) \in \mathbb{R} \times \{1,2\}: x < x^*_1(y)\}$, an application of It\^o's formula (possibly with a standard localization argument) leads to
\begin{eqnarray}
\label{check-3}
\hspace{-0.5cm} \widehat{w}_{x}(x,2;y)& \hspace{-0.25cm} =  \hspace{-0.25cm} & \mathbb{E}_{(x,i)}\bigg[e^{-\rho \tau_1}\widehat{w}_x(X_{\tau_1}, \varepsilon_{\tau_1};y) - \int_0^{\tau_1} e^{-\rho s}\rho ds \bigg] \leq \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau_1}\widehat{w}_x(X_{\tau_1}, \varepsilon_{\tau_1};y)\Big] \nonumber \\
& \hspace{-0.25cm} =  \hspace{-0.25cm} & \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau_1}\widehat{w}_x(X_{\tau_1}, \varepsilon_{\tau_1};y)\mathds{1}_{\{\varepsilon_{\tau_1} = 1\}}\Big] + \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau_1}\widehat{w}_x(X_{\tau_1}, \varepsilon_{\tau_1};y)\mathds{1}_{\{\varepsilon_{\tau_1} = 2\}}\Big],
\end{eqnarray}
for any $x < x^*_1(y)$. Since $\widehat{w}_{x}(x^*_1(y),i;y) = {w}_{x}(x^*_1(y),i;y) - 1\leq 0$, $i=1,2$, by the fifth of \eqref{FBP-1} and by Step \emph{3.}, and because $\tau_1 < +\infty$ $\mathbb{P}_{(x,i)}$-a.s.\ due to recurrence property of $(X,\varepsilon)$ (see (i) of Theorem 4.4 of \cite{ZhuYin} with $k>0$, $\alpha \in (0,1)$, $c_1=c_2$ therein), we conclude from \eqref{check-3} that $\widehat{w}_{x}(x,2;y) \leq 0$ for any $x < x^*_1(y)$. In turn this implies $w(x,2;y) \geq x-\hat{c}(y)$ for any $x < x^*_1(y)$ since $w(x^*_1(y),2;y) \geq x^*_1(y)-\hat{c}(y)$ again by the results of Step \emph{3.}

Take now $x \in (x^*_1(y), x^*_2(y))$ and define $\tau_{1,2}:=\inf\{t\geq 0: (X,\varepsilon) \notin \mathcal{D}_{1,2}\}$ $\mathbb{P}_{(x,i)}$-a.s., where $\mathcal{D}_{1,2}:=\{(x,i) \in \mathbb{R} \times \{1,2\}: x^*_1(y) < x < x^*_2(y)\}$.  Employing the same rational of the arguments above and using also that $\widehat{w}_{x}(x^*_2(y),2;y) = 0$ and $\widehat{w}_x(x^*_2(y),1;y) = 0$, we obtain $\widehat{w}_x(x,2;y) \leq 0$ for any $x \in (x^*_1(y), x^*_2(y))$. Hence $\widehat{w}(x,2;y) \geq 0$ for any $x \in (x^*_1(y), x^*_2(y))$ since $\widehat{w}(x^*_2(y),2;y) = 0$. Therefore ${w}(x,2;y) \geq x - \hat{c}(y)$ for any $x < x^*_2(y)$, by combining the previous results and the fact that ${w}(x^*_1(y),2;y) \geq x^*_1(y) - \hat{c}(y)$ proved in Step \emph{3.}
\medskip

Steps \emph{2}, \emph{3} and \emph{4} above show that $w(x,i;y) \geq x -\hat{c}(y)$ for $x \in \mathbb{R}$ and $i=1,2$. We now turn to prove that one also has $\tfrac{1}{2}\sigma_i^2 w_{xx}(x,i;y)-\rho w(x,i;y) + \lambda_i(w(x,3-i;y)-w(x,i;y)) \leq 0$ for a.e.\ $x \in \mathbb{R}$ and $i=1,2$.
\medskip

\emph{Step 5.}\, We start showing that 
\beq
\label{ineq-1}
\tfrac{1}{2}\sigma_2^2 w_{xx}(x,2;y)-\rho w(x,2;y) + \lambda_2(w(x,1;y)-w(x,2;y)) \leq 0
\eeq
for a.e.\ $x \in \mathbb{R}$. This is true with equality for any $x < x^*_2(y)$ by construction. For $x > x^*_2(y)$ we have $w(x,1;y)=x-\hat{c}(y)=w(x,2;y)$. On that interval \eqref{ineq-1} thus reads $- \rho (x-\hat{c}(y)) \leq 0$, which is fulfilled since $\rho > 0$ and $x^*_2(y) > \hat{c}(y)$ by Corollary \ref{cor:boundary-system}.

We now check that one also has
\beq
\label{ineq-2}
\tfrac{1}{2}\sigma_1^2 w_{xx}(x,1;y)-\rho w(x,1;y) + \lambda_1(w(x,2;y)-w(x,1;y)) \leq 0
\eeq
for a.e.\ $x \in \mathbb{R}$. Again, it suffices to show that the previous is true for $x > x^*_1(y)$, as it is verified with equality by construction on $(-\infty,x^*_1(y))$. 

If $x > x^*_2(y)$ then $w(x,2;y)= x - \hat{c}(y)=w(x,1;y)$ and \eqref{ineq-2} holds since $\rho > 0$ and $x^*_2(y) > \hat{c}(y)$ by Corollary \ref{cor:boundary-system}. To complete the proof we consider the case $x\in (x_1^*(y), x^*_2(y))$. On such interval we have again $w(x,1;y)=x-\hat{c}(y)$, and therefore \eqref{ineq-2} is verified on $(x_1^*(y), x^*_2(y))$ if 
\beq
\label{ineq-3}
w(x,2;y) \leq \frac{\rho + \lambda_1}{\lambda_1} w(x,1;y),
\eeq
where we have used that $w_{xx}(x,1;y) = 0$ on $(x_1^*(y), x^*_2(y))$.
In Step \emph{4.}\ we have shown that $w_x(x,2;y) - 1 \leq 0$ for any $x\in (x_1^*(y), x^*_2(y))$, from which one has $w(x,2;y) - w(x,1;y) = w(x,2;y) - (x - \hat{c}(y)) \leq w(x_1^*(y),2;y) - (x_1^*(y) - \hat{c}(y)) = w(x_1^*(y),2;y) - w(x_1^*(y),1;y)$, where the fact that $w(x,1;y) = x - \hat{c}(y)$ for any $x \geq x_1^*(y)$ has been used. Therefore on $(x_1^*(y), x^*_2(y))$
\beq
\label{ineq-4}
w(x,2;y)\leq w(x_1^*(y),2;y)-w(x_1^*(y),1;y)+ w(x,1;y),
\eeq
Also 
$\tfrac{1}{2}\sigma_1^2 w_{xx}(x,1;y)-\rho w(x,1;y) + \lambda_1(w(x,2;y)-w(x,1;y)) = 0,$
for any $x < x^*_1(y)$, and therefore 
\beq
\label{eq:ineq-5}
w(x,2;y) \leq \frac{\rho+\lambda_1}{\lambda_1} w(x,1;y),\quad x < x^*_1(y),
\eeq
by convexity of $w(x,1;y)$ proved in Step \emph{2.} Then, taking limits as $x \uparrow x^*_1(y)$ we get from \eqref{eq:ineq-5} and continuity of $w(\cdot,i;y)$
\beq
\label{eq:ineq-5-bis}
w(x_1^*(y),2;y) \leq \frac{\rho+\lambda_1}{\lambda_1} w(x_1^*(y),1;y),
\eeq
and we conclude from \eqref{ineq-4} and \eqref{eq:ineq-5-bis} that for any $x \in (x_1^*(y), x^*_2(y))$
$$
w(x,2;y)\leq \frac{\rho+\lambda_1}{\lambda_1} w(x^*_1(y),1;y)-w(x^*_1(y),1;y) + w(x,1;y)\leq \frac{\rho+\lambda_1}{\lambda_1}w(x,1;y),
$$
where the fact that $w(x^*_1(y),1;y) = x^*_1(y)-\hat{c}(y) \leq (x-\hat{c}(y)) =w(x,1;y)$ for any $x >  x^*_1(y)$ implies the last step. Hence \eqref{ineq-3} holds on $(x_1^*(y), x^*_2(y))$ and therefore also \eqref{ineq-2} is satisfied on that interval.
\ep

\vspace{0.25cm}

\emph{Proof of Theorem \ref{thm:verifying}}
\vspace{0.15cm}

\emph{Step 1.} Fix $(x,i) \in \mathbb{R} \times \{1,2\}$, let $\tau$ be an arbitrary $\mathbb{P}_{(x,i)}$-a.s.\ finite stopping time, and set $\tau_R:=\inf\{t\geq 0: X_t \notin (-R,R)\}$ $\mathbb{P}_{(x,i)}$-a.s.\ for $R>0$. Given the regularity of $w(\cdot, i;y)$ for any $i=1,2$ (cf.\ Theorem \ref{candidate-w}) It\^o-Tanaka's formula (see, e.g., \cite{RevuzYor}, Chapter VI, Proposition 1.5, Corollary 1.6 and following Remarks) can be applied to get
\begin{eqnarray}
\label{verifico-1}
w(x, i;y) & \hspace{-0.25cm} = \hspace{-0.25cm} & \mathbb{E}_{(x,i)}\bigg[e^{-\rho (\tau\wedge \tau_R)} w(X_{\tau\wedge \tau_R}, \varepsilon_{\tau\wedge \tau_R};y) - \int_0^{\tau\wedge \tau_R}e^{-\rho s}(\mathcal{G}-\rho)w(X_s, \varepsilon_s; y)ds\bigg] \nonumber \\
& \hspace{-0.25cm} \geq \hspace{-0.25cm} & \mathbb{E}_{(x,i)}\Big[e^{-\rho(\tau\wedge \tau_R)} w(X_{\tau\wedge \tau_R},\varepsilon_{\tau\wedge \tau_R}; y)\Big] \geq \mathbb{E}_{(x,i)}\Big[e^{-\rho (\tau\wedge \tau_R)}(X_{\tau \wedge \tau_R}-\hat{c}(y))\Big],
\end{eqnarray}
where we have used that $w$ solves free boundary problem \eqref{FBP-1} (cf.\ Theorem \ref{candidate-w}). If now $\{e^{-\rho (\tau\wedge \tau_R)} X_{\tau \wedge \tau_R},\, R>0\}$ is a $\mathbb{P}_{(x,i)}$-uniformly integrable family, then observing that if $R\uparrow \infty$ one has $\tau \wedge \tau_R \uparrow \tau$ a.s.\ by regularity of $(X,\varepsilon)$ (cf.\ \cite{ZhuYin}, Section 3.1), we can take limits as $R\uparrow \infty$ in \eqref{verifico-1}, invoke Vitali's convergence theorem and obtain 
$$w(x, i;y) \geq \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau}(X_{\tau}-\hat{c}(y))\Big].$$
Since $\tau$ was arbitrary, $ w(x, i ;y)\geq \sup_{\tau \geq 0}\mathbb{E}_{(x,i)}[e^{-\rho \tau}(X_{\tau}-\hat{c}(y))\Big] = u(x,i;y)$.

To conclude this part of the proof it remains to prove that $\{e^{-\rho(\tau\wedge \tau_R)} X_{\tau\wedge \tau_R},\, R>0\}$ is $\mathbb{P}_{(x,i)}$-uniformly integrable. By It\^o's formula we have due to \eqref{dyn:X}
$$e^{-\rho(\tau\wedge \tau_R)} X_{\tau\wedge \tau_R} = x - \int_0^{\tau\wedge \tau_R} \rho e^{-\rho s} X_s ds + \int_0^{\tau\wedge \tau_R} e^{-\rho s} \sigma_{\varepsilon_s} dW_s,$$
from which 
$$\Big|e^{-\rho(\tau\wedge \tau_R)} X_{\tau\wedge \tau_R}\Big| \leq |x| + \int_0^{\infty} \rho e^{-\rho s} |X_s| ds + \Big|\int_0^{\tau\wedge \tau_R} e^{-\rho s} \sigma_{\varepsilon_s} dW_s\Big|.$$
Now, on the one hand by H\"older's inequality and It\^o's isometry one has
\begin{eqnarray}
\label{boundUI-a}
\mathbb{E}_{(x,i)}\bigg[\int_0^{\infty} \rho e^{-\rho s} |X_s| ds\bigg] 
& \hspace{-0.25cm} \leq \hspace{-0.25cm} & |x| + \int_0^{\infty} \rho e^{-\rho s}\mathbb{E}_{(x,i)}\bigg[\Big|\int_0^s \sigma_{\varepsilon_u}dW_u\Big|^2\bigg]^{\frac{1}{2}}\\
& \hspace{-0.25cm} \leq \hspace{-0.25cm} & |x| + (\sigma_1^2 \vee \sigma_2^2)^{\frac{1}{2}}\int_0^{\infty} \rho \sqrt{s} e^{-\rho s} ds < \infty, \nonumber
\nonumber
\end{eqnarray}
for some $K>0$. Hence $\int_0^{\infty} \rho e^{-\rho s} |X_s| ds \in L^1(\Omega, \mathbb{P}_{(x,i)})$.
On the other hand, the continuous martingale $\{\int_0^{t} e^{-\rho s} \sigma_{\varepsilon_s} dW_s,\, t\geq 0\}$ is bounded in $L^2(\Omega, \mathbb{P}_{(x,i)})$ since $\mathbb{E}_{(x,i)}[|\int_0^{t} e^{-\rho s} \sigma_{\varepsilon_s} dW_s|^2] \leq (\sigma_1^2 \vee \sigma_2^2) \int_0^{\infty} e^{-2\rho s} ds$, and therefore (cf.\ \cite{RevuzYor}, Chapter IV, Proposition 1.23)
$$\mathbb{E}_{(x,i)}\bigg[\Big|\int_0^{\tau\wedge \tau_R} e^{-\rho s} \sigma_{\varepsilon_s} dW_s\Big|^2\bigg] = \mathbb{E}_{(x,i)}\bigg[\int_0^{\tau\wedge \tau_R} e^{-2\rho s} \sigma^2_{\varepsilon_s} ds \bigg] \leq (\sigma_1^2 \vee \sigma_2^2) \int_0^{\infty} e^{-2\rho s} ds, \quad R > 0.$$
Hence, the family $\{\big|\int_0^{\tau\wedge \tau_R} e^{-\rho s} \sigma_{\varepsilon_s} dW_s\big|,\, R>0\}$ is bounded in $L^2(\Omega, \mathbb{P}_{(x,i)})$ as well, thus uniformly integrable. This fact, together with \eqref{boundUI-a}, in turn imply uniform integrability of the family $\{e^{-\rho(\tau\wedge \tau_R)} X_{\tau\wedge \tau_R},\, R>0\}$ and complete this part of the proof.
\vspace{+8pt}

\emph{Step 2.} To prove the reverse inequality, i.e.\ $w(x,i;y) \leq u(x,i;y)$, take $\tau=\tau^*$, in the previous rationale and notice that one has $(\mathcal{G}-\rho)w(x, i; y) =0$ on $\mathcal{C}$. Then taking limits as $R\uparrow \infty$ one finds
\begin{eqnarray}
\label{taustar0}
w(x,i;y) &\hspace{-0.25cm} = \hspace{-0.25cm}& \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau^*}w(X_{\tau^*},\varepsilon_{\tau^*}; y)\Big] = \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau^*}(X_{\tau^*}-\hat{c}(y))\Big],
\end{eqnarray}
where the last equality follows from the fact that $\tau^* < +\infty$ $\mathbb{P}_{(x,i)}$-a.s.\ by recurrence of $(X, \varepsilon)$ (cf.\ Theorem 4.4 in \cite{ZhuYin}). Therefore $w(x,i;y) \leq u(x,i;y)$, whence $w(x,i;y) = u(x,i;y)$ and optimality of $\tau^*$.
%To prove the reverse inequality, i.e.\ $w(x,i;y) \leq u(x,i;y)$, take $\tau=\tau^*\wedge n$, $n\in \mathbb{N}$, in the previous rationale and notice that one has $(\mathcal{G}-\rho)w(x, i; y) =0$ on $\mathcal{C}$. Then taking limits as $R\uparrow \infty$ one finds
%\begin{eqnarray}
%\label{taustar0}
%w(x,i;y) &\hspace{-0.25cm} = \hspace{-0.25cm}& \mathbb{E}_{(x,i)}\Big[e^{-\rho (\tau^*\wedge n)}w(X_{\tau^*\wedge n},\varepsilon_{\tau^*\wedge n}; y)\Big] \\
%&\hspace{-0.25cm} = \hspace{-0.25cm}& \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau^*}(X_{\tau^*}-\hat{c}(y))\mathds{1}_{\{\tau^*\leq n\}}\Big] + \mathbb{E}_{(x,i)}\Big[e^{-\rho n}w(X_{n},\varepsilon_{n}; y)\mathds{1}_{\{\tau^* > n\}}\Big]. \nonumber
%\end{eqnarray}
%Employing the sublinear growth of $w(\cdot,i;y)$ (cf.\ Theorem \ref{candidate-w}), H\"older inequality, It\^o's isometry, \eqref{dyn:X} and boundedness of $\sigma(\cdot)$, it is easy to obtain
%\beq
%\label{taustar1}
%\mathbb{E}_{(x,i)}\Big[e^{-\rho n}w(X_{n},\varepsilon_{n}; y)\mathds{1}_{\{\tau^* > n\}}\Big] \leq Ke^{-\rho n}\sqrt{1 + |x|^2 + (\sigma^2(1) \vee \sigma^2(2))n},
%\eeq
%for some $K>0$ independent of $n$. Clearly the right-hand side of \eqref{taustar1} converges to zero as $n\uparrow \infty$. On the other hand one also has
%\beq
%\label{taustar2}
%\lim_{n\uparrow \infty}\mathbb{E}_{(x,i)}\Big[e^{-\rho \tau^*}(X_{\tau^*}-\hat{c}(y))\mathds{1}_{\{\tau^*\leq n\}}\Big] = \mathbb{E}_{(x,i)}\Big[e^{-\rho \tau^*}(X_{\tau^*}-\hat{c}(y))\Big],
%\eeq
%by monotone convergence. Indeed on $\{\omega \in \Omega: \tau^*(\omega)\leq n\}$ one has either $X_{\tau^*(\omega)}(\omega)-\hat{c}(y) = x^*_1(y)-\hat{c}(y)$ or $X_{\tau^*(\omega)}(\omega)-\hat{c}(y)=x^*_2(y)-\hat{c}(y)$, and $x^*_i(y) > \hat{c}(y)$, $i=1,2$. Then taking limits as $n\uparrow \infty$ in \eqref{taustar0} and using \eqref{taustar1} and \eqref{taustar2} yields $w(x,i;y) \leq u(x,i;y)$, whence $w(x,i;y) = u(x,i;y)$ and optimality of $\tau^*$.
\ep

\vspace{0.25cm}

\emph{Proof of Theorem \ref{candidate-w-equal}}
\vspace{0.15cm}

The claimed regularity follows by construction, whereas the growth property can be easily checked from \eqref{eq:candidatevalue1-equal} and \eqref{eq:candidatevalue2-equal}. Moreover, by construction we also have that for any $i=1,2$ $\frac{1}{2}\sigma_i^2 w_{xx}(x,i;y) - \rho w(x,i;y) + \lambda_i\big(w(x,3-i;y) - w(x,i;y)\big) =0$ on $x < x^*(y)$ and $w(x,i;y) = x -\hat{c}(y)$ on $x \geq x^*(y)$.
It thus remains only to check that for any $i=1,2$ \emph{a)} $\frac{1}{2}\sigma_i^2 w_{xx}(x,i;y) - \rho w(x,i;y) + \lambda_i\big(w(x,3-i;y) - w(x,i;y)\big) \leq 0$ on $x > x^*(y)$ and \emph{b)} $w(x,i;y) \geq x -\hat{c}(y)$ on $x < x^*(y)$.

Since on $x > x^*(y)$ one has $w(x,1;y)=x-\hat{c}(y) = w(x,2;y)$, property \emph{a)} above follows by noticing that $x^*(y) \geq \hat{c}(y)$ (cf.\ \eqref{xstar} or equivalently \eqref{xstar2}) and recalling that $\rho>0$.

%As for \emph{b)}, it suffices to show that $w(\cdot,1;y)$ is convex on $x<x^*(y)$. Indeed, if this is true one has $w_x(x,1;y) - 1 \leq 0$ for any $x < x^*(y)$ since $w_x(x^*(y),1;y) - 1 =0$, and therefore that $w(x,1;y) \geq x - \hat{c}(y)$ for $x < x^*(y)$, because $w(x^*(y),1;y) - (x^*(y)-\hat{c}(y)) = 0$. 
As for \emph{b)}, it suffices to show that $w_x(x,i;y) - 1 \leq 0$ for any $x < x^*(y)$ since $w(x^*(y),i;y) - (x^*(y) - \hat{c}(y)) =0$.
To this end define $\widehat{w}(x,i;y):= w(x,i;y) - (x - \hat{c}(y))$, $i=1,2$, and notice that we can differentiate once more the first of \eqref{FBP-equal} with respect to $x$ inside $(-\infty, x^*(y))$ to obtain
$$
\frac{1}{2}\sigma_i^2\widehat{w}_{xxx}(x,i;y) + \lambda_i (\widehat{w}_x(x,3-i;y) - \widehat{w}_x(x,i;y) ) - \rho\widehat{w}_x(x,i;y) =\rho.
$$
Then an argument based on Dynkin's formula as that employed in Step \emph{4.}\ of the proof of Theorem \ref{candidate-w} yields $\widehat{w}_{x}(x,i;y) \leq 0$ for any $x < x^*(y)$, which in turn gives $w(x,i;y) \geq x-\hat{c}(y)$ for any $x < x^*(y)$, because $w(x^*(y),i;y) = x^*(y)-\hat{c}(y)$.
%Moreover, convexity of $w(\cdot,1;y)$ also suffices to show that $w(x,2;y) \geq x - \hat{c}(y)$ for $x < x^*(y)$. To see this, define $\widehat{w}(x,i;y):= w(x,i;y) - (x - \hat{c}(y))$, $i=1,2$, and notice that for $x \in (-\infty, x^*(y))$ one has
%$$
%\frac{1}{2}\sigma^2(2)\widehat{w}_{xxx}(x,2;y)-(\rho+\lambda_2)\widehat{w}_x(x,2;y)=-\lambda_2 \widehat{w}_x(x,1;y)+\rho.
%$$
%Now convexity of $w(\cdot,1;y)$ and $w_x(x^*(y),1;y) - 1 =0$ imply $\widehat{w}_x(x,1;y) = {w}_x(x,1;y) - 1 \leq 0$ on $x \in (-\infty, x^*(y))$, and we can write
%$$
%\frac{1}{2}\sigma^2(2)\widehat{w}_{xxx}(x,2;y)-(\rho+\lambda_2)\widehat{w}_x(x,2;y) \geq 0, \quad x<x^*(y).
%$$
%Then the maximum principle and $\widehat{w}_{x}(x^*(y),2;y) = 0$ yield $\widehat{w}_{x}(x,2;y) \leq 0$ for any $x < x^*(y)$, which in turn gives $w(x,2;y) \geq x-\hat{c}(y)$ for any $x < x^*(y)$, because $w(x^*(y),2;y) = x^*(y)-\hat{c}(y)$.
%
%To complete the proof it thus remains to prove convexity of $w(\cdot,1;y)$ and to this end we proceed similary to Step \emph{2.}\ in the proof of Theorem \ref{candidate-w}. By direct calculations one obtains from \eqref{eq:candidatevalue1-equal}
%\beq
%\label{w1convex-1-equal}
%w_{xx}(x,1;y)(\alpha_4-\alpha_3)=\alpha_3^2(\alpha_4(x^*(y)-\hat{c}(y))-1)e^{\alpha_3(x-x^*(y))}
%+\alpha_4^2(1-\alpha_3(x^*(y)-\hat{c}(y)))e^{\alpha_4(x-x^*(y))}.
%\eeq
%Moreover, it is easy to see that
%\begin{equation*}
%\label{w1convex-3-equal}
%\alpha_3^2(\alpha_4(x^*(y)-\hat{c}(y))-1) +\alpha_4^2(1-\alpha_3(x^*(y)-\hat{c}(y)))=(\alpha_4-\alpha_3)\Big[\alpha_4+\alpha_3-\alpha_3\alpha_4(x^*(y)-\hat{c}(y))\Big] \geq 0,
%\end{equation*}
%where the last inequality follows by the fact that $x^*(y)-\hat{c}(y) \leq (\alpha_3 + \alpha_4)/\alpha_3\alpha_4$ by \eqref{xstar}. Therefore
%$$\alpha_4^2(1-\alpha_3(x^*(y)-\hat{c}(y))) \geq - \alpha_3^2(\alpha_4(x^*(y)-\hat{c}(y))-1),$$
%which substituted into \eqref{w1convex-1-equal} yields
%\beq
%\label{w1convex-4-equal}
%w_{xx}(x,1;y)(\alpha_4-\alpha_3) \geq \alpha_3^2(\alpha_4(x^*(y)-\hat{c}(y))-1)\Big[e^{\alpha_3(x-x^*(y))}
%-e^{\alpha_4(x-x^*(y))}\Big] \geq 0,
%\eeq
%where the fact that $\alpha_3 < \alpha_4$ but $x<x^*(y)$ have been used in the last step.
\ep



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{An Auxiliary Result}
\label{Some Auxiliary Results}
\label{app}
\renewcommand{\theequation}{B-\arabic{equation}}

\begin{lemma}
\label{lemm:valuesai}
Let $a_i$, $i=1,2,3,4$, be defined as in \eqref{a1-a4}. Then one has $a_1 < 0$, $a_2>0$, $a_3 < 0$ and $a_4>0$.
\end{lemma}  
\begin{proof}
Noticing that $\Phi_i(\alpha)=-\frac{1}{2}\sigma_i^2 \alpha^2+\rho+\lambda_i$, $i=1,2$, is a strictly decreasing function of $\alpha$,  the fact that $\alpha_3 < \alpha_4$ imply $a_2>0$ and $a_3<0$.

As for $a_1$, recall that from \eqref{a1-a4} one has
\beq
\label{a1}
a_1=-\frac{\alpha_4\Phi_1(\alpha_3)-\alpha_3\Phi_1(\alpha_4)}{\lambda_1(\alpha_4-\alpha_3)}
+\frac{\rho}{\rho+\lambda_2}.
\eeq
By using the explicit expression of $\Phi_i(\alpha)$, $i=1,2$, direct calculations lead to
\begin{equation*}
\alpha_4\Phi_1(\alpha_3)-\alpha_3\Phi_1(\alpha_4)=
\Big(\frac{1}{2}\sigma_1^2\alpha_3\alpha_4+\rho+\lambda_1\Big)(\alpha_4-\alpha_3),
\end{equation*}
which substituted into \eqref{a1} yields
$$a_1=-\frac{\frac{1}{2}\sigma_1^2\alpha_3\alpha_4+\rho+\lambda_1}{\lambda_1} + \frac{\rho}{\rho+\lambda_2} < -\frac{\frac{1}{2}\sigma_1^2\alpha_3\alpha_4+\rho}{\lambda_1}<0.$$

We conclude showing that $a_4>0$. It is matter of simple algebra to show that
$$\alpha_3\Phi_1(\alpha_3)-\alpha_4\Phi_1(\alpha_4)=
(\alpha_4-\alpha_3)\Big[\frac{1}{2}\sigma_1^2(\alpha_3\alpha_4+\alpha_3^2+\alpha_4^2)-(\rho + \lambda_1)\Big],$$
which used in the expression for $a_4$ of \eqref{a1-a4} allows to write
\beq
\label{a4}
a_4=\frac{\frac{1}{2}\sigma_1^2(\alpha_3\alpha_4+\alpha_3^2+\alpha_4^2)-(\rho +\lambda_1)}{\lambda_1}
+\frac{\lambda_2}{\rho+\lambda_2}.
\eeq
Since $\alpha_3$ and $\alpha_4$ solve $\Phi_1(\alpha)\Phi_2(\alpha)=\lambda_1\lambda_2$, by Vieta's formulas we deduce that
\beq
\label{Vietaalpha34}
\alpha_3^2+\alpha_4^2=\frac{2\sigma_1^2(\rho+\lambda_2)+2\sigma_2^2
(\rho+\lambda_1)}{\sigma_1^2\sigma_2^2}.
\eeq
Noticing that $\alpha_3\alpha_4>0$, and using \eqref{Vietaalpha34} in \eqref{a4} we obtain
$$a_4>\frac{\frac{1}{2}\sigma_1^2(\alpha_3^2+\alpha_4^2)- (\rho +\lambda_1)}{\lambda_1}
>\frac{1}{\lambda_1}\Big[\frac{\sigma_1^2\sigma_2^2
(\rho+\lambda_1)}{\sigma_1^2\sigma_2^2}- (\rho + \lambda_1)\Big]=0,$$
thus completing the proof.
\end{proof}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\begin{lemma}
%\label{lemma:UI}
%For any $\nu \in \mathcal{A}_y$ the processes
%$$\bigg\{\int_0^t e^{-\rho u}(X_u-c)d\nu_u,\,t\geq 0\bigg\}\quad \text{and}\quad\bigg\{\int_0^t e^{-\rho u}f(Y^{\nu}_u)du,\,t\geq 0\bigg\}$$ are $\mathbb{P}_{(x,y,i)}$-uniformly integrable.
%\end{lemma}
%\begin{proof}
%We start proving uniformly integrability of the first process by showing that it is uniformly bounded in $L^2(\Omega,\mathbb{P}_{(x,y,i)})$. Fix $t\geq 0$, take any $\nu\in \mathcal{A}_y$, and notice that an integration by parts leads to
%\beq
%\label{UI-1}
%\int_0^t e^{-\rho u}(X_u -c)d\nu_u = e^{-\rho t}(X_t -c)\nu_t +  \int_0^t \rho e^{-\rho u}(X_u -c)\nu_u du - \int_0^t e^{-\rho u} \nu_u\sigma_{\varepsilon_u}dW_u,
%\eeq
%where \eqref{dyn:X} has been employed. Denoting by $K>0$ a suitable constant possibly depending on $x$, but not on $t$, and that may change from line to line, we get from \eqref{UI-1}
%\begin{eqnarray}
%\label{UI-2}
%&& \Big|\int_0^t e^{-\rho u}(X_u -c)d\nu_u\Big|^2 \leq K\Big[ e^{-2\rho t}|X_t -c|^2 + \Big(\int_0^t \rho e^{-\rho u}|X_u -c|du\Big)^2  \nonumber \\
%&& + \Big|\int_0^t e^{-\rho u} \nu_u\sigma_{\varepsilon_u}dW_u\Big|^2\Big] \leq K\Big[ 1 + e^{-2\rho t}|X_t|^2 + \int_0^{\infty} \rho e^{-\rho u}|X_u|^2 du + \Big|\int_0^t e^{-\rho u} \nu_u\sigma_{\varepsilon_u}dW_u\Big|^2\Big] \nonumber \\
%&& \leq K\Big[ 1 + e^{-2\rho t}\Big|\int_0^t\sigma_{\varepsilon_u}dW_u\Big|^2 + \int_0^{\infty} \rho e^{-\rho u}\Big|\int_0^u e^{-\rho s} \sigma_{\varepsilon_s}dW_s\Big|^2 du  \\
%&& + \Big|\int_0^t e^{-\rho u} \nu_u\sigma_{\varepsilon_u}dW_u\Big|^2\Big],\nonumber 
%\end{eqnarray}
%where Jensen's inequality has been used in the second step for the integral with respect to $\rho e^{-\rho u}du$, whereas the last step employs \eqref{dyn:X}. Taking expectations in \eqref{UI-2}, using It\^o's isometry, noticing that $\sigma_{\varepsilon_t}^2 \leq \sigma_1^2 \vee \sigma_2^2$ a.s.\ and that any admissible control is bounded by one, we obtain 
%\begin{eqnarray}
%\label{UI-3}
%&& \mathbb{E}_{(x,y,i)}\bigg[\Big|\int_0^t e^{-\rho u}(X_u -c)d\nu_u\Big|^2\bigg] \leq K\Big[ 1 + (\sigma_1^2 \vee \sigma_2^2)\Big( 1 + t e^{-2\rho t} + \int_0^{\infty} \rho e^{-\rho u} u du\Big)\Big] \nonumber \\
%&& \leq K\Big[ 1 + (\sigma_1^2 \vee \sigma_2^2)\Big( 1 + \sup_{t\geq 0}\Big(t e^{-2\rho t}\Big) + \int_0^{\infty} \rho e^{-\rho u} u du\Big)\Big], 
%\end{eqnarray}
%which in turn proves the first claim.
%
%Uniformly integrability of the second process follows by noticing that for any $t\geq 0$ and any $\nu \in \mathcal{A}_y$ we have
%$$0 \leq \int_0^t e^{-\rho u}f(Y^{\nu}_u)du  \leq \int_0^t e^{-\rho u}f(1)du \leq \frac{f(1)}{\rho},$$
%where the fact that $f(\cdot)$ is increasing and that $Y^{\nu}_t \leq 1$ a.s.\ have been used.
%\end{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{thebibliography}{199}


\bibitem{Insley1} \textsc{Almansour, A., Insley, M.}\ (2016). The Impact of Stochastic Extraction Cost on the Value of an Exhaustible Resource: An Application to the Alberta Oil Sands. \textsl{Energy J.}\ \textbf{37(2)}.

\bibitem{Alvarez01} \textsc{Alvarez, L.H.R.}\ (1999). Singular Stochastic Control, Linear Diffusions, and Optimal Stopping: a Class of Solvable Problems. \textsl{SIAM J.~Control Optim.}\ \textbf{39(6)} 1697--1710.

\bibitem{Bachelier}\textsc{Bachelier, L.}\ $(1900)$. Theorie de la Sp\'{e}culation. \textsl{Annales scientifiques de l'\'{E}cole Normale Sup\'{e}rieure S\'{e}r.\ 3} \textbf{17}, pp.\ 21--86. 

\bibitem{KaratzasBaldursson}\textsc{Baldursson, F.M., Karatzas, I.}\ $(1997)$. Irreversible Investment and Industry Equilibrium. \textsl{Finance Stoch.} \textbf{1} 69--89.

\bibitem{Bensoussanetal}\textsc{Bensoussan, A., Yan, Z.F., Yin, G.}\ $(2012)$. Threshold-Type Policies for Real Options Using Regime-switching Models. \textsl{SIAM J.\ Financ.\ Math.} \textbf{3} 667--689.

\bibitem{Benth}\textsc{Benth, F.E., Reikvam, K.}\ $(2004)$. A Connection between Singular Stochastic Control and Optimal Stopping. \textsl{Appl.~Math.~Optim.} \textbf{49}  27--41.

\bibitem{BrekkeOksendal} \textsc{Brekke, K.A., \O ksendal, B.}\ (1994). Optimal Switching in an Economic Activity under Uncertainty. \textsl{SIAM J.~Control Optim.}\ \textbf{32(4)} 1021--1036.

\bibitem{BrennanSchwartz}\textsc{Brennan, M.J., Schwartz, E.S.}\ $(1985)$. Evaluation of Natural Resource Investments. \textsl{J.\ Bus.}\ \textbf{58}  135--157.

\bibitem{Buffington}\textsc{Buffington, J., Elliott, R.J.}\ $(2002)$. American Options with Regime Switching. \textsl{Int.\ J.\ Theor.\ Appl.\ Finance}\ \textbf{5}  497--514.

\bibitem{DeAFeMo15}\textsc{De Angelis, T., Ferrari, G., Moriarty, J.}\ $(2015)$. A Non Convex Singular Stochastic Control Problem and its Related Optimal Stopping Boundaries. \textsl{SIAM J.~Control Optim.}\ \textbf{53(3)} 1199--1223.

\bibitem{DM}\textsc{Dellacherie, C., Meyer, P.}\ $(1978)$. \textsl{Probabilities and Potential. Chapters I--IV}. North-Holland Mathematics Studies \textbf{29}.

\bibitem{DixitPindyck}\textsc{Dixit, A.K., Pindyck, R.S.}\ $(1994)$. \textsl{Investment under Uncertainty}. Princeton University Press. Princeton.

\bibitem{Fenton} \textsc{Fenton, C.P., Nance, P.K.}\ (2011). Subzero Commodity Prices: Why Commodity Prices Fall Through the Zero Bound and Where and How it Could Happen in 2011. \textsl{J.P.\ Morgan Global Commodities Research, February 2011}. Available at SSRN: http://ssrn.com/abstract=1922787.

\bibitem{Feliz} \textsc{Feliz, R.A.}\ (1993). The Optimal Extraction Rate of a Natural Resource under Uncertainty. \textsl{Econ.\ Lett.}\ \textbf{43} 231--234. 

\bibitem{FlemingSoner} \textsc{Fleming, W.H., Soner, H. M.}\ (2006). \textsl{Controlled Markov Processes and Viscosity Solutions}, Springer-Verlag.

\bibitem{Guo01} \textsc{Guo, X.}\ $(2001)$. An Explicit Solution to an Optimal Stopping Problem with Regime Switching. \textsl{J.\ Appl.\ Probab.}\ \textbf{38} 464--481.

\bibitem{GuoZhang} \textsc{Guo, X., Zhang, Q.}\ $(2004)$. Closed-Form Solutions for Perpetual American Put Options with Regime Switching. \textsl{SIAM J.\ Appl.\ Math.}\ \textbf{64(6)} 2034--2049.

\bibitem{Guoetal} \textsc{Guo, X., Miao, J.J, Morellec, E.}\ $(2005)$. Irreversible Investment with Regime Shifts. \textsl{J.\ Econ.\ Theory}\ \textbf{122(1)} 37--59.

%\bibitem{GuoZervos}\textsc{Guo, X., Zervos, M.}\ (2015). {Optimal Execution with Multiplicative Price Impact}. \textsl{SIAM J.~Financial Math.}~\textbf{6} 281--306.

\bibitem{Hamilton} \textsc{Hamilton, J.}\ (1989). A New Approach to the Analysis of Non-Stationary Time Series and the Business
Cycle. \textsl{Econometrica} \textbf{57} 357--384.

\bibitem{Insley2} \textsc{Insley, M.}\ (2015). On the Timing of Non-Renewable Resource Extraction with Regime Switching Prices: an Optimal Stochastic Control Approach. Available at SSRN: http://ssrn.com/abstract=2311752.

\bibitem{LumleyZervos} \textsc{Lumley, R.R., Zervos, M.}\ $(2001)$. A Model for Investments in the Natural Resource Industry with Switching Costs. \textsl{Math.\ Oper.\ Res.}\ \textbf{26(4)} 637--653.

\bibitem{Pistorius}\textsc{Jiang, Z., Pistorius, M.}\ (2012). Optimal Dividend Distribution under Markov Regime Switching. \textsl{Finance Stoch.}\ \textbf{16} 449--476.

\bibitem{Jiang}\textsc{Jiang, Z.}\ (2015). Optimal Dividend Policy when Cash Reserves Follow a Jump-Diffusion Process under Markov-Regime Switching. \textsl{J.\ Appl.\ Probab.}\ \textbf{52(1)} 209--223.

\bibitem{PeskShir}\textsc{Peskir, G., Shiryaev, A.}\ (2006). \textsl{Optimal Stopping and Free-Boundary Problems}. Lectures in Mathematics ETH, Birkhauser.

%\bibitem{Pham} \textsc{Pham, H.}\ (2009). \textsl{Continuous-time Stochastic Control and Optimization with Financial Applications}. Springer-Verlag. Berlin.

\bibitem{RevuzYor} \textsc{Revuz, D., Yor, M.}\ (1999). \textsl{Continuous Martingales and Brownian Motion}. Springer-Verlag. Berlin.

\bibitem{Shreve88} \textsc{Shreve S.}~(1988). \textsl{An Introduction to Singular Stochastic Control}, in {Stochastic Differential Systems, Stochastic Control Theory and Apoplications}, IMA Vol.\ 10, W.\ Fleming and P.-L.\ Lions, ed.\ Springer-Verlag, New York.

\bibitem{CadSot}\textsc{Sotomayor, L.R., Cadenillas, A.}\ $(2011)$. Classical and Singular Stochastic Control for the Optimal Dividend Policy when there is Regime Switching. \textsl{Ins.\ Math.\ Econ.}\ \textbf{48} 344--354.

\bibitem{Trigeorgis}\textsc{Trigeorgis, L.}\ $(1996)$. \textsl{Real Options: Managerial Flexibility and Strategy in Resource Allocations}, MIT Press.

\bibitem{ZhangZhu}\textsc{Zhang, Q., Zhu, X.Y.}\ (2009). Valuation of Stock Loan with Regime Switching. \textsl{SIAM J.~Control Optim.} \textbf{48(3)} 1229--1250.

\bibitem{ZhuYin}\textsc{Zhu, C., Yin, G.}\ $(2009)$. On Strong Feller, Recurrence, and Weak Stabilization of Regime-Switching Diffusions. \textsl{SIAM J.~Control Optim.} \textbf{48(3)} 2003--2031.

\end{thebibliography}
\end{document} 

1602.06765.extracted_bib
{Insley1 \textsc{Almansour, A., Insley, M.\ (2016). The Impact of Stochastic Extraction Cost on the Value of an Exhaustible Resource: An Application to the Alberta Oil Sands. \textsl{Energy J.\ 37(2).
1602.06765.extracted_bib
{Alvarez01 \textsc{Alvarez, L.H.R.\ (1999). Singular Stochastic Control, Linear Diffusions, and Optimal Stopping: a Class of Solvable Problems. \textsl{SIAM J.~Control Optim.\ 39(6) 1697--1710.
1602.06765.extracted_bib
{Bachelier\textsc{Bachelier, L.\ $(1900)$. Theorie de la Sp\'{eculation. \textsl{Annales scientifiques de l'\'{Ecole Normale Sup\'{erieure S\'{er.\ 3 17, pp.\ 21--86.
1602.06765.extracted_bib
{KaratzasBaldursson\textsc{Baldursson, F.M., Karatzas, I.\ $(1997)$. Irreversible Investment and Industry Equilibrium. \textsl{Finance Stoch. 1 69--89.
1602.06765.extracted_bib
{Bensoussanetal\textsc{Bensoussan, A., Yan, Z.F., Yin, G.\ $(2012)$. Threshold-Type Policies for Real Options Using Regime-switching Models. \textsl{SIAM J.\ Financ.\ Math. 3 667--689.
1602.06765.extracted_bib
{Benth\textsc{Benth, F.E., Reikvam, K.\ $(2004)$. A Connection between Singular Stochastic Control and Optimal Stopping. \textsl{Appl.~Math.~Optim. 49 27--41.
1602.06765.extracted_bib
{BrekkeOksendal \textsc{Brekke, K.A., \O ksendal, B.\ (1994). Optimal Switching in an Economic Activity under Uncertainty. \textsl{SIAM J.~Control Optim.\ 32(4) 1021--1036.
1602.06765.extracted_bib
{BrennanSchwartz\textsc{Brennan, M.J., Schwartz, E.S.\ $(1985)$. Evaluation of Natural Resource Investments. \textsl{J.\ Bus.\ 58 135--157.
1602.06765.extracted_bib
{Buffington\textsc{Buffington, J., Elliott, R.J.\ $(2002)$. American Options with Regime Switching. \textsl{Int.\ J.\ Theor.\ Appl.\ Finance\ 5 497--514.
1602.06765.extracted_bib
{DeAFeMo15\textsc{De Angelis, T., Ferrari, G., Moriarty, J.\ $(2015)$. A Non Convex Singular Stochastic Control Problem and its Related Optimal Stopping Boundaries. \textsl{SIAM J.~Control Optim.\ 53(3) 1199--1223.
1602.06765.extracted_bib
{DM\textsc{Dellacherie, C., Meyer, P.\ $(1978)$. \textsl{Probabilities and Potential. Chapters I--IV. North-Holland Mathematics Studies 29.
1602.06765.extracted_bib
{DixitPindyck\textsc{Dixit, A.K., Pindyck, R.S.\ $(1994)$. \textsl{Investment under Uncertainty. Princeton University Press. Princeton.
1602.06765.extracted_bib
{Fenton \textsc{Fenton, C.P., Nance, P.K.\ (2011). Subzero Commodity Prices: Why Commodity Prices Fall Through the Zero Bound and Where and How it Could Happen in 2011. \textsl{J.P.\ Morgan Global Commodities Research, February 2011. Available at SSRN: http://ssrn.com/abstract=1922787.
1602.06765.extracted_bib
{Feliz \textsc{Feliz, R.A.\ (1993). The Optimal Extraction Rate of a Natural Resource under Uncertainty. \textsl{Econ.\ Lett.\ 43 231--234.
1602.06765.extracted_bib
{FlemingSoner \textsc{Fleming, W.H., Soner, H. M.\ (2006). \textsl{Controlled Markov Processes and Viscosity Solutions, Springer-Verlag.
1602.06765.extracted_bib
{Guo01 \textsc{Guo, X.\ $(2001)$. An Explicit Solution to an Optimal Stopping Problem with Regime Switching. \textsl{J.\ Appl.\ Probab.\ 38 464--481.
1602.06765.extracted_bib
{GuoZhang \textsc{Guo, X., Zhang, Q.\ $(2004)$. Closed-Form Solutions for Perpetual American Put Options with Regime Switching. \textsl{SIAM J.\ Appl.\ Math.\ 64(6) 2034--2049.
1602.06765.extracted_bib
{Guoetal \textsc{Guo, X., Miao, J.J, Morellec, E.\ $(2005)$. Irreversible Investment with Regime Shifts. \textsl{J.\ Econ.\ Theory\ 122(1) 37--59. %
1602.06765.extracted_bib
{GuoZervos\textsc{Guo, X., Zervos, M.\ (2015). {Optimal Execution with Multiplicative Price Impact. \textsl{SIAM J.~Financial Math.~6 281--306.
1602.06765.extracted_bib
{Hamilton \textsc{Hamilton, J.\ (1989). A New Approach to the Analysis of Non-Stationary Time Series and the Business Cycle. \textsl{Econometrica 57 357--384.
1602.06765.extracted_bib
{Insley2 \textsc{Insley, M.\ (2015). On the Timing of Non-Renewable Resource Extraction with Regime Switching Prices: an Optimal Stochastic Control Approach. Available at SSRN: http://ssrn.com/abstract=2311752.
1602.06765.extracted_bib
{LumleyZervos \textsc{Lumley, R.R., Zervos, M.\ $(2001)$. A Model for Investments in the Natural Resource Industry with Switching Costs. \textsl{Math.\ Oper.\ Res.\ 26(4) 637--653.
1602.06765.extracted_bib
{Pistorius\textsc{Jiang, Z., Pistorius, M.\ (2012). Optimal Dividend Distribution under Markov Regime Switching. \textsl{Finance Stoch.\ 16 449--476.
1602.06765.extracted_bib
{Jiang\textsc{Jiang, Z.\ (2015). Optimal Dividend Policy when Cash Reserves Follow a Jump-Diffusion Process under Markov-Regime Switching. \textsl{J.\ Appl.\ Probab.\ 52(1) 209--223.
1602.06765.extracted_bib
{PeskShir\textsc{Peskir, G., Shiryaev, A.\ (2006). \textsl{Optimal Stopping and Free-Boundary Problems. Lectures in Mathematics ETH, Birkhauser. %
1602.06765.extracted_bib
{Pham \textsc{Pham, H.\ (2009). \textsl{Continuous-time Stochastic Control and Optimization with Financial Applications. Springer-Verlag. Berlin.
1602.06765.extracted_bib
{RevuzYor \textsc{Revuz, D., Yor, M.\ (1999). \textsl{Continuous Martingales and Brownian Motion. Springer-Verlag. Berlin.
1602.06765.extracted_bib
{Shreve88 \textsc{Shreve S.~(1988). \textsl{An Introduction to Singular Stochastic Control, in {Stochastic Differential Systems, Stochastic Control Theory and Apoplications, IMA Vol.\ 10, W.\ Fleming and P.-L.\ Lions, ed.\ Springer-Verlag, New York.
1602.06765.extracted_bib
{CadSot\textsc{Sotomayor, L.R., Cadenillas, A.\ $(2011)$. Classical and Singular Stochastic Control for the Optimal Dividend Policy when there is Regime Switching. \textsl{Ins.\ Math.\ Econ.\ 48 344--354.
1602.06765.extracted_bib
{Trigeorgis\textsc{Trigeorgis, L.\ $(1996)$. \textsl{Real Options: Managerial Flexibility and Strategy in Resource Allocations, MIT Press.
1602.06765.extracted_bib
{ZhangZhu\textsc{Zhang, Q., Zhu, X.Y.\ (2009). Valuation of Stock Loan with Regime Switching. \textsl{SIAM J.~Control Optim. 48(3) 1229--1250.
1602.06765.extracted_bib
{ZhuYin\textsc{Zhu, C., Yin, G.\ $(2009)$. On Strong Feller, Recurrence, and Weak Stabilization of Regime-Switching Diffusions. \textsl{SIAM J.~Control Optim. 48(3) 2003--2031.