Relational parametricity and control

We study the equational theory of Parigot's second-order /spl lambda//spl mu/-calculus in connection with a call-by-name continuation-passing style (CPS) translation into a fragment of the second-order /spl lambda/-calculus. It is observed that the relational parametricity on the target calculus induces a natural notion of equivalence on the /spl lambda//spl mu/-terms. On the other hand, the unconstrained relational parametricity on the /spl lambda//spl mu/-calculus turns out to be inconsistent with this CPS semantics. Following these facts, we propose to formulate the relational parametricity on the /spl lambda//spl mu/-calculus in a constrained way, which might be called "focal parametricity".


Introduction
The λµ-calculus, introduced by Parigot [26], has been one of the representative term calculi for classical natural deduction, and widely studied from various aspects. Although it still is an active research subject, it can be said that we have some reasonable understanding of the first-order propositional λµ-calculus: we have good reduction theories, well-established CPS semantics and the corresponding operational semantics, and also some canonical equational theories enjoying semantic completeness [16,24,25,36,39]. The last point cannot be overlooked, as such complete axiomatizations provide deep understanding of equivalences between proofs and also of the semantic structure behind the syntactic presentation.
The second-order λµ-calculus (λµ2), again due to Parigot [27], has been studied in depth as a calculus for second-order classical natural deduction. In particular, strong normalization results of λµ2 [27,23] and its extensions, e.g. with inductive types [21], have been a central research topic, because of the proof-theoretical importance of strong normalization. However, for λµ2, it seems that there are few attempts of giving an equational theory supported by some fine semantic structure. This situation is rather frustrating, since without such equational and semantic accounts, we cannot discuss e.g. the correctness of the impredicative encoding of the datatypes in λµ2. For the second-order λ-calculus λ2 (system F) [9,33], a subsystem of λµ2, there are several beautiful results on the relational parametricity [34] and the universal properties of impredicative constructions [1,15,31,40,44], e.g. that µX.σ = ∀X.(σ → X) → X (where σ covariant in X) gives an initial algebra of the functor ΛX.σ in a suitable sense. We certainly wish to have such a story for λµ2 too.
This work is an attempt to identify such an equational theory which is backed up by certain semantic structures. Specifically, we propose a relational parametricity principle which is sound and sufficiently powerful for deriving such equivalences on the λµ-terms.
1.1. Parametric CPS semantics. We first consider the semantics of λµ2 given by a CPS-translation into a fragment of λ2 -that of the second-order existential types ∃X.τ , conjunction types τ 1 ∧ τ 2 , and arrow types τ → R into a distinguished type R (this choice of the target calculus is due to a recent work of Fujita [7]). The translation (−) • sends a type variable X to X, arrow type σ 1 → σ 2 to (σ • 1 → R) ∧ σ • 2 , and the universal type ∀X.σ to ∃X.σ • -while a term M : σ is sent to [[M ]] : σ • → R. It can be considered as a natural extension of Streicher's call-by-name CPS translation [36,39,43]. It follows that this translation already gives a reasonable equational theory on λµ2, in that it validates the standard βη-equalities 1 . In fact, this is a consequence of a fibred version of the "category of continuations" construction [16,36,39].
However, this is just a starting point; we observe that, if some of the impredicative constructions in the target calculus satisfy certain universal properties (e.g. ∃X.X is a terminal object) which follow from the relational parametricity, then so do the impredicative constructions in the source λµ2-calculus -but not quite in the way that we first might expect. For instance, the type ⊥ = ∀X.X does not give an initial object (cf. [37]) -instead it plays the role of the falsity type (or the "answer type"); in fact, we have a double-negation elimination from (σ → ⊥) → ⊥ to σ for any σ which actually is an algebra of the doublenegation monad ((−) → ⊥) → ⊥. As another major example, ∀X.(σ → X) → X does not give an initial algebra of ΛX.σ; it gives an initial algebra of ΛX.(σ → ⊥) → ⊥ -not with respect to all terms but to a certain class of terms (the "focal terms", to be mentioned below). In particular, if X is not free in σ, ∀X.(σ → X) → X is isomorphic not to σ but to (σ → ⊥) → ⊥. In short, impredicative encodings in λµ2 get extra double negations, and the relational parametricity of λ2 is not consistent with the equational theory of λµ2 induced by the CPS semantics. As a consequence, we cannot encode cartesian products in λµ2, though they can be added easily. Also we cannot express the classical disjunctions [36], though they can be added without changing the target of the CPS translation.
1.2. Focal parametricity. These results suggest that the CPS translation into parametric target calculus gives a reasonable semantic foundation and equational theory for λµ2, which is sufficient for obtaining various interesting results. However, here the parametricity is used rather indirectly, via the CPS translation; we also wish to have a decent notion of parametricity directly within λµ2. To figure out what sort of parametricity principle can be expected for λµ2, recall the following fact on λ2 with parametricity: given a polymorphic term M : ∀X.F [X] → G[X] (with X covariant in F and G) and types σ 1 , σ 2 , the instances 1 We can say more -we can show that this CPS-semantics is sound and complete with respect to the βη-theory of λµ2. This result, together with further syntactic analysis of this CPS translation, will appear in a forthcoming paper with Ken-etsu Fujita.

