Abdorrahim Bahrami

Elisabetta De Maria
email: elisabetta.de-maria@unice.fr

Amy Felty
email: afelty@uottawa.ca

Modelling and Verifying Dynamic Properties of Biological Neural Networks in Coq

Keywords: Biological network reconstruction and analysis, Modelling and simulation of biological processes and pathways, Human Neural Networks, Dynamic Properties, Leaky Integrate and Fire Model, Neuronal Modules, Archetypes, Formal Verification, Theorem Proving, Coq Proof Assistant

published or not. The documents may come   L'archive ouverte pluridisciplinaire

Introduction

In this work, we apply formal verification to verify the dynamic behavior of biological human neural networks. We focus on theorem proving, which can be used to show that a piece of software or a system is free of errors with respect to a formal model that is provided for it. In formal verification, often a model of the system is defined based on a transition graph [START_REF] Clarke | Model Checking[END_REF]. Each node in the graph represents a state of the system being modelled and each edge stands for a transition from a source to a destination state. Model checkers or theorem provers are often used to verify that specific properties of the system hold at particular states.

The field of systems biology is a more recent application area for formal verification, and such techniques have turned out to be very useful so far in this domain [START_REF] Gilbert | Advances in computational methods in systems biology[END_REF]. A variety of biological systems can be modelled as graphs whose nodes represent the different possible configurations of a system and whose edges encode meaningful configuration changes. It is then possible to define and prove properties concerning the temporal evolution of the biological species involved in the system [START_REF] Fages | Modelling and querying interaction networks in the biochemical abstract machine BIOCHAM[END_REF][START_REF] Richard | Graph-based modeling of biological regulatory networks: Introduction of singular states[END_REF]. This often allows deep insight into the biological system at issue, in particular concerning the biological transitions governing it, and the reactions the system will have when confronted with external factors such as disease, medicine, and environmental changes [START_REF] De Maria | Design, optimization and predictions of a coupled model of the cell cycle, circadian clock, DNA repair system, irinotecan metabolism and exposure control under temporal logic constraints[END_REF][START_REF] Talcott | Explaining response to drugs using pathway logic[END_REF]. By understanding and proving properties of a biological system, there is a higher chance of treating diseases and developing medicines that will be suited for them. Furthermore, weak points of the system can be detected and better prevention against disease and other external problems can be proposed. Finally, biological system recovery after damage has occurred can be studied and verified. In summary, behavior, disease, effects of medicine, external problems, environmental change impacts, and system recovery of a biological system can all be detected and verified using formal verification.

As far as the modelling of biological systems is concerned, in the literature we can find both qualitative and quantitative approaches. To express the qualitative nature of dynamics, the most used formalisms are Thomas' discrete models [START_REF] Thomas | Dynamical behaviour of biological regulatory networks-i. Biological role of feedback loops and practical use of the concept of the loop-characteristic state[END_REF], Petri nets [START_REF] Reddy | Petri net representations in metabolic pathways[END_REF], πcalculus [START_REF] Regev | Representation and simulation of biochemical processes using the pi-calculus process algebra[END_REF], bio-ambients [START_REF] Regev | Bioambients: An abstraction for biological compartments[END_REF], and reaction rules [START_REF] Chabrier-Rivier | Modeling and querying biochemical interaction networks[END_REF]. To capture the dynamics from a quantitative point of view, ordinary or stochastic differential equations are used extensively. More recent approaches include hybrid Petri nets [START_REF] Hofestädt | Quantitative modeling of biochemical networks[END_REF] and hybrid automata [START_REF] Alur | Hybrid modeling and simulation of biomolecular networks[END_REF], stochastic π-calculus [START_REF] Phillips | A correct abstract machine for the stochastic pi-calculus[END_REF], and rule-based languages with continuous/stochastic dynamics such as Kappa [START_REF] Danos | Formal molecular biology[END_REF]. Relevant properties concerning the obtained models are then often expressed using a formalism called temporal logic and verified thanks to model checkers such as NuSMV [START_REF] Cimatti | NUSMV: A new symbolic model verifier[END_REF] or PRISM [START_REF] Kwiatkowska | PRISM 4.0 2001 Verification of probabilistic real-time systems[END_REF].

In [START_REF] De Maria | A Logical Framework for Systems Biology[END_REF], the authors propose the use of modal linear logic as a unified framework to encode both biological systems and temporal properties of their dynamic behavior. They focus on a model of the P53/Mdm2 DNA-damage repair mechanism and they prove some desired properties using theorem proving techniques. In [START_REF] Rashid | Formal reasoning about systems biology using theorem proving[END_REF], the authors advocate the use of higher-order logic to formalize reaction kinetics and exploit the HOL Light theorem prover to verify some reaction-based models of biological networks. Finally, the Porgy system is introduced in [START_REF] Andrei | Strategy-Driven Exploration for Rule-Based Models of Biochemical Systems with Porgy[END_REF]. It is a visual environment which allows modelling of biochemical systems as rule-based models. Rewriting strategies are used to choose the rules to be applied.

As far as human neural networks are concerned, there is recent work that has focused on their formal verification. In [START_REF] De Maria | Verification of Temporal Properties of Neuronal Archetypes Modeled as Synchronous Reactive Systems[END_REF][START_REF] De Maria | Modelling and Formal Verification of Neuronal Archetypes Coupling[END_REF], the authors consider the synchronous paradigm to model and verify some specific graphs composed of a few biological neurons. These graphs or mini-circuits, characterized by biologically relevant structures and behaviors, are referred to as archetypes and constitute the fundamental elements of neuronal information processing. They can be coupled to create the elementary building blocks of bigger neuronal circuits. For this reason, their study has become an emerging question in the domain of neurosciences, especially for their potential integration with neurocomputational techniques [START_REF] Markram | The blue brain project[END_REF]. Furthermore, understanding these micro-circuits can help in detecting weakly active or inactive zones of the human brain, and in identifying neurons whose role is crucial to perform some vital activities, such as breathing or moving.

In the work proposed in [START_REF] De Maria | Verification of Temporal Properties of Neuronal Archetypes Modeled as Synchronous Reactive Systems[END_REF][START_REF] De Maria | Modelling and Formal Verification of Neuronal Archetypes Coupling[END_REF], some model checkers such as Kind2 [START_REF] Hagen | Scaling up the formal verification of Lustre programs with SMT-based techniques[END_REF] are employed to automatically verify properties concerning the dynamics of six basic archetypes and their coupling. However, model checkers prove properties for some given parameter intervals, and do not handle inputs of arbitrary length. In our work, we use the Coq Proof Assistant [START_REF] Bertot | Interactive Theorem Proving and Program Development[END_REF] to prove four important properties of neurons and archetypes. Coq implements a highly expressive higher-order logic in which we can directly introduce datatypes modelling neurons and archetypes, and express properties about them. As a matter of fact, one of the main advantages of using Coq is the generality of its proofs. Using such a system, we can prove properties about arbitrary values of parameters, such as any length of time, any input sequence, or any number of neurons. We use Coq's general facilities for structural induction and case analysis, as well as Coq's standard libraries that help in reasoning about rational numbers and functions on them. We believe the approach introduced in this paper for reasoning about neural networks is very promising, because it can be exploited for the verification of other kinds of biological networks, such as gene regulatory, metabolic, or environmental networks.

