File: theorems.tex

package info (click to toggle)
hol88 2.02.19940316-35
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 65,988 kB
  • ctags: 21,623
  • sloc: ml: 199,939; ansic: 9,666; sh: 7,118; makefile: 6,095; lisp: 2,747; yacc: 894; sed: 201; cpp: 87; awk: 5
file content (404 lines) | stat: -rw-r--r-- 11,378 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
\chapter{Pre-proved Theorems}\label{thms}\input{theorems-intro}\section{Theorems about Inequalities}\THEOREM GEN\_INDUCTION ineq
|- !P. P 0 /\ (!n. (!m. m < n ==> P m) ==> P n) ==> (!n. P n)
\ENDTHEOREM
\THEOREM GREATER\_EQ\_ANTISYM ineq
|- !n m. ~(n >= m /\ n < m)
\ENDTHEOREM
\THEOREM LESS\_EQ\_LESS\_EQ\_EQ ineq
|- !m n. m <= n /\ n <= m = (m = n)
\ENDTHEOREM
\THEOREM LESS\_IS\_NOT\_LESS\_OR\_EQ ineq
|- !x y. x < y = ~y <= x
\ENDTHEOREM
\THEOREM NOT\_EQ\_LESS\_EQ ineq
|- !a b. ~(a = b) = a < b \/ b < a
\ENDTHEOREM
\THEOREM NOT\_LESS\_AND\_GREATER ineq
|- !n m. n < m ==> ~m < n
\ENDTHEOREM
\section{Theorems about {\tt 0}}\THEOREM GREATER\_NOT\_ZERO zero\_ineq
|- !x. 0 < x ==> ~(x = 0)
\ENDTHEOREM
\THEOREM LESS1EQ0 zero\_ineq
|- !m. m < 1 = (m = 0)
\ENDTHEOREM
\THEOREM LESS\_EQ\_0\_EQ zero\_ineq
|- !m. m <= 0 ==> (m = 0)
\ENDTHEOREM
\THEOREM M\_LESS\_0\_LESS zero\_ineq
|- !m n. m < n ==> 0 < n
\ENDTHEOREM
\THEOREM NOT\_0\_AND\_MORE zero\_ineq
|- !x. ~((x = 0) /\ 0 < x)
\ENDTHEOREM
\THEOREM NOT\_EQ\_0 zero\_ineq
|- !m. ~(m = 0) ==> m >= 1
\ENDTHEOREM
\section{Theorems about {\tt SUC}}\THEOREM LESS\_EQ\_LESS\_SUC suc
|- !m n. m <= n = m < (SUC n)
\ENDTHEOREM
\THEOREM NOT\_0\_GREATER\_EQ\_SUC suc
|- !n. ~0 >= (SUC n)
\ENDTHEOREM
\THEOREM NOT\_FORALL\_SUC\_LESS\_EQ suc
|- ~(!n m. (SUC m) <= n)
\ENDTHEOREM
\THEOREM NOT\_SUC\_LESS\_EQ\_SELF suc
|- !n. ~(SUC n) <= n
\ENDTHEOREM
\THEOREM SUC\_0 suc
|- 1 = SUC 0
\ENDTHEOREM
\THEOREM SUC\_GREATER\_EQ\_SUC suc
|- !n m. (SUC m) >= (SUC n) = m >= n
\ENDTHEOREM
\THEOREM SUC\_LESS\_EQ suc
|- !m n. m <= n /\ ~(m = n) ==> (SUC m) <= n
\ENDTHEOREM
\THEOREM SUC\_NOT\_0 suc
|- !n. ~(SUC n = 0)
\ENDTHEOREM
\section{Theorems about {\tt PRE}}\THEOREM LESS\_IMP\_LESS\_EQ\_PRE pre
|- !m n. 0 < n ==> (m < n = m <= (PRE n))
\ENDTHEOREM
\THEOREM PRE\_ADD pre
|- !n m. 0 < n ==> (PRE(n + m) = (PRE n) + m)
\ENDTHEOREM
\THEOREM PRE\_K\_K pre
|- !k. 0 < k ==> (PRE k) < k
\ENDTHEOREM
\THEOREM PRE\_LESS pre
|- !b. 0 < b /\ b < a ==> (PRE b) < a
\ENDTHEOREM
\THEOREM PRE\_LESS\_EQ pre
|- !n. (PRE n) <= n
\ENDTHEOREM
\THEOREM PRE\_MONO pre
|- !m n. (PRE m) < (PRE n) ==> m < n
\ENDTHEOREM
\THEOREM PRE\_MONO\_LESS\_EQ pre
|- !m n. m < n ==> (PRE m) <= (PRE n)
\ENDTHEOREM
\THEOREM SUC\_LESS\_EQ\_PRE pre
|- !m n. 0 < n ==> (SUC m) <= n ==> m <= (PRE n)
\ENDTHEOREM
\THEOREM SUC\_LESS\_PRE pre
|- !m n. (SUC m) < n ==> m < (PRE n)
\ENDTHEOREM
\THEOREM SUC\_PRE pre
|- !n. 0 < n ==> (SUC(PRE n) = n)
\ENDTHEOREM
\section{Theorems about Addition}\THEOREM ADD\_EQ\_LESS\_EQ add
|- !m n p. (m + n = p) ==> m <= p
\ENDTHEOREM
\THEOREM ADD\_EQ\_LESS\_IMP\_LESS add
|- !n m k l. (k + m = l + n) /\ k < l ==> n < m
\ENDTHEOREM
\THEOREM ADD\_GREATER\_EQ add
|- !m n. (m + n) >= m
\ENDTHEOREM
\THEOREM ADDL\_GREATER add
|- !m n p. m < n ==> m < (p + n)
\ENDTHEOREM
\THEOREM ADDL\_GREATER\_EQ add
|- !m n p. m <= n ==> m <= (p + n)
\ENDTHEOREM
\THEOREM ADD\_MONO\_LESS add
|- !m n p. (m + p) < (m + n) = p < n
\ENDTHEOREM
\THEOREM ADDR\_GREATER add
|- !m n p. m < n ==> m < (n + p)
\ENDTHEOREM
\THEOREM ADDR\_GREATER\_EQ add
|- !m n p. m <= n ==> m <= (n + p)
\ENDTHEOREM
\THEOREM ADD\_SUC\_0 add
|- !m. SUC m = (SUC 0) + m
\ENDTHEOREM
\THEOREM ADD\_SYM\_ASSOC add
|- !a b c. a + (b + c) = b + (a + c)
\ENDTHEOREM
\THEOREM GREATER\_EQ\_SPLIT add
|- !m n p. p >= (m + n) ==> p >= n /\ p >= m
\ENDTHEOREM
\THEOREM LESS\_ADD1 add
|- !a. a < (a + 1)
\ENDTHEOREM
\THEOREM LESS\_ADD\_ASSOC add
|- !a b c d. a < (b + c) ==> a < (b + (c + d))
\ENDTHEOREM
\THEOREM LESS\_EQ\_ADD1 add
|- !p n. p <= (n + p)
\ENDTHEOREM
\THEOREM LESS\_EQ\_MONO\_ADD\_EQ0 add
|- !m n p. m <= n = (p + m) <= (p + n)
\ENDTHEOREM
\THEOREM LESS\_EQ\_MONO\_ADD\_EQ1 add
|- !m p. (m + p) <= p = m <= 0
\ENDTHEOREM
\THEOREM LESS\_EQ\_SPLIT add
|- !m n p. (m + n) <= p ==> n <= p /\ m <= p
\ENDTHEOREM
\THEOREM LESS\_LESS\_EQ add
|- !a b. a < b = (a + 1) <= b
\ENDTHEOREM
\THEOREM LESS\_LESS\_EQ\_MONO add
|- (!m n p q. m < p /\ n <= q ==> (m + n) < (p + q)) /\
   (!m n p q. m <= p /\ n < q ==> (m + n) < (p + q))
