Coding discretizations of continuous functions
aa r X i v : . [ m a t h . D S ] J u l CODING DISCRETIZATIONS OF CONTINUOUS FUNCTIONS
CRISTOBAL ROJAS AND SERGE TROUBETZKOY
Abstract.
We consider several coding discretizations of continuous functionswhich reflect their variation at some given precision. We study certain statis-tical and combinatorial properties of the sequence of finite words obtained bycoding a typical continuous function when the diameter of the discretizationtends to zero. Our main result is that any finite word appears on a subsequencediscretization with any desired limit frequency. Introduction
Take a straight line in the plane and code it by a 0 − x = n for some n ∈ Z ) writea 0 and each time it crosses an integer horizontal line ( y = n for some n ∈ Z )write a 1. In the case of irrational slope the corresponding sequence is called aSturmian sequence [F]. A classical result tells us that each word that appears insuch a sequence has a limiting frequency. Moreover, the set of numbers occurring aslimit frequencies can be completely described [B]. Recently similar condings havebeen considered for quadratic functions and limiting frequencies are caluculated forwords which appear [DTZ].In this article we ask the question if limiting frequencies can appear in more gen-eral circumstance: namely for typical, in the sense of Baire, continuous functions.For such functions it is not clear which kind of coding should be used. Here wepropose three different notions of coding. For each of these codings we study twodifferent questions: if all finite words can appear in a code or not, and if words inthe code of a typical function can have a limiting frequency.A discretization system of [0 ,
1] is a sequence X n := { x n , x n , ..., x nN n = 1 } ⊂ [0 ,
1] where,(1) X ⊂ X ⊂ ... ⊂ X n ⊂ .... ⊂ [0 , X n , x ni < x ni +1 for all 1 ≤ i < N n ,(3) The maximal resolution H n := max ≤ i The various codes considered:quantitative: Q ( f, n ) = 5 − − − q ( f, n ) = 1 − − − s ( f, n ) = 111110 − − − − − − − − qualitative version q ( f, n ) ∈ {− , , } N n − of the quantitative code Q ( f, n )is defined by setting q ( f, n ) i := , if Q ( f, n ) i > , if Q ( f, n ) i = 0 − , if Q ( f, n ) i < . Finally, the stretched version s ( f, n ) ∈ { , , − } ∗ of the quantitative code Q ( f, n ) is defined as follows: if Q ( f, n ) i is positive then we replace it by a runof Q ( f, n ) i − Q ( f, n ) i is negative.All three of these codes seem natural in terms of discrete curves on the computerscreen. In case when the discretization system is uniform, the streched quantitativecode of a line segment with irrational slope is exactly the well known coding bySturmian sequences [F].Let us introduce some more notation in order to state our main results. Let w, v be finite words over the same alphabet Σ (finite or infintie) such that | w | ≤ | v | . Wedenote by oc ( w, v ) := { j : v j + | w | j = w, ≤ j ≤ | v | − | w |} (1) ODING DISCRETIZATIONS OF CONTINUOUS FUNCTIONS 3 the number of times w occurs in v and by fr ( w, v ) := oc ( w,v ) | v | the relative frequencyof w in v . The minimal periodic factor length p ( w ) of w is defined to be p ( w ) :=min {| u | : oc ( w, wu ) = 2 } . For example, p (010) = 2. Remark . The limit relative frequency of w in some infinite sequence v n is at most p ( w ) . That is: lim sup n fr ( w, v n ) ≤ p ( w ) . Our main result is the following: Theorem 1. Let X n be a discretization system. For a typical f ∈ C ([0 , thefollowing holds: (i) (Qualitative) For any w ∈ {− , , } ∗ and α ∈ [0 , p ( w ) ] , there exists a subse-quence n i such that lim i →∞ fr ( w, q ( f, n i )) = α. (ii) (Quantitative) Suppose that X n satisfies lim inf n nh n = 0 . Then for any w ∈ Z ∗ and α ∈ [0 , p ( w ) ] , there exists a subsequence n i such that lim i →∞ fr ( w, Q ( f, n i )) = α. (iii) (Stretched) Suppose that X n satisfies lim inf n nh n = 0 and H n h n is bounded.Then lim inf n →∞ fr (0 , s ( f, n )) = 0 , if f (1) ≥ f (0)lim inf n →∞ fr (1 , s ( f, n )) = lim sup n →∞ fr ( − , s ( f, n )) = 12 , and if f (1) ≤ f (0)lim sup n →∞ fr (1 , s ( f, n )) = lim inf n →∞ fr ( − , s ( f, n )) = 122. Preliminaries We start by a simple result, which says that one can focus on functions whichdo not intersect the discretization. Lemma 1. Let X n be a discretization system. Then for a typical function f onehas that for all n ∈ N and all i = 1 , ..., N n , f ( x ni ) ∈ ( y nj , y nj +1 ) , for the corresponding j ∈ N .Proof. The set F n = { f : f ( x ni ) = y nj for all j ∈ N and i = 1 , ..., N n } is clearlyopen and dense. Hence, T n F n is a G δ -dense set. (cid:3) One would expect that codings of typical functions contains few zeros and allpossible words of 1’s and − ′ s . This is partially true. Proposition 1. Let X n be a discretization system. For a typical f , q ( f, n ) containsno , infinitely often. CRISTOBAL ROJAS AND SERGE TROUBETZKOY Proof. We prove that the set of functions such that for all n ∈ N , there exists m ≥ n such that q ( f, m ) i = 0 for all i = 0 , ..., N m − 2, is residual in C ([0 , q ( f, n ) i = 0 whenever | f ( x ni +1 ) − f ( x ni ) | > h n . Clearly, the set F m = { f : | f ( x mi +1 ) − f ( x mi ) | > h m for all i = 1 , ..., N m − } is open. Moreover, for each n ∈ N , the set [ m ≥ n F m is a dense open set. Indeed, given g ∈ C ([0 , ε > 0, there exists m ≥ n suchthat h m < ε and it is easy to construct a function f ∈ F m such that k g − f k ∞ < ε .Therefore, \ n [ m ≥ n F m is a G δ -dense set. (cid:3) Remark . In the previous result, the symbol 0 cannot be replaced by 1 nor by − 1. On the other hand, Theorem 1 says that the qualitative and the quantitativecodings of a typical function does not posses any statistical regularity. So that froma statistical viewpoint, the symbols 1 or − n ∈ Z in the quantitative case)are not privileged with respect to 0.2.1. Approximation by ε -boxes. Here we will describe a simple constructionwhich will be used in the proofs of our main results.Let δ > 0. For a given n we define a subdiscretization X δn := { x i k : k = 1 , ..., K } of X n as follows: x i = 0 ,x i k +1 = max { x ni ∈ X n : x ni < x i k + 2 δ } x i K = 1The number of points of X n in the interval ( x i k , x i k +1 ] will be denoted by l k . Withthis notation we have x i k +1 = x i k + l k .Next, to each g ∈ C ([0 , ε > 0, the associated ε -boxes B k ( g, ε, δ ) aredefined by: B k ( g, ε, δ ) := ( x i k , x i k + 2 δ ) × ( g (∆ k ) − ε , g (∆ k ) + ε k = x ik + x ik +1 . See figure 2.1. We shall write just B k when no confusion ispossible.Let δ g : R + → R + denote the modulus of continuity of g . That is, for every x, x ′ in [0 , | x − x ′ | < δ g ( ε ) then | f ( x ) − f ( x ′ ) | < ε . Lemma 2. For the ε -boxes B k ( g, ε, δ ) , k = 1 , ..., K , the following holds: (i) If δ < δ g ( ε ) then the ε -boxes form an ε -cover of the graph of g . That is, any ( x, y ) ∈ S k B k ( g, ε, δ g ( ε )) satisfy | g ( x ) − y | < ε . (ii) If ⌈ δ ⌉ H n < δ , then K = ⌈ δ ⌉ + 1 .Proof. Let ( x, y ) ∈ S k B k . Then ( x, y ) ∈ B k for some k . Hence | x − ∆ k | < δ < δ g ( ε )which implies | g ( x ) − g (∆ k ) | < ε . Since g (∆ k ) − ε < y < g (∆ k ) + ε we conclude | g ( x ) − y | < ε . ODING DISCRETIZATIONS OF CONTINUOUS FUNCTIONS 5 Figure 2. An ε -cover by the boxes B k ( g, ε, δ )Since x i k +1 < x i k + 2 δ , we have that K ≥ ⌈ δ ⌉ + 1. Now, for each k we have x i k + 2 δ − x i k +1 ≤ H n . It follows that K ≤ (cid:24) δ (cid:25) + (cid:24) ⌈ δ ⌉ H n δ (cid:25) . Hence, if 2 δ > ⌈ δ ⌉ H n we obtain K ≤ ⌈ δ ⌉ + 1. (cid:3) Words and frequencies. Consider a finite word w over some alphabet Σ.For each α ∈ [0 , p ( w ) ] and t > 0, it is easy to construct a sequence of finite words v k , k = 1 , ..., K − 1, satisfying | v k | = l k − | fr ( w, v k ) − α | < t . Let b k ∈ Σbe any sequence of K − v = v b v b · · · v K − b K − . Lemma 3. If ( K − | w || v | < t then | fr ( w, v ) − α | < t .Proof. Put oc ( w, v k ) = p k , then we have P K − k =1 p k | v | ≤ fr ( w, f, n ) ≤ P K − k =1 p k | v | + ( K − | w || v | (3)A simple calculation yields P K − k =1 p k | v | = P K − k =1 p k P K − k =1 ( l k − − P K − k =1 p k ( P K − k =1 ( l k − + ( K − P K − k =1 ( l k − . (4) CRISTOBAL ROJAS AND SERGE TROUBETZKOY On the one hand we have: (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) P K − k =1 p k P K − k =1 ( l k − − α (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) = (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) K − K − X k =1 fr ( w, v k ) − α (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) < t and on the other hand, the absolute value of the second term in the right side ofequation (4) is less than | v | − ( K − | v | − ( K − + ( | v | − ( K − K − 1) = 1 | v | ≤ t so that (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) P K − k =1 p k | v | − α (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) < t . Since ( K − | w || v | < t , from equation (3) we obtain | fr ( w, f, n ) − α | ≤ t and thelemma is proved. (cid:3) Proofs Proof of Theorem 1. We begin by proving parts (i) and (ii). For each finite word w in {− , , } ∗ or Z ∗ , let { α ws } s ∈ N be a sequence which is dense on [0 , p ( w ) ]. Let F i denote the open sets defined in Lemma 1 (the set of functions which do notintersect the discretization X i ). For integers s, n, t , consider the sets F qw,s,n,t := { f ∈ ∩ i ≤ n F i : | fr ( w, q ( f, n )) − α s | ≤ t } ,F Qw,s,n,t := { f ∈ ∩ i ≤ n F i : | fr ( w, q ( f, n )) − α s | ≤ t } . Clearly these sets are open since a function f in ∩ i ≤ n F i can be perturbed withoutchanging its code q ( f, n ) or Q ( f, n ). Hence, the following sets are open too. F qw,s,m,t := { f : ∃ n ≥ m, f ∈ F qw,s,n,t } ,F Qw,s,m,t := { f : ∃ n ≥ m, f ∈ F Qw,s,n,t } . We now show that these sets are moreover dense. Let g ∈ C ([0 , ε > 0. Wewill construct a function f in F qw,s,m,t (respectively F Qw,s,m,t ) such that k f − g k ∞ ≤ ε . Case F qw,s,m,t . Put δ < min { δ g ( ε ) , ε } and let B k be the associated ε -boxes. For n ≥ m large enough (in particular such that ⌈ δ ⌉ H n < δ ) there exists a sequenceof finite words v k , k = 1 , ..., K − 1, such that | v k | = l k − | fr ( w, v k ) − α s | < t and ( K − | w | N n < t .We claim that a function f v can be constructed such that for each k we have q ( f v , n ) i k + l k i k +1 = v k and f v is ε -close to g (the interval ( x i k , x i k +1 ) is reserved to make“the bridge” and there are K such intervals, see figure 3). To see this, observe thatthe condition 2 δ < ε implies that for each k , the triangles of vertices ( a k , b k , c k )defined by a qk = ( x i k +1 , g (∆ k )) b qk = ( x i k +1 , g (∆ k ) + | v k | h n ) c qk = ( x i k +1 , g (∆ k ) − | v k | h n ) ODING DISCRETIZATIONS OF CONTINUOUS FUNCTIONS 7 PSfrag replacements x i k x i k +1 x i k +1 a k b k c k Figure 3. The triangles ( a k , b k , c k ) . are included in B k and that for any v k , a function f v such that q ( f v , n ) i k + l k i k +1 = v k can be inscribed in these triangles. By lemma 2 a function f so constructed satisfies k f − g k ∞ ≤ ε . By lemma 3 we have that | fr ( w, q ( f, n )) − α s | < t . Case F Qw,s,m,t . The proof that these sets are dense is the same as for the sets F qw,s,m,t , with the only exception that we have to take δ < ε H ( w ) where H ( w ) :=max i | w i | denotes the hight of w . This condition assures that a function f v suchthat q ( f v , n ) i k + l k i k +1 = v k can be inscribed in the corresponding triangles: a Qk = ( x i k +1 , g (∆ k )) b Qk = ( x i k +1 , g (∆ k ) + | v k | H ( w ) h n ) c Qk = ( x i k +1 , g (∆ k ) − | v k | H ( w ) h n ) . It follows that the sets \ w,s,m,t F qw,s,m,t and \ w,s,m,t F Qw,s,m,t are both G δ -dense.Finally we prove part (iii). Let u n := oc (1 , s ( f, n )) be the numbers of 1’s (or“ups”) in s ( f, n ) and d n := oc ( − , s ( f, n )) be the number of − n . Then V n = u n + d n denotes the total n -variation . By definition we have CRISTOBAL ROJAS AND SERGE TROUBETZKOY that | s ( f, n ) | = V n + N n , where N n is both the cardinality of the discretization andthe number of zeros. Hence we have fr (1 , s ( f, n )) = u n V n + N n . We will need the following lemma: Lemma 4. Let X n be a discretization system satisfying lim inf n nh n = 0 . Then,for a typical f , there are infinitely many n such that u n > nN n and d n > nN n .Proof. Consider the set of functions F n := (cid:26) f : card { i : Q ( f, n ) i > n } > N n card { i : Q ( f, n ) i < − n } > N n (cid:27) ∩ \ i ≤ n F i This is an open set. Moreover, for any m ∈ N , the set [ n ≥ m F n is dense. For let g ∈ C [0 , 1] and consider the associated ε -boxes B k . It is clearthat for some n ≥ m such that nh n < ε one can construct a function f satisfying graph ( f ) ⊂ ∪ k B k and | f ( x i +1 ) − f ( x i ) | > n for all i . Moreover, we can alternatethe sign of | f ( x i +1 ) − f ( x i ) | at every i , with at most K exceptions. Hence thefunction so constructed belongs to F n and then the set \ m [ n ≥ m F n is G δ dense. (cid:3) Now, a simple calculation yields u n V n = 12 − ∆ n u n where ∆ n = ⌊ ( f (1) − f (0)) h n ⌋ . So, if f (1) = f (0) we have u n V n = . Let M be a boundfor H n h n . We have then that h n ≤ M N n and hence ∆ n ≤ ( f (1) − f (0)) M N n . ByLemma 4 we have that( f (1) − f (0)) M N n u n < f (1) − f (0)) M N n nN n and N n V n < n for infinitely many n , so that,lim inf ∆ n u n = 0 if f (1) > f (0) , (5)lim sup ∆ n u n = 0 if f (1) < f (0) . (6)Hence, when f (1) > f (0) we havelim inf n →∞ u n V n + N n = lim inf n →∞ u n V n = 12 − lim inf ∆ n u n = 12 ODING DISCRETIZATIONS OF CONTINUOUS FUNCTIONS 9 and when f (1) < f (0) we havelim sup n →∞ u n V n + N n = lim sup n →∞ u n V n = 12 − lim inf ∆ n u n = 12and the results follows by symmetry. (cid:3) References [B] V. Berth´e, Frequencies of Sturmian series factors , Theoretical Computer Science. 165(2):295-309 (1996)[DTZ] A. Daurat, M. Tajine, M. Zouaoui, Fr´equences des motifs d’une discr´etisation de courbe