-
Notifications
You must be signed in to change notification settings - Fork 90
/
demo0.mm
80 lines (58 loc) · 2.23 KB
/
demo0.mm
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
$( This is the Metamath database demo0.mm. $)
$( Metamath is a formal language and associated computer program for
archiving, verifying, and studying mathematical proofs, created by Norman
Dwight Megill (1950--2021). For more information, visit
https://us.metamath.org and
https://github.com/metamath/set.mm, and feel free to ask questions at
https://groups.google.com/g/metamath. $)
$( The database demo0.mm was created by Norman Megill. This is the version
of 1-Jan-2004. $)
$( !
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
Metamath source file demo0.mm
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
~~ PUBLIC DOMAIN ~~
This work is waived of all rights, including copyright, according to the CC0
Public Domain Dedication. https://creativecommons.org/publicdomain/zero/1.0/
Norman Megill - https://us.metamath.org
$)
$(
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
demo0.mm: An introductory formal system example
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
This file is the introductory formal system example described in Chapter 2 of
the Metamath book.
$)
$( Declare the constant symbols we will use. $)
$c 0 + = -> ( ) term wff |- $.
$( Declare the metavariables we will use. $)
$v t r s P Q $.
$( Specify properties of the metavariables. $)
tt $f term t $.
tr $f term r $.
ts $f term s $.
wp $f wff P $.
wq $f wff Q $.
$( Define "term" (part 1 of 2). $)
tze $a term 0 $.
$( Define "term" (part 2 of 2). $)
tpl $a term ( t + r ) $.
$( Define "wff" (part 1 of 2). $)
weq $a wff t = r $.
$( Define "wff" (part 2 of 2). $)
wim $a wff ( P -> Q ) $.
$( State Axiom ~ a1 . $)
a1 $a |- ( t = r -> ( t = s -> r = s ) ) $.
$( State Axiom ~ a2 . $)
a2 $a |- ( t + 0 ) = t $.
${
min $e |- P $.
maj $e |- ( P -> Q ) $.
$( Define the modus ponens inference rule. $)
mp $a |- Q $.
$}
$( Prove a theorem. (Contributed by NM, 1-Jan-2004.) $)
th1 $p |- t = t $=
$( Here is its proof: $)
tt tze tpl tt weq tt tt weq tt a2 tt tze tpl tt weq tt tze tpl tt weq tt tt
weq wim tt a2 tt tze tpl tt tt a1 mp mp $.