1 needs "Examples/ssrfun-compiled.hl";;
4 module Ssrbool = struct
8 Sections.begin_section "ApplyIff";;
9 (Sections.add_section_var (mk_var ("P", (`:bool`))); Sections.add_section_var (mk_var ("Q", (`:bool`))));;
10 (Sections.add_section_hyp "eqPQ" (`P <=> Q`));;
13 let iffLR = Sections.section_proof []
20 let iffRL = Sections.section_proof []
27 let iffLRn = Sections.section_proof []
34 let iffRLn = Sections.section_proof []
40 (* Finalization of the section ApplyIff *)
41 let iffLR = Sections.finalize_theorem iffLR;;
42 let iffRL = Sections.finalize_theorem iffRL;;
43 let iffLRn = Sections.finalize_theorem iffLRn;;
44 let iffRLn = Sections.finalize_theorem iffRLn;;
45 Sections.end_section "ApplyIff";;
47 (* Lemma is_true_true *)
48 let is_true_true = Sections.section_proof []
54 (* Lemma not_false_is_true *)
55 let not_false_is_true = Sections.section_proof []
60 let isT = is_true_true;;
61 let notF = not_false_is_true;;
64 let negbT = Sections.section_proof ["b"]
71 let negbTE = Sections.section_proof ["b"]
78 let negbF = Sections.section_proof ["b"]
85 let negbFE = Sections.section_proof ["b"]
92 let negbK = Sections.section_proof ["b"]
99 let negbNE = Sections.section_proof ["b"]
106 let negb_inj = Sections.section_proof ["b1";"b2"]
107 `~b1 = ~b2 ==> b1 = b2`
109 ((((use_arg_then2 ("b1", [])) (disch_tac [])) THEN (clear_assumption "b1") THEN case) THEN (((use_arg_then2 ("b2", [])) (disch_tac [])) THEN (clear_assumption "b2") THEN case THEN (simp_tac)) THEN (done_tac));
113 let negbLR = Sections.section_proof ["b";"c"]
116 ((BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
120 let negbRL = Sections.section_proof ["b";"c"]
123 ((BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
127 let contra = Sections.section_proof ["c";"b"]
128 `(c ==> b) ==> ~b ==> ~c`
130 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
132 let contraNN = contra;;
135 let contraL = Sections.section_proof ["c";"b"]
136 `(c ==> ~b) ==> b ==> ~c`
138 (BETA_TAC THEN (move ["h"]));
139 ((((fun arg_tac -> (use_arg_then2 ("contra", [contra])) (fun fst_arg -> (use_arg_then2 ("h", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
143 let contraR = Sections.section_proof ["c";"b"]
144 `(~c ==> b) ==> ~b ==> c`
146 (BETA_TAC THEN (move ["h"]));
147 ((((fun arg_tac -> (use_arg_then2 ("contra", [contra])) (fun fst_arg -> (use_arg_then2 ("h", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
151 let contraLR = Sections.section_proof ["c";"b"]
152 `(~c ==> ~b) ==> b ==> c`
154 (BETA_TAC THEN (move ["h"]));
155 ((((fun arg_tac -> (use_arg_then2 ("contra", [contra])) (fun fst_arg -> (use_arg_then2 ("h", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (repeat_tactic 1 9 (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
159 let contraT = Sections.section_proof ["b"]
166 let wlog_neg = Sections.section_proof ["b"]
169 (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac));
173 let contraFT = Sections.section_proof ["c";"b"]
174 `(~c ==> b) ==> b = F ==> c`
176 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
180 let contraFN = Sections.section_proof ["c";"b"]
181 `(c ==> b) ==> b = F ==> ~c`
183 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
187 let contraTF = Sections.section_proof ["c";"b"]
188 `(c ==> ~b) ==> b ==> c = F`
190 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
194 let contraNF = Sections.section_proof ["c";"b"]
195 `(c ==> b) ==> ~b ==> c = F`
197 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
201 let contraFF = Sections.section_proof ["c";"b"]
202 `(c ==> b) ==> b = F ==> c = F`
204 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)));
206 let isSome = define `isSome NONE = F /\ (!x. isSome (SOME x) = T)`;;
209 Sections.begin_section "BoolIf";;
210 (Sections.add_section_var (mk_var ("vT", (`:A`))); Sections.add_section_var (mk_var ("vF", (`:A`))));;
211 (Sections.add_section_var (mk_var ("f", (`:A -> B`))));;
212 (Sections.add_section_var (mk_var ("b", (`:bool`))));;
215 let if_same = Sections.section_proof []
216 `(if b then vT else vT) = vT`
218 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
222 let if_neg = Sections.section_proof []
223 `(if ~b then vT else vF) = if b then vF else vT`
225 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
229 let fun_if = Sections.section_proof []
230 `f (if b then vT else vF) = if b then f vT else f vF`
232 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
236 let if_arg = Sections.section_proof ["fT";"fF";"x"]
237 `(if b then (fT:A->B) else fF) x = if b then fT x else fF x`
239 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
242 (* Finalization of the section BoolIf *)
243 let if_same = Sections.finalize_theorem if_same;;
244 let if_neg = Sections.finalize_theorem if_neg;;
245 let fun_if = Sections.finalize_theorem fun_if;;
246 let if_arg = Sections.finalize_theorem if_arg;;
247 Sections.end_section "BoolIf";;
250 let andTb = Sections.section_proof ["b"]
257 let andFb = Sections.section_proof ["b"]
264 let andbT = Sections.section_proof ["b"]
271 let andbF = Sections.section_proof ["b"]
278 let andbb = Sections.section_proof ["b"]
285 let andbC = Sections.section_proof ["b";"c"]
286 `(b /\ c) = (c /\ b)`
288 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
292 let andbA = Sections.section_proof ["b";"c";"p"]
293 `b /\ (c /\ p) <=> (b /\ c) /\ p`
295 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
299 let andbCA = Sections.section_proof ["b";"c";"p"]
300 `b /\ (c /\ p) <=> c /\ (b /\ p)`
302 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
306 let andbAC = Sections.section_proof ["b";"c";"p"]
307 `(b /\ c) /\ p <=> (b /\ p) /\ c`
309 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
313 let orTb = Sections.section_proof ["b"]
320 let orFb = Sections.section_proof ["b"]
327 let orbT = Sections.section_proof ["b"]
334 let orbF = Sections.section_proof ["b"]
341 let orbb = Sections.section_proof ["b"]
348 let orbC = Sections.section_proof ["b";"c"]
351 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
355 let orbA = Sections.section_proof ["b";"c";"p"]
356 `b \/ (c \/ p) <=> (b \/ c) \/ p`
358 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
362 let orbCA = Sections.section_proof ["b";"c";"p"]
363 `b \/ (c \/ p) <=> c \/ (b \/ p)`
365 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
369 let orbAC = Sections.section_proof ["b";"c";"p"]
370 `(b \/ c) \/ p <=> (b \/ p) \/ c`
372 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
376 let andbN = Sections.section_proof ["b"]
379 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
383 let andNb = Sections.section_proof ["b"]
386 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
390 let orbN = Sections.section_proof ["b"]
393 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
397 let orNb = Sections.section_proof ["b"]
400 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
404 let andb_orl = Sections.section_proof ["b";"c";"p"]
405 `(b \/ c) /\ p <=> (b /\ p) \/ (c /\ p)`
407 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
411 let andb_orr = Sections.section_proof ["b";"c";"p"]
412 `b /\ (c \/ p) <=> (b /\ c) \/ (b /\ p)`
414 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
418 let orb_andl = Sections.section_proof ["b";"c";"p"]
419 `(b /\ c) \/ p <=> (b \/ p) /\ (c \/ p)`
421 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
425 let orb_andr = Sections.section_proof ["b";"c";"p"]
426 `b \/ (c /\ p) <=> (b \/ c) /\ (b \/ p)`
428 ((((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
432 let andb_idl = Sections.section_proof ["a";"b"]
433 `(b ==> a) ==> (a /\ b <=> b)`
435 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
439 let andb_idr = Sections.section_proof ["a";"b"]
440 `(a ==> b) ==> (a /\ b <=> a)`
442 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
445 (* Lemma andb_id2l *)
446 let andb_id2l = Sections.section_proof ["a";"b";"c"]
447 `(a ==> (b <=> c)) ==> (a /\ b <=> a /\ c)`
449 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
452 (* Lemma andb_id2r *)
453 let andb_id2r = Sections.section_proof ["a";"b";"c"]
454 `(b ==> (a <=> c)) ==> (a /\ b <=> c /\ b)`
456 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
460 let orb_idl = Sections.section_proof ["a";"b"]
461 `(a ==> b) ==> (a \/ b <=> b)`
463 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
467 let orbb_idr = Sections.section_proof ["a";"b"]
468 `(b ==> a) ==> (a \/ b <=> a)`
470 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
474 let orb_id2l = Sections.section_proof ["a";"b";"c"]
475 `(~ a ==> (b <=> c)) ==> (a \/ b <=> a \/ c)`
477 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
481 let orb_id2r = Sections.section_proof ["a";"b";"c"]
482 `(~ b ==> (a <=> c)) ==> (a \/ b <=> c \/ b)`
484 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
488 let negb_and = Sections.section_proof ["a";"b"]
489 `~ (a /\ b) <=> ~ a \/ ~ b`
491 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
495 let negb_or = Sections.section_proof ["a";"b"]
496 `~ (a \/ b) <=> ~ a /\ ~ b`
498 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
502 let andbK = Sections.section_proof ["a";"b"]
503 `((a /\ b) \/ a) = a`
505 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
509 let andKb = Sections.section_proof ["a";"b"]
512 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
516 let orbK = Sections.section_proof ["a";"b"]
517 `(a \/ b) /\ a <=> a`
519 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
523 let orKb = Sections.section_proof ["a";"b"]
524 `a /\ (b \/ a) <=> a`
526 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
530 let implybT = Sections.section_proof ["b"]
537 let implybF = Sections.section_proof ["b"]
544 let implyFb = Sections.section_proof ["b"]
551 let implyTb = Sections.section_proof ["b"]
558 let implybb = Sections.section_proof ["b"]
564 (* Lemma negb_imply *)
565 let negb_imply = Sections.section_proof ["a";"b"]
566 `~ (a ==> b) <=> a /\ ~ b`
568 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
572 let implybE = Sections.section_proof ["a";"b"]
573 `(a ==> b) <=> ~ a \/ b`
575 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
579 let implyNb = Sections.section_proof ["a";"b"]
580 `(~ a ==> b) <=> a \/ b`
582 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
586 let implybN = Sections.section_proof ["a";"b"]
587 `(a ==> ~ b) <=> (b ==> ~ a)`
589 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
593 let implybNN = Sections.section_proof ["a";"b"]
594 `(~ a ==> ~ b) <=> b ==> a`
596 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
599 (* Lemma implyb_idl *)
600 let implyb_idl = Sections.section_proof ["a";"b"]
601 `(~ a ==> b) ==> ((a ==> b) <=> b)`
603 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
606 (* Lemma implyb_idr *)
607 let implyb_idr = Sections.section_proof ["a";"b"]
608 `(b ==> ~ a) ==> ((a ==> b) <=> ~ a)`
610 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
613 (* Lemma implyb_id2l *)
614 let implyb_id2l = Sections.section_proof ["a";"b";"c"]
615 `(a ==> (b <=> c)) ==> ((a ==> b) <=> (a ==> c))`
617 ((((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)) THEN (done_tac));
619 let XOR_DEF = new_definition `XOR p q = if p then ~q else q`;;
620 overload_interface("+", `XOR`);;
623 let addFb = Sections.section_proof ["b"]
626 ((((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
630 let addbF = Sections.section_proof ["b"]
633 ((((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
637 let addbb = Sections.section_proof ["b"]
640 ((((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
644 let addbC = Sections.section_proof ["b";"c"]
647 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case THEN (simp_tac)) THEN (done_tac));
651 let addbA = Sections.section_proof ["a";"b";"c"]
652 `a + (b + c) <=> (a + b) + c`
654 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)));
658 let addbCA = Sections.section_proof ["a";"b";"c"]
659 `(a + b) + c <=> (a + c) + b`
661 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)));
665 let addbAC = Sections.section_proof ["a";"b";"c"]
666 `a + (b + c) <=> b + (a + c)`
668 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)));
671 (* Lemma andb_addl *)
672 let andb_addl = Sections.section_proof ["a";"b";"c"]
673 `(a + b) /\ c <=> (a /\ c) + (b /\ c)`
675 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)));
678 (* Lemma andb_addr *)
679 let andb_addr = Sections.section_proof ["a";"b";"c"]
680 `a /\ (b + c) <=> (a /\ b) + (a /\ c)`
682 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case) THEN (((use_arg_then2 ("c", [])) (disch_tac [])) THEN (clear_assumption "c") THEN case) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case THEN (simp_tac)));
686 let addKb = Sections.section_proof ["x";"y"]
689 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("x", [])) (disch_tac [])) THEN (clear_assumption "x") THEN case) THEN (((use_arg_then2 ("y", [])) (disch_tac [])) THEN (clear_assumption "y") THEN case THEN (simp_tac)));
693 let addbK = Sections.section_proof ["x";"y"]
696 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("x", [])) (disch_tac [])) THEN (clear_assumption "x") THEN case) THEN (((use_arg_then2 ("y", [])) (disch_tac [])) THEN (clear_assumption "y") THEN case THEN (simp_tac)));
700 let addIb = Sections.section_proof ["x";"y1";"y2"]
701 `(y1 + x <=> y2 + x) ==> (y1 = y2)`
703 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("y1", [])) (disch_tac [])) THEN (clear_assumption "y1") THEN case) THEN (((use_arg_then2 ("y2", [])) (disch_tac [])) THEN (clear_assumption "y2") THEN case) THEN (((use_arg_then2 ("x", [])) (disch_tac [])) THEN (clear_assumption "x") THEN case THEN (simp_tac)));
707 let addbI = Sections.section_proof ["x";"y1";"y2"]
708 `(x + y1 <=> x + y2) ==> (y1 = y2)`
710 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("x", [])) (disch_tac [])) THEN (clear_assumption "x") THEN case) THEN (((use_arg_then2 ("y1", [])) (disch_tac [])) THEN (clear_assumption "y1") THEN case) THEN (((use_arg_then2 ("y2", [])) (disch_tac [])) THEN (clear_assumption "y2") THEN case THEN (simp_tac)));
714 let addTb = Sections.section_proof ["b"]
717 (((((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))) THEN (done_tac));
721 let addbT = Sections.section_proof ["b"]
724 ((((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)) THEN (done_tac));
728 let addbN = Sections.section_proof ["a";"b"]
729 `a + ~ b <=> ~ (a + b)`
731 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)));
735 let addNb = Sections.section_proof ["a";"b"]
736 `~ a + b <=> ~ (a + b)`
738 ((repeat_tactic 1 9 (((use_arg_then2 ("XOR_DEF", [XOR_DEF]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("a", [])) (disch_tac [])) THEN (clear_assumption "a") THEN case) THEN (((use_arg_then2 ("b", [])) (disch_tac [])) THEN (clear_assumption "b") THEN case THEN (simp_tac)));
740 let subpred = new_definition `subpred p1 p2 <=> (!x. p1 x ==> p2 x)`;;
741 let subrel = new_definition `subrel r1 r2 <=> (!x y. r1 x y ==> r2 x y)`;;
742 let pred0 = new_definition `pred0 = (\x. F)`;;
743 let predT = new_definition `predT = (\x. T)`;;
744 let predI = new_definition `predI p1 p2 = (\x. p1 x /\ p2 x)`;;
745 let predU = new_definition `predU p1 p2 = (\x. p1 x \/ p2 x)`;;
746 let predC = new_definition `predC p = (\x. ~p x)`;;
747 let predD = new_definition `predD p1 p2 = (\x. ~p2 x /\ p1 x)`;;
748 let preim = new_definition `preim f (d:A->bool) = (\x. d (f x))`;;
749 let relU = new_definition `relU r1 r2 = (\x y. r1 x y \/ r2 x y)`;;
752 let subrelUl = Sections.section_proof ["r1";"r2"]
753 `subrel r1 (relU r1 r2)`
755 (((((use_arg_then2 ("relU", [relU]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("subrel", [subrel]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac));
759 let subrelUr = Sections.section_proof ["r1";"r2"]
760 `subrel r2 (relU r1 r2)`
762 (((((use_arg_then2 ("relU", [relU]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("subrel", [subrel]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac));
765 (* Close the module *)