A dual-context sequent calculus for the constructive modal logic S4

Abstract The proof theory of the constructive modal logic S4 (hereafter 
$\mathsf{CS4}$
 ) has been settled since the beginning of this century by means of either standard natural deduction and sequent calculi or by the reconstruction of modal logic through hypothetical and categorical judgments à la Martin-Löf, an approach carried out by using a special kind of sequents, which keeps two separated contexts representing ordinary and enhanced hypotheses, intuitively interpreted as true and valid assumptions. These so-called dual-context sequents, originated in linear logic, are used to define a natural deduction system handling judgments of validity, truth, and possibility, resulting in a formalism equivalent to an axiomatic system for 
$\mathsf{CS4}$
 . However, this proof-theoretical study of 
$\mathsf{CS4}$
 lacks, to the best of our knowledge, its third fundamental constituent, namely a sequent calculus. In this paper, we define such a dual-context formalism, called 
${\bf DG_{CS4}}$
 , and provide detailed proofs of the admissibility for the ordinary cut rule as well as the elimination of a second cut rule, which manipulates enhanced hypotheses. Furthermore, we make available a formal verification of the equivalence of this proposal with the previously defined axiomatic and dual-context natural deduction systems for 
$\mathsf{CS4}$
 , using the Coq proof-assistant.


Introduction
Modal logics, whose origin can be traced back to Aristotle's philosophical investigations about the truth of a proposition, have today several applications in different areas gained from distinct interpretations of the and ♦ modalities, dissimilar from the original readings as necessity and possibility. For instance, various type systems for concurrent and distributed computations (López et al. 2005;Murphy VII et al. 2004) employ modalities and a modal lambda calculus has been proposed to model information flow in computer networks (Borghuis and Feijs 2000). In Artificial Intelligence (AI), they are useful to model ontologies or knowledge structures, as well as for verifying agent-based computer systems, or in Philosophy, in the representation of concrete cases in modal argumentation theory, where the operator usually represents the argument attack relation (Boella et al. 2006;Grossi 2011).
The most widely studied modal logics are those based on classical reasoning where the duality principle A ↔ ¬♦¬A holds. When this principle is rejected, we land on the realm of nonclassical modal logics. Although it is worth noting that there are non-classical logics where this duality principle still holds, like Lukasiewicz description logics (see Bobillo et al. 2015). However, to be more precise certain choices have to be made. For instance, the intuitionistic modal logics Fischer-Servi (1977), Plotkin and Stirling (1986) and Simpson (1994), are designed in order to obtain classical modal logics by adding the excluded middle axiom, and the constructive modal logics Alechina et al. (2001), Bierman and de Paiva (2000), and Wijesekera (1990) reject the ♦-distributivity axioms: ♦(A ∨ B) → ♦A ∨ ♦B and ¬♦⊥. This last family has proved its relevance in computer science applications, for instance in concurrent and distributed programming (Moody 2004), hardware verification (Fairtlough and Mendler 1997) and programming languages semantics (Kobayashi 1997).
The proof theory of modal logics has developed mainly in two directions: on one hand Labeled Deduction Systems (Gabbay 2014;Negri 2011;Viganò 2000) which internalize the semantical approach within the syntax by means of relational atoms and labeled formulas corresponding to the forcing relation of the Kripke semantics and that are required to obey the usual features of traditional systems; on the other hand the search for pure, that is label-free, natural deduction or sequent calculi to capture modal logics has lead to the development of sophisticated formalisms like higher-arity or display calculi based on generalizations of Gentzen's ordinary sequents: nested sequents, (tree-)hypersequents, etc. (see Indrzejczak 2010 for natural deduction modal systems and Poggiolesi 2010 for an overview of modal sequent calculi systems). In the case of the constructive modal logic S4, its proof theory, by means of ordinary sequent systems, is well established (Bierman and de Paiva 2000). Moreover, an alternative approach, having important applications in computer science Moody 2004), based on the judgmental reconstruction of modal logic was proposed in Pfenning and Davies (2001), an approach that follows the constructive philosophy of Martin-Löf (1996) by means of hypothetical and categorical judgments. This aim is realized by means of dual-context sequents, originated in linear logic (Barber and Plotkin 1997), of the form | A distinguishing between ordinary hypotheses belonging to and enhanced hypotheses contained in . These qualifiers can be interpreted in different ways, for instance as propositional and necessary (of the form A) hypotheses. However, as we will see, this intuitive interpretation is not enforced by the syntax. Dual-context systems have been further studied in several works. For instance, Kavvos (2020) discusses natural deduction systems and lambda calculi for several logics including the necessity fragment of S4 and the logic of provability GL; Heilala and Pientka (2007a) present a focused sequent calculus capturing the normal natural deductions of S4 and Nanevski et al. (2008) provides a contextual modal type theory which relativizes the notion of validity with respect to arbitrary contexts. Moreover, we ourselves (González- Huesca et al. 2019;González Huesca et al. 2020) have formally verified the equivalence of the natural deduction systems for constructive S4 of Pfenning and Davies (2001) with their Hilbert-style counterparts by means of the state-of-the-art COQ proof-assistant, such equivalence was not discussed previously in detail, except for the necessity fragment in Kavvos (2020). Further, in Miranda-Perea et al. (2020 we define a sequent calculus suitable for humanguided interactive proof-search in the necessity fragment of S4. It is worth noting that here, following the lines of all the above mentioned works on dual-context systems for constructive S4, we deal only with the positive fragment of S4, that is neither the constant of falsity ⊥ nor a negation operator are present. In this paper, we contribute to the proof theory of constructive modal logics by presenting a cut-free dual-context sequent calculus for CS4, called DG CS4 , which features two sets of left rules, one for each context, and results equivalent to the judgmental reconstruction of modal logic with the advantage of not requiring the explicit use of the judgments of validity, truth, or possibility. To the best of our knowledge, the literature lacks of such formalism, whose conception is already mentioned in Pfenning and Davies (2001). We discuss in detail the cut admissibility and elimination of the two cut rules for this calculus, together with the equivalence with its axiomatic and natural deduction counterparts, thus completing the definition of the three styles of deductive systems for the case of CS4. As a companion, we provide a formal verification of the systems discussed in this paper and their equivalence, developed in the COQ proof-assistant, available in https:// bitbucket.org/luglzhuesca/mlogic-formalverif/src/master/DCS4/ We leave the full mechanization of cut elimination as a future work, since it constitutes an independent challenge that requires considerable additional effort consisting in automatizing at least 361 cases for each cut theorem, obtained by all possible combinations of rules deriving the premises of the cut rule, in a way corresponding to the succinct case analysis provided in our proofs of theorems in Section 7 (see Pfenning 2000 for a related endeavor). It is not our intention to explain here the companion formal verification; nevertheless, within the paper we present some results required for this task. In particular, we give some definitions and structural rules as implemented in our COQ development and follow a train-of-thought that eases the understanding of the implementation when compared with the paper definitions and proofs.
The paper is organized as follows: an axiomatic system featuring single contexts is presented in Section 3. The original judgmental reconstruction of modal logic by means of a dual-context natural deduction system is exposed in Section 4. In Section 5, we define a judgment-free natural deduction system that will serve as a bridge for the equivalence with our sequent calculus DG CS4 , which will be introduced in Section 6. The cut admissibility and elimination theorems are detailed in Section 7. The equivalence of all systems in this paper will be proved in Section 8. We close the paper by giving some final remarks in Section 9.
Let us start by reviewing some important definitions about syntax.

