Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
File size: 3,705 Bytes
4365a98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
let [pth_0g;pth_0l;pth_gg;pth_gl;pth_lg;pth_ll] =
   (CONJUNCTS o prove)
   (`((p = &0) ==> c > &0 ==> (c * p = &0)) /\
     ((p = &0) ==> c < &0 ==> (c * p = &0)) /\
     (p > &0 ==> c > &0 ==> c * p > &0) /\
     (p > &0 ==> c < &0 ==> c * p < &0) /\
     (p < &0 ==> c > &0 ==> c * p < &0) /\
     (p < &0 ==> c < &0 ==> c * p > &0)`,
    SIMP_TAC[REAL_MUL_RZERO] THEN
    REWRITE_TAC[REAL_ARITH `(x > &0 <=> &0 < x) /\ (x < &0 <=> &0 < --x)`;
                REAL_ARITH `~(p = &0) <=> p < &0 \/ p > &0`] THEN
    REWRITE_TAC[IMP_IMP] THEN
    REPEAT CONJ_TAC THEN DISCH_THEN(MP_TAC o MATCH_MP REAL_LT_MUL) THEN
    REAL_ARITH_TAC);;

let pth_nzg = prove_by_refinement(
  `p <> &0 ==> c > &0 ==> c * p <> &0`,
(* {{{ Proof *)
[
  REWRITE_TAC[NEQ;REAL_ENTIRE] THEN REAL_ARITH_TAC;
]);;
(* }}} *)

let pth_nzl = prove_by_refinement(
  `p <> &0 ==> c < &0 ==> c * p <> &0`,
(* {{{ Proof *)
[
  REWRITE_TAC[NEQ;REAL_ENTIRE] THEN REAL_ARITH_TAC;
]);;
(* }}} *)

let signs_lem01 = prove_by_refinement(
  `c < &0 ==> p < &0 ==> (c * p = p') ==> p' > &0`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt];
]);;
(* }}} *)

let signs_lem02 = prove_by_refinement(
  `c > &0 ==> p < &0 ==> (c * p = p') ==> p' < &0`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt];
]);;
(* }}} *)

let signs_lem03 = prove_by_refinement(
  `c < &0 ==> p > &0 ==> (c * p = p') ==> p' < &0`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt];
]);;
(* }}} *)

let signs_lem04 = prove_by_refinement(
  `c > &0 ==> p > &0 ==> (c * p = p') ==> p' > &0`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt];
]);;
(* }}} *)

let signs_lem05 = prove_by_refinement(
  `c < &0 ==> (p = &0) ==> (c * p = p') ==> (p' = &0)`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt;REAL_MUL_RZERO];
]);;
(* }}} *)

let signs_lem06 = prove_by_refinement(
  `c > &0 ==> (p = &0) ==> (c * p = p') ==> (p' = &0)`,
(* {{{ Proof *)
[
  ASM_MESON_TAC[REAL_MUL_LT;REAL_MUL_GT;real_gt;REAL_MUL_RZERO];
]);;
(* }}} *)

let signs_lem07 = prove_by_refinement(
  `c < &0 ==> p <> &0 ==> (c * p = p') ==> p' <> &0`,
(* {{{ Proof *)

[
  ASM_MESON_TAC[NEQ;REAL_MUL_LT;REAL_MUL_GT;real_gt;REAL_MUL_RZERO;REAL_ENTIRE;REAL_GT_IMP_NZ];
]);;

(* }}} *)

let signs_lem08 = prove_by_refinement(
  `c > &0 ==> p <> &0 ==> (c * p = p') ==> p' <> &0`,
(* {{{ Proof *)

[
  ASM_MESON_TAC[NEQ;REAL_MUL_LT;REAL_MUL_GT;real_gt;REAL_MUL_RZERO;REAL_ENTIRE;REAL_LT_IMP_NZ];
]);;

(* }}} *)

let signs_lem002 = prove_by_refinement(
  `!p. (p = &0) \/ (p <> &0)`,
(* {{{ Proof *)
[
  MESON_TAC[NEQ];
]);;
(* }}} *)

let signs_lem003 = TAUT `a \/ b ==> (a ==> x) ==> (b ==> y) ==> (a /\ x \/ b /\ y)`;;

let sz_z_thm = ref TRUTH;;
let sz_nz_thm = ref TRUTH;;

let PULL_CASES_THM = prove
 (`!a p p0 p1.
((a = &0) /\ (p <=> p0) \/ (a <> &0) /\ (p <=> p1)) <=> ((p <=> (a = &0) /\ p0 \/ a <> &0 /\ p1 ))`,
(* {{{ Proof *)
   REPEAT STRIP_TAC THEN  REWRITE_TAC[NEQ] THEN MAP_EVERY BOOL_CASES_TAC [`p:bool`; `p0:bool`; `p1:bool`; `p2:bool`] THEN
  ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC);;
(* }}} *)

let signs_lem0002 = prove(
  `!p. p <> &0 ==> (p > &0) \/ (p < &0)`,REWRITE_TAC [NEQ] THEN REAL_ARITH_TAC);;
let signs_lem0003 = TAUT `a \/ b ==> (a ==> x) ==> (b ==> y) ==> (a /\ x \/ b /\ y)`;;

let PULL_CASES_THM_NZ = prove
 (`!a p p1 p2.
  (a <> &0) ==> ((a > &0 /\ (p <=> p1) \/ a < &0 /\ (p <=> p2)) <=>
   ((p <=> a > &0 /\ p1 \/ a < &0 /\ p2)))`,
(* {{{ Proof *)
   REWRITE_TAC[NEQ] THEN
   REPEAT STRIP_TAC THEN
   REWRITE_TAC[NEQ] THEN
   MAP_EVERY BOOL_CASES_TAC [`p:bool`; `p0:bool`; `p1:bool`; `p2:bool`] THEN
   ASM_REWRITE_TAC[] THEN TRY (POP_ASSUM MP_TAC THEN REAL_ARITH_TAC)
);;
(* }}} *)