1 Introduction

In the late 80s Chua and Yang introduced a new natural computing paradigm called the cellular neural networks (or cellular nonlinear networks) CNN which includes the cellular automata as a particular case [6, 7, 9]. From the beginning the CNN paradigm was intended for applications as an integrated circuit. This paradigm has been extremely successful in various applications in vision, robotics and remote sensing, see e.g. [8, 26] and the references therein.

In this article we present a mathematical generalization of the CNNs of Chua and Yang called p-adic cellular neural networks. The p-adic continuous CNNs offer a theoretical framework to study the emergent patterns of hierarchical discrete CNNs having arbitrary many hidden layers.

Nowadays, it is widely accepted that the analysis on ultrametric spaces is the natural tool for formulating models where the hierarchy plays a central role. An ultrametric space (Md) is a metric space M with a distance satisfying \(d(A,B)\le \max \left\{ d\left( A,C\right) ,d\left( B,C\right) \right\}\) for any three points A, B, C in M. Ultrametricity in physics means the emergence of ultrametric spaces in physical models. Ultrametricity was discovered in the 80s by Parisi and others in the theory of spin glasses and by Frauenfelder and others in physics of proteins. In both cases, the space of states of a complex system has a hierarchical structure which play a central role in the physical behavior of the system, see e.g. [10, 11, 15, 20, 21, 25, 29,30,31,32, 32], and the references therein.

On the other hand, Khrennikov and his collaborators have studied neural network models where p-state neurons take their values in p-adic numbers, see [2, 19]. These models are completely different to the ones considered here. In addition, Khrennikov has developed non-Archimedean models of brain activity and mental processes, see e.g. [18] and the references therein.

Among the ultrametric spaces, the field of p-adic numbers \(\mathbb {Q}_{p}\) plays a central role. A p-adic number is a series of the form

$$\begin{aligned} x=x_{-k}p^{-k}+x_{-k+1}p^{-k+1}+\cdots +x_{0}+x_{1}p+\ldots ,\text { with } x_{-k}\ne 0\text {,} \end{aligned}$$
(1.1)

where p is a prime number, the \(x_{j}\)s are p-adic digits, i.e. numbers in the set \(\left\{ 0,1,\ldots ,p-1\right\}\). The set of all the possible series of form (1.1) constitutes the field of p-adic numbers \(\mathbb {Q}_{p}\). There are natural field operations, sum and multiplication, on series of form (1.1), see e.g. [16]. There is also a natural norm in \(\mathbb {Q}_{p}\) defined as \(\left| x\right| _{p}=p^{k}\), for a nonzero p-adic number x of the form (1.1). The field of p-adic numbers with the distance induced by \(\left| \cdot \right| _{p}\) is a complete ultrametric space. The ultrametric property refers to the fact that \(\left| x-y\right| _{p}\le \max \left\{ \left| x-z\right| _{p},\left| z-y\right| _{p}\right\}\) for any x, y, z in \(\mathbb {Q}_{p}\).

We denote by \(G_{M}\) the set all the p-adic numbers of the form \(\varvec{i}=\varvec{i}_{-M}p^{-M}+\varvec{i}_{-M+1}p^{-M+1} +\cdots +\varvec{i}_{0}+\cdots +\varvec{i}_{M-1}p^{M-1}\), where the \(\varvec{i}_{j}\)s belong to \(\left\{ 0,1,\ldots ,p-1\right\}\). Then (\(G_{M},\left| \cdot \right| _{p}\)) is a finite ultrametric space. Geometrically speaking, \(G_{M}\) is a regular rooted tree with 2M layers, here regular means that exactly p edges emanate from each vertex. A (1-dimensional) p-adic discrete CNN is a dynamical system of the form

$$\begin{aligned} \frac{\partial }{\partial t}X(\varvec{i},t)=-X(\varvec{i},t)+ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}}} \mathbb {A}(\varvec{i},\varvec{j})Y(\varvec{j},t)+ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}}} \mathbb {B}(\varvec{i},\varvec{j})U(\varvec{j})+Z(\varvec{i}), \end{aligned}$$
(1.2)

\(\varvec{i}\in G_{M}\), where \(Y(\varvec{j},t)=f\left( X(\varvec{j},t)\right)\), with \(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\). Here \(X(\varvec{i},t),Y(\varvec{i} ,t)\in \mathbb {R}\) are the state, respectively the output, of cell \(\varvec{i}\) at the time t. The function \(U(\varvec{i})\in \mathbb {R}\) is the input of the cell \(\varvec{i}\), \(Z(\varvec{i} )\in \mathbb {R}\) is the threshold of cell \(\varvec{i}\), and the matrices \(\mathbb {A},\mathbb {B}:G_{M}^{N}\times G_{M}^{N}\rightarrow \mathbb {R}\) are the feedback operator and feedforward operator, respectively. Notice that matrices \(\mathbb {A}\), \(\mathbb {B}\) are functions on the Cartesian product of two rooted trees. The Chua-Yang CNNs are a particular case of (1.2), see e.g. [8, 26]. In this article we study N-dimensional, discrete hierarchical CNNs having arbitrary many layers. For the sake of simplicity, we focus on space-invariant networks, i.e. in the case in which

$$\begin{aligned} \mathbb {A}(\varvec{i},\varvec{j})=\mathbb {A}(\left| \varvec{i} -\varvec{j}\right| _{p})\text {, \quad \ }\mathbb {B}(\varvec{i} ,\varvec{j})=\mathbb {B}(\left| \varvec{i}-\varvec{j} \right| _{p}). \end{aligned}$$
(1.3)

In this article we initiate the study of the emergent patterns produced by the p-adic discrete CNNs. Since we are interested in arbitrary large trees, the description of these networks requires literally millions of integro-differential equations, consequently a numerical approach seems not suitable, instead of this, we construct a p-adic continuous model that can be very well approximated by (1.2).

The study of the qualitative behavior of differential equations on large graphs is a relevant matter due to its applications. In [23] Nakao and Mikhailov proposed using continuous models to study reaction-diffusion systems on networks and the corresponding Turing patterns. In [30] the second author showed that p-adic analysis is the natural tool to carry out this program. Models constructed using energy landscapes naturally drive to a large system of differential equations (the master equation of the system), see e.g. [5, 20, 21]. p-Adic continuous versions of some of these systems were constructed by Avetisov, Kozyrev and others in connection with models of protein folding, see e.g. [20, 21] for a general discussion. Another relevant system is the Eigen-Schuster model in biology, see e.g. [24]. In [31] a p-adic continuous version of this model was introduced, this p-adic version allows to explain the Eigen paradox. Recently Hua and Hovestadt pointed out that the p-adic number system offers a natural representation of hierarchical organization of complex networks [15].

Intuitively, in the space-invariant case, the continuous model corresponding to (1.2) is obtained by taking the limit as M tends to infinity:

$$\begin{aligned} \frac{\partial X(x,t)}{\partial t} =&-X(x,t)+ {\displaystyle \int \limits _{\mathbb {Q}_{p}}} A(\left| x-y\right| _{p})Y(y,t)dy+\nonumber \\&\quad {\displaystyle \int \limits _{\mathbb {Q}_{p}}} B(\left| x-y\right| _{p})U(y)dy+Z(x), \end{aligned}$$
(1.4)

with \(Y(x,t)=f(X(x,t))\). For the sake of simplicity, in the introduction we discuss our results in dimension one. We study the case where \(A(\left| x\right| _{p})\), \(B(\left| x\right| _{p})\) are integrable, and U, Z are continuous functions vanishing at infinity. Under these hypotheses the initial value problem attached to (1.4), with initial datum \(X_{0}\) (a continuous function vanishing at infinity) has a unique solution X(xt) which is a continuos function vanishing at infinity in x for any \(t\ge 0\), satisfying \(\left| X(x,t)\right| \le X_{\max }\), where the constant \(X_{\max }\) is completely determined by A, B, U, Z and f, see Theorem 2. An analog result is valid for discrete CNNs, see Theorem 3.

The solution X(xt) can be very well approximated in the \(\left\| \cdot \right\| _{\infty }\)-norm as

$$\begin{aligned} \sum _{\varvec{j}\in G_{M}}X(\varvec{j},t)\Omega \left( p^{M}\left| x-\varvec{j}\right| _{p}\right) . \end{aligned}$$

By using standard techniques of approximation of semilinear evolution equations, we show that the solution of the Cauchy problem attached to (1.2), under condition (1.3), is arbitrarily close in the \(\left\| \cdot \right\| _{\infty }\)-norm to the solution of the Cauchy problem attached to (1.4), if M is sufficiently large, see Theorem 4. This implies that the p-adic continuous CNNs have infinitely many hidden layers, and that they are continuous versions of suitable p-adic discrete CNNs. It is relevant to mention that Eq. (1.4) makes sense over the real numbers, i.e. by replacing \(\mathbb {Q}_{p}\) by \(\mathbb {R}\) in (1.4) we get an equation modeling a continuous network. But, there are no natural discretizations of the real version of (1.4) that can be interpreted as hierarchical CNNs, because the real numbers are a completely ordered field, and thus the natural hierarchy is only the linear one.

In practical applications it is natural to assume that radial functions A, B have compact support or that they are test functions. Under this hypothesis we study the patterns produced by p-adic continuous CNNs when U, Z and \(X_{0}\) are test functions. The hypothesis that \(X_{0}\) is a test functions means that at time \(t=0\) only certain clusters of cells are excited. Each cluster corresponds to a p-adic ball centered at some cell with radius, say \(p^{-L}\). The intensity of the excitation is the same for all cells in a given cluster. The fact that U, Z are test functions can be interpreted in an analogous way. Let \(B_{M_{0}}\) denote the ball centered at the origin with radius \(p^{M_{0}}\), which the smallest ball containing the supports of A, B, U, Z, \(X_{0}\). Then the solution X(xt) of the initial value problem attached to (1.4) is a test function supported in \(B_{M_{0}}\) of the form \(\sum _{\varvec{j}\in G_{M_{0}} }X(\varvec{j,t})\Omega \left( p^{M_{0}}\left| x-\varvec{j} \right| _{p}\right)\) for \(t\ge 0\), with \(M_{0}\ge L\), see Theorem 1. This means that a p-adic continuous CNN produces a pattern which is organized in a finite number of disjoint clusters, each of them supporting a time varying pattern. We also show the existence of two steady state patterns \(X_{+}(x)\), \(X_{-}(x)\), which are test functions, such that \(\ X_{-}(x)\le \lim _{t\rightarrow \infty }X(x,t)\le X_{+}(x)\), see Theorem 2. We conjecture that for generic p-adic continuous CNNs, \(\lim _{t\rightarrow \infty }X(x,t)\) is a test function, which means that the steady state pattern is organized in a finite number of disjoint clusters, each of them supporting a constant pattern. This is exactly the multistability property reported in [23], see also [30], for reaction-diffusion networks.

We have conducted a large number of numerical simulations. Such simulations require solving integro-differential equations on a tree. The numerical study of p-adic continuous CNNs offers two big challenges. The first, the need of dealing with matrices having millions of entries, the second, the visualization of functions depending on p-adic variables. Due to the first problem, we use small trees with 16 to 64 leaves. The p-adic numbers have a fractal nature, then, it is necessary to visualize real-valued functions defined on the Cartesian product of a fractal times the real line. To deal with this problem we use systematically heat maps which allow us to get a glimpse of the hierarchical nature of the CNNs. Our numerical simulations show that the solutions of continuous CNNs exhibit a very complex behavior, including self-similarity and multistability, depending on the interaction of all the parameters defining the network and initial datum.

2 p-Adic Analysis: Essential Ideas

2.1 The Field of p-adic Numbers

Along this article p will denote a prime number. The field of \(p-\)adic numbers \(\mathbb {Q}_{p}\) is defined as the completion of the field of rational numbers \(\mathbb {Q}\) with respect to the \(p-\)adic norm \(|\cdot |_{p}\), which is defined as