Formulas and Contexts
We dedicate this brief section to set up the important syntactic notions that accompany the rest of the work, namely formulas and contexts. Modal formulas are generated by the following grammar: where p n denotes an element taken from an infinite supply of propositional variables, indexed by a natural number. Let us observe that we consider neither negation nor the constant ⊥. Thus, we will be dealing with modal logic obtained from minimal propositional logic with all connectives, extended with the modal operators of necessity and possibility. All systems in this work are presented in sequent style and therefore it is adequate to state precisely what kind of contexts we will use. Following the original paper introducing dual-context systems for modal logic , contexts are implemented as finite lists of formulas built from the empty list, denoted here by ·, and a constructor that generates a new list from a given one by adding a new element to its right-end. This choice is also the data structure employed for the development of companion formal verification. Finite lists are formally defined as follows: The operation L, A is usually called snoc. Furthermore, the append operation of two lists L and L , denoted with a semicolon L; L , is recursively defined as L; · = L and L; (L , A) = (L; L ), A. These definitions allow us to prove several useful properties by induction on contexts.
Lemma 1 (Snoc lists properties). The following properties hold: • For all A, L, if A ∈ L then there are L 1 , L 2 such that L = L 1 , A; L 2 . • For all A, L 1 and L 2 , if A ∈ L 1 ; L 2 then A ∈ L 1 or A ∈ L 2 . • For all A and L 1 , if A ∈ L 1 then for any L 2 , A ∈ L 1 ; L 2 . • For all A and L 2 , if A ∈ L 2 then for any L 1 , A ∈ L 1 ; L 2 .
• If L 1 ; L 2 = L 3 , A then either L 2 is the empty list and L 1 = L 3 , A or there exists a context L 4 such that L 2 = L 4 , A. • If L 1 ; L 2 = L 3 , A; L 4 then A ∈ L 1 or A ∈ L 2 .
These properties are mandatory for the formal verification. However, its use will not be mentioned in the below proofs. Furthermore, throughout this article we use the Greek letters and to denote finite lists of formulas, called contexts.

