05 CCA Kyoto2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

A Lambda Calculus for Real Analysis

Paul Taylor1

Andrej Bauer2

1 Department

of Computer Science
University of Manchester
UK EPSRC GR/S58522

2 Department

of Mathematics and Physics


University of Ljubljana

Computability and Complexity in Analysis


Sunday, 28 August 2005

www.cs.man.ac.uk/pt/ASD

All functions are continuous and computable


This is not a Theorem (`a la Brouwer) but a design principle.
The language only introduces continuous computable
functions.

All functions are continuous and computable


This is not a Theorem (`a la Brouwer) but a design principle.
The language only introduces continuous computable
functions.
In particular, all functions R R are continuous
and correspond to open subspaces.

All functions are continuous and computable


This is not a Theorem (`a la Brouwer) but a design principle.
The language only introduces continuous computable
functions.
In particular, all functions R R are continuous
and correspond to open subspaces.
Hence a < b, a > b and a , b are definable,
but a b, a b and a = b are not definable.

All functions are continuous and computable


This is not a Theorem (`a la Brouwer) but a design principle.
The language only introduces continuous computable
functions.
In particular, all functions R R are continuous
and correspond to open subspaces.
Hence a < b, a > b and a , b are definable,
but a b, a b and a = b are not definable.
This is because R is Hausdorff but not discrete.

All functions are continuous and computable