$$\begin{aligned} \left| x\right| _{p}=\left\{ \begin{array} [c]{lll} 0 &{} \quad \text {if} &{} x= 0\\ p^{-\gamma } &{} \quad \text {if} &{} x=p^{\gamma }\frac{a}{b}\text {,} \end{array} \right. \end{aligned}$$

where a and b are integers coprime with p. The integer \(\gamma :=ord(x)\), with \(ord(0):=+\infty\), is called the\(p-\)adic order of x. We extend the \(p-\)adic norm to \(\mathbb {Q}_{p}^{N}\) by taking

$$\begin{aligned} ||x||_{p}:=\max _{1\le i\le N}|x_{i}|_{p},\quad \text {for }\; x=(x_{1} ,\dots ,x_{N})\in \mathbb {Q}_{p}^{N}. \end{aligned}$$

We define \(ord(x)=\min _{1\le i\le N}\{ord(x_{i})\}\), then \(||x||_{p} =p^{-ord(x)}\). The metric space \(\left( \mathbb {Q}_{p}^{N},||\cdot ||_{p}\right)\) is a complete ultrametric space. As a topological space \(\mathbb {Q}_{p}\) is homeomorphic to a Cantor-like subset of the real line, see e.g. [1, 29].

Any \(p-\)adic number \(x\ne 0\) has a unique expansion of the form

$$\begin{aligned} x=p^{ord(x)}\sum _{j=0}^{\infty }x_{j}p^{j}, \end{aligned}$$

where \(x_{j}\in \{0,1,\dots ,p-1\}\) and \(x_{0}\ne 0\).

2.2 Topology of \(\mathbb {Q}_{p}^{N}\)

For \(r\in \mathbb {Z}\), denote by \(B_{r}^{N}(a)=\{x\in \mathbb {Q}_{p} ^{N};||x-a||_{p}\le p^{r}\}\) the ball of radius \(p^{r}\) with center at \(a=(a_{1},\dots ,a_{N})\in \mathbb {Q}_{p}^{N}\), and take \(B_{r} ^{N}(0):=B_{r}^{N}\). Note that \(B_{r}^{N}(a)=B_{r}(a_{1})\times \cdots \times B_{r}(a_{N})\), where \(B_{r}(a_{i}):=B_{r}^{1}(a_{i})=\{x\in \mathbb {Q} _{p};|x_{i}-a_{i}|_{p}\le p^{r}\}\) is the one-dimensional ball of radius \(p^{r}\) with center at \(a_{i}\in \mathbb {Q}_{p}\). The ball \(B_{0}^{N}\) equals the product of N copies of \(B_{0}=\mathbb {Z}_{p}\), the ring of \(p-\)adic integers. We also denote by \(S_{r}^{N}(a)=\{x\in \mathbb {Q}_{p}^{N};||x-a||_{p}=p^{r}\}\) the sphere of radius \(p^{r}\) with center at \(a=(a_{1},\dots ,a_{N})\in \mathbb {Q}_{p}^{N}\), and take \(S_{r}^{N}(0):=S_{r}^{N}\). We notice that \(S_{0}^{1}=\mathbb {Z}_{p}^{\times }\) (the group of units of \(\mathbb {Z}_{p}\)), but \(\left( \mathbb {Z}_{p}^{\times }\right) ^{N}\subsetneq S_{0}^{N}\). The balls and spheres are both open and closed subsets in \(\mathbb {Q}_{p}^{N}\). In addition, two balls in \(\mathbb {Q}_{p}^{N}\) are either disjoint or one is contained in the other.

As a topological space \(\left( \mathbb {Q}_{p}^{N},||\cdot ||_{p}\right)\) is totally disconnected, i.e. the only connected subsets of \(\mathbb {Q}_{p} ^{N}\) are the empty set and the points. A subset of \(\mathbb {Q}_{p}^{N}\) is compact if and only if it is closed and bounded in \(\mathbb {Q}_{p}^{N}\), see e.g. [29, Section 1.3], or [1, Section 1.8]. The balls and spheres are compact subsets. Thus \(\left( \mathbb {Q}_{p} ^{N},||\cdot ||_{p}\right)\) is a locally compact topological space.

We will use \(\Omega \left( p^{-r}||x-a||_{p}\right)\) to denote the characteristic function of the ball \(B_{r}^{N}(a)\). For more general sets, we will use the notation \(1_{A}\) for the characteristic function of a set A.

2.3 The Bruhat–Schwartz Space

A real-valued function \(\varphi\) defined on \(\mathbb {Q}_{p}^{N}\) is called locally constant if for any \(x\in \mathbb {Q}_{p}^{N}\) there exists an integer \(l(x)\in \mathbb {Z}\) such that

$$\begin{aligned} \varphi (x+x^{\prime })=\varphi (x)\; \text { for }\; x^{\prime }\in B_{l(x)}^{N}. \end{aligned}$$
(2.1)

A function \(\varphi :\mathbb {Q}_{p}^{N}\rightarrow \mathbb {R}\) is called a Bruhat-Schwartz function (or a test function) if it is locally constant with compact support. Any test function can be represented as a linear combination, with real coefficients, of characteristic functions of balls. The \(\mathbb {R}\)-vector space of Bruhat-Schwartz functions is denoted by \(\mathcal {D}(\mathbb {Q}_{p}^{N})\). For \(\varphi \in \mathcal {D} (\mathbb {Q}_{p}^{N})\), the largest number \(l=l(\varphi )\) satisfying (2.1) is called the exponent of local constancy (or the parameter of constancy) of \(\varphi\).

If U is an open subset of \(\mathbb {Q}_{p}^{N}\), \(\mathcal {D}(U)\) denotes the space of test functions with supports contained in U, then \(\mathcal {D}(U)\) is dense in

$$\begin{aligned} L^{\rho }\left( U\right) =\left\{ \varphi :U\rightarrow \mathbb {R};\left( {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} \left| \varphi \left( x\right) \right| ^{\rho }d^{N}x\right) ^{\frac{1}{\rho }}<\infty \right\} , \end{aligned}$$

where \(d^{N}x\) is the Haar measure on \(\mathbb {Q}_{p}^{N}\) normalized by the condition \(vol(B_{0}^{N})=1\), for \(1\le \rho <\infty\), see e.g. [1, Section 4.3]. In the case \(U=\mathbb {Q}_{p}^{N}\), we will use the notation \(L^{\rho }\) instead of \(L^{\rho }\left( \mathbb {Q}_{p} ^{N}\right)\). For an in depth discussion about p-adic analysis the reader may consult [1, 17, 27, 29].

2.4 The Spaces \(\mathcal {X}_{\infty }\), \(\mathcal {X}_{M}\)

We define \(\mathcal {X}_{\infty }( \mathbb {Q} _{p}^{N}):=\mathcal {X}_{\infty }=\overline{\left( \mathcal {D}( \mathbb {Q} _{p}^{N}),\left\| \cdot \right\| _{\infty }\right) }\), where \(\left\| \phi \right\| _{\infty }=\sup _{x\in \mathbb {Q} _{p}^{N}}|\phi (x)|\) and the bar means the completion with respect the metric induced by \(\left\| \cdot \right\| _{\infty }\). Notice that all the functions in \(\mathcal {X}_{\infty }\) are continuous and that

$$\begin{aligned} \mathcal {X}_{\infty }\subset \mathcal {C}_{0}:=\left( \left\{ f: \mathbb {Q} _{p}^{N}\rightarrow \mathbb {R};f\text { continuous with }\lim _{\left\| x\right\| _{p}\rightarrow \infty }f\left( x\right) =0\right\} ,\left\| \cdot \right\| _{\infty }\right) . \end{aligned}$$

On the other hand, since \(\mathcal {D}( \mathbb {Q} _{p}^{N})\) is dense in \(\mathcal {C}_{0}\), cf. [27, Chap. II, Proposition 1.3], we conclude that \(\mathcal {X}_{\infty }=\mathcal {C}_{0}\).

For \(M\ge 1\), we set \(G_{M}^{N}:=B_{M}^{N}/B_{-M}^{N}\), which is a finite additive group with \(\#G_{M}^{N}:=p^{2NM}\) elements. Any element \(\varvec{i}=(\varvec{i}_{1},\ldots ,\varvec{i}_{N})\) of \(G_{M}^{N}\) can be represented as

$$\begin{aligned} \varvec{i}_{j}=\varvec{i}_{-M}^{j}p^{-M}+\varvec{i}_{-M+1} ^{j}p^{-M+1}+\cdots +\varvec{i}_{0}^{j}+\varvec{i}_{1}^{j} p+\cdots +\varvec{i}_{M-1}^{j}p^{M-1}\text {,} \end{aligned}$$
(2.2)

for \(j=1,\ldots ,N\), with \(\varvec{i}_{k}^{j}\in \left\{ 0,1,\ldots ,p-1\right\}\). From now on, we fix a set of representatives in \(\mathbb {Q} _{p}^{N}\) for \(G_{M}^{N}\) of the form (2.2). Notice that

$$\begin{aligned} \varvec{i}_{j}=p^{-M}\left( \varvec{a}_{0}^{j}+\varvec{a}_{1} ^{j}p+\cdots +\varvec{a}_{2M-1}^{j}p^{2M-1}\right) , \end{aligned}$$

where \(\varvec{a}_{0}^{j}+\varvec{a}_{1}^{j}p+\cdots +\varvec{a} _{2M-1}^{j}p^{2M-1}\in \mathbb {Z}_{p}/p^{2M}\mathbb {Z}_{p}=B_{0}/B_{-2M}\).

The functions

$$\begin{aligned} \left\{ \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) \right\} _{\varvec{i}\in G_{M}^{N}} \end{aligned}$$
(2.3)

are orthogonal with respect to the standard \(L^{2}\) inner product, since

$$\begin{aligned} \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) \Omega \left( p^{M}\left\| x-\varvec{j}\right\| _{p}\right) =0\quad \text {, for }\varvec{i},\; \varvec{j}\in G_{M}^{N}\text {, }\varvec{i}\ne \varvec{j}\text { and for any }x\in B_{M}^{N}. \end{aligned}$$

We denote by \(\mathcal {D}^{M}\left( \mathbb {Q} _{p}^{N}\right) :=\mathcal {D}^{M}\) the \(\mathbb {R}\)-vector space spanned by (2.3). We set

$$\begin{aligned} \text { }\mathcal {X}_{M}:=\left( \mathcal {D}^{M},\left\| \cdot \right\| _{\infty }\right) \quad \text { for }\; M\ge 1\text {.} \end{aligned}$$

