text
stringlengths
128
2.05k
11. Acknowledgements A.M. Grundland was partially supported by the research grant ANR-11LABX-0056-LMHLabEX LMH (Fondation Mathématique Jacques Hadamard, France) and an Operating Grant from NSERC, Canada. J. de Lucas and A.M. Grundland acknowledge partial support from HARMONIA 2016/22/M/ST1/00542 of the National Science...
# Source: arxiv 1807.01870 # Title: Formalisation in Constructive Type Theory of Barendregt's Variable Convention for Generic Structures with Binders # Sections: all # Downloaded: 2026-03-03T02:31:02.129961+00:00
Formalisation in Constructive Type Theory of Barendregt's Variable Convention for Generic Structures with Binders Abstract We introduce a universe of regular datatypes with variable binding information, for which we define generic formation and elimination (i.e. induction /recursion) operators. We then define a generic...
Introduction The definition of functions by recursion on the description of datatypes is the basic idea of generic programming. This method is based on defining a datatype, introduced as the universe
, which contains datatype descriptions, such as ``a list is either empty or a pair consisting of a parameter and a sublist''. Indeed, the universe constructors correspond to the common notions ``either'', ``pair'', ``parameter'' and ``substructure'' abstracted out of informal descriptions such as the preceding one. The...
In this work we introduce a universe of regular trees extended with variables (i.e. names) and binding information. We first define generic formation and elimination (i.e. induction/recursion) operators over this universe. The inclusion of names and the notion of locality allow us to introduce a generic [MATH] -equival...
1.1 Related work Programming languages supporting native constructions to declare and manipulate abstract syntax with binders are presented by Shinwell, et. al in
, where an ML extension FreshML , and an OCaml extension Fresh O'Caml are respectively developed. These languages allow to deconstruct datatypes with binders in a safe way, that is, in the case of an abstraction inspection, a renaming with a freshly generated binder is computed for the abstraction body. In this way, th...
by introducing a denotational semantics of the object language FreshML into FM-sets (Fraenkel and Mostowski's sets). They prove that this denotational semantics matches the operational one. In this way, they are able to prove that values of the introduced abstract syntax with binders properly represent [MATH] -equivale...
Cheney carries out a similar work, but instead of developing a language extension, he implements a Haskell library called FreshLib . As the author does not implement a language from scratch, this work introduces generic programming techniques in its implementation to support the required level of genericity.
All previous works address common operations dealing with general structures with binders. Although some of these developments give proofs about the soundness of their approaches, their main concern is the implementation of meta-programs. In
, Lee et al. use generic programming techniques to develop mechanisations of formal meta-theory in the Coq proof assistant. This work allows the user to choose between nominal, locally nameless or de Bruijn first-order syntax. For each of these representations, they offer several infrastructure operations and their ass...
in their framework, validating their approach both for the locally nameless and the de Bruijn first-order syntax, and comparing some metrics of their approach against other solutions. However, their particular choice of universe makes it impossible to have more than one sort of binder per datatype. Hence, they cannot r...
, where there exist three distinct sort of binders: parameters, channels and ports within a concurrent calculus. We believe their work addresses reusing and usability in great manner, but lacks in extensibility and abstraction. By using this framework it is possible to reuse several operations and lemmas that hide some...
In , Licata and Harper codify a universe that mixes binding and computation constructions in Agda, where computations are represented as meta-level functions injected in the universe constructions, i.e., they embed a HOL syntax in their development. Their representation is based on a well-scoped de Bruijn representatio...
, a first-order many-sorted logic with equality, containing primitives for renaming via name-swapping, for freshness of names, and for name-binding. The swapping operation has much nicer logical properties than the more general, non-bijective forms of renaming. This operation provides a sufficient foundation for a theo...
, Urban and Tasson use ideas from Nominal Logic to construct a set of [MATH] -calculus terms modulo alpha, that is, identifying [MATH] -convertible terms. The construction is based on a HOAS syntax on top of Isabelle/HOL, deriving recursion and induction principles over this quotient set.
Our main motivation is to show it is feasible to formalise within constructive type theory [MATH] -iteration/ induction principles for a classical named syntax, deriving these principles from just simple structural induction on fist-order terms, where equality remains the simple definitional one, and not performing any...
We will show fragments of the Agda code, the complete version being available at: Universe of Regular Trees with Binders 2.1 Universe of (Codes of) Functors
We choose to build up a universe whose objects are codes to be interpreted as functions from Set to Set , i.e. as functors The actual datatypes To this effect, we introduce in Figure
the datatype Functor of codes, and the (mutually recursive-inductive) definition of the decoding function ⟦_⟧ and of the actual datatype
[MATH] associated to any given functor code [MATH] Notice first that the (inductive) definition of [MATH] by means of the constructor [MATH] indeed introduces it as the least fixed point of the functor corresponding to the code [MATH] . Now let us examine the codes and corresponding functors. The first three constructo...
For example, the types of natural numbers and of lists of natural numbers can be defined as follows: [MATH] [MATH] [MATH] [MATH]
In Figure we illustrate the use of the variables and binders constructions by encoding the [MATH] -calculus. We show the corresponding classical concrete syntax definition using comments, that are written following a dash to the right of each line. This definition has only one sort of variables identified with the sort...
We next introduce notation resembling the concrete syntax of the [MATH] -calculus and hiding away our universe code constructions.
\ExecuteMetaData [GenericProgramming/Examples/LambdaCalculus.tex]lambdaconstlam Next we present the codification of the System F. As this language also needs bindings at the type level, this encoding illustrates the use of two distinct sorts of identifiers, namely SortFTypeVars and SortλTermVars
\ExecuteMetaData [GenericProgramming/Examples/SystemF.tex]systemFmutrm In the preceding constructions we have chosen a simplification of the universe of regular tree datatypes presented in
, where recursive types are represented using [MATH] -types (from ). However, instead of the nominal approach traditionally used with recursive type binders, they use a well-scoped de Bruijn representation. Therefore, in order to properly interpret the full universe, a definition indexed by a context with the multiple ...
2.2 Map and Fold The classical definition of fold based on map that is usually introduced in category theory does not pass Agda's termination checker. The recursive call to fold is hidden inside a call to map, and because of this the termination checker cannot determine how map is using it. To make the fold operation p...
for a similar regular tree universe. In Figure we show our implementation of the function foldmap . We make use of Agda's implicit arguments feature, denoted by curly braces, to omit terms that the type checker can figure out for itself. For instance, we declare the [MATH] set argument as an implicit argument. The pres...
As an example, we define a function vars that counts the number of variable occurrences in a term of the [MATH] -calculus. We do so by instantiating it as a case of the fold operation in fig.
Next we present a particular useful instantiation of the fold operator, named foldCtx . This instantiation aims at reproducing some techniques related to the nominal syntax considered in our work. We introduce an extra argument with type μ C , which is used by the folded function [MATH] . This function is partially app...
\ExecuteMetaData [GenericProgramming/GPBindings.tex]foldCtx From this fold instance we can directly derive the naive substitution operation for the [MATH] -calculus. In order to do this, we next give the functor descriptor cF for the context argument. It represents the pair formed by the variable to be replaced and the...
\ExecuteMetaData [GenericProgramming/Examples/LambdaCalculus.tex]substcontext Next we define the function substaux (Figure ) to be folded which, given a term structure with the results of the recursive calls in its recursive positions, constructs the final result of the substitution. For the variable case, we check, as...
. In fact, this comparison would be pointless because, as we are using an iteration principle, we do not have access to the original abstraction body subterm. Note that we hide the universe codes on the right side of this definition by using the previously introduced [MATH] -calculus constructors.
Finally, we instantiate the foldCtx function with substaux , and its appropriate context pair to get the naive substitution operation.
\ExecuteMetaData [GenericProgramming/Examples/LambdaCalculus.tex]naivesubst 2.3 Primitive Induction We now develop a more generic elimination rule than the fold operation defined above. This elimination rule captures proof by induction, and is based on the recursion rule given by Benke et al. in
. However, our development departs from their work in the following points: Firstly, they derive an elimination rule for a simpler universe construction, based on one-sorted term algebras, and defined through signatures instead of functors. For instance, their universe does not allow the injection of previously defined...
This function receives a predicate [MATH] over the fixed point of a functor [MATH] , and an auxiliary functor [MATH] (with a similar functionality to the one used in the foldmap function). It returns a corresponding predicate of type ⟦ G ⟧ (μ F) → Set . This resulting predicate represents [MATH] holding for every recur...
We can now present our induction principle. We proceed in a similar way as we did above for the fold function. First, we introduce the fold-map fusion function foldmapFh (Figure ). Then, we use this function to directly derive the induction principle as a recursive instance of the fold-map fusion.
We next give an example of the use of this induction principle, namely proving that the application of the function vars to any lambda term is greater than zero. We introduce the predicate Pvars representing the property to be proved and an auxiliary lemma plus>0 , stating that the sum of two positive numbers is also p...
The proof that Pvars holds for every term is a direct application of the induction principle. The variable case is direct, while the application case is the application of the lemma plus>0 to the induction hypotheses. Finally, the abstraction case is a direct application of the induction hypothesis.
Name-Swapping We now turn to considering a very basic primitive of name-swapping, which will be used for defining [MATH] -conversion without a mention to substitution. This constitutes the foundation of the implementation of the general idea that principles of recursion and induction ought to be defined so as to work m...
[MATH] -conversion, thus allowing to mimic the usual pen-an-paper conventions that allow the choice of convenient representatives of the terms involved in a definition or proof. The name-swapping operation completely traverses a data structure, swapping occurrences (either free, bound or binding) of two given names of ...
We use an auxiliary function swapF , that takes functors [MATH] and [MATH] , and traverses the [MATH] structure until a recursive or embedded position is reached, from where we restart the [MATH] argument with either the original recursive functor [MATH] or the embedded functor respectively. Note that this treatment di...
We prove a generic lemma about the interaction between name-swapping and the iteration principle. This lemma is presented in Figure , and states that the fold instance with context information is well-behaved with respect to name-swapping, given that the respectively folded operation is also well-behaved. Its proof goe...
We are able to directly apply the preceding lemma to the [MATH] -calculus case in order to prove the result in Figure 10 This states that name-swapping commutes with substitution, which is particularly useful. We introduce the operator (∙) to denote the swapping of variables in terms. In the proof we use of the auxilia...
In a similar manner we introduce a generic function returning the free variables of terms, and prove several properties about its interaction with swapping, fold, and [MATH] -conversion.
Alpha Equivalence Relation. In Figure 11 we introduce the generic definition of the [MATH] -equivalence relation over our universe, named ∼α . Its definition follows a process similar to the one used before to implement generic functions over our universe. First, we define an auxiliary relation ∼αF , which is inductive...
, that is, we define that two abstractions are [MATH] -equivalent if there exists some list of variables [MATH] , such that for any given variable [MATH] not in [MATH] , the result of swapping the corresponding binders with [MATH] in the abstraction bodies is [MATH] -equivalent. Note that the swapping is performed only...
As we did before with name-swapping, we study how the iteration principle interacts with the introduced [MATH] -equivalence relation. We begin proving that the fold operation is [MATH] -compatible if it is applied to an also [MATH] -compatible function. We say a function is [MATH] -compatible iff it returns [MATH] -con...
As a direct corollary we get that the fold with context instance is [MATH] -compatible in its context argument provided the folded function is also [MATH] -compatible on its arguments (Figure 13 ).
We define other relations over our universe in a similar way as we have done for the [MATH] -equivalence relation. For instance, the notOccurBind relation holds if some given variable does not occur in any binder position within a term. In this relation we discard the name sort information. We do so to simplify our nex...
4.1 Alpha Fold We are now able to introduce a fold operation that works at the level of [MATH] -equivalence classes of terms, that is, it only defines [MATH] -compatible functions. First, we introduce the function bindersFreeElem that takes a list of variables [MATH] and an element [MATH] , and returns an element [MATH...
\ExecuteMetaData [GenericProgramming/AlphaInduction.tex]bindersfreealphaelem Based on this function, we next directly implement the [MATH] -fold principle as an instance of the fold with context function.
\ExecuteMetaData [GenericProgramming/AlphaInduction.tex]foldCtxalpha This iteration principle first finds a fresh term for a given context [MATH] , and then directly applies the fold operation over it. We developed this iteration principle following a different approach from the one taken in our previous work
, where we renamed the binders during the fold traverse. Instead, we chose to separate these two stages in order to reuse the previously defined fold operation and its properties.
We can now properly justify the name ``alpha'' given to the introduced iteration principle. Firstly, as bindersFreeElem returns syntactical equal terms when applied to [MATH] -convertible terms, we have that our function is trivially strong [MATH] -compatible on its last term argument. Secondly, as a direct consequence...
Now we can derive the capture avoiding substitution operation for the lambda calculus example by a direct application of the introduced [MATH] -fold principle. In fact this definition is exactly the same as the one given before for the naive substitution, but using now the [MATH] -fold operation instead of the fold one...
\ExecuteMetaData [GenericProgramming/Examples/LambdaCalculus.tex]subst Substitution lemmas stating that substitution is well-behaved with respect to [MATH] -conversion are inherited from the [MATH] -compatibility of the iteration principle, only requiring the [MATH] -compatibility property of the substaux function. As ...
Next lemma in Figure 15 relates the presented [MATH] -fold principle with the previously defined one, giving sufficient conditions under which the two principles return [MATH] -convertible terms. First, the folded function must be [MATH] -compatible on its two arguments, and also well-behaved with respect to name-swapp...
We can instantiate this lemma to the [MATH] -calculus to get sufficient conditions under which the two presented substitution operations are [MATH] -convertible. Its proof requires two lemmas about the substaux function, one stating that it is [MATH] -compatible, and the other one stating that it is well-behaved under ...
4.2 Alpha Induction Principle In this section we generalise previous works , developing an [MATH] -induction principle for [MATH] -compatible predicates. Our presentation introduces an explicit premise about the [MATH] -compatibility of the predicate being proved, which in general is not explicitly mentioned in informa...
We state this principle in Figure 16 . Its proof is similar to the [MATH] -fold principle's proof. We firstly use the function bindersFreeElem (from Section 4.1 ) over the parameter [MATH] and the freshness context [MATH] to get an [MATH] -equivalent term [MATH] with binders not occurring in the list [MATH] Then we app...
[MATH] Finally, we apply the proof of predicate [MATH] to the term [MATH] and its freshness hypothesis to obtain that [MATH] must hold. Hence, as the predicate [MATH] is [MATH] -compatible, and [MATH]
[MATH] [MATH] , we get that [MATH] should also hold. The proof of [MATH] is done using an auxiliary lemma which recursively reconstructs a proof of fihalpha
[MATH] given that fih [MATH] holds and that the binders of [MATH] do not occur in the context [MATH] . This proof is just a generalisation of the one already presented in
for an equivalent [MATH] -induction principle for [MATH] -calculus. In this previous work we were also able to prove the Church-Rosser theorem for the [MATH] -calculus using this equivalent induction principle. Therefore, we conjecture that following the same procedure we would be able to achieve the confluence of [MAT...
Codification of a BVC proof technique. In Figure. 17 we show a result that validates the BVC and usual practices in common pen-and-paper proofs within our generic framework. It states that for any [MATH] -compatible predicate [MATH] , we can prove [MATH] for any term [MATH] by just proving it for terms whose binders ar...
To prove [MATH] for arbitrary [MATH] , we proceed as follows: We first find a fresh enough term [MATH] such that [MATH] using the function bindersFreeElem Then, we can use the hypothesis for the fresh term [MATH] to derive that [MATH] holds. Finally, [MATH] must also hold, as [MATH] is [MATH] -compatible. We do not sho...
Next we illustrate the use of this result to prove the substitution composition lemma for System F. First, we prove this lemma for the naive substitution operation. Next we introduce the property to be proved. Note that an extra freshness premise stating that [MATH] does not occur bound in the term [MATH] is required, ...
\ExecuteMetaData [GenericProgramming/Examples/SystemF.tex]substnaivecompositionpredicate The proof is done using the structural induction principle (Figure ). We show below the interesting abstraction case:
\ExecuteMetaData [GenericProgramming/Examples/SystemF.tex]substncompositionabstractioncase This equational proof is constructed following the usual pen-and-paper practice: First we push the substitution inside the abstraction. Then, by the induction hypothesis we know that the composition of substitutions in the abstra...
Now we prove the substitution composition lemma for the capture-avoiding substitution operation using the introduced [MATH] -proof technique. We begin by defining the functor describing a triple of terms TreeTermF . Then, we introduce the predicate PSComp over triples, stating the composition lemma for the substitution...
\ExecuteMetaData [GenericProgramming/Examples/SystemF.tex]substcompositionpredicate We prove that PSComp is [MATH] -compatible with respect to triples of terms by a direct equational proof using basically the previous substitution lemmas. In Figure 18 we show the core of the proof. It uses the preceding substitution le...
Finally, we can use the introduced [MATH] -proof principle with the previous proof obligations to finish the proof. Note how, by applying the [MATH] -proof technique to a triple of terms, we were able to get sufficient freshness premises to develop a proof similar in structure to pen-and-paper ones in a direct manner. ...
Conclusions We address the formalisation of a general first order named syntax with multi-sorted binders by applying a combination of generic programming and nominal techniques to derive fold operations, name-swapping, the [MATH] -conversion relation, and [MATH] -induction/iteration principles for any language abstract...
Our work uses generic programming techniques to develop the meta-theory of abstract syntax with binders in a general way as in related works. But we choose to maintain names for binders like as usually done in informal practice. On the other hand, contrary to the historical standpoint, following ideas in
, we give [MATH] -conversion a more fundamental role than that of the definition of substitution. Indeed, we verify that the name-swapping is powerful enough to define a theory of structural induction/recursion modulo [MATH] in a general way.
We generalise the [MATH] -recursion/induction principles developed in . In these previous works we renamed binders within the fold traversal. Instead, in this work we separate these stages, managing to reuse the fold operation and its properties. We also present an [MATH] -proof technique which is not based on an induc...
Generic programming techniques are capable of further improvements as the one considered in , where a more modular assembly is introduced, enabling a more structured approach to the reuse of meta-theory formalisations through the composition of modular inductive definitions and proofs. The present work does not directl...
In Reynold's parametricity theory is used to prove the [MATH] -compatibility property of a big step semantics using reflection within Coq. They introduce a lambda calculus terms interface, and by a formalisation of Reynold's parametricity, they prove that polymorphic functions (over this interface) applied to related i...
# Source: arxiv 1807.01934 # Title: Directed Continuous-Time Random Walk with memory # Sections: all # Downloaded: 2026-03-03T04:47:26.381363+00:00
Directed Continuous-Time Random Walk with memory Received: date / Revised version: date Abstract We propose a new Directed Continuous-Time Random Walk (CTRW) model with memory. As CTRW trajectory consists of spatial jumps preceded by waiting times, in Directed CTRW, we consider the case with only positive spatial jumps...
pacs: 89.20.-a 89.75.-k 05.40.-a 89.65.Gh Introduction In 1956 two physicists Montroll and Weiss, in the context of dispersive transport diffusion, introduced a new stochastic process they named Continuous-Time Random Walk (CTRW) montroll1965 . As dynamics of many complex systems can be described by discrete spatiotemp...
Since its introduction, the elegant and flexible concept of CTRW found many applications and inspired at least three generations of scientists. It is worth to mention that recently The European Physical Journal B published a special issue titled ”Continuous Time Random Walk fifty years on”. The extended introduction to...
CTRW was initially introduced to describe a photocurrent relaxation in amorphous films SM pfister1978 shlesinger1984 weiss1994 bouchaud1990 . A broad spectrum of other applications and arrangements contains: diffusion in probabilistic fractal structures (percolations clusters ben2000 and fractal diffusion HILFER200335 ...
In the majority of cases, the analyzed CTRW models focus on the spatial distribution with zero mean or even symmetric distribution. In other words, the drift term is usually neglected. The case of drift was studied in metzler2000 (and references therein). The case of canonical CTRW, where both spatial and temporal dist...
The other promising branch of CTRW models is the one considering memory, i.e., the dependence between successive jumps. Different types of dependencies were already studied: the backward or forward correlations between spatial jump directions haus1987 in the case of concentrated lattice gas for the study of the tracer ...
Our work is directly motivated by the application of CTRW in the description of high-frequency financial data. The universal properties of all financial price time series are sometimes referred to as stylized facts Tsay RCont2001 . There are two well known stylized facts about autocorrelation of price time series. The ...
The paper is organized as follows: in Section we present the motivation of our work and define and solve the proper stochastic process. In Section we obtain Velocity Autocorrelation Function (VAF) and in Section the comparison with empirical data is made. The intraday-seasonality is taken into account in Section . Fina...
Model We construct a directed continuous-time random walk (CTRW) process with assumptions analogical to ones used in TG_1 but focused on the absolute values of spatial jumps. This process models stock prices, the value of the process at time [MATH] represents the stock price at the corresponding time. A change of its v...
[EQUATION] where [MATH] and [MATH] are respectively distribution of jump modules and conditional distribution of jump modules. Parameter [MATH] describes the strength of the memory, for [MATH] we obtain the model without memory. Considering directed CTRW of absolute values of price changes, Dirac delta describes the sa...
[EQUATION] where [MATH] represents the waiting time distribution (WTD). Results will be presented for any WTD and in two specific cases.
We cannot use the same waiting time distribution for the first jump as for other jumps JT JKT . This is because the previous (preinitial) jump might have occured at any time before t = 0. Therefore, we should define
[EQUATION] as the waiting time distribution before the first jump. Moreover, for simplicity of notation it is useful to introduce sojourn probability [MATH] . Above probabilities can be easily expressed in the Laplace domain:
[EQUATION] where [MATH] denotes Laplace transform and [MATH] is expected (mean) waiting time. The intermediate dynamic quantity describing the stochastic process is the stochastic, sharp, [MATH] -step propagator [MATH] This propagator is defined as the conditional probability density that the price, which was initially...
[EQUATION] The first sharp propagator [MATH] can be calculated directly from definition [EQUATION] The following sharp propagators can be calculated using Eq. ( ). After integrating over [MATH] we obtain the recursion relation
[EQUATION] Finally, we can write the relation between the soft propagator [MATH] , defined as the probability density that process will be in [MATH] at the time [MATH] starting from [MATH] at the time [MATH] , and the sharp propagator [MATH] (in the Fourier-Laplace domain)
[EQUATION] To obtain explicit formula for the right hand side of Eq. ( ), in case of one-step memoru defined by Eq. ( ), we use the Z-transform in variable [MATH] and recurrence relation ( ). The result can be simplit substituted into Eq. ( ) and hence we obtain the soft propagator in the following form