An Axiomatic System
The traditional manner of presenting and studying modal logics is through a Hilbert-style system. Here we consider a formulation inspired by the system given by Hakli and Negri (2012) and designed to derive consequences from hypotheses using single context sequents. This is the key feature of axiomatic systems for modal logic in order to validate the deduction theorem and ease the proofs of equivalence with the other styles of deductive systems.
The set A of axioms defining the modal logic CS4 is The system manipulates single sequents of the form H A. The relation of modal derivability between these sequents is defined inductively by the following rules: Let us observe that the necessitation rule concedes us to introduce a operator only if the formula to be boxed is a theorem. This restriction solves the controversy around the validity of the deduction theorem. Moreover, the modus ponens rule (MP) is stated in a multiplicative (independent contexts) style. The reason is that this is the natural way to establish a correspondence of H with an ordinary axiomatic system, one that does not handle hypotheses explicitly. Let us also note that, due to the presence of axiom ♦T, there is no need for an inference rule involving the ♦ operator (though see Lemma 4 below). The deduction theorem and other relevant admissible rules in H, required for the formal verification, are presented next. Their proofs are included in the formalization and our previous works (see González-Huesca et al. 2019;González Huesca et al. 2020).
Theorem(Deduction Theorem). The following rule is admissible: Corollary 2 (Principle of substitution). The following rule is admissible: Theorem(Principle of detachment). The following rule is admissible: Since the contexts are lists, the above rules allow only the (dis)charge of the last assumption in the context, that is, the transfer of such formula to one or the other side of the turnstile symbol. Thus, we need to admit a rule that allows us to discharge an arbitrary hypothesis in the context. Theorem(Generalized Deduction Theorem). The following rule is admissible: Next we state some useful structural rules working on contexts.
Lemma 3 (Structural rules). The following rules are admissible: We show now some admissible rules which simplify the derivation process of modal formulas, namely a rule for diamond introduction and a generalization of the necessitation rule when a context is non-empty but consists only of boxed formulas.
Lemma 4 (Modal introduction rules). The following rules are admissible: We close the presentation of system H with a derivation example using the formula . This formula will also be derived in the further deductive systems of this paper, in order to compare the deduction facilities of each system.
Let us next review the original judgmental reconstruction of modal logic.

Dual-Context Natural Deduction with Judgments
The main reference of the dual-context approach to S4 is the natural deduction system introduced in Pfenning and . This system features a treatment of propositions analyzed judgmentally, following the work of Martin-Löf (Martin-Löf and Sambin 1984) where the sequents relate three basic judgments which describe knowledge without explicit use of possible worlds semantics. Instead, formulas are labeled with semantic judgments, which follow the intuition of Kripke's worlds, but without any reference to any formal semantics. The A true judgment denotes how to verify A under hypothetical judgments; A valid represents, by means of categorical judgments, a proposition which does not depend on true hypotheses, which intuitively means that A is true in any particular world. Finally, A poss represents a possible truth, meaning that A must be assumed as unique ordinary hypothesis, perhaps together with any number of enhanced hypotheses, in order to get a conclusion. This can be understood intuitively as A being true in an unknown world, of which we only know this truth.
In previous works (González -Huesca et al. 2019;González Huesca et al. 2020; Miranda-Perea et al. 2020), we studied and implemented this system with two main differences with respect to its original formulation. On one hand, contexts contain ordinary and not labeled formulas. Instead, we use two disjoint lists in order to omit the judgments true and valid. For instance, the hypotheses ♦A true, C → B valid, E true, D valid are represented, according to Pfenning and Davies (2001) (p. 516), as a list where we put together and first all valid formulas, namely C → B valid, D valid, ♦A true, E true whereas here we represent them with two disjoint lists separated by a | symbol, that is C → B, D | ♦A, E, meaning that the first (second) list contains only valid (true) formulas. This choice simplifies the COQ implementation. On the other hand, we are obliged to add the rule (TP), which explicitly transforms a judgment of truth A true to a judgment of possibility A poss. Such rule is only used tacitly in Pfenning and Davies (2001) but its statement and use are mandatory for our formal verification.
Here we denote the system as jN, a dual-context judgmental Natural deduction system. The sequents in jN have the form | jN J where and are the contexts for enhanced and ordinary hypotheses, respectively, and the succedent J is a conclusion judgment, formally defined as: It is worth noting that, as exemplified above, the third kind of judgment, namely A valid, vanishes due to the use of contexts as disjoint lists.
The system is defined by the following inference rules: We have two starting rules corresponding to both kinds of hypotheses, stated in the most general way allowing us to infer any formula that belongs to a context. The rule for the introduction of necessity ( I) exactly captures the definition of validity through a categorical judgment, while the rule of necessity elimination ( E) behaves as a substitution or cut rule where the formula A is used as lemma A in the enhanced hypotheses in order to prove C. See (Kavvos 2020, Section 2.2.2) for a discussion in this regard. The judgment A poss is explained with a combination of enhanced and ordinary judgments by the rules ( E-POSS), (TP), (♦ I), and (♦ E). The second elimination rule for the operator is given in order to conclude a statement of possibility C poss, this taking advantage of a lemma of the form A true, meaning that we can dispense with the enhanced hypothesis A. It is important to mention that there is no need to derive judgments of the form A valid since, as discussed in Pfenning and Davies (2001), the validity of A is defined as unconditional or necessary truth, that is A valid corresponds to A true and can be constructed by the rule ( I).
Let us show our example theorem in this system.
The following lemmas resume some structural rules and generalizations. Again, these explicit rules are not present in Pfenning and Davies (2001) but are mentioned in other related works, for instance Bierman and de Paiva (2000). The corresponding proofs are available in our previous works (see González-Huesca et al. 2019;González Huesca et al. 2020).
Lemma 5 (Structural Rules). The following rules are admissible • Context Weakening: Lemma 6 (Generalized Implication Introduction). The following rule is admissible: Lemma 7 (Inversion Introduction rules). The following rules are admissible The inversion of ♦-introduction is proved using rules (TP) and (♦ E). This admissible rule together with (♦ I) constitutes a transference principle allowing to go from a judgment of truth to a judgment of possibility and back. This principle collapses the judgment A poss and permit us to define a system free of judgment annotations, as we discuss in Section 5. Let us now focus on another important transference principle.