Notice that \(\mathcal {X}_{M}\) is isomorphic as a Banach space to \(\left( \mathbb {R}^{\#G_{M}^{N}},\left\| \cdot \right\| _{\mathbb {R}}\right)\), where

$$\begin{aligned} \left\| \left( t_{1},\ldots ,t_{\#G_{M}^{N}}\right) \right\| _{\mathbb {R}}=\max _{1\le j\le \#G_{M}^{N}}\left| t_{j}\right| . \end{aligned}$$

2.5 Tree-like Structures and p-adic Numbers

Take \(N=1\) and fix \(M\in \mathbb {N}\left\{ 0\right\}\), then \(G_{M}^{1}:=G_{M}=p^{-M}\mathbb {Z}_{p}/p^{M}\mathbb {Z}_{p}\) is an additive group consisting of elements of the form

$$\begin{aligned} \varvec{i}=\varvec{i}_{-M}p^{-M}+\varvec{i}_{-M+1}p^{-M+1} +\cdots +\varvec{i}_{0}+\cdots +\varvec{i}_{M-1}p^{M-1}, \end{aligned}$$
(2.4)

where the \(\varvec{i}_{j}\)s belong to \(\left\{ 0,1,\ldots ,p-1\right\}\). Furthermore, the restriction of \(\left| \cdot \right| _{p}\) to \(G_{M}\) induces an absolute value such that \(\left| G_{M}\right| _{p}=\left\{ 0,p^{-\left( M-1\right) },\ldots ,p^{-1},1,\ldots ,p^{M}\right\}\). We endow \(G_{M}\) with the metric induced by \(\left| \cdot \right| _{p}\), and thus \(G_{M}\) becomes a finite ultrametric space. In addition, \(G_{M}\) can be identified with the set of branches (vertices at the top level) of a rooted tree with \(2M+1\) levels and \(p^{2M}\) branches. Any element \(\varvec{i}\in G_{M}\) can be uniquely written as \(p^{-M}\widetilde{\varvec{i}}\), where

$$\begin{aligned} \widetilde{\varvec{i}}=\widetilde{\varvec{i}}_{0}+\widetilde{\varvec{i}}_{1}p+\cdots +\widetilde{\varvec{i}}_{2M-1}p^{2M-1} \in \mathbb {Z}_{p}/p^{2M}\mathbb {Z}_{p}, \end{aligned}$$

with the \(\widetilde{\varvec{i}}_{j}\)s belonging to \(\left\{ 0,1,\ldots ,p-1\right\}\). The elements of the \(\mathbb {Z}_{p}/p^{2M} \mathbb {Z}_{p}\) are in bijection with the vertices at the top level of the above mentioned rooted tree. By definition the root of the tree is the only vertex at level 0. There are exactly p vertices at level 1, which correspond with the possible values of the digit \(\widetilde{\varvec{i} }_{0}\) in the p-adic expansion of \(\widetilde{\varvec{i}}\). Each of these vertices is connected to the root by a non-directed edge. At level \(\ell\), with \(1\le \ell \le 2M\), there are exactly \(p^{\ell }\) vertices, each vertex corresponds to a truncated expansion of \(\widetilde{\varvec{i}}\) of the form \(\widetilde{\varvec{i}}_{0}+\cdots +\widetilde{\varvec{i} }_{\ell -1}p^{\ell -1}\). The vertex corresponding to \(\widetilde{\varvec{i} }_{0}+\cdots +\widetilde{\varvec{i}}_{\ell -1}p^{\ell -1}\) is connected to a vertex \(\widetilde{\varvec{i}}_{0}^{\prime }+\cdots +\widetilde{\varvec{i}}_{\ell -2}^{\prime }p^{\ell -2}\) at the level \(\ell -1\) if and only if \(\left( \widetilde{\varvec{i}}_{0}+\cdots +\widetilde{\varvec{i}}_{\ell -1}p^{\ell -1}\right) -\left( \widetilde{\varvec{i} }_{0}^{\prime }+\cdots +\widetilde{\varvec{i}}_{\ell -2}^{\prime }p^{\ell -2}\right)\) is divisible by \(p^{\ell -1}\).

In conclusion, \(\mathbb {Z}_{p}/p^{2M}\mathbb {Z}_{p}\) is a rooted tree, and \(\mathbb {Z}_{p}\) is an infinite rooted tree. Now, the 1-dimensional unit sphere \(\mathbb {Z}_{p}^{\times }\) is the disjoint union of sets of the form \(j+p\mathbb {Z}_{p}\), for \(j\in \left\{ 1,\ldots ,p-1\right\}\). Each set of the form \(j+p\mathbb {Z}_{p}\) is an infinite rooted tree. Then, \(\mathbb {Z} _{p}^{\times }\) is a forest formed by the disjoint union of \(p-1\) infinite rooted trees. On the other hand, \(\mathbb {Q}_{p}^{\times }=\mathbb {Q} _{p}\smallsetminus \left\{ 0\right\}\) is a countable disjoint union of scaled versions of the forest \(\mathbb {Z}_{p}^{\times }\), more precisely, \(\mathbb {Q}_{p}^{\times }= {\textstyle \bigsqcup \nolimits _{k=-\infty }^{k=+\infty }} p^{k}\mathbb {Z}_{p}^{\times }\). The field of p-adic numbers has a fractal structure, see e.g. [1, 29] (Figs. 1 and 2).

Fig. 1
figure 1

The rooted tree associated with the group \(\mathbb {Z}_{2} /2^{3}\mathbb {Z}_{2}\). We identify the elements of \(\mathbb {Z}_{2} /2^{3}\mathbb {Z}_{2}\) with the set of integers \(\left\{ 0,\ldots ,7\right\}\) with binary representation \(\varvec{i}=\varvec{i}_{0}+\varvec{i} _{1}2+\varvec{i}_{3}2^{2},\;\;\;\varvec{i}_{0},\varvec{i} _{1},\varvec{i}_{2}\in \{0,1\}\). Two leaves \(\varvec{i},\varvec{j} \in \mathbb {Z}_{2}/2^{3}\mathbb {Z}_{2}\) have a common ancestor at level 2 if and only if \(\varvec{i}\equiv \varvec{j}\) \({\text {mod}}\) \(2^{2}\), i.e., \(\varvec{i}=\varvec{a}_{0}+\varvec{a}_{1}2+\varvec{i} _{2}2^{2}\) and \(\varvec{j}=\varvec{a}_{0}+\varvec{a} _{1}2+\varvec{j}_{2}2^{2}\) with \(\varvec{i}_{2},\varvec{j}_{2} \in \{0,1\}\). Now, for \(\varvec{i},\varvec{j\in }\mathbb {Z}_{2} /2^{3}\mathbb {Z}_{2}\) have a common ancestor at level 1 if and only if \(\varvec{i}\equiv \varvec{j}\) \({\text {mod}}\) 2. Notice that that the p-adic distance satisfies \(-\log _{2}\left| \varvec{i} -\varvec{j}\right| _{2}=-\left( \text {level of the first common ancestor of }\varvec{i}\text {, }\varvec{j}\right)\)

Fig. 2
figure 2

The heat map associated with the p-adic distance function on \(\mathbb {Z}_{2}/2^{3}\mathbb {Z}_{2}\)

3 p-Adic CNNs: Basic Definitions

We say that a function \(f:\mathbb {R}\rightarrow \mathbb {R}\) is called a Lipschitz function if there exists a real constant \(L(f)>0\) such that, for all \(x,y\in \mathbb {R}\), \(|f(x)-f(y)|\le L(f)|x-y|\). A relevant example is

$$\begin{aligned} f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right) . \end{aligned}$$

3.1 p-Adic Discrete CNNs

By considering \(G_{M}^{N}\) as a subset of \(\mathbb {Q}_{p}^{N}\), \(\left( G_{M}^{N},\left\| \cdot \right\| _{p}\right)\) becomes a finite ultrametric space.

Definition 1

An element \(\varvec{i}\) of \(G_{M}^{N}\) is called a cell. A p-adic discrete CNN is a dynamical system CNN\(_{d}(\mathbb {A},\mathbb {B},U,Z)\) on \(G_{M}^{N}\). The state \(X(\varvec{i},t)\in \mathbb {R}\) of cell \(\varvec{i}\) is described by the following differential equations:

  1. (1)

    state equation:

    $$\begin{aligned} \frac{dX(\varvec{i},t)}{dt}=-X(\varvec{i},t)+\sum _{\varvec{j}\in G_{M}^{N}}\mathbb {A}(\varvec{i},\varvec{j})Y_{\varvec{j}} (t)+\sum _{\varvec{j}\in G_{M}^{N}}\mathbb {B}(\varvec{i},\varvec{j} )U(\varvec{j})+Z(\varvec{i})\text {, }\varvec{i}\in G_{M} ^{N}\text {,\ } \end{aligned}$$
  2. (2)

    output equation:

    $$\begin{aligned} Y_{\varvec{j}}(t)=f(X_{\varvec{j}}(t)), \end{aligned}$$

    where \(Y(\varvec{i},t)\in \mathbb {R}\) is the output of cell \(\varvec{i}\) at the time t, \(f:\mathbb {R}\rightarrow \mathbb {R}\) is a bounded Lipschitz function satisfying \(f(0)=0\). The function \(U(\varvec{i})\in \mathbb {R}\) is the input of the cell \(\varvec{i}\), \(Z(\varvec{i})\in \mathbb {R}\) is the threshold of cell \(\varvec{i}\), and \(\mathbb {A},\mathbb {B}:G_{M} ^{N}\times G_{M}^{N}\rightarrow \mathbb {R}\) are the feedback operator and feedforward operator, respectively (Figs. 3, 4).

Fig. 3
figure 3

A 1-dimensional discrete 2-adic CNN with 8 cells: \(C_{1,3}=\{0,1,2,3,4,5,7\}\subset \mathbb {Z}_{2}/2^{3}\mathbb {Z}_{2} \subset 2^{-3}\mathbb {Z}_{2}/2^{3}\mathbb {Z}_{2}\). We set \(\mathbb {B}=0\) and \(\mathbb {A}(\varvec{i},\varvec{j})=\left[ a_{\varvec{i} ,\varvec{j}}\right]\), with \(a_{\varvec{i},\varvec{j}}\ne 0\) if \(|\varvec{i}-\varvec{j}|_{2}=1/2\) and \(\varvec{i}\), \(\varvec{j}\in C_{1,3}\); \(a_{\varvec{i},\varvec{j}}=0\) otherwise

Fig. 4
figure 4

A 1-dimensional 3-adic CNN with 7 cells, \(C_{1,2} =\{0,1,2,3,4,5,6\}\subset \mathbb {Z}_{3}/3^{2}\mathbb {Z}_{3}\subset 3^{-2}\mathbb {Z}_{3}/3^{2}\mathbb {Z}_{3}\). We set \(\mathbb {B}=0\) and \(\mathbb {A}(\varvec{i},\varvec{j})=\left[ a_{\varvec{i} ,\varvec{j}}\right]\), with \(a_{\varvec{i},\varvec{j}}\ne 0\) if \(|\varvec{i}-\varvec{j}|_{3}=1\) and \(\varvec{i},\varvec{j}\in C_{1,2}\); \(a_{\varvec{i},\varvec{j}}=0\) otherwise. We use colors to make the visualization easier

Not all the cells of \(G_{M}^{N}\) are active. A cell \(\varvec{i}\) is connected with cell \(\varvec{j}\) if \(\mathbb {A}(\varvec{i} ,\varvec{j})\ne 0\) or \(\mathbb {B}(\varvec{i},\varvec{j})\ne 0\) for some \(\varvec{j}\in G_{M}^{N}\). Then, a p-adic discrete CNN is a dynamical system on

$$\begin{aligned} C_{N,M}:=\left\{ \varvec{i}\in G_{M}^{N};\mathbb {A}(\varvec{i} ,\varvec{j})\ne 0\ \text {or }\mathbb {B}(\varvec{i},\varvec{j} )\ne 0 \quad \text { for some }\; \varvec{j}\in G_{M}^{N}\right\} . \end{aligned}$$

The topology of a p-adic discrete \(\text {CNN depends on the functions }\mathbb {A}\), \(\mathbb {B}:\) \(G_{M}^{N}\times G_{M}^{N}\rightarrow \mathbb {R}\). The topology of the network is encoded in an undirected weighted graph \(\left( V,E,W\right)\), where V denotes the set of vertices, E denotes set of edges, and \(W:V\times V\rightarrow \mathbb {R}\) is the weight function. Given two vertices v, \(v^{\prime }\in V\) there is an undirected edge \(l\in E\) connecting them if and only if \(W(v,v^{\prime })\ne 0\). The graph attached to a p-adic discrete \(\text {CNN is defined as }\)

$$\begin{aligned} V=C_{N,M}\text {, }W(\varvec{i},\varvec{j})=\left| \mathbb {A} (\varvec{i},\varvec{j})\right| +\left| \mathbb {B} (\varvec{i},\varvec{j})\right| . \end{aligned}$$

In this article we focus on p-adic CNNs satisfying

$$\begin{aligned} \mathbb {A}(\varvec{i},\varvec{j})=\mathbb {A}(\left\| \varvec{i} -\varvec{j}\right\| _{p})\text {, }\mathbb {B}(\varvec{i} ,\varvec{j})=\mathbb {B}(\left\| \varvec{i}-\varvec{j} \right\| _{p}), \end{aligned}$$
(3.1)

which are discrete CNNs having the space-invariant property. The fact that \(\mathbb {A}\) and \(\mathbb {B}\) are radial functions of \(\Vert \cdot \Vert _{p}\) implies that the cells are organized in a tree like-structure with many layers.

3.2 p-Adic Continuous CNNs

Definition 2

Given A(xy), \(B(x,y)\in L^{1}(\mathbb {Q}_{p}^{N}\times \mathbb {Q}_{p}^{N})\), and U, \(Z\in \mathcal {X}_{\infty }\), a p-adic continuous CNN, denoted as CNN(ABUZ), is the dynamical system given by the following differential equations: (1) state equation:

$$\begin{aligned} \frac{\partial X(x,t)}{\partial t}=-X(x,t)+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(x,y)Y(y,t)d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(x,y)U(y)d^{N}y+Z(x), \end{aligned}$$
(3.2)

where \(x\in \mathbb {Q}_{p}^{N}\), \(t\ge 0\), and (2) output equation: \(Y(x,t)=f(X(x,t))\). We say that \(X(x,t)\in \mathbb {R}\) is the state of cell x at the time t, \(Y(x,t)\in \mathbb {R}\) is the output of cell x at the time t. Function A(xy) is the kernel of the feedback operator, while function B(xy) is the kernel of the feedforward operator. Function U is the input of the \(\text {CNN}\), while function Z is tthe threshold of the \(\text {CNN.}\)

We focus mainly in continuous CNNs having the space invariant property, i.e. \(A(x,y)=A(\Vert x-y\Vert _{p})\) and \(B(x,y)=B(\Vert x-y\Vert _{p})\) for some \(A,B\in L^{1}\), however our results are valid for general p-adic continuous \(\text {CNN}\)s. Along this article the function \(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\) will be fixed, for this reason it does not appear in the list of parameters of the CNNs.

3.3 Discretization of p-adic Continuous CNNs

A central result of the present work is the fact that p-adic continuous CNNs are ‘continuous versions’ of p-adic discrete CNNs. More precisely, p-adic discrete CNNs are very good approximations of p-adic continuous CNNs for sufficiently large M. We discuss here the discretization process in an intuitive way (a formal theorem will be provided later on).

Intuitively, a discretization of a p-adic continuous \(\text {CNN}(A,B,U,Z)\) is obtained assuming that \(X(\cdot ,t)\), A, \(Y(\cdot ,t)\), B, U and Z belong to \(\mathcal {D}^{M}\), i.e.

$$\begin{aligned} X(x,t)= & {} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} X(\varvec{i},t)\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) \text {, \ }Y(x,t)= {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} Y(\varvec{i},t)\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) ,\\ U(x)= & {} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} U(\varvec{i})\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) \text {, \ }Z(x)= {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} Z(\varvec{i})\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) ,\\ A(x,y)= & {} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \text { } {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} A(\varvec{i},\varvec{j})\Omega \left( p^{M}\left\| x-\varvec{i} \right\| _{p}\right) \Omega \left( p^{M}\left\| y-\varvec{j} \right\| _{p}\right) ,\\ B(x,y)= & {} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \text { } {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} B(\varvec{i},\varvec{j})\Omega \left( p^{M}\left\| x-\varvec{i} \right\| _{p}\right) \Omega \left( p^{M}\left\| y-\varvec{j} \right\| _{p}\right) . \end{aligned}$$

