(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION                                              *)
(* Section: Conclusions                                                       *)
(* Chapter: Local Fan                                                         *)
(* Author: Thomas C. Hales                                                    *)
(* Date: 2013-04-17                                                           *)
(* ========================================================================== *)

(*
Terminal cases of main estimate.
*)

flyspeck_needs "local/appendix_main_estimate.hl";;

module Terminal = struct


open Hales_tactic;;

(*
let filter_flypaper tl = 
  List.flatten (map (function
	    | Flypaper s -> s
	    | _ -> []) tl);;

let has_flypaper_tag sl ind = 
  let tl = ind.tags in
    List.length (intersect (filter_flypaper tl) sl) > 0;;

let main_ineq_data = 
  filter (fun ind ->
	    has_flypaper_tag ["UPONLFY";"SAUZWSD";"EDZEPIH";"OMKYNLT";"FHOLLLW";"TNNOPSI"] ind) (!Ineq.ineqs);;

let main_nonlinear = 
  let ineql = map (fun idv -> idv.ineq) main_ineq_data in
  let main_ineq_conj = end_itlist (curry mk_conj) ineql in
  let _ = new_definition (mk_eq (`main_nonlinear_v39:bool`,main_ineq_conj)) in
    ();;

let is_main = function 
	    | Main_estimate -> true
	    | _ -> false;;

let has_main ind = 
    exists (is_main) ind.tags;;

let main_ineq_data = 
  filter has_main (!Ineq.ineqs);;

let get_main_nonlinear = 
  let ineql = map (fun ind -> ind.ineq) main_ineq_data in
  let sl = map (fun ind -> ind.idv) main_ineq_data in
  let main_ineq_conj = end_itlist (curry mk_conj) ineql in
  let th = new_definition (mk_eq (`main_nonlinear_v39:bool`,main_ineq_conj)) in
  let th1 = UNDISCH (MATCH_MP (TAUT `(a <=> b) ==> (a ==> b)`) th) in
  let co1 thm = if (is_conj (concl thm)) then CONJUNCT1 thm else thm in
    fun s ->
      let i = index s sl in
      let th2 = funpow i CONJUNCT2 th1 in
	co1 th2;;

*)


let get_main_nonlinear = 
  let is_main = function 
    | Main_estimate -> true
    | _ -> false in
  let has_main ind = 
    exists (is_main) ind.tags in
  let main_ineq_data1 = 
    filter has_main (!Ineq.ineqs) in
  let id = map (fun t-> t.idv) main_ineq_data1 in
  let main_ineq_data = map (fun t -> hd(Ineq.getexact t)) id in
  let ineql = map (fun ind -> ind.ineq) main_ineq_data in
  let sl = map (fun ind -> ind.idv) main_ineq_data in
  let main_ineq_conj = end_itlist (curry mk_conj) ineql in
  
let th = new_definition (mk_eq (`main_nonlinear_terminal_v11:bool`,main_ineq_conj)) in
  let th1 = UNDISCH (MATCH_MP (TAUT `(a <=> b) ==> (a ==> b)`) th) in
  let co1 thm = if (is_conj (concl thm)) then CONJUNCT1 thm else thm in
  let tryindex s sl = try index s sl with  _ -> report s; failwith s in
    fun s ->
      let i = tryindex s sl in
      let th2 = funpow i CONJUNCT2 th1 in
	co1 th2;;
