(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Chapter: Local Fan *)
(* Author: Hoang Le Truong *)
(* Date: 2012-04-01 *)
(* ========================================================================= *)
(*
remaining conclusions from appendix to Local Fan chapter
*)
module Hexagons = 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_lemmas1;;
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;;
open Mtuwlun;;
open Uxckfpe;;
open Sgtrnaf;;
open Yxionxl;;
open Qknvmlb;;
open Odxlstcv2;;
open Yxionxl2;;
open Eyypqdw;;
open Ocbicby;;
open Imjxphr;;
open Nuxcoea;;
open Aursipd;;
open Cuxvzoz;;
open Rrcwnsj;;
open Tfitskc;;
let PSORT_5_EXPLICIT=prove(`
psort 5 (0,0)= (0,0)/\
psort 5 (1,1)= (1,1)/\
psort 5 (2,2)= (2,2)/\
psort 5 (3,3)= (3,3)/\
psort 5 (4,4)= (4,4)/\
psort 5 (0,1)= (0,1)/\
psort 5 (0,2)= (0,2)/\
psort 5 (0,3)= (0,3)/\
psort 5 (0,4)= (0,4)/\
psort 5 (1,0)= (0,1)/\
psort 5 (1,2)= (1,2)/\
psort 5 (1,3)= (1,3)/\
psort 5 (1,4)= (1,4)/\
psort 5 (2,0)= (0,2)/\
psort 5 (2,1)= (1,2)/\
psort 5 (2,3)= (2,3)/\
psort 5 (2,4)= (2,4)/\
psort 5 (3,0)= (0,3)/\
psort 5 (3,1)= (1,3)/\
psort 5 (3,2)= (2,3)/\
psort 5 (3,4)= (3,4)/\
psort 5 (4,0)= (0,4)/\
psort 5 (4,1)= (1,4)/\
psort 5 (4,2)= (2,4)/\
psort 5 (4,3)= (3,4)/\
psort 5 (4,5)= (0,4)/\
psort 4 (3,4)= (0,3)/\
psort 3 (2,0)= (0,2)/\
psort 3 (2,1)= (1,2)/\
psort 3 (1,0)= (0,1)`,
REWRITE_TAC[psort;Uxckfpe.ARITH_3_TAC;Uxckfpe.ARITH_5_TAC;Uxckfpe.ARITH_4_TAC;
LET_DEF;
LET_END_DEF;
MOD_5_EXPLICIT;ARITH_RULE`0<=a/\ ~(1<= 0)/\ ~(2<=0)/\ ~(3<=0)/\ ~(4<=0)/\a<=a/\ ~(2<=1)/\ ~(3<=2)/\ ~(4<=3)/\ ~(3<=1)/\ ~(4<=1)/\ ~(4<=2)/\ 2<=3`]);;
let scs_5M3 = new_definition`scs_5M3 = mk_unadorned_v39 5 (#0.616)
(funlist_v39 [(0,1),(&2*h0);(0,2),(cstab);(0,3),(cstab);(1,3),(cstab);(1,4),(cstab);(2,4),(cstab)] (&2) 5)
(funlist_v39 [(0,1),cstab;(0,2),(&6); (0,3),(&6); (1,3),(&6); (1,4),(&6); (2,4),(&6)] (&2*h0) 5)`;;
let SCS_TAC= ASM_SIMP_TAC[scs_basic;is_scs_v39;mk_unadorned_v39;scs_v39_explicit;CS_ADJ;d_tame;REAL_ARITH`#0.712 < #0.9`;periodic;SET_RULE`{} j <=> {} i`;periodic2;scs_basic;unadorned_v39;scs_prop_equ_v39;LET_DEF;LET_END_DEF;scs_stab_diag_v39;scs_half_slice_v39;
Uxckfpe.ARITH_3_TAC;Uxckfpe.ARITH_6_TAC;Uxckfpe.ARITH_4_TAC;Uxckfpe.ARITH_5_TAC;
scs_5M1;scs_3M1;scs_6I1;scs_3T1;scs_4M2;scs_6M1;scs_6T1;scs_5I1;scs_5I2;scs_5I3;scs_5M2;scs_4M6;scs_3T4;scs_5M3;
Terminal.FUNLIST_EXPLICIT;Yrtafyh.PSORT_PERIODIC;PSORT_5_EXPLICIT;
ARITH_RULE`SUC 0=1/\ SUC 1=2/\ SUC 2=3/\ SUC 3=4/\ SUC 4=5/\ SUC 5=6/\ SUC 6=7/\ SUC 7=8`];;
(******is_scs*********)
let MOD_PERIODIC=prove(`~(k=0) ==> (i+k) MOD k = i MOD k/\ SUC (i+k) MOD k= SUC i MOD k`,
STRIP_TAC
THEN ONCE_REWRITE_TAC[ARITH_RULE`i+k= 1*k+i`;]
THEN SIMP_TAC[
MOD_MULT_ADD;ARITH_RULE`SUC (1 * k + i) =(1 * k + SUC i)`]);;
let SCS_6I1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_6I1`,
[
REWRITE_TAC[
scs_6I1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<6/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.712 < #0.9`;periodic;SET_RULE`{} (i + 6) <=> {} i`;periodic2;]
THEN SIMP_TAC[ARITH_RULE`~(6=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC
;
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
REAL_ARITH_TAC;
REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`~(6=0)`;
MOD_LT;h0]
THEN REAL_ARITH_TAC;
REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY]
THEN ARITH_TAC]);;
let SCS_3M1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_3M1`,
[SIMP_TAC[
scs_3M1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<6/\a<=a/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.103 < #0.9`;periodic;SET_RULE`{} (i + j) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
ARITH_TAC;
SCS_TAC;
SCS_TAC;
SCS_TAC;
SCS_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+3= 1*3+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 3= j MOD 3\/ ~(i MOD 3= j MOD 3)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 3= j MOD 3\/ ~(i MOD 3= j MOD 3)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 3= j MOD 3\/ ~(i MOD 3= j MOD 3)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[
MOD_LT;h0]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[
MOD_LT;cstab;h0]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[
MOD_LT;cstab;h0]
THEN REAL_ARITH_TAC;
MRESAS_TAC
CARD_SUBSET[`{i | i < 3 /\
(&2 * h0 <
funlist_v39 [(0,1),cstab] (&2 * h0) 3 i (SUC i) \/
&2 <
funlist_v39 [(0,1),&2 * h0] (&2) 3 i (SUC i))}`;`0..2`][
FINITE_NUMSEG;
CARD_NUMSEG;ARITH_RULE`(2+1)-0=3/\ (a+3<=6 <=> a<=3)`]
THEN MATCH_DICH_TAC 0
THEN REWRITE_TAC[
SUBSET;
IN_ELIM_THM;
IN_NUMSEG]
THEN ARITH_TAC]);;
let SCS_5M1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_5M1`,
[
SIMP_TAC[
scs_5M1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=5/\ 5<=6/\a<=a/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.616 < #0.9`;periodic;SET_RULE`{} (i + 5) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
POP_ASSUM MP_TAC
THEN ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT;Qknvmlb.SUC_MOD_NOT_EQ;ARITH_RULE`1<5`]
THEN SUBGOAL_THEN`{i | i < 5 /\
(&2 * #1.26 < (if psort 5 (i,SUC i) = 0,1 then #3.01 else &2 * #1.26) \/
&2 < (if psort 5 (i,SUC i) = 0,1 then &2 * #1.26 else &2))} ={0}`ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_SING;ARITH_RULE`x<5<=> x=0\/ x=1\/x=2\/ x=3\/ x=4`]
THEN GEN_TAC
THEN EQ_TAC
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
PSORT_5_EXPLICIT;ARITH_RULE`SUC 1=2`;
PAIR_EQ;Uxckfpe.ARITH_5_TAC;REAL_ARITH`~(a<a)/\ &2 * #1.26 < #3.01 `];
ASM_REWRITE_TAC[Geomdetail.CARD_SING]
THEN ARITH_TAC]);;
let SCS_5I1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_5I1`,
[
REWRITE_TAC[
scs_5I1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(5=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=5/\ 5<=6/\a<=a/\ ~(5=4)/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.4819 < #0.9`;periodic;SET_RULE`{} (i + 5) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY]
THEN ARITH_TAC]);;
let SCS_5I2_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_5I2`,
[
REWRITE_TAC[
scs_5I2;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(5=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=5/\ 5<=6/\a<=a/\ ~(5=4)/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.616 < #0.9`;periodic;SET_RULE`{} (i + 5) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`]
THEN MP_TAC(SET_RULE`(j MOD 5 = SUC i MOD 5 \/ SUC j MOD 5 = i MOD 5)\/ ~(j MOD 5 = SUC i MOD 5 \/ SUC j MOD 5 = i MOD 5)`)
THEN RESA_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`];
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN MP_TAC(SET_RULE`(j = SUC i MOD 5 \/ SUC j MOD 5 = i )\/ ~(j = SUC i MOD 5 \/ SUC j MOD 5 = i)`)
THEN RESA_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`;
LE_sqrt8_2];
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY]
THEN ARITH_TAC]);;
let SCS_5I3_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_5I3`,
[
REWRITE_TAC[
scs_5I3;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(5=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=5/\ 5<=6/\a<=a/\ ~(5=4)/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.616 < #0.9`;periodic;SET_RULE`{} (i + 5) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)/\ SUC (1 * 5 + i)= 1*5+ SUC i`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN MRESA_TAC Terminal.psort_sym[`5`;`i`;`j`];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN MRESA_TAC Terminal.psort_sym[`5`;`i`;`j`];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN MRESA_TAC Terminal.psort_sym[`5`;`i`;`j`];
SCS_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`]
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`;
LE_sqrt8_2h0]
THEN MP_TAC(SET_RULE`psort 5 (i,j) = 0,1\/ ~(psort 5 (i,j) = 0,1)`)
THEN RESA_TAC
THEN SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`;
LE_sqrt8_2h0]
THEN REAL_ARITH_TAC;
SCS_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`;
LE_sqrt8_2h0;
MOD_LT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
sqrt8_LE_6;REAL_ARITH`&2<= &2 * #1.26/\ a<=a`;
LE_sqrt8_2h0;
MOD_LT]
THEN MP_TAC(SET_RULE`i MOD 5 = SUC i MOD 5\/ ~(i MOD 5 = SUC i MOD 5)`)
THEN RESA_TAC
THEN REWRITE_TAC[REAL_ARITH`&0 <= #3.01`]
THEN MP_TAC(SET_RULE`psort 5 (i,SUC i) = 0,1\/ ~(psort 5 (i,SUC i) = 0,1)`)
THEN RESA_TAC
THEN REWRITE_TAC[
sqrt8_LE_CSTAB]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT;Qknvmlb.SUC_MOD_NOT_EQ;ARITH_RULE`1<5`]
THEN SUBGOAL_THEN`{i | i < 5 /\
(&2 * #1.26 < (if psort 5 (i,SUC i) = 0,1 then sqrt8 else &2 * #1.26) \/
&2 < (if psort 5 (i,SUC i) = 0,1 then &2 * #1.26 else &2))}
={0}`ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_SING;ARITH_RULE`x<5<=> x=0\/ x=1\/x=2\/ x=3\/ x=4`]
THEN GEN_TAC
THEN EQ_TAC
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
PSORT_5_EXPLICIT;ARITH_RULE`SUC 1=2`;
PAIR_EQ;Uxckfpe.ARITH_5_TAC;REAL_ARITH`~(a<a)/\ &2 * #1.26 < #3.01 `;
LT_sqrt8_2h0];
ASM_REWRITE_TAC[Geomdetail.CARD_SING]
THEN ARITH_TAC]);;
let SCS_5M2_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_5M2`,
[
SIMP_TAC[
scs_5M2;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=5/\ 5<=6/\a<=a/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.616 < #0.9`;periodic;SET_RULE`{} (i + 5) <=> {} i`;periodic2;ARITH_RULE`~(3=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+5= 1*5+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 5= j MOD 5\/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
POP_ASSUM MP_TAC
THEN ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT;Qknvmlb.SUC_MOD_NOT_EQ;ARITH_RULE`1<5`]
THEN SUBGOAL_THEN`{i | i < 5 /\
(&2 * #1.26 < (if psort 5 (i,SUC i) = 0,1 then #3.01 else &2 * #1.26) \/
&2 < (if psort 5 (i,SUC i) = 0,1 then &2 else &2))} ={0}`ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_SING;ARITH_RULE`x<5<=> x=0\/ x=1\/x=2\/ x=3\/ x=4`]
THEN GEN_TAC
THEN EQ_TAC
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
PSORT_5_EXPLICIT;ARITH_RULE`SUC 1=2`;
PAIR_EQ;Uxckfpe.ARITH_5_TAC;REAL_ARITH`~(a<a)/\ &2 * #1.26 < #3.01 `];
ASM_REWRITE_TAC[Geomdetail.CARD_SING]
THEN ARITH_TAC]);;
let SCS_4M2_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_4M2`,
[
SIMP_TAC[
scs_4M2;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<=4/\ 4<=6/\a<=a/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.3789 < #0.9`;periodic;SET_RULE`{} (i + 4) <=> {} i`;periodic2;ARITH_RULE`~(4=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`i+4= 1*4+i/\ ~(3=0)`;
MOD_MULT_ADD];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 4= j MOD 4\/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 4= j MOD 4\/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN MP_TAC(SET_RULE`i MOD 4= j MOD 4\/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[];
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
POP_ASSUM MP_TAC
THEN ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`4`][
scs_diag;Uxckfpe.ARITH_4_TAC;Terminal.FUNLIST_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`4`][
scs_diag;Uxckfpe.ARITH_4_TAC;Terminal.FUNLIST_EXPLICIT]
THEN REAL_ARITH_TAC;
SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`4`][
scs_diag;Uxckfpe.ARITH_4_TAC;Terminal.FUNLIST_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`4`][
scs_diag;Uxckfpe.ARITH_4_TAC;Terminal.FUNLIST_EXPLICIT;Qknvmlb.SUC_MOD_NOT_EQ;ARITH_RULE`1<4`]
THEN SUBGOAL_THEN`{i | i < 4 /\
(&2 * #1.26 < (if psort 4 (i,SUC i) = 0,1 then #3.01 else &2 * #1.26) \/
&2 < (if psort 4 (i,SUC i) = 0,1 then &2 * #1.26 else &2))} ={0}`ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_SING;ARITH_RULE`x<4<=> x=0\/ x=1\/x=2\/ x=3`]
THEN GEN_TAC
THEN EQ_TAC
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[Terminal.FUNLIST_EXPLICIT;ARITH_RULE`SUC 1=2`;
PAIR_EQ;Uxckfpe.ARITH_4_TAC;REAL_ARITH`~(a<a)/\ &2 * #1.26 < #3.01 `;
PSORT_5_EXPLICIT];
ASM_REWRITE_TAC[Geomdetail.CARD_SING]
THEN ARITH_TAC;]);;
let SCS_6M1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_6M1`,
[
REWRITE_TAC[
scs_6M1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<6/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.712 < #0.9`;periodic;SET_RULE`{} (i + 6) <=> {} i`;periodic2;]
THEN SIMP_TAC[ARITH_RULE`~(6=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
REAL_ARITH_TAC;
REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`~(6=0)`;
MOD_LT;h0;cstab]
THEN REAL_ARITH_TAC;
REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY]
THEN ARITH_TAC]);;
let SCS_6T1_IS_SCS=prove_by_refinement(`
is_scs_v39 scs_6T1`,
[
REWRITE_TAC[
scs_6T1;
is_scs_v39;
mk_unadorned_v39;scs_v39_explicit;
CS_ADJ;]
THEN REWRITE_TAC[
ARITH_RULE`~(6=3)/\ 6-1=5/\ 3<=6/\ 6<=6/\ ~(6=4)/\ ~(6=5)/\ 3<6/\a<=a/\ ~(6=0)`;
d_tame;REAL_ARITH`#0.712 < #0.9`;]
THEN SIMP_TAC[periodic;SET_RULE`{} (i + 6) <=> {} i`
;periodic2;ARITH_RULE`~(6=0)`;
MOD_PERIODIC]
THEN REPEAT RESA_TAC;
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a=b<=> b=a`]
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`a\/b<=> b\/a`]
THEN REWRITE_TAC[];
REWRITE_TAC[h0;cstab]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[h0;cstab;
MOD_LT]
THEN REAL_ARITH_TAC;
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;]
THEN REWRITE_TAC[REAL_ARITH`~(a<a)/\ ~(&2 * #1.26 < &2)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;h0]
THEN ARITH_TAC]);;
(***************)
(******************)
(******************)
(*******************)
let DIST_PSORT=prove(`periodic v (k)/\ ~(k=0) /\ psort (k) (i,j) = psort (k) (i',j')
==>
dist (v i',v j')=
dist (v i,v j)`,
REWRITE_TAC[psort;
LET_DEF;
LET_END_DEF;]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(SET_RULE`i MOD k<= j MOD k\/ ~(i MOD k<= j MOD k)`)
THEN RESA_TAC
THEN MP_TAC(SET_RULE`i' MOD k<= j' MOD k\/ ~(i' MOD k<= j' MOD k)`)
THEN RESA_TAC
THEN REWRITE_TAC[
PAIR_EQ]
THEN RESA_TAC
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`k`;`v`][ARITH_RULE`~(4=0)`;periodic]
THEN THAYTHEL_ASM_TAC 0[`i`][]
THEN THAYTHEL_ASM_TAC 0[`i'`][]
THEN THAYTHEL_ASM_TAC 0[`j`][]
THEN THAYTHEL_ASM_TAC 0[`j'`][]
THEN SIMP_TAC[
DIST_SYM]);;
let DIAD_PSORT_IMP_DIAD=prove_by_refinement(`
scs_diag k i j /\ ~(k=0)
/\ psort k (i',j') = psort k (i,j)
==>
scs_diag k i' j'`,
[REWRITE_TAC[
scs_diag;psort;
LET_DEF;
LET_END_DEF]
THEN STRIP_TAC
THEN DICH_TAC 0
THEN MP_TAC(SET_RULE`i MOD k<= j MOD k\/ ~(i MOD k<= j MOD k)`)
THEN RESA_TAC
THEN MP_TAC(SET_RULE`i' MOD k<= j' MOD k\/ ~(i' MOD k<= j' MOD k)`)
THEN RESA_TAC
THEN REWRITE_TAC[
PAIR_EQ]
THEN RESA_TAC;
MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`i'`;`i`;`k`]
THEN MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`j'`;`j`;`k`] ;
MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`i'`;`j`;`k`]
THEN MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`j'`;`i`;`k`] ;
MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`i'`;`j`;`k`]
THEN MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`j'`;`i`;`k`] ;
MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`i'`;`i`;`k`]
THEN MRESA_TAC Zithlqn.IMP_SUC_MOD_EQ[`j'`;`j`;`k`] ]);;
(****************************)
(****************************)
(****************************)
(****************************)
let BB_6I1_IS_BB_6M1=prove_by_refinement(`
BBs_v39 scs_6I1 v/\ (!i j.
scs_diag 6 i j ==> cstab <=
dist(v i,v j)) ==>
BBs_v39 scs_6M1 v`,
[
SIMP_TAC[
scs_basic;
LET_DEF;
LET_END_DEF;
BBs_v39;
scs_stab_diag_v39;scs_v39_explicit;
mk_unadorned_v39;
scs_6I1;
scs_6M1;
CS_ADJ;
scs_diag]
THEN REPEAT RESA_TAC
THEN MP_TAC(SET_RULE`i MOD 6= j MOD 6\/ ~(i MOD 6= j MOD 6)`)
THEN RESA_TAC;
THAYTHE_TAC (5-2)[`i`;`j`];
MP_TAC(SET_RULE`SUC i MOD 6= j MOD 6\/ ~(SUC i MOD 6= j MOD 6)`)
THEN RESA_TAC;
THAYTHE_TAC (6-2)[`i`;`j`];
MP_TAC(SET_RULE`i MOD 6= SUC j MOD 6\/ ~(i MOD 6= SUC j MOD 6)`)
THEN RESA_TAC;
THAYTHE_TAC (7-2)[`i`;`j`];
THAYTHE_TAC (7-4)[`i`;`j`];
THAYTHE_TAC (5-2)[`i`;`j`];
MP_TAC(SET_RULE`SUC i MOD 6= j MOD 6\/ ~(SUC i MOD 6= j MOD 6)`)
THEN RESA_TAC;
THAYTHE_TAC (6-2)[`i`;`j`];
MP_TAC(SET_RULE`i MOD 6= SUC j MOD 6\/ ~(i MOD 6= SUC j MOD 6)`)
THEN RESA_TAC;
THAYTHE_TAC (7-2)[`i`;`j`];
THAYTHE_TAC (7-4)[`i`;`j`]]);;
(****************************)
(****************************)
(****************************)
(****************************)
(* }}} *)
(****************************)
(****************************)
(****************************)
(****************************)
(****************************)
(****************************)
(****************************)
(****************************)
(***************)
(*********CARD scs_M <=1**************)
let CARD_SCS_M_6M1=prove(`
CARD (
scs_M scs_6M1) <= 1`,
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN ARITH_TAC);;
let SCS_M_6M1=prove(`(
scs_M scs_6M1) ={}`,
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN ARITH_TAC);;
let SCS_M_6T1=prove(`(
scs_M scs_6T1) ={}`,
ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)/\ ~(&2 * #1.26 < &2)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M;h0]
THEN ARITH_TAC);;
let CARD_SCS_M_5I1=prove(`
CARD (
scs_M scs_5I1) <= 1`,
ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN ARITH_TAC);;
let SCS_M_5I1=prove(`
scs_M scs_5I1 ={}`,
ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN ARITH_TAC);;
let SCS_M_5M2=prove(`
scs_M scs_5M2 ={0}`,
ASM_SIMP_TAC[ARITH_RULE`1<5`;Qknvmlb.SUC_MOD_NOT_EQ;REAL_ARITH`~(a<a)`;SET_RULE`{i | F}={}`;Oxl_2012.CARD_EMPTY;
scs_M]
THEN SCS_TAC
THEN ASM_SIMP_TAC[h0;cstab;]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`2`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`0`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`1`;`3`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT]
THEN MRESAS_TAC Yrtafyh.DIAG_NOT_PSORT[`2`;`4`;`5`][
scs_diag;Uxckfpe.ARITH_5_TAC;
PSORT_5_EXPLICIT;Qknvmlb.SUC_MOD_NOT_EQ;ARITH_RULE`1<5`]
THEN REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_SING;ARITH_RULE`x<5<=> x=0\/ x=1\/x=2\/ x=3\/ x=4`]
THEN GEN_TAC
THEN EQ_TAC
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
PSORT_5_EXPLICIT;ARITH_RULE`SUC 1=2`;
PAIR_EQ;Uxckfpe.ARITH_5_TAC;REAL_ARITH`~(a<a)/\ &2 * #1.26 < #3.01 `];
);;
(*********************)
(****************************)
(****************************)
(****************************)
(****************************)
let DIAG_EQ_ADD=prove(`
scs_diag 6 (i MOD 6) (j MOD 6)<=>
((i MOD 6= (j MOD 6+ 2) MOD 6)\/ (i MOD 6= (j MOD 6+ 3) MOD 6)\/
(j MOD 6=(i MOD 6+2) MOD 6)\/ (j MOD 6= (i MOD 6+ 3) MOD 6))`,
REWRITE_TAC[
scs_diag]
THEN MP_TAC(ARITH_RULE`i MOD 6<6==> i MOD 6= 0 \/ i MOD 6= 1 \/i MOD 6= 2 \/
i MOD 6= 3 \/i MOD 6= 4 \/i MOD 6= 5
`)
THEN ASM_SIMP_TAC[
DIVISION;ARITH_RULE`~(6=0)`]
THEN RESA_TAC
THEN 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 ASM_SIMP_TAC[
DIVISION;ARITH_RULE`~(6=0)`]
THEN RESA_TAC
THEN ARITH_TAC);;
let PSORT_EQ_SYM1=prove(`psort (
scs_k_v39 s) (j,i) = (j',i')
<=> psort (
scs_k_v39 s) (i,j) = (j',i')`,
GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[Terminal.psort_sym]
THEN REWRITE_TAC[]);;
let EQ_DIAG_STAB_6I1_02=prove(`
scs_arrow_v39
{
scs_stab_diag_v39 scs_6I1 (i + 2) i }
{
scs_stab_diag_v39 scs_6I1 0 2}`,
MRESA_TAC
STAB_SYM[`
scs_6I1`;`2`;`0`]
THEN MP_TAC (GEN_ALL Wkeidft.WKEIDFT)
THEN REWRITE_TAC[
LET_DEF;
LET_END_DEF]
THEN STRIP_TAC
THEN MATCH_DICH_TAC 0
THEN ASM_SIMP_TAC[ARITH_RULE`2 + i = (i + 2) + 0/\ 3<6/\ i+1= SUC i`;
K_SCS_6I1;
h0_LT_B_SCS_6I1;
h0_EQ_B_SCS_6I1;
SCS_6I1_IS_SCS;
SCS_6I1_BASIC]
THEN SCS_TAC
THEN ASM_SIMP_TAC[ARITH_RULE`1<6`;Qknvmlb.SUC_MOD_NOT_EQ;]
THEN EXISTS_TAC`&0`
THEN EXISTS_TAC`&2`
THEN EXISTS_TAC`&2 *h0`
THEN EXISTS_TAC`&2 *h0`
THEN EXISTS_TAC`&6`
THEN ASM_SIMP_TAC[
scs_diag;ARITH_RULE`SUC (i + 2)= i+3/\ SUC i= i+1/\ 2+1=3`;ARITH_RULE`1<6/\ ~(6=0)`;Qknvmlb.SUC_MOD_NOT_EQ;Ocbicby.MOD_EQ_MOD_SHIFT]
THEN SCS_TAC
THEN MP_TAC(SET_RULE`i= i+0==> i MOD 6= (i+0) MOD 6`)
THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o DEPTH_CONV)[ARITH_RULE`x+0=x`]
THEN RESA_TAC
THEN ASM_SIMP_TAC[Ocbicby.MOD_EQ_MOD_SHIFT;ARITH_RULE`1<6/\ ~(6=0)`]
THEN SCS_TAC);;
end;;
(*
let check_completeness_claimA_concl =
Ineq.mk_tplate `\x. scs_arrow_v13 (set_of_list x)
*)