Notice that if \(f:\mathbb {R}\rightarrow \mathbb {R}\), then

$$\begin{aligned} f\left( X(x,t)\right) = {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} f(X(\varvec{i},t))\Omega \left( p^{M}\left\| x-\varvec{i} \right\| _{p}\right) =Y(x,t)\text {.} \end{aligned}$$

Now,

$$\begin{aligned} \frac{\partial }{\partial t}X(x,t)= {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \frac{\partial }{\partial t}X(\varvec{i},t)\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) , \end{aligned}$$

and

$$\begin{aligned}&{\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(x,y)f\left( X(y,t)\right) d^{N}y\\ \quad&= {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left\{ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} A(\varvec{i},\varvec{j})f(X(\varvec{j},t)) {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} \Omega \left( p^{M}\left\| y-\varvec{j}\right\| _{p}\right) d^{N}y\right\} \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) \\ \quad&=p^{-MN} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left\{ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} A(\varvec{i},\varvec{j})Y(\varvec{j},t))\right\} \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) . \end{aligned}$$

Similarly,

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(x,y)U(y)d^{N}y=p^{-MN} {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left\{ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} B(\varvec{i},\varvec{j})U(\varvec{j}))\right\} \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) . \end{aligned}$$

Therefore,

$$\begin{aligned} \frac{\partial }{\partial t}X(\varvec{i},t)&=-X(\varvec{i},t)+ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} p^{-MN}A(\varvec{i},\varvec{j})Y(\varvec{j},t)\\&\quad + {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} p^{-MN}B(\varvec{i},\varvec{j})U(\varvec{j})+Z(\varvec{i} )\text {, for }\varvec{i}\in G_{M}^{N}\text {,} \end{aligned}$$

and \(Y(\varvec{i},t)=f(X(\varvec{i},t))\), for \(\varvec{i}\in G_{M}^{N}\). This is exactly a p-adic discrete CNN with \(\mathbb {A} (\varvec{i},\varvec{j})=p^{-MN}A(\varvec{i},\varvec{j})\), \(\mathbb {B}(\varvec{i},\varvec{j})=p^{-MN}B(\varvec{i} ,\varvec{j})\).

Intuitively a p-adic continuous CNN has infinitely many layers, each layer corresponds to some M, which are organized in a hierarchical structure. For practical purposes, a p-adic continuous CNN is realized as a p-adic discrete CNN for M sufficiently large.

4 Stability of p-adic Continuous CNN

Lemma 1

Let f be a Lipschitz function with \(f(0)=0\) and let E be a radial function in \(L^{1}(\mathbb {Q}_{p}^{N})\) . Then, the mappings

$$\begin{aligned} \begin{aligned}&F_{0}:g\rightarrow \int _{\mathbb {Q}_{p}^{N}}E(\Vert x-y\Vert _{p} )f(g(y))d^{N}y\\&F_{1}:g\rightarrow \int _{\mathbb {Q}_{p}^{N}}E(\Vert x-y\Vert _{p})g(y)d^{N}y \end{aligned} \end{aligned}$$

are well defined bounded operators from \(\mathcal {X}_{\infty }\) into itself.

Proof

We first notice that for all \(g\in \mathcal {X}_{\infty }\), \(F_{0}(g)(x)\) exists for all \(x\in \mathbb {Q}_{p}^{N}\), since

$$\begin{aligned} |E(\Vert y\Vert _{p})|\text { }|f(g(x-y))|\le L(f)\Vert g\Vert _{\infty }\text { }\left| E(\Vert y\Vert _{p})\right| , \end{aligned}$$
(4.1)

where \(E(\Vert y\Vert _{p})\in L^{1}(\mathbb {Q}_{p}^{N})\). To show the continuity of \(F_{0}(g)(x)\), we take a sequence \(\{x_{m}\}_{m\in \mathbb {N} }\subset\) \(\mathbb {Q}_{p}^{N}\) such that \(x_{m}\rightarrow x\). By using (4.1) and the dominated convergence theorem, \(\lim _{m\rightarrow \infty }F_{0}(g)(x_{m})=F_{0}(g)(x)\). Finally, we show that \(F_{0} (g)\in \mathcal {X}_{\infty }\). By contradiction, assume that \(F_{0} (g)\not \in \mathcal {X}_{\infty }\). Then, there is a sequence \(\{x_{m} \}_{m\in \mathbb {N}}\subset\) \(\mathbb {Q}_{p}^{N}\) such that \(\lim _{m\rightarrow \infty }\Vert x_{m}\Vert _{p}=\infty\) and \(\epsilon >0\) such that \(F_{0}(g)(x_{m})>\epsilon\) for all \(m\in \mathbb {N}\). By using (4.1) and the dominated convergence theorem, we have

$$\begin{aligned} \epsilon&\le \lim _{m\rightarrow \infty }|F_{0}(g)(x_{m})|=\lim _{m\rightarrow \infty }\left| \int _{\mathbb {Q}_{p}^{N}}E(\Vert y\Vert _{p})f(g(x_{m} -y))d^{N}y\right| \\&\quad =\left| \int _{\mathbb {Q}_{p}^{N}}E(\Vert y\Vert _{p})\left\{ \lim _{m\rightarrow \infty }f(g(x_{m}-y))\right\} d^{N}y\right| =0 \end{aligned}$$

which contradicts the fact \(\epsilon >0\). The same argument allow us to show that \(F_{1}(g)\in \mathcal {X}_{\infty }\) for any \(g\in \mathcal {X}_{\infty }\). \(\square\)

Lemma 2

Assume \(A,B\in L^{1}(\mathbb {Q}_{p}^{N})\) are radial functions and that U, \(Z\in \mathcal {X}_{\infty }\). For \(g\in \mathcal {X}_{\infty }\), set

$$\begin{aligned} \varvec{H}(g):= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})f\left( g(y)\right) d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x). \end{aligned}$$

Then \(\varvec{H}:\mathcal {X}_{\infty }\rightarrow \mathcal {X}_{\infty }\) is a well-defined operator satisfying

$$\begin{aligned} \Vert \varvec{H}(g)-\varvec{H}(g^{\prime })\Vert _{\infty }\le L(f)\Vert A\Vert _{1}\Vert g-g^{\prime }\Vert _{\infty }\text {, for }g\text {, }g^{\prime } \in \mathcal {X}_{\infty }\text {,} \end{aligned}$$

where L(f) is the Lipschitz constant of f.

Proof

By Lemma 1, \(\varvec{H}:\mathcal {X}_{\infty }\rightarrow \mathcal {X}_{\infty }\) is a well-defined operator. Take g, \(g^{\prime } \in \mathcal {X}_{\infty }\), then

$$\begin{aligned} |\varvec{H}(g)(x)-\varvec{H}(g^{\prime })(x)| = \left| \text { } {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})\left( f\left( g(y)\right) -f\left( g^{\prime }(y)\right) \right) d^{N}y\right| \\ \le {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} |A(\Vert x-y\Vert _{p})||f\left( g(y)\right) -f\left( g^{\prime }(y)\right) |d^{N}y\le L(f)\Vert g-g^{\prime }\Vert _{\infty } {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} |A(\Vert x-y\Vert _{p})|d^{N}y\\ =L(f)\Vert A\Vert _{1}\Vert g-g^{\prime }\Vert _{\infty }. \end{aligned}$$

\(\square\)

Remark 1

(i) Lemma 1 remains valid if we replace the condition E is radial and integrable by the condition E(xy) is a continuous function with compact support.

(ii) Under the hypothesis of part (i), Lemma 2 is valid for operators of the form

$$\begin{aligned} \varvec{L}g= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(x,y)f\left( g(y)\right) d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(x,y)U(y)d^{N}y+Z(x), \end{aligned}$$

for \(g\in \mathcal {X}_{\infty }\).

Proposition 1

Assume that A, B, f satisfy hypotheses of Lemma 2 and that U, \(Z\in \mathcal {X}_{\infty }\). Let \(\tau\) be a fixed positive real number. Then for each \(X_{0}\in \mathcal {X}_{\infty }\) there exists a unique \(X\in C([0,\tau ],\mathcal {X}_{\infty })\) which satisfies

$$\begin{aligned} X(x,t)=e^{-t}X_{0}\left( x\right) +\int _{0}^{t}e^{-(t-s)}\varvec{H} (X(x,s))ds \end{aligned}$$
(4.2)

where

$$\begin{aligned} \varvec{H}X(x,t)= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})f(X(y,t))d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x). \end{aligned}$$
(4.3)

The function X(xt) is differentiable in t for all x, and it is a solution of equation (3.2) with initial datum \(X_{0}\).

Proof

The result follows from Lemma 2, by using standard techniques in PDEs, see e.g. [22, Theorem 5.1.2]. To make the treatment comprehensive to a general audience, we provide some details here. First, define

$$\begin{aligned} \varvec{T}(Y)=X_{0}e^{-t}+\int _{0}^{t}e^{-(t-s)}\varvec{H}(Y(x,s))ds, \end{aligned}$$

and \(\mathcal {Y}=C([0,\tau ],\mathcal {X}_{\infty })\) which is a Banach space with the norm \(\Vert \cdot \Vert _{\infty }\). By Lemma 2, \(\varvec{T}:\mathcal {Y}\rightarrow \mathcal {Y}\). If Y, \(Y_{1} \in \mathcal {Y}\), then