(* Start with OWZLKVY. *) let LET_THM = CONJ LET_DEF LET_END_DEF;;
let sqrt8_flyspeck = 
prove_by_refinement( `#2.828427 < sqrt8 /\ sqrt8 < #2.828428`,
(* {{{ proof *) [ BY(REWRITE_TAC[Flyspeck_constants.bounds]) ]);;
(* }}} *)
let SOL_SOLID_TRIANGLE_ALT = 
prove_by_refinement( `!v0 v1 v2 v3. ~coplanar {v0, v1, v2, v3} ==> sol v0 (convex hull {v0, v1, v2, v3}) = dihV v0 v1 v2 v3 + dihV v0 v2 v3 v1 + dihV v0 v3 v1 v2 - pi`,
(* {{{ proof *) [ BY(MESON_TAC[Tskajxy_lemmas.SOL_SOLID_TRIANGLE]) ]);;
(* }}} *)
let sol_x_nn = 
prove_by_refinement( `!x1 x2 x3 x4 x5 x6. &0 < x1 /\ &0 < x2 /\ &0 < x3 /\ &0 < ups_x x1 x2 x6 /\ &0 < ups_x x2 x3 x4 /\ &0 < ups_x x1 x3 x5 /\ &0 < eulerA_x x1 x2 x3 x4 x5 x6 /\ &0 < delta_x x1 x2 x3 x4 x5 x6 ==> &0 < sol_x x1 x2 x3 x4 x5 x6`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC Merge_ineq.sol_x_sol_euler_x; ASM_REWRITE_TAC[Sphere.sol_euler_x;LET_DEF;LET_END_DEF]; REPEAT (GMATCH_SIMP_TAC SQRT_MUL); REWRITE_TAC[GSYM Sphere.eulerA_x]; GMATCH_SIMP_TAC REAL_LE_MUL; ASM_SIMP_TAC[arith `&0 < x ==> &0 <= x`]; MATCH_MP_TAC (arith `&0 < x ==> &0 < &2 * x `); GMATCH_SIMP_TAC Merge_ineq.ATN2_POS; CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); GMATCH_SIMP_TAC REAL_LT_RSQRT; BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let DIH_X_NN = 
prove_by_refinement( `!x1 x2 x3 x4 x5 x6. &0 < x1 /\ &0 <= delta_x x1 x2 x3 x4 x5 x6 ==> &0 <= dih_x x1 x2 x3 x4 x5 x6`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_CASES_TAC `&0 < delta_x x1 x2 x3 x4 x5 x6`; MATCH_MP_TAC Merge_ineq.dih_x_nn; BY(ASM_REWRITE_TAC[]); TYPIFY `delta_x x1 x2 x3 x4 x5 x6 = &0` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); ASM_REWRITE_TAC[Sphere.dih_x;LET_DEF;LET_END_DEF]; REWRITE_TAC[arith `x * &0 = &0`;SQRT_0]; TYPED_ABBREV_TAC `d4 = -- delta_x4 x1 x2 x3 x4 x5 x6`; INTRO_TAC Merge_ineq.atn2_0 [`d4`]; REPEAT WEAKER_STRIP_TAC; ASSUME_TAC PI_POS; MP_TAC (arith `&0 < d4 \/ d4 < &0 \/ d4 = &0`); DISCH_THEN DISJ_CASES_TAC; ASM_SIMP_TAC[]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); FIRST_X_ASSUM DISJ_CASES_TAC; ASM_SIMP_TAC[]; BY(REAL_ARITH_TAC); ASM_SIMP_TAC[]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let DIH_Y_NN = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6. &0 < y1 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> &0 <= dih_y y1 y2 y3 y4 y5 y6`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Sphere.dih_y;LET_DEF;LET_END_DEF]; MATCH_MP_TAC DIH_X_NN; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; ASM_REWRITE_TAC[]; FIRST_X_ASSUM MP_TAC; BY(REWRITE_TAC[Sphere.delta_y]) ]);;
(* }}} *)
let RHO_LB = 
prove_by_refinement( `!y. &2 <= y ==> &1 <= rho y`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Nonlinear_lemma.rho_alt]; MATCH_MP_TAC (arith `&0 <= x ==> &1 <= &1 + x `); GMATCH_SIMP_TAC REAL_LE_MUL; REWRITE_TAC[GSYM Nonlinear_lemma.sol0_over_pi_EQ_const1]; GMATCH_SIMP_TAC REAL_LE_RDIV_EQ; GMATCH_SIMP_TAC REAL_LE_RDIV_EQ; REWRITE_TAC[arith `&0 * x = &0`]; REWRITE_TAC[PI_POS]; INTRO_TAC Flyspeck_constants.bounds []; FIRST_X_ASSUM MP_TAC; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let DIH_Y_LT_RHAZIM = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> dih_y y1 y2 y3 y4 y5 y6 <= rhazim y1 y2 y3 y4 y5 y6`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Sphere.rhazim]; MATCH_MP_TAC (arith `&0 <= (r - &1) * d ==> d <= r * d`); GMATCH_SIMP_TAC REAL_LE_MUL; CONJ2_TAC; MATCH_MP_TAC DIH_Y_NN; ASM_REWRITE_TAC[]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); MATCH_MP_TAC (arith `&1 <= r ==> &0 <= r - &1`); MATCH_MP_TAC RHO_LB; BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let taum_taum_x = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6. &0 <= y1 /\ &0 <= y2 /\ &0 <= y3 /\ &0 <= y4 /\ &0 <= y5 /\ &0 <= y6 ==> taum y1 y2 y3 y4 y5 y6 = y_of_x taum_x y1 y2 y3 y4 y5 y6`,
(* {{{ proof *) [ REWRITE_TAC[Sphere.y_of_x;Sphere.taum_x;Sphere.rhazim_x;Sphere.rhazim2_x;Sphere.rhazim3_x]; REWRITE_TAC[Nonlinear_lemma.taum_123]; REPEAT WEAKER_STRIP_TAC; BY(ASM_SIMP_TAC[Nonlinear_lemma.sqrtxx]) ]);;
(* }}} *) (* Now do OCBICBY *) let BBs_terminal = `!s vv. MEM s scs_terminal_v116 /\ BBs_v39 s vv ==> &0 <= taustar_v39 s vv`;;
let scs_unadorned_explicit = 
prove_by_refinement( `(!k d a b. scs_k_v39 (mk_unadorned_v39 k d a b) = k) /\ (!k d a b . scs_d_v39 (mk_unadorned_v39 k d a b) = d) /\ (!k d a b . scs_a_v39 (mk_unadorned_v39 k d a b) = a) /\ (!k d a b . scs_am_v39 (mk_unadorned_v39 k d a b) = a) /\ (!k d a b . scs_b_v39 (mk_unadorned_v39 k d a b) = b) /\ (!k d a b . scs_bm_v39 (mk_unadorned_v39 k d a b) = b) /\ (!k d a b . scs_J_v39 (mk_unadorned_v39 k d a b) = (\ i j. F)) /\ (!k d a b . scs_lo_v39 (mk_unadorned_v39 k d a b) = {}) /\ (!k d a b . scs_hi_v39 (mk_unadorned_v39 k d a b) = {}) /\ (!k d a b . scs_str_v39 (mk_unadorned_v39 k d a b) = {})`,
(* {{{ proof *) [ BY(REWRITE_TAC[Appendix.scs_v39_explicit;Appendix.mk_unadorned_v39]) ]);;
(* }}} *)
let UNADORNED_NOT_EAR = 
prove_by_refinement( `!k d a b. ~(is_ear_v39 (mk_unadorned_v39 k d a b))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.is_ear_v39;scs_unadorned_explicit;EMPTY_GSPEC]; BY(MESON_TAC[NOT_IN_EMPTY;IN_SING]) ]);;
(* }}} *)
let dsv_unadorned = 
prove_by_refinement( `!k d a b vv. dsv_v39 (mk_unadorned_v39 k d a b) vv = d `,
(* {{{ proof *) [ REWRITE_TAC[Appendix.dsv_v39;UNADORNED_NOT_EAR;scs_unadorned_explicit;EMPTY_GSPEC;SUM_CLAUSES]; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let dsv_F = 
prove_by_refinement( `!k d a a' b' b s s' s'' vv. dsv_v39 (scs_v39 (k, d, a, a', b', b, (\i j. F), s, s',s'')) vv = d `,
(* {{{ proof *) [ ASM_REWRITE_TAC[Appendix.dsv_v39;Appendix.scs_v39_explicit;EMPTY_GSPEC;SUM_CLAUSES]; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let SUM_INTER = 
prove_by_refinement( `!(A:A->bool) B f. sum (A INTER B) f = sum A (\i. if (i IN B) then f i else &0)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; INTRO_TAC SUM_SUPERSET [`(\i. if (i IN B) then f i else &0)`;`A INTER B`;`A`]; ANTS_TAC; CONJ_TAC; BY(SET_TAC[]); BY(SET_TAC[]); DISCH_THEN SUBST1_TAC; MATCH_MP_TAC SUM_EQ; REWRITE_TAC[IN_INTER]; BY(MESON_TAC[]) ]);;
(* }}} *)
let dsv_fun3 = 
prove_by_refinement( `! d a a' b' b f s s' s'' vv. dsv_v39 (scs_v39 (3, d, a, a', b', b, f , s, s',s'')) vv = d + #0.1 * (if is_ear_v39 (scs_v39 (3,d,a,a',b',b,f ,s,s',s'')) then &1 else -- &1) * ((if f 0 1 then cstab - dist (vv 0,vv 1) else &0) + (if f 1 2 then cstab - dist (vv 1,vv 2) else &0) + (if f 2 3 then cstab - dist (vv 2,vv 3) else &0) + &0) `,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[Appendix.dsv_v39;Appendix.scs_v39_explicit;EMPTY_GSPEC;SUM_CLAUSES]; TYPIFY `{i | i < 3 /\ f i (SUC i) } = {0,1,2} INTER {i | f i (SUC i) }` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[EXTENSION;IN_ELIM_THM;IN_INTER;IN_INSERT;NOT_IN_EMPTY]; BY(REWRITE_TAC[arith `x < 3 <=> (x = 0 \/ x = 1 \/ x = 2)`]); REWRITE_TAC[SUM_INTER;IN_ELIM_THM]; REPEAT (GMATCH_SIMP_TAC (CONJUNCT2 SUM_CLAUSES)); REWRITE_TAC[NOT_IN_EMPTY;IN_INSERT;FINITE_EMPTY;FINITE_INSERT;arith `~(0 = 1) /\ ~(0=2) /\ ~(1 = 2)`;SUM_CLAUSES]; BY(REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3`]) ]);;
(* }}} *)
let dsv_fun4 = 
prove_by_refinement( `! d a a' b' b f s s' s'' vv. dsv_v39 (scs_v39 (4, d, a, a', b', b, f , s, s',s'')) vv = d - #0.1 * ((if f 0 1 then cstab - dist (vv 0,vv 1) else &0) + (if f 1 2 then cstab - dist (vv 1,vv 2) else &0) + (if f 2 3 then cstab - dist (vv 2,vv 3) else &0) + (if f 3 4 then cstab - dist (vv 3,vv 4) else &0) + &0) `,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[Appendix.dsv_v39;Appendix.scs_v39_explicit;EMPTY_GSPEC;SUM_CLAUSES]; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit;arith `~(4 = 3)`]; MATCH_MP_TAC (arith `(s = s') ==> d + a * -- &1 * s = d - a * s'`); TYPIFY `{i | i < 4 /\ f i (SUC i) } = {0,1,2,3} INTER {i | f i (SUC i) }` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[EXTENSION;IN_ELIM_THM;IN_INTER;IN_INSERT;NOT_IN_EMPTY]; BY(REWRITE_TAC[arith `x < 4 <=> (x = 0 \/ x = 1 \/ x = 2 \/ x = 3)`]); REWRITE_TAC[SUM_INTER;IN_ELIM_THM]; REPEAT (GMATCH_SIMP_TAC (CONJUNCT2 SUM_CLAUSES)); REWRITE_TAC[NOT_IN_EMPTY;IN_INSERT;FINITE_EMPTY;FINITE_INSERT;arith `~(0 = 1) /\ ~(0=2) /\ ~(1 = 2) /\ ~(2 = 3) /\ ~(0=3) /\ ~(1 = 3)`;SUM_CLAUSES]; BY(REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`]) ]);;
(* }}} *)
let IMAGE_SUBSET_IN = 
prove_by_refinement( `!(f:A->B) A B. IMAGE f A SUBSET B <=> (!a. a IN A ==> f a IN B)`,
(* {{{ proof *) [ SET_TAC[] ]);;
(* }}} *)
let taustar3  = 
prove_by_refinement( `!d a b. (let s = mk_unadorned_v39 3 d a b in ((!v0 v1 v2. &2 <= norm v0 /\ norm v0 <= &2 * h0 /\ &2 <= norm v1 /\ norm v1 <= &2 * h0 /\ &2 <= norm v2 /\ norm v2 <= &2 * h0 /\ a 0 1 <= dist(v0,v1) /\ dist(v0,v1) <= b 0 1 /\ a 1 2 <= dist(v1,v2) /\ dist(v1,v2) <= b 1 2 /\ a 0 2 <= dist(v0,v2) /\ dist(v0,v2) <= b 0 2 ==> d <= tau3 v0 v1 v2) ==> (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv)))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Appendix.taustar_v39;scs_unadorned_explicit;arith `3 <= 3`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[dsv_unadorned]; REWRITE_TAC[arith `&0 <= t - d <=> d <= t`]; FIRST_X_ASSUM MATCH_MP_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[Appendix.BBs_v39;scs_unadorned_explicit;arith `3 <= 3`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[IMAGE_SUBSET_IN;IN_UNIV;Fnjlbxs.in_ball_annulus]; BY(MESON_TAC[]) ]);;
(* }}} *)
let taustar3_fun = 
prove_by_refinement( `!d a b f. (let s = scs_v39 (3,d,a,a,b,b,f,{},{},{}) in ((!v0 v1 v2. &2 <= norm v0 /\ norm v0 <= &2 * h0 /\ &2 <= norm v1 /\ norm v1 <= &2 * h0 /\ &2 <= norm v2 /\ norm v2 <= &2 * h0 /\ a 0 1 <= dist(v0,v1) /\ dist(v0,v1) <= b 0 1 /\ a 1 2 <= dist(v1,v2) /\ dist(v1,v2) <= b 1 2 /\ a 0 2 <= dist(v0,v2) /\ dist(v0,v2) <= b 0 2 ==> d + #0.1 * (if is_ear_v39 s then &1 else -- &1) * ((if f 0 1 then cstab - dist (v0,v1) else &0) + (if f 1 2 then cstab - dist (v1,v2) else &0) + (if f 2 3 then cstab - dist (v2,v0) else &0) + &0) <= tau3 v0 v1 v2) ==> (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))) `,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Appendix.taustar_v39;Appendix.scs_v39_explicit;arith `3 <= 3`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[dsv_fun3]; REWRITE_TAC[arith `&0 <= t - d <=> d <= t`]; TYPIFY `vv 3 = vv 0` (C SUBGOAL_THEN SUBST1_TAC); FIRST_X_ASSUM MP_TAC; REWRITE_TAC[Appendix.BBs_v39]; REWRITE_TAC[Appendix.scs_v39_explicit]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[Oxl_def.periodic]; BY(MESON_TAC[arith `0 + 3 = 3`]); FIRST_X_ASSUM MATCH_MP_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[Appendix.BBs_v39;Appendix.scs_v39_explicit;arith `3 <= 3`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[IMAGE_SUBSET_IN;IN_UNIV;Fnjlbxs.in_ball_annulus]; BY(MESON_TAC[]) ]);;
(* }}} *)
let NONPARALLEL_BALL_ANNULUS40 =
prove_by_refinement(`!v w. &2<= norm(v-w) /\ norm(v-w)< &4 /\ v IN ball_annulus /\ w IN ball_annulus ==> ~(collinear ({vec 0} UNION {v,w}))`,
[ REPEAT GEN_TAC; REWRITE_TAC[SET_RULE`{A} UNION {B,C}={A,B,C}`;GSYM NORM_CAUCHY_SCHWARZ_EQUAL;NORM_LE_SQUARE;NORM_LT_SQUARE;]; ONCE_REWRITE_TAC[REAL_ARITH`A<=B <=> B >= A`]; REWRITE_TAC[NORM_GE_SQUARE;REAL_ARITH`~(&2<= &0) /\ &0 < &2`]; ONCE_REWRITE_TAC[REAL_ARITH`A>=B <=> B <= A`]; REWRITE_TAC[DOT_RSUB;DOT_LSUB;DOT_SQUARE_NORM]; DISJ_CASES_TAC(REAL_ARITH`&0<= v dot w \/ &0<= --(v dot (w:real^3))`); POP_ASSUM MP_TAC; REWRITE_TAC[GSYM REAL_ABS_REFL]; RESA_TAC; REPEAT STRIP_TAC; POP_ASSUM(fun t-> ASM_TAC THEN REWRITE_TAC[t] THEN REPEAT STRIP_TAC THEN MP_TAC t); REWRITE_TAC[]; ONCE_REWRITE_TAC[DOT_SYM]; STRIP_TAC; POP_ASSUM(fun t-> ASM_TAC THEN REWRITE_TAC[t] ); REWRITE_TAC[REAL_ARITH`A pow 2 -A*B-(A*B-B pow 2)=(A-B) pow 2`;GSYM REAL_LE_SQUARE_ABS;Pack_defs.ball_annulus;IN_ELIM_THM;DIFF;ball;cball;dist;VECTOR_ARITH`vec 0 -A= --A`;NORM_NEG;REAL_ARITH`~(a<b)<=> b<=a`]; DISJ_CASES_TAC(REAL_ARITH`&0<= norm (v:real^3) -norm w \/ &0<= --(norm v -norm (w:real^3))`); POP_ASSUM MP_TAC; REWRITE_TAC[GSYM REAL_ABS_REFL]; RESA_TAC; REPEAT STRIP_TAC; MP_TAC(REAL_ARITH`norm (v:real^3) <= &2 * h0 /\ &2 <= norm (w:real^3) ==> norm v - norm w <= &2*(h0 - &1)`); ASM_REWRITE_TAC[Sphere.h0]; ASM_TAC; BY(REAL_ARITH_TAC); POP_ASSUM MP_TAC; REWRITE_TAC[GSYM REAL_ABS_REFL;REAL_ABS_NEG]; RESA_TAC; ONCE_REWRITE_TAC[REAL_ARITH`--(A-B)=B-A`]; REPEAT STRIP_TAC; MP_TAC(REAL_ARITH`norm (w:real^3) <= &2 * h0 /\ &2 <= norm (v:real^3) ==> norm w - norm v <= &2*(h0 - &1)`); ASM_REWRITE_TAC[Sphere.h0]; ASM_TAC; BY(REAL_ARITH_TAC); POP_ASSUM MP_TAC; REWRITE_TAC[GSYM REAL_ABS_REFL;REAL_ABS_NEG]; RESA_TAC; ONCE_REWRITE_TAC[REAL_ARITH`--A=B<=> A= --B`]; REPEAT STRIP_TAC; POP_ASSUM(fun t-> ASM_TAC THEN REWRITE_TAC[t] THEN REPEAT STRIP_TAC THEN MP_TAC t); REWRITE_TAC[]; ONCE_REWRITE_TAC[DOT_SYM]; STRIP_TAC; POP_ASSUM(fun t-> ASM_TAC THEN REWRITE_TAC[t] ); REWRITE_TAC[REAL_ARITH`A pow 2 -(--(A*B))-(--(A*B)-B pow 2)=(A+B) pow 2`;GSYM REAL_LE_SQUARE_ABS;Pack_defs.ball_annulus;IN_ELIM_THM;DIFF;ball;cball;dist;VECTOR_ARITH`vec 0 -A= --A`;NORM_NEG;REAL_ARITH`~(a<b)<=> b<=a`]; STRIP_TAC; REMOVE_ASSUM_TAC; MP_TAC(REAL_ARITH`&0<= norm (v:real^3) /\ &0<= norm (w:real^3)==> &0<= norm v + norm w`); SIMP_TAC[NORM_POS_LE]; REWRITE_TAC[GSYM REAL_ABS_REFL]; RESA_TAC; REPEAT STRIP_TAC; MP_TAC(REAL_ARITH`&2<=norm (w:real^3) /\ &2 <= norm (v:real^3) ==> &4<= norm v + norm w `); ASM_REWRITE_TAC[]; DISCH_TAC; FIRST_X_ASSUM_ST `pow` MP_TAC; REWRITE_TAC[]; REWRITE_TAC[arith `~(x2 < y2) <=> y2 <= x2`]; MATCH_MP_TAC Collect_geom2.POS_IMP_POW2; ASM_REWRITE_TAC[]; BY(REAL_ARITH_TAC) ] );;
let NONPARALLEL_BALL_ANNULUS_ALT = 
prove_by_refinement( `!v w. &2 <= dist(v,w) /\ dist(v,w) <= #3.62 /\ // was cstab. v IN ball_annulus /\ w IN ball_annulus ==> ~collinear ({vec 0,v, w})`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM MP_TAC; TYPIFY `{vec 0,v,w} = {vec 0} UNION {v,w}` (C SUBGOAL_THEN SUBST1_TAC); BY(SET_TAC[]); REWRITE_TAC[]; MATCH_MP_TAC Dih2k_hypermap.NONPARALLEL_BALL_ANNULUS362; REWRITE_TAC[GSYM dist]; BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let NONPARALLEL_BALL_ANNULUS40_ALT = 
prove_by_refinement( `!v w. &2 <= dist(v,w) /\ dist(v,w) < &4 /\ v IN ball_annulus /\ w IN ball_annulus ==> ~collinear ({vec 0,v, w})`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM MP_TAC; TYPIFY `{vec 0,v,w} = {vec 0} UNION {v,w}` (C SUBGOAL_THEN SUBST1_TAC); BY(SET_TAC[]); REWRITE_TAC[]; MATCH_MP_TAC NONPARALLEL_BALL_ANNULUS40; REWRITE_TAC[GSYM dist]; BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let tau3_taum = 
prove_by_refinement( `!(v0:real^3) v1 v2. v0 IN ball_annulus /\ v1 IN ball_annulus /\ v2 IN ball_annulus /\ &2 <= dist(v0,v1) /\ &2 <= dist(v0,v2) /\ &2 <= dist(v1,v2) /\ dist(v0,v1) <= #3.62 /\ dist(v0,v2) <= #3.62 /\ dist(v1,v2) <= #3.62 ==> tau3 v0 v1 v2 = taum (norm v0) (norm v1) (norm v2) (dist(v1,v2)) (dist(v0,v2)) (dist(v0,v1))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.tau3;Nonlinear_lemma.taum_123;Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y]; REWRITE_TAC[Sphere.rhazim;Nonlinear_lemma.sol0_const1]; REPEAT WEAKER_STRIP_TAC; TYPIFY `dihV (vec 0) v0 v1 v2 = dih_y (norm v0) (norm v1) (norm v2) (dist (v1,v2)) (dist (v0,v2)) (dist (v0,v1)) /\ dihV (vec 0) v1 v2 v0 = dih_y (norm v1) (norm v2) (norm v0) (dist (v0,v2)) (dist (v0,v1)) (dist (v1,v2)) /\ dihV (vec 0) v2 v0 v1 = dih_y (norm v2) (norm v0) (norm v1) (dist (v0,v1)) (dist (v1,v2)) (dist (v0,v2))` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); BY(REAL_ARITH_TAC); REPEAT (GMATCH_SIMP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] Merge_ineq.DIHV_EQ_DIH_Y)); REWRITE_TAC[DIST_0]; TYPIFY `dist(v2,v0) = dist(v0,v2) /\ dist(v2,v1) = dist(v1,v2) /\ dist(v1,v0) = dist(v0,v1)` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[DIST_SYM]); ASM_REWRITE_TAC[]; REPEAT (GMATCH_SIMP_TAC NONPARALLEL_BALL_ANNULUS_ALT); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let tau3_taum_40 = 
prove_by_refinement( `!(v0:real^3) v1 v2. v0 IN ball_annulus /\ v1 IN ball_annulus /\ v2 IN ball_annulus /\ &2 <= dist(v0,v1) /\ &2 <= dist(v0,v2) /\ &2 <= dist(v1,v2) /\ dist(v0,v1) < &4 /\ dist(v0,v2) < &4 /\ dist(v1,v2) < &4 ==> tau3 v0 v1 v2 = taum (norm v0) (norm v1) (norm v2) (dist(v1,v2)) (dist(v0,v2)) (dist(v0,v1))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.tau3;Nonlinear_lemma.taum_123;Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y]; REWRITE_TAC[Sphere.rhazim;Nonlinear_lemma.sol0_const1]; REPEAT WEAKER_STRIP_TAC; TYPIFY `dihV (vec 0) v0 v1 v2 = dih_y (norm v0) (norm v1) (norm v2) (dist (v1,v2)) (dist (v0,v2)) (dist (v0,v1)) /\ dihV (vec 0) v1 v2 v0 = dih_y (norm v1) (norm v2) (norm v0) (dist (v0,v2)) (dist (v0,v1)) (dist (v1,v2)) /\ dihV (vec 0) v2 v0 v1 = dih_y (norm v2) (norm v0) (norm v1) (dist (v0,v1)) (dist (v1,v2)) (dist (v0,v2))` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); BY(REAL_ARITH_TAC); REPEAT (GMATCH_SIMP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] Merge_ineq.DIHV_EQ_DIH_Y)); REWRITE_TAC[DIST_0]; TYPIFY `dist(v2,v0) = dist(v0,v2) /\ dist(v2,v1) = dist(v1,v2) /\ dist(v1,v0) = dist(v0,v1)` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[DIST_SYM]); ASM_REWRITE_TAC[]; REPEAT (GMATCH_SIMP_TAC NONPARALLEL_BALL_ANNULUS40_ALT); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let DELTA_Y_POS_4POINTS = 
prove_by_refinement( `!v0 v1 v2 (v3:real^3). &0 <= delta_y (dist(v0,v1)) (dist(v0,v2)) (dist(v0,v3)) (dist(v2,v3)) (dist(v1,v3)) (dist(v1,v2))`,
(* {{{ proof *) [ REWRITE_TAC[Sphere.delta_y;arith `x * x = x pow 2`]; REWRITE_TAC[GSYM Merge_ineq.delta_delta_x]; BY(REWRITE_TAC[Collect_geom.DELTA_POS_4POINTS]) ]);;
(* }}} *)
let tau3_taum_d = 
prove_by_refinement( `!d a01 a12 a02 b01 b12 b02. (&2 <= a01 /\ &2 <= a12 /\ &2 <= a02 /\ b01 <= #3.62 /\ b12 <= #3.62 /\ b02 <= #3.62 /\ (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ a01 <= y6 /\ y6 <= b01 /\ a12 <= y4 /\ y4 <= b12 /\ a02 <= y5 /\ y5 <= b02 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> d <= taum y1 y2 y3 y4 y5 y6) ==> (!v0 v1 v2. &2 <= norm v0 /\ norm v0 <= &2 * h0 /\ &2 <= norm v1 /\ norm v1 <= &2 * h0 /\ &2 <= norm v2 /\ norm v2 <= &2 * h0 /\ a01 <= dist(v0,v1) /\ dist(v0,v1) <= b01 /\ a12 <= dist(v1,v2) /\ dist(v1,v2) <= b12 /\ a02 <= dist(v0,v2) /\ dist(v0,v2) <= b02 ==> d <= tau3 v0 v1 v2))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC tau3_taum; CONJ_TAC; REWRITE_TAC[Fnjlbxs.in_ball_annulus]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); FIRST_X_ASSUM MATCH_MP_TAC; TYPIFY `&0 <= delta_y (norm v0) (norm v1) (norm v2) (dist (v1,v2)) (dist (v0,v2)) (dist (v0,v1))` (C SUBGOAL_THEN (unlist REWRITE_TAC)); REWRITE_TAC[GSYM Trigonometry1.DIST_L_ZERO]; BY(REWRITE_TAC[DELTA_Y_POS_4POINTS]); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let tau3_taum_dfun = 
prove_by_refinement( `!d a01 a12 a02 b01 b12 b02 f. (&2 <= a01 /\ &2 <= a12 /\ &2 <= a02 /\ b01 <= #3.62 /\ b12 <= #3.62 /\ b02 <= #3.62 /\ (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ a01 <= y6 /\ y6 <= b01 /\ a12 <= y4 /\ y4 <= b12 /\ a02 <= y5 /\ y5 <= b02 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> d + f y4 y5 y6 <= taum y1 y2 y3 y4 y5 y6) ==> (!v0 v1 v2. &2 <= norm v0 /\ norm v0 <= &2 * h0 /\ &2 <= norm v1 /\ norm v1 <= &2 * h0 /\ &2 <= norm v2 /\ norm v2 <= &2 * h0 /\ a01 <= dist(v0,v1) /\ dist(v0,v1) <= b01 /\ a12 <= dist(v1,v2) /\ dist(v1,v2) <= b12 /\ a02 <= dist(v0,v2) /\ dist(v0,v2) <= b02 ==> d + f (dist(v1,v2)) (dist(v0,v2)) (dist(v0,v1)) <= tau3 v0 v1 v2))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC tau3_taum; CONJ_TAC; REWRITE_TAC[Fnjlbxs.in_ball_annulus]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); FIRST_X_ASSUM MATCH_MP_TAC; TYPIFY `&0 <= delta_y (norm v0) (norm v1) (norm v2) (dist (v1,v2)) (dist (v0,v2)) (dist (v0,v1))` (C SUBGOAL_THEN (unlist REWRITE_TAC)); REWRITE_TAC[GSYM Trigonometry1.DIST_L_ZERO]; BY(REWRITE_TAC[DELTA_Y_POS_4POINTS]); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let taustar_taum = 
prove_by_refinement( `!d a b. (&2 <= a 0 1 /\ &2 <= a 1 2 /\ &2 <= a 0 2 /\ b 0 1 <= #3.62 /\ b 1 2 <= #3.62 /\ b 0 2 <= #3.62 /\ (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ a 0 1 <= y6 /\ y6 <= b 0 1 /\ a 1 2 <= y4 /\ y4 <= b 1 2 /\ a 0 2 <= y5 /\ y5 <= b 0 2 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> d <= taum y1 y2 y3 y4 y5 y6) ==> (let s = mk_unadorned_v39 3 d a b in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))) `,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar3); MATCH_MP_TAC tau3_taum_d; BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let taustar_taum_dfun = 
prove_by_refinement( `!d a b f. (let s = scs_v39 (3,d,a,a,b,b,f,{},{},{}) in (&2 <= a 0 1 /\ &2 <= a 1 2 /\ &2 <= a 0 2 /\ b 0 1 <= #3.62 /\ b 1 2 <= #3.62 /\ b 0 2 <= #3.62 /\ (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ a 0 1 <= y6 /\ y6 <= b 0 1 /\ a 1 2 <= y4 /\ y4 <= b 1 2 /\ a 0 2 <= y5 /\ y5 <= b 0 2 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> d + #0.1 * (if is_ear_v39 s then &1 else -- &1) * ((if f 0 1 then cstab - y6 else &0) + (if f 1 2 then cstab - y4 else &0) + (if f 2 3 then cstab - y5 else &0) + &0) <= taum y1 y2 y3 y4 y5 y6) ==> (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))) `,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT GEN_TAC; DISCH_TAC; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar3_fun); REPEAT GEN_TAC; TYPIFY `dist(v2,(v0:real^3)) = dist(v0,v2)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[DIST_SYM]); REPEAT WEAKER_STRIP_TAC; REPLICATE_TAC 12 (FIRST_X_ASSUM MP_TAC); REWRITE_TAC[TAUT `(a ==> b ==> c) <=> (a /\ b) ==> c` ]; REWRITE_TAC[TAUT `(a /\ b) /\ c <=> (a /\ b /\ c)`]; SPEC_TAC (`v2:real^3`,`v2:real^3`); SPEC_TAC (`v1:real^3`,`v1:real^3`); SPEC_TAC (`v0:real^3`,`v0:real^3`); MATCH_MP_TAC tau3_taum_dfun; BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let taum_sym = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6. taum y1 y2 y3 y4 y5 y6 = taum y2 y1 y3 y5 y4 y6 /\ taum y1 y2 y3 y4 y5 y6 = taum y1 y3 y2 y4 y6 y5`,
(* {{{ proof *) [ REWRITE_TAC[Nonlinear_lemma.taum_123;Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y]; REWRITE_TAC[Sphere.rhazim]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC (REAL_RING `((e1:real) = e1' /\ e2 = e2' /\ e3 = e3' /\ e1 = e1'' /\ e2 = e2'' /\ e3 = e3'') ==> ((r1 * e1 + r2 * e2 + r3 * e3 - c = r2 * e2' + r1 * e1' + r3 * e3' - c) /\ (r1 * e1 + r2 * e2 + r3 * e3 - c = r1 * e1'' + r3 * e3'' + r2 * e2'' - c))`); BY(MESON_TAC[Nonlinear_lemma.dih_y_sym;Nonlinear_lemma.dih_y_sym2]) ]);;
(* }}} *)
let MOD_4_EXPLICIT = 
prove_by_refinement( `0 MOD 4 = 0 /\ 1 MOD 4 = 1 /\ 2 MOD 4 = 2 /\ 3 MOD 4 = 3 /\ 4 MOD 4 = 0 /\ 5 MOD 4 = 1 /\ 6 MOD 4 = 2`,
(* {{{ proof *) [ ASM_SIMP_TAC[MOD_LT;MOD_MULT_ADD;arith `0 < 4 /\ 1 < 4 /\ 2 < 4 /\ 3 < 4 /\ 5 = 1*4 + 1 /\ 6 = 1*4 + 2`]; BY(ASM_SIMP_TAC[Oxlzlez.MOD_REFL_ALT;arith `~(4 =0)`]) ]);;
(* }}} *)
let FUNLIST_EXPLICIT = 
prove_by_refinement( `(!data d k i j. funlist_v39 data d k i j = (if i MOD k = j MOD k then &0 else ASSOCD_v39 (psort k (i,j)) (MAP (\ (u,d). psort k u,d) data) d)) /\ (!data u u' k i j. funlistA_v39 data (u:A) u' k i j = (if i MOD k = j MOD k then u else ASSOCD_v39 (psort k (i,j)) (MAP (\ (u,d). psort k u,d) data) u')) /\ 0 MOD 3 = 0 /\ 1 MOD 3 = 1 /\ 2 MOD 3 = 2 /\ 3 MOD 3 = 0 /\ (! (x:real) . x = x) /\ ~(0 = 1) /\ ~(0 = 2) /\ ~(1 = 2) /\ ~(0 = 3) /\ ~(1 = 3) /\ ~(2 = 3) /\ psort 3 (0,1) = 0,1 /\ psort 3 (0,2) = 0,2 /\ psort 3 (1,2) = 1,2 /\ psort 3 (2,3) = 0,2 /\ psort 4 (0,1) = 0,1 /\ psort 4 (0,2) = 0,2 /\ psort 4 (0,3) = 0,3 /\ psort 4 (1,2) = (1,2) /\ psort 4 (1,3) = (1,3) /\ psort 4 (2,3) = (2,3) /\ psort 4 (1,0) = (0,1) /\ psort 4 (2,0) = (0,2) /\ psort 4 (3,0) = (0,3) /\ psort 4 (2,1) = (1,2) /\ psort 4 (3,1) = (1,3) /\ psort 4 (3,2) = (2,3) /\ (!(a:A) (b:B) c d. (a,b) = (c,d) <=> (a = c) /\ (b = d)) /\ (!(a:A) (d:B). ASSOCD_v39 a [] d = d) /\ (!(a:A) (d:B) h t. ASSOCD_v39 a (CONS h t) d = (if a = FST h then SND h else ASSOCD_v39 a t d)) /\ (!k. MAP (\ (u,(d:B)). psort k u,d) [] = []) /\ (!p d. ASSOCD_v39 (p:A) [] (d:B) = d) /\ (!k i j r t. MAP (\ (u,(d:B)). psort k u,d) (CONS ((i,j),r) t) = CONS (psort k (i,j),r) (MAP (\ (u,d). psort k u,d) t)) `,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Appendix.funlist_v39;Appendix.funlistA_v39;Appendix.ASSOCD_v39;PAIR_EQ]; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[arith `~(0 = 1) /\ ~(0=2) /\ ~(1=2) /\ ~(0 = 3) /\ ~(1 = 3) /\ ~(2 = 3)`]; REWRITE_TAC[MAP]; REWRITE_TAC[Appendix.psort;LET_DEF;LET_END_DEF]; REWRITE_TAC[MOD_4_EXPLICIT;PAIR_EQ]; TYPIFY `0 MOD 3 = 0 /\ 1 MOD 3 = 1 /\ 2 MOD 3 = 2` (C SUBGOAL_THEN ASSUME_TAC); REPEAT (GMATCH_SIMP_TAC MOD_LT); BY(ARITH_TAC); ASM_REWRITE_TAC[]; TYPIFY `3 MOD 3 = 0` (C SUBGOAL_THEN SUBST1_TAC); BY(ASM_SIMP_TAC[Oxlzlez.MOD_REFL_ALT;arith `~(3 = 0)`]); ARITH_TAC ]);;
(* }}} *)
let periodic2_funlist = 
prove_by_refinement( `!a a0 k. periodic2 (funlist_v39 a a0 k) k`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.periodic2;Appendix.funlist_v39]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; TYPIFY `!i. (i + k) MOD k = i MOD k` (C SUBGOAL_THEN ASSUME_TAC); GEN_TAC; ONCE_REWRITE_TAC[arith `i + (k:num) = 1 * k + i`]; BY(REWRITE_TAC[MOD_MULT_ADD]); TYPIFY `psort k (i + k,j) = psort k (i,j) /\ psort k (i,j+k) = psort k (i,j)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_REWRITE_TAC[Appendix.psort]); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let periodic2_funlistA = 
prove_by_refinement( `!j1 j' j'' k. periodic2 (funlistA_v39 j1 j' (j'':A) k) k`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.periodic2;Appendix.funlistA_v39]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; TYPIFY `!i. (i + k) MOD k = i MOD k` (C SUBGOAL_THEN ASSUME_TAC); GEN_TAC; ONCE_REWRITE_TAC[arith `i + (k:num) = 1 * k + i`]; BY(REWRITE_TAC[MOD_MULT_ADD]); TYPIFY `psort k (i + k,j) = psort k (i,j) /\ psort k (i,j+k) = psort k (i,j)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_REWRITE_TAC[Appendix.psort]); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let psort_sym = 
prove_by_refinement( `!k i j. psort k (i,j) = psort k (j,i)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Appendix.psort]; REWRITE_TAC[LET_DEF;LET_END_DEF]; BY(REPEAT COND_CASES_TAC THEN REWRITE_TAC[PAIR_EQ] THEN (REPEAT (FIRST_X_ASSUM MP_TAC)) THEN ARITH_TAC) ]);;
(* }}} *)
let funlist_sym = 
prove_by_refinement( `!k a a0 i j. funlist_v39 a a0 k i j = funlist_v39 a a0 k j i`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.funlist_v39]; REPEAT WEAKER_STRIP_TAC; TYPIFY `psort k (i,j) = psort k (j,i)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[psort_sym]); REWRITE_TAC[LET_DEF;LET_END_DEF]; BY(COND_CASES_TAC THEN ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let funlistA_sym = 
prove_by_refinement( `!k a (a0:A) a1 i j. funlistA_v39 a a0 a1 k i j = funlistA_v39 a a0 a1 k j i`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.funlistA_v39]; REPEAT WEAKER_STRIP_TAC; TYPIFY `psort k (i,j) = psort k (j,i)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[psort_sym]); REWRITE_TAC[LET_DEF;LET_END_DEF]; BY(COND_CASES_TAC THEN ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let funlist_diag = 
prove_by_refinement( `!a (a0) k i. funlist_v39 a a0 k i i = &0`,
(* {{{ proof *) [ BY(REWRITE_TAC[Appendix.funlist_v39;LET_DEF;LET_END_DEF]) ]);;
(* }}} *)
let funlistA_diag = 
prove_by_refinement( `!j1 j2 j3 k i. funlistA_v39 j1 j2 j3 k i i = (j2:A)`,
(* {{{ proof *) [ BY(REWRITE_TAC[Appendix.funlistA_v39;LET_DEF;LET_END_DEF]) ]);;
(* }}} *)
let funlistA_empty = 
prove_by_refinement( `!k. funlistA_v39 [] F F k = ( \ i j. F) `,
(* {{{ proof *) [ REWRITE_TAC[Appendix.funlistA_v39;FUN_EQ_THM;MAP;LET_DEF;LET_END_DEF;Appendix.ASSOCD_v39]; BY(MESON_TAC[]) ]);;
(* }}} *)
let funlist_kik = 
prove_by_refinement( `!b b0 k i. funlist_v39 b b0 k i k = funlist_v39 b b0 k 0 i`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; TYPIFY `k MOD k = 0 MOD k` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[arith `k = 1*k + 0`;MOD_MULT_ADD]); REWRITE_TAC[Appendix.funlist_v39;LET_DEF;LET_END_DEF]; TYPIFY `psort k (i,k) = psort k (0,i)` (C SUBGOAL_THEN SUBST1_TAC); ASM_REWRITE_TAC[Appendix.psort;LET_DEF;LET_END_DEF]; BY(COND_CASES_TAC THEN COND_CASES_TAC THEN REWRITE_TAC[PAIR_EQ] THEN (REPEAT (FIRST_X_ASSUM MP_TAC)) THEN ARITH_TAC); ASM_REWRITE_TAC[]; BY(COND_CASES_TAC THEN ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let periodic_mod_reduce = 
prove_by_refinement( `!P k. ~(k = 0) /\ periodic P k /\ (!i. i < k ==> P i) ==> (!i. P i)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC Oxl_def.periodic_mod; TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[]; FIRST_X_ASSUM MATCH_MP_TAC; BY(ASM_MESON_TAC[DIVISION]) ]);;
(* }}} *)
let periodic2_mod_reduce = 
prove_by_refinement( `!P k. ~(k = 0) /\ periodic2 P k /\ (!i j. i < k /\ j < k ==> P i j) ==> (!i j. P i j)`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.periodic2]; REPEAT WEAKER_STRIP_TAC; TYPIFY `!i. periodic (P i) k` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[Oxl_def.periodic]; BY(ASM_REWRITE_TAC[]); TYPIFY `!j. periodic (\i. P i j) k` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[Oxl_def.periodic]; BY(ASM_REWRITE_TAC[]); TYPIFY `(\ i. P i j) i = (\ i. P i j) (i MOD k)` ((C SUBGOAL_THEN MP_TAC)); MATCH_MP_TAC Oxl_def.periodic_mod; BY(ASM_REWRITE_TAC[]); REWRITE_TAC[]; DISCH_THEN SUBST1_TAC; TYPIFY `P (i MOD k) j = P (i MOD k) (j MOD k)` (C SUBGOAL_THEN MP_TAC); MATCH_MP_TAC Oxl_def.periodic_mod; BY(ASM_REWRITE_TAC[]); DISCH_THEN SUBST1_TAC; FIRST_X_ASSUM MATCH_MP_TAC; BY(ASM_MESON_TAC[DIVISION]) ]);;
(* }}} *)
let periodic2_mod_sym_reduce = 
prove_by_refinement( `!P k. ~(k = 0) /\ periodic2 P k /\ (!i. P i i) /\ (!i j. P i j = P j i) /\ (!i j. i < j /\ j < k ==> P i j) ==> (!i j. P i j)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC periodic2_mod_reduce; TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[]; REPEAT WEAKER_STRIP_TAC; TYPIFY `(i:num) < j` ASM_CASES_TAC; FIRST_X_ASSUM MATCH_MP_TAC; BY(ASM_REWRITE_TAC[]); TYPIFY `(j:num) < i \/ (j = i)` (C SUBGOAL_THEN MP_TAC); BY(FIRST_X_ASSUM MP_TAC THEN ARITH_TAC); DISCH_THEN DISJ_CASES_TAC; BY(ASM_MESON_TAC[]); BY(ASM_MESON_TAC[]) ]);;
(* }}} *)
let periodic2_SUC_periodic = 
prove_by_refinement( `!f i. periodic2 (f:num->num->A) k ==> periodic (\i. f i (SUC i)) k`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.periodic2;Oxl_def.periodic]; REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; TYPIFY `SUC (i + k) = SUC i + k` (C SUBGOAL_THEN SUBST1_TAC); BY(ARITH_TAC); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let periodic_vv_inj = 
prove_by_refinement( `!vv k. periodic (vv:num->A) k /\ ~(k = 0) /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> (!i j. (vv i = vv j) <=> (i MOD k = j MOD k)) `,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Geomdetail.EQ_EXPAND]; CONJ2_TAC; BY(ASM_MESON_TAC[Oxl_def.periodic_mod]); INTRO_TAC Oxl_def.periodic_mod [`vv`;`k`]; ASM_REWRITE_TAC[]; DISCH_THEN (unlist ONCE_REWRITE_TAC); BY(ASM_MESON_TAC[DIVISION]) ]);;
(* }}} *)
let I_LT_J_LT_3_EXPLICIT = 
prove_by_refinement( `!i j. (i < j /\ j < 3) <=> ((i = 0 /\ j = 1) \/ (i = 0 /\ j = 2) \/ (i = 1 /\ j = 2))`,
(* {{{ proof *) [ BY(ARITH_TAC) ]);;
(* }}} *)
let I_LT_J_LT_4_EXPLICIT = 
prove_by_refinement( `!i j. (i < j /\ j < 4) <=> ((i = 0 /\ j = 1) \/ (i = 0 /\ j = 2) \/ (i = 0 /\ j = 3) \/ (i = 1 /\ j = 2) \/ (i = 1 /\ j = 3) \/ (i = 2 /\ j = 3))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Geomdetail.EQ_EXPAND]; CONJ2_TAC; BY(ARITH_TAC); REPEAT WEAKER_STRIP_TAC; TYPIFY `j = 1 \/ j = 2 \/ j = 3` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[] THEN REPEAT (FIRST_X_ASSUM MP_TAC); BY(ARITH_TAC); BY(ARITH_TAC); BY(ARITH_TAC) ]);;
(* }}} *)
let is_scs_funlist = 
prove_by_refinement( `!k d a0 b0 j0 a b j1 u u' u''. d < #0.9 /\ 3 <= k /\ k <= 6 /\ periodic u k /\ periodic u' k /\ periodic u'' k /\ (!i j. i < j /\ j < k ==> funlist_v39 a a0 k i j <= funlist_v39 b b0 k i j) /\ (!i j. i < j /\ j < k ==> &2 <= funlist_v39 a a0 k i j) /\ (!i. i < 3 /\ k = 3 ==> funlist_v39 b b0 k i (SUC i) < &4) /\ (!i. i < k /\ 3 < k ==> funlist_v39 b b0 k i (SUC i) <= cstab) /\ (!i j. i < j /\ j < k /\ funlistA_v39 j1 F j0 k i j ==> funlist_v39 a a0 k i j = sqrt8 /\ funlist_v39 b b0 k i j = cstab) /\ (!i j. i < j /\ j < k /\ funlistA_v39 j1 F j0 k i j ==> j = SUC i \/ (i = 0 /\ SUC j = k)) /\ CARD {i | i < k /\ (&2 * h0 < funlist_v39 b b0 k i (SUC i) \/ &2 < funlist_v39 a a0 k i (SUC i))} + k <= 6 ==> is_scs_v39 (scs_v39 (k,d, funlist_v39 a a0 k,funlist_v39 a a0 k, funlist_v39 b b0 k,funlist_v39 b b0 k, funlistA_v39 j1 F j0 k,u,u',u''))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[Appendix.is_scs_v39;Appendix.scs_v39_explicit;arith `x <= x`;Appendix.periodic_empty]; REWRITE_TAC[periodic2_funlist;periodic2_funlistA]; REWRITE_TAC[funlist_sym;funlistA_sym;funlist_diag]; CONJ_TAC; MATCH_MP_TAC periodic2_mod_sym_reduce; TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[TAUT `(a /\ a' ==> b ==> c) <=> (a /\ a' /\ b ==> c)` ]; ASM_SIMP_TAC[arith `3 <= k ==> ~(k=0)`]; REWRITE_TAC[funlist_diag;arith `&0 <= &0`]; CONJ_TAC; REWRITE_TAC[Appendix.periodic2]; BY(MESON_TAC[periodic2_funlist;Appendix.periodic2]); BY(MESON_TAC[funlist_sym]); COMMENT "next goal";
CONJ_TAC; REPEAT WEAKER_STRIP_TAC; TYPIFY `i < (j:num)` ASM_CASES_TAC; BY(ASM_MESON_TAC[]); ONCE_REWRITE_TAC[funlist_sym]; FIRST_X_ASSUM MATCH_MP_TAC; BY(ASM_SIMP_TAC[arith `~(i = j) /\ ~(i < j) ==> (j < (i:num))`]); COMMENT "next goal again"; CONJ_TAC; REWRITE_TAC[RIGHT_FORALL_IMP_THM]; DISCH_TAC; MATCH_MP_TAC periodic_mod_reduce; TYPIFY `k` EXISTS_TAC; ASM_SIMP_TAC [arith `k=3 ==> ~(k=0)`]; REWRITE_TAC[Oxl_def.periodic]; BY(ASM_MESON_TAC[periodic2_funlist;periodic2_SUC_periodic;Oxl_def.periodic]); COMMENT "next"; CONJ_TAC; REWRITE_TAC[RIGHT_FORALL_IMP_THM]; DISCH_TAC; MATCH_MP_TAC periodic_mod_reduce; TYPIFY `k` EXISTS_TAC; ASM_SIMP_TAC [arith `3 < k ==> ~(k=0)`]; REWRITE_TAC[Oxl_def.periodic]; BY(ASM_MESON_TAC[periodic2_funlist;periodic2_SUC_periodic;Oxl_def.periodic]); COMMENT "pentultimate"; CONJ2_TAC; MATCH_MP_TAC periodic2_mod_sym_reduce; TYPIFY `k` EXISTS_TAC; ASM_SIMP_TAC [arith `3 <= k ==> ~(k=0)`]; CONJ_TAC; REWRITE_TAC[Appendix.periodic2]; BY(REWRITE_TAC[ (REWRITE_RULE[Appendix.periodic2] periodic2_funlist); (REWRITE_RULE[Appendix.periodic2] periodic2_funlistA)]); REWRITE_TAC[funlistA_diag]; BY(MESON_TAC[funlistA_sym;funlist_sym]); COMMENT "final"; MATCH_MP_TAC periodic2_mod_sym_reduce; TYPIFY `k` EXISTS_TAC; ASM_SIMP_TAC [arith `3 <= k ==> ~(k=0)`]; CONJ_TAC; REWRITE_TAC[Appendix.periodic2]; (REWRITE_TAC[ (REWRITE_RULE[Appendix.periodic2] periodic2_funlist); (REWRITE_RULE[Appendix.periodic2] periodic2_funlistA)]); REWRITE_TAC[arith `SUC (i + k) = SUC i + k`]; ONCE_REWRITE_TAC[arith `(i + k) = (1 * k + i)`]; BY(REWRITE_TAC[MOD_MULT_ADD]); REWRITE_TAC[funlistA_diag]; CONJ_TAC; BY(MESON_TAC[funlistA_sym;funlist_sym]); REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM (C INTRO_TAC [`i`;`j`]); ASM_REWRITE_TAC[]; DISCH_THEN DISJ_CASES_TAC; BY(ASM_REWRITE_TAC[]); ASM_REWRITE_TAC[]; TYPIFY `k MOD k = (1 * k + 0) MOD k` (C SUBGOAL_THEN SUBST1_TAC); AP_THM_TAC; AP_TERM_TAC; BY(ARITH_TAC); BY(REWRITE_TAC[MOD_MULT_ADD]) ]);; (* }}} *)
let is_ear_scs3 = 
prove_by_refinement( `!a b jf. is_ear_v39 (scs_v39 (3, #0.11, a, a, b, b, jf, {}, {},{})) <=> is_scs_v39 (scs_v39 (3, #0.11, a,a,b,b,jf, {},{},{})) /\ (!i. b i i = &0) /\ (?i. {i | i < 3 /\ jf i (SUC i)} = {i} /\ a i (SUC i) = sqrt8 /\ b i (SUC i) = cstab /\ (!j. j < 3 /\ ~(j = i) ==> a j (SUC j) = &2 /\ b j (SUC j) = &2 * h0))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit]; ASM_CASES_TAC `~is_scs_v39 (scs_v39 (3, #0.11,a,a,b,b,jf,{},{},{}))`; BY(ASM_REWRITE_TAC[]); RULE_ASSUM_TAC (REWRITE_RULE[ (TAUT `~ ~ x = x`)]); ASM_REWRITE_TAC[]; ASM_CASES_TAC `~(?i. {i | i < 3 /\ jf i (SUC i)} = {i} /\ a i (SUC i) = sqrt8 /\ b i (SUC i) = cstab /\ (!j. j < 3 /\ ~(j = i) ==> a j (SUC j) = &2 /\ b j (SUC j) = &2 * h0))`; BY(ASM_REWRITE_TAC[]); RULE_ASSUM_TAC (REWRITE_RULE[ (TAUT `~ ~ x = x`)]); ASM_REWRITE_TAC[]; BY(REWRITE_TAC[Appendix.unadorned_v39;Appendix.scs_v39_explicit]) ]);;
(* }}} *)
let is_scs_scs3 = 
prove_by_refinement( `! d a a0 b b0 jf j0 . d < #0.9 /\ funlist_v39 a a0 3 0 1 <= funlist_v39 b b0 3 0 1 /\ funlist_v39 a a0 3 0 2 <= funlist_v39 b b0 3 0 2 /\ funlist_v39 a a0 3 1 2 <= funlist_v39 b b0 3 1 2 /\ &2 <= funlist_v39 a a0 3 0 1 /\ &2 <= funlist_v39 a a0 3 1 2 /\ &2 <= funlist_v39 a a0 3 0 2 /\ funlist_v39 b b0 3 0 1 < &4 /\ funlist_v39 b b0 3 0 2 < &4 /\ funlist_v39 b b0 3 1 2 < &4 /\ (!i j. i < j /\ j < 3 /\ funlistA_v39 jf F j0 3 i j ==> funlist_v39 a a0 3 i j = sqrt8 /\ funlist_v39 b b0 3 i j = cstab) ==> is_scs_v39 (scs_v39 (3, d, funlist_v39 a a0 3, funlist_v39 a a0 3, funlist_v39 b b0 3, funlist_v39 b b0 3, funlistA_v39 jf F j0 3, {},{}, {}))`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC is_scs_funlist; ASM_REWRITE_TAC[Appendix.periodic_empty;arith `3 <= 3 /\ 3 <= 6 /\ ~(3 < 3)`]; REWRITE_TAC[arith `x + 3 <= 6 <=> x <= 3`]; TYPIFY `CARD {i | i < 3 /\ (&2 * h0 < funlist_v39 b b0 3 i (SUC i) \/ &2 < funlist_v39 a a0 3 i (SUC i))} <= 3` (C SUBGOAL_THEN (unlist REWRITE_TAC)); ENOUGH_TO_SHOW_TAC `CARD {i | i < 3 /\ (&2 * h0 < funlist_v39 b b0 3 i (SUC i) \/ &2 < funlist_v39 a a0 3 i (SUC i))} <= CARD {i | i < 3}`; TYPIFY `{i | i < 3} = (0..2)` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[IN_NUMSEG;EXTENSION;IN_ELIM_THM]; BY(ARITH_TAC); BY(REWRITE_TAC[CARD_NUMSEG;arith `2 + 1 = 3 /\ 3 - 0 = 3`]); MATCH_MP_TAC CARD_SUBSET; CONJ_TAC; BY(SET_TAC[]); BY(REWRITE_TAC[FINITE_NUMSEG_LT]); REWRITE_TAC[I_LT_J_LT_3_EXPLICIT]; CONJ_TAC; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[]); CONJ_TAC; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[]); CONJ_TAC; REWRITE_TAC[arith `i < 3 <=> (i = 0 \/ i = 1 \/ i = 2)`]; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3`;funlist_kik]); REWRITE_TAC[TAUT `(a /\ b /\ c ==> d) <=> (a /\ b ==> (c ==> d))`]; REWRITE_TAC[I_LT_J_LT_3_EXPLICIT]; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3`]) ]);;
(* }}} *)
let is_scs_ear_3603097872 = 
prove_by_refinement( `is_scs_v39 (scs_v39 (3, #0.11, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlistA_v39 [(0,1),T] F F 3, {},{}, {}))`,
(* {{{ proof *) [ MATCH_MP_TAC is_scs_scs3; TYPIFY `(!i j. i < j /\ j < 3 /\ funlistA_v39 [(0,1),T] F F 3 i j ==> funlist_v39 [(0,1),sqrt8] (&2) 3 i j = sqrt8 /\ funlist_v39 [(0,1),cstab] (&2 * h0) 3 i j = cstab)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); REWRITE_TAC[TAUT `(a /\ b /\ c ==> d) <=> (a /\ b ==> (c ==> d))`]; REWRITE_TAC[I_LT_J_LT_3_EXPLICIT]; REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM MP_TAC; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[FUNLIST_EXPLICIT])); REWRITE_TAC[FUNLIST_EXPLICIT;arith `#0.11 < #0.9`]; REWRITE_TAC[Appendix.cstab;Sphere.h0]; INTRO_TAC Flyspeck_constants.bounds []; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let is_ear_3603097872 = 
prove_by_refinement( `is_ear_v39 (scs_v39 (3, #0.11, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlistA_v39 [(0,1),T] F F 3, {},{}, {})) `,
(* {{{ proof *) [ REWRITE_TAC[ is_ear_scs3;is_scs_ear_3603097872;funlist_diag]; EXISTS_TAC `0`; REWRITE_TAC[arith `SUC 0 = 1`;arith `!j. (j < 3 /\ ~(j = 0) <=> (j = 1 \/ j = 2))`]; CONJ_TAC; REWRITE_TAC[EXTENSION;IN_SING;IN_ELIM_THM]; GEN_TAC; MP_TAC (arith `x = 0 \/ x = 1 \/ x = 2 \/ ~(x < 3)`); DISCH_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_SIMP_TAC[arith `0 < 3 /\ 1 < 3 /\ 2 < 3 /\ (~(x < 3 ) ==> ~(x = 0))`;FUNLIST_EXPLICIT;arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3`]); TYPIFY `(!j. j = 1 \/ j = 2 ==> funlist_v39 [(0,1),sqrt8] (&2) 3 j (SUC j) = &2 /\ funlist_v39 [(0,1),cstab] (&2 * h0) 3 j (SUC j) = &2 * h0)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_SIMP_TAC[arith `SUC 1 = 2 /\ SUC 2 = 3`;FUNLIST_EXPLICIT;funlist_kik]); BY(REWRITE_TAC[FUNLIST_EXPLICIT]) ]);;
(* }}} *)
let REAL_FINITE_MIN_EXISTS =
prove(`!S:real->bool. FINITE S /\ ~(S = {}) ==> ?m. m IN S /\ (!x. x IN S ==> m <= x)`,
MESON_TAC[INF_FINITE]);;
let REAL_WLOG_SQUARE_LEMMA = 
prove_by_refinement( `!P. (!y1 y2 y3 y4 y5 y6. P y1 y2 y3 y4 y5 y6 = P y2 y3 y4 y1 y6 y5) /\ (!y1 y2 y3 y4 y5 y6. (y2 <= y1) /\ (y3 <= y1) /\ (y4 <= y1) ==> P y1 y2 y3 y4 y5 y6) ==> (!y1 y2 y3 y4 y5 y6. P y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ REPEAT WEAK_STRIP_TAC; SUBGOAL_THEN `?a. a IN {y1,y2,y3,y4} /\ (!x. x IN {y1,y2,y3,y4} ==> x <= a)` MP_TAC; MATCH_MP_TAC Merge_ineq.REAL_FINITE_MAX_EXISTS; BY(REWRITE_TAC[ FINITE_INSERT ; FINITE_EMPTY;NOT_INSERT_EMPTY]); REPEAT WEAK_STRIP_TAC; REPEAT (FIRST_X_ASSUM_ST `IN` MP_TAC); REWRITE_TAC[IN_INSERT;NOT_IN_EMPTY]; REWRITE_TAC[MESON[] `(!x. x = y1 \/ x = y2 \/ x = y3 \/ x = y4 ==> x <= a) = (y1 <= a /\ y2 <= a /\ y3 <= a /\ y4 <= a)`]; BY(DISCH_THEN STRIP_ASSUME_TAC THEN ASM_MESON_TAC[]) ]);;
(* }}} *)
let REAL_WLOG_SQUARE2_LEMMA = 
prove_by_refinement( `!P. (!y1 y2 y3 y4 y5 y6. P y1 y2 y3 y4 y5 y6 = P y2 y3 y4 y1 y6 y5 /\ P y1 y2 y3 y4 y5 y6 = P y1 y4 y3 y2 y6 y5) /\ (!y1 y2 y3 y4 y5 y6. (y2 <= y1) /\ (y3 <= y1) /\ (y4 <= y1) /\ (y4 <= y2) ==> P y1 y2 y3 y4 y5 y6) ==> (!y1 y2 y3 y4 y5 y6. P y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ GEN_TAC; DISCH_TAC; MATCH_MP_TAC REAL_WLOG_SQUARE_LEMMA; ASM_REWRITE_TAC[]; BY(ASM_MESON_TAC[arith `y2 <= y4 \/ y4 <= y2`]) ]);;
(* }}} *)
let EE_vv = 
prove_by_refinement( `!vv k i. periodic (vv:num->A) k /\ 3 <= k /\ (!i (j:num). i < k /\ j < k /\ vv i = vv j ==> i = j) ==> (EE (vv i) (IMAGE (\i. {vv i, vv (SUC i)}) (:num))) = { vv (SUC i) , vv (i + (k -1)) }`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; TYPIFY `~(k=0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); REWRITE_TAC[Lvducxu.IN_EE_IFF_IN_E;EXTENSION;IN_INSERT;NOT_IN_EMPTY]; X_GEN_TAC `ww:A`; REWRITE_TAC[IN_IMAGE;IN_UNIV]; REWRITE_TAC[Geomdetail.EQ_EXPAND]; CONJ2_TAC; DISCH_THEN DISJ_CASES_TAC; BY(ASM_MESON_TAC[]); TYPIFY `i + k - 1` EXISTS_TAC; ASM_REWRITE_TAC[]; REWRITE_TAC[Geomdetail.PAIR_EQ_EXPAND]; DISJ2_TAC; ASM_SIMP_TAC[arith `3 <= k ==> SUC(i + k - 1) = i +k`]; BY(ASM_MESON_TAC[Oxl_def.periodic]); REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[Geomdetail.PAIR_EQ_EXPAND]; DISCH_THEN DISJ_CASES_TAC; ASM_REWRITE_TAC[]; DISJ1_TAC; FIRST_X_ASSUM MP_TAC; INTRO_TAC Oxl_def.periodic_mod [`vv`;`k`]; REWRITE_TAC[GSYM RIGHT_IMP_FORALL_THM]; ANTS_TAC; BY(ASM_REWRITE_TAC[]); DISCH_THEN (unlist ONCE_REWRITE_TAC); REPEAT WEAKER_STRIP_TAC; TYPIFY `i MOD k = x MOD k` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[DIVISION]); AP_TERM_TAC; REWRITE_TAC[arith `SUC x = x + 1`]; GMATCH_SIMP_TAC (GSYM MOD_ADD_MOD); FIRST_X_ASSUM (SUBST1_TAC o GSYM); GMATCH_SIMP_TAC MOD_ADD_MOD; BY(ASM_REWRITE_TAC[]); COMMENT "last case";
ASM_REWRITE_TAC[]; DISJ2_TAC; FIRST_X_ASSUM MP_TAC; INTRO_TAC Oxl_def.periodic_mod [`vv`;`k`]; ASM_REWRITE_TAC[]; DISCH_THEN (unlist ONCE_REWRITE_TAC); REPEAT WEAKER_STRIP_TAC; TYPIFY `i MOD k = SUC x MOD k` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[DIVISION]); AP_TERM_TAC; GMATCH_SIMP_TAC (GSYM MOD_ADD_MOD); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC MOD_ADD_MOD; ASM_SIMP_TAC[arith `3 <= k ==> (SUC x + k - 1 = 1 * k + x)`]; BY(REWRITE_TAC[MOD_MULT_ADD]) ]);; (* }}} *)
let tau_fun_azim = 
prove_by_refinement( `!vv k . (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> tau_fun V E f = sum {i | i < k} (\i. rho_fun (norm (vv i)) * azim (vec 0) (vv i) (vv (i+1)) (vv (i + (k-1)))) - (pi + sol0) * (&k - &2)))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF;Appendix.tau_fun]; REPEAT WEAKER_STRIP_TAC; GMATCH_SIMP_TAC (GSYM Oxlzlez.PERIODIC_IMAGE); TYPIFY `k` EXISTS_TAC; CONJ_TAC; ASM_SIMP_TAC[arith `3 <= k ==> ~(0 = k)`]; FIRST_X_ASSUM_ST `periodic` MP_TAC; REWRITE_TAC[Oxl_def.periodic;PAIR_EQ]; BY(MESON_TAC[arith `SUC (i + k) = SUC i + k`]); MATCH_MP_TAC (arith `s = s' /\ b = b' ==> s - (pi+sol0) * b = s' - (pi+sol0) * b'`); GMATCH_SIMP_TAC CARD_IMAGE_INJ; ASM_REWRITE_TAC[IN_ELIM_THM;PAIR_EQ;FINITE_NUMSEG_LT;CARD_NUMSEG_LT]; CONJ_TAC; BY(ASM_MESON_TAC[]); CONJ2_TAC; GMATCH_SIMP_TAC REAL_OF_NUM_SUB; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); GMATCH_SIMP_TAC SUM_IMAGE; ASM_REWRITE_TAC[IN_ELIM_THM;PAIR_EQ;FINITE_NUMSEG_LT;CARD_NUMSEG_LT]; CONJ_TAC; BY(ASM_MESON_TAC[]); MATCH_MP_TAC SUM_EQ; REWRITE_TAC[IN_ELIM_THM;o_THM]; REPEAT WEAKER_STRIP_TAC; AP_TERM_TAC; REWRITE_TAC[Localization.azim_in_fan;LET_DEF;LET_END_DEF]; GMATCH_SIMP_TAC EE_vv; TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[]; COND_CASES_TAC; REWRITE_TAC[Local_lemmas.AZIM_CYCLE_TWO_POINT_SET]; BY(REWRITE_TAC[arith `SUC x = x + 1`]); PROOF_BY_CONTR_TAC; FIRST_X_ASSUM_ST `CARD` MP_TAC; TYPIFY `~(k = 0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); REWRITE_TAC[]; MATCH_MP_TAC (arith `c = 2 ==> c > 1`); MATCH_MP_TAC Hypermap.CARD_TWO_ELEMENTS; INTRO_TAC Oxl_def.periodic_mod [`vv`;`k`]; ASM_REWRITE_TAC[]; DISCH_THEN (unlist ONCE_REWRITE_TAC); DISCH_TAC; TYPIFY `SUC x MOD k = (x + k - 1) MOD k` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[DIVISION]); INTRO_TAC Oxlzlez.MOD_INJ1_ALT [`k-2`;`k`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM_ST `3 <= k` MP_TAC) THEN ARITH_TAC); DISCH_TAC; FIRST_X_ASSUM (C INTRO_TAC [`SUC x`]); ASM_REWRITE_TAC[]; BY(ASM_SIMP_TAC[arith `3 <= k ==> SUC x + k - 2 = x + k - 1`]) ]);;
(* }}} *)
let vv_rho_node1 = 
prove_by_refinement( `!vv k . (let V = IMAGE vv (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> (!i. rho_node1 f (vv i) = vv (SUC i))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Local_lemmas.rho_node1]; TYPIFY `~( k = 0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); SELECT_TAC; RULE_ASSUM_TAC(REWRITE_RULE[IN_IMAGE;IN_UNIV;PAIR_EQ]); REPEAT (FIRST_X_ASSUM MP_TAC) THEN REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; REPLICATE_TAC 4 (FIRST_X_ASSUM MP_TAC); INTRO_TAC periodic_vv_inj [`vv`;`k`]; ASM_REWRITE_TAC[]; DISCH_THEN (unlist ONCE_REWRITE_TAC); REWRITE_TAC[arith `SUC u = u + 1`]; REPEAT WEAKER_STRIP_TAC; ONCE_REWRITE_TAC [GSYM MOD_ADD_MOD]; GMATCH_SIMP_TAC (GSYM MOD_ADD_MOD); TYPIFY `x' MOD k = i MOD k` (C SUBGOAL_THEN SUBST1_TAC); BY(ASM_MESON_TAC[]); GMATCH_SIMP_TAC MOD_ADD_MOD; BY(ASM_REWRITE_TAC[]); PROOF_BY_CONTR_TAC; FIRST_X_ASSUM_ST `IMAGE` MP_TAC; REWRITE_TAC[]; TYPIFY `vv(SUC i)` EXISTS_TAC; BY(SET_TAC[]) ]);;
(* }}} *)
let ITER_vv_rho_node1 = 
prove_by_refinement( `!vv k j. (let V = IMAGE vv (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> (!i. ITER j (rho_node1 f) (vv i) = vv (i+j))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; SPEC_TAC (`j:num`,`j:num`); INDUCT_TAC; BY(REWRITE_TAC[ITER;arith `i + 0 = i`]); ASM_SIMP_TAC[ITER]; INTRO_TAC vv_rho_node1 [`vv`;`k`]; ASM_REWRITE_TAC[LET_DEF;LET_END_DEF]; DISCH_THEN (unlist REWRITE_TAC); AP_TERM_TAC; BY(ARITH_TAC) ]);;
(* }}} *)
let PRIOR_TO_LESS_THAN_PI_LEMMA_ALT = 
prove_by_refinement( `!V E FF v. convex_local_fan (V,E,FF) /\ v IN V ==> (!w. w IN V ==> azim (vec 0) v (rho_node1 FF v) w <= azim (vec 0) v (rho_node1 FF v) (azim_cycle (EE v E) (vec 0) v (rho_node1 FF v)))`,
(* {{{ proof *) [ MESON_TAC[Local_lemmas.PRIOR_TO_LESS_THAN_PI_LEMMA] ]);;
(* }}} *)
let vv_azim_le = 
prove_by_refinement( `!vv k i j. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ V SUBSET ball_annulus /\ dist(vv i, vv (SUC i)) < &4 /\ dist(vv i, vv (i+k - 1)) < &4 /\ dist(vv i, vv j) < &4 /\ ~(i MOD k = j MOD k) /\ (!i j. ~(vv i = vv j) ==> &2 <= dist(vv i,vv j) ) /\ convex_local_fan (V,E,f) /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> azim (vec 0) (vv i) (vv (SUC i)) (vv j) <= azim (vec 0) (vv i) (vv (SUC i)) (vv (i + k - 1))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; TYPIFY `~(k=0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); INTRO_TAC PRIOR_TO_LESS_THAN_PI_LEMMA_ALT [`IMAGE vv (:num)`; `IMAGE (\i. {vv i, vv (SUC i)}) (:num)`; `IMAGE (\i. vv i,vv (SUC i)) (:num)`;`vv i`]; ASM_REWRITE_TAC[]; ANTS_TAC; BY(SET_TAC[]); DISCH_THEN (C INTRO_TAC [`vv j`]); ANTS_TAC; BY(SET_TAC[]); INTRO_TAC vv_rho_node1 [`vv`;`k`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; ANTS_TAC; BY(ASM_REWRITE_TAC[]); DISCH_THEN (unlist REWRITE_TAC); GMATCH_SIMP_TAC EE_vv; TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[]; REWRITE_TAC[Local_lemmas.AZIM_CYCLE_TWO_POINT_SET]; ]);;
(* }}} *)
let vv_split_azim = 
prove_by_refinement( `!vv k i j. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ V SUBSET ball_annulus /\ dist(vv i, vv (SUC i)) < &4 /\ dist(vv i, vv (i+k - 1)) < &4 /\ dist(vv i, vv j) < &4 /\ ~(i MOD k = j MOD k) /\ (!i j. ~(vv i = vv j) ==> &2 <= dist(vv i,vv j) ) /\ convex_local_fan (V,E,f) /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> azim (vec 0) (vv i) (vv (SUC i)) (vv (i + k - 1)) = azim (vec 0) (vv i) (vv (SUC i)) (vv j) + azim (vec 0) (vv i) (vv j) (vv (i + k - 1))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; TYPIFY `~(k=0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); INTRO_TAC vv_azim_le [`vv`;`k`;`i`;`j`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; ANTS_TAC; BY(ASM_REWRITE_TAC[]); DISCH_TAC; MATCH_MP_TAC Fan.sum4_azim_fan; ASM_REWRITE_TAC[]; REPEAT (GMATCH_SIMP_TAC NONPARALLEL_BALL_ANNULUS40_ALT); ASM_REWRITE_TAC[]; RULE_ASSUM_TAC (REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[]; REPEAT (FIRST_ASSUM_ST `dist` GMATCH_SIMP_TAC); INTRO_TAC periodic_vv_inj [`vv`;`k`]; ANTS_TAC; BY(ASM_REWRITE_TAC[]); DISCH_THEN (unlist ASM_REWRITE_TAC); REWRITE_TAC[arith `SUC i = (i +1)`]; BY(ASM_MESON_TAC[Oxlzlez.MOD_INJ1_ALT;arith `3 <= k ==> (k - 1 < k)`;arith `3 <=k ==> 1 < k`;arith `3 <=k ==> ~(k- 1=0)`;arith `~(1 = 0)`]) ]);;
(* }}} *)
let EGHNAVX1_ALT = 
prove_by_refinement( `!V E FF bta v0 ww k. convex_local_fan (V,E,FF) /\ v0 IN V /\ CARD V = k /\ (!v. v IN V /\ ~(v = v0) ==> ~collinear {vec 0, v0, v}) /\ (!i. ITER i (rho_node1 FF) v0 = ww i) /\ (!i. azim (vec 0) v0 (ww 1) (ww i) = bta i) ==> (!i j. i < j /\ j < k ==> bta i <= bta j)`,
(* {{{ proof *) [ REPEAT GEN_TAC; DISCH_THEN (MP_TAC o (MATCH_MP Local_lemmas.EGHNAVX)); BY(DISCH_THEN (unlist REWRITE_TAC)) ]);;
(* }}} *)
let vv_split_azim_generic = 
prove_by_refinement( `!vv k i j j'. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ (0< j) /\ (j < j') /\ (j' < k) /\ generic V E /\ convex_local_fan (V,E,f) /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> (i = j)) ==> azim (vec 0) (vv i) (vv (SUC i)) (vv (i+j')) = azim (vec 0) (vv i) (vv (SUC i)) (vv (i+j)) + azim (vec 0) (vv i) (vv (i+j)) (vv (i+j'))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; TYPIFY `~(k=0)` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC); TYPIFY `!i. vv i IN IMAGE vv (:num)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[IN_IMAGE;IN_UNIV]; BY(ASM_MESON_TAC[]); INTRO_TAC EGHNAVX1_ALT [`IMAGE vv (:num)`; `IMAGE (\i. {vv i, vv (SUC i)}) (:num)`; `IMAGE (\i. vv i,vv (SUC i)) (:num)`;`\j. azim (vec 0) (vv i) (vv (SUC i)) (vv (i + j))`;`vv i`;`\j. ITER j (rho_node1 (IMAGE (\i. vv i,vv (SUC i)) (:num))) (vv i)`;`k`]; ASM_REWRITE_TAC[]; INTRO_TAC ITER_vv_rho_node1 [`vv`;`k`]; REWRITE_TAC[LET_DEF;LET_END_DEF]; ASM_REWRITE_TAC[]; DISCH_THEN (unlist REWRITE_TAC); REWRITE_TAC[arith `i + 1 = SUC i`]; INTRO_TAC Nkezbfc_local.PROPERTIES_GENERIC_LOCAL_FAN [`IMAGE vv (:num)`;`IMAGE (\i. {vv i, vv (SUC i)}) (:num)`;`IMAGE (\i. vv i,vv (SUC i)) (:num)`;`vv i`]; ASM_REWRITE_TAC[]; ANTS_TAC; MATCH_MP_TAC Local_lemmas.CVX_LO_IMP_LO; BY(ASM_REWRITE_TAC[]); DISCH_TAC; ASM_REWRITE_TAC[]; ANTS_TAC; GMATCH_SIMP_TAC (GSYM Oxlzlez.PERIODIC_IMAGE); TYPIFY `k` EXISTS_TAC; ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC CARD_IMAGE_INJ; BY(ASM_REWRITE_TAC[IN_ELIM_THM;CARD_NUMSEG_LT;FINITE_NUMSEG_LT ]); DISCH_THEN (C INTRO_TAC [`j`;`j'`]); ASM_REWRITE_TAC[]; DISCH_TAC; MATCH_MP_TAC Fan.sum4_azim_fan; ASM_REWRITE_TAC[]; FIRST_X_ASSUM_ST `IMAGE` (REPEAT o GMATCH_SIMP_TAC); ASM_REWRITE_TAC[]; INTRO_TAC periodic_vv_inj [`vv`;`k`]; ANTS_TAC; BY(ASM_REWRITE_TAC[]); DISCH_THEN (unlist REWRITE_TAC); REWRITE_TAC[arith `SUC i = i + 1`]; BY(REPEAT CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[GSYM RIGHT_FORALL_IMP_THM] (GSYM Oxlzlez.MOD_INJ1_ALT)) THEN ASM_REWRITE_TAC[] THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN ARITH_TAC) ]);;
(* }}} *)
let muR_ALT = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6 y7 y8 y9. muR y1 y2 y3 y4 y5 y6 y7 y8 y9 = cayleyR (y6 * y6) (y5 * y5) (y1 * y1) (y7 * y7) (y4 * y4) (y2 * y2) (y8 * y8) (y3 * y3) (y9 * y9) `,
(* {{{ proof *) [ BY(REWRITE_TAC[FUN_EQ_THM;Mur.muR]) ]);;
(* }}} *)
let enclosed4_lemma = 
prove_by_refinement( `!(v0:real^3) v1 v2 v3. (let y1 = norm (v1) in let y2 = norm (v2) in let y3 = norm (v0) in let y4 = dist(v0, v2) in let y5 = dist(v0, v1) in let y6 = dist(v1, v2) in let y7 = norm (v3) in let y8 = dist(v0,v3) in let y9 = dist(v2,v3) in ( &0 < ups_x (norm (v0) * norm (v0)) (norm (v2) * norm (v2)) (dist(v0,v2) * dist(v0,v2)) /\ chi_msb [(vec 0);v0;v2] v1 * chi_msb [(vec 0);v0;v2] v3 <= &0 ==> dist(v1 ,v3) = enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9))`,
(* {{{ proof *) [ REWRITE_TAC[LET_DEF;LET_END_DEF]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Enclosed.enclosed]; INTRO_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] Collect_geom2.CAYLEYR_5POINTS) [`(vec 0):real^3`;`v0`;`v2`;`v1`;`v3`]; REWRITE_TAC[DIST_0]; TYPIFY `dist(v2,v1) = dist(v1,v2)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[DIST_SYM]); DISCH_TAC; TYPED_ABBREV_TAC `p = muR (norm (v1:real^3)) (dist (v0,v1)) (dist (v1,v2)) (dist (v0,v2)) (norm v2) (norm v0) (norm v3) (dist (v0,v3)) (dist (v2,v3))`; TYPIFY `quadratic_root_plus (abc_of_quadratic p) = dist (v1,v3) pow 2` ENOUGH_TO_SHOW_TAC; DISCH_THEN SUBST1_TAC; GMATCH_SIMP_TAC POW_2_SQRT; BY(REWRITE_TAC[DIST_POS_LE]); FIRST_X_ASSUM_ST `muR` MP_TAC; REWRITE_TAC[muR_ALT]; DISCH_THEN (SUBST1_TAC o GSYM); TYPED_ABBREV_TAC `a = ups_x (norm (v0) * norm (v0)) (norm (v2) * norm (v2)) (dist(v0,v2) * dist(v0,v2))` ; TYPED_ABBREV_TAC `b = cayleytr (norm v0 * norm v0) (norm v2 * norm v2) (norm v1 * norm v1) (norm v3 * norm v3) (dist (v0,v2) * dist (v0,v2)) (dist (v0,v1) * dist (v0,v1)) (dist (v0,v3) * dist (v0,v3)) (dist (v1,v2) * dist (v1,v2)) (dist (v2,v3) * dist (v2,v3)) (&0)` ; TYPED_ABBREV_TAC `c = cayleyR (norm v0 * norm v0) (norm v2 * norm v2) (norm v1 * norm v1) (norm v3 * norm v3) (dist (v0,v2) * dist (v0,v2)) (dist (v0,v1) * dist (v0,v1)) (dist (v0,v3) * dist (v0,v3)) (dist (v1,v2) * dist (v1,v2)) (dist (v2,v3) * dist (v2,v3)) (&0)` ; TYPIFY ` cayleyR (norm v0 * norm v0) (norm v2 * norm v2) (norm v1 * norm v1) (norm v3 * norm v3) (dist (v0,v2) * dist (v0,v2)) (dist (v0,v1) * dist (v0,v1)) (dist (v0,v3) * dist (v0,v3)) (dist (v1,v2) * dist (v1,v2)) (dist (v2,v3) * dist (v2,v3)) = (\x. a * x pow 2 + b * x + c)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[FUN_EQ_THM]; ONCE_REWRITE_TAC[Collect_geom.LTCTBAN]; BY(ASM_REWRITE_TAC[]); ASM_REWRITE_TAC[Nonlinear_lemma.abc_quadratic]; TYPIFY `b pow 2 - &4 * a * c = &16 * delta_y (norm v0) (norm v2) (norm v1) (dist (v2,v1)) (dist (v0,v1)) (dist (v0,v2)) * delta_y (norm v0) (norm v2) (norm v3) (dist (v2,v3)) (dist (v0,v3)) (dist (v0,v2))` (C SUBGOAL_THEN ASSUME_TAC); EXPAND_TAC "a";
EXPAND_TAC "b"; EXPAND_TAC "c"; REWRITE_TAC[Collect_geom.DISCRIMINANT_OF_CAY]; REWRITE_TAC[Merge_ineq.delta_delta_x;GSYM Sphere.delta_y]; BY(MESON_TAC[DIST_SYM]); TYPIFY `&0 <= delta_y (norm v0) (norm v2) (norm v1) (dist (v2,v1)) (dist (v0,v1)) (dist (v0,v2))` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[REWRITE_RULE[LET_DEF;LET_END_DEF] Tame_lemmas.delta_y_pos]); TYPIFY `&0 <= delta_y (norm v0) (norm v2) (norm v3) (dist (v2,v3)) (dist (v0,v3)) (dist (v0,v2))` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[REWRITE_RULE[LET_DEF;LET_END_DEF] Tame_lemmas.delta_y_pos]); TYPIFY `&0 <= b pow 2 - &4 * a * c` (C SUBGOAL_THEN ASSUME_TAC); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC REAL_LE_MUL; CONJ_TAC; BY(REAL_ARITH_TAC); GMATCH_SIMP_TAC REAL_LE_MUL; BY(ASM_REWRITE_TAC[]); TYPED_ABBREV_TAC `(x:real) = dist(v1,v3) pow 2` ; TYPIFY `a * x pow 2 + b * x + c = &0` (C SUBGOAL_THEN ASSUME_TAC); FIRST_X_ASSUM_ST `cayleyR` MP_TAC; REWRITE_TAC[FUN_EQ_THM]; DISCH_THEN (C INTRO_TAC [`x`]); DISCH_THEN (SUBST1_TAC o GSYM); FIRST_X_ASSUM kill; BY(ASM_REWRITE_TAC[arith ` x * x = x pow 2`]); ASM_CASES_TAC `b pow 2 - &4 * a * c = &0`; MATCH_MP_TAC Tame_lemmas.quadratic_root_plus_disc0_eq; FIRST_X_ASSUM_ST `&0 < a` MP_TAC; REPLICATE_TAC 2 (FIRST_X_ASSUM MP_TAC); BY(REAL_ARITH_TAC); COMMENT "pos discr. case"; MATCH_MP_TAC Tame_lemmas.quadratic_root_plus_gt_eq; TYPED_ABBREV_TAC `(n:real^3) = v0 cross v2`; TYPED_ABBREV_TAC `(v1':real^3) = reflection n v1` ; TYPED_ABBREV_TAC `(y:real) = dist(v1',v3) pow 2` ; TYPIFY `y` EXISTS_TAC; SUBCONJ_TAC; BY(ASM_MESON_TAC[]); DISCH_TAC; CONJ_TAC; FIRST_X_ASSUM_ST `&0 <= x` MP_TAC; BY(REWRITE_TAC[]); FIRST_X_ASSUM_ST `a * x pow 2` MP_TAC; DISCH_THEN (SUBST1_TAC); REWRITE_TAC[]; COMMENT "cayleyR again"; INTRO_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] Collect_geom2.CAYLEYR_5POINTS) [`(vec 0):real^3`;`v0`;`v2`;`v1'`;`v3`]; ASM_REWRITE_TAC[]; EXPAND_TAC "v1'"; TYPIFY `!v. dist(v,reflection n v1) =dist(reflection n v1,v)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(MESON_TAC[DIST_SYM]); REPEAT (GMATCH_SIMP_TAC Tame_lemmas.dist_reflection_special); EXPAND_TAC "n"; REWRITE_TAC[DOT_LZERO]; REWRITE_TAC[Collect_geom2.ORTHOGONAL_CROSS_PRODUCT]; REWRITE_TAC[DIST_0]; TYPIFY `dist(v1,v0) = dist(v0,v1)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[DIST_SYM]); ASM_REWRITE_TAC[arith `x pow 2 = x * x`]; DISCH_THEN SUBST1_TAC; REWRITE_TAC[]; COMMENT "y < x"; EXPAND_TAC "x"; EXPAND_TAC "y"; EXPAND_TAC "v1'"; REWRITE_TAC[Tame_lemmas.dist_reflection_lemma]; MATCH_MP_TAC (arith `&0 < ( --r )/ nn ==> d + &4 * r / nn < d`); GMATCH_SIMP_TAC REAL_LT_DIV; TYPIFY `~(n = vec 0)` (C SUBGOAL_THEN ASSUME_TAC); EXPAND_TAC "n"; FIRST_X_ASSUM_ST `&0 < a` MP_TAC; EXPAND_TAC "a"; REWRITE_TAC[GSYM DIST_0;arith `x * x = x pow 2`]; REWRITE_TAC[GSYM Collect_geom2.NORM_CROSS_PRODUCT_UPS_X]; REWRITE_TAC[arith `&0 < &4 * x <=> &0 < x`;arith `(v0:real^3) - vec 0 = v0`]; REWRITE_TAC[GSYM NORM_POS_LT]; REWRITE_TAC[GSYM Trigonometry2.NOT_ZERO_EQ_POW2_LT]; BY(MESON_TAC[NORM_POS_LE;arith `&0 <= x /\ ~(x = &0) ==> &0 < x`]); CONJ2_TAC; BY(FIRST_X_ASSUM MP_TAC THEN MESON_TAC[DOT_POS_LT]); REWRITE_TAC[arith `&0 < -- r <=> r < &0`]; EXPAND_TAC "n"; TYPIFY `!v. v dot (v0 cross v2) = chi_msb [vec 0;v0;v2] v` (C SUBGOAL_THEN (unlist REWRITE_TAC)); REWRITE_TAC[Leaf_cell.chi_msb;Basics.EL_EXPLICIT]; REWRITE_TAC[arith `(v:real^3) - vec 0 = v`]; BY(MESON_TAC[DOT_SYM]); FIRST_X_ASSUM_ST `chi_msb` MP_TAC; TYPIFY `~(chi_msb [vec 0;v0;v2] v1 * chi_msb [vec 0;v0;v2] v3 = &0)` ENOUGH_TO_SHOW_TAC; BY(REAL_ARITH_TAC); REWRITE_TAC[REAL_ENTIRE;DE_MORGAN_THM]; REWRITE_TAC[GSYM Leaf_cell.CHI_MSB_COPLANAR]; REWRITE_TAC[Oxlzlez.coplanar_delta_y;DIST_0]; REWRITE_TAC[arith `&0 < x <=> (&0 <= x /\ ~(x = &0))`]; ASM_REWRITE_TAC[]; REWRITE_TAC[GSYM DE_MORGAN_THM;GSYM REAL_ENTIRE]; DISCH_TAC; REPEAT (FIRST_X_ASSUM_ST `b pow 2 - &4 * a *c` MP_TAC); ASM_REWRITE_TAC[]; BY(REAL_ARITH_TAC) ]);; (* }}} *)
let IN_V_IMP_AZIM_LESS_PI_ALT = 
prove_by_refinement( `!V E FF v. (convex_local_fan (V,E,FF) /\ v IN V ==> (!w. w IN V ==> azim (vec 0) v (rho_node1 FF v) w <= pi))`,
(* {{{ proof *) [ BY(MESON_TAC[Local_lemmas.IN_V_IMP_AZIM_LESS_PI]) ]);;
(* }}} *)
let vv_enclosed4 = 
prove_by_refinement( `!vv i. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in let y1 = norm (vv (i+1)) in let y2 = norm (vv (i+2)) in let y3 = norm (vv (i)) in let y4 = dist(vv (i), vv (i+2)) in let y5 = dist(vv (i), vv (i+1)) in let y6 = dist(vv (i+1), vv (i+2)) in let y7 = norm (vv (i+3)) in let y8 = dist(vv (i),vv (i+3)) in let y9 = dist(vv (i+2),vv (i+3)) in (periodic vv 4 /\ dist (vv i,vv ( i+1)) < &4 /\ dist (vv i,vv (i + 3)) < &4 /\ (!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j)) /\ V SUBSET ball_annulus /\ dist (vv i,vv (i+2)) < &4 /\ convex_local_fan (V,E,f) /\ (!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j) ==> dist (vv (i+1), vv(i+3)) = enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9))`,
(* {{{ proof *) [ REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] enclosed4_lemma); TYPIFY `!i. vv i IN ball_annulus` (C SUBGOAL_THEN ASSUME_TAC); FIRST_X_ASSUM_ST `ball_annulus` MP_TAC; BY(SET_TAC[IN_UNIV]); TYPIFY `!i. vv i IN IMAGE vv (:num)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[IN_IMAGE;IN_UNIV]; BY(MESON_TAC[]); SUBCONJ_TAC; REWRITE_TAC[GSYM DIST_0]; REWRITE_TAC[GSYM Collect_geom2.NOT_COL_EQ_UPS_X_POS;arith `x * x = x pow 2`]; MATCH_MP_TAC NONPARALLEL_BALL_ANNULUS40_ALT; ASM_REWRITE_TAC[]; FIRST_X_ASSUM MATCH_MP_TAC; GMATCH_SIMP_TAC periodic_vv_inj; TYPIFY `4` EXISTS_TAC; ASM_REWRITE_TAC[arith `~(4 = 0)`]; BY(ASM_MESON_TAC[ Oxlzlez.MOD_INJ1_ALT;arith `~(4 = 0) /\ ~(2 = 0) /\ (2 < 4)`]); DISCH_TAC; COMMENT "case delta=0";
TYPIFY `chi_msb [vec 0; vv i; vv (i + 2)] (vv (i + 1)) = &0` ASM_CASES_TAC; BY(ASM_REWRITE_TAC[arith `&0 * x <= &0`]); TYPIFY `chi_msb [vec 0; vv i; vv (i + 2)] (vv (i + 3)) = &0` ASM_CASES_TAC; BY(ASM_REWRITE_TAC[arith ` x * &0 <= &0`]); TYPIFY `~coplanar {vec 0, vv i, vv (i + 2), vv (i + 1)} /\ ~coplanar {vec 0, vv i, vv (i + 2), vv (i + 3)}` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_REWRITE_TAC[ Leaf_cell.CHI_MSB_COPLANAR]); TYPIFY `~collinear {vec 0, vv i, vv (i+1)} /\ ~collinear {vec 0,vv i, vv (i+3)} /\ ~collinear {vec 0,vv i, vv(i+2)}` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[Planarity.notcoplanar_imp_notcollinear_fan]); COMMENT "angle 0"; INTRO_TAC IN_V_IMP_AZIM_LESS_PI_ALT [ `IMAGE vv (:num)`;`IMAGE (\i. {vv i, vv (SUC i)}) (:num)`;`IMAGE (\i. vv i,vv (SUC i)) (:num)`;`vv i`]; ASM_REWRITE_TAC[]; DISCH_THEN (C INTRO_TAC [`vv (i +3)`]); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] vv_rho_node1); CONJ_TAC; TYPIFY `4` EXISTS_TAC; BY(ASM_REWRITE_TAC[arith `3 <= 4`]); DISCH_TAC; COMMENT "v2 in wedge"; TYPIFY `vv (i +2) IN wedge_ge (vec 0) (vv i) (vv ( i+1)) (vv (i + 3))` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[Local_lemmas.WEDGE_GE_AZIM_LE]; REWRITE_TAC[arith `i + 1 = SUC i /\ i + 3 = i + 4 -1`]; INTRO_TAC (REWRITE_RULE[LET_THM] vv_azim_le) [`vv`;`4`;`i`;`i + 2`]; ANTS_TAC; ASM_REWRITE_TAC[arith `3 <= 4`]; REWRITE_TAC[arith `SUC i = i + 1 /\ i + 4 -1 = i + 3`]; ASM_REWRITE_TAC[]; BY(MESON_TAC[ Oxlzlez.MOD_INJ1_ALT;arith `~(4 = 0) /\ ~(2 = 0) /\ (2 < 4)`]); BY(REWRITE_TAC[]); COMMENT " < pi "; TYPIFY `azim (vec 0) (vv i) (vv (SUC i)) (vv (i + 3)) < pi` ASM_CASES_TAC; FIRST_X_ASSUM_ST `wedge_ge` MP_TAC; GMATCH_SIMP_TAC Local_lemmas.WEDGE_GE_EQ_AFF_GE; ASM_REWRITE_TAC[arith `i + 1 = SUC i`]; GMATCH_SIMP_TAC Marchal_cells_2_new.AFF_GE_2_2; CONJ_TAC; TYPIFY `DISJOINT {vec 0, vv i} {vv (SUC i)} /\ DISJOINT {vec 0, vv i} {vv (i + 3)}` ENOUGH_TO_SHOW_TAC; REWRITE_TAC[DISJOINT]; BY(SET_TAC[]); BY(ASM_MESON_TAC[Fan.th3a;arith `SUC i = i + 1`]); REWRITE_TAC[IN_ELIM_THM]; REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; ONCE_REWRITE_TAC[Leaf_cell.chi_msb_swap_23]; GMATCH_SIMP_TAC Leaf_cell.chi_msb_additive_d; TYPIFY `t3 % vv (SUC i) + t4 % vv (i + 3) = t4 % vv (i + 3) + t3 % vv (SUC i)` (C SUBGOAL_THEN SUBST1_TAC); BY(VECTOR_ARITH_TAC); GMATCH_SIMP_TAC Leaf_cell.chi_msb_additive_d; CONJ_TAC; BY(FIRST_X_ASSUM_ST `&1` MP_TAC THEN REAL_ARITH_TAC); CONJ_TAC; BY(FIRST_X_ASSUM_ST `&1` MP_TAC THEN REAL_ARITH_TAC); TYPIFY `chi_msb [vec 0; vv i; vv (SUC i)] (vv (i + 3)) = -- chi_msb [vec 0; vv i; vv (i + 3)] (vv (SUC i))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[Leaf_cell.chi_msb_swap_23]); REWRITE_TAC[arith `-- (t4 * -- c) * -- (t3 * c) <= &0 <=> &0 <= t4 * t3 * c pow 2`]; GMATCH_SIMP_TAC REAL_LE_MUL; ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC REAL_LE_MUL; ASM_REWRITE_TAC[]; BY(REWRITE_TAC[ REAL_LE_POW_2]); COMMENT "azim = pi"; TYPIFY `azim (vec 0) (vv i) (vv (SUC i)) (vv (i + 3)) = pi` (C SUBGOAL_THEN ASSUME_TAC); BY(REPLICATE_TAC 2 (FIRST_X_ASSUM_ST `azim` MP_TAC) THEN REAL_ARITH_TAC); FIRST_X_ASSUM MP_TAC; GMATCH_SIMP_TAC Ldurdpn.LDURDPN; ASM_REWRITE_TAC[arith `SUC i = i + 1`]; REWRITE_TAC[EXTENSION;NOT_IN_EMPTY;NOT_FORALL_THM]; REWRITE_TAC[IN_INTER;Geomdetail.CONV0_SET2;IN_ELIM_THM]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC Leaf_cell.AFFINE_IMP_CHI_MSB_0 [`[vec 0;vv i; vv (i+2)]`;`x`]; REWRITE_TAC[LENGTH;arith `SUC(SUC(SUC 0)) = 3`]; REWRITE_TAC[Bump.set_of_list3_explicit]; ANTS_TAC; TYPIFY `aff {vec 0, vv i} SUBSET affine hull {vec 0, vv i, vv (i + 2)}` ENOUGH_TO_SHOW_TAC; BY(FIRST_X_ASSUM_ST `aff` MP_TAC THEN SET_TAC[]); MATCH_MP_TAC Collect_geom.AFFINE_CONTAIN_LINE; REWRITE_TAC[AFFINE_AFFINE_HULL]; MATCH_MP_TAC SUBSET_TRANS; TYPIFY `{vec 0, vv i, vv (i + 2)}` EXISTS_TAC; CONJ_TAC; BY(SET_TAC[]); BY(REWRITE_TAC[HULL_SUBSET]); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC Leaf_cell.CHI_MSB_ADDITIVE; ASM_REWRITE_TAC[]; DISCH_TAC; TYPIFY `!c c'. ((c':real) = (-- a/b) * c) ==> c * c' <= &0` (C SUBGOAL_THEN MATCH_MP_TAC); REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; REWRITE_TAC[ (arith `c * -- a /b * c <= &0 <=> &0 <= (a / b) * c pow 2`) ]; GMATCH_SIMP_TAC REAL_LE_MUL; GMATCH_SIMP_TAC REAL_LE_RDIV_EQ; ASM_REWRITE_TAC[]; REWRITE_TAC[ REAL_LE_POW_2]; BY(REPEAT (FIRST_X_ASSUM_ST `&0 < x` MP_TAC) THEN REAL_ARITH_TAC); MATCH_MP_TAC REAL_EQ_LCANCEL_IMP; TYPIFY `b` EXISTS_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[arith `a + b = &0 <=> b = --a`]; DISCH_THEN SUBST1_TAC; CONJ_TAC; BY(FIRST_X_ASSUM_ST `&0 < b` MP_TAC THEN REAL_ARITH_TAC); Calc_derivative.CALC_ID_TAC; BY(FIRST_X_ASSUM_ST `&0 < b` MP_TAC THEN REAL_ARITH_TAC) ]);; (* }}} *)
let enclosed_sym = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6 y7 y8 y0. enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 = enclosed y1 y6 y5 y4 y3 y2 y7 y9 y8`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Enclosed.enclosed]; REPLICATE_TAC 3 AP_TERM_TAC; REWRITE_TAC[muR_ALT]; REWRITE_TAC[FUN_EQ_THM]; GEN_TAC; REWRITE_TAC[Collect_geom2.cayleyR]; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let enclosed_sym2 = 
prove_by_refinement( `!y1 y2 y3 y4 y5 y6 y7 y8 y0. enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 = enclosed y7 y8 y9 y4 y2 y3 y1 y5 y6`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Enclosed.enclosed]; REPLICATE_TAC 3 AP_TERM_TAC; REWRITE_TAC[muR_ALT]; REWRITE_TAC[FUN_EQ_THM]; GEN_TAC; REWRITE_TAC[Collect_geom2.cayleyR]; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let convex_local_fan_azim_le_pi = 
prove_by_refinement( `!vv k i. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv k /\ 3 <= k /\ (!i j. i < k /\ j < k /\ vv i = vv j ==> i = j) /\ convex_local_fan (V,E,f) /\ V SUBSET ball_annulus ==> (azim (vec 0) (vv i) (vv (SUC i)) (vv (i + k - 1)) <= pi)))`,
(* {{{ proof *) [ REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC Localization.convex_local_fan [`IMAGE (\i. vv i,vv (SUC i)) (:num)`;`IMAGE vv (:num)`;`IMAGE (\i. {vv i, vv (SUC i)}) (:num)`;]; ASM_REWRITE_TAC[IN_IMAGE;IN_UNIV]; REPEAT WEAKER_STRIP_TAC; FIRST_X_ASSUM (C INTRO_TAC [ `vv i, vv (SUC i)`]); ANTS_TAC; BY(MESON_TAC[]); GMATCH_SIMP_TAC Local_lemmas.LOFA_DETERMINE_AZIM_IN_FA; CONJ_TAC; GEXISTL_TAC [`IMAGE vv (:num)`;`IMAGE (\i. vv i,vv (SUC i)) (:num)`]; ASM_REWRITE_TAC[]; BY(MESON_TAC[IN_IMAGE;IN_UNIV]); GMATCH_SIMP_TAC EE_vv; TYPIFY `k` EXISTS_TAC; CONJ_TAC; BY(ASM_REWRITE_TAC[]); REWRITE_TAC[Local_lemmas.AZIM_CYCLE_TWO_POINT_SET]; BY(MESON_TAC[]) ]);;
(* }}} *)
let vv_quad_split012 = 
prove_by_refinement( `!vv. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv 4 /\ V SUBSET ball_annulus /\ dist(vv 0, vv 1) < &4 /\ dist(vv 0, vv 2) < &4 /\ dist(vv 0, vv 3) < &4 /\ dist(vv 1,vv 2) < &4 /\ dist(vv 2,vv 3) < &4 /\ (!i j. ~(vv i = vv j) ==> &2 <= dist(vv i,vv j) ) /\ convex_local_fan (V,E,f) /\ (!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> (i = j)) ==> (rho_fun (norm (vv 0)) * azim (vec 0) (vv 0) (vv 1) (vv 3) + rho_fun (norm (vv 1)) * azim (vec 0) (vv 1) (vv 2) (vv 0) + rho_fun (norm (vv 2)) * azim (vec 0) (vv 2) (vv 3) (vv 1) + rho_fun (norm (vv 3)) * azim (vec 0) (vv 3) (vv 0) (vv 2)) - (pi + sol0) * &2 = tau3 (vv 0) (vv 1) (vv 2) + tau3 (vv 2) (vv 3) (vv 0)))`,
(* {{{ proof *) [ REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; TYPIFY ` azim (vec 0) (vv 0) (vv (SUC 0)) (vv (0 + 4 - 1)) <= pi /\ azim (vec 0) (vv 1) (vv (SUC 1)) (vv (1 + 4 - 1)) <= pi /\ azim (vec 0) (vv 2) (vv (SUC 2)) (vv (2 + 4 - 1)) <= pi /\ azim (vec 0) (vv 3) (vv (SUC 3)) (vv (3 + 4 -1)) <= pi` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[LET_THM] convex_local_fan_azim_le_pi) THEN ASM_REWRITE_TAC[arith `3 <= 4`]); REWRITE_TAC[Appendix.tau3]; TYPIFY `vv 6 = vv 2 /\ vv 5 = vv 1 /\ vv 4 = vv 0` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); TYPIFY `azim (vec 0) ((vv 0)) ((vv (SUC 0))) ((vv (0 + 4 - 1))) = azim (vec 0) ((vv 0)) ((vv (SUC 0))) ((vv 2)) + azim(vec 0) ((vv 0)) ((vv 2)) ((vv (0 + 4 - 1))) /\ (azim (vec 0) ((vv 2)) ((vv (SUC 2))) ((vv (2 + 4 - 1))) = azim (vec 0) ((vv 2)) ((vv (SUC 2))) ((vv 0)) + azim(vec 0) ((vv 2)) ((vv 0)) ((vv (2 + 4 -1))))` (C SUBGOAL_THEN ASSUME_TAC); CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[LET_THM] vv_split_azim) THEN ASM_REWRITE_TAC[arith `3 <= 4 /\ ~( 0 = 2)`;MOD_4_EXPLICIT;arith `SUC 0 = 1 /\ 0 + 4 - 1 = 3`;arith `SUC 2 = 3 /\ 2 + 4 - 1 = 5`]; BY(ASM_MESON_TAC[DIST_SYM]); RULE_ASSUM_TAC (REWRITE_RULE[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4 /\ 0+4-1 = 3 /\ 1+4-1=4 /\ 2+4-1=5 /\ 3+4-1=6`]); FIRST_X_ASSUM_ST `6` (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); ASM_REWRITE_TAC[]; TYPIFY `azim (vec 0) (vv 0) (vv 1) (vv 2) <= pi /\ azim (vec 0) (vv 0) (vv 2) (vv 3) <= pi /\ azim (vec 0) (vv 2 ) (vv 3) (vv 0) <= pi /\ azim (vec 0) (vv 2) (vv 0) (vv 1) <= pi` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[Counting_spheres.AZIM_NN;arith `&0 <= x /\ &0 <= y /\ x + y <= pi ==> (x <= pi /\ y <= pi)`]); COMMENT "azim to dih";
TYPIFY `~collinear {vec 0,vv 0,vv 1} /\ ~collinear {vec 0,vv 0, vv 2} /\ ~collinear {vec 0,vv 0,vv 3} /\ ~collinear {vec 0,vv 1,vv 2} /\ ~collinear {vec 0,vv 2, vv 3}` (C SUBGOAL_THEN ASSUME_TAC); REPEAT (GMATCH_SIMP_TAC NONPARALLEL_BALL_ANNULUS40_ALT); RULE_ASSUM_TAC (REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM_ST `dist` MATCH_MP_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN (TYPIFY `4` EXISTS_TAC) THEN ASM_REWRITE_TAC[arith `~(4 = 0)`;MOD_4_EXPLICIT;arith `~(2 = 3) /\ ~(1 = 2) /\ ~(0=3) /\ ~(0=1) /\ ~(0=2)`]); COMMENT "azim to dih"; TYPIFY `azim (vec 0) (vv 0) (vv 1) (vv 2) = dihV (vec 0) (vv 0) (vv 1) (vv 2) /\ azim (vec 0) (vv 0) (vv 2) (vv 3) = dihV (vec 0) (vv 0) (vv 2) (vv 3) /\ azim (vec 0) (vv 1) (vv 2) (vv 0) = dihV (vec 0) (vv 1) (vv 2) (vv 0) /\ azim (vec 0) (vv 2) (vv 3) (vv 0) = dihV (vec 0) (vv 2) (vv 3) (vv 0) /\ azim (vec 0) (vv 2) (vv 0) (vv 1) = dihV (vec 0) (vv 2) (vv 0) (vv 1) /\ azim (vec 0) (vv 3) (vv 0) (vv 2) = dihV (vec 0) (vv 3) (vv 0) (vv 2)` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); REWRITE_TAC[Appendix.rho_rho_fun]; BY(REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[TAUT `(a ==> b ==> c) <=> (a /\ b ==> c)`] Local_lemmas.AZIM_LE_PI_EQ_DIHV) THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE `{a,b,c}={a,c,b}`] THEN ASM_REWRITE_TAC[]) ]);; (* }}} *)
let vv_quad_split123 = 
prove_by_refinement( `!vv. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv 4 /\ V SUBSET ball_annulus /\ dist(vv 0, vv 1) < &4 /\ dist(vv 0, vv 3) < &4 /\ dist(vv 1,vv 2) < &4 /\ dist(vv 1,vv 3) < &4 /\ dist(vv 2,vv 3) < &4 /\ (!i j. ~(vv i = vv j) ==> &2 <= dist(vv i,vv j) ) /\ convex_local_fan (V,E,f) /\ (!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> (i = j)) ==> (rho_fun (norm (vv 0)) * azim (vec 0) (vv 0) (vv 1) (vv 3) + rho_fun (norm (vv 1)) * azim (vec 0) (vv 1) (vv 2) (vv 0) + rho_fun (norm (vv 2)) * azim (vec 0) (vv 2) (vv 3) (vv 1) + rho_fun (norm (vv 3)) * azim (vec 0) (vv 3) (vv 0) (vv 2)) - (pi + sol0) * &2 = tau3 (vv 1) (vv 2) (vv 3) + tau3 (vv 3) (vv 0) (vv 1)))`,
(* {{{ proof *) [ REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; TYPIFY ` azim (vec 0) (vv 0) (vv (SUC 0)) (vv (0 + 4 - 1)) <= pi /\ azim (vec 0) (vv 1) (vv (SUC 1)) (vv (1 + 4 - 1)) <= pi /\ azim (vec 0) (vv 2) (vv (SUC 2)) (vv (2 + 4 - 1)) <= pi /\ azim (vec 0) (vv 3) (vv (SUC 3)) (vv (3 + 4 -1)) <= pi` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[LET_THM] convex_local_fan_azim_le_pi) THEN ASM_REWRITE_TAC[arith `3 <= 4`]); REWRITE_TAC[Appendix.tau3]; TYPIFY `vv 6 = vv 2 /\ vv 5 = vv 1 /\ vv 4 = vv 0` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); TYPIFY `azim (vec 0) ((vv 1)) ((vv (SUC 1))) ((vv (1 + 4 - 1))) = azim (vec 0) ((vv 1)) ((vv (SUC 1))) ((vv 3)) + azim(vec 0) ((vv 1)) ((vv 3)) ((vv (1 + 4 - 1))) /\ (azim (vec 0) ((vv 3)) ((vv (SUC 3))) ((vv (3 + 4 - 1))) = azim (vec 0) ((vv 3)) ((vv (SUC 3))) ((vv 1)) + azim(vec 0) ((vv 3)) ((vv 1)) ((vv (3 + 4 -1))))` (C SUBGOAL_THEN ASSUME_TAC); CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[LET_THM] vv_split_azim) THEN ASM_REWRITE_TAC[arith `3 <= 4 /\ ~( 1 = 3)`;MOD_4_EXPLICIT;arith `SUC 1 = 2 /\ 1 + 4 - 1 = 4`;arith `SUC 3 = 4 /\ 3 + 4 - 1 = 6`]; BY(ASM_MESON_TAC[DIST_SYM]); BY(ASM_MESON_TAC[DIST_SYM]); RULE_ASSUM_TAC (REWRITE_RULE[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4 /\ 0+4-1 = 3 /\ 1+4-1=4 /\ 2+4-1=5 /\ 3+4-1=6`]); FIRST_X_ASSUM_ST `vv 6 = vv 2` (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); ASM_REWRITE_TAC[]; TYPIFY `azim (vec 0) (vv 1) (vv 2) (vv 3) <= pi /\ azim (vec 0) (vv 1) (vv 3) (vv 0) <= pi /\ azim (vec 0) (vv 3 ) (vv 0) (vv 1) <= pi /\ azim (vec 0) (vv 3) (vv 1) (vv 2) <= pi` (C SUBGOAL_THEN ASSUME_TAC); BY(ASM_MESON_TAC[Counting_spheres.AZIM_NN;arith `&0 <= x /\ &0 <= y /\ x + y <= pi ==> (x <= pi /\ y <= pi)`]); COMMENT "collinearity";
TYPIFY `~collinear {vec 0,vv 0,vv 1} /\ ~collinear {vec 0,vv 0, vv 3} /\ ~collinear {vec 0,vv 1,vv 3} /\ ~collinear {vec 0,vv 1,vv 2} /\ ~collinear {vec 0,vv 2, vv 3}` (C SUBGOAL_THEN ASSUME_TAC); REPEAT (GMATCH_SIMP_TAC NONPARALLEL_BALL_ANNULUS40_ALT); RULE_ASSUM_TAC (REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM_ST `dist` MATCH_MP_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN (TYPIFY `4` EXISTS_TAC) THEN ASM_REWRITE_TAC[arith `~(4 = 0)`;MOD_4_EXPLICIT;arith `~(2 = 3) /\ ~(1 = 2) /\ ~(0=3) /\ ~(0=1) /\ ~(1=3)`]); COMMENT "azim to dih"; TYPIFY `azim (vec 0) (vv 0) (vv 1) (vv 3) = dihV (vec 0) (vv 0) (vv 1) (vv 3) /\ azim (vec 0) (vv 1) (vv 2) (vv 3) = dihV (vec 0) (vv 1) (vv 2) (vv 3) /\ azim (vec 0) (vv 1) (vv 3) (vv 0) = dihV (vec 0) (vv 1) (vv 3) (vv 0) /\ azim (vec 0) (vv 2) (vv 3) (vv 1) = dihV (vec 0) (vv 2) (vv 3) (vv 1) /\ azim (vec 0) (vv 3) (vv 0) (vv 1) = dihV (vec 0) (vv 3) (vv 0) (vv 1) /\ azim (vec 0) (vv 3) (vv 1) (vv 2) = dihV (vec 0) (vv 3) (vv 1) (vv 2)` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); REWRITE_TAC[Appendix.rho_rho_fun]; BY(REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN MATCH_MP_TAC (REWRITE_RULE[TAUT `(a ==> b ==> c) <=> (a /\ b ==> c)`] Local_lemmas.AZIM_LE_PI_EQ_DIHV) THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE `{a,b,c}={a,c,b}`] THEN ASM_REWRITE_TAC[]) ]);; (* }}} *)
let vv_quad_split_short = 
prove_by_refinement( `!vv. (let V = IMAGE vv (:num) in let E = IMAGE (\i. {vv i, vv (SUC i)}) (:num) in let f = IMAGE (\i. vv i,vv (SUC i)) (:num) in (periodic vv 4 /\ V SUBSET ball_annulus /\ dist (vv 0,vv 1) < &4 /\ dist (vv 0,vv 3) < &4 /\ dist (vv 0,vv 2) < &4 /\ dist (vv 1,vv 2) < &4 /\ dist (vv 1,vv 3) < &4 /\ dist (vv 2,vv 3) < &4 /\ (!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j)) /\ convex_local_fan (V,E,f) /\ (!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j) ==> (?i. i < 2 /\ (dist(vv i,vv (i+2)) <= dist(vv (i+1),vv(i+3))) /\ (rho_fun (norm (vv 0)) * azim (vec 0) (vv 0) (vv 1) (vv 3) + rho_fun (norm (vv 1)) * azim (vec 0) (vv 1) (vv 2) (vv 0) + rho_fun (norm (vv 2)) * azim (vec 0) (vv 2) (vv 3) (vv 1) + rho_fun (norm (vv 3)) * azim (vec 0) (vv 3) (vv 0) (vv 2)) - (pi + sol0) * &2 = tau3 (vv i) (vv (i+1)) (vv (i+2)) + tau3 (vv (i+2)) (vv (i+3)) (vv i))))`,
(* {{{ proof *) [ REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; TYPIFY `dist(vv 0,vv 2) <= dist(vv 1,vv 3)` ASM_CASES_TAC; TYPIFY `0` EXISTS_TAC; ASM_REWRITE_TAC[arith `0+x = x /\ 0 < 2`]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] vv_quad_split012); BY(ASM_REWRITE_TAC[]); TYPIFY `1` EXISTS_TAC; REWRITE_TAC[arith `1+2 = 3 /\ 1+1 = 2 /\ 1 + 3 = 4 /\ 1 < 2`]; TYPIFY `vv 4 = vv 0` (C SUBGOAL_THEN SUBST1_TAC); BY( GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); CONJ_TAC; BY(FIRST_X_ASSUM MP_TAC THEN MESON_TAC[DIST_SYM;arith `~(x <= y) ==> y <= x`]); MATCH_MP_TAC (REWRITE_RULE[LET_THM] vv_quad_split123); BY(ASM_REWRITE_TAC[]) ]);;
(* }}} *)
let SUC_EXPLICIT = 
prove_by_refinement( `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4 /\ SUC 4 = 5 /\ SUC 5 = 6 /\ SUC 6 = 7 /\ SUC 7 = 8 /\ SUC 8 = 9`,
(* {{{ proof *) [ ARITH_TAC ]);;
(* }}} *)
let cs_adj4_EXPLICIT = 
prove_by_refinement( `!a b. cs_adj 4 a b 0 0 = &0 /\ cs_adj 4 a b 0 1 = a /\ cs_adj 4 a b 0 2 = b /\ cs_adj 4 a b 0 3 = a /\ cs_adj 4 a b 1 0 = a /\ cs_adj 4 a b 1 1 = &0 /\ cs_adj 4 a b 1 2 = a /\ cs_adj 4 a b 1 3 = b /\ cs_adj 4 a b 2 0 = b /\ cs_adj 4 a b 2 1 = a /\ cs_adj 4 a b 2 2 = &0 /\ cs_adj 4 a b 2 3 = a /\ cs_adj 4 a b 3 0 = a /\ cs_adj 4 a b 3 1 = b /\ cs_adj 4 a b 3 2 = a /\ cs_adj 4 a b 3 3 = &0 `,
(* {{{ proof *) [ REWRITE_TAC[Appendix.cs_adj;MOD_4_EXPLICIT;SUC_EXPLICIT]; BY(ARITH_TAC) ]);;
(* }}} *)
let delta_4680581274 = 
prove_by_refinement( `!y1 y4. cstab <= y1 /\ &4 <= y4 ==> delta_y y1 (&2) (&2) y4 (&2) cstab < &0`,
(* {{{ proof *) [ REWRITE_TAC[Sphere.delta_y;Sphere.delta_x;arith `&2 * &2 = &4`]; REPEAT WEAKER_STRIP_TAC; TYPED_ABBREV_TAC `y = y1 * y1` ; TYPED_ABBREV_TAC `z = y4 * y4` ; TYPED_ABBREV_TAC `c = cstab * cstab` ; TYPIFY `y * z * (--y + &4 + &4 - z + &4 + c) + &4 * &4 * (y - &4 + &4 + z - &4 + c) + &4 * c * (y + &4 - &4 + z + &4 - c) - &4 * &4 * z - y * &4 * &4 - y * &4 * c - z * &4 * c = (-- &64 + &32 * c - &4 * c pow 2) - y * z * (-- &12 - c + y + z)` (C SUBGOAL_THEN SUBST1_TAC); BY(REAL_ARITH_TAC); REWRITE_TAC[arith `x - y < &0 <=> x < y`]; MATCH_MP_TAC REAL_LT_TRANS; TYPIFY ` &0` EXISTS_TAC; CONJ_TAC; EXPAND_TAC "c";
REWRITE_TAC[Appendix.cstab]; BY(REAL_ARITH_TAC); EXPAND_TAC "y"; EXPAND_TAC "z"; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ); TYPIFY `&0 < y1 /\ &0 < y4` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); TYPIFY `&9 <= y1 * y1` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `&9 = &3 * &3`]; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); TYPIFY `&16 <= y4 * y4` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `&16 = &4 * &4`]; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); EXPAND_TAC "c"; REWRITE_TAC[Appendix.cstab]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *)
let delta_7697147739 = 
prove_by_refinement( `!y1 y4. cstab <= y1 /\ &4 <= y4 ==> delta_y y1 (&2) (&2) y4 (&2) sqrt8 < &0`,
(* {{{ proof *) [ REWRITE_TAC[Sphere.delta_y;Sphere.delta_x;arith `&2 * &2 = &4`;Nonlinear_lemma.sqrt8_2;arith `#8.0 = &8`]; REPEAT WEAKER_STRIP_TAC; TYPED_ABBREV_TAC `y = y1 * y1` ; TYPED_ABBREV_TAC `z = y4 * y4` ; TYPIFY `y * z * (--y + &4 + &4 - z + &4 + &8) + &4 * &4 * (y - &4 + &4 + z - &4 + &8) + &4 * &8 * (y + &4 - &4 + z + &4 - &8) - &4 * &4 * z - y * &4 * &4 - y * &4 * &8 - z * &4 * &8 = -- &64 - y * z * (-- &20 + y + z)` (C SUBGOAL_THEN SUBST1_TAC); BY(REAL_ARITH_TAC); REWRITE_TAC[arith `x - y < &0 <=> x < y`]; MATCH_MP_TAC REAL_LT_TRANS; TYPIFY ` &0` EXISTS_TAC; CONJ_TAC; BY(REAL_ARITH_TAC); EXPAND_TAC "y";
EXPAND_TAC "z"; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ); TYPIFY `&0 < y1 /\ &0 < y4` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); TYPIFY `&9 <= y1 * y1` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `&9 = &3 * &3`]; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); TYPIFY `&16 <= y4 * y4` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `&16 = &4 * &4`]; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *)
let tau3_sym = 
prove_by_refinement( `!v0 v1 v2. tau3 v0 v1 v2 = tau3 v0 v2 v1 /\ tau3 v0 v1 v2 = tau3 v1 v0 v2`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.tau3]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[DIHV_SYM]; BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let INSERT_SUBSET = 
prove_by_refinement( `!(a:A) A S. a INSERT A SUBSET S <=> (a IN S) /\ A SUBSET S`,
(* {{{ proof *) [ BY(SET_TAC[]) ]);;
(* }}} *) (* INEQUALITY MATERIAL STARTS HERE *)
let OWZLKVY0 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y1 /\ y2 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ &200 <= delta_y y1 y2 y3 y4 y5 y6 ==> &0 <= taum y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.cstab]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "6762190381") []; DISCH_THEN (C INTRO_TAC [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]); REWRITE_TAC[Sphere.ineq]; REPEAT (FIRST_X_ASSUM MP_TAC); BY(REAL_ARITH_TAC) ]);;
(* }}} *) (* was EAR_ANGLE_ACUTE *)
let EAR_DELTA_X4 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ delta_y y1 y2 y3 y4 y5 y6 <= &200 ==> (delta_x4 (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6) < &0 /\ &0 < delta_x4 (y2 * y2) (y3 * y3) (y1 * y1) (y5 * y5) (y6 * y6) (y4 * y4) /\ &0 < delta_x4 (y3 * y3) (y1 * y1) (y2 * y2) (y6 * y6) (y4 * y4) (y5 * y5) ) )`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; CONJ_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "8346775862") []; DISCH_THEN (C INTRO_TAC [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]); REWRITE_TAC[Sphere.ineq;Sphere.delta_y;Sphere.y_of_x]; REWRITE_TAC[TAUT `a ==> b ==> c <=> a /\ b ==> c`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); BY(FIRST_X_ASSUM MP_TAC THEN REWRITE_TAC[Sphere.delta_y] THEN REAL_ARITH_TAC); CONJ_TAC; TYPIFY `delta_x4 (y2 * y2) (y3 * y3) (y1 * y1) (y5 * y5) (y6 * y6) (y4 * y4) = delta_x4 (y2 * y2) (y1 * y1) (y3 * y3) (y5 * y5) (y4 * y4) (y6 * y6)` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.delta_x4]; BY(REAL_ARITH_TAC); INTRO_TAC ((* Appendix. *) get_main_nonlinear "8631418063") []; DISCH_THEN (C INTRO_TAC [`y2`;`y1`;`y3`;`y5`;`y4`;`y6`]); REWRITE_TAC[Sphere.ineq;Sphere.delta_y;Sphere.y_of_x]; REWRITE_TAC[arith `x > &0 <=> &0 < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); INTRO_TAC ((* Appendix. *) get_main_nonlinear "8631418063") []; DISCH_THEN (C INTRO_TAC [`y3`;`y1`;`y2`;`y6`;`y4`;`y5`]); REWRITE_TAC[Sphere.ineq;Sphere.delta_y;Sphere.y_of_x]; REWRITE_TAC[arith `x > &0 <=> &0 < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let EAR_DIH1_DELTA_0 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ delta_y y1 y2 y3 y4 y5 y6 = &0 ==> dih_y y1 y2 y3 y4 y5 y6 = pi)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; INTRO_TAC (UNDISCH EAR_DELTA_X4) [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); DISCH_TAC; FIRST_X_ASSUM_ST `delta_y` MP_TAC; REWRITE_TAC[Sphere.dih_y;Sphere.dih_x;LET_DEF;LET_END_DEF;Sphere.delta_y]; DISCH_THEN (unlist REWRITE_TAC); REWRITE_TAC[arith `x * &0 = &0`;SQRT_0]; TYPED_ABBREV_TAC `d = delta_x4 (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6)`; INTRO_TAC Merge_ineq.atn2_0 [`-- d`]; REPLICATE_TAC 2 (FIRST_X_ASSUM MP_TAC); BY(REAL_ARITH_TAC) ]);;
(* }}} *)
let OWZLKVY3 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> ( !y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 /\ dih_y y1 y2 y3 y4 y5 y6 = pi ==> sol0 * (y1 - &2 * h0) / (&2 * h0 - &2) <= taum y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_CASES_TAC `&200 <= delta_y y1 y2 y3 y4 y5 y6`; INTRO_TAC OWZLKVY0 []; ASM_REWRITE_TAC[]; DISCH_THEN (C INTRO_TAC [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]); ASM_REWRITE_TAC[]; MATCH_MP_TAC (arith `&0 <= s * (-- u) /v ==> (&0 <= t ==> s * u / v <= t)`); GMATCH_SIMP_TAC REAL_LE_MUL; CONJ_TAC; INTRO_TAC Flyspeck_constants.bounds []; BY(REAL_ARITH_TAC); GMATCH_SIMP_TAC REAL_LE_RDIV_EQ; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); RULE_ASSUM_TAC (REWRITE_RULE[arith `~(x <= y) <=> y < x`]); REWRITE_TAC[Nonlinear_lemma.taum_123;Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y]; REWRITE_TAC[Sphere.rhazim]; TYPIFY `delta_y y1 y2 y3 y4 y5 y6 = &0` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC Oxlzlez.DIH_X_LT_PI [`y1 * y1`;`y2*y2`;`y3*y3`;`y4*y4`;`y5*y5`;`y6*y6`]; ANTS_TAC; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.delta_y]; MP_TAC (arith `&2 <= y1 ==> &0 < y1`); BY(REAL_ARITH_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.dih_y;LET_DEF;LET_END_DEF] THEN REAL_ARITH_TAC); COMMENT "...";
INTRO_TAC (UNDISCH EAR_DELTA_X4) [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); REPEAT WEAKER_STRIP_TAC; TYPIFY `dih_y y2 y3 y1 y5 y6 y4 = &0` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.dih_y;Sphere.dih_x;LET_DEF;LET_END_DEF]; REPEAT (FIRST_X_ASSUM_ST `x = &2` kill); RULE_ASSUM_TAC (REWRITE_RULE[Sphere.delta_y]); TYPIFY `delta_x (y2 * y2) (y3 * y3) (y1 * y1) (y5 * y5) (y6 * y6) (y4 * y4) = &0` (C SUBGOAL_THEN SUBST1_TAC); FIRST_X_ASSUM_ST `x = &0` MP_TAC; BY(MESON_TAC[Merge_ineq.delta_x_sym]); REWRITE_TAC[arith `x * &0 = &0`;SQRT_0]; TYPED_ABBREV_TAC `d = delta_x4 (y2 * y2) (y3 * y3) (y1 * y1) (y5 * y5) (y6 * y6) (y4 * y4)`; INTRO_TAC Merge_ineq.atn2_0 [`-- d`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT ".."; TYPIFY `dih_y y3 y1 y2 y6 y4 y5 = &0` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.dih_y;Sphere.dih_x;LET_DEF;LET_END_DEF]; REPEAT (FIRST_X_ASSUM_ST `x = &2` kill); RULE_ASSUM_TAC (REWRITE_RULE[Sphere.delta_y]); TYPIFY `delta_x (y3 * y3) (y1 * y1) (y2 * y2) (y6 * y6) (y4 * y4) (y5 * y5) = &0` (C SUBGOAL_THEN SUBST1_TAC); FIRST_X_ASSUM_ST `x = &0` MP_TAC; BY(MESON_TAC[Merge_ineq.delta_x_sym]); REWRITE_TAC[arith `x * &0 = &0`;SQRT_0]; TYPED_ABBREV_TAC `d = delta_x4 (y3 * y3) (y1 * y1) (y2 * y2) (y6 * y6) (y4 * y4) (y5 * y5)`; INTRO_TAC Merge_ineq.atn2_0 [`-- d`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "A"; TYPIFY `dih_y y1 y2 y3 y4 y5 y6 = pi` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.dih_y;Sphere.dih_x;LET_DEF;LET_END_DEF]; REPEAT (FIRST_X_ASSUM_ST `x = &2` kill); RULE_ASSUM_TAC (REWRITE_RULE[Sphere.delta_y]); TYPIFY `delta_x (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6) = &0` (C SUBGOAL_THEN SUBST1_TAC); FIRST_X_ASSUM_ST `x = &0` MP_TAC; BY(MESON_TAC[Merge_ineq.delta_x_sym]); REWRITE_TAC[arith `x * &0 = &0`;SQRT_0]; TYPED_ABBREV_TAC `d = delta_x4 (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6)`; INTRO_TAC Merge_ineq.atn2_0 [`-- d`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); REWRITE_TAC[arith `x * &0 = &0 /\ x + &0 = x`]; REWRITE_TAC[Nonlinear_lemma.rho_alt;Nonlinear_lemma.sol0_const1]; MATCH_MP_TAC (arith `x = y ==> x <= y`); Calc_derivative.CALC_ID_TAC; REWRITE_TAC[Sphere.h0]; BY(REAL_ARITH_TAC) ]);; (* }}} *)
let OWZLKVY1 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> ( !y1 y2 y3 y4 y5 y6. &2 <= y1 /\ y1 <= &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> -- sol0 <= taum y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_CASES_TAC `&200 <= delta_y y1 y2 y3 y4 y5 y6`; INTRO_TAC OWZLKVY0 []; ASM_REWRITE_TAC[]; DISCH_THEN (C INTRO_TAC [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]); ASM_REWRITE_TAC[]; MATCH_MP_TAC (arith `&0 <= s ==> (&0 <= t ==> -- s <= t)`); INTRO_TAC Flyspeck_constants.bounds []; BY(REAL_ARITH_TAC); COMMENT "delta=0";
ASM_CASES_TAC `delta_y y1 y2 y3 y4 y5 y6 = &0`; INTRO_TAC (UNDISCH EAR_DIH1_DELTA_0) [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); DISCH_TAC; MATCH_MP_TAC REAL_LE_TRANS; EXISTS_TAC `sol0 * (y1 - &2 * h0) / (&2 * h0 - &2)`; CONJ_TAC; MATCH_MP_TAC (arith `&0 <= s * (&1 + y /z) ==> --s <= s * y /z`); GMATCH_SIMP_TAC REAL_LE_MUL; CONJ_TAC; INTRO_TAC Flyspeck_constants.bounds []; BY(REAL_ARITH_TAC); TYPIFY `&1 + (y1 - &2 * h0) / (&2 * h0 - &2) = (y1 - &2) / (&2 * h0 - &2)` (C SUBGOAL_THEN SUBST1_TAC); Calc_derivative.CALC_ID_TAC; BY(REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); GMATCH_SIMP_TAC REAL_LE_RDIV_EQ; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); MATCH_MP_TAC (UNDISCH OWZLKVY3); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "replace taum with solid angle"; TYPIFY `&0 < delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN MP_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); DISCH_TAC; REWRITE_TAC[Nonlinear_lemma.taum_123;Sphere.rhazim2;Sphere.rhazim3;Sphere.node2_y;Sphere.node3_y]; REWRITE_TAC[arith `-- sol0 <= r1 + r2 + r3 - (&1 + c)*pi <=> (-- sol0 + c * pi) + pi <= (r1 + r2 + r3)`]; MATCH_MP_TAC REAL_LE_TRANS; EXISTS_TAC `dih_y y1 y2 y3 y4 y5 y6 + dih_y y2 y3 y1 y5 y6 y4 + dih_y y3 y1 y2 y6 y4 y5`; CONJ2_TAC; MATCH_MP_TAC (arith `d1 <= r1 /\ d2 <= r2 /\ d3x <= r3 ==> d1 + d2 + d3x <= r1 + r2 + r3`); REPEAT (GMATCH_SIMP_TAC DIH_Y_LT_RHAZIM); ASM_REWRITE_TAC[]; BY(ASM_MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Nonlinear_lemma.sol0_const1;arith `(-- (pi * c) + c * pi) + pi = pi`]; RULE_ASSUM_TAC(REWRITE_RULE[arith `~(x <= d) <=> (d < x)`]); ENOUGH_TO_SHOW_TAC `&0 < sol_y y1 y2 y3 y4 y5 y6`; REWRITE_TAC[Sphere.sol_y]; BY(REAL_ARITH_TAC); REWRITE_TAC[Merge_ineq.sol_y_sol_x]; MATCH_MP_TAC sol_x_nn; REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ); REWRITE_TAC[Trigonometry1.UPS_X_SQUARES]; REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ); TYPIFY `&0 < eulerA_x (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); INTRO_TAC ((* Appendix. *) get_main_nonlinear "4821120729") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;Sphere.y_of_x;arith `x > &0 <=> &0 < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); TYPIFY `&0 < delta_x (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); FIRST_X_ASSUM MP_TAC; BY(REWRITE_TAC[Sphere.delta_y]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN (REWRITE_TAC[Appendix.cstab;Sphere.h0]) THEN REAL_ARITH_TAC) ]);; (* }}} *)
let OWZLKVY2 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> ( !y1 y2 y3 y4 y5 y6. y1 = &2 * h0 /\ &2 <= y2 /\ y2 <= &2 * h0 /\ &2 <= y3 /\ y3 <= &2 * h0 /\ cstab <= y4 /\ y4 <= #3.915 /\ y5 = &2 /\ y6 = &2 /\ &0 <= delta_y y1 y2 y3 y4 y5 y6 ==> &0 <= taum y1 y2 y3 y4 y5 y6)`,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; ASM_CASES_TAC `&200 <= delta_y y1 y2 y3 y4 y5 y6`; INTRO_TAC OWZLKVY0 []; ASM_REWRITE_TAC[]; DISCH_THEN (C INTRO_TAC [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]); ASM_REWRITE_TAC[]; DISCH_THEN MATCH_MP_TAC; BY(REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); TYPIFY `&0 <= delta_x (y1 * y1) (y2 * y2) (y3 * y3) (y4 * y4) (y5 * y5) (y6 * y6)` (C SUBGOAL_THEN ASSUME_TAC); FIRST_X_ASSUM_ST `&0 <= d` MP_TAC; BY(REWRITE_TAC[Sphere.delta_y] THEN REAL_ARITH_TAC); GMATCH_SIMP_TAC taum_taum_x; CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); REWRITE_TAC[Sphere.y_of_x]; GMATCH_SIMP_TAC Merge_ineq.tau_x_tau_residual_x; COMMENT "residue hypotheses";
CONJ_TAC; GMATCH_SIMP_TAC Nonlinear_lemma.sqrtxx; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; REPEAT (GMATCH_SIMP_TAC REAL_LT_MUL_EQ); INTRO_TAC (UNDISCH EAR_DELTA_X4) [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); DISCH_THEN (unlist REWRITE_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.delta_y;Sphere.h0;Appendix.cstab] THEN REAL_ARITH_TAC); GMATCH_SIMP_TAC REAL_LE_MUL; CONJ_TAC; GMATCH_SIMP_TAC SQRT_POS_LE; BY(FIRST_X_ASSUM (unlist REWRITE_TAC)); INTRO_TAC ((* Appendix. *) get_main_nonlinear "5202826650 a") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;Sphere.y_of_x]; REWRITE_TAC[TAUT `a ==> b ==> c <=> (a /\ b ==> c)`]; ANTS_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab;Sphere.h0] THEN REAL_ARITH_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *) (* was sqrt2_bounds *)
let sqrt8_bounds = 
prove_by_refinement( `sqrt8 <= #3.01 /\ &2 <= sqrt8 /\ sqrt8 <= #3.62`,
(* {{{ proof *) [ INTRO_TAC Flyspeck_constants.bounds []; BY(REAL_ARITH_TAC) ]);;
(* }}} *) (* renamed from terminal_std_tri_OMKYNLT_3336871894_empty *) (* let empty_3T2 = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (&0) (funlist_v39 [] (&2) 3) (funlist_v39 [] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` , (* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;arith `&2 <= &2 /\ &2 <= #3.01 /\ &2 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "OMKYNLT 3336871894") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= #0.0 <=> &0 <= x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);; (* }}} *) *)
let empty_3T2 = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T2 in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T2]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;arith `&2 <= &2 /\ &2 <= #3.01 /\ &2 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ( get_main_nonlinear "OMKYNLT 3336871894") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= #0.0 <=> &0 <= x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* renamed from terminal_std_tri_4010906068_empty *)
let empty_3T3   = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (#0.476) (funlist_v39 [] (&2*h0) 3) (funlist_v39 [] (cstab) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4010906068") [`y1`;`y3`;`y2`;`y4`;`y6`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y1 y3 y2 y4 y6 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let empty_3T3   = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T3 in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T3]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4010906068") [`y1`;`y3`;`y2`;`y4`;`y6`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y1 y3 y2 y4 y6 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* renamed from terminal_std_tri_6833979866_empty *)
let empty_3T4   = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T4 in //mk_unadorned_v39 //3 //(#0.2759) //(funlist_v39 [(0,1),(&2)] (&2*h0) 3) //(funlist_v39 [(0,1),(&2 * h0)] (cstab) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T4]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "6833979866") [`y3`;`y1`;`y2`;`y6`;`y4`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y1 y2 y6 y4 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* renamed from terminal_std_tri_5541487347_empty *)
let empty_3T5  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T5 in //mk_unadorned_v39 //3 //(#0.103) //(funlist_v39 [(0,1),(&2 * h0)] (&2) 3) //(funlist_v39 [(0,1),(sqrt8)] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T5]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "5541487347") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* let terminal_std_tri_4528012043_empty = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 0 3 + #3.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [] cstab 3) (funlist_v39 [] cstab 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` , (* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;arith `x <= x /\ &2 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4528012043") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);; (* }}} *)
let  terminal_std_tri_7459553847_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 0 3 + #3.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [(0,1),&2 * h0] cstab 3) (funlist_v39 [(0,1),&2 * h0] cstab 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7459553847") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_4143829594_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 0 3 + #3.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [(0,1),cstab] (&2 * h0) 3) (funlist_v39 [(0,1),cstab] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4143829594") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_1080462150_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 0 3 + #3.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [] (&2 * h0) 3) (funlist_v39 [] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "1080462150") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_9816718044_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2 + #2.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [(0,1),&2] cstab 3) (funlist_v39 [(0,1),&2] cstab 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9816718044") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_3106201101_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2 + #2.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [(0,1),&2; (0,2),cstab] sqrt8 3) (funlist_v39 [(0,1),&2; (0,2),cstab] sqrt8 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "3106201101") [`y3`;`y1`;`y2`;`y6`;`y4`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y1 y2 y6 y4 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_2200527225_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2 + #2.0 * (tame_table_d 2 1 - #0.11)) (funlist_v39 [(0,1),&2] sqrt8 3) (funlist_v39 [(0,1),&2] sqrt8 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "2200527225") [`y3`;`y1`;`y2`;`y6`;`y4`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y1 y2 y6 y4 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_2900061606_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2 + tame_table_d 2 1 - #0.11) (funlist_v39 [(0,1),&2 * h0; (0,2),cstab] (&2) 3) (funlist_v39 [(0,1),&2 * h0; (0,2),cstab] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "2900061606") [`y1`;`y3`;`y2`;`y4`;`y6`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y1 y3 y2 y4 y6 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_7097350062a_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2) (funlist_v39 [(0,1),&2 * h0; (0,2),sqrt8] (&2) 3) (funlist_v39 [(0,1),&2 * h0; (0,2),sqrt8] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7097350062a") [`y1`;`y3`;`y2`;`y4`;`y6`;`y5`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y1 y3 y2 y4 y6 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_OMKYNLT_1_2_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 1 2) (funlist_v39 [(0,1),&2] (&2 * h0) 3) (funlist_v39 [(0,1),&2] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "OMKYNLT 1 2") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_7645170609_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 2 1) (funlist_v39 [(0,1),sqrt8] (&2) 3) (funlist_v39 [(0,1),sqrt8] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7645170609") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_OMKYNLT_2_1_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 (tame_table_d 2 1) (funlist_v39 [(0,1),&2 * h0] (&2) 3) (funlist_v39 [(0,1),&2 * h0] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "OMKYNLT 2 1") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) *)
let  terminal_std_tri_7881254908_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 ( #0.696 - #2.0 * #0.11) (funlist_v39 [(0,1),sqrt8; (1,2),sqrt8] (&2 * h0) 3) (funlist_v39 [(0,1),cstab; (1,2),cstab] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7881254908") [`y2`;`y1`;`y3`;`y5`;`y4`;`y6`]; TYPIFY `taum y2 y1 y3 y5 y4 y6 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* renamed from terminal_std_tri_5026777310a_empty *)
let empty_3T6  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T6' in //mk_unadorned_v39 3 ( #0.6548 - #2.0 * #0.11) //(funlist_v39 [(0,1),sqrt8; (1,2),sqrt8] (&2) 3) //(funlist_v39 [(0,1),cstab; (1,2),cstab] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T6]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "5026777310a") [`y3`;`y1`;`y2`;`y6`;`y4`;`y5`]; TYPIFY `taum y3 y1 y2 y6 y4 y5 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; REWRITE_TAC[arith `4 + 2 * 1 > 3`]; TYPIFY `delta_y y3 y1 y2 y6 y4 y5 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* deprecated 2013-06-17 let terminal_std_tri_7720405539_empty = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 ( #0.5518 / #2.0 - #0.2) (funlist_v39 [(0,1),cstab; (0,2),&2 * h0; (1,2),&2] (&2) 3) (funlist_v39 [(0,1), #3.41; (0,2),&2 * h0; (1,2),&2] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` , (* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7720405539") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; REWRITE_TAC[arith `2 + 2 * 2 > 3`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);; (* }}} *)
let  terminal_std_tri_2739661360_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 ( #0.5518 / #2.0 + #0.2) (funlist_v39 [(0,1),cstab; (0,2),cstab; (1,2),&2] (&2) 3) (funlist_v39 [(0,1), #3.41; (0,2),cstab; (1,2),&2] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "2739661360") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; REWRITE_TAC[arith `2 + 2 * 2 > 3`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_std_tri_4922521904_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 ( #0.5518 / #2.0) (funlist_v39 [(0,1),cstab; (0,2),&2 * h0; (1,2),&2] (&2) 3) (funlist_v39 [(0,1), #3.339; (0,2),&2 * h0; (1,2),&2] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4922521904") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; REWRITE_TAC[arith `2 + 2 * 2 > 3`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) *) (* renamed from terminal_std_tri_2468307358_empty *)
let empty_3T7   = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T7 in // mk_unadorned_v39 3 ( #0.2565) // (funlist_v39 [(0,1),cstab; (0,2),cstab; (1,2),&2] (&2) 3) // (funlist_v39 [(0,1), #3.62; (0,2),cstab; (1,2),&2] (&2) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T7]; REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "2468307358") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; (* INTRO_TAC ((* Appendix. *) get_main_nonlinear "2739661360") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; edited 2013-06-17. *) TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; REWRITE_TAC[arith `2 + 2 * 2 > 3`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let terminal_std_tri_ear_stab_empty = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 3 #0.11 (funlist_v39 [(0,2),cstab] (&2) 3) (funlist_v39 [(0,2),cstab] (&2 * h0) 3) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; MATCH_MP_TAC taustar_taum; REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "3603097872") [`y2`;`y1`;`y3`;`y5`;`y4`;`y6`]; TYPIFY `taum y2 y1 y3 y5 y4 y6 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y2 y1 y3 y5 y4 y6 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* let terminal_std_ear_3603097872_empty = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_v39 (3, #0.11, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlistA_v39 [(0,1),T] F F 3, {},{}, {}) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` , (* {{{ proof *) [ DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar_taum_dfun); REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[is_ear_3603097872]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "3603097872") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y3 y2 y1 y6 y5 y4 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);; (* }}} *)
let  terminal_std_ear_jnull_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_v39 (3, #0.11, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),sqrt8] (&2) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, funlist_v39 [(0,1),cstab] (&2 * h0) 3, (\i j. F), {},{}, {}) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar_taum_dfun); REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit;EMPTY_GSPEC;NOT_INSERT_EMPTY]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "3603097872") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y3 y2 y1 y6 y5 y4 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) *)
let  empty_3T1  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_3T1 in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_3T1;Appendix.mk_unadorned_v39]; DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar_taum_dfun); REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit;EMPTY_GSPEC;NOT_INSERT_EMPTY]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "3603097872") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y3 y2 y1 y6 y5 y4 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let  terminal_tri_5405130650_empty  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_v39 (3, #0.477 - #0.11, funlist_v39 [(0,1),sqrt8; (0,2),&2 * h0; (1,2),&2] (&2) 3, funlist_v39 [(0,1),sqrt8; (0,2),&2 * h0; (1,2),&2] (&2) 3, funlist_v39 [(0,1),cstab; (0,2),sqrt8; (1,2),&2 * h0] (&2 * h0) 3, funlist_v39 [(0,1),cstab; (0,2),sqrt8; (1,2),&2 * h0] (&2 * h0) 3, funlistA_v39 [(0,1),T] F F 3, {},{}, {}) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar_taum_dfun); REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit;arith `~(#0.477 - #0.11 = #0.11)`]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "5405130650") [`y3`;`y2`;`y1`;`y6`;`y5`;`y4`]; TYPIFY `taum y3 y2 y1 y6 y5 y4 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y3 y2 y1 y6 y5 y4 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);;
(* }}} *) (* let terminal_tri_5766053833_empty = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_v39 (3, #0.696 - #2.0 * #0.11, funlist_v39 [(0,1),sqrt8; (1,2),sqrt8] (&2) 3, funlist_v39 [(0,1),sqrt8; (1,2),sqrt8] (&2) 3, funlist_v39 [(0,1),cstab; (1,2),cstab] (&2) 3, funlist_v39 [(0,1),cstab; (1,2),cstab] (&2) 3, funlistA_v39 [(0,1),T; (1,2),T] F F 3, {},{}, {}) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` , (* {{{ proof *) [ DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; MATCH_MP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] taustar_taum_dfun); REWRITE_TAC[FUNLIST_EXPLICIT]; REWRITE_TAC[Appendix.is_ear_v39;Appendix.scs_v39_explicit;arith `~(#0.696 - #2.0* #0.11 = #0.11)`]; REWRITE_TAC[Appendix.cstab;Sphere.h0;arith `x <= x /\ &2 <= #3.01 /\ &2 <= &2 * #1.26 /\ &2 * #1.26 <= #3.01 /\ &2 <= #3.62 /\ #3.01 <= #3.62 /\ &2 * #1.26 <= #3.62 /\ #3.41 <= #3.62 /\ #3.339 <= #3.62`]; REWRITE_TAC[sqrt8_bounds]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "5766053833") [`y2`;`y1`;`y3`;`y5`;`y4`;`y6`]; TYPIFY `taum y2 y1 y3 y5 y4 y6 = taum y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); TYPIFY `delta_y y2 y1 y3 y5 y4 y6 = delta_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[Merge_ineq.delta_y_sym]); REWRITE_TAC[Sphere.ineq;arith `x >= y <=> y <= x`;arith `x > y <=> y < x`;Sphere.tame_table_d]; MP_TAC sqrt8_bounds; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC) ]);; (* }}} *) *) (* ************************************************************************** *) (* START OF QUAD CASES *) (* ************************************************************************** *) (* renamed from terminal__adhoc_quad_5691615370_empty *)
let empty_4T1  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_4T1 in //mk_unadorned_v39 4 #0.467 (cs_adj 4 (&2) (&3)) (cs_adj 4 (&2) (&6)) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))` ,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_4T1]; DISCH_TAC; REWRITE_TAC[LET_DEF;LET_END_DEF]; REWRITE_TAC[Appendix.BBs_v39;Appendix.mk_unadorned_v39;Appendix.cs_adj;Appendix.scs_v39_explicit]; REWRITE_TAC[LET_DEF;LET_END_DEF;arith `~(4 <= 3)`]; REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; REPLICATE_TAC 2 (FIRST_X_ASSUM kill); ASSUME_TAC MOD_4_EXPLICIT; ASSUME_TAC (arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`); FIRST_ASSUM (C INTRO_TAC [`0`;`1`]); FIRST_ASSUM (C INTRO_TAC [`0`;`2`]); FIRST_ASSUM (C INTRO_TAC [`0`;`3`]); FIRST_ASSUM (C INTRO_TAC [`1`;`2`]); FIRST_ASSUM (C INTRO_TAC [`1`;`3`]); FIRST_X_ASSUM (C INTRO_TAC [`2`;`3`]); ASM_REWRITE_TAC[arith `~(1 = 3) /\ ~(2 = 3) /\ ~(1 = 2) /\ ~(0 = 1) /\ ~(0=2) /\ ~(0=3)`]; REPEAT WEAKER_STRIP_TAC; TYPIFY `dist(vv 2,vv 3) = &2 /\ dist(vv 1,vv 2) = &2 /\ dist(vv 0, vv 3) = &2 /\ dist(vv 0,vv 1) = &2` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); INTRO_TAC DELTA_Y_POS_4POINTS [`vv 0 `;`vv 1`;`vv 2`;`vv 3`]; ASM_REWRITE_TAC[Sphere.delta_y;Sphere.delta_x]; TYPIFY `&9 <= dist(vv 1, vv 3) * dist(vv 1, vv 3) /\ &9 <= dist(vv 0 , vv 2) * dist(vv 0,vv 2)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `&9 = &3 * &3`]; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; GMATCH_SIMP_TAC Misc_defs_and_lemmas.ABS_SQUARE_LE; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); TYPED_ABBREV_TAC `y2 = dist(vv 1,vv 3) * dist(vv 1,vv 3)` ; TYPED_ABBREV_TAC `z2 = dist(vv 0,vv 2) * dist(vv 0,vv 2)` ; REWRITE_TAC[arith `&2 * &2 = &4`]; REWRITE_TAC[arith `&4 * &4 * (-- &4 + z2 + &4 - &4 + y2 + &4) + z2 * y2 * (&4 - z2 + &4 + &4 - y2 + &4) + &4 * &4 * (&4 + z2 - &4 + &4 + y2 - &4) - z2 * &4 * &4 - &4 * &4 * y2 - &4 * z2 * &4 - &4 * y2 * &4 = -- ( y2 *z2 *( y2 + z2 - &16))`]; REWRITE_TAC[arith `~(&0 <= -- x ) <=> (&0 < x)`]; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; GMATCH_SIMP_TAC REAL_LT_MUL_EQ; BY(REPLICATE_TAC 3 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let ineq_5691615370_asym = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y1 y2 y3 y4 y5 y6. ineq [ (#3.0,y1,#3.0); (&2,y2,#2.52); (&2,y3,#2.52); (#3.0,y4,#3.0); (&2,y5,#2.52); (&2,y6,#2.52) ] ((delta_y y1 y2 y3 y4 y5 y6 < &0) \/ (y2 + y3 + y5 + y6 > #8.472)))`,
(* {{{ proof *) [ DISCH_TAC; ONCE_REWRITE_TAC[MESON[] `(!y1 y2 y3 y4 y5 y6. P y1 y2 y3 y4 y5 y6) <=> (! y2 y3 y5 y6 y1 y4. P y1 y2 y3 y4 y5 y6)`]; MATCH_MP_TAC REAL_WLOG_SQUARE2_LEMMA; CONJ_TAC; REWRITE_TAC[Sphere.ineq]; REPEAT WEAKER_STRIP_TAC; TYPIFY `y2' + y5 + y6 + y2 = y2 + y2' + y5 + y6` (C SUBGOAL_THEN SUBST1_TAC); BY(REAL_ARITH_TAC); TYPIFY `y2 + y6 + y5 + y2' = y2 + y2' + y5 + y6` (C SUBGOAL_THEN SUBST1_TAC); BY(REAL_ARITH_TAC); TYPIFY `delta_y y4 y2' y5 y1 y6 y2 = delta_y y1 y2 y2' y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); BY(REWRITE_TAC[Sphere.delta_y;Sphere.delta_x] THEN REAL_ARITH_TAC); CONJ_TAC; BY(REWRITE_TAC[Sphere.delta_y;Sphere.delta_x] THEN REAL_ARITH_TAC); BY(REWRITE_TAC[Sphere.delta_y;Sphere.delta_x] THEN REAL_ARITH_TAC); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[Sphere.ineq]; REPEAT WEAKER_STRIP_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "5691615370") [`y1`;`y2`;`y2'`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);;
(* }}} *)
let terminal_quad_lemma = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!d a b . (let s = mk_unadorned_v39 4 d a b in (!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &0 < a i j) /\ (!vv. IMAGE vv (:num) SUBSET ball_annulus /\ periodic vv 4 /\ (!i j. a i j <= dist (vv i,vv j) /\ dist (vv i,vv j) <= b i j) /\ (convex_local_fan (IMAGE vv (:num), IMAGE (\i. {vv i, vv (SUC i)}) (:num), IMAGE (\i. vv i,vv (SUC i)) (:num))) ==> (d <= (rho_fun (norm (vv 0)) * azim (vec 0) (vv 0) (vv 1) (vv 3) + rho_fun (norm (vv 1)) * azim (vec 0) (vv 1) (vv 2) (vv 4) + rho_fun (norm (vv 2)) * azim (vec 0) (vv 2) (vv 3) (vv 5) + rho_fun (norm (vv 3)) * azim (vec 0) (vv 3) (vv 4) (vv 6) + &0) - (pi + sol0) * (&4 - &2) )) ==> (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv)))` ,
(* {{{ proof *) [ DISCH_TAC; REWRITE_TAC[LET_THM]; REWRITE_TAC[Appendix.BBs_v39;Appendix.mk_unadorned_v39;Appendix.scs_v39_explicit;Appendix.taustar_v39]; REWRITE_TAC[LET_THM;arith `~(4 <= 3)`;dsv_fun4]; REWRITE_TAC[arith `d - #0.1 * (&0 + &0 + &0 + &0 + &0) = d`]; REPEAT WEAKER_STRIP_TAC; COMMENT "expand tau_fun";
GMATCH_SIMP_TAC (REWRITE_RULE[LET_DEF;LET_END_DEF] tau_fun_azim); TYPIFY `4` EXISTS_TAC; ASM_SIMP_TAC[arith `3 <= 4`]; CONJ_TAC; REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; FIRST_X_ASSUM (C INTRO_TAC [`i`;`j`]); ASM_REWRITE_TAC[DIST_REFL]; REWRITE_TAC[DE_MORGAN_THM;arith `~(a <= &0) <=> &0 < a`]; BY(ASM_MESON_TAC[]); TYPIFY `{i | i < 4 } = {0,1,2,3}` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[EXTENSION;IN_ELIM_THM;IN_INSERT;NOT_IN_EMPTY]; BY(ARITH_TAC); REPEAT (GMATCH_SIMP_TAC Marchal_cells_2_new.SUM_CLAUSES_alt); REWRITE_TAC[SUM_CLAUSES;IN_INSERT;NOT_IN_EMPTY;arith `~(2 = 3) /\ ~(0 = 1) /\ ~(0 = 2) /\ ~(0 = 3) /\ ~(1 = 2) /\ ~(1 = 3) /\ ~(1 = 2) /\ ~(1 = 3)`;FINITE_INSERT;FINITE_EMPTY]; REWRITE_TAC[arith `0 + 1 = 1 /\ 1 + 1 = 2 /\ 2 + 1 = 3 /\ 3 + 1 = 4 /\ 0 + 4 -1 = 3 /\ 1 + 4 -1 = 4 /\ 2 + 4 - 1 = 5 /\ 3 + 4 - 1 = 6`]; COMMENT "next"; REWRITE_TAC[arith `&0 <= r - d <=> d <= r`]; FIRST_X_ASSUM MATCH_MP_TAC; BY(ASM_REWRITE_TAC[]) ]);; (* }}} *) (* renamed from terminal_adhoc_quad_9563139965B_empty *)
let empty_4T2  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_4T2 in // mk_unadorned_v39 4 #0.467 (cs_adj 4 (&2) (&3)) (cs_adj 4 (&2 * h0) (&3)) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_4T2]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_THM]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] (UNDISCH terminal_quad_lemma)); COMMENT "digression";
TYPIFY `(!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &2 <= cs_adj 4 (&2) (&3) i j) ` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[Appendix.cs_adj]; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 <= &2 /\ &2 <= &3`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`] THEN ASM_MESON_TAC[]); COMMENT "digress2"; TYPIFY `!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> cs_adj 4 (&2 * h0) (&3) i j < &4` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[Appendix.cs_adj;Sphere.h0]; REPEAT WEAKER_STRIP_TAC; BY(REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 * #1.26 < &4 /\ &3 < &4`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`] THEN ASM_MESON_TAC[]); CONJ_TAC; BY(ASM_MESON_TAC[arith `&2 <= x ==> &0 < x`]); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[arith `x + &0 = x /\ &4 - &2 = &2`]; TYPIFY `(!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j)` (C SUBGOAL_THEN ASSUME_TAC); REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; BY(ASM_MESON_TAC[DIST_REFL;REAL_LE_TRANS;arith `~(&2 <= &0)`]); COMMENT "vv"; TYPIFY `vv 4 = vv 0 /\ vv 5 = vv 1 /\ vv 6 = vv 2` (C SUBGOAL_THEN ASSUME_TAC); BY((REPEAT CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC (REWRITE_RULE[LET_THM] vv_quad_split012); ASM_REWRITE_TAC[]; COMMENT "dist"; SUBCONJ_TAC; TYPIFY `(!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j))` (C SUBGOAL_THEN ASSUME_TAC); MATCH_MP_TAC periodic2_mod_reduce; TYPIFY `4` EXISTS_TAC; REWRITE_TAC[Appendix.periodic2;arith `~(4 = 0)`]; TYPIFY `!i. vv (i + 4) = vv i` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_MESON_TAC[Oxl_def.periodic;arith `~(4 = 0)`]); REPEAT WEAKER_STRIP_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS]); ASM_REWRITE_TAC[]; BY(ASM_MESON_TAC[REAL_LET_TRANS;arith `0 < 4 /\ 1 < 4 /\ 2 < 4 /\ 3 < 4 /\ ~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1=2) /\ ~(2 =3)`]); COMMENT "tau3"; REPEAT WEAKER_STRIP_TAC; REPEAT (GMATCH_SIMP_TAC tau3_taum_40); ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[]; TYPIFY `dist (vv 2,vv 0) < &4 /\ dist (vv 3,vv 0) < &4 ` (C SUBGOAL_THEN (unlist REWRITE_TAC)); ONCE_REWRITE_TAC[DIST_SYM]; BY(ASM_REWRITE_TAC[]); REWRITE_TAC[TAUT `a /\ b /\ c <=> (a /\ b) /\ c`]; CONJ_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS;arith `1 < 4 /\ 2 < 4 /\ 3 < 4 /\ 0 < 4 /\ ~(2=3) /\ ~(2 =0) /\ ~(3 =0) /\ ~(0 = 1) /\ ~(0=2) /\ ~(1 = 2)`]); TYPIFY `dist(vv 3,vv 0) = dist(vv 0,vv 3) /\ dist(vv 2, vv 0) = dist(vv 0,vv 2)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(MESON_TAC[DIST_SYM]); COMMENT "prep dist"; TYPIFY `(!i j d. d <= cs_adj 4 (&2) (&3) i j ==> d <= dist (vv i,vv j)) /\ (!i j d. cs_adj 4 (&2 * h0) (&3) i j <= d ==> dist (vv i,vv j) <= d)` (C SUBGOAL_THEN MP_TAC); BY(ASM_MESON_TAC[REAL_LE_TRANS]); REPEAT WEAKER_STRIP_TAC; INTRO_TAC cs_adj4_EXPLICIT [`&2`;`&3`]; INTRO_TAC cs_adj4_EXPLICIT [`&2 * h0`;`&3`]; REPEAT WEAKER_STRIP_TAC; COMMENT "fist get"; INTRO_TAC (UNDISCH ineq_5691615370_asym) [`dist (vv 0,vv 2)`;`dist(vv 0, vv 1)`;`dist(vv 0, vv 3)`;`dist(vv 1,vv 3)`;`dist(vv 2,vv 3)`;`dist(vv 2,vv 1)`]; TYPIFY `~(delta_y (dist (vv 0,vv 2)) (dist (vv 0,vv 1)) (dist (vv 0,vv 3)) (dist (vv 1,vv 3)) (dist (vv 2,vv 3)) (dist (vv 2,vv 1)) < &0)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); MATCH_MP_TAC (arith `&0 <= d ==> ~(d < &0)`); BY(REWRITE_TAC[DELTA_Y_POS_4POINTS]); REWRITE_TAC[]; TYPIFY `dist(vv 2,vv 1) = dist(vv 1, vv 2)` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[DIST_SYM]); REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); DISCH_TAC; COMMENT "norms"; RULE_ASSUM_TAC(REWRITE_RULE[Fnjlbxs.in_ball_annulus]); COMMENT "second get"; TYPIFY `dist (vv 0,vv 1) <= #2.472 /\ dist(vv 1,vv 2) <= #2.472 /\ dist(vv 2,vv 3) <= #2.472 /\ dist(vv 0,vv 3) <= #2.472` ASM_CASES_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 d") [`norm(vv 1)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 1)`;`dist(vv 1,vv 2)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 d") [`norm(vv 3)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 3)`;`dist(vv 2,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); DISCH_TAC; TYPIFY `taum (norm (vv 0)) (norm (vv 1)) (norm (vv 2)) (dist (vv 1,vv 2)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1)) = taum (norm (vv 1)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1)) (dist (vv 1,vv 2)) /\ taum (norm (vv 2)) (norm (vv 3)) (norm (vv 0)) (dist (vv 0,vv 3)) (dist (vv 0,vv 2)) (dist (vv 2,vv 3)) = taum (norm (vv 3)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 3)) (dist (vv 2,vv 3))` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); BY(REPLICATE_TAC 4 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); BY(MESON_TAC[taum_sym]); COMMENT "third get"; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 f") [`norm(vv 1)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 1)`;`dist(vv 1,vv 2)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 1)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1)) (dist (vv 1,vv 2)) = taum (norm (vv 0)) (norm (vv 1)) (norm (vv 2)) (dist (vv 1,vv 2)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 f") [`norm(vv 3)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 3)`;`dist(vv 2,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 3)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 3)) (dist (vv 2,vv 3)) = taum (norm (vv 2)) (norm (vv 3)) (norm (vv 0)) (dist (vv 0,vv 3)) (dist (vv 0,vv 2)) (dist (vv 2,vv 3))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); DISCH_TAC; FIRST_X_ASSUM_ST `~` MP_TAC; REWRITE_TAC[DE_MORGAN_THM]; COMMENT "four cases on top edge"; DISCH_TAC THEN REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC); INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 e") [`norm(vv 1)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 1)`;`dist(vv 1,vv 2)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; TYPIFY `#2.467 <= dist(vv 0,vv 1)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN FIRST_X_ASSUM MP_TAC THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 1)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1)) (dist (vv 1,vv 2)) = taum (norm (vv 0)) (norm (vv 1)) (norm (vv 2)) (dist (vv 1,vv 2)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPLICATE_TAC 3 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "3 left"; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 e") [`norm(vv 1)`;`norm (vv 0)`;`norm (vv 2)`;`dist(vv 0,vv 2)`;`dist(vv 1,vv 2)`;`dist(vv 0,vv 1)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; TYPIFY `#2.467 <= dist(vv 1,vv 2)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN FIRST_X_ASSUM MP_TAC THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 1)) (norm (vv 0)) (norm (vv 2)) (dist (vv 0,vv 2)) (dist (vv 1,vv 2)) (dist (vv 0,vv 1)) = taum (norm (vv 0)) (norm (vv 1)) (norm (vv 2)) (dist (vv 1,vv 2)) (dist (vv 0,vv 2)) (dist (vv 0,vv 1))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPLICATE_TAC 3 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "2 left"; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 e") [`norm(vv 3)`;`norm (vv 0)`;`norm (vv 2)`;`dist(vv 0,vv 2)`;`dist(vv 2,vv 3)`;`dist(vv 0,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; TYPIFY `#2.467 <= dist(vv 2,vv 3)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN FIRST_X_ASSUM MP_TAC THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 3)) (norm (vv 0)) (norm (vv 2)) (dist (vv 0,vv 2)) (dist (vv 2,vv 3)) (dist (vv 0,vv 3)) = taum (norm (vv 2)) (norm (vv 3)) (norm (vv 0)) (dist (vv 0,vv 3)) (dist (vv 0,vv 2)) (dist (vv 2,vv 3))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPLICATE_TAC 3 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "1 left"; INTRO_TAC ((* Appendix. *) get_main_nonlinear "9563139965 e") [`norm(vv 3)`;`norm (vv 2)`;`norm (vv 0)`;`dist(vv 0,vv 2)`;`dist(vv 0,vv 3)`;`dist(vv 2,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; ASM_REWRITE_TAC[]; TYPIFY `#2.467 <= dist(vv 0,vv 3)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); BY(REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0] THEN FIRST_X_ASSUM MP_TAC THEN TRY REAL_ARITH_TAC); TYPIFY `taum (norm (vv 3)) (norm (vv 2)) (norm (vv 0)) (dist (vv 0,vv 2)) (dist (vv 0,vv 3)) (dist (vv 2,vv 3)) = taum (norm (vv 2)) (norm (vv 3)) (norm (vv 0)) (dist (vv 0,vv 3)) (dist (vv 0,vv 2)) (dist (vv 2,vv 3))` (C SUBGOAL_THEN SUBST1_TAC); BY(MESON_TAC[taum_sym]); BY(REPLICATE_TAC 3 (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *)
let quad_4680581274_derived = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y0 y1 y2 y3 y4 y5 y6 y7 y8 y9. ineq [ (#3.01,y0,&4); (#2.0,y1,&2 * h0); (#2.0,y2,&2 * h0); (#2.0,y3,&2 * h0); (#3.01,y4,&4); (#2.0,y5,&2); (#2.0,y6,&2); (#2.0,y7,&2 * h0); (#2.0,y8,&2); (#3.01,y9,#3.01)] ( (enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 = y0) /\ ( y4 <= y0 ) /\ &0 <= delta_y y0 y9 y8 y4 y5 y6 ==> // #0.616 - #0.11 #0.513 < tauq y1 y2 y3 y4 y5 y6 y7 y8 y9 )) `,
(* {{{ proof *) [ REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REPEAT WEAKER_STRIP_TAC; TYPIFY `y4 <= #3.166` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4680581274 delta top issue") [`y0`;`y9`;`y8`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); INTRO_TAC ((* Appendix. *) get_main_nonlinear "4559601669") [`y1`;`y5`;`y6`;`y4`;`y2`;`y3`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); TYPIFY `delta4_y y1 y5 y6 y4 y2 y3 = delta4_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.delta4_y;Sphere.y_of_x;Sphere.delta_x4]; BY(REAL_ARITH_TAC); DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4680581274 delta issue") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`;`y7`;`y8`;`y9`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); ASM_SIMP_TAC[arith `d4 < &0 ==> ~(d4 > &0)`;arith `c <= y0 ==> ~(y0 < c)`]; REWRITE_TAC[arith `x > y <=> y < x`]; DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "4680581274 a") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`;`y7`;`y8`;`y9`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); ASM_SIMP_TAC[arith `d4 < &0 ==> ~(d4 > &0)`;arith `c <= y0 ==> ~(y0 < c)`;arith `c < d ==> ~(d < c)`]; BY(REAL_ARITH_TAC) ]);;
(* }}} *) (* deprecated 2013-06-17 let quad_7697147739_derived = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (!y0 y1 y2 y3 y4 y5 y6 y7 y8 y9. ineq [ (#3.01,y0,&4); (#2.0,y1,&2 * h0); (#2.0,y2,&2 * h0); (#2.0,y3,&2 * h0); (#3.01,y4,&4); (#2.0,y5,&2); (#2.0,y6,&2); (#2.0,y7,&2 * h0); (#2.0,y8,&2); (sqrt8,y9,sqrt8)] ( (enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 = y0) /\ ( y4 <= y0 ) /\ &0 <= delta_y y0 y9 y8 y4 y5 y6 ==> #0.616 - #0.11 < tauq y1 y2 y3 y4 y5 y6 y7 y8 y9 )) `, (* {{{ proof *) [ REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REPEAT WEAKER_STRIP_TAC; TYPIFY `y4 <= #3.108` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7697147739 delta top issue") [`y0`;`y9`;`y8`;`y4`;`y5`;`y6`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); INTRO_TAC ((* Appendix. *) get_main_nonlinear "4559601669") [`y1`;`y5`;`y6`;`y4`;`y2`;`y3`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); TYPIFY `delta4_y y1 y5 y6 y4 y2 y3 = delta4_y y1 y2 y3 y4 y5 y6` (C SUBGOAL_THEN SUBST1_TAC); REWRITE_TAC[Sphere.delta4_y;Sphere.y_of_x;Sphere.delta_x4]; BY(REAL_ARITH_TAC); DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7697147739 delta issue") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`;`y7`;`y8`;`y9`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); ASM_SIMP_TAC[arith `d4 < &0 ==> ~(d4 > &0)`;arith `c <= y0 ==> ~(y0 < c)`]; REWRITE_TAC[arith `x > y <=> y < x`]; DISCH_TAC; INTRO_TAC ((* Appendix. *) get_main_nonlinear "7697147739 a") [`y1`;`y2`;`y3`;`y4`;`y5`;`y6`;`y7`;`y8`;`y9`]; REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ANTS_TAC; BY(REPEAT CONJ_TAC THEN REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Sphere.h0] THEN TRY REAL_ARITH_TAC); ASM_SIMP_TAC[arith `d4 < &0 ==> ~(d4 > &0)`;arith `c <= y0 ==> ~(y0 < c)`;arith `c < d ==> ~(d < c)`]; BY(REAL_ARITH_TAC) ]);; (* }}} *) *) (* renamed from terminal_adhoc_quad_4680581274_empty, 2013-06-26, constant #0.616- #0.11 -> #0.513 *)
let empty_4T3  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_4T3 in //mk_unadorned_v39 4 ( #0.616 - #0.11) // (funlist_v39 [(0,1),cstab; (0,2),cstab; (1,3),cstab] (&2) 4) // (funlist_v39 [(0,1),cstab; (0,2),&6; (1,3),&6] (&2) 4) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_4T3]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_THM]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] (UNDISCH terminal_quad_lemma)); COMMENT "digression";
TYPIFY `(!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &2 <= funlist_v39 [(0,1),cstab; (0,2),cstab; (1,3),cstab] (&2) 4 i j) ` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REPEAT WEAKER_STRIP_TAC; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;FUNLIST_EXPLICIT;arith `&2 <= &2 /\ &2 <= &3`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Appendix.cstab;arith `&2 <= #3.01`]) THEN ASM_MESON_TAC[]); COMMENT "conj1"; CONJ_TAC; BY(ASM_MESON_TAC[arith `&2 <= x ==> &0 < x`]); REPEAT WEAKER_STRIP_TAC; COMMENT "prep dist"; TYPIFY `(!i j d. d <= funlist_v39 [(0,1),cstab; (0,2),cstab; (1,3),cstab] (&2) 4 i j ==> d <= dist (vv i,vv j)) /\ (!i j d. funlist_v39 [(0,1),cstab; (0,2),&6; (1,3),&6] (&2) 4 i j <= d ==> dist (vv i,vv j) <= d)` ((C SUBGOAL_THEN MP_TAC)); BY(ASM_MESON_TAC[REAL_LE_TRANS]); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[arith `x + &0 = x /\ &4 - &2 = &2`]; TYPIFY `(!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j)` (C SUBGOAL_THEN ASSUME_TAC); REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; BY(ASM_MESON_TAC[DIST_REFL;REAL_LE_TRANS;arith `~(&2 <= &0)`]); COMMENT "vv"; TYPIFY `vv 4 = vv 0 /\ vv 5 = vv 1 /\ vv 6 = vv 2` (C SUBGOAL_THEN ASSUME_TAC); BY((REPEAT CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); ASM_REWRITE_TAC[]; INTRO_TAC vv_quad_split_short [`vv`]; ASM_REWRITE_TAC[LET_THM]; COMMENT "dist"; TYPIFY `(!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j))` (C SUBGOAL_THEN ASSUME_TAC); MATCH_MP_TAC periodic2_mod_reduce; TYPIFY `4` EXISTS_TAC; REWRITE_TAC[Appendix.periodic2;arith `~(4 = 0)`]; TYPIFY `!i. vv (i + 4) = vv i` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_MESON_TAC[Oxl_def.periodic;arith `~(4 = 0)`]); REPEAT WEAKER_STRIP_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS]); ASM_REWRITE_TAC[]; COMMENT "edge lengths"; TYPIFY `I(dist(vv 0,vv 1) = cstab /\ dist(vv 1,vv 2) = &2 /\ dist(vv 2, vv 3) = &2 /\ dist(vv 0,vv 3) = &2)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[I_DEF]; REWRITE_TAC[arith `d = c <=> d <= c /\ c <= d`]; FIRST_X_ASSUM kill; BY(REPEAT CONJ_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT;Appendix.cstab] THEN TRY REAL_ARITH_TAC); TYPIFY `dist(vv 1,vv 0) = dist(vv 0,vv 1) /\ dist (vv 2, vv 0) = dist(vv 0,vv 2) /\ dist(vv 3,vv 0) = dist (vv 0, vv 3) /\ dist (vv 2,vv 1) = dist (vv 1, vv 2) /\ dist (vv 3,vv 2) = dist (vv 2, vv 3) /\ dist(vv 3,vv 1)=dist(vv 1,vv 3)` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[DIST_SYM]); DISCH_TAC; COMMENT "diags"; TYPIFY `dist(vv 0,vv 2) < &4` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC delta_4680581274 [`dist(vv 1,vv 3)`;`dist(vv 0,vv 2)`]; ANTS_TAC; CONJ_TAC; (FIRST_X_ASSUM MATCH_MP_TAC) THEN REWRITE_TAC[FUNLIST_EXPLICIT;Appendix.cstab;MOD_4_EXPLICIT;arith `~(1 = 3)`]; BY(REAL_ARITH_TAC); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); REWRITE_TAC[arith `~(d < &0) <=> &0 <= d`]; TYPIFY `delta_y (dist (vv 1,vv 3)) (&2) (&2) (dist (vv 0,vv 2)) (&2) cstab = delta_y (dist(vv 3,vv 1)) (dist(vv 3,vv 0)) (dist(vv 3,vv 2)) (dist(vv 0,vv 2)) (dist (vv 1, vv 2)) (dist (vv 1, vv 0))` ENOUGH_TO_SHOW_TAC; DISCH_THEN SUBST1_TAC; BY(REWRITE_TAC[ DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC (REWRITE_RULE[I_THM]); BY(ASM_REWRITE_TAC[]); COMMENT "second diag"; TYPIFY `dist(vv 1,vv 3) < &4` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC delta_4680581274 [`dist(vv 2,vv 0)`;`dist(vv 1,vv 3)`]; ANTS_TAC; CONJ_TAC; (FIRST_X_ASSUM MATCH_MP_TAC) THEN REWRITE_TAC[FUNLIST_EXPLICIT;Appendix.cstab;MOD_4_EXPLICIT;arith `~(0=2)`]; BY(REAL_ARITH_TAC); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); REWRITE_TAC[arith `~(d < &0) <=> &0 <= d`]; TYPIFY `delta_y (dist (vv 2,vv 0)) (&2) (&2) (dist (vv 1,vv 3)) (&2) cstab = delta_y (dist(vv 2,vv 0)) (dist(vv 2,vv 1)) (dist(vv 2,vv 3)) (dist(vv 1,vv 3)) (dist (vv 0, vv 3)) (dist (vv 0, vv 1))` ENOUGH_TO_SHOW_TAC; DISCH_THEN SUBST1_TAC; BY(REWRITE_TAC[ DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC (REWRITE_RULE[I_THM]); BY(ASM_REWRITE_TAC[]); FIRST_X_ASSUM_ST `rho_fun` MP_TAC; ANTS_TAC; RULE_ASSUM_TAC (REWRITE_RULE[I_THM]) THEN ASM_REWRITE_TAC[]; BY(REWRITE_TAC[Appendix.cstab] THEN REAL_ARITH_TAC); REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; COMMENT "enclosed"; INTRO_TAC vv_enclosed4 [`vv`;`i`]; REWRITE_TAC[LET_THM]; ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(REWRITE_RULE[arith `i < 2 <=> i = 0 \/ i = 1`]); ANTS_TAC; FIRST_X_ASSUM DISJ_CASES_TAC; RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[arith `0+x = x`;Appendix.cstab]; BY(REAL_ARITH_TAC); RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[arith `1+x = SUC x`;Appendix.cstab;SUC_EXPLICIT]; BY(REAL_ARITH_TAC); DISCH_THEN (ASSUME_TAC o GSYM); COMMENT "relabel vars"; TYPIFY `?v1 v2 v3 v4. ( let y1 = norm v1 in let y2 = norm v2 in let y3 = norm v3 in let y4 = dist(v2,v3) in let y5 = dist(v1,v3) in let y6 = dist(v1,v2) in let y7 = norm v4 in let y8 = dist(v3,v4) in let y9 = dist(v2,v4) in let y0 = enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 in ({v1,v2,v3,v4} SUBSET ball_annulus /\ tau3 (vv i) (vv (i + 1)) (vv (i + 2)) + tau3 (vv (i + 2)) (vv (i + 3)) (vv i) = tau3 v1 v2 v3 + tau3 v4 v2 v3 /\ y4 <= y0 /\ cstab <= y4 /\ y0 < &4 /\ y9 = cstab /\ y8 = &2 /\ y5 = &2 /\ y6 = &2 /\ y0 = dist(v1,v4)))` (C SUBGOAL_THEN MP_TAC); FIRST_X_ASSUM DISJ_CASES_TAC; ASM_REWRITE_TAC[LET_THM;arith `0+x = x`]; FIRST_X_ASSUM (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); RULE_ASSUM_TAC (REWRITE_RULE[arith `0 + x = x`]); GEXISTL_TAC [`vv 3`;`vv 0`;`vv 2`;`vv 1`]; ASM_REWRITE_TAC[]; ONCE_REWRITE_TAC[enclosed_sym2]; ONCE_REWRITE_TAC[enclosed_sym]; ASM_REWRITE_TAC[]; CONJ_TAC; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[SUBSET;IN_INSERT;NOT_IN_EMPTY]; BY(FIRST_X_ASSUM_ST `ball_annulus` MP_TAC THEN MESON_TAC[]); CONJ_TAC; BY(ASM_MESON_TAC[tau3_sym;arith `a + b = b + a`]); RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[]; FIRST_X_ASSUM MATCH_MP_TAC; REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]; BY(REAL_ARITH_TAC); COMMENT "second case relabel"; ASM_REWRITE_TAC[LET_THM;arith `1+x = SUC x`;SUC_EXPLICIT]; FIRST_X_ASSUM (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); RULE_ASSUM_TAC (REWRITE_RULE[arith `1 + x = SUC x`;SUC_EXPLICIT]); FIRST_X_ASSUM_ST `vv 4 = vv 0` (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); GEXISTL_TAC [`vv 2`;`vv 1`;`vv 3`;`vv 0`]; ASM_REWRITE_TAC[]; ONCE_REWRITE_TAC[enclosed_sym]; FIRST_X_ASSUM_ST `enclosed` MP_TAC; ASM_REWRITE_TAC[]; DISCH_THEN SUBST1_TAC; CONJ_TAC; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[SUBSET;IN_INSERT;NOT_IN_EMPTY]; BY(FIRST_X_ASSUM_ST `ball_annulus` MP_TAC THEN MESON_TAC[]); CONJ_TAC; BY(MESON_TAC[tau3_sym]); FIRST_X_ASSUM_ST `<=` MP_TAC; RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[]; DISCH_THEN (unlist REWRITE_TAC); FIRST_X_ASSUM MATCH_MP_TAC; REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]; BY(REAL_ARITH_TAC); COMMENT "final kill"; FIRST_X_ASSUM_ST `main_nonlinear_terminal_v11` MP_TAC; REPEAT (FIRST_X_ASSUM kill); REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(ONCE_REWRITE_RULE[ISPEC `(a:real) = b` (GSYM I_THM)]); REPEAT (GMATCH_SIMP_TAC tau3_taum_40); RULE_ASSUM_TAC(REWRITE_RULE[INSERT_SUBSET]) THEN ASM_REWRITE_TAC[DIST_SYM]; CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab;I_THM] THEN REAL_ARITH_TAC); CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab;I_THM] THEN REAL_ARITH_TAC); MATCH_MP_TAC (arith `x < y ==> x <= y`); COMMENT "get"; MP_TAC (UNDISCH quad_4680581274_derived); REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REWRITE_TAC[Sphere.tauq]; DISCH_THEN MATCH_MP_TAC; TYPIFY `dist(v1,v4)` EXISTS_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[I_THM] THEN DISCH_THEN (fun t -> RULE_ASSUM_TAC(REWRITE_RULE[t]) THEN SUBST1_TAC t); TYPIFY `&0 <= delta_y (dist (v1,v4)) (dist (v2,v4)) (dist (v3,v4)) (dist (v2,v3)) (dist (v1,v3)) (dist (v1,v2))` (C SUBGOAL_THEN (unlist REWRITE_TAC)); TYPIFY `dist (v1,v4) = dist(v4,v1) /\ dist(v2,v4) = dist(v4,v2) /\ dist(v3,v4) = dist(v4,v3)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(MESON_TAC[DIST_SYM]); BY(REWRITE_TAC[DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC(REWRITE_RULE[I_THM;Appendix.cstab;Fnjlbxs.in_ball_annulus]) THEN ASM_REWRITE_TAC[Appendix.cstab;arith `#2.0= &2`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *) (* deprecated 2013-06-17: let terminal_adhoc_quad_7697147739_empty = prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = mk_unadorned_v39 4 ( #0.616 - #0.11) (funlist_v39 [(0,1),sqrt8; (0,2),cstab; (1,3),cstab] (&2) 4) (funlist_v39 [(0,1),sqrt8; (0,2),&6; (1,3),&6] (&2) 4) in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))`, (* {{{ proof *) [ REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_THM]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] (UNDISCH terminal_quad_lemma)); COMMENT "sqrt8 bounds"; TYPIFY `#2.828427 < sqrt8 /\ sqrt8 < #2.828428` (C SUBGOAL_THEN ASSUME_TAC); BY(REWRITE_TAC[Flyspeck_constants.bounds]); TYPIFY `&2 <= sqrt8` (C SUBGOAL_THEN ASSUME_TAC); BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC); COMMENT "digression"; TYPIFY `(!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &2 <= funlist_v39 [(0,1),sqrt8; (0,2),cstab; (1,3),cstab] (&2) 4 i j) ` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REPEAT WEAKER_STRIP_TAC; BY(((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;FUNLIST_EXPLICIT;arith `&2 <= &2 /\ &2 <= &3`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Appendix.cstab;arith `&2 <= #3.01`])) THEN TRY (ASM_MESON_TAC[])); COMMENT "conj1"; CONJ_TAC; BY(ASM_MESON_TAC[arith `&2 <= x ==> &0 < x`]); REPEAT WEAKER_STRIP_TAC; COMMENT "prep dist"; TYPIFY `(!i j d. d <= funlist_v39 [(0,1),sqrt8; (0,2),cstab; (1,3),cstab] (&2) 4 i j ==> d <= dist (vv i,vv j)) /\ (!i j d. funlist_v39 [(0,1),sqrt8; (0,2),&6; (1,3),&6] (&2) 4 i j <= d ==> dist (vv i,vv j) <= d)` ((C SUBGOAL_THEN MP_TAC)); BY(ASM_MESON_TAC[REAL_LE_TRANS]); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[arith `x + &0 = x /\ &4 - &2 = &2`]; TYPIFY `(!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j)` (C SUBGOAL_THEN ASSUME_TAC); REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; BY(ASM_MESON_TAC[DIST_REFL;REAL_LE_TRANS;arith `~(&2 <= &0)`]); COMMENT "vv"; TYPIFY `vv 4 = vv 0 /\ vv 5 = vv 1 /\ vv 6 = vv 2` (C SUBGOAL_THEN ASSUME_TAC); BY((REPEAT CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); ASM_REWRITE_TAC[]; INTRO_TAC vv_quad_split_short [`vv`]; ASM_REWRITE_TAC[LET_THM]; COMMENT "dist"; TYPIFY `(!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j))` (C SUBGOAL_THEN ASSUME_TAC); MATCH_MP_TAC periodic2_mod_reduce; TYPIFY `4` EXISTS_TAC; REWRITE_TAC[Appendix.periodic2;arith `~(4 = 0)`]; TYPIFY `!i. vv (i + 4) = vv i` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_MESON_TAC[Oxl_def.periodic;arith `~(4 = 0)`]); REPEAT WEAKER_STRIP_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS]); ASM_REWRITE_TAC[]; COMMENT "edge lengths"; TYPIFY `I(dist(vv 0,vv 1) = sqrt8 /\ dist(vv 1,vv 2) = &2 /\ dist(vv 2, vv 3) = &2 /\ dist(vv 0,vv 3) = &2)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[I_DEF]; REWRITE_TAC[arith `d = c <=> d <= c /\ c <= d`]; FIRST_X_ASSUM kill; BY((REPEAT CONJ_TAC THEN FIRST_X_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT;Appendix.cstab] THEN TRY REAL_ARITH_TAC)); TYPIFY `dist(vv 1,vv 0) = dist(vv 0,vv 1) /\ dist (vv 2, vv 0) = dist(vv 0,vv 2) /\ dist(vv 3,vv 0) = dist (vv 0, vv 3) /\ dist (vv 2,vv 1) = dist (vv 1, vv 2) /\ dist (vv 3,vv 2) = dist (vv 2, vv 3) /\ dist(vv 3,vv 1)=dist(vv 1,vv 3)` (C SUBGOAL_THEN ASSUME_TAC); BY(MESON_TAC[DIST_SYM]); DISCH_TAC; COMMENT "diags"; TYPIFY `dist(vv 0,vv 2) < &4` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC delta_7697147739 [`dist(vv 1,vv 3)`;`dist(vv 0,vv 2)`]; ANTS_TAC; CONJ_TAC; (FIRST_X_ASSUM MATCH_MP_TAC) THEN REWRITE_TAC[FUNLIST_EXPLICIT;Appendix.cstab;MOD_4_EXPLICIT;arith `~(1 = 3)`]; BY(REAL_ARITH_TAC); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); REWRITE_TAC[arith `~(d < &0) <=> &0 <= d`]; TYPIFY `delta_y (dist (vv 1,vv 3)) (&2) (&2) (dist (vv 0,vv 2)) (&2) sqrt8 = delta_y (dist(vv 3,vv 1)) (dist(vv 3,vv 0)) (dist(vv 3,vv 2)) (dist(vv 0,vv 2)) (dist (vv 1, vv 2)) (dist (vv 1, vv 0))` ENOUGH_TO_SHOW_TAC; DISCH_THEN SUBST1_TAC; BY(REWRITE_TAC[ DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC (REWRITE_RULE[I_THM]); BY(ASM_REWRITE_TAC[]); COMMENT "second diag"; TYPIFY `dist(vv 1,vv 3) < &4` (C SUBGOAL_THEN ASSUME_TAC); PROOF_BY_CONTR_TAC; INTRO_TAC delta_7697147739 [`dist(vv 2,vv 0)`;`dist(vv 1,vv 3)`]; ANTS_TAC; CONJ_TAC; (FIRST_X_ASSUM MATCH_MP_TAC) THEN REWRITE_TAC[FUNLIST_EXPLICIT;Appendix.cstab;MOD_4_EXPLICIT;arith `~(0=2)`]; BY(REAL_ARITH_TAC); BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC); REWRITE_TAC[arith `~(d < &0) <=> &0 <= d`]; TYPIFY `delta_y (dist (vv 2,vv 0)) (&2) (&2) (dist (vv 1,vv 3)) (&2) sqrt8 = delta_y (dist(vv 2,vv 0)) (dist(vv 2,vv 1)) (dist(vv 2,vv 3)) (dist(vv 1,vv 3)) (dist (vv 0, vv 3)) (dist (vv 0, vv 1))` ENOUGH_TO_SHOW_TAC; DISCH_THEN SUBST1_TAC; BY(REWRITE_TAC[ DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC (REWRITE_RULE[I_THM]); BY(ASM_REWRITE_TAC[]); FIRST_X_ASSUM_ST `rho_fun` MP_TAC; ANTS_TAC; RULE_ASSUM_TAC (REWRITE_RULE[I_THM]) THEN ASM_REWRITE_TAC[]; BY(REPEAT (FIRST_X_ASSUM_ST `sqrt8 < c` MP_TAC) THEN REAL_ARITH_TAC); REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; COMMENT "enclosed"; INTRO_TAC vv_enclosed4 [`vv`;`i`]; REWRITE_TAC[LET_THM]; ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(REWRITE_RULE[arith `i < 2 <=> i = 0 \/ i = 1`]); ANTS_TAC; FIRST_X_ASSUM DISJ_CASES_TAC; RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[arith `0+x = x`;Appendix.cstab]; BY(REPEAT (FIRST_X_ASSUM_ST `sqrt8 < c` MP_TAC) THEN REAL_ARITH_TAC); RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[arith `1+x = SUC x`;Appendix.cstab;SUC_EXPLICIT]; BY(REPEAT (FIRST_X_ASSUM_ST `sqrt8 < c` MP_TAC) THEN REAL_ARITH_TAC); DISCH_THEN (ASSUME_TAC o GSYM); COMMENT "relabel vars"; TYPIFY `?v1 v2 v3 v4. ( let y1 = norm v1 in let y2 = norm v2 in let y3 = norm v3 in let y4 = dist(v2,v3) in let y5 = dist(v1,v3) in let y6 = dist(v1,v2) in let y7 = norm v4 in let y8 = dist(v3,v4) in let y9 = dist(v2,v4) in let y0 = enclosed y1 y5 y6 y4 y2 y3 y7 y8 y9 in ({v1,v2,v3,v4} SUBSET ball_annulus /\ tau3 (vv i) (vv (i + 1)) (vv (i + 2)) + tau3 (vv (i + 2)) (vv (i + 3)) (vv i) = tau3 v1 v2 v3 + tau3 v4 v2 v3 /\ y4 <= y0 /\ cstab <= y4 /\ y0 < &4 /\ y9 = sqrt8 /\ y8 = &2 /\ y5 = &2 /\ y6 = &2 /\ y0 = dist(v1,v4)))` (C SUBGOAL_THEN MP_TAC); FIRST_X_ASSUM DISJ_CASES_TAC; ASM_REWRITE_TAC[LET_THM;arith `0+x = x`]; FIRST_X_ASSUM (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); RULE_ASSUM_TAC (REWRITE_RULE[arith `0 + x = x`]); GEXISTL_TAC [`vv 3`;`vv 0`;`vv 2`;`vv 1`]; ASM_REWRITE_TAC[]; ONCE_REWRITE_TAC[enclosed_sym2]; ONCE_REWRITE_TAC[enclosed_sym]; ASM_REWRITE_TAC[]; CONJ_TAC; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[SUBSET;IN_INSERT;NOT_IN_EMPTY]; BY(FIRST_X_ASSUM_ST `ball_annulus` MP_TAC THEN MESON_TAC[]); CONJ_TAC; BY(ASM_MESON_TAC[tau3_sym;arith `a + b = b + a`]); RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[]; FIRST_X_ASSUM MATCH_MP_TAC; REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]; BY(REAL_ARITH_TAC); COMMENT "second case relabel"; ASM_REWRITE_TAC[LET_THM;arith `1+x = SUC x`;SUC_EXPLICIT]; FIRST_X_ASSUM (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); RULE_ASSUM_TAC (REWRITE_RULE[arith `1 + x = SUC x`;SUC_EXPLICIT]); FIRST_X_ASSUM_ST `vv 4 = vv 0` (RULE_ASSUM_TAC o (unlist REWRITE_RULE)); GEXISTL_TAC [`vv 2`;`vv 1`;`vv 3`;`vv 0`]; ASM_REWRITE_TAC[]; ONCE_REWRITE_TAC[enclosed_sym]; FIRST_X_ASSUM_ST `enclosed` MP_TAC; ASM_REWRITE_TAC[]; DISCH_THEN SUBST1_TAC; CONJ_TAC; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[SUBSET;IN_INSERT;NOT_IN_EMPTY]; BY(FIRST_X_ASSUM_ST `ball_annulus` MP_TAC THEN MESON_TAC[]); CONJ_TAC; BY(MESON_TAC[tau3_sym]); FIRST_X_ASSUM_ST `<=` MP_TAC; RULE_ASSUM_TAC(REWRITE_RULE[I_THM]); ASM_REWRITE_TAC[]; DISCH_THEN (unlist REWRITE_TAC); FIRST_X_ASSUM MATCH_MP_TAC; REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]; BY(REAL_ARITH_TAC); COMMENT "final kill"; FIRST_X_ASSUM_ST `main_nonlinear_terminal_v11` MP_TAC; FIRST_X_ASSUM_ST `sqrt8 < c` MP_TAC; REPEAT (FIRST_X_ASSUM kill); REWRITE_TAC[LET_THM]; REPEAT WEAKER_STRIP_TAC; ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(ONCE_REWRITE_RULE[ISPEC `(a:real) = b` (GSYM I_THM)]); REPEAT (GMATCH_SIMP_TAC tau3_taum_40); RULE_ASSUM_TAC(REWRITE_RULE[INSERT_SUBSET]) THEN ASM_REWRITE_TAC[DIST_SYM]; CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab;I_THM] THEN REAL_ARITH_TAC); CONJ_TAC; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REWRITE_TAC[Appendix.cstab;I_THM] THEN REAL_ARITH_TAC); MATCH_MP_TAC (arith `x < y ==> x <= y`); COMMENT "get"; MP_TAC (UNDISCH quad_7697147739_derived); REWRITE_TAC[Sphere.ineq;TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REWRITE_TAC[Sphere.tauq]; DISCH_THEN MATCH_MP_TAC; TYPIFY `dist(v1,v4)` EXISTS_TAC; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[I_THM] THEN DISCH_THEN (fun t -> RULE_ASSUM_TAC(REWRITE_RULE[t]) THEN SUBST1_TAC t); TYPIFY `&0 <= delta_y (dist (v1,v4)) (dist (v2,v4)) (dist (v3,v4)) (dist (v2,v3)) (dist (v1,v3)) (dist (v1,v2))` (C SUBGOAL_THEN (unlist REWRITE_TAC)); TYPIFY `dist (v1,v4) = dist(v4,v1) /\ dist(v2,v4) = dist(v4,v2) /\ dist(v3,v4) = dist(v4,v3)` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(MESON_TAC[DIST_SYM]); BY(REWRITE_TAC[DELTA_Y_POS_4POINTS]); RULE_ASSUM_TAC(REWRITE_RULE[I_THM;Appendix.cstab;Fnjlbxs.in_ball_annulus]) THEN ASM_REWRITE_TAC[Appendix.cstab;arith `#2.0= &2`]; BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC) ]);; (* }}} *) *)
let empty_4T4  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_4T4 in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_4T4]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_THM]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] (UNDISCH terminal_quad_lemma)); COMMENT "digression";
TYPIFY `(!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &2 <= funlist_v39 [(0,1),&2 * h0; (0,2),sqrt8; (1,3),sqrt8] (&2) 4 i j)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[TAUT `(a \/ b) \/ c <=> a \/ b \/ c`;arith `~(i = k /\ j = k /\ ~(i = (j:num)))`]; REPEAT WEAKER_STRIP_TAC; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[FUNLIST_EXPLICIT;arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 <= &2 /\ &2 <= &3`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Sphere.h0] THEN MP_TAC sqrt8_flyspeck THEN TRY REAL_ARITH_TAC)); COMMENT "digress2"; TYPIFY `!i j. (i=0 /\ j=1) \/ (i=0 /\ j=3) \/ (i=1 /\ j=2) \/ (i=1 /\ j=3) \/ (i=2 /\ j=3) ==> funlist_v39 [(0,1),sqrt8; (0,2),&6; (1,3),cstab] (&2 * h0) 4 i j < &4` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[TAUT `(a \/ b) \/ c <=> a \/ b \/ c`;arith `~(i = k /\ j = k /\ ~(i = (j:num)))`]; REWRITE_TAC[Appendix.cs_adj;Sphere.h0]; REPEAT WEAKER_STRIP_TAC; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[FUNLIST_EXPLICIT;arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 * #1.26 < &4 /\ &3 < &4`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Sphere.cstab] THEN MP_TAC sqrt8_flyspeck THEN TRY REAL_ARITH_TAC)); CONJ_TAC; BY(ASM_MESON_TAC[arith `&2 <= x ==> &0 < x`]); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[arith `x + &0 = x /\ &4 - &2 = &2`]; TYPIFY `(!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j)` (C SUBGOAL_THEN ASSUME_TAC); REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; BY(ASM_MESON_TAC[DIST_REFL;REAL_LE_TRANS;arith `~(&2 <= &0)`]); COMMENT "vv"; TYPIFY `vv 4 = vv 0 /\ vv 5 = vv 1 /\ vv 6 = vv 2` (C SUBGOAL_THEN ASSUME_TAC); BY((REPEAT CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC (REWRITE_RULE[LET_THM] vv_quad_split123); ASM_REWRITE_TAC[]; COMMENT "dist"; SUBCONJ_TAC; TYPIFY `(!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j))` (C SUBGOAL_THEN ASSUME_TAC); MATCH_MP_TAC periodic2_mod_reduce; TYPIFY `4` EXISTS_TAC; REWRITE_TAC[Appendix.periodic2;arith `~(4 = 0)`]; TYPIFY `!i. vv (i + 4) = vv i` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_MESON_TAC[Oxl_def.periodic;arith `~(4 = 0)`]); REPEAT WEAKER_STRIP_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS]); ASM_REWRITE_TAC[]; BY(ASM_MESON_TAC[REAL_LET_TRANS]); REPEAT WEAKER_STRIP_TAC; COMMENT "tau3"; REPEAT (GMATCH_SIMP_TAC tau3_taum_40); ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[DIST_SYM]; TYPIFY `dist (vv 3,vv 0) < &4 ` (C SUBGOAL_THEN (unlist REWRITE_TAC)); ONCE_REWRITE_TAC[DIST_SYM]; BY(ASM_REWRITE_TAC[]); REWRITE_TAC[TAUT `a /\ b /\ c <=> (a /\ b) /\ c`]; CONJ_TAC; FIRST_X_ASSUM (REPEAT o GMATCH_SIMP_TAC); FIRST_X_ASSUM_ST `i < 4` MP_TAC; BY(MESON_TAC[arith `1 < 4 /\ 2 < 4 /\ 3 < 4 /\ 0 < 4 /\ ~(2=3) /\ ~(2 =1) /\ ~(1 =0) /\ ~(1 = 3) /\ ~(3=0 ) /\ ~(1 = 2)`]); COMMENT "prep dist"; TYPED_ABBREV_TAC `a = funlist_v39 [(0,1),&2 * h0; (0,2),sqrt8; (1,3),sqrt8] (&2) 4`; TYPED_ABBREV_TAC `b = funlist_v39 [(0,1),sqrt8; (0,2),&6; (1,3),cstab] (&2 * h0) 4`; TYPIFY `(!i j d. d <= a i j ==> d <= dist (vv i,vv j)) /\ (!i j d. b i j <= d ==> dist (vv i,vv j) <= d)` (C SUBGOAL_THEN MP_TAC); BY(ASM_MESON_TAC[REAL_LE_TRANS]); REPEAT WEAKER_STRIP_TAC; TYPIFY `a 1 0 = &2 * h0 /\ a 2 1 = &2 /\ a 2 3 = &2 /\ a 3 0 = &2 /\ a 1 3 = sqrt8 /\ b 1 0 = sqrt8 /\ b 2 1 = &2 * h0 /\ b 2 3 = &2 * h0 /\ b 3 0 = &2 * h0 /\ b 1 3 = cstab` (C SUBGOAL_THEN ASSUME_TAC); EXPAND_TAC "a"; EXPAND_TAC "b"; BY(REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]); RULE_ASSUM_TAC(REWRITE_RULE[Fnjlbxs.in_ball_annulus]); TYPIFY `#2.52 = &2 * h0` (C SUBGOAL_THEN ASSUME_TAC); BY(REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); COMMENT "fist get"; INTRO_TAC (get_main_nonlinear "5405130650") [`norm (vv 0)`;`norm (vv 3)`;`norm (vv 1)`;`dist(vv 3,vv 1)`;`dist(vv 0,vv 1)`;`dist(vv 0,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REWRITE_TAC[arith `(d < &0) <=> ~(&0 <= d)`]; REWRITE_TAC[REWRITE_RULE[LET_THM] Tame_lemmas.delta_y_pos]; ASM_REWRITE_TAC[DIST_SYM;arith `#2.0 = &2`]; ANTS_TAC; BY((REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN TRY REAL_ARITH_TAC)); DISCH_TAC; COMMENT "second get"; INTRO_TAC (get_main_nonlinear "3603097872") [`norm (vv 2)`;`norm (vv 3)`;`norm (vv 1)`;`dist(vv 3,vv 1)`;`dist(vv 2,vv 1)`;`dist(vv 2,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; REWRITE_TAC[arith `(d < &0) <=> ~(&0 <= d)`]; REWRITE_TAC[REWRITE_RULE[LET_THM] Tame_lemmas.delta_y_pos]; ASM_REWRITE_TAC[DIST_SYM;arith `#2.0 = &2`]; ANTS_TAC; BY((REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN TRY REAL_ARITH_TAC)); COMMENT "final kill"; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[DIST_SYM]; TYPIFY `taum (norm (vv 0)) (norm (vv 3)) (norm (vv 1)) (dist (vv 1,vv 3)) (dist (vv 1,vv 0)) (dist (vv 3,vv 0)) = taum (norm (vv 3)) (norm (vv 0)) (norm (vv 1)) (dist (vv 1,vv 0)) (dist (vv 1,vv 3)) (dist (vv 3,vv 0)) /\ taum (norm (vv 2)) (norm (vv 3)) (norm (vv 1)) (dist (vv 1,vv 3)) (dist (vv 2,vv 1)) (dist (vv 2,vv 3)) = taum (norm (vv 1)) (norm (vv 2)) (norm (vv 3)) (dist (vv 2,vv 3)) (dist (vv 1,vv 3)) (dist (vv 2,vv 1))` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); BY(REAL_ARITH_TAC); BY(REWRITE_TAC[(* Terminal. *) taum_sym]) ]);; (* }}} *)
let empty_4T5  = 
prove_by_refinement( `main_nonlinear_terminal_v11 ==> (let s = scs_4T5 in (!vv. BBs_v39 s vv ==> &0 <= taustar_v39 s vv))`,
(* {{{ proof *) [ REWRITE_TAC[Appendix.scs_4T5]; REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[LET_THM]; MATCH_MP_TAC (REWRITE_RULE[LET_THM] (UNDISCH terminal_quad_lemma)); COMMENT "digression";
TYPED_ABBREV_TAC `a = funlist_v39 [(0,1),&2 * h0; (0,2),cstab; (1,3),cstab] (&2) 4`; TYPED_ABBREV_TAC `b = funlist_v39 [(0,1),cstab; (0,2),&6; (1,3),cstab] (&2 * h0) 4`; TYPIFY `(!i j. i < 4 /\ j < 4 /\ ~(i = j) ==> &2 <= a i j)` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[TAUT `(a \/ b) \/ c <=> a \/ b \/ c`;arith `~(i = k /\ j = k /\ ~(i = (j:num)))`]; REPEAT WEAKER_STRIP_TAC; EXPAND_TAC "a"; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[FUNLIST_EXPLICIT;arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 <= &2 /\ &2 <= &3`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Sphere.h0;Sphere.cstab] THEN MP_TAC sqrt8_flyspeck THEN TRY REAL_ARITH_TAC)); COMMENT "digress2"; TYPIFY `!i j. (i=0 /\ j=1) \/ (i=0 /\ j=3) \/ (i=1 /\ j=2) \/ (i=1 /\ j=3) \/ (i=2 /\ j=3) ==> b i j < &4` (C SUBGOAL_THEN ASSUME_TAC); REWRITE_TAC[arith `i < 4 <=> (i = 0 \/ i = 1 \/ i = 2 \/ i = 3)`]; REWRITE_TAC[TAUT `(a \/ b) /\ c <=> a /\ c \/ b /\ c`;TAUT `a /\ (b \/ c) <=> (a /\ b) \/ a /\ c`]; REWRITE_TAC[TAUT `(a \/ b) \/ c <=> a \/ b \/ c`;arith `~(i = k /\ j = k /\ ~(i = (j:num)))`]; EXPAND_TAC "b"; REPEAT WEAKER_STRIP_TAC; BY((REPEAT (FIRST_X_ASSUM DISJ_CASES_TAC) THEN ASM_REWRITE_TAC[FUNLIST_EXPLICIT;arith `SUC 0 = 1 /\ SUC 1 = 2 /\ SUC 2 = 3 /\ SUC 3 = 4`;MOD_4_EXPLICIT;arith `&2 * #1.26 < &4 /\ &3 < &4`;arith `~(0=1) /\ ~(0=2) /\ ~(0=3) /\ ~(1 =2) /\ ~(1 = 3) /\ ~(2 = 3)`;Sphere.cstab;Sphere.h0] THEN MP_TAC sqrt8_flyspeck THEN TRY REAL_ARITH_TAC)); CONJ_TAC; BY(ASM_MESON_TAC[arith `&2 <= x ==> &0 < x`]); REPEAT WEAKER_STRIP_TAC; REWRITE_TAC[arith `x + &0 = x /\ &4 - &2 = &2`]; TYPIFY `(!i j. i < 4 /\ j < 4 /\ vv i = vv j ==> i = j)` (C SUBGOAL_THEN ASSUME_TAC); REPEAT WEAKER_STRIP_TAC; PROOF_BY_CONTR_TAC; BY(ASM_MESON_TAC[DIST_REFL;REAL_LE_TRANS;arith `~(&2 <= &0)`]); COMMENT "vv"; TYPIFY `vv 4 = vv 0 /\ vv 5 = vv 1 /\ vv 6 = vv 2` (C SUBGOAL_THEN ASSUME_TAC); BY((REPEAT CONJ_TAC) THEN GMATCH_SIMP_TAC periodic_vv_inj THEN TYPIFY `4` EXISTS_TAC THEN ASM_REWRITE_TAC[MOD_4_EXPLICIT;arith `~(4 = 0)`]); ASM_REWRITE_TAC[]; GMATCH_SIMP_TAC (REWRITE_RULE[LET_THM] vv_quad_split123); ASM_REWRITE_TAC[]; COMMENT "dist"; SUBCONJ_TAC; TYPIFY `(!i j. ~(vv i = vv j) ==> &2 <= dist (vv i,vv j))` (C SUBGOAL_THEN ASSUME_TAC); MATCH_MP_TAC periodic2_mod_reduce; TYPIFY `4` EXISTS_TAC; REWRITE_TAC[Appendix.periodic2;arith `~(4 = 0)`]; TYPIFY `!i. vv (i + 4) = vv i` (C SUBGOAL_THEN (unlist REWRITE_TAC)); BY(ASM_MESON_TAC[Oxl_def.periodic;arith `~(4 = 0)`]); REPEAT WEAKER_STRIP_TAC; BY(ASM_MESON_TAC[REAL_LE_TRANS]); ASM_REWRITE_TAC[]; BY(ASM_MESON_TAC[REAL_LET_TRANS]); REPEAT WEAKER_STRIP_TAC; COMMENT "tau3"; REPEAT (GMATCH_SIMP_TAC tau3_taum_40); ASM_REWRITE_TAC[]; RULE_ASSUM_TAC(REWRITE_RULE[IMAGE_SUBSET_IN;IN_UNIV]); ASM_REWRITE_TAC[DIST_SYM]; TYPIFY `dist (vv 3,vv 0) < &4 ` (C SUBGOAL_THEN (unlist REWRITE_TAC)); ONCE_REWRITE_TAC[DIST_SYM]; BY(ASM_REWRITE_TAC[]); REWRITE_TAC[TAUT `a /\ b /\ c <=> (a /\ b) /\ c`]; CONJ_TAC; FIRST_X_ASSUM (REPEAT o GMATCH_SIMP_TAC); FIRST_X_ASSUM_ST `i < 4` MP_TAC; BY(MESON_TAC[arith `1 < 4 /\ 2 < 4 /\ 3 < 4 /\ 0 < 4 /\ ~(2=3) /\ ~(2 =1) /\ ~(1 =0) /\ ~(1 = 3) /\ ~(3=0 ) /\ ~(1 = 2)`]); COMMENT "prep dist"; TYPIFY `(!i j d. d <= a i j ==> d <= dist (vv i,vv j)) /\ (!i j d. b i j <= d ==> dist (vv i,vv j) <= d)` (C SUBGOAL_THEN MP_TAC); BY(ASM_MESON_TAC[REAL_LE_TRANS]); REPEAT WEAKER_STRIP_TAC; TYPIFY `a 1 0 = &2 * h0 /\ a 2 1 = &2 /\ a 2 3 = &2 /\ a 3 0 = &2 /\ a 1 3 = cstab /\ b 1 0 = cstab /\ b 2 1 = &2 * h0 /\ b 2 3 = &2 * h0 /\ b 3 0 = &2 * h0 /\ b 1 3 = cstab` (C SUBGOAL_THEN ASSUME_TAC); EXPAND_TAC "a"; EXPAND_TAC "b"; BY(REWRITE_TAC[FUNLIST_EXPLICIT;MOD_4_EXPLICIT]); RULE_ASSUM_TAC(REWRITE_RULE[Fnjlbxs.in_ball_annulus]); TYPIFY `#2.52 = &2 * h0` (C SUBGOAL_THEN ASSUME_TAC); BY(REWRITE_TAC[Sphere.h0] THEN REAL_ARITH_TAC); INTRO_TAC (get_main_nonlinear "9096461391") [`norm (vv 1)`;`norm (vv 3)`;`norm (vv 0)`;`dist(vv 3,vv 0)`;`dist(vv 1,vv 0)`;`dist(vv 1,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ASM_REWRITE_TAC[DIST_SYM;arith `#2.0 = &2`]; ANTS_TAC; BY((REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN TRY REAL_ARITH_TAC)); DISCH_TAC; COMMENT "second get"; INTRO_TAC (get_main_nonlinear "2445657182") [`norm (vv 1)`;`norm (vv 3)`;`norm (vv 2)`;`dist(vv 3,vv 2)`;`dist(vv 1,vv 2)`;`dist(vv 1,vv 3)`]; REWRITE_TAC[Sphere.ineq]; REWRITE_TAC[TAUT `(a ==> b==> c) <=> (a /\ b) ==> c `;TAUT `(a /\ b) /\ c <=> a /\ b /\ c`]; ASM_REWRITE_TAC[DIST_SYM;arith `#2.0 = &2`]; ANTS_TAC; BY((REPEAT CONJ_TAC THEN (FIRST_X_ASSUM MATCH_MP_TAC) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[Sphere.h0;Sphere.cstab] THEN TRY REAL_ARITH_TAC)); COMMENT "final kill"; FIRST_X_ASSUM MP_TAC; REWRITE_TAC[DIST_SYM]; TYPIFY `taum (norm (vv 1)) (norm (vv 3)) (norm (vv 0)) (dist (vv 3,vv 0)) (dist (vv 1,vv 0)) (dist (vv 1,vv 3)) = taum (norm (vv 3)) (norm (vv 0)) (norm (vv 1)) (dist (vv 1,vv 0)) (dist (vv 1,vv 3)) (dist (vv 3,vv 0)) /\ taum (norm (vv 1)) (norm (vv 3)) (norm (vv 2)) (dist (vv 2,vv 3)) (dist (vv 2,vv 1)) (dist (vv 1,vv 3)) = taum (norm (vv 1)) (norm (vv 2)) (norm (vv 3)) (dist (vv 2,vv 3)) (dist (vv 1,vv 3)) (dist (vv 2,vv 1))` ENOUGH_TO_SHOW_TAC; DISCH_THEN (unlist REWRITE_TAC); BY(REAL_ARITH_TAC); BY(REWRITE_TAC[(* Terminal. *)taum_sym]) ]);; (* }}} *) end;;