The paper is organized as follows. In Section 2, we introduce the state of the art relative to neural network modelling and the application of formal methods in this domain. In Section 3, we describe the computational model we have chosen, the Leaky Integrate and Fire model (LI&F), and we briefly introduce some basic archetypes. In Section 4, we introduce the Coq Proof Assistant. In Section 5, we present our model of neural networks in Coq, which includes definitions of neurons, operations on them, and combining them into archetypes. In Section 6, we present and discuss four important properties, starting with properties of single neurons and the relation between the input and output, and moving toward more complex properties that express their interactions and behaviors as a system. We provide a full proof of the first property; the remaining proofs are found in the appendix at the end of this paper. Finally, in Section 7, we conclude and discuss future work. The accompanying Coq code can be found at: http://www.site.uottawa.ca/~afelty/csbio18/.

Background

Neurons are the smallest unit of a neural network [26]. They are basically just a single cell. We can consider them simply as a function with one or more inputs and a single output. A human neuron receives its inputs via its dendrites. Dendrites are short extensions connected to the neuron body, which is called a soma. Inputs are provided in the form of electrical pulses (spikes). For each neuron there is another extension, called the axon, which plays the role of output. This extension is also connected to the cell body, but it is longer than the dendrites. Each neuron has its own activation threshold which is coded somehow inside the soma. When the sum of the spikes received by a neuron through its dendrites passes its threshold, the neuron fires a spike in the axon. Neurons can be connected to other neurons. Connections happen between the axon of a neuron and a dendrite of another neuron. Theses connections are called synaptic connections and the location of the connection is called a synapse. They are responsible for transmitting signals between neurons.

In this paper, we consider third generation models of neural networks. They are known as spiking neural networks [START_REF] Paugam-Moisy | Computing with spiking neuron networks[END_REF] and have been proposed in the literature with different complexities and capabilities. In this work we focus on the Leaky Integrate and Fire (LI&F) model originally proposed in [START_REF] Lapicque | Recherches quantitatives sur l'excitation electrique des nerfs traitee comme une polarization[END_REF]. It is a computationally efficient approximation of a single-compartment model [START_REF] Izhikevich | Which model to use for cortical spiking neurons[END_REF] and is abstract enough to be able to apply formal verification techniques. In such a model, neurons integrate present and past inputs in order to update their membrane potential values. Whenever the potential exceeds a given threshold, an output signal is fired.

As far as spiking neural networks are concerned, in the literature there are a few attempts at giving formal models for them. In [START_REF] Aman | Modelling and verification of weighted spiking neural systems[END_REF], a mapping of spiking neural P systems into timed automata is proposed. In that work, the dynamics of neurons are expressed in terms of evolution rules and durations are given in terms of the number of rules applied. Timed automata are also exploited in [START_REF] De Maria | Parameter Learning for Spiking Neural Networks Modelled as Timed Automata[END_REF] to model LI&F networks. This modelling is substantially different from the one proposed in [START_REF] Aman | Modelling and verification of weighted spiking neural systems[END_REF] because an explicit notion of duration of activities is given. Such a model is formally validated against some crucial properties defined as temporal logic formulas and is then exploited to find an assignment for the synaptic weights of neural networks so that they can reproduce a given behavior.

Another recent application of formal methods in computer science to neuro-sciences is given in [START_REF] De Maria | Verification of Temporal Properties of Neuronal Archetypes Modeled as Synchronous Reactive Systems[END_REF][START_REF] De Maria | Modelling and Formal Verification of Neuronal Archetypes Coupling[END_REF], where the authors model LI&F neurons and some basic small circuits using the synchronous language Lustre. Such a language is dedicated to the modelling of reactive systems, i.e., systems which constantly interact with the environment and which may have an infinite duration. It relies on the notion of logical time: time is considered as a sequence of discrete instants, and an instant is a point in time where external input events can be observed, computations can be done, and outputs can be emitted. Lustre is used not only to encode neurons and some basic archetypes (simple series, parallel composition, etc.), but also some properties concerning their dynamic evolution. Some model checkers are then employed to automatically prove these properties for some given parameter intervals.

LI&F networks extended with probabilities are formalized as discrete-time Markov chains in [START_REF] De Maria | A Modelchecking Approach to Reduce Spiking Neural Networks[END_REF]. The proposed framework is then exploited to propose an algorithm which reduces the number of neurons and synaptic connections of input networks while preserving their dynamics.

Leaky Integrate and Fire Model and Neuron Modules

Leaky Integrate and Fire (LI&F) networks [START_REF] Maass | Networks of spiking neurons: The third generation of neural network models[END_REF] can be seen as directed weighted graphs whose nodes stand for neurons and whose edges represent synaptic connections. The signals propagating over synapses are trains of impulses and they are referred to as spikes. Synapses may modulate these signals according to their weight: excitatory if positive, or inhibitory if negative.

The dynamic behavior of neurons is guided by their membrane potential (or, simply, potential), which represents the difference of electrical potential across the cell membrane. The membrane potential of each neuron depends on the spikes received over its input synapses. Both current and past spikes are taken into account, but the contribution of old spikes is less important. In particular, the leak factor is introduced to weaken the signals received in the past. The neuron outcome depends on the difference between its membrane potential and its firing threshold: it is enabled to fire (i.e., emit a spike over all its outgoing synapses) only whenever such a difference is positive. Immediately after each spike emission, the neuron membrane potential is reset to zero.

More formally, the following definition can be given for networks of LI&F neurons. Definition 1 (LI&F Neural Network). A LI&F Neural Network is a tuple (𝑉, 𝐸, 𝑤), where:

• 𝑉 is the set of LI&F neurons, • 𝐸 ⊆ 𝑉 × 𝑉 is the set of synapses, • 𝑤: 𝐸 → ℚ ∩ [-1,1]
is the synapse weight function associating a weight 𝑤 3,4 to each synapse (𝑢, 𝑣).

We distinguish three disjoint sets of neurons: 𝑉 8 (input neurons), 𝑉 89: (intermediary neurons), and 𝑉 ; (output neurons), with 𝑉 = 𝑉 8 ∪ 𝑉 89: ∪ 𝑉 ; .

A LI&F neuron is characterized by a tuple (𝜏, 𝑟, 𝑝, 𝑦), where:

