(* ========================================================================== *) (* FLYSPECK - BOOK FORMALIZATION *) (* *) (* Chapter: Local Fan *) (* Author: Hoang Le Truong *) (* Date: 2012-04-01 *) (* ========================================================================= *) (* remaining conclusions from appendix to Local Fan chapter *) module Uxckfpe = struct open Polyhedron;; open Sphere;; open Topology;; open Fan_misc;; open Planarity;; open Conforming;; open Hypermap;; open Fan;; open Topology;; open Wrgcvdr_cizmrrh;; open Local_lemmas;; open Collect_geom;; open Dih2k_hypermap;; open Wjscpro;; open Tecoxbm;; open Hdplygy;; open Nkezbfc_local;; open Flyspeck_constants;; open Gbycpxs;; open Pcrttid;; open Local_lemmas;; open Pack_defs;; open Hales_tactic;; open Appendix;; open Hypermap;; open Fan;; open Wrgcvdr_cizmrrh;; open Local_lemmas;; open Flyspeck_constants;; open Pack_defs;; open Hales_tactic;; open Appendix;; open Zithlqn;; open Xwitccn;; open Ayqjtmd;; open Jkqewgv;;let NOT_EMPTY_CASE_4_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ scs_k_v39 s=4 /\ BBs_v39 s vv /\ dimindex(:M)= scs_k_v39 s ==> ~({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v }={})`,let VV_IN_BALL_ANNULUS_TAC_4= fun (so:term)-> REPLICATE_TAC (31-23)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL1_TAC th so[ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=4/\3<=4/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`;IN]) ;; let SCS_A_LE_NORM_4_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=4/\3<=4/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s i`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_4= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 4<4)==> (j MOD 4=0) \/ (j MOD 4=1) \/ (j MOD 4=2)\/ (j MOD 4=3)`) THEN RESA_TAC THENL[ SCS_A_LE_NORM_4_IS_SCS th `4`; SCS_A_LE_NORM_4_IS_SCS th `1`; SCS_A_LE_NORM_4_IS_SCS th `2`; SCS_A_LE_NORM_4_IS_SCS th `3`];; let SCS_B_LE_NORM_4_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=4/\3<=4/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s i`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (4)`][ARITH_RULE`~(4=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_4B= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 4<4)==> (j MOD 4=0) \/ (j MOD 4=1) \/ (j MOD 4=2)\/ (j MOD 4=3)`) THEN RESA_TAC THENL[ SCS_B_LE_NORM_4_IS_SCS th `4`; SCS_B_LE_NORM_4_IS_SCS th `1`; SCS_B_LE_NORM_4_IS_SCS th `2`; SCS_B_LE_NORM_4_IS_SCS th `3`];; let V_SY_EQ_IMAGE_VV_TAC4= fun (th:term)-> ASM_REWRITE_TAC[] THEN EXISTS_TAC th THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN(:num)`;ARITH_4_TAC];; let PROVE_E_SY_EQ_MOD_TAC_4= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_4_TAC] ;; let PROOF_E_EQ_TAC_4= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN (:num)`;ARITH_4_TAC;] ;; let PROVE_E_SY_EQ_IMAGE_VV_4= fun (so:term) (so1:term)-> MRESAL_TAC(GEN_ALL Zithlqn.IMP_SUC_MOD_EQ)[`x':num`;so1;`scs_k_v39 s`][ARITH_4_TAC] THEN EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_4_TAC];;let ARITH_4_TAC =ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=4/\3<=4/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 4=0/\ SUC 0=1/\ 1<=4/\ 4<=4/\ 1+0=1/\ 1 MOD 4=1/\ 1<=1/\ 1<=4/\ 1 MOD 4=1/\ 1+1=2/\ ~(1=0)/\ 2 MOD 4=2/\ SUC 2=3/\ ~(2=0)/\ 1<=2/\ 2<=4/\ 1+2=3/\ 3 MOD 4=3/\ 1<=3/\ 3<=4/\ 1+3=4/\ SUC 3=4/\ ~(3=0)/\ SUC 1=2/\ SUC 4=5/\ 5 MOD 4=1/\ ~(4=0)/\ 0 MOD 4=0`;;(* }}} *)let IN_NOT_EMPTY_B1_SY_4_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ scs_k_v39 s=4 /\ dimindex(:M) = scs_k_v39 s/\ matvec (v:real^3^M) =a/\ (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v /\ (!i. vv i = if i MOD scs_k_v39 s = 0 then row 4 v else if i MOD scs_k_v39 s = 1 then row 1 v else if i MOD scs_k_v39 s = 2 then row 2 v else row 3 v) ==> vv IN BBs_v39 s`,(* }}} *) (*************CASE 5****************)let XWITCCN_CASE_4_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ BBs_v39 s vv /\ scs_k_v39 s=4 /\ dimindex(:M) =scs_k_v39 s /\ taustar_v39 s vv < &0 ==> ~(BBprime_v39 s = {})`,let NOT_EMPTY_CASE_5_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ scs_k_v39 s=5 /\ BBs_v39 s vv /\ dimindex(:M)= scs_k_v39 s ==> ~({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v }={})`,let VV_IN_BALL_ANNULUS_TAC_5= fun (so:term)-> REPLICATE_TAC (31-23)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL1_TAC th so[ARITH_5_TAC;IN]) ;; let SCS_A_LE_NORM_5_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_5_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s i`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_5= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 5<5)==> (j MOD 5=0) \/ (j MOD 5=1) \/ (j MOD 5=2)\/ (j MOD 5=3)\/ (j MOD 5=4)`) THEN RESA_TAC THENL[ SCS_A_LE_NORM_5_IS_SCS th `5`; SCS_A_LE_NORM_5_IS_SCS th `1`; SCS_A_LE_NORM_5_IS_SCS th `2`; SCS_A_LE_NORM_5_IS_SCS th `3`; SCS_A_LE_NORM_5_IS_SCS th `4`];; let SCS_B_LE_NORM_5_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_5_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s i`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (5)`][ARITH_RULE`~(5=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_5B= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 5<5)==> (j MOD 5=0) \/ (j MOD 5=1) \/ (j MOD 5=2)\/ (j MOD 5=3)\/ (j MOD 5=4)`) THEN RESA_TAC THENL[ SCS_B_LE_NORM_5_IS_SCS th `5`; SCS_B_LE_NORM_5_IS_SCS th `1`; SCS_B_LE_NORM_5_IS_SCS th `2`; SCS_B_LE_NORM_5_IS_SCS th `3`; SCS_B_LE_NORM_5_IS_SCS th `4`];; let V_SY_EQ_IMAGE_VV_TAC5= fun (th:term)-> ASM_REWRITE_TAC[] THEN EXISTS_TAC th THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN(:num)`;ARITH_5_TAC];; let PROVE_E_SY_EQ_MOD_TAC_5= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_5_TAC] ;; let PROOF_E_EQ_TAC_5= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN (:num)`;ARITH_5_TAC;] ;; let PROVE_E_SY_EQ_IMAGE_VV_5= fun (so:term) (so1:term)-> MRESAL_TAC(GEN_ALL Zithlqn.IMP_SUC_MOD_EQ)[`x':num`;so1;`scs_k_v39 s`][ARITH_5_TAC] THEN EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_5_TAC];;let ARITH_5_TAC =ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=5/\3<=5/\5<=5 /\ 4<=5/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 6 MOD 5=1/\ SUC 0=1/\ 1<=4/\ 4<=4/\ 1+0=1/\ 1 MOD 5=1/\ 1<=1/\ 1<=4/\ 4 MOD 5=4/\ 1+1=2/\ ~(1=0)/\ 2 MOD 5=2/\ SUC 2=3/\ ~(2=0)/\ 1<=2/\ 2<=4/\ 1+2=3/\ 3 MOD 5=3/\ 1<=3/\ 3<=4/\ 1+3=4/\ SUC 3=4/\ ~(3=0)/\ SUC 1=2/\ SUC 4=5/\ 5 MOD 5=0/\ ~(4=0)/\ 0 MOD 5=0 /\ 1<=5 /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)/\ SUC 5=6/\ ~(5=0) `;;(* }}} *)let IN_NOT_EMPTY_B1_SY_5_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ scs_k_v39 s=5 /\ dimindex(:M) = scs_k_v39 s/\ matvec (v:real^3^M) =a/\ (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v /\ (!i. vv i = if i MOD scs_k_v39 s = 0 then row 5 v else if i MOD scs_k_v39 s = 1 then row 1 v else if i MOD scs_k_v39 s = 2 then row 2 v else if i MOD scs_k_v39 s = 3 then row 3 v else row 4 v) ==> vv IN BBs_v39 s`,(* }}} *) (*************CASE 6****************)let XWITCCN_CASE_5_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ BBs_v39 s vv /\ scs_k_v39 s=5 /\ dimindex(:M) =scs_k_v39 s /\ taustar_v39 s vv < &0 ==> ~(BBprime_v39 s = {})`,let NOT_EMPTY_CASE_6_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ scs_k_v39 s=6 /\ BBs_v39 s vv /\ dimindex(:M)= scs_k_v39 s ==> ~({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v }={})`,let VV_IN_BALL_ANNULUS_TAC_6= fun (so:term)-> REPLICATE_TAC (31-23)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL1_TAC th so[ARITH_6_TAC;IN]) ;; let SCS_A_LE_NORM_6_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_6_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s i`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`6:num`[ARITH_RULE`6 MOD 6=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`6:num`[ARITH_RULE`6 MOD 6=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_6= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 6<6)==> (j MOD 6=0) \/ (j MOD 6=1) \/ (j MOD 6=2)\/ (j MOD 6=3)\/ (j MOD 6=4) \/ (j MOD 6=5)`) THEN RESA_TAC THENL[ SCS_A_LE_NORM_6_IS_SCS th `6`; SCS_A_LE_NORM_6_IS_SCS th `1`; SCS_A_LE_NORM_6_IS_SCS th `2`; SCS_A_LE_NORM_6_IS_SCS th `3`; SCS_A_LE_NORM_6_IS_SCS th `4`; SCS_A_LE_NORM_6_IS_SCS th `5`];; let SCS_B_LE_NORM_6_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (33-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_6_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (34-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s i`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`6:num`[ARITH_RULE`6 MOD 6=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`6:num`[ARITH_RULE`6 MOD 6=0`]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (6)`][ARITH_RULE`~(6=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`6:num`[ARITH_RULE`6 MOD 6=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_6B= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 6<6)==> (j MOD 6=0) \/ (j MOD 6=1) \/ (j MOD 6=2)\/ (j MOD 6=3)\/ (j MOD 6=4) \/ (j MOD 6=5)`) THEN RESA_TAC THENL[ SCS_B_LE_NORM_6_IS_SCS th `6`; SCS_B_LE_NORM_6_IS_SCS th `1`; SCS_B_LE_NORM_6_IS_SCS th `2`; SCS_B_LE_NORM_6_IS_SCS th `3`; SCS_B_LE_NORM_6_IS_SCS th `4`; SCS_B_LE_NORM_6_IS_SCS th `5`];; let V_SY_EQ_IMAGE_VV_TAC6= fun (th:term)-> ASM_REWRITE_TAC[] THEN EXISTS_TAC th THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN(:num)`;ARITH_6_TAC];; let PROVE_E_SY_EQ_MOD_TAC_6= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_6_TAC] ;; let PROOF_E_EQ_TAC_6= fun (so:term)-> EXISTS_TAC so THEN ASM_REWRITE_TAC[SET_RULE`(a:num)IN (:num)`;ARITH_6_TAC;] ;; let PROVE_E_SY_EQ_IMAGE_VV_6= fun (so:term) (so1:term)-> MRESAL_TAC(GEN_ALL Zithlqn.IMP_SUC_MOD_EQ)[`x':num`;so1;`scs_k_v39 s`][ARITH_6_TAC] THEN EXISTS_TAC so THEN ASM_REWRITE_TAC[ARITH_6_TAC];;let ARITH_6_TAC =ARITH_RULE`1<=4/\1<=2/\1<=3/\1<=1/\2<=6/\3<=6/\5<=6 /\ 4<=6/\5<=6/\ 6<=6/\ 1<=6 /\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 6 MOD 5=1/\ SUC 0=1/\ 1<=4/\ 4<=4/\ 1+0=1/\ 1 MOD 6=1/\ 1<=1/\ 1<=4/\ 4 MOD 6=4/\ 1+1=2/\ ~(1=0)/\ 2 MOD 6=2/\ SUC 2=3/\ ~(2=0)/\ 1<=2/\ 2<=4/\ 1+2=3/\ 3 MOD 6=3/\ 1<=3/\ 3<=4/\ 1+3=4/\ SUC 3=4/\ ~(3=0)/\ SUC 1=2/\ SUC 4=5/\ 5 MOD 6=5/\ ~(4=0)/\ 0 MOD 6=0/\ 6 MOD 6=0/\ 7 MOD 6=1 /\ SUC 6=7 /\ 1<=5 /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)/\ SUC 5=6/\ ~(5=0)/\ ~(6=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3)/\ ~(5=4)`;;(* }}} *)let IN_NOT_EMPTY_B1_SY_6_IS_SCS=prove_by_refinement(`is_scs_v39 s /\ scs_k_v39 s=6 /\ dimindex(:M) = scs_k_v39 s/\ matvec (v:real^3^M) =a/\ (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ CONDITION2_SY v /\ (!i. vv i = if i MOD scs_k_v39 s = 0 then row 6 v else if i MOD scs_k_v39 s = 1 then row 1 v else if i MOD scs_k_v39 s = 2 then row 2 v else if i MOD scs_k_v39 s = 3 then row 3 v else if i MOD scs_k_v39 s = 4 then row 4 v else row 5 v) ==> vv IN BBs_v39 s`,(* }}} *) (****************CASE 3**************) let IS_SCS_IN_BALL_ANNULUS_3= fun (so:term)-> REPLICATE_TAC 7 (POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MP_TAC th THEN REWRITE_TAC[IMAGE;SUBSET;IN_ELIM_THM]) THEN STRIP_TAC THEN POP_ASSUM MATCH_MP_TAC THEN EXISTS_TAC so THEN MRESAL_TAC VECTOR_3_3[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=3/\ 2<=3/\ 3<=3/\ 3<=3/\ 3 MOD 3= 0 /\ 1 MOD 3= 1 /\ 2 MOD 3= 2/\ 3 MOD 3= 0/\ ~(2=1) /\ SUC 4 MOD 4= 1 /\ SUC 1 MOD 4= 2 /\ SUC 2 MOD 4= 3/\ SUC 3 MOD 4= 0/\ ~(3=1)/\ ~(1=0)`;SET_RULE`(a:num) IN (:num)`] ;;let XWITCCN_CASE_6_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ BBs_v39 s vv /\ scs_k_v39 s=6 /\ dimindex(:M) =scs_k_v39 s /\ taustar_v39 s vv < &0 ==> ~(BBprime_v39 s = {})`,let IN_IS_SCS_CASE_3=prove_by_refinement( ` is_scs_v39 s /\ scs_k_v39 s=3 /\ BBs_v39 s vv /\ dimindex(:M)= scs_k_v39 s /\ vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 0]:real^3^M= v /\ matvec (v:real^3^M) =a ==> a IN {matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v }`,let VV_IN_BALL_ANNULUS_TAC_3= fun (so:term)-> REPLICATE_TAC (30-23)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL1_TAC th so[ARITH_RULE`1<=3/\1<=2/\1<=3/\1<=1/\2<=3/\3<=3/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`;IN]) ;; let SCS_A_LE_NORM_3_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (32-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_3_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (33-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s i`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`3:num`[ARITH_RULE`3 MOD 3=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_a_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`3:num`[ARITH_RULE`3 MOD 3=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_3= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 3<3)==> (j MOD 3=0) \/ (j MOD 3=1) \/ (j MOD 3=2)`) THEN RESA_TAC THENL[ SCS_A_LE_NORM_3_IS_SCS th `3`; SCS_A_LE_NORM_3_IS_SCS th `1`; SCS_A_LE_NORM_3_IS_SCS th `2`;];; let SCS_B_LE_NORM_3_IS_SCS= fun (so:term) (so1:term)-> REPLICATE_TAC (32-24)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC THEN MRESAL_TAC th [so;so1][ARITH_3_TAC;IN]) THEN ASM_TAC THEN REWRITE_TAC[periodic2] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (33-20)(POP_ASSUM MP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC) THEN ASSUME_TAC th) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s i`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESA1_TAC th`j:num`) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (j MOD scs_k_v39 s)`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`3:num`[ARITH_RULE`3 MOD 3=0`] THEN MRESA1_TAC th`i:num`) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (i MOD scs_k_v39 s)`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`3:num`[ARITH_RULE`3 MOD 3=0`]) THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`scs_k_v39 s`;`scs_b_v39 s (3)`][ARITH_RULE`~(3=0)`;periodic] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`3:num`[ARITH_RULE`3 MOD 3=0`]) THEN REPEAT RESA_TAC ;; let PROVE_INEQUALITY_TAC_3B= fun (th:term)-> MP_TAC(ARITH_RULE`(j MOD 3<3)==> (j MOD 3=0) \/ (j MOD 3=1) \/ (j MOD 3=2)`) THEN RESA_TAC THENL[ SCS_B_LE_NORM_3_IS_SCS th `3`; SCS_B_LE_NORM_3_IS_SCS th `1`; SCS_B_LE_NORM_3_IS_SCS th `2`;];;let ARITH_3_TAC =ARITH_RULE`1<=3/\1<=2/\1<=3/\1<=1/\2<=3/\3<=3/\4<=4/\ ~(1=0)/\ ~(2=0)/\ ~(2=1)/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 0 MOD 3=0/\ 1 MOD 3=1/\ 2 MOD 3=2/\ 3 MOD 3=0/\ SUC 0=1 /\ SUC 1=2/\ SUC 2=3/\ SUC 3=4/\ 0<3/\ a+0=a/\ 0+a=a/\ 3-1=2/\ 3-2=1/\ 3-0=3/\ 3-3=0`;;(* }}} *)let IN_NOT_EMPTY_B1_SY_3_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ scs_k_v39 s=3 /\ dimindex(:M) = scs_k_v39 s/\ matvec (v:real^3^M) =a/\ (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v /\ (!i. vv i = if i MOD scs_k_v39 s = 0 then row 3 v else if i MOD scs_k_v39 s = 1 then row 1 v else row 2 v) ==> vv IN BBs_v39 s`,let NOT_EMPTY_CASE_3_IS_SCS=prove_by_refinement( ` is_scs_v39 s /\ scs_k_v39 s=3 /\ BBs_v39 s vv /\ dimindex(:M)= scs_k_v39 s ==> ~({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v }={})`,let J1_TS=new_definition `J1_TS (s:tri_sy)= {x| ?i. {i MOD 3,f_ts s (i MOD (3))} IN J_TS s /\ i IN 1..3 /\ x=i,SUC(i MOD (3))}`;;let d_fun3=new_definition `d_fun3 (s1:scs_v39)(s:tri_sy,l:real^(M,3)finite_product) = (d_ts s) + #0.1 * (if is_ear_v39 s1 then &1 else -- &1) * sum (J1_TS s) (\x. cstab -norm (row (FST x) (vecmats l) - row (SND x) (vecmats l) ))`;;let CONTINUOUS_ON_D_FUN3=prove(`!s:tri_sy . k=3 /\ k_ts s =k /\ dimindex(:M) =k/\ I_TS s= 0..k-1 /\ f_ts s=(\i. ((1+i):num MOD k)) ==> lift o(\l:real^(M,3)finite_product. d_fun3 s1 (s,l)) continuous_on ( {matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (a_ts s) (b_ts s) v })`,(* }}} *)let tri_sy_explicit =prove_by_refinement( `!k d s a b J f. tri_stable k d s a b J f ==> k_ts (tri_sy (k,d,s, a,b,J,f)) = k/\ d_ts (tri_sy (k,d,s, a,b,J,f)) = d /\ a_ts (tri_sy (k,d,s, a,b,J,f)) = a /\ b_ts (tri_sy (k,d,s, a,b,J,f)) = b /\ J_TS (tri_sy (k,d,s, a,b,J,f)) = J /\ I_TS (tri_sy (k,d,s, a,b,J,f)) = s /\ f_ts (tri_sy (k,d,s, a,b,J,f)) = f `,(* }}} *)let IN_B_SY1_COLLINEAR_CASE_3_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ scs_k_v39 s=3/\ dimindex(:M)= scs_k_v39 s ==> (!a. a IN {matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY (change_type_v3 (scs_a_v39 s)) (change_type_v3 (scs_b_v39 s)) v } ==> ~collinear{vec 0, row 1 (vecmats a),row 2 (vecmats a)}/\ ~collinear{vec 0, row 1 (vecmats a),row 3 (vecmats a)}/\ ~collinear{vec 0, row 2 (vecmats a),row 3 (vecmats a)})`,(* }}} *)let HDPLYGY_CASE_30=prove_by_refinement( `tri_stable k (d:real) (0..k-1) a b J (\i. ((1+i):num MOD k)) /\k= dimindex(:M) /\ 2<k /\ ~({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY a b v } = {}:real^(M,3)finite_product->bool) /\ (!l. l IN {matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY a b v } ==> ~collinear{vec 0, row 1 (vecmats l),row 2 (vecmats l)}/\ ~collinear{vec 0, row 1 (vecmats l),row 3 (vecmats l)}/\ ~collinear{vec 0, row 2 (vecmats l),row 3 (vecmats l)}) /\ k_ts s = 3 /\ I_TS s = 0..3 - 1 /\ f_ts s = (\i. (1 + i) MOD 3) /\ a_ts s =a /\ b_ts s =b ==> ?x:real^(M,3)finite_product. x IN ({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY a b v }) /\ (!y:real^(M,3)finite_product. y IN ({matvec(v:real^3^M) | (!i. 1<=i /\ i <= dimindex(:M)==> row i v IN ball_annulus) /\ CONDITION1_SY a b v }) ==> tau3 (row 1 (vecmats (x:real^(M,3)finite_product))) (row 2 (vecmats x)) (row 3 ( vecmats x)) - d_fun3 s1 (s,x) <= tau3 (row 1 (vecmats y)) (row 2 (vecmats y)) (row 3 (vecmats y)) - d_fun3 s1 (s,y) )`,let TAUSTAR_EQ_TAU_STAR_3_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ BBs_v39 s vv /\ scs_k_v39 s=3 /\ dimindex (:M)=3 /\ vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 0]:real^3^M= v /\ matvec (v:real^3^M) =a /\ tri_sy((scs_k_v39 s),(scs_d_v39 s),(0..scs_k_v39 s - 1), (change_type_v3 (scs_a_v39 s)), (change_type_v3 (scs_b_v39 s)), (change_type_v2 (scs_J_v39 s) (scs_k_v39 s)), (\i. (1 + i) MOD scs_k_v39 s))=s1 ==> taustar_v39 s vv = tau3 (vv 1) (vv 2) (vv 0) -d_fun3 s (s1,a)`,(* }}} *)let XWITCCN_CASE_3_IS_SCS=prove_by_refinement( `is_scs_v39 s /\ BBs_v39 s vv /\ scs_k_v39 s=3 /\ dimindex(:M) =scs_k_v39 s /\ taustar_v39 s vv < &0 ==> ~(BBprime_v39 s = {})`,end;; (* let check_completeness_claimA_concl = Ineq.mk_tplate `\x. scs_arrow_v13 (set_of_list x) *)let UXCKFPE=prove_by_refinement( ` !s vv . is_scs_v39 s /\ vv IN BBs_v39 s /\ taustar_v39 s vv < &0 ==> ~(BBprime_v39 s = {})`,