(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Chapter: Local Fan *)
(* Author: Hoang Le Truong *)
(* Date: 2012-04-01 *)
(* ========================================================================= *)
(*
remaining conclusions from appendix to Local Fan chapter
*)
module Cqaoqlr = 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 K_SUC_2_MOD_SUB=prove(`1<k ==> (k - SUC ((i + 2) MOD k) + 1) MOD k= (k- SUC((i+1) MOD k)) MOD k`,
SIMP_TAC[GSYM
ADD1;]
THEN STRIP_TAC
THEN ASM_SIMP_TAC [
SUC_MOD_EQ_MOD_SUC;ARITH_RULE`1<k ==> SUC (k - SUC ((i + 2) MOD k)) = k- (i+2) MOD k`;ARITH_RULE`i+2=SUC(SUC i)`]);;
let K_SUC_2_MOD_SUB_ID=prove(`1<k ==> (k - SUC ((i + 2) MOD k) + 2) MOD k= (k- SUC((i) MOD k)) MOD k`,
SIMP_TAC[GSYM
ADD1;]
THEN STRIP_TAC
THEN ASM_SIMP_TAC [
SUC_MOD_EQ_MOD_SUC;ARITH_RULE`1<k ==> SUC (k - SUC ((i + 2) MOD k)) = k- (i+2) MOD k`;ARITH_RULE`i+2=SUC(SUC i)`
]
THEN MRESA_TAC
SUC_MOD_EQ_MOD_SUC[`SUC i`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (SUC i) MOD k`;`k`]
THEN SYM_ASSUM_TAC
THEN SYM_ASSUM_TAC
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (SUC i MOD k)`;`k`]
THEN ASM_SIMP_TAC[ARITH_RULE`1<k==>SUC (k - SUC (SUC i MOD k))=k - SUC i MOD k`]
);;
let SUC_OPP_ID=prove(`1<k ==> SUC (k - SUC i MOD k) MOD k= (k- i MOD k) MOD k`,
STRIP_TAC
THEN MRESA_TAC
SUC_MOD_EQ_MOD_SUC[`(i)`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (i) MOD k`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`SUC(k - SUC ( i) MOD k)`;`k`]
THEN SYM_ASSUM_TAC
THEN SYM_ASSUM_TAC
THEN SYM_ASSUM_TAC
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (i MOD k)`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`SUC(k - SUC (i MOD k))`;`k`]
THEN ASM_SIMP_TAC[ARITH_RULE`1<k==>SUC (k - SUC (i MOD k))=k - i MOD k`]);;
let K_SUC_2_MOD_F_SUB_ID=prove(`1<k ==> (k - SUC ((i + 2) MOD k) + 3) MOD k= (k- SUC((i+k-1) MOD k)) MOD k`,
SIMP_TAC[GSYM
ADD1;]
THEN STRIP_TAC
THEN ASM_SIMP_TAC [
SUC_MOD_EQ_MOD_SUC;ARITH_RULE`1<k ==> SUC (k - SUC ((i + 2) MOD k)) = k- (i+2) MOD k`;ARITH_RULE`i+2=SUC(SUC i)/\ i+3=SUC(i+2)`
]
THEN MRESA_TAC
SUC_MOD_EQ_MOD_SUC[`(SUC i)`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (SUC i) MOD k`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`SUC(k - SUC (SUC i) MOD k)`;`k`]
THEN SYM_ASSUM_TAC
THEN SYM_ASSUM_TAC
THEN SYM_ASSUM_TAC
THEN MRESA_TAC
MOD_SUC_MOD[`k - SUC (SUC i MOD k)`;`k`]
THEN MRESA_TAC
MOD_SUC_MOD[`SUC(k - SUC (SUC i MOD k))`;`k`]
THEN ASM_SIMP_TAC[ARITH_RULE`1<k==>SUC (k - SUC (SUC i MOD k))=k - SUC i MOD k/\ SUC (i + k - 1)= 1*k+i`;
SUC_OPP_ID;
MOD_MULT_ADD]);;
let DIAG_OPP=prove_by_refinement(`3<k /\
scs_diag k i j ==>
scs_diag k (k - SUC (i MOD k)) (k - SUC (j MOD k))`,
[REWRITE_TAC[
scs_diag]
THEN REPEAT RESA_TAC;
DICH_TAC 3
THEN REWRITE_TAC[]
THEN MP_TAC(ARITH_RULE`3<k==> ~(k=0)`)
THEN RESA_TAC
THEN MRESA_TAC
OPP_SUC_MOD[`i`;`k`]
THEN MRESA_TAC
OPP_SUC_MOD[`j`;`k`];
DICH_TAC 1
THEN REWRITE_TAC[]
THEN MP_TAC(ARITH_RULE`3<k==> ~(k=0)/\ 1<k/\ SUC (k - SUC (i MOD k))= k- i MOD k/\ SUC (k - SUC (SUC (k - SUC i MOD k) MOD k))
=(k - (SUC (k - SUC i MOD k) MOD k))`)
THEN RESA_TAC
THEN MRESA_TAC
OPP_SUC_MOD[`j`;`k`]
THEN POP_ASSUM MP_TAC
THEN DICH_TAC 4
THEN RESA_TAC
THEN SYM_ASSUM_TAC
THEN MRESA_TAC
SUC_OPP_ID[`i`;`k`]
THEN SYM_ASSUM_TAC
THEN MRESAS_TAC Zithlqn.IMP_SUC_MOD_EQ[`k - SUC (SUC (k - SUC i MOD k) MOD k)`;`j`;`k`][
MOD_REFL;]
THEN STRIP_TAC
THEN DICH_TAC 1
THEN ASM_SIMP_TAC[
MOD_REFL;GSYM
SUC_MOD_EQ_MOD_SUC;
OPP_SUC_MOD];
DICH_TAC 2
THEN POP_ASSUM(fun th-> ASSUME_TAC(SYM
th))
THEN REWRITE_TAC[]
THEN MP_TAC(ARITH_RULE`3<k==> ~(k=0)/\ 1<k/\ SUC (k - SUC (j MOD k))= k- j MOD k/\ SUC (k - SUC (SUC (k - SUC j MOD k) MOD k))
=(k - (SUC (k - SUC j MOD k) MOD k))`)
THEN RESA_TAC
THEN MRESA_TAC
OPP_SUC_MOD[`i`;`k`]
THEN POP_ASSUM MP_TAC
THEN DICH_TAC 4
THEN RESA_TAC
THEN SYM_ASSUM_TAC
THEN MRESA_TAC
SUC_OPP_ID[`j`;`k`]
THEN SYM_ASSUM_TAC
THEN MRESAS_TAC Zithlqn.IMP_SUC_MOD_EQ[`k - SUC (SUC (k - SUC j MOD k) MOD k)`;`i`;`k`][
MOD_REFL;]
THEN STRIP_TAC
THEN DICH_TAC 1
THEN ASM_SIMP_TAC[
MOD_REFL;GSYM
SUC_MOD_EQ_MOD_SUC;
OPP_SUC_MOD]]);;
let CQAOQLR_concl =
`main_nonlinear_terminal_v11
==> (!s (v:num->real^3) i.
3< scs_k_v39 s/\
is_scs_v39 s /\ v IN MMs_v39 s /\ scs_generic v /\ scs_basic_v39 s /\
(!i j. scs_diag (scs_k_v39 s) i j ==> (scs_a_v39 s i j <= cstab /\ cstab < dist(v i, v j)/\ &4 * h0 < scs_b_v39 s i j)) /\
&2< scs_b_v39 s i (i+1) /\ &2< scs_b_v39 s (i+1) (i+2)/\
scs_a_v39 s (i+2) (i+3)< scs_b_v39 s (i+2) (i+3) /\
scs_a_v39 s (i+ scs_k_v39 s -1) i< scs_b_v39 s (i+scs_k_v39 s -1) i
==>
scs_a_v39 s (i) (i+1) = &2 /\ scs_b_v39 s (i) (i+1) <= &2 * h0 /\
scs_a_v39 s (i+1) (i+2) = &2 /\ scs_b_v39 s (i+1) (i+2) <= &2 * h0 ==>
(dist(v i,v (i+1)) = &2 <=> dist(v(i+1),v(i+2)) = &2))`;;
end;;
(*
let check_completeness_claimA_concl =
Ineq.mk_tplate `\x. scs_arrow_v13 (set_of_list x)
*)