$$\begin{aligned}&\Vert \varvec{T}(Y)(t)-\varvec{T}(Y_{1})(t)\Vert _{\infty }=\left\| \int _{0}^{t}e^{-(t-s)}\left\{ \varvec{H}(Y)(s)-\varvec{H} (Y_{1})(s)\right\} ds\right\| _{\infty }\\&\quad \le \int _{0}^{t}e^{-(t-s)}\Vert \varvec{H}(Y)(s)-\varvec{H} (Y_{1})(s)\Vert _{_{\infty }}\text { }ds\le L(f)\Vert A\Vert _{1}\int _{0} ^{t}\Vert Y-Y_{1}\Vert _{_{\infty }}ds. \end{aligned}$$

Now, for \(M\ge 1\), it verifies that

$$\begin{aligned} \Vert \varvec{T}^{M}(Y)(t)-\varvec{T}^{M}(Y_{1})(t)\Vert _{\infty } \le \frac{\tau ^{M}L(f)^{M}\Vert A\Vert _{1}^{M}}{M!}\Vert Y-Y_{1}\Vert _{\infty }, \end{aligned}$$

see the proof of Theorem 5.1.2 in [22]. By the Stirling approximation formula for M!, it holds that \(0<\frac{\tau ^{M}L(f)^{M}\Vert A\Vert _{1}^{M} }{M!}<1\) for some M sufficiently large, and by the contraction mapping theorem applied to \(\varvec{T}^{M}\), there is a unique \(X\in \mathcal {Y}\) which \(\varvec{T}(X)=X\), see e.g. [22, Theorem 1.1.3]. Moreover, since the right-hand side of (4.2) is differentiable in t, X is a solution of (3.2) with initial condition \(X_{0}\). \(\square\)

Remark 2

The contraction mapping theorem provides an iterative formula for X(xt). Set \(X_{1}(x,t)=X_{0}\left( x\right)\) and

$$\begin{aligned} X_{L+1}(x,t)=e^{-t}X_{0}\left( x\right) +\int _{0}^{t}e^{-(t-s)} H(X_{L}(x,s))ds\text {, for }L=1,2,\ldots , \end{aligned}$$

then \(\lim _{L\rightarrow \infty }\Vert X_{L}\left( \cdot ,t\right) -X\left( \cdot ,t\right) \Vert _{\infty }\) \(=0\) for each \(t\le \tau\), see e.g. [22, Theorem 5.2.2].

Theorem 1

Assume A, \(B\in L^{1}(p^{-M_{0}}\mathbb {Z}_{p}^{N})\) are radial functions, for some \(M_{0}\in \mathbb {N}\), and that U, Z, \(X_{0} \in \mathcal {X}_{M_{0}}\). We also assume that f is a Lipschitz function with \(f(0)=0\). Then there is a unique \(X\in C([0,\tau ],\mathcal {X}_{M_{0}})\cap C^{1}([0,\tau ],\mathcal {X}_{M_{0}})\) satisfying (4.2), which is a solution of Eq. (3.2) with initial datum \(X_{0}\).

Remark 3

This theorem remains valid if A(xy), B(xy) are continuous functions with compact support, see Remark 1.

Proof

Since \(\mathcal {X}_{M_{0}}\) is a subspace of \(\mathcal {X}_{\infty }\), and the space \(C([0,\tau ],\mathcal {X}_{\infty })\) is invariant under \(\varvec{T}\), by applying Proposition 1, there exists a unique \(X\in C([0,\tau ],\mathcal {X}_{\infty })\cap C^{1}([0,\tau ],\mathcal {X}_{\infty })\) that satisfies all the announced properties. By Remark 2,

$$\begin{aligned} \lim _{L\rightarrow \infty }\Vert X_{L}\left( \cdot ,t\right) -X\left( \cdot ,t\right) \Vert _{\infty }=0, \end{aligned}$$

where

$$\begin{aligned} X_{L+1}(x,t)=e^{-t}X_{0}\left( x\right) +\int _{0}^{t}e^{-(t-s)} H(X_{L}(x,s))ds\text {, for }L=1,2,\ldots . \end{aligned}$$

By induction on L, if \(X_{L}(\cdot ,s)\in \mathcal {X}_{M_{0}}\), i.e. if

$$\begin{aligned} X_{L}(x,s)&=\sum _{\varvec{i}\in G_{M_{0}}^{N}}X_{L}(\varvec{i} ,s)\Omega \left( p^{M_{0}}\left\| x-\varvec{i}\right\| _{p}\right) ,\\ f(X_{L}(x,s))&=\sum _{\varvec{i}\in G_{M_{0}}^{N}}Y_{L}(\varvec{i} ,s)\Omega \left( p^{M_{0}}\left\| x-\varvec{i}\right\| _{p}\right) \end{aligned}$$

by using that

$$\begin{aligned}&\int _{0}^{t}e^{-(t-s)}H(X_{L}(x,s))ds\\= & {} {\displaystyle \sum \limits _{\varvec{i}\in G_{M_{0}}^{N}}} \left( \int _{0}^{t}e^{-(t-s)}Y_{L}(\varvec{i},s)ds\right) \left( {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})\Omega \left( p^{M_{0}}\left\| y-\varvec{i} \right\| _{p}\right) d^{N}y\right) \\&+ {\displaystyle \sum \limits _{\varvec{i}\in G_{M_{0}}^{N}}} U(\varvec{i})(1-e^{-t}) {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})\Omega \left( p^{M_{0}}\left\| y-\varvec{i} \right\| _{p}\right) d^{N}y\\&+ {\displaystyle \sum \limits _{\varvec{i}\in G_{M_{0}}^{N}}} (1-e^{-t})Z(\varvec{i})\Omega \left( p^{M_{0}}\left\| x-\varvec{i} \right\| _{p}\right) , \end{aligned}$$

and that \(E\in L^{1}(p^{-M_{0}}\mathbb {Z}_{p}^{N})\) is a radial function supported in the ball \(p^{-M_{0}}\mathbb {Z}_{p}^{N}\), we obtain that

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} E(\Vert x-y\Vert _{p})\Omega \left( p^{M_{0}}\left\| y-\varvec{i} \right\| _{p}\right) d^{N}y= {\displaystyle \int \limits _{\varvec{i}+p^{M_{0}}\mathbb {Z}_{p}^{N}}} E(\Vert x-y\Vert _{p})d^{N}y\\ =\left\{ \begin{array}{lll} 0 &{} \text {if} &{} x\notin p^{-M_{0}}\mathbb {Z}_{p}^{N}\\ {\displaystyle \int \limits _{p^{M_{0}}\mathbb {Z}_{p}^{N}}} E(\Vert z\Vert _{p})d^{N}z &{} \text {if} &{} x\in \varvec{i}+p^{M_{0}} \mathbb {Z}_{p}^{N}\\ p^{-M_{0}N}E(\Vert \varvec{i}-\varvec{j}\Vert _{p}) &{} \text {if} &{} x\in \varvec{j}+p^{M_{0}}\mathbb {Z}_{p}^{N}\text {, }\varvec{i} \ne \varvec{j}, \end{array} \right. \end{aligned}$$

and thus

$$\begin{aligned} X_{L+1}(x,t)=e^{-t}X_{0}\left( x\right) +\nonumber \\ {\displaystyle \sum \limits _{\varvec{j}\in G_{M_{0}}^{N}}} \left( \int _{0}^{t}e^{-(t-s)}Y_{L}(\varvec{j},s)ds\right) \left\{ {\displaystyle \sum \limits _{\begin{array}{c} \varvec{i}\in G_{M_{0}} ^{N}\\ \varvec{i}\ne \varvec{j} \end{array}}} a\left( \varvec{i},t\right) p^{-M_{0}N}A(\Vert \varvec{i} -\varvec{j}\Vert _{p})\right\} \quad \Omega \left( p^{M_{0}}\left\| x-\varvec{j}\right\| _{p}\right) \nonumber \\ + {\displaystyle \sum \limits _{\varvec{j}\in G_{M_{0}}^{N}}} a\left( \varvec{j},t\right) \left( {\displaystyle \int \limits _{p^{M_{0}}\mathbb {Z}_{p}^{N}}} A(\Vert z\Vert _{p})d^{N}z\right) \quad \Omega \left( p^{M_{0}}\left\| x-\varvec{j}\right\| _{p}\right) \nonumber \\ + {\displaystyle \sum \limits _{\varvec{j}\in G_{M_{0}}^{N}}} \left\{ {\displaystyle \sum \limits _{\begin{array}{c} \varvec{i}\in G_{M_{0}} ^{N}\\ \varvec{i}\ne \varvec{j} \end{array}}} U(\varvec{i})(1-e^{-t})B(\Vert \varvec{i}-\varvec{j}\Vert _{p})\right\} \quad \Omega \left( p^{M_{0}}\left\| x-\varvec{j}\right\| _{p}\right) \nonumber \\ + \left\{ {\displaystyle \sum \limits _{\varvec{j}\in G_{M_{0}}^{N}}} U\left( \varvec{j}\right) (1-e^{-t}) \quad \left( {\displaystyle \int \limits _{p^{M_{0}}\mathbb {Z}_{p}^{N}}} B(\Vert z\Vert _{p})d^{N}z\right) +(1-e^{-t})Z(\varvec{j})\right\} \quad \Omega \left( p^{M_{0}}\left\| x-\varvec{j}\right\| _{p}\right) , \end{aligned}$$
(4.4)

i.e. \(X_{L+1}(\cdot ,s)\in \mathcal {X}_{M}\). And consequently, \(\left\{ X_{L}(\cdot ,t)\right\} _{L\in \mathbb {N}\smallsetminus \left\{ 0\right\} }\) is a sequence in \(\mathcal {X}_{M}\). Since \(\mathcal {X}_{M}\) is closed in \(\mathcal {X}_{\infty }\), \(X\left( \cdot ,t\right) \in \mathcal {X}_{M}\) for any \(t\le \tau\). \(\square\)

Remark 4

By using that

$$\begin{aligned} p^{MN} {\displaystyle \int \limits _{p^{M}\mathbb {Z}_{p}^{N}}} A(\Vert z\Vert _{p})d^{N}z\rightarrow A(0)\text {, }p^{MN} {\displaystyle \int \limits _{p^{M}\mathbb {Z}_{p}^{N}}} B(\Vert z\Vert _{p})d^{N}z\rightarrow B(0) \end{aligned}$$

as \(M\rightarrow \infty\), see e.g. [27, Theorem 1.14], (4.4) provides an explicit approximation of the continuous CNN described in Theorem 1.

Lemma 3

Let \(\tau\) be a fixed positive real number, let X(xt) be the solution given in Proposition 1, with \(X(x,0)=\) \(X_{0}\). Then, for all \(x,y\in \mathbb {Q}_{p}^{N}\) and \(t\in \left( 0,\tau \right)\),

$$\begin{aligned} |X(x,t)-X(y,t)|\le |X_{0}(x)-X_{0}(y)|e^{\Vert A\Vert _{1}L(f)t}. \end{aligned}$$

Moreover, if \(X_{0}\) is a locally-constant function, i.e. \(X_{0}(x)=X_{0}(y)\) for \(y\in B_{l}(x)\), with \(l=l(x)\in \mathbb {Z}\), for any \(x\in \mathbb {Q} _{p}^{N}\), then \(X(\cdot ,t)\) is a locally-constant function and \(X(x,t)=X(y,t)\) for \(y\in B_{l}(x)\) and for any \(x\in \mathbb {Q}_{p}^{N}\).

Proof

Fix \(x,y\in \mathbb {Q}_{p}^{N}\), by the Proposition 1 and Lemma 2, for all \(t\in (0,\tau ]\)

$$\begin{aligned} |X(x,t)-X(y,t)|&\le e^{-t}|X_{0}(x)-X_{0}(y)|+\int _{0}^{t}e^{-(t-s)} |\varvec{H}(X(x,s))-\varvec{H}(X(y,s))|ds\\&\le |X_{0}(x)-X_{0}(y)|+L(f)\Vert A\Vert _{1}\int _{0}^{t}|X(x,s)-X(y,s)|ds. \end{aligned}$$

By using the fact that x, y are fixed, \(\left| X(x,s)-X(y,s)\right| \in L^{1}(0,\tau )\), and by Gronwall inequality, see [22, Theorem 5.1.1],

$$\begin{aligned} |X(x,t)-X(y,t)|\le |X_{0}(x)-X_{0}(y)|e^{L(f)\Vert A\Vert _{1}t} \end{aligned}$$

for all \(t\in \left( 0,\tau \right)\). \(\square\)

Definition 3

A function \(X_{stat}(x):=X_{stat}(x;A,B,U,Z)\in \mathcal {X}_{\infty }\) is called a stationary state of a p-adic continuous \(\text {CNN}(A,B,U,Z)\), if

$$\begin{aligned} X_{stat}(x)= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})Y(y)d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x) \end{aligned}$$

