Vous êtes sur la page 1sur 82

The Theory Behind The Summed Area Tables

Algorithm: A Simple Approach To Calculus

Amir Finkelstein

e-mail: amir.f22@gmail.com

May 15, 2010

Abstract
Ever since the early 1980's, computer scientists have been using dis-
crete versions of Green's and Stokes' theorems. These theorems were
shown to provide a tremendous computational gain, since they t pre-
cisely to the needs of Discrete Geometry researchers, due to their discrete
nature. In this book the author suggests that these theorems are actually
derived from a dierently dened Calculus, namely the "Calculus of De-
tachment". The main operator of this theory is dened by a mixture of
discrete and continuous math, to form a simpler and more ecient opera-
tor than the derivative. This approach to analyze functions is hence more
suitable for computers (in order to save computation time), and the sim-
plicity of the denition allows further research in other areas of Classical
Analysis.
Contents
I Prologue 5
1 Introduction 5
2 Previous Work 5
2.1 Integral Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Integral Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 A generalization of the Fundamental Theorem of Caclulus . . . . 7
2.4 Discrete Version of Stokes' Theorem . . . . . . . . . . . . . . . . 7

II Basic Terminology In Calculus 10


3 Denition of the detachment 10
4 Denition of the signposted detachment 11
5 A natural extension to the detachment 16

III Fundamental Properties of The Detachment Oper-


ators 18
6 Classication of disdetachment points 18
7 Analysis of the weather vane function 21
8 Tendency and extremum indicator 26
8.1 Denition of operators . . . . . . . . . . . . . . . . . . . . . . . . 26
8.2 Geometric interpretation of the tendency . . . . . . . . . . . . . 28

9 continuity and the detachment 29


10 Monotony and the detachment operators 30
10.1 Tendency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
10.2 Detachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
10.3 Signposted Detachment . . . . . . . . . . . . . . . . . . . . . . . 33
10.4 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
10.5 General notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

11 Boundedness and the detachment 34

2
12 Dierentiability and the detachment 35
12.1 Joint points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
12.2 Dierentiability Vs. tendability of functions . . . . . . . . . . . . 37
12.3 Dierentiability related sucient conditions for tendability . . . 37

13 Fundamental theorems involving the detachment 38


13.1 Closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
13.2 Arithmetic rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
13.3 Analogous versions to the even\odd theorems (of the derivative) 40
13.4 An analogous version to Fermat's theorem . . . . . . . . . . . . . 41
13.5 An analogous version to Rolle's theorem . . . . . . . . . . . . . . 41
13.6 An analogous verion to Lagrange's theorem . . . . . . . . . . . . 42
13.7 An analogous version to Darboux's theorem . . . . . . . . . . . . 43
13.8 An analogous version to the Fundamental Theorem of Calculus . 45

IV Computational Cost Related Discussion 49


14 Approximation of partial limits 49
15 Computational cost 50

V The discrete Green's theorem in a non-discrete do-


main 53
16 Tendency of a curve 53
16.1 Basic terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
16.2 Classication of edge points according to the tendency indicator
vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
16.3 Classication of corners according to the tendency indicator vector 56
16.4 Denition of tendency of a curve . . . . . . . . . . . . . . . . . . 60
16.5 Geometric interpretation of the tendency of a curve . . . . . . . . 61

17 Slanted line integral 64


17.1 Denition of the slanted line integral . . . . . . . . . . . . . . . . 64
17.2 Properties of the slanted line integral . . . . . . . . . . . . . . . . 66

18 The discrete Green's theorem for a non-discrete domain 70

VI Epilogue 77
19 Future work 77

3
20 Appendix 78
20.1 A dierent denition to the limit process . . . . . . . . . . . . . . 78
20.2 Source code in matlab . . . . . . . . . . . . . . . . . . . . . . . . 80

4
Part I
Prologue

1 Introduction
Ever since the early 1980's, the discrete geometry community has issued inte-
gration algorithms that form discrete versions to the integration theorems of
the advanced Calculus (the discrete Green's theorem and the discrete Stokes'
theorem).
The discrete versions of these theorems were required to enable computational
eciency: for example, the discrete Green's theorem enables to calculate the
double integral of a function in a discrete domain (a domain whose boundary
is parallel to the axes, as is usually the case in discrete geometry) in a more
ecient manner with respect to the regular Green's theorem, due to the fact
that the calculation is taken place based on the corners of the discrete region,
and there is no need to pass through the entire boundary - as opposed to the
regular Green's theorem, that points out the connection between the double
integral and the line integral. The computational saving is enabled due to a
pre-processing, that includes a calculation of the antiderivative of the function.
In this paper we will suggest a theory - in R and in R2 - to the origin of these
discrete theorems. The paper is divided as follows. In part 1, depicted is a short
survey of early work in discrete geometry. In part 2 the basic operators are de-
ned. The operators are shown to be simple tools for the analysis of monotonic
regions of any function. The most fundamental operator, the detachment, forms
a hybridization between two kinds of mathematics: continuous math (Calculus)
and discrete math (the sgn (·) operator). In part 3 a mathematical discussion is
held, where: the connection between the properties of these operators to those
of the familiar derivative is surveyed; analogous versions to some of the most
fundamental theorems of Calculus are depicted; the geometric interpretation of
one of the operators is drawn; a discussion is held regarding the cases where
it is impossible to apply one or more of the operators to functions; a general
function that demonstrates the operators' approach is shown; and a structure
to the Calculus is suggested. In part 4, an engineering-oriented discussion is
held regarding the computational cost of the usage of the suggested operators.
Amongst others, a proof is suggested to the computational preferability of the
usage in these operators, when compared to the derivative. In part 5, terminol-
ogy and theorems are suggested, whose aim is to generalize the discrete Green's
theorem to a more generalized type of domain. In part 6 the paper is sealed;
the appendix suggests another denition to the limit process.

2 Previous Work
In this section the author chose to depict basic concepts from discrete geometry.