Formula transference between contexts
Since a sequent has two contexts, it is a natural question to ask whether we can transfer one formula between contexts. These transference processes are not discussed in Pfenning and Davies (2001), Kavvos (2020), and although some of them are stated in Bierman and de Paiva (2000) (Theorem 7), they have not been given due attention. Let us present them now.
Proposition 8 (Transference from enhanced to ordinary). The following is an admissible rule Proof. First, we prove the case for a judgment of truth. Assuming , A ; | jN B true we get ; , A| jN B true by a context exchange rule. From this, together with the obvious ; | , A jN A true, the ( E) rule yields the desired ; | , A jN B true. We can use now this rule to prove the case for a judgment of possibility, using adequately rule (♦ I) and its inverse.
This transference is achieved by deleting A from the enhanced assumptions while adding A to the ordinary hypotheses. This behavior considerably simplifies a backward proof-search process. We can iterate the application of this rule in such a way that the context of enhanced formulas becomes empty. However, this option is not suitable for actual proof construction in jN, although plays an important role in the desired equivalence proof with respect to the axiomatic system H.
As a corollary, we obtain a rule that allows for the direct discharge of enhanced hypotheses.
The above rule seems to be important for some special interpretations of the conditional, as in the case of lax logic where the lax implication can be defined as A → B (see Pfenning and Davies 2001, Section 7). Furthermore, the rule is invertible according to the following Proposition 10 (Detachment for boxed formulas). The following rule is admissible: Proof. By a weakening on the premise, we get , A; | jN A →B true. On the other hand, we have , A; |· jN A true by (EHYP), which implies , A; | jN A true by rule ( I). Finally, rule ( → E) yields the desired conclusion , A; | jN B true. This proposition allows us to prove the inversion of the rule in Proposition 8, according to which the transference of a boxed formula from the ordinary to the enhanced context is achieved by moving it without the box, thus converting a boxed ordinary hypothesis into a pure propositional enhanced assumption.
Proposition 11 (Transference from ordinary to enhanced). The following rule is admissible Proof. First, we prove the case for a judgment of truth. Assuming | , A ; jN B true rule (GEN → I) yields | ; jN A → B true, which by rule ( DET) allows us to conclude the desired , A| ; jN B true. We can use now this rule to prove the case for a judgment of possibility, using adequately rule (♦ I) and its inverse.
In addition to the above rules, we show next yet another transference principle, which allows transforming a formula in the enhanced context, from the premise to the conclusion, while adding a .
It is easy to see that the above rule is invertible. As we will see in Section 6, the presented transference principles will be relevant for the definition of our sequent calculus. Moreover, by simple combinatorics there are in total twelve possible rules capturing transference principles, three of them are unsound as they do not respect the semantic intuition. The discussion of all these rules will be presented elsewhere.
The transference rules and their corollaries provide a useful tool that considerably simplifies the actual construction of proofs as the following version of our pet example shows.

Example 4.2.
A derivation of the sequent · | · jN (A → B) → ♦( A → ♦B) true obtained by using the implication introduction for enhanced formulas.

