1 (* ========================================================================== *)
2 (* FLYSPECK - BOOK FORMALIZATION *)
4 (* Chapter: Local Fan *)
5 (* Author: Hoang Le Truong *)
7 (* ========================================================================= *)
11 remaining conclusions from appendix to Local Fan chapter
15 module Lkgrqui = struct
28 open Wrgcvdr_cizmrrh;;
36 open Flyspeck_constants;;
52 open Wrgcvdr_cizmrrh;;
54 open Flyspeck_constants;;
82 let SLICE_IS_UNADORNED=prove(`unadorned_v39 (scs_half_slice_v39 s p q d' mkj)`,
83 ASM_REWRITE_TAC[MMs_v39; BBprime2_v39;BBprime_v39;BBs_v39;LET_DEF;LET_END_DEF;scs_half_slice_v39;is_scs_v39;scs_diag;scs_v39_explicit;unadorned_v39]
87 let LKGRQUI= prove_by_refinement(
88 ` is_scs_v39 s /\ scs_diag (scs_k_v39 s) p q /\
89 is_scs_slice_v39 s s' s'' p q
90 ==> scs_arrow_v39 {s} {s',s''}`,
91 [REWRITE_TAC[scs_arrow_v39;IN_SING;LET_DEF;LET_END_DEF;unadorned_v39;PAIR_EQ]
92 THEN REPEAT STRIP_TAC;
95 THEN REWRITE_TAC[SET_RULE`a IN {b,c}<=> a=b\/a=c`]
98 MP_TAC SCS_HALF_SLICE_IS_A_SCS
104 MRESA_TAC (GEN_ALL SCS_HALF_SLICE_IS_A_SCS)[`s:scs_v39`;`s':scs_v39`;`q:num`;`p:num`;`s'':scs_v39`]
106 THEN REWRITE_TAC[scs_diag]
107 THEN REPEAT RESA_TAC;
109 DISJ_CASES_TAC(SET_RULE`(!s'. s' = s ==> MMs_v39 s' = {}) \/ ~((!s'. s' = s ==> MMs_v39 s' = {}))`);
114 THEN POP_ASSUM MP_TAC
115 THEN REWRITE_TAC[NOT_FORALL_THM;NOT_IMP]
116 THEN REPEAT STRIP_TAC
117 THEN POP_ASSUM MP_TAC
119 THEN POP_ASSUM MP_TAC
120 THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[SET_RULE`~(A={})<=> ?vv. A vv`;]
122 THEN REPLICATE_TAC (2)(POP_ASSUM MP_TAC)
123 THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
126 THEN REWRITE_TAC[is_scs_slice_v39;LET_DEF;LET_END_DEF]
127 THEN ABBREV_TAC`mkj=scs_J_v39 s' 0 (scs_k_v39 s' - 1)`
128 THEN ABBREV_TAC`d'=scs_d_v39 s'`
129 THEN ABBREV_TAC`d''=scs_d_v39 s''`
130 THEN REWRITE_TAC[scs_slice_v39;PAIR_EQ]
132 THEN ABBREV_TAC`vv' = (\i. (vv:num->real^3) (i MOD (scs_k_v39 s')+ p MOD (scs_k_v39 s)))`
133 THEN POP_ASSUM MP_TAC
136 THEN ASM_REWRITE_TAC[LET_DEF;LET_END_DEF]
138 THEN SUBGOAL_THEN`scs_bm_v39 s q p < &4 /\
139 (scs_k_v39 s = 4 \/ scs_bm_v39 s q p <= cstab) /\
140 scs_diag (scs_k_v39 s) q p` ASSUME_TAC;
143 THEN ASM_REWRITE_TAC[LET_DEF;LET_END_DEF;scs_diag;is_scs_v39]
144 THEN REPEAT RESA_TAC;
146 MRESAL_TAC (GEN_ALL QKNVMLB1)[`vv:num->real^3`;`s:scs_v39`;`q:num`;`p:num`;`d'':real`;`mkj:bool`]
147 [LET_DEF;LET_END_DEF]
148 THEN ABBREV_TAC`vv''=(\i. (vv:num->real^3)
149 (i MOD scs_k_v39 (scs_half_slice_v39 s q p d'' mkj) +
153 THEN REPLICATE_TAC (14-3)(POP_ASSUM MP_TAC)
154 THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
157 THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[MMs_v39;BBprime_v39;BBprime2_v39;LET_DEF;LET_END_DEF]
158 THEN REWRITE_TAC[BBprime_v39;BBprime2_v39]
160 THEN MP_TAC(REAL_ARITH`taustar_v39 (scs_half_slice_v39 s p q d' mkj) vv' +
161 taustar_v39 (scs_half_slice_v39 s q p d'' mkj) vv'' <=
163 /\ taustar_v39 s vv< &0
164 ==> taustar_v39 (scs_half_slice_v39 s p q d' mkj) vv' < &0 \/ taustar_v39 (scs_half_slice_v39 s q p d'' mkj) vv''< &0`)
168 EXISTS_TAC`s':scs_v39`
169 THEN ASM_REWRITE_TAC[SET_RULE`a IN {a,b}`;]
170 THEN MATCH_MP_TAC SGTRNAF
171 THEN EXISTS_TAC`vv':num->real^3`
172 THEN ASM_REWRITE_TAC[IN]
173 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
175 THEN REWRITE_TAC[SLICE_IS_UNADORNED];
178 EXISTS_TAC`s'':scs_v39`
179 THEN ASM_REWRITE_TAC[SET_RULE`b IN {a,b}`;]
180 THEN MATCH_MP_TAC SGTRNAF
181 THEN EXISTS_TAC`vv'':num->real^3`
182 THEN ASM_REWRITE_TAC[IN]
183 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
185 THEN REWRITE_TAC[SLICE_IS_UNADORNED]
186 THEN MP_TAC SCS_SLICE_SYM
188 THEN MRESA_TAC (GEN_ALL SCS_HALF_SLICE_IS_A_SCS)[`s:scs_v39`;`s':scs_v39`;`q:num`;`p:num`;`s'':scs_v39`];
192 EXISTS_TAC`s':scs_v39`
193 THEN ASM_REWRITE_TAC[SET_RULE`a IN {a,b}`;]
194 THEN MATCH_MP_TAC SGTRNAF
195 THEN EXISTS_TAC`vv':num->real^3`
196 THEN ASM_REWRITE_TAC[IN]
197 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
199 THEN REWRITE_TAC[SLICE_IS_UNADORNED];
201 EXISTS_TAC`s'':scs_v39`
202 THEN ASM_REWRITE_TAC[SET_RULE`b IN {a,b}`;]
203 THEN MATCH_MP_TAC SGTRNAF
204 THEN EXISTS_TAC`vv'':num->real^3`
205 THEN ASM_REWRITE_TAC[IN]
206 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
208 THEN REWRITE_TAC[SLICE_IS_UNADORNED]
209 THEN MP_TAC SCS_SLICE_SYM
211 THEN MRESA_TAC (GEN_ALL SCS_HALF_SLICE_IS_A_SCS)[`s:scs_v39`;`s':scs_v39`;`q:num`;`p:num`;`s'':scs_v39`];
213 EXISTS_TAC`s':scs_v39`
214 THEN ASM_REWRITE_TAC[SET_RULE`a IN {a,b}`;]
215 THEN MATCH_MP_TAC SGTRNAF
216 THEN EXISTS_TAC`vv':num->real^3`
217 THEN ASM_REWRITE_TAC[IN]
218 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
220 THEN REWRITE_TAC[SLICE_IS_UNADORNED];
222 EXISTS_TAC`s'':scs_v39`
223 THEN ASM_REWRITE_TAC[SET_RULE`b IN {a,b}`;]
224 THEN MATCH_MP_TAC SGTRNAF
225 THEN EXISTS_TAC`vv'':num->real^3`
226 THEN ASM_REWRITE_TAC[IN]
227 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
229 THEN REWRITE_TAC[SLICE_IS_UNADORNED]
230 THEN MP_TAC SCS_SLICE_SYM
232 THEN MRESA_TAC (GEN_ALL SCS_HALF_SLICE_IS_A_SCS)[`s:scs_v39`;`s':scs_v39`;`q:num`;`p:num`;`s'':scs_v39`]
235 EXISTS_TAC`s':scs_v39`
236 THEN ASM_REWRITE_TAC[SET_RULE`a IN {a,b}`;]
237 THEN MATCH_MP_TAC SGTRNAF
238 THEN EXISTS_TAC`vv':num->real^3`
239 THEN ASM_REWRITE_TAC[IN]
240 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
242 THEN REWRITE_TAC[SLICE_IS_UNADORNED];
244 EXISTS_TAC`s'':scs_v39`
245 THEN ASM_REWRITE_TAC[SET_RULE`b IN {a,b}`;]
246 THEN MATCH_MP_TAC SGTRNAF
247 THEN EXISTS_TAC`vv'':num->real^3`
248 THEN ASM_REWRITE_TAC[IN]
249 THEN MP_TAC SCS_HALF_SLICE_IS_A_SCS
251 THEN REWRITE_TAC[SLICE_IS_UNADORNED]
252 THEN MP_TAC SCS_SLICE_SYM
254 THEN MRESA_TAC (GEN_ALL SCS_HALF_SLICE_IS_A_SCS)[`s:scs_v39`;`s':scs_v39`;`q:num`;`p:num`;`s'':scs_v39`]
263 let check_completeness_claimA_concl =
264 Ineq.mk_tplate `\x. scs_arrow_v13 (set_of_list x)