This is not a Theorem (`a la Brouwer) but a design principle.
The language only introduces continuous computable
functions.
In particular, all functions R R are continuous
and correspond to open subspaces.
Hence a < b, a > b and a , b are definable,
but a b, a b and a = b are not definable.
This is because R is Hausdorff but not discrete.
N and Q are discrete and Hausdorff.
So we have all six relations for them.

Geometric, not Intuitionistic, logic


A term : is called a proposition.
A term : X is called a predicate or open subspace.
We can form and .
Also n : N. x, q : Q. x, x : R. x and x : [0, 1]. x.

Geometric, not Intuitionistic, logic


A term : is called a proposition.
A term : X is called a predicate or open subspace.
We can form and .
Also n : N. x, q : Q. x, x : R. x and x : [0, 1]. x.
But not x : X. x for arbitrary X it must be overt.

Geometric, not Intuitionistic, logic


A term : is called a proposition.
A term : X is called a predicate or open subspace.
We can form and .
Also n : N. x, q : Q. x, x : R. x and x : [0, 1]. x.
But not x : X. x for arbitrary X it must be overt.
Negation and implication are not allowed.
Because:
I
I
I

this is the logic of open subspaces;


 
the function  on
is not continuous;
the Halting Problem is not solvable.

Universal quantification
When K X is compact (e.g. [0, 1] R), we can form x : K. x.
x : K ` > x
=================
` > x : K. x

Universal quantification
When K X is compact (e.g. [0, 1] R), we can form x : K. x.
x : K ` > x
=================
` > x : K. x
The quantifier is a (higher-type) function K : K .
Like everything else, its Scott continuous.

Universal quantification
When K X is compact (e.g. [0, 1] R), we can form x : K. x.
x : K ` > x
=================
` > x : K. x
The quantifier is a (higher-type) function K : K .
Like everything else, its Scott continuous.
The useful cases of this in real analysis are
x : K. > 0.(x, ) > 0.x : K.(x, )
x : K.n.(x, n)
in the case where
or

(1 < 2 )
(n1 > n2 )

n.x : K.(x, n)

(x, 2 ) (x, 1 )
(x, n2 ) (x, n1 ).

Recall that uniform convergence, continuity, etc.


involve commuting quantifiers like this.

Propositions and statements


Whats the problem with ?

Propositions and statements


Whats the problem with ? We cant write  > 0!

Propositions and statements


Whats the problem with ? We cant write  > 0!
Propositions may be computationally observable.
Equations and implications amongst propositions or predicates
may be logically provable from the axioms.
We call them statements.

Propositions and statements


Whats the problem with ? We cant write  > 0!
Propositions may be computationally observable.
Equations and implications amongst propositions or predicates
may be logically provable from the axioms.
We call them statements.
For example, with a (d. d < a),
a = b iff a = b and a b iff a b
in the arithmetical order.
Hence a b, a b and a = b are meaningful,
as statements, not as propositions.

Propositions and statements


Whats the problem with ? We cant write  > 0!
Propositions may be computationally observable.
Equations and implications amongst propositions or predicates
may be logically provable from the axioms.
We call them statements.
For example, with a (d. d < a),
a = b iff a = b and a b iff a b
in the arithmetical order.
Hence a b, a b and a = b are meaningful,
as statements, not as propositions.
In fact, a b is equivalent as a statement to (a > b) ,
and a = b to (a , b) .
We deal with  > 0 by allowing  as parameter or free variable.

Examples: continuity and uniform continuity


Recall that, from local compactness of R,
x > 0. y : [x ]. y
Theorem: Every definable function f : R R is continuous:



 > 0 > 0. y : [x ]. fy fx < 



Proof: Put x, y fy fx <  , with parameters x,  : R.
Theorem: Every function f is uniformly continuous
on any compact subspace K R:



 > 0 > 0. x : K. y : [x ]. fy fx < 
Proof: > 0 and x : K commute.

Example: Dinis theorem


Theorem: Let fn : K R be an increasing sequence of functions
n : N, x : K ` fn x fn+1 x : R
that converges pointwise to g : K R, so
 > 0, x : K ` > n. gx fn x < .
If K is compact then fn converges to g uniformly.
Proof: Using the introduction and Scott continuity rules for ,
 > 0 ` > x : K. n. gx fn x < 
n. x : K. gx fn x < 
Corollary: Since ASD has a computational interpretation,
Dinis theorem is computationally valid.

Relative containment of open subspaces


Let , , be propositions with parameters x1 : X1 , ..., xk : Xk .
(We conventionally write for this list.
Semantically, is the space X1 Xk .)
Then , , define open subspaces of .
They satisfy a Gentzen-stle rule of inference:
, > `
====================
`
in which the top line means
within the open subspace of defined by ,
the open subspace defined by
is contained in the open subspace defined by .
and the bottom line means
the intersection of the open subspaces defined by and
is contained in that defined by .

Relative containment of closed subspaces


Let , , be propositions with parameters x1 : X1 , ..., xk : Xk .
(We conventionally write for this list.
Semantically, is the space X1 Xk .)
Then , , define closed subspaces of .
They satisfy a Gentzen-stle rule of inference:
, `
====================
`
in which the top line means
within the closed subspace of defined by ,
the closed subspace defined by
contains the closed subspace defined by .
and the bottom line means
the intersection of the closed subspaces defined by and
is contained in that defined by .

Exercise for everyone!


Make a habit of trying to formulate statements in analysis
according to (the restrictions of) the ASD language.
This may be easy it may not be possible
The exercise of doing so may be 95% of solving your problem!

Constructive intermediate value theorem


Suppose that f : R R doesnt hover, i.e.
b, d : R ` b < d x. (b < x < d) (fx , 0),
and f 0 < 0 < f 1. Then fc = 0 for some 0 < c < 1.
Interval trisection: Let a0 0, e0 1,
bn 13 (2an + en )

and dn 31 (an + 2en ).

Then f (cn ) , 0 for some bn < cn < dn , so put


(
an , cn if f (cn ) > 0
an+1 , en+1
cn , en if f (cn ) < 0.
Then f (an ) < 0 < f (en ) and an c en .
(This isnt the ASD proof/algorithm yet!)

Stable zeroes
The interval trisection finds zeroes with this property:
fd
a

fb

d
d

fb

fd

Definition: c : R is a stable zero of f if


a, e : R ` a < c < e bd.

(a < b < c < d < e)


(fb < 0 < fd fb > 0 > fd).

The subspace Z [0, 1] of all zeroes is compact.


The subspace S [0, 1] of stable zeroes is overt (as we shall
see...)

Straddling intervals
An open subspace U R contains a stable zero c U S iff U
also contains a straddling interval,
[b, d] U

with

fb < 0 < fd or fb > 0 > fd.

[] From the definitions. [] The straddling interval


is an intermediate value problem in miniature.

Straddling intervals
An open subspace U R contains a stable zero c U S iff U
also contains a straddling interval,
[b, d] U

with

fb < 0 < fd or fb > 0 > fd.

[] From the definitions. [] The straddling interval


is an intermediate value problem in miniature.
Notation: Write U if U contains a straddling interval.
We write this containment in ASD using the universal
quantifier.
bd.

(x : [b, d]. x)
(fb < 0 < fd) (fb > 0 > fd).

The possibility operator


By hypothesis, (0, 1) >, whilst trivially.
S
iI Ui i. Ui .
If f : R R is an open map, this is easy.
If f : R R doesnt hover, it depends on connectedness of R.

The possibility operator


By hypothesis, (0, 1) >, whilst trivially.
S
iI Ui i. Ui .
If f : R R is an open map, this is easy.
If f : R R doesnt hover, it depends on connectedness of R.
Definition: A term : with this property
is called an overt subspace of X.
X

A simpler example: For any point a : X,


the neighbourhood filter a . a is a possibility
operator.
is a point iff it also preserves > and .

The Possibility Operator as a Program


Theorem: Let be an overt subspace of R with > >.
Then has an accumulation point c R,
i.e. one of which every open neighbourhood c U R
satisfies U:
: R ` c
Example: In the intermediate value theorem, any such c is a
stable zero.
Proof: Interval trisection.
Corollary: Obtain a Cauchy sequence from a Dedekind cut.
(I expect to get a representation 2N * R in the sense of TTE
by proving a result of Brattko & Hertling in ASD.)

Possibility operators classically


Define U as U S , , for any subset S X whatever.
S

Then
U
iI i iff i. Ui .
Conversely, if has this property, let
S

{a X | for all open U X, a U U}


[
W X\S =
{U open | U}
Then W is open and S is closed.
W by preservation of unions.
Hence U holds iff U 1 W, i.e. U S , .
If had been derived from some S0 then S = S0 , its closure.
Classically, every (sub)space S is overt.

Necessity operators
Let K R be any compact subspace.
(For example, all zeroes in a bounded interval.)
U 7 (K U) is Scott continuous.
Notation: Write  for x : K. x.

Modal operators, separately


 encodes the compact subspace Z {x I | fx = 0} of all zeroes.
encodes the overt subspace S of stable zeroes.
 X is true

and

 U  V (U V)

is false

and

(U V) U V.

(Z , )

iff

 is false

(S , )

iff

R is true

Modal operators, together


and  for the subspaces S Z are related in general by:
 U V (U V)
 U (U W = X)
V (V 1 W)
S is dense in Z iff
(U V)  U V
V (V 1 W)
In the intermediate value theorem
for functions that dont hover (e.g. polynomials):
I

S = Z in the non-singular case

S Z in the singular case (e.g. double zeroes).

Modal laws in ASD notation


Overt subspace
Compact subspace

> >
( )
( )  
( )
 (x. x)
Commutative laws:




x. (y. xy)
 y. (x. xy)




 x. (y. xy)  y. (x. xy)
Mixed modal laws for a compact overt subspace.
 ( )

and

 ( )

Empty/inhabited is decidable
Theorem: Any compact overt subspace (, ) is either empty
( ) or non-empty ( >).
Proof:

>
 >
empty
> >

inhabited
 >
 >
complementary
( >)  > > (mixed) ( )

Empty/inhabited is decidable
Theorem: Any compact overt subspace (, ) is either empty
( ) or non-empty ( >).
Proof:

>
 >
empty
> >

inhabited
 >
 >
complementary
( >)  > > (mixed) ( )

The dichotomy (either  or >) means that


the parameter space is a disjoint union.
So, if it is connected, like Rn ,
something must break at singularities.
It is the modal law ( )  .

Non-empty compact overt subspace of R has a


maximum
Theorem: Any overt compact subspace K R is
I

either empty

or has a greatest element, max K K.

Definition: max K satisfies, for x : R,


(x < max K) (k : K. x < k)
(max K < x) (k : K. k < x)
k : K ` k max K
, k : K ` k x
` max K x

Compact overt subspace of R has a maximum


Proof: Define a Dedekind cut (next slide)
d k : K. d < k

and

u k : K. k < u

Hence there is some a : R with


d (d < a)

and u (a < u)

Moreover, a K.
K is also the closed subspace
co-classified by x (k. x , k),
so we must show that a .
a (k. a , k) (k. a < k) (k < a)
(k. a < k) (k. k < a)

a a

(a < a) (a < a) .

Compact overt subspace of R defines a Dedekind cut


Overt subspace

Compact subspace 

W
, ,  and so R

commutes with

W
>, and 

d (k. d < k)

Dedekind cut

u (k. k < u)

(d < e) e
lower/upper
t (t < u)
(k. k < t) (t < u)
(d < e) (k. e < k)
(k. d < e < k)
(Frobenius/ >)
(k. k < t < u)
(k. d < k) d
(transitivity)
(k. k < u) u

rounded (interpolation)

d. d d. (k. d < k)
(k. d. d < k)
> > (inhabited)

inhabited
(directed joins)
(extrapolation)

u. u u. (k. k < u)
(k. u. k < u)
> >

The Bishop-style proof


Definition: K is totally bounded if, for each  > 0,
theres a finite subset

S K such that

x : K. y S . x y < .
Proof: If K is closed and totally bounded,
I either the set S1 is empty, in which case K is empty too,
I or xn max S2n defines a Cauchy sequence
that converges to max K.
But K is also overt, with  > 0. y S . y.
Definition: K is located if, for each x X,
inf {|x k| | k K} is defined.
(A different usage of the word located.)
closed, totally bounded compact and overt located
(in TTE) also r.e. closed
I
I

Total boundedness and locatedness are metrical concepts.


Compactness and overtness are topological.

The real interval is connected (usual proof)


Any closed subspace of a compact space is compact.
Any open subspace of an overt space is overt.
Any clopen subspace of an overt compact space is overt
compact, so its either empty or has a maximum.
Since the clopen subspace is open, its elements are interior,
so the maximum can only be the right endpoint of the interval.
Any clopen subspace has a clopen complement.
I

They cant both be empty, but

in the interval they cant both have maxima (the right


endpoint).

Hence one is empty and the other is the whole interval.

Connectedness in modal notation


We have just proved
( ) , ( ) > `   >
where  x : [0, 1]. x and x : [0, 1]. x.
Using the mixed modal law  ( )
and the Gentzen-style rules
> `
=================
`

`
=================
`

connectedness may be expressed in other ways:


( )

( )  

( )

( )

( )

  ( )

( ) ( )

Weak intermediate value theorems


Let f : [0, 1] R, and use two of these forms of connectedness.
Put x (0 < fx) and x (fx < 0).
Use ( ) = ` ( ) .
( ) by disjointness.


Then (f 0 < 0 < f 1) x : [0, 1]. fx , 0 .
So the closed, compact subspace Z {x : I | fx = 0} is not empty.
Put x (e < fx) and x (fx < t).
Use ( ) ( ).
( ) by locatedness. 

Then (f 0 < e < t < f 1) x : [0, 1]. e < fx < t .

or  > 0 ` x. fx < .
So the open, overt subspace {x | e < fx < t} is inhabited.

Straddling intervals in ASD


Let f : [0, 1] R be a function that doesnt hover.
Proposition: preserves joins, (n. n ) n. n .
Proof: Consider
x n. y. (x < y < u) (fy >< 0) z : [x, y]. n z.
Then x. + x x by connectness.
Lemma: 0 < a < 1 is a stable zero of f iff
it is an accumulation point of , i.e. a .
Theorem: and  obey  ( ).
They also obey ( ) 
iff f doesnt touch the axis without crossing it.
When f is a polynomial, this is the non-singular case, where f
has no zeroes of even multiplicity.

Solving equations in ASD


In the non-singular case, all zeroes are stable,
and  define a non-empty overt compact subspace,
which has a maximum.
So the classical textbook proof of IVT,
a sup {x : [0, 1] | fx 0},
is computationally meaningful!
The set of zeroes varies discontinuously at singularities in the
parameters.
The modal operators  and are Scott-continuous
throughout the parameter space.
The interval trisection algorithm for finds some zero,
even in the singular case,
but it behaves non-deterministically and catastrophically.

Differentiation
Define (fx, f 0 x) together by a Dedekind cross-hair.
Characterise (e0 < fx < t0 ) (e1 < f 0 x < t1 ) by
. h : [0, ].

e1 + e1 h < f (x + h) < t0 + t1 h
e1 t1 h < f (x h) < t0 e1 h

This is a Dedekind cut in (e0 , t0 ) since f : R R is a function.


It is bounded in (e1 , t1 ) if f is Lipschitz at x.
It is a Dedekind cut in (e1 , t1 ) if f is differentiable at x.

I need help!
Im a categorist, not an analyst.
I last did real analysis as a second year undergraduate.
I need a real analyst to set an agenda for me.
I also need a job from September 2006.

You might also like