\ENDTHEOREM
\THEOREM LESS\_LESS\_MONO add
|- !m n p q. m < p /\ n < q ==> (m + n) < (p + q)
\ENDTHEOREM
\THEOREM LESS\_TRANS\_ADD add
|- !m n p q. m < (n + p) /\ p < q ==> m < (n + q)
\ENDTHEOREM
\THEOREM NOT\_1\_TWICE add
|- !n. ~(1 = n + n)
\ENDTHEOREM
\THEOREM NOT\_ADD\_LESS add
|- !m n. ~(m + n) < n
\ENDTHEOREM
\THEOREM NOT\_LESS\_IMP\_LESS\_EQ\_ADD1 add
|- !a b. ~a < b ==> b <= (a + 1)
\ENDTHEOREM
\THEOREM SUC\_LESS\_N\_LESS add
|- !m n. (m + 1) < n ==> m < n
\ENDTHEOREM
\THEOREM SUM\_LESS add
|- !m n p. (m + n) < p ==> m < p /\ n < p
\ENDTHEOREM
\section{Theorems about Subtraction}\THEOREM ADD\_EQ\_IMP\_SUB\_EQ sub
|- !a b c. (a = b + c) ==> (a - b = c)
\ENDTHEOREM
\THEOREM ADD\_LESS\_EQ\_SUB sub
|- !n m p. n <= p ==> ((n + m) <= p = m <= (p - n))
\ENDTHEOREM
\THEOREM ADD\_SUB\_SYM sub
|- !a c. (c + a) - c = a
\ENDTHEOREM
\THEOREM GREATER\_EQ\_SUB\_LESS\_TO\_ADD sub
|- !n m p. p >= n ==> ((p - n) < m = p < (n + m))
\ENDTHEOREM
\THEOREM LESS\_EQ\_ADD\_SUB1 sub
|- !m n p. p <= n ==> (m + (n - p) = (m + n) - p)
\ENDTHEOREM
\THEOREM LESS\_EQ\_SUB\_1 sub
|- !a b. a <= b ==> (a - 1) <= (b - 1)
\ENDTHEOREM
\THEOREM LESS\_EQ\_SUB\_ADD sub
|- !m n p. p <= m ==> ((m - p) + n = (m + n) - p)
\ENDTHEOREM
\THEOREM LESS\_PRE sub
|- !i m. i < (m - 1) ==> i < m
\ENDTHEOREM
\THEOREM LESS\_SUB\_IMP\_INV sub
|- !k l. 0 < (k - l) ==> l < k
\ENDTHEOREM
\THEOREM LESS\_SUB\_IMP\_SUM\_LESS sub
|- !i m. i < (m - 1) /\ 1 < m ==> (i + 1) < m
\ENDTHEOREM
\THEOREM LESS\_SUB\_TO\_ADDL\_LESS sub
|- !m n p. n <= m ==> (p < (m - n) = (n + p) < m)
\ENDTHEOREM
\THEOREM LESS\_SUB\_TO\_ADDR\_LESS sub
|- !m n p. p <= m ==> (n < (m - p) = (n + p) < m)
\ENDTHEOREM
\THEOREM LESS\_TWICE\_IMP\_LESS\_SUB sub
|- !a b m. a < m /\ b < m /\ m <= (a + b) ==> ((a + b) - m) < m
\ENDTHEOREM
\THEOREM NOT\_0\_SUB sub
|- !m n. ~(m - n = 0) ==> ~(m = 0)
\ENDTHEOREM
\THEOREM NOT\_LESS\_SUB sub
|- !m n. ~m < (m - n)
\ENDTHEOREM
\THEOREM NOT\_SUB\_0 sub
|- !m n. m < n ==> ~(n - m = 0)
\ENDTHEOREM
\THEOREM PRE\_LESS\_LESS\_SUC sub
|- !i m. i < (m - 1) /\ 0 < m ==> (i + 1) < m
\ENDTHEOREM
\THEOREM PRE\_SUB\_SUC sub
|- !m n. m < n ==> (PRE(n - m) = n - (SUC m))
\ENDTHEOREM
\THEOREM SMALLER\_SUM sub
|- !m n p. m < p /\ n < p ==> ~((m + n) - p) > m
\ENDTHEOREM
\THEOREM SUB\_1\_LESS sub
|- !m n. ~(m = 0) /\ m < (SUC n) ==> (m - 1) < n
\ENDTHEOREM
\THEOREM SUB\_1\_LESS\_EQ sub
|- !m n. m < n ==> (n - 1) >= m
\ENDTHEOREM
\THEOREM SUB\_ADD\_SELF sub
|- !m n. ~m < n ==> ((m - n) + n = m)
\ENDTHEOREM
\THEOREM SUB\_BOTH\_SIDES sub
|- !m n p. (m = n) ==> (m - p = n - p)
\ENDTHEOREM
\THEOREM SUB\_EQ\_SUB\_ADD\_SUB sub
|- !a b c. a <= b /\ b <= c ==> (c - a = (c - b) + (b - a))
\ENDTHEOREM
\THEOREM SUB\_GREATER\_0 sub
|- !a b. a < b ==> (b - a) > 0
\ENDTHEOREM
\THEOREM SUB\_GREATER\_EQ\_ADD sub
|- !n m p. p >= n ==> ((p - n) >= m = p >= (n + m))
\ENDTHEOREM
\THEOREM SUB\_LE\_ADD sub
|- !n m p. n <= p ==> (m <= (p - n) = (n + m) <= p)
\ENDTHEOREM
\THEOREM SUB\_LESS\_BOTH\_SIDES sub
|- !m n p. p <= m /\ m < n ==> (m - p) < (n - p)
\ENDTHEOREM
\THEOREM SUB\_LESS\_EQ\_SUB1 sub
|- !x. x > 0 ==> (!a. (a - x) <= (a - 1))
\ENDTHEOREM
\THEOREM SUB\_LESS\_EQ\_SUB\_SUC sub
|- !a b c n. 0 < c /\ a <= (b - n) ==> (a - c) <= (b - (SUC n))
\ENDTHEOREM
\THEOREM SUB\_LESS\_TO\_LESS\_ADDL sub
|- !m n p. n <= m ==> ((m - n) < p = m < (n + p))
\ENDTHEOREM
\THEOREM SUB\_LESS\_TO\_LESS\_ADDR sub
|- !m n p. p <= m ==> ((m - p) < n = m < (n + p))
\ENDTHEOREM
\THEOREM SUB\_PRE\_SUB\_1 sub
|- !a b. 0 < b ==> ((a - (PRE b)) - 1 = a - b)
\ENDTHEOREM
\THEOREM SUB\_SUB\_ID sub
|- !k l. l < k ==> (k - (k - l) = l)
\ENDTHEOREM
\THEOREM SUB\_SUC sub
|- !k m. m < k ==> (k - m = SUC(k - (SUC m)))
\ENDTHEOREM
\THEOREM SUB\_SUC\_PRE\_SUB sub
|- !n m. 0 < n ==> (n - (SUC m) = (PRE n) - m)
\ENDTHEOREM
\THEOREM SUC\_SUB sub
|- !m n.
    (m < n ==> ((SUC m) - n = 0)) /\
    (~m < n ==> ((SUC m) - n = SUC(m - n)))