• 𝜏 ∈ ℚ C is the firing threshold or activation threshold, • 𝑟 ∈ ℚ ∩ [0, 1] is the leak factor, • 𝑝: ℕ → ℚ is the [membrane] potential function defined as: 𝑝(𝑡) = ⎩ ⎨ ⎧ J 𝑤 8 . 𝑥 8 (𝑡), 𝑖𝑓 𝑝(𝑡 -1) ≥ 𝜏 O 8PQ J 𝑤 8 . 𝑥 8 (𝑡) + 𝑟 • 𝑝(𝑡 -1), 𝑖𝑓 𝑝(𝑡 -1) < 𝜏 O 8PQ ( 1
)
with 𝑝(0) = 0 and where 𝑥 8 (𝑡) ∈ {0, 1} is the signal received at the time 𝑡 by the neuron through its 𝑖 :W out of 𝑚 input synapses (observe that the past potential is multiplied by the leak factor while current inputs are not weakened),

• 𝑦: ℕ → {0, 1} is the neuron output function, defined as:

𝑦(𝑡) = Y 1 𝑖𝑓 𝑝(𝑡) ≥ 𝜏 0 𝑖𝑓 𝑝(𝑡) < 𝜏 (2)
The set of neurons of a LI&F neural network can be divided into input, intermediary, and output neurons. Each input neuron can only receive external signals as input and the output of each output neuron is considered as an output for the network. Output neurons are the only ones whose output is not connected to other neurons.

In neural networks, it is possible to identify some mini-circuits with a relevant topological structure. Each one of these small modules, which are often referred to as archetypes in the literature, displays a specific class of behaviors. They can be coupled together to form the elementary bricks of bigger neural circuits. In [START_REF] De Maria | Verification of Temporal Properties of Neuronal Archetypes Modeled as Synchronous Reactive Systems[END_REF], six basic archetypes have been identified and validated against some temporal logic properties thanks to model checking techniques [START_REF] Clarke | Model Checking[END_REF]. They are the following ones (see Figure 1 for a graphical representation): (a) simple series, which is a sequence of neurons where each element of the chain receives as input the output of the preceding one; (b) series with multiple outputs, which is a series where, at each time unit, we are interested in knowing the outputs of all the neurons (i.e., all the neurons are considered as output); (c) parallel composition, which is a set of neurons receiving as input the output of a given neuron; (d) negative loop, which is a loop consisting of two neurons-the first neuron activates the second one while the latter inhibits the former; (e) inhibition of a behavior, which consists of two neurons, the first one inhibiting the second one; and (f) contralateral inhibition, which is made by two or more neurons, each one inhibiting the other ones. In Figure 1, a solid black circle at the end of an edge shows an inhibitory connection and a regular arrow represents an excitatory connection. In this paper, we exploit Coq to prove more general properties concerning some of these archetypes.

The Coq Proof Assistant

In this section, we present the basic elements of Coq that we use to represent our model. More complete documentation of Coq can be found in [START_REF] Bertot | Interactive Theorem Proving and Program Development[END_REF][START_REF]Coq reference manual[END_REF]. Coq is a proof assistant that implements the Calculus of Inductive Constructions [START_REF] Coquand | The calculus of constructions[END_REF], which is an expressive higher-order logic. Using this software, we can express and prove properties in this logic. Expressions in the logic include a functional programming language. It is a typed language, which means that every Coq expression has a type. For instance, X:nat expresses that variable X is in the domain of natural numbers. The types used in our model include nat, Q, and list which denote natural numbers, rational numbers, and list of elements respectively. These types are found in Coq's standard libraries. Elements of a list have their own type. For instance, L:list nat means that L is a list of natural numbers. A list can be empty, which is written [] or nil in Coq. Functions are a basic element of any functional programming language. The general form of a function in Coq is shown in Figure 2.

Figure 2. General form for defining a function in Coq

Definition and Fixpoint are Coq keywords for defining non-recursive and recursive functions, respectively. Calling a function inside its body causes an error when Definition is used. After either one of these keywords comes the name that a programmer gives to the function. Following the function name are the input arguments and their types. If two or more inputs have the same type, they can be grouped as, for example, (X Y Z: Q) which means all variables X, Y, and Z are rational numbers. Following the inputs is a colon, followed by the type of the function. Finally, the body of the function is a Coq expression representing a program, followed by a dot.

Pattern matching is a useful method in Coq, used for case analysis. This feature is used, for instance, for distinguishing between base cases and recursive cases in recursive functions. For example, it can distinguish when a list is empty or not. The pattern for a non-empty list shows the first element of the list, which is called the head, followed by a double colon, followed by the rest of the list, which is called the tail. The tail of a list itself is a list of elements of the same type as the type of the head. For example, let L be the list (6::3::8::nil) containing three natural numbers.

An alternate notation for Coq lists allows L to be written as [6;3;8] where the head is 6 and the tail is [3;8]. Thus, the general pattern for non-empty lists often used in Coq recursive functions has the form (h::t). Another example of a Coq data type is the natural numbers. A natural number is either 0 or the successor of another natural number, written (S n), where n is a natural number. For example, 1 is represented as (S 0), 2 as (S (S 0)), etc. In Figure 3, some patterns for lists and natural numbers are shown using Coq's match…with…end pattern matching construct.

Figure 3. General form for pattern matching of natural numbers and lists in Coq

In addition to the data types that are defined in Coq's libraries, new data types can be defined. One way to do so is using records. Records can have different fields with different types. For example, we can define a record that has 3 fields Fieldnat, FieldQ, and ListField, which have types natural number, rational number, and list of natural numbers, respectively. Figure 4 shows the Coq syntax for the definition of this record with one additional field called CR. Fields in Coq can represent conditions on other fields. For example, field CR in Figure 4 is a condition on the Fieldnat field stating that it must be greater than 7. After defining a record, it is a type like any other type, and so for example, we can have variables with the new record type. Variable S shown with type Sample_Record in Figure 4 is an example.

Modelling Human Neural Networks in Coq

Record

Figure 5. Coq code defining a neuron and the weighted sum of its inputs

We illustrate our encoding of neural networks in Coq by beginning with the code in Figure 5. We use Coq's record structure to define a neuron. This record includes five fields with their types, and four fields which represent constraints that the first five fields must satisfy according to the LI&F model mentioned in Section 3. The types include natural numbers, rational numbers, and lists. In particular, a neuron's output (Output) is represented as a list of natural numbers, with one entry for each time step. The weights attached to the inputs of the neuron (Weights) are stored in a list of rational numbers, one for each input in some designated order. The leak factor (Leak_Factor), the firing threshold (Tau), and the most recent neuron membrane potential (Current) are rational numbers. With respect to the four conditions, for example, consider PosTau, which expresses that Tau must be positive. Qle_bool and other arithmetic operators come from Coq's rational number library. The other three state, respectively, that Output contains only 0s and 1s (it is a binary list), Leak_Factor is between 0 and 1 inclusive, and each input weight is in the range of [-1, 1]. We omit the definitions of Bin_List and WeightInRange used in these statements. The reader is referred to the accompanying Coq code.

Given a neuron N, we write (Output N) to denote its first field, and similarly for the others. To create a new neuron with values O, W, L, T, and C of the appropriate types, and proofs P1,…, P4 of the four constraints, we write (MakeNeuron O W L T C P1 P2 P3 P4).