Substitution properties in jN
In this section, we show that System jN enjoys distinct substitution or composition properties, ensuring that derivations are closed under composition, or from a more practical point of view, guarantee the correctness of proofs organized with help of an auxiliary lemma. Since the system makes a distinction between two kinds of hypotheses or conclusions, there are multiple substitution properties gained by following a combination of a specific hypothesis (either enhanced or ordinary) and a particular conclusion judgment (either ordinary or possible). The total number of combinations is eight, but only five are appropriate and already given in Pfenning and Davies (2001, Section 5.1) where the proofs, though not present, are mentioned to succeed by structural induction on a premise.
Lemma 13 (Substitution principles). The following rules are admissible: Proof. Rules 1 and 3 are proved directly due to the power of transference rules, which avoid the need for structural induction. Rules 2 and 4 by induction on the right premise. Details can be found in González .
The above four substitution principles involve a lemma A for which the judgment A true holds. The last option considers the weak case where the lemma A only verifies the judgment A poss. Therefore, A can only be used as a unique ordinary hypothesis in the right premise.
Lemma 14 (Substitution of a possible lemma). The following rule is admissible: Proof. A direct consequence of the rules (♦E) and (♦I).
It is worth noting that the primitive elimination rules, ( E), ( E-Poss), and (♦E) can be gained from some transference principles, namely rule (ENHTOORD) or rule (♦ I-INV), and a particular instance of a substitution principle when the lemma is an explicit modal proposition.
This finishes our overview of the judgmental reconstruction of modal logic. Next, we define a judgment-free version of jN needed to simplify our equivalence proofs.

A Dual-Context Natural Deduction System
Due to the use of judgments A true and A poss in a sequent succedent, deriving a proof in the jN system might be tedious and the derived proofs tend to be long. In order to address this issue, we present in this section a dual-context natural deduction system N, which is a simplified version of jN of Section 4, where the succedent consists of an ordinary formula instead of judgment of truth or possibility. This system has been previously defined at least two times. In Bierman and de Paiva (2000) (Section 5), it is presented as a multi-context formulation of IS4 that comes out as an alternative addressing the difficulties in formulating the introduction rule for the standard natural deduction formulation of IS4 in sequent style. As already mentioned, the context separation is inspired by works on intuitionistic linear logic. Besides this, Heilala and Pientka (2007b) proposes NJ IS4 , as a system based on Pfenning and Davies (2001), which makes no judgmental distinction between truth and possibility, by internalizing the poss judgment using the ♦ operator, a process independently identified by us and easily explained as follows: as a consequence of the ♦-introduction rule and its inverse (Lemma 7), in jN the judgment A Poss can be replaced by ♦ A True and vice-versa. This replacement generates sequents involving only judgments of truth.
In particular, the rules, and in consequence any derivation, can be transformed in such a way that only judgments of truth occur in them. Hence, the true label becomes redundant and can be completely removed.
The set of inference patterns for N is obtained by applying the internalization process and adding the usual rules for conjunction and disjunction to jN, yielding the following rules: It is worth noting that the rule ( E-POSS) in jN becomes a particular case of ( E) so there is no rule to add in N. Regarding (♦ I) in jN, once the internalization has been applied, it becomes trivial for its premise and conclusion are identical. On the other hand, the internalization applied to the rule (TP) of jN yields the new (♦ I) rule in N.
We show next a derivation of our pet example in the current system.

1.
With respect to the structural rules and transference principles, they hold in N as well. For example, the properties of weakening and exchange in jN (Lemma 5) have analogous proofs in N. Additionally, the transfer principles are also valid. We state them next.
Proposition 15 (Transference principles). The following rules are admissible.
To conclude this section, we present the substitution rules that are admissible in N. Our starting point is the set of admissible rules in Lemma 13. After substituting A poss with ♦A true, (SUBST-2) becomes a particular case of (SUBST-1), and (SUBST-4) becomes a particular case of (SUBST-3) as well. Regarding (SUBST-5), it collapses as a particular instance of ♦ E. Thus, we are left with two substitution rules only.
Theorem(Substitution rules). The following rules are admissible: This finishes the discussion on axiomatic and natural deduction systems for CS4. We are now in position of presenting the promised sequent calculus.