5
2.1 Integral Image
Followed is an introduction to probably one of the most stunning breakthroughs
in the eld of computational-gain driven integral calculus theorems over discrete
domains, which was rst introduced (to the author's knowledge) by Tang in
1982. The idea of summed area tables, was later introduced by Lance Williams
and Franklin Crow in ([6]). Yet, the most inuencial paper in this area is Viola
and Jones' Integral Image algorithm ([1]), which applies summed are tables to
fast calculations of sums of squares in an image.
2
Q
The idea is as follows. Given a function i over a discrete domain [mj , Mj ] ⊂
j=1

Z2 , dene a new function (sat stands for summed area table, and i stands for
image):
X
sat (x, y) = i (x0 , y 0 ) ,
x0 ≤x y 0 ≤y
V

and now the sum of all the values that the function i accepts on the grid [a, b] ×
[c, d] , where m1 ≤ a, b ≤ M1 and m2 ≤ c, d ≤ M2 , equals:

b d
X X
i (x0 , y 0 ) = sat (b, d) + sat (a, c) − sat (a, d) − sat (b, c) .
x0 =ay 0 =c

2.2 Integral Video


The idea of Integral Image was extended by Yan Ke, Rahul Sukthankar and
Martial Hebert in [3]. This algorithm was named Integral Video, for it aims
to calculate the sum of volumetric features dened over a video sequence. It
generalizes the Integral Image concept in the sense, that the cumulative function
is generalized to deal with three dimensions. Namely, given a function i over a
3
3
Q
discrete domain [mi , Mi ] ∈ Z , dene a new function:
i=1

X
sat (x, y, z) = i (x0 , y 0 , z 0 ) ,
x0 ≤x y 0 ≤y z 0 ≤y
V V

and now the sum of all the values that the function i accepts on the grid [a, b] ×
[c, d] × [e, f ] , where m1 ≤ a, b ≤ M1 , m2 ≤ c, d ≤ M2 , and m3 ≤ e, f ≤ M3 ,
equals:

b d f
X X X
i (x0 , y 0 , z 0 ) = sat (b, d, f ) − sat (b, d, e) − sat (b, c, f ) + sat (b, c, e)
x0 =ay 0 =cz 0 =e

−sat (a, d, f ) + sat (a, c, f ) + sat (a, d, e) − sat (a, c, e) .

6
2.3 A generalization of the Fundamental Theorem of Ca-
clulus
Wang et al. ([7]) suggested to further generalize the Integral Image concept, in
2007. They issued the following argument, which forms a natural generalization
to the Fundamental Theorem of Calculus:

Given a function f (x) : Rk −→ Rm , and a rectangular domain D = [u1 , v1 ] ×


. . . × [uk , vk ] ⊂ Rk . If there exists an antiderivative F (x) : Rk −→ Rm , of f (x),
then:
ˆ
ν T1
X
f (x) dx = (−1) F (ν1 u1 + ν 1 u1 , . . . , νk uk + ν k uk ) ,
D ν∈B k

T T1
where
´ 1 , . . . , νk ) , ν = ν1 + . . . + νk , νi = 1 − νi , and B = {0, 1} . If
ν = (ν
k = 1, then f (x) dx = F (v1 ) − F (u1 ), which is the Fundamental Theorem of
D
Calculus. If k = 2, then
ˆ
f (x) dx = F (v1 , v2 ) − F (v1 , u2 ) − F (u1 , v2 ) + F (u1 , u2 ) ,
D

and so on.

This formula suggests a tremendous computational power in many applications,


such as in the probability and the computer vision eld, as was shown to hold
in [7].

2.4 Discrete Version of Stokes' Theorem


Back in 1982, Tang ([10]) suggested a discrete version of Green's theorem. In
their paper from 2007, Wang et al.'s ([7]) suggested to further generalize Tang's
theorem to any nite dimension. This is in fact the rst time, known to the
author, that a discrete version to Stokes' theorem was published. In their paper
from 2009, Labelle and Lacasse ([9]) suggested a dierent proof to a similar
theorem. The formulation of this theorem, as suggested in Wang et al.'s work,
is as follows:

Theorem. (The Discrete Green's Theorem). Let D ⊂ Rn be


a generalized rectangular domain, and let f be a Lebesgue-Integrable function
in Rn . Let F be the antiderivative of f, in the same terms of this paper's
theorem 2. Then: ˆ X
f dλ = αD (x) F (x) ,
x∈∇·D
D

where αD : Rn −→ Z, is a map that depends on n. For n = 2 it is such that


αD (x) ∈ {0, ±1, ±2}, according to which of the 10 types of corners, depicted in

7
Figure 1: The corners on which Wang et al.'s pointed out in their paper. The
numbers {±1, ±2} are the corner's  αD , which is a term that this paper seeks
to dene in a rigorous manner.

gure 1 in Wang et al.'s paper (and in this paper's gure 1), x belongs to.

The goal of this paper is to nd a more rigorous denition to the term of  αD 
in the above theorem, research the pointwise operator that forms this term, and
nd a more general version to this theorem, which holds also for a non-discrete
domain. Some of the results that this paper depicts are depicted in gure 2.

8
Figure 2: The owered boxes are some of the results that this paper suggests.

9
Part II
Basic Terminology In Calculus

3 Denition of the detachment


Definition. The sign operator. Given a constant r ∈ R, we will dene
sgn (r) as follows:

+1, r > 0

sgn (r) ≡ −1, r < 0

0, r = 0.

Definition. Detachable function in a point. Given a function f : R → R,


we will say that f is detachable in a point x∈R if the following limit exists:

∃limsgn [f (x + h) − f (x)] .
h→0

Definition. Right-detachable function in a point. Given a function f :


R −→ R, we will say that it is right-detachable in a point x ∈ R, if the following
limit exists:
∃ lim+ sgn [f (x + h) − f (x)] .
h→0

Definition. Left-detachable function in a point. Given a function f : R −→


R, we will say that it is left-detachable in a point x ∈ R, if the following limit
exists:
∃ lim sgn [f (x + h) − f (x)] .
h→0−

Note. A function f : R −→ R is detachable in a point x0 ∈ R i it is both


left and right detachable in x0 , and the limits are equal.

Definition. Detachable function in an interval. Given a function f : R → R,


we will say that f is detachable in an interval I if one of the following holds:

1. I = (a, b) , and f is detachable for each x ∈ (a, b).


2. I = [a, b), and f is detachable for each x ∈ (a, b) and right detachable in
a.
3. I = (a, b], and f is detachable for each x ∈ (a, b) and left detachable in b.
4. I = [a, b], and f is detachable for each x ∈ (a, b), left detachable in b and
right detachable in a.

10
Figure 3: The idea of the denition of the detachment is very simple. Let us
observe the term: f (x + h) − f (x). It is clear that for any continuous function,
it holds that: lim [f (x + h) − f (x)] = 0. The derivative, however, manages
h→0
to supply interesting information by comparing dy to dx, via a fraction. The
detachment uses less information, and quantizes dy , via the function sgn (·). The
detachment of the function does not reveal the information regarding the rate
of change of the function. It is a trade-o between eciency and information
level, as will be discussed later on.

Definition. Detachment in a point. Given a detachable function f : R → R,


we will dene the detachment operator applied for f as:

f ; : R → {+1, −1, 0}
;
f (x) ≡ limsgn [f (x + h) − f (x)] .
h→0

Applying the detachment operator to a function will be named: detachment of


the function.

Definition. Left or right detachment in a point. Given a left or right detach-


able function f : R → R, we will dene the left or right detachment operators
applied for f as:

;
f± : R → {+1, −1, 0}
;
f± (x) ≡ lim sgn [f (x + h) − f (x)] .
h→0±

Applying the detachment operator to a function will be named: left or right


detachment of the function.

4 Denition of the signposted detachment


Definition. Signposted detachable function in a point. Given a function
f : R → R, we will say that f is signposted detachable in a point x∈R if the

11
Figure 4: An illustration to the detachment process. It is clear from this gure
why the term of detachment was selected: The function is being torn in its
extrema points.

following limit exists:

∃limsgn [h · (f (x + h) − f (x))] .
h→0

Definition. Right or left signposted detachable function in a point. Given


a function f : R −→ R, we will say that it is right signposted detachable in a
point x ∈ R, if it is right or left detachable there, respectively.

Definition. signposted detachable function in an interval. Given a func-


tion f : R → R, we will say that f is signposted detachable in an interval I if
one of the following holds:

1. I = (a, b) , and f is signposted detachable for each x ∈ (a, b).


2. I = [a, b), and f is signposted detachable for each x ∈ (a, b) and right
(signposted) detachable in a.

3. I = (a, b], and f is signposted detachable for each x ∈ (a, b) and left
(signposted) detachable in b.
4. I = [a, b], and f is signposted detachable for each x ∈ (a, b), left (sign-
posted) detachable in b and right (signposted) detachable in a.

Definition. Signposted detachment in a point. Given a signposted detach-


able function f : R → R, we will dene the signposted detachment operator

12
applied for f as:

f~; : R → {+1, −1, 0}


f~; (x) ≡ limsgn [h · (f (x + h) − f (x))] .
h→0

Applying the signposted detachment operator to a function will be named: sign-


posted detachment of the function.

Definition. Left or right signposted detachment in a point. Given a left


or right signposted detachable function f : R → R, we will dene the left or
right signposted detachment operators applied for f as:

f~±
;
: R → {+1, −1, 0}
f~±
;
(x) ≡ ± lim± sgn [(f (x + h) − f (x))] .
h→0

Applying the signposted detachment operator to a function will be named: left


or right signposted detachment of the function.

Examples.
1. Let us consider the following function:

f :R→R
(
x, x ∈ Q
f (x) =
x2 , x ∈
/ Q.
Then f is right detachable and right signposted detachable there, and
;
f+ (0) = +1. However, it is not left detachable there.
2. Let us consider the following function:

f :R→R
(
xsin x1 , x 6= 0

f (x) =
0, x = 0.
Then f is not right nor left detachable in x=0 since the limits

lim sgn [f (h) − f (0)]


h→0±

do not exist, although it is continuous in x = 0.


3. Let us consider the following function:

f :R→R
(
x2 sin x1 , x 6= 0

f (x) =
0, x = 0.
Then f is not right nor left detachable in x = 0 since the limits lim± sgn [f (h) − f (0)]
h→0
do not exist, although it is dierentiable in x = 0.

13
4. The function f : R → R, f (x) = |x| is detachable in x = 0 althought it is
not dierentiable there. f is also signposted detachable in R\ {0}.
5. It is not true that if f is detachable in a point x then there exists a
neighborhood I (x) such that f is signposted detachable in I . Let us
consider the following function:

f : [−1, 1] → R

2,
 x=0
f (x) = (−1)n , x = n1 , n ∈ Z

0, otherwise.

then f ; (0) =S−1


 , however it is easy to see that for any other point x∈
t|t = n1 , n ∈ Z , there are

[−1, 1] \ {0} innitely many points in any
punctured neighborhood where f receives higher values, and innitely
many points in any punctured neighborhood where f receives lower values,
than in the point x. Hence, f is not detachable nor signposted detachable
in any neighborghood of x = 0.
6. Let us consider the function:

f :R→R
(
0, x ∈ R\Z
f (x) =
1, x ∈ Z.

Then the detachment of f is:

f; : R → R
(
0, x ∈ R\Z
f ; (x) =
−1, x ∈ Z,

hence it exists in any point, although f is not continuous in innitely many


points. The signposted detachment of f is:

f~; : R\Z → {0}


f~; (x) = 0.

f~; is not dened for integers since for all the points x∈Z it holds that
; ;
f+ (x) 6= −f− (x).

14
f : R → R, f (x) = x2 + x. Then:
7. Let us consider the function:
h i
; 2
f+ (x) = lim sgn (x + h) + x + h − x2 − x
h→0+

= lim+ sgn x2 + 2xh + h2 + x + h − x2 − x


 
h→0

= lim sgn 2hx + h2 + h


 
h→0+

= lim sgn (h) · lim sgn [2x + h + 1]


h→0+ h→0+

h+1
−1, x < − 2

h+1
= lim+ 0, x=− 2
h→0 
+1, x > − h+1

2

1

 −1, x < − 2
= 0, x = − 12
+1, x > − 12 .

8. The function:

f :R→R
(
tan (x) , x 6= π2 + πk
f (x) = , k∈Z
0, x = π2 + πk

is everywhere signposted detachable and nowhere detachable.

9. Riemann's function:

f :R→R
(
1
, x = pq ∈ Q
f (x) = q
0, x ∈ R\Q,

is nowhere signposted detachable. It is detachable on the rationals, since


for any point x∈Q f ; (x) = −1, and it is not detachable
it holds that on
;
the irrationals, for any point x∈
/ Q, the terms f± (x) do not exist.
10. The function:

f : R\ {0} → R\ {0}
(
1
, x∈Q
f (x) = x 1
− x , x ∈ R\Q

is detachable from right for any point x > 0, and detachable from left for
any point x < 0. However, this function is discontinuous anywhere.

11. Both the directions of the argument:

;
f± (x0 ) = k ⇐⇒ lim f ; (x) = k
x→x0

15
are incorrect. For example, the function:

f : [0, 1] → R
(
1, x = 0
f (x) =
0, 0 < x ≤ 1
;
satises lim f ; (x) = 0 although f+ (0) = −1. Further, the function:
x→0+

f : (−1, 1) → R
(
sin x1 , x 6= 0

f (x) =
17, x = 0.
;
satises that f+ (0) = −1 although lim f ; (x) does not exist.
x→0+

12. A function may be detachable in a point even if its limit in the point does
not exist from either sides. For example, let   1 be a constant, then the
function:

f :R→R
(
sin 1 + ,

x x 6= 0
f (x) =
0, x = 0,

is detachable in x=0 althogh the limit there is undened.

13. Weirstrass' function has both uncountably many non-extrema points where
its detachment is not dened, and uncountably many extrema points,
where its detachment is dened.

5 A natural extension to the detachment


Definition. Indicator function of a function with respect to domains. Given
a function
S f : R −→ R and a set of disjoint domains A = {An }1≤n≤N ⊆ R such
that An = R, and a set of scalars r = {rn }1≤n≤N , we will dene the indicator
n
function of f with respect to A in the following manner:

χA f : R → r
χrA f (x) = rn ⇐⇒ f (x) ∈ An .

Definition. Generalized detachable function. Given a function f : R −→ R,


we will say that it is generalized-detachable in a point x ∈ R with respect to
the set of domains A = {An }1≤n≤N ⊆ R and a set of scalars r = {rn }1≤n≤N , if
the following limit exists:

∃limχrA [f (x + h) − f (x)] .
h→0

16
Example. Any detachable function is generalized-detachable with respect to
S S
A = {0} (−∞, 0) (0, ∞), and the set of scalars {0, −1, +1}.

Definition. The generalized detachment operator. Given a left or right


generalized detachable function f : R → R with respect to a set of domains
A = {An }1≤n≤N ⊆ R and a set of scalars r = {rn }1≤n≤N , we will dene the
left or right generalized detachment operators applied for f with respect to A
and r as:

;(A,r)
f± : R→r
;(A,r)
f± (x) ≡ lim χrA [f (x + h) − f (x)] .
h→0s

Applying the detachment operator to a function will be named: generalized


detachment of the function.

17
Part III
Fundamental Properties of The

Detachment Operators

6 Classication of disdetachment points


Definition. Null disdetachment. Given a function f : R −→ R, let x∈R be
a point there. We will say that f is null disdetachable there if it is detachable
from both sides, but not detachable nor signposted detachable there.

Definition. Upper detachable function. Given a function f : R −→ R,


we will say that it is upper detachable in a point x ∈ R, if the following partial
limit exist:
∃limsupsgn [(f (x + h) − f (x))] .
h→0

Definition. The upper detachment operator. Given a function f :R→R


(not necessarily upper detachable), we will dene the upper detachment opera-
tors applied for f from right or left, as:

;
supf± : R → {+1, −1, 0}
;
supf± (x) ≡ limsupsgn [(f (x + h) − f (x))] .
h→0±

Definition. Lower detachable function. Given a function f : R −→ R, we


will say that it is lower detachable in a point x ∈ R, if the following partial limit
exist:
∃liminf sgn [(f (x + h) − f (x))] .
h→0

Definition. The lower detachment operator. Given a function f :R→R


(not necessarily lower detachable), we will dene the lower detachment operators
applied for f from right or left, as:

;
inf f± : R → {+1, −1, 0}
;
inf f± (x) ≡ liminf sgn [(f (x + h) − f (x))] .
h→0±

Examples.

1. Riemann's function is upper and lower detachble in any point, since for the
irrationals it holds that supf ; (x) = +1 and inf f ; (x) = 0. It is an easy
exercise to show that it is nowhere upper nor lower signposted detachable.

18
2. Dirichlet's function:

f : R → {0, 1}
(
1, x ∈ Q
f (x) =
0, x∈ / Q,

is not detachable in any point. However, it is upper and lower detachable


in any point, and:
(
; 0, x∈Q
supf (x) =
+1, x∈
/ Q,
(
; −1, x∈Q
inf f (x) =
0, x∈
/ Q.

Remark. In order for a function f : R −→ R to be detachable in a point


; ; ;
x ∈ R, is should satisfy the equalities: supf+ (x) = inf f+ (x) = supf− (x) =
;
inf f− (x). In order for it to be signposted detachable in the point, it should
; ; ; ; ;
satisfy that: supf+ (x) = inf f+ (x) , supf− (x) = inf f− (x) and supf+ (x) =
; ; ;
−supf− (x) (and inf f+ (x) = −inf f− (x)). In other words, there are 6 causes
for disdetachment in a point. Hence the following denition of calssication of
disdetachment points.

Definition. Classication of disdetachment points. Given a function f :


R −→ R, we will classify its disdetachment points as follows:

1. First type (upper signposted) disdetachment in a point x ∈ R, if:

; ;
supf+ (x) 6= −supf− (x) .

2. Second type (lower signposted) disdetachment in a point x ∈ R, if:

; ;
inf f+ (x) 6= −inf f− (x) .

3. Third type (upper) disdetachment in a point x ∈ R, if:

; ;
supf+ (x) 6= supf− (x) .

4. Fourth type (lower) disdetachment in a point x ∈ R, if:

; ;
inf f+ (x) 6= inf f− (x) .

5. Fifth type (right) disdetachment in a point x ∈ R, if:

; ;
supf+ (x) 6= inf f+ (x) .

6. Sixth type (left) disdetachment in a point x ∈ R, if:

; ;
supf− (x) 6= inf f− (x) .

19
Corollary. A function f : R −→ R is detachable in a point x i x is only
a rst and second disdetachment point, and is signposted detachable there i x
is only a third and fourth disdetachment point.

Examples.

1. Let us consider the following function:

f : [0, 2] → R
(
1, 0 ≤ x < 1
f (x) =
2, 1 ≤ x ≤ 2.

Then x=1 is a rst, second, third and fourth type disdetachment point
of f. The function is also null disdetachable there.

2. Let us consider the following function:

f :R→R
(
x2 sin x1 , x 6= 0

f (x) =
0, x = 0.

Then x=0 is a rst, second, fth and sixth type disdetachment point of
f.
Defintion. f : R → R be a
Tendency indicator vector of a function. Let
function, and let x ∈ R be a point. Denote by ω ± (x) the set of partial limits of
±
the term sgn [f (x + h) − f (x)], where h → 0 respectively. Then the tendency
indicator vector of f in the point x is dened as a vector ~
s, whose entries satisfy:

si ≡ χs(i) ω r(i) (x) , 1 ≤ i ≤ 6,

where:

+1, i = 1, 4
( ( 
1, x ∈ X −1, 1 ≤ i ≤ 3
χx (X) = , r (i) = , s (i) = 0, i = 2, 5
0, x ∈
/X +1, 4 ≤ i ≤ 6 
−1, i = 3, 6.

The denition is illustrated in gure 5.


Examples.

1. Let us consider the function f (x) = sin (x). Then in x = 0, its tendency
indicator vector is (1, 0, 0, 1, 0, 0).
2. Let us consider the function:
(
1

x2 sin x , x 6= 0
f (x) =
0, x = 0.

Then in x = 0, its tendency indicator vector is (1, 1, 1, 1, 1, 1).

20
Figure 5: An illustration of the tendency indicator vector in a point. Given the
parabola f x (colored with red in the middle) on it, the tendency
and a point
indicator vector of f x is a binary vector, returning for each of the six options
in
depicted in the graph, whether the term sgn [f (x + h) − f (x)] has a partial
limit in that point, whose value is one of the options: if it has a partial limit +1
from left, then the rst entry in the vector is 1; if it has a partial limit 0 from
left, then the second entry in the vector is 1, and so on. The domains for which
the answer is yes in this example are colored with blue; hence the tendency
indicator vector here is (1, 0, 0, 1, 0, 0).

Remark. The aim of the algorithm found in 1 is to determine the type of


the disdetachment of a function f : R → R in a point x. A Matlab code of
the algorithm is available in the appendix. The output of the Matlab code is
depicted in gure 6.

7 Analysis of the weather vane function


N
Definition. Elaborated function. LetD be a domain and let {Dn }n=1 be
S N
pairwise disjoint sub-domains of D such that D = Dn . Let {fn : Dn → R}n=1
1≤n≤N
be a set of functions. Then we shall dene the elaborated function of them by:

U
fn : D → R
n
U
fn (x) ≡ fn (x) , x ∈ Dn .
n

Definition. Weather vane function. The following function's aim is to


illustrate the relationships between the detachment operators. Let us consider

21
Algorithm 1 Classication of disdetachment points
Given a function f : R → R, a point x and the tendency indicator vector of f
in the point x, ~s = ~s (f, x), do:
; ; ; ;
1. Extract supf+ (x) , inf f+ (x) , supf− (x) , inf f− (x) via the entries of the
vector ~s, in the following manner (sup ts min and inf ts max, due to
the nature of the denition of the vector ~s):
 
;
(x) = ϕ argmin s+ s+

supf+ i : i =1
i
 
;
(x) = ϕ argmax s+ s+

inf f+ i : i = 1
i
 
;
(x) = ϕ argmin s− s−

supf− i : i = 1
i
 
;
(x) = ϕ argmax s+ s+

inf f− i : i = 1 ,
i

where ϕ is a function dened as follows:

ϕ : {1, . . . , 6} → {+1, −1, 0}



+1, n ∈ {1, 4}

ϕ (n) = −1, n ∈ {3, 6}

0, n ∈ {2, 5} .

; ;
2. Ifsupf+ (x) 6= −supf− (x) classify f as having a rst type disdetachment
in x.

; ;
inf f+
3. If (x) 6= −inf f− (x) classify f as having a second type disdetach-
ment in x.

; ;
4. If supf+ (x) 6= supf− (x) classify f as having a third type disdetachment
in x.

; ;
5. Ifinf f+ (x) 6= inf f− (x) classify f as having a fourth type disdetachment
in x.

; ;
6. If supf+ (x) 6= inf f+ (x) classify f as having a fth type disdetachment
in x.

; ;
7. If supf− (x) 6= inf f− (x) classify f as having a sixth type disdetachment
in x.

22
Figure 6: Classication of disdetachment points as a function of the tendency
indicator vector in the point. Note the majority of the rst and second type dis-
detachment types, due to harsh requirement in the denition of the signposted
detachment.

23
 6
six functions, f (i) : R → R i=1
, dened in the following manner:

f (1) (x) = f (6) (x) = −x


f (3) (x) = f (4) (x) = +x
f (2) (x) = f (5) (x) = 0.

Let us dene:

√ √
D1± = R± , D2± = 2Q± , D3± = 3Q± ,
√ √ S√ 
D4± = R± \ 2Q, D5± = R± \ 2Q 3Q , D6± = Ø.

Let


v = (v1 , . . . , v6 ) ∈ {0, 1}
6
be a vector whose at least one of the rst
three elements and at least one of last three elements is 1. Thus, there are
26 − 1 − 2 · 23 − 1 = 49 options to select → −

v.
Let k~ v : {1, . . . , 6} → {1, . . . , 6}
v be a transformation k~ such that:

S +
R+ = Dk~v (i)
1≤i≤3


Dk−~v (i) ,
S
R =
4≤i≤6

±
where Dk(i) are pairwise disjoint, and:

k~v (i) 6= 6 ⇐⇒ vi = 1.

− →
Let us dene a vector of domains, D (−
v ), by:


− r(i)
D (vi ) ≡ Dk(i) ,
(
−1, 1 ≤ i ≤ 3
where r (i) = . Then the weather vane function is dened thus:
+1, 4 ≤ i ≤ 6

> (x, →

]
v)≡ f (i) |→

D (v )
.
i
i

The weather vane function is illustrated in gure 7.

Example. We shall now analyse the weather vane function, denoted by


> (x, →

s ), in the point x = 0. We will examine some of the 49 cases possible for
>.
• If s2 = s5 = 1 and all the other si 's equal zero, then > is the zero function,
hence both detachable and signposted detachable. (1 case).

24
Figure 7: An illustration of the weather
 −−− −−−−−−→  −−vane
−−−−−−−→
function. Above:

> x, (1, 1, 1, 1, 1, 1) , in the middle: > x, (1, 1, 1, 0, 0, 1) , and below:


 −−−−−−−−−→
> x, (1, 0, 1, 1, 0, 1) .

25
• Ifs2 + s5 = 1 (mod2) then > can be upper or lower detachable. For
example if

−s = (1, 0, 0, 0, 1, 1) then > is not lower nor upper detachable.


However, in the case where s = (1, 0, 0, 1, 1, 0), the function is upper
4
detachable, but not detachable from any other kind. (2 · 2 = 32 cases).

• If si = 1 for all i, then > is not detachable nor signposted detahable,


however it is both upper and lower detachable.(1 case).

• If either s1 = s4 = 1 or s3 = s6 = 1 (and all of the other entries are null),


then > is detachable and not signposted detachable. (2 cases).

• If either s1 = s6 = 1 or s3 = s4 = 1 (and all of the other entries are null),


then > is signposted detachable and not even upper or lower detachable.
These are in fact the only cases where the function is signposted detachable
and not detachable. (2 cases).

• If s1 = s3 = s4 = s6 = 1 (and s2 = s5 = 0), then > is not detachable nor


signposted detachable. However, it is both upper and lower detachable.(1
case).

Notice the similarity between this denition of the tendency indicator vector of
a function and the weather vane function. It is easy to verify that for any


v
amongst the 49 possible cases:

~s (> (x, →

v ) , 0) = →

v.

8 Tendency and extremum indicator


8.1 Denition of operators
Definition. Tendable function in a point. Given a function f : R → R, we
will say that f is tendable in a point x∈R if it is detachable from right and
left there.

Example. Let us consider the following function:

f : R → {0, 1, 2}

2, x ∈ Z

f (x) = 1, x ∈ Q\Z

0, x ∈ R\Q.

Then f is discontinuous anywhere, however it is detachable (and especially tend-


able) in innitely many points - the integers.

Definition. Tendable function in an interval. Given a function f : R → R,


we will say that f is tendable in an interval I if one of the following holds:

26
1. I = (a, b) , and f is tendable for each x ∈ (a, b).
2. I = [a, b), and f is tendable for each x ∈ (a, b) and right detachable in a.
3. I = (a, b], and f is tendable for each x ∈ (a, b) and left detachable in b.
4. I = [a, b], and f is tendable for each x ∈ (a, b), left detachable in b and
right detachable in a.
Definition. Tendency in a point. Given function f : R → R, if it is tendable
in a point x ∈ R, then we will dene its tendency in the following manner:

τf : R → {+1, −1, 0}
(
; ;
0, f+ (x) = f− (x)
τf (x) ≡ ; ; ;
f+ (x) , f+ (x) 6= f− (x)

Remark. The rationalization behind the denition of tendency is as follows.


If a tendable function has an extremum in a point then it is detachable there,
hence according to the denition of tendency, its tendency there is zero, simi-
larly to the case with the derivative (the derivative of a dierentiable function
in an extremum is zero). Otherwise, if the function is not zero, the tendency
predicts the function's behavior in a right neighborhood of a point, via the right-
;
detachment, f+ .

Definition. Uniformly tended function. Given a tendable function f :R→


R, we will say that it is uniformly tended in a closed interval I = [a, b] ⊆ R if
there exists a constant β such that:

τf (x) = β, ∀x ∈ I\ {a, b} .

Examples.

1. Every stricly monotonous function is uniformly tended in its denition


domain.

2. Let us consider the function:

f :R→R
f (x) = x2 .
then the tendency of f is:

τf : R → R

−1, x < 0

τf (x) = 0, x=0.

+1, x > 0

hence, f is uniformly tended in (−∞, 0] and in [0, ∞).

27
Definition. Extrema indicator. Given an function f : R → R, we will dene
its extrema indicator in the following manner:

∧f : R → {0, −1}
(
0, ~s (f, x) ∈ {(1, 0, 0, 1, 0, 0) , (0, 0, 1, 0, 0, 1) , (0, 1, 0, 0, 1, 0)}
∧f (x) ≡ ,
−1, otherwise

where ~s (f, x) is the tendency indicator vector of f in the point x dened ear-
lier. It is easy to see that the extrema indicator is dened for any point of any
function.

Note. Let f : R → R be a function. Then it is clear from the denition


that ∧f (x) = 0 ⇐⇒ x is an extremum. Hence the extrema indicator can point
out extrema for any function, contrary to the derivative, which is limited to
dierentiable functions.

8.2 Geometric interpretation of the tendency


Definition. An interval. Given two points x1 6= x2 ∈ R, The interval that
they dene is the set:

{x ∈ R : min {x1 , x2 } ≤ x ≤ max {x1 , x2 }} .

It will be denoted by [x1 , x2 ].

Definition. Intervals of a tendable function f : R → R in a point x ∈ R.


Given a right and left detachable function f : R → R, we shall dene its intervals
in a point x by:

;
If+ (x) = x, x − f+
 
(x) · h
;
If− (x) = x, x − f−
 
(x) · h ,

where h>0 is an arbitrary constant.

Definition. Signs of vertices in an interval. Given an interval [x1 , x2 ], we


will dene the vertices' ({x1 , x2 }) signs thus:

(
+1, xi > x2−i
sgn[x1 ,x2 ] (xi ) = , i = 1, 2
−1, xi < x2−i

Claim. Given a function f :X →R (where X ⊆ R), which is tendable in a


point x ∈ R, it holds that:

X
τf (x) = sgnIfs (x) (x) .
; ;
s∈{±1} and fs (x)=f (x)
+

28
Figure 8: The correlation between the tendency in a point, and the sign of
that point as a vertice in the interval. The± signs in the extremum deduct
eachother, and suggest that the tendency is 0.

; ; ; ;
Proof. Let us observe the possible values for f+ (x) , f− (x). If f+ (x) = f− (x)
then according to the denition of tendency,τf (x) = 0, in which case:

X
sgnIfs (x) (x) = sgnI + (x) (x)+sgnI − (x) (x) = +1+(−1) = 0 = τf (x) .
f f
; ;
s∈{±1} and fs (x)=f (x)
+

; ;
If on the other hand f+ (x) 6= f− (x) then according to the denition, τf (x) =
;
f+ (x). Hence:

(
X +1, f is increasing in x
sgnIfs (x) (x) = sgnI + (x) (x) =
;
s∈{±1} and fs (x)=f
;
(x)
f −1, f is decreasing in x
+
;
= f+ (x) = τf (x) .

Remark. Clearly the above claim states the geometric connection between
the tendency of a function and its intervals in a point, in a similar manner that
the derivative is the slope of the tangent to a function in a point. The above
claim is illustrated in gure 8.

9 continuity and the detachment


Note. If a function f : (a, b) → R is right-continuous everywhere in (a, b),
then it is continuous there in inntely many points.

29
Note. The above statement does not hold for detachment for right. Con-
sider the following function:

f : (0, 1) → R
(
1
, x∈Q
f (x) = x 1
− x , x ∈ R\Q.

Then f is detachable from right everywhere in (0, 1), however it is also discon-
tinuous and disdetachable everywhere there. It is easy to see that any function
that is detachable from right and not detachable from left consists of two pieces
1
x and
(in this example, the pieces are − x1 ). the following note refers to a simple
generalization of the detachment.

Note. Let us consider the following generalization of the detachment, where:

A1 = (−∞, −) , r1 = −1
A2 = (−, +) , r2 = 0
A3 = (+, ∞) , r3 = +1,

where   1 is constant. Let us denote A = {Ai }1≤i≤3 , r = {ri }1≤i≤3 .


Then one can think of a function which is discontinuous in any point, and yet
generalized detachable in the above sense, for example:

f : (0, 1) → (−1, 1)


− 3 , x ∈ Z

f (x) = 0, x ∈ Q\Z
 

+ 3 , x ∈ R\Q.

Then f ;(A,r) ≡ 0 for all x ∈ R. It is easy to see that one can build functions
with as many pieces as desired, which are discontinuous anywhere and yet
generalized detachable (in the above sense) everywhere.

10 Monotony and the detachment operators


10.1 Tendency
Note. The following claim is incorrect: If a function is tendable in a neigh-
borhood of the point, then there exists left and right neighborhoods of that
point where the function is monotoneous. Followed is a counter example:

f : (−1, 1) → R
(
sin x1 , x 6= 0

f (x) =
17, x = 0.

30
Then f is tendable in (−1, 1), however due to its discontinuity in x = 0, the
existence of an interval where f is monotonous is not guaranteed, and indeed
there does not exist such in that example.

Note. The following claim is also incorrect: If a function f :R→R is tend-
able and continuous in a neighborhood of the point, then there exists left and
right neighborhoods of that point where the function is monotoneous. Followed
is a counter example:

f : (−1, 1) → R
(
xsin x1 − x, x 6= 0

f (x) =
0, x = 0.

Then f is tendable in (−1, 1), further it is continuous there, however there does
not exist any - left nor right - neighborhood of x=0 where f is monotonous.

Note. The following claim is incorrect: If f :R→R is continuous in[a, b]


and tendable in (a, b), then it there exists an interval where f is monotonous.
A counter example can be shown to exist in the following manner. As Katznel-
son and Stromberg showed in [12], there exist functions which are dierentiable
everywhere but not monotonous anywhere, and whose derivative is zeroed only
in its extrema (which are a dense set). As shown in the Detachment and dif-
ferentiation part, if a function's derivative is not zero in a point then it is
tendable there. Further, from the denition of the tendency, it is clear that in
its extrema points a function is detachable and especially tendable. Hence these
functions form a counter example to the quoted claim, since they are everywhere
continuous and tendable, and nowhere monotonous.

10.2 Detachment
Definition. Step function. We will say that a fucntion → R is a step
f : RS
function if there exist a sequence of disjoint intervals {Ak } with Ak = R, and
k
a sequence of scalars {rk } such that:

X
f (x) = rk · χAk (x) ,
k

where χAk is the indicator function of Ak .

Theorem. If a function f is detachable in the interval [a, b] then it is a


step function there.
Proof. Given that f is detachable, we show that it is a step function. A
similar proof to a slightly dierent claim was given by Behrends and Geschket
in [11]. The fact that f is detachable implies, according to the denition of the
detachment, that any point in [a, b] is a local extremum. Given n > 0, let us de-
note by Mn the set of all points x ∈ [a, b] for which f receives a local maximum,

31
and similarly denote mn theTset of all points in the interval where f recieves a
local minimum. Clearly Mn mn is not necessarily empty, in case f is constant
in a sub-interval of [a, b]. Now, since each x ∈ [a, b] is a local extremum of f ,
we obtain: [h [ i
[a, b] = m n Mn ,
n∈N

hence [h [ i
f ([a, b]) = f (mn ) f (Mn ) .
n∈N
S
To prove the argument we need to show that for each n ∈ N, the set f (mn ) f (Mn )
is countable. Without loss of generality, let us show that f (mn ) is countable.
1 −1
Let y ∈ f (mn ) . Let Dy be a
T 2n -neighborhood of f (y). Let z ∈ f (mn )
with z 6= y , and let x ∈ Dy Dz . Then there exist xy , xz ∈ mn such that
f (xy ) = y, f (xz ) = z and:
1 1
|xy − x| < , |xz − x| < .
2n 2n
1
Hence, |xy − xz | <n . Since in both the n-neighborhoods of xy , xz , f receives
its largests value in xy and xz , it must hold that f (xy ) = f (xz ), contradict-
T
ing the choice of
T y 6= z . Hence, Dy Dz = ∅. Now, let us observe the set
C = [a, b] Q. Any set Dy , for y ∈ f (mn ), contains an element of C . Since
Dy , Dz are disjoint for any y 6= z and since C is not countable, then f (mn )
is also countable. Hence, f ([a, b]) is countable, which implies that f is a step
function, according to the denition. 

Remarks.
1. The second direction is not true: a step function may not be detachable
in the entire interval, for example:

f : [0, 2] → R
(
0, 0 < x < 1
f (x) =
1, 1 ≤ x < 2
which is not detachable in x = 1.
2. It is not true that if a function f : R → R is detachable in an interval [a, b]
then it is constant there except, maybe, in a countable set of points. For
example, consider the function:

f : [0, 2] → R

0, 0 < x < 1

f (x) = 2, x = 1

1, 1 < x < 2.

Then f is detachable in [0, 2] although it is not constant there a.e.

32
Corollary. f : R → R is detachable in an interval (a, b) and
If a function
f ; ≡ 0, then f is constant there.
its detachment is constant there,
Proof. Immediate from the fact that f is a step function, beacuse had there
;
been any jumps in the values of f , then it would hold that f (x) 6= 0 in any
such jump point x. 

10.3 Signposted Detachment


Lemma. (Kaplan). If a function f :R→R is signposted detachable in an
interval (a, b) and its signposted detachment is constant there then f is stricly
monotonous there.
Proof. If f~; ≡ 0 in the interval then so is f ;, and we've shown that in this
case, f is constant in the interval. Without loss of generality, let us assume that
f~; ≡ +1 in the interval. Let x1 , x2 ∈ (a, b) such that x1 < x2 . We would like to
show that f (x1 ) < f (x2 ). From the denition of the signposted detachment,
there exists a left neighborhood of x2 such that f (x) < f (x2 ) for each x in
that neighborhood. Let t 6= x2 be an element of that neighborhood. Let s =
sup {x|x1 ≤ x ≤ t, f (x) ≥ f (x2 )}. On the contrary, let us assume that f (x1 ) ≥
f (x2 ). Then s ≥ x1 . If f (s) ≥ f (x2 ) (that is, the supremum is accepted in
the dened set), then since for any x > s it holds that f (x) < f (x2 ) ≤ f (s),
; ;
then f+ (s) = −1, contadicting f+ ≡ +1 in (a, b) . Hence the maximum is
not accepted. Especially it implies that s 6= x1 . Therefore according to the
denition of the supremum, there exists a sequence xn → s with {xn } ⊂ (x1 , s)
such that:
f (xn ) ≥ f (x2 ) > f (s) ,
that is, f (xn ) > f (s), contradicting our assumption that f~; (s) = +1 (which
;
implies that f− (s) = −1. Hence f (x1 ) < f (x2 ) . 

Theorem. If a function f : R → R is signposted detachable in an inter-


val (a, b) and is continuous there then f is stricly monotonous there.
Proof. According to Kaplan's lemma, it is enough to show that f~; is con-
stant in (a, b). Let x, y ∈ (a, b) . Assume x < y . On the contrary, suppose that
f~; (x) 6= f~; (y) . Let us distinguish two main cases, where the rest of the cases
are handled similarly:

; ;
1. f~; (x) = +1, f~; (y) = −1. That is, f− (y) = f+ (x) = +1, hence argmaxf (t) ∈
/
t∈[x,y]
{x, y}. f [x, y], hence there exists t ∈ (x, y) where f re-
is continuous in
ceives its maximum, hence f is detachable, and not signposted detachable
in t, a contradiction.

2. f~; (x) = +1, f~; (y) = 0. Let us denote:

s = sup {t|x < t < y, f (t) 6= f (y)} .

33
;
If s = −∞ then f [x, y] , hence f+
is constant in (x) = 0, hence f is either
~;
not signposted detachable in x or f (x) = 0, a contradiction. That is,
x < s < y. Hence there exists a left neighborhood of s where f (t) 6= f (y)
for each t in that neighborhood, and a right neighborhood of s where
; ;
f (t) = f (y) for each t in that neighborhood. Hence f− (s) 6= 0, f+ (s) =
0, which implies that f is null-disdetachable, and especially not signposted
detachable, in x = s, a contradiction. 

10.4 Derivative
Note. If a function is brokenly both continuous and signposted detachable,
then it is dierentiable almost everywhere.
Proof. According to a previous lemma, this condition assures that the func-
tion is monotoneous, which in turn insures dierentiability almost everywhere
by Lebesgue's theorem. 

Note. Let us note that while a function's monotony implies that it is dif-
ferentiable ALMOST everywhere (by Lebesgue's theorem), it implies that it is
signposted detachable, and especially tendable everywhere.

10.5 General notes


Note. Let f :R→R be a function. Then f is constant in an open interval
(a, b) i it is both detachable and signposted detachable there.

Example. Let us consider the function:

f : (0, 2) → R
(
x, 0 ≤ x ≤ 1
f (x) =
1, 1 ≤ x ≤ 2
; ; ;
satises that f− (x) = −f+ (x) for each x ∈ (0, 2) \ {1}, however: f+ (1) =
;
0, f− (1) = −1 and f is indeed not stricly monotonous there.

11 Boundedness and the detachment


Note. If a function is detachable in an interval, then it is not necessarily
bounded there. Consider the following function:

f : [−1, 1] → R

n,
 x = n1 , n ∈ Z\ {0}
f (x) = −1, x = 0

0, otherwise.

Then f is detachable in [−1, 1] but not bounded in a neighborhood of x = 0.

34
Figure 9: The derivative has an advantage over the detachment: it is a linear
operator. However, in the era of computers, eciency is not less important.
The detachment asks the question: "Function, are you increasing, decreasing
or constant?", while the derivative uses the information about the tangent to
answer that question. Hence the detachment is more computationally ecient
in determining the monotonic behavior of a function. Generalizations of the
detachment, such as limQ [f (x + h) − f (x)], where Q is a quantization func-
h→0
tion, can give more information regarding the behavior of the function in the
neighborhood of a point with respect to the regular detachment; the eciency
is hardly harmed in the generalization process, since the values that Q gets is
nite, and since the divison operator in the denition of the derivative is spared.

Note. If a function is signposted detachable in an interval, then it is not


necessarily bounded there. Consider the following function:

f : (0, π) → R
(
π
tan (x) , x 6= 2
f (x) = π
0, x= 2.

Then f is signposted detachable in (0, π) but not bounded in a neighborhood


of x = π2 .

12 Dierentiability and the detachment


12.1 Joint points
Note. While the derivates are dened for any function, they hold too much
information with respect to a function's monotony, hence they are not always
sucient to analyze the extrema points of a function in a pointwise manner. For

35
Figure 10: Joint points, arrayed according to their type.

example: the function f (x) = x3 satises D± f (0) = D± f (0) = 0 while x = 0 is


not an extremum, and the function g (x) = x2 satises D± f (0) = D± f (0) = 0
while x=0 is indeed an extremum. On the other hand, the tendency indicator
vector gives precisely the amount of information needed to decide whether a
point is an extremum.

Definition. Joint point. Given a function f : R → R, we will say that


x0 ∈ X is a joint point of f if f is continuous, tendable, and not dierentiable
in x0 .

Definition. First type joint point. Given a function f : R → R, we will


say that x0 ∈ X is a rst type joint point of f if x0 is a joint point of f, and
; ;
f+ (x0 ) = f− (x0 ) .

Definition. Second type joint point. Given a function f : R → R, we


will say that x0 ∈ X is a second type joint point of f if x0 is a joint point,
; ; ; ;
f+ (x0 ) 6= f− (x0 ) and f+ (x0 ) · f− (x0 ) 6= 0.

Definition. Third type joint point. Given a function f : R → R, we


will say that x0 ∈ X is a third type joint point of f if x0 is a joint point,
; ; ; ;
f+ (x0 ) 6= f− (x0 ) and f+ (x0 ) · f− (x0 ) = 0.

Examples.

1. Consider the function:

f :R→R
f (x) = |x|

then x=0 is a rst type joint point of f.

36
2. Consider the function:

f : [0, 2] → R
(
x, 0≤x<1
f (x) =
2x − 1, 1 ≤ x < 2.

then x=1 is a second type joint point of f.


3. Consider the function:

f : [0, 2] → R
(
1, 0 ≤ x < 1
f (x) =
x, 1 ≤ x < 2.

then x=1 is a third type joint point of f.

12.2 Dierentiability Vs. tendability of functions


Note. A function f : R→R is dierentiable everywhere < it is tendable
everywhere. For example consider the following functions:

f : [−1, 1] → R
(
sin x1 , x 6= 0

f (x) =
17, otherwise

and:

g : [−1, 1] → R
(
x2 sin x1 , x 6= 0

g (x) = .
0, x=0

then f is tendable everywhere and not dierntiable in x = 0, and g is dieren-


tiable everywhere and not tendable in x = 0.

Conjecture. A function f : R→R is dierentiable almost everywhere


⇐⇒ it is tendable almost everywhere.

12.3 Dierentiability related sucient conditions for tend-


ability
Definition. Derivates. Let f : R → R be a function. We will dene its
derivates in a point x0 ∈ R as the following four quantities (as dened in [13],

37
p. 99):

f (x0 +h)−f (x0 )


D+ f (x0 ) = lim h
h→0+

f (x0 )−f (x0 −h)


D− f (x0 ) = lim h
h→0+

f (x0 +h)−f (x0 )


D+ f (x0 ) = lim h
h→0+

f (x0 )−f (x0 −h)


D− f (x0 ) = lim h
h→0+

Claim. Let f :R→R be a function. Then the following claims hold:


;
D+ f (x) < 0 ⇒ f+ = −1
;
D− f (x) > 0 ⇒ f− = −1
;
D+ f (x) > 0 ⇒ f+ = +1
;
D− f (x) < 0 ⇒ f− = +1,
where D± , D± are the function's derivates dened earlier.
;
Proof. We will show that D+ f (x) < 0 ⇒ f+ = −1. The correctness of the
+
rest of the claims is shown similarly. Suppose D f (x) = L < 0. Thus:

f (x) − f (x0 )
∃δ : x0 < x < x0 + δ =⇒ ≤ L < 0.
x − x0
Especially, it implies that there exists a right neighborhood of x0 where for each
x it holds that f (x)−f
x−x0
(x0 )
< 0. Since it is a right neighborhood, x0 < x, hence
;
sgn [f (x) − f (x0 )] = −1, hence f+ (x0 ) = −1. 
0
Corollary. f : R → R
Let be a function and let x 0 ∈ R. If f± (x0 ) 6= 0
0

;
then f± = ±sgn f± (x0 ) .
0 ;
Proof. We show that f+ (x0 ) > 0 implies f+ (x0 ) = +1. Indeed, the condition
0 ;
f+ (x0 ) > 0 implies D+ f (x0 ) > 0, hence by the previous claim f+ (x0 ) = +1. 

Corollary. If f : R → R x0 ∈ R and f 0 (x0 ) 6= 0


is dierentiable in
~; 0
then f is signposted detachable in x0 and τf (x0 ) = f (x0 ) = sgn (f (x0 )).
0
Proof. We show the correctness of the claim for f (x0 ) > 0. It follows from
; ;
the previous claims that f+ (x0 ) = +1 and f− (x0 ) = −1. Hence τf (x0 ) =
f~; (x0 ) = +1. 

13 Fundamental theorems involving the detach-


ment
13.1 Closure
Note. The tendable, detachable and signposted detachable functions are
closed under multiplication by a scalar.

38
Note. The tendable functions are not closed under addition. For example,
consider the following functions:

f : [−1, 1] → R

−1, x = 0

f (x) = n, x = n1 , n ∈ Z

0, otherwise,

and:

g : [−1, 1] → R
(
+1, x = 0
g (x) =
0, otherwise.

Then f, g are tendable (and even detachable) in [−1, 1] , however:

f + g : [−1, 1] → R
(
n, x = n1 , n ∈ Z
(f + g) (x) =
0, otherwise

is not tendable in x = 0.

Note. The functions which are both tendable and dierentiable are also not
closed under addition. For example, consider the following functions:

f : [−1, 1] → R
(
x2 sin x1 − x2 ,

x 6= 0
f (x) =
0, x = 0,

and:

g : [−1, 1] → R
g (x) = x2 .

Then f, g are both dierentiable and tendable in their denition domain, how-
ever

f + g : [−1, 1] → R
(
x2 sin x1 , x 6= 0

(f + g) (x) =
0, x=0

is not tendable in x = 0.

39
13.2 Arithmetic rules
Claim. Let f : R → R be a tendable function. Let c ∈ R be a constant. Then:

; ;
[cf ]± = sgn (c) f± .

Proof.
;
[cf ]± (x) = lim sgn {[cf ] (x + h) − [cf ] (x)} =
h→0±
;
= lim sgn {c [f (x + h) − f (x)]} = sgn (c) f± . 
h→0±

Definition. Pointwise-incremented function. Let f : R → R be a func-


tion. We will bened its a-incremented function, where a ∈ R, in the following
manner:

f (a) : R → R
(
f (x) + f (a) , x 6= a
f (a) (x) =
f (a) , x = a.

Claim. Let f, g : R → R be functions. Set x ∈ R. Then f (x) , g (x) are tendable


(x)
i so is (f g) , and:

h i;  ;  ;
(x)
(f g) (x) = f (x) (x) · g (x) (x) .
± ± ±

Proof.
 ;  ; h i h i
f (x) (x) · g (x) (x) = lim± sgn f (x) (x + h) − f (x) (x) · lim± sgn g (x) (x + h) − g (x) (x)
± ± h→0 h→0

= lim± sgn [f (x + h) + f (x) − f (x)] · lim± sgn [g (x + h) + g (x) − g (x)]


h→0 h→0

= lim sgn [f (x + h) · g (x + h)] = lim± sgn [(f g) (x + h) + (f g) (x) − (f g) (x)]


h→0± h→0
h i h i;
(x) (x) (x)
= lim sgn (f g) (x + h) − (f g) (x) = (f g) (x0 ) . 
h→0± ±

Corollary. Let f : R → R be tendable function and let n ∈ N, x ∈ R.


Then: h i; h n i ;
(x)
(f n ) (x) = f (x) (x) .
± ±

13.3 Analogous versions to the even\odd theorems (of the


derivative)
Lemma. Let f :R→R be a tendable function. If f is even then:

; ;
f+ (−x) = f− (x) .

40
Proof.
;
f+ (−x) = lim sgn [f (−x + h) − f (−x)] = lim+ sgn [f (x − h) − f (x)]
h→0+ h→0
;
= lim− sgn [f (x + h) − f (x)] = f− (x) ,
h→0

where the second equality is due to the fact that f is even. 

Lemma. Let f :R→R be a tendable function. If f is odd then:

; ;
f+ (x) = −f− (−x) .

Proof.
;
−f− (−x) = − lim− sgn [f (−x + h) − f (−x)] = − lim− sgn [−f (x − h) + f (x)]
h→0 h→0

= lim sgn [f (x − h) − f (x)] = lim sgn [f (x + h) − f (x)]


h→0− h→0+
;
= f+ (x) ,

where the second equality is due to the fact that f is odd. 

Claim. If a detachable function f is even, so is f ;. If f is odd, then f is


constant.
Proof. If f is even, then according to the rst lemma above it holds that
f ; (x) = f ; (−x), hence f ; is even. If f is odd, then according to the second
; ; ;
lemma, for each x it holds that: f+ (x) = −f+ (x). Hence f (x) ≡ 0, and f is
constant, and especially odd. 

Note. If a signposted detachable function f is even, then its signposted


detachment is odd. If f is odd, then its signposted detachment is even.

13.4 An analogous version to Fermat's theorem


Claim. Let f : (a, b) → R and let x0 ∈ (a, b) be an extremum of f. Then the
function is detachable in x0 , and:

τf (x0 ) = 0.

Proof. Without loss of generality, let us assume that x0 is a maximum. Then


there exists a neighborhood of x0 ,namely Iδ (x0 ) , where f (x) < f (x0 ) for each
;
x ∈ Iδ (x0 ). Hence, according to the denition of the detachment, f (x0 ) = −1,
; ;
and especially f+ (x0 ) = f− (x0 ). According to the denition of tendency, it
implies that τf (x0 ) = 0. 

13.5 An analogous version to Rolle's theorem


Theorem. Let f be a function dened on a closed interval [a, b] ⊆ R. Suppose
that f satises the following:

41
1. f is continuous in [a, b] .
2. f (a) = f (b) .
Then, there exists a point c ∈ (a, b) where f is detachable, and especially,
τf (c) = 0.
Proof. f is continuous in a closed interval, hence according to Weirstrass'
theorem, it recieves there a maximum M and a minimum m. In case m < M ,
f (a) = f (b), then one of the values m or M must be
then since it is given that
−1
an image of one of the points in the open interval (a, b) . Let c ∈ f ({m, M }).
Since f receives an extremum in c, then f is detachable there according to the
denition of detachment, and especially, τf (c) = 0. In case m = M , then f is
constant and the claim holds trivially. 

13.6 An analogous verion to Lagrange's theorem


Note. Let f : (a, b) → R be tendable in (a, b) and suppose that f (a) 6= f (b).
Then it is not always true that there exists a point c ∈ [a, b] such that:

τf (c) = sgn [f (b) − f (a)] , ∀x ∈ I.

For example, consider the function:

f : [0, 2] → R
(
0, 0 ≤ x < 1
f (x) =
1, 1 ≤ x ≤ 2

Then f (2) > f (0) , further f is tendable in [0, 2] however τf ≡ 0 there.

Theorem. Let f : [a, b] → R be continuous in [a, b] and tendable in (a, b).


Assume f (a) 6= f (b). Then for each v ∈ (f (a) , f (b)) there exists a point
cv ∈ f −1 (v) such that:

τf (cv ) = sgn [f (b) − f (a)] .

Proof. First let us comment that this theorem is illustrated in gure . With-
out loss of generality, let us assume that v ∈ (f (a) , f (b)).
f (a) < f (b) . Let
Since f is continuous, then Cauchy's intermediate theorem assures that f −1 (v) 6=
; −1
∅. On the contrary, let us assume that f+ (x) = −1 for each x ∈ f (v) . Let
xmax = sup f −1 (v) . The maximum is accepted since f is continuous, hence
;
f (xmax ) = v . Then according to our assumption f+ (xmax ) = −1, and espe-
cially there exists a point t > xmax such that f (t) < f (xmax ) = v . But f
is continuous in [t, b] , thus according to Cauchy's intermediate theorem, there
exists a point s ∈ [t, b] for which f (s) = v, which contradicts the choice of xmax .
; −1
In the same manner it impossible that f+ (x) = 0 for each point x ∈ f (v) ,
;
because then the same contradiction will rise from f+ (xmax ) = +1. Hence,
T ;
S = f −1 (v)

x|f+ (x) = +1 6= ∅. Now we will show that S must contain a

42
;
point x for which f− (x) 6= +1. Let us observe xmin = inf S. We will now show
;
that f+ (xmin ) = +1. From the continuity of f it follows that f (xmin ) = v,
;
hence xmin > a. If f+ (xmin ) 6= +1, then xmin is an inmum, and not a mini-
mum, of S . Hence according to the denition of inmum, there exists a sequence
of points xn & xmin , such that xn ∈ S for all n. Especially, f (xn ) = v, hence
;
f+ (xmin ) = 0 (otherwise, f would not be right detachable, and especially, would
;
not be tendable, in xmin ). But f+ (xmin ) = 0 implies that there is a right neigh-
borhood of xmin where f is constant (f (x) = v for each x in that neighborhood),
;
and especially f+ (x) = 0 for each x in that neighborhood, which contradicts
the denition of xmin as an inmum of a set whose points' right detachment
;
is +1. Hence xmin = min (S) , which implies that f+ (xmin ) = +1. On the
;
contrary, suppose that f− (xmin ) = +1. Then especially there exists t < xmin
with v = f (xmin ) < f (t). But f is continuous in [a, t] , and f (a) < f (t) = v ,
−1
T
hence according to Cauchy's intermediate theorem, f
 −1 T  (v) (a, t) 6= ∅. Let us
observe s = max f (v) (a, t) . Then it can be shown in a similar manner
;
that f+ (s) = +1, hence s ∈ S , which forms a contradiction since s < xmin .
; ;
Thus cv = xmin satises that f (cv ) = v , f+ (cv ) = +1, and f− (cv ) 6= +1.
Thus, τf (cv ) = +1. 

Note. The above theorem is no longer true if we demand that for any value v
there exists cv where:

f 0 (cv ) = sgn [f (b) − f (a)] .

Consider the function:

f : [0, 2] → R
(
x, 0≤x≤1
f (x) =
2x − 1, 1 ≤ x ≤ 2.

Then for v = 1, f is not even dierentiable in f −1 (v) = {1} .

13.7 An analogous version to Darboux's theorem


Theorem. Let f : R → R be continuous and tendable in a neighborhood
of the point x0 ∈ R, denoted by Iδ (x0 ). If x0 is a local maximum or a local
minimum of f , then Im τf |Iδ (x0 ) = {0, ±1} , and there are uncountably many
points in that neighborhood where the tendency of f is ±1.
Proof. Without loss of generlity, let us assume that x0 is a local maximum,
− − −
hence there exists t ∈ Iδ (x0 ) with t < x0 , such that f (t ) < f (x0 ). Now, f is
− −
continuous in [t , x0 ] and tendable in (t , x0 ) , hence according to the analogous
− −
version to Lagrange's theorem, for each value v ∈ (f (t ) , f (x0 )) there exists a
−1
(v ) (t , x0 ) that satises τf (cv− ) = sgn [f (x0 ) − f (t− )] =

T −
point cv − ∈ f
+1. Hence there are uncountably many points in that neighborhood where the
tendency of f is +1. Similarly, there exist uncountably many points in the
right neighborhood of x0 where the tendency of f is −1. Further, since x0 is a

43
Figure 11: An illustration to the analogous version to Lagrange's theorem.
Given a function which is continuous in [a, b] and tendable in (a, b), then
for any value v ∈ (f (a) , f (b)) there is a point cv ∈ f −1 (v) for which
τf (cv ) = sgn [f (b) − f (a)] . In the depicted graph, there is only one such
−1
point, highlighted with yellow. Notice that although {t1 , t2 , t3 } ∈ f (v) ,
none of them satises the theorem's conditions, since τf (t1 ) = τf (t3 ) = 0
and τf (t2 ) = −1, while sgn [f (b) − f (a)] = +1.

44
; ;
maximum, then f ; (x0 ) = −1, and especially
 f+ (x0 ) = f− (x0 ), which implies
that τf (x0 ) = 0. Thus, Im τf |Iδ (x0 ) = {0, ±1} . 

Note. If f is not continuous then the above theorem does not hold. Con-
sider the following function:

f : [0, 2] → R
(
0, x 6= 1
f (x) =
1, x = 1.

Then x=1 is a local maximum, however τf ∈ {0, −1} .

13.8 An analogous version to the Fundamental Theorem


of Calculus
Definition. Antiderivative. Let f :R→R be an integrable function. Then
its antiderivative is dened as follows:

F :R→R
´x
F (x) = f (t) dt.
−∞

Definition. Local antiderivative. Let f :R→R be an integrable function,


and let p ∈ R. Then its local antiderivative is dened as follows:

Fp : [p, ∞) → R
´x
Fp (x) = f (t) dt.
p

Definition. Extended local antiderivative. Let f :R→R be an integrable


S
function, and let p ∈ R {−∞}. Then its local antiderivative is dened as
follows:

Fp : R → R
´x
Fp (x) = f (t) dt.
p

Theorem. Let f : R → R be an integrable function, and let Fp be its


S
extended local antiderivative, where p∈R {−∞}. Let x 0 ∈ R. Suppose that
the pointwise incremented function f (x0 ) is tendable in x0 . Then Fp is tendable
in x0 , and:
 ;
;
(Fp )± (x0 ) = f (x0 ) (x0 ) ,
±
(x0 )
where f is the pointwise incremented function of f dened earlier. In simple
words, the theorem's statement is that the antiderivative's detachment from

45
each side is the same as the limit of the sign of the function itself, in that side.
;
Proof. Without loss of generality, let us assume that
+
(x0 ) = +1, and f (x0 )
;
we will show that (Fp ) (x0 ) = +1. The rest of the cases are handled similarly.
+
According to the denition of pointwise incremented function and detachment,
we have:
 ; h i
f (x0 ) (x0 ) = lim+ sgn f (x0 ) (x0 + h) − f (x0 ) (x0 )
+ h→0

= lim sgn [f (x0 + h) + f (x0 ) − f (x0 )]


h→0+

= lim sgn [f (x0 + h)] .


h→0+

;
Somce f (x0 )
+
(x0 ) = +1, it follows that there exists a right neighborhood
of x0 , namely Iδ (x0 ) , where f (x) > 0 for each x ∈ Iδ (x0 ) . Hence for each
x ∈ Iδ (x0 ):
ˆx ˆx ˆx0
f (t) dt > 0 =⇒ f (t) dt − f (t) dt > 0 =⇒ Fp (x) > Fp (x0 ) ,
x0 p p

;
which results with (Fp )+ (x0 ) = +1. 

46
Figure 12: A suggested structure of the Calculus. The functions' denitions are
found in gure 13.

47
Figure 13: The functions' denition for gure 12.

48
Part IV
Computational Cost Related

Discussion

In this part the author suggests a rigorous discussion regarding the eciency of
applying the derivative Vs. applying the extrema indicator, in a point.

14 Approximation of partial limits


Definition. Approximation of a partial limit of a sequence. Given a sequence
{an }n∈N , P , if there exists
we will say that it has an approximated partial limit
a randomly chosen sub-sequence of {an }n∈N , namely {ank }k∈N , for which there
exist two numbers, 0 < Mmin  Mmax , such that for any Mmin < m < Mmax
there exist two numbers Kmin , Kmax with 0 < Kmin  Kmax such that for all
Kmin < k < Kmax it holds that:
1
|ank − P | < .
m
We will denote the set of approximated partial limits by ˜ n.
plima Hence in the
discussed case:
˜ n.
P ∈ plima

Examples.
n ˜ n = {±1},
1. Let an = (−1) , n ∈ N. Then plima while the set of partial
limits of an is {±1}.

2. Let: (
17, n < 10100
an = n
(−1) , n ≥ 10100 .

Then ˜ n = {17, ±1},


plima although the set of partial limits of an is {±1}.
n o
3. Let an = 1 ˜ n=
plima
S 1
an
n . Then Mmax , although the limit of is
Mmax 1
0.
n o 
(ω)
Conjecture. The set of all sequences an for which the set
n∈N ω
n o
˜ (ω)
plima n does not intersect the set of partial limits of an
(ω)
is a negligible
n∈N
with respect to the set of all possible sequences.

Corollary. If the above conjecture is shown to hold, then for any engineering-
oriented requirement, partial limits can be found by the limit approximation

49
process.

Definition. Approximation of a partial limit of a function. Given a function


f : R → R, we will say that it has an approximated partial limit P in a point
(k)
x0 ∈ R, if there exists a random sequence, {xn }n∈N that satises xn → x0 ,
such that:
˜ (xn ) .
P ∈ plimf
We will then denote:
˜ f (x) .
P ∈ plim
x→x0

Remark. In order to approximate the limit of a sequence (rather than just its
partial limit), or the limit of a function , one may sample S1 sub-sequences
and approximate the partial limits for each of them.

15 Computational cost
Definition. Computational cost of singular expressions. Given a singular
operator ♣, a computer c, and a number r, we will dene the computational cost
of the expression ♣ (r) given the computer, as the period of time required for
the computer to evaluate the term ♣ (r), assuming that the computer's memory
and computational power is wholly devoted to that mission. We will denote this
cost by:
Υc (♣ (r)) .

Definition. Computational cost of boolean expressions. Given a boolean


operator ♣, a computer c, and two numbers {r1 , r2 }, we will dene the compu-
tational cost of the expression r1 ♣r2 given the computer, as the period of time
required for the computer to evaluate the exoression r1 ♣r2 , assuming that the
computer's memory and computational power is wholly devoted to that mission.
We will denote this cost by:
Υc (r1 ♣r2 ) .

Definition. Computational cost of assembled expressions. Given a set of


singular or boolean opertors {♣n }1≤n≤N , a computer c, and a set of numbers
{r1 , . . . , rn+1 }we will dene the computational cost of the assembled expression,
r1 ♣1 r2 ♣3 · · · ♣n rn+1 in a recursive manner as:
0

Υc (r1 ♣1 r2 ♣3 · · · ♣n rn+1 ) ≡ Υc (r1 ♣1 r2 ♣3 · · · ♣n−1 rn ) + Υc rn−1 ♣rn ,
0
where rn−1 is the value of the expression r1 ♣1 r2 ♣3 · · · ♣n−1 rn .

Remark. The evaluation of the sign operator is a very withered case of

50
the evaluation of singular expressions. Although the sgn (·) operator can be
interprated as an assembly of logical boolean expressions, i.e (in C code):

sgn (r) = (r > 0)? + 1 : (r < 0? − 1 : 0) ,

the computer in fact may not use this sequence of boolean expressions. The
computer may only check the sign bit of the already evaluated expression r (if
such a bit is allocated). Especially, for any computer c, for the ”÷” operator
and for any numbers r, r0 , it holds that:

Υc (sgn (r))  Υc (r ÷ r0 ) ,

since the evaluation of the right-side expression operator involves bits manip-
ulation, and requires a few cycles even in the strongest arithmetic logic unit
(ALU), which are spared in the evaluation of the sign.

Examples.

1. Computational cost of approximating a partial limit of a sequence. Let c


be a computer, and let {an }n∈N be a sequence. Say we wish to evaluate the
computational cost of the approximation of one of the partial limits of the
sequence. Let us assume that we have guessed a partial limitP , sampled a
random sequence of indexes {nk }k∈N , and also guessed Mmin , Mmax in the
limit approximation process, along with guesses for Kmin (m) , Kmax (m)
for each Mmin < m < Mmax . Hence, we should evalute the logical expres-
1 ?
sion |ank − P | <
m for all possible values of k, m in the domain. Thus,
the computational cost of that process would be:
   
? ?
˜ n =
Υc P ∈ plima
P P
Υc |ank − P | < 1
m
Mmin <m<Mmax Nmin <nk <Nmax

and each addened can be written as:


   
1 ?
Υc (ank ) + Υc (r1 − P ) + Υc (|r2 |) + Υc + Υc r3 < r4
m
1
where r1 = ank , r2 = ank − P, r3 = |an − P | and r4 = m.

2. Computational cost of approximating a partial limit of a function in a


point. Let c be a computer, f : R→R be a function and let x0 ∈ R .
Say we wish to evaluate the computational cost of the approximation of
a partial limit of f in x0 . Let us assume that we have guessed the partial
limit, P. Say we already sampled a sequence {xn }n∈N such that xn → x0 .
Thus, the computational cost of that process would be
   
? ?
˜ ˜
Υc P ∈ plimf (x) = Υc P ∈ plimf (xn ) ,
x→x0

where the right side term is evaluated via paragraph 1.

51
Claim. Given a non-parametric dierentiable function f : R→R (by non-
parametric the author means that the formula of f is unknown, and especially
the derivative cannot be calculated simply by placing x0 in the formula of
the derivative) and a computer c, the computational cost of approximating
its derivative in a point x0 ∈ R is much higher than the computational cost of
approximating its extremum indicator, i.e.:

Υc (∧f (x0 ))  Υc (f 0 (x0 )) .

Proof. Let us analyze the cost of the two main stages of the approximation
of both the derivative and the extremum indicator:

1. The set of limits the computer needs to guess from. Let us assume that a
sophisticated pre-processing algorithm managed to reduce the suspected
values of the derivative (all of which one should verify in the denition of
the approximation of the limit, as in the example above) to a very large,
however nite set. Note that in order to approximate the extremum indi-
cator, on the paper there seems to be more work (because there are more
partial limits - namely 6 - to calculate); however, they are all calculated
parallely (the computer program may choose the same sequences used to
approximate the derivative, and summarize the approximated partial lim-
its of the upper and lower left and right detachments there). Further, the
set of candidate partial limits for the extremum indicator is nite and very
small: {0, ±1}.
2. The calculated term inside the limit. Notice that the dierence between
the derivative and the detachment is the ÷ operator vs. the sgn operator.
As we mentioned earlier,

Υc (sgn (r))  Υc (r ÷ r0 ) ,

and this is for any r, r0 . Hence the computational cost of any of the
expressions inside the limit is cheaper for the detachment (hence for the
extremum indicator) than the for the derivative.

To sum up, in both stages of the approximation of the limit there is a massive
computational advantage to the extrema indicator over the derivative. 

52
Part V
The discrete Green's theorem in a

non-discrete domain

From now on we will focus our discussion on R2 , although natural generalizations


can be formed. Further, all the curves which we will discuss are continuous,
simple and nite.

16 Tendency of a curve
16.1 Basic terminology
Definition. Antiderivative. Let f : R2 → R be a Lebesgue-integrable func-
tion. Then its antiderivative is dened as follows:

F : R2 → R
´
F (x1 , x2 ) ≡ f dλ,
B

2
Q
where B≡ (−∞, xi ) .
i=1

Definition. Local antiderivative. Let f : R2 → R be a Lebesgue-integrable


function. Then its local antiderivative initialized at the point p = (p1 , p2 ) is
dened as follows:

2
Q
Fp : [pi , ∞)→ R
i=1
´
Fp (x1 , x2 ) ≡ f dλ,
Bp

2
Q
where B≡ (pi , xi ) .
i=1

Definition. Generalized rectangular domain. A generalized rectangular


D ⊂ R2
S
domain is a domain that satises: ∂D = Πω , where each Πω is
ω∈Ω

perpendicular to one of the axes of R2 . In this paper we will sometime abbre-


viate generalized rectangular Domain by GRD.

Definition. Tendable curve. Let C = γ (t) = (x (t) , y (t)) , 0 ≤ t ≤ 1


be a curve, where x, y : [0, 1] → R. It will be said to be tendable if the functions
that form the curve, i.e x and y , are both tendable for 0 ≤ t ≤ 1.

Definition. Tendency indicator vector of a tendable curve. Let C =


γ (t) = (x (t) , y (t)) , 0 ≤ t ≤ 1 be a tendable curve, and let z = γ (t0 ) =

53
(x (t0 ) , y (t0 )) ∈ C be a point on the curve. We will dene the tendency indica-
tor vector of the curve C in the point , as:

4
~s (C, t0 ) : C → {+1, −1, 0}
~s (C, t0 ) ≡ x;+ , x;− , y+
; ; 
, y− |t0 .

Definition. A corner of a tendable curve. Let C = γ (t) = (x (t) , y (t)) , 0 ≤


t≤1 be a tendable curve, and let z = γ (t0 ) = (x (t0 ) , y (t0 )) ∈ C be a point on
the curve. We will say that z is a corner of the curve C if the function ~ s (C, ·)
is discontinuous in t0 .

Definition. An edge point of a tendable curve. Let C = γ (t) = (x (t) , y (t)) , 0 ≤


t≤1 be a tendable curve, and let z = γ (t0 ) = (x (t0 ) , y (t0 )) ∈ C be a point
on the curve. We will say that z is an edge point of the curve C if the function
~s (C, ·) is continuous in t0 .
2
Definition. A quadrant in R2 . Let x ∈ R2 , and let v ∈ {+1, −1} . Then the
quardant associated with v is the set:

Ov ≡ (x1 , x2 ) ∈ R2 | xi ≥ 0 if vi = +1, or xi ≤ 0 if vi = −1, i = 1, 2 .




2
Definition. A partial quadrant in R2 . x ∈ R2 , let v ∈ {+1, −1}
Let and
+ 2
u ∈ (R ) . Then the partial quardant associated with v and u is the set:

Ov,u ≡ (x1 , x2 ) ∈ R2 | 0 ≤ xi ≤ ui if vi = +1, or − ui ≤ xi ≤ 0 if vi = −1, i = 1, 2 .




2
Definition. A quadrant of a point in R2 . Let x ∈ R2 , and let v ∈ {+1, −1} .
Then we will dene the quardant of the given point which is associated with v
in the following manner:

Ov (x) ≡ {x + y| y ∈ Ov } ,
where Ov is the quadrant which is associated with v.

Definition. A partial quadrant of a point in R2 . Let x ∈ R2 , and let


2 2
v ∈ {+1, −1} and u ∈ (R+ ) . Then we will dene the partial quardant of
the given point which is associated with v and u in the following manner:

Ov,u (x) ≡ {x + y| y ∈ Ov,u } ,


where Ov,u is the partial quadrant which is associated with v and u.

16.2 Classication of edge points according to the ten-


dency indicator vector
Definition. A perpendicular edge point of a tendable curve. Given a tend-
able curve, C = γ (t) , 0 ≤ t ≤ 1, we will say that the edge point γ (t0 ) is a

54
Figure 14: An illustration to perpendicular and slanted edges points, with their
associated tendency indicator vector.

perependicular edge point of the curve if the curve is perpendicular to one of the
axes in a neighborhood of γ (t0 ) . An illustration to perpendicular edge points
is given in gure 14.

Definition. A slanted edge point of a tendable curve. Given a tendable


curve, C = γ (t) , 0 ≤ t ≤ 1, we will say that the edge point γ (t0 ) is a slanted
edge point of the curve if the curve is not perpendicular to one of the axes in a
neighborhood of γ (t0 ) . An illustration to perpendicular edge points is given in
gure 14.

55
Figure 15: An illustration to slanted edges points, with their associated tendency
indicator vector.

16.3 Classication of corners according to the tendency


indicator vector
Definition. A perependicular corner of a tendable curve. Given a tendable
curve, C = γ (t) , 0 ≤ t ≤ 1, we will say that the corner γ (t0 ) is a perpendic-
ular corner of the curve if the curve is perpendicular to one of the axes in left
and right neighborhood of γ (t0 ) respectively. An illustration to perpendicular
corners is given in gure 15.

Definition. A slanted corner of a tendable curve. Given a tendable curve,


C = γ (t) , 0 ≤ t ≤ 1, we will say that the corner γ (t0 ) is a slanted corner of the
curve if the curve has only slanted edges in small enough left and right neighbor-
hoods of γ (t0 ) respectively; further, all the curve's points in these neighborhoods

56
Figure 16: An illustration to slanted edges points, with their associated tendency
indicator vector.

are contained in the same quadrant of the point γ (t0 ). An illustration to slanted
corners is given in gure 16.

Definition. A switch corner of a tendable curve. Given a tendable curve,


C = γ (t) , 0 ≤ t ≤ 1, we will say that the corner γ (t0 ) is a switch corner of the
curve if the curve has slanted edges in both the right and left neighborhoods of
γ (t0 ) respectively; further, the curve's points in these neighborhoods are con-
tained in adjacent quadrants of the point γ (t0 ). (Hence its name: the curve
switchs quardants in the point). An illustration to abtuse corners is given in
gure 17.

57
Figure 17: An illustration to abtuse corners for a curve whose orientation is
positive, with their associated tendency indicator vector.

58
Figure 18: An illustration to acute corners for a curve whose orientation is
positive, with their associated tendency indicator vector.

Definition. An acute corner of a tendable curve. Given a tendable curve,


C = γ (t) , 0 ≤ t ≤ 1, we will say that the corner γ (t0 ) is an acute corner of
the curve if the curve has only slanted edge points in either a left or right small
enough neighborhood of γ (t0 ) , and only a perpendicular edge points in a small
enough neighborhood in the other side of γ (t0 ); further, all the curve's points
in these neighborhoods are contained in the same quadrant of the point γ (t0 ).
(Hence its name: if the curve is also dierentiable there, then the angle between
the tangents is acute in such a point). An illustration to slanted corners is given
in gure 18.

Definition. An obtuse corner of a tendable curve. Given a tendable curve,


C = γ (t) , 0 ≤ t ≤ 1, we will say that the corner γ (t0 ) is an obtuse corner
of the curve has only slanted edge points in either a left or right small enough

59
Figure 19: An illustration to abtuse corners for a curve whose orientation is
positive, with their associated tendency indicator vector.

neighborhood of γ (t0 ) , and only perpendicular edge points in a small enough


neighborhood in the other side of γ (t0 ); further, the curve's points in these
neighborhoods are contained in dierent quadrants of the point γ (t0 ). (Hence
its name: if the curve is also dierentiable there, then the angle between the
tangents would be obtuse in such a point). An illustration to abtuse corners is
given in gure 19.

16.4 Denition of tendency of a curve


Definition. Maximum in absolute value of a set. Given a set A ⊆ R, we will
dene its maximum in absolute value as the element in A whose absolute value
is the biggest. It will be denoted as |max| {A} .

60
Definition. Tendency of a tendable curve. Let C = γ (t) = (x (t) , y (t)) , 0 ≤
t≤1 be a tendable curve. We will dene the tendency of the curve C in the
point z = γ (t0 ) = (x (t0 ) , y (t0 )) ∈ C , as a function, τC : C → {+1, −1, 0},
where its values are determined according to the tendency indicator vector at
the point, ~s (C, t0 ) ≡ x;+ , x;− , y+
; ; 
, y− |t0 , according to the cases depicted in
gure 20. The tendency is determined according to the following rules:

• Switch corners, obtuse corners in a negatively oriented curve, acute cor-


ners in a positively oriented curve, perpendicular edge points - all have a
tendency of zero.

• The tendency in slanted edge points and in slanted corners is determined


according to the following rule:

τC (z) = −x;+ · y+
;
|t0 = −x;− · y−
;
|t0 .

The second equality is due to the denition of a slanted edges point and
a slanted corner.

• The tendency in perpendicular corners in a negatively oriented curve is


determined according to the following rule:

τC (z) = s · |max| x;+ · y−


;
, x;− · y+
;

|t0 ,

where s ∈ {±1} is the orientation of the curve (+1 for a positively oriented
curve, −1 for a negatively oriented curve).
• The tendency in obtuse corners in a positively oriented curve and in acute
corners in a negatively oriented curve is determined according to the fol-
lowing rule:
τC (z) = − |max| x;+ · y+
;
, x;− · y−
;

|t0 .

Definition. Uniformly tended curve. Given a tendable curve C, if it holds


that the tendency of the curve is a constant β for each point on the curve apart
perhaps its two end-points, then we will say that the curve is tended uniformly,
and denote: Cβ ≡ C .

16.5 Geometric interpretation of the tendency of a curve


Definition. C = γ (t) be a curve. Let
Left hand side of a curve. Let
T S C be
a positively oriented curve, such that C C = {γ (0) , γ (1)}. Thus, C C is a
loop in the plane, and according to Jordan's curve theorem, one can speak of
two sides of this loop. We will dene the left hand side of
S C with respect to C
as the interior of the loop C C.

Definition. Quadrant vectors of a point on a curve. Given a curve C = γ (t),

61
Figure 20: A summary of the tendency of a curve in a point as a function of
the tendency indicator vector. Positive, Negative and Zero stand for a
tendency of +1, −1 and 0 respectively.

62
Figure 21: An illustration to the term quadrant vectors of a point on a curve.
Notice that the point z1 v whose partial quadrants are fully
has only one vector
contained in a left hand side of C1 , hence: QV (C1 , z1 ) = {(−1, −1)}, and that
the point z2 has two vectors v1 , v2 whose partial quadrants are fully contained
in a left hand side of C2 , hence: QV (C2 , z2 ) = {(+1, +1) , (+1, −1)}.

with orientation s (where s ∈ {±1}, to denote that the curve is either positively
or negatively oriented), we will dene the quadrant vectors of the point z∈C
on the curve as the set:

QV (z, C) ≡ {v| ∃u : Ov,u (z) is f ully contained in a lef t hand side of C} ,

where Ov,u (z) are the partial quardants of the point dened earlier. It is easy to
see that the choice of the curve C from the denition of the left hand side does
not aect the choice of v , hence the above term is well dened. The denition
is illustrated in gure 21.

Definition. Product of a vector in R2 . Let v = (v1 , v2 ) ∈ R2 . We will dene


the vector's product in the following manner:

π (v) = v1 · v2 .

Claim. Let C be a tendable curve. Then the tendency of C in a point z∈C


satises:

X
τC (z) = π (v) ,
v∈QV (z,C)
P
where if QV (z, C) = ∅ then we will dene π (v) = 0.
v
Proof. By inspecting all possible cases (the number of cases is bounded by

63
Figure 22: An illustration of quadrant vectors vs. tendency. Observe that
P
QV (z1 , C1 ) = {(+1, +1) , (−1, +1) , (−1, −1)} , hence π (v) = 1 − 1 +
v∈QV (z1 ,C1 )
t
1 = +1, and indeed the tendency in +1, P s (C1 , z1 ) = (+1, 0, 0, −1) .
z1
since ~ is
Further, QV (z2 , C2 ) = {(+1, −1)} , hence π (v) = −1, and indeed the
v∈QV (z1 ,C1 )
t
tendency in z2 is −1, since ~s (CP
2 , z2 ) = (0, +1, −1, 0) . Next, QV (z3 , C3 ) =
{(+1, +1) , (−1, +1)} , hence π (v) = +1 − 1 = 0, and indeed the ten-
v∈QV (z1 ,C1 )
t
dency in z3 is 0, since ~s (C3 , z3 ) = (+1, −1, 0, 0) P- in fact, z3 is a perpendicular
edge point. Finally, QV (z4 , C4 ) = ∅, hence π (v) = 0, and indeed the
v∈QV (z1 ,C1 )
t
tendency in z4 is 0, since ~s (C3 , z3 ) = (−1, +1, −1, −1) - in fact, z4 is a switch
corner.

the number of tendency indicator vectors, which is nite). An illustration is


given in gure 22. 

17 Slanted line integral


17.1 Denition of the slanted line integral
Lemma. LetC = γ (t) = (x (t) , y (t)) , 0 ≤ t ≤ 1 be a given tendable curve. If
the four left and right detachments, x;− , x;+ , y−
; ;
, y+ are constant on the curve for
each 0 < t < 1, then C is totally contained in a square whose oposite vertices
are the given curve's endpoints.
Proof. According to a previous lemma regarding signposted detachable func-
tions in R, both the functions x and y are stricly monotoneous there, hence for
each 0 < t < 1 it holds that:

x (0) < x (t) < x (1)


y (0) < y (t) < y (1) ,

64
hence the curve's points are fully contained in the square [x (0) , y (0)]×[x (1) , y (1)] . 

Definition. A straight path between two points. Given two points,

{x = (a, b) , y = (c, d)} ⊂ R2 ,

we will dene the following curves:

(
x (t) = ct + a (1 − t)
γ1+ :
y (t) = b
(
x (t) = c
γ2+ :
y (t) = dt + b (1 − t)
(
x (t) = a
γ1− :
y (t) = dt + b (1 − t)
(
x (t) = ct + a (1 − t)
γ2− :
y (t) = d,

where, in each term, it holds that 0 ≤ t ≤ 1. Then, we will sat that γ + ({x, y}) ≡
γ1+ γ2+ and γ − ({x, y}) γ1− γ2− are the straight paths between the two
S S

points. We will refer to γ ({x, y}) , γ − ({x, y}) as the positive and negative
+

straight paths of {x, y}, respectively.

Definition. Paths of a curve. Given a curve C = γ (t), Let us consider


its end points,{γ (0) , γ (1)}, and let us consider the straight paths between the
+ −
points, γ and γ , as suggested in a previous denition. We will dene the
paths of the curve C in the following manner:

C + ≡ γ + ({γ (0) , γ (1)}), C − ≡ γ − ({γ (0) , γ (1)}) .

We will refer to C +, C − as the curve's positive and negative paths respectively.

Definition. Partial domains of a uniformly tended curve. Given a uniformly


tended curve Cβ whose orientation is s, we will dene the partial domains of Cβ ,
namely D+ (Cβ ) and D− (Cβ ), as the closed domains whose boundaries satisfy:

∂D+ (Cβ ) ≡ Cβs , ∂D− (Cβ ) ≡ Cβ−s ,

where Cβs , Cβ−s are the paths of the Cβ . We will refer to D+ (Cβ ) as the selected
domain of the continuous uniformly tended curve.

Definition. Slanted line integral of a Lebesgue-Integrable function's an-


tiderivative on a uniformly tended curve in R2 . Let C ⊂ R2 be a curve, and
letCβ = γ (t) , 0 ≤ t ≤ 1, be a uniformly tendeded sub-curve of C (that is,
Cβ ⊆ C ), whose orientation is s and whose tendency is β. Let us consider a

65
Figure 23: An illustration to the denition of the slanted line integral. In
this example, the curve C has a highlighted curve, denoted by Cβ . This is a
uniformly tended curve, whose tendency is β = −1 (since the tendency indicator
t
vector on Cβ is (−1, +1, −1, +1) and according to the denition). Further,
the tendency in the subcurve's end points is β0 = −1 and β1 = −1 fflfor the
point γ (0) and γ (1) respectively. Hence according to the denition: Fp =
´

γ1+ (1) − 1

f dλ + Fp 2 [Fp (γ (1)) + Fp (γ (0))] .
D + (Cβ )

function f : R2 −→ R which is Lebesgue-Integrable there. Let us consider its


2
local antiderivative, Fp , where p ∈ R . Then the slanted line integral of Fp on
Cβ is dened as follows:

ˆ
1
Fp ≡ f dλ − βFp (γ1s (1)) + [β0 Fp (γ (0)) + β1 Fp (γ (1))] ,
2

( )
D + Cβ

s + −
where γ1 is either γ or γ according to the sign of s, and β0 , β1 are the curve's
tendencies in the points γ (0) and γ (1) respectively. An ilustration to that def-
inition is given in gure 23.

17.2 Properties of the slanted line integral


First, let us recall the generalization of the Fundamental theorem of Calculus
(also known as the summed area tables algorithm), whose formulation was
suggested by Wang et al.'s in [7].

66
Theorem (The Fundamental Theorem of Calculus In Rn ).
Given a function f (x) : Rk −→ Rm , and a rectangular domain D = [u1 , v1 ] ×
. . . × [uk , vk ] ⊂ Rk , then if there exists an antiderivative F (x) : Rk −→ Rm , of
f (x), then:

ˆ
ν T1
X
f (x) dx = (−1) F (ν1 u1 + ν 1 u1 , . . . , νk uk + ν k uk ) ,
D ν∈B k

T
where ν = (ν1 , . . . , νk ) , ν T1 = ν1 + . . . + νk , νi = 1 − νi , and B = {0, 1} .
(1) (2)
Lemma. (Additivity). Let C1 = Cβ , C2 = Cβ two uniformly tended curves,
that satisfy:
(1) (2)
\
∃!x ∈ R2 : x ∈ Cβ Cβ ,
and let us also assume that both the curves share the same orientation s. Let
us consider a function f : R2 −→ R which is Lebesgue-Integrable there. Let us
2
consider its local antiderivative, Fp , where p ∈ R . Let us consider the curve
(1) S (2)
Cβ ≡ Cβ Cβ . Let us denote the curves by C1 = γ1 , C2 = γ2 and C = γ
accordingly. Then:

Fp = Fp + Fp .
Cβ (1) (2)
C C
β β

Proof. First let us note that the proof is illustrated in gure 24. Without
T
loss of generality, let us assume that C1 C2 = γ1 (1) = γ2 (0). Let us denote
s s s
the paths of the curves C1 , C2 and C by γ1,i , γ2,i and γi accordingly, where
i ∈ {1, 2}. According to the denition of the slanted line integral, we obtain:

ˆ
ffl 1
Fp = f dλ − βFp (γ1s (1)) + [β0 Fp (γ (0)) + β1 Fp (γ (1))]
C 2
D + (C)
ˆ
ffl s
 1
Fp = f dλ − βFp γ1,1 (1) + [β0 Fp (γ1 (0)) + βFp (γ1 (1))]
C1 2
D + (C1 )
ˆ
ffl s
 1
Fp = f dλ − βFp γ2,1 (1) + [βFp (γ2 (0)) + β1 Fp (γ2 (1))] .
C2 2
D + (C2 )

Now according to the generalization of the Fundamental Theorem of Calculus,


it holds that:
ˆ ˆ ˆ
f dλ+ f dλ+β [Fp (γ1s (1)) + Fp (γ s (1))] − Fp γ1,1
s s
   
f dλ = (1) + Fp γ2,1 (1) .
D D1 D2

Hence the statement's correctness. 

67
Figure 24: An illustration to the proof of the additivity of the slanted line
integral.

Definition. A division of a tendable curve. Let C = (x (t) , y (t)) , 0 ≤ t ≤ 1


be a tendable curve in R2 . Let t1 , . . . , t n be the values of the curve's parameter
for which the curves dened by:

(ω)
Cβ : tω−1 ≤ t ≤ tω
n o
(ω)
are uniformly tended subcurves of the given curve C. The set Cβ is
1≤ω≤n
called a division of the curve. An illustration is given in gure 25.

Definition. Slanted line integral of a Lebesgue-Integrable function's an-


tiderivative on a tendable
n curve
o in R2 . Let us consider a tendable curve C =
S (ω) 2 (ω)
Cβ ⊂ R , where Cβ is a division of the curve C. Let us consider a
ω

function f : R2 −→ R which is Lebesgue-Integrable there. Let us consider its


2
local antiderivative, Fp , where p ∈ R . Then the slanted line integral of Fp on
C is dened as follows:
X
Fp ≡ Fp dλ.
ω
C (ω)
C
β

This is well dened beacuse the right hand-side is independent of the choice of
the division of the curve - due to the slanted line integral's additivity.

Lemma. Let us consider a uniformly tended curve Cβ = γ (t) , 0 ≤ t ≤ 1


whose oritentation is positive. Let us consider the curve −Cβ which consol-
idates with Cβ apart from the fact that its orientation is negative. Let us
consider a function f : R2 −→ R which is Lebesgue-Integrable there. Let Fp be

68
Figure 25: An illustration to division of a tendable curve. The subscript in-
dicates the tendency of the sub-curve, and the superscript indicates its index
amongst the other sub-curves.

its local antiderivative, where p ∈ R2 . Then it holds that:

Fp = − Fp .
−Cβ Cβ

´ ´ ´
Proof. Since it holds that f dλ + f dλ = f dλ, and
( )
D + Cβ D − (Cβ ) D + (Cβ ) D − (Cβ )
S

since the generalization of the Fundamental Theorem of Calculus claims that:


ˆ
f dλ = β F γ1+ (1) + F γ1− (1) − [F (γ (1)) + F (γ (1))] ,
  

( )
D + Cβ D − Cβ
( )
S

then by considering all the cases of β, rearranging the terms and applying the
denition of the slanted line integral for Cβ , the corollary is trivially derived. 

Corollary. Let us consider a tendable curve C = γ (t) , 0 ≤ t ≤ 1 whose


oritentation is constant. Let us consider the curve −C which consolidates with
C apart from the fact that its orientation is the opposite to the given curve's ori-
entation. Let us consider a function f : R2 −→ R which is Lebesgue-Integrable
2
there. Let Fp be its local antiderivative, where p ∈ R . Then it holds that:

Fp = − Fp .
−C C

69
Note. Given a function f : R2 −→ R which is Lebesgue-Integrable there, and
a continuous uniformly tended curve C0 , Then the slanted line integral of its
antiderivative, F on C0 satises that:

F =0
C0

Proof. D± (C0 ) is zero (since the curve


The integral of any function on the set
consolidates with its paths). Further, since β = 0, then corollary is derived from
the slanted line integral's denition. 

18 The discrete Green's theorem for a non-discrete


domain
Let us recall the discrete Green's theorem, as it was formulated in Wang et al.'s
work, found in [7].

Theorem. (The Discrete Green's Theorem). Let D ⊂ Rn be


a generalized rectangular domain, and let f be a Lebesgue-Integrable function
in Rn . Let Fp be the local antiderivative of f. Then:

ˆ X
f dλ = αD (x) F (x) ,
x∈∇·D
D

where αD : Rn −→ Z, is a map that depends on n. For n = 2 it is such that


αD (x) ∈ {0, ±1, ±2}, according to which of the 10 types of corners, depicted in
gure 1 in Wang et al.'s paper (and in this paper's gure 1), x belongs to.

We will now suggest to apply the denition of the slanted line integral, in order
to extend the above theorem to a non-discrete domain.

Theorem. (The Discrete Green's Theorem for a non-discrete


domain). Let D ⊆ R2 be a given simply connected domain whose edge is
continuous and tendable, and let f be a Lebesgue-Integrable function in R2 .
2
Let Fp be its local antiderivative, where p∈R . Then, in the same terms that
were introduced, it holds that:
ˆ
f dλ = Fp .
D ∂D

70
Figure 26: An illustration of the analogous version to Green's theorem for a
rectangle.

Proof. Let us seperate to cases, according to the type of the domain. For a
simple rectangular domain whose edges are paralel to the axes, it holds that:

Fp = Fp + Fp + Fp + Fp
BADC BA AD DC CB

1
= [+Fp (B) − Fp (A)]
2
1
+ [+Fp (D) − Fp (A)]
2
1
+ [+Fp (D) − Fp (C)]
2
1
+ [+Fp (B) − Fp (C)]
2
= Fp (B) + Fp (D) − [Fp (A) + Fp (C)] .

This case is depicted in gure 26.


For a generalized rectangular domain whose edges are paralel to the axes: Note
that while traversing upon the edge of the domain, the coecient of Fp taken to
the summation is determined according to the tendency in the corners, where
each half is obtained via a one side of the corner. Considering all the possible
cases results with the consequence, that the claim for this type of domains
consolidates with the discrete Green's theorem. This case is depicted in gure
27.
Now that we know the theorem's correctness for a GRD, let us prove it for a
simply connected domain whose edge is continuous and tendable. We'll consider
a general domain D, and for an illustration we'll use the domain depicted in
gure 28. It is easier to prove the theorem for a negatively oriented curve,
because if this is the case then idea of the proof is building a GRD such that the
given domain is fully condtained inside it, rather than fully contain it. Hence,
we will show that the slanted line integral of the negatively oriented curve equals
the integral of f on the area bounded between the GRD's edge and the domain,

71
Figure 27: An illustration of the analogous version to Green's theorem for a
GRD.

minus the intergral of f on the whole GRD; in turn, this will show that:

ˆ ˆ ˆ ˆ ˆ
 

Fp = − Fp = −  f dλ − f dλ = f dλ − f dλ = f dλ,
∂D −∂D GRD\D GRD GRD GRD\D D

as the theorem claims. Let us oberve all possible cases for points on a curve,
and see that in each case the slanted integral indeed results with the integral
of f in the area between the GRD's edge and the domain's boundary. Further,
1
let us skip the tendency coecient of
2 in the corners and relate directly to the
accumulated tendency from both sides of the corner.

• For a switch corner, the GRD's edge simply goes on (it has no corner
there), hence there is no need to add or subtract the value of Fp there
(and indeed, the tendency of such corners is zero) - for example, point A
in gure 28. The same goes for perpendicular edge points - the GRD's
edge consolidates with them, hence it has no corners there. For example,
the points in the open segments DE, EF, GH.
• For a segment between two corners, the slanted integral accumulates the
integral of f in the positive partial domain of the curve, and also adds
the weighted value of Fp in the corner - a value which is minus the ten-
dency of the segment, such that (by considering all cases) the weight
ts to the corner of the GRD's edge. Examples are shown in edges
N A, AB, BC, F G, HJ, KL, LM, and MN in gure 28.

• In a slanted edge point, the additivity of the slanted line integral assures
that the GRD's edge may pass through it or skip it. For example, in

72
gure 28: point B is a slanted edge point where the GRD's edge has a
corner, and I is a slanted edge point where the GRD's edge does not have
a corner. Since this proof is consturctive, one may use this fact to control
the computational eciency of the slanted line integral: the more slanted
edge points the GRD's edge meets, the less double integral the computer
needs to calculate on-line (assuming that Fp has been pre-processed as is
the case in computer applications).

• Acute or obtuse corners where the GRD's edge simply goes on (it has not
corner there), have a zero tendency, as we would expect. For example,
corners F, H and J in gure 28.

• Perpendicular corners consolidate with the GRD's edge, and indeed their
tendency is as in the discrete Green's theorem. For example, points D
and E in gure 28.

• If along the curve there are two adjacent slanted corners, then it is shown
via observing all cases that the areas bounded by the positive partial do-
mains of the sub-curves sometimes overlap, as is the case for the sub-curves
LM, M N in gure 28. However, once again via observing all cases, it is
shown that if an overlap indeed occurs, then the extra accumulated inte-
gral is deducted by an integral of f on a rectangle, via a linear combination
of Fp . In the examle, the integral of f in the rectangle M M 0 M 000 M 00 is
deducted via the accumulated linear combination:
ˆ
Fp (M ) − Fp (M 00 ) − Fp (M 0 ) + Fp (M 000 ) = − f dλ,
M M 0 M 000 M 00

000 000
where the terms +Fp (M ) , −Fp (M ) are articially added to the cal-
cuation: they deduct each other, while the rst is used for deducting the
integral over the rectangle, and the second one is used as the usual value
of Fp on the corner of the GRD's edge.

• In case two corners which have a zero-tendency corner between them con-
solidate, and they both have opposite weights, then this corner is dis-
regarded in the global corners of the GRD's edge (the plus/minus signs
deduct each other, as shown in point E in gure 28). 
Notation. The slanted line integral of a function's local antiderivative Fp
on a curve C (where p ∈ R2 ), calculated with a given rotation θ of the coordi-
ffl θ
nates system, will be denoted by Fp .
C

Corollary. Let C ⊆ R2 be a closed and tendable curve, and let f be a


Lebesgue-Integrable function in R2 . Let Fp1 , Fp2 be two of its local antideriva-
tives, where p ∈ R2 , where Fp1 , Fp2 are calculated with given rotations θ1 , θ2
of the coordinates syestems. Then, in the same terms that were introduced, it
holds that:
θ1 θ2
Fp1 = Fp2 .
C C

73
Figure 28: An illustration to the proof of the discrete Green's theorem for a
non-discrete domain. The domain is colored in green, and its orientation is
negative. The bounding GRD is partially broken and partially consolidates
with the domain (as in the section DE ). The corners of the GRD are colored
with yellow. Let us classify the highlighted points on the green curve: A is a
switch corner, B and I are slanted edge points, C, H and J are obtuse corners,
D and E are perpendicular corners, F, G and K are acute corners, and L, M, N
are all slanted corners.

74
Figure 29: The discrete Green's theorem for a non-discrete domain, for a pos-
itively oriented curve. Since the orientation is positive, the GRD is contained
inside the domain bounded by the curve. Note that the theorem's correctness
is independent of the choice of the division of the curve: this fact is visible via
two dierent divisions of the curve, as shown above.

Proof. Since C is closed, it is the boundary of a simply connected domain


D, hence according to the above theorem applied for dierent rotation angles
of the axes:
ˆ θ1 ˆ θ2
f dλ = Fp 1 , f dλ = Fp 2 . 
D C D C

Notation. According to the above corollary, the slanted line integral of a


closed curve in R2 is independent of the choice of the angle of the rotation of the
coordinates system or the point p in the denition of the local antiderivative Fp .
Hence, for a bounded domain D we shall denote the previous quoted theorem
by: “ ˆ
F = f dλ,
∂D D

› ffl θ
where F ≡ Fp for any choice of the coordinates system's rotation θ and
∂D ∇·D

for any point p ∈ R2 . This fact is illustrated in gure 30.

75
Figure 30: An illustration to the fact that the discrete green's theorem for
a non-discrete domain is independent of the rotation angle of the coordinate
system.

Figure 31: An illustration of the Line Integral for a squared curve, and an
illustration to the Slanted Line Integral for a curve that bounds a Generalized
Squared Domain (As was shown by Wang et al.'s in [7]). Note the bi-directional
relationship between the Line integral and the Slanted Line integral, whose
visualization is intuitive: In the same manner that the Line Integral on the curve
can be calculated using canceled sums of the line integral inside the curve, so
can the Slanted Line Integral on the curve be calculated using canceled sums of
the Slanted Line Integral of the boxes inside the curve.

76
Part VI
Epilogue

19 Future work
The denition of the detachment enables future work in the following elds of
research:

• Discrete Geometry and Advanced Calculus, via further exploring theorems


that rely on the detachment. Note that the discrete Green's theorem for a
non-discrete domain and the denition of the Slanted Line Integral form a
dierent approach to Advanced Calculus, since it relies on discrete division
of the domain bounded by a curve, rather than summing up the function's
values on the curve as suggested by the familiar Line Integral.

• Elementary Calculus, via further exploring the suggested denition of the


limit process (which is depicted in the appendix), extensions to the de-
nition of the detachment to other quantizations, and the establishment of
further theorems that rely on the detachment.

• Numerical Analysis, via optimizations of the detachment.

• Metric and Topological Spaces, Number Theory and other elds of Clas-
sical Analysis. Given a function, f : (X, dX ) → (Y, dY ) , where X, Y are
metric spaces and dX , dY are the induced measures respectively, one usu-
dY (f (x),f (x0 ))
ally cannot talk about the derivative, since the term: lim dX (x,x0 )
x→x0
dX (·)
is not always dened (we can not know for sure that the fraction
dY (·) is
well dened). However, the term

lim Q [dY (f (x) , f (x0 ))] ,


x→x0

where Q is a quantization function (as is the sgn (·) function in the def-
inition of the detachment), is well dened, and suggests a classication
of a discontinuity in a point. Theorems relying on this operator may be
established.

• Computer applications, such as computer vision and image processing.


For example, given an image which has been interpolated into a pseudo-
continuous domain, one can use an extension of the detachment,

lim Q [(f (x) , f (x0 ))]


x→x0

(where Q is a quantization function), to discover edges in the image, rather


than use the gradient as in the current approcah. This can spare compu-
tation time, as was suggested in part 4.

77
• Algebra. The unusual arithmetic attributes that the detachment depicts,
whose nature is multiplicative, can be now further explored.

• Real Functions. Is it true that a function is detachable almost everywhere


if and only if it is dierentiable almost everywhere? I couldn't prove or
disprove it. This conjecture is now open for further investigation, along
with other Measure Theory related questions regarding the detachment.

20 Appendix
20.1 A dierent denition to the limit process
Definition. A sequence {an }n∈N is said to have a limit L if for any  > 0 there
exists an index Ñ such that for any Nmax > Ñ there exists Nmin < Nmax − 1
such that for all Nmin < n < Nmax it holds that:

|an − L| < .

Theorem. The above denition, and Cauchy's denition to the limit process,
are equivalent.
Proof. First direction. Suppose that Cauchy's denition holds for a sequence.
Hence, given an  > 0 there exists a number N such that for any n > N it holds
that |an − L| < . Let us choose Ñ = N + 1. Then especially, given Nmax > Ñ ,
then Nmin = N satises the required condition.
Second direction. Suppose that the above denition holds for a sequence. We
want to show that Cauchy's denition also holds. Given  > 0, let us choose
N = Ñ . We would like to show now that for any n > N it holds that
|an − L| < . Indeed, let n0 > N . Then according to the denition, if we
choose Nmax = n0 + 1, there exists Nmin < n0 such that for any n that sat-
ises Nmin < n < Nmax it holds that |an − L| < . Especially, |an0 − L| < . 

Remark. Note that Cauchy's denition for limit consists of the following
argument. A sequence {an }n∈N is said to have a limit L  > 0 (as
if for any
small as we desire), there exists some N () such that for any n > N it holds
that:
|an − L| < .
Consider the following alternative: There exists max such that for any 0 <
 < max there exists N () with |an − L| < . The author would like to point
out that this alternative suggest a more rigorous terminology to the term as
small as we desire, and also forms a computational advantage: one knows ex-
actly what is domain from which  should be chosen. It is clear that both the
denitions are equivalent, hence the proof is skipped. Following is a slightly
dierent modication of the discussed suggestion to dene the limit, where once
again the proof to its equivalency to the previously known denitions is skipped.

78
Definition. A sequence{an }n∈N is said to have a limit L if there exists
a number M > 0 such that for any m > M there exists Ñ (m) such that for any
Nmax > Ñ there exists Nmin < Nmax − 1 such that for all Nmin < n < Nmax
it holds that:
1
|an − L| < .
m

79
20.2 Source code in matlab
Algorithm 2 Source code for determimining the type of disdetachment
% DetermineTypeOfDisdetachment - given a function f and its tendency indi-
cator vector in a point x,
% will return a vector containing the classication of the function to its detach-
ment types, via
% the vector res, i.e: res(i) = 1 i the function has i-th type disdetachment in
x.
% Author: Amir Finkelstein, amir.f22@gmail.com
% Date: 16-February-2010

function res = DetermineTypeOfDisdetachment(v)


res = zeros(NUM_CLASSIFICATIONS, 1);
v_minus = v(1:3); v_plus = v(4:6);
d_plus_sup = GetSign(min(nd(v_plus)));
d_plus_inf = GetSign(max(nd(v_plus)));
d_minus_sup = GetSign(min(nd(v_minus)));
d_minus_inf = GetSign(max(nd(v_minus)));
if d_plus_sup ~= -d_minus_sup
res(1) = 1;
end
if d_plus_inf ~= -d_minus_inf
res(2) = 1;
end
if d_plus_sup ~= d_minus_sup
res(3) = 1;
end
if d_plus_inf ~= d_minus_inf
res(4) = 1;
end
if d_plus_sup ~= d_plus_inf
res(5) = 1;
end
if d_minus_sup ~= d_minus_inf
res(6) = 1;
end

function phi = GetSign(index)


switch (index)
case {1,4}
phi = +1;
case {2,5}
phi = 0;
case {3,6}
phi = -1;
end

80
Figure 32: The NaCl structure on the left, and the NaCl dissolving in water,
on the right. Note that the structure of the NaCl resembles the structure of
the squares in the discrete Stokes' theorem, and that the process of dissolving
resembles the slanted line integral: If performed recursively, then in each itera-
tion, the slanted line integral dissolves another piece of the curve, where the
± signs appear in the slanted line integral as well.

References
[1] Paul Viola and Michael Jones. Robust Real-time Object Detection. Inter-
national Journal of Computer Vision, 2001.

[2] Stewart, J. "Fundamental Theorem of Calculus", Calculus: early transcen-


dentals, Belmont, California: Thomson/Brooks/Cole. 2003.

[3] Yan Ke, Rahul Sukthankar and Martial Hebert. Ecient Visual Event De-
tection using Volumetric Features, International Conference on Computer
Vision, pp. 166 - 173, October 2005, volume 1.

[4] Lebesgue, Henri. "Sur lintegration des fonctions discontinues". Annales sci-
entiques de lEcole Normale Superieure 27: 361450, 1910.

[5] Williams, Lance. Pyramidal parametrics. SIGGRAPH Comput. Graph.,


volume 17, 1983, pages 1-11, ACM, New York, NY, USA.

[6] Crow, Franklin. "Summed-area tables for texture mapping", SIGGRAPH


'84: Proceedings of the 11th annual conference on Computer graphics and
interactive techniques. pp. 207-212.

[7] X. Wang, G. Doretto, T. Sebastian, J. Rittscher, and P. Tu. Shape and ap-
pearance context modeling. In Proc. IEEE Int. Conf. on Computer Vision
(ICCV), pages 18, 2007.

81
[8] Lienhart, R. &Maydt, J. (2002). An extended set of Haar-like features for
rapid object detection. In IEEE Computer Vision and Pattern Recognition
(p. I:900:903).

[9] Gilbert Labelle and Annie Lacasse. Discrete Versions of Stokes' Theorem
Based on Families of Weights on Hypercubes. In Springer Berlin / Heidel-
berg ISSN 0302-9743, 1611-3349, Volume 5810/2009.

[10] Tang, Gregory Y. A Discrete Version of Green's Theorem. Pattern Analysis


and Machine Intelligence, IEEE Transactions on Volume PAMI-4, Issue 3,
May 1982 Page(s):242 - 249.

[11] http://math.boisestate.edu/~geschke/papers/EverywhereMinMax.pdf.

[12] Y. Katznelson and Karl Stromberg. Everywhere Dierentiable, Nowhere


Monotone, Functions. The American Mathematical Monthly, Vol. 81, No.
4. (Apr., 1974), pp. 349-354.

[13] H.L Royden. Real Analysis. Third edition.

82

Vous aimerez peut-être aussi