RELATIONAL PARAMETRICITY AND CONTROL
commutes for any f : σ 1 → σ 2 . This is no longer true for λµ2. For example, let F [σ] = (σ → ⊥) → ⊥, G[σ] = σ and M be the double-negation elimination (which does not exist in λ2); then the naturality for arbitrary maps implies inconsistency -we get σ ≃ (σ → ⊥) → ⊥ for every σ by letting f be the obvious map from σ to (σ → ⊥) → ⊥, which is enough to kill the theory [20]. Similar result can be observed for other "classical" proofs, e.g. of the Peirce law.
To this end, we look at the focus [36] (centre [32,42], C-maps [16]) of λµ2; a focal map is no other than an algebra morphism between the the double-negation monad mentioned above, i.e., a map making the naturality diagram for the double-negation elimination commute. It follows that a notion of relational parametricity on λµ2 in which the construction of the graph relations is allowed only for focal maps is consistent, as there are nontrivial models. Together with the definability (fullness) of the CPS translation, we see that it is at least as powerful as the parametricity on the CPS target calculus which we have mentioned above, thus gives a powerful principle for deriving the equivalences of terms in λµ2. (We actually conjecture that these two notions of parametricity do agree, but it is open as of writing this article.) This principle, which we shall call focal parametricity, should be a natural notion of parametricity for λµ2. We will sketch some use of focal parametricity for deriving "free theorems" for λµ2 syntactically.
1.3. Towards parametricity for computational effects. At the conceptual and abstract level, this story closely resembles to the study of linear parametricity and recursion [4,30]. In the case of linear parametricity, the graph relations are allowed to be constructed only from the linear maps, and a linear map is an algebra map w.r.t. the lifting monad. We claim that, just like the linear parametricity gives a solution of accommodating nontermination and recursion in the polymorphic setting (as advocated by Plotkin [30]), the focal parametricity provides a way of accommodating control features in the polymorphic setting. In short: linear parametricity non-termination = focal parametricity first-class control As future work, it would be an interesting challenge to find a unifying framework of linear parametricity and focal parametricity; it should be useful to have parametric polymorphism, recursion, and control at once, as in the realistic programming languages (cf. [14,18,19]). More ambitiously, we are keen to see an adequate notion of parametricity for fairly general "effectful" settings. Possible starting points for this direction might include the "parametricity graphs" approach [5] which allows us to deal with parametricity at a general level (including the linear parametricity as an instance), and the "category of linear continuations construction" [12] which induces both the CPS translation and Girard translation as special cases. See Section 7 for further discussions related to this issue.
1.4. Construction of this paper. The rest of this paper is organised as follows. In section 2 and 3 we introduce the calculi and CPS-translation which are the subject of this study. In section 4 we consider the implications of the relational parametricity on the CPS-target calculus. The focal parametricity is introduced in section 5, followed by examples in section 6, including focally initial algebras and the type of Church numerals. Section 7 gives an alternative characterisation of focus, which suggests a generalisation of this work to a theory of parametricity for general effects. We then give some concluding remarks in Section 8.