where \(Y(x)=f(X_{stat}(x))\) and \(x\in \mathbb {Q}_{p}^{N}\).

Remark 5

If a p-adic continuous \(\text {CNN}(A,B,U,Z)\) satisfies that \(\Vert A\Vert _{1}L(f)<1\), then the \(\text {CNN}(A,B,U,Z)\) has a unique stationary state. This follows by the fact that, under this condition, \(\varvec{H}(X)\) becomes a contraction map in \(\mathcal {X}_{\infty }\), cf. Lemmas 1, 2.

Theorem 2

All the states X(xt) of a p-adic continuous \(\text {CNN}(A,B,U,Z)\) are bounded for all time \(t\ge 0\). More precisely, if

$$\begin{aligned} X_{\max }:=\Vert X_{0}\Vert _{\infty }+\Vert f\Vert _{\infty }\Vert A\Vert _{1}+\Vert U\Vert _{\infty }\Vert B\Vert _{1}+\Vert Z\Vert _{\infty }, \end{aligned}$$
(4.5)

then

$$\begin{aligned} |X(x,t)|\le X_{\max }\; \text { for all }\;t\ge 0 \; \text { and for all }\; x\in \mathbb {Q}_{p}^{N}. \end{aligned}$$
(4.6)

In addition

$$\begin{aligned} X_{-}\left( x\right) :=\lim \inf _{t\rightarrow \infty }X(x,t)\le X(x,t)\le \lim \sup _{t\rightarrow \infty }X(x,t)=:X_{+}\left( x\right) , \end{aligned}$$

for \(x\in \mathbb {Q}_{p}^{N}\). If \(X_{-}\left( x\right) =X_{+}\left( x\right) :=X^{*}(x)\), then \(X^{*}(x)\) is a stationary solution of the CNN(ABUZ) and

$$\begin{aligned} X^{*}(x)\ge -\left\| f\right\| _{\infty }\Vert A\Vert _{1}-\Vert U\Vert _{\infty }\Vert B\Vert _{1}+Z(x). \end{aligned}$$
(4.7)

Remark 6

Condition (4.6) implies that X(xt) does not blow-up at finite time. The existence of a stationary state \(X^{*}(x)\) means that the state of each cell of a p-adic continuous CNN must settle at stable equilibrium point after the transient has decayed to zero.

Proof

By Proposition 1, see (4.2)–(4.3), by using that \(\left| Y(y,t)\right| =\left| f\left( X\left( x,t\right) \right) \right| \le \left\| f\right\| _{\infty }\), we have

$$\begin{aligned} \left| \varvec{H}(X\left( x,t\right) )\right|&\le {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} |A(\Vert x-y\Vert _{p})||Y(y,t)|d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} |B(\Vert x-y\Vert _{p})||U(y)|d^{N}y+|Z(x)|\\&\le \Vert f\Vert _{\infty }\Vert A\Vert _{1}+\Vert B\Vert _{1}\Vert U\Vert _{\infty }+\Vert Z\Vert _{\infty }. \end{aligned}$$

Therefore

$$\begin{aligned} \left\| X\left( x,t\right) \right\| _{\infty }&\le e^{-t}\Vert X_{0}\Vert _{\infty }+\int _{0}^{t}e^{-(t-s)}\left\| \varvec{H}\left( X\left( x,s\right) \right) \right\| _{\infty }ds\\&\le \Vert X_{0}\Vert _{\infty }+\Vert f\Vert _{\infty }\Vert A\Vert _{1}+\Vert B\Vert _{1}\Vert U\Vert _{\infty }+\Vert Z\Vert _{\infty }. \end{aligned}$$

This bound is valid for any \(t\in \left[ 0,\tau \right]\), but \(\tau\) is an arbitrary, the bound is valid for any \(t\ge 0\). In this way we establish (4.5)-(4.6).

The bound (4.6) implies existence of the functions:

$$\begin{aligned} X_{+}\left( x\right)&=\lim \sup _{t\rightarrow \infty }X(x,t)=\lim _{M\rightarrow \infty }\sup \left\{ X(x,t);t>M\right\} ,\\ X_{-}\left( x\right)&=\lim \inf _{t\rightarrow \infty }X(x,t)=\lim _{M\rightarrow \infty }\inf \left\{ X(x,t);t>M\right\} . \end{aligned}$$

Now assume that \(X_{+}\left( x\right) =X_{-}\left( x\right) =X^{*}(x)\), then \(\lim _{t\rightarrow \infty }X(x,t)=X^{*}(x)\) exists. By using that

$$\begin{aligned} \int _{0}^{t}e^{-(t-s)}\varvec{H}(X\left( x,s\right) )ds= & {} \int _{0} ^{t}e^{-u}\varvec{H}(X\left( x,t-u\right) )du\\= & {} \int _{0}^{\infty }1_{\left[ 0,t\right] }\left( u\right) e^{-u} \varvec{H}(X(x,t-u))du, \end{aligned}$$

and

$$\begin{aligned} \left| 1_{\left[ 0,t\right] }\left( u\right) e^{-u}\varvec{H} (X(x,t-u))\right| \le \left( \Vert f\Vert _{\infty }\Vert A\Vert _{1}+\Vert B\Vert _{1}\Vert U\Vert _{\infty }+\Vert Z\Vert _{\infty }\right) e^{-u}\in L^{1}(\mathbb {R}), \end{aligned}$$

and the dominated convergence and Lemma 2, it follows from (4.2) that

$$\begin{aligned} \lim _{t\rightarrow \infty }X(x,t)&=X^{*}(x)\\&=\int _{0}^{\infty }e^{-u}\lim _{t\rightarrow \infty }\left\{ 1_{\left[ 0,t\right] }\left( u\right) \varvec{H}(X(x,t-u))\right\} du=\int _{0}^{\infty }e^{-u}\varvec{H}(X^{*}(x,))du\\&= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})f(X^{*}(x))d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x), \end{aligned}$$

which shows that \(X^{*}(x)\) is a stationary solution of the CNN(ABUZ). \(\square\)

5 Stability of p-adic Discrete CNN and Approximation of Continuous CNNs

5.1 The Operators \(\varvec{P}_{M}\), \(\varvec{E}_{M}\)

We now define for \(M\ge 1\), \(\varvec{P}_{M}:\mathcal {X}_{\infty }\rightarrow \mathcal {X}_{M}\) as

$$\begin{aligned} \varvec{P}_{M}\varphi \left( x\right) =\sum _{\varvec{i}\in G_{M}^{N} }\varphi \left( \varvec{i}\right) \Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) . \end{aligned}$$

We remind the reader that the \(\varvec{i}\)s run through a fixed system of representatives of \(G_{M}^{N}\). Therefore \(\varvec{P}_{M}\) is a linear bounded operator satisfying \(\left\| \varvec{P}_{M}\right\| \le 1\).

We denote by \(\varvec{E}_{M}\) , \(M\ge 1\), the embedding \(\mathcal {X} _{M}\rightarrow \mathcal {X}_{\infty }\). The following result is a consequence of the above observations. If \(\mathcal {Z}\), \(\mathcal {Y}\) are real Banach spaces, we denote by \(\mathfrak {B}(\mathcal {Z},\mathcal {Y})\), the space of all linear bounded operators from \(\mathcal {Z}\) into \(\mathcal {Y}\).

Lemma 4

[32, Lemma 2] With the above notation, the following assertions hold true:

(i) \(\mathcal {X}_{\infty }\), \(\mathcal {X}_{M}\) for \(M\ge 1\), are real Banach spaces, all with the norm \(\left\| \cdot \right\| _{\infty }\);

(ii) \(\varvec{P}_{M}\in \mathfrak {B}\left( \mathcal {X}_{\infty },\mathcal {X}_{M}\right)\) and \(\left\| \varvec{P}_{M}\varphi \right\| _{\infty }\le \left\| \varphi \right\| _{\infty }\) for any \(M\ge 1\), \(\varphi \in \mathcal {X}_{\infty }\);

(iii) \(\varvec{E}_{M}\in \mathfrak {B}\left( \mathcal {X} _{M},\mathcal {X}_{\infty }\right)\) and \(\left\| \varvec{E}_{M} \varphi \right\| _{\infty }=\left\| \varphi \right\| _{\infty }\) for any \(M\ge 1\), \(\varphi \in \mathcal {X}_{M}\);

(iv) \(\varvec{P}_{M}\varvec{E}_{M}\varphi =\varphi\) for \(M\ge 1\), \(\varphi \in \mathcal {X}_{M}\);

(v) \(\lim _{M\rightarrow \infty }\left\| \varphi -\varvec{P} _{M}\varphi \right\| _{\infty }=0\) for any \(\varphi \in \mathcal {X}_{\infty }\);

(vi) \(\lim _{M\rightarrow \infty }\Vert \varvec{E}_{M}\varvec{P} _{M}\phi -\phi \Vert _{\infty }=0\) for all \(\phi \in \mathcal {X}_{\infty }\).

Proposition 2

Assume that \(A(\Vert x\Vert _{p})\), \(B(\Vert x\Vert _{p})\), U(x), \(Z(x)\in \mathcal {X}_{M}\), \(M\ge 1\). Let \(\tau\) be a fixed positive real number. Consider the initial value problem:

$$\begin{aligned} \left\{ \begin{array} [c]{l} X\in C([0,\tau ],\mathcal {X}_{M})\cap C^{1}([0,\tau ],\mathcal {X}_{M})\\ \begin{array} [c]{l} \frac{\partial X(x,t)}{\partial t}=-X(x,t)+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})f(X(y,t))d^{N}y\\ + {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x),\text { }x\in B_{M}^{N}\text {, }t\ge 0 \end{array} \\ \\ X(x,0)=X_{0}\in \mathcal {X}_{M}. \end{array} \right. \end{aligned}$$
(5.1)

There exists a unique \(X\in C([0,\tau ],\mathcal {X}_{M})\) which satisfies

$$\begin{aligned} X(x,t)=e^{-t}X_{0}\left( x\right) +\int _{0}^{t}e^{-(t-s)}\varvec{H} (X(x,s))ds \end{aligned}$$

where