\ENDTHEOREM
\section{Theorems about Multiplication and Exponential Functions}\THEOREM EXP1 mult
|- !n. n EXP 1 = n
\ENDTHEOREM
\THEOREM LESS\_MONO\_MULT1 mult
|- !m n p. m <= n ==> (p * m) <= (p * n)
\ENDTHEOREM
\THEOREM LESS\_MULT\_PLUS\_DIFF mult
|- !n k l. k < l ==> ((k * n) + n) <= (l * n)
\ENDTHEOREM
\THEOREM NOT\_MULT\_LESS\_0 mult
|- !m n. 0 < m /\ 0 < n ==> 0 < (m * n)
\ENDTHEOREM
\THEOREM ONE\_LESS\_EQ\_TWO\_EXP mult
|- !n. 1 <= (2 EXP n)
\ENDTHEOREM
\THEOREM ONE\_LESS\_TWO\_EXP\_SUC mult
|- !n. 1 < (2 EXP (SUC n))
\ENDTHEOREM
\THEOREM ZERO\_LESS\_TWO\_EXP mult
|- !n. 0 < (2 EXP n)
\ENDTHEOREM
\section{Theorems about Division}\THEOREM ADD\_DIV\_ADD\_DIV div\_mod
|- !n. 0 < n ==> (!x r. ((x * n) + r) DIV n = x + (r DIV n))
\ENDTHEOREM
\THEOREM ADD\_DIV\_SUC\_DIV div\_mod
|- !n. 0 < n ==> (!r. (n + r) DIV n = SUC(r DIV n))
\ENDTHEOREM
\THEOREM DIV\_DIV\_DIV\_MULT div\_mod
|- !m n. 0 < m /\ 0 < n ==> (!x. (x DIV m) DIV n = x DIV (m * n))
\ENDTHEOREM
\THEOREM DIV\_ONE div\_mod
|- !q. q DIV (SUC 0) = q
\ENDTHEOREM
\THEOREM LESS\_DIV\_EQ\_ZERO div\_mod
|- !r n. r < n ==> (r DIV n = 0)
\ENDTHEOREM
\THEOREM LESS\_EQ\_MONO\_DIV div\_mod
|- !n. 0 < n ==> (!p q. p <= q ==> (p DIV n) <= (q DIV n))
\ENDTHEOREM
\THEOREM MOD\_MULT\_MOD div\_mod
|- !m n. 0 < n /\ 0 < m ==> (!x. (x MOD (n * m)) MOD n = x MOD n)
\ENDTHEOREM
\THEOREM MULT\_DIV div\_mod
|- !n q. 0 < n ==> ((q * n) DIV n = q)
\ENDTHEOREM
\THEOREM SUC\_DIV\_CASES div\_mod
|- !n.
    0 < n ==>
    (!x. ((SUC x) DIV n = x DIV n) \/ ((SUC x) DIV n = SUC(x DIV n)))