A Dual-Context Sequent Calculus
We present now the main contribution of this paper, a cut-free dual-context sequent calculus for the full constructive modal logic S4, called DG CS4 . Related dual-context formalisms are the sequent calculi MJ IS4 and MJ F IS4 in Heilala and Pientka (2007a) which are focused versions of the sequent calculus LJ IS4 presented in the unpublished technical report Heilala and Pientka (2007b) and are inspired by the sequent calculus for the intuitionistic contextual modal logic of Nanevski et al. (2008). These systems consider the enhanced context only in a parametric way. To the best of our knowledge, a dual-context sequent calculus featuring left rules for both contexts has not been defined before, except for our previous related work ) which only considers the box modality together with alternative left rules for implication, which, while suitable for interactive proof-search, also invalidate cut elimination.
The inference rules of DG CS4 are: • Initial sequents: allowing to conclude a hypothesis according to the context it belongs.
The right rules for propositional connectives and the diamond operator are standard. In the case of a modal formula A, the right rule corresponds to the so-called necessitation rule and allows us to introduce the box operator on the right hand side of the turnstile, only in the absence of ordinary assumptions. This rule is the dual-context version of the right rule present in single context sequent calculi since the work of Curry (1950Curry ( , 1952 and used later by Ohnishi and Matsumoto (1957), where to introduce A we are required to derive A using boxed hypotheses only.
As announced the left rules come in two versions, one for each context.
• Left rules for the ordinary context.
The rules for the propositional connectives are standard. The left rule ( L) captures the transference principle between contexts (Proposition 8): if we prove B using the enhanced hypothesis A, we can also derive B using the ordinary hypothesis A. Observing that the enhanced context is parametric in the rule for the ♦ operator, we realize that this rule is essentially the same as the left rule for standard systems apparently introduced in Ohnishi and Matsumoto (1957). This rule shows that statements of possibility interact only with themselves. That is, a possibility statement ♦A allows to conclude only another possibility formula ♦C, this by proving it using A as unique ordinary hypothesis. • Left rules for the enhanced context.
As usual, the formula introducing an operator in the conclusion of a left or right rule is called the principal formula of such rule, whereas its immediate subformulas, present in the premises of the rule, are called the active formulas.
The enhanced left rule for conjunction is modeled after the fact that the formula (A ∧ B) ↔ A ∧ B is a theorem of S4. Observe that for disjunction and implication the active formulas appear in the ordinary context, otherwise the rules would be unsound. For instance, we would be able to derive (A ∨ B) → A ∨ B, which is invalid in all known semantics of CS4. The rule ( LE), introduced by us in Miranda-Perea et al. (2020), says that, with respect to backward proof-search, an enhanced boxed hypothesis can be safely unboxed. Finally, the rule (♦ LE) follows the same idea of rule (♦ L).
As we will show in Section 7, DG CS4 is a cut-free calculus. However, due to the double context, we have to consider a specialized cut rule, in analogy to the substitution properties presented in Proposition 5, where the cut formula belongs to the enhanced context. For technical reasons, we have to keep this rule as primitive, although later we present an elimination theorem.
• Enhanced cut: In conclusion, DG CS4 consists of nineteen rules: two kinds of initial sequents; six right rules; five left rules; five enhanced left rules together with the enhanced cut rule. Furthermore, we introduce now a cut rule for ordinary hypotheses, hereafter called ordinary cut.
• Ordinary cut This rule is not primitive and later we will show its admissibility.
The following is an example of a derivation in DG CS4 : We present now further rules required to prove the admissibility of the ordinary cut. Several proofs require a complex inductive argument, namely a simultaneous and nested induction involving both formulas and derivations. In such proofs, we can appeal to an induction hypothesis either with at least one less complex formula or with a formula of equal complexity, usually exactly the same formula involved in the inductive step, but with at least one simpler derivation. In the below proofs, we use structural complexity measures, going from subformulas to formulas and from premises to conclusions in any analized rule of a derivation. In particular, in any given inductive step it is legal to appeal to the induction hypothesis with exactly the same formula as long as at least one derivation involved decreases in complexity. Of course, these inductive arguments can also be thought of as using a numerical measure of complexity such as the number of logical operators in a formula and the height of a derivation like in Negri et al. (2001, Theorem 2.4.3). Nevertheless, we prefer to use structural measures since they ease the mechanization of the results in this section, a task that is part of future work (for a similar enterprise see Pfenning 2000). That said, let us start by proving the usual version of the exchange structural rule.
Lemma 16 (Exchange). Let , , , be contexts and A, B, C be formulas. The following rules are admissible Proof. We prove the rule (EXCH), since the rule (EEXCH) is analogous. The proof is by a simultaneous and nested structural induction on the formulas A, B and the premise. The base cases and all inductive cases where A and B are not principal formulas are direct from the I.H.. In the remaining cases, A (or B) is principal. Let us show two of these cases, first when A = def A 1 → A 2 and the premise is obtained by rule ( → L). The situation is as follows: The case is solved by the I.H. on A 1 → A 2 and the left premise and by the I.H. on A 2 and the right premise as follows: Next we show the most interesting case, namely when the premise is derived by rule (∧ L) where the principal formula is A = def A 1 ∧ A 2 . The situation is: By the I.H. on A 2 and the premise, we get | , A 1 , B, A 2 ; G C. From this, the I.H. on A 1 yields | , B, A 1 , A 2 ; G C. Finally we apply ( ∧ L) to get | , B, A 1 ∧ A 2 ; G C.
Next we prove some weakening rules allowing to add a formula or a full context in a derivation.
Lemma 17 (Weakening). Let , , , be contexts and A, C be formulas. The following rules are admissible Proof. The rules (WEAK) and (EWEAK) are proved by structural induction on the premise. For the contextual versions (CTX-WEAK) and (ECTX-WEAK), we proceed by induction on the context . When = · (respectively = ·), the rules become trivial. Finally, the inductive step is straightforward from the I.H. and the rule (WEAK) (respectively (EWEAK)).
The above exchange and weakening rules allow us to prove the invertibility of some left rules.
Proposition 18 (Rule inversion). The following rules are admissible: Proof. Each rule is proved by structural induction on the premise.
Apart from these rules, let us observe that rule (→ LE) is trivially invertible on its right premise as well as rule (∨ LE) on both premises. Moreover, it is easy to see that the remaining rules of DG CS4 are non-invertible.
Let us now present a quite general exchange structural rule, one that is independent from the order imposed by having defined contexts as lists. Such rule is usually not mentioned but used tacitly appealing to a repeated use of the simple exchange rule. However, it is mandatory to define it explicitly for the sake of formal verification. Our approach uses a non-deterministic insertion predicate for finite lists à la PROLOG, specified as follows: Insert A L L holds if and only if L is obtained by inserting A to L. An inductive definition is given by the following rules: The insertion predicate preserves derivations in the following sense: Proof. By induction on the predicate Insert A . The proof is analogous to that for the next lemma.

Lemma 20. If Insert
Proof. By induction on the predicate Insert A . The base case is trivial since what we need to prove is exactly the assumption , A| G C. Assume now that Insert A ( , B) ( , B) holds, since Insert A , and that , B, A| G C. The following derivation solves the inductive step: We define now a permutation predicate by the following rules, where Perm holds if and only if is a permutation of : The case is solved as follows, using the I.H. in both A 1 and A 2 : • The premise is obtained by rule ( L). The situation is: The occurrence of (SCONTR) is replaced by an ordinary contraction in the enhanced context.
• The premise is obtained by rule ( LE). The situation is: The occurrence of (SCONTR) is replaced by an ordinary contraction in the enhanced context.
• The premise is obtained by rule (♦L). The situation is: The occurrence of (SCONTR) vanishes using an adequate instance of the enhanced rule (♦LE): • The premise is obtained by rule (♦LE). Is analogous to the previous subcase.
We have now everything we need for cut elimination.

Ordinary Cut Admissibility and Enhanced Cut Elimination
This section is devoted to prove the admissibility of the ordinary cut rule in DG CS4 as well as the eliminability of the enhanced cut rule. Since we need both approaches to verify that the two cut rules are dispensable, it is adequate to recall their differences: admissibility of a rule R in any deductive system S means that such rule is not primitive but can be simulated in S, whereas eliminability means that R is a primitive, but redundant, rule of S. That is, any derivation in S can be transformed into a derivation in S that does not have occurrences of R. For a detailed discussion about the relationship between admissibility and eliminability, see Section 1.8.1 in Indrzejczak (2021).
Theorem(Cut Admissibility). The cut rule is admissible: Proof. The proof is by a simultaneous and triple nested structural induction on the cut formula A and both premises. Let L be the left premise 1 | 1 G A and R be the right premise 2 | 2 , A G B. In the base case either L or R is an initial sequent. The most interesting cases are when L is an instance of (HYP) or (EHYP), for they require the use of the specialized contraction rule (Proposition 24). Let us present the case for (EHYP), which means that A ∈ 1 . The cut vanishes as follows: Next we consider the inductive cases where at least one of the premises is derived by (ECUT) • L was derived by (ECUT). This case is analogous to the next one. • R is derived by (ECUT). The cut is: This instance of (CUT) is shown admissible as follows: where the new ordinary cut is admissible due to the I.H., since its right premise, namely 2 , C| 2 , A G B, has a structurally simpler derivation than the right premise of the original cut.
To solve the remaining inductive cases, we make a case analysis according to whether the cut formula A is principal, meaning that A is the formula introduced by a left or right rule in order to obtain such premise, in both or only one of the premises. This suffices since the case where A is not principal in neither premise does not need to be treated separately (see the remark at the end of case (2) below). We present all cases involving modalities. The propositional cases are omitted since they are solved in an analogous way to the proof for a standard sequent calculus for intuitionistic logic.
(1) The cut formula A is principal in both premises L and R. There are two subcases. a. Subcase A ≡ C. The cut is as follows: where 2 = , C; . The cut is permuted above ( L) by the I.H on the above premises as follows: d. R is derived by ( LE). Is analogous to the previous subcase. e. R is derived by (♦L). Is analogous to the next subcase. f. R is derived by (♦LE). The cut is: where ♦C ∈ 2 . The cut vanishes as follows: Next we prove an elimination theorem for enhanced cuts. It is worth noting that due to technical reasons, we were not able to prove the admissibility of the (ECUT) rule in a similar way to the Cut Admissibility Theorem. Though the below proof is quite analogous.
Theorem (Enhanced cut elimination). Every derivation π in DG CS4 can be transformed into a derivation π with no occurrences of the rule (ECUT).

Corollary 25 (Subformula property). Any formula occurring in a derivation of | G C is a subformula of , or C.
This ends our presentation of the sequent calculus DG CS4 . Let us exhibit next the equivalence of this formalism with the previously discussed systems for CS4.

Equivalence
In this section, we summarize the equivalence properties of DG CS4 with the previously discussed axiomatic and natural deduction, this way ensuring that our sequent calculus actually corresponds to CS4. Although a direct proof of equivalence between jN and DG CS4 could be provided, for the sake of reuse our previous formal verification in COQ (González Huesca et al. 2020), we prefer to use systems H and N as a bridge. This way, we also confirm the equivalence between the axiomatic and the judgment-free natural deduction system for CS4. Since we provide the mechanization, we do not give here the proofs details.
The equivalence between the judgmental natural deduction system jN and its axiomatic counterpart H is achieved by using translations in both directions. From axiomatic to natural deduction proofs, the translation simulates the original proof by ignoring the enhanced context, this is straightforward since the Hilbert-style system handles sequents already. If instead, a derivation in H was a sequence of formulas, we would need a mechanism to collect the assumptions in a given deduction to being able to construct a context in jN, as it is done for example in von Plato (2014). This certainly would complicate the implementation. On the other direction, the idea is to follow Proposition 8 to empty the enhanced context, thus getting a context of ordinary assumptions which can be directly managed in H. The equivalence between N and H is proved following the same idea as above but the proofs are simpler since system N is free of judgments.

Theorem(Equivalence between axiomatic and natural deduction proofs).
(1) If H A then · | N A.
(2) If | N A then ; H A.
Proof. Each implication is proved by structural induction on the premise.
Finally, the equivalence between the natural deduction system N and the sequent calculus DG CS4 is proved, again by a structural induction, showing that the rules of one system are admissible in the other.
Theorem(Equivalence between natural deduction and sequent calculus proofs). ( Proof. Structural induction on the premises | N A and | G A, respectively.
Since we provide a formal verification of these equivalences, we do not give here further proof details. However, it is important to note that, considering that the cut admissibility and elimination theorems are not verified, the results here stated are mechanized using DG CS4 + , that is the version of DG CS4 where the ordinary cut rule is primitive. Of course, this is harmless for the here presented results. This finishes our exposition.

Final Remarks
This paper introduces a dual-context sequent calculus DG CS4 for the constructive modal logic S4, thus completing the three styles of deductive systems for this logic. Our calculus is related to the system LJ IS4 of the unpublished technical report Heilala and Pientka (2007b) but features initial sequents and left rules for both contexts, thus generating a deterministic set of inference rules. The ordinary left rule ( L) for necessity is gained from a transference property between contexts (Section 4.1, Proposition 15) which, though previously stated in natural deduction (Bierman and de Paiva 2000, Theorem 7), has not been further exploited before. Moreover, the rule ( LE) comes from yet another transference principle (Proposition 12) which, although quite natural, in our best knowledge has not been mentioned before. Finally, the left rules for possibility are directly gained from the corresponding elimination rule in natural deduction. With respect to the cut reasoning patterns, in order to prove the admissibility of the ordinary cut we require to keep the enhanced cut as primitive and later prove that it is eliminable. This way, both inductive proofs succeed. In our opinion, this proving process provides an interesting example of the difference between the admissibility and the elimination of an inference rule.
To prove that DG CS4 exactly corresponds to CS4, we provide an equivalence chain that goes from the sequent calculus to the judgmental natural deduction system jN passing through the judgment-free natural deduction system N and the axiomatic system H. This chain of equivalences has been formally verified using the COQ proof-assistant. With the purpose of providing a better understanding of our formal development, we presented several structural inference rules which may be considered redundant, but that facilitate the understanding of the COQ code.
As current and future lines of research, we mention the mechanization of our cut admissibility and elimination theorems, a non-trivial task that requires the programming of several tactics in COQ in order to automatize more than 360 subcases in each of the two theorems, as well as the development of proof-search procedures based on DG CS4 , following the lines of Heilala and Pientka (2007a). A further line of research refers to the extension of the dualcontext approach to the classical version of S4 to improve and simplify some existent proof-search procedures (Andrikonis 2012;Pliuškevičius and Pliuškevišienė 2008). We conjecture that these methods can be simplified with the dual-context approach since the left rules for necessity safely eliminate A in the premise, which certainly simplifies the backward proof-search procedure. Another interesting task consists in proving the equivalence of dual-context systems with the ordinary natural deduction and sequent calculus for S4 given in Bierman and de Paiva (2000). This seems straightforward in the paper but a formal verification is challenging in the case of natural deduction since the rules for -introduction and ♦-elimination schematically represent an infinite family of rules. As future work, we mention the use of dual-context systems in proofsearch related to the work on multi-agent dialogues of Sticht (2018) and the study of the semantical aspects and tools that will allow us to obtain completeness theorems for the here presented systems but also equivalent labeled deduction systems.