a simple approach to calculus

82

Upload: detachment-calculus

Post on 27-Apr-2015

321 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A Simple Approach To Calculus

The Theory Behind The Summed Area Tables

Algorithm: A Simple Approach To Calculus

Amir Finkelstein

e-mail: [email protected]

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 wereshown to provide a tremendous computational gain, since they t pre-cisely to the needs of Discrete Geometry researchers, due to their discretenature. In this book the author suggests that these theorems are actuallyderived from a dierently dened Calculus, namely the "Calculus of De-tachment". The main operator of this theory is dened by a mixture ofdiscrete and continuous math, to form a simpler and more ecient opera-tor than the derivative. This approach to analyze functions is hence moresuitable for computers (in order to save computation time), and the sim-plicity of the denition allows further research in other areas of ClassicalAnalysis.

Page 2: A Simple Approach To Calculus

Contents

I Prologue 5

1 Introduction 5

2 Previous Work 5

2.1 Integral Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Integral Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 A generalization of the Fundamental Theorem of Caclulus . . . . 72.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 . . . . . . . . . . . . . . . . . . . . . . . . 268.2 Geometric interpretation of the tendency . . . . . . . . . . . . . 28

9 continuity and the detachment 29

10 Monotony and the detachment operators 30

10.1 Tendency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3010.2 Detachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3110.3 Signposted Detachment . . . . . . . . . . . . . . . . . . . . . . . 3310.4 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3410.5 General notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

11 Boundedness and the detachment 34

2

Page 3: A Simple Approach To Calculus

12 Dierentiability and the detachment 35

12.1 Joint points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3512.2 Dierentiability Vs. tendability of functions . . . . . . . . . . . . 3712.3 Dierentiability related sucient conditions for tendability . . . 37

13 Fundamental theorems involving the detachment 38

13.1 Closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3813.2 Arithmetic rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 4013.3 Analogous versions to the even\odd theorems (of the derivative) 4013.4 An analogous version to Fermat's theorem . . . . . . . . . . . . . 4113.5 An analogous version to Rolle's theorem . . . . . . . . . . . . . . 4113.6 An analogous verion to Lagrange's theorem . . . . . . . . . . . . 4213.7 An analogous version to Darboux's theorem . . . . . . . . . . . . 4313.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 . . . . . . . . . . . . . . . . . . . . . . . . . . . 5316.2 Classication of edge points according to the tendency indicator

vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5416.3 Classication of corners according to the tendency indicator vector 5616.4 Denition of tendency of a curve . . . . . . . . . . . . . . . . . . 6016.5 Geometric interpretation of the tendency of a curve . . . . . . . . 61

17 Slanted line integral 64

17.1 Denition of the slanted line integral . . . . . . . . . . . . . . . . 6417.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

Page 4: A Simple Approach To Calculus

20 Appendix 78

20.1 A dierent denition to the limit process . . . . . . . . . . . . . . 7820.2 Source code in matlab . . . . . . . . . . . . . . . . . . . . . . . . 80

4

Page 5: A Simple Approach To Calculus

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 ofthe advanced Calculus (the discrete Green's theorem and the discrete Stokes'theorem).The discrete versions of these theorems were required to enable computationaleciency: for example, the discrete Green's theorem enables to calculate thedouble integral of a function in a discrete domain (a domain whose boundaryis parallel to the axes, as is usually the case in discrete geometry) in a moreecient manner with respect to the regular Green's theorem, due to the factthat 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 theregular Green's theorem, that points out the connection between the doubleintegral and the line integral. The computational saving is enabled due to apre-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 thesediscrete theorems. The paper is divided as follows. In part 1, depicted is a shortsurvey 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 monotonicregions of any function. The most fundamental operator, the detachment, formsa hybridization between two kinds of mathematics: continuous math (Calculus)and discrete math (the sgn (·) operator). In part 3 a mathematical discussion isheld, where: the connection between the properties of these operators to thoseof the familiar derivative is surveyed; analogous versions to some of the mostfundamental theorems of Calculus are depicted; the geometric interpretation ofone of the operators is drawn; a discussion is held regarding the cases whereit is impossible to apply one or more of the operators to functions; a generalfunction that demonstrates the operators' approach is shown; and a structureto the Calculus is suggested. In part 4, an engineering-oriented discussion isheld regarding the computational cost of the usage of the suggested operators.Amongst others, a proof is suggested to the computational preferability of theusage 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'stheorem 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

Page 6: A Simple Approach To Calculus

2.1 Integral Image