\ENDTHEOREM
\THEOREM SUC\_DIV\_SELF div\_mod
|- !n. (SUC n) DIV (SUC n) = 1
\ENDTHEOREM
\THEOREM SUC\_MOD div\_mod
|- !n m. (SUC n) < m ==> ((SUC n) MOD m = SUC(n MOD m))
\ENDTHEOREM
\THEOREM SUC\_MOD\_SELF div\_mod
|- !n. (SUC n) MOD (SUC n) = 0
\ENDTHEOREM
\section{Theorems about Maximum and Minimum}\THEOREM MAX\_0 min\_max
|- !n. MAX 0 n = n
\ENDTHEOREM
\THEOREM MAX\_DEF min\_max
|- !n p. MAX n p = (n <= p => p | n)
\ENDTHEOREM
\THEOREM MAX\_REFL min\_max
|- !n. MAX n n = n
\ENDTHEOREM
\THEOREM MAX\_SUC min\_max
|- !n. MAX n(SUC n) = SUC n
\ENDTHEOREM
\THEOREM MAX\_SYM min\_max
|- !n p. MAX n p = MAX p n
\ENDTHEOREM
\THEOREM MIN\_0 min\_max
|- !n. MIN 0 n = 0
\ENDTHEOREM
\THEOREM MIN\_DEF min\_max
|- !n p. MIN n p = (n <= p => n | p)
\ENDTHEOREM
\THEOREM MIN\_REFL min\_max
|- !n. MIN n n = n
\ENDTHEOREM
\THEOREM MIN\_SUC min\_max
|- !n. MIN n(SUC n) = n
\ENDTHEOREM
\THEOREM MIN\_SYM min\_max
|- !n p. MIN n p = MIN p n
\ENDTHEOREM
\THEOREM SUC\_MAX min\_max
|- !n p. MAX(SUC n)(SUC p) = SUC(MAX n p)
\ENDTHEOREM
\THEOREM SUC\_MIN min\_max
|- !n p. MIN(SUC n)(SUC p) = SUC(MIN n p)
\ENDTHEOREM
\section{Theorems about Odd and Even Numbers}\THEOREM EVEN\_MULT odd\_even
|- !n m. EVEN n \/ EVEN m ==> EVEN(n * m)
\ENDTHEOREM
\THEOREM EVEN\_ODD\_0 odd\_even
|- EVEN 0 /\ ~ODD 0
\ENDTHEOREM
\THEOREM EVEN\_ODD\_PLUS\_CASES odd\_even
|- !n m.
    (ODD n /\ ODD m ==> EVEN(n + m)) /\
    (ODD n /\ EVEN m ==> ODD(n + m)) /\
    (EVEN n /\ EVEN m ==> EVEN(n + m))
\ENDTHEOREM
\THEOREM EVEN\_ODD\_SUC odd\_even
|- !n. (EVEN(SUC n) = ODD n) /\ (ODD(SUC n) = EVEN n)
\ENDTHEOREM
\THEOREM MULT\_EVEN odd\_even
|- !n m. EVEN(n * m) ==> EVEN n \/ EVEN m
\ENDTHEOREM
\THEOREM MULT\_ODD odd\_even
|- !n m. ODD(n * m) ==> ODD n /\ ODD m
\ENDTHEOREM
\THEOREM NOT\_EVEN\_ODD\_SUC\_EVEN\_ODD odd\_even
|- !n. (~EVEN(SUC n) = EVEN n) /\ (~ODD(SUC n) = ODD n)
\ENDTHEOREM
\THEOREM ODD\_MULT odd\_even
|- !n m. ODD n /\ ODD m ==> ODD(n * m)
\ENDTHEOREM