The next definition in Figure 5 implements the weighted sum of the inputs of a neuron, which is an important part of the calculation in Equation [START_REF] Clarke | Model Checking[END_REF]. In this recursive function, there are two arguments: Weights representing 𝑤 Q , … , 𝑤 O and Inputs representing 𝑥 Q , … , 𝑥 O . The function returns an element of type Q. Its definition uses pattern matching on both inputs simultaneously. The body of the definition uses Booleans, the if statement, and the equality operator on natural numbers (beq_nat), all from Coq's standard library. Natural numbers, such as 0%nat above are marked with their type to distinguish them from rational numbers, whose types are omitted. Although, we always call the potential function with two lists of equal length, Coq requires functions to be total; when two lists do not have equal length, we return a "default" value of 0. Also, when we call this function, Inputs, which is the second argument of the function, will always be a binary list (contains only the natural numbers 0 and 1). Thus, when head of this list h2 is 0, we don't need to add anything to the final sum because anything multiplied by 0 is 0. In this case, we just call the function recursively on the remaining weights and inputs t1 and t2, respectively. On the other hand, when h2 is 1, we need to add h1, the head of Weights to the final sum, which again is the recursive call on t1 and t2.

Figure 6. Coq code defining neuron potential function

Figure 6 shows the NextPotential function, which implements 𝑝(𝑡) from Equation [START_REF] Clarke | Model Checking[END_REF]. Recall that (Current N) is the most recent potential value of the neuron which is 𝑝(𝑡 -1) in Equation ( 1). (Qle_bool (Tau N) (Current N)) represents 𝜏 ≤ 𝑝(𝑡 -1) and we use the potential function defined in Figure 5 for the part calculating the weighted sum of the neuron inputs. Finally, the last line implements 𝑟 • 𝑝(𝑡 -1).

Figure 7 on the next page contains two definitions. The first calculates the next output of the neuron which is 𝑦(𝑡) in Equation [START_REF] Gilbert | Advances in computational methods in systems biology[END_REF]. Recall that (NextPotential N Inputs) shown in Figure 6 calculates 𝑝(𝑡). Thus, the expression (Qle_bool (Tau N) (NextPotential N Inputs)) expresses the condition 𝜏 ≤ 𝑝(𝑡).

In our model, the state of a neuron is represented by the Output and Current fields. The Output field of a neuron in the initial state is [0%nat], which denotes a list of length 1 containing only 0. The Current field represents the initial potential, which is set to 0. A neuron changes state by processing input. After processing a list of 𝑛 inputs, the Output field will be a list of length 𝑛 + 1 containing 0's and 1's, and the Current field will be set to the value of the potential after processing these 𝑛 inputs. State change occurs by applying the NextNeuron function in Figure 7 to a neuron and a list of inputs. As is typical in functional programming, we represent a neuron at its later state by creating a new record with the new values for Output and Current and other values directly copied over. We store the values in the Output field in reverse order, which simplifies proofs by induction over lists, which we use regularly in our Coq proofs. Thus, the most recent output of the neuron is at the of head the list. We can see this in the code in Figure 7, where the new value of the output is ((NextOutput N Inputs)::(Output N)). The next output of the neuron is at the head, followed by the previous outputs. (NextPotential N Inputs) is the new value for (Current N). Recall that (Current N) is the most recent value of potential value of the neuron or 𝑝(𝑡 -1). So, for calculating the next potential value of the neuron or 𝑝(𝑡), the NextPotential function in Figure 6 is called.

Following the new values for each field of the neuron, we have proofs of the four constraints. The first requires a lemma NextOutput_Bin_List (statement omitted) which allows us to prove that the new longer list is still a binary list. Proofs of the other three constraints are carried over exactly from the original neuron, since they are about components of the neuron that do not change.

Figure 7. Coq functions for returning the next output and neuron structure after the next time step

To reinitialize a neuron to the initial state as described above, the ResetNeuron function is used. This function takes any Neuron as input, and returns a new one, with the Output, Current, and Output_Bin fields reset, while keeping the others.

So far, we have discussed the encoding and processing of single neurons in isolation, which take in inputs and produce outputs. The archetypes in Figure 1 illustrate some ways in which networks of neurons are connected. We have so far considered archetypes (a) and (e) in our work. We represent (a) as an ordered list of single input neurons (a Coq list of type list Neuron), where we assume that the output of a neuron in the list is connected to the input of the neuron occurring immediately following it, the input to the first is the input to the whole series, and the output of the last is the output of the whole series. To represent (e), we define Coq predicates that relate two neurons; an example is discussed further in Section 6.

Properties of Neural Networks and their Proofs

As mentioned earlier, we prove four basic properties of the LI&F model of neurons in this section. All of them have been fully verified in Coq. We start in the next section with a property about a simple neuron, which has only one input. We refer to this neuron as a single-input neuron.

In all of the statements of the properties, we omit the assumption that the input sequence of the neuron is a binary list and contains only 0s and 1s. It is, of course, included in the Coq code. We use several other conventions to enhance readability when stating properties and presenting proofs. For example, we state our properties using pretty-printed Coq syntax, with some abbreviations for our own definitions. For instance, we use mathematical fonts and conventions for Coq text, e.g., (Output N) is written 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁) , (Tau N) is written as 𝜏(𝑁) , (Weights N) is written 𝑤(𝑁), (Leak_Factor N) is written 𝑟(𝑁), and (Current N) is written 𝑝(𝑁). In addition, if 𝑤(𝑁) is a list of the form [𝑤 Q ; … ; 𝑤 9 ] for some 𝑛 ≥ 0, for 𝑖 = 1, … , 𝑛, we often write 𝑤 8 (𝑁) to denote 𝑤 8 . Also, we use notation and operators from the Coq standard library for lists. For instance, 𝑙𝑒𝑛𝑔𝑡ℎ and + are list operators; the former is for finding the number of elements in the list and the latter is the notation we will use here for list concatenation.

In addition, although for a neuron 𝑁, the list 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁) is encoded in reverse order in our Coq model, when presenting properties and their proofs here, we use forward order.

The Delayer Effect for a Single-Input Neuron

The first property is called the delayer effect property. Recall that a neuron is in an inactive state initially, which means the output of a neuron at time 0 is 0. When a neuron has only one input, and the weight of that input is greater than or equal to its activation threshold, then the neuron transfers the input sequence to the output without any change (except for a "delay" of length 1). For instance, if a single input neuron receives 0100110101 as its input sequence, it will produce 00100110101 as output. Neurons that have this property are not functional neurons. They are mainly just transferring signals. Humans have some of this type of neuron in their auditory system. This property is expressed as Property 1. Property 1. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) ≥ 𝜏(𝑁) → 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) = [0] + 𝑖𝑛𝑝𝑢𝑡 In the above statement, 𝑁 l denotes the neuron obtained by initializing 𝑁 and then processing the input (using 𝑅𝑒𝑠𝑒𝑡𝑁𝑒𝑢𝑟𝑜𝑛 and repeated applications of 𝑁𝑒𝑥𝑡𝑁𝑒𝑢𝑟𝑜𝑛). We use this convention in stating all of our properties. Note that in Definition 1, Equation (1), 𝑝 is a function of time. Time in our Coq model is encoded as the position in the output list. If 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁) has length 𝑡, then 𝑝(𝑁) stores 𝑝(𝑡 -1) from Equation (1). If we then apply 𝑁𝑒𝑥𝑡𝑁𝑒𝑢𝑟𝑜𝑛 to 𝑁 and the next input obtaining 𝑁 l , then 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) has length 𝑡 + 1 and 𝑝(𝑁 l ) stores the value 𝑝(𝑡) from Equation [START_REF] Clarke | Model Checking[END_REF].