$$\begin{aligned} \varvec{H}(X)(x,t)= {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(\Vert x-y\Vert _{p})f(X(y,t))d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(\Vert x-y\Vert _{p})U(y)d^{N}y+Z(x). \end{aligned}$$

The function X(xt) is a solution of Eq. 5.1with initial datum \(X_{0}\).

Proof

The result is established by using the argument given in the proof of Theorem 1. \(\square\)

By the discussion presented in Sect. 3.3, (5.1) describes a p-adic discrete CNN. Furthermore, Theorem 2 is also valid for discrete CNN in \(\mathcal {X}_{M}\).

Remark 7

By using the discretization procedure given in Sect. 3.3 and in the proof of Theorem 1, Proposition 2 implies that the initial value problem

$$\begin{aligned} \left\{ \begin{array} [c]{l} X_{M}\in C([0,\tau ],\mathcal {X}_{M})\cap C^{1}([0,\tau ],\mathcal {X}_{M})\\ \\ \frac{\partial X_{M}}{\partial t}=-X_{M}+\varvec{P}_{M}\varvec{H} (\varvec{E}_{M}X_{M})\\ \\ X_{M}(0)=\varvec{P}_{M}(X_{0}) \end{array} \right. \end{aligned}$$

has a unique solution for an arbitrary \(\tau >0\).

Theorem 3

All the states \(X(\varvec{i},t)\), \(\varvec{i}\in G_{M}^{N}\), in a p-adic discrete CNN are bounded for all time \(t\ge 0\). More precisely, if

$$\begin{aligned} X_{\max }:=\max _{\varvec{i}\in G_{M}^{N}}\left| X_{0}(\varvec{i} )\right| +p^{-MN}\left\| f\right\| _{\infty } {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left| A(\Vert \varvec{i}\Vert _{p})\right| \\ +p^{-MN}\left( \max _{\varvec{i}\in G_{M}^{N}}\left| U(\varvec{i} )\right| \right) {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left| B(\Vert \varvec{i}\Vert _{p})\right| +\max _{\varvec{i}\in G_{M}^{N}}\left| Z(\varvec{i})\right| , \end{aligned}$$

then

$$\begin{aligned} |X(\varvec{i},t)|\le X_{\max }\text { for all }t\ge 0\text { and for all }\varvec{i}\in G_{M}^{N}. \end{aligned}$$

In addition

$$\begin{aligned} X_{-}\left( \varvec{i}\right) :=\lim \inf _{t\rightarrow \infty }X(\varvec{i},t)\le X(\varvec{i},t)\le \lim \sup _{t\rightarrow \infty }X(\varvec{i},t)=:X_{+}\left( \varvec{i}\right) , \end{aligned}$$

for \(\varvec{i}\in G_{M}^{N}\). If \(X_{-}\left( \varvec{i}\right) =X_{+}\left( \varvec{i}\right) :=X^{*}(\varvec{i})\), then

$$\begin{aligned} X^{*}(\varvec{i})&= {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} p^{-MN}A(\Vert \varvec{i}-\varvec{j}\Vert _{p})f(X^{*}(\varvec{j} ))\\&+ {\displaystyle \sum \limits _{\varvec{j}\in G_{M}^{N}}} p^{-MN}B(\Vert \varvec{i}-\varvec{j}\Vert _{p})U(\varvec{j} )+Z(\varvec{i})\text {, for }\varvec{i}\in G_{M}^{N}\text {,} \end{aligned}$$

and

$$\begin{aligned} &X^{*}(\varvec{i})\ge -p^{-MN}\left\| f\right\| _{\infty } {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left| A(\Vert \varvec{i}\Vert _{p})\right| \\ & \quad -p^{-MN}\left( \max _{\varvec{i}\in G_{M}^{N}}\left| U(\varvec{i} )\right| \right) {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} \left| B(\Vert \varvec{i}\Vert _{p})\right| +Z(\varvec{i})\text { , for all }\varvec{i}\in G_{M}^{N}. \end{aligned}$$

Proof

It follows from Proposition 2 and Theorem 2, by assuming that \(A(\Vert x\Vert _{p})\), \(B(\Vert x\Vert _{p})\), U(x), \(Z(x)\in \mathcal {X}_{M}\). Notice that \(A(\Vert x\Vert _{p})\), \(B(\Vert x\Vert _{p})\in \mathcal {X}_{M}\) imply that

$$\begin{aligned} A(\Vert x\Vert _{p})=\text { } {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} A(\left\| \varvec{i}\right\| _{p})\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) ,\\ B(\Vert x\Vert _{p})= {\displaystyle \sum \limits _{\varvec{i}\in G_{M}^{N}}} B(\left\| \varvec{i}\right\| _{p})\Omega \left( p^{M}\left\| x-\varvec{i}\right\| _{p}\right) . \end{aligned}$$

The announced result follows discretizing the formulas given in the proof of Theorem 2 as in Sect. 3.3. \(\square\)

Theorem 4

Let X be the solution of a continuous p-adic CNN given by Theorem 1with initial condition \(X_{0}\). Let \(X_{M}\) be the solution of the Cauchy problem

$$\begin{aligned} \left\{ \begin{array} [c]{l} \frac{dX_{M}}{dt}=-X_{M}+\varvec{P}_{M}\varvec{H}(\varvec{E} _{M}X_{M})\\ X_{M}(0)=\varvec{P}_{M}(X_{0}), \end{array} \right. \end{aligned}$$
(5.2)

cf. Proposition 2 and Remark 7. Then

$$\begin{aligned} \lim _{M\rightarrow \infty }\sup _{0\le t\le \tau }\Vert X_{M}(t)-X(t)\Vert _{\infty }=0. \end{aligned}$$

Proof

The result follows from Lemma 4, Propositions 1, 2, by using standard techniques of approximation for evolution equations, see e.g. [22][Theorem 5.4.7]. See also [32][Section 9.1 and Theorem 7] for an in-depth discussion of similar matters. \(\square\)

6 Numerical Simulations of p-Adic Continuous CNNs

In this section we present some numerical simulations of the solutions of several p-adic continuous \(\text {CNN}\)s in dimension 1. We give two numerical schemes for the numerical approximation of the solutions.

6.1 Numerical Scheme A

Lemma 5

Let \(H(|\cdot |_{p})\in L^{1}(\mathbb {Q}_{p})\) and let \(g\in \mathcal {X}_{\infty }\). We set \(G_{k}=p^{-k}\mathbb {Z}_{p} /p^{k}\mathbb {Z}_{p}\), \(k\in \mathbb {N}\). Then

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} H(|x-y|)g(y)dy=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k};\text { }\varvec{i}\ne x}g(\varvec{i})p^{-k}H\left( |x-\varvec{i} |_{p}\right) +g(x)\left( 1-p^{-1}\right) \sum _{l=k}^{\infty }H\left( p^{-l}\right) p^{-l}. \end{aligned}$$

Proof

By Lemma 4-(v), \(\lim _{k\rightarrow \infty } \sum _{\varvec{i}\in G_{k}}g(\varvec{i})\Omega (p^{k}|x-\varvec{i} |_{p})=g(x)\), now by the dominated convergence theorem,

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} H(|x-y|_{p})g(y)dy&=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k}}g(\varvec{i}) {\displaystyle \int \limits _{\mathbb {Q}_{p}}} H(|x-y|_{p})\Omega (p^{k}|y-\varvec{i}|_{p})dy\\&=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k}}g(\varvec{i}) {\displaystyle \int \limits _{x-\varvec{i}+p^{k}\mathbb {Z}_{p}}} H(|z|_{p})dz. \end{aligned}$$

Now, if \(|x-\varvec{i}|_{p}>p^{-k}\), i.e. \(x\ne \varvec{i}\) in \(G_{k}\), then

$$\begin{aligned} {\displaystyle \int \limits _{x-\varvec{i}+p^{k}\mathbb {Z}_{p}}} H(|z|_{p})dz=p^{-k}H(|x-\varvec{i}|_{p}). \end{aligned}$$

And if \(|x-\varvec{i}|_{p}\le p^{-k}\), i.e. \(x=\varvec{i}\) in \(G_{k}\), then

$$\begin{aligned} {\displaystyle \int \limits _{x-\varvec{i}+p^{k}\mathbb {Z}_{p}}} H(|z|_{p})dz=\sum _{l=k}^{\infty }H(p^{-l})(1-p^{-1})p^{-l}. \end{aligned}$$

\(\square\)

We now assume that A, B are radial integrable functions, and that U, Z, \(X_{0}\in \mathcal {X}_{\infty }\). Based on the continuity of operators \(\varvec{A},\varvec{B}:\mathcal {X}_{\infty }\rightarrow \mathcal {X} _{\infty }\) and the formula given in Lemma 5, we can approximate the solution X(xt) of a p-adic continuous CNN\(\left( A,B,U,Z\right)\) by \(p^{2k}\) ODEs, \(k\ge 1\), of the form

$$\begin{aligned} \frac{d}{dx}X(\varvec{i},t)=-X(\varvec{i},t)+\sum _{\varvec{j}\in G_{k};\text { }\varvec{j}\ne \varvec{i}}f(X(\varvec{j} ,t))p^{-k}A\left( |\varvec{i}-\varvec{j}|_{p}\right) +\\ f(X(\varvec{i},t))\left( 1-p^{-1}\right) \sum _{l=k}^{k_{\max }}A\left( p^{-l}\right) p^{-l} +\sum _{\varvec{j}\in G_{k};\text { }\varvec{j}\ne \varvec{i} }U(\varvec{i})p^{-k}B\left( |\varvec{i}-\varvec{j}|_{p}\right) \\ +U(\varvec{j})\left( 1-p^{-1}\right) \sum _{l=k}^{k_{\max }}B\left( p^{-l}\right) p^{-l} +Z(\varvec{i})\quad \text {, for }\varvec{i}\in G_{k}. \end{aligned}$$

In the simulations the parameters k, \(k_{max}\) were chosen by trial and error on a case by case approach. The sum \(\sum _{l=k}^{k_{\max }} A(p^{-l})p^{-l}\) can be approximated by \(A(p^{-k})p^{-k}\) in the cases were \(A(p^{-k})p^{-k}\) is the dominant term in \(\sum _{l=k}^{k_{\max }}\) \(A(p^{-l})p^{-l}\).

6.2 Numerical Scheme B

Lemma 6

Let \(H(x)=\sum _{l=0}^{m}H_{l}\Omega (p^{k_{l} }|x-b_{l}|_{p})\) be a test function and let \(g\in \mathcal {X}_{\infty }\). Take \(G_{k}=p^{-k}\mathbb {Z}_{p}/p^{k}\mathbb {Z}_{p}\), \(k\in \mathbb {N}\), as before. Then

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} H(x-y)g(y)dy= & {} \lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k} }g(\varvec{i})\sum _{l=0}^{m}H_{l} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} \Omega (p^{k_{l}}|x-\varvec{i}-b_{l}-y|_{p})\Omega (p^{k}|y|_{p})dy\\= & {} \lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k}}g(\varvec{i} )\sum _{l=0}^{m}H_{l}p^{\min (-k,-k_{l})}\Omega \left( p^{-\max (-k,-k_{l} )}|x-\varvec{i}-b_{l}|_{p}\right) \\= & {} \lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k}}g(\varvec{i} )\sum _{l=0}^{m}H_{l}p^{-\max (k,k_{l})}\Omega \left( p^{\min (k,k_{l} )}|x-\varvec{i}-b_{l}|_{p}\right) . \end{aligned}$$

Proof

It is sufficient to consider the case where \(H(x)=\Omega (p^{k_{H}} |x-b_{H}|_{p})\) for some \(k_{H}\in \mathbb {Z}\) and \(b_{H}\in \mathbb {Q}_{p}\). Since \(g(x)=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k} }g(\varvec{i})\Omega (p^{k}|x-\varvec{a}|_{p})\), we have

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} H(x-y)g(y)dy&=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k} }g(\varvec{i}) {\displaystyle \int \limits _{\mathbb {Q}_{p}}} \Omega (p^{k_{H}}|x-b_{H}-y|_{p})\Omega (p^{k}|y-\varvec{i}|_{p})dy\\&=\lim _{k\rightarrow \infty }\sum _{\varvec{i}\in G_{k}}g(\varvec{i}) {\displaystyle \int \limits _{\mathbb {Q}_{p}}} \Omega (p^{k_{H}}|(x-b_{H}-\varvec{i})-y|_{p})\Omega (p^{k}|y|_{p})dy. \end{aligned}$$

Without loss of generality, we may assume that \(k_{H}\le k\), and since any two balls are disjoint or one contains the other, then \(B_{-k}\cap B_{-k_{H} }(x-b_{H}-a)=\emptyset\) or \(B_{-k}\cap B_{-k_{H}}(x-b_{H}-\varvec{i} )=B_{-k}\). The latter case occurs if and only if \(0\in B_{-k_{H}} (x-b_{H}-\varvec{i})\), i.e. when \(|x-b_{H}-a|_{p}\le p^{-k_{H}}\). Therefore

$$\begin{aligned} {\displaystyle \int \limits _{\mathbb {Q}_{p}}} \Omega (p^{k_{H}}|x-b_{H}-\varvec{i}-y|_{p})\Omega (p^{k}|y|_{p} )dy=p^{-k}\Omega \left( p^{k_{H}}|x-b_{H}-\varvec{i}|_{p}\right) . \end{aligned}$$

\(\square\)

