« Lambda counting » : différence entre les versions
Aucun résumé des modifications |
|||
| (259 versions intermédiaires par 7 utilisateurs non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
counting.pdf : [http://www.lama.univ-savoie.fr/~david/ftp/paper/counting.pdf] version on wednesday 07/01 at 17h30. the files below are the good ones. René |
|||
==Introduction== |
==Introduction== |
||
The question is: among programs, what is the probability of having a fixed property. |
|||
intro : [http://www.lama.univ-savoie.fr/~david/ftp/paper/intro.tex] |
|||
what kind of program : turing machines, cellular automata, combinatory logic, lambda calculus |
|||
== lambda== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-2.tex] |
|||
==combinatorics== |
|||
section 3 : [http://www.lama.univ-savoie.fr/~david/ftp/paper/section-3.tex] |
|||
generating : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/generating.tex] |
|||
==bounds== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-4.tex] |
|||
==main results== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5.tex] |
|||
==section 5-2== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-2.tex] |
|||
section 5-2-2 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-2-2.tex] |
|||
section 5-2-3 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-2-3.tex] |
|||
section 5-2-4 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-2-4.tex] |
|||
==section 5-3== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-3.tex] |
|||
section 5-3-1 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-3-1.tex] |
|||
section 5-3-2 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-3-2.tex] |
|||
section 5-3-3 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-3-3.tex] |
|||
section 5-3-4 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-5-3-4.tex] |
|||
==other systems== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-6.tex] |
|||
section 6.1 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-6.1.tex] |
|||
section 6.2 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-6.2.tex] |
|||
==conclusion== |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-7.tex] |
|||
section 7.1 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-7.1.tex] |
|||
section 7.2 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-7.2.tex] |
|||
section 7.3 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/section-7.3.tex] |
|||
==biblio == |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/biblio.tex] |
|||
==appendix == |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/appendix.tex] |
|||
appendix-1 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/appendix-1.tex] |
|||
appendix-2 : |
|||
[http://www.lama.univ-savoie.fr/~david/ftp/paper/appendix-2.tex] |
|||
What appears below is the old version |
|||
== Known results for Turing machines and cellular automata == |
|||
what kind of properties : structural (for functional programs), behaviour (SN, weakly normalizable, ... |
|||
In this section I propose to comment on paper |
|||
references to known results on : turing machines, cellular automata |
|||
[http://tcs.uj.edu.pl/~zaionc/papers_ps/HaltingProblem.pdf] and [http://tcs.uj.edu.pl/~zaionc/papers_ps/Dabramo.pdf]. |
|||
Guillaume says: I am very skeptical about paper 2 by D'Abramo. I suggest to replace it by the paper by Calude and Stay [http://arxiv.org/abs/cs/0610153]. |
|||
we concentrate on combinatory logic, lambda calculus |
|||
== Lambert function, Catalan and Motzkin numbers == |
== Lambert function, Catalan and Motzkin numbers == |
||
| Ligne 18 : | Ligne 112 : | ||
Usual equivalent: <math>C(n) \sim \frac{4^n}{n^{3/2}\sqrt{\pi}}</math> which is obtained using Strirling formula. |
Usual equivalent: <math>C(n) \sim \frac{4^n}{n^{3/2}\sqrt{\pi}}</math> which is obtained using Strirling formula. |
||
However, using stirling |
However, using stirling formula which can be extended as the following double inequality: <math> |
||
n! |
\sqrt{2\pi n}n^n e^{\left(-n+\frac{1}{12n+1}\right)} < n! <\sqrt{2\pi n}n^n e^{\left(-n+\frac{1}{12n}\right)}</math> |
||
\left( |
|||
<math>C(n) = \frac{(2n)!}{(n+1)!n!} \geq \frac{4^n}{\sqrt{\pi} (n+1)^{\frac{3}{2}}} \left(\frac{n}{n+1}\right)^n e^{\left(1 + \frac{1}{24n+1}-\frac{1}{12 n + 12}-\frac{1}{12n}\right)}</math> |
|||
1 |
|||
+{1\over12n} |
|||
+{1\over288n^2} |
|||
-{139\over51840n^3} |
|||
-{571\over2488320n^4} |
|||
+ \cdots |
|||
\right) |
|||
</math>, we get that for <math>n\geq1</math> we have <math>\sqrt{2\pi n}\left({n\over e}\right)^n \leq n! \leq \frac{7}{6}\sqrt{2\pi n}\left({n\over e}\right)^n</math> |
|||
Thus, using this and <math>\left(\frac{n}{n+1}\right)^{n} > e^{-1}</math>, we have: |
Thus, using this and <math>\left(\frac{n}{n+1}\right)^{n} > e^{-1}</math>, we have: |
||
<math>C(n) |
<math>C(n) \geq \frac{4^n}{\sqrt{\pi} (n+1)^{\frac{3}{2}}} e^{\left(\frac{1}{24n+1}-\frac{1}{12 n + 12}-\frac{1}{12n}\right)} </math> |
||
Then, we can check that |
|||
<math>\frac{1}{24n+1}-\frac{1}{12 n + 12}-\frac{1}{12n} = \frac{-36 n^2 - 14 n - 1}{12(24n+1)(n+1)n} \geq -\frac{51}{288n}</math> |
|||
Thus finally <math>C(n) \geq \frac{4^n}{\sqrt{\pi} (n+1)^{\frac{3}{2}}} e^{\left(-\frac{17}{96n}\right)} \geq \frac{4^n}{\sqrt{\pi} (n+1)^{\frac{3}{2}}} e^{\left(-\frac{17}{96}\right)} </math> for all <math>n\geq1</math>. |
|||
===Motzkin numbers=== |
===Motzkin numbers=== |
||
In fact, these are not usual Motzkin's numbers because in <math>M(n)</math>, <math>n</math> is the number of inner nodes while |
|||
* <math>M(n,k)</math> |
|||
usually, this is the total number of nodes, including leaves. The number we use are known as large Schroeder numbers. |
|||
Let us define <math>M(n,k)</math> the number of unary-binary trees with <math>n</math> inner nodes and <math>k</math> leafs. |
|||
A tree with <math>n</math> inner node <math>k</math> leafs has exactly <math>k-1</math> binary nodes and therefore <math>n-k+1</math>. |
|||
Hence we get the following formula |
|||
<center><math>M(n,k) = C(k-1){n+k-1 \choose n-k+1} </math></center> |
|||
Then, by summing we define <math>M(n)</math> the number of unary-binary trees with <math>n</math> inner nodes and give an equivalent: |
|||
<center><math>M(n) = \sum_{k \geq 1} M(n,k) \sim \left(\frac{1}{3-2\sqrt{2}}\right)^n \frac{1}{n^\frac{3}{2}}</math></center> |
|||
===Lambert W function=== |
===Lambert W function=== |
||
The Lambert function <math>W(x)</math> is defined by the equation <math>x = W(x) e ^ {W(x)} </math> |
The Lambert function <math>W(x)</math> is defined by the equation <math>x = W(x) e ^ {W(x)} </math> |
||
which has a unique solution in <math>\mathbb{R}</math>. |
which has a unique solution in <math>\mathbb{R}_+</math>. |
||
For <math>x \geq e</math>, we have <math>\ln(x) - \ln(\ln(x)) \leq W(x) \leq \ln(x)</math> which implies that |
For <math>x \geq e</math>, we have <math>\ln(x) - \ln(\ln(x)) \leq W(x) \leq \ln(x)</math> which implies that |
||
<math>W(x) \sim \ln(x)</math> near <math>+\infty</math>. To prove this, it is enough to remark that |
<math>W(x) \sim \ln(x)</math> near <math>+\infty</math>. To prove this, it is enough to remark that |
||
<center><math>(ln(x) - \ln(\ln(x))e^{\ln(x)-\ln(\ln(x))} = x - \frac{ |
<center><math>(\ln(x) - \ln(\ln(x))e^{\ln(x)-\ln(\ln(x))} = x \left(1 - \frac{\ln(\ln(x))}{\ln(x)}\right) \leq x \leq x \ln(x) = \ln(x) e^{\ln(x)} </math></center> |
||
This is not precise enough for our purpose. Using one step of the Newton method from <math>\ln(x) - \ln(\ln(x))</math>, we can find a better upper bound for <math>W(x)</math> because <math>y \mapsto y e^y</math> is increasing and convex when <math>y \geq 0</math>. This gives for <math>x \geq e</math>: |
|||
<center><math>\ln(x) - \ln(\ln(x)) \leq W(x) \leq \ln(x) - \ln(\ln(x)) + \frac{\ln(\ln(x))}{\ln(x) - \ln(\ln(x)) + 1}</math></center> |
|||
Indeed, if we define <math>f(y) = y e^y</math>, we have <math>f'(y)=(1+y)e^y</math> and therefore, newton's method from <math>A = \ln(x) - \ln(\ln(x))</math> gives a point at position: |
|||
<center><math> |
|||
A - \frac{f(A) - x}{f'(A)} |
|||
= A + \frac{x \ln(\ln(x))}{\ln(x)} \frac{\ln(x)}{x(\ln(x) - \ln(\ln(x)) + 1)} |
|||
= A + \frac{\ln(\ln(x))}{\ln(x) - \ln(\ln(x)) + 1} |
|||
</math></center> |
|||
Finally, we show that for <math>x\geq e</math>, we have: |
|||
<center><math>\ln(x) - \ln(\ln(x)) \leq W(x) \leq \ln(x) - \ln(\ln(x)) + 1</math></center> |
|||
Indeed, for <math>x > 1</math>, we have <math>e^{\sqrt{ex}} \geq 1 + \sqrt{ex} + \frac{ex}{2} \geq x</math>, which implies |
|||
<math>ex \geq \ln^2(x)</math> and therefore <math>\ln(x) - \ln\ln(x) + 1 \geq \ln\ln(x)</math>. |
|||
== combinatory logic == |
== combinatory logic == |
||
Basically the paper already written by Marek |
|||
results on combinatory logic |
|||
tex file : [http://www.lama.univ-savoie.fr/~david/ftp/CL.tex] |
|||
pdf file :[http://www.lama.univ-savoie.fr/~david/ftp/CL.pdf] |
|||
+ the following |
|||
As we will see in section ??, theorem ?? does not holds for the Lambda calculus. This may be surprising since there are translations between these systems which respect many properties (for exemple the one of being terminating). However these translations do not preserve the size. |
|||
The translation <math>T</math> from combinatory logic to lambda calculus is linear, i.e. there is a constant <math>k</math> such that, for all terms, <math>size(T (t)) \leq k * size(t)</math> but the translation <math> S </math> in the other direction is not linear. As far as we know, there is no known bound on the size of <math>S (t)</math> but it is not difficult to find exemples where <math> size(S(t)) </math> is of order <math> size(t)^3</math>. |
|||
The point is that <math> S </math> has to code the binding in some way and this takes place. It will be interesting to compare the size of <math> S (t) </math> with the one of <math> t </math> using other notion of size than the usual one. See section ?? for some complement. |
|||
== Generality on lambda calculus == |
== Generality on lambda calculus == |
||
what kind of distribution ? |
|||
we look only for densities, |
|||
for that we need size. |
|||
definition |
|||
different size for variables: zero, one, binary with optimal size, binary with fixed size, debruijn indices in unary... |
|||
The set <math>\Lambda</math> of lambda terms (or, |
|||
we concentrate on the simple one : variable of size zero (probably similar for size one ) more later for other size |
|||
simply, terms) is defined by the following grammar |
|||
<math>t, u := Var \ \mid \ \lambda x.t \ \mid \ (t \ u)</math> |
|||
To be able to define the notion of a ''random'' term we |
|||
have to define a distribution law on <math>\Lambda</math>. There are many |
|||
possibilities for that. We choose here the simplest one. Note that this is the one for which, at least at present, we are |
|||
able to prove some results. It is based on densities. For that we |
|||
first have to define the ''size'' of a term. |
|||
The usual |
|||
definition is the following. |
|||
definition |
|||
The size (denoted as <math>size_1(t)</math>) of a term <math>t</math> is defined by the following |
|||
rules. |
|||
- <math>size_1(t)=1</math> if <math>t</math> is a variable. |
|||
- <math>size_1(\lambda x.t)=size_1(t)+1</math> |
|||
- <math>size_1((t \ u))=size_1(t)+size_1(u)+1</math> |
|||
In the rest of the paper we will use another definition (denoted |
|||
as <math>size_0(t)</math>) which is similar but gives simpler computations. |
|||
We believe (but we have not yet checked the details) that, with |
|||
<math>size_1</math> we would have similar results. The |
|||
computation, with <math>size_1</math>, of the upper and lower |
|||
bounds of the number of terms of size <math>n</math> will be done |
|||
in section ?? |
|||
definition |
|||
The size (denoted as <math>size_0(t)</math> or, more simply <math>size(t)</math>) of a term <math>t</math> is defined by the following |
|||
rules. |
|||
- <math>size_0(t)=1</math> if <math>t</math> is a variable. |
|||
- <math>size_0(\lambda x.t)=size_0(t)+1</math> |
|||
- <math>size_0((t \ u))=size_0(t)+size_0(u)+1</math> |
|||
These definitions of the size are, for the implementation point of |
|||
view, not realistic because, in case a term has a lot of distinct |
|||
variables, it is not realistic to use a single bit to code them. |
|||
The usual way to implement this coding is to replace the names of |
|||
variables by their so called de Bruijn indices: a variable is |
|||
replaced by the number of <math>\lambda</math> that occur, on the |
|||
path from the variable to the root, between the variable and the |
|||
<math>lambda</math> that binds it. Note that, in this case, |
|||
different occurrences of the same variable may be represented by |
|||
different indices. |
|||
Choosing the way we code these de Bruijn indices gives different |
|||
other ways of defining the size of a term. This can be done in the |
|||
following ways |
|||
- Use unary notation, i.e. the size of the index <math>n</math> |
|||
simply is <math>n</math> itself |
|||
- Use optimal binary notation, i.e. the size of the index |
|||
<math>n</math> is <math>log_2(n)</math> i.e. the logarithm of |
|||
<math>n</math> in base 2. |
|||
- Use uniform binary notation, i.e. the size of an index is the |
|||
logarithm, in base 2, of the number of leaves of the term. |
|||
Remark |
|||
See section ?? for a discusion about these different size. |
|||
definition |
|||
Let <math>n</math> be an integer. We denote by <math>\Lambda_n</math> the set of <math>\lambda</math> terms of size n. |
|||
definition |
|||
Let A be a set of <math>\lambda</math> terms. |
|||
1) We denote by <math>\#(A)</math> the cardinality of A. |
|||
2) We denote by <math>d(A)</math> the limit, for n going to <math>\infty</math>, |
|||
of <math>\frac{\#(A\cap \Lambda_n)}{\#(\Lambda_n)}</math>. |
|||
Remark |
|||
Note that d is not exactly a measure since <math>d(A)</math> is undefined if the previous limit does not exist |
|||
definition |
|||
Let P be a property of terms. We will say that almost every term satisfies P |
|||
(this will be also stated as P holds a.e.) if |
|||
<math>d(\{t \ | \ P(t) holds\})=1</math> |
|||
== generating functions == |
== generating functions == |
||
| Ligne 76 : | Ligne 309 : | ||
=== Upper and lower bounds for <math>L_n</math> === |
=== Upper and lower bounds for <math>L_n</math> === |
||
For the lower bound, we will first count the number <math>LB(n,k)</math> of lambda-terms of size <math>n</math> starting with <math>k</math> lambdas and having no other lambda below. This means that the lower part of the term is a binary tree |
For the lower bound, we will first count the number <math>LB(n,k)</math> of lambda-terms of size <math>n</math> starting with <math>k</math> lambdas and having no other lambda below. This means that the lower part of the term is a binary tree with <math>n-k</math> inner nodes with |
||
<math>k</math> possibility for each leaf. Therefore we have: |
<math>k</math> possibility for each leaf. Therefore we have: |
||
<center><math>LB(n,k) = C(n-k) k^{n-k}</math></center> |
<center><math>LB(n,k) = C(n-k) k^{n-k+1}</math></center> |
||
And therefore, for <math>n > k</math>, using our lower bound for <math>C(n)</math> and <math>n + 1 \geq n - k + 1</math>, we get: |
And therefore, for <math>n > k</math>, using our lower bound for <math>C(n)</math> and <math>n + 1 \geq n - k + 1</math>, we get: |
||
<center><math>LB(n,k) \geq K \frac{(4k)^{n-k}}{(n+1)^\frac{3}{2}}</math> with <math>K=\frac{ |
<center><math>LB(n,k) \geq K \frac{(4k)^{n-k+1}}{(n+1)^\frac{3}{2}}</math> with <math>K=\frac{e^{-\frac{17}{96}}}{4\sqrt{\pi}}</math></center> |
||
Now, for <math>n</math> fixed, we define <math>f(\alpha) = \left(4n\alpha\right)^{n(1-\alpha)}</math> (so <math>LB(n,k) \geq \frac{K}{(n+1)^\frac{3}{2}} f\left(\frac{k}{n}\right)</math>) and look for the maximum of this function. We have <math>f'(\alpha) = |
Now, for <math>n</math> fixed, we define <math>f(\alpha) = \left(4n\alpha\right)^{n(1-\alpha) + 1}</math> (so <math>LB(n,k) \geq \frac{K}{(n+1)^\frac{3}{2}} f\left(\frac{k}{n}\right)</math>) and look for the maximum of this function. We have <math>f'(\alpha) = f(\alpha) \left(-n\ln(4n\alpha) +\frac{n(1-\alpha) + 1}{\alpha}\right)</math>. Thus, <math>f'(\alpha) \geq 0</math> is equivalent to <math>\frac{n+1}{n\alpha}e^{\frac{n+1}{n\alpha}}\geq 4e(n+1)</math>. The Lambert function begin increasing this means that <math>f'(\alpha) \geq 0</math> is equivalent to <math>\alpha \leq \frac{n+1}{nW(4e(n+1))}</math>. Therefore, <math>f(\alpha)</math> reaches a maximum for <math>\alpha = \frac{n+1}{nW(4e(n+1))}</math>. |
||
This means that <math> |
This means that <math>(4k)^{n-k}</math> reaches its maximum for <math>n</math> fixed when <math>k</math> |
||
is near to <math>\frac{n}{W( |
is near to <math>\frac{n+1}{W(4e(n+1))}</math> which is likely not to be an integer. However, there are at least <math>\left\lfloor \frac{(n+1) (\ln(\ln(4en)) - 1)}{\ln^2(4en)}\right\rfloor</math> integer between <math>\frac{n+1}{W(4e(n+1))}</math> and <math>\frac{n+1}{\ln(4e(n+1))}</math>. Indeed, using our inequalities on Lambert W function, we have: |
||
<center><math>\frac{n+1}{W(4e(n+1))}-\frac{n+1}{\ln(4e(n+1))} = \frac{(n+1) (\ln(4e(n+1)) - W(4e(n+1)))}{W(4e(n+1))\ln(4e(n+1))} \geq \frac{(n+1) (\ln(\ln(4e(n+1))) - 1)}{\ln^2(4e(n+1))}</math></center> |
|||
Thus, we get the following lowerbound for <math>L_n</math>: |
|||
<center><math>\#(L_n) \geq \sum_{k=1}^{n} LB(n,k) \geq \sum_{k=\lceil\frac{n+1}{\ln(4e(n+1))}\rceil}^{\lfloor\frac{n+1}{W(4e(n+1))}\rfloor} K \frac{(4k)^{n-k+1}}{(n+1)^\frac{3}{2}} \geq K \left\lfloor \frac{(n+1) (\ln(\ln(4e(n+1))) - 1)}{\ln^2(4e(n+1))}\right\rfloor \frac{\left(\frac{4(n+1)}{\ln(4e(n+1))}\right)^{n-\frac{n+1}{\ln(4e(n+1))}+1}}{(n+1)^\frac{3}{2}}</math></center> |
|||
To simplify, we first remove the constant <math>K</math> and the integer part by replacing the <math>\ln(\ln(4e(n+1))) - 1</math> term by any constant <math>C</math>. This means that for any constant <math>C</math>, we can take <math>n</math> large enough to have: |
|||
<center><math>\#(L_n) \geq C\frac{n+1}{\ln^2(4e(n+1))}\frac{\left(\frac{4(n+1)}{\ln(4e(n+1))}\right)^{n-\frac{n+1}{\ln(4e(n+1))}+1}}{(n+1)^\frac{3}{2}} |
|||
= C\frac{\sqrt{n+1}}{\ln^3(4e(n+1))}\left(\frac{4(n+1)}{\ln(4e(n+1))}\right)^{n-\frac{n+1}{\ln(4e(n+1))}} |
|||
</math></center> |
|||
Then, using the facts that <math>\frac{n+1}{\ln(4e(n+1))} \leq \frac{n}{\ln(n)}</math>, <math>\lim_{n\to +\infty}\frac{\ln(n)}{\ln(4e(n+1))} = 1</math> and <math>\lim_{n\to +\infty}\left(\frac{\ln(n)}{\ln(4e(n+1))}\right)^n = 0</math>, we have the following lowerbound (still for <math>n</math> large enough, with <math>C = 1</math>): |
|||
<center><math>\#(L_n) \geq \frac{\sqrt{n}}{\ln^3(n)}\left(\frac{4n}{\ln(n)}\right)^{n-\frac{n}{\ln(n)}}</math></center> |
|||
We now compute an upper bound <math>UB(n,k)</math> for the number of lambda-terms of size <math>n</math> with exactly <math>k</math> lambdas (that is with <math>n - k + 1</math> leaves using the Motzkin numbers and allowing any lambda to bind any variable (regardless of the real scope): |
|||
<center><math>UB(n,k) = M(n,n-k+1) k^{n-k+1}</math></center> |
|||
If we sum this for all possible <math>k</math> and get an upper bound of <math>k^{n-k+1}</math> using Lambert function as for the lower bound, we get the following upper bound for <math>L_n</math>: |
|||
<center><math>\#(L_n) \leq M(n) \left(\frac{n+1}{W(e(n+1))}\right)^{n-\frac{n+1}{W(e(n+1))} + 1}</math></center> |
|||
The ration between our upper bound and lower bound is equivalent to (NEEDS FURTHER CHECKING, OR IS REMOVED because we can do better using Jakob's remark at the end of 7.2): |
|||
<center><math>\left(\frac{1}{4(3-2\sqrt{2})}\right)^n\frac{\ln^3(n)}{n^2} \simeq 1.46^n\frac{\ln^3(n)}{n^2}</math></center> |
|||
=== upper and lower bounds for number of lambdas in a term of size n === |
=== upper and lower bounds for number of lambdas in a term of size n === |
||
Let <math>S(n,k)</math> be the number of lambda term of size n containing more than <math>\frac{k n}{ln(n)}</math> lambdas. |
|||
=== Jakub's trik : at least 1 lambda in head position === |
|||
We search <math>k</math> such that <math>\lim_{n \rightarrow +\infty} \frac{S(n,k)}{L_n} = 0</math>. |
|||
Using the previous notation, we may write <math>S_n \leq \sum_{p \geq \frac{k n}{ln(n)}} UB(n,p)</math>. We observed that |
|||
=== at least <math>o(\sqrt{n/\ln(n)})</math> lambdas in head position and number of lambdas in one path === |
|||
<math>UB(n,p)</math> is decreasing in <math>p</math> if <math>p > \frac{n+1}{W(e(n+1))}</math>. |
|||
Then, we have <math>W(e(n+1)) \geq \ln(e(n+1)) - \ln(\ln(e(n+1)))</math>. Therefore, if <math>\frac{k n}{ln(n)} > \frac{n+1}{\ln(e(n+1)) - \ln(\ln(e(n+1)))}</math> (i), we have |
|||
Remark: (may be 4) can be done directly without 3)) |
|||
<center><math>S(n,k) \leq M(n)\left(\frac{k n}{ln(n)}\right)^{n+1-\frac{k n}{ln(n)}}</math></center> |
|||
=== each of the <math>o(\sqrt{n/\ln(n)})</math> head lambdas really bind "many" occurrences of the variable === |
|||
Then, (i) is equivalent to <math>\frac{k n}{n+1} > \frac{ln(n)}{\ln(e(n+1)) - \ln(\ln(e(n+1)))}</math> which is true for <math>n</math> |
|||
large enough if <math>k>1</math> because <math>\lim_{n \rightarrow +\infty} \frac{ln(n)}{\ln(e(n+1)) - \ln(\ln(e(n+1)))} = 1</math>. |
|||
Using our lower bound for <math>L_n</math>, we find |
|||
<center><math>\frac{S(n,k)}{L_n} \leq \frac{M(n)\left(\frac{k n}{ln(n)}\right)^{n+1-\frac{k n}{ln(n)}}}{\frac{\sqrt{n}}{\ln^3(n)}\left(\frac{4n}{\ln(n)}\right)^{n-\frac{n}{\ln(n)}}}</math></center> |
|||
We now use the fact that <math>M(n) \sim \left(\frac{1}{3-2\sqrt{2}}\right)^n \frac{1}{n^\frac{3}{2}}</math>, |
|||
for <math>n</math> large enough, we have (we introduce an extra log to compensate for the equivalent) |
|||
<center><math>\frac{S(n,k)}{L_n} \leq \frac{\ln^4(n)\left(\frac{1}{3-2\sqrt{2}}\right)^n \left(\frac{k n}{ln(n)}\right)^{n+1-\frac{k n}{ln(n)}}}{n^2\left(\frac{4n}{\ln(n)}\right)^{n-\frac{n}{\ln(n)}}}</math></center> |
|||
We get a simpler upper bound by using the <math>n^2</math> to compensate for the <math>+1</math> exponent and the remaining <math>k\frac{\ln^4(n)}{\ln(n)}</math>, which gives: |
|||
<center><math>\frac{S(n,k)}{L_n} \leq \frac{\left(\frac{1}{3-2\sqrt{2}}\right)^n \left(\frac{k n}{ln(n)}\right)^{n-\frac{k n}{ln(n)}}}{\left(\frac{4n}{\ln(n)}\right)^{n-\frac{n}{\ln(n)}}} = \left(\frac{k}{4(3-2\sqrt{2})}\right)^n \left(\frac{k n}{ln(n)}\right)^{\frac{-kn}{\ln(n)}}\left(\frac{4n}{ln(n)}\right)^{\frac{n}{\ln(n)}}</math></center> |
|||
Let us remark that <math>\left(\frac{k n}{ln(n)}\right)^{\frac{-kn}{\ln(n)}} = e^{-kn}\left(\frac{k}{ln(n)}\right)^{\frac{-kn}{\ln(n)}} </math> |
|||
and <math>\left(\frac{4n}{ln(n)}\right)^{\frac{n}{\ln(n)}} = e^{n}\left(\frac{4}{ln(n)}\right)^{\frac{n}{\ln(n)}} </math> . |
|||
Thus we have: |
|||
<center><math>\frac{S(n,k)}{L_n} \leq \left(\frac{ke^{1-k}}{4(3-2\sqrt{2})}\right)^n \left(\frac{4 k^{-k}}{ln^2(n)}\right)^{\frac{n}{\ln(n)}}</math></center> |
|||
This means that <math>\frac{S(n,k)}{L_n}</math> converges toward zero if <math>\frac{ke^{1-k}}{4(3-2\sqrt{2})} < 1</math>. |
|||
<math>ke^{1-k}</math> reaches its maximum <math>1</math> in <math>k=1</math> and <math>0 < 4(3-2\sqrt{2}) < 1</math> |
|||
This means that <math>ke^{1-k} = 4(3-2\sqrt{2})</math> has two solutions, one for <math>k > 1</math> the other for <math>k<1</math>. |
|||
Because of (i) we need to keep the first solution. It is easy to see that the first solution is smaller than 3 because |
|||
<math>3e^{1-3} < 3\frac{4}{25} < 4(3-2\sqrt{2})</math>. |
|||
Corollary. Random lambda term of size n contains asymptotically no more then <math>\frac{3 n}{ln(n)}</math> lambdas. |
|||
In the same way, we can consider lambda-terms with less than <math>\frac{k n}{ln(n)}</math> and redo exactly the same computation, |
|||
but replacing (i) by <math>\frac{k n}{ln(n)} < \frac{n+1}{\ln(e(n+1))}</math> (ii). Then we have to take <math>k</math> smaller |
|||
than the other solution of the equation, and if it easy to see that <math>k < \frac{1}{3}</math> works. |
|||
Corollary. Random lambda term of size n contains asymptotically no less then <math>\frac{n}{3 ln(n)}</math> lambdas. |
|||
Once we know this we can improve the upper bound. |
|||
Let Ll be <math>\Lambda \setminus Ls</math>. In a term from Ll the proportion between unary and binary nodes is smaller then <math>\frac{3}{ln(n)}</math> which is far from typical proportion in unary-binary trees which tends to some nonzero constant. Rough estimation gives |
|||
<math> |
|||
Ll_n \leq C(n) {n \choose \frac{3}{ln(n)}} ((1+\epsilon) \frac{n}{ln(n)})^n |
|||
</math> |
|||
where C(n) corresponds to the binary structure, <math>{n \choose \frac{3}{ln(n)}}</math> to the possible distribtions of lambdas in binary structure and <math>((1+\epsilon) \frac{n}{ln(n)})^n</math> to the possibilities of bindings (one can optimal number of unary nodes involving Lambert's function to get rid of epsilon here). The crucial observation now is that <math>{n \choose \frac{3}{ln(n)}}</math> is '''subexponential'''. |
|||
Comparing this upper bound with <math>LB(n,\frac{n}{ln (n)})</math> we would obtain that the asymptotic ratio between upper and lower bound is subexponential. |
|||
I think it has some serious consequences. In particular it seems that in a random lambda term almost all lambdas lie on one path. |
|||
'''Proposition.''' \label{prop:typical_depth} There exists a function <math>f\in\Omega\left(\frac{n}{\log(n)}\right)</math> such that the set of terms t having a <math>\lambda</math>-depth greater than <math>f(size(t))</math> has density 1. |
|||
=== Lambdas in head position === |
|||
'''Theorem'''. \label{th:starting_lambdas} Let <math>g\in o\left(\frac{n}{\log(n)}\right)</math>. The set <math>\Lambda_g</math> of terms t starting with less than <math>g(size(t))</math> lambdas has density 0. |
|||
'''Proof'''. By proposition \ref{prop:typical_depth}, for some function f such that <math>g\in o(f)</math>, we can restrict to the set <math>\Gamma_f</math> of terms t having <math>\lambda</math>-depth at least <math>f(size(t))</math> (because <math>\Gamma_f</math> has density 1). To prove the theorem it is sufficient to exhibit a one-to-one function <math>\phi</math> from <math>\Lambda_g\cap\Gamma_f</math> into <math>\Gamma_f</math> whose image set has density 0. We now define <math>\phi</math> by describing <math>\phi(t)</math> where t is an arbitrary term of size n belonging to <math>\Lambda_g\cap\Gamma_f</math>. By hypothesis, the term t starts with a chain of p <math>\lambda</math>-nodes, where <math>p\leq g(n)</math>. So <math>t=\lambda x_1\cdots\lambda x_p.A</math> where A is a term starting by an application and containing at least one <math>\lambda</math> (for n large enough). Now let B be the maximal purely applicative prefix of A. Precisely, B is the maximal binary tree whose leaves are either special leaves or variables among <math>x_1,\ldots,x_p</math> and such that <math>A=B(t_1,\ldots,t_k)</math> where <math>t_1,\ldots,t_k</math> are terms starting with a lambda, and <math>B(t_1,\ldots,t_k)</math> denotes the term obtained by replacing successive special leaves of B by terms <math>t_1,\ldots,t_k</math> respectively. By hypothesis on term t, we have <math>k\geq 1</math>. Let <math>t'_1,\ldots,t'_k</math> denote the terms obtained from <math>t_1,\ldots,t_k</math> by removing the leading lambda. |
|||
Consider the term <math>T=\lambda x_1\cdots\lambda x_p.(t'_1(t'_2(\cdots(t'_{k-1}t'_k)\cdots)</math> which is of size <math>n-1-b</math>, where b is the number of application nodes in B. Finally, let <math>U_{b,f(n)}</math> be the set of purely applicative terms of size b whose variables are chosen among a set of size <math>f(n)</math>. Consider the leftmost deepmost lambda of term T (leftmost among deepmost), and let <math>\lambda y.C</math> denote the term rooted at this position. For any <math>u\in U_{b,f(n)}</math>, we define the term <math>T(u)</math> by subsituting <math>\lambda y.C</math> with <math>\lambda y.(u.C)</math> in T and binding all variables of u according to their name to lambda above u. Firstly, <math>T(u)</math> is a well-defined closed term because the insertion of u occurs at depth at least <math>f(n)</math> and u has at most <math>f(n)</math> different variables. Secondly, <math>T(u)</math> has size exactly n. |
|||
The set <math>X_{b,p}</math> of binary trees with b internal nodes and leaves labelled either 'special' or by a variable among <math>x_1,\ldots,x_p</math> has cardinality <math>(p+1)^{b+1}C(b)</math> (where <math>C(b)</math> denotes the Catalan number). Besides, the set <math>U_{b,f(n)}</math> has carinality <math>f(n)^{b+1}C(b)</math>. Therefore, since <math>p\leq g(n)</math> and <math>g\in o(f)</math>, there exists a function <math>\rho</math> with <math>\rho(n)\rightarrow\infty</math> and a function <math>\Psi_{b,p,n}</math> from <math>X_{b,p}</math> to subsets of <math>U_{b,f(n)}</math> such that: |
|||
* for each <math>x\in X_{b,p}</math>, <math>\Psi_{b,p,n}(x)</math> contains <math>\rho(n)</math> elements; |
|||
* for n large enough, <math>x\not=x'\Rightarrow \Psi_{b,p,n}(x)\cap\Psi_{b,p,n}(x')=\emptyset</math>. |
|||
What we have established so far is the following: to term <math>t\in\Lambda_g\cap\Gamma_f</math> we assosiate '''injectively''' the 4-uple <math>(b,p,n,B,T)</math>; then, if u is the first element of <math>\Psi_{b,p,n}(B)</math> in some arbitrary (but fixed) order, we assotiate to <math>(b,p,n,B,T)</math> the term <math>\phi(t) = T(u)</math>. By hypothesis on function <math>\Psi_{b,p,n}</math> defined above, the function <math>\phi : t\mapsto \phi(t)</math> is injective for n large enough. Moreover, we have <math>\left|\phi(\Gamma_f\cap\Lambda_g\cap L_n)\right|\leq\frac{|\Gamma_f\cap L_n|}{\rho(n)}</math> so the image set of <math>\phi</math> has density 0 and the theorem follows. |
|||
=== Head lambdas bind "many" occurrences of the corresponding variables === |
|||
'''Theorem'''. \label{th:biding_lambdas} Let g and h be two functions belonging to <math>o\left(\frac{n}{\log(n)}\right)</math> and let <math>\Lambda_{g,h}</math> be the set of terms t where the total number of occurrences of variables bound to one of the <math>g(size(t))</math> head lambdas is less than <math>h(size(t))</math>. Then <math>\Lambda_{g,h}</math> has density 0. |
|||
'''Remark'''. The proof of this theorem uses arguments similar to those used in proof of theorem 'starting lambdas'. But is this theorem useful ? |
|||
Yes, since it is used in the next theorem. However, it is enough to show that for fixed integers k and k' each of k head lambdas binds at least k' variables. |
|||
[http://tcs.uj.edu.pl/~grygiel/lambdan/manyheadlambdas.pdf pdf] |
|||
[http://tcs.uj.edu.pl/~grygiel/lambdan/manyheadlambdas.tex tex] |
|||
=== every fixed closed term (including the identity !) does not appear in a random term (in fact we have much more than that) === |
=== every fixed closed term (including the identity !) does not appear in a random term (in fact we have much more than that) === |
||
Let <math>\Lambda^{t_0}</math> denote the set of lambda terms which have <math>t_0</math> as a subterm and let <math>T_k</math> be the set of those lambda trees in which the number of unbounded leaves (occurrences of free variables) is equal to <math>k</math>. |
|||
; Theorem : |
|||
For any integers <math>k</math> and <math>k'\geq k+1</math> and for any term <math>t_0 \in T_k</math> of length <math>k'</math> the following holds: |
|||
<center> |
|||
<math> \lim_{n \to \infty} \frac{\# (\Lambda_n \cap \Lambda^{t_0})}{\# \Lambda_n} =0.</math> |
|||
</center> |
|||
; Proof : |
|||
Fix <math>k</math> and <math>k'\geq k+1</math>. Let <math>t_0</math> be a lambda tree of size <math>k'</math> with exactly <math>k</math> occurrences of free variables, denoted <math>x_1,\ldots,x_k</math> (not necessarily distinct). Since there are at most <math>k'-k+1</math> occurrences of lambdas and at most <math>k'+1</math> leaves in <math>t_0</math>, there are at most |
|||
<center> |
|||
<math>K=M(k')(k'+1)^{k'+1}</math> |
|||
</center> |
|||
such trees and we can enumerate them in a fixed way. Let <math>m</math> be the number of <math>t_0</math>. The tree <math>t_0</math> contains at least one occurrence of lambda, otherwise it would either contain more free variables or would be of a bigger size. |
|||
<br /> |
|||
Let <math>n</math> be an integer satisfying <math>\sqrt{\frac{n}{\ln(n)}} \geq K</math>. |
|||
<br /> |
|||
We will construct an injective function <math>f \colon \Lambda_n \cap \Lambda^{t_0} \to \Lambda_n</math> such that its image is of density 0 in <math>\Lambda_n</math>. |
|||
<br /> |
|||
Let <math>t</math> be a term of size <math>n</math> with <math>t_0</math> as its subterm. Let us consider the tree <math>T</math> which is built from the tree <math>t</math> by adding an additional unary node (labelled with <math>\lambda x</math>) at depth <math>m</math>. Next, let <math>T'</math> be the tree obtained by replacing the subtree <math>t_0</math> in <math>T</math> by the tree <math>t_1=UB</math>, where <math>U</math> is a binary tree of size <math>k'-k-1</math> such that <math>U=x(x(\ldots (xx)\ldots))</math> and <math>B=x_1(x_2(\ldots (x_{k-1}x_k)\ldots))</math>, so the size of <math>B</math> is equal to <math>k-1</math>. Thus, the size of <math>T'</math> is equal to <math>n</math>. The variable <math>x</math> is bound by the <math>m</math>-th lambda in the tree <math>T'</math>. Let us take <math>f(t)=T'</math>. Since <math>m</math> is the number of the tree <math>t_0</math>, the function <math>f</math> is injective. |
|||
<br /> |
|||
By Theorem \ref{?}, each of <math>K</math> head lambdas in a random tree of size <math>n</math> binds more than <math>k'</math> variables. Trees from the image <math>f(\Lambda_n \cap \Lambda^{t_0})</math> do not have this property, since the <math>m</math>-th lmabda binds only <math>k'</math> variables. Thus, those trees are negligible among all trees of size <math>n</math>. |
|||
; Corollary : |
|||
Let <math>t_0</math> be a closed lambda term. Then the density of <math>\Lambda^{t_0}</math> is equal to <math>0</math>. |
|||
; Corollary : |
|||
Let <math>t_0</math> be a lambda term in which there are at least two occurrences of lambdas. Then the density of <math>\Lambda^{t_0}</math> is equal to <math>0</math>. |
|||
comment : so different situation in combinatory logic and lambda calculus ; the coding uses a big size so need to count variables in a different way |
comment : so different situation in combinatory logic and lambda calculus ; the coding uses a big size so need to count variables in a different way |
||
=== Random lambda terms are strongly normalizable === |
|||
Sketch of the proof [http://tcs.uj.edu.pl/~jkozik/LTCount/rSN.pdf pdf] [http://tcs.uj.edu.pl/~jkozik/LTCount/rSN.tex tex] |
|||
Jakub says: I think that it might be possible to simplify the proof, by using other argument for the proof that the density of the image of encoding equals 0. |
|||
Chambéry says: we checked the proof and we are convinced by the result. Since Jakub made an important step for the second time, we suggest to explicitely acknowledge his contribution in the paper (for instance, by naming some key lemma/theorems "Jakub's lemma/theorem"). Here are the points to fix in the proof: |
|||
* as René said, the definition of "dangerous redex" must be changed to allow a single occurrence of x in A (and a proof sketch of why "no dangerous redex" implies SN must be added) |
|||
* version 1 of encoding is sufficient |
|||
* in the encoding, there is some substituion of variable to do in C (to have a closed term at the end, and also to ensure that the decoding is unambiguous) |
|||
* to complete the proof with the new definition of "dangerous redex" we need the result saying that terms containing identity have density 0 (as said by Jakub by e-mail). We don't see how to conclude without that. However, we have to further check if there is no shorter proof... |
|||
== Experiments == |
== Experiments == |
||
Dernière version du 7 janvier 2009 à 16:33
counting.pdf : [1] version on wednesday 07/01 at 17h30. the files below are the good ones. René
Introduction
intro : [2]
lambda
combinatorics
section 3 : [4]
generating : [5]
bounds
main results
section 5-2
section 5-2-2 : [9]
section 5-2-3 :
[10]
section 5-2-4 : [11]
section 5-3
section 5-3-1 : [13]
section 5-3-2 :
[14]
section 5-3-3 : [15]
section 5-3-4 : [16]
other systems
section 6.1 : [18]
section 6.2 : [19]
conclusion
section 7.1 : [21]
section 7.2 : [22]
section 7.3 : [23]
biblio
appendix
appendix-1 : [26]
appendix-2 : [27]
What appears below is the old version
Known results for Turing machines and cellular automata
In this section I propose to comment on paper [28] and [29].
Guillaume says: I am very skeptical about paper 2 by D'Abramo. I suggest to replace it by the paper by Calude and Stay [30].
Lambert function, Catalan and Motzkin numbers
Catalan numbers
- : Catalan numbers
Usual equivalent: which is obtained using Strirling formula. However, using stirling formula which can be extended as the following double inequality: Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \sqrt{2\pi n}n^n e^{\left(-n+\frac{1}{12n+1}\right)} < n! <\sqrt{2\pi n}n^n e^{\left(-n+\frac{1}{12n}\right)}}
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C(n) = \frac{(2n)!}{(n+1)!n!} \geq \frac{4^n}{\sqrt{\pi} (n+1)^{\frac{3}{2}}} \left(\frac{n}{n+1}\right)^n e^{\left(1 + \frac{1}{24n+1}-\frac{1}{12 n + 12}-\frac{1}{12n}\right)}}
Thus, using this and , we have:
Then, we can check that
Thus finally for all .
Motzkin numbers
In fact, these are not usual Motzkin's numbers because in , is the number of inner nodes while usually, this is the total number of nodes, including leaves. The number we use are known as large Schroeder numbers.
Let us define the number of unary-binary trees with inner nodes and leafs. A tree with inner node leafs has exactly binary nodes and therefore . Hence we get the following formula
Then, by summing we define the number of unary-binary trees with inner nodes and give an equivalent:
Lambert W function
The Lambert function is defined by the equation which has a unique solution in .
For , we have which implies that near . To prove this, it is enough to remark that
This is not precise enough for our purpose. Using one step of the Newton method from , we can find a better upper bound for because is increasing and convex when . This gives for :
Indeed, if we define , we have and therefore, newton's method from gives a point at position:
Finally, we show that for , we have:
Indeed, for , we have , which implies and therefore .
combinatory logic
Basically the paper already written by Marek
tex file : [31]
pdf file :[32]
+ the following
As we will see in section ??, theorem ?? does not holds for the Lambda calculus. This may be surprising since there are translations between these systems which respect many properties (for exemple the one of being terminating). However these translations do not preserve the size.
The translation from combinatory logic to lambda calculus is linear, i.e. there is a constant such that, for all terms, but the translation in the other direction is not linear. As far as we know, there is no known bound on the size of but it is not difficult to find exemples where is of order .
The point is that has to code the binding in some way and this takes place. It will be interesting to compare the size of with the one of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t } using other notion of size than the usual one. See section ?? for some complement.
Generality on lambda calculus
definition
The set Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda} of lambda terms (or, simply, terms) is defined by the following grammar
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t, u := Var \ \mid \ \lambda x.t \ \mid \ (t \ u)}
To be able to define the notion of a random term we
have to define a distribution law on Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda}
. There are many
possibilities for that. We choose here the simplest one. Note that this is the one for which, at least at present, we are
able to prove some results. It is based on densities. For that we
first have to define the size of a term.
The usual definition is the following.
definition
The size (denoted as Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1(t)} ) of a term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t} is defined by the following rules.
- Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1(t)=1} if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t} is a variable.
- Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1(\lambda x.t)=size_1(t)+1}
- Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1((t \ u))=size_1(t)+size_1(u)+1}
In the rest of the paper we will use another definition (denoted
as Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_0(t)}
) which is similar but gives simpler computations.
We believe (but we have not yet checked the details) that, with
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1}
we would have similar results. The
computation, with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_1}
, of the upper and lower
bounds of the number of terms of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
will be done
in section ??
definition
The size (denoted as Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_0(t)} or, more simply Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size(t)} ) of a term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t} is defined by the following rules.
- Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_0(t)=1} if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t} is a variable.
- Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle size_0(\lambda x.t)=size_0(t)+1}
-
These definitions of the size are, for the implementation point of
view, not realistic because, in case a term has a lot of distinct
variables, it is not realistic to use a single bit to code them.
The usual way to implement this coding is to replace the names of
variables by their so called de Bruijn indices: a variable is
replaced by the number of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda}
that occur, on the
path from the variable to the root, between the variable and the
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle lambda}
that binds it. Note that, in this case,
different occurrences of the same variable may be represented by
different indices.
Choosing the way we code these de Bruijn indices gives different other ways of defining the size of a term. This can be done in the following ways
- Use unary notation, i.e. the size of the index Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} simply is Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} itself
- Use optimal binary notation, i.e. the size of the index Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} is Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle log_2(n)} i.e. the logarithm of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} in base 2.
- Use uniform binary notation, i.e. the size of an index is the logarithm, in base 2, of the number of leaves of the term.
Remark
See section ?? for a discusion about these different size.
definition
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} be an integer. We denote by Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_n} the set of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} terms of size n.
definition
Let A be a set of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} terms.
1) We denote by Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \#(A)} the cardinality of A.
2) We denote by Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle d(A)} the limit, for n going to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \infty} , of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{\#(A\cap \Lambda_n)}{\#(\Lambda_n)}} .
Remark
Note that d is not exactly a measure since Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle d(A)} is undefined if the previous limit does not exist
definition
Let P be a property of terms. We will say that almost every term satisfies P (this will be also stated as P holds a.e.) if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle d(\{t \ | \ P(t) holds\})=1}
generating functions
this does not work (by now) because radius of convergence 0
no known results for the number of terms of size n (denoted Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n} )
our results
(the proof of result of section k needs the result of section (k-1))
Upper and lower bounds for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n}
For the lower bound, we will first count the number Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle LB(n,k)} of lambda-terms of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} starting with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} lambdas and having no other lambda below. This means that the lower part of the term is a binary tree with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n-k} inner nodes with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} possibility for each leaf. Therefore we have:
And therefore, for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n > k} , using our lower bound for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C(n)} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n + 1 \geq n - k + 1} , we get:
Now, for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} fixed, we define Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(\alpha) = \left(4n\alpha\right)^{n(1-\alpha) + 1}} (so Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle LB(n,k) \geq \frac{K}{(n+1)^\frac{3}{2}} f\left(\frac{k}{n}\right)} ) and look for the maximum of this function. We have Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f'(\alpha) = f(\alpha) \left(-n\ln(4n\alpha) +\frac{n(1-\alpha) + 1}{\alpha}\right)} . Thus, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f'(\alpha) \geq 0} is equivalent to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n+1}{n\alpha}e^{\frac{n+1}{n\alpha}}\geq 4e(n+1)} . The Lambert function begin increasing this means that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f'(\alpha) \geq 0} is equivalent to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \alpha \leq \frac{n+1}{nW(4e(n+1))}} . Therefore, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(\alpha)} reaches a maximum for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \alpha = \frac{n+1}{nW(4e(n+1))}} .
This means that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle (4k)^{n-k}} reaches its maximum for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} fixed when Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} is near to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n+1}{W(4e(n+1))}} which is likely not to be an integer. However, there are at least Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \left\lfloor \frac{(n+1) (\ln(\ln(4en)) - 1)}{\ln^2(4en)}\right\rfloor} integer between Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n+1}{W(4e(n+1))}} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n+1}{\ln(4e(n+1))}} . Indeed, using our inequalities on Lambert W function, we have:
Thus, we get the following lowerbound for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n} :
To simplify, we first remove the constant Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle K} and the integer part by replacing the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \ln(\ln(4e(n+1))) - 1} term by any constant Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C} . This means that for any constant Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C} , we can take Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} large enough to have:
Then, using the facts that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n+1}{\ln(4e(n+1))} \leq \frac{n}{\ln(n)}} , Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lim_{n\to +\infty}\frac{\ln(n)}{\ln(4e(n+1))} = 1} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lim_{n\to +\infty}\left(\frac{\ln(n)}{\ln(4e(n+1))}\right)^n = 0} , we have the following lowerbound (still for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} large enough, with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C = 1} ):
We now compute an upper bound Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle UB(n,k)} for the number of lambda-terms of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} with exactly Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} lambdas (that is with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n - k + 1} leaves using the Motzkin numbers and allowing any lambda to bind any variable (regardless of the real scope):
If we sum this for all possible Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} and get an upper bound of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k^{n-k+1}} using Lambert function as for the lower bound, we get the following upper bound for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n} :
The ration between our upper bound and lower bound is equivalent to (NEEDS FURTHER CHECKING, OR IS REMOVED because we can do better using Jakob's remark at the end of 7.2):
upper and lower bounds for number of lambdas in a term of size n
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle S(n,k)} be the number of lambda term of size n containing more than lambdas. We search such that .
Using the previous notation, we may write . We observed that is decreasing in Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle p} if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle p > \frac{n+1}{W(e(n+1))}} .
Then, we have Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle W(e(n+1)) \geq \ln(e(n+1)) - \ln(\ln(e(n+1)))} . Therefore, if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{k n}{ln(n)} > \frac{n+1}{\ln(e(n+1)) - \ln(\ln(e(n+1)))}} (i), we have
Then, (i) is equivalent to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{k n}{n+1} > \frac{ln(n)}{\ln(e(n+1)) - \ln(\ln(e(n+1)))}} which is true for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} large enough if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k>1} because Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lim_{n \rightarrow +\infty} \frac{ln(n)}{\ln(e(n+1)) - \ln(\ln(e(n+1)))} = 1} .
Using our lower bound for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n} , we find
We now use the fact that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle M(n) \sim \left(\frac{1}{3-2\sqrt{2}}\right)^n \frac{1}{n^\frac{3}{2}}} , for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n} large enough, we have (we introduce an extra log to compensate for the equivalent)
We get a simpler upper bound by using the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n^2} to compensate for the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle +1} exponent and the remaining Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k\frac{\ln^4(n)}{\ln(n)}} , which gives:
Let us remark that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \left(\frac{k n}{ln(n)}\right)^{\frac{-kn}{\ln(n)}} = e^{-kn}\left(\frac{k}{ln(n)}\right)^{\frac{-kn}{\ln(n)}} } and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \left(\frac{4n}{ln(n)}\right)^{\frac{n}{\ln(n)}} = e^{n}\left(\frac{4}{ln(n)}\right)^{\frac{n}{\ln(n)}} } .
Thus we have:
This means that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{S(n,k)}{L_n}} converges toward zero if Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{ke^{1-k}}{4(3-2\sqrt{2})} < 1} . Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle ke^{1-k}} reaches its maximum Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle 1} in Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k=1} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle 0 < 4(3-2\sqrt{2}) < 1} This means that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle ke^{1-k} = 4(3-2\sqrt{2})} has two solutions, one for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k > 1} the other for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k<1} . Because of (i) we need to keep the first solution. It is easy to see that the first solution is smaller than 3 because .
Corollary. Random lambda term of size n contains asymptotically no more then Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{3 n}{ln(n)}} lambdas.
In the same way, we can consider lambda-terms with less than Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{k n}{ln(n)}} and redo exactly the same computation, but replacing (i) by Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{k n}{ln(n)} < \frac{n+1}{\ln(e(n+1))}} (ii). Then we have to take Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} smaller than the other solution of the equation, and if it easy to see that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k < \frac{1}{3}} works.
Corollary. Random lambda term of size n contains asymptotically no less then Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{n}{3 ln(n)}} lambdas.
Once we know this we can improve the upper bound.
Let Ll be Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda \setminus Ls} . In a term from Ll the proportion between unary and binary nodes is smaller then Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \frac{3}{ln(n)}} which is far from typical proportion in unary-binary trees which tends to some nonzero constant. Rough estimation gives
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle Ll_n \leq C(n) {n \choose \frac{3}{ln(n)}} ((1+\epsilon) \frac{n}{ln(n)})^n }
where C(n) corresponds to the binary structure, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle {n \choose \frac{3}{ln(n)}}} to the possible distribtions of lambdas in binary structure and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle ((1+\epsilon) \frac{n}{ln(n)})^n} to the possibilities of bindings (one can optimal number of unary nodes involving Lambert's function to get rid of epsilon here). The crucial observation now is that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle {n \choose \frac{3}{ln(n)}}} is subexponential.
Comparing this upper bound with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle LB(n,\frac{n}{ln (n)})} we would obtain that the asymptotic ratio between upper and lower bound is subexponential.
I think it has some serious consequences. In particular it seems that in a random lambda term almost all lambdas lie on one path.
Proposition. \label{prop:typical_depth} There exists a function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f\in\Omega\left(\frac{n}{\log(n)}\right)} such that the set of terms t having a Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} -depth greater than Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(size(t))} has density 1.
Lambdas in head position
Theorem. \label{th:starting_lambdas} Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle g\in o\left(\frac{n}{\log(n)}\right)} . The set Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_g} of terms t starting with less than Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle g(size(t))} lambdas has density 0.
Proof. By proposition \ref{prop:typical_depth}, for some function f such that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle g\in o(f)} , we can restrict to the set Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Gamma_f} of terms t having Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} -depth at least Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(size(t))} (because Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Gamma_f} has density 1). To prove the theorem it is sufficient to exhibit a one-to-one function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi} from Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_g\cap\Gamma_f} into Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Gamma_f} whose image set has density 0. We now define Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi} by describing Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi(t)} where t is an arbitrary term of size n belonging to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_g\cap\Gamma_f} . By hypothesis, the term t starts with a chain of p Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} -nodes, where Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle p\leq g(n)} . So Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t=\lambda x_1\cdots\lambda x_p.A} where A is a term starting by an application and containing at least one Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda} (for n large enough). Now let B be the maximal purely applicative prefix of A. Precisely, B is the maximal binary tree whose leaves are either special leaves or variables among Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x_1,\ldots,x_p} and such that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle A=B(t_1,\ldots,t_k)} where Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_1,\ldots,t_k} are terms starting with a lambda, and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle B(t_1,\ldots,t_k)} denotes the term obtained by replacing successive special leaves of B by terms Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_1,\ldots,t_k} respectively. By hypothesis on term t, we have Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k\geq 1} . Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t'_1,\ldots,t'_k} denote the terms obtained from Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_1,\ldots,t_k} by removing the leading lambda. Consider the term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T=\lambda x_1\cdots\lambda x_p.(t'_1(t'_2(\cdots(t'_{k-1}t'_k)\cdots)} which is of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n-1-b} , where b is the number of application nodes in B. Finally, let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle U_{b,f(n)}} be the set of purely applicative terms of size b whose variables are chosen among a set of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(n)} . Consider the leftmost deepmost lambda of term T (leftmost among deepmost), and let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda y.C} denote the term rooted at this position. For any Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle u\in U_{b,f(n)}} , we define the term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T(u)} by subsituting Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda y.C} with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda y.(u.C)} in T and binding all variables of u according to their name to lambda above u. Firstly, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T(u)} is a well-defined closed term because the insertion of u occurs at depth at least Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(n)} and u has at most Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(n)} different variables. Secondly, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T(u)} has size exactly n.
The set Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle X_{b,p}} of binary trees with b internal nodes and leaves labelled either 'special' or by a variable among Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x_1,\ldots,x_p} has cardinality Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle (p+1)^{b+1}C(b)} (where Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle C(b)} denotes the Catalan number). Besides, the set Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle U_{b,f(n)}} has carinality Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(n)^{b+1}C(b)} . Therefore, since Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle p\leq g(n)} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle g\in o(f)} , there exists a function with and a function from to subsets of such that:
- for each Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x\in X_{b,p}} , Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Psi_{b,p,n}(x)} contains Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \rho(n)} elements;
- for n large enough, Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x\not=x'\Rightarrow \Psi_{b,p,n}(x)\cap\Psi_{b,p,n}(x')=\emptyset} .
What we have established so far is the following: to term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t\in\Lambda_g\cap\Gamma_f} we assosiate injectively the 4-uple Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle (b,p,n,B,T)} ; then, if u is the first element of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Psi_{b,p,n}(B)} in some arbitrary (but fixed) order, we assotiate to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle (b,p,n,B,T)} the term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi(t) = T(u)} . By hypothesis on function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Psi_{b,p,n}} defined above, the function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi : t\mapsto \phi(t)} is injective for n large enough. Moreover, we have Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \left|\phi(\Gamma_f\cap\Lambda_g\cap L_n)\right|\leq\frac{|\Gamma_f\cap L_n|}{\rho(n)}} so the image set of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \phi} has density 0 and the theorem follows.
Head lambdas bind "many" occurrences of the corresponding variables
Theorem. \label{th:biding_lambdas} Let g and h be two functions belonging to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle o\left(\frac{n}{\log(n)}\right)} and let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_{g,h}} be the set of terms t where the total number of occurrences of variables bound to one of the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle g(size(t))} head lambdas is less than Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle h(size(t))} . Then Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_{g,h}} has density 0.
Remark. The proof of this theorem uses arguments similar to those used in proof of theorem 'starting lambdas'. But is this theorem useful ?
Yes, since it is used in the next theorem. However, it is enough to show that for fixed integers k and k' each of k head lambdas binds at least k' variables.
every fixed closed term (including the identity !) does not appear in a random term (in fact we have much more than that)
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda^{t_0}} denote the set of lambda terms which have Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} as a subterm and let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T_k} be the set of those lambda trees in which the number of unbounded leaves (occurrences of free variables) is equal to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} .
- Theorem
For any integers Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'\geq k+1} and for any term Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0 \in T_k} of length Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'} the following holds:
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lim_{n \to \infty} \frac{\# (\Lambda_n \cap \Lambda^{t_0})}{\# \Lambda_n} =0.}
- Proof
Fix Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'\geq k+1} . Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} be a lambda tree of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'} with exactly Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k} occurrences of free variables, denoted Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x_1,\ldots,x_k} (not necessarily distinct). Since there are at most Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'-k+1} occurrences of lambdas and at most Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'+1} leaves in Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} , there are at most
Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle K=M(k')(k'+1)^{k'+1}}
such trees and we can enumerate them in a fixed way. Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle m} be the number of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} . The tree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} contains at least one occurrence of lambda, otherwise it would either contain more free variables or would be of a bigger size.
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
be an integer satisfying Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \sqrt{\frac{n}{\ln(n)}} \geq K}
.
We will construct an injective function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f \colon \Lambda_n \cap \Lambda^{t_0} \to \Lambda_n}
such that its image is of density 0 in Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda_n}
.
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t}
be a term of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0}
as its subterm. Let us consider the tree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T}
which is built from the tree by adding an additional unary node (labelled with Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda x}
) at depth Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle m}
. Next, let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T'}
be the tree obtained by replacing the subtree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0}
in Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T}
by the tree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_1=UB}
, where Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle U}
is a binary tree of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'-k-1}
such that Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle U=x(x(\ldots (xx)\ldots))}
and Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle B=x_1(x_2(\ldots (x_{k-1}x_k)\ldots))}
, so the size of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle B}
is equal to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k-1}
. Thus, the size of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T'}
is equal to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
. The variable Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle x}
is bound by the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle m}
-th lambda in the tree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle T'}
. Let us take Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(t)=T'}
. Since Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle m}
is the number of the tree Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0}
, the function Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f}
is injective.
By Theorem \ref{?}, each of head lambdas in a random tree of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
binds more than Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'}
variables. Trees from the image Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle f(\Lambda_n \cap \Lambda^{t_0})}
do not have this property, since the Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle m}
-th lmabda binds only Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle k'}
variables. Thus, those trees are negligible among all trees of size Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle n}
.
- Corollary
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} be a closed lambda term. Then the density of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda^{t_0}} is equal to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle 0} .
- Corollary
Let Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle t_0} be a lambda term in which there are at least two occurrences of lambdas. Then the density of Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \Lambda^{t_0}} is equal to Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle 0} .
comment : so different situation in combinatory logic and lambda calculus ; the coding uses a big size so need to count variables in a different way
Random lambda terms are strongly normalizable
Jakub says: I think that it might be possible to simplify the proof, by using other argument for the proof that the density of the image of encoding equals 0.
Chambéry says: we checked the proof and we are convinced by the result. Since Jakub made an important step for the second time, we suggest to explicitely acknowledge his contribution in the paper (for instance, by naming some key lemma/theorems "Jakub's lemma/theorem"). Here are the points to fix in the proof:
- as René said, the definition of "dangerous redex" must be changed to allow a single occurrence of x in A (and a proof sketch of why "no dangerous redex" implies SN must be added)
- version 1 of encoding is sufficient
- in the encoding, there is some substituion of variable to do in C (to have a closed term at the end, and also to ensure that the decoding is unambiguous)
- to complete the proof with the new definition of "dangerous redex" we need the result saying that terms containing identity have density 0 (as said by Jakub by e-mail). We don't see how to conclude without that. However, we have to further check if there is no shorter proof...
Experiments
results of the experiments we have done
some experiments that have to be done : e.g. density of terms having Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle \lambda x.y} or big Omega pattern ...
to be done
Upper and lower bounds for Échec de l’analyse (SVG (MathML peut être activé via une extension du navigateur) : réponse non valide(« Math extension cannot connect to Restbase. ») du serveur « https://wikimedia.org/api/rest_v1/ » :): {\displaystyle L_n} with other size for variables especially one, binary with fixed size
Open questions and Future work
.....