The calculi
2.1. The second-order λµcalculus. The second-order λµ-calculus, λµ2, is given as follows. We essentially follow Parigot's formulation [27] (with some flavour from Selinger's [36]). The types are the same as those of the second-order λ-calculus λ2: In a typing judgement Γ ⊢ M : σ | ∆, Γ stands for the typing context of variables, while ∆ for the context of names (continuation variables).
The axioms for the equational theory are again the standard ones -note that we consider the extensional theory, i.e. with the η-axioms.
In the last two axioms, we make uses of so-called "mixed substitution"; for instance, M In the sequel, we frequently use the following syntactic sugar. First, we let ⊥ be the type ∀X.X -the type of falsity. We may also write ¬σ for σ → ⊥. Using ⊥, we define the "named term" With this ⊥, we can express the double-negation elimination in λµ2 by making use of both the polymorphic and classical features: As expected, we have C σ (λk ¬σ .k M ) = M . The properties of ⊥ and C σ will be further studied later under parametricity assumptions.

2.2.
Target: the {∃, ∧, ¬}calculus. In tthe literature, the second-order λ-calculus (λ2) is often taken as the target of the CPS translation for λµ2. Fujita observed that it actually suffices to consider a fragment of λ2 with negations, conjunctions and existential types as a target [7]. In this paper we follow this insight.
τ ::= X | R | ¬τ | τ ∧ τ | ∃X.τ ¬τ can be considered as a shorthand of τ → R. The type R can be replaced by ∃X.¬X ∧ X, but for simplicity we keep R as a type constant. The syntax of terms is a fairly standard one, though for conjunctions we employ a slightly less familiar elimination rule (with let-binding) so that it parallels that of the existential types.

CPS translation
3.1. The CPS translation. We present a call-by-name CPS translation which can be considered as an extension of that introduced by Streicher [16,39,36] (rather than the translations by Plotkin [29], Parigot [27] or Fujita [7] which introduce extra negations and do not respect extensionality).
Soundness. The type soundness follows from a straightforward induction.
Then we have the equational soundness: In addition, we have the definability result: This can be proved by providing an inverse translation of the CPS translation, so that This can be considered as a "continuation-grabbing style transformation" in the sense of Sabry [35]. It follows that for any ¬Γ • , ∆ • ⊢ M : ¬σ • there exists ¬Γ • , ∆ • ⊢ P : ¬σ • generated by this grammar such that P = M -it suffices to take the β-normal form [7]. Moreover we can routinely show that [[P −1 ]] = P . Thus the CPS translation enjoys fullness: all terms are definable modulo the provable equality. This definability is important for relating the parametricity principles for the source and target calculi.

A semantic explanation.
Here is a short explanation of why this CPS translation works, intended for readers with category theoretic background -on the "categories of continuations" construction [16,39,36], and on fibrations for polymorphic type theories [17]. As a response category C with a response object R induces a control category R C with R C (X, Y ) = C(R X , R Y ), a fibred response category with finite products and simple coproducts (for existential quantifiers) induces a fibred control category with finite products and simple products (for universal quantifiers). Let us write C Γ for the response category over the type-context Γ. We assume that the weakening functor π * : C Γ → C Γ×A has a left adjoint ∃ A : C Γ×A → C Γ subject to the Beck-Chevalley condition. Thus Hence π * , regarded as the weakening functor from R C Γ to R C Γ×A , has a right adjoint given by ∃ A , which can be used for interpreting the universal quantifier. Our CPS transformation is essentially a syntactic interpretation of this semantic construction.
4. CPS semantics with the parametric target calculus 4.1. Parametricity for the target calculus. As the target calculus can be seen as a subset of λ2 (via the standard encoding of the conjunctions and existential types), we can define the relational parametricity for the target calculus in the same way as for λ2, e.g. logic for parametricity [31,40], system R [1], or system P [5]. One may directly define the parametricity principle (often called the simulation principle) for the existential type, see for example [31].
In this paper we only consider the relations constructed from the graphs of termsin-context, identity, and σ * 's obtained by the following construction, which we shall call "admissible relations".
Among admissible relations, the most fundamental are the graph relations. Given a term f (x) : τ 2 with a free variable x : Given a type τ whose free type variables are included in X 1 , . . . , X n and admissible relations s 1 : τ 1 ↔ τ ′ 1 , . . . , s n : τ n ↔ τ ′ n , we define an admissible relation τ * as follows.
One may further define admissible relations ¬r, r ∧ s and ∃X.r for admissible r, s, so that Let id τ : τ ↔ τ be the identity relation on the terms of type τ . The relational parametricity asserts that, for any τ whose free type variables are included in X 1 , . . . , X n and Its consistency follows immediately from that of the parametricity for λ2. Their proofs are standard, cf. papers cited above [31,1,40,5]. Below we will see the implications of these parametricity results on the target calculus. We refer to the λµ2-theory induced by the CPS translation into this parametric target calculus as λµ2 P .
4.2. The falsity type. As a first example, let us consider the falsity type ⊥ = ∀X.X in λµ2. We have Thus the type ⊥ serves as the falsity type as found in some formulation of the λµ-calculus.

4.3.
Initial algebra? A more substantial example is the "initial algebra" µX.
(here we see an unfortunate clash of µ's for the name-binding and for the fixed-point on types, but this should not cause any serious problem). We calculate: is an isomorphism. It still is not an initial algebra of (F [−] → ⊥) → ⊥; we shall further consider this issue later. For now, we shall emphasize that the parametricity principle for λ2 should not be used for λµ2, at least without certain constraint -otherwise in would be an isomorphism, hence a degeneracy follows (because we have (σ → ⊥) → ⊥ ≃ σ for every σ).
• ∃X.σ does not work as the existential type; it is isomorphic to ¬∀X.¬σ.

4.5.
Answer-type polymorphism. Note that the answer type R has been considered just as a constant with no specific property. In fact we could have used any type for R -Everything is defined polymorphically regarding R. Thus we can apply the "answer-type polymorphism" principle (cf. [43]): in particular, a closed term of type σ in λµ2 can be considered to be sent to a λ2-term of type ∀R.¬σ • . This way of reasoning goes behind the parametricity principle for our target calculus, but it is justified by the parametricity of λ2.
For instance, consider the type ⊤ = ∀X.X → X of λµ2. We have in λ2 with parametricity. This means that, although ⊤ is not a terminal object in λµ2, it has a unique closed inhabitant. Similarly, we have ∀R.¬⊥ • ≃ ∀R.R ≃ 0, thus we see that there is no closed inhabitant of ⊥ in λµ2. However, such reasonings based on the answer-type polymorphism become much harder for more complicated types. The force of answer-type polymorphism in this setting seems still not very obvious.

Focal parametricity
We have seen that the CPS semantics with respect to the target calculus with relational parametricity induces a reasonable equational theory λµ2 P . However, here the parametricity is used rather indirectly, via the CPS translation. We now consider a notion of parametricity which is directly available within λµ2.

CPS translating relations.
The key of formulating the relational parametricity is the use of graph relations of terms (considered as representing a functional relation): without graph relations, relational parametricity reduces to just the basic lemma of the (secondorder) logical relations. On the other hand, it does not have to allow all terms to be used for constructing relations. In fact, in linear parametricity [30] only linear (or strict) maps are allowed to be used for constructing graph relations, and this choice allows a weaker notion of parametricity which can accommodate recursion. Naturally, we are led to look for a characterisation of λµ-terms which can be used for graph relations without breaking the soundness with respect to the CPS semantics into the parametric target calculus. Now suppose that we are allowed to use the graph relation f : σ 1 ↔ σ 2 of a term x : σ 1 ⊢ f (x) : σ 2 . To ensure the soundness of the use of this graph relation, we shall consider the CPS translation of such relations. For instance, we hope that f will be sent to a relation between types σ x (g (k)) for some k : σ • 2 ⊢ g(k) : σ • 1 in the target calculus. If there is such g, we can complete the translation of the relations and reduce the parametricity principle on λµ2 to the parametricity on the target calculus.
Fortunately, there is a way to characterise such "translatable" f 's in the λµ-calculus without performing the CPS-translation (modulo a technical assumption on the CPS-target, known as "equalising requirement" [22]). It is the notion of "focus", which we now recall below.
In any λµ2-theory, focal terms compose, and the identity λx σ .x is obviously focal. So, the (equivalence classes of) focal maps form a category. Hereafter we shall call it the focus of the λµ2-theory.
While this characterisation of focal maps is concise and closely follows the semantic considerations in [36,19], there is a subtle problem; the βη-axioms of λµ2 are too weak to establish the focality of some important terms. This is because we have used the polymorphic feature of λµ2 for expressing C σ -it involves the falsity type ⊥ = ∀X.X, but the axioms of λµ2 do not guarantee that ⊥ does work properly. If there were not sufficiently many focal maps, the parametricity principle restricted on focal maps would be useless.
To see this issue more clearly, we shall look at another "classical" combinator (the Peirce law) which does not make use of polymorphism, and the "abort" map (Ex Falso Quodlibet) which is defined without the classical feature. It is well known that the double-negation elimination is as expressible as the Peirce law together with Ex Falso Quodlibet, see e.g. [2]. This is also the case at the level of (uniformity of) proofs. Let us say that M : In [16], a focal map from σ1 to ⊥ is called a "C-term of type σ1". C-terms of type σ1 with a free name of σ2 correspond to focal maps from σ1 to σ2, thus these notions (and the associated constructions of the CPS target categories via C-terms (C-maps) [16] and via focus [36]) are essentially the same.
commutes for each σ 3 ; and discardable if Proposition 5.2. In a λµ2-theory, M : σ 1 → σ 2 is focal if and only if it is both repeatable and discardable.
We note that the corresponding result in the call-by-value setting has been observed by Führmann [8] as the characterisation of algebraic values as repeatable discardable expressions. Here we follow his terminology.
This reformulation allows us to see that only the second diagram of A's involves the polymorphically defined ⊥ and needs to be justified by additional conditions. 3 On the other hand, the first diagram of P 's is not problematic, as it does not make use of polymorphism at all.

Additional axioms.
To this end, we add more axioms to λµ2 before thinking about parametricity. They are α] Note that λµ2 P discussed in Section 4 satisfies these conditions. Also we shall note that [α](x σ) are all repeatable in λµ2. Together with these additional axioms, they become focal. (Alternatively, we could have ⊥ as a type constant and assume the standard axiomatization of λµ-calculus with the falsity type [16,36] -in that case C is defined without polymorphism, and this problem disappears.) Below we develop the focal parametricity principle on top of λµ2 with these additional axioms.

5.4.
A parametricity principle for λµ2. Given a focal f : σ 1 → σ 2 we define its graph relation f : σ 1 ↔ σ 2 by u f v iff f u = v. Also, let id σ : σ ↔ σ be the identity relation on the terms of type σ. In this paper we only consider the relations given by the graphs of focal maps, identity, and σ * 's obtained by the following construction, which we shall call "focal relations".
Thus the only departure from the standard parametricity principle is the condition that the graph relation construction is allowed only on focal maps. Note that this restriction is necessary; if we apply parametricity to polymorphic terms ΛX.C X or ΛX.P X,σ , we will get the naturality diagrams above for any term which is allowed to be used for the graph relation construction.

5.5.
On consistency and soundness. The consistency of focal parametricity (in the sense that the equational theory of λµ2 with focal parametricity is not trivial) follows from the fact that there are non-trivial parametric models of λ2 in which there is an object R so that the continuation monad T τ = R R τ satisfies the "equalising requirement" [22], i.e. each component η τ : τ → T τ of its unit is an equaliser of η T τ and T η τ . (Here we employ the syntax of the CPS target calculus as an internal language for such models, where the CPS translation is considered to give a semantic interpretation.) In such models, for any focal term f : σ 1 → σ 2 , there exists a unique y : σ • 2 ⊢ g(y) : σ • 1 such that [[f x]] = λy.x (g(y)) (cf. [36]).
Using this fact, given a focal relation r : σ 1 ↔ σ 2 , we construct an admissible relation r • : σ • 2 ↔ σ • 1 as follows. For a graph relation f : where g is the unique map as given above. For σ * , σ * • is defined by straightforward induction:  We do not know if the term model of the parametric target calculus satisfies the equalising requirement -if so, by the definability result, the parametricity on the target and the focal parametricity on λµ2 should agree. Alternatively we should consider a refined target calculus with a construct ensuring the equalising requirement, as detailed in Taylor's work on sober space ("a lambda calculus for sobriety" [41]). For now, we only know that one direction is true (thanks to the definability).
Theorem 5.5. An equality derivable in λµ2 P is also derivable in λµ2 with focal parametricity.

Examples
We show that certain impredicative encodings in λµ2 satisfy universal properties with respect to the focus using the focal parametricity principle.
f : and only if f is focal.
6.2. Falsity as a focally initial object. Now we shall proceed to reason about impredicative encodings in λµ2. The first example is the falsity ⊥ = ∀X.X.
First, we note that A σ = λx ⊥ .x σ : ⊥ → σ is focal. The parametricity on ⊥ says x ⊥ * x for any x : Now suppose that g : ⊥ → σ is focal. Again by the parametricity on ⊥ we know x ⊥ * x for any x : ⊥, hence x ⊥ g x σ. Thus g (x ⊥) = x σ; but x = x ⊥, so we have g x = x σ, hence g = λx ⊥ .x σ = A σ .
So we conclude that A σ is the unique focal map from ⊥ to σ. This means that ⊥ is initial in the focus. 6.3. Focally initial algebra. As in λ2, there is a fairly standard encoding for which the following diagram commutes (just by β-axioms).
Therefore in is a weak initial F -algebra. However, as we noted before, in is not an initial F -algebra -in fact it is not even an isomorphism. By applying the focal decomposition above, we obtain the commutative diagram for any focal a : ¬¬F [σ] → σ. We show that fold a ♭ is the unique focal map making this diagram commute, thus in ♯ is an initial ¬¬F [−]-algebra in the focus. We sketch a proof which is fairly analogous to that for the corresponding result in parametric λ2 as given in [1]. First, from the parametricity on µX.F [X] we obtain that so by extensionality we conclude fold σ a ♭ = h. This also implies that in ♯ is an isomorphism, with the inverse given by fold ¬¬µX.F [X] (¬¬F [in]). As a special case, by letting F be a constant functor, we obtain isomorphisms between (σ → ⊥) → ⊥ and ∀X.(σ → X) → X where X is not free in σ. With some further calculation we see that in ♯ = λm.ΛX.λk σ→X .µα X .m (λx σ .[α](k x)) is the inverse of λn.n ⊥ : (∀X.(σ → X) → X) → (σ → ⊥) → ⊥. We will see more about this isomorphism in Section 7.
6.4. The type of Church numerals. We conclude this section by a remark on the type of Church numerals N = ∀X.X → (X → X) → X. Recall that, in λ2 with parametricity, N is an initial algebra of ∀X.X → (− → X) → X ≃ 1 + (−), i.e. a natural numbers object, whose closed inhabitants are equal to the Church numerals S n O which can be given by, as usual, It is no longer true in λµ2, as observed by Parigot, as there are closed inhabitants which are not equal to Church numerals, e.g.
To see this, it is useful to observe the following bijective correspondence (a variant of the focal decomposition): given focal g : (⊥ → (σ → ⊥) → ⊥) → σ we have : σ g s = λy σ .g (λx ⊥ k σ→⊥ .k y) : σ → σ and conversely, for a : σ and f : σ → σ we have a focal map It follows that (ϕ a,f ) o = a and (ϕ a,f ) s = f hold for any a and f , while ϕ go,gs = g for any focal g. Now we define It then follows that the diagram above commutes -and the focal parametricity implies that fold A g is the unique such focal map.

A general characterisation
So far, we concentrated on the relational parametricity for λµ2. One may feel that this story is very specific to the case of λµ2, or of the first-class continuations, and is not immediately applicable to other computational effects.
In this section we describe an alternative characterisation of the focus, which makes sense in any extension of λ2. Namely, we show that, any λ2-theory is equipped with a monad L, such that each type is equipped with an algebra structure -and then see that, in the case of λµ2 with focal parametricity, this monad L is isomorphic to the double-negation (continuation) monad, and focal maps are precisely the algebra maps of the monad L. This suggests a natural generalisation of this work to a theory of parametricity for general computational effects. 7.1. A monad on λ2. Let Lσ = ∀X.(σ → X) → X (with no free X in σ), and define Proposition 7.1. On the term model of any λ2-theory, (L, η, µ) forms a monad.
One might think that this is trivial as Lσ is isomorphic to σ when we assume the standard parametricity. This is not always the case however, as we have already seen, Lσ ≃ (σ → ⊥) → ⊥ in the focally parametric λµ2.
Thus each σ is canonically equipped with an algebra structure α σ . Again one may think that this is trivial, as under the standard parametricity α σ is just an isomorphism with η σ being an inverse. However, again it is not the case in a non-trivial λµ2-theory.
Now we define the notion of linear maps in terms of the monad L and the canonical algebras α σ -this is close to what we do in (axiomatic) domain theory for characterising the strict maps, and also in control categories for characterising the focal maps.
That is, f is linear when f (M σ 1 (λx σ 1 .x)) = M σ 2 f holds for any M : Lσ 1 . We may write f : σ 1 ⊸ σ 2 for a linear f : σ 1 → σ 2 . Under the standard parametricity every f : σ 1 → σ 2 is linear, while for focal parametricity on λµ2 we have that linear maps are precisely the focal maps (see below). In passing, we note the following interesting observation. Proposition 7.4. In a λ2-theory, the following conditions are equivalent.
Note that they are very close to the "additional axioms" for λµ2 discussed in Section 5. Also note that, if a λ2-theory satisfies one of these conditions, µ σ and α Lσ agree for every σ. and we have a "linear decomposition" correspondence between the maps of σ 1 → σ 2 and the linear maps of Lσ 1 → σ 2 . 7.2. Focal maps as algebra maps. Now we shall consider the double-negation monad ¬¬σ = (σ → ⊥) → ⊥ on λµ2 with focal parametricity. Proposition 7.5. In a focally parametric λµ2-theory, C σ : ¬¬σ → σ is an algebra of the double-negation monad.
Corollary 7.6. f : σ 1 → σ 2 is focal if and only if it is an algebra map from C σ 1 to C σ 2 .
Proposition 7.7. The monad (L, η, µ) is isomorphic to the double negation monad in the focally parametric λµ2, with λx Lσ .x ⊥ : Lσ ≃ → ¬¬σ. Thus a focal map in a focally parametric λµ2-theory can be characterised just in terms of the monad L which is defined for arbitrary λ2-theory.
We believe that the monad L deserves much attention. It has been considered trivial, but now we know that it does characterise an essential notion (focus) in the case of relational parametricity under the presence of control feature. In fact, the story does not end here; under the presence of non-termination or recursion, L behaves like a lifting monad -indeed it is a lifting in the theory of linear parametricity, because Lσ = ∀X.(σ → X) → X = ∀X.!(!σ ⊸ X) ⊸ X ≃ !σ where the last isomorphism follows from the fact that ∀X.!(F [X] ⊸ X) ⊸ X gives an initial algebra of F , cf. [4].
These observations suggest that there exists a general framework similar to (axiomatic or synthetic) domain theory where the lifting monad can be replaced by any strong monad -a continuation monad for example -on which a theory of parametricity for general computational effects can be built. Recently, Alex Simpson has made a progress in this direction, by developing a two-level polymorphic type theory (for interpreting types and algebras of a monad) in a constructive universe [38]. His work fits very well with the case of linear parametricity for recursion; it is plausible that it also explains the case of focal parametricity for first-class control.

Conclusion and future work
We have studied the relational parametricity for λµ2, first by considering the CPS translation into a parametric fragment of λ2, and then by directly giving a constrained parametricity for λµ2. The later, which we call "focal parametricity", seems to be a natural parametricity principle under the presence of first-class controls -in the same sense that linear parametricity works under the presence of recursion and non-termination.
There remain many things to be addressed in future. In the previous section, we already discussed a research direction towards a relational parametricity for general effects. Below we shall briefly mention some future work more closely related to the main development of this paper.
Firstly, we are yet to complete the precise comparison between focal parametricity on λµ2 and the parametricity on the CPS target calculus. This involves some subtle interaction between parametricity and a technical condition (equalising requirement).
Secondly, we should study focal parametricity for extensions of λµ2. As we observed, λµ2 with focal parametricity does not have many popular datatypes, e.g. cartesian products, and classical disjunction types which however can be added with no problem. Adding general initial algebras is problematic (having an initial object already means inconsistency), but it might be safe to add certain carefully chosen instances. On the other hand, final coalgebras seem less problematic, though a generic account for them in λµ2 is still missing.
Perhaps we also need to consider the CPS translation of such datatypes (cf. [3]) in a systematic way.
An interesting topic we have not discussed in this paper is the Filinski-Selinger duality [6,36] between call-by-name and call-by-value calculi with control primitives. In fact it is straightforward to consider its second-order extension: in short, universal quantifiers in callby-name (as studied in this paper) amount to existential quantifiers in call-by-value. We are not sure if the call-by-value calculus with existential quantifiers itself is of some interest. However, it can be a good starting point to understand the call-by-value parametric polymorphism (possibly with computational effects), from both syntactic and semantic aspects. In particular, it should provide new insights on the famous difficulty of accommodating first-class continuations in ML type system [11].
Finally, we also should consider if there is a better (ideally semantic) formulation of focal relations. In this paper we only consider those coming from focal maps, but it seems natural to regard a subalgebra (of the double-negation monad) of C σ 1 ×σ 2 as a focal relation between σ 1 and σ 2 , where we assume the presence of cartesian product σ 1 × σ 2 . This looks very closely related to Pitts' ⊤⊤-closed relations for λ2 with recursion [28].