We now assume that U, Z, \(X_{0}\in \mathcal {X}_{\infty }\) and that A, B are test functions of the form

$$\begin{aligned} A(x)=\sum _{l=0}^{m_{A}}A_{l}\Omega (p^{k_{l}}|x-a_{l}|_{p}),\quad \text { \ } B(x)=\sum _{l=0}^{m_{B}}B_{l}\Omega (p^{k_{l}}|x-b_{l}|_{p}. \end{aligned}$$

Based on the continuity of operators \(\varvec{A},\varvec{B} :\mathcal {X}_{\infty }\rightarrow \mathcal {X}_{\infty }\) and the formula given in Lemma 6, we can approximate the solution X(xt) of a p-adic continuous CNN by \(p^{2k}\) ODEs, \(k\ge 1\), of the form

$$\begin{aligned} \frac{d}{dx}X(\varvec{i},t)= & {} -X(\varvec{i},t)+\sum _{\varvec{j}\in G_{k}}f(X(\varvec{j},t))\sum _{l=0}^{m_{A}}A_{l}p^{-\max (k,k_{l})} \Omega \left( p^{\min (k,k_{l})}|\varvec{i}-\varvec{j}-a_{l} |_{p}\right) \\&+\sum _{\varvec{j}\in G_{k}}U(\varvec{j)}\sum _{l=0}^{m_{B}} B_{l}p^{-\max (k,k_{l})}\Omega \left( p^{\min (k,k_{l})}|\varvec{i} -\varvec{j}-b_{l}|_{p}\right) +Z(\varvec{i})\text {, for }\varvec{i}\in G_{k}. \end{aligned}$$

It is possible to combine the approximations given in numeric schemes A, B.

6.3 A Remark on the Visualization of Finite Rooted Trees

The discretizations of the kernels A, B are functions on \(G_{k}\times G_{k}\), while the input U and \(X_{0}\) are functions on \(G_{k}\). We use systematically heat maps to present these functions. We always include a plot of the tree \(G_{k}\). By convention we identify the leaves of the tree \(G_{k}\) with the set of rational numbers \(\{0,1/p^{k},2/p^{k},\ldots ,(p^{2k} -1)/p^{k}\}\). Furthermore, we label the levels of \(G_{k}\) with integers from the set \(\left\{ -k,-k+1,\ldots ,0,1,\ldots k-1\right\}\). The level l consists of the cells \(\varvec{i}\), \(\varvec{j}\) such that

$$\begin{aligned} -\log _{p}(|\varvec{i}-\varvec{j}|_{p})=(\text {the level of the first common ancestor of }\varvec{i},\varvec{j})=l. \end{aligned}$$

6.4 First Simulation

In this example, we take \(k=2\), \(p=2\), which means that we use a tree with \(2^{4}=16\) leaves and 4 levels. A basic application of the classical CNNs is image processing, see e.g. [8]. In this example we present a one-dimensional edge detector, which is a p-adic, one-dimensional analog of the examples 3.1 and 3.2 in [8]. The input U is a image having three levels:

$$\begin{aligned} U(x)=\sum _{\varvec{i}\in G_{2}}U_{\varvec{i}}\Omega (2^{2} |x-\varvec{i}|_{2}),\quad U_{a}=\left\{ \begin{array} [c]{lll} -1 &{} \quad \text {if} &{} \, \varvec{i}=1,2,1/4,13/4\\ 0 &{} \quad \text {if} &{} \, \varvec{i}=1/2,9/4,5/4\\ 1 &{} \quad \text {otherwise,} &{} \end{array} \right. \end{aligned}$$

\(x\in G_{2}=2^{-2}\mathbb {Z}_{2}/2^{2}\mathbb {Z}_{2}\). As in [8] we take \(X_{0}(x)=0\),\(\ A(x)=0\). To construct template B, we identify a matrix with a test function. We use

$$\begin{aligned} B(x)=64\Omega (2^{2}|x|_{2})-4 {\displaystyle \sum \limits _{\varvec{i}\in G_{2}\text {; }\varvec{i} \ne 0}} \Omega (2^{2}|x-\varvec{i}|_{2}),\text { }x\in G_{2}\text {.} \end{aligned}$$

Finally, we take \(Z(x)=-\Omega (2^{-2}|x|_{2}),\)\(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\). The output Y(xt) consists of the edges on the input U, see Figs. 5, 6, 7.

Fig. 5
figure 5

Simulation 1. Heat map U(x)

Fig. 6
figure 6

Simulation 1. Heat map of \(B\left( \left| x-y\right| _{2}\right)\), x, \(y\in G_{2}\)

Fig. 7
figure 7

Simulation 1. Step 0.05

6.5 Second Simulation

In this example, we take \(k=2\), \(p=2\), which means that we use a tree with \(2^{4}=16\) leaves and 4 levels. We consider a CNN with the following parameters:

$$\begin{aligned} A(x)=\Omega (2^{2}|x-2^{-2}|_{2}),\text { \ }B(x)=U(x)=\Omega (2^{2} |x|_{2}),\text { }Z(x)=0,\text { }x\in G_{2.}\text {\ } \end{aligned}$$

We set \(X_{0}(x)=0\) and \(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\), see Figs. 8, 9, 10.

Fig. 8
figure 8

Simulation 2. Heat map \(A(x-y)\) for \(x,y\in G_{2}\)

In this network, we have \(A(\varvec{i},\varvec{j})=A(\varvec{i} -\varvec{j})=\Omega \left( 2^{2}\left| \varvec{i}-\varvec{j} -2^{-1}\right| _{2}\right)\), \(B(\varvec{i},\varvec{j} )=B(\left| \varvec{i}-\varvec{j}\right| _{2})=\Omega \left( 2^{2}\left| \varvec{i}-\varvec{j}\right| _{2}\right) =\delta _{\varvec{i},\varvec{j}}\), where \(\delta _{\varvec{i} ,\varvec{j}}\) denotes the Konecker delta function. This network does not have the space-invariant property because \(A(\varvec{i},\varvec{j} )=\Omega 2^{2}\left| \varvec{i}-\varvec{j}-2^{-1}\right| _{2}\) is not a radial function. Due to this fact, \(A(\varvec{i},\varvec{j})\) is not a symmetric matrix. For instance:

$$\begin{aligned} A\left( \frac{15}{4},0\right) =0,\text { }A\left( 0,\frac{15}{4}\right) =1,\text { \ }A\left( \frac{1}{4},0\right) =0,\text { }A\left( 0,\frac{1}{4}\right) =1. \end{aligned}$$
Fig. 9
figure 9

Simulation 2. Heat map of \(B\left( \left| x-y\right| _{2}\right)\) for \(x,y\in G_{2}\)

Fig. 10
figure 10

Simulation 2. Heat map of U(x)

Our interpretation is that there is a connection from cell \(\frac{15}{4}\) to cell 0, and a connection from cell 0 to cell \(\frac{1}{4}\). This assertion is confirm by the output Y(xt), see Fig. 11. Notice that \(Y(\frac{1}{2},t)\ne 0\) and \(A(\frac{1}{2},0)=A(0,\frac{1}{2})=0\). But \(A(\frac{1}{4},\frac{1}{2})=0\), \(A(\frac{1}{2},\frac{1}{4})=1\), then there is a connection from cell \(\frac{1}{4}\) to cell \(\frac{1}{2\text { }}\), which explains the fact that \(Y(\frac{1}{2},t)\ne 0\).

The numerical solutions is given in Fig. 11. We now take \(A(x)=B(x)=\Omega (2^{2}|x|_{2})\). In this case the output Y(xt) changes completely, see Fig. 12.

Fig. 11
figure 11

Simulation 2. Step 0.05

Fig. 12
figure 12

Simulation 2. Output with \(A(x)=B(x)=\Omega (2^{2}|x|_{2})\) and step 0.05

6.6 Third Simulation

In this example, we take \(k=3\), \(p=2\), which means that we use a tree with \(2^{6}=64\) leaves and 12 levels. We consider a CNN with the following parameters: \(A(x)=\Omega (2^{3}|x-2^{-2}|_{2})\), \(B(|x|_{2})=\Omega (2^{3}|x|_{2})\), \(U(x)=\sin (p^{4}|x|_{2})\)\(\ Z(x)=0.15\Omega (2^{-2}|x|_{2})\) for \(x\in G_{3}=2^{-3}\mathbb {Z}_{3}/2^{3}\mathbb {Z}_{3}\). We set \(X_{0}(x)=0\) and \(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\).

As a consequence of the fractal nature of the p-adic numbers, the p-adic CNNs exhibit self-similarity in several ways. For instance, the graph of the kernel A(xy) is a self-similar set, this follows by comparing the graphs given in simulations 2 and 3 for this kernel. In addition, the output \(Y(x,t)=0\) when the norm \(|x|_{2}\) is sufficiently large. In this simulation the CNN produces a pattern similar to the input, see Figs. 13, 14, 15.

Fig. 13
figure 13

Simulation 3. Heat map of \(A(x-y)\) for x, \(y\in G_{3}\)

Fig. 14
figure 14

Simulation 3. Heat map of U(x)

Fig. 15
figure 15

Simulation 3. Step 0.05

6.7 Fourth Simulation

In this example, we take \(k=2\), \(p=2\), which means that we use a tree with \(2^{4}=16\) leaves and 4 levels. The parameters of the CNN are \(A(x)=\Omega \left( 2^{2}\left| x-2^{-2}\right| _{2}\right)\), \(B(x)=U(x)=0\), we set \(X_{0}\left( x\right) =\Omega \left( 2^{2}\left| x\right| _{2}\right)\), \(f(x)=\frac{1}{2}\left( |x+1|-|x-1|\right)\) for \(x\in G_{2}\).

In this example, at time zero the cells near the origin are excited. Which causes all the cells of the network to activate. The activation can be seen in the Fourier transform of the output. After some time the network returns to a state of rest, see Figs. 16, 17, 18.

Fig. 16
figure 16

Simulation 4. Heat map of \(X_{0}(x)\)

Fig. 17
figure 17

Simulation 4. Step 0.05

Fig. 18
figure 18

Simulation 4

7 Conclusions

In this article, we present a p-adic generalization of Chua-Yang CNNs. In the p-adic framework, a continuous CNN is modeled by just one integro-differential equation depending on several p-adic variables and the time. In contrast, the classical CNNs are described by a discrete system of integro-differential equations. The need of constructing continuous models of discrete CNNs whose modeling requires millions of integro-differential equations is quite natural.

A one-dimensional p-adic continuous CNN has infinitely many cells which are hierarchically organized in rooted trees, also a such network has infinitely many hidden layers. The topology of the network, which lately controls the interaction of the cells, depends on the supports of the kernels of the feedback and feedforward operators. Under mild hypotheses, there is a natural discretization process of p-adic continuous CNNs that produces standard discrete CNNs. The solutions of the continuous CNNs can be very well approximated by the solutions of discrete CNNs. Then, for practical purposes, a p-adic continuous CNN is a hierarchical discrete CNN with many hidden layers.

Our numerical simulations show that the solutions of continuous CNN exhibit a very complex behavior, including self-similarity and multistability, depending on the interaction of the parameters defining the network and the initial datum.

In the p-adic framework, the class of continuous CNNs is huge, for instance, consider equations of type

$$\begin{aligned} \frac{\partial X(x,t)}{\partial t}=-\varvec{L}X(x,t)+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} A(x,y)Y(y,t)d^{N}y+ {\displaystyle \int \limits _{\mathbb {Q}_{p}^{N}}} B(x,y)U(y)d^{N}y+Z(x), \end{aligned}$$

where \(\frac{\partial X(x,t)}{\partial t}=-\varvec{L}X(x,t)\) is a p-adic heat equation, i.e. the fundamental solution of a such equation is the transition probability density of a Markov process on \(\mathbb {Q}_{p}^{N}\). The class of p-adic heat equations is extremely large, see e.g. [20, 28, 33]. By incorporating a ‘diffusion term’ is natural to expect that the corresponding network will produce more complex patterns. We plan to study these networks in a forthcoming article. In the classical framework the reaction-diffusion CNNs have been studied intensively, see e.g. [12,13,14].