| Some definitions of interest. |
|
count_pairs | Def count(x < y in L | P(x;y))
Def == sum(if (i<j)P(L[i];L[j]) 1 else 0 fi | i < ||L||; j < ||L||) |
| | Thm* T:Type, L:T List, P:(TT). count(x < y in L | P(x,y)) |
|
band | Def pq == if p q else false fi |
| | Thm* p,q:. (pq) |
|
double_sum | Def sum(f(x;y) | x < n; y < m) == sum(sum(f(x;y) | y < m) | x < n) |
| | Thm* n,m:, f:(nm). sum(f(x,y) | x < n; y < m) |
|
nat | Def == {i:| 0i } |
| | Thm* Type |
|
le | Def AB == B<A |
| | Thm* i,j:. (ij) Prop |
|
length | Def ||as|| == Case of as; nil 0 ; a.as' ||as'||+1 (recursive) |
| | Thm* A:Type, l:A List. ||l|| |
| | Thm* ||nil|| |
|
select | Def l[i] == hd(nth_tl(i;l)) |
| | Thm* A:Type, l:A List, n:. 0n n<||l|| l[n] A |
|
lt_int | Def i<j == if i<j true ; false fi |
| | Thm* i,j:. (i<j) |