1268
|
1 |
(* Title: FOL/IFOL.thy
|
35
|
2 |
ID: $Id$
|
79
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
35
|
4 |
Copyright 1993 University of Cambridge
|
|
5 |
|
|
6 |
Intuitionistic first-order logic
|
|
7 |
*)
|
|
8 |
|
79
|
9 |
IFOL = Pure +
|
0
|
10 |
|
79
|
11 |
classes
|
|
12 |
term < logic
|
|
13 |
|
|
14 |
default
|
|
15 |
term
|
0
|
16 |
|
79
|
17 |
types
|
278
|
18 |
o
|
0
|
19 |
|
79
|
20 |
arities
|
|
21 |
o :: logic
|
0
|
22 |
|
79
|
23 |
|
|
24 |
consts
|
0
|
25 |
|
1322
|
26 |
Trueprop :: o => prop ("(_)" 5)
|
|
27 |
True, False :: o
|
79
|
28 |
|
|
29 |
(* Connectives *)
|
|
30 |
|
1322
|
31 |
"=" :: ['a, 'a] => o (infixl 50)
|
35
|
32 |
|
1322
|
33 |
Not :: o => o ("~ _" [40] 40)
|
|
34 |
"&" :: [o, o] => o (infixr 35)
|
|
35 |
"|" :: [o, o] => o (infixr 30)
|
|
36 |
"-->" :: [o, o] => o (infixr 25)
|
|
37 |
"<->" :: [o, o] => o (infixr 25)
|
79
|
38 |
|
|
39 |
(* Quantifiers *)
|
|
40 |
|
1322
|
41 |
All :: ('a => o) => o (binder "ALL " 10)
|
|
42 |
Ex :: ('a => o) => o (binder "EX " 10)
|
|
43 |
Ex1 :: ('a => o) => o (binder "EX! " 10)
|
79
|
44 |
|
0
|
45 |
|
928
|
46 |
syntax
|
1322
|
47 |
"~=" :: ['a, 'a] => o (infixl 50)
|
928
|
48 |
|
35
|
49 |
translations
|
79
|
50 |
"x ~= y" == "~ (x = y)"
|
|
51 |
|
35
|
52 |
|
0
|
53 |
rules
|
|
54 |
|
79
|
55 |
(* Equality *)
|
0
|
56 |
|
79
|
57 |
refl "a=a"
|
|
58 |
subst "[| a=b; P(a) |] ==> P(b)"
|
0
|
59 |
|
79
|
60 |
(* Propositional logic *)
|
0
|
61 |
|
79
|
62 |
conjI "[| P; Q |] ==> P&Q"
|
|
63 |
conjunct1 "P&Q ==> P"
|
|
64 |
conjunct2 "P&Q ==> Q"
|
0
|
65 |
|
79
|
66 |
disjI1 "P ==> P|Q"
|
|
67 |
disjI2 "Q ==> P|Q"
|
|
68 |
disjE "[| P|Q; P ==> R; Q ==> R |] ==> R"
|
0
|
69 |
|
79
|
70 |
impI "(P ==> Q) ==> P-->Q"
|
|
71 |
mp "[| P-->Q; P |] ==> Q"
|
0
|
72 |
|
79
|
73 |
FalseE "False ==> P"
|
0
|
74 |
|
79
|
75 |
(* Definitions *)
|
0
|
76 |
|
79
|
77 |
True_def "True == False-->False"
|
|
78 |
not_def "~P == P-->False"
|
|
79 |
iff_def "P<->Q == (P-->Q) & (Q-->P)"
|
|
80 |
|
|
81 |
(* Unique existence *)
|
0
|
82 |
|
79
|
83 |
ex1_def "EX! x. P(x) == EX x. P(x) & (ALL y. P(y) --> y=x)"
|
0
|
84 |
|
79
|
85 |
(* Quantifiers *)
|
0
|
86 |
|
79
|
87 |
allI "(!!x. P(x)) ==> (ALL x.P(x))"
|
|
88 |
spec "(ALL x.P(x)) ==> P(x)"
|
0
|
89 |
|
79
|
90 |
exI "P(x) ==> (EX x.P(x))"
|
|
91 |
exE "[| EX x.P(x); !!x. P(x) ==> R |] ==> R"
|
0
|
92 |
|
|
93 |
(* Reflection *)
|
|
94 |
|
79
|
95 |
eq_reflection "(x=y) ==> (x==y)"
|
|
96 |
iff_reflection "(P<->Q) ==> (P==Q)"
|
0
|
97 |
|
|
98 |
end
|
79
|
99 |
|