Followed is an introduction to probably one of the most stunning breakthroughsin the eld of computational-gain driven integral calculus theorems over discretedomains, which was rst introduced (to the author's knowledge) by Tang in1982. The idea of summed area tables, was later introduced by Lance Williamsand Franklin Crow in ([6]). Yet, the most inuencial paper in this area is Violaand Jones' Integral Image algorithm ([1]), which applies summed are tables tofast calculations of sums of squares in an image.

The idea is as follows. Given a function i over a discrete domain2∏j=1

[mj ,Mj ] ⊂

Z2, dene a new function (sat stands for summed area table, and i stands forimage):

sat (x, y) =∑

x′≤x∧y′≤y

i (x′, y′) ,

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∑x′=a

d∑y′=c

i (x′, y′) = sat (b, d) + sat (a, c)− sat (a, d)− sat (b, c) .

2.2 Integral Video

The idea of Integral Image was extended by Yan Ke, Rahul Sukthankar andMartial Hebert in [3]. This algorithm was named Integral Video, for it aimsto calculate the sum of volumetric features dened over a video sequence. Itgeneralizes the Integral Image concept in the sense, that the cumulative functionis generalized to deal with three dimensions. Namely, given a function i over a

discrete domain3∏i=1

[mi,Mi] ∈ Z3, dene a new function:

sat (x, y, z) =∑

x′≤x∧y′≤y

∧z′≤y

i (x′, y′, z′) ,

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∑x′=a

d∑y′=c

f∑z′=e

i (x′, y′, z′) = sat (b, d, f)− sat (b, d, e)− sat (b, c, f) + sat (b, c, e)

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

6

Page 7: A Simple Approach To Calculus

2.3 A generalization of the Fundamental Theorem of Ca-clulus

Wang et al. ([7]) suggested to further generalize the Integral Image concept, in2007. They issued the following argument, which forms a natural generalizationto 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: ˆ

D

f (x) dx =∑ν∈Bk

(−1)νT1

F (ν1u1 + ν1u1, . . . , νkuk + νkuk) ,

where ν = (ν1, . . . , νk)T, νT1 = ν1 + . . . + νk, νi = 1 − νi, and B = 0, 1 . If

k = 1, then´D

f (x) dx = F (v1)− F (u1), which is the Fundamental Theorem of

Calculus. If k = 2, then

ˆ

D

f (x) dx = F (v1, v2)− F (v1, u2)− F (u1, v2) + F (u1, u2) ,

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 holdin [7].

2.4 Discrete Version of Stokes' Theorem

Back in 1982, Tang ([10]) suggested a discrete version of Green's theorem. Intheir paper from 2007, Wang et al.'s ([7]) suggested to further generalize Tang'stheorem to any nite dimension. This is in fact the rst time, known to theauthor, that a discrete version to Stokes' theorem was published. In their paperfrom 2009, Labelle and Lacasse ([9]) suggested a dierent proof to a similartheorem. 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 bea generalized rectangular domain, and let f be a Lebesgue-Integrable functionin Rn. Let F be the antiderivative of f , in the same terms of this paper'stheorem 2. Then: ˆ

D

fdλ =∑x∈∇·D

αD (x)F (x) ,

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

Page 8: A Simple Approach To Calculus

Figure 1: The corners on which Wang et al.'s pointed out in their paper. Thenumbers ±1,±2 are the corner's αD, which is a term that this paper seeksto 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 αDin the above theorem, research the pointwise operator that forms this term, andnd a more general version to this theorem, which holds also for a non-discretedomain. Some of the results that this paper depicts are depicted in gure 2.

8

Page 9: A Simple Approach To Calculus

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

9

Page 10: A Simple Approach To Calculus

Part II

Basic Terminology In Calculus

3 Denition of the detachment

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

sgn (r) ≡

+1, r > 0

−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:

∃limh→0

sgn [f (x+ h)− f (x)] .

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 followinglimit exists:

∃ limh→0+

sgn [f (x+ h)− f (x)] .

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 limitexists:

∃ limh→0−

sgn [f (x+ h)− f (x)] .

Note. A function f : R −→ R is detachable in a point x0 ∈ R i it is bothleft 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 ina.

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 andright detachable in a.

10

Page 11: A Simple Approach To Calculus

Figure 3: The idea of the denition of the detachment is very simple. Let usobserve the term: f (x+ h)− f (x). It is clear that for any continuous function,it holds that: lim

h→0[f (x+ h)− f (x)] = 0. The derivative, however, manages

to supply interesting information by comparing dy to dx, via a fraction. Thedetachment uses less information, and quantizes dy, via the function sgn (·). Thedetachment of the function does not reveal the information regarding the rateof change of the function. It is a trade-o between eciency and informationlevel, 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, 0f ; (x) ≡ lim

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

Applying the detachment operator to a function will be named: detachment ofthe 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 operatorsapplied for f as:

f ;± : R→ +1,−1, 0f ;± (x) ≡ lim

h→0±sgn [f (x+ h)− f (x)] .

Applying the detachment operator to a function will be named: left or rightdetachment of the function.

4 Denition of the signposted detachment

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

11

Page 12: A Simple Approach To Calculus

Figure 4: An illustration to the detachment process. It is clear from this gurewhy the term of detachment was selected: The function is being torn in itsextrema points.

following limit exists:

∃limh→0

sgn [h · (f (x+ h)− f (x))] .

Definition. Right or left signposted detachable function in a point. Givena function f : R −→ R, we will say that it is right signposted detachable in apoint 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 ifone 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

Page 13: A Simple Approach To Calculus

applied for f as:

f~; : R→ +1,−1, 0f~; (x) ≡ lim

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

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 leftor right signposted detachable function f : R → R, we will dene the left orright signposted detachment operators applied for f as:

f~;± : R→ +1,−1, 0

f~;± (x) ≡ ± limh→0±

sgn [(f (x+ h)− f (x))] .

Applying the signposted detachment operator to a function will be named: leftor right signposted detachment of the function.

Examples.

1. Let us consider the following function:

f : R→ R

f (x) =

x, x ∈ Qx2, x /∈ Q.

Then f is right detachable and right signposted detachable there, andf ;+ (0) = +1. However, it is not left detachable there.

2. Let us consider the following function:

f : R→ R

f (x) =

xsin

(1x

), x 6= 0

0, x = 0.

Then f is not right nor left detachable in x = 0 since the limits

limh→0±

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

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

3. Let us consider the following function:

f : R→ R

f (x) =

x2sin

(1x

), x 6= 0

0, x = 0.

Then f is not right nor left detachable in x = 0 since the limits limh→0±

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

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

13

Page 14: A Simple Approach To Calculus

4. The function f : R→ R, f (x) = |x| is detachable in x = 0 althought it isnot 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 aneighborhood Iε (x) such that f is signposted detachable in Iε. Let usconsider the following function:

f : [−1, 1]→ R

f (x) =

2, x = 0

(−1)n, x = 1

n , n ∈ Z0, otherwise.

then f ; (0) = −1, however it is easy to see that for any other point x ∈[−1, 1] \

(0

⋃t|t = 1

n , n ∈ Z), there are innitely many points in any

punctured neighborhood where f receives higher values, and innitelymany points in any punctured neighborhood where f receives lower values,than in the point x. Hence, f is not detachable nor signposted detachablein any neighborghood of x = 0.

6. Let us consider the function:

f : R→ R

f (x) =

0, x ∈ R\Z1, x ∈ Z.

Then the detachment of f is:

f ; : R→ R

f ; (x) =

0, x ∈ R\Z−1, x ∈ Z,

hence it exists in any point, although f is not continuous in innitely manypoints. The signposted detachment of f is:

f~; : R\Z→ 0f~; (x) = 0.

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

14

Page 15: A Simple Approach To Calculus

7. Let us consider the function: f : R→ R, f (x) = x2 + x. Then:

f ;+ (x) = limh→0+

sgn[(x+ h)

2+ x+ h− x2 − x

]= lim

h→0+sgn

[x2 + 2xh+ h2 + x+ h− x2 − x

]= lim

h→0+sgn

[2hx+ h2 + h

]= lim

h→0+sgn (h) · lim

h→0+sgn [2x+ h+ 1]

= limh→0+

−1, x < −h+1

2

0, x = −h+12

+1, x > −h+12

=

−1, x < − 1

2

0, x = − 12

+1, x > − 12 .

8. The function:

f : R→ R

f (x) =

tan (x) , x 6= π

2 + πk

0, x = π2 + πk

, k ∈ Z

is everywhere signposted detachable and nowhere detachable.

9. Riemann's function:

f : R→ R

f (x) =

1q , x = p

q ∈ Q0, x ∈ R\Q,

is nowhere signposted detachable. It is detachable on the rationals, sincefor any point x ∈ Q it holds that f ; (x) = −1, and it is not detachable onthe irrationals, for any point x /∈ Q, the terms f ;± (x) do not exist.

10. The function:

f : R\ 0 → R\ 0

f (x) =

1x , x ∈ Q− 1x , x ∈ R\Q

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

11. Both the directions of the argument:

f ;± (x0) = k ⇐⇒ limx→x0

f ; (x) = k

15

Page 16: A Simple Approach To Calculus

are incorrect. For example, the function:

f : [0, 1]→ R

f (x) =

1, x = 0

0, 0 < x ≤ 1

satises limx→0+

f ; (x) = 0 although f ;+ (0) = −1. Further, the function:

f : (−1, 1)→ R

f (x) =

sin(1x

), x 6= 0

17, x = 0.

satises that f ;+ (0) = −1 although limx→0+

f ; (x) does not exist.

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

f : R→ R

f (x) =

∣∣sin ( 1x)∣∣+ ε, x 6= 0

0, x = 0,

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

13. Weirstrass' function has both uncountably many non-extrema points whereits 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. Givena function f : R −→ R and a set of disjoint domains A = An1≤n≤N ⊆ R suchthat

⋃nAn = R, and a set of scalars r = rn1≤n≤N , we will dene the indicator

function of f with respect to A in the following manner:

χAf : R→ r

χrAf (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 tothe set of domains A = An1≤n≤N ⊆ R and a set of scalars r = rn1≤n≤N , ifthe following limit exists:

∃limh→0

χrA [f (x+ h)− f (x)] .

16

Page 17: A Simple Approach To Calculus

Example. Any detachable function is generalized-detachable with respect toA = 0

⋃(−∞, 0)

⋃(0,∞), and the set of scalars 0,−1,+1.

Definition. The generalized detachment operator. Given a left or rightgeneralized detachable function f : R → R with respect to a set of domainsA = An1≤n≤N ⊆ R and a set of scalars r = rn1≤n≤N , we will dene theleft or right generalized detachment operators applied for f with respect to Aand r as:

f;(A,r)± : R→ r

f;(A,r)± (x) ≡ lim

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

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

17

Page 18: A Simple Approach To Calculus

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 bea point there. We will say that f is null disdetachable there if it is detachablefrom 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 partiallimit exist:

∃limsuph→0

sgn [(f (x+ h)− f (x))] .

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, 0supf ;± (x) ≡ limsup

h→0±sgn [(f (x+ h)− f (x))] .

Definition. Lower detachable function. Given a function f : R −→ R, wewill say that it is lower detachable in a point x ∈ R, if the following partial limitexist:

∃liminfh→0

sgn [(f (x+ h)− f (x))] .

Definition. The lower detachment operator. Given a function f : R → R(not necessarily lower detachable), we will dene the lower detachment operatorsapplied for f from right or left, as:

inff ;± : R→ +1,−1, 0inff ;± (x) ≡ liminf

h→0±sgn [(f (x+ h)− f (x))] .

Examples.

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

18

Page 19: A Simple Approach To Calculus

2. Dirichlet's function:

f : R→0, 1

f (x) =

1, x ∈ Q0, x/∈ Q,

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

supf ; (x) =

0, x ∈ Q+1, x/∈ Q,

inff ; (x) =

−1, x ∈ Q0, x/∈ Q.

Remark. In order for a function f : R −→ R to be detachable in a pointx ∈ R, is should satisfy the equalities: supf ;+ (x) = inff ;+ (x) = supf ;− (x) =inff ;− (x). In order for it to be signposted detachable in the point, it shouldsatisfy that: supf ;+ (x) = inff ;+ (x) , supf ;− (x) = inff ;− (x) and supf ;+ (x) =−supf ;− (x) (and inff ;+ (x) = −inff ;− (x)). In other words, there are 6 causesfor disdetachment in a point. Hence the following denition of calssication ofdisdetachment 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:

inff ;+ (x) 6= −inff ;− (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:

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

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

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

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

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

19

Page 20: A Simple Approach To Calculus

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

Examples.

1. Let us consider the following function:

f : [0, 2]→ R

f (x) =

1, 0 ≤ x < 1

2, 1 ≤ x ≤ 2.

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

2. Let us consider the following function:

f : R→ R

f (x) =

x2sin

(1x

), x 6= 0

0, x = 0.

Then x = 0 is a rst, second, fth and sixth type disdetachment point off .

Defintion. Tendency indicator vector of a function. Let f : R → R be afunction, and let x ∈ R be a point. Denote by ω± (x) the set of partial limits ofthe term sgn [f (x+ h)− f (x)], where h→ 0± respectively. Then the tendencyindicator 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:

χx (X) =

1, x ∈ X0, x /∈ X

, r (i) =

−1, 1 ≤ i ≤ 3

+1, 4 ≤ i ≤ 6, s (i) =

+1, i = 1, 4

0, i = 2, 5

−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 tendencyindicator vector is (1, 0, 0, 1, 0, 0).

2. Let us consider the function:

f (x) =

x2sin

(1x

), x 6= 0

0, x = 0.

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

20

Page 21: A Simple Approach To Calculus

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

Remark. The aim of the algorithm found in 1 is to determine the type ofthe disdetachment of a function f : R → R in a point x. A Matlab code ofthe algorithm is available in the appendix. The output of the Matlab code isdepicted in gure 6.

7 Analysis of the weather vane function

Definition. Elaborated function. Let D be a domain and let DnNn=1 be

pairwise disjoint sub-domains ofD such thatD =⋃

1≤n≤NDn. Let fn : Dn → RNn=1

be a set of functions. Then we shall dene the elaborated function of them by:⊎n

fn : D → R⊎n

fn (x) ≡ fn (x) , x ∈ Dn.

Definition. Weather vane function. The following function's aim is toillustrate the relationships between the detachment operators. Let us consider

21

Page 22: A Simple Approach To Calculus

Algorithm 1 Classication of disdetachment points

Given a function f : R → R, a point x and the tendency indicator vector of fin the point x, ~s = ~s (f, x), do:

1. Extract supf ;+ (x) , inff ;+ (x) , supf ;− (x) , inff ;− (x) via the entries of thevector ~s, in the following manner (sup ts min and inf ts max, due tothe nature of the denition of the vector ~s):

supf ;+ (x) = ϕ

(argmin

i

s+i : s+i = 1

)inff ;+ (x) = ϕ

(argmax

i

s+i : s+i = 1

)supf ;− (x) = ϕ

(argmin

i

s−i : s−i = 1

)inff ;− (x) = ϕ

(argmax

i

s+i : s+i = 1

),

where ϕ is a function dened as follows:

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

ϕ (n) =

+1, n ∈ 1, 4−1, n ∈ 3, 60, n ∈ 2, 5 .

2. If supf ;+ (x) 6= −supf ;− (x) classify f as having a rst type disdetachmentin x.

3. If inff ;+ (x) 6= −inff ;− (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 disdetachmentin x.

5. If inff ;+ (x) 6= inff ;− (x) classify f as having a fourth type disdetachmentin x.

6. If supf ;+ (x) 6= inff ;+ (x) classify f as having a fth type disdetachmentin x.

7. If supf ;− (x) 6= inff ;− (x) classify f as having a sixth type disdetachmentin x.

22

Page 23: A Simple Approach To Calculus

Figure 6: Classication of disdetachment points as a function of the tendencyindicator 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 signposteddetachment.

23

Page 24: A Simple Approach To Calculus

six functions,f (i) : R→ R

6i=1

, dened in the following manner:

f (1) (x) = f (6) (x) = −xf (3) (x) = f (4) (x) = +x

f (2) (x) = f (5) (x) = 0.

Let us dene:

D±1 = R±, D±2 =√

2Q±, D±3 =√

3Q±,D±4 = R±\

√2Q, D±5 = R±\

(√2Q⋃√

3Q), D±6 = Ø.

Let −→v = (v1, . . . , v6) ∈ 0, 16 be a vector whose at least one of the rstthree elements and at least one of last three elements is 1. Thus, there are26 − 1− 2 ·

(23 − 1

)= 49 options to select −→v .

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

R+ =⋃

1≤i≤3

D+k~v(i)

R− =⋃

4≤i≤6

D−k~v(i),

where D±k(i) are pairwise disjoint, and:

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

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

−→D (vi) ≡ Dr(i)

k(i),

where r (i) =

−1, 1 ≤ i ≤ 3

+1, 4 ≤ i ≤ 6. Then the weather vane function is dened thus:

> (x,−→v ) ≡⊎i

f (i)|−→D(vi)

.

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

Page 25: A Simple Approach To Calculus

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

Page 26: A Simple Approach To Calculus

• If s2 + s5 = 1 (mod2) then > can be upper or lower detachable. Forexample 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 upperdetachable, but not detachable from any other kind. (2 · 24 = 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 detachableand not detachable. (2 cases).

• If s1 = s3 = s4 = s6 = 1 (and s2 = s5 = 0), then > is not detachable norsignposted detachable. However, it is both upper and lower detachable.(1case).

Notice the similarity between this denition of the tendency indicator vector ofa function and the weather vane function. It is easy to verify that for any −→vamongst 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, wewill say that f is tendable in a point x ∈ R if it is detachable from right andleft there.

Example. Let us consider the following function:

f : R→ 0, 1, 2

f (x) =

2, x ∈ Z1, x ∈ Q\Z0, 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

Page 27: A Simple Approach To Calculus

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 andright detachable in a.

Definition. Tendency in a point. Given function f : R→ R, if it is tendablein a point x ∈ R, then we will dene its tendency in the following manner:

τf : R→ +1,−1, 0

τf (x) ≡

0, 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 functionin an extremum is zero). Otherwise, if the function is not zero, the tendencypredicts 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 ifthere exists a constant β such that:

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

Examples.

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

2. Let us consider the function:

f : R→ Rf (x) = x2.

then the tendency of f is:

τf : R→ R

τf (x) =

−1, x < 0

0, x = 0

+1, x > 0

.

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

27

Page 28: A Simple Approach To Calculus

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

∧f : R→ 0,−1

∧f (x) ≡

0, ~s (f, x) ∈ (1, 0, 0, 1, 0, 0) , (0, 0, 1, 0, 0, 1) , (0, 1, 0, 0, 1, 0)−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 anyfunction.

Note. Let f : R → R be a function. Then it is clear from the denitionthat ∧f (x) = 0⇐⇒ x is an extremum. Hence the extrema indicator can pointout extrema for any function, contrary to the derivative, which is limited todierentiable functions.

8.2 Geometric interpretation of the tendency

Definition. An interval. Given two points x1 6= x2 ∈ R, The interval thatthey 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 intervalsin a point x by:

I+f (x) =[x, x− f ;+ (x) · h

]I−f (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], wewill dene the vertices' (x1, x2) signs thus:

sgn[x1,x2] (xi) =

+1, xi > x2−i

−1, xi < x2−i, i = 1, 2

Claim. Given a function f : X → R (where X ⊆ R), which is tendable in apoint x ∈ R, it holds that:

τf (x) =∑

s∈±1 and f;s(x)=f

;+

(x)

sgnIsf (x) (x) .

28

Page 29: A Simple Approach To Calculus

Figure 8: The correlation between the tendency in a point, and the sign ofthat point as a vertice in the interval. The ± signs in the extremum deducteachother, 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:∑s∈±1 and f;

s(x)=f;+

(x)

sgnIsf (x) (x) = sgnI+f (x) (x)+sgnI−f (x) (x) = +1+(−1) = 0 = τf (x) .

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

∑s∈±1 and f;

s(x)=f;+

(x)

sgnIsf (x) (x) = sgnI+f (x) (x) =

+1, f is increasing in x

−1, f is decreasing in x

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

Remark. Clearly the above claim states the geometric connection betweenthe tendency of a function and its intervals in a point, in a similar manner thatthe derivative is the slope of the tangent to a function in a point. The aboveclaim 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

Page 30: A Simple Approach To Calculus

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

f : (0, 1)→ R

f (x) =

1x , x ∈ Q− 1x , 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 functionthat is detachable from right and not detachable from left consists of two pieces(in this example, the pieces are 1

x and − 1x ). 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 = Ai1≤i≤3 , r = ri1≤i≤3.Then one can think of a function which is discontinuous in any point, and yetgeneralized detachable in the above sense, for example:

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

f (x) =

− ε

3 , x ∈ Z0, 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 functionswith as many pieces as desired, which are discontinuous anywhere and yetgeneralized 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 thatpoint where the function is monotoneous. Followed is a counter example:

f : (−1, 1)→ R

f (x) =

sin(1x

), x 6= 0

17, x = 0.

30

Page 31: A Simple Approach To Calculus

Then f is tendable in (−1, 1), however due to its discontinuity in x = 0, theexistence of an interval where f is monotonous is not guaranteed, and indeedthere 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 andright neighborhoods of that point where the function is monotoneous. Followedis a counter example:

f : (−1, 1)→ R

f (x) =

xsin

(1x

)− x, x 6= 0

0, x = 0.

Then f is tendable in (−1, 1), further it is continuous there, however there doesnot 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 dierentiableeverywhere but not monotonous anywhere, and whose derivative is zeroed onlyin 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 istendable there. Further, from the denition of the tendency, it is clear that inits extrema points a function is detachable and especially tendable. Hence thesefunctions form a counter example to the quoted claim, since they are everywherecontinuous and tendable, and nowhere monotonous.

10.2 Detachment

Definition. Step function. We will say that a fucntion f : R → R is a stepfunction if there exist a sequence of disjoint intervals Ak with

⋃k

Ak = R, and

a sequence of scalars rk such that:

f (x) =∑k

rk · χAk (x) ,

where χAk is the indicator function of Ak.

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

31

Page 32: A Simple Approach To Calculus

and similarly denote mn the set of all points in the interval where f recieves alocal minimum. ClearlyMn

⋂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:

[a, b] =⋃n∈N

[mn

⋃Mn

],

hencef ([a, b]) =

⋃n∈N

[f (mn)

⋃f (Mn)

].

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.Let y ∈ f (mn) . Let Dy be a 1

2n -neighborhood of f−1 (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:

|xy − x| <1

2n, |xz − x| <

1

2n.

Hence, |xy − xz| < 1n . 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-ing the choice of 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 stepfunction, according to the denition.

Remarks.

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

f : [0, 2]→ R

f (x) =

0, 0 < x < 1

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. Forexample, consider the function:

f : [0, 2]→ R

f (x) =

0, 0 < x < 1

2, x = 1

1, 1 < x < 2.

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

32

Page 33: A Simple Approach To Calculus

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

10.3 Signposted Detachment

Lemma. (Kaplan). If a function f : R → R is signposted detachable in aninterval (a, b) and its signposted detachment is constant there then f is striclymonotonous there.Proof. If f~; ≡ 0 in the interval then so is f ;, and we've shown that in thiscase, f is constant in the interval. Without loss of generality, let us assume thatf~; ≡ +1 in the interval. Let x1, x2 ∈ (a, b) such that x1 < x2. We would like toshow 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 inthat 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 inthe 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 isnot accepted. Especially it implies that s 6= x1. Therefore according to thedenition 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 (whichimplies 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 thatf~; (x) 6= f~; (y) . Let us distinguish two main cases, where the rest of the casesare handled similarly:

1. f~; (x) = +1, f~; (y) = −1. That is, f ;− (y) = f ;+ (x) = +1, hence argmaxt∈[x,y]

f (t) /∈

x, y. f is continuous in [x, y], hence there exists t ∈ (x, y) where f re-ceives its maximum, hence f is detachable, and not signposted detachablein 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

Page 34: A Simple Approach To Calculus

If s = −∞ then f is constant in [x, y] , hence f ;+ (x) = 0, hence f is eithernot 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 wheref (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 signposteddetachable, 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 everywhereby 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 issignposted 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

f (x) =

x, 0 ≤ x ≤ 1

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 necessarilybounded there. Consider the following function:

f : [−1, 1]→ R

f (x) =

n, x = 1

n , n ∈ Z\ 0−1, x = 0

0, otherwise.

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

34

Page 35: A Simple Approach To Calculus

Figure 9: The derivative has an advantage over the detachment: it is a linearoperator. However, in the era of computers, eciency is not less important.The detachment asks the question: "Function, are you increasing, decreasingor constant?", while the derivative uses the information about the tangent toanswer that question. Hence the detachment is more computationally ecientin determining the monotonic behavior of a function. Generalizations of thedetachment, such as lim

h→0Q [f (x+ h)− f (x)], where Q is a quantization func-

tion, can give more information regarding the behavior of the function in theneighborhood of a point with respect to the regular detachment; the eciencyis hardly harmed in the generalization process, since the values that Q gets isnite, 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 notnecessarily bounded there. Consider the following function:

f : (0, π)→ R

f (x) =

tan (x) , x 6= π

2

0, x = π2 .

Then f is signposted detachable in (0, π) but not bounded in a neighborhoodof x = π

2 .

12 Dierentiability and the detachment

12.1 Joint points

Note. While the derivates are dened for any function, they hold too muchinformation with respect to a function's monotony, hence they are not alwayssucient to analyze the extrema points of a function in a pointwise manner. For

35

Page 36: A Simple Approach To Calculus

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 isnot an extremum, and the function g (x) = x2 satises D±f (0) = D±f (0) = 0while x = 0 is indeed an extremum. On the other hand, the tendency indicatorvector gives precisely the amount of information needed to decide whether apoint is an extremum.

Definition. Joint point. Given a function f : R → R, we will say thatx0 ∈ X is a joint point of f if f is continuous, tendable, and not dierentiablein x0.

Definition. First type joint point. Given a function f : R → R, we willsay that x0 ∈ X is a rst type joint point of f if x0 is a joint point of f , andf ;+ (x0) = f ;− (x0) .

Definition. Second type joint point. Given a function f : R → R, wewill 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, wewill 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→ Rf (x) = |x|

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

36

Page 37: A Simple Approach To Calculus

2. Consider the function:

f : [0, 2]→ R

f (x) =

x, 0 ≤ x < 1

2x− 1, 1 ≤ x < 2.

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

3. Consider the function:

f : [0, 2]→ R

f (x) =

1, 0 ≤ x < 1

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 tendableeverywhere. For example consider the following functions:

f : [−1, 1]→ R

f (x) =

sin(1x

), x 6= 0

17, otherwise

and:

g : [−1, 1]→ R

g (x) =

x2sin

(1x

), x 6= 0

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 itsderivates in a point x0 ∈ R as the following four quantities (as dened in [13],

37

Page 38: A Simple Approach To Calculus

p. 99):

D+f (x0) = limh→0+

f(x0+h)−f(x0)h

D−f (x0) = limh→0+

f(x0)−f(x0−h)h

D+f (x0) = limh→0+

f(x0+h)−f(x0)h

D−f (x0) = limh→0+

f(x0)−f(x0−h)h

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 therest of the claims is shown similarly. Suppose D+f (x) = L < 0. Thus:

∃δ : x0 < x < x0 + δ =⇒ f (x)− f (x0)

x− x0≤ L < 0.

Especially, it implies that there exists a right neighborhood of x0 where for each

x it holds that f(x)−f(x0)x−x0

< 0. Since it is a right neighborhood, x0 < x, hence

sgn [f (x)− f (x0)] = −1, hence f ;+ (x0) = −1.

Corollary. Let f : R → R be a function and let x0 ∈ R. If f′

± (x0) 6= 0

then f ;± = ±sgn(f′

± (x0)).

Proof. We show that f′

+ (x0) > 0 implies f ;+ (x0) = +1. Indeed, the condition

f′

+ (x0) > 0 impliesD+f (x0) > 0, hence by the previous claim f ;+ (x0) = +1.

Corollary. If f : R → R is dierentiable in x0 ∈ R and f ′ (x0) 6= 0then f is signposted detachable in x0 and τf (x0) = f~; (x0) = sgn (f ′ (x0)).Proof. We show the correctness of the claim for f ′ (x0) > 0. It follows fromthe 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 areclosed under multiplication by a scalar.

38

Page 39: A Simple Approach To Calculus

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

f : [−1, 1]→ R

f (x) =

−1, x = 0

n, x = 1n , n ∈ Z

0, otherwise,

and:

g : [−1, 1]→ R

g (x) =

+1, x = 0

0, otherwise.

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

f + g : [−1, 1]→ R

(f + g) (x) =

n, x = 1

n , n ∈ Z0, otherwise

is not tendable in x = 0.

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

f : [−1, 1]→ R

f (x) =

x2sin

(1x

)− x2, x 6= 0

0, x = 0,

and:

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

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

f + g : [−1, 1]→ R

(f + g) (x) =

x2sin

(1x

), x 6= 0

0, x = 0

is not tendable in x = 0.

39

Page 40: A Simple Approach To Calculus

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

h→0±sgn [cf ] (x+ h)− [cf ] (x) =

= limh→0±

sgn c [f (x+ h)− f (x)] = sgn (c) f ;±.

Definition. Pointwise-incremented function. Let f : R → R be a func-tion. We will bened its a-incremented function, where a ∈ R, in the followingmanner:

f (a) : R→ R

f (a) (x) =

f (x) + f (a) , x 6= a

f (a) , x = a.

Claim. Let f, g : R→ R be functions. Set x ∈ R. Then f (x), g(x) are tendablei so is (fg)

(x), and:[

(fg)(x)];±

(x) =(f (x)

);±

(x) ·(g(x)

);±

(x) .

Proof.(f (x)

);±

(x) ·(g(x)

);±

(x) = limh→0±

sgn[f (x) (x+ h)− f (x) (x)

]· limh→0±

sgn[g(x) (x+ h)− g(x) (x)

]= lim

h→0±sgn [f (x+ h) + f (x)− f (x)] · lim

h→0±sgn [g (x+ h) + g (x)− g (x)]

= limh→0±

sgn [f (x+ h) · g (x+ h)] = limh→0±

sgn [(fg) (x+ h) + (fg) (x)− (fg) (x)]

= limh→0±

sgn[(fg)

(x)(x+ h)− (fg)

(x)(x)]

=[(fg)

(x)];±

(x0) .

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

(fn)(x)];±

(x) =[(f (x)

)n];±

(x) .

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

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

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

40

Page 41: A Simple Approach To Calculus

Proof.

f ;+ (−x) = limh→0+

sgn [f (−x+ h)− f (−x)] = limh→0+

sgn [f (x− h)− f (x)]

= limh→0−

sgn [f (x+ h)− f (x)] = f ;− (x) ,

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) = − limh→0−

sgn [f (−x+ h)− f (−x)] = − limh→0−

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

= limh→0−

sgn [f (x− h)− f (x)] = limh→0+

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

= 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 isconstant.Proof. If f is even, then according to the rst lemma above it holds thatf ; (x) = f ; (−x), hence f ; is even. If f is odd, then according to the secondlemma, for each x it holds that: f ;+ (x) = −f ;+ (x). Hence f ; (x) ≡ 0, and f isconstant, and especially odd.

Note. If a signposted detachable function f is even, then its signposteddetachment 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 thefunction is detachable in x0, and:

τf (x0) = 0.

Proof. Without loss of generality, let us assume that x0 is a maximum. Thenthere exists a neighborhood of x0,namely Iδ (x0) , where f (x) < f (x0) for eachx ∈ 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, itimplies 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. Supposethat f satises the following:

41

Page 42: A Simple Approach To Calculus

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 ,then since it is given that f (a) = f (b), then one of the values m or M must bean image of one of the points in the open interval (a, b) . Let c ∈ f−1 (m,M).Since f receives an extremum in c, then f is detachable there according to thedenition of detachment, and especially, τf (c) = 0. In case m = M , then f isconstant 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

f (x) =

0, 0 ≤ x < 1

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 pointcv ∈ 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 f (a) < f (b) . Let v ∈ (f (a) , f (b)).Since f is continuous, then Cauchy's intermediate theorem assures that f−1 (v) 6=∅. On the contrary, let us assume that f ;+ (x) = −1 for each x ∈ f−1 (v) . Letxmax = sup f−1 (v) . The maximum is accepted since f is continuous, hencef (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 fis continuous in [t, b] , thus according to Cauchy's intermediate theorem, thereexists a point s ∈ [t, b] for which f (s) = v, which contradicts the choice of xmax.In the same manner it impossible that f ;+ (x) = 0 for each point x ∈ f−1 (v) ,because then the same contradiction will rise from f ;+ (xmax) = +1. Hence,S = f−1 (v)

⋂x|f ;+ (x) = +1

6= ∅. Now we will show that S must contain a

42

Page 43: A Simple Approach To Calculus

point x for which f ;− (x) 6= +1. Let us observe xmin = infS. We will now showthat 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 sequenceof points xn xmin, such that xn ∈ S for all n. Especially, f (xn) = v, hencef ;+ (xmin) = 0 (otherwise, f would not be right detachable, and especially, wouldnot 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 contradictsthe denition of xmin as an inmum of a set whose points' right detachmentis +1. Hence xmin = min (S) , which implies that f ;+ (xmin) = +1. On thecontrary, suppose that f ;− (xmin) = +1. Then especially there exists t < xminwith v = f (xmin) < f (t). But f is continuous in [a, t] , and f (a) < f (t) = v,hence according to Cauchy's intermediate theorem, f−1 (v)

⋂(a, t) 6= ∅. Let us

observe s = max[f−1 (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 vthere exists cv where:

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

Consider the function:

f : [0, 2]→ R

f (x) =

x, 0 ≤ x ≤ 1

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 neighborhoodof the point x0 ∈ R, denoted by Iδ (x0). If x0 is a local maximum or a localminimum 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 iscontinuous in [t−, x0] and tendable in (t−, x0) , hence according to the analogousversion to Lagrange's theorem, for each value v− ∈ (f (t−) , f (x0)) there exists apoint cv− ∈ f−1 (v−)

⋂(t−, x0) that satises τf (cv−) = sgn [f (x0)− f (t−)] =

+1. Hence there are uncountably many points in that neighborhood where thetendency of f is +1. Similarly, there exist uncountably many points in theright neighborhood of x0 where the tendency of f is −1. Further, since x0 is a

43

Page 44: A Simple Approach To Calculus

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), thenfor 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 suchpoint, highlighted with yellow. Notice that although t1, t2, t3 ∈ f−1 (v) ,none of them satises the theorem's conditions, since τf (t1) = τf (t3) = 0and τf (t2) = −1, while sgn [f (b)− f (a)] = +1.

44

Page 45: A Simple Approach To Calculus

maximum, then f ; (x0) = −1, and especially f ;+ (x0) = f ;− (x0), which impliesthat τ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

f (x) =

0, x 6= 1

1, x = 1.

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

13.8 An analogous version to the Fundamental Theoremof Calculus

Definition. Antiderivative. Let f : R→ R be an integrable function. Thenits antiderivative is dened as follows:

F : R→ R

F (x) =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

Fp (x) =x

p

f (t) dt.

Definition. Extended local antiderivative. Let f : R → R be an integrablefunction, and let p ∈ R

⋃−∞. Then its local antiderivative is dened as

follows:

Fp : R→ R

Fp (x) =x

p

f (t) dt.

Theorem. Let f : R → R be an integrable function, and let Fp be itsextended local antiderivative, where p ∈ R

⋃−∞. Let x0 ∈ R. Suppose that

the pointwise incremented function f (x0) is tendable in x0. Then Fp is tendablein x0, and:

(Fp);± (x0) =

(f (x0)

);±

(x0) ,

where f (x0) is the pointwise incremented function of f dened earlier. In simplewords, the theorem's statement is that the antiderivative's detachment from

45

Page 46: A Simple Approach To Calculus

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

(f (x0)

);+

(x0) = +1, and

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: (

f (x0));+

(x0) = limh→0+

sgn[f (x0) (x0 + h)− f (x0) (x0)

]= lim

h→0+sgn [f (x0 + h) + f (x0)− f (x0)]

= limh→0+

sgn [f (x0 + h)] .

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 eachx ∈ Iδ (x0):

x

x0

f (t) dt > 0 =⇒x

p

f (t) dt−x0

p

f (t) dt > 0 =⇒ Fp (x) > Fp (x0) ,

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

46

Page 47: A Simple Approach To Calculus

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

47

Page 48: A Simple Approach To Calculus

Figure 13: The functions' denition for gure 12.

48

Page 49: A Simple Approach To Calculus

Part IV

Computational Cost Related

Discussion

In this part the author suggests a rigorous discussion regarding the eciency ofapplying 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 sequenceann∈N, we will say that it has an approximated partial limit P , if there existsa randomly chosen sub-sequence of ann∈N, namely ankk∈N, for which thereexist 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 allKmin < k < Kmax it holds that:

|ank − P | <1

m.

We will denote the set of approximated partial limits by p ˜liman. Hence in thediscussed case:

P ∈ p ˜liman.

Examples.

1. Let an = (−1)n, n ∈ N. Then ˜pliman = ±1, while the set of partial

limits of an is ±1.

2. Let:

an =

17, n < 10100

(−1)n, n ≥ 10100.

Then p ˜liman = 17,±1, although the set of partial limits of an is ±1.

3. Let an = 1n . Then p

˜liman =⋃

Mmax1

1

Mmax

, although the limit of an is

0.

Conjecture. The set of all sequences

a(ω)n

n∈N

ω

for which the set

p ˜lima(ω)n does not intersect the set of partial limits of

a(ω)n

n∈N

is a negligible

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

Page 50: A Simple Approach To Calculus

process.

Definition. Approximation of a partial limit of a function. Given a functionf : R→ R, we will say that it has an approximated partial limit P in a point

x0 ∈ R, if there exists a random sequence, xnn∈N that satises x(k)n → x0,

such that:P ∈ p ˜limf (xn) .

We will then denote:P ∈ p ˜lim

x→x0

f (x) .

Remark. In order to approximate the limit of a sequence (rather than just itspartial limit), or the limit of a function , one may sample S 1 sub-sequencesand approximate the partial limits for each of them.

15 Computational cost

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

Υc (♣ (r)) .

Definition. Computational cost of boolean expressions. Given a booleanoperator ♣, 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 timerequired for the computer to evaluate the exoression r1♣r2, assuming that thecomputer'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 ofsingular or boolean opertors ♣n1≤n≤N , a computer c, and a set of numbersr1, . . . , rn+1we will dene the computational cost of the assembled expression,r1♣1r2♣3 · · · ♣nrn+1 in a recursive manner as:

Υc (r1♣1r2♣3 · · · ♣nrn+1) ≡ Υc (r1♣1r2♣3 · · · ♣n−1rn) + Υc

(r′n−1♣rn

),

where r′n−1 is the value of the expression r1♣1r2♣3 · · · ♣n−1rn.

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

50

Page 51: A Simple Approach To Calculus

the evaluation of singular expressions. Although the sgn (·) operator can beinterprated 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. Thecomputer may only check the sign bit of the already evaluated expression r (ifsuch a bit is allocated). Especially, for any computer c, for the ” ÷ ” operatorand for any numbers r, r′, it holds that:

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

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 cbe a computer, and let ann∈N be a sequence. Say we wish to evaluate thecomputational cost of the approximation of one of the partial limits of thesequence. Let us assume that we have guessed a partial limit P , sampled arandom sequence of indexes nkk∈N, and also guessedMmin,Mmax in thelimit approximation process, along with guesses for Kmin (m) ,Kmax (m)for eachMmin < m < Mmax. Hence, we should evalute the logical expres-

sion |ank − P |?< 1

m for all possible values of k,m in the domain. Thus,the computational cost of that process would be:

Υc

(P

?∈ p ˜liman

)=

∑Mmin<m<Mmax

∑Nmin<nk<Nmax

Υc

(|ank − P |

?< 1

m

)and each addened can be written as:

Υc (ank) + Υc (r1 − P ) + Υc (|r2|) + Υc

(1

m

)+ Υc

(r3

?< r4

)where r1 = ank , r2 = ank − P, r3 = |an − P | and r4 = 1

m .

2. Computational cost of approximating a partial limit of a function in apoint. 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 ofa partial limit of f in x0. Let us assume that we have guessed the partiallimit, P . Say we already sampled a sequence xnn∈N such that xn → x0.Thus, the computational cost of that process would be

Υc

(P

?∈ p ˜lim

x→x0

f (x)

)= Υc

(P

?∈ p ˜limf (xn)

),

where the right side term is evaluated via paragraph 1.

51

Page 52: A Simple Approach To Calculus

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

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

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

1. The set of limits the computer needs to guess from. Let us assume that asophisticated pre-processing algorithm managed to reduce the suspectedvalues of the derivative (all of which one should verify in the denition ofthe 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 morepartial limits - namely 6 - to calculate); however, they are all calculatedparallely (the computer program may choose the same sequences used toapproximate the derivative, and summarize the approximated partial lim-its of the upper and lower left and right detachments there). Further, theset of candidate partial limits for the extremum indicator is nite and verysmall: 0,±1.

2. The calculated term inside the limit. Notice that the dierence betweenthe derivative and the detachment is the ÷ operator vs. the sgn operator.As we mentioned earlier,

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

and this is for any r, r′. Hence the computational cost of any of theexpressions inside the limit is cheaper for the detachment (hence for theextremum indicator) than the for the derivative.

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

52

Page 53: A Simple Approach To Calculus

Part V

The discrete Green's theorem in a

non-discrete domain

From now on we will focus our discussion on R2, although natural generalizationscan 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→ RF (x1, x2) ≡

´B

fdλ,

where B ≡2∏i=1

(−∞, xi) .

Definition. Local antiderivative. Let f : R2→ R be a Lebesgue-integrablefunction. Then its local antiderivative initialized at the point p = (p1, p2) isdened as follows:

Fp :2∏i=1

[pi,∞)→ R

Fp (x1, x2) ≡´Bp

fdλ,

where B ≡2∏i=1

(pi, xi) .

Definition. Generalized rectangular domain. A generalized rectangulardomain D ⊂ R2 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 ≤ 1be a curve, where x, y : [0, 1]→ R. It will be said to be tendable if the functionsthat 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

Page 54: A Simple Approach To Calculus

(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:

~s (C, t0) : C → +1,−1, 04

~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 onthe 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 pointon the curve. We will say that z is an edge point of the curve C if the function~s (C, ·) is continuous in t0.

Definition. A quadrant in R2. Let x ∈ R2, and let v ∈ +1,−12. Then thequardant associated with v is the set:

Ov ≡

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

Definition. A partial quadrant in R2. Let x ∈ R2, let v ∈ +1,−12 and

u ∈ (R+)2. 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.

Definition. A quadrant of a point in R2. Let x ∈ R2, and let v ∈ +1,−12.Then we will dene the quardant of the given point which is associated with vin 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 letv ∈ +1,−12 and u ∈ (R+)

2. 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

Page 55: A Simple Approach To Calculus

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

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

Definition. A slanted edge point of a tendable curve. Given a tendablecurve, C = γ (t) , 0 ≤ t ≤ 1, we will say that the edge point γ (t0) is a slantededge point of the curve if the curve is not perpendicular to one of the axes in aneighborhood of γ (t0) . An illustration to perpendicular edge points is given ingure 14.

55

Page 56: A Simple Approach To Calculus

Figure 15: An illustration to slanted edges points, with their associated tendencyindicator vector.

16.3 Classication of corners according to the tendencyindicator vector

Definition. A perependicular corner of a tendable curve. Given a tendablecurve, 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 leftand right neighborhood of γ (t0) respectively. An illustration to perpendicularcorners 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 thecurve 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

Page 57: A Simple Approach To Calculus

Figure 16: An illustration to slanted edges points, with their associated tendencyindicator vector.

are contained in the same quadrant of the point γ (t0). An illustration to slantedcorners 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 thecurve 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 curveswitchs quardants in the point). An illustration to abtuse corners is given ingure 17.

57

Page 58: A Simple Approach To Calculus

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

58

Page 59: A Simple Approach To Calculus

Figure 18: An illustration to acute corners for a curve whose orientation ispositive, 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 ofthe curve if the curve has only slanted edge points in either a left or right smallenough neighborhood of γ (t0) , and only a perpendicular edge points in a smallenough neighborhood in the other side of γ (t0); further, all the curve's pointsin 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 betweenthe tangents is acute in such a point). An illustration to slanted corners is givenin 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 cornerof the curve has only slanted edge points in either a left or right small enough

59

Page 60: A Simple Approach To Calculus

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

neighborhood of γ (t0) , and only perpendicular edge points in a small enoughneighborhood in the other side of γ (t0); further, the curve's points in theseneighborhoods are contained in dierent quadrants of the point γ (t0). (Henceits name: if the curve is also dierentiable there, then the angle between thetangents would be obtuse in such a point). An illustration to abtuse corners isgiven 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 willdene its maximum in absolute value as the element in A whose absolute valueis the biggest. It will be denoted as |max| A .

60

Page 61: A Simple Approach To Calculus

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 thepoint 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 atthe 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 atendency of zero.

• The tendency in slanted edge points and in slanted corners is determinedaccording 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 anda slanted corner.

• The tendency in perpendicular corners in a negatively oriented curve isdetermined 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 orientedcurve, −1 for a negatively oriented curve).

• The tendency in obtuse corners in a positively oriented curve and in acutecorners 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 holdsthat the tendency of the curve is a constant β for each point on the curve apartperhaps 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. Left hand side of a curve. Let C = γ (t) be a curve. Let C bea 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 oftwo sides of this loop. We will dene the left hand side of C with respect to Cas the interior of the loop C

⋃C.

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

61

Page 62: A Simple Approach To Calculus

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

62

Page 63: A Simple Approach To Calculus

Figure 21: An illustration to the term quadrant vectors of a point on a curve.Notice that the point z1 has only one vector v whose partial quadrants are fullycontained in a left hand side of C1, hence: QV (C1, z1) = (−1,−1), and thatthe point z2 has two vectors v1, v2 whose partial quadrants are fully containedin 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 positivelyor negatively oriented), we will dene the quadrant vectors of the point z ∈ Con the curve as the set:

QV (z, C) ≡ v| ∃u : Ov,u (z) is fully contained in a left hand side of C ,

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

Definition. Product of a vector in R2. Let v = (v1, v2) ∈ R2. We will denethe 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 ∈ Csatises:

τC (z) =∑

v∈QV (z,C)

π (v) ,

where if QV (z, C) = ∅ then we will dene∑vπ (v) = 0.

Proof. By inspecting all possible cases (the number of cases is bounded by

63

Page 64: A Simple Approach To Calculus

Figure 22: An illustration of quadrant vectors vs. tendency. Observe thatQV (z1, C1) = (+1,+1) , (−1,+1) , (−1,−1) , hence

∑v∈QV (z1,C1)

π (v) = 1− 1 +

1 = +1, and indeed the tendency in z1 is +1, since ~s (C1, z1) = (+1, 0, 0,−1)t.

Further, QV (z2, C2) = (+1,−1) , hence∑

v∈QV (z1,C1)

π (v) = −1, and indeed the

tendency in z2 is −1, since ~s (C2, z2) = (0,+1,−1, 0)t. Next, QV (z3, C3) =

(+1,+1) , (−1,+1) , hence∑

v∈QV (z1,C1)

π (v) = +1− 1 = 0, and indeed the ten-

dency in z3 is 0, since ~s (C3, z3) = (+1,−1, 0, 0)t- in fact, z3 is a perpendicular

edge point. Finally, QV (z4, C4) = ∅, hence∑

v∈QV (z1,C1)

π (v) = 0, and indeed the

tendency in z4 is 0, since ~s (C3, z3) = (−1,+1,−1,−1)t- in fact, z4 is a switch

corner.

the number of tendency indicator vectors, which is nite). An illustration isgiven in gure 22.

17 Slanted line integral

17.1 Denition of the slanted line integral

Lemma. Let C = γ (t) = (x (t) , y (t)) , 0 ≤ t ≤ 1 be a given tendable curve. Ifthe 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 verticesare 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 foreach 0 < t < 1 it holds that:

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

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

64

Page 65: A Simple Approach To Calculus

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:

γ+1 :

x (t) = ct+ a (1− t)y (t) = b

γ+2 :

x (t) = c

y (t) = dt+ b (1− t)

γ−1 :

x (t) = a

y (t) = dt+ b (1− t)

γ−2 :

x (t) = ct+ a (1− t)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

points. We will refer to γ+ (x, y) , γ− (x, y) as the positive and negativestraight paths of x, y, respectively.

Definition. Paths of a curve. Given a curve C = γ (t), Let us considerits end points, γ (0) , γ (1), and let us consider the straight paths between thepoints, γ+ and γ−, as suggested in a previous denition. We will dene thepaths 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 uniformlytended 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β) ≡ Csβ , ∂D− (Cβ) ≡ C−sβ ,

where Csβ , 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, andlet Cβ = γ (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

Page 66: A Simple Approach To Calculus

Figure 23: An illustration to the denition of the slanted line integral. Inthis example, the curve C has a highlighted curve, denoted by Cβ . This is auniformly tended curve, whose tendency is β = −1 (since the tendency indicatorvector on Cβ is (−1,+1,−1,+1)

tand according to the denition). Further,

the tendency in the subcurve's end points is β0 = −1 and β1 = −1 for thepoint γ (0) and γ (1) respectively. Hence according to the denition:

fflCβ

Fp =

´D+(Cβ)

fdλ+ Fp(γ+1 (1)

)− 1

2 [Fp (γ (1)) + Fp (γ (0))] .

function f : R2 −→ R which is Lebesgue-Integrable there. Let us consider itslocal antiderivative, Fp, where p ∈ R2. Then the slanted line integral of Fp onCβ is dened as follows:

Fp ≡ˆ

D+(Cβ)

fdλ− βFp (γs1 (1)) +1

2[β0Fp (γ (0)) + β1Fp (γ (1))] ,

where γs1 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 wassuggested by Wang et al.'s in [7].

66

Page 67: A Simple Approach To Calculus

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, off (x), then:

ˆ

D

f (x) dx =∑ν∈Bk

(−1)νT1

F (ν1u1 + ν1u1, . . . , νkuk + νkuk) ,

where ν = (ν1, . . . , νk)T, νT1 = ν1 + . . .+ νk, νi = 1− νi, and B = 0, 1 .

Lemma. (Additivity). Let C1 = C(1)β , C2 = C

(2)β two uniformly tended curves,

that satisfy:

∃!x ∈ R2 : x ∈ C(1)β

⋂C

(2)β ,

and let us also assume that both the curves share the same orientation s. Letus consider a function f : R2 −→ R which is Lebesgue-Integrable there. Let usconsider its local antiderivative, Fp, where p ∈ R2. Let us consider the curve

Cβ ≡ C(1)β

⋃C

(2)β . Let us denote the curves by C1 = γ1, C2 = γ2 and C = γ

accordingly. Then:

Fp =

C(1)β

Fp +

C(2)β

Fp.

Proof. First let us note that the proof is illustrated in gure 24. Withoutloss of generality, let us assume that C1

⋂C2 = γ1 (1) = γ2 (0). Let us denote

the paths of the curves C1, C2 and C by γs1,i, γs2,i and γsi accordingly, where

i ∈ 1, 2. According to the denition of the slanted line integral, we obtain:

fflC

Fp =

ˆ

D+(C)

fdλ− βFp (γs1 (1)) +1

2[β0Fp (γ (0)) + β1Fp (γ (1))]

fflC1

Fp =

ˆ

D+(C1)

fdλ− βFp(γs1,1 (1)

)+

1

2[β0Fp (γ1 (0)) + βFp (γ1 (1))]

fflC2

Fp =

ˆ

D+(C2)

fdλ− βFp(γs2,1 (1)

)+

1

2[βFp (γ2 (0)) + β1Fp (γ2 (1))] .

Now according to the generalization of the Fundamental Theorem of Calculus,it holds that:ˆ

D

fdλ =

ˆ

D1

fdλ+

ˆ

D2

fdλ+β

[Fp (γs1 (1)) + Fp (γs (1))]−[Fp(γs1,1 (1)

)+ Fp

(γs2,1 (1)

)].

Hence the statement's correctness.

67

Page 68: A Simple Approach To Calculus

Figure 24: An illustration to the proof of the additivity of the slanted lineintegral.

Definition. A division of a tendable curve. Let C = (x (t) , y (t)) , 0 ≤ t ≤ 1be a tendable curve in R2. Let t1, . . . , tn be the values of the curve's parameterfor which the curves dened by:

C(ω)β : tω−1 ≤ t ≤ tω

are uniformly tended subcurves of the given curve C. The setC

(ω)β

1≤ω≤n

is

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 curve in R2. Let us consider a tendable curve C =⋃ω

C(ω)β ⊂ R2, 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 itslocal antiderivative, Fp, where p ∈ R2. Then the slanted line integral of Fp onC is dened as follows:

C

Fp ≡∑ω

C(ω)β

Fpdλ.

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

Lemma. Let us consider a uniformly tended curve Cβ = γ (t) , 0 ≤ t ≤ 1whose oritentation is positive. Let us consider the curve −Cβ which consol-idates with Cβ apart from the fact that its orientation is negative. Let usconsider a function f : R2 −→ R which is Lebesgue-Integrable there. Let Fp be

68

Page 69: A Simple Approach To Calculus

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 indexamongst the other sub-curves.

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

−Cβ

Fp = −

Fp.

Proof. Since it holds that´

D+(Cβ)fdλ+

´D−(Cβ)

fdλ =´

D+(Cβ)⋃D−(Cβ)

fdλ, and

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

ˆ

D+(Cβ)⋃D−(Cβ)

fdλ = βF(γ+1 (1)

)+ F

(γ−1 (1)

)− [F (γ (1)) + F (γ (1))]

,

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

Corollary. Let us consider a tendable curve C = γ (t) , 0 ≤ t ≤ 1 whoseoritentation is constant. Let us consider the curve −C which consolidates withC 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-Integrablethere. Let Fp be its local antiderivative, where p ∈ R2. Then it holds that:

−C

Fp = −

C

Fp.

69

Page 70: A Simple Approach To Calculus

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

C0

F = 0

Proof. The integral of any function on the setD± (C0) is zero (since the curveconsolidates with its paths). Further, since β = 0, then corollary is derived fromthe 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.'swork, found in [7].

Theorem. (The Discrete Green's Theorem). Let D ⊂ Rn bea generalized rectangular domain, and let f be a Lebesgue-Integrable functionin Rn. Let Fp be the local antiderivative of f . Then:

ˆ

D

fdλ =∑x∈∇·D

αD (x)F (x) ,

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 ingure 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 orderto extend the above theorem to a non-discrete domain.

Theorem. (The Discrete Green's Theorem for a non-discretedomain). Let D ⊆ R2 be a given simply connected domain whose edge iscontinuous and tendable, and let f be a Lebesgue-Integrable function in R2.Let Fp be its local antiderivative, where p ∈ R2. Then, in the same terms thatwere introduced, it holds that:

ˆ

D

fdλ =

∂D

Fp.

70

Page 71: A Simple Approach To Calculus

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

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

BADC

Fp =

BA

Fp +

AD

Fp +

DC

Fp +

CB

Fp

=1

2[+Fp (B)− Fp (A)]

+1

2[+Fp (D)− Fp (A)]

+1

2[+Fp (D)− Fp (C)]

+1

2[+Fp (B)− Fp (C)]

= 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: Notethat while traversing upon the edge of the domain, the coecient of Fp taken tothe summation is determined according to the tendency in the corners, whereeach half is obtained via a one side of the corner. Considering all the possiblecases results with the consequence, that the claim for this type of domainsconsolidates with the discrete Green's theorem. This case is depicted in gure27.Now that we know the theorem's correctness for a GRD, let us prove it for asimply connected domain whose edge is continuous and tendable. We'll considera general domain D, and for an illustration we'll use the domain depicted ingure 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 thegiven 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 equalsthe integral of f on the area bounded between the GRD's edge and the domain,

71

Page 72: A Simple Approach To Calculus

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

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

∂D

Fp = −

−∂D

Fp = −

ˆ

GRD\D

fdλ−ˆ

GRD

fdλ

=

ˆ

GRD

fdλ−ˆ

GRD\D

fdλ =

ˆ

D

fdλ,

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 integralof f in the area between the GRD's edge and the domain's boundary. Further,let us skip the tendency coecient of 1

2 in the corners and relate directly to theaccumulated tendency from both sides of the corner.

• For a switch corner, the GRD's edge simply goes on (it has no cornerthere), 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 Ain gure 28. The same goes for perpendicular edge points - the GRD'sedge 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 theintegral of f in the positive partial domain of the curve, and also addsthe 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 weightts to the corner of the GRD's edge. Examples are shown in edgesNA,AB,BC,FG,HJ,KL,LM, and MN in gure 28.

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

72

Page 73: A Simple Approach To Calculus

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

• Acute or obtuse corners where the GRD's edge simply goes on (it has notcorner 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 theirtendency is as in the discrete Green's theorem. For example, points Dand E in gure 28.

• If along the curve there are two adjacent slanted corners, then it is shownvia 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-curvesLM,MN in gure 28. However, once again via observing all cases, it isshown 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 combinationof Fp. In the examle, the integral of f in the rectangle MM ′M ′′′M ′′ isdeducted via the accumulated linear combination:

Fp (M)− Fp (M ′′)− Fp (M ′) + Fp (M ′′′) = −ˆ

MM′M′′′M′′

fdλ,

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 theintegral over the rectangle, and the second one is used as the usual valueof 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 signsdeduct each other, as shown in point E in gure 28).

Notation. The slanted line integral of a function's local antiderivative Fpon a curve C (where p ∈ R2), calculated with a given rotation θ of the coordi-

nates system, will be denoted byfflC

θFp.

Corollary. Let C ⊆ R2 be a closed and tendable curve, and let f be aLebesgue-Integrable function in R2. Let Fp1 , Fp2 be two of its local antideriva-tives, where p ∈ R2, where Fp1

, Fp2are calculated with given rotations θ1, θ2

of the coordinates syestems. Then, in the same terms that were introduced, itholds that:

C

θ1

Fp1=

C

θ2

Fp2.

73

Page 74: A Simple Approach To Calculus

Figure 28: An illustration to the proof of the discrete Green's theorem for anon-discrete domain. The domain is colored in green, and its orientation isnegative. The bounding GRD is partially broken and partially consolidateswith the domain (as in the section DE). The corners of the GRD are coloredwith yellow. Let us classify the highlighted points on the green curve: A is aswitch 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,Nare all slanted corners.

74

Page 75: A Simple Approach To Calculus

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 containedinside the domain bounded by the curve. Note that the theorem's correctnessis independent of the choice of the division of the curve: this fact is visible viatwo dierent divisions of the curve, as shown above.

Proof. Since C is closed, it is the boundary of a simply connected domainD, hence according to the above theorem applied for dierent rotation anglesof the axes: ˆ

D

fdλ =

C

θ1

Fp1,

ˆ

D

fdλ =

C

θ2

Fp2.

Notation. According to the above corollary, the slanted line integral of aclosed curve in R2 is independent of the choice of the angle of the rotation of thecoordinates 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 theoremby: “

∂D

F =

ˆ

D

fdλ,

where›∂D

F ≡ffl∇·D

θFp for any choice of the coordinates system's rotation θ and

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

75

Page 76: A Simple Approach To Calculus

Figure 30: An illustration to the fact that the discrete green's theorem fora non-discrete domain is independent of the rotation angle of the coordinatesystem.

Figure 31: An illustration of the Line Integral for a squared curve, and anillustration to the Slanted Line Integral for a curve that bounds a GeneralizedSquared Domain (As was shown by Wang et al.'s in [7]). Note the bi-directionalrelationship between the Line integral and the Slanted Line integral, whosevisualization is intuitive: In the same manner that the Line Integral on the curvecan be calculated using canceled sums of the line integral inside the curve, socan the Slanted Line Integral on the curve be calculated using canceled sums ofthe Slanted Line Integral of the boxes inside the curve.

76

Page 77: A Simple Approach To Calculus

Part VI

Epilogue

19 Future work

The denition of the detachment enables future work in the following elds ofresearch:

• Discrete Geometry and Advanced Calculus, via further exploring theoremsthat rely on the detachment. Note that the discrete Green's theorem for anon-discrete domain and the denition of the Slanted Line Integral form adierent approach to Advanced Calculus, since it relies on discrete divisionof the domain bounded by a curve, rather than summing up the function'svalues on the curve as suggested by the familiar Line Integral.

• Elementary Calculus, via further exploring the suggested denition of thelimit process (which is depicted in the appendix), extensions to the de-nition of the detachment to other quantizations, and the establishment offurther 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 aremetric spaces and dX , dY are the induced measures respectively, one usu-

ally cannot talk about the derivative, since the term: limx→x0

dY (f(x),f(x0))dX(x,x0)

is not always dened (we can not know for sure that the fraction dX(·)dY (·) is

well dened). However, the term

limx→x0

Q [dY (f (x) , f (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 classicationof a discontinuity in a point. Theorems relying on this operator may beestablished.

• 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,

limx→x0

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

(where Q is a quantization function), to discover edges in the image, ratherthan use the gradient as in the current approcah. This can spare compu-tation time, as was suggested in part 4.

77

Page 78: A Simple Approach To Calculus

• 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 everywhereif and only if it is dierentiable almost everywhere? I couldn't prove ordisprove it. This conjecture is now open for further investigation, alongwith other Measure Theory related questions regarding the detachment.

20 Appendix

20.1 A dierent denition to the limit process

Definition. A sequence ann∈N is said to have a limit L if for any ε > 0 there

exists an index N such that for any Nmax > N there exists Nmin < Nmax − 1such 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 holdsthat |an − L| < ε. Let us choose N = N + 1. Then especially, given Nmax > N ,then Nmin = N satises the required condition.Second direction. Suppose that the above denition holds for a sequence. Wewant to show that Cauchy's denition also holds. Given ε > 0, let us chooseN = 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 wechoose 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 followingargument. A sequence ann∈N is said to have a limit L if for any ε > 0 (assmall as we desire), there exists some N (ε) such that for any n > N it holdsthat:

|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 pointout that this alternative suggest a more rigorous terminology to the term assmall 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 thedenitions are equivalent, hence the proof is skipped. Following is a slightlydierent modication of the discussed suggestion to dene the limit, where onceagain the proof to its equivalency to the previously known denitions is skipped.

78

Page 79: A Simple Approach To Calculus

Definition. A sequence ann∈N is said to have a limit L if there exists

a number M > 0 such that for any m > M there exists N (m) such that for anyNmax > N there exists Nmin < Nmax − 1 such that for all Nmin < n < Nmaxit holds that:

|an − L| <1

m.

79

Page 80: A Simple Approach To Calculus

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 inx.% Author: Amir Finkelstein, [email protected]% 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_supres(1) = 1;

endif d_plus_inf ~= -d_minus_infres(2) = 1;

endif d_plus_sup ~= d_minus_supres(3) = 1;

endif d_plus_inf ~= d_minus_infres(4) = 1;

endif d_plus_sup ~= d_plus_infres(5) = 1;

endif d_minus_sup ~= d_minus_infres(6) = 1;

end

function phi = GetSign(index)switch (index)case 1,4phi = +1;

case 2,5phi = 0;

case 3,6phi = -1;

end

80

Page 81: A Simple Approach To Calculus

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 ofthe squares in the discrete Stokes' theorem, and that the process of dissolvingresembles 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 ComputerVision, 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 andinteractive 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

Page 82: A Simple Approach To Calculus

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

[9] Gilbert Labelle and Annie Lacasse. Discrete Versions of Stokes' TheoremBased 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 Analysisand 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, NowhereMonotone, Functions. The American Mathematical Monthly, Vol. 81, No.4. (Apr., 1974), pp. 349-354.

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

82