3 flyspeck_needs "../glpk/minorlp/tame_table.ml";;
4 let process_exec = Preprocess.exec();;
5 flyspeck_needs "nonlinear/prep.hl";;
7 flyspeck_needs "computational_build.hl";;
13 Tame_table.execute();;
15 flyspeck_needs "usr/thales/hales_tactic.hl";;
16 flyspeck_needs "general/debug.hl";;
17 flyspeck_needs "volume/vol1.hl";;
18 flyspeck_needs "hypermap/bauer_nipkow.hl";;
19 needs "Multivariate/convex.ml";;
20 rflyspeck_needs "local/polar_fan.hl";;
21 rflyspeck_needs "local/lp_details.hl";;
22 flyspeck_needs "local/polar.hl";;
23 flyspeck_needs "local/localization.hl";;
24 flyspeck_needs "local/local_lemmas1.hl";;
25 flyspeck_needs "packing/YSSKQOY.hl";;
26 flyspeck_needs "packing/counting_spheres.hl";;
27 rflyspeck_needs "jordan/refinement.hl";;
28 rflyspeck_needs "jordan/parse_ext_override_interface.hl";;
29 rflyspeck_needs "jordan/real_ext.hl";;
30 rflyspeck_needs "jordan/taylor_atn.hl";;
31 rflyspeck_needs "jordan/parse_ext_override_interface.hl";;
32 flyspeck_needs "general/print_types.hl";;
34 flyspeck_needs "local/RRCWNSJ.hl";;
35 flyspeck_needs "local/JCYFMRP.hl";;
36 flyspeck_needs "local/TFITSKC.hl";;
37 flyspeck_needs "local/CQAOQLR.hl";;
38 flyspeck_needs "local/JLXFDMJ.hl";;
39 flyspeck_needs "leg/geomdetail.hl";;
40 flyspeck_needs "local/local_lemmas1.hl";;
43 flyspeck_needs "local/ARDBZYE.hl";;
44 flyspeck_needs "local/AUEAHEH.hl";;
45 flyspeck_needs "local/VASYYAU.hl";;
46 flyspeck_needs "local/MIQMCSN.hl";;
47 flyspeck_needs "local/JEJTVGB.hl";;
49 flyspeck_needs "local/yxionxl.hl";;
50 flyspeck_needs "local/ODXLSTCv2.hl";;
51 flyspeck_needs "local/ZLZTHIC.hl";;
52 flyspeck_needs "local/lunar_deform.hl";;
53 Lunar_deform.MHAEYJN;;
54 flyspeck_needs "local/NUXCOEA.hl";;
55 flyspeck_needs "packing/Oxl_def.hl";;
56 flyspeck_needs "packing/Oxl_2012.hl";;
59 let fn = flyspeck_needs;;
60 fn "local/appendix_main_estimate.hl";;
61 fn "local/ODXLSTCv2.hl";;
62 fn "local/IMJXPHR.hl";;
63 fn "local/NUXCOEA.hl";;
64 fn "local/FEKTYIY.hl";;
65 fn "local/AURSIPD.hl";;
66 fn "local/PPBTYDQ.hl";;
67 fn "local/AXJRPNC.hl";;
68 fn "local/YRTAFYH.hl";;
69 fn "local/WKEIDFT.hl";;
70 fn "local/hexagons.hl";;
71 fn "local/OTMTOTJ.hl";;
72 fn "local/HIJQAHA.hl";;
73 fn "local/CNICGSF.hl";;
74 fn "local/BKOSSGE.hl";;
75 fn "local/IUNBUIG.hl";;
76 flyspeck_needs "local/JOTSWIX.hl";;
78 flyspeck_needs "local/IUNBUIG.hl";;
81 flyspeck_needs "local/";;
83 flyspeck_needs "general/flyspeck_lib.hl";;
84 flyspeck_needs "local/Xivphks.hl";;
85 flyspeck_needs "local/EYYPQDW.hl";; (* 2013-07-08 *)
86 flyspeck_needs "local/IMJXPHR.hl";;
87 Imjxphr.ZLZTHICv1_concl;;
88 Appendix.ZLZTHIC_concl;;
90 State_manager.neutralize_state();;
91 rflyspeck_needs "nonlinear/lemma.hl";;
92 rflyspeck_needs "nonlinear/functional_equation.hl";;
94 rflyspeck_needs "nonlinear/ineq.hl";;
95 rflyspeck_needs "nonlinear/main_estimate_ineq.hl";;
96 rflyspeck_needs "nonlinear/parse_ineq.hl";;
97 rflyspeck_needs "nonlinear/optimize.hl";;
98 rflyspeck_needs "general/flyspeck_lib.hl";;
99 rflyspeck_needs "nonlinear/function_list.hl";;
100 rflyspeck_needs "nonlinear/auto_lib.hl";;
101 rflyspeck_needs "nonlinear/scripts.hl";;
102 Scripts.execute_interval_all false;;
103 Scripts.execute_cfsqp();;
106 Scripts.one_cfsqp "QZECFIC wt0";;
107 Scripts.cfsqp ["QZECFIC wt0";"QZECFIC wt0 corner";"QZECFIC wt0 sqrt8";"QZECFIC wt1";"QZECFIC wt2 A"];;
108 Scripts.cfsqp ["IXPOTPA"; "GRKIBMP B V2"; "7796879304"; "8346775862"];;
111 List.length !Ineq.ineqs;;
113 let idvs = Flyspeck_lib.nub (sort (<) (map (fun t -> t.idv) (!Ineq.ineqs)));;
116 flyspeck_needs "nonlinear/calc_derivative.hl";;
117 flyspeck_needs "nonlinear/merge_ineq.hl";;
118 rflyspeck_needs "nonlinear/scripts.hl";;
119 (* Scripts.execute_interval_all true;; (* takes several hours *) *)
120 Scripts.unfinished_cases();;
121 let reruns = ["6843920790"; (* "9563139965D" ; *) "6944699408 a reduced"; "6944699408 a";
122 "7043724150 a reduced v2"; "7043724150 a"; "8055810915"; "1965189142 34";
124 map (Auto_lib.testsplit true) ["8055810915"];;
128 Scripts.hour (Scripts.total Scripts.times);;
129 Scripts.case_splits_execute;;
133 let cs' = subtract rg cs in
134 map (fun c -> (s,c,t)) cs';;
136 let redos = List.flatten (map redo incompletes);;
142 map (test_prep_case_split true) redos;;
145 test_prep_case true 1 2 "GRKIBMP A V2";;
147 Auto_lib.testsplit true "GRKIBMP A V2";;
149 let some_cases = filter (fun (_,t) -> t > 300) Scripts.times;;
150 let some_cases = filter (fun (_,t) -> t > 120) times;;
152 assoc "3862621143 revised" times;;
153 assoc "7043724150 a" times;;
154 assoc "9507202313" times;;
156 Scripts.hour (Scripts.total some_cases);;
157 List.length some_cases;;
160 flyspeck_needs "general/flyspeck_lib.hl";;
161 flyspeck_needs "../glpk/glpk_link.ml";;
162 flyspeck_needs "../glpk/minorlp/OXLZLEZ.ml";;
164 flyspeck_needs "packing/oxl_def.hl";;
165 flyspeck_needs "packing/oxl_2012.hl";;
166 flyspeck_needs "packing/OXLZLEZ.hl";;
167 Oxlzlez.PACKING_CHAPTER_MAIN_CONCLUSION;;
169 Mk_all_ineq.example2;;
171 rflyspeck_needs "../projects_discrete_geom/bezdek_reid/bezdek_reid.hl";;
172 let filter_edge_bak = Bezdek_reid.filter_edge;;
175 Bezdek_reid.test_edge;;
176 Bezdek_reid.test_triplet;;
178 flyspeck_needs "../glpk/glpk_link.ml";;
179 rflyspeck_needs "../projects_discrete_geom/fejestoth12/lipstick_ft.ml";;
180 List.length Bezdek_reid.filter_triplet;;
181 List.length (filter (fun (a,_,_) -> (a =[])) Bezdek_reid.coord_triplet);;
184 flyspeck_needs "nonlinear/check_completeness.hl";;
185 let check_completeness_out = Check_completeness.execute();;
187 rflyspeck_needs "nonlinear/types.hl";;
188 rflyspeck_needs "nonlinear/nonlin_def.hl";;
189 rflyspeck_needs "nonlinear/ineq.hl";;
190 rflyspeck_needs "nonlinear/mdtau.hl";;
191 rflyspeck_needs "nonlinear/main_estimate_ineq.hl";;
192 rflyspeck_needs "nonlinear/lemma.hl";; (* needs trig1, trig2 *)
193 rflyspeck_needs "nonlinear/functional_equation.hl";;
194 rflyspeck_needs "nonlinear/parse_ineq.hl";;
195 rflyspeck_needs "nonlinear/optimize.hl";;
196 rflyspeck_needs "nonlinear/function_list.hl";;
197 rflyspeck_needs "nonlinear/auto_lib.hl";;
198 rflyspeck_needs "nonlinear/scripts.hl";;
199 flyspeck_needs "local/XBJRPHC.hl";;
202 (* Formal LP verification *)
203 needs "../formal_lp/hypermap/verify_all.hl";;
204 let result = Verify_all.verify_all();;
205 Verify_all.test_result result;;
207 List.length (List.flatten (map fst result));;
209 (73386.0 /. 3600.0);;
216 The zip file unpacked to glpk/binary/lp_certificates/.
217 I had to move the files to glpk/binary/
219 The directory glpk/binary/ has hiddedn files .DS_Store and .svn
220 Verify_all.verify_all() tried:
221 Verifying /Users/thomashales/Desktop/googlecode/flyspeck/text_formalization/../formal_lp/glpk/binary/.DS_Store
222 and threw an exception.
229 flyspeck_needs "../development/thales/session/local_defs.hl";;
230 flyspeck_needs "../development/thales/session/interval_args.hl";;
231 flyspeck_needs "../development/thales/session/2app.hl";;
233 (* Local materials *)
235 rflyspeck_needs "nonlinear/ineq.hl";;
236 rflyspeck_needs "nonlinear/main_estimate_ineq.hl";;
237 List.length !Ineq.ineqs;;
238 flyspeck_needs "local/appendix_main_estimate.hl";;
241 rflyspeck_needs "local/appendix_main_estimate.hl";;
242 flyspeck_needs "local/terminal.hl";;
244 flyspeck_needs "local/lunar_deform.hl";;
246 flyspeck_needs "local/terminal.hl";;
247 flyspeck_needs "local/pent_hex.hl";;
248 flyspeck_needs "local/OCBICBY.hl";;
249 flyspeck_needs "local/YXIONXL2.hl";;
250 flyspeck_needs "local/XIVPHKS.hl";;
251 flyspeck_needs "local/ZLZTHIC.hl";;
252 flyspeck_needs "local/PQCSXWG.hl";;
253 flyspeck_needs "local/CUXVZOZ.hl";;
256 flyspeck_needs "../development/thales/session/work_in_progress.hl";;
258 open Work_in_progress;;
262 let ss = Str.split (Str.regexp "[],[]") s in
263 (hd ss,map int_of_string (tl ss));;
265 strip_id "abc[0,1,2,3]";;
276 doc="Used in some quad calculations to show that a node
277 is not straight (both halves are acute)";
278 tags=[Flypaper[];Main_estimate;Cfsqp;Xconvert;Tex];
279 ineq = all_forall `ineq [
284 (#3.01,y5, &2 * #2.52);
287 ((delta4_y y1 y2 y3 y4 y5 y6 > &0) \/ (delta_y y1 y2 y3 y4 y5 y6 < &0))`;
291 let ztg4s = map (fun t -> t.idv) (Ineq.getprefix "ZTGIJCF4");;
299 idv = "test QITNPEA 3848804089";
300 ineq = all_forall `ineq
301 [(&2 * hminus,y1, &2 * hplus);
302 (&2,y2, &2 * hminus);
303 (&2,y3, &2 * hminus);
304 (#2 ,y4, &2 * hminus);
305 (&2,y5, &2 * hminus);
308 ((gamma4fgcy y1 y2 y3 y4 y5 y6 lmfun - #0.164017 + #0.119482* dih_y y1 y2 y3 y4 y5 y6 > #0.0) \/ (eta_y y1 y2 y6 pow 2 < #1.34 pow 2 )) `;
310 This is an inequality for quarters used to prove the cluster inequality.";
311 tags=[Marchal;Cfsqp;Clusterlp;Flypaper["OXLZLEZ"];Tex;Xconvert;Branching;Split[0]];
316 ineq = all_forall `ineq
317 [(&2 * hminus,y1, &2 * hplus);
318 (&2,y2, &2 * hminus);
319 (&2,y3, &2 * hminus);
320 (&2,y4, &2 * hminus);
321 (&2,y5, &2 * hminus);
324 ((gamma4fgcy y1 y2 y3 y4 y5 y6 lmfun + #0.0539
325 - #0.042*dih_y y1 y2 y3 y4 y5 y6 > #0.0) \/
326 (eta_y y1 y2 y6 pow 2 < #1.34 pow 2 ))`;
328 This is an inequality for quarters used to prove the cluster inequality.";
329 tags=[Marchal;Cfsqp;Flypaper["OXLZLEZ"];Clusterlp;Tex;Xconvert;Branching;Split[0]];
333 idv = "test BIXPCGW 9455898160";
334 ineq = all_forall `ineq
335 [(&2 * hminus, y1, #2.6);
336 (&2,y2, &2 * hminus);
337 (&2,y3, &2 * hminus);
338 (&2,y4, &2 * hminus);
339 (&2,y5, &2 * hminus);
343 gamma4fgcy y1 y2 y3 y4 y5 y6 lmfun > &0) `;
345 If $X$ is a quarter, then $\\gamma(X,L)\\ge -0.00569$.";
346 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
351 ineq = all_forall `ineq
352 [(&2 * hminus, y4, &2 * hplus);
356 ( truncate_gamma3f_x (#0.001) (h0cut y4) (h0cut y5) (h0cut y6) (&2) (&2) (&2) (y4*y4) (y5*y5) (y6*y6) /
357 (&1* dih_y y4 y5 sqrt2 sqrt2 sqrt2 y6) > &0 \/
358 eta_y y4 y5 y6 > sqrt2 - #0.001
360 eta_y y4 y5 y6 < #1.34
363 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
367 idv = "test gamma23";
368 ineq = all_forall `ineq
369 [(&2 * hminus, y1, &2 * hplus);
370 (&2,y2, &2 * hminus);
371 (&2,y3, &2 * hminus);
373 (&2,y5, &2 * hminus);
377 y_of_x (truncate_gamma3f_x #0.0 (h0cut y1) (&1) (&1)) (&0) (&0) (&0) y1 y2 y6 +
378 y_of_x (truncate_gamma3f_x #0.0 (h0cut y1) (&1) (&1)) (&0) (&0) (&0) y1 y3 y5 +
379 (dih_y y1 y2 y3 y4 y5 y6 -
380 (dih_y y1 y2 sqrt2 sqrt2 sqrt2 y6 +
381 dih_y y1 sqrt2 y3 sqrt2 y5 sqrt2)) * #0.008 > &0 \/
382 rad2_y y1 y2 y3 y4 y5 y6 < &2 \/
383 eta_y y1 y2 y6 > #1.34 \/
384 eta_y y1 y3 y5 > #1.34 \/
385 dih_y y1 y2 y3 y4 y5 y6 < #1.946 \/
386 dih_y y1 y2 y3 y4 y5 y6 > #2.089)`;
388 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
392 idv = "test gamma23bis";
393 ineq = all_forall `ineq
394 [(&2 * hminus, y1, &2 * hplus);
396 (&2,y3, &2 * hminus);
398 (&2,y5, &2 * hminus);
402 y_of_x (truncate_gamma3f_x #0.0 (h0cut y1) (&1) (&1)) (&0) (&0) (&0) y1 y3 y5 +
403 (dih_y y1 y2 y3 y4 y5 y6 -
404 dih_y y1 sqrt2 y3 sqrt2 y5 sqrt2) * #0.008 > a_spine5 +
405 b_spine5 * dih_y y1 y2 y3 y4 y5 y6 \/
406 rad2_y y1 y2 y3 y4 y5 y6 < &2 \/
407 eta_y y1 y2 y6 < #1.34 \/
408 eta_y y1 y2 y6 > sqrt2 \/
409 eta_y y1 y3 y5 > #1.34 \/
410 dih_y y1 y2 y3 y4 y5 y6 > #1.074)`;
412 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
419 ineq = all_forall `ineq
420 [(&2 * hminus, y1, &2 * hplus);
428 dih_y y1 y2 y3 y4 y5 y6 > &0 \/
429 rad2_y y1 y2 y3 y4 y5 y6 < &2 \/
430 eta_y y1 y2 y6 > sqrt2 \/
431 eta_y y1 y3 y5 > sqrt2 )`;
433 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
440 augment_search_results ["hi"];;
441 really_expand "?-0";;
444 help "apropos_short_order_script";;
446 String.sub "abcde" 1 (String.length "abcde" - 1);;
449 List.nth !loaded_files 69;; Reload 1--69
451 flyspeck_needs "general/lib.hl";;
452 flyspeck_needs "nonlin/kelvin_lattice.hl";;
453 flyspeck_needs "usr/thales/searching.hl";;
455 rflyspeck_needs "usr/thales/init_search.hl";;
456 reneeds "packing/counting_spheres.hl";;
457 flyspeck_needs "packing/QZKSYKG.hl";;
458 flyspeck_needs "packing/DDZUPHJ.hl";;
459 flyspeck_needs "packing/AJRIPQN.hl";;
460 flyspeck_needs "packing/QZYZMJC.hl";;
461 flyspeck_needs "packing/marchal_cells_3.hl";;
462 flyspeck_needs "packing/GRUTOTI.hl";;
464 flyspeck_needs "fan/CFYXFTY.hl";;
465 flyspeck_needs "packing/counting_spheres.hl";;
466 open Counting_spheres;;
467 flyspeck_needs "nonlinear/cleanDeriv.hl";;
468 flyspeck_needs "nonlinear/cleanDeriv_examples.hl";;
469 flyspeck_needs "../development/thales/chaff/tmp/vectors_patch.ml";;
470 flyspeck_needs "../development/thales/chaff/tmp/determinants_patch.ml";;
471 flyspeck_needs "../development/thales/chaff/tmp/wlog_patch.hl";;
472 flyspeck_needs "trigonometry/trig2.hl";;
474 augment_search_results;;
476 Counting_spheres.ORDER_AZIM_SUM2PI;;
478 let u11111 = ((GOAL_TERM (fun w -> ALL_TAC)):tactic);;
481 GOAL_TERM (fun w -> (MP_TAC (ISPECL ( envl w [`p`;`v`;`u0`;`b`]) RCONE_PREP)));;
483 INST [(`u:bool`,`A:bool`)] (TAUT ` ((A ==> B) /\ A) ==> B`);;
485 let thh = Collect_geom.EQ_POW2_COND;;
486 let ta1 = TAUT `(a ==> b ==> c) <=> (a /\ b ==> c)`;;
487 let th2 = REWRITE_RULE[ta1] ( thh);;
488 let tm1 = snd (strip_forall (concl th2));;
489 let tm2 = snd (dest_imp tm1);;
490 let tm3 = fst (dest_eq tm2);;
491 let force_rewrite th;;
495 let goalx = `&0 <= sqrt x /\ &0 <= sqrt t ==> &0 <= sqrt u`;;
496 GMATCH_SIMP_TAC SQRT_POS_LE;;
498 let (asl,w) = (top_realgoal());;
499 let thm = SQRT_POS_LE;;
500 let thm' = hd (mk_rewrites true thm []);;
501 let t1 = fst (dest_eq(snd (dest_imp(concl(thm'))))) ;;
503 let m = term_match [] t1 t in
504 let _ = subset (frees t) (frees u) or failwith "" in
506 let wsub u = find_term (can (matcher u)) u ;;
509 let var1 = mk_var("v",type_of w') in
510 variant (frees w) var1 ;;
511 let athm = REWRITE_CONV[ ASSUME (mk_eq (w',vv))] w ;;
512 let arhs = rhs (concl athm) ;;
513 let bthm = (ISPECL [mk_abs(vv,arhs);w'] BETA_THM) ;;
514 let betx = SYM(TRANS bthm (BETA_CONV (rhs (concl bthm)))) ;;
515 ONCE_REWRITE_TAC[betx]
516 MATCH_MP_TAC (lift_eq thm')
522 let lift_SQRT_POS_LE = GEN_ALL (MATCH_MP lift_imp (SPEC_ALL SQRT_POS_LE));;
524 add_rewrite_tag("mycase ",th);;
525 let xxx n = add_rewrite_stag (List.nth search_result_dump_march7_8am n);;
527 assoc (List.nth search_result_dump_march7_8am 0) !theorems;;
530 let th = ASSUME (`!p q r. p ==> q ==> (cos r = s) /\ (u ==> sin y > &1)`);;
532 let gexp = `!t. (cos x + sqrt (t pow 2) > &0)`;;
533 let hexp = `!x. (cos x + sqrt (t pow 2) > &0)`;;
540 let m = term_match [] t1 t in
541 let _ = subset (frees t) (frees u) or failwith "" in
543 let mmat u = find_term (can (matcherx u)) u;;
545 let mma1 = term_match [] `sqrt x` (mmat hexp);;
547 let var1 = mk_var("v",type_of mx) in
548 variant (frees hexp) var1;;
549 let rrx = REWRITE_CONV[ ASSUME (mk_eq (mx,vv))] hexp;;
550 let rhsx = rhs (concl rrx);;
551 let bthx = (ISPECL [mk_abs(vv,rhsx);mx] BETA_THM);;
552 let betx = SYM(TRANS bthx (BETA_CONV (rhs (concl bthx))));;
554 term_match [] `sqrt x` mmat;;
556 st_of `sin x + cos (asn t)`;;
561 help "GEN_PART_MATCH";;
564 `(&0 <= sqrt (t pow 2)) \/ b ==> ~(&0 <= sqrt u)`
567 SPEC_ALL (ASSUME `!x. x = x`);;
568 let lift_SQRT_POS_LE = GEN_ALL (MATCH_MP lift_imp (SPEC_ALL SQRT_POS_LE));;
569 searcht 5 [`&0 <= sqrt x`];;
571 eval_command ~silent:true "let x111 = 1+1+4";;
573 eval_command ~silent:false "mark 4";;
581 List.map hd (split_proof_record [] [] (!proof_record));;
590 eval_tactic_lines "st/r\nfxa mpt";;
594 process_to_string "date";;
599 List.nth (show_gax()) 2;;
601 Clean_deriv.x1_eta2;;
605 search [name "FMSWMVO"];;
606 search [name "IVFICRK"];;
607 search [name "volume_props"];;
613 let (d,hd) = data (get_tm_depth w) in
614 filter (fun ((d',hd'),_,_) -> (((abs (d-d')< 1+k) && sorted_meet 0 hd hd' ))) thml;;
617 List.length (ballpark_theorems (top_realgoal()));;
618 (ballpark_theorems (top_realgoal()));;
623 strip_imp `a ==> b==> c`;;
629 help "strip_exists";;
630 strip_comb `a ==> b==> c`;;
636 let nearest_thm_to_goal thml (asl,w) =
637 let tt tl = List.flatten (map (tm_depth o concl) tl) in
638 let common = tt (map snd asl) in
639 let thl = map (fun (s,t) -> ((tm_depth o snd o strip_forall o concl )t,s,t) ) thml in
640 let r = map (fun (tl,s,t) -> (tl,s,t,msd 0.0 common (tm_depth w) tl)) thl in
641 (sort (fun (_,_,_,a) (_,_,_,b) -> a < b) r);;
643 let thml_depth_of_goalmatch thml (asl,w) =
644 let tt tl = List.flatten (map (tm_depth o concl) tl) in
645 let w'::rest = List.rev strip_imp o snd o strip_forall w in
646 let common = tt ((map snd asl) @ rest) in
647 let thl = map (fun (s,t) -> ((tm_depth o snd o strip_forall o concl )t,s,t) ) thml in
653 nearest_thm_to_goal (ballpark_theorems (top_realgoal())) (top_realgoal());;
654 let guess = nearest_thm_to_goal (top_realgoal());;
655 List.length !theorems;;
667 (* jan 3, 2012 chaff *)
671 (* USEFUL CONSTRUCTS *)
674 Format.print_string s; Format.print_newline();;
680 let ( TYPE_VAR :string -> (term -> tactic) -> tactic) =
681 fun s tm_tactic (asl,g) ->
682 let (_,r) = dest_comb g in
683 let (v,_) = dest_abs r in
684 let (_,ty) = dest_var v in
685 tm_tactic (mk_var(s,ty)) (asl,g);;
687 TYPE_VAR "x" EXISTS_TAC;
689 Format.print_flush();;
692 searcht 10 [`eulerA_hexall_x`];;
697 process_to_string "cat qed_log.txt | sed 's/^.*ineq./\"/' | sed 's/., secs.*$/\";/' "
699 cat qed_log.txt | sed 's/^.*ineq./"/' | sed 's/., secs.*$/";/' | sort -u | wc
702 let _ = Sys.command("cat "^flyspeck_dir^"/../interval_code/qed_log.txt");;
708 let b = (false or (let _ = Sys.command("date") in failwith "h")) in b;;
715 dest_binder "?" (`?(x:A). f A`);;
719 let searchl = sortlength_thml o search;;
720 let take = Lib_ext.take;;
721 let searcht r = take 0 5 (searchl r);;
722 let searchtake i j r = take i j (searchl r);;
730 State_manager.neutralize_state();;
731 let vv = (eval("1+1")) + 3;;
732 let vv = (eval("REFL `T`"));;
739 map (List.nth (infixes())) (95--131);;
740 unparse_as_binder "!";;
744 find_path ((=) `4`) `(sum (3..4) f)`;; (* lrr *)
746 let kill_process n = Sys.command (Printf.sprintf "sudo kill -9 %d" n);;
749 help "list_mk_conj";;
752 FROZEN_REWRITE_TAC [REAL_ARITH `b + d = d - (--b)`];;
754 let goal_types = Print_types.print_goal_types;;
755 Print_types.goal_types();;
756 Print_types.print_term_types `#2`;;
757 Print_types.print_thm_types (REFL `1`);;
762 (* parsing printing *)
763 let pterm = Print_types.print_term_types;;
764 let tterm = Print_types.print_thm_types;;
766 #install_printer print_qterm;;
769 #install_printer Goal_printer.print_goal_hashed;;
770 #install_printer Goal_printer.print_goalstack_hashed;;
772 #remove_printer Goal_printer.print_goal_hashed;;
773 #remove_printer Goal_printer.print_goalstack_hashed;;
778 search[`f (x:A) (g (y:A) z) = f (g x y) z`];; (* min, max, + /\, \/ *, compose, monoidal ops,
779 APPEND, a - (b + c) = a - b - c /\ a - (b - c) = a - b + c),
780 p ==> q ==> r <=> p /\ q ==> r);; *)
782 find_term ( can (term_match[ `r a (r y z) = r (r x y) z`])) (concl IMP_IMP);;
788 constant_of_regexp "at.*[gn]$";;
790 constant_of_regexp "FILTER";;
792 def_of_string "FILTER";;
794 def_of_string "fan";;
795 conjuncts `!a b c. (u /\ v /\ (!c. w /\ r) /\ (!x y. r2 /\ r3))`;;
799 List.nth !theorems 0;;
803 INFINITE_DIFF_FINITE;;
804 search[`INFINITE`;`DIFF`];;
807 Format.set_max_boxes 100;;
808 let tt = hol_of_smalllist (1--300);;
809 string_of_my_term tt;;
813 let hel i = help (List.nth tacsss i );;
817 constant_of_regexp "sol";;
823 (* get all word counts in HOL LIGHT and FLYSPECK *)
828 let avs,bod = strip_forall tm in
829 let ant,con = dest_imp bod in
830 let th1 = SPECL avs (ASSUME tm) in
831 let th2 = UNDISCH th1 in
832 let evs = filter (fun v -> vfree_in v ant & not (vfree_in v con))
834 let th3 = itlist SIMPLE_CHOOSE evs (DISCH tm th2) in
835 let tm3 = hd(hyp th3) in
836 MP (DISCH tm (GEN_ALL (DISCH tm3 (UNDISCH th3)))) th;;
839 let u = fst(chop_list 50 (trigger_counts "MATCH_MP_TAC")) in
840 let sl = map fst !theorems in
841 let f1 = filter (fun (t,_) -> mem t sl ) u in
842 let f2 = map (fun (s,n) -> (s,n,assoc s !theorems)) f1 in
843 filter (fun (_,_,t) -> can match_mp_strip t) f2;;
846 let relevant_match_mp r =
847 filter (fun (_,_,t) -> can (MATCH_MP_TAC t) r) mp_short_list;;
849 let suggest_match_mp () = relevant_match_mp (top_realgoal());;
857 grep -r "\bREPEAT\b" . | grep -v svn | sed 's/^.*REPEAT *//' | sed 's/ .*$//g'
860 let recent_search = ref [""];;
862 let refcount = ref [("",0)];;
864 trigger_counts "MATCH_MP_TAC";;
868 search[regexp "EQ_SYM"];;
872 (* to get tacticals as well *)
873 (* grep "TYPE.*tactic" -i *.doc -l | sed 's/.doc//g' *)
875 List.length tactic_list;;
876 List.length(tachy "");;
877 subtract tactic_list (tachy "");;
883 let split = Str.split (Str.regexp "\n") in
884 let cmd s = process_to_string ("(cd " ^s^ "; grep TYPE "^ss^".doc | sed 's/TYPE[^{]*//g' )") in
885 List.flatten (map ( split o cmd ) (!helpdirs));;
891 let MP_TAC_BAK = MP_TAC;;
892 let MATCH_MP_TAC_BAK = MATCH_MP_TAC;;
896 let mp_theorems = ref[];;
897 let incr1 thm = (mp_theorems:= thm::!mp_theorems);;
900 let _ = incr1 t in MP_TAC_BAK t;;
902 let MP_TAC = MP_TAC_COUNT ;;
904 let MATCH_MP_TAC_COUNT t =
905 let _ = incr1 t in MATCH_MP_TAC_BAK t;;
907 let MATCH_MP_TAC = MATCH_MP_TAC_COUNT ;;
908 let MATCH_MP_TAC = MATCH_MP_TAC_BAK ;;
911 reneeds "trigonometry/trig2.hl";;
913 let thm_hash = Hashtbl.create 1000;;
914 map (fun (x,y) -> Hashtbl.add thm_hash y x) (!theorems);;
917 try (Hashtbl.find thm_hash th) with Not_found -> "ANONYMOUS";;
919 List.length (search[`x:A`]);;
921 List.length (search[`x > (y:real)`]);; (* 111 *)
923 List.length (search[`x > &0`]);; (* 67 *)
924 (search[`x > y`; omit `x > &0`]);; (* complicated thing > simple thing. *)
925 List.length (search[`x < y`]);; (* 1438 *)
927 List.length (search[`x >= &0`]);; (* 11 *)
928 List.length (search[`x <= (y:real)`]);; (* 1830 *)
929 List.length (search[`x >= y`; omit `x >= &0`]);; (* 85, complicated thing > simple thing. *)
932 (* IN -- no rhyme or reason. *)
933 List.length(search[`(IN)`]) (* 3455 *);;
934 List.length(search[`SETSPEC`]);; (* 1071 *);;
935 List.length(search[`SETSPEC`;`(IN)`]);; (* 568 *)
936 dest_comb `{x | T} y`;;
937 List.length (search[`y IN (GSPEC f)`]);; (* 23 *)
938 (search[`y IN {u | f}`]);; (* 14 *)
939 (search[`{u | f} y`]);; (* 3 *)
940 (searcht 40 [`(IN)`;omit `SETSPEC`]);;
942 dest_comb `{x | x > 0}`;;
944 List.length (search[`x < y`]);; (* 1438 *)
946 (* search, what is the arc cosine called? acs *)
948 search[rewrite `inv`;`( / )`];;
949 searcht 5 [rewrite `inv`;`a*b`];;
950 search [regexp "[dD]iff"];;
951 is_rewrite "inv" ("",REAL_INV_MUL);;
952 heads (snd(dest_thm(REAL_INV_MUL)));;
954 Toploop.execute_phrase;;
960 heads(concl(hd(definitions())));;
968 let dds = map fst def_assoc in
969 sort (fun (_,a) (_,b) -> a > b) (map (fun t-> (t,stm_depth t)) dds);;
975 let (s,th) = List.nth !theorems n in
976 let d = thm_depth th in (s,d,th);;
979 tm_depth `!a b. (&2 <= a /\ a <= #2.52) /\ &2 <= b /\ b <= #2.52
980 ==>( ((\x. -- (&4 + a pow 2 - x pow 2)/(a * sqrt(ups_x (a pow 2) (b pow 2) (&4)))) has_real_derivative
981 (&32 * a * b /( (sqrt (ups_x (a pow 2) (b pow 2) (&4))) pow 3)))
982 (atreal b within real_interval [&2,#2.52]))`;;
984 let depth_filter n = filter (fun (_,t)->
985 let (_,c) = hd (thm_depth t) in (c <= n));;
987 searcht 10 [`has_real_derivative`;`real_div`];;
988 (* now distance between constants *)
990 help_grep_flags "rat" "i";;
992 help "REAL_RAT_REDUCE_CONV";;
996 assoc "pi" def_assoc;;
1003 stm_depth "uniformly_continuous_on";;
1004 stm_depth "real_add";;
1005 stm_depth "treal_add";;
1006 stm_depth "hreal_add";;
1007 stm_depth "nadd_eq";;
1012 assoc "_0" def_assoc;;
1015 s_depth "arclength";;
1019 assoc `T` def_assoc;;
1023 c_of [] `sin(cos (x + y))`;;
1025 searcht 5 [`a/b + c/d`];;
1028 searcht 5 [`x pow n = &0`];;
1030 help_grep "REAL_RAT";;
1032 pre_rationalize `-- (v/ u pow 3)/(&1/x + &3 * (-- (u /( v * inv (w)))))`;;
1034 strip_comb `&1 + &2`;;
1042 searcht 5 [`inv`;`a/b`];;
1043 searcht 5 [`a/b + c/d`];;
1044 let (rr,_)=hd[(`(+)`,ratform_add);
1045 (`( * )`,ratform_mul);(`( - )`,ratform_sub);
1046 (`( / )`,ratform_div)];;
1048 rationalize `-- (v/ u pow 3)/(&1/x + &3 * (-- (u /( v * inv (w)))))`;;
1049 Calc_derivative.derivative_form `\q. sin(q pow 5)` `t:real` `{}:real->bool`;;
1050 pre_rationalize `inv (w)`;;
1052 Calc_derivative.derivative_form `(\x. --(&4 + a pow 2 - x pow 2) / (a * sqrt (ups_x (a pow 2) (x pow 2) (&4))))` `b:real` `real_interval [&2,#2.52]`;;
1054 searcht 5[`x pow 1`];;
1056 search [name "HAS_REAL";name "COS"];;
1058 search [`(within)`;`(:real)`];;
1060 open Calc_derivative;;
1064 let s = `{t | t > &0}` in
1065 let tm = `\x. x pow 3 + x * x - x * -- x + x/(x + &1)`in
1066 differentiate tm x s;;
1070 let s = `{t | t > &0}` in
1071 let tm = `(\q:real. (q - sin(q pow 3) + q pow 7 + y)/(q pow 2 + q pow 4 *(&33 + &43 * q)) + (q pow 3) * ((q pow 2) / (-- (q pow 3))))` in
1072 differentiate tm x s;;
1076 let s = `(:real)` in
1077 let tm = `\q. cos(&1 + q pow 2) * acs (q pow 4) + atn(cos q) + inv (q + &1)` in
1078 differentiate tm x s;;
1082 let s = `(:real)` in
1083 let tm = `\q. cos(&1 + q pow 2) * acs (q pow 4) + atn(cos q) + inv (q + &1)` in
1084 differentiate tm x s;;
1087 (* prove rational identity modulo accumulating assumptions *)
1089 let equ = `(&1 / u - &1/v) pow 2 = inv u pow 2 - &2 * inv (u * v) + inv v pow 2`;;
1090 let eq0 = MATCH_MP (REAL_ARITH `u - v = &0 ==> (u=v)`);;
1092 CONV_RULE rc (pre_rationalize `&1 / (x + y) - &1 / (x - y) - (-- &2 * y / (x pow 2 - y pow 2))`);;
1093 let lite_imp = MESON[] `ratform p a ;;
1095 REAL_FIELD ` ((x - y - (x + y)) * (x pow 2 * &1 pow 2 - &1 pow 2 * y pow 2) -
1096 ((x + y) * (x - y)) * -- &2 * y * &1 pow 2 * &1 pow 2) = &0`;;
1101 searcht 5 [`(a1 pow n / b1 pow n)`];;
1104 REWRITE_TAC [ratform] THEN
1105 REPEAT STRIP_TAC THENL
1106 [ASM_MESON_TAC[REAL_ENTIRE] ;
1107 REPEAT (FIRST_X_ASSUM (fun t -> MP_TAC t THEN ANTS_TAC THEN
1108 ASM_REWRITE_TAC[])) THEN
1109 REPEAT STRIP_TAC THEN
1110 ASM_REWRITE_TAC[] THEN
1111 REPEAT (POP_ASSUM MP_TAC) THEN
1112 CONV_TAC REAL_FIELD];;
1116 let ratform_pow = prove_by_refinement(
1117 `ratform p1 r1 a1 b1 ==> ratform p1 (r1 pow n) (a1 pow n) (b1 pow n)`,
1120 REWRITE_TAC[ratform;GSYM REAL_POW_DIV];
1125 rational_identity `&1 / (x + y) - &1 / (x - y) = -- &2 * y / (x pow 2 - y pow 2)`;;
1128 REAL_FIELD `&2 * x * y - &2 * y * x`;;
1132 let (h1,[f1;f1';r1]) = strip_comb tm in
1133 let (h2,[b2;s1]) = strip_comb r1 in
1134 let (h3,b) = dest_comb b2 in
1135 (f1,SPECL [f1;f1';b;s1] triv) in
1137 let hooked_deriv hook =
1138 let assumed_rules = map mk_derived hook in
1140 let r = assoc tm assumed_rules in
1141 let _ = print_thm r in
1144 let triv = REWRITE_RULE[](REWRITE_CONV[derived_form]
1145 `!f f' x s. derived_form ((f has_real_derivative f') (atreal x within s)) f f' x s` ) in
1147 differentiate_hook [`(f has_real_derivative (&17)) (atreal x within (:real))`] `\x. ((f:real->real) x) pow 2` `x:real` `(:real)`;;
1149 differentiate_hook [`(f has_real_derivative f') (atreal x within (:real))`] `f:real->real` `x:real` `(:real)`;;
1151 let triv = REWRITE_RULE[](REWRITE_CONV[derived_form]
1152 `!f f' x s. derived_form ((f has_real_derivative f') (atreal x within s)) f f' x s` );;
1155 mk_derived `(f has_real_derivative (&17)) (atreal x within (:real))`;;
1156 assoc `f:real->real` [it];;
1157 differentiate_hook;;
1159 `(f has_real_derivative f') (atreal x within (:univ))`;;
1161 let d_hyp assumed_rules tm =
1162 snd(find (fun (r,s) -> aconv tm r) assumed_rules);;
1165 let triv2 = prove_by_refinement(
1166 `f f' x s. derived_form ((f has_real_derivative f') (atreal x)) f f' x (:real)`,
1169 REWRITE_TAC[derived_form;WITHINREAL_UNIV];
1175 `!x s. p ==> (f has_real_derivative f') (atreal x within s)`
1176 `!x s. p ==> (f has_real_derivative f') (atreal x)`
1177 `!x s. derived_form f f' x s`;;
1180 let thm5 = prove_by_refinement(
1181 `!x s. derived_form (p x /\ (!x s. (derived_form (p x) f (f' x) x s))) f (f' x) x s`,
1184 REWRITE_TAC[derived_form];
1189 let thm4 = prove_by_refinement(
1190 `!x s. derived_form (!x s. (f has_real_derivative f' x) (atreal x within s)) f (f' x) x s`,
1193 REWRITE_TAC[derived_form];
1198 let thm3 = prove_by_refinement(
1199 `!x s. derived_form (!x. (f has_real_derivative f' x) (atreal x)) f (f' x) x s`,
1202 REWRITE_TAC[derived_form];
1203 MESON_TAC[HAS_REAL_DERIVATIVE_ATREAL_WITHIN];
1207 let thm2 = prove_by_refinement(
1208 `!x s. derived_form (p x /\ (!x. p x ==> (f has_real_derivative f' x) (atreal x) )) f (f' x) x s`,
1211 REWRITE_TAC[derived_form];
1212 MESON_TAC[HAS_REAL_DERIVATIVE_ATREAL_WITHIN];
1216 let thm1 = prove_by_refinement(
1217 `! x s. derived_form (p x /\ (!x s. p x==> (f has_real_derivative f' x) (atreal x within s)))
1221 REWRITE_TAC[derived_form];
1227 let form1 = `!x s. p x==> (f has_real_derivative f' x) (atreal x within s)`in
1228 let form2 = `!x. p x ==> (f has_real_derivative f' x) (atreal x)` in
1229 let form3 = `!x. (f has_real_derivative f' x) (atreal x)` in
1230 let form4 = `!x s. (f has_real_derivative f' x) (atreal x within s)` in
1231 let form5 = `!x s. derived_form p f f' x s` in
1233 (form1,thm1);(form2,thm2);(form3,thm3);(form4,thm4);(form5,thm5)] in
1235 let ins = term_match [] r tm in
1236 INST ((fun (_,a,_) -> a) ins) s in
1238 tryfind (mm tm) fls;;
1244 search [`within`;`atreal`;`has_real_derivative`;name "HAS_REAL"];;
1245 let tm5 = `!x u. derived_form q g g' x u`;;
1246 let tm4 = `!x u. (x > &0) ==> (g has_real_derivative (x pow 2)) (atreal x within u)`;;
1247 if (can (term_match [] form5) tm) then tm else ( failwith "form5");;
1250 let ins = (term_match [] form4) tm4 ;;
1251 INST ((fun (_,a,_) -> a) ins) thm4;;
1256 let (h1,[f1;f1';r1]) = strip_comb tm in
1257 let (h2,[b2;s1]) = strip_comb r1 in
1258 let (h3,b) = dest_comb b2 in
1259 (f1,SPECL [f1;f1';b;s1] triv) ;;
1269 type_of `has_real_derivative`;;
1270 types_of `derived_form ((f has_real_deriv f') (atreal x within s))`;;
1274 snd(top_realgoal());;
1275 let (h1,[f;f';r]) = strip_comb (snd(top_realgoal()));;
1276 let _ = (h1 = `(has_real_derivative)`) or
1277 failwith "form 'f has_real_derivative f' atreal b within s' expected." ;;
1278 let (h2,[atb;s1]) = strip_comb r;;
1279 let (h3,b) = dest_comb atb;;
1287 search[`A INTER B = B INTER A`];;
1289 search[`&0 <= x * x`];;
1292 time REAL_RING `a' = &2 * a /\ b' = a*a - &4 * b /\ x2 * y1 = x1 /\ y2 * y1 pow 2 = &1 - b * x1 pow 4 /\ y1 pow 2 = &1 + a * x1 pow 2 + b * x1 pow 4 /\ ~(y1 = &0) ==> y2 pow 2 = &1 - a' * x2 pow 2 + b' * x2 pow 4`;;
1294 Calc_derivative.differentiate `\t. &1/(cos (a * t pow 2))` `b+ &1` `(:real)`;;
1296 time Calc_derivative.differentiate `\t. &1/(cos (a * t pow 2))` `b+ &1` `{x | x > &0}`;;
1301 searcht 5 [`(a,b) = (c,d)`];;
1303 if (NULLSET X) then {} else
1304 (let (k,ul) = cell_params V X in set_of_list (truncate_simplex (k-1) ul))`;;
1308 g `!(x). (x = x) \/ (!(x:num). x = x) \/ (!(y:bool). y = y)`;;
1310 Print_types.print_goal_var_overload();;
1312 hash_of_term `p /\ q ==> r`;;
1317 eval_goal `a /\ b /\ c /\ d ==> r /\ s`;;
1318 eval_tactic_abbrev "rt/a,[TRUTH]";;
1323 (!Toploop.parse_toplevel_phrase (Lexing.from_string ("let xx = `&1`;;")));;
1325 eval_command "let xx = `(x:real) + 2`;;";;
1327 eval_command "failwith \"hi\" ;;";;
1328 eval_command "assocrx";;
1330 thm_depth FACET_OF_POLYHEDRON;;
1331 searcht 15 [`norm x = &1`];;
1335 let alpha_num = Str.regexp "[a-z_A-Z]+" in
1336 let _ = Str.string_match alpha_num s 0 or failwith "tachit" in
1337 let m = Str.matched_string s in
1338 let ns = (break_init m s) in
1339 let n = if (String.length n > 0)
1345 String.escaped "/\\ ";;
1348 Sys.command "date";;
1353 let lemma = prove_by_refinement(
1354 `!a b . (!t. a < t ==> b <= t) ==> (!t. a <= t ==> b <= t)`,
1358 DISJ_CASES_TAC (REAL_ARITH `a< t \/ a = t \/ t < a`);
1360 HASH_UNDISCH_TAC 1429 ;
1361 DISCH_THEN DISJ_CASES_TAC;
1362 ASM_REWRITE_TAC [REAL_ARITH `b<=t <=> (t < b ==> F)`];
1364 HASH_RULE_TAC 6466 (SPEC `(a + b)/ (&2)`);
1365 ASM_REAL_ARITH_TAC ;
1377 List.length tactic_counts;;
1378 end_itlist (fun (_,t) (_,u) -> ("",t + u)) tactic_counts20;;
1380 let INFINITE_EXISTS = prove_by_refinement (
1381 `!S. INFINITE S ==> (?(x:A). x IN S)`,
1383 REWRITE_TAC[INFINITE];
1385 ASM_MESON_TAC[FINITE_EMPTY;Misc_defs_and_lemmas.EMPTY_EXISTS;];
1391 let INFINITE_EXISTS = prove_by_refinement (
1392 `!S. INFINITE S ==> (?(x:A). x IN S)`,
1394 REWRITE_TAC[INFINITE;GSYM Misc_defs_and_lemmas.EMPTY_EXISTS];
1395 CONV_TAC (CONTRAPOS_CONV);
1396 THEN MESON_TAC[FINITE_EMPTY];
1401 (* save. find strange constants *)
1403 let symbolic_of cnames =
1404 let symbolchar = explode "=-~.,@#$%^&*|\\/?><" in
1405 filter (fun t -> not (intersect (explode t) symbolchar=[])) cnames;;
1407 let symbolic_constants = symbolic_of (map fst (constants()));;
1408 let symbolic_infixes = symbolic_of (map fst (infixes()));;
1411 searcht 5 [name "CHAIN";`has_derivative`];;
1413 help "apropos_derivative";;
1414 Calc_derivative.differentiate;;
1415 Calc_derivative.derived_form;;
1416 Calc_derivative.differentiate `cos` `x:real` `(:real)`;;
1424 let types_of = Print_types.print_term_types;;
1425 let type_of_thm = Print_types.print_thm_types;;
1426 let type_of_goal = Print_types.print_goal_types;;
1429 help "apropos_types";;
1433 map (fun t -> (t,type_of t)) (frees ` (!(y:real^6). p y ==> (continuous) (lift o f'') (at y within s))`);;
1435 let arclength2 = prove_by_refinement(
1436 `!h. (&1 <= h /\ h <= h0) ==> arclength (&2) (&2 * h) (&2) = acs(h / &2)`,
1440 MP_TAC (SPECL [`&2`;`&2 * h`;`&2`] Trigonometry1.ACS_ARCLENGTH);
1446 DISCH_THEN SUBST1_TAC;
1448 UNDISCH_TAC `&1 <= h`;
1449 BY (CONV_TAC REAL_FIELD);
1453 let usage_count x = List.length (search [x]);;
1459 let marked = ref [];;
1460 let show_marked() = map (fun t-> (t,assoc t !theorems)) (!marked);;
1462 let th = assoc s (!theorems) in
1463 let _ = marked := s::!marked in
1465 let resetm() = marked:=[];;
1468 term_match [] `s:C` `s:E->G`;;
1470 `(r:B -> D) ((f:A->B) x) = ((g:C->D) y)`;;
1471 map types_of (gtypl [`f x`;`y`;`f`;`z:D`]);;
1472 filter has_stv (setify (frees `f x`));;
1474 help "apropos_types";;
1477 let EZ_SOS_TAC equ =
1479 (REWRITE_TAC[REAL_ARITH `(x > y <=> y < x) /\ (x >= y <=> y <= x)`] THEN
1480 ONCE_REWRITE_TAC[REAL_ARITH `(x < y <=> &0 < y - x) /\ (x <= y <=> (&0 <= y - x))`]) THEN
1483 let eqthm = try (REAL_FIELD eqn ) with _ -> failwith "sos_tac, REAL_FIELD failed" in
1488 searcht 5 [`x > y <=> x < y`];;
1490 let equ = `(&1 - t) * (&1 pow 2) + t * (&1 - t) * (&1 pow 2) = (&1 - t pow 2)`;;
1492 let (plus,adden) = strip_comb lh;;
1493 let _ = (plus = `(+)`) or failwith "sum expected";;
1500 Str.split (Str.regexp "`") "`how `1` is it`";;
1501 Str.split (Str.regexp "ab") "That is a better choice ab t";;
1502 Str.split (Str.regexp "(\*") "^(* Start comment (* ( *) $";;
1507 map type_of [disjunct (`CARD`,`HAS_SIZE`)];;
1508 search [disjunct (`HAS_SIZE`,`CARD`)];;
1509 type_of `HAS_SIZE`;;
1510 search [disjunct (`&0 < inv x`,`&0 < sqrt u`)];;
1511 search [disjunct (`&0 < sqrt u`,`&0 < inv x`)];;
1512 search [`&0 < sqrt u`];;
1514 search[disjunct (`INJ`,`(f x = f y) ==> (x = y)`);disjunct(`CARD`,`HAS_SIZE`)];;
1518 mk_rewrites false (ASSUME `!s. s = t`) [];;
1520 net_of_thm false (ASSUME `s = t`) empty_net;;
1525 !invariant_under_linear;;
1528 let pollack_inconsistency =
1529 let thm1 = prove( `?(n:num). (t < n)`,EXISTS_TAC`t + 1` THEN ARITH_TAC) in
1530 let t = mk_var("n < 0 /\\ 0",`:num`) in
1531 INST [(t,`t:num`)] thm1;;
1535 let curryl = [Calc_derivative.atn2curry] ;;
1536 let curry = REWRITE_CONV curryl;;
1537 let uncurry = REWRITE_CONV (map GSYM curryl) ;;
1539 uncurry `\x. atn2 (x,x + &1)`;;
1543 Counting_spheres....
1546 !invariant_under_translation;;
1547 searcht 10 [`dihV`;`arcV`];;
1548 searcht 10 [`r f x y = f y x`;omit `#x`];;
1549 VECTOR_ANGLE_ANGLE;;
1550 search[name "ARCV_ANGLE"];;
1551 search[`Arg`;`vector_angle`];;
1552 searcht 10 [`azim`;`Arg`];;
1553 (* from wlog_examples.ml *)
1555 let TRUONG_1 = prove
1556 (`!u1:real^3 u2 p a b.
1560 dist(u1,u2) <= a + b /\
1561 abs(a - b) < dist(u1,u2) /\
1565 {d1, d2} SUBSET p /\
1566 &1 / &2 % (d1 + d2) IN affine hull {u1, u2} /\
1571 (*** First, rotate the plane p to the special case z$3 = &0 ***)
1573 GEOM_HORIZONTAL_PLANE_TAC `p:real^3->bool`
1576 (* bug on loading misc.ml. (next is used as a variable, but later it becomes a constant *)
1577 Debug.Term_of_preterm_error
1578 [("function head", `next`, `:(?2712096)loop->?2712096->?2712096`);
1579 ("function arg", `0`, `:num`)].
1580 Error in included file /Users/thomashales/Desktop/googlecode/hol_light/Multivariate/misc.ml
1583 File "/Users/thomashales/Desktop/googlecode/hol_light/calc_rat.ml", line 515, characters 4-160:
1584 Error: This expression has type
1585 (num -> term) * conv * conv * conv * (term -> thm) * (term -> thm) *
1586 (term -> thm) * (term -> thm) * 'a
1587 but an expression was expected of type
1588 (thm list * thm list * thm list -> positivstellensatz -> thm) ->
1589 thm list * thm list * thm list -> thm
1592 let backup_proof_record = !proof_record;;
1593 List.length backup_proof_record;;
1597 let rec clean_proof_record g skip tbs =
1599 [] -> (g, EVERY (List.rev tbs))
1600 | Gax u :: xs -> clean_proof_record [u] skip tbs xs
1601 | Bax::xs -> clean_proof_record g (skip+1) tbs
1602 | Tax (_,_,t)::xs -> if (skip<=0) then clean_proof_record g 0 (t::tbs) xs else
1603 clean_proof_record g (skip-1) tbs xs;;
1608 let replay_proof gax_no count =
1609 let p1 = List.nth (gax()) gax_no in
1610 let p2 = fst(chop_list count p1) in
1611 let _ = proof_record:= p2 @ !proof_record in
1614 let rotate_proof n =
1615 let (a,b) = chop_list n (gax()) in
1616 List.flatten (b,a);;
1619 let _ = reneeds "usr/thales/init_search.hl" in ();;
1623 let REAL_LEMMA = prove_by_refinement(
1624 `!t s. (&0 < t ) ==> (?x. &0 < x /\ (&0 < s + t * x))`,
1627 REPEAT WEAK_STRIP_TAC;
1628 ASM_CASES_TAC (`&0 < s + t `);
1630 BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
1631 EXISTS_TAC `&1 - s/t`;
1633 MATCH_MP_TAC (arith `&0 < (-- a)/b ==> &0 < &1 - a/b`);
1634 MATCH_MP_TAC REAL_LT_DIV;
1635 BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
1636 SUBGOAL_THEN `s + t * (&1 - s/t) = t` SUBST1_TAC;
1637 Calc_derivative.CALC_ID_TAC;
1638 BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
1639 BY(ASM_REWRITE_TAC[])
1645 let AZIM_ARG4 = prove_by_refinement(
1646 `!x v u w t1 t2 t3. &0 < t3 /\ ~collinear {x , v , u} /\ ~collinear {x,v,w} ==>
1647 azim x v u w = azim x v u (t1 % x + t2 % v + t3 % w)`,
1651 sgth `(?x. &0 < x /\ (&0 < (t1 + t2 + t3 * x)))` mptac
1652 rt[arith `t1 + t2 + t3*x = (t1 + t2) + t3*x`]
1656 sgth `(t3 % w = (t3 * x') % (&1/x' % (w:real^3)))` subst1
1657 rt[VECTOR_MUL_ASSOC]
1658 repeat (apthmtac ORELSE aptermtac)
1660 repeat (fxa mptac) then rat
1661 abbrev `s = t1 + t2 + t3 * x'`
1662 sgth `t1 % x + t2 % v + (t3 * x') % (&1/x' % w) =
1666 searcht 5 [`a % (b % c)`;`(a * b) % c`];;
1670 EXTREME_POINT_OF_FACE;;
1672 FACE_OF_EQ;; (* relative interiors of faces are disjoint *)
1675 FACE_OF_POLYHEDRON_POLYHEDRON;;
1678 POLYHEDRON_COLLINEAR_FACES;;
1682 Graph_control.run(Graph_control.bezdek_reid_properties);;
1683 flyspeck_needs "../glpk/fejesToth_contact/bezdek_reid_problem.ml";;
1684 List.length Bezdek_reid_problem.archive;;
1685 let brp = Bezdek_reid_problem.exec();;
1686 let zbrp = zip Bezdek_reid_problem.archive brp;;
1687 let feas = filter (fun (_,(a,_)) -> not(a = ["PROBLEM HAS NO PRIMAL FEASIBLE SOLUTION"]) && not (a = ["PROBLEM HAS NO FEASIBLE SOLUTION"])) zbrp;;
1689 let mk_bb = Bezdek_reid_problem.mk_bb;;
1690 let feas_bb = map (fun (t,_) -> mk_bb t) feas;;
1692 open Bezdek_reid_problem;;
1694 let out_bb = map (fun bb -> solve_branch_f model dumpfile "optival" ampl_of_bb bb) feas_bb;;
1697 let bb = "154372608266 14 7 0 1 2 3 4 5 6 3 0 6 5 3 0 5 7 3 7 5 4 3 1 0 8 3 8 0 7 3 7 4 9 3 9 4 3 3 9 3 10 3 10 3 2 3 10 2 11 3 11 2 8 3 2 1 8 5 8 7 9 10 11 ";;
1698 solve_branch_f model dumpfile "optival" ampl_of_bb (mk_bb bb);;
1700 let svar = mk_var (s,snd(dest_var t));;
1704 let leaf_def = `leaf V u0 u1 = { u | u IN V /\ ~collinear {u0,u1,u} /\
1705 radV {u0, u1, u2} < sqrt2 }`;;
1707 let leaf_ordering_def = `leaf_ordering V u0 u1 v f n =
1708 leaf V u0 u1 HAS_SIZE n /\
1709 (! i j. i < n /\ j < n /\ (f i = f j) ==> (i = j)) /\
1711 (!i. i < n ==> (f i IN leaf V u0 u1)) /\
1712 u0 IN V /\ u1 IN V /\
1713 (!i j. i < j ==> azim u0 u1 v (f i) < azim u0 u1 v (f (i+1)))`;;
1715 let mcell_group_def = `mcell_group V u0 u1 f i =
1716 {X | X SUBSET wedge u0 u1 (f i) (f (i+1)) /\
1717 {u0,u1} IN edgeX V X /\
1721 let mcell_group_sum = `!V u0 u1 v f n i.
1722 packing V /\ saturated V /\
1723 leaf_ordering V u0 u1 v f n /\
1725 sum (mcell_group V u0 u1 f) (\X. dihX V X (u0,u1)) = azim u0 u1 (f i) (f (i+1))`;;
1727 let mcell_group_4_type = `!V u0 u1 v f n X.
1728 packing V /\ saturated V /\
1729 leaf_ordering V u0 u1 v f n /\
1733 {u0,u1} IN edgeX V X /\
1734 FST(cell_params V X) = 4 ==>
1736 azim u0 u1 (f i) (f (i+1)) < pi /\
1737 radV {u0,u1,(f i),(f (i+1))} < sqrt2 /\
1738 X IN mcell_group V u0 u1 f i)`;;
1740 let mcell_group_23_type = `!V u0 u1 v f n X.
1741 packing V /\ saturated V /\
1742 leaf_ordering V u0 u1 v f n /\
1746 {u0,u1} IN edgeX V X /\
1747 FST(cell_params V X) IN {2,3} ==>
1749 ~(azim u0 u1 (f i) (f (i+1)) < pi /\
1750 radV {u0,u1,(f i),(f (i+1))} < sqrt2) /\
1751 X IN mcell_group V u0 u1 f i)`;;
1753 (* consequence of previous 2 *)
1754 let mcell_group_type = `!V u0 u1 v f n X.
1755 packing V /\ saturated V /\
1756 leaf_ordering V u0 u1 v f n /\
1761 {u0,u1} IN edgeX V X ==>
1762 (?i. i < n /\ X IN mcell_group V u0 u1 f i)`;;
1764 let mcell_group_4_singleton = `!V u0 u1 v f n i.
1765 packing V /\ saturated V /\
1766 leaf_ordering V u0 u1 v f n /\
1768 azim u0 u1 (f i) (f (i+1)) < pi /\
1769 radV {u0,u1,(f i),(f (i+1))} < sqrt2 ==>
1770 mcell_group V u0 u1 f i = { mcell 4 V [u0;u1;(f i);(f (i+1))] }`;;
1774 let mcell_sqrt2_barV = `!V u0 u1 w1 w2.
1775 packing V /\ saturated V /\
1776 {u0,u1,w1,w2} SUBSET V /\
1777 ~coplanar {u0,u1,w1,w2} /\
1778 radV {u0,u1,w1,w2} < sqrt2 ==>
1779 [u0;u1;w1;w2] IN barV V 3`;;
1781 let mcell_group_3_a = `!V u0 u1 f v n i.
1782 packing V /\ saturated V /\
1783 leaf_ordering V u0 u1 v f n /\
1785 (azim u0 u1 (f i) (f (i+1)) >= pi \/
1786 radV {u0,u1,(f i),(f (i+1))} >= sqrt2) ==>
1787 (?X w. X IN mcell_group V u0 u1 f i /\
1788 [u0;u1;(f i);w] IN barV V 3 /\
1789 X = mcell3 V [u0;u1;(f i);w])`;;
1791 let mcell_group_3_b = `!V u0 u1 v f n i.
1792 packing V /\ saturated V /\
1793 leaf_ordering V u0 u1 v f n /\
1795 (azim u0 u1 (f i) (f (i+1)) >= pi \/
1796 radV {u0,u1,(f i),(f (i+1))} >= sqrt2) ==>
1797 (?X w. X IN mcell_group V u0 u1 f i /\
1798 [u0;u1;(f i);w] IN barV V 3 /\
1799 X = mcell3 V [u0;u1;(f i);w])`;;
1802 need if mcell3 V ul = mcell3 V vl , ul, vl IN barV, NONNULL, and both start with [u0;u1]
1803 the ul = vl. In particular, the two mcells in 3_a and 3_b are distinct, and
1804 the w is uniquely determined by X.
1807 let mcell_group_3_exhaust =
1808 `!V u0 u1 v f n i X.
1809 packing V /\ saturated V /\
1810 leaf_ordering V u0 u1 v f n /\
1812 X IN mcell_group V u0 u1 f i /\
1813 FST(cell_params V X) = 3 /\
1815 u IN {(f i),(f (i+1))} /\
1816 X = mcell3 V [u0;u1;u;w] /\ [u0;u1;u;w] IN barV V 3)`;;
1818 (* also need formula for 4-cell gamma, 3-cell gamma, 2-cell gamma (as a function of angle)
1819 in terms of the functions that appear in ineq.hl.
1823 module More = struct
1829 ineq = all_forall `ineq
1830 [(&2 * hminus, y1, &2 * hplus );
1837 (y_of_x delta_x y1 y2 y3 y4 y5 y6 > &0)`;
1839 This is used with rad2_x calculations to bound the denominator.
1841 tags=[Marchal;Flypaper["OXLZLEZ";"Nov2012"];Tex;Cfsqp;Xconvert;Branching];
1846 ineq = all_forall `ineq
1847 [(&2 * hminus, y1, &2 * hplus );
1848 (&2 ,y2,&2 * hminus );
1849 (&2,y3,&2 * hminus);
1850 (&2,y4,&2 * hminus);
1851 (&2,y5,&2 * hminus );
1852 (&2,y6,&2 * hminus )
1854 ((gamma4fgcy y1 y2 y3 y4 y5 y6 lmfun
1856 (y_of_x rad2_x y1 y2 y3 y4 y5 y6 > &2) \/ (eta_y y1 y2 y6 pow 2 < #1.34 pow 2))`;
1858 OXLZLEZ.mod 'g_quqya' 'g_quqyb'
1859 %old idv: 1118115412, cc:2bl
1860 If $X$ is any quarter, and $Y$ is a $3$-cell that flanks it, then
1862 \\gamma(X,L) + \\gamma(Y,L) \\ge 0.
1864 Nov2012, changed eta_y y1 y3 y5 to eta_y y1 y2 y6.
1866 (* + &0 * gamma3f y1 y3 y5 sqrt2 lmfun dropped *)
1867 tags=[Marchal;Flypaper["OXLZLEZ";];Tex;Cfsqp;Xconvert;Branching;Split[0]];
1873 Auto_lib.testsplit true "FHBVYXZ a";;
1874 map (fun t -> try (Auto_lib.testsplit bool t) with Failure _ -> [()]) cases;;
1875 open Functional_equation;;
1876 string_of_num (num_of `5`;;
1877 dest_numeral `55555555555555`;;
1880 module More = struct
1885 idv = "QZECFIC wt2 A"; (* was "test ratio" , y4 y5 swapped, nov 2012 *)
1886 ineq = all_forall `ineq
1890 (&2 * hminus ,y4, sqrt8);
1891 (&2 * hminus, y5, sqrt8);
1892 (&2 ,y6, &2 * hminus)
1894 ( y_of_x (gamma3f_x_div_sqrtdelta (h0cut y4) (h0cut y5) (&1)) y1 y2 y3 y4 y5 y6 / &2 > #0.008 * y_of_x dih4_x_div_sqrtdelta_posbranch y1 y2 y3 y4 y5 y6 \/
1895 eta_y y4 y5 y6 pow 2 > &2
1897 doc = "gamma3f averages at least 0.008 per azim.
1898 We don't have a wt3 case because eta[2hminus,2hminus,2hminus]>sqrt2.";
1899 tags=[Marchal;Flypaper["OXLZLEZ";"Jun2012"];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[3;4]];
1903 idv = "PEMKWKU test1";
1904 ineq = all_forall `ineq
1905 [(&2 * hminus, y1, &2 * hplus);
1906 (&2 * hminus ,y2, sqrt8);
1907 (&2,y3, &2 * hminus);
1909 (&2,y5, &2 * hminus);
1910 (&2,y6, &2 * hminus)
1913 ((y_of_x (gamma23_keep135_x (h0cut y1)) y1 y2 y3 y4 y5 y6) / &2
1914 > a_spine5 + b_spine5 * dih_y y1 y2 y3 y4 y5 y6) \/
1915 y_of_x rad2_x y1 y2 y3 y4 y5 y6 < &2 \/
1916 dih_y y1 y2 y3 y4 y5 y6 > #1.074 \/
1917 eta_y y1 y2 y6 pow 2 > &2 \/
1918 eta_y y1 y2 y6 pow 2 < #1.34 pow 2 \/
1919 eta_y y1 y3 y5 pow 2 > #1.34 pow 2 )`;
1921 tags=[Marchal;Flypaper["OXLZLEZ";"Jun2012"];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
1925 idv = "BIXPCGW b test";
1926 ineq = all_forall `ineq
1927 [(&2 * hminus,y1, &2 * hplus);
1934 ( (delta4_y y1 y2 y3 y4 y5 y6 > &0) \/ (delta_y y1 y2 y3 y4 y5 y6 > &60) \/ (delta_y y1 y2 y3 y4 y5 y6 < &0))`;
1937 If $X$ is a $4$-cell with a critical edge opposite spine, then $\\dih(X) < 2.3$.";
1938 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Penalty (500.0,500.0);Tex;Xconvert];
1942 idv = "BIXPCGW 6652007036 a2";
1943 ineq = all_forall `ineq
1944 [(&2 * hminus, y1, &2 * hplus);
1951 ((dih_y y1 y2 y3 y4 y5 y6 < #2.8) )`;
1953 OXLZLEZ.mod 'azim_c4' QX and QU
1954 If $X$ is a $4$-cell then $\\dih(X) < 2.8$.";
1955 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert];
1959 idv = "BIXPCGW 7080972881 a2";
1960 ineq = all_forall `ineq
1961 [(&2 * hminus,y1, &2 * hplus);
1962 (&2 * hminus,y2, sqrt8);
1968 ((dih_y y1 y2 y3 y4 y5 y6 < #2.3) )`;
1970 OXLZLEZ.mod 'g_qxd' QXD
1971 If $X$ is a $4$-cell with a critical edge next to the spine, then $\\dih(X) < 2.3$.";
1972 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert];
1976 idv = "BIXPCGW 1738910218 a2";
1977 ineq = all_forall `ineq
1978 [(&2 * hminus,y1, &2 * hplus);
1981 (&2,y4, &2 * hplus);
1985 ( (dih_y y1 y2 y3 y4 y5 y6 < #2.3) )`;
1987 OXLZLEZ.mod 'g_qxd' QXD
1988 If $X$ is a $4$-cell with a critical edge opposite spine, then $\\dih(X) < 2.3$.";
1989 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert];
1993 idv = "BIXPCGW 7274157868 a";
1994 ineq = all_forall `ineq
1995 [(&2 * hminus,y1, &2 * hplus);
1996 (&2,y2, &2 * hminus);
1997 (&2,y3, &2 * hminus);
1998 (&2 * hplus,y4, sqrt8);
1999 (&2,y5, &2 * hminus);
2000 (&2,y6, &2 * hminus)
2002 ((gamma4fgcy y1 y2 y3 y4 y5 y6 lmfun > #0.0057) \/
2003 (dih_y y1 y2 y3 y4 y5 y6 < #2.3))`;
2005 OXLZLEZ.mod 'g_qxd' QXD
2006 If $X$ is a $4$-cell with a single critical edge (the spine), and if $\\dih(X)\\ge 2.3$,
2007 then $\\gamma(X,L) > 0.0057$.";
2008 tags=[Marchal;Flypaper["OXLZLEZ";];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
2013 ineq = all_forall `ineq
2014 [(&2 * hminus, y1, &2 * hplus);
2022 dih_y y1 y2 y3 y4 y5 y6 > #0.606
2024 doc = "Min angle on a cell along a spine.
2026 tags=[Marchal;Flypaper["OXLZLEZ";"Nov2012"];Cfsqp;Clusterlp;Tex;Xconvert;Branching];
2031 ineq = all_forall `ineq
2036 (&2 * hminus,y4, sqrt8);
2037 (&2 * hminus ,y5, sqrt8);
2040 (eta_y y4 y5 y6 pow 2 > (#1.34) pow 2 )`;
2041 doc = "eta small implies face small";
2042 tags=[Marchal;Flypaper["OXLZLEZ";"Nov2012"];Cfsqp;Clusterlp;Tex;Xconvert;Branching];
2047 ineq = all_forall `ineq
2048 [(&2 * hminus, y1, &2 * hplus);
2049 (&2,y2, &2 * hminus);
2050 (&2,y3, &2 * hminus);
2051 (sqrt8,y4, &4 * hminus);
2052 (&2,y5, &2 * hminus);
2053 (&2,y6, &2 * hminus)
2055 (let tan2lower = #3.07 in ( // Tan[Pi-2.089]^2
2056 let tan2upper = #6.45 in ( // Tan[Pi-1.946]^2
2057 delta_y y1 y2 y3 y4 y5 y6 < &0 \/
2058 delta4_y y1 y2 y3 y4 y5 y6 > &0 \/
2059 (&4 * x1_delta_y y1 y2 y3 y4 y5 y6 < tan2lower * delta4_squared_y y1 y2 y3 y4 y5 y6) \/
2060 (&4 * x1_delta_y y1 y2 y3 y4 y5 y6 > tan2upper * delta4_squared_y y1 y2 y3 y4 y5 y6) \/
2061 eta_y y1 y2 y6 pow 2 > #1.34 pow 2 \/
2062 eta_y y1 y3 y5 pow 2 > #1.34 pow 2 \/
2063 (y_of_x (gamma23_full8_x (h0cut y1)) y1 y2 y3 y4 y5 y6 > &3 * #0.0057))))`;
2064 doc = "Dec 2, 2012. This is the case of TXQTPVC, when y4 >= sqrt8. We can't use monotonicty here,
2065 because of the explicit dih constraints.";
2066 tags=[Marchal;Flypaper["OXLZLEZ";"Nov2012"];Cfsqp;Clusterlp;Tex;Xconvert;Branching;Split[0]];
2071 tags = [Cfsqp;Tablelp;Xconvert;Tex];
2072 ineq = all_forall `ineq
2077 (&2 * h0,y4,&4 * h0);
2080 (delta_y y1 y2 y3 y4 y5 y6 < &0)`;
2085 tags = [Cfsqp;Tablelp;Xconvert;Tex];
2086 ineq = all_forall `ineq
2094 (y_of_x eulerA_x y1 y2 y3 y4 y5 y6 > &0)`;
2098 doc="This reduces OWZLKVY to the case when delta_y < 200. Added 2013-4-18";
2099 tags = [Cfsqp;Tablelp;Xconvert;Tex];
2100 ineq = all_forall `ineq
2109 delta_y y1 y2 y3 y4 y5 y6 < &200 \/ taum y1 y2 y3 y4 y5 y6 > &0 )`;
2113 doc="In OWZLKVY the angle at y1 is obtuse. Added 2013-4-18.";
2114 tags = [Cfsqp;Tablelp;Xconvert;Tex];
2115 ineq = all_forall `ineq
2124 delta_y y1 y2 y3 y4 y5 y6 > &200 \/ y_of_x delta_x4 y1 y2 y3 y4 y5 y6 < &0 ) `;
2128 doc="In OWZLKVY the angle at y2,y3 is acute. Added 2013-4-18.";
2129 tags = [Cfsqp;Tablelp;Xconvert;Tex];
2130 ineq = all_forall `ineq
2138 (y_of_x delta_x4 y1 y2 y3 y4 y5 y6 > &0)`;
2143 doc="pentagon case, clipped A-piece triangle. ";
2144 tags=[Flypaper["FHOLLLW"];Main_estimate;Cfsqp;Xconvert;Tex;Penalty(50.0,500.0)];
2145 ineq = all_forall `ineq [
2154 ( taum y1 y2 y3 y4 y5 y6 > tame_table_d 4 1 - &2 * #0.11) \/
2155 (delta_y y1 y2 y3 y4 y5 y6 < &0)
2162 module More = struct
2168 doc="quad case top neg delta.
2169 Solve[Delta[x,2,2,x,2,3.01]==0,x] (*x < 3.166 *)
2171 tags=[Cfsqp;Xconvert];
2172 ineq = all_forall `ineq [
2179 (taum y1 y2 y3 y4 y5 y6 > &0)`;
2185 tags=[Cfsqp;Xconvert;Tex;];
2186 ineq = all_forall `ineq [
2195 ( delta_y y1 y2 y3 y4 y5 y6 < &72 \/ taum y1 y2 y3 y4 y5 y6 > #0.038 )
2202 tags=[Cfsqp;Xconvert;Tex;];
2203 ineq = all_forall `ineq [
2212 ( taum y1 y2 y3 y4 y5 y6 > &0 )
2219 tags=[Cfsqp;Xconvert;Tex];
2220 ineq = all_forall `ineq [
2224 (#3.01,y4,#3.23607);
2229 (#3.01,y9,#3.23607)]
2230 ( delta_y y1 y2 y3 y4 y5 y6 > &30 \/
2231 enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 < #3.23607 )`;
2238 tags=[Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0)];
2239 ineq = all_forall `ineq [
2248 (y_of_x tau_residual_x y1 y2 y3 y4 y5 y6 > #0.027) \/
2249 (delta_y y1 y2 y3 y4 y5 y6 < &0)
2256 map Scripts.one_cfsqp ["test4"];;
2257 map (Auto_lib.testsplit true) ["7697147739 delta top issue";"4680581274 delta top issue";];;
2259 map (Auto_lib.testsplit true) [
2266 let idq_of_string s = hd(Ineq.getexact s);;
2267 idq_of_string "GRKIBMP B";;
2268 Ineq.remove "GRKIBMP B";;
2269 idq_of_string "GRKIBMP test";;
2270 Auto_lib.testsplit true "BIXPCGW 1738910218 a2";;
2271 map (Auto_lib.testsplit true) [
2272 "QITNPEA1 1 0 9063653052 A";
2273 "QITNPEA1 1 1 9063653052 A";
2274 "QITNPEA1 1 2 9063653052 A";
2275 "QITNPEA1 2 0 9063653052 A";
2276 "QITNPEA1 2 1 9063653052 A";
2277 "QITNPEA1 2 2 9063653052 A";
2281 Scripts.one_cfsqp "GRKIBMP A V2";;
2282 let [(s1,tags1,testineq1);(s2,tags2,testineq2)] = Optimize.preprocess_split_idq (hd(Ineq.getexact "GRKIBMP A V2"));;
2283 Auto_lib.execute_interval true tags1 s1 testineq1;;
2285 Auto_lib.testsplit true "GRKIBMP A V2";;
2287 Scripts.one_cfsqp "GLFVCVK4 2477216213 y4subcrit";;
2290 conflicts `x + 1` `x + &2`;;
2295 Debug.find_subterms;;
2301 mk_type ("prod",[`:num`;`:bool`]);;
2303 let follow_your_nose_string_list() =
2304 let aslw = top_realgoal() in
2305 let m = filter (fun (p,_,_) -> p aslw) !noses in
2306 let m2 = map (fun ((_,_,a),b) -> ("{"^string_of_int b ^":"^a^"}")) (zip m (0--((List.length m) -1))) in
2307 Flyspeck_lib.join_comma m2;;
2310 let aslw = top_realgoal() in
2311 let m = filter (fun (p,_,_) -> p aslw) !noses in
2312 let (_,t,_) = List.nth m k in
2315 String.sub "abcde" 0 4;;
2317 let string_starts_with u s = (String.length u <= String.length s) && (u = String.sub s 0 (String.length u));;
2318 string_starts_with "ab" "c";;
2322 Print_types.print_goal_types();;
2331 let rec(%)=(mod) and i=index p '0'and
2333 i<>j & (i/9=j/9||i%9=j%9||i/27=j/27&i%9/3=j%9/3) & p.[i]=p.[j] || j<80 & b(j+1)
2335 iter (fun c->p.[i]<-c;b 0||()=s p;()) "948721536";
2342 let longt = filter (fun (_,t) -> (30 < t)) times;;
2345 map (fun (s,t) -> (s,float_of_int (t) /. 180.0)) longt;;
2347 let t = `hello = there`;;
2353 type_of (inst [(`:b`,ty_b)] b);;
2359 let add_inequality idq = (inxx := idq::!inxx);;
2360 flyspeck_needs "nonlinear/prep.hl";;
2361 let inyy = map (fun t -> t.idv) (!inxx);;
2362 index "4717061266" inyy;;
2364 index "GRKIBMP B V2" inyy;;
2368 mk_rewrites true (ASSUME `!a b. a ==> (b /\ c)`) [];;
2369 SPEC_ALL (REFL `a:bool`);;
2370 30 + 230 + 46 + 9 + 224 + 996 + 5;;
2373 Preprocess.preprocess1;;
2374 let funx s = (Optimize.preprocess_split_idq (hd (Ineq.getexact (s))));;
2376 Flyspeck_lib.output_filestring;;
2379 let prep = Optimize.preprocess_split_idq
2380 (hd (Ineq.getexact (s))) in
2382 Flyspeck_lib.join_lines (map Preprocess.print_one prep) in
2384 ((s,map (fun (s,_,_) -> s) prep),v);;
2386 Preprocess.preprocess1 "GLFVCVK4a 8328676778";;
2392 (* generating proves prep ==> ineq.hl *)
2394 (* follow preprocess_split_idq, step by step *)
2396 let strip_let_conv = REDEPTH_CONV let_CONV;; (* strip_let_tm *)
2398 let LET_ELIM_TAC = CONV_TAC (REDEPTH_CONV let_CONV);;
2400 Optimize.get_split_tags;;
2402 let PREPROCESS (s,tags,case) =
2403 let is_xconvert = mem Xconvert tags in
2404 let is_branch = mem Branching tags in
2405 let strip_let_case = strip_let_conv case in
2406 let _ = report ("process and exec: "^s) in
2408 [PRELIM_REWRITE_TAC;
2409 MP_TAC (REWRITE_RULE[] NONLIN);
2410 if (is_branch) then (BRANCH_TAC) else (ALL_TAC);
2411 if (is_xconvert) then e (X_OF_Y_TAC) else e(ALL_TAC);
2412 if (is_branch && not(is_xconvert)) then
2413 (SERIES3Q1H_5D_TAC) else (ALL_TAC);
2416 let _ = g (strip_let_case) in
2417 let _ = e (EVERY tacl) in
2418 let testineq = snd(top_goal()) in
2426 asmcase `a:bool` then (repeat (fxa mp))
2428 refine(merge1_goal);;
2436 List.length (!current_goalstack);;
2437 List.nth (!current_goalstack) 0;;
2440 let (merge1_goal:refinement) =
2441 fun (meta,sgs,just) ->
2442 if List.length sgs < 2 then (meta,sgs,just)
2444 let s0::s1::s2 = sgs in
2445 let _ = fst(s0) = [] or failwith "merge1_goal asl nonempty" in
2446 let _ = fst(s1) = [] or failwith "merge1_goal asl nonempty" in
2447 let sgs' = ([],mk_conj (snd s0, snd s1)) ::s2 in
2449 (just i ( (CONJUNCT1 (hd ths)) :: (CONJUNCT2 ( (hd ths))) :: tl ths)) in
2453 let (_,sgs,f)::_ = !current_goalstack in
2454 let t = snd(hd sgs) in
2455 DISCH t (f null_inst [ASSUME t]);;
2461 open Nonlinear_lemma;;
2468 let slxx = map (fun t -> t.idv) !Ineq.ineqs;;
2473 prove_ineq "4528012043";;
2475 let s = "4528012043";;
2476 let DSPLIT_TAC i = DISCH_TAC THEN (Optimize.SPLIT_H0_TAC i);;
2477 let LET_ELIM_TAC = CONV_TAC (REDEPTH_CONV let_CONV);;
2478 let is_xconvert tags = mem Xconvert tags;;
2479 let is_branch tags = mem Branching tags;;
2480 let NONL = `prepared_nonlinear:bool`;;
2481 let idq = hd(Ineq.getexact s);;
2483 let (s',tags,ineq) = idq_fields idq;;
2484 let _ = (s = s') or failwith "prove_ineq: wrong ineq";;
2485 try (s,prove(mk_imp(NONL,ineq);;
2487 g(mk_imp(NONL,ineq));;
2491 (EVERY (map DSPLIT_TAC (get_split_tags idq)) );;
2495 PRELIM_REWRITE_TAC;;
2497 e(if (is_branch tags) then BRANCH_TAC else ALL_TAC);;
2498 e(if (is_xconvert tags) then X_OF_Y_TAC else ALL_TAC);;
2499 e(if (is_branch tags && not(is_xconvert tags)) then SERIES3Q1H_5D_TAC else ALL_TAC);;
2502 REWRITE_TAC (get_all_prep_nonlinear s)]))
2503 with Failure _ -> failwith s;;
2504 List.length !Ineq.ineqs;;
2505 List.length !Prep.prep_ineqs;;
2508 module Test = struct
2510 open Counting_spheres;;
2511 let FCHANGED_RADIAL_ALT = prove_by_refinement(
2512 `!(p:real^3->bool) f r.
2513 bounded p /\ polyhedron p /\ vec 0 IN interior p /\ f facet_of p ==>
2514 radial r (vec 0) ( fchanged f INTER normball (vec 0) r)`,
2517 REWRITE_TAC[ Sphere.radial ];
2518 REPEAT WEAK_STRIP_TAC;
2519 REWRITE_TAC[ NORMBALL_BALL ];
2520 REWRITE_TAC[VECTOR_ADD_RID;VECTOR_SUB_RZERO;VECTOR_ADD_LID;VECTOR_SUB_LZERO];
2523 REPEAT WEAK_STRIP_TAC;
2524 FIRST_X_ASSUM_ST `fchanged` MP_TAC;
2525 REWRITE_TAC[IN_INTER];
2526 REWRITE_TAC[ Polyhedron.fchanged ];
2527 REWRITE_TAC[ IN_ELIM_THM ];
2528 REPEAT WEAK_STRIP_TAC;
2530 TYPIFY `v1` EXISTS_TAC;
2532 TYPIFY `t * t'` EXISTS_TAC;
2533 REWRITE_TAC [ VECTOR_MUL_ASSOC ];
2534 REPEAT (FIRST_X_ASSUM_ST `a > b` MP_TAC);
2535 REWRITE_TAC [arith `a > b <=> b < a`];
2536 BY(MESON_TAC[ REAL_LT_MUL ]);
2537 INTRO_TAC Counting_spheres.RADIAL_NORMBALL [`(vec 0):real^3`;`r`];
2538 REWRITE_TAC[ NORMBALL_BALL ];
2539 REWRITE_TAC[ Sphere.radial ];
2540 REWRITE_TAC[VECTOR_ADD_RID;VECTOR_SUB_RZERO;VECTOR_ADD_LID;VECTOR_SUB_LZERO];
2541 FIRST_X_ASSUM MP_TAC;
2542 REWRITE_TAC[ IN_BALL ];
2543 REWRITE_TAC[ dist ];
2544 REWRITE_TAC[VECTOR_ADD_RID;VECTOR_SUB_RZERO;VECTOR_ADD_LID;VECTOR_SUB_LZERO];
2545 REWRITE_TAC[ NORM_NEG ];
2546 BY(ASM_MESON_TAC[SUBSET])
2554 dest_imp `a ==> b`;;
2556 help "IMP_REWR_CONV";;
2558 help "mk_rewrites";;
2559 mk_rewrites false ADD_CLAUSES [];;
2560 help "REWRITES_CONV";;
2562 help "RULE_ASSUM_TAC";;
2568 help "TOP_SWEEP_SQCONV";;
2573 help "GEN_PART_MATCH";;
2579 help "SIMPLE_EXISTS";;
2589 help "EQ_IMP_RULE";;
2594 (map Merge_ineq.get_pack_nonlinear_non_ox3q1h ["QZECFIC wt0";"QZECFIC wt0 corner";"QZECFIC wt0 sqrt8";"QZECFIC wt1";"QZECFIC wt2 A";"CIHTIUM";"CJFZZDW";]);;
2596 Flyspeck_constants.calc `atn (sqrt (#3.07)) < pi - #2.089`;;
2598 Oxl_merge.CELL_CLUSTER_ESTIMATE_PROPS;;
2614 "6944699408 a reduced";
2623 "4240815464 a reduced";
2624 "3862621143 revised";
2634 "OMKYNLT 3336871894"];;
2636 let t1 = map (fun t -> (t,List.length((Ineq.getexact t)))) smt_timeouts;;
2637 filter (fun (_,s) -> (s = 0)) t1;;
2639 map Scripts.one_cfsqp smt_timeouts;;
2644 (* Analysis of constants for Clarke, Gao, et al. *)
2645 (* moved to function_list.hl *)
2648 let tm1 = `domain6 (\x1 x2 x3 x4 x5 x6.
2649 &0 <= x1 /\ &0 <= x2 /\ &0 <= x3 /\
2650 &0 <= x4 /\ &0 <= x5 /\ &0 <= x6)
2651 dih5_x (rotate5 dih_x)`;;
2652 let thm1 = UNDISCH (MATCH_MP domain6_assum (ASSUME tm1));;
2656 help_path := ["/Users/thomashales/Desktop/googlecode/hol-light/Help"; "$/Help"];;
2663 let cons2 = (map (const_types o test) (0--30));;
2664 let cons2 = (map (const_types o test) (0--100));;
2666 const_types (test 740);;
2670 Flyspeck_lib.nub cons;;
2674 let z1 = zip p1 cons in
2675 map fst (filter (fun (_,c) -> mem "matan" c) z1);;
2676 let hss = map (fun t -> t.idv) has_matan;;
2678 let testcase = "5202826650 a";;
2680 let testcase = "7796879304";;
2681 let testcases = subtract hss ["7796879304"];;
2682 map (Auto_lib.testsplit true) testcases;;
2684 let i2 = map (fun t -> t.ineq) (!Ineq.ineqs);;
2685 let ct2 = setify (List.flatten (map cxx i2));;
2687 let ct3 = setify (ct2 @ ct1);;
2690 let p1 = !Prep.prep_ineqs;;
2691 let i1 = map (fun t -> t.ineq) p1;;
2692 let i1 =[ (find (fun t -> (t.idv = "2200527225")) p1).ineq];;
2694 let h1 = (ASSUME (snd(strip_forall (List.nth i1 0))));;
2696 let u = REWRITE_RULE
2697 [Nonlin_def.unit6;Sphere.rad2_x;Sphere.y_of_x;Sphere.rho_x;Sphere.delta_x;
2698 Sphere.ineq;Nonlin_def.sqrt_x1;Nonlin_def.sqrt_x2;Nonlin_def.sqrt_x3;
2699 Nonlin_def.sqrt_x4;Nonlin_def.sqrt_x4;Nonlin_def.sqrt_x5;Nonlin_def.sqrt_x6;
2700 Sphere.vol_x;Sphere.gchi1_x;Sphere.gchi;Sphere.gchi2_x;Sphere.gchi3_x;
2701 Sphere.gchi4_x;Sphere.gchi5_x;Sphere.gchi6_x;
2702 Sphere.dih_x;Sphere.dih2_x;Sphere.dih3_x;Sphere.dih4_x;Sphere.dih5_x;
2703 Sphere.dih6_x;Sphere.dih_y;Sphere.dih2_y;Sphere.dih3_y;
2704 Sphere.dih4_y;Sphere.dih5_y;Sphere.dih6_y;
2705 LET_DEF;LET_END_DEF;
2706 Sphere.delta_x4;Sphere.dih_x;Nonlin_def.unit6;
2707 Sphere.delta_y_LC;Sphere.delta_y;Nonlin_def.proj_x2;Nonlin_def.proj_x3;
2708 Mdtau.mdtau_y_LC;Mdtau.mdtau_y;Mdtau.mdtau2uf_y_LC;Mdtau.mdtau2uf_y;Sphere.rho;Sphere.ups_x;
2709 Sphere.ly;Mdtau.dua;Sphere.sol_y;Sphere.interp;
2710 Sphere.rhazim_x;Sphere.rhazim2_x;Sphere.rhazim3_x;Sphere.rhazim;Sphere.const1;
2711 Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y;
2714 Print_types.print_term_types test;;
2716 let hs1 r = (ASSUME (snd(strip_forall (List.nth (is1 (List.nth cases r)) 0))));;
2717 let h2 = REWRITE_RULE
2718 [Nonlin_def.unit6;Sphere.rad2_x;Sphere.y_of_x;Sphere.rho_x;Sphere.delta_x;
2719 Sphere.ineq;Nonlin_def.sqrt_x1;Nonlin_def.sqrt_x2;Nonlin_def.sqrt_x3;
2720 Nonlin_def.sqrt_x4;Nonlin_def.sqrt_x4;Nonlin_def.sqrt_x5;Nonlin_def.sqrt_x6;
2721 Sphere.vol_x;Sphere.gchi1_x;Sphere.gchi;Sphere.gchi2_x;Sphere.gchi3_x;
2722 Sphere.gchi4_x;Sphere.gchi5_x;Sphere.gchi6_x;
2723 Sphere.dih_x;Sphere.dih2_x;Sphere.dih3_x;Sphere.dih4_x;Sphere.dih5_x;
2724 Sphere.dih6_x;Sphere.dih_y;Sphere.dih2_y;Sphere.dih3_y;
2725 Sphere.dih4_y;Sphere.dih5_y;Sphere.dih6_y;
2726 LET_DEF;LET_END_DEF;
2727 Sphere.delta_x4;Sphere.dih_x;Nonlin_def.unit6;
2728 Nonlin_def.gamma3f_x_div_sqrtdelta;
2729 Nonlin_def.sub6;Nonlin_def.constant6;Nonlin_def.mul6;
2730 Nonlin_def.scalar6;Nonlin_def.add6;Nonlin_def.mk_456;
2731 Sphere.rotate4;Sphere.rotate5;Sphere.rotate6;
2732 Nonlin_def.uni;Nonlin_def.two6;Nonlin_def.proj_x4;Nonlin_def.proj_x5;
2733 Nonlin_def.proj_x6;Nonlin_def.compose6;
2734 Sphere.sol_euler_x_div_sqrtdelta;Nonlin_def.proj_y4;Nonlin_def.proj_y5;
2748 let cxx i = setify (map fst (Print_types.get_const_types i));;
2750 let p1 = !Prep.prep_ineqs;;
2751 let i1 = map (fun t -> t.ineq) p1;;
2752 let ct1 = setify (List.flatten (map cxx i1));;
2754 let i2 = map (fun t -> t.ineq) (!Ineq.ineqs);;
2755 let ct2 = setify (List.flatten (map cxx i2));;
2757 let ct3 = setify (ct2 @ ct1);;
2760 Nonlin_def.safesqrt;;
2775 flyspeck_needs "../glpk/sphere.ml";;
2776 flyspeck_needs "nonlinear/check_completeness.hl";;
2777 let check_completeness_out = Check_completeness.execute();;
2780 (* bcc lattice revisited *)
2785 (* BCC LATTICE PROJECT *)
2787 flyspeck_needs "../projects_discrete_geom/bcc_lattice.hl";;
2788 let ineq_list = ["EIFIOKD-a";"EIFIOKD-b";"EIFIOKD-c";"EIFIOKD1";"EIFIOKD2";"EIFIOKD3";"EIFIOKD4"];;
2789 let testid = "EIFIOKD-a";;
2791 let uu = (hd(Ineq.getexact testid)).ineq;;
2792 let vv = REWRITE_RULE
2793 [LET_DEF;LET_END_DEF;
2794 Bcc_lattice.selling_surface_nn;
2795 Bcc_lattice.selling_surface_num;
2796 Bcc_lattice.selling_volume2;
2797 Bcc_lattice.bcc_value;
2801 idv=(testid^"-test");
2809 let testid2 = testid^"-test";;
2810 Optimize.testsplit false testid2;;
2811 map (Optimize.testsplit true) !testids;;
2815 Auto_lib.terms_with_real_arity_ge8;;
2816 report Auto_lib.fn_code;;
2818 Optimize.preprocess_split_idq (hd(Ineq.getexact "test B1-100"));;
2819 Auto_lib.mkfile_code (all_forall `ineq [
2827 (( taum y1 y2 y3 y4 y5 y6 +
2828 y_of_x (mudLs_234_x (sqrt(&15)) (&10) (&2) (&2) (&2)) y1 y2 y3 y4 y5 y6 - sol0
2830 y_of_x (delta_234_x (&4) (&4) (&4)) y1 y2 y3 y4 y5 y6 < &15 \/
2831 y_of_x (delta_234_x (&4) (&4) (&4)) y1 y2 y3 y4 y5 y6 > &100 \/
2832 (y_of_x eulerA_x y1 y2 y3 y4 y5 y6 < &0)
2837 install_functions();;
2838 rflyspeck_needs "nonlinear/scripts.hl";;
2841 let _ = Ineq.add s in
2842 Scripts.one_cfsqp s.idv;;
2844 rflyspeck_needs "nonlinear/auto_lib.hl";;
2847 let _ = Ineq.add s in
2848 Auto_lib.testsplit true s.idv;;
2851 let _ = Ineq.add s in
2852 Auto_lib.testsplit false s.idv;;
2857 run2 (make_hex_ear i1 i2 i3) done done done;;
2860 let r k = report (string_of_int k);;
2864 let is_sphere= new_definition`is_sphere x=(?(v:real^3)(r:real). (r> &0)/\ (x={w:real^3 | norm (w-v)= r}))`;;
2867 let NULLSET_RULES2 = prove_by_refinement
2868 (`(!P. ((plane P)\/ (is_sphere P) \/ (circular_cone P)) ==> NULLSET P) /\
2869 (!(s:real^3->bool) t. (NULLSET s /\ NULLSET t) ==> NULLSET (s UNION t))`,
2871 SIMP_TAC[NEGLIGIBLE_UNION] ;
2872 X_GEN_TAC `s:real^3->bool` THEN STRIP_TAC;
2873 MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE ;
2874 SIMP_TAC[COPLANAR; DIMINDEX_3; ARITH] THEN ASM_MESON_TAC[SUBSET_REFL];
2875 FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [is_sphere]) ;
2876 STRIP_TAC THEN ASM_REWRITE_TAC[GSYM dist] ;
2877 ONCE_REWRITE_TAC[DIST_SYM] THEN REWRITE_TAC[NEGLIGIBLE_SPHERE];
2878 FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [circular_cone]) ;
2879 REWRITE_TAC[EXISTS_PAIRED_THM; c_cone] THEN STRIP_TAC ;
2881 MP_TAC(ISPECL [`w + v:real^3`; `v:real^3`; `r:real`] NEGLIGIBLE_RCONE_EQ) ;
2882 ASM_REWRITE_TAC[rcone_eq; rconesgn] ;
2883 REWRITE_TAC[dist; VECTOR_ARITH `(w + v) - v:real^N = w`] ;
2884 ASM_REWRITE_TAC[VECTOR_ARITH `w + v:real^N = v <=> w = vec 0`]
2887 let NULLSET_IS_SPHERE = prove_by_refinement
2888 (`(!P. is_sphere P ==> NULLSET P)`,
2890 X_GEN_TAC `s:real^3->bool` THEN STRIP_TAC;
2891 FIRST_X_ASSUM(MP_TAC o GEN_REWRITE_RULE I [is_sphere]) ;
2892 STRIP_TAC THEN ASM_REWRITE_TAC[GSYM dist] ;
2893 ONCE_REWRITE_TAC[DIST_SYM] THEN REWRITE_TAC[NEGLIGIBLE_SPHERE];
2901 doc="old name: local max v4*, WNLKGOQ, 1671775772 (with #0.12->#0.1) 8146670324
2902 better local max test.
2903 This is the numerator of the 2nd derivative of the function taud.
2905 tags=[Main_estimate;Flypaper ["XFZFSWT"];Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0)];
2906 ineq = all_forall `ineq [
2914 (y_of_x taud_D1_num_x y1 y2 y3 y4 y5 y6 > &0 \/
2915 y_of_x taud_D1_num_x y1 y2 y3 y4 y5 y6 < &0 \/
2916 y_of_x taud_D2_num_x y1 y2 y3 y4 y5 y6 < &0 \/
2917 y_of_x taud_x y1 y2 y3 y4 y5 y6 > #0.12 \/
2918 delta_y y1 y2 y3 y4 y5 y6 < &20)`;
2923 idv="test 8723570049";
2924 doc="local fan/main estimate/terminal pent
2925 y1=2.52, delta>=20, falls into taum>=0.12 case";
2926 tags=[Main_estimate;Flypaper ["XFZFSWT"];Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0)];
2927 ineq = all_forall `ineq [
2935 (taud y1 y2 y3 y4 y5 y6 > #0.12 \/
2936 delta_y y1 y2 y3 y4 y5 y6 < &20
2942 Calc_derivative.differentiate `f:real->real` `x:real` `(:real)`;;
2943 Calc_derivative.differentiate `\x. (f (x pow 2)):real` `x:real` `(:real)`;;
2949 idv = "test 22065952723 A1";
2950 doc = "This is the case that $a_2 \\le 15.53$.
2951 $a_2$ upper bound changed on 2011-Jan-21.
2952 If larger than 15.53, it must be in a hexagon, and two consecutive straight vertices.
2953 Warning: this is verified by custom code (using cfsqp heuristics)
2954 in the interval arithmetic calculations.
2955 Fixed statement 2013-06-01.
2957 (* was (num_combo1 e1 e2 e3 a2 b2 c2 > &0) *)
2958 tags=[Flypaper["UPONLFY"];Tex];
2959 ineq = Sphere.all_forall `ineq
2961 (&1 , e1, &1 + sol0/ pi);
2962 (&1 , e2, &1 + sol0/ pi);
2963 (&1 , e3, &1 + sol0/ pi);
2964 ((&2 / h0) pow 2, a2, #15.53);
2965 ((&2 / h0) pow 2, b2, &4 pow 2);
2966 ((&2 / h0) pow 2, c2, &4 pow 2)
2968 ((num1 e1 e2 e3 a2 b2 c2) pow 2 > &0 \/
2969 num2 e1 e2 e3 a2 b2 c2 < &0)`;
2974 List.length Check_completeness.r_init;; (* 15 *)
2975 List.length Check_completeness.triquad_assumption;; (* 3 *)
2978 Check_completeness.terminal_cs;;
2979 List.length Check_completeness.terminal_cs;;
2980 List.nth Check_completeness.terminal_cs 21;;
2985 doc="triangle 1,2-ac";
2986 tags=[Flypaper["FHOLLLW"];Main_estimate;Cfsqp;Xconvert;Tex;Penalty(50.0,500.0)];
2987 ineq = Sphere.all_forall `ineq [
2996 taum y1 y2 y3 y4 y5 y6 > tame_table_d 1 2 + (tame_table_d 2 1 - #0.11)
3004 tags=[Cfsqp;Xconvert;Tex;Penalty(50.0,500.0)];
3005 ineq = Sphere.all_forall `ineq [
3014 ups_x (y2*y2) (y3*y3) (y4*y4) * ups_x (y4*y4) (y5*y5) (y6*y6) > &0
3023 1 long (out to sqrt8): 5541487347
3030 Ineq.getexact "5541487347";;
3036 new_build_silent();;
3041 let old_then = ( THEN );;
3042 let old_prove = prove;;
3043 let old_prove_by_refinement = prove_by_refinement;;
3047 let tactic_counter = ref [3];;
3049 let new_prove_by_refinement(g,thml) =
3050 let _ = tactic_counter := (List.length thml :: !tactic_counter) in
3051 old_prove_by_refinement (g,thml);;
3053 let prove_by_refinement = new_prove_by_refinement;;
3055 rflyspeck_needs "packing/counting_spheres.hl";;
3057 let prove_by_refinement = new_prove_by_refinement in
3058 flyspeck_needs "packing/counting_spheres.hl";;
3062 let tlist = (Lib.sort (<) !tactic_counter);;
3064 List.nth (Lib.sort (<) tlist) (188 / 2);;
3066 end_itlist (+) tlist;;
3068 (end_itlist (+) ) (snd (chop_list (188 /2) tlist));;
3071 let all_forall = Sphere.all_forall;;
3077 doc=" Main estimate/quad case.
3079 tags=[Flypaper["FHOLLLW"];Cfsqp;Main_estimate;Xconvert;Tex;Penalty(50.0,500.0)];
3080 ineq = all_forall `ineq [
3085 (&2 * h0,y5,&2 * h0);
3088 ( delta_y y1 y2 y3 y4 y5 y6 < &0)`;
3094 idv="test 8748498390";
3095 doc=" 0.513 estimate, A-piece triangle.
3096 One diagonal exactly 3.01. Added 2013-06-13";
3097 tags=[Flypaper["FHOLLLW"];Cfsqp;Main_estimate;Xconvert;Tex;Penalty(50.0,500.0)];
3098 ineq = all_forall `ineq [
3106 ( taum y1 y2 y3 y4 y5 y6 + #0.12 * (y1 - &2) > #0.403 )`;
3111 idv="test 2445657182";
3112 doc=" 0.513 estimate. ear. Combine with 8748498390 along diagonal 3.01.
3114 tags=[Flypaper["FHOLLLW"];Cfsqp;Main_estimate;Xconvert;Tex;Penalty(50.0,500.0)];
3115 ineq = all_forall `ineq [
3123 ( taum y1 y2 y3 y4 y5 y6 > #0.11 + #0.12 * (y1 - &2))`;
3126 (* + #0.5 * (#3.01 - y6) ;; *)
3130 idv="test 2445657182";
3131 doc=" 0.513 estimate. ear. Combine with 8748498390 along diagonal 3.01.
3133 tags=[Flypaper["FHOLLLW"];Cfsqp;Xconvert;Tex;Penalty(50.0,500.0)];
3134 ineq = all_forall `ineq [
3142 ( delta_y (&0) y2 y3 y4 y5 y6 > &0 )`;
3148 doc= "Used with 5691615370.
3150 tags=[Cfsqp;Xconvert;Tex;Lp_aux "5691615370";Penalty(50.0,500.0)];
3151 ineq = all_forall `ineq [
3159 ( y1 < &4 \/ delta_y y1 y2 y3 y4 y5 y6 < &0 )`;
3166 tags=[Cfsqp;Xconvert;Tex;Penalty(50.0,500.0)];
3167 ineq = all_forall `ineq [
3175 ( delta_y y1 y2 y3 y4 y5 y6 < &200 )`;
3180 let eta2_126 = new_definition `eta2_126 x1 (x2:real) (x3:real) (x4:real) (x5:real) x6 =
3181 (eta_y (sqrt x1) (sqrt x2) (sqrt x6)) pow 2`;;
3183 Functional_equation.functional_overload();;
3185 let nonf_ups_126 = prove_by_refinement(
3186 `!x1 x2 x3 x4 x5 x6. ups_126 x1 x2 x3 x4 x5 x6 = ups_x x1 x2 x6`,
3189 REWRITE_TAC[Nonlin_def.ups_126];
3190 BY(Functional_equation.F_REWRITE_TAC)
3197 let t = `V = IMAGE vv (:num)`;;
3198 let (a,b) = dest_eq t ;;
3199 let b' = env (top_realgoal()) b ;;
3200 let a' = tysubst [type_of b',type_of a] a ;;
3204 let t' = mk_eq (a',b') ;;
3205 ABBREV_TAC t' (asl,w);;
3210 type_of (inst [`:B`,`:A`] `x:A`);;
3215 help "instantiate";;
3218 let (a,b) = dest_eq t ;;
3219 let b' = env (asl,w) b ;;
3220 let (a',_) = dest_var a ;;
3221 let t' = mk_eq(mk_var(a',type_of b'),b');;
3224 ABBREV_TAC t' (asl,w);;
3231 doc="old name: angles pent*
3232 Local-fan/Main-estimate/Terminal-pent/both-ears-under-20.
3234 tags=[Main_estimate;Flypaper ["XFZFSWT"];Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0)];
3235 ineq = all_forall `ineq [
3243 ( #1.75 < dih_y y1 y2 y3 y4 y5 y6
3250 doc="old name: test A*
3251 Local-fan/Main-estimate/Terminal-pent/both-ears-under-20.
3253 tags=[Main_estimate;Flypaper ["XFZFSWT"];Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0)];
3254 ineq = Sphere.all_forall `ineq [
3263 (dih_y y1 y2 y3 y4 y5 y6 < #1.109)
3269 idv="3405144397-numerical";
3270 doc="old name: test8*
3271 Local-fan/Main-estimate/terminal-pent/both-ears-under-20.
3272 ear dih inequality when delta < 20";
3273 tags=[Cfsqp;Xconvert;Tex;Penalty(500.0,5000.0);Deprecated];
3274 ineq = all_forall `ineq [
3283 (delta_y y1 y2 y3 y4 y5 y6 > &20) \/
3284 (dih_y y1 y2 y3 y4 y5 y6 < (#1.75 - #1.109) / &2) \/
3285 (delta_y y1 y2 y3 y4 y5 y6 < &0)
3291 idv="test 3405144397";
3292 doc="ear dih ineq when delta < 20.
3293 Local-fan/Main-estimate/Terminal-pent/both-ears-under-20.
3294 Adaptation of 9459075374.
3295 (EAR) A bound on the delta of an ear in a pent,
3296 The disjunct (dih_y y1 y2 y3 y4 y5 y6 < #0.3205 = (1.75-1.109)/2) has been 'linearized'.
3297 Tan[0.3205]^2 = (>=) 0.110186
3298 In more detail, this calc shows that delta > 20 or dih < 0.3205
3299 By 4887115291, we know that the combined angle at the crowded node of a pent is
3300 at least 1.75. If both ears have delta < 20, then combined angle
3301 is at least 1.109 + 2 * 0.3205 = 1.75, so a cross diag <= 3.01.
3302 Hence wlog one of the two ears has delta >= 20.
3304 tags=[Cfsqp;Xconvert;Tex;Penalty(50.0,500.0);];
3305 ineq = all_forall `ineq [
3313 (let tan2lower = #0.110186 in
3314 (delta_y y1 y2 y3 y4 y5 y6 > &20) \/
3315 (&4 * x1_delta_y y1 y2 y3 y4 y5 y6 < tan2lower * delta4_squared_y y1 y2 y3 y4 y5 y6)
3319 let all_forall = Sphere.all_forall;;
3322 List.length remain;;
3324 (filter Merge_ineq.is_ox3q1h (!Ineq.ineqs));;
3326 Merge_ineq.packing_ineq_data;;
3328 Ysskqoy.pack_ineq_def_a;;
3331 Script.unfinished_cases();;
3332 searcht 5 [def "deformation"];;
3334 g Appendix.NUXCOEAv2_concl;;
3336 let NUXCOEAv2=prove_by_refinement((Appendix.NUXCOEAv2_concl),
3337 MP_TAC Nuxcoea.NUXCOEA
3338 ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC]
3343 rule (orr[EQ_SYM_EQ])
3347 g Appendix.IMJXPHRv2_concl;;
3349 let IMJXPHRv2=prove((Appendix.IMJXPHRv2_concl),
3350 MP_TAC Imjxphr.IMJXPHR
3351 ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC]
3356 g Appendix.ODXLSTCv2_concl;;
3358 let ODXLSTCv2=prove((Appendix.ODXLSTCv2_concl),
3359 MP_TAC Odxlstcv2.ODXLSTCv2
3360 ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC]
3362 fxa (C intro [`s`;`k`;`w`;`l`])
3374 Appendix.NUXCOEAv2_concl;;
3376 module Test = struct
3381 let NUXCOEAv2=prove((Appendix.NUXCOEAv2_concl),
3383 THEN ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC]
3387 let IMJXPHRv2=prove((Appendix.IMJXPHRv2_concl),
3389 THEN ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC]
3393 let ODXLSTCv2=prove_by_refinement((Appendix.ODXLSTCv2_concl),
3395 MP_TAC Odxlstcv2.ODXLSTCv2;
3396 ASM_REWRITE_TAC[Lunar_deform.MHAEYJN;Zlzthic.ZLZTHIC];
3398 REPEAT WEAKER_STRIP_TAC;
3399 FIRST_X_ASSUM (C INTRO_TAC [`s`;`k`;`w`;`l`]);
3407 searcht 5 [`arclength`;`atn`];;
3409 let arclength222h0 = prove_by_refinement(
3410 `arclength (&2) (&2) (&2 * h0) < pi / &2`,
3413 GMATCH_SIMP_TAC Compute_2158872499.ATN_UPS_X_BREAKDOWN1;
3415 GMATCH_SIMP_TAC REAL_LT_MUL_EQ;
3416 REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ);
3417 BY(REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC);
3418 REWRITE_TAC[arith `x + y < x <=> y < &0`];
3419 ONCE_REWRITE_TAC[GSYM ATN_0];
3420 MATCH_MP_TAC ATN_MONO_LT;
3421 REWRITE_TAC[arith `(x / y < &0 <=> &0 < (-- x)/ y)`];
3422 GMATCH_SIMP_TAC REAL_LT_DIV;
3423 GMATCH_SIMP_TAC SQRT_POS_LT;
3424 REWRITE_TAC[Sphere.h0];
3429 let arclength_2h0_cstab = prove_by_refinement(
3430 `arclength (&2) (&2) (&2 *h0) + arclength (&2) (&2) cstab < pi`,
3433 REPEAT (GMATCH_SIMP_TAC Compute_2158872499.ATN_UPS_X_BREAKDOWN1);
3434 REWRITE_TAC[GSYM CONJ_ASSOC];
3436 BY(REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN REAL_ARITH_TAC);
3438 BY(REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN REAL_ARITH_TAC);
3439 REWRITE_TAC[arith `(pi/ &2 + b) + (pi / &2 + d) < pi <=> b + d < &0`];
3440 REWRITE_TAC[Sphere.h0;Sphere.cstab];
3441 MP_TAC (Flyspeck_constants.calc `atn (((&2 * #1.26) * &2 * #1.26 - &2 * &2 - &2 * &2) / sqrt ((&2 + &2 + &2 * #1.26) * (&2 + &2 - &2 * #1.26) * (&2 + &2 * #1.26 - &2) * (&2 * #1.26 + &2 - &2))) + atn (( #3.01 * #3.01 - &2 * &2 - &2 * &2) / sqrt ((&2 + &2 + #3.01) * (&2 + &2 - #3.01) * (&2 + #3.01 - &2) * ( #3.01 + &2 - &2))) < &0`);
3448 idv="test 6843920790";
3449 doc = "In a pentagon with one long edge, we can contract the long edge to 2.52,
3450 or even to 2, using 2 diags.
3451 The constant 2.38 < 3.01/h0.";
3453 ineq = Sphere.all_forall `ineq
3455 (&1 , e1, &1 + sol0/ pi);
3456 (&1 , e2, &1 + sol0/ pi);
3457 (&1 , e3, &1 + sol0/ pi);
3458 ((&2 / h0) pow 2, a2, #2.52 pow 2);
3459 (#2 pow 2, b2, #15.53);
3460 ((#3.01/ #1.26) pow 2, c2, #15.53)
3462 ((num1 e1 e2 e3 a2 b2 c2 > &0) ) `;
3466 let thm = Localization.deformation;;
3468 let c = fst(dest_const (fst (strip_comb (fst (dest_eq (snd (strip_forall (concl thm))))))));;
3470 (* TRIAL DEFINITION *)
3472 let deflist = ref [];;
3475 let c = fst(dest_const (fst (strip_comb (fst (dest_eq (snd (strip_forall (concl thm)))))))) in
3476 let _ = deflist := (c,thm)::!deflist in
3480 try assoc s (!deflist)
3481 with _ -> failwith ("definition "^s^" not found");;
3483 List.length !proof_record;;
3492 Searching.searcht 5 [`!f g x.
3493 f continuous at x /\ g continuous at x
3494 ==> (\x. lift (f x dot g x)) continuous at x`];;
3495 Searching.searcht 5 [`T`];;
3499 let REAL_CONTINUOUS_AT_DOT2 = prove_by_refinement(
3500 `!(f:real->real^A) g x. f continuous atreal x /\ g continuous atreal x
3501 ==> (\x. (f x dot g x)) real_continuous atreal x`,
3504 REWRITE_TAC[REAL_CONTINUOUS_CONTINUOUS1];
3505 REPEAT WEAKER_STRIP_TAC;
3506 TYPIFY `lift o (\x. f x dot g x) = (\x. lift (f x dot g x))` (C SUBGOAL_THEN SUBST1_TAC);
3507 BY(REWRITE_TAC[FUN_EQ_THM;o_DEF]);
3508 INTRO_TAC CONTINUOUS_LIFT_DOT2 [`f o drop`;`g o drop`;`lift x`];
3509 TYPIFY `(\x. lift ((f o drop) x dot (g o drop) x)) = (\x. lift (f x dot g x)) o drop` (C SUBGOAL_THEN SUBST1_TAC);
3510 BY(REWRITE_TAC[FUN_EQ_THM;o_DEF]);
3511 BY(ASM_REWRITE_TAC[GSYM Xbjrphc.CONTINUOUS_CONTINUOUS_ATREAL])
3516 let CONTINUOUS_LIFT_DOT2 = prove
3517 (`!net f:A->real^N g.
3518 f continuous net /\ g continuous net
3519 ==> (\x. lift(f x dot g x)) continuous net`,
3520 REPEAT GEN_TAC THEN DISCH_THEN(MP_TAC o MATCH_MP (MATCH_MP (REWRITE_RULE
3521 [TAUT `p /\ q /\ r ==> s <=> r ==> p /\ q ==> s`]
3522 BILINEAR_CONTINUOUS_COMPOSE) BILINEAR_DOT)) THEN REWRITE_TAC[]);;
3525 let REAL_CONTINUOUS_AT_DOT2 = prove_by_refinement(
3526 `!(f:real->real^A) g x. f continuous atreal x /\ g continuous atreal x
3527 ==> (\x. (f x dot g x)) real_continuous atreal x`,
3530 REWRITE_TAC[REAL_CONTINUOUS_CONTINUOUS1];
3531 REPEAT WEAKER_STRIP_TAC;
3532 TYPIFY `lift o (\x. f x dot g x) = (\x. lift (f x dot g x))` (C SUBGOAL_THEN SUBST1_TAC);
3533 BY(REWRITE_TAC[FUN_EQ_THM;o_DEF]);
3534 INTRO_TAC CONTINUOUS_AT_LIFT_DOT2 [`f o drop`;`g o drop`;`lift x`];
3535 TYPIFY `(\x. lift ((f o drop) x dot (g o drop) x)) = (\x. lift (f x dot g x)) o drop` (C SUBGOAL_THEN SUBST1_TAC);
3536 BY(REWRITE_TAC[FUN_EQ_THM;o_DEF]);
3537 BY(ASM_REWRITE_TAC[GSYM (* Xbjrphc. *) CONTINUOUS_CONTINUOUS_ATREAL])
3542 module Test = struct
3544 let REAL_CONTINUOUS_AT_DOT2 = prove_by_refinement(
3545 `!(f:real->real^A) g x. f continuous atreal x /\ g continuous atreal x
3546 ==> (\x. (f x dot g x)) real_continuous atreal x`,
3549 REWRITE_TAC[REAL_CONTINUOUS_CONTINUOUS1];
3550 REPEAT WEAKER_STRIP_TAC;
3551 TYPIFY `lift o (\x. f x dot g x) = (\x. lift (f x dot g x))` (C SUBGOAL_THEN SUBST1_TAC);
3552 BY(REWRITE_TAC[FUN_EQ_THM;o_DEF]);
3553 MATCH_MP_TAC CONTINUOUS_LIFT_DOT2;
3560 proof_record := [];;
3562 String.length " REPEAT GEN_TAC;
3563 ASM_CASES_TAC `~(?x1. a * x1 pow 2 + b * x1 + c = &0)`;
3564 BY(ASM_MESON_TAC[]);
3565 FIRST_X_ASSUM MP_TAC THEN REWRITE_TAC[] THEN REPEAT STRIP_TAC;
3566 ASM_CASES_TAC `!x2. a * x2 pow 2 + b * x2 + c = &0 ==> x2 = x1`;
3567 BY(ASM_MESON_TAC[]);
3568 FIRST_X_ASSUM MP_TAC THEN REWRITE_TAC[NOT_FORALL_THM] THEN REPEAT STRIP_TAC;
3569 GEXISTL_TAC [`x1`;`x2`];
3570 BY(GEN_TAC THEN ASM_TAC THEN CONV_TAC REAL_RING)";;
3573 asmcs `~(?x1. a * x1 pow 2 + b * x1 + c = &0)`
3575 fx mp then rt[] then str/r
3576 asmcs `!x2. a * x2 pow 2 + b * x2 + c = &0 ==> x2 = x1`
3578 fx mp then rt[NOT_FORALL_THM] then str/r
3580 g then asm then cvc REAL_RING";;
3585 (* BUGGY BEHAVIOR *)
3586 can (term_match [] `((f:A->B) ((v:num->A) 2))`) `((f:A->B) ((v:num->A) 7))`;;
3588 can (term_match [] `(f:num->A) 2`) `(f:num->A) 7`;;
3595 ineq = Sphere.all_forall `ineq
3604 ((dih_y y1 y2 y3 y4 y5 y6 > pi / &2) ) `;
3612 ineq = Sphere.all_forall `ineq
3621 ((delta_y y1 y2 y3 y4 y5 y6 > &0) \/
3622 arclength y1 y2 y6 > #2.8) `;
3628 Ineq.getexact "test";;
3629 let v1 = hd(Ineq.getexact s);;
3630 let v2 = List.length (fst (strip_forall (v1.ineq)));;
3632 (* analysis of cases with more than 6 variables *)
3635 let v1 = hd (Ineq.getexact s) in
3636 List.length (fst (strip_forall (v1.ineq)));;
3638 let ineqnames = map (fun idq -> idq.idv) (!Ineq.ineqs);;
3640 filter (fun s -> numvars s > 6) ineqnames;;
3642 let manyvars = ["9507202313"; "4680581274 delta issue"; "4680581274 a"; "9563139965D";
3643 "3862621143 revised"; "4240815464 a"; "6944699408 a"; "7043724150 a"];;
3645 map numvars manyvars;;
3650 map (fun t -> t.idv) (Ineq.getfield Onlycheckderiv1negative);;
3652 map (fun t -> t.idv) (filter (fun t -> Optimize.has_cross_diag (t.ineq)) !Prep.prep_ineqs);;
3653 ["7043724150 a"; "6944699408 a"; "4240815464 a"; "3862621143 revised";
3654 "4680581274"; "4680581274 delta issue"; "7697147739";
3655 "7697147739 delta issue"; "9507202313"];;
3658 Ineq.getexact "4680581274 a";;
3661 `!y1 y2 y3 y4 y5 y6 y7 y8 y9.
3663 [ #2.0,y1,&2 * h0; #2.0,y2,&2 * h0; #2.0,y3,&2 * h0; #3.01,
3668 &2; #2.0,y6,&2; #2.0,y7,&2 * h0; #2.0,y8,&2; #3.01,y9, #3.01]
3669 (tauq y1 y2 y3 y4 y5 y6 y7 y8 y9 > #0.513 \/
3670 delta_y y1 y2 y3 y4 y5 y6 < &10 \/
3671 delta4_y y1 y2 y3 y4 y5 y6 > &0 \/
3672 enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 < #3.01)`;
3673 idv = "test 4680581274 a";
3675 "quad case both diags > 3.01, y9 long.\n 4559601669 gives the gratuitous delta4_y disjunct.\n May 23, changed delta4 constant from -11.2 to 0.\n 2013-05-05, 0.696 -> 0.616.";
3677 [Flypaper ["FHOLLLW"]; Main_estimate; Cfsqp; Quad_cluster 10000.0;
3678 Xconvert; Tex; Penalty (50., 5000.)]};;
3680 module Am = Pervasives;;
3682 let (x0,z0) = ([0.0;0.0;0.0],[1.0;4.0;3.0]);;
3684 let w0 = map (fun (xi,zi) -> zi -. xi) (zip x0 z0);;
3685 let avoid_filter = map (fun i -> (mem i avoid0)) (0--(List.length x0 - 1));;
3686 let w' = map (fun (t,b) -> if b then 0.0 else t) (zip w0 avoid_filter);;
3687 let wm = maxlist w' ;;
3690 let arclength_lt_1553 = prove_by_refinement(
3691 `&2 * arclength (&2) (&2) (&2 * h0) < arclength (&2) (&2) (sqrt(#15.53))`,
3694 REPEAT (GMATCH_SIMP_TAC Compute_2158872499.ATN_UPS_X_BREAKDOWN1);
3695 GMATCH_SIMP_TAC REAL_LT_MUL_EQ;
3696 REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ);
3697 REWRITE_TAC[arith `x + &2 - &2 = x`];
3698 REWRITE_TAC[Sphere.h0];
3699 TYPIFY `#3.9 < sqrt (#15.53) /\ sqrt(#15.53) < #3.95` (C SUBGOAL_THEN ASSUME_TAC);
3700 GMATCH_SIMP_TAC REAL_LT_RSQRT;
3703 MATCH_MP_TAC REAL_LT_LSQRT;
3705 TYPIFY_GOAL_THEN `&0 < &2 + &2 * #1.26 - &2 /\ &0 < &2 + &2 - &2 * #1.26 /\ &0 < &2 + &2 + &2 * #1.26 /\ &0 < &2 + sqrt #15.53 - &2 /\ &0 < &2 + &2 - sqrt #15.53 /\ &0 < &2 + &2 + sqrt #15.53 /\ &0 < sqrt #15.53 /\ &0 < &2 * #1.26` (unlist REWRITE_TAC);
3706 BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC);
3707 MP_TAC (Flyspeck_constants.calc `&2 * (pi / &2 + atn (((&2 * #1.26) * &2 * #1.26 - &2 * &2 - &2 * &2) / sqrt ((&2 + &2 + &2 * #1.26) * (&2 + &2 - &2 * #1.26) * (&2 + &2 * #1.26 - &2) * &2 * #1.26))) < pi / &2 + atn ((sqrt #15.53 * sqrt #15.53 - &2 * &2 - &2 * &2) / sqrt ((&2 + &2 + sqrt #15.53) * (&2 + &2 - sqrt #15.53) * (&2 + sqrt #15.53 - &2) * sqrt #15.53))` );
3718 ineq = Sphere.all_forall `ineq
3726 ((dih_y y1 y2 y3 y4 y5 y6 > pi / &2) ) `;
3733 idv="test 1348932091"; (* was "testB"; *)
3735 tags=[Main_estimate;Cfsqp;Tex;Xconvert];
3736 ineq = Sphere.all_forall `ineq
3744 ((dih_y y1 y2 y3 y4 y5 y6 < #1.4) ) `;
3750 idv= "test 5557288534"; (* was "testC"; *)
3752 tags=[Main_estimate;Cfsqp;Tex;Xconvert];
3753 ineq = Sphere.all_forall `ineq
3761 ((dih_y y1 y2 y3 y4 y5 y6 < #1.7) ) `;
3764 needs "../formal_lp/hypermap/ineqs/lp_ineqs_proofs-compiled.hl";;
3765 needs "../formal_lp/hypermap/computations/list_hypermap_computations.hl";;
3767 needs "../formal_lp/hypermap/verify_all.hl";;
3768 Verify_all.init_ineqs();;
3769 let result = Verify_all.verify_file (flyspeck_dir ^"/../formal_lp/glpk/binary/easy_onepass_1.dat");;
3773 val it : thm = lp_ineqs, lp_main_estimate,
3774 iso (hypermap_of_fan (V,ESTD V))
3776 [['0; '1; '2; '3]; ['0; '3; '4; '5]; ['4; '3; '6; '7]; ['6; '3; '2]; ['1; '0; '8; '9]; ['8; '0; '5]; ['2; '1; '10]; ['10; '1; '9]; ['6; '2; '10]; ['5; '4; '11]; ['11; '4; '7]; ['7; '6; '12]; ['12; '6; '10]; ['8; '5; '11]; ['9; '8; '13]; ['13; '8; '11]; ['12; '10; '9]; ['12; '9; '13]; ['13; '11; '7]; ['7; '12; '13]])
3777 |- contravening V ==> F
3779 type_of `hypermap_of_fan`;;
3780 type_of `hypermap_of_list`;;
3783 type_of `['0;'1;'2]`;;
3785 run2f (hd(Ineq.getexact "7550003505 0 1 3"));;
3787 Print_types.get_const_types;;
3793 [`norm2hh (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3794 norm2hh_x x1 x2 x3 x4 x5 x6 `;
3795 `rad2_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3796 rad2_x x1 x2 x3 x4 x5 x6 `;
3797 `delta4_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3798 delta_x4 x1 x2 x3 x4 x5 x6 `;
3799 `delta4_y (sqrt x7) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x8) (sqrt x9) =
3800 delta_x4 x7 x2 x3 x4 x8 x9 `;
3801 `dih2_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3802 dih2_x x1 x2 x3 x4 x5 x6 `;
3803 `dih3_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3804 dih3_x x1 x2 x3 x4 x5 x6 `;
3805 `dih_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3806 dih_x x1 x2 x3 x4 x5 x6 `;
3807 `dih4_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3808 dih4_x x1 x2 x3 x4 x5 x6 `;
3809 `dih5_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3810 dih5_x x1 x2 x3 x4 x5 x6 `;
3811 `dih6_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3812 dih6_x x1 x2 x3 x4 x5 x6 `;
3813 `delta_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3814 delta_x x1 x2 x3 x4 x5 x6 `;
3815 `delta_y (sqrt x7) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x8) (sqrt x9) =
3816 delta_x x7 x2 x3 x4 x8 x9`;
3817 `vol_y (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3818 vol_x x1 x2 x3 x4 x5 x6 `;
3819 `eta_y (sqrt x1) (sqrt x2) (sqrt x6) pow 2 = eta2_126 x1 x2 x3 x4 x5 x6 `;
3820 `eta_y (sqrt x1) (sqrt x3) (sqrt x5) pow 2 = eta2_135 x1 x2 x3 x4 x5 x6 `;
3821 `eta_y (sqrt x4) (sqrt x5) (sqrt x6) pow 2 = eta2_456 x1 x2 x3 x4 x5 x6 `;
3822 `vol3f (sqrt x1) (sqrt x2) (sqrt x6) sqrt2 lfun = vol3f_x_lfun x1 x2 x3 x4 x5 x6 `;
3823 `vol_y sqrt2 sqrt2 sqrt2 (sqrt x1) (sqrt x2) (sqrt x6) = vol3_x_sqrt x1 x2 x3 x4 x5 x6 `;
3824 `vol3f_sqrt2_lmplus (sqrt x1) (sqrt x2) (sqrt x3) (sqrt x4) (sqrt x5) (sqrt x6) =
3825 vol3f_x_sqrt2_lmplus x1 x2 x3 x4 x5 x6`;
3828 let tab1 = List.nth tab 0;;
3829 fst (strip_comb (fst(dest_eq tab1)));;