(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Chapter: Local Fan *)
(* Author: Hoang Le Truong *)
(* Date: 2012-04-01 *)
(* ========================================================================= *)
(*
remaining conclusions from appendix to Local Fan chapter
*)
module Xwitccn = 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;;
let CARD_SLICE_EQ=prove_by_refinement(
`!V E
FF v w.
convex_local_fan(V,E,
FF)
/\ ~(v=w) /\
v
IN V /\ w
IN V
/\ (!u u1. u
IN {v,w} /\ u1
IN V /\ ~(u=u1) ==> ~(
collinear {
vec 0, u, u1}))
/\ (!e. e
IN FF ==> aff_gt {
vec 0} {v,w}
SUBSET wedge_in_fan_gt e E)
==>
CARD V =
CARD (slicev E
FF v w) +
CARD (slicev E
FF w v) - 2`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ASSUME_TAC
th
THEN REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN REWRITE_TAC[
convex_local_fan]
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
COMPATIBLE_BW_TWO_LEMMAS2
)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`E:(real^3->bool)->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.EJRCFJD)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`E:(real^3->bool)->bool`;`w:real^3`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`FF:real^3#real^3->bool`;`v:real^3`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REWRITE_TAC[
convex_local_fan]
THEN STRIP_TAC
THEN STRIP_TAC
THEN SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF w v`ASSUME_TAC
;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`
order (
rho_node1 (FF:real^3#real^3->bool)) w v `
THEN REWRITE_TAC[ARITH_RULE`0<=a /\ a<=a`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) w = v))`ASSUME_TAC
;
STRIP_TAC
THEN POP_ASSUM(fun th-> STRIP_TAC
THEN MRESA1_TAC
th`i:num`)
;
MRESA_TAC (GEN_ALL
ORDER)[`n:num`;`
rho_node1 (FF:real^3#real^3->bool)`;`w:real^3`;`v:real^3`];
SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF v w`ASSUME_TAC
;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`0`
THEN REWRITE_TAC[
ITER]
THEN ARITH_TAC;
MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`;`slicev (E:(real^3->bool)->bool)
FF v w`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`;`slicev (E:(real^3->bool)->bool)
FF w v`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`]
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (v,
rho_node1 (FF:real^3#real^3->bool) v)`;`n:num`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM2)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (w,
rho_node1 (FF:real^3#real^3->bool) w)`;`n:num`;`V:real^3->bool`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN SUBGOAL_THEN`(slicev (E:(real^3->bool)->bool)
FF v w) =
IMAGE (\i.
ITER i (
rho_node1 FF) v) {i| i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF v w}`ASSUME_TAC
;
REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th->
MP_TAC
th
THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[slicev;
IN_ELIM_THM]
THEN ASSUME_TAC
th)
THEN STRIP_TAC
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) v = w))`ASSUME_TAC
;
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPLICATE_TAC 4 (STRIP_TAC) THEN STRIP_TAC
THEN MRESA1_TAC
th`i:num`)
;
MRESA_TAC (GEN_ALL
UNIQUE_ORDER)[`v:real^3`;`w:real^3`;`n:num`;`(
rho_node1 (FF:real^3#real^3->bool))`]
THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[
th])
THEN REPEAT STRIP_TAC
THEN EXISTS_TAC`n':num`
THEN ASM_REWRITE_TAC[]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM
th])
THEN POP_ASSUM MP_TAC
THEN REPLICATE_TAC 4 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
RESA_TAC
;
SUBGOAL_THEN`(slicev (E:(real^3->bool)->bool)
FF w v) =
IMAGE (\i.
ITER i (
rho_node1 FF) v) {i| i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF w v}`ASSUME_TAC
;
REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REMOVE_ASSUM_TAC
THEN REPEAT STRIP_TAC
THEN POP_ASSUM(fun th->
MP_TAC
th
THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[slicev;
IN_ELIM_THM]
THEN ASSUME_TAC
th)
THEN STRIP_TAC
THEN MRESA_TAC(GEN_ALL Local_lemmas.LOCAL_FAN_ITER_RHO_NODE_IN_V)
[`(E:(real^3->bool)->bool)`;`FF:real^3#real^3->bool`;`w:real^3`;`V:real^3->bool`]
THEN POP_ASSUM(fun th-> MRESA1_TAC
th `n':num`)
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)
[`(E:(real^3->bool)->bool)`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`x:real^3`]
THEN EXISTS_TAC`n'':num`
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 4 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM
th]);
RESA_TAC
;
SUBGOAL_THEN`
CARD (slicev (E:(real^3->bool)->bool)
FF v w) =
CARD {i | i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF v w}`ASSUME_TAC;
REMOVE_ASSUM_TAC
THEN POP_ASSUM(fun th->
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[
th])
THEN MATCH_MP_TAC
CARD_IMAGE_INJ
THEN STRIP_TAC
;
REWRITE_TAC[
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN MP_TAC Local_lemmas1.LT_CARD_MONO_LOFA
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM MATCH_MP_TAC
THEN ASM_REWRITE_TAC[];
MATCH_MP_TAC
FINITE_SUBSET
THEN EXISTS_TAC`0.. (
CARD (V:real^3->bool))`
THEN REWRITE_TAC[
FINITE_NUMSEG;
SUBSET;
IN_ELIM_THM;
IN_NUMSEG]
THEN ARITH_TAC
;
SUBGOAL_THEN`
CARD (slicev (E:(real^3->bool)->bool)
FF w v) =
CARD {i | i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF w v}`ASSUME_TAC;
REMOVE_ASSUM_TAC
THEN POP_ASSUM(fun th->
GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[
th])
THEN MATCH_MP_TAC
CARD_IMAGE_INJ
THEN STRIP_TAC
;
REWRITE_TAC[
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN MP_TAC Local_lemmas1.LT_CARD_MONO_LOFA
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM MATCH_MP_TAC
THEN ASM_REWRITE_TAC[];
MATCH_MP_TAC
FINITE_SUBSET
THEN EXISTS_TAC`0.. (
CARD (V:real^3->bool))`
THEN REWRITE_TAC[
FINITE_NUMSEG;
SUBSET;
IN_ELIM_THM;
IN_NUMSEG]
THEN ARITH_TAC
;
POP_ASSUM(fun th->
POP_ASSUM( fun th1->
STRIP_TAC
THEN STRIP_TAC
THEN GEN_REWRITE_TAC(RAND_CONV o ONCE_DEPTH_CONV)[
th]
THEN GEN_REWRITE_TAC(RAND_CONV o ONCE_DEPTH_CONV)[
th1]))
THEN ASM_REWRITE_TAC[]
THEN SUBGOAL_THEN`{i| i<n+1}= 0.. n` ASSUME_TAC
;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_NUMSEG]
THEN ARITH_TAC;
SUBGOAL_THEN`{i | i = 0 \/ n <= i /\ i <
CARD (V:real^3->bool)} = (n.. (
CARD V -1))
UNION {0}`
ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_NUMSEG;
UNION;
IN_SING]
THEN ARITH_TAC;
ASM_REWRITE_TAC[]
THEN MP_TAC(ARITH_RULE`n=0\/ 0< n`)
THEN RESA_TAC;
POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th;
ITER])
THEN REPEAT RESA_TAC
;
SUBGOAL_THEN`(n..CARD (V:real^3->bool) - 1)
INTER {0} ={}`ASSUME_TAC;
REWRITE_TAC[
EXTENSION;
IN_ELIM_THM;
IN_NUMSEG;
UNION;
IN_SING;
INTER]
THEN GEN_TAC
THEN EQ_TAC;
POP_ASSUM MP_TAC
THEN ARITH_TAC;
SET_TAC[];
MRESAL_TAC Geomdetail.CARD_EQUATION[`n..(
CARD (V:real^3->bool)-1)`;`{0}`][
FINITE_NUMSEG;
FINITE_SING;
CARD_CLAUSES;Geomdetail.CARD_SING;ARITH_RULE`A+0=A`;
CARD_NUMSEG]
THEN REPLICATE_TAC 2 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM MP_TAC
THEN REPLICATE_TAC 8 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC
;
]);;
let CARD_SLICE_LE=prove_by_refinement(
`!V E
FF v w.
convex_local_fan(V,E,
FF)
/\ ~(v=w) /\
v
IN V /\ w
IN V
/\ (!u u1. u
IN {v,w} /\ u1
IN V /\ ~(u=u1) ==> ~(
collinear {
vec 0, u, u1}))
/\ (!e. e
IN FF ==> aff_gt {
vec 0} {v,w}
SUBSET wedge_in_fan_gt e E)
==>
CARD (slicev E
FF v w)<
CARD V`,
[
REPEAT STRIP_TAC
THEN ASM_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ASSUME_TAC
th
THEN REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN REWRITE_TAC[
convex_local_fan]
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
COMPATIBLE_BW_TWO_LEMMAS2
)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`E:(real^3->bool)->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.EJRCFJD)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`E:(real^3->bool)->bool`;`w:real^3`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`FF:real^3#real^3->bool`;`v:real^3`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM (fun th-> MP_TAC
th
THEN POP_ASSUM (fun th1-> MP_TAC
th1
THEN REWRITE_TAC[
convex_local_fan]
THEN ASSUME_TAC
th THEN ASSUME_TAC
th1))
THEN STRIP_TAC
THEN STRIP_TAC
THEN SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF w v`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`
order (
rho_node1 (FF:real^3#real^3->bool)) w v `
THEN REWRITE_TAC[ARITH_RULE`0<=a /\ a<=a`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) w = v))`ASSUME_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th-> STRIP_TAC
THEN MRESA1_TAC
th`i:num`);
MRESA_TAC (GEN_ALL
ORDER)[`n:num`;`
rho_node1 (FF:real^3#real^3->bool)`;`w:real^3`;`v:real^3`];
SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF v w`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`0`
THEN REWRITE_TAC[
ITER]
THEN ARITH_TAC;
MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`;`slicev (E:(real^3->bool)->bool)
FF v w`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`;`slicev (E:(real^3->bool)->bool)
FF w v`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`]
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (v,
rho_node1 (FF:real^3#real^3->bool) v)`;`n:num`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM2)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (w,
rho_node1 (FF:real^3#real^3->bool) w)`;`n:num`;`V:real^3->bool`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN MRESA_TAC
CARD_SLICE_EQ[`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`;]
THEN MRESA_TAC (GEN_ALL
CARD_VERTEX_GE_3_LOCAL_FAN)
[`slicev (E:(real^3->bool)->bool)
FF w v`;`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`]
THEN POP_ASSUM MP_TAC
THEN MRESA_TAC (GEN_ALL
CARD_VERTEX_GE_3_LOCAL_FAN)
[`slicev (E:(real^3->bool)->bool)
FF v w`;`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC]);;
let CARD_SLICE_LE1=prove_by_refinement(
`!V E
FF v w.
convex_local_fan(V,E,
FF)
/\ ~(v=w) /\
v
IN V /\ w
IN V
/\ (!u u1. u
IN {v,w} /\ u1
IN V /\ ~(u=u1) ==> ~(
collinear {
vec 0, u, u1}))
/\ (!e. e
IN FF ==> aff_gt {
vec 0} {v,w}
SUBSET wedge_in_fan_gt e E)
==>
CARD (slicev E
FF w v)<
CARD V`,
[
REPEAT STRIP_TAC
THEN ASM_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ASSUME_TAC
th
THEN REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN REWRITE_TAC[
convex_local_fan]
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
COMPATIBLE_BW_TWO_LEMMAS2
)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`E:(real^3->bool)->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.EJRCFJD)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`E:(real^3->bool)->bool`;`w:real^3`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`FF:real^3#real^3->bool`;`v:real^3`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM (fun th-> MP_TAC
th
THEN POP_ASSUM (fun th1-> MP_TAC
th1
THEN REWRITE_TAC[
convex_local_fan]
THEN ASSUME_TAC
th THEN ASSUME_TAC
th1))
THEN STRIP_TAC
THEN STRIP_TAC
THEN SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF w v`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`
order (
rho_node1 (FF:real^3#real^3->bool)) w v `
THEN REWRITE_TAC[ARITH_RULE`0<=a /\ a<=a`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) w = v))`ASSUME_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th-> STRIP_TAC
THEN MRESA1_TAC
th`i:num`);
MRESA_TAC (GEN_ALL
ORDER)[`n:num`;`
rho_node1 (FF:real^3#real^3->bool)`;`w:real^3`;`v:real^3`];
SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF v w`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`0`
THEN REWRITE_TAC[
ITER]
THEN ARITH_TAC;
MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`;`slicev (E:(real^3->bool)->bool)
FF v w`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`;`slicev (E:(real^3->bool)->bool)
FF w v`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`]
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (v,
rho_node1 (FF:real^3#real^3->bool) v)`;`n:num`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN MRESAL_TAC (GEN_ALL Local_lemmas1.CONDS_IN_V_PRIME_NUM2)[`(E:(real^3->bool)->bool)`;`hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))`;`w:real^3`;`FF:real^3#real^3->bool`;`v:real^3`;`face (hypermap (
HYP (
vec 0,V,(E:(real^3->bool)->bool)
UNION {{v, w}}))) (w,
rho_node1 (FF:real^3#real^3->bool) w)`;`n:num`;`V:real^3->bool`][
DIFF;
IN_SING;
IN_ELIM_THM;]
THEN POP_ASSUM MP_TAC
THEN ONCE_REWRITE_TAC[SET_RULE`~(t = z) <=> ~(z = t)`]
THEN RESA_TAC
THEN MRESA_TAC
CARD_SLICE_EQ[`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`;]
THEN MRESA_TAC (GEN_ALL
CARD_VERTEX_GE_3_LOCAL_FAN)
[`slicev (E:(real^3->bool)->bool)
FF w v`;`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`]
THEN POP_ASSUM MP_TAC
THEN MRESA_TAC (GEN_ALL
CARD_VERTEX_GE_3_LOCAL_FAN)
[`slicev (E:(real^3->bool)->bool)
FF v w`;`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC]);;
let SLICE_REPRENT=prove_by_refinement(
`!V E
FF v w.
convex_local_fan(V,E,
FF)
/\ ~(v=w) /\
v
IN V /\ w
IN V
/\ (!u u1. u
IN {v,w} /\ u1
IN V /\ ~(u=u1) ==> ~(
collinear {
vec 0, u, u1}))
/\ (!e. e
IN FF ==> aff_gt {
vec 0} {v,w}
SUBSET wedge_in_fan_gt e E)
==>(slicev (E:(real^3->bool)->bool)
FF v w) =
IMAGE (\i.
ITER i (
rho_node1 FF) v) {i| i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF v w}`
,
[
REPEAT STRIP_TAC
THEN ASM_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ASSUME_TAC
th
THEN REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN REWRITE_TAC[
convex_local_fan]
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
COMPATIBLE_BW_TWO_LEMMAS2
)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`E:(real^3->bool)->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.EJRCFJD)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`E:(real^3->bool)->bool`;`w:real^3`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`FF:real^3#real^3->bool`;`v:real^3`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REWRITE_TAC[
convex_local_fan]
THEN STRIP_TAC
THEN STRIP_TAC
THEN SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF w v`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`
order (
rho_node1 (FF:real^3#real^3->bool)) w v `
THEN REWRITE_TAC[ARITH_RULE`0<=a /\ a<=a`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) w = v))`ASSUME_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th-> STRIP_TAC
THEN MRESA1_TAC
th`i:num`);
MRESA_TAC (GEN_ALL
ORDER)[`n:num`;`
rho_node1 (FF:real^3#real^3->bool)`;`w:real^3`;`v:real^3`];
SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF v w`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`0`
THEN REWRITE_TAC[
ITER]
THEN ARITH_TAC;
MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`;`slicev (E:(real^3->bool)->bool)
FF v w`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`;`slicev (E:(real^3->bool)->bool)
FF w v`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`]
THEN REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th->
MP_TAC
th
THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[slicev;
IN_ELIM_THM]
THEN ASSUME_TAC
th)
THEN STRIP_TAC
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) v = w))`ASSUME_TAC;
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPLICATE_TAC 4 (STRIP_TAC) THEN STRIP_TAC
THEN MRESA1_TAC
th`i:num`);
MRESA_TAC (GEN_ALL
UNIQUE_ORDER)[`v:real^3`;`w:real^3`;`n:num`;`(
rho_node1 (FF:real^3#real^3->bool))`]
THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[
th])
THEN REPEAT STRIP_TAC
THEN EXISTS_TAC`n':num`
THEN ASM_REWRITE_TAC[]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM
th])
THEN POP_ASSUM MP_TAC
THEN REPLICATE_TAC 4 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
RESA_TAC;
]);;
let SLICE_REPRENT2=prove_by_refinement(
`!V E
FF v w.
convex_local_fan(V,E,
FF)
/\ ~(v=w) /\
v
IN V /\ w
IN V
/\ (!u u1. u
IN {v,w} /\ u1
IN V /\ ~(u=u1) ==> ~(
collinear {
vec 0, u, u1}))
/\ (!e. e
IN FF ==> aff_gt {
vec 0} {v,w}
SUBSET wedge_in_fan_gt e E)
==> (slicev (E:(real^3->bool)->bool)
FF w v) =
IMAGE (\i.
ITER i (
rho_node1 FF) v) {i| i <
CARD (V:real^3->bool) /\
ITER i (
rho_node1 FF) v
IN slicev E
FF w v}`,
[
REPEAT STRIP_TAC
THEN ASM_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ASSUME_TAC
th
THEN REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN REWRITE_TAC[
convex_local_fan]
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
COMPATIBLE_BW_TWO_LEMMAS2
)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`E:(real^3->bool)->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.EJRCFJD)[`hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))`;`E:(real^3->bool)->bool`;`w:real^3`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (v,
rho_node1 FF v)`;`V:real^3->bool`;`face (hypermap (
HYP (
vec 0,(V:real^3->bool),E
UNION {{v, w:real^3}}))) (w,
rho_node1 FF w)`;`FF:real^3#real^3->bool`;`v:real^3`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REWRITE_TAC[
convex_local_fan]
THEN STRIP_TAC
THEN STRIP_TAC
THEN SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF w v`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`
order (
rho_node1 (FF:real^3#real^3->bool)) w v `
THEN REWRITE_TAC[ARITH_RULE`0<=a /\ a<=a`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`w:real^3`;`v:real^3`]
THEN SUBGOAL_THEN`(!i. 0 < i /\ i < n ==> ~(
ITER i (
rho_node1 (FF:real^3#real^3->bool)) w = v))`ASSUME_TAC;
STRIP_TAC
THEN POP_ASSUM(fun th-> STRIP_TAC
THEN MRESA1_TAC
th`i:num`);
MRESA_TAC (GEN_ALL
ORDER)[`n:num`;`
rho_node1 (FF:real^3#real^3->bool)`;`w:real^3`;`v:real^3`];
SUBGOAL_THEN`v
IN slicev (E:(real^3->bool)->bool)
FF v w`ASSUME_TAC;
REWRITE_TAC[slicev;
IN_ELIM_THM]
THEN EXISTS_TAC`0`
THEN REWRITE_TAC[
ITER]
THEN ARITH_TAC;
MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF v w`;`slicef (E:(real^3->bool)->bool)
FF v w`;`slicev (E:(real^3->bool)->bool)
FF v w`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas.LOFA_IMP_LT_CARD_SET_V)[`slicee (E:(real^3->bool)->bool)
FF w v`;`slicef (E:(real^3->bool)->bool)
FF w v`;`slicev (E:(real^3->bool)->bool)
FF w v`;`v:real^3`]
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)[`E:(real^3->bool)->bool`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`w:real^3`]
THEN REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REMOVE_ASSUM_TAC
THEN REPEAT STRIP_TAC
THEN POP_ASSUM(fun th->
MP_TAC
th
THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[slicev;
IN_ELIM_THM]
THEN ASSUME_TAC
th)
THEN STRIP_TAC
THEN MRESA_TAC(GEN_ALL Local_lemmas.LOCAL_FAN_ITER_RHO_NODE_IN_V)
[`(E:(real^3->bool)->bool)`;`FF:real^3#real^3->bool`;`w:real^3`;`V:real^3->bool`]
THEN POP_ASSUM(fun th-> MRESA1_TAC
th `n':num`)
THEN MRESA_TAC (GEN_ALL Local_lemmas1.POINT_PRESENTED_IN_RHOND1)
[`(E:(real^3->bool)->bool)`;`V:real^3->bool`;`FF:real^3#real^3->bool`;`v:real^3`;`x:real^3`]
THEN EXISTS_TAC`n'':num`
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 4 (REMOVE_ASSUM_TAC)
THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM
th]);
RESA_TAC;
]);;
let PERIODIC_PROPERTY= prove(
` ~(k = 0) /\ periodic vv k ==> (!i. vv (i MOD k)= vv i)`,
REWRITE_TAC[periodic]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC
DIVISION[`i:num`;`k:num`]
THEN REMOVE_ASSUM_TAC
THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(RAND_CONV o ONCE_DEPTH_CONV)[
th]
THEN MP_TAC
th)
THEN ABBREV_TAC`n= i DIV k`
THEN ASM_TAC
THEN SPEC_TAC (`i:num`,`i:num`)
THEN SPEC_TAC (`n:num`,`n:num`)
THEN INDUCT_TAC
THENL[REWRITE_TAC[ARITH_RULE`0*K+A=A`];
POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th`n *k + i MOD k`)
THEN POP_ASSUM MP_TAC
THEN MRESA_TAC
DIVISION[`i:num`;`k:num`]
THEN MRESA_TAC
MOD_MULT_ADD[`n:num`;`k:num`;`i MOD k`]
THEN MRESA_TAC
DIV_UNIQ[`n * k + i MOD k`;`k:num`;`n:num`;`i MOD k`]
THEN ASM_SIMP_TAC[
MOD_MOD_REFL;ARITH_RULE`SUC n * k + i MOD k = (n * k + i MOD k) +k`]])
;;
let SCS_3_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 3 (
d_tame 3) (
cs_adj 3 (&2) (&2 * h0)) (
cs_adj 3 (&2 * h0) upperbd))
==>
tri_stable (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(4<=3)/\ 3-1=2`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`2`][ARITH_RULE`(2+1)-0=3`]
THEN ASM_SIMP_TAC[
tri_stable;
constraint_system;torsor;ARITH_RULE`3<= 3 /\3<=6/\ 1+3<=6/\ (2+1)-0=3/\ 3=3 /\ 0+3<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`3-1=2`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`2`[ARITH_RULE`SUC 2=3`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`3-1=2`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`3`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=3<=> A<=2)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`3-1=2`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<3`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`3:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 3==> i=1 \/ i=2`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 2==> x=0 \/ x=1 \/ x=2`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`3-1=2`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=3 /\1<3/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`3:num`;`x:num`;`3:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`3`;`x:num`][ARITH_RULE`1*3=3`]
THEN MP_TAC(ARITH_RULE`x<= 2==> x=0 \/ x=1 \/ x=2`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 3= j MOD 3 \/ ~(i MOD 3= j MOD 3)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`i MOD 3= SUC j MOD 3 \/ ~(i MOD 3= SUC j MOD 3)`)
THEN RESA_TAC;
REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
MP_TAC
CHOOSE_MOD_3
THEN ASM_REWRITE_TAC[h0]
THEN RESA_TAC
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=3 /\1<3/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`3:num`;`j:num`;`3:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`3`;`j:num`][ARITH_RULE`1*3=3`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`3`][ARITH_RULE`~(3=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`3`][ARITH_RULE`~(3=0) /\ 1 MOD 3=1`;
ADD1];
SET_TAC[];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 2)<=> i=0 \/ i=1\/ i=2`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 3=0 /\ 1 MOD 3=1 /\ 2 MOD 3=2 /\ ~(0=1)
/\ SUC 0 MOD 3=1 /\ SUC 1 MOD 3=2/\ SUC 2 MOD 3=0`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 2)<=> i=0 \/ i=1\/ i=2`]
THEN REPEAT STRIP_TAC
THEN
ASM_REWRITE_TAC[ARITH_RULE`0 MOD 3=0 /\ 1 MOD 3=1 /\ 2 MOD 3=2 /\ ~(0=1)
/\ SUC 0 MOD 3=1 /\ SUC 1 MOD 3=2/\ SUC 2 MOD 3=0
/\ (1+ 0) MOD 3=1 /\ (1+ 1) MOD 3=2 /\ (1+ 2) MOD 3=0
`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_4_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (
d_tame 4) (
cs_adj 4 (&2) (&2 * h0)) (
cs_adj 4 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))
`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(4=3)/\ 4-1=3`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`3`][ARITH_RULE`(3+1)-0=4`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 4 /\4<=6/\ 1+4<=6/\ (3+1)-0=4/\ 4=4 /\ 0+4<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`3`[ARITH_RULE`SUC 3=4`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`4`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=4<=> A<=3)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<4`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 4==> i=1 \/ i=2 \/ i=3`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2 \/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=3`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`x:num`][ARITH_RULE`1*4=4`]
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2\/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 4= j MOD 4 \/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4) \/ ~(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`j:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`j:num`][ARITH_RULE`1*4=4`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2 \/ i=3`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2\/ i=3`]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_5_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (
d_tame 5) (
cs_adj 5 (&2) (&2 * h0)) (
cs_adj 5 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(5=3)/\ 5-1=4`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`4`][ARITH_RULE`(4+1)-0=5`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 5 /\5<=6/\ 1+5<=6/\ (4+1)-0=5/\ 5=5 /\ 0+5<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`4`[ARITH_RULE`SUC 4=5`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`5`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=5<=> A<=4)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<5`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 5==> i=1 \/ i=2 \/ i=3\/ i=4`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2 \/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=4`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`x:num`][ARITH_RULE`1*5=5`]
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2\/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 5= j MOD 5 \/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5) \/ ~(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`j:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`j:num`][ARITH_RULE`1*5=5`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_6_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 6 (
d_tame 6) (
cs_adj 6 (&2) (&2 * h0)) (
cs_adj 6 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(6=3)/\ 6-1=5`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`5`][ARITH_RULE`(5+1)-0=6`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 6 /\6<=6/\ (5+1)-0=6/\ 6=6 /\ 0+6<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`6-1=5`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`5`[ARITH_RULE`SUC 5=6`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`6-1=5`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`6`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=6<=> A<=5)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`6-1=5`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<6`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`6:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 6==> i=1 \/ i=2 \/ i=3\/ i=4\/ i=5`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 5==> x=0 \/ x=1 \/ x=2 \/ x=3\/ x=4\/ x=5`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`6-1=5`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=6 /\1<6/\ 1<=5`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`6:num`;`x:num`;`6:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`6`;`x:num`][ARITH_RULE`1*6=6`]
THEN MP_TAC(ARITH_RULE`x<= 5==> x=0 \/ x=1 \/ x=2\/ x=3\/ x=4\/ x=5`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 6= j MOD 6 \/ ~(i MOD 6= j MOD 6)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`(i MOD 6 = SUC j MOD 6 \/ j MOD 6 = SUC i MOD 6) \/ ~(i MOD 6 = SUC j MOD 6 \/ j MOD 6 = SUC i MOD 6)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=6 /\1<6/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`6:num`;`j:num`;`6:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`6`;`j:num`][ARITH_RULE`1*6=6`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`6`][ARITH_RULE`~(6=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`6`][ARITH_RULE`~(6=0) /\ 1 MOD 6=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 5)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4 \/ i=5`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 6=0 /\ 1 MOD 6=1 /\ 2 MOD 6=2 /\ 3 MOD 6=3 /\ ~(0=1)
/\ SUC 0 MOD 6=1 /\ SUC 1 MOD 6=2/\ SUC 2 MOD 6=3 /\ SUC 3 MOD 6=4/\ SUC 4 MOD 6=5 /\ 4 MOD 6=4/\ SUC 5 MOD 6=0/\ 5 MOD 6=5`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 5)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4 \/ i=5`]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 6=0 /\ 1 MOD 6=1 /\ 2 MOD 6=2 /\ 3 MOD 6=3 /\ ~(0=1)/\ ~(1=2)
/\ SUC 0 MOD 6=1 /\ SUC 1 MOD 6=2/\ SUC 2 MOD 6=3 /\ SUC 3 MOD 6=4/\ SUC 4 MOD 6=5 /\ 4 MOD 6=4/\ SUC 5 MOD 6=0/\ 5 MOD 6=5/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_4_3_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.467) (
cs_adj 4 (&2) (&3)) (
cs_adj 4 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))
`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(4=3)/\ 4-1=3`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`3`][ARITH_RULE`(3+1)-0=4`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 4 /\4<=6/\ 1+4<=6/\ (3+1)-0=4/\ 4=4 /\ 0+4<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`3`[ARITH_RULE`SUC 3=4`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`4`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=4<=> A<=3)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<4`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 4==> i=1 \/ i=2 \/ i=3`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2 \/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=3`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`x:num`][ARITH_RULE`1*4=4`]
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2\/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 4= j MOD 4 \/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4) \/ ~(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`j:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`j:num`][ARITH_RULE`1*4=4`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2 \/ i=3`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0`;h0;REAL_ARITH`&2<= &2`;cstab]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2\/ i=3`]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_5_sqrt8_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (
cs_adj 5 (&2) (sqrt8)) (
cs_adj 5 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(5=3)/\ 5-1=4`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`4`][ARITH_RULE`(4+1)-0=5`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 5 /\5<=6/\ 1+5<=6/\ (4+1)-0=5/\ 5=5 /\ 0+5<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`4`[ARITH_RULE`SUC 4=5`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`5`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=5<=> A<=4)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<5`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 5==> i=1 \/ i=2 \/ i=3\/ i=4`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2 \/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=4`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`x:num`][ARITH_RULE`1*5=5`]
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2\/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 5= j MOD 5 \/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(ARITH_RULE`(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5) \/ ~(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0;sqrt8]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`&6`][REAL_ARITH`&0<= &8/\ &0<= &6 /\ &8<= &6 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`j:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`j:num`][ARITH_RULE`1*5=5`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4`;h0;REAL_ARITH`&2<= &2`;cstab;sqrt8]
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1;h0;REAL_ARITH`&2<= &2`;cstab;sqrt8]
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_4_sqrt8_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.477) (a_pro 4 (&2 * h0) (&2) sqrt8) (a_pro 4 sqrt8 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(4=3)/\ 4-1=3`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`3`][ARITH_RULE`(3+1)-0=4`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 4 /\4<=6/\ 1+4<=6/\ (3+1)-0=4/\ 4=4 /\ 0+4<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES;SET_RULE`({j MOD 4, i MOD 4} = {0, 1})<=> {i MOD 4, j MOD 4} = {0, 1}`]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`3`[ARITH_RULE`SUC 3=4`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`4`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=4<=> A<=3)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<4`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 4==> i=1 \/ i=2 \/ i=3`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2 \/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`4-1=3`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=3`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`x:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`x:num`][ARITH_RULE`1*4=4`]
THEN MP_TAC(ARITH_RULE`x<= 3==> x=0 \/ x=1 \/ x=2\/ x=3`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 4= j MOD 4 \/ ~(i MOD 4= j MOD 4)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(SET_RULE`{i MOD 4, j MOD 4} = {0, 1} \/ ~({i MOD 4, j MOD 4} = {0, 1})`)
THEN RESA_TAC;
MRESAL_TAC
REAL_LE_RSQRT [`&2 * #1.26 `;`&8`][sqrt8;h0;REAL_ARITH`&0<= &8/\ &0<= &2 * #1.26 /\ (&2 * #1.26) pow 2<= &8`];
MP_TAC(ARITH_RULE`(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4) \/ ~(i MOD 4 = SUC j MOD 4 \/ j MOD 4 = SUC i MOD 4)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0;sqrt8]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`&6`][REAL_ARITH`&0<= &8/\ &0<= &6 /\ &8<= &6 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=4 /\1<4/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`4:num`;`j:num`;`4:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`4`;`j:num`][ARITH_RULE`1*4=4`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2 \/ i=3`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(SET_RULE`~(2=0) /\ ~(2=1)/\ ~(3=0) /\ ~(3=1)==> ~({2,3}={1,0}) `)
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0 `;h0;REAL_ARITH`&2<= &2`;cstab;SET_RULE`{A,B}={A,C}<=> B=C`;sqrt8;SET_RULE`{A,B}={B,A}`;SET_RULE`{B,A}={C,A}<=> B=C`;SET_RULE`{B,A}={A,C}<=> B=C`;]
THEN RESA_TAC
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 3)<=> i=0 \/ i=1\/ i=2 \/ i=3`]
THEN REPEAT STRIP_TAC
THEN MP_TAC(SET_RULE`~(2=0) /\ ~(2=1)/\ ~(3=0) /\ ~(3=1)==> ~({2,3}={1,0}) `)
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 4=0 /\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)/\ 1+0=1/\ 1+2=3/\ 1+3=4/\ 4 MOD 4=0
/\ SUC 0 MOD 4=1 /\ SUC 1 MOD 4=2/\ SUC 2 MOD 4=3 /\ SUC 3 MOD 4=0 `;h0;REAL_ARITH`&2<= &2`;cstab;SET_RULE`{A,B}={A,C}<=> B=C`;sqrt8;SET_RULE`{A,B}={B,A}`;SET_RULE`{B,A}={C,A}<=> B=C`;SET_RULE`{B,A}={A,C}<=> B=C`;cstab;GSYM
ADD1;h0;REAL_ARITH`&2<= &2`;cstab;sqrt8]
THEN RESA_TAC
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let SCS_5_pro_cs_IS_TRI_STABLE=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (a_pro 5 (&2 * h0) (&2) (&2 * h0)) (a_pro 5 sqrt8 (&2 * h0) upperbd))
==>
stable_system (
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):num MOD (
scs_k_v39 s)))`,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`~(5=3)/\ 5-1=4`;
mk_unadorned_v39;
CS_ADJ;
scs_J_v39_explicit;
change_type_v2;
d_tame ;
change_type_v3]
THEN MRESAL_TAC
HAS_SIZE_NUMSEG[`0`;`4`][ARITH_RULE`(4+1)-0=5`]
THEN ASM_SIMP_TAC[
stable_system;
constraint_system;torsor;ARITH_RULE`3<= 5 /\5<=6/\ 1+5<=6/\ (4+1)-0=5/\ 5=5 /\ 0+5<=6`;
CARD_NUMSEG;Hypermap.CARD_SINGLETON;
change_type_v3;ARITH_RULE`A=B:num <=> B=A`;SET_RULE`A\/B<=> B\/A`;SET_RULE`{{i MOD k,j MOD K}| i,j| F}={}/\ {}
SUBSET A`;
CARD_CLAUSES;SET_RULE`({j MOD 5, i MOD 5} = {0, 1})<=> {i MOD 5, j MOD 5} = {0, 1}`]
THEN STRIP_TAC;
STRIP_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN MRESAL1_TAC Hypermap.LE_MOD_SUC`4`[ARITH_RULE`SUC 4=5`];
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN MRESAL_TAC (GEN_ALL
MOD_IMP_EQ)[`5`;`1+x1`;`1+x2`][ARITH_RULE`1<= 1+A /\ (1+A<=5<=> A<=4)`]
THEN POP_ASSUM MP_TAC
THEN ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN MP_TAC(ARITH_RULE`0<i==> 1<= i /\ 1<5`)
THEN RESA_TAC
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`i:num`]
THEN MP_TAC(ARITH_RULE`0<i /\ i< 5==> i=1 \/ i=2 \/ i=3\/ i=4`)
THEN RESA_TAC
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2 \/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
REWRITE_TAC[ARITH_RULE`5-1=4`;
IN_NUMSEG;ARITH_RULE`0<= A`]
THEN REPEAT STRIP_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=4`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`x:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`x:num`][ARITH_RULE`1*5=5`]
THEN MP_TAC(ARITH_RULE`x<= 4==> x=0 \/ x=1 \/ x=2\/ x=3\/ x=4`)
THEN ASM_REWRITE_TAC[]
THEN RESA_TAC
THEN ARITH_TAC;
STRIP_TAC;
REPEAT STRIP_TAC
THEN MP_TAC(ARITH_RULE`i MOD 5= j MOD 5 \/ ~(i MOD 5= j MOD 5)`)
THEN RESA_TAC;
REAL_ARITH_TAC;
MP_TAC(SET_RULE`{i MOD 5, j MOD 5} = {0, 1} \/ ~({i MOD 5, j MOD 5} = {0, 1})`)
THEN RESA_TAC;
MRESAL_TAC
REAL_LE_RSQRT [`&2 * #1.26 `;`&8`][sqrt8;h0;REAL_ARITH`&0<= &8/\ &0<= &2 * #1.26 /\ (&2 * #1.26) pow 2<= &8`];
MP_TAC(ARITH_RULE`(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5) \/ ~(i MOD 5 = SUC j MOD 5 \/ j MOD 5 = SUC i MOD 5)`)
THEN RESA_TAC
THEN REWRITE_TAC[h0;sqrt8]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`&6`][REAL_ARITH`&0<= &8/\ &0<= &6 /\ &8<= &6 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REPEAT GEN_TAC
THEN ASSUME_TAC(ARITH_RULE`1<=5 /\1<5/\ 1<=2`)
THEN MRESA_TAC (GEN_ALL
POWER_MOD_FUN)[`5:num`;`j:num`;`5:num`]
THEN MRESAL_TAC
MOD_MULT_ADD[`1`;`5`;`j:num`][ARITH_RULE`1*5=5`]
THEN MRESAL_TAC
MOD_MOD_REFL[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
MOD_ADD_MOD[`j:num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1`;
ADD1];
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)/\ 1+0=1/\ 1+2=3/\ 1+3=4/\ 5 MOD 5=0
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4`;h0;REAL_ARITH`&2<= &2`;cstab;sqrt8]
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
STRIP_TAC;
REWRITE_TAC[
IN_NUMSEG;ARITH_RULE`(0 <= i /\ i <= 4)<=> i=0 \/ i=1\/ i=2 \/ i=3\/ i=4`]
THEN REPEAT STRIP_TAC
THEN MP_TAC(SET_RULE`~(2=0) /\ ~(2=1)/\ ~(3=0) /\ ~(3=1)==> ~({2,3}={1,0}) `)
THEN MP_TAC(SET_RULE`~(4=0) /\ ~(4=1)/\ ~(3=0) /\ ~(3=1)==> ~({4,3}={1,0}) `)
THEN ASM_REWRITE_TAC[ARITH_RULE`0 MOD 5=0 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ ~(0=1)/\ ~(0=2)/\ ~(0=3)/\ ~(2=1)/\ ~(0=4)/\ ~(3=1) /\ ~(1=4) /\ ~(3=2)
/\ ~(4=2) /\ ~(4=3)/\ 1+0=1/\ 1+2=3/\ 1+3=4/\ 5 MOD 5=0
/\ SUC 0 MOD 5=1 /\ SUC 1 MOD 5=2/\ SUC 2 MOD 5=3 /\ SUC 3 MOD 5=4/\ SUC 4 MOD 5=0 /\ 4 MOD 5=4/\ 1+i=i+1`;h0;REAL_ARITH`&2<= &2`;cstab;GSYM
ADD1;h0;REAL_ARITH`&2<= &2`;cstab;cstab;SET_RULE`{A,B}={A,C}<=> B=C`;sqrt8;SET_RULE`{A,B}={B,A}`;SET_RULE`{B,A}={C,A}<=> B=C`;SET_RULE`{B,A}={A,C}<=> B=C`;cstab;GSYM
ADD1;h0;REAL_ARITH`&2<= &2`;cstab;sqrt8]
THEN RESA_TAC
THEN RESA_TAC
THEN MRESAL_TAC
REAL_LE_RSQRT [`&2`;`&8`][REAL_ARITH`&0<= &8/\ &0<= &8 /\ &2 pow 2<= &8`]
THEN MRESAL_TAC
REAL_LE_LSQRT [`&8`;`#3.01`][REAL_ARITH`&0<= &8/\ &0<= #3.01 /\ &8<= #3.01 pow 2`]
THEN REAL_ARITH_TAC;
SET_TAC[]
]);;
(* }}} *)
let stable_sy_explicit = prove_by_refinement(
`!k d s a b J f.
stable_system k d s a b J f ==>
k_sy (stable_sy (k,d,s, a,b,J,f)) = k/\
d_sy (stable_sy (k,d,s, a,b,J,f)) = d /\
a_sy (stable_sy (k,d,s, a,b,J,f)) = a /\
b_sy (stable_sy (k,d,s, a,b,J,f)) = b /\
J_SY (stable_sy (k,d,s, a,b,J,f)) = J /\
I_SY (stable_sy (k,d,s, a,b,J,f)) = s /\
f_sy (stable_sy (k,d,s, a,b,J,f)) = f `,
(* {{{ proof *)
[ REWRITE_TAC[
k_sy;
d_sy;
a_sy;
b_sy;
J_SY;
I_SY;
f_sy;stable_sy_tybij;]
THEN MP_TAC stable_sy_tybij
THEN STRIP_TAC
THEN REPEAT GEN_TAC
THEN STRIP_TAC
THEN POP_ASSUM(fun th->
POP_ASSUM (fun th1-> ASSUME_TAC
th THEN MRESA1_TAC
th1`(k,d,s,a,b,J,f):(num#real#(num->bool)#(num#num->
real)#(num#num->
real)#((num->bool)->bool)#(num->num))`))
]);;
(* }}} *)
(* }}} *)
let ROW_IN_BALL_ANNULUS_3=
fun (th:term)->
ASM_SIMP_TAC[]
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`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[SET_RULE`(a:num) IN(:num)`]
;;
let INEQUALITY_A_B_SCS_TAC_30=
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
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/\ 1 MOD 3=1/\ 2 MOD 3=2 /\ ~(1=2) /\ SUC 1 MOD 3=2/\ SUC 2 MOD 3=0`]
THEN REPLICATE_TAC 10 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=3/\ 2<=3/\ 3<=3/\ 1 MOD 3=1/\ 2 MOD 3=2 /\ ~(1=2) /\ SUC 1 MOD 3=2/\ SUC 2 MOD 3=0/\ 0 MOD 3=0/\ ~(1=0)/\ SUC 0 MOD 3=1 /\ ~(2=1) /\ 3 MOD 3=0 /\ SUC 3 MOD 3=1/\ ~(2=0)`]);;
let INEQUALITY_A_B_SCS_TAC_3=
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 3==> i=1\/ i=2\/ i=3`)
THEN RESA_TAC
THENL[
INEQUALITY_A_B_SCS_TAC_30 `1` th;
INEQUALITY_A_B_SCS_TAC_30 `2` th;
INEQUALITY_A_B_SCS_TAC_30 `0` th];;
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_3=
fun (so:term)->
REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=3 /\ 2<=3/\ 3<=3/\ 4<=4/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) `] )
;;
let PROVE_INEQUALITY_TAC_30=
fun (so:term) (so1:term)->
REPLICATE_TAC 6(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=3 /\ 3<=3/\ 1<=1 /\ 1<=3/\ 1<=2 /\ 2<=3/\1<=3 /\ 3<=4`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 3=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 3=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 3=2/\ ~(2=0)/\ ~(2=1)`])
THEN MRESAL1_TAC th2`3`[ARITH_RULE`3 MOD 3=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_3
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`3 MOD 3=0/\ 1 MOD 3=1/\ 2 MOD 3=2 /\ 3 MOD 4=3`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_30 th `3`;
PROVE_INEQUALITY_TAC_30 th `1`;
PROVE_INEQUALITY_TAC_30 th `2`];;
(* }}} *)
(* }}} *)
let NOT_COLLINEAR_BBs_CASE_3=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 3 (
d_tame 3) (
cs_adj 3 (&2) (&2 * h0)) (
cs_adj 3 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s
==> ~collinear{
vec 0, vv 1 ,vv 2}/\
~collinear{
vec 0, vv 1 ,vv 0}/\
~collinear{
vec 0, vv 2 ,vv 0}`
,
(* {{{ proof *)
[
REWRITE_TAC[Local_lemmas.collinear_fan22;aff;
AFFINE_HULL_2;
IN_ELIM_THM;
VECTOR_ARITH`A %
vec 0+B=B`]
THEN STRIP_TAC
THEN MP_TAC
POINT_IN_BBS_IS_NOT_0_3
THEN RESA_TAC
THEN ASM_TAC
THEN REWRITE_TAC[
IN]
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`3<=3`;
mk_unadorned_v39;
CS_ADJ]
THEN SUBGOAL_THEN`
scs_k_v39 s =3` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
ASM_REWRITE_TAC[ARITH_RULE`3<=3`]
THEN POP_ASSUM(fun th->
STRIP_TAC
THEN ASSUME_TAC
th)
THEN REPEAT DISCH_TAC
THEN REPEAT STRIP_TAC;
REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA_TAC
th[`1`;`2`])
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`3<=3`;
mk_unadorned_v39;
CS_ADJ;
ARITH_RULE`1 MOD 3 =1 /\ 2 MOD 3=2/\ ~(1=2) /\ SUC 1=2 /\ SUC 2=3/\ 3 MOD 3=0`;
dist;VECTOR_ARITH`A- B%A=(&1-B)%A`;
NORM_MUL]
THEN REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 1 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`1`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 2 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`2`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`(vv:num->real^3) 2`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`]
THEN MRESAL1_TAC
th`(vv:num->real^3) 1`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`])
THEN MP_TAC(REAL_ARITH`&0<= &1-v\/ &0<= --( &1-v)`)
THEN STRIP_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESA1_TAC Trigonometry2.ABS_REFL `v:real`
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= (&1 - v) *
norm (vv 1)
/\ &2 <= v *
norm (vv 1) ==> &4<=
norm ((vv:num->real^3) 1)`)
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL `-- v:real`[
REAL_ABS_NEG]
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= --v *
norm (vv 1)
/\ &2 <=
norm (vv 1) ==> &4<=(&1- v) *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 10(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 1)
/\ &2 <= --(&1 - v) *
norm (vv 1) ==> &4<= v *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` --v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 1)
/\ &2 <= --v *
norm (vv 1) ==> &4<= (&1-v) *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 11(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA_TAC
th[`0`;`1`])
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`3<=3`;
mk_unadorned_v39;
CS_ADJ;
ARITH_RULE`1 MOD 3 =1 /\ 2 MOD 3=2/\ ~(1=2) /\ SUC 1=2 /\ SUC 2=3/\ 3 MOD 3=0/\ 0 MOD 3=0/\ SUC 0=1/\ ~(0=1)`;
dist;VECTOR_ARITH`B%A-A= --((&1-B)%A)`;
NORM_MUL;
NORM_NEG]
THEN REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 1 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`1`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 0 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`0`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`(vv:num->real^3) 0`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`]
THEN MRESAL1_TAC
th`(vv:num->real^3) 1`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`])
THEN MP_TAC(REAL_ARITH`&0<= &1-v\/ &0<= --( &1-v)`)
THEN STRIP_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESA1_TAC Trigonometry2.ABS_REFL `v:real`
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= (&1 - v) *
norm (vv 1)
/\ &2 <= v *
norm (vv 1) ==> &4<=
norm ((vv:num->real^3) 1)`)
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL `-- v:real`[
REAL_ABS_NEG]
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= --v *
norm (vv 1)
/\ &2 <=
norm (vv 1) ==> &4<=(&1- v) *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 10(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 1)
/\ &2 <= --(&1 - v) *
norm (vv 1) ==> &4<= v *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` --v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 1)
/\ &2 <= --v *
norm (vv 1) ==> &4<= (&1-v) *norm ((vv:num->real^3) 1)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 11(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA_TAC
th[`0`;`2`])
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
LET_DEF;
LET_END_DEF;
BBs_v39;ARITH_RULE`3<=3`;
mk_unadorned_v39;
CS_ADJ;
ARITH_RULE`1 MOD 3 =1 /\ 2 MOD 3=2/\ ~(1=2) /\ SUC 1=2 /\ SUC 2=3/\ 3 MOD 3=0/\ 0 MOD 3=0/\ SUC 0=1/\ ~(0=1)/\ ~(0=2)`;
dist;VECTOR_ARITH`B%A-A= --((&1-B)%A)`;
NORM_MUL;
NORM_NEG]
THEN REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 2 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`2`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
SUBGOAL_THEN`(?x. x
IN (:num) /\ vv 0 = (vv:num->real^3) x)`ASSUME_TAC;
EXISTS_TAC`0`
THEN ASM_REWRITE_TAC[SET_RULE`(a:num)
IN (:num)`];
REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`(vv:num->real^3) 0`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`]
THEN MRESAL1_TAC
th`(vv:num->real^3) 2`[
ball_annulus;
IN_ELIM_THM;
DIFF;
cball;
ball;
dist;VECTOR_ARITH`
vec 0- B= --B`;
NORM_NEG;
NORM_MUL;REAL_ARITH`~(a<b) <=> b<=a`])
THEN MP_TAC(REAL_ARITH`&0<= &1-v\/ &0<= --( &1-v)`)
THEN STRIP_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESA1_TAC Trigonometry2.ABS_REFL `v:real`
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= (&1 - v) *
norm (vv 2)
/\ &2 <= v *
norm (vv 2) ==> &4<=
norm ((vv:num->real^3) 2)`)
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL `-- v:real`[
REAL_ABS_NEG]
THEN MRESA1_TAC Trigonometry2.ABS_REFL `&1- v:real`
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <= --v *
norm (vv 2)
/\ &2 <=
norm (vv 2) ==> &4<=(&1- v) *norm ((vv:num->real^3) 2)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 10(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MP_TAC(REAL_ARITH`&0<= v\/ &0<= --( v)`)
THEN STRIP_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 2)
/\ &2 <= --(&1 - v) *
norm (vv 2) ==> &4<= v *norm ((vv:num->real^3) 2)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 5(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC
;
MRESAL1_TAC Trigonometry2.ABS_REFL ` --v:real`[
REAL_ABS_NEG]
THEN MRESAL1_TAC Trigonometry2.ABS_REFL `--(&1- v):real` [
REAL_ABS_NEG]
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th]
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM(fun th-> ASM_TAC
THEN REWRITE_TAC[
th; ]
THEN REPEAT STRIP_TAC)
THEN MP_TAC(REAL_ARITH`&2 <=
norm (vv 2)
/\ &2 <= --v *
norm (vv 2) ==> &4<= (&1-v) *norm ((vv:num->real^3) 2)`)
THEN ASM_REWRITE_TAC[]
THEN REPLICATE_TAC 11(POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC
THEN MP_TAC
th)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[h0]
THEN REAL_ARITH_TAC;
]);;
(* }}} *)
(* }}} *)
let HDPLYGY_CASE_3=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)})
==> ?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)) <= tau3 (
row 1 (vecmats y)) (
row 2 (vecmats y)) (
row 3 (vecmats y)))`
,
(* {{{ proof *)
[
REPEAT STRIP_TAC
THEN MP_TAC
TRI_STABLE_K_EQ_3
THEN RESA_TAC
THEN MRESA_TAC
CONTINUOUS_ATTAINS_INF[`(\x:real^(M,3)finite_product. tau3 (
row 1 (vecmats (x:real^(M,3)finite_product))) (
row 2 (vecmats x)) (
row 3 ( vecmats x)))`;`{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`]
THEN POP_ASSUM MATCH_MP_TAC
THEN STRIP_TAC
;
POP_ASSUM(fun th-> REWRITE_TAC[SYM
th])
THEN MATCH_MP_TAC
COMPACT_TRI_STABLE
THEN ASM_REWRITE_TAC[];
SIMP_TAC[
o_DEF;
LIFT_SUM;
FINITE_NUMSEG;tau3;
o_DEF;
LIFT_SUB;
LIFT_SUM;REAL_ARITH`A+B+C-D=((A+B)+C)-D`]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN SIMP_TAC[
o_DEF;
LIFT_ADD;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN STRIP_TAC;
SIMP_TAC[
o_DEF;
LIFT_ADD;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN STRIP_TAC;
SIMP_TAC[
o_DEF;
LIFT_CMUL;
FINITE_NUMSEG]
THEN REPEAT STRIP_TAC
THEN MATCH_MP_TAC
CONTINUOUS_ON_MUL
THEN STRIP_TAC;
REWRITE_TAC[rho;
o_DEF;
LIFT_ADD]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_LIFT_NORM_COMPOSE
THEN MATCH_MP_TAC
CONTINUOUS_ON_ROW
THEN ASM_REWRITE_TAC[
IN_NUMSEG]
THEN ARITH_TAC;
REWRITE_TAC[
CONTINUOUS_ON_SEQUENTIALLY;
o_DEF]
THEN REPEAT STRIP_TAC
THEN MP_TAC (GEN_ALL
SEQUENTIALLY_DIVH)
THEN REWRITE_TAC[
o_DEF]
THEN STRIP_TAC
THEN POP_ASSUM MATCH_MP_TAC
THEN MRESAL_TAC (GEN_ALL
LIM_VECMAT)[`(\n:num. vecmats ((x:num->real^(M,3)finite_product) n))`;`vecmats(a':real^(M,3)finite_product)`][
MATVEC_VECMATS_ID;ETA_AX]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`1`[ARITH_RULE`1<=1/\ 1<=3`]
THEN MRESAL1_TAC
th`2`[ARITH_RULE`1<=2/\ 2<=3`]
THEN MRESAL1_TAC
th`3`[ARITH_RULE`1<=3/\ 3<=3`])
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT DISCH_TAC
THEN MRESA1_TAC
th `a':real^(M,3)finite_product`
THEN ASSUME_TAC
th)
THEN GEN_TAC
THEN POP_ASSUM(fun th-> MRESA1_TAC
th `(x (n:num)):real^(M,3)finite_product`)
;
SIMP_TAC[
o_DEF;
LIFT_CMUL;
FINITE_NUMSEG]
THEN REPEAT STRIP_TAC
THEN MATCH_MP_TAC
CONTINUOUS_ON_MUL
THEN STRIP_TAC;
REWRITE_TAC[rho;
o_DEF;
LIFT_ADD]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_LIFT_NORM_COMPOSE
THEN MATCH_MP_TAC
CONTINUOUS_ON_ROW
THEN ASM_REWRITE_TAC[
IN_NUMSEG]
THEN ARITH_TAC;
REWRITE_TAC[
CONTINUOUS_ON_SEQUENTIALLY;
o_DEF]
THEN REPEAT STRIP_TAC
THEN MP_TAC (GEN_ALL
SEQUENTIALLY_DIVH)
THEN REWRITE_TAC[
o_DEF]
THEN STRIP_TAC
THEN POP_ASSUM MATCH_MP_TAC
THEN MRESAL_TAC (GEN_ALL
LIM_VECMAT)[`(\n:num. vecmats ((x:num->real^(M,3)finite_product) n))`;`vecmats(a':real^(M,3)finite_product)`][
MATVEC_VECMATS_ID;ETA_AX]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`1`[ARITH_RULE`1<=1/\ 1<=3`]
THEN MRESAL1_TAC
th`2`[ARITH_RULE`1<=2/\ 2<=3`]
THEN MRESAL1_TAC
th`3`[ARITH_RULE`1<=3/\ 3<=3`])
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT DISCH_TAC
THEN MRESA1_TAC
th `a':real^(M,3)finite_product`
THEN ASSUME_TAC
th)
THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`]
THEN ASM_REWRITE_TAC[]
THEN GEN_TAC
THEN POP_ASSUM(fun th-> MRESA1_TAC
th `(x (n:num)):real^(M,3)finite_product`)
THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`]
THEN ASM_REWRITE_TAC[]
;
SIMP_TAC[
o_DEF;
LIFT_CMUL;
FINITE_NUMSEG]
THEN REPEAT STRIP_TAC
THEN MATCH_MP_TAC
CONTINUOUS_ON_MUL
THEN STRIP_TAC;
REWRITE_TAC[rho;
o_DEF;
LIFT_ADD]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_ADD
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_CMUL
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_ADD;ly;
interp;REAL_ARITH`a*b=b*a`;
LIFT_CMUL]
THEN MATCH_MP_TAC
CONTINUOUS_ON_SUB
THEN REWRITE_TAC[
CONTINUOUS_ON_CONST;
LIFT_CMUL;
LIFT_SUB;]
THEN MATCH_MP_TAC
CONTINUOUS_ON_LIFT_NORM_COMPOSE
THEN MATCH_MP_TAC
CONTINUOUS_ON_ROW
THEN ASM_REWRITE_TAC[
IN_NUMSEG]
THEN ARITH_TAC;
REWRITE_TAC[
CONTINUOUS_ON_SEQUENTIALLY;
o_DEF]
THEN REPEAT STRIP_TAC
THEN MP_TAC (GEN_ALL
SEQUENTIALLY_DIVH)
THEN REWRITE_TAC[
o_DEF]
THEN STRIP_TAC
THEN POP_ASSUM MATCH_MP_TAC
THEN MRESAL_TAC (GEN_ALL
LIM_VECMAT)[`(\n:num. vecmats ((x:num->real^(M,3)finite_product) n))`;`vecmats(a':real^(M,3)finite_product)`][
MATVEC_VECMATS_ID;ETA_AX]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`1`[ARITH_RULE`1<=1/\ 1<=3`]
THEN MRESAL1_TAC
th`2`[ARITH_RULE`1<=2/\ 2<=3`]
THEN MRESAL1_TAC
th`3`[ARITH_RULE`1<=3/\ 3<=3`])
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT DISCH_TAC
THEN MRESA1_TAC
th `a':real^(M,3)finite_product`
THEN ASSUME_TAC
th)
THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`]
THEN ASM_REWRITE_TAC[]
THEN GEN_TAC
THEN POP_ASSUM(fun th-> MRESA1_TAC
th `(x (n:num)):real^(M,3)finite_product`)
THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`]
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
(* }}} *)
let XWITCCN_CASE_3=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 3 (
d_tame 3) (
cs_adj 3 (&2) (&2 * h0)) (
cs_adj 3 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`
,
(* {{{ proof *)
[
STRIP_TAC
THEN MP_TAC
SCS_3_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_3
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN SUBGOAL_THEN`
scs_k_v39 s =3` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 3 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MP_TAC
IN_B_SY1_COLLINEAR_CASE_3
THEN RESA_TAC
THEN MRESAL_TAC (GEN_ALL
HDPLYGY_CASE_3)[`
scs_d_v39 s`;`(
change_type_v2 (
scs_J_v39 s) (
scs_k_v39 s))`;`
scs_k_v39 s`;`(
change_type_v3 (
scs_a_v39 s))`;` (
change_type_v3 (
scs_b_v39 s))`][ARITH_RULE`2<3`]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_3)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; (vv1:num->real^3) 2;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 3=1/\ 2 MOD 3=2/\ 3 MOD 3=0/\ 0 MOD 3=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=3 <=>i=1\/ i=2\/ i=3`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_3)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_3)[`s:scs_v39`;`vv1:num->real^3`;]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_3)
[`s:scs_v39`;`ww:num->real^3`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_3)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN MRESAL_TAC
VECTOR_3_3[`(vv1:num->real^3) 1`;`(vv1:num->real^3) 2`;`(vv1:num->real^3) 0`;][ARITH_RULE`1<=3/\ 2<=3/\ 3<=3`]
THEN MRESAL_TAC
VECTOR_3_3[`(ww:num->real^3) 1`;`(ww:num->real^3) 2`;`(ww:num->real^3) 0`;][ARITH_RULE`1<=3/\ 2<=3/\ 3<=3`]
THEN REPLICATE_TAC 13 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESAL1_TAC
th `matvec(
vector [ww 1; ww 2; ww 0]:real^3^M):real^(M,3)finite_product`[Dih2k_hypermap.VECMATS_MATVEC_ID]);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_3)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_3)[`s:scs_v39`;`vv1:num->real^3`;]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_3)
[`s:scs_v39`;`vv:num->real^3`;]
THEN REPLICATE_TAC 14 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_3)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN MRESAL_TAC
VECTOR_3_3[`(vv1:num->real^3) 1`;`(vv1:num->real^3) 2`;`(vv1:num->real^3) 0`;][ARITH_RULE`1<=3/\ 2<=3/\ 3<=3`]
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`]
THEN REPLICATE_TAC 12 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESAL1_TAC
th `matvec(
vector [(vv:num->real^3) 1; vv 2; vv 0]:real^3^M):real^(M,3)finite_product`[Dih2k_hypermap.VECMATS_MATVEC_ID])
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC
]);;
(* }}} *)
let PROVE_V_SY_EQ_TAC=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`1<= 1 /\ 1<= 4`]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)`]
THEN ARITH_TAC
;;
let PROVE_E_SY_EQ_TAC=
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4 /\ SUC 4=5`;SET_RULE`(a:num)IN (:num)`]
;;
let PROVE_EQ_V_SY_TAC_4=
fun (th:term)->
ASM_REWRITE_TAC[]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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 PROVE_F_SY_EQ_TAC=
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 0`;`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4 /\ SUC 4=5`]
THEN SET_TAC[];;
let PROOF_E_EQ_IMAGE_4=
fun (th:term)->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`4`][ARITH_RULE`~(4=0)/\ 4 MOD 4=0/\ SUC 0 MOD 4=1/\ 1 MOD 4=1/\ 2 MOD 4=2 /\ 3 MOD 4=3`]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4/\ 1<=1/\ 1<=2/\ 1<=3`];;
let V_E_FF_CASE_4=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (
d_tame 4) (
cs_adj 4 (&2) (&2 * h0)) (
cs_adj 4 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
PROVE_EQ_V_SY_TAC_4 `1`;
PROVE_EQ_V_SY_TAC_4 `2`;
PROVE_EQ_V_SY_TAC_4 `3`;
PROVE_EQ_V_SY_TAC_4 `0`];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_TAC `4`;
PROVE_V_SY_EQ_TAC `1`;
PROVE_V_SY_EQ_TAC `2`;
PROVE_V_SY_EQ_TAC `3`];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
EXISTS_TAC `3`
THEN MRESAL_TAC
VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`SUC 3`[ARITH_RULE`SUC 3 MOD 4=0/\ SUC 3=4`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th])
THEN SET_TAC[];
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROOF_E_EQ_IMAGE_4 `4`;
PROOF_E_EQ_IMAGE_4 `1`;
PROOF_E_EQ_IMAGE_4 `2`;
PROOF_E_EQ_IMAGE_4 `3`];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
EXISTS_TAC `3`
THEN MRESAL_TAC
VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`SUC 3`[ARITH_RULE`SUC 3 MOD 4=0/\ SUC 3=4`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th])
THEN SET_TAC[];
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROOF_E_EQ_IMAGE_4 `4`;
PROOF_E_EQ_IMAGE_4 `1`;
PROOF_E_EQ_IMAGE_4 `2`;
PROOF_E_EQ_IMAGE_4 `3`];
]);;
(* }}} *)
let IN_BALL_ANNULUS_ROW_TAC_4=
fun (th:term)->
ASM_SIMP_TAC[]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[SET_RULE`(a:num)IN (:num)`]
;;
let INEQUALITY_PROOF_TAC40=
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)`]
THEN REPLICATE_TAC 12 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 0 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(2=1)
/\ SUC 0 MOD 4= 1 /\ SUC 1 MOD 4= 2 /\ SUC 2 MOD 4= 3/\ SUC 3 MOD 4= 0 /\ ~(2=0)/\ ~(3=0)/\ ~(2=3)/\ ~(3=1)/\ ~(1=0)`]);;
let INEQUALITY_PROOF_TAC4=
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 4==> i=1\/ i=2\/ i=3\/ i=4`)
THEN RESA_TAC
THENL[
INEQUALITY_PROOF_TAC40 `1` th;
INEQUALITY_PROOF_TAC40 `2` th;
INEQUALITY_PROOF_TAC40 `3` th;
INEQUALITY_PROOF_TAC40 `0` th];;
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_4=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=4 /\ 2<=4/\ 3<=4/\ 4<=4/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) `] )
;;
let PROVE_INEQUALITY_TAC_40=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=4 /\ 4<=4/\ 1<=1 /\ 1<=4/\ 1<=2 /\ 2<=4/\1<=3 /\ 3<=4`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 4=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 4=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 4=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`])
THEN MRESAL1_TAC th2`4`[ARITH_RULE`4 MOD 4=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_4
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`4 MOD 4=0/\ 1 MOD 4=1/\ 2 MOD 4=2 /\ 3 MOD 4=3`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_40 th `4`;
PROVE_INEQUALITY_TAC_40 th `1`;
PROVE_INEQUALITY_TAC_40 th `2`;
PROVE_INEQUALITY_TAC_40 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_RULE`1 MOD 4=1 /\ ~(1=0) /\ 2 MOD 4=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 4=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 4=0`];;
let PROVE_E_SY_EQ_MOD_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)`]
THEN ARITH_TAC;;
let PROVE_E_SY_EQ_IMAGE_VV_4=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1/\ 1<=4/\ 4<=4/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 4=0/\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 4=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=4
/\ 1<=3/\ 3<=4/\ 3+1=4`])
;;
let PROOF_E_EQ_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 4=1/\ SUC 1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 4=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4/\ 4 MOD 4=0/\ SUC 0=1 /\ SUC 4=5/\ 5 MOD 4=1`;SET_RULE`(a:num) IN (:num)`]
;;
let IN_NOT_EMPTY_B1_SY_4=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (
d_tame 4) (
cs_adj 4 (&2) (&2 * h0)) (
cs_adj 4 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4<4 ==> x' MOD 4 = 0 \/ x' MOD 4 = 1 \/ x' MOD 4 = 2 \/ x' MOD 4 = 3`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_4 `4`;
VV_IN_BALL_ANNULUS_TAC_4 `1`;
VV_IN_BALL_ANNULUS_TAC_4 `2`;
VV_IN_BALL_ANNULUS_TAC_4 `3`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+4:num`;`i:num`;`4:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 4)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`4`][ARITH_RULE`~(4=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 4<4)==> (i MOD 4=0) \/ (i MOD 4=1) \/ (i MOD 4=2)\/ (i MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_4 `4`;
PROVE_INEQUALITY_TAC_4 `1`;
PROVE_INEQUALITY_TAC_4 `2`;
PROVE_INEQUALITY_TAC_4 `3`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(4<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC4 `1`;
V_SY_EQ_IMAGE_VV_TAC4 `2`;
V_SY_EQ_IMAGE_VV_TAC4 `3`;
V_SY_EQ_IMAGE_VV_TAC4 `4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_4 `4`;
PROVE_E_SY_EQ_MOD_TAC_4 `1`;
PROVE_E_SY_EQ_MOD_TAC_4 `2`;
PROVE_E_SY_EQ_MOD_TAC_4 `3`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_4=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (
d_tame 4) (
cs_adj 4 (&2) (&2 * h0)) (
cs_adj 4 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_4_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_4
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<4`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 4=1/\ 2 MOD 4=2/\ 3 MOD 4=3/\ 0 MOD 4=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=4 <=>i=1\/ i=2\/ i=3\/ i=4`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4)
[`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4)
[`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC
]);;
(* }}} *)
let EQUALITY_V_SY_TAC_5 =
fun (th:term)->
ASM_REWRITE_TAC[]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0)`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_V_SY_EQ_5_TAC=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`1<= 1 /\ 1<= 5`]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5`]
;;
let PROVE_E_SY_EQ_5_TAC =
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4 `; SET_RULE`(a:num) IN (:num)`]
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC th`SUC 4`[ARITH_RULE`SUC 4 MOD 5=0/\ SUC 4=5`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th])
;;
let PROVE_E_SY_EQ_INV_5_TAC=
fun (th:term) ->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`5`][ARITH_RULE`~(5=0)/\ 0 MOD 5=0/\ SUC 0 MOD 5=1 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3/\ 4 MOD 5=4`]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4/\ SUC 4=5 `; SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_E_SY_EQ_INV_5_TAC=
fun (th:term) ->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`5`][ARITH_RULE`~(5=0)/\ 5 MOD 5=0/\ SUC 0 MOD 5=1 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3/\ 4 MOD 5=4`]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)/\ SUC 5 MOD 5=1
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4/\ SUC 4=5 `; SET_RULE`(a:num) IN (:num)`]
;;
let V_E_FF_CASE_5=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (
d_tame 5) (
cs_adj 5 (&2) (&2 * h0)) (
cs_adj 5 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 4;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4\/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
EQUALITY_V_SY_TAC_5 `1`;
EQUALITY_V_SY_TAC_5 `2`;
EQUALITY_V_SY_TAC_5 `3`;
EQUALITY_V_SY_TAC_5 `4`;
EQUALITY_V_SY_TAC_5 `0`;];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5 ==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_5_TAC`5`;
PROVE_V_SY_EQ_5_TAC`1`;
PROVE_V_SY_EQ_5_TAC`2`;
PROVE_V_SY_EQ_5_TAC`3`;
PROVE_V_SY_EQ_5_TAC`4`;];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5`;
PROVE_E_SY_EQ_INV_5_TAC `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` ;
PROVE_E_SY_EQ_INV_5_TAC `3` ;
PROVE_E_SY_EQ_INV_5_TAC `4` ;];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5`;
PROVE_E_SY_EQ_INV_5_TAC `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` ;
PROVE_E_SY_EQ_INV_5_TAC `3` ;
PROVE_E_SY_EQ_INV_5_TAC `4` ;];
]);;
(* }}} *)
let IN_BALL_ANNUUS_TAC_5 =
fun (th:term)->
ASM_SIMP_TAC[]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[SET_RULE`(a:num) IN(:num)`]
;;
let INEQUALITY_A_B_TAC_50 =
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0)`]
THEN REPLICATE_TAC 13 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0) /\ ~(1=4)/\ ~(2=3) /\ ~(2=0) /\ ~(3=0)/\ ~(0=4)/\ ~(2=4)
/\ ~(3=4)`]);;
let INEQUALITY_A_B_TAC_5 =
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 5==> i=1\/ i=2\/ i=3\/ i=4 \/ i=5`)
THEN RESA_TAC
THENL[
INEQUALITY_A_B_TAC_50 `1` th;
INEQUALITY_A_B_TAC_50 `2` th;
INEQUALITY_A_B_TAC_50 `3` th;
INEQUALITY_A_B_TAC_50 `4` th;
INEQUALITY_A_B_TAC_50 `0` th;];;
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_5=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=5 /\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)/\ ~(4=0) /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`] )
;;
let PROVE_INEQUALITY_TAC_50=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=5 /\ 5<=5/\ 1<=1 /\ 1<=5/\ 1<=2 /\ 2<=5/\1<=3 /\ 3<=5/\ 1<=4/\ 4<=5`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`5`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 5=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 5=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 5=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`]
THEN MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 5=4/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`])
THEN MRESAL1_TAC th2`5`[ARITH_RULE`5 MOD 5=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_5
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`5 MOD 5=0/\ 1 MOD 5=1/\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ 4 MOD 5=4`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_50 th `5`;
PROVE_INEQUALITY_TAC_50 th `1`;
PROVE_INEQUALITY_TAC_50 th `2`;
PROVE_INEQUALITY_TAC_50 th `3`;
PROVE_INEQUALITY_TAC_50 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_RULE`1 MOD 5=1 /\ ~(1=0) /\ 2 MOD 5=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 5=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 5=4/\ 5 MOD 5=0/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`];;
let PROVE_E_SY_EQ_MOD_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) `]
THEN ARITH_TAC;;
let PROOF_E_EQ_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 5=1/\ SUC 1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 5=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4
/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) /\ 4 MOD 5=4/\ 5 MOD 5=0/\ SUC 0=1
/\ SUC 5=6/\ SUC 4=5/\ 6 MOD 5=1`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_E_SY_EQ_IMAGE_VV_5=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1/\ 1<=5/\ 5<=5/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 5=4/\ 5 MOD 5=0 /\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 5=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=5 /\ 3<=5 /\ 4<=5/\ 1<=4/\ 4+1=5
/\ 1<=3/\ 3<=4/\ 3+1=4/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)`])
;;
let IN_NOT_EMPTY_B1_SY_5=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (
d_tame 5) (
cs_adj 5 (&2) (&2 * h0)) (
cs_adj 5 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5<5 ==> x' MOD 5 = 0 \/ x' MOD 5 = 1 \/ x' MOD 5 = 2 \/ x' MOD 5 = 3\/ x' MOD 5 = 4`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_5 `5`;
VV_IN_BALL_ANNULUS_TAC_5 `1`;
VV_IN_BALL_ANNULUS_TAC_5 `2`;
VV_IN_BALL_ANNULUS_TAC_5 `3`;
VV_IN_BALL_ANNULUS_TAC_5 `4`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+5:num`;`i:num`;`5:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 5)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`5`][ARITH_RULE`~(5=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 5<5)==> (i MOD 5=0) \/ (i MOD 5=1) \/ (i MOD 5=2)\/ (i MOD 5=3) \/ (i MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_5 `5`;
PROVE_INEQUALITY_TAC_5 `1`;
PROVE_INEQUALITY_TAC_5 `2`;
PROVE_INEQUALITY_TAC_5 `3`;
PROVE_INEQUALITY_TAC_5 `4`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(5<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC5 `1`;
V_SY_EQ_IMAGE_VV_TAC5 `2`;
V_SY_EQ_IMAGE_VV_TAC5 `3`;
V_SY_EQ_IMAGE_VV_TAC5 `4`;
V_SY_EQ_IMAGE_VV_TAC5 `5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3)\/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_5 `5`;
PROVE_E_SY_EQ_MOD_TAC_5 `1`;
PROVE_E_SY_EQ_MOD_TAC_5 `2`;
PROVE_E_SY_EQ_MOD_TAC_5 `3`;
PROVE_E_SY_EQ_MOD_TAC_5 `4`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_5=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (
d_tame 5) (
cs_adj 5 (&2) (&2 * h0)) (
cs_adj 5 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_5_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_5
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<5`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 4;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 5=1/\ 2 MOD 5=2/\ 3 MOD 5=3/\ 0 MOD 5=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) /\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)/\ 4 MOD 5=4`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=5 <=>i=1\/ i=2\/ i=3\/ i=4\/ i=5`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `4`;num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5)
[`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5)
[`
vector [vv 1; vv 2; vv 3; vv 4;vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC;
]);;
(* }}} *)
let IN_BALL_ANNUUS_TAC_6 =
fun (th:term)->
ASM_SIMP_TAC[]
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6/\6<=6`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[SET_RULE`(a:num) IN(:num)`]
;;
let INEQUALITY_A_B_TAC_60 =
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(1=0)`]
THEN REPLICATE_TAC 14 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(1=0) /\ ~(1=4)/\ ~(2=3) /\ ~(2=0) /\ ~(3=0)/\ ~(0=4)/\ ~(2=4)
/\ ~(3=4)/\ ~(1=5)/\ ~(2=5)/\ ~(3=5)/\ ~(4=5)/\ ~(0=5)`]);;
let INEQUALITY_A_B_TAC_6 =
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 6==> i=1\/ i=2\/ i=3\/ i=4 \/ i=5 \/ i=6`)
THEN RESA_TAC
THENL[
INEQUALITY_A_B_TAC_60 `1` th;
INEQUALITY_A_B_TAC_60 `2` th;
INEQUALITY_A_B_TAC_60 `3` th;
INEQUALITY_A_B_TAC_60 `4` th;
INEQUALITY_A_B_TAC_60 `5` th;
INEQUALITY_A_B_TAC_60 `0` th;];;
let EQUALITY_V_SY_TAC_6 =
fun (th:term)->
ASM_REWRITE_TAC[]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(1=0)`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_V_SY_EQ_6_TAC=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`1<= 1 /\ 1<= 5`]
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(1=0)`;SET_RULE`(a:num) IN (:num)`]
THEN ARITH_TAC
;;
let PROVE_E_SY_EQ_6_TAC =
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4 /\ SUC 4=5 `; SET_RULE`(a:num) IN (:num)`]
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`6`;`vv:num-> real^3`][ARITH_RULE`~(6=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC th`SUC 5`[ARITH_RULE`SUC 5 MOD 6=0/\ SUC 5=6`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th])
;;
let PROVE_E_SY_EQ_INV_6_TAC=
fun (th:term) ->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`6`][ARITH_RULE`~(6=0)/\ 0 MOD 6=0/\ SUC 0 MOD 6=1 /\ 1 MOD 6=1 /\ 2 MOD 6=2 /\ 3 MOD 6=3/\ 4 MOD 6=4 /\ 5 MOD 6=5/\ 6 MOD 6=0 `]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_6[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 5`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=6/\ 2<=6/\ 3<=6/\ 4<=6/\ 5<=6 /\ 6<=6 /\ 0 MOD 6= 0 /\ 1 MOD 6= 1 /\ 2 MOD 6= 2/\ 3 MOD 6= 3 /\ 4 MOD 6= 4 /\ 5 MOD 6=5 /\ 6 MOD 6=0 /\ ~(2=1)
/\ SUC 0 MOD 6= 1 /\ SUC 1 MOD 6= 2 /\ SUC 2 MOD 6= 3/\ SUC 3 MOD 6= 4
/\ SUC 4 MOD 6= 5 /\ SUC 5 MOD 6 = 0 /\ SUC 6 MOD 6 =1 /\ ~(3=1)/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4 /\ SUC 4=5 /\ SUC 5=6`; SET_RULE`(a:num) IN (:num)`]
;;
let V_E_FF_CASE_6=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 6 (
d_tame 6) (
cs_adj 6 (&2) (&2 * h0)) (
cs_adj 6 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 4;(vv:num->real^3) 5;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(6<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 6)<=> (i=1\/ i=2\/ i=3 \/ i=4\/ i=5 \/ i=6)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
EQUALITY_V_SY_TAC_6 `1`;
EQUALITY_V_SY_TAC_6 `2`;
EQUALITY_V_SY_TAC_6 `3`;
EQUALITY_V_SY_TAC_6 `4`;
EQUALITY_V_SY_TAC_6 `5`;
EQUALITY_V_SY_TAC_6 `0`;];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5 \/ i=6)<=> (1<= i /\ i<= 6)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`6`;`vv:num-> real^3`][ARITH_RULE`~(6=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 6 < 6 ==> x' MOD 6 =0 \/ x' MOD 6 = 1\/ x' MOD 6 = 2 \/ x' MOD 6 =3 \/ x' MOD 6 =4 \/ x' MOD 6 =5`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_6_TAC`6`;
PROVE_V_SY_EQ_6_TAC`1`;
PROVE_V_SY_EQ_6_TAC`2`;
PROVE_V_SY_EQ_6_TAC`3`;
PROVE_V_SY_EQ_6_TAC`4`;
PROVE_V_SY_EQ_6_TAC`5`;];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 6)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5\/ i=6)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_6_TAC `1`;
PROVE_E_SY_EQ_6_TAC `2`;
PROVE_E_SY_EQ_6_TAC `3`;
PROVE_E_SY_EQ_6_TAC `4`;
PROVE_E_SY_EQ_6_TAC `5`;
PROVE_E_SY_EQ_6_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5 \/ i=6)<=> (1<= i /\ i<= 6)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`6`;`vv:num-> real^3`][ARITH_RULE`~(6=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 6 < 6==> x' MOD 6 =0 \/ x' MOD 6 = 1\/ x' MOD 6 = 2 \/ x' MOD 6 =3 \/ x' MOD 6 =4 \/ x' MOD 6 =5`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_6_TAC `6`;
PROVE_E_SY_EQ_INV_6_TAC `1`;
PROVE_E_SY_EQ_INV_6_TAC `2`;
PROVE_E_SY_EQ_INV_6_TAC `3`;
PROVE_E_SY_EQ_INV_6_TAC `4`;
PROVE_E_SY_EQ_INV_6_TAC `5`;];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 6)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5 \/ i=6)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_6_TAC `1`;
PROVE_E_SY_EQ_6_TAC `2`;
PROVE_E_SY_EQ_6_TAC `3`;
PROVE_E_SY_EQ_6_TAC `4`;
PROVE_E_SY_EQ_6_TAC `5`;
PROVE_E_SY_EQ_6_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5 \/ i=6)<=> (1<= i /\ i<= 6)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`6`;`vv:num-> real^3`][ARITH_RULE`~(6=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 6 < 6==> x' MOD 6 =0 \/ x' MOD 6 = 1\/ x' MOD 6 = 2 \/ x' MOD 6 =3 \/ x' MOD 6 =4 \/ x' MOD 6 =5`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_6_TAC `6`;
PROVE_E_SY_EQ_INV_6_TAC `1`;
PROVE_E_SY_EQ_INV_6_TAC `2`;
PROVE_E_SY_EQ_INV_6_TAC `3`;
PROVE_E_SY_EQ_INV_6_TAC `4`;
PROVE_E_SY_EQ_INV_6_TAC `5`;];
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_6=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=6 /\ 2<=6/\ 3<=6/\ 4<=6/\ 6<=6/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)/\ ~(4=0) /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)/\ 1<=5/\ 5<=6
/\ ~(5=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3) /\ ~(5=4)`] )
;;
let PROVE_INEQUALITY_TAC_60=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=6 /\ 6<=6/\ 1<=1 /\ 1<=6/\ 1<=2 /\ 2<=6/\1<=3 /\ 3<=6/\ 1<=4/\ 4<=6/\ 1<=5/\ 5<=6`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`6`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 6=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 6=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 6=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`]
THEN MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 6=4/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`]
THEN MRESAL1_TAC th3`5`[ARITH_RULE`5 MOD 6=5/\ ~(5=0)/\ ~(5=1)/\ ~(5=2)/\ ~(5=3)/\ ~(5=4)`])
THEN MRESAL1_TAC th2`6`[ARITH_RULE`6 MOD 6=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_6
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`6 MOD 6=0/\ 1 MOD 6=1/\ 2 MOD 6=2 /\ 3 MOD 6=3 /\ 4 MOD 6=4/\ 5 MOD 6=5`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_60 th `6`;
PROVE_INEQUALITY_TAC_60 th `1`;
PROVE_INEQUALITY_TAC_60 th `2`;
PROVE_INEQUALITY_TAC_60 th `3`;
PROVE_INEQUALITY_TAC_60 th `4`;
PROVE_INEQUALITY_TAC_60 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_RULE`1 MOD 6=1 /\ ~(1=0) /\ 2 MOD 6=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 6=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 6=4/\ 5 MOD 6=5/\ 6 MOD 6=0 /\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)
/\ ~(5=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3) /\ ~(5=4)`];;
let PROVE_E_SY_EQ_MOD_TAC_6=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)/\ ~(5=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3) /\ ~(5=4) `]
THEN ARITH_TAC;;
let PROOF_E_EQ_TAC_6=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 6=1/\ SUC 1=2/\ 2 MOD 6=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 6=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4
/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) /\ 4 MOD 6=4/\ 6 MOD 6=0/\ SUC 0=1
/\ SUC 5=6/\ SUC 4=5/\ 7 MOD 6=1/\ 5 MOD 6=5/\ SUC 6=7
/\ ~(5=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3) /\ ~(5=4)
`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_E_SY_EQ_IMAGE_VV_6=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`6`][ARITH_RULE`~(6=0) /\ 1 MOD 6=1/\ 1<=6/\ 6<=6/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 1 MOD 6=1/\ SUC 1=2/\ 2 MOD 6=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 6=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4
/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) /\ 4 MOD 6=4/\ 6 MOD 6=0/\ SUC 0=1
/\ SUC 5=6/\ SUC 4=5/\ 7 MOD 6=1/\ 5 MOD 6=5/\ SUC 6=7
/\ ~(5=0) /\ ~(5=1)/\ ~(5=2)/\ ~(5=3) /\ ~(5=4)/\3<=6/\ 4+1=5/\ 5+1=6
/\ 0+1=1/\ 1<=1 /\1+1=2/\ 1<=2/\ 2+1=3/\ 1<=3/\ 3+1=4/\ 2<=6
/\ 1<=4/\ 4<=6/\ 1<=5/\ 5<=6`])
;;
let IN_NOT_EMPTY_B1_SY_6=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 6 (
d_tame 6) (
cs_adj 6 (&2) (&2 * h0)) (
cs_adj 6 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =6` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(6<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(6<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 6<6 ==> x' MOD 6 = 0 \/ x' MOD 6 = 1 \/ x' MOD 6 = 2 \/ x' MOD 6 = 3\/ x' MOD 6 = 4 \/ x' MOD 6 = 5`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_6 `6`;
VV_IN_BALL_ANNULUS_TAC_6 `1`;
VV_IN_BALL_ANNULUS_TAC_6 `2`;
VV_IN_BALL_ANNULUS_TAC_6 `3`;
VV_IN_BALL_ANNULUS_TAC_6 `4`;
VV_IN_BALL_ANNULUS_TAC_6 `5`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+6:num`;`i:num`;`6:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 6)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`6`][ARITH_RULE`~(6=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`6`][ARITH_RULE`~(6=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`6`][ARITH_RULE`~(6=0)`]
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 RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_6 `6`;
PROVE_INEQUALITY_TAC_6 `1`;
PROVE_INEQUALITY_TAC_6 `2`;
PROVE_INEQUALITY_TAC_6 `3`;
PROVE_INEQUALITY_TAC_6 `4`;
PROVE_INEQUALITY_TAC_6 `5`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(6<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 6)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5\/ i=6`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC6 `1`;
V_SY_EQ_IMAGE_VV_TAC6 `2`;
V_SY_EQ_IMAGE_VV_TAC6 `3`;
V_SY_EQ_IMAGE_VV_TAC6 `4`;
V_SY_EQ_IMAGE_VV_TAC6 `5`;
V_SY_EQ_IMAGE_VV_TAC6 `6`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 6<6)==> (x' MOD 6=0) \/ (x' MOD 6=1) \/ (x' MOD 6=2)\/ (x' MOD 6=3)\/ (x' MOD 6=4) \/ (x' MOD 6=5)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_6 `6`;
PROVE_E_SY_EQ_MOD_TAC_6 `1`;
PROVE_E_SY_EQ_MOD_TAC_6 `2`;
PROVE_E_SY_EQ_MOD_TAC_6 `3`;
PROVE_E_SY_EQ_MOD_TAC_6 `4`;
PROVE_E_SY_EQ_MOD_TAC_6 `5`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 6)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5\/ i=6`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_6`1`;
PROOF_E_EQ_TAC_6`2`;
PROOF_E_EQ_TAC_6`3`;
PROOF_E_EQ_TAC_6`4`;
PROOF_E_EQ_TAC_6`5`;
PROOF_E_EQ_TAC_6`6`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 6<6)==> (x' MOD 6=0) \/ (x' MOD 6=1) \/ (x' MOD 6=2)\/ (x' MOD 6=3) \/ (x' MOD 6=4) \/ (x' MOD 6=5)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_6 `6`;
PROVE_E_SY_EQ_IMAGE_VV_6 `1`;
PROVE_E_SY_EQ_IMAGE_VV_6 `2`;
PROVE_E_SY_EQ_IMAGE_VV_6 `3`;
PROVE_E_SY_EQ_IMAGE_VV_6 `4`;
PROVE_E_SY_EQ_IMAGE_VV_6 `5`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 6)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5\/ i=6`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_6`1`;
PROOF_E_EQ_TAC_6`2`;
PROOF_E_EQ_TAC_6`3`;
PROOF_E_EQ_TAC_6`4`;
PROOF_E_EQ_TAC_6`5`;
PROOF_E_EQ_TAC_6`6`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`6`][ARITH_RULE`~(6=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 6<6)==> (x' MOD 6=0) \/ (x' MOD 6=1) \/ (x' MOD 6=2)\/ (x' MOD 6=3) \/ (x' MOD 6=4) \/ (x' MOD 6=5)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_6 `6`;
PROVE_E_SY_EQ_IMAGE_VV_6 `1`;
PROVE_E_SY_EQ_IMAGE_VV_6 `2`;
PROVE_E_SY_EQ_IMAGE_VV_6 `3`;
PROVE_E_SY_EQ_IMAGE_VV_6 `4`;
PROVE_E_SY_EQ_IMAGE_VV_6 `5`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_6=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 6 (
d_tame 6) (
cs_adj 6 (&2) (&2 * h0)) (
cs_adj 6 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_6_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_6
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =6` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(6
<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<6
`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_6)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 4;vv1 5;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 6=1/\ 2 MOD 6=2/\ 3 MOD 6=3/\ 0 MOD 6
=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) /\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)/\ 4 MOD 6=4/\ 5 MOD 6=5/\ ~(1=5)/\ ~(2=5)/\ ~(3=5)/\ ~(4=5)/\ ~(0=5)`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=6
<=>i=1\/ i=2\/ i=3\/ i=4\/ i=5\/ i=6`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `4`;num_CONV `5`;num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_6)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_6)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_6)
[`
vector [ww 1; ww 2; ww 3; ww 4; ww 5; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 5; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_6
)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 4; ww 5;ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4; ww 5; ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 4; ww 5; ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_6
)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_6
)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_6
)
[`
vector [vv 1; vv 2; vv 3; vv 4;vv 5;vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4;vv 5; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_6
)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 4; vv 5;vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 5; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 5; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC;
]);;
(* }}} *)
let V_E_FF_CASE_5_sqrt8=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (
cs_adj 5 (&2) (sqrt8)) (
cs_adj 5 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 4;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4\/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
EQUALITY_V_SY_TAC_5 `1`;
EQUALITY_V_SY_TAC_5 `2`;
EQUALITY_V_SY_TAC_5 `3`;
EQUALITY_V_SY_TAC_5 `4`;
EQUALITY_V_SY_TAC_5 `0`;];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5 ==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_5_TAC`5`;
PROVE_V_SY_EQ_5_TAC`1`;
PROVE_V_SY_EQ_5_TAC`2`;
PROVE_V_SY_EQ_5_TAC`3`;
PROVE_V_SY_EQ_5_TAC`4`;];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5`;
PROVE_E_SY_EQ_INV_5_TAC `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` ;
PROVE_E_SY_EQ_INV_5_TAC `3` ;
PROVE_E_SY_EQ_INV_5_TAC `4` ;];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`;];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5`;
PROVE_E_SY_EQ_INV_5_TAC `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` ;
PROVE_E_SY_EQ_INV_5_TAC `3` ;
PROVE_E_SY_EQ_INV_5_TAC `4` ;];
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_5=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=5 /\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)/\ ~(4=0) /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`] )
;;
let PROVE_INEQUALITY_TAC_50=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=5 /\ 5<=5/\ 1<=1 /\ 1<=5/\ 1<=2 /\ 2<=5/\1<=3 /\ 3<=5/\ 1<=4/\ 4<=5`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`5`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 5=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 5=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 5=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`]
THEN MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 5=4/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`])
THEN MRESAL1_TAC th2`5`[ARITH_RULE`5 MOD 5=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_5_sqrt8
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`5 MOD 5=0/\ 1 MOD 5=1/\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ 4 MOD 5=4`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_50 th `5`;
PROVE_INEQUALITY_TAC_50 th `1`;
PROVE_INEQUALITY_TAC_50 th `2`;
PROVE_INEQUALITY_TAC_50 th `3`;
PROVE_INEQUALITY_TAC_50 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_RULE`1 MOD 5=1 /\ ~(1=0) /\ 2 MOD 5=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 5=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 5=4/\ 5 MOD 5=0/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`];;
let PROVE_E_SY_EQ_MOD_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) `]
THEN ARITH_TAC;;
let PROOF_E_EQ_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 5=1/\ SUC 1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 5=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4
/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) /\ 4 MOD 5=4/\ 5 MOD 5=0/\ SUC 0=1
/\ SUC 5=6/\ SUC 4=5/\ 6 MOD 5=1`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_E_SY_EQ_IMAGE_VV_5=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1/\ 1<=5/\ 5<=5/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 5=4/\ 5 MOD 5=0 /\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 5=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=5 /\ 3<=5 /\ 4<=5/\ 1<=4/\ 4+1=5
/\ 1<=3/\ 3<=4/\ 3+1=4/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)`])
;;
let IN_NOT_EMPTY_B1_SY_5_sqrt8=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (
cs_adj 5 (&2) (sqrt8)) (
cs_adj 5 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5<5 ==> x' MOD 5 = 0 \/ x' MOD 5 = 1 \/ x' MOD 5 = 2 \/ x' MOD 5 = 3\/ x' MOD 5 = 4`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_5 `5`;
VV_IN_BALL_ANNULUS_TAC_5 `1`;
VV_IN_BALL_ANNULUS_TAC_5 `2`;
VV_IN_BALL_ANNULUS_TAC_5 `3`;
VV_IN_BALL_ANNULUS_TAC_5 `4`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+5:num`;`i:num`;`5:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 5)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`5`][ARITH_RULE`~(5=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 5<5)==> (i MOD 5=0) \/ (i MOD 5=1) \/ (i MOD 5=2)\/ (i MOD 5=3) \/ (i MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_5 `5`;
PROVE_INEQUALITY_TAC_5 `1`;
PROVE_INEQUALITY_TAC_5 `2`;
PROVE_INEQUALITY_TAC_5 `3`;
PROVE_INEQUALITY_TAC_5 `4`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(5<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC5 `1`;
V_SY_EQ_IMAGE_VV_TAC5 `2`;
V_SY_EQ_IMAGE_VV_TAC5 `3`;
V_SY_EQ_IMAGE_VV_TAC5 `4`;
V_SY_EQ_IMAGE_VV_TAC5 `5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3)\/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_5 `5`;
PROVE_E_SY_EQ_MOD_TAC_5 `1`;
PROVE_E_SY_EQ_MOD_TAC_5 `2`;
PROVE_E_SY_EQ_MOD_TAC_5 `3`;
PROVE_E_SY_EQ_MOD_TAC_5 `4`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_5_sqrt8=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (
cs_adj 5 (&2) (sqrt8)) (
cs_adj 5 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_5_sqrt8_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_5_sqrt8
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<5`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_sqrt8)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 4;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 5=1/\ 2 MOD 5=2/\ 3 MOD 5=3/\ 0 MOD 5=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) /\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)/\ 4 MOD 5=4`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=5 <=>i=1\/ i=2\/ i=3\/ i=4\/ i=5`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `4`;num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_sqrt8)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_sqrt8)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_sqrt8)
[`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5_sqrt8)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_sqrt8)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_sqrt8)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_sqrt8)
[`
vector [vv 1; vv 2; vv 3; vv 4;vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5_sqrt8)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC;
]);;
(* }}} *)
let IN_BALL_ANNUUS_TAC_5 =
fun (th:term)->
ASM_SIMP_TAC[]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[]
THEN SET_TAC[]
;;
let INEQUALITY_A_B_TAC_50 =
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0)`]
THEN REPLICATE_TAC 13 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0) /\ ~(1=4)/\ ~(2=3) /\ ~(2=0) /\ ~(3=0)/\ ~(0=4)/\ ~(2=4)
/\ ~(3=4)`;SET_RULE`{1,0}={0,1}`; ])
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESAL1_TAC th`5:num`[ARITH_RULE`5 MOD 5=0`])
THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT RESA_TAC)
;;
let INEQUALITY_A_B_TAC_5 =
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 5==> i=1\/ i=2\/ i=3\/ i=4 \/ i=5`)
THEN RESA_TAC
THENL[ INEQUALITY_A_B_TAC_50 `1` th;
INEQUALITY_A_B_TAC_50 `2` th;
INEQUALITY_A_B_TAC_50 `3` th;
INEQUALITY_A_B_TAC_50 `4` th;
INEQUALITY_A_B_TAC_50 `5` th];;
let EQUALITY_V_SY_TAC_5 =
fun (th:term)->
ASM_REWRITE_TAC[]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ 0 MOD 5= 0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ 4 MOD 5= 4 /\ 5 MOD 5=0 /\ ~(2=1)
/\ SUC 0 MOD 5= 1 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4
/\ SUC 4 MOD 5= 0 /\ SUC 5 MOD 5 = 1 /\ ~(3=1)/\ ~(1=0)`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_V_SY_EQ_5_TAC=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`1<= 1 /\ 1<= 5`]
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5`]
;;
let PROVE_E_SY_EQ_5_TAC =
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4 `; SET_RULE`(a:num) IN (:num)`]
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC th`SUC 4`[ARITH_RULE`SUC 4 MOD 5=0/\ SUC 4=5`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th])
;;
let PROVE_E_SY_EQ_INV_5_TAC=
fun (th:term) (th1:term) ->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`5`][ARITH_RULE`~(5=0)/\ 0 MOD 5=0/\ SUC 5 MOD 5=1 /\ 1 MOD 5=1 /\ 2 MOD 5=2 /\ 3 MOD 5=3/\ 4 MOD 5=4/\ 5 MOD 5=0`]
THEN EXISTS_TAC th1
THEN MRESAL_TAC VECTOR_3_5[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 4`;`(vv:num->real^3) 0`][ARITH_RULE`1<=5/\ 2<=5/\ 3<=5/\ 4<=5/\ 4 MOD 5= 4/\ 5 MOD 5=0 /\ 1 MOD 5= 1 /\ 2 MOD 5= 2/\ 3 MOD 5= 3 /\ ~(2=1)
/\ SUC 4 MOD 5= 0 /\ SUC 1 MOD 5= 2 /\ SUC 2 MOD 5= 3/\ SUC 3 MOD 5= 4/\ ~(3=1)/\ ~(1=0)/\ 5<=5/\ 1<=1 /\ 1<=2 /\ 1<= 3 /\ 1<=4 /\ 1<=5
/\ SUC 1=2 /\ SUC 0 =1/\ SUC 2=3/\ SUC 3=4/\ SUC 4=5 `; SET_RULE`(a:num) IN (:num)`]
;;
let V_E_FF_CASE_5_pro_cs=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (a_pro 5 (&2 * h0) (&2) (&2 * h0)) (a_pro 5 sqrt8 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 4;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4\/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
EQUALITY_V_SY_TAC_5 `1`;
EQUALITY_V_SY_TAC_5 `2`;
EQUALITY_V_SY_TAC_5 `3`;
EQUALITY_V_SY_TAC_5 `4`;
EQUALITY_V_SY_TAC_5 `0`];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5 ==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_5_TAC`5`;
PROVE_V_SY_EQ_5_TAC`1`;
PROVE_V_SY_EQ_5_TAC`2`;
PROVE_V_SY_EQ_5_TAC`3`;
PROVE_V_SY_EQ_5_TAC`4`];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5` `5`;
PROVE_E_SY_EQ_INV_5_TAC `1` `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` `2`;
PROVE_E_SY_EQ_INV_5_TAC `3` `3`;
PROVE_E_SY_EQ_INV_5_TAC `4` `4`;];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 5)<=> (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_5_TAC `1`;
PROVE_E_SY_EQ_5_TAC `2`;
PROVE_E_SY_EQ_5_TAC `3`;
PROVE_E_SY_EQ_5_TAC `4`;
PROVE_E_SY_EQ_5_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4 \/ i=5)<=> (1<= i /\ i<= 5)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`5`;`vv:num-> real^3`][ARITH_RULE`~(5=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5 < 5==> x' MOD 5 =0 \/ x' MOD 5 = 1\/ x' MOD 5 = 2 \/ x' MOD 5 =3 \/ x' MOD 5 =4`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_INV_5_TAC `5` `5`;
PROVE_E_SY_EQ_INV_5_TAC `1` `1`;
PROVE_E_SY_EQ_INV_5_TAC `2` `2`;
PROVE_E_SY_EQ_INV_5_TAC `3` `3`;
PROVE_E_SY_EQ_INV_5_TAC `4` `4`;];
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let SCS_A_B__EQ_MOD_5_pro_cs=prove(
`s=(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (a_pro 5 (&2 * h0) (&2) (&2 * h0)) (a_pro 5 sqrt8 (&2 * h0) upperbd))
==>
!i j.
scs_a_v39 s i j =
scs_a_v39 s (i MOD 5) (j MOD 5)/\
scs_b_v39 s i j =
scs_b_v39 s (i MOD 5) (j MOD 5)`,
let VV_IN_BALL_ANNULUS_TAC_5=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=5 /\ 2<=5/\ 3<=5/\ 4<=5/\ 5<=5/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)/\ ~(4=0) /\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`] )
;;
let PROVE_INEQUALITY_TAC_50=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=5 /\ 5<=5/\ 1<=1 /\ 1<=5/\ 1<=2 /\ 2<=5/\1<=3 /\ 3<=5/\ 1<=4/\ 4<=5`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`5`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 5=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 5=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 5=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`]
THEN MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 5=4/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`])
THEN MRESAL1_TAC th2`5`[ARITH_RULE`5 MOD 5=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_5_pro_cs
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`5 MOD 5=0/\ 1 MOD 5=1/\ 2 MOD 5=2 /\ 3 MOD 5=3 /\ 4 MOD 5=4`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_50 th `5`;
PROVE_INEQUALITY_TAC_50 th `1`;
PROVE_INEQUALITY_TAC_50 th `2`;
PROVE_INEQUALITY_TAC_50 th `3`;
PROVE_INEQUALITY_TAC_50 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_RULE`1 MOD 5=1 /\ ~(1=0) /\ 2 MOD 5=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 5=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 5=4/\ 5 MOD 5=0/\ ~(4=0)/\ ~(4=1)/\ ~(4=2)/\ ~(4=3)`];;
let PROVE_E_SY_EQ_MOD_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) `]
THEN ARITH_TAC;;
let PROOF_E_EQ_TAC_5=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 5=1/\ SUC 1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 5=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4
/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3) /\ 4 MOD 5=4/\ 5 MOD 5=0/\ SUC 0=1
/\ SUC 5=6/\ SUC 4=5/\ 6 MOD 5=1`;SET_RULE`(a:num) IN (:num)`]
;;
let PROVE_E_SY_EQ_IMAGE_VV_5=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`5`][ARITH_RULE`~(5=0) /\ 1 MOD 5=1/\ 1<=5/\ 5<=5/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 5=4/\ 5 MOD 5=0 /\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 5=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 5=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=5 /\ 3<=5 /\ 4<=5/\ 1<=4/\ 4+1=5
/\ 1<=3/\ 3<=4/\ 3+1=4/\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)`])
;;
let IN_NOT_EMPTY_B1_SY_5_pro_cs=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (a_pro 5 (&2 * h0) (&2) (&2 * h0)) (a_pro 5 sqrt8 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 5<5 ==> x' MOD 5 = 0 \/ x' MOD 5 = 1 \/ x' MOD 5 = 2 \/ x' MOD 5 = 3\/ x' MOD 5 = 4`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_5 `5`;
VV_IN_BALL_ANNULUS_TAC_5 `1`;
VV_IN_BALL_ANNULUS_TAC_5 `2`;
VV_IN_BALL_ANNULUS_TAC_5 `3`;
VV_IN_BALL_ANNULUS_TAC_5 `4`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+5:num`;`i:num`;`5:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 5)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`5`][ARITH_RULE`~(5=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 5<5)==> (i MOD 5=0) \/ (i MOD 5=1) \/ (i MOD 5=2)\/ (i MOD 5=3) \/ (i MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_5 `5`;
PROVE_INEQUALITY_TAC_5 `1`;
PROVE_INEQUALITY_TAC_5 `2`;
PROVE_INEQUALITY_TAC_5 `3`;
PROVE_INEQUALITY_TAC_5 `4`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(5<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC5 `1`;
V_SY_EQ_IMAGE_VV_TAC5 `2`;
V_SY_EQ_IMAGE_VV_TAC5 `3`;
V_SY_EQ_IMAGE_VV_TAC5 `4`;
V_SY_EQ_IMAGE_VV_TAC5 `5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3)\/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_5 `5`;
PROVE_E_SY_EQ_MOD_TAC_5 `1`;
PROVE_E_SY_EQ_MOD_TAC_5 `2`;
PROVE_E_SY_EQ_MOD_TAC_5 `3`;
PROVE_E_SY_EQ_MOD_TAC_5 `4`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 5)<=> i= 1\/ i=2 \/ i=3 \/ i=4\/ i=5`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_5`1`;
PROOF_E_EQ_TAC_5`2`;
PROOF_E_EQ_TAC_5`3`;
PROOF_E_EQ_TAC_5`4`;
PROOF_E_EQ_TAC_5`5`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`5`][ARITH_RULE`~(5=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 5<5)==> (x' MOD 5=0) \/ (x' MOD 5=1) \/ (x' MOD 5=2)\/ (x' MOD 5=3) \/ (x' MOD 5=4)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_5 `5`;
PROVE_E_SY_EQ_IMAGE_VV_5 `1`;
PROVE_E_SY_EQ_IMAGE_VV_5 `2`;
PROVE_E_SY_EQ_IMAGE_VV_5 `3`;
PROVE_E_SY_EQ_IMAGE_VV_5 `4`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_5_pro_cs=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 5 (#0.616) (a_pro 5 (&2 * h0) (&2) (&2 * h0)) (a_pro 5 sqrt8 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_5_pro_cs_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_5_pro_cs
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =5` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(5<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<5`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_pro_cs)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 4;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 5=1/\ 2 MOD 5=2/\ 3 MOD 5=3/\ 0 MOD 5=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) /\ ~(4=0) /\ ~(4=1) /\ ~(4=2) /\ ~(4=3)/\ 4 MOD 5=4`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=5 <=>i=1\/ i=2\/ i=3\/ i=4\/ i=5`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `4`;num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_pro_cs)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_pro_cs)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_pro_cs)
[`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5_pro_cs)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 4; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 4;ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_5_pro_cs)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_pro_cs)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_5_pro_cs)
[`
vector [vv 1; vv 2; vv 3; vv 4;vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_5_pro_cs)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 4; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC;
]);;
(* }}} *)
let V_E_FF_CASE_4_3=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.467) (
cs_adj 4 (&2) (&3)) (
cs_adj 4 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
PROVE_EQ_V_SY_TAC_4 `1`;
PROVE_EQ_V_SY_TAC_4 `2`;
PROVE_EQ_V_SY_TAC_4 `3`;
PROVE_EQ_V_SY_TAC_4 `0`];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_TAC `4`;
PROVE_V_SY_EQ_TAC `1`;
PROVE_V_SY_EQ_TAC `2`;
PROVE_V_SY_EQ_TAC `3`];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
EXISTS_TAC `3`
THEN MRESAL_TAC
VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`SUC 3`[ARITH_RULE`SUC 3 MOD 4=0/\ SUC 3=4`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th])
THEN SET_TAC[];
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROOF_E_EQ_IMAGE_4 `4`;
PROOF_E_EQ_IMAGE_4 `1`;
PROOF_E_EQ_IMAGE_4 `2`;
PROOF_E_EQ_IMAGE_4 `3`];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
EXISTS_TAC `3`
THEN MRESAL_TAC
VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC
th`SUC 3`[ARITH_RULE`SUC 3 MOD 4=0/\ SUC 3=4`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th])
THEN SET_TAC[];
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROOF_E_EQ_IMAGE_4 `4`;
PROOF_E_EQ_IMAGE_4 `1`;
PROOF_E_EQ_IMAGE_4 `2`;
PROOF_E_EQ_IMAGE_4 `3`];
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_4=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=4 /\ 2<=4/\ 3<=4/\ 4<=4/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) `] )
;;
let PROVE_INEQUALITY_TAC_40=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=4 /\ 4<=4/\ 1<=1 /\ 1<=4/\ 1<=2 /\ 2<=4/\1<=3 /\ 3<=4`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 4=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 4=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 4=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`])
THEN MRESAL1_TAC th2`4`[ARITH_RULE`4 MOD 4=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_4_3
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`4 MOD 4=0/\ 1 MOD 4=1/\ 2 MOD 4=2 /\ 3 MOD 4=3`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_40 th `4`;
PROVE_INEQUALITY_TAC_40 th `1`;
PROVE_INEQUALITY_TAC_40 th `2`;
PROVE_INEQUALITY_TAC_40 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_RULE`1 MOD 4=1 /\ ~(1=0) /\ 2 MOD 4=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 4=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 4=0`];;
let PROVE_E_SY_EQ_MOD_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)`]
THEN ARITH_TAC;;
let PROVE_E_SY_EQ_IMAGE_VV_4=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1/\ 1<=4/\ 4<=4/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 4=0/\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 4=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=4
/\ 1<=3/\ 3<=4/\ 3+1=4`])
;;
let PROOF_E_EQ_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 4=1/\ SUC 1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 4=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4/\ 4 MOD 4=0/\ SUC 0=1 /\ SUC 4=5/\ 5 MOD 4=1`;SET_RULE`(a:num) IN (:num)`]
;;
let IN_NOT_EMPTY_B1_SY_4_3=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.467) (
cs_adj 4 (&2) (&3)) (
cs_adj 4 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4<4 ==> x' MOD 4 = 0 \/ x' MOD 4 = 1 \/ x' MOD 4 = 2 \/ x' MOD 4 = 3`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_4 `4`;
VV_IN_BALL_ANNULUS_TAC_4 `1`;
VV_IN_BALL_ANNULUS_TAC_4 `2`;
VV_IN_BALL_ANNULUS_TAC_4 `3`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+4:num`;`i:num`;`4:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 4)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`4`][ARITH_RULE`~(4=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 4<4)==> (i MOD 4=0) \/ (i MOD 4=1) \/ (i MOD 4=2)\/ (i MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_4 `4`;
PROVE_INEQUALITY_TAC_4 `1`;
PROVE_INEQUALITY_TAC_4 `2`;
PROVE_INEQUALITY_TAC_4 `3`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(4<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC4 `1`;
V_SY_EQ_IMAGE_VV_TAC4 `2`;
V_SY_EQ_IMAGE_VV_TAC4 `3`;
V_SY_EQ_IMAGE_VV_TAC4 `4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_4 `4`;
PROVE_E_SY_EQ_MOD_TAC_4 `1`;
PROVE_E_SY_EQ_MOD_TAC_4 `2`;
PROVE_E_SY_EQ_MOD_TAC_4 `3`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_4_3=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.467) (
cs_adj 4 (&2) (&3)) (
cs_adj 4 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_4_3_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_4_3
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<4`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_3)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 4=1/\ 2 MOD 4=2/\ 3 MOD 4=3/\ 0 MOD 4=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=4 <=>i=1\/ i=2\/ i=3\/ i=4`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_3)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_3)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_3)
[`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4_3)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_3)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_3)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_3)
[`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4_3)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC
]);;
(* }}} *)
let IN_BALL_ANNULUS_TAC_4=
fun (th:term) ->
ASM_SIMP_TAC[]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`][ARITH_RULE`1<= 4 /\ 2<= 4 /\ 3<= 4 /\ 4<= 4`]
THEN MATCH_MP_TAC(SET_RULE`
vv th IN IMAGE vv (:num) /\ IMAGE vv (:num) SUBSET ball_annulus
==> vv th IN ball_annulus`)
THEN ASM_REWRITE_TAC[IMAGE;IN_ELIM_THM]
THEN EXISTS_TAC th
THEN REWRITE_TAC[SET_RULE`(a:num) IN (:num)`]
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`])
THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT RESA_TAC)
;;
let INEQUALITY_A_B_TAC_40=
fun (so:term) (so1:term)->
ASM_SIMP_TAC[change_type_v3]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 0 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(2=1)
/\ SUC 0 MOD 4= 1 /\ SUC 1 MOD 4= 2 /\ SUC 2 MOD 4= 3/\ SUC 3 MOD 4= 0/\ ~(3=1)/\ ~(1=0)`]
THEN REPLICATE_TAC 12 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][dist;ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 0 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(2=1)
/\ SUC 0 MOD 4= 1 /\ SUC 1 MOD 4= 2 /\ SUC 2 MOD 4= 3/\ SUC 3 MOD 4= 0 /\ 4 MOD 4 =0/\ SUC 4 MOD 4 =1 /\ ~(2=0)/\ ~(3=0)/\ ~(2=3)/\ ~(3=1)/\ ~(1=0)`;SET_RULE`({A,B}= {C,B})<=> A=C`;SET_RULE`({B,A}= {B,C})<=> A=C`;SET_RULE`({A,B}= {B,C})<=> A=C`;SET_RULE`{A,B}={B,A}`])
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESAL1_TAC th`4:num`[ARITH_RULE`4 MOD 4=0`])
THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT RESA_TAC)
;;
let INEQUALITY_A_B_TAC_4=
fun (th:term)->
MP_TAC(ARITH_RULE`1<= i /\ i<= 4==> i=1\/ i=2\/ i=3\/ i=4`)
THEN RESA_TAC
THENL[
INEQUALITY_A_B_TAC_40 `1` th;
INEQUALITY_A_B_TAC_40 `2` th;
INEQUALITY_A_B_TAC_40 `3` th;
INEQUALITY_A_B_TAC_40 `4` th];;
let EQ_V_SY_TAC_4=
fun (th:term)->
ASM_REWRITE_TAC[]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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 PROVE_V_SY_EQ_TAC=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`1<= 1 /\ 1<= 4`]
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ 1<=2 /\ 1<=3`]
;;
let PROVE_E_SY_EQ_TAC=
fun (th:term)->
EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4`;SET_RULE`(a:num) IN (:num)`]
THEN MRESAL_TAC(GEN_ALL PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM(fun th-> MRESAL1_TAC th`SUC 3`[ARITH_RULE`SUC 3 MOD 4=0/\ SUC 3=4`])
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]);;
let PROVE_E_SY_INV_TAC_4=
fun (th:term)->
MRESAL_TAC(GEN_ALL IMP_SUC_MOD_EQ)[`x':num`;th;`4`][ARITH_RULE`~(4=0)/\ 4 MOD 4=0/\ SUC 0 MOD 4=1/\ 1 MOD 4=1 /\ 2 MOD 4=2 /\ 3 MOD 4=3`]
THEN EXISTS_TAC th
THEN MRESAL_TAC VECTOR_3_4[`(vv:num->real^3) 1`;`(vv:num->real^3) 2`;`(vv:num->real^3) 3`;`(vv:num->real^3) 0`;][ARITH_RULE`1<=4/\ 2<=4/\ 3<=4/\ 4<=4/\ 4 MOD 4= 0 /\ 1 MOD 4= 1 /\ 2 MOD 4= 2/\ 3 MOD 4= 3/\ ~(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)/\ SUC 1=2/\ SUC 0=1 /\ SUC 2= 3/\ SUC 3=4/\ 1<=1 /\ 1<=2 /\ 1<=3`];;
let V_E_FF_CASE_4_sqrt8=prove_by_refinement(
`(s=let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.477) (a_pro 4 (&2 * h0) (&2) sqrt8) (a_pro 4 sqrt8 (&2 * h0) upperbd))
/\ vv
IN BBs_v39 s
/\
scs_k_v39 s=
dimindex(:M)
/\
vector[(vv:num->real^3) 1;(vv:num->real^3) 2;(vv:num->real^3) 3;(vv:num->real^3) 0]:real^3^M= v
/\ matvec (v:real^3^M) =a
==>
V_SY (v:real^3^M)=
IMAGE vv (:num)/\
E_SY (v:real^3^M)=
IMAGE (\i. {vv i, vv (SUC i)}) (:num)/\
F_SY (v:real^3^M)=
IMAGE (\i. vv i,vv (SUC i)) (:num)`,
(* {{{ proof *)
[
STRIP_TAC
THEN REPLICATE_TAC 4 (POP_ASSUM MP_TAC)
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39]
THEN REPEAT STRIP_TAC;
REWRITE_TAC[
V_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN STRIP_TAC
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
REPEAT STRIP_TAC
THENL[
EQ_V_SY_TAC_4 `1`;
EQ_V_SY_TAC_4 `2`;
EQ_V_SY_TAC_4 `3`;
EQ_V_SY_TAC_4 `0`];
REPEAT STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROVE_V_SY_EQ_TAC `4`;
PROVE_V_SY_EQ_TAC `1`;
PROVE_V_SY_EQ_TAC `2`;
PROVE_V_SY_EQ_TAC `3`];
REWRITE_TAC[
E_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
PROVE_E_SY_EQ_TAC `3`;
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROVE_E_SY_INV_TAC_4 `4`;
PROVE_E_SY_INV_TAC_4 `1`;
PROVE_E_SY_INV_TAC_4 `2`;
PROVE_E_SY_INV_TAC_4 `3`];
REWRITE_TAC[
F_SY;
rows]
THEN REPLICATE_TAC 2 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM
th;ARITH_RULE`(1<= i /\ i<= 4)<=> (i=1\/ i=2\/ i=3 \/ i=4)`] THEN ASSUME_TAC (SYM
th))
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN ONCE_REWRITE_TAC[GSYM
EXTENSION]
THEN EQ_TAC;
STRIP_TAC
THEN ASM_REWRITE_TAC[]
THENL[
PROVE_E_SY_EQ_TAC `1`;
PROVE_E_SY_EQ_TAC `2`;
PROVE_E_SY_EQ_TAC `3`;
PROVE_E_SY_EQ_TAC `0`];
STRIP_TAC
THEN REWRITE_TAC[ARITH_RULE` (i=1\/ i=2\/ i=3 \/ i=4)<=> (1<= i /\ i<= 4)`]
THEN MRESAL_TAC(GEN_ALL
PERIODIC_PROPERTY)[`4`;`vv:num-> real^3`][ARITH_RULE`~(4=0)`]
THEN POP_ASSUM (fun th-> MRESA1_TAC
th`x':num` THEN MRESA1_TAC
th`SUC x':num`)
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> ONCE_REWRITE_TAC[SYM
th])
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4 < 4==> x' MOD 4 =0 \/ x' MOD 4 = 1\/ x' MOD 4 = 2 \/ x' MOD 4 =3`)
THEN RESA_TAC
THENL[
PROVE_E_SY_INV_TAC_4 `4`;
PROVE_E_SY_INV_TAC_4 `1`;
PROVE_E_SY_INV_TAC_4 `2`;
PROVE_E_SY_INV_TAC_4 `3`];
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let VV_IN_BALL_ANNULUS_TAC_4=
fun (so:term)->
REPLICATE_TAC 8 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL1_TAC th so [ARITH_RULE`1<=1 /\ 1<=2 /\1<=3 /\ 1<= 4/\ 1<=4 /\ 2<=4/\ 3<=4/\ 4<=4/\ ~(1=0)/\ ~(2=0) /\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2) `] )
;;
let SCS_A_B__EQ_MOD_4_sqrt8=prove(
`s=(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.477) (a_pro 4 (&2 * h0) (&2) sqrt8) (a_pro 4 sqrt8 (&2 * h0) upperbd))
==>
!i j.
scs_a_v39 s i j =
scs_a_v39 s (i MOD 4) (j MOD 4)/\
scs_b_v39 s i j =
scs_b_v39 s (i MOD 4) (j MOD 4)`,
let PROVE_INEQUALITY_TAC_40=
fun (so:term) (so1:term)->
REPLICATE_TAC 7(POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> MRESAL_TAC th[so;so1][ARITH_RULE`1<=4 /\ 4<=4/\ 1<=1 /\ 1<=4/\ 1<=2 /\ 2<=4/\1<=3 /\ 3<=4`])
THEN POP_ASSUM( fun th->
POP_ASSUM( fun th1->
REPEAT DISCH_TAC
THEN MP_TAC th THEN MP_TAC th1
THEN POP_ASSUM(fun th2-> ONCE_REWRITE_TAC[th2]
THEN POP_ASSUM(fun th3-> MRESAL1_TAC th3`4`[ARITH_RULE`4 MOD 4=0`]
THEN MRESAL1_TAC th3`1`[ARITH_RULE`1 MOD 4=1/\ ~(1=0)`]
THEN MRESAL1_TAC th3`2`[ARITH_RULE`2 MOD 4=2/\ ~(2=0)/\ ~(2=1)`]
THEN MRESAL1_TAC th3`3`[ARITH_RULE`3 MOD 4=3/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)`])
THEN MRESAL1_TAC th2`4`[ARITH_RULE`4 MOD 4=0`])
))
THEN MP_TAC SCS_A_B__EQ_MOD_4_sqrt8
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> ONCE_REWRITE_TAC[th])
THEN ASM_REWRITE_TAC[ARITH_RULE`4 MOD 4=0/\ 1 MOD 4=1/\ 2 MOD 4=2 /\ 3 MOD 4=3`]
THEN RESA_TAC
THEN 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[
PROVE_INEQUALITY_TAC_40 th `4`;
PROVE_INEQUALITY_TAC_40 th `1`;
PROVE_INEQUALITY_TAC_40 th `2`;
PROVE_INEQUALITY_TAC_40 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_RULE`1 MOD 4=1 /\ ~(1=0) /\ 2 MOD 4=2 /\ ~(2=0)/\ ~(2=1)/\ 3 MOD 4=3 /\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\ 4 MOD 4=0`];;
let PROVE_E_SY_EQ_MOD_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(3=0)/\ ~(3=1)/\ ~(3=2)/\ ~(2=0)/\ ~(2=1)/\ ~(1=0)`]
THEN ARITH_TAC;;
let PROVE_E_SY_EQ_IMAGE_VV_4=
fun (so:term)->
EXISTS_TAC so
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)`]
THEN MRESAL_TAC MOD_ADD_MOD[`x':num`;`1:num`;`4`][ARITH_RULE`~(4=0) /\ 1 MOD 4=1/\ 1<=4/\ 4<=4/\ 0+1=1`;ADD1]
THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;ARITH_RULE`~(1=0)/\ 4 MOD 4=0/\ 0+1=1/\ 1<=1 /\ 1+1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ 2+1=3/\ 3 MOD 4=3
/\ ~(3=0)/\ ~(3=1)/\ ~(3=2)/\1<=2/\ 2<=4
/\ 1<=3/\ 3<=4/\ 3+1=4`])
;;
let PROOF_E_EQ_TAC_4=
fun (th:term)->
EXISTS_TAC th
THEN ASM_REWRITE_TAC[ARITH_RULE`~(1=0)/\ 1 MOD 4=1/\ SUC 1=2/\ 2 MOD 4=2/\ ~(2=0)/\ ~(2=1)/\ SUC 2=3 /\ 3 MOD 4=3/\ ~(3=0) /\ ~(3=1)/\ ~(3=2)/\ SUC 3=4/\ 4 MOD 4=0/\ SUC 0=1 /\ SUC 4=5/\ 5 MOD 4=1`;SET_RULE`(a:num) IN (:num)`]
;;
let IN_NOT_EMPTY_B1_SY_4_sqrt8=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.477) (a_pro 4 (&2 * h0) (&2) sqrt8) (a_pro 4 sqrt8 (&2 * h0) upperbd))=s/\
scs_k_v39 s=
dimindex(:M)/\
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`,
(* {{{ proof *)
[
REWRITE_TAC[
CONDITION1_SY;
CONDITION2_SY;
change_type_v3]
THEN REPEAT STRIP_TAC
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 5 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT STRIP_TAC)
THEN POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
th;
IN]
THEN STRIP_TAC
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;]
THEN STRIP_TAC;
ASM_REWRITE_TAC[
IMAGE;
SUBSET;
IN_ELIM_THM]
THEN REPEAT STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`x' MOD 4<4 ==> x' MOD 4 = 0 \/ x' MOD 4 = 1 \/ x' MOD 4 = 2 \/ x' MOD 4 = 3`)
THEN RESA_TAC
THENL[
VV_IN_BALL_ANNULUS_TAC_4 `4`;
VV_IN_BALL_ANNULUS_TAC_4 `1`;
VV_IN_BALL_ANNULUS_TAC_4 `2`;
VV_IN_BALL_ANNULUS_TAC_4 `3`];
STRIP_TAC;
ASM_REWRITE_TAC[periodic]
THEN GEN_TAC
THEN MRESAL_TAC
MOD_EQ[`i+4:num`;`i:num`;`4:num`;`1`][ARITH_RULE`1*A=A`];
STRIP_TAC;
REWRITE_TAC[
dist]
THEN REPEAT GEN_TAC
THEN SUBGOAL_THEN`!i. (vv:num->real^3) i= vv (i MOD 4)` ASSUME_TAC;
POP_ASSUM(fun th-> ONCE_REWRITE_TAC[
th])
THEN GEN_TAC
THEN MRESAL_TAC
MOD_MOD_REFL[`i:num`;`4`][ARITH_RULE`~(4=0)`];
POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MRESAL_TAC
DIVISION[`i:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MRESAL_TAC
DIVISION[`j:num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(i MOD 4<4)==> (i MOD 4=0) \/ (i MOD 4=1) \/ (i MOD 4=2)\/ (i MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_INEQUALITY_TAC_4 `4`;
PROVE_INEQUALITY_TAC_4 `1`;
PROVE_INEQUALITY_TAC_4 `2`;
PROVE_INEQUALITY_TAC_4 `3`];
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[ARITH_RULE`~(4<=3)`]
THEN STRIP_TAC
THEN SUBGOAL_THEN`
V_SY (v:real^3^M) =
IMAGE vv (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
V_SY;
rows;
IMAGE;
EXTENSION;
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN STRIP_TAC
THENL[
V_SY_EQ_IMAGE_VV_TAC4 `1`;
V_SY_EQ_IMAGE_VV_TAC4 `2`;
V_SY_EQ_IMAGE_VV_TAC4 `3`;
V_SY_EQ_IMAGE_VV_TAC4 `4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_MOD_TAC_4 `4`;
PROVE_E_SY_EQ_MOD_TAC_4 `1`;
PROVE_E_SY_EQ_MOD_TAC_4 `2`;
PROVE_E_SY_EQ_MOD_TAC_4 `3`];
SUBGOAL_THEN`
E_SY (v:real^3^M) =
IMAGE (\i. {vv i, vv (SUC i)}) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
E_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
SUBGOAL_THEN`
F_SY (v:real^3^M) =
IMAGE (\i. (vv i, vv (SUC i))) (:num)`ASSUME_TAC;
ASM_REWRITE_TAC[
F_SY;
rows;
IMAGE;]
THEN ONCE_REWRITE_TAC[
EXTENSION;]
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN GEN_TAC
THEN EQ_TAC;
ASM_REWRITE_TAC[ARITH_RULE`(1 <= i /\ i <= 4)<=> i= 1\/ i=2 \/ i=3 \/ i=4`]
THEN RESA_TAC
THENL[
PROOF_E_EQ_TAC_4`1`;
PROOF_E_EQ_TAC_4`2`;
PROOF_E_EQ_TAC_4`3`;
PROOF_E_EQ_TAC_4`4`];
RESA_TAC
THEN MRESAL_TAC
DIVISION[`x':num`;`4`][ARITH_RULE`~(4=0)`]
THEN MP_TAC(ARITH_RULE`(x' MOD 4<4)==> (x' MOD 4=0) \/ (x' MOD 4=1) \/ (x' MOD 4=2)\/ (x' MOD 4=3)`)
THEN RESA_TAC
THENL[
PROVE_E_SY_EQ_IMAGE_VV_4 `4`;
PROVE_E_SY_EQ_IMAGE_VV_4 `1`;
PROVE_E_SY_EQ_IMAGE_VV_4 `2`;
PROVE_E_SY_EQ_IMAGE_VV_4 `3`];
POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM
th])
THEN ASM_REWRITE_TAC[];
]);;
(* }}} *)
let XWITCCN_CASE_4_sqrt8=prove_by_refinement(
`(let upperbd = &6 in
let a_pro = (\k p a1 a2 i j. (if (i MOD k = j MOD k) then &0
else (if {i MOD k,j MOD k}={0,1} then p
else (if (j MOD k = SUC i MOD k) \/ (SUC j MOD k = i MOD k) then a1 else a2)))) in
mk_unadorned_v39 4 (#0.477) (a_pro 4 (&2 * h0) (&2) sqrt8) (a_pro 4 sqrt8 (&2 * h0) upperbd))=s
/\ vv
IN BBs_v39 s /\
taustar_v39 s vv < &0
/\
scs_k_v39 s=
dimindex(:M)
==> ~(
BBprime_v39 s = {})`,
(* {{{ proof *)
[
REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC
SCS_4_sqrt8_IS_TRI_STABLE
THEN RESA_TAC
THEN MP_TAC
NOT_EMPTY_CASE_4_sqrt8
THEN RESA_TAC
THEN REWRITE_TAC[SET_RULE`~(A={})<=> ?a. a
IN A`]
THEN ABBREV_TAC`s1 =stable_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))`
THEN MRESA_TAC
stable_sy_explicit[`(
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)`]
THEN SUBGOAL_THEN`
scs_k_v39 s =4` ASSUME_TAC;
EXPAND_TAC"s"
THEN REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;];
POP_ASSUM (fun th->
REPLICATE_TAC 11 (POP_ASSUM MP_TAC)
THEN REWRITE_TAC[
th]
THEN STRIP_TAC
THEN POP_ASSUM(fun th1-> ASSUME_TAC(SYM
th1))
THEN ASSUME_TAC
th
THEN REPEAT RESA_TAC)
THEN MRESAL_TAC (GEN_ALL
HDPLYGY)[`(
scs_k_v39 s)`;`s1:stable_sy`][
k_sy;
B_SY1;ARITH_RULE`2<4`;]
THEN POP_ASSUM (fun th->
POP_ASSUM MP_TAC
THEN ASM_REWRITE_TAC[
IN_ELIM_THM]
THEN STRIP_TAC
THEN ASSUME_TAC
th)
THEN REWRITE_TAC[
BBprime_v39;
IN]
THEN ABBREV_TAC`( vv1 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:real^3^M))`
THEN EXISTS_TAC`vv1:num->real^3`
THEN STRIP_TAC;
ONCE_REWRITE_TAC[GSYM
IN]
THEN MATCH_MP_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_sqrt8)
THEN EXISTS_TAC`x:real^(M,3)finite_product`
THEN EXISTS_TAC`v:real^3^M`
THEN ASM_REWRITE_TAC[]
THEN POP_ASSUM MP_TAC
THEN RESA_TAC;
SUBGOAL_THEN`
vector [ vv1 1; vv1 2; (vv1:num->real^3) 3;vv1 0] = v:real^3^M`
ASSUME_TAC;
POP_ASSUM(fun th-> REWRITE_TAC[GSYM
th])
THEN ASM_REWRITE_TAC[ARITH_RULE`1 MOD 4=1/\ 2 MOD 4=2/\ 3 MOD 4=3/\ 0 MOD 4=0 /\ ~(1=0)/\ ~(2=0)/\ ~(3=0)/\ ~(2=1)/\ ~(3=1)/\ ~(3=2)`;]
THEN ONCE_REWRITE_TAC[
CART_EQ]
THEN ASM_REWRITE_TAC[ARITH_RULE`1<=i/\ i<=4 <=>i=1\/ i=2\/ i=3\/ i=4`]
THEN REPEAT RESA_TAC
THEN
ASM_SIMP_TAC[
row;
vector;
LAMBDA_BETA; DIMINDEX_3;
LENGTH; ARITH] THEN
REWRITE_TAC[num_CONV `3`;num_CONV `2`; num_CONV `1`;
EL;
HD;
TL;]
THEN ASM_SIMP_TAC[
CART_EQ; DIMINDEX_3;
FORALL_3;
VEC_COMPONENT;
VECTOR_3; ARITH;
row;
LAMBDA_BETA];
STRIP_TAC;
GEN_TAC
THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[GSYM
IN]
THEN REPEAT STRIP_TAC
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_sqrt8)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_sqrt8)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_sqrt8)
[`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`s:scs_v39`;`ww:num->real^3`;`s1:stable_sy`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;]
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4_sqrt8)[`ww:num->real^3`;`
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M`;`matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 7 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [ww 1; ww 2; ww 3; ww 0]:real^3^M):real^(M,3)finite_product`);
MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_B1_SY_4_sqrt8)
[`x:real^(M,3)finite_product`;`v:real^3^M`;`vv1:num->real^3`;`s:scs_v39`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_sqrt8)[`v:real^3^M`;`s:scs_v39`;`vv1:num->real^3`;`s1:stable_sy`;`x:real^(M,3)finite_product`]
THEN MRESA_TAC ( GEN_ALL
TAUSTAR_EQ_TAU_STAR_4_sqrt8)
[`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`s:scs_v39`;`vv:num->real^3`;`s1:stable_sy`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;]
THEN REPLICATE_TAC 23 (POP_ASSUM MP_TAC)
THEN POP_ASSUM (fun th-> REPEAT STRIP_TAC THEN MP_TAC
th)
THEN MRESA_TAC (GEN_ALL
IN_NOT_EMPTY_CASE_4_sqrt8)[`vv:num->real^3`;`
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M`;`matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`;`s:scs_v39`;]
THEN REPLICATE_TAC 6 (POP_ASSUM MP_TAC)
THEN POP_ASSUM(fun th-> REPEAT STRIP_TAC
THEN MRESA1_TAC
th `matvec(
vector [vv 1; vv 2; vv 3; vv 0]:real^3^M):real^(M,3)finite_product`)
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN REAL_ARITH_TAC
]);;
(* }}} *)
let XWITCCN= prove(` !s vv .
MEM s
s_init_list_v39 /\ vv
IN BBs_v39 s
/\
taustar_v39 s vv < &0
==> ~(
BBprime_v39 s = {})`,
REPEAT GEN_TAC
THEN DISCH_TAC
THEN MP_TAC(INST_TYPE [`:3`,`:M`]
XWITCCN_TYPE)
THEN ASM_REWRITE_TAC[DIMINDEX_3]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESA_TAC
th[`s:scs_v39`;`vv:num->real^3`])
THEN MP_TAC(INST_TYPE [`:2+2`,`:M`]
XWITCCN_TYPE)
THEN ASM_REWRITE_TAC[Basics.DIMINDEX_4]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESA_TAC
th[`s:scs_v39`;`vv:num->real^3`])
THEN MP_TAC(INST_TYPE [`:2+3`,`:M`]
XWITCCN_TYPE)
THEN ASM_REWRITE_TAC[Basics.DIMINDEX_5]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESA_TAC
th[`s:scs_v39`;`vv:num->real^3`])
THEN MP_TAC(INST_TYPE [`:3+3`,`:M`]
XWITCCN_TYPE)
THEN ASM_REWRITE_TAC[Basics.DIMINDEX_6]
THEN STRIP_TAC
THEN POP_ASSUM(fun th-> MRESA_TAC
th[`s:scs_v39`;`vv:num->real^3`])
THEN ASM_TAC
THEN REWRITE_TAC[
s_init_list_v39;
JEJTVGB_assume_v39;GSYM
IN_SET_OF_LIST;
set_of_list;
LET_DEF;
LET_END_DEF
;SET_RULE`A
IN {A1,A2,A3,A4,A5,A6,A7,A8} <=> A= A1 \/ A= A2 \/ A= A3 \/ A= A4 \/ A= A5 \/ A= A6 \/ A= A7 \/ A= A8`]
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[
scs_k_v39_explicit;
scs_d_v39_explicit;
scs_a_v39_explicit;
scs_b_v39_explicit;
BBs_v39;ARITH_RULE`3<=3`;
LET_DEF;
LET_END_DEF;ARITH_RULE`~(4<=3)`;
IN;
mk_unadorned_v39;]
THEN REPEAT RESA_TAC
);;
(*
*)
end;;