In order to prove Property 1, we need the following lemma, which states that when a neuron has one input and its input weight is greater than or equal to its threshold, the potential value of that neuron is always non-negative. Lemma 1. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) ≥ 𝜏(𝑁) → 𝑝(𝑁′) ≥ 0

As explained above 𝑝(𝑁′) is the most recent value of the potential function of neuron 𝑁 , i.e., the one obtained after processing all of the input values. The proof of this lemmas is in the appendix. We use it here to prove Property 1. Proof (of Property 1). The proof is by induction on the length of the input sequence as follows.

Base case: 𝑖𝑛𝑝𝑢𝑡 = [] (the empty If there is no input in the input sequence, the neuron will keep its initial status, i.e., 𝑁 = 𝑁′.

So, 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) = [0] . Therefore, 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) = [0] = [0] + [] = [0] + 𝑖𝑛𝑝𝑢𝑡.
Induction case: We assume that the property is true for 𝑖𝑛𝑝𝑢𝑡 and we must show that it holds for some 𝑖𝑛𝑝𝑢𝑡′ of the form (𝑖𝑛𝑝𝑢𝑡 + [ℎ]) for some additional input value ℎ. Let 𝑁′ be the neuron resulting from processing 𝑖𝑛𝑝𝑢𝑡, and let 𝑁′′ be the neuron after processing 𝑖𝑛𝑝𝑢𝑡′. By the induction hypothesis, we know 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) = [0] + 𝑖𝑛𝑝𝑢𝑡 and we must prove that 𝑂𝑢𝑡𝑝𝑢𝑡i𝑁 ′′ j = [0] + 𝑖𝑛𝑝𝑢𝑡′.

Note that 𝜏(𝑁) = 𝜏(𝑁′) = 𝜏(𝑁′′) and similar equalities hold for 𝑟 and 𝑤 1 , so we use them interchangeably. Because 𝑖𝑛𝑝𝑢𝑡 is a binary list, we know that ℎ = 0 or ℎ = 1. We break this into two different cases, depending on the value of ℎ.

First, we assume that 𝑖𝑛𝑝𝑢𝑡 ′ = 𝑖𝑛𝑝𝑢𝑡 + [0] and we prove that 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0]. In this case, the most recent input to the neuron is 0. Again, to relate this to Equation (1), let 𝑡 be the time at which we process the last input. We calculate 𝑝(𝑁′′), which corresponds to 𝑝(𝑡), i.e., the potential value of the neuron at time 𝑡; also the value 𝑝(𝑁′) represents 𝑝(𝑡 -1) in this definition. Using the first and second clauses of Equation (1), respectively, the value is one of:

𝑝(𝑁 ll ) = 𝑤 Q (𝑁′) • 0 = 0 or 𝑝(𝑁′′) = 𝑤 Q (𝑁′) • 0 + 𝑟(𝑁′) • 𝑝(𝑁′).
In the first case, 𝑝(𝑁′′) = 0 and we know 0 < 𝜏(𝑁), because 𝜏(𝑁) is always positive. So, by the second clause of Equation ( 2) in Definition 1, the next output of the neuron will be 0. The other case, which comes from the second clause of Equation (1) has the same result. In this case, the condition on this clause says that 𝑝(𝑁′) < 𝜏(𝑁′) and we must show that 𝑝(𝑁′′) = 𝑟(𝑁′) • 𝑝(𝑁′) < 𝜏(𝑁). Recall that 𝑟(𝑁′), the leak factor of the neuron, is between 0 and 1. So, multiplying any number that is less than a positive number by a value between 0 and 1 gives a value that is smaller than or equal to the original number. Therefore, by Equation ( 2), the next output of the neuron will be 0 again. We can conclude now that by adding 0 to the input sequence, a 0 will be produced in the output. Thus, 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0] . Using our induction hypothesis, we have:

𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0] = [0] + 𝑖𝑛𝑝𝑢𝑡 + [0] = 0 + 𝑖𝑛𝑝𝑢𝑡′.
Second, we assume that 𝑖𝑛𝑝𝑢𝑡 ′ = 𝑖𝑛𝑝𝑢𝑡 + [START_REF] Clarke | Model Checking[END_REF] and we will prove that 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [START_REF] Clarke | Model Checking[END_REF] . In this case, the most recent input of the neuron is 1. Again, we calculate the potential value of 𝑁′′ using Equation [START_REF] Clarke | Model Checking[END_REF]:

𝑝(𝑁′′) = 𝑤 1 (𝑁′) • 1 = 𝑤 1 (𝑁′) or 𝑝(𝑁′′) = 𝑤 1 (𝑁′) • 1 + 𝑟(𝑁′) • 𝑝(𝑁′)
= 𝑤 1 (𝑁′) + 𝑟(𝑁′) • 𝑝(𝑁′). In the first case, when 𝑝(𝑁′′) = 𝑤 1 (𝑁′) , we know that 𝑤 1 (𝑁) ≥ 𝜏(𝑁) by assumption in the statement of the property, we know that 𝑤 1 (𝑁) = 𝑤 1 (𝑁′) as discussed, and thus 𝑝(𝑁′′) ≥ 𝜏(𝑁). So by Equation ( 2), the next output of the neuron will be 1. In the second case, 𝑝(𝑁′) ≥ 0 according to Lemma 1, and it is always the case that 𝑟(𝑁′) ≥ 0, so we can conclude that 𝑟(𝑁′) • 𝑝(𝑁′) ≥ 0. Because 𝑤 1 (𝑁) ≥ 𝜏(𝑁) and adding a non-negative value to the greater side of an inequality keeps it that way, we can conclude that 𝑝(𝑁′′) = 𝑤 1 (𝑁′) + 𝑟(𝑁′) • 𝑝(𝑁′) ≥ 𝜏(𝑁) . Therefore, again by Equation ( 2), the next output of the neuron will be 1 again. Thus, we can conclude in both cases that by adding 1 to the input sequence, a 1 will be produced in the output. Thus, 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [START_REF] Clarke | Model Checking[END_REF].Using our induction hypothesis, we have:

𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [1] = [0] + 𝑖𝑛𝑝𝑢𝑡 + [1] = 0 + 𝑖𝑛𝑝𝑢𝑡′.
This completes the proof.

The Filter Effect for a Single Neuron

The next property we consider is also about single-input neurons. When a neuron has only one input, and the weight of that input is less than its activation threshold, the neuron passes on the value 1 once as output for each sequence of 𝑛 1s in the input, where 𝑛 is the designated length of the series. All 1s in the input are replaced by 0 except for the 𝑛 :W one, the 2𝑛 :W one, the 3𝑛 :W one, etc. The other 1s are "filtered out." For instance, let 𝑛 = 3. Then if a single input neuron with this effect receives 01110010101 as input, it will produce 000010000001 as the output sequence. (The output sequence is one longer than the input because of the leading 0.) As a consequence, there are never two consecutive 1s in the output sequence. This consequence is called the filter effect. Most neurons in a human body have the filter effect because their input weight is less than their activation threshold. Normally, more than one input is needed to activate a human neuron. In biology, this property is often called the integrator effect. Property 2. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) < 𝜏(𝑁) → 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′)

Note that in the statement above, 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) means there are no two consecutive 1s in the list 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′). This theorem is also proved by induction on the structure of the input list. (See the appendix.)

The Inhibitor Effect

The next property is an important one because it has the potential to help us detect inactive zones of the brain. Normally, a human neuron does not have negative weights for all of its inputs but when one or more positive weight inputs are out of order because of some kind of disability, this property can occur. It is called the inhibitor effect because it is important for proving properties of archetype 1(e). We consider here the single neuron case. When a neuron has only one input and the weight of that input is less than 0, then the neuron is inactive, which means that for any input, the neuron cannot emit 1 as output. i.e., if a signal reaches this neuron, it will not pass through. As with the other properties, the input sequence has an arbitrary finite length. This property is expressed as follows. Property 3. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) < 0 → 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′)

Similarly, in the statement above, 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) means there is no 1 in the list 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′). This property is also proved by induction on the structure of the input, again in the appendix.

The inhibitor effect expressed in Property 3 has a more general version, which we plan to prove as a future work. For a neuron with multiple inputs, when all input weights are less than or equal to 0, then the neuron is inactive and can't pass any signal. Thus, in addition to proving this property for arbitrary input length, we intend to generalize it to an arbitrary number of neurons. As mentioned, recognizing inactive neurons can help to detect inactive zones of the brain. In addition, it can also help to simplify the structure of a neural network by removing such neurons from the network.

The Delayer Effect in a Series of Single Neurons

The next property is about the archetype shown in Figure 1(a). In this structure, each neuron output is the input of the next neuron. If we have a series of 𝑛 single input neurons and all of them have the delayer effect, then the output of the whole structure is the input plus 𝑛 leading zeros. In other words, this structure transfers the input sequence exactly with a delay marked by the 𝑛 leading zeros, denoted as 𝑧𝑒𝑟𝑜𝑠(𝑛) in the statement of the property below. This property is expressed as follows.

Conclusion

In this work, we proposed a formal approach to model and validate leaky integrate and fire neurons and some basic circuits (simple series and inhibition of a behavior). In the literature, this is not the first attempt to the formal investigation of neural networks. In [START_REF] De Maria | Verification of Temporal Properties of Neuronal Archetypes Modeled as Synchronous Reactive Systems[END_REF][START_REF] De Maria | Modelling and Formal Verification of Neuronal Archetypes Coupling[END_REF], the synchronous paradigm has been exploited to model neurons and some small neuronal circuits with a relevant topological structure and behavior and to prove some properties concerning their dynamics. Our approach based on the use of the Coq proof assistant (which is, to the best of our knowledge, the first one), turned out to be much more general. As a matter of fact, we guarantee that the properties we prove are true in the general case, such as true for any input values, any length of input, and any amount of time. As an example, let us consider the simple series. In [START_REF] De Maria | Modelling and Formal Verification of Neuronal Archetypes Coupling[END_REF], the authors were able to write a function (more precisely, a Lustre node) which encodes the expected behavior of the circuit. Then, they could call a model checker to test whether the property at issue is valid for some input series with a fixed length. Here we can prove that the wished behavior is true whatever the length and the parameters of the series are.

As a first next step, we intend to formally study the missing archetypes of Figure 1 (series with multiple outputs, parallel composition, negative loop, and contralateral inhibition) and other new archetypes made of two, three or more neurons. We already started to investigate the two-neuron positive loop, where the first neuron activates the second one, which in turn activates the first one. Our progress so far includes defining a Coq inductive predicate that relates these two neurons and their corresponding two lists of values obtained by applying the potential function over time. This predicate is true whenever the output has a particular pattern that is important for proving one of the more advanced properties we are studying. Defining general relations that can be specialized to specific patterns will likely also be very useful for the kinds of properties that are important for more complex networks.

As a second next step, we plan to focus on the composition of the studied archetypes. There are two main ways to couple two circuits: either to connect the output of the first one to the input of the second one, or to nest the first one inside the second one. We are interested in detecting the compositions which lead to circuits with a meaningful biological behavior. Archetypes can be considered as the syllables of a given alphabet. When two or more syllables are combined, it is possible to obtain either a real word or a word which does not exist. At the same way, the archetype composition can lead to meaningful networks or not.

As a long-term aim, we would like to be able to prove that whatever neural network can be expressed as a combination of the small mini-circuits we have identified, as far as all the words can be expressed as combination of the syllables of a given alphabet. Although, the proofs we have completed require some sophisticated reasoning, there is still a significant amount that is common between them. As we continue, we expect to encounter more complex inductions as we consider more complex properties. Thus, it will become important to automate as much of the proofs as possible, most likely by writing tactics tailored to the kind of induction, case analysis, and mathematical reasoning that is needed here. 𝑧𝑒𝑟𝑜𝑠(𝑁) means a sequence of 0s of length 𝑁 . Also, 𝑂𝑢𝑡𝑝𝑢𝑡 denotes the final output of the series structure which is equal to 𝑂𝑢𝑡𝑝𝑢𝑡(𝑆𝑒𝑟𝑖𝑒𝑠[𝑁]).

Base case: 𝑁 = 1. In this case, there is only one neuron in the series and we know that this neuron has the delayer effect. According to Property 1 proved earlier, we can conclude that 𝑂𝑢𝑡𝑝𝑢𝑡 = 𝑖𝑛𝑝𝑢𝑡 + [0] = 𝑖𝑛𝑝𝑢𝑡 + 𝑧𝑒𝑟𝑜𝑠 [START_REF] Clarke | Model Checking[END_REF].

Induction case: We assume that the property holds for 𝑆𝑒𝑟𝑖𝑒𝑠 of length 𝑘. Let 𝑂𝑢𝑡𝑝𝑢𝑡′ be the output of this series. Thus by the induction hypothesis, 𝑂𝑢𝑡𝑝𝑢𝑡′ = 𝑧𝑒𝑟𝑜𝑠(𝑘) + 𝑖𝑛𝑝𝑢𝑡 . We must show that the property holds for a 𝑆𝑒𝑟𝑖𝑒𝑠 + [𝑀], where 𝑀 is a neuron such that 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑀)j = 1 and 𝑤 Q (𝑀) > 𝜏(𝑀) ,. Let 𝑂𝑢𝑡𝑝𝑢𝑡′′ be the output of this series of length 𝑘 + 1. The input sequence for 𝑀 is the final output of 𝑆𝑒𝑟𝑖𝑒𝑠, which is 𝑧𝑒𝑟𝑜𝑠(𝑘) + 𝑖𝑛𝑝𝑢𝑡. By the assumptions of this property, all neurons in 𝑆𝑒𝑟𝑖𝑒𝑠 + [𝑀] satisfy Property 1, i.e., have the delayer effect, including the last one 𝑀, which means that its output is equal to its input plus a leading 0. In other words, 𝑂𝑢𝑡𝑝𝑢𝑡 l l = [0] + 𝑧𝑒𝑟𝑜𝑠(𝑘) + 𝑖𝑛𝑝𝑢𝑡. Therefore, we can conclude that 𝑂𝑢𝑡𝑝𝑢𝑡 ll = [0] + 𝑧𝑒𝑟𝑜𝑠(𝑘) + 𝑖𝑛𝑝𝑢𝑡 = 𝑧𝑒𝑟𝑜𝑠(𝑘 + 1) + 𝑖𝑛𝑝𝑢𝑡.

This completes the proof.

Figure 1 :

 1 Figure 1: Neuron archetypes [21, 22]

  Definition/Fixpoint Function_Name (Input1: Type of Input1) … (Inputn: Type of Inputn) : Output Type := Body of the function.

  match X with | 0 => Do something when X = 0 | S n => Do something when X is successor of n end match L with | [] => Do something when L is an empty list | h::t => Do something when L has head h followed by tail t end

Figure 4 .

 4 Figure 4. Definition of a record and a variable with the record type in Coq

  0 Leak_Factor = true /\ Qle_bool Leak_Factor 1 = true; PosTau: Qlt_bool 0 Tau = true; WRange: WeightInRange Weights = true }. Fixpoint potential (Weights: list Q) (Inputs: list nat): Q := match Weights, Inputs with | nil, _ => 0 | _, nil => 0 | h1::t1, h2::t2 => if (beq_nat h2 0%nat) then (potential t1 t2) else (potential t1 t2) + h1 end.

  Definition NextPotential (N: Neuron) (Inputs: list nat): Q := if (Qle_bool (Tau N) (Current N)) then (potential (Weights N) Inputs) else (potential (Weights N) Inputs) + (Leak_Factor N) * (Current N).

Property 4 .

 4 ∀ (𝑆𝑒𝑟𝑖𝑒𝑠: 𝑙𝑖𝑠𝑡 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡) (𝑖: 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎ(𝑆𝑒𝑟𝑖𝑒𝑠) = 𝑛 ∧ 0 ≤ 𝑖 < 𝑛 ∧ 𝑙𝑒𝑛𝑔𝑡ℎ(𝑤(𝑆𝑒𝑟𝑖𝑒𝑠[𝑖]) = 1 ∧ 𝑤 Q (𝑆𝑒𝑟𝑖𝑒𝑠[𝑖]) > 𝜏(𝑆𝑒𝑟𝑖𝑒𝑠[𝑖])→ 𝑂𝑢𝑡𝑝𝑢𝑡 = 𝑧𝑒𝑟𝑜𝑠(𝑛) + 𝑖𝑛𝑝𝑢𝑡 This time, the proof proceeds by induction on the length of 𝑆𝑒𝑟𝑖𝑒𝑠. As with the other properties, the complete proof is in the appendix.

ACKNOWLEDGMENTS

The first and third authors acknowledge the support of the Natural Sciences and Engineering Research Council of Canada. We thank neurophysiologist Frank Grammont for his useful explanations of neuron functioning.

Appendix

We include here the complete proofs of Lemma 1 and Properties 2, 3, and 4. Lemma 1. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) ≥ 𝜏(𝑁) → 𝑝(𝑁′) ≥ 0 As explained above 𝑝(𝑁′) is the most recent value of the potential function of neuron 𝑁 , i.e., the one obtained after processing all of input values. Lemma 1). The proof is by induction on the length of the input sequence.

Proof (of

Base case: 𝑖𝑛𝑝𝑢𝑡 = [] (the empty list). If there is no input in the input sequence, the neuron will keep its initial status, i.e., 𝑁 = 𝑁′. So, 𝑝(𝑁′) = 0. Therefore, 𝑝(𝑁′) ≥ 0.

Induction case: we assume that the property is true for 𝑖𝑛𝑝𝑢𝑡 and we must show that it holds for some 𝑖𝑛𝑝𝑢𝑡′ of the form (𝑖𝑛𝑝𝑢𝑡 + [ℎ]) for some additional input value ℎ. Let 𝑁′ be the neuron resulting from processing 𝑖𝑛𝑝𝑢𝑡, and let 𝑁′′ be the input after processing 𝑖𝑛𝑝𝑢𝑡′. By the induction hypothesis, we know 𝑝(𝑁′) ≥ 0 and we must prove that 𝑝(𝑁′′) ≥ 0.

Note that 𝜏(𝑁) = 𝜏(𝑁 l ) = 𝜏(𝑁 ll ) and 𝑤 Q (𝑁) = 𝑤 Q (𝑁 l ) = 𝑤 Q (𝑁 ll ), so we use them interchangeably. We break this proof into two cases depending on whether or not 𝑝(𝑁′) ≥ 𝜏(𝑁′).

First, let's assume that 𝑝(𝑁′) ≥ 𝜏(𝑁′) . Because the input contains only 0s and 1s, we know that ℎ = 0 or ℎ = 1 . We calculate 𝑝(𝑁 ll ), which as stated, corresponds to 𝑝(𝑡) in Equation (1), i.e., the potential value of the neuron at time 𝑡; the value 𝑝(𝑁 l ) represents 𝑝(𝑡 -1) in this definition. Because of our assumption, only the first clause of Equation (1) applies, with two possibilities depending on the value of ℎ:

In the first case, 𝑝(𝑁′′) = 0 ≥ 0. In the second case, 𝑝(𝑁′′) = 𝑤 Q (𝑁 l ) and we know 𝑤 Q (𝑁 l ) ≥ 𝜏(𝑁) by assumption, and 𝜏(𝑁) > 0 because, by definition, the activation threshold of any neuron is a positive value.

Second, we assume that 𝑝(𝑁′) < 𝜏(𝑁). So, again because the input contains only 0s and 1s, we know that ℎ = 0 or ℎ = 1. By the second clause of the definition of 𝑝, we have:

In the first case, 𝑟(𝑁 l ) is non-negative by definition and 𝑝(𝑁 l ) is non-negative by the induction hypothesis. Thus, 𝑟(𝑁 l ) • 𝑝(𝑁′) ≥ 0. For the second case, we also have that 𝑤 Q (𝑁 l ) ≥ 𝜏(𝑁′) > 0, and thus the sum of two non-negative numbers is also non-negative.

This completes the proof, thus showing that it is always the case that the value of the potential of a single input neuron with a nonnegative input weight will be non-negative. Property 2. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) < 𝜏(𝑁) → 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) Note that in the statement above, 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) means there are no two consecutive 1s in the list 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ).

Proof. We prove this theorem again by induction on the structure of the input list.

Base case: 𝑖𝑛𝑝𝑢𝑡 = []. If there is no input in the input sequence, the neuron will keep its initial status, i.e., 𝑁 = 𝑁′ . So,

Induction case: we assume that the property is true for 𝑖𝑛𝑝𝑢𝑡 and we must show that it holds for some 𝑖𝑛𝑝𝑢𝑡′ of the form (𝑖𝑛𝑝𝑢𝑡 + [ℎ]) for some additional input value ℎ. Let 𝑁′ be the neuron resulting from processing 𝑖𝑛𝑝𝑢𝑡, and let 𝑁′′ be the input after processing 𝑖𝑛𝑝𝑢𝑡′. By the induction hypothesis, we know 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) and we must prove that 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′).

Because we know that a neuron produces only 0 and 1 as output values, we know that 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0] or 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′) = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [START_REF] Clarke | Model Checking[END_REF]. For the first case, we are done, because when 11 does not appear in a sequence, then by adding a 0 to the end of that sequence, there will still no 11 in that sequence.

The second case here is a bit more complicated. We need to split this case into two subcases. First, let's assume that the last produced output in 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) is 0, i.e., 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) has the form 𝑆𝑒𝑞 + [0]. So, it is clear that by adding a 1 to a sequence which ended with 0 and didn't have any 11, the resulting sequence will not have any 11 as a substring. Thus, we can conclude that 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) → 11 ∉ 𝑆𝑒𝑞 +

Now for the second subcase, let's assume that the last produced output in 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) is 1, i.e., 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) has the form 𝑆𝑒𝑞 + [START_REF] Clarke | Model Checking[END_REF]. In this case, we have to prove that the next output will be 0. Because the last produced output in 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) is 1, we know that 𝑝(𝑁′) ≥ 𝜏(𝑁′). So, 𝑝(𝑁 ll ) = 𝑤 Q (𝑁 l ). ℎ and because ℎ = 0 or ℎ = 1, we can conclude that 𝑝(𝑁 l ′) = 𝑤 Q (𝑁 l ) or 𝑝(𝑁 l ′) = 0. In the first case, according to the property assumption, we know that 𝑤 Q (𝑁) < 𝜏(𝑁) , and thus 𝑝(𝑁 ll ) = 𝑤 Q (𝑁′) = 𝑤 Q (𝑁) < 𝜏(𝑁) , and in the second case, because 𝜏(𝑁) is a positive value we have 𝑝(𝑁 ll ) = 0 < 𝜏(𝑁) . Thus, by Equation ( 2), the next output produced will be 0. Therefore, 11 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) → 11 ∉ 𝑆𝑒𝑞 +

This completes the proof.

Property 3. ∀ (𝑁: 𝑛𝑒𝑢𝑟𝑜𝑛) (𝑖𝑛𝑝𝑢𝑡: 𝑙𝑖𝑠𝑡 𝑛𝑎𝑡), 𝑙𝑒𝑛𝑔𝑡ℎi𝑤(𝑁)j = 1 ∧ 𝑤 Q (𝑁) < 0 → 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) Similar to Property 2, in the statement above, 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ) means there is no 1 in the list 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 l ).

Proof. We will prove this property using induction on the input length again.

Base case: 𝑖𝑛𝑝𝑢𝑡 = []. If there is no input in the input sequence, the neuron will keep its initial status, i.e., 𝑁 = 𝑁′ . So,

Induction case: we assume that the property is true for 𝑖𝑛𝑝𝑢𝑡 and we must show that it holds for some 𝑖𝑛𝑝𝑢𝑡′ of the form (𝑖𝑛𝑝𝑢𝑡 + [ℎ]) for some additional input value ℎ. Let 𝑁′ be the neuron resulting from processing 𝑖𝑛𝑝𝑢𝑡, and let 𝑁′′ be the input after processing 𝑖𝑛𝑝𝑢𝑡′. By the induction hypothesis, we know 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) and we must prove that 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′′).

Let 𝑡 be the time at which we produced the most recent output. So, 𝑝(𝑁′′) corresponds to 𝑝(𝑡) and 𝑝(𝑁′) corresponds to 𝑝(𝑡 -1). Again, note that 𝜏(𝑁) = 𝜏(𝑁 l ) = 𝜏(𝑁 ll ) and similar equalities hold for 𝑟 and 𝑤 Q , so we use them interchangeably. Using the induction hypothesis, we know that 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′). So, the last produced output in 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) is 0. Thus, 𝑝(𝑁′) = 𝑝(𝑡 -1) < 𝜏(𝑁′). That makes 𝑝(𝑡) = 𝑝(𝑁′′) = 𝑤 Q (𝑁 ll ). ℎ + 𝑟(𝑁′′). 𝑝(𝑁′). We need to consider two cases, which are ℎ = 0 and ℎ = 1.

In the first case, 𝑝(𝑁′′) = 𝑟(𝑁′′). 𝑝(𝑁′). We can conclude that 𝑝(𝑁′′) = 𝑟(𝑁′′). 𝑝(𝑁 l ) < 𝜏(𝑁′) because 𝑝(𝑁′) < 𝜏(𝑁′) by the property assumption and it is multiplied by 𝑟(𝑁′), the leak factor, which is between 0 and 1. Recall that 𝜏(𝑁′) is a positive value. Thus, the next output will be 0 in this case and 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0] = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁 ll ).

In the second case, 𝑝(𝑁′′) = 𝑤 Q (𝑁′′) + 𝑟(𝑁 ll ). 𝑝(𝑁′). With the same reasoning as the previous case, we can say that 𝑟(𝑁 ll ). 𝑝(𝑁 l ) < 𝜏(𝑁′) . Because 𝑤 Q (𝑁′) is a negative value, adding it to the left side of the inequality will make it smaller and the inequality still holds. Thus, 𝑝(𝑁′′) = 𝑤 Q (𝑁′′) + 𝑟(𝑁 ll ). 𝑝(𝑁 l ) < 𝜏(𝑁′). Therefore, the next output will be 0 in this case too and 1 ∉ 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′) + [0] = 𝑂𝑢𝑡𝑝𝑢𝑡(𝑁′ l ).

This completes the proof. Proof. This time we need to use induction on the length of 𝑆𝑒𝑟𝑖𝑒𝑠.

Here, we consider the series structure shown in Figure 1(a). In the formula above, 𝑆𝑒𝑟𝑖𝑒𝑠[𝑖] denotes the 𝑖-th neuron in the 𝑆𝑒𝑟𝑖𝑒𝑠 and