Diacritical Companions

Coinductive reasoning in terms of bisimulations is in practice routinely supported by carefully crafted up-to techniques that can greatly simplify proofs. However, designing and proving such bisimulation enhancements sound can be challenging, especially when striving for modularity. In this article, we present a theory of up-to techniques that builds on the notion of companion introduced by Pous and that extends our previous work which allows for powerful up-to techniques deﬁned in terms of diacritical progress of relations. The theory of diacritical companion that we put forward works in any complete lattice and makes it possible to modularly prove soundness of up-to techniques which rely on the distinction between passive and active progresses, such as up to context in λ -calculi with control operators and extensionality.


Introduction
Coinduction allows to define and reason about potentially infinite objects, such as streams [14] or program behaviors [8].Proving a property by coinduction consists in exhibiting an invariant, known as bisimulation in the context of program equivalence.Finding the appropriate invariant for a given property can be challenging, as it has to be large enough for the invariant to hold, but also small enough to keep the proof as simple as possible.Up-to techniques or enhancements [15,13] have been introduced to relieve this tension, as they permit to consider smaller objects which are not invariant but contained into one.For example, in some languages, it is safe to ignore a common context when proving the equivalence of two given programs [4].This reasoning up to context is not sound in general, so the problem becomes how to prove that a given technique is indeed valid, especially since the composition of two up-to techniques is not necessarily sound.
Sangiorgi and Pous studied up-to techniques first for binary relations [15], and then in the more general setting of complete lattices [13], focusing on finding composable enhancements for better modularity.Their work led to the definition of the subclass of compatible enhancements, which is closed by function composition and union.Following up on a remark by Hur et al. [6], Pous [11] shows how useful the greatest compatible function (the companion) can be used as a sufficient, modular criterion for the validity of up-to techniques.Indeed, any function (compatible or not) below the companion is an up-to technique, and being below the companion is preserved by composition and union.As further demonstrated by Pous, the notion of companion is surrounded by an array of tools that in practice are highly flexible and effective, compared to relying on the notion of compatibility alone.The companion has since been studied as a categorical object [12,2] and has been characterized in a classical [9] and constructive [16] setting.Danielsson [5] uses the former characterization to relate the companion to size-preserving functions, a class of up-to techniques proved valid using types.
In our studies of equivalences for variants of the λ-calculus [1,3], we restrict the use of up-to techniques in some cases, to allow for more powerful enhancements which would otherwise be unsound when applied in an unconstrained way.We then distinguish the strong up-to techniques, which can safely be used with no restrictions, from the regular ones with a restricted use.This distinction makes it possible to define a highly expressive variant of environmental bisimulation up to context, particularly useful in the presence of context-manipulating constructs such as control operators [1].It also enables up-to techniques for normal-form bisimulation which respect η-expansion [3].In the aforementioned papers, we propose diacritical compatibility as a sufficient criterion to be a (strong) up-to technique in our setting.This notion does not allow for an interesting notion of companion, as it is defined at the level of sets of functions and not for individual functions.
This paper fixes this issue by revisiting our view of up-to techniques: instead of distinguishing between strong and regular techniques, we decompose an up-to technique into a pair, composed of a safe (or strong) part, which can be used everywhere, and a restricted (or weak ) one, which cannot.We then define compatibility for pairs of functions; the corresponding companion is therefore itself a pair, called the diacritical companion.We show that the diacritical companion enjoys the same properties as Pous' companion, and can be used as a sufficient criterion for the validity of up-to techniques.In contrast with our previous papers, the current developments are not restricted to binary relations and take place in any complete lattice.The theory of this article therefore extends our previous work as well as Pous'.
In the rest of the paper, we first introduce the concepts and notions used throughout this work in Section 2. We define the diacritical companion in Section 3, and then extend it to the higher-order setting to use it as a proof technique to show that a given pair of functions is below the first-order diacritical companion (Section 4).We conclude in Section 5.The theory (not the examples) has been formalized in the Coq proof assistant; the developments are available at https://bitbucket.org/pl-uwr/companion/.

Diacritical Progress, Complete Lattices, and Companion
We set the stage by reminding the notion of diacritical progress, usual definitions about complete lattices, and Pous' companion.

Diacritical Progress
The notion of progress [15] between relations makes it possible to uniformly describe bisimulations and up-to techniques.A relation R progresses to S, usually written R S, if terms related by R can be turned into terms related by S by following some conditions given by .A simulation is then a relation which progresses to itself, i.e., R R; a bisimulation R is a relation such that R and its inverse R −1 are simulations, and bisimilarity is the largest bisimulation.An up-to technique or enhancement is a function f on relations such that R f(R) implies that R is included in the bisimilarity.
Example 2.1 All along the paper, we use normal-form bisimilarity [7] for the λ-calculus as an illustrative example.We let x, y, z range over variables.The syntax of terms (e), values (v), and evaluation contexts (E) is given by: e ::= v | e e v ::= x | λx.e E ::= | E e | v E An abstraction λx.e binds x in e; a variable that is not bound is called free.We work modulo α-conversion of bound variables, and a variable is called fresh if it does not occur in the terms under consideration.We write E[e] for plugging a term in an evaluation context, and e{v/x} for the capture-avoiding substitution of v for x in e, defined as usual.We abbreviate successive λ-abstractions λx.λy.e as λxy.e.The call-by-value reduction semantics is given by the following rule.
Normal-form bisimilarity [7] relates terms by reducing them to normal forms, which are then decomposed into bisimilar subterms.With the chosen semantics, normal forms are either values or open-stuck terms of the form E[x v].The notion of progress corresponding to normal-form bisimilarity can be given as follows: R S if R ⊆ S and e 1 R e 2 implies: (i) if e 1 → e 1 then there exists e 2 such that e 2 → * e 2 and e 1 S e 2 ; (ii) if e 1 = v 1 then there exists v 2 such that e 2 → * v 2 and for a fresh variable z, we have and for a fresh variable z, we have Clause (ii) allows for a uniform treatment of values by simply applying them to a fresh variable.Such a formulation respects η-expansion and scales to richer calculi with, e.g., control operators [3].
In our previous work [1,3], we decomposed progress into a passive and an active part, with the idea that passive progress covers administrative steps, and active progress actual computation steps.Diacritical progress R Q, S means that R progresses towards Q in the passive case, and towards S in the active one.The resulting notions of simulation and bisimilarity are not affected by this change, since a simulation still progresses to itself in the active and passive cases: R R, R. Instead, diacritical progress allows for a finer control on enhancements by forbidding the application of some of them in the passive case.We distinguish between regular techniques, which can be used only in the active case, from the strong ones usable everywhere.Formally, a function f is an up-to technique if R R, f (R) implies that R is included in the bisimilarity, and it is a strong one if R f (R), f (R) implies the same property.Such a distinction enables techniques that otherwise would be unsound if applied in an unconstrained way.
Example 2.2 For normal-form bisimilarity [3], we consider the clauses (i) and (iii) as active, since computation happens in both cases, either explicitly in (i), or implicitly in (iii).Indeed, clause (iii) runs the surrounding context E with a variable z which plays the role of a value obtained by at least one reduction step of x v 1 , if x was replaced with a λ-abstraction.In contrast, value testing (ii) is passive, as it simply builds terms and does not reduce them.
W.r.t.up-to techniques, such a choice allows to forbid in particular the factorization of a common context when comparing values, as authorizing such a technique in that case would be unsound: v 1 R v 2 implies that v 1 z and v 2 z are related up to context for any z, v 1 , and v 2 .Up to context can still be safely used when comparing open-stuck terms or after a reduction step.
In our previous work, we proposed a sufficient criterion to show that a function is a (strong) up-to technique, phrased in terms of evolution and compatibility.A function f diacritically evolves to g and , and it strongly evolves to g and . These notions mean that f is transformed into g in the passive case, and into h in the active one.Diacritical evolution makes the extra hypothesis that R passively progresses to itself, so that we can normalize the elements in R w.r.t.passive progress before making an active progress.Compatibility is then defined for sets of functions: roughly, a set F is compatible if it contains a subset S such that If F is compatible, then every function in F is an up-to technique, and every function in S is a strong up-to technique.In both cases, h can be built out of functions in F, meaning that any up-to technique can be used in the active case, while only strong techniques can be used in the passive case to build g, g 1 , or g 2 .
Such a definition of compatibility does not lend itself to a notion of companion, because it is defined at the level of sets and not individual functions.We propose a much cleaner theory in this paper, by defining a notion of compatibility and its corresponding companion which allows for the distinction between active and passive progress while extending Pous' framework.

Progress for Complete Lattices
The notion of progress underlying a bisimilarity can also be expressed as a monotone function b on relations [13]; bisimulations are then post-fixpoints of b, i.e., relations R verifying R ⊆ b(R).Bisimilarity is the greatest fixpoint of b, and can be characterized by Knaster-Tarksi's theorem as the union of all bisimulations.Pous defines the companion for any complete lattice for a given monotone function [11].
However, the notion of progress can also be generalized to any complete lattice [10], with a one-to-one correspondence to monotone functions, meaning that we still benefit from Knaster-Tarski's theorem.We present our work using this notion of progress, as we believe it simplifies the presentation of the theory and its comprehension.In particular, our examples relying on normal-form bisimilarity can still be formulated in terms of progress and do not need a less natural translation to monotone functions.To be consistent with this choice, we use progress-like notations and terminology all along the paper, like, e.g., simulation for post-fixpoint and similarity for greatest fixpoint.
We remind some general notions and fix some notations.A complete lattice consists of a set L (whose elements are ranged over by R, S, Q) equipped with a partial order such that any subset X of L has a least upper bound X verifying: for all R ∈ L, X R iff for all S ∈ X, S R. The least upper bound of two elements R and S is written R S, and we write ⊥ for the bottom element of L, defined as ∅.Given a predicate P on elements of L, we write R.P(R) for {R | P(R)}.By inverting the ordering, we derive the definition of the greatest lower bound of a set, including the binary one , as well as the top element .
A function f from L to L is monotone if for all x, y, x y implies f(x) f(y).We write [L → L] for the set of monotone functions from L to L, and denote its elements with either f, g, h, b, or s.The set [L → L] forms a complete lattice if we extend and as follows: f g if for all x ∈ L, f(x) g(x), and for all X ⊆ [L → L], X = x → f(x).f∈ X.We write id for the identity function.Given two complete lattices L 1 and L 2 , their product L 1 × L 2 , ordered pointwise, is also a complete lattice.We write π 1 and π 2 for respectively the first and second projection.
Given a complete lattice L, the general definition of progress [10] describes how to go from one element of L to another, respecting the ordering and the least upper bound .

Definition 2.3 A binary relation
on L is a progress relation if the following holds: Least upper bounds are preserved by on the left, but also on the right, as a consequence of the first item.Indeed, given a subset X of L, if S ∈ X implies R S, then since S X, we also have R X. Progress relations correspond to monotone functions since we can define a progress b from a given monotone function b, and vice versa: Definition 2.4 Let b be a progress relation on L, and (f, Evolution is a progress relation on [L → L], and is preserved by composition.

Companion
We briefly remind the definition and the main properties of Pous' companion [11], reformulated using progress and evolution to be consistent with the rest of the paper.Let L be a complete lattice, and b a progress relation on L, for which we consider the corresponding notion of similarity, written ν( b ).
A compatible function for b is a monotone function f such that f b f, and the companion, written t, is the largest compatible function.What makes t interesting is that it is an up-to technique, and any function below t is an up-to technique.
To show that f is below t, we just need to consider the lattice [L → L] and the progress relation b , whose simulations and similarity are, respectively, compatible functions and t.The higher-order companion T is then the companion for b , and instantiating Theorem 2.6 in that setting gives the following result.
The b-evolution proof for a given f can then be simplified thanks to the following properties of T, where we write b for the monotone function corresponding to b .
Our goal is to tell a similar story for diacritical progress.We start in the following section by defining a companion for which we prove a result similar to Theorem 2.6.

First-order Diacritical Companion
Henceforth, we fix a complete lattice L with order and least upper bound , and two progress relations p and a , referred to as the passive and active progress, respectively.Diacritical progress is the conjunction of the two progresses, and a simulation for is therefore a simulation for p and for a .We write ν( p , a ) for the corresponding similarity.
Example 3.1 The passive and active progresses for normal-form similarity are defined as follows.Let R, S be relations on λ-terms.
• We write R p S if R ⊆ S and v 1 R e 2 implies that there exists v 2 such that e 2 → * v 2 , and v 1 z S v 2 z for a fresh variable z.
• We write R a S if R ⊆ S and e 1 R e 2 implies • if e 1 → e 1 , then there exists e 2 such that e 2 → * e 2 and e 1 S e 2 ; • if and v 1 z S v 2 z for a fresh variable z.
We discuss the need for the inclusion hypothesis R ⊆ S and its consequences in Remark 4.9.
In our previous work, we defined compatibility not simply for functions but for sets of functions, to allow for a strong candidate to evolve towards a regular one in the active progress case, as we can see with the definition of strong evolution in Section 2.1.The same purpose can be achieved by decomposing up-to techniques into pairs of monotone functions (s, f), where s is the function applied after the passive progress, while f is applied after the active one.
By considering pairs of functions, we generalize the distinction between strong and regular up-to techniques described in Section 2.1; we decompose an up-to technique into its strong and weak components, respectively s and f.Such a change allows for a definition of evolution between two pairs (s, f) and (s , f ) where s evolves towards f in the active progress case.
The function f can be seen as weak since it requires an extra hypothesis in its evolution proof, i.e., it requires arguments that passively progress to themselves-recall that diacritical evolution in Section 2.1 is defined for R verifying R R, S. Weak functions may require R to make administrative steps (passive progress) before making a computing step (active progress).We reflect this condition in the following notion of restricted evolution.
and R a S imply f(R) p g(S).
Restricted evolution is a progress relation on [L → L], and it is preserved by composition under the following hypotheses.
Proposition 3.4 If f 1 p|a g 1 , and f 2 p|a g 2 , and Remark 3.5 The notions of strong and diacritical evolution from our previous work (cf Section 2.1) can be related to the notions of (restricted) evolution of this paper just by unfolding the definitions: • f strongly evolves to g and h iff f p g and f a h.
• If f diacritically evolves to g and h, then f p g and f p|a h.
As a result, we reuse the evolution results of our previous papers in the examples about normal-form bisimulation.
We use evolution and restricted evolution to define compatibility for pairs of monotone functions.
The diacritical companion is the greatest compatible pair, composed of the strong and weak companions, written respectively u and w: (u, w) = (s, f).(s, f) is compatible A pair (s, f) is compatible if each function is compatible w.r.t.passive progress.The conditions for active progress follow the intuitions hinted before: first, the strong component s evolves towards the weak one, since any up-to technique, not necessary strong ones, can be used after the active progress.Second, the weak component f uses restricted evolution, as f may require the elements of L to passively progress to themselves before making an active progress.
Example 3.7 In deterministic languages, simulation up to reduction [13] allows terms to reduce before being related: we can therefore ignore the intermediary reduction steps and reason in a big-step manner even with a small-step semantics.The definition of the corresponding technique in the λ-calculus is as follows.
In [3], we show that red p red ∪ id and red a red ∪ id, but since id red, we have in fact red p red and red a red.The latter implies that red p|a red, therefore the pair (red, red) is compatible.
Example 3.8 We give an example of technique for which restricted evolution is needed.We define

x}
The technique ectx allows to factor out different evaluation contexts, as long as these contexts are related when plugged with a fresh variable.Similarly, subst allows to reason up to substitution of related values.We prove in [3] that subst p subst and subst a ectx • subst 2 .In contrast, we need restricted evolution to conclude about ectx.We sketch the subcase which illustrates why.
Let R, S be such that R p R and R a S, and suppose we have x R e 2 and y v 1 R E 2 [y] for a fresh y.Since x v 1 is an open-stuck term, we have to show that E 2 [e 2 ] also reduces to an open-stuck term.Because x R e 2 and R p R, there exists v such that e 2 → * v and x z R v z for a fresh z.
. Because R a S and subst a ectx • subst 2 , we know that E 2 [v] reduces to an open-stuck term as well.Without restricted evolution, we would have , with S instead of R, and since we do not have any progress hypothesis about S, it would not be possible to go further.
More generally, we can show that ectx p ectx and ectx p|a ectx • subst 2 [3].The pair (subst, ectx) is not compatible, but we still show it is below the diacritical companion in Section 4.
Compatibility for pairs behaves like regular compatibility.In particular, the composition of two compatible pairs produces a compatible pair.Proposition 3.9 (iv) Let R be a simulation, and R the function constant to R. The pair ( R, R) is compatible.
Proof.The proofs follow from a straightforward unfolding of the definitions.Item (i) uses Propositions 2.5 and 3.4.Like Pous' companion, u and w are idempotent and above id.Besides, similarity can be characterized using w.Proposition 3.10 Let R ∈ L. The following holds: Proof.Item (i) follows from Proposition 3.9, item (ii).Item (ii) is a direct consequence of (i).To prove (iii) we check that (u • u, w • w) is compatible using the items (i) and (iii) of Proposition 3.9.Because ν( p , a ) is a simulation, we derive (iv) from the item (iv) of Proposition 3.9.
Finally, for (v), we already know that ν( p , a ) w(⊥) with (iv).For the reverse inequality, we show that w(⊥) is a simulation.By definition of ⊥, we have ⊥ p ⊥ and ⊥ a ⊥.Because (u, w) is compatible, we get w(⊥) p w(⊥) and w(⊥) a w(⊥), as wished.There is no corresponding property for u.
With these properties, we can show the main result of this section, that the diacritical companion is indeed an up-to technique.
Proof.By the first item of Proposition 3.10, we have R (w • u)(R).We show that (w • u)(R) is a simulation to conclude.From the hypotheses of the theorem, compatibility and idempotence of the companions, we get Therefore u(R) p u(R) and u(R) a w(R) because p and a are progress relations.Using again the compatibility of the diacritical companion, we deduce w(u(R)) p w(u(R)) and w(u(R)) a w(w(R)), but w(w(R)) w(R) = w(id(R)) w(u(R)) using the properties of Proposition 3.10.In the end, we obtain w(u(R)) p w(u(R)) and w(u(R)) a w(u(R)), as wished.
An immediate consequence is that any pair of monotone functions below the companion is an up-to technique.
Corollary 3.12 If (s, f) (u, w) then (s, f) is an up-to technique.

Higher-Order Diacritical Companion
Example 3.8 shows that some interesting up-to techniques are not compatible.Yet, we can show they are below the diacritical companion, by turning to higher-order.

Definition and Properties
The key observation for this section is that the diacritical companion can be defined coinductively, by defining passive and active progresses on pairs of monotone functions.We write L ↑ as a shorthand for the complete lattice Passive and active evolutions are progress relations over L ↑ .By definition, a compatible pair (s, f) verifies (s, f) p =⇒ (s, f) and (s, f) a =⇒ (s, f), i.e., it is a simulation for p =⇒ and a =⇒.Consequently, the corresponding similarity is the diacritical companion, meaning that (u, w) = ν( p =⇒, a =⇒), and we can apply the theory of Section 3 to the lattice L ↑ .
A compatible pair for L ↑ is composed of functions in [L ↑ → L ↑ ], which we denote with capital letters.The higher-order diacritical companion, written (U, W), is the diacritical companion defined w.r.t.p =⇒ and a =⇒.A first result we show by going higher-order is that u is below w; it means that any function below u can be used as a strong or weak component of an up-to technique.In particular, if s u, then (s, s) is an up-to technique.Proof.By Theorem 3.11, it is enough to show that (u, u) p =⇒ U(u, u) and (u, u) a =⇒ W(u, u).For the former, we prove that (u, u) p =⇒ (u, u), and then use item (i) of Proposition 3.10.But since (u, w) is compatible, we have in particular u p u, from which we deduce (u, u) =⇒), item (iv) of Proposition 3.10 then gives us (u, w) W(u, u).Because (u, w) is compatible, we already have u a w, which in turn entails u p|a w.We therefore have (u, u) a =⇒ (u, w), as wished.
Theorem 3.11 is the main technique to show that a pair (s, f) is below (u, w); we rephrase it to make its application easier in the higher-order setting.First of all, remember that the codomain of U and W is a product , which we decompose using projections.Let Then for all (s, f) ∈ L ↑ , we have U(s, f) = (U str (s, f), U wk (s, f)) and W(s, f) = (W str (s, f), W wk (s, f)).With these functions and by unfolding the definitions of p =⇒ and a =⇒, Theorem 3.11 can be presented as follows.
then (s, f) (u, w) and (s, f) is an up-to technique.
Following the first-order intuition, U contains the enhancements allowed after passive evolution, and W the ones after active evolution.More precisely, U str contains the enhancements allowed after the evolution of the strong component s, and U wk those after the weak component f.Due to the asymmetric nature of active evolution, W wk is used for both components.These functions combine s and f in some way; the question is then which combinations are allowed in the different cases.We provide some answers with the help of the following auxiliary lemma.Lemma 4.4 Let (s, f) ∈ L ↑ .We define: The pairs (D 1 , D 2 ) and (C, C) are compatible.
We relate the higher-order companions to the first-order functions and show how they can be composed.For sake of completeness, we give the properties of W str even though it is not used in Corollary 4.3.
Proposition 4.5 Let (s, f) ∈ L ↑ .The following holds: Proof.By Proposition 3.10, we know that id U and id W, which imply (s, f) U(s, f) and (s, f) W(s, f), i.e., s U str (s, f), f U wk (s, f), s W str (s, f), and f W wk (s, f).The remaining inequalities of (i) then follow from items (xi) and (x).Similarly, item (iv) of Proposition 3.10 gives us (u, w) U(s, f) and (u, w) W(s, f), from which we deduce the inequalities in (iii) and (iv).Item (v) follows from (iii) and the fact that id u, and (vi) is a direct consequence of the idempotence of the (higher-order) companion.
To prove (vii) and (viii), we remark that D 1 U and D 2 W hold by Lemma 4.4.Using idempotence of the higher-order companions, we have the following sequences of inequalities.
Unfolding the definition of D 1 and D 2 and taking the appropriate projections give us the inequalities in (vii) and (viii).Similarly, we prove (ix) using compatibility of the pair (C, C).Item (x) simply recasts Proposition 4.2 in the higher-order setting, and (xi) can be derived from (viii) and (v).
Items (v) and (vii) imply that U str (s, f), W str (s, f), and W wk (s, f) are in fact idempotent.This property does not hold for U wk (s, f), as shown by the following counterexample.x f(R) y x R y x z f(R) y z Our goal is to apply Corollary 4.3 to the pair (⊥, f) to eventually show it is an up-to technique.To this end, we study how f evolves w.r.t.
p and p|a .
We first show that f p f • f.Let R, S such that R p S; we want f(R) p f(f(S)).Let e 1 f(R) e 2 ; for passive progress, e 1 must be a value, which is possible only if the first rule defining f has been used.Therefore, we have x f(R) y, and we want x z f(f(S)) y z for a fresh z, which holds by definition of f.We also show that f p|a f • f.Let R, S such that R p R and R a S; we want f(R) a f(f(S)).For active progress, only the terms related by the second rule are concerned, i.e., we have x z f(R) y z with x R y.Because x z and y z are open-stuck terms, we need to show that x = y and x z f(f(S)) x z for a fresh x .Again, the latter holds by definition of f.From x R y and R p R, we know that x z R y z for a fresh z .But these terms are open-stuck, so R a S implies that x = y, as wished.
As a result, we have f then we can apply Corollary 4.3, and show that f w, which in turn implies that any two variables are normalform bisimilar, a contradiction.
Fortunately, we still have some weaker properties about how U wk can be composed.The property (viii) shows that any technique allowed after the p-evolution of s can be composed on the left of U wk , like, for instance, s itself, since we have s U str (s, f).Similarly, item (ix) allows to compose any technique below w on the right of U wk .These properties differ from our previous work, where a weak candidate f should p-evolve towards a function g ).The pair (set S , set F ) satisfies the conditions of Theorem 4.12, and is therefore below (u, w).

Symmetry
So far, the results and examples are phrased in terms of simulation and similarity.As in Pous [11], we show that assuming symmetry of the underlying progress relations, we can go from the similarity to the bisimilarity.Let i ∈ [L → L] be an involution, i.e., i • i = id.An element R ∈ L is symmetric if i(R) = R, and a function Let (s, f, g) ∈ (L ↑ ) 3 such that g is symmetric, and F ∈ {U str , U wk , U rc , W str , W wk }.Then: (i) g b F(s, f) iff g b F(s, f); (ii) g b|b F(s, f) iff g b|b F(s, f).
Proof.The left-to-right implications are by hypothesis on b , so we focus on the right-to-left ones.First, we show that (i, ⊥) is compatible.Indeed, let R b S; then R b S and i(R) b i(S).Since i is involutive, we have i(i(R)) b i(i(S)) and i(R) b i(S), i.e., i(R) b i(S), as wished.Therefore, i u w.
For the first-order property, from i f, i • i = id, and idempotence of the companions, we deduce i • f = f.Therefore, R b f(S) implies R b i(f(S)), i.e., i(R) b i(f(S)) since R is symmetric.In the end, we have R b f(S), as expected.
For the higher-order properties, we first notice that i • F(s, f) = F(s, f) = F(s, f) • i.If F ∈ {U str , W str , W wk }, then i • F(s, f) u • F(s, f) F(s, f) • F(s, f) F(s, f) using items (iii) and (vi) of Proposition 4.5.From i • F(s, f) F(s, f), we get i • i • F(s, f) i • F(s, f), i.e., F(s, f) i • F(s, f), and therefore i • F(s, f) = F(s, f).The proof for F(s, f) • i = F(s, f) is similar.If F = U wk , the proof is the same using the items (viii) and (ix) of Proposition 4.5, and for F = U rc , use item (iv) of Proposition 4.11 and item (iii) from the definition of U rc .We now prove item (i) of Proposition 4.13, the proof for (ii) being similar.Let R b S; then R b S and i(R) b i(S).Because g b F(s, f), it implies g(R) b F(s, f)(S) and g(i(R)) b F(s, f)(i(S)).Because g is symmetric and F(s, f) • i = i • F(s, f), the last progress can be rewritten as i(g(R)) b i(F(s, f)(S)), meaning that g(R) b F(s, f)(S) holds, and g b F(s, f).

Conclusion
In this paper, we propose, through the diacritical companion, a sufficient criterion to show in the presence of passive and active progresses that a function is an up-to technique.The key change compared to our previous work is the decomposition of an up-to technique into its strong and weak components, allowing a definition of active evolution where a strong component may evolve to a weak one.The diacritical companion enjoys most of the properties of Pous' companion, and in particular, when considered in the higher-order setting, it provides a proof technique to show that a pair of functions is below the first-order diacritical companion.A natural future work is then to investigate if the subsequent characterizations of Pous' companion [9,16,12,2] scale to the diacritical one.

Example 4 . 6
We consider normal-form simulation in the λ-calculus as in the previous examples, and define the function f by the following rules, where x, y, and z are any variables.
For binary relations, i is the usual inverse• −1 .Let b ∈ { p , a }; suppose there exists b such that b = b ∧ i • b • i.Then for all (b, b ) ∈ {p, a} 2 , we also have b = b ∧ i • b • i and b|b = b|b ∧ i • b|b • i.We can relate progresses and evolutions as follows.Proposition 4.13 Let (R, S) ∈ L 2 such that R is symmetric, and f ∈ {u, w}.Then R b f(S) iff R b f(S).
1 • f • g 2 such that g 1 and g 2 are built from strong candidate functions (cf.Section 2.1).We still have and f p|a set ω F , and therefore set S p set ω S , set S a set ω F , set F p set ω S • set F • set ω S , and set F p|a set ω F .It is easy to show by induction that set ω S U str (set S , ⊥) and set ω F W wk (set S , set F ).As a result, we have set ω S • set F • set ω S U str (set S , ⊥) • U wk (set S , set F ) • U str (set S , ⊥) U rc (set S , set F