(* ========================================================================= *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Authour : VU KHAC KY *)
(* Book lemma: *)
(* Chaper : Packing (Marchal Cells 3) *)
(* *)
(* ========================================================================= *)
open Sphere;;
open Euler_main_theorem;;
open Pack_defs;;
open Pack_concl;;
open Pack1;;
open Pack2;;
open Packing3;;
open Rogers;;
open Vukhacky_tactics;;
open Marchal_cells;;
open Emnwuus;;
open Marchal_cells_2;;
open Marchal_cells_2_new;;
open Urrphbz1;;
open Lepjbdj;;
open Hdtfnfz;;
open Rvfxzbu;;
open Sltstlo;;
open Urrphbz2;;
open Urrphbz3;;
open Ynhyjit;;
open Njiutiu;;
open Tezffsk;;
open Qzksykg;;
open Ddzuphj;;
open Ajripqn;;
open Qzyzmjc;;
open Upfzbzm_support_lemmas;;
let TAKE_TAC = UP_ASM_TAC THEN REPEAT STRIP_TAC;;
(* ==================================================================== *)
(* Lemma 1 *)
(* ==================================================================== *)
(* Lemma 2 *)
let ROGERS_SUBSET_VORONOI_CLOSED = prove_by_refinement (
`!V ul. saturated V /\ packing V /\ barV V 3 ul ==>
rogers V ul
SUBSET voronoi_closed V (
HD ul)`,
[(REPEAT STRIP_TAC);
(ASM_SIMP_TAC[
ROGERS_EXPLICIT]);
(NEW_GOAL `
voronoi_closed V (
HD ul) =
convex hull (
voronoi_closed V ((
HD ul):real^3))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[
CONVEX_HULL_EQ]);
(REWRITE_TAC[Packing3.CONVEX_VORONOI_CLOSED]);
(ONCE_ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Marchal_cells.CONVEX_HULL_SUBSET);
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(REWRITE_TAC[GSYM
OMEGA_LIST_N]);
(REWRITE_WITH `
voronoi_closed V (omega_list_n V ul 0) =
voronoi_list V (truncate_simplex 0 ul)`);
(ASM_REWRITE_TAC[
OMEGA_LIST_N;
TRUNCATE_SIMPLEX_EXPLICIT_0;
VORONOI_LIST;
VORONOI_SET;
set_of_list;
HD] THEN SET_TAC[]);
(NEW_GOAL `omega_list_n V ul 0
IN
voronoi_list V (truncate_simplex 0 ul)`);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(NEW_GOAL `omega_list_n V ul 1
IN
voronoi_list V (truncate_simplex 0 ul)`);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(NEW_GOAL `omega_list_n V ul 2
IN
voronoi_list V (truncate_simplex 0 ul)`);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(NEW_GOAL `omega_list_n V ul 3
IN
voronoi_list V (truncate_simplex 0 ul)`);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(ASM_SET_TAC[])]);;
(* ==================================================================== *)
(* Lemma 3 *)
let HD_IN_MCELL = prove_by_refinement (
`!V ul i r X .
packing V /\
saturated V /\
barV V 3 ul /\
X = mcell i V ul /\
~(X = {}) /\ ~(i = 0)
==> (
HD ul
IN X)`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[
HD]);
(ASM_CASES_TAC `i = 1`);
(ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell1]);
(COND_CASES_TAC);
(ASM_SIMP_TAC[
IN_DIFF;
IN_INTER;
HD;
TL;
IN_CBALL;
DIST_REFL;
TRUNCATE_SIMPLEX_EXPLICIT_1;
rcone_gt;
rconesgn]);
(REPEAT STRIP_TAC);
(REWRITE_WITH `u0 =
HD ul /\ [u0; u1; u2; u3:real^3] = ul`);
(ASM_REWRITE_TAC[
HD]);
(MATCH_MP_TAC
HD_IN_ROGERS);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
SQRT_POS_LE);
(REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[
IN;
IN_ELIM_THM; VECTOR_ARITH
`(u0 - u0)
dot (u1 - u0) = &0`;
DIST_REFL]);
(REAL_ARITH_TAC);
(NEW_GOAL `F`);
(NEW_GOAL `X:real^3->bool = {}`);
(REWRITE_TAC[ASSUME `X = mcell i V ul`; ASSUME `i = 1`;
MCELL_EXPLICIT; mcell1]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `i = 2`);
(ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell2]);
(COND_CASES_TAC);
(LET_TAC);
(ASM_SIMP_TAC[
IN_INTER;
HD;
TL;
DIST_REFL;
TRUNCATE_SIMPLEX_EXPLICIT_1;
rcone_ge;
rconesgn;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(REWRITE_TAC[VECTOR_ARITH `(u0 - u0)
dot (u1 - u0) = &0`]);
(REAL_ARITH_TAC);
(REWRITE_TAC[GSYM
NORM_POW_2; GSYM
dist; REAL_POW_2]);
(REWRITE_TAC[REAL_ARITH `a * a >= a * a * b <=> &0 <= a * a * (&1 - b)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIST_POS_LE]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIST_POS_LE]);
(ABBREV_TAC `s = hl (truncate_simplex 1 [u0; u1; u2; u3:real^3])`);
(EXPAND_TAC "a");
(REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`]);
(REWRITE_WITH `s /
sqrt (&2) <= &1 <=> s <= &1 *
sqrt (&2)`);
(MATCH_MP_TAC
REAL_LE_LDIV_EQ);
(MATCH_MP_TAC
SQRT_POS_LT THEN REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(REWRITE_WITH `[u0; u1; u2; u3:real^3] = ul`);
(ASM_REWRITE_TAC[]);
(ABBREV_TAC `m = mxi V ul`);
(ABBREV_TAC `s3 = omega_list_n V ul 3`);
(REWRITE_WITH `aff_ge {u0, u1:real^3} {m, s3} u0 <=>
u0
IN aff_ge {u0, u1} {m, s3}`);
(REWRITE_TAC[
IN]);
(NEW_GOAL `u0
IN convex hull {u0,u1,m,s3:real^3}`);
(MATCH_MP_TAC
IN_SET_IMP_IN_CONVEX_HULL_SET);
(SET_TAC[]);
(NEW_GOAL `
convex hull {u0,u1,m,s3:real^3}
SUBSET aff_ge {u0, u1} {m, s3}`);
(REWRITE_TAC[Marchal_cells_2_new.CONVEX_HULL_4_SUBSET_AFF_GE_2_2]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `X:real^3->bool = {}`);
(REWRITE_TAC[ASSUME `X = mcell i V ul`; ASSUME `i = 2`;
MCELL_EXPLICIT; mcell2]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `i = 3`);
(ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell3]);
(COND_CASES_TAC);
(REWRITE_TAC[
set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2]);
(MATCH_MP_TAC
IN_SET_IMP_IN_CONVEX_HULL_SET);
(SET_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `X:real^3->bool = {}`);
(REWRITE_TAC[ASSUME `X = mcell i V ul`; ASSUME `i = 3`;
MCELL_EXPLICIT; mcell3]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `i >= 4`);
(ASM_SIMP_TAC[
MCELL_EXPLICIT; mcell4]);
(COND_CASES_TAC);
(REWRITE_TAC[
set_of_list]);
(MATCH_MP_TAC
IN_SET_IMP_IN_CONVEX_HULL_SET);
(SET_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `X:real^3->bool = {}`);
(SIMP_TAC[ASSUME `X = mcell i V ul`; ASSUME `i >= 4`;
MCELL_EXPLICIT; mcell4]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 4 *)
let FINITE_MCELL_SET_lemma1 = prove_by_refinement (
`!V ul i r X .
packing V /\
saturated V /\
barV V 3 ul /\
X = mcell i V ul /\
X
SUBSET ball (
vec 0, r) /\
~(X = {})
==> (!u. u
IN set_of_list ul ==> u
IN ball (
vec 0, r + &6))`,
[(REPEAT STRIP_TAC);
(* Case i = 0 *)
(ASM_CASES_TAC `i = 0`);
(UNDISCH_TAC `X = mcell i V ul`THEN ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell0]);
(STRIP_TAC);
(NEW_GOAL `!s. s
IN rogers V ul ==>
dist (
HD ul, s) < &2`);
(REPEAT STRIP_TAC);
(NEW_GOAL `rogers V ul
SUBSET voronoi_closed V (
HD ul)`);
(ASM_SIMP_TAC[
ROGERS_SUBSET_VORONOI_CLOSED]);
(NEW_GOAL `s:real^3
IN voronoi_closed V (
HD ul)`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `saturated (V:real^3->bool)`);
(REWRITE_TAC[saturated]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?y. y
IN V /\
dist (s, y:real^3) < &2`);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UNDISCH_TAC `s:real^3
IN voronoi_closed V (
HD ul)` THEN REWRITE_TAC[
voronoi_closed;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (s,
HD ul) <=
dist (s,y:real^3)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(ONCE_REWRITE_TAC[
DIST_SYM] THEN ASM_REAL_ARITH_TAC);
(NEW_GOAL `?s. s:real^3
IN X`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `
dist (
HD ul, s:real^3) < &2`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(NEW_GOAL `
set_of_list (ul:(real^3)list)
SUBSET ball (
HD ul,&4)`);
(MATCH_MP_TAC
BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:real^3->bool`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Packing3.HD_IN_SET_OF_LIST);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `u:real^3
IN ball (
HD ul, &4)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN_BALL]);
(STRIP_TAC);
(NEW_GOAL `
dist (
vec 0,u) <=
dist (
vec 0, s) +
dist (s, u:real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
dist (s, u) <=
dist (s,
HD ul) +
dist (
HD ul, u:real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
dist (
vec 0,u) <=
dist (
vec 0,s) +
dist (s,
HD ul) +
dist (
HD ul,u:real^3)`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `
dist (s:real^3,
HD ul) < &2`);
(ONCE_REWRITE_TAC[
DIST_SYM] THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
dist (
vec 0,s:real^3) < r`);
(REWRITE_TAC[GSYM
IN_BALL]);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC);
(* Case i != 0 *)
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `(
HD ul):real^3
IN X`);
(MATCH_MP_TAC
HD_IN_MCELL);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `(
HD ul):real^3
IN ball (
vec 0, r)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN_BALL] THEN STRIP_TAC);
(NEW_GOAL `
dist (
vec 0,u) <=
dist (
vec 0,
HD ul) +
dist (
HD ul, u:real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
set_of_list (ul:(real^3)list)
SUBSET ball (
HD ul,&4)`);
(MATCH_MP_TAC
BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:real^3->bool`);
(ASM_REWRITE_TAC[
HD;
set_of_list]);
(SET_TAC[]);
(NEW_GOAL `u:real^3
IN ball (
HD ul, &4)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN_BALL]);
(STRIP_TAC);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 5 *)
let FINITE_MCELL_SET_LEMMA_concl =
`!V r. packing V /\ saturated V ==>
FINITE {X | X SUBSET ball (vec 0,r) /\ mcell_set V X}`;;
let FINITE_MCELL_SET_LEMMA = prove_by_refinement (
FINITE_MCELL_SET_LEMMA_concl,
[(REPEAT STRIP_TAC);
(REWRITE_WITH `FINITE {X | X SUBSET ball (vec 0,r) /\ mcell_set V X} <=>
FINITE {X | X SUBSET ball (vec 0,r) /\ mcell_set V X /\ ~(X = {})}`);
(ASM_CASES_TAC `{} IN {X | X SUBSET ball (vec 0,r) /\ mcell_set V X}`);
(REWRITE_WITH `{X | X SUBSET ball (vec 0,r) /\ mcell_set V X} =
{} INSERT {X | X SUBSET ball (vec 0,r) /\ mcell_set V X /\ ~(X = {})}`);
(ONCE_REWRITE_TAC[SET_RULE `A = B <=> B SUBSET A /\ A SUBSET B`]);
(REPEAT STRIP_TAC);
(REWRITE_TAC[INSERT_SUBSET]);
(ASM_REWRITE_TAC[]);
(SET_TAC[]);
(REWRITE_TAC[SUBSET_INSERT_DELETE]);
(ONCE_REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN_DELETE] THEN REWRITE_TAC[IN_ELIM_THM]);
(SET_TAC[]);
(REWRITE_TAC[FINITE_INSERT]);
(REWRITE_WITH `{X | X SUBSET ball (vec 0,r) /\ mcell_set V X} =
{X | X SUBSET ball (vec 0,r) /\ mcell_set V X /\ ~(X = {})}`);
(ONCE_REWRITE_TAC[SET_RULE `A = B <=> B SUBSET A /\ A SUBSET B`]);
(REPEAT STRIP_TAC);
(SET_TAC[]);
(ONCE_REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN]
THEN REWRITE_TAC[IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `{} IN {X | X SUBSET ball (vec 0,r) /\ mcell_set V X}`);
(ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(ABBREV_TAC
`S = {X | X SUBSET ball (vec 0,r) /\ mcell_set V X /\ ~(X = {})}`);
(ABBREV_TAC `s1:(real^3->bool) = V INTER ball (vec 0, r + &6)`);
(ABBREV_TAC `s2 = {ul:(real^3)list | ?u0 u1 u2 u3.
u0 IN s1 /\
u1 IN s1 /\
u2 IN s1 /\
u3 IN s1 /\
ul = [u0; u1; u2; u3]}`);
(ABBREV_TAC `s3 = {(i:num, ul:(real^3)list) | i IN 0..4 /\ ul IN s2}`);
(NEW_GOAL`S SUBSET {X| ?t. t IN s3 /\ X = (\t. mcell (FST t) V (SND t)) t}`);
(EXPAND_TAC "S" THEN EXPAND_TAC "s3");
(ONCE_REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN] THEN
REWRITE_TAC[IN_ELIM_THM; FST; SND; mcell_set]);
(REPEAT STRIP_TAC);
(EXISTS_TAC `((if i <= 4 then i else 4), ul:(real^3)list)`);
(ASM_REWRITE_TAC[FST;SND]);
(REPEAT STRIP_TAC);
(EXISTS_TAC `(if i <= 4 then i else 4)` THEN EXISTS_TAC `ul:(real^3)list`);
(REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(COND_CASES_TAC);
(ASM_REWRITE_TAC[IN_NUMSEG_0]);
(ASM_REWRITE_TAC[IN_NUMSEG_0] THEN ARITH_TAC);
(EXPAND_TAC "s2");
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC THEN ONCE_REWRITE_TAC[IN]);
(REWRITE_TAC[IN_ELIM_THM]);
(EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);
(EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `!u:real^3. u IN set_of_list ul ==> u IN s1`);
(EXPAND_TAC "s1" THEN REPEAT STRIP_TAC);
(REWRITE_TAC[IN_INTER]);
(STRIP_TAC);
(NEW_GOAL `set_of_list ul SUBSET (V:real^3->bool)`);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_MESON_TAC[IN]);
(ASM_SET_TAC[]);
(NEW_GOAL `!u:real^3. u IN set_of_list ul ==> u IN ball (vec 0,r + &6)`);
(MATCH_MP_TAC FINITE_MCELL_SET_lemma1);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `i:num` THEN
EXISTS_TAC `x:real^3->bool`);
(ASM_MESON_TAC[IN]);
(ASM_SIMP_TAC[]);
(REPEAT STRIP_TAC);
(FIRST_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[set_of_list] THEN SET_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[set_of_list] THEN SET_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[set_of_list] THEN SET_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[set_of_list] THEN SET_TAC[]);
(COND_CASES_TAC);
(REFL_TAC);
(NEW_GOAL `i >= 4`);
(ASM_ARITH_TAC);
(ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);
(MATCH_MP_TAC FINITE_SUBSET);
(EXISTS_TAC `{X | ?t. t IN s3 /\ X = (\t. mcell (FST t) V (SND t)) t}`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC FINITE_IMAGE_EXPAND);
(EXPAND_TAC "s3");
(MATCH_MP_TAC FINITE_PRODUCT);
(REWRITE_TAC[FINITE_NUMSEG]);
(EXPAND_TAC "s2");
(MATCH_MP_TAC FINITE_SET_LIST_LEMMA);
(EXPAND_TAC "s1");
(MATCH_MP_TAC Packing3.KIUMVTC);
(ASM_REWRITE_TAC[])]);;
(* ==================================================================== *)
(* Lemma 6 *)
let CARD_BOUNDARY_INT_BALL_BOUND_1 = prove_by_refinement (
`!x k1 k2. &0 < k1 /\ &0 < k2 ==>
(?C. !r. &1 <= r ==>
&(
CARD (
int_ball x (r + k1)
DIFF int_ball x (r - k2))) <= C * r pow 2)`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `?C. !r. k2 +
sqrt (&3) <= r
==> &(
CARD
(
int_ball x (r + k1)
DIFF int_ball x (r - k2))) <=
C * r pow 2`);
(MATCH_MP_TAC Vol1.bdt5_finiteness);
(ASM_REWRITE_TAC[]);
(TAKE_TAC);
(ABBREV_TAC `D = &(
CARD (
int_ball x ((k2 +
sqrt (&3)) + k1)))`);
(EXISTS_TAC `max C D`);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `k2 +
sqrt (&3) <= r`);
(NEW_GOAL
`&(
CARD (
int_ball x (r + k1)
DIFF int_ball x (r - k2))) <= C * r pow 2`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `C * r pow 2 <= max C D * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a * b <= c * b <=> &0 <= (c - a) * b`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
REAL_LE_POW_2]);
(REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `&(
CARD (
int_ball x (r + k1)
DIFF int_ball x (r - k2))) <=
&(
CARD (
int_ball x (r + k1)))`);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(SET_TAC[]);
(REWRITE_TAC[Vol1.finite_int_ball]);
(NEW_GOAL `&(
CARD (
int_ball x (r + k1))) <= D * r pow 2`);
(NEW_GOAL `&(
CARD (
int_ball x (r + k1))) <= D`);
(EXPAND_TAC "D");
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_SUBSET);
(REWRITE_TAC[Vol1.finite_int_ball;
int_ball; Pack1.hinhcau_ball;
SUBSET;
IN_INTER;
IN_BALL]);
(REWRITE_TAC[
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(ASM_SIMP_TAC[]);
(NEW_GOAL `r + k1 <= (k2 +
sqrt (&3)) + k1`);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `D <= D * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a <= a * b <=> &0 <= a * (b - &1)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(EXPAND_TAC "D" THEN REWRITE_TAC[REAL_OF_NUM_LE;
LE_0]);
(REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`]);
(ONCE_REWRITE_TAC[REAL_ARITH `&1 = (&1) pow 2`]);
(REWRITE_WITH `(&1) pow 2 <= r pow 2 <=> &1 <= r`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ] THEN MATCH_MP_TAC Collect_geom.POW2_COND_LT);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `D * r pow 2 <= max C D * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a * b <= c * b <=> &0 <= (c - a) * b`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
REAL_LE_POW_2]);
(REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 7 *)
(* The following is a simplified version of Vol1.bdt5_finiteness, Vol1.bdt7_finiteness *)
(* ==================================================================== *)
(* Lemma 8 *)
(* ==================================================================== *)
(* Lemma 9 *)
let BOUNDARY_VOLUME = prove_by_refinement (
`!p:real^3 k1 k2.
?C. (!r. &1 <= r ==>
vol (
ball (p:real^3,r + k1)
DIFF ball (p,r - k2)) <= C * r pow 2)`,
[(REPEAT STRIP_TAC);
(ABBREV_TAC
`C = &4 / &3 *
pi * (&3 * abs (k1 + k2) + &3 * k1 pow 2 + abs (k1 pow 3 + k2 pow 3))`);
(ABBREV_TAC `D = vol (
ball (p:real^3, abs (k1 + k2)))`);
(ABBREV_TAC `E = max C (D:real)`);
(EXISTS_TAC `max (E:real) (&0)`);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `r + k1 <= r - k2`);
(REWRITE_WITH `
ball (p,r + k1)
DIFF ball (p:real^3,r - k2) = {}`);
(MATCH_MP_TAC (SET_RULE `A
SUBSET B ==> A
DIFF B = {}`));
(REWRITE_TAC[
SUBSET;
IN_BALL] THEN REPEAT STRIP_TAC);
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
MEASURE_EMPTY]);
(NEW_GOAL `&0 * r pow 2 <= max E (&0) * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(ASM_REWRITE_TAC[
REAL_LE_POW_2] THEN REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(REWRITE_WITH `vol (
ball (p,r + k1)
DIFF ball (p,r - k2)) =
vol (
ball (p,r + k1)) - vol (
ball (p,r - k2))`);
(MATCH_MP_TAC
MEASURE_DIFF_SUBSET);
(REWRITE_TAC[
MEASURABLE_BALL;
SUBSET;
IN_BALL] THEN ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
VOLUME_BALL]);
(ASM_CASES_TAC `&0 <= r - k2`);
(NEW_GOAL `&0 <= r + k1`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `vol (
ball (p,r + k1)) - vol (
ball (p,r - k2)) <= C * r pow 2`);
(ASM_SIMP_TAC [
VOLUME_BALL]);
(EXPAND_TAC "C");
(REWRITE_TAC[REAL_ARITH
`x *
pi * a - x *
pi * b <= (x *
pi * c) * d <=>
&0 <= (x *
pi) * (c * d - (a - b))`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(ASM_SIMP_TAC[
REAL_LE_MUL;
REAL_LE_DIV;
PI_POS_LE; REAL_ARITH `&0 <= &3 /\ &0 <= &4`]);
(REWRITE_TAC[REAL_ARITH `(r + k1) pow 3 - (r - k2) pow 3 = &3 * (k1 + k2) *
r pow 2 + &3 * (k1 pow 2 - k2 pow 2) * r + (k1 pow 3 + k2 pow 3)`]);
(REWRITE_TAC[
REAL_ADD_RDISTRIB]);
(NEW_GOAL `(&3 * abs (k1 + k2)) * r pow 2 >=
&3 * (k1 * r pow 2 + k2 * r pow 2)`);
(REWRITE_TAC[REAL_ARITH
`(&3 * abs (k1 + k2)) * r pow 2 >= &3 * (k1 * r pow 2 + k2 * r pow 2) <=>
&0 <= &3 * r pow 2 * (abs (k1 + k2) - (k1 + k2))`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[REAL_ARITH `&0 <= &3`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
REAL_LE_POW_2]);
(REAL_ARITH_TAC);
(NEW_GOAL `(&3 * k1 pow 2) * r pow 2 >= &3 * (k1 pow 2 - k2 pow 2) * r`);
(NEW_GOAL `(&3 * k1 pow 2) * r pow 2 >= (&3 * k1 pow 2) * r`);
(REWRITE_TAC[REAL_ARITH `x * y pow 2 >= x * y <=> &0 <= x * y * (y - &1)`]);
(ASM_SIMP_TAC[
REAL_LE_MUL;
REAL_LE_POW_2; REAL_ARITH `&1 <= a ==> &0 <= a`;
REAL_ARITH `&1 <= a ==> &0 <= (a - &1)`; REAL_ARITH `&0 <= &3`]);
(NEW_GOAL `(&3 * k1 pow 2) * r >= &3 * (k1 pow 2 - k2 pow 2) * r`);
(REWRITE_TAC[REAL_ARITH `(&3 * x) * r >= &3 * (x - y) * r <=> &0 <= y * r`]);
(ASM_SIMP_TAC[
REAL_LE_MUL;
REAL_LE_POW_2; REAL_ARITH `&1 <= a ==> &0 <= a`]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `abs (k1 pow 3 + k2 pow 3) * r pow 2 >= k1 pow 3 + k2 pow 3`);
(NEW_GOAL `abs (k1 pow 3 + k2 pow 3) * r pow 2 >=
abs (k1 pow 3 + k2 pow 3)`);
(REWRITE_TAC[REAL_ARITH `x * y pow 2 >= x <=> &0 <= x * (y pow 2 - &1)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
REAL_ABS_POS]);
(REWRITE_TAC[REAL_ARITH `&0 <= a - &1 <=> &1 pow 2 <= a`]);
(REWRITE_WITH `&1 pow 2 <= r pow 2 <=> &1 <= r`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Collect_geom.POW2_COND_LT);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `C * r pow 2 <= max E (&0) * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(ASM_REWRITE_TAC[
REAL_LE_POW_2] THEN ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `r < k2`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `vol (
ball (p,r + k1)) - vol (
ball (p,r - k2)) <= D * r pow 2`);
(REWRITE_WITH `
ball (p:real^3,r - k2) = {}`);
(REWRITE_TAC[SET_RULE `s = {} <=> (!x. x
IN s ==> F)`]);
(REWRITE_TAC[
IN_BALL] THEN GEN_TAC);
(MP_TAC (MESON[
DIST_POS_LE] `&0 <=
dist (p, x:real^3)`));
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
MEASURE_EMPTY; REAL_ARITH `a - &0 = a`]);
(NEW_GOAL `vol (
ball (p,r + k1)) <= D`);
(EXPAND_TAC "D" THEN MATCH_MP_TAC
MEASURE_SUBSET);
(REWRITE_TAC[
MEASURABLE_BALL;
SUBSET;
IN_BALL]);
(REPEAT STRIP_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `D <= D * r pow 2`);
(REWRITE_TAC[REAL_ARITH `x <= x * y pow 2 <=> &0 <= x * (y pow 2 - &1)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(EXPAND_TAC "D");
(STRIP_TAC);
(MATCH_MP_TAC
MEASURE_POS_LE);
(REWRITE_TAC[
MEASURABLE_BALL]);
(REWRITE_TAC[REAL_ARITH `&0 <= a - &1 <=> &1 pow 2 <= a`]);
(REWRITE_WITH `&1 pow 2 <= r pow 2 <=> &1 <= r`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Collect_geom.POW2_COND_LT);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `D * r pow 2 <= max E (&0) * r pow 2`);
(REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(ASM_REWRITE_TAC[
REAL_LE_POW_2] THEN ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 10 *)
let PACKING_BALL_BOUNDARY = prove_by_refinement (
`!V p:real^3 k1 k2. packing V ==>
?C. !r. &1 <= r
==> &(
CARD (V
INTER ball (p,r + k1)
DIFF V
INTER ball (p,r - k2)))
<= C * r pow 2`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `?C. (!r. &1 <= r ==>
vol (
ball (p:real^3,r + k1 + &1)
DIFF ball (p,r - (k2 + &1))) <=
C * r pow 2)`);
(REWRITE_TAC[
BOUNDARY_VOLUME]);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `C:real`);
(REPEAT STRIP_TAC);
(ABBREV_TAC
`B = V
INTER ball (p,r + k1)
DIFF V
INTER ball (p:real^3,r - k2)`);
(ABBREV_TAC `f = (\u:real^3.
ball (u, &1))`);
(NEW_GOAL `FINITE (B:real^3->bool)`);
(EXPAND_TAC "B");
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `V
INTER ball (p:real^3,r + k1)`);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA] THEN ASM_SET_TAC[]);
(NEW_GOAL `
sum B (\u:real^3. vol (f u)) = &(
CARD B) * &4 / &3 *
pi`);
(EXPAND_TAC "f");
(SIMP_TAC[
VOLUME_BALL; REAL_ARITH `&0 <= &1`]);
(ASM_SIMP_TAC [
SUM_CONST]);
(REAL_ARITH_TAC);
(NEW_GOAL `
sum B (\u:real^3. vol (f u)) = vol (
UNIONS (
IMAGE f B))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
MEASURE_DISJOINT_UNIONS_IMAGE);
(EXPAND_TAC "f" THEN REWRITE_TAC[
MEASURABLE_BALL] THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[SET_RULE `
DISJOINT s t <=> !x. ~(x
IN s /\ x
IN t)`]);
(REWRITE_TAC[
IN_BALL]);
(REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[] THEN ONCE_REWRITE_TAC[
DIST_SYM] THEN STRIP_TAC);
(NEW_GOAL `
dist (u, y) <=
dist (u, x) +
dist (x, y:real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `&2 <=
dist (u, y:real^3)`);
(UNDISCH_TAC `packing V` THEN REWRITE_TAC[packing] THEN STRIP_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `vol (
UNIONS (
IMAGE f (B:real^3->bool))) <=
vol (
ball (p,r + k1 + &1)
DIFF ball (p,r - (k2 + &1)))`);
(EXPAND_TAC "f" THEN REWRITE_TAC[
IMAGE]);
(MATCH_MP_TAC
MEASURE_SUBSET);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC
MEASURABLE_UNIONS);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
MEASURABLE_BALL]);
(ASM_SIMP_TAC[
MEASURABLE_DIFF;
MEASURABLE_BALL]);
(EXPAND_TAC "B");
(REWRITE_TAC[
SUBSET;
IN_UNIONS;
IN_BALL;
IN_DIFF;
IN_INTER]);
(REWRITE_TAC[
IN_ELIM_THM;
IN]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (p, x) <=
dist (p, x') +
dist (x', x:real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
dist (x',x:real^3) < &1`);
(UNDISCH_TAC `(t:real^3->bool) x`);
(ASM_REWRITE_TAC[
ball;
IN_ELIM_THM]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `
dist (p, x':real^3) < r - k2`);
(NEW_GOAL `
dist (p, x') <=
dist (p, x) +
dist (x, x':real^3)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
dist (x,x':real^3) < &1`);
(ONCE_REWRITE_TAC[
DIST_SYM]);
(UNDISCH_TAC `(t:real^3->bool) x`);
(ASM_REWRITE_TAC[
ball;
IN_ELIM_THM]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[]);
(NEW_GOAL `&(
CARD (B:real^3->bool)) <= &(
CARD B) * &4 / &3 *
pi`);
(REWRITE_TAC [REAL_ARITH `a <= a * b <=> &0 <= a * (b - &1)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[REAL_OF_NUM_LE;
LE_0]);
(NEW_GOAL `#3.14159 <
pi`);
(REWRITE_TAC[Flyspeck_constants.bounds]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `vol (
ball (p:real^3,r + k1 + &1)
DIFF ball (p,r - (k2 + &1))) <=
C * r pow 2`);
(ASM_SIMP_TAC[]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 11 *)
let MCELL_SUBSET_BALL_4 = prove_by_refinement (
`!V X .
packing V /\
saturated V /\
mcell_set V X
==> (?p. X
SUBSET ball (p, &4))`,
[(REWRITE_TAC[
mcell_set_2;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `X:real^3->bool = {}`);
(EXISTS_TAC `(
vec 0):real^3`);
(ASM_MESON_TAC[
EMPTY_SUBSET]);
(* Case i = 0 *)
(ASM_CASES_TAC `i = 0`);
(UNDISCH_TAC `X = mcell i V ul`THEN ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell0]);
(STRIP_TAC);
(NEW_GOAL `!s. s
IN rogers V ul ==>
dist (
HD ul, s) < &2`);
(REPEAT STRIP_TAC);
(NEW_GOAL `rogers V ul
SUBSET voronoi_closed V (
HD ul)`);
(ASM_SIMP_TAC[
ROGERS_SUBSET_VORONOI_CLOSED]);
(NEW_GOAL `s:real^3
IN voronoi_closed V (
HD ul)`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `saturated (V:real^3->bool)`);
(REWRITE_TAC[saturated]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?y. y
IN V /\
dist (s, y:real^3) < &2`);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UNDISCH_TAC `s:real^3
IN voronoi_closed V (
HD ul)` THEN REWRITE_TAC[
voronoi_closed;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (s,
HD ul) <=
dist (s,y:real^3)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(ONCE_REWRITE_TAC[
DIST_SYM] THEN ASM_REAL_ARITH_TAC);
(EXISTS_TAC `
HD (ul:(real^3)list)`);
(REWRITE_TAC[
SUBSET;
IN_BALL]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (
HD ul, x:real^3) < &2`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC);
(* Case i = 4 *)
(ASM_CASES_TAC `i = 4`);
(UNDISCH_TAC `X = mcell i V ul` THEN
ASM_SIMP_TAC[
MCELL_EXPLICIT; mcell4; ARITH_RULE `4 >= 4`]);
(COND_CASES_TAC);
(STRIP_TAC);
(EXISTS_TAC `omega_list V ul`);
(NEW_GOAL `
ball (omega_list V ul,&4) =
convex hull (
ball (omega_list V ul,&4))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ] THEN REWRITE_TAC[
CONVEX_HULL_EQ;
CONVEX_BALL]);
(ONCE_ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
CONVEX_HULL_SUBSET);
(REWRITE_TAC[
SUBSET;
IN_BALL] THEN REPEAT STRIP_TAC);
(REWRITE_WITH `omega_list V ul = circumcenter (
set_of_list ul)`);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[
IN]);
(REWRITE_WITH `
dist (circumcenter (
set_of_list ul),x:real^3) = hl ul`);
(NEW_GOAL `(!x:real^3. x
IN set_of_list ul
==>
dist (circumcenter (
set_of_list ul),x) = hl ul)`);
(MATCH_MP_TAC Rogers.HL_PROPERTIES);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
sqrt (&2) <= &2`);
(REWRITE_WITH `
sqrt (&2) <= &2 <=>
sqrt (&2) pow 2 <= &2 pow 2`);
(MATCH_MP_TAC Collect_geom.POW2_COND_LT);
(ASM_SIMP_TAC[
SQRT_POS_LT; REAL_ARITH `&0 < &2`]);
(REWRITE_WITH `
sqrt (&2) pow 2 = (&2)`);
(MATCH_MP_TAC
SQRT_POW_2);
(REAL_ARITH_TAC);
(REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(STRIP_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(* Case i = 1 and i = 2 and i = 3 *)
(ABBREV_TAC `s = omega_list_n V ul (i - 1)`);
(EXISTS_TAC `s:real^3`);
(MATCH_MP_TAC (SET_RULE `(?x. A
SUBSET x /\ x
SUBSET B) ==> A
SUBSET B`));
(EXISTS_TAC `
UNIONS
{rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzksykg.QZKSYKG2);
(ASM_REWRITE_TAC[SET_RULE `i
IN {0,1,2,3,4} <=> i=0\/i=1\/i=2\/i=3\/i=4`]);
(ASM_ARITH_TAC);
(REWRITE_TAC[
SUBSET;
IN_UNIONS;
IN;
IN_ELIM_THM;
IN_BALL]);
(REPEAT STRIP_TAC);
(ABBREV_TAC `vl:(real^3)list =
left_action_list p ul`);
(NEW_GOAL `rogers V vl
SUBSET voronoi_closed V (
HD vl)`);
(MATCH_MP_TAC
ROGERS_SUBSET_VORONOI_CLOSED);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_REWRITE_TAC[SET_RULE `i
IN {0,1,2,3,4} <=> i=0\/i=1\/i=2\/i=3\/i=4`]);
(ASM_ARITH_TAC);
(ASM_SET_TAC[]);
(* -------------------------------------------------------------------------- *)
(NEW_GOAL `barV V 3 vl /\
(!j. i - 1 <= j /\ j <= 3
==> omega_list_n V vl j = omega_list_n V ul j)`);
(ASM_CASES_TAC `i <= 1`);
(UNDISCH_TAC `p
permutes 0..i - 1`);
(REWRITE_WITH `i - 1 = 0`);
(ASM_ARITH_TAC);
(REWRITE_TAC[Packing3.PERMUTES_TRIVIAL]);
(STRIP_TAC THEN EXPAND_TAC "vl" THEN REWRITE_TAC[ASSUME `p = I:num->num`;
Packing3.LEFT_ACTION_LIST_I]);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Ynhyjit.YNHYJIT);
(EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(REWRITE_TAC[SET_RULE `i
IN {2,3,4} <=> i = 2 \/ i = 3 \/ i = 4`]);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~(X = {}:real^3->bool)` THEN ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `i = 2`);
(ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell2; ARITH_RULE `2 - 1 = 1`]);
(COND_CASES_TAC);
(MESON_TAC[]);
(MESON_TAC[]);
(ASM_CASES_TAC `i = 3`);
(ASM_REWRITE_TAC[
MCELL_EXPLICIT; mcell3; ARITH_RULE `3 - 1 = 2`]);
(COND_CASES_TAC);
(MESON_TAC[]);
(MESON_TAC[]);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `s
IN voronoi_list V (truncate_simplex (i - 1) vl)`);
(REWRITE_WITH `s = omega_list_n V vl (i - 1)`);
(EXPAND_TAC "s");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_ARITH_TAC);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_IN_VORONOI_LIST);
(EXISTS_TAC `3`);
(ASM_REWRITE_TAC[] THEN ASM_ARITH_TAC);
(NEW_GOAL `s:real^3
IN voronoi_closed V (
HD vl)`);
(NEW_GOAL `voronoi_list V (truncate_simplex (i - 1) vl)
SUBSET
voronoi_closed V (
HD vl)`);
(REWRITE_TAC[
VORONOI_LIST;
VORONOI_SET]);
(NEW_GOAL `
HD (vl:(real^3)list)
IN
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(REWRITE_WITH `
HD (vl:(real^3)list) =
HD (truncate_simplex (i - 1) vl)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(ASM_ARITH_TAC);
(MATCH_MP_TAC Packing3.HD_IN_SET_OF_LIST);
(NEW_GOAL `?u0 u1 u2 u3. vl = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_CASES_TAC `i = 1`);
(ASM_REWRITE_TAC[ARITH_RULE `1 - 1 = 0`;
TRUNCATE_SIMPLEX_EXPLICIT_0;
LENGTH] THEN ARITH_TAC);
(ASM_CASES_TAC `i = 2`);
(ASM_REWRITE_TAC[ARITH_RULE `2 - 1 = 1`;
TRUNCATE_SIMPLEX_EXPLICIT_1;
LENGTH] THEN ARITH_TAC);
(ASM_CASES_TAC `i = 3`);
(ASM_REWRITE_TAC[ARITH_RULE `3 - 1 = 2`;
TRUNCATE_SIMPLEX_EXPLICIT_2;
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_SET_TAC[]);
(NEW_GOAL `
dist (s, x:real^3) <=
dist (s,
HD vl) +
dist (
HD vl, x)`);
(REWRITE_TAC[
DIST_TRIANGLE]);
(NEW_GOAL `
dist (s:real^3,
HD vl) < &2`);
(ONCE_REWRITE_TAC[
DIST_SYM] THEN REWRITE_TAC[GSYM
IN_BALL]);
(NEW_GOAL `
voronoi_closed V ((
HD vl):real^3)
SUBSET ball (
HD vl,&2)`);
(ASM_SIMP_TAC[Packing3.VORONOI_BALL2]);
(ASM_SET_TAC[]);
(NEW_GOAL `
dist (
HD vl, x:real^3) < &2`);
(REWRITE_TAC[GSYM
IN_BALL]);
(NEW_GOAL `
voronoi_closed V ((
HD vl):real^3)
SUBSET ball (
HD vl,&2)`);
(ASM_SIMP_TAC[Packing3.VORONOI_BALL2]);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 12 *)
let HL_2 = prove_by_refinement (
`!u v:real^3. hl [u; v] = inv (&2) *
dist (u, v)`,
[(REWRITE_TAC[
HL;
set_of_list; radV] THEN REPEAT GEN_TAC THEN
MATCH_MP_TAC
SELECT_UNIQUE THEN REPEAT STRIP_TAC THEN
REWRITE_TAC[
BETA_THM;
CIRCUMCENTER_2;
midpoint] THEN EQ_TAC);
(REPEAT STRIP_TAC);
(REWRITE_WITH `y =
dist (inv (&2) % (u + v),v:real^3)`);
(FIRST_ASSUM MATCH_MP_TAC THEN
REWRITE_TAC[MESON [
IN] `{a, b} s <=> s
IN {a, b}`] THEN SET_TAC[]);
(NORM_ARITH_TAC);
(REPEAT STRIP_TAC);
(NEW_GOAL `w = u \/ w = v:real^3`);
(UP_ASM_TAC THEN REWRITE_TAC[MESON [
IN] `{a, b} s <=> s
IN {a, b}`] THEN SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[] THEN NORM_ARITH_TAC);
(ASM_REWRITE_TAC[] THEN NORM_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 13 *)
let HL_LE_SQRT2_IMP_BARV_1 = prove_by_refinement (
`!V u0 u1.
saturated V /\
packing V /\
u0
IN V /\
u1
IN V /\
~(u0 = u1) /\
hl [u0;u1] <
sqrt (&2) ==> barV V 1 [u0;u1:real^3]`,
[(REPEAT STRIP_TAC);
(REWRITE_TAC[
BARV;
LENGTH; ARITH_RULE `SUC (SUC 0) = 1 + 1`]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `
LENGTH (vl:(real^3)list) = 1`);
(NEW_GOAL `initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = 0 + 1`);
(ASM_REWRITE_TAC[] THEN ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH
`initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = 0 + 1 <=>
truncate_simplex 0 [u0;u1] = vl /\ 0 + 1 <=
LENGTH [u0;u1:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_0]);
(REWRITE_TAC[
VORONOI_NONDG;
VORONOI_LIST;
VORONOI_SET;
set_of_list;
LENGTH;
SET_RULE `
INTERS {
voronoi_closed V v | v
IN {u0}} =
voronoi_closed V u0`]);
(ASM_SIMP_TAC[Packing3.AFF_DIM_VORONOI_CLOSED]);
(REPEAT STRIP_TAC);
(ARITH_TAC);
(ASM_SET_TAC[]);
(ARITH_TAC);
(ASM_CASES_TAC `
LENGTH (vl:(real^3)list) = 2`);
(NEW_GOAL `initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = 1 + 1`);
(ASM_REWRITE_TAC[] THEN ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH
`initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = 1 + 1 <=>
truncate_simplex 1 [u0;u1] = vl /\ 1 + 1 <=
LENGTH [u0;u1:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1]);
(REWRITE_TAC[
VORONOI_NONDG]);
(REWRITE_TAC[
set_of_list;
LENGTH]);
(REPEAT STRIP_TAC);
(ARITH_TAC);
(ASM_SET_TAC[]);
(REWRITE_WITH
`
aff_dim (voronoi_list V [u0; u1:real^3]) =
aff_dim (
INTERS {bis (
HD [u0; u1]) v | v | v
IN set_of_list [u0; u1]})`);
(MATCH_MP_TAC Rogers.YIFVQDV_lemma_aff_dim);
(ASM_REWRITE_TAC[
set_of_list;
AFFINE_INDEPENDENT_2] THEN ASM_SET_TAC[]);
(REWRITE_TAC[
set_of_list; SET_RULE `a
IN {b,c} <=> a =b \/ a = c`;
HD]);
(REWRITE_TAC[SET_RULE `
INTERS {bis u0 v | v | v = u0 \/ v = u1} =
bis u0 u0
INTER bis u0 u1`]);
(REWRITE_WITH `!a:real^3. bis a a = (:real^3)`);
(REWRITE_TAC[bis] THEN SET_TAC[]);
(REWRITE_TAC[SET_RULE `(:real^3)
INTER s = s`]);
(MATCH_MP_TAC (ARITH_RULE `a = &2 ==> a + &(SUC(SUC 0)) = (&4):int`));
(REWRITE_WITH `&2 = &(
dimindex (:3)) - &1:int`);
(REWRITE_TAC[DIMINDEX_3]);
(ARITH_TAC);
(REWRITE_TAC[Packing3.BIS_EQ_HYPERPLANE]);
(MATCH_MP_TAC
AFF_DIM_HYPERPLANE);
(ASM_NORM_ARITH_TAC);
(NEW_GOAL `F`);
(NEW_GOAL `initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = (
LENGTH vl - 1) + 1`);
(ASM_REWRITE_TAC[] THEN ASM_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH
`initial_sublist vl [u0; u1:real^3] /\
LENGTH vl = (
LENGTH vl - 1) + 1 <=>
truncate_simplex (
LENGTH vl - 1) [u0;u1] = vl /\
(
LENGTH vl - 1) + 1 <=
LENGTH [u0;u1:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(REWRITE_TAC[
LENGTH]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 14 *)
(* ==================================================================== *)
(* Lemma 15 *)
(* ===================================================================== *)
(* The following lemmas are in the svn 126 of HOL *)
(* To be done by John Harrison *)
(* ===================================================================== *)
(* ==================================================================== *)
(* Lemma 16 *)
(* ==================================================================== *)
(* Lemma 17 *)
(* ==================================================================== *)
(* Lemma 18 *)
(* ==================================================================== *)
(* Lemma 19 *)
(* ==================================================================== *)
(* Lemma 20 *)
(* ==================================================================== *)
(* Lemma 21 *)
(* ==================================================================== *)
(* The following lemmas help to prove that the *)
(* definition of dihX is well-defined *)
(* ==================================================================== *)
(* ==================================================================== *)
(* Lemma 22 *)
let MCELL_ID_OMEGA_LIST_N = prove_by_refinement (
`!V i j ul vl. packing V /\ saturated V /\ barV V 3 ul /\ barV V 3 vl /\
(mcell i V ul = mcell j V vl) /\
~(
negligible (mcell i V ul)) /\
i
IN {2, 3, 4} /\
j
IN {2, 3, 4} ==>
(i = j) /\ (!k. i - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V vl k)`,
[(REPEAT GEN_TAC THEN STRIP_TAC);
(NEW_GOAL `i = j /\ mcell i V ul = mcell j V vl`);
(MATCH_MP_TAC Ajripqn.AJRIPQN);
(ASM_REWRITE_TAC[SET_RULE `a
INTER a = a` ]);
(STRIP_TAC);
(ASM_SET_TAC[]);
(STRIP_TAC);
(ASM_SET_TAC[]);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `i = 4`);
(REPEAT STRIP_TAC);
(NEW_GOAL `k = 3`);
(ASM_ARITH_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `omega_list_n V ul 3 = omega_list V ul`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);
(REWRITE_WITH `omega_list_n V vl 3 = omega_list V vl`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);
(REWRITE_WITH `omega_list V ul = circumcenter (
set_of_list ul)`);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[
IN]);
(MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));
(STRIP_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(SIMP_TAC[ASSUME `i = 4`;
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(REWRITE_WITH `omega_list V vl = circumcenter (
set_of_list vl)`);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[
IN]);
(MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));
(STRIP_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `j = 4`);
(ASM_ARITH_TAC);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(AP_TERM_TAC);
(REWRITE_WITH `
set_of_list ul =
set_of_list (vl:(real^3)list) <=>
convex hull (
set_of_list ul) =
convex hull (
set_of_list vl)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.CONVEX_HULL_EQ_EQ_SET_EQ);
(STRIP_TAC);
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[
set_of_list] THEN STRIP_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(REWRITE_TAC[ASSUME `i = 4`]);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(ASM_REWRITE_TAC[
set_of_list]);
(MATCH_MP_TAC
COPLANAR_IMP_NEGLIGIBLE);
(MATCH_MP_TAC
COPLANAR_SUBSET);
(EXISTS_TAC `
affine hull {u0, u1, u2, u3:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR]);
(MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);
(MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `?u0 u1 u2 u3. vl = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[
set_of_list] THEN STRIP_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(REWRITE_TAC[ASSUME `mcell i V ul = mcell j V vl`]);
(REWRITE_WITH `j = 4`);
(ASM_ARITH_TAC);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(ASM_REWRITE_TAC[
set_of_list]);
(MATCH_MP_TAC
COPLANAR_IMP_NEGLIGIBLE);
(MATCH_MP_TAC
COPLANAR_SUBSET);
(EXISTS_TAC `
affine hull {u0, u1, u2, u3:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR]);
(MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);
(MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(MP_TAC (ASSUME `mcell i V ul = mcell j V vl`));
(REWRITE_WITH `j = 4 /\ i = 4`);
(ASM_ARITH_TAC);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(COND_CASES_TAC);
(REWRITE_TAC[]);
(NEW_GOAL `F`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `j = 4 /\ i = 4`);
(ASM_ARITH_TAC);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(REWRITE_WITH `j = 4 /\ i = 4`);
(ASM_ARITH_TAC);
(SIMP_TAC[
MCELL_EXPLICIT; ARITH_RULE `4 >= 4`;mcell4]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(* Finish the case i = 4 *)
(* ========================================================================= *)
(NEW_GOAL `mcell i V ul
SUBSET
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`);
(MATCH_MP_TAC Qzksykg.QZKSYKG2);
(ASM_REWRITE_TAC[] THEN ASM_SET_TAC[]);
(ABBREV_TAC `X = mcell i V ul`);
(NEW_GOAL `X
INTER
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1} = X`);
(ASM_SET_TAC[]);
(NEW_GOAL `~negligible (X
INTER
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1})`);
(ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
INTER_UNIONS]);
(NEW_GOAL `!s:(real^3->bool)->bool.
~negligible (
UNIONS s) /\ FINITE s ==> (?t. t
IN s /\ ~negligible t)`);
(MESON_TAC[
NEGLIGIBLE_UNIONS]);
(REWRITE_TAC[SET_RULE
`{X
INTER x | x
IN {rogers V (
left_action_list p ul) | p
permutes 0..i - 1}} =
{X
INTER rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`]);
(ABBREV_TAC
`S = {X
INTER rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`);
(STRIP_TAC);
(NEW_GOAL `(?t. t
IN (S:(real^3->bool)->bool) /\ ~negligible t)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "S");
(ABBREV_TAC `f = (\p. X
INTER rogers V (
left_action_list p ul))`);
(REWRITE_WITH
`{X
INTER rogers V (
left_action_list p ul) | p
permutes 0..i - 1} =
{f p | p
permutes 0..i-1}`);
(EXPAND_TAC "f" THEN REFL_TAC);
(ONCE_REWRITE_TAC[SET_RULE `{f x | P x} = {f x | x
IN {x | P x}}`]);
(REWRITE_TAC[SET_RULE `{f p | p
IN {x | x
permutes 0..i - 1} } =
{y | ?p. p
IN {x | x
permutes 0..i - 1} /\ y = f p}`]);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(MATCH_MP_TAC
FINITE_PERMUTATIONS);
(REWRITE_TAC[
FINITE_NUMSEG]);
(UP_ASM_TAC THEN EXPAND_TAC "S" THEN REWRITE_TAC[
IN;
IN_ELIM_THM]
THEN STRIP_TAC);
(NEW_GOAL `mcell j V vl
SUBSET
UNIONS {rogers V (
left_action_list q vl) | q
permutes 0..j - 1}`);
(MATCH_MP_TAC Qzksykg.QZKSYKG2);
(ASM_REWRITE_TAC[] THEN ASM_SET_TAC[]);
(NEW_GOAL `t
SUBSET
UNIONS {rogers V (
left_action_list q vl) | q
permutes 0..j - 1}`);
(ASM_SET_TAC[]);
(NEW_GOAL `t
INTER
UNIONS {rogers V (
left_action_list q vl) | q
permutes 0..j - 1} = t`);
(ASM_SET_TAC[]);
(NEW_GOAL `~negligible (t
INTER
UNIONS {rogers V (
left_action_list q vl) | q
permutes 0..j - 1})`);
(ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
INTER_UNIONS]);
(REWRITE_TAC[SET_RULE
`{t
INTER x | x
IN {rogers V (
left_action_list q vl) | q
permutes 0..j - 1}} =
{t
INTER rogers V (
left_action_list q vl) | q
permutes 0..j - 1}`]);
(NEW_GOAL `!s:(real^3->bool)->bool.
~negligible (
UNIONS s) /\ FINITE s ==> (?t. t
IN s /\ ~negligible t)`);
(MESON_TAC[
NEGLIGIBLE_UNIONS]);
(ABBREV_TAC
`R = {t
INTER rogers V (
left_action_list q vl) | q
permutes 0..j - 1}`);
(STRIP_TAC);
(NEW_GOAL `(?r. r
IN (R:(real^3->bool)->bool) /\ ~negligible r)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "R");
(ABBREV_TAC `f = (\q. t
INTER rogers V (
left_action_list q vl))`);
(REWRITE_WITH
`{t
INTER rogers V (
left_action_list q vl) | q
permutes 0..j - 1} =
{f q | q
permutes 0..j - 1}`);
(EXPAND_TAC "f" THEN REFL_TAC);
(ONCE_REWRITE_TAC[SET_RULE `{f x | P x} = {f x | x
IN {x | P x}}`]);
(REWRITE_TAC[SET_RULE `{f q | q
IN {x | x
permutes 0..j - 1} } =
{y | ?q. q
IN {x | x
permutes 0..j - 1} /\ y = f q}`]);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(MATCH_MP_TAC
FINITE_PERMUTATIONS);
(REWRITE_TAC[
FINITE_NUMSEG]);
(UP_ASM_TAC THEN EXPAND_TAC "R" THEN REWRITE_TAC[
IN;
IN_ELIM_THM]
THEN STRIP_TAC);
(NEW_GOAL
`rogers V (
left_action_list p ul) = rogers V (
left_action_list q vl)`);
(MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));
(STRIP_TAC);
(NEW_GOAL `
coplanar (rogers V (
left_action_list p ul)
INTER
rogers V (
left_action_list q vl))`);
(MATCH_MP_TAC Rogers.DUUNHOR);
(ASM_REWRITE_TAC[
IN]);
(STRIP_TAC);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_SET_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell j V vl`)]);
(STRIP_TAC);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[ASSUME `X:real^3->bool = {}`;
NEGLIGIBLE_EMPTY]);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `vl:(real^3)list` THEN EXISTS_TAC `j:num`);
(EXISTS_TAC `q:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_SET_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell j V vl`)]);
(STRIP_TAC);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[ASSUME `X:real^3->bool = {}`;
NEGLIGIBLE_EMPTY]);
(UNDISCH_TAC `~NULLSET r`);
(REWRITE_TAC[]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `rogers V (
left_action_list p ul)
INTER
rogers V (
left_action_list q vl)`);
(STRIP_TAC);
(ASM_SIMP_TAC[
COPLANAR_IMP_NEGLIGIBLE]);
(ASM_SET_TAC[]);
(ABBREV_TAC `xl:(real^3)list = (
left_action_list p ul)`);
(ABBREV_TAC `yl:(real^3)list = (
left_action_list q vl)`);
(NEW_GOAL `barV V 3 xl /\
(!k. i - 1 <= k /\ k <= 3
==> omega_list_n V xl k = omega_list_n V ul k)`);
(MATCH_MP_TAC Ynhyjit.YNHYJIT);
(EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `j = 2`);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[GSYM (ASSUME `mcell i V ul = X`); ASSUME `i = j:num`;
MCELL_EXPLICIT; mcell2; ASSUME `j = 2`]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[ARITH_RULE `2 - 1 = 1`]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `j = 3`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[GSYM (ASSUME `mcell i V ul = X`); ASSUME `i = j:num`;
MCELL_EXPLICIT; mcell3; ASSUME `j = 3`]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `barV V 3 yl /\
(!k. j - 1 <= k /\ k <= 3
==> omega_list_n V yl k = omega_list_n V vl k)`);
(MATCH_MP_TAC Ynhyjit.YNHYJIT);
(EXISTS_TAC `q:num->num`);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `j = 2`);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[ASSUME `X = mcell j V vl`;
MCELL_EXPLICIT; mcell2; ASSUME `j = 2`]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[ARITH_RULE `2 - 1 = 1`]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `j = 3`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `~NULLSET X`);
(REWRITE_TAC[ASSUME `X = mcell j V vl`;
MCELL_EXPLICIT; mcell3; ASSUME `j = 3`]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `!k. 0 <= k /\ k <= 3
==> omega_list_n V xl k = omega_list_n V yl k`);
(MATCH_MP_TAC Njiutiu.NJIUTIU);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
aff_dim (rogers V yl) <= &(
dimindex (:3))`);
(REWRITE_TAC[
AFF_DIM_LE_UNIV]);
(UP_ASM_TAC THEN REWRITE_TAC[DIMINDEX_3]);
(STRIP_TAC);
(NEW_GOAL `~(
aff_dim (rogers V yl) <= &2)`);
(STRIP_TAC);
(UNDISCH_TAC `~NULLSET r` THEN REWRITE_TAC[]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `rogers V yl`);
(STRIP_TAC);
(MATCH_MP_TAC
COPLANAR_IMP_NEGLIGIBLE);
(ASM_SIMP_TAC[Rogers.AFF_DIM_LE_2_IMP_COPLANAR]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(NEW_GOAL
`(!k. j - 1 <= k /\ k <= 3 ==> omega_list_n V xl k = omega_list_n V yl k)`);
(REPEAT STRIP_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `j = 2 \/ j = 3 \/ j = 4`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 23 *)
let MCELL_ID_MXI = prove_by_refinement (
`!V i j ul vl.
packing V /\
saturated V /\
barV V 3 ul /\
barV V 3 vl /\
HD ul =
HD vl /\
mcell i V ul = mcell j V vl /\
~NULLSET (mcell i V ul) /\
i
IN {2, 3} /\
j
IN {2, 3}
==> mxi V ul = mxi V vl`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `i = j /\
(!k. i - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V vl k)`);
(MATCH_MP_TAC
MCELL_ID_OMEGA_LIST_N);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_CASES_TAC `hl (truncate_simplex 2 (ul:(real^3)list)) >=
sqrt (&2)`);
(ASM_CASES_TAC `hl (truncate_simplex 2 (vl:(real^3)list)) >=
sqrt (&2)`);
(REWRITE_WITH `mxi V ul = omega_list_n V ul 2`);
(REWRITE_TAC[mxi] THEN COND_CASES_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_WITH `mxi V vl = omega_list_n V vl 2`);
(REWRITE_TAC[mxi] THEN COND_CASES_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(ABBREV_TAC `xl = truncate_simplex 2 (ul:(real^3)list)`);
(ABBREV_TAC `yl = truncate_simplex 2 (vl:(real^3)list)`);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `V
INTER mcell i V ul =
set_of_list (truncate_simplex (i - 1) ul)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `V
INTER mcell j V vl =
set_of_list (truncate_simplex (j - 1) vl)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `hl (xl:(real^3)list) <=
dist (omega_list V xl,
HD xl)`);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN] THEN EXPAND_TAC "xl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `hl yl =
dist (omega_list V yl,
HD yl)`);
(MATCH_MP_TAC Rogers.WAUFCHE2);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "yl" THEN MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `omega_list V xl = omega_list V yl`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (xl:(real^3)list) = 3 /\
LENGTH (yl:(real^3)list) = 3`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_TAC[ARITH_RULE `3 = 2 + 1`]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH
`truncate_simplex 2 ul = truncate_simplex (2 + 0) (ul:(real^3)list) /\
truncate_simplex 2 vl = truncate_simplex (2 + 0) (vl:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) ul) 2 = omega_list_n V ul 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) vl) 2 = omega_list_n V vl 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(NEW_GOAL `
HD (xl:(real^3)list) =
HD yl`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH `
HD (truncate_simplex 2 ul) = (
HD ul):real^3`);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH `
HD (truncate_simplex 2 vl) = (
HD vl):real^3`);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `hl (yl:(real^3)list) =
dist (omega_list V xl,
HD xl)`);
(ASM_REWRITE_TAC[]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[]);
(* ======================================================================= *)
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(ASM_CASES_TAC `hl (truncate_simplex 2 (vl:(real^3)list)) >=
sqrt (&2)`);
(ABBREV_TAC `xl = truncate_simplex 2 (ul:(real^3)list)`);
(ABBREV_TAC `yl = truncate_simplex 2 (vl:(real^3)list)`);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `V
INTER mcell i V ul =
set_of_list (truncate_simplex (i - 1) ul)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `V
INTER mcell j V vl =
set_of_list (truncate_simplex (j - 1) vl)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `hl (yl:(real^3)list) <=
dist (omega_list V yl,
HD yl)`);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN] THEN EXPAND_TAC "yl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `hl xl =
dist (omega_list V xl,
HD xl)`);
(MATCH_MP_TAC Rogers.WAUFCHE2);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "xl" THEN MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `omega_list V xl = omega_list V yl`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (xl:(real^3)list) = 3 /\
LENGTH (yl:(real^3)list) = 3`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_TAC[ARITH_RULE `3 = 2 + 1`]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH
`truncate_simplex 2 ul = truncate_simplex (2 + 0) (ul:(real^3)list) /\
truncate_simplex 2 vl = truncate_simplex (2 + 0) (vl:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) ul) 2 = omega_list_n V ul 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) vl) 2 = omega_list_n V vl 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(NEW_GOAL `
HD (xl:(real^3)list) =
HD yl`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH `
HD (truncate_simplex 2 ul) = (
HD ul):real^3`);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH `
HD (truncate_simplex 2 vl) = (
HD vl):real^3`);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `hl (xl:(real^3)list) =
dist (omega_list V yl,
HD yl)`);
(ASM_REWRITE_TAC[]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(* ======================================================================= *)
(NEW_GOAL `
sqrt (&2) <= hl (ul:(real^3)list)`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_CASES_TAC `i = 2`);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `i = 2`; mcell2]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `i = 3`);
(ASM_SET_TAC[]);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `i = 3`; mcell3]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `
sqrt (&2) <= hl (vl:(real^3)list)`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `j = 2`);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `j = 2`; mcell2]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `j = 3`);
(ASM_SET_TAC[]);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `j = 3`; mcell3]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ABBREV_TAC `s2 = omega_list_n V ul 2`);
(ABBREV_TAC `s3 = omega_list_n V ul 3`);
(NEW_GOAL `s2 = omega_list_n V vl 2`);
(EXPAND_TAC "s2" THEN FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(NEW_GOAL `s3 = omega_list_n V vl 3`);
(EXPAND_TAC "s3" THEN FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(ABBREV_TAC `u0:real^3 =
HD ul`);
(NEW_GOAL `?s.
between s (s2,s3) /\
dist (u0,s) =
sqrt (&2) /\
mxi V ul = s`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "s3");
(MATCH_MP_TAC
MXI_EXPLICIT);
(NEW_GOAL `?v0 u1 u2 u3. ul = [v0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `v0:real^3 =
HD ul`);
(REWRITE_TAC[ASSUME `ul = [v0;u1;u2;u3:real^3]`;
HD]);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?t.
between t (s2,s3) /\
dist (u0,t) =
sqrt (&2) /\
mxi V vl = t`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MXI_EXPLICIT);
(NEW_GOAL `?v0 u1 u2 u3. vl = [v0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);
(ASM_REWRITE_TAC[
HD]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `!n.
between n (s2, s3:real^3) ==>
dist (u0, n) pow 2 =
dist (s2, n) pow 2 +
dist (u0, s2) pow 2`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[
dist]);
(MATCH_MP_TAC
PYTHAGORAS);
(REWRITE_TAC[
orthogonal]);
(ABBREV_TAC `zl = truncate_simplex 2 (ul:(real^3)list)`);
(REWRITE_WITH `s2:real^3 = circumcenter (
set_of_list zl)`);
(REWRITE_WITH `s2 = omega_list V zl`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "zl");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(MATCH_MP_TAC Rogers.MHFTTZN4);
(EXISTS_TAC `V:real^3->bool`);
(EXISTS_TAC `2`);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `s2
IN voronoi_list V zl`);
(REWRITE_WITH `s2 = omega_list V zl`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "zl");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.OMEGA_LIST_IN_VORONOI_LIST);
(EXISTS_TAC `2`);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `s3
IN voronoi_list V zl`);
(EXPAND_TAC "s3" THEN EXPAND_TAC "zl");
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3 /\ 3 <= 3`]);
(NEW_GOAL `
affine hull {s2, s3}
SUBSET affine hull voronoi_list V zl`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);
(ASM_SET_TAC[]);
(NEW_GOAL `n
IN affine hull {s2, s3:real^3}`);
(NEW_GOAL `
convex hull {s2,s3}
SUBSET affine hull {s2,s3:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `n
IN convex hull {s2, s3:real^3}`);
(REWRITE_TAC[GSYM
BETWEEN_IN_CONVEX_HULL]);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(MATCH_MP_TAC Marchal_cells_2_new.IN_AFFINE_KY_LEMMA1);
(REWRITE_WITH `u0:real^3 =
HD zl`);
(EXPAND_TAC "zl" THEN EXPAND_TAC "u0");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.HD_IN_SET_OF_LIST);
(REWRITE_WITH `
LENGTH (zl:(real^3)list) = 2 + 1 /\
CARD (
set_of_list zl) = 2 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(ARITH_TAC);
(NEW_GOAL `
dist (u0,s) pow 2 =
dist (s2,s:real^3) pow 2 +
dist (u0,s2) pow 2`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `
dist (u0,t) pow 2 =
dist (s2,t:real^3) pow 2 +
dist (u0,s2) pow 2`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `
dist (s2, s:real^3) =
dist (s2, t)`);
(REWRITE_TAC[
DIST_EQ]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC);
(UNDISCH_TAC `
between s (s2, s3:real^3)` THEN
UNDISCH_TAC `
between t (s2, s3:real^3)`);
(REWRITE_TAC[
BETWEEN_IN_CONVEX_HULL;
CONVEX_HULL_2;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `
dist (s2,s) =
dist (s2,t:real^3)`);
(REWRITE_TAC[
dist;ASSUME `s = u' % s2 + v' % s3:real^3`;
ASSUME `t = u % s2 + v % s3:real^3` ]);
(REWRITE_WITH `s2 - (u' % s2 + v' % s3) =
(u' + v') % s2 - (u' % s2 + v' % s3:real^3)`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_WITH `s2 - (u % s2 + v % s3) =
(u + v) % s2 - (u % s2 + v % s3:real^3)`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH `(u + v) % s - (u % s + v % t) = v % (s - t)`]);
(REWRITE_TAC[
NORM_MUL]);
(REWRITE_WITH `abs v = v /\ abs v' = v'`);
(ASM_SIMP_TAC[
REAL_ABS_REFL]);
(REWRITE_TAC[REAL_ARITH `a * b = c * b <=> (a - c) * b = &0`;
REAL_ENTIRE]);
(STRIP_TAC);
(REWRITE_WITH `v = v':real /\ u = u':real`);
(ASM_REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[
NORM_EQ_0]);
(REWRITE_TAC[VECTOR_ARITH `a - b =
vec 0 <=> a = b`] THEN STRIP_TAC);
(NEW_GOAL `F`);
(NEW_GOAL `hl (ul:(real^3)list) <=
dist (s3,u0:real^3)`);
(REWRITE_WITH `s3 = omega_list V ul /\ u0 =
HD ul`);
(STRIP_TAC);
(REWRITE_TAC[GSYM (ASSUME `omega_list_n V ul 3 = s3`);
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[
IN]);
(ABBREV_TAC `zl:(real^3)list = truncate_simplex 2 ul`);
(NEW_GOAL `hl (zl:(real^3)list) =
dist (s3, u0:real^3)`);
(REWRITE_WITH `s3 = omega_list V zl /\ u0 =
HD zl`);
(STRIP_TAC);
(REWRITE_TAC[GSYM (ASSUME `s2:real^3 = s3`);
OMEGA_LIST]);
(EXPAND_TAC "s2");
(REWRITE_WITH `
LENGTH (zl:(real^3)list) = 2 + 1 /\
CARD (
set_of_list zl) = 2 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(REWRITE_TAC[ARITH_RULE `(2 + 1) - 1 = 2`]);
(EXPAND_TAC "zl");
(REWRITE_WITH `truncate_simplex 2 (ul:(real^3)list) =
truncate_simplex (2 + 0) (ul:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(EXPAND_TAC "zl" THEN EXPAND_TAC "u0");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Rogers.WAUFCHE2);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 24 *)
(* ==================================================================== *)
(* Lemma 25 *)
let FINITE_EDGE_X2 = prove_by_refinement (
`!(V:real^3->bool) e:real^3->bool u0 u1.
packing V /\ saturated V /\ e = {u0, u1} ==>
FINITE {X |
mcell_set V X /\ edgeX V X e}`,
[(REPEAT STRIP_TAC);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{X |
mcell_set V X /\ edgeX V X e /\ ~(X = {})}
UNION {{}}`);
(ONCE_REWRITE_TAC[SET_RULE `A /\ B <=> B /\ A`]);
(STRIP_TAC);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM;
IN_UNION]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[MESON[
IN] `{{}} x <=> x
IN {{}}`;
SET_RULE `x
IN {a} <=> x = a`]);
(MESON_TAC[]);
(REWRITE_TAC [
FINITE_UNION;
FINITE_SING]);
(MATCH_MP_TAC
FINITE_SUBSET);
(ABBREV_TAC `f = (\(i, ul). mcell i V ul)`);
(ABBREV_TAC `s = V
INTER ball (u0:real^3, &4)`);
(ABBREV_TAC `S = {y | ?v0 v1 v2 v3:real^3.
v0
IN s /\
v1
IN s /\
v2
IN s /\
v3
IN s /\
y = [v0; v1; v2; v3]}`);
(ABBREV_TAC `S1 = {i, (ul:(real^3)list) | i
IN 0..4 /\ ul
IN S}`);
(EXISTS_TAC `{(f:num#(real^3)list->real^3->bool) x | x
IN S1}`);
(STRIP_TAC);
(REWRITE_TAC[SET_RULE `{f x |x
IN s } = {y | ?x. x
IN s /\ y = f x}`]);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(EXPAND_TAC "S1");
(MATCH_MP_TAC
FINITE_PRODUCT);
(REWRITE_TAC[
FINITE_NUMSEG]);
(EXPAND_TAC "S");
(MATCH_MP_TAC Ajripqn.FINITE_SET_LIST_LEMMA);
(EXPAND_TAC "s");
(MATCH_MP_TAC Pack2.KIUMVTC THEN ASM_SIMP_TAC[]);
(EXPAND_TAC "f" THEN REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM;
mcell_set_2]);
(REPEAT STRIP_TAC);
(EXISTS_TAC `(i:num, ul:(real^3)list)`);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "S1" THEN REWRITE_TAC[
IN_ELIM_THM]);
(EXISTS_TAC `i:num` THEN EXISTS_TAC `ul:(real^3)list`);
(ASM_REWRITE_TAC[
IN_NUMSEG_0]);
(EXPAND_TAC "S" THEN REWRITE_TAC[
IN;
IN_ELIM_THM]);
(NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN REPEAT STRIP_TAC);
(EXISTS_TAC `v0:real^3` THEN EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list ul
SUBSET (s:real^3->bool)`);
(EXPAND_TAC "s");
(REWRITE_TAC[
SUBSET_INTER]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `~NULLSET x`);
(UNDISCH_TAC `edgeX V x e`);
(REWRITE_TAC[edgeX;
IN_ELIM_THM;
VX]);
(COND_CASES_TAC);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `{ } (u:real^3)`);
(REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(NEW_GOAL `
VX V x = V
INTER x`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `V
INTER (x:real^3->bool) =
set_of_list (truncate_simplex (i - 1) ul)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(REWRITE_TAC[GSYM (ASSUME `ul = [v0;v1;v2;v3:real^3]`);
GSYM (ASSUME `x = mcell i V ul`)]);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `i = 0`);
(NEW_GOAL `F`);
(UNDISCH_TAC `edgeX V x e`);
(REWRITE_TAC[edgeX;
IN_ELIM_THM]);
(REWRITE_WITH `
VX V x = {}`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);
(ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `{ } (u:real^3)`);
(REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN ARITH_TAC);
(NEW_GOAL `u0
IN VX V x`);
(UNDISCH_TAC `edgeX V x e`);
(REWRITE_TAC[edgeX;
IN_ELIM_THM; ASSUME `e = {u0, u1:real^3}`;
IN]);
(REPEAT STRIP_TAC);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `ul = [v0; v1; v2; v3:real^3]`)]);
(STRIP_TAC);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) ul)
SUBSET
set_of_list (ul:(real^3)list)`);
(MATCH_MP_TAC Rogers.SET_OF_LIST_TRUNCATE_SIMPLEX_SUBSET);
(ASM_REWRITE_TAC[
LENGTH] THEN ASM_ARITH_TAC);
(ASM_SET_TAC[]);
(REWRITE_TAC[MESON[
IN] `(s:real^3->bool) v <=> v
IN s`]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[
set_of_list] THEN SET_TAC[])]);;
(* ==================================================================== *)
(* Lemma 26 *)
(* ==================================================================== *)
(* Lemma 27 *)
(* ==================================================================== *)
(* Lemma 28 *)
(* ==================================================================== *)
(* Lemma 29 *)
(* ==================================================================== *)
(* Lemma 30 *)
let MCELL_SUBSET_BALL8_1 = prove_by_refinement (
`!v:real^3 ul i V.
i<= 4 /\ packing V /\ saturated V /\ barV V 3 ul /\ v
IN mcell i V ul ==>
mcell i V ul
SUBSET ball (v, &8)`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `mcell i V ul
SUBSET
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`);
(MATCH_MP_TAC Qzksykg.QZKSYKG2);
(ASM_REWRITE_TAC[SET_RULE `i
IN {0,1,2,3,4}<=> i =0\/i=1\/i=2\/i=3\/i=4`]);
(ASM_ARITH_TAC);
(NEW_GOAL `
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1}
SUBSET UNIONS {
voronoi_closed V s | s
IN set_of_list ul}`);
(REWRITE_TAC[
SUBSET;
IN_UNIONS;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `
voronoi_closed V ((
HD (
left_action_list p ul)):real^3)`);
(STRIP_TAC);
(EXISTS_TAC `(
HD (
left_action_list p ul)):real^3`);
(REWRITE_TAC[MESON[
IN] `(a:real^3->bool) s <=> s
IN a`]);
(REWRITE_WITH
`
set_of_list (ul:(real^3)list) =
set_of_list (
left_action_list p ul)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(ASM_CASES_TAC `i = 4`);
(MATCH_MP_TAC Packing3.SET_OF_LIST_LEFT_ACTION_LIST);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[ARITH_RULE `3 + 1 = 4`]);
(ASM_CASES_TAC `i = 3`);
(MATCH_MP_TAC Marchal_cells_2_new.SET_OF_LIST_LEFT_ACTION_LIST_2);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[ARITH_RULE `(3 + 1) - 2 = 3 - 1 /\ 2 <= 3 + 1`]);
(ASM_CASES_TAC `i = 2`);
(MATCH_MP_TAC Marchal_cells_2_new.SET_OF_LIST_LEFT_ACTION_LIST_3);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[ARITH_RULE `(3 + 1) - 3 = 2 - 1 /\ 3 <= 3 + 1`]);
(NEW_GOAL `i <= 1`);
(ASM_ARITH_TAC);
(NEW_GOAL `p
permutes 0..0`);
(ASM_MESON_TAC[ARITH_RULE `i <= 1 ==> i - 1 = 0`]);
(UP_ASM_TAC THEN REWRITE_TAC[Packing3.PERMUTES_TRIVIAL] THEN STRIP_TAC);
(ASM_REWRITE_TAC[Packing3.LEFT_ACTION_LIST_I]);
(MATCH_MP_TAC Packing3.HD_IN_SET_OF_LIST);
(REWRITE_TAC[Packing3.LENGTH_LEFT_ACTION_LIST]);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[MESON[
IN] `(a:real^3->bool) s <=> s
IN a`]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `rogers V (
left_action_list p ul)
SUBSET
voronoi_closed V (
HD (
left_action_list p ul))`);
(MATCH_MP_TAC
ROGERS_SUBSET_VORONOI_CLOSED);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num` THEN
EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(REWRITE_TAC[SET_RULE `i
IN {0,1,2,3,4} <=> i=0\/i=1\/i=2\/i=3\/i=4`]);
(ASM_ARITH_TAC);
(UNDISCH_TAC `v
IN mcell i V ul` THEN SET_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `
UNIONS {
voronoi_closed V s | s
IN set_of_list ul}
SUBSET
UNIONS {
ball (s:real^3, &2) | s
IN set_of_list ul}`);
(NEW_GOAL `!s:real^3.
voronoi_closed V s
SUBSET ball (s, &2)`);
(ASM_SIMP_TAC[Packing3.VORONOI_BALL2]);
(UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `mcell i V ul
SUBSET UNIONS {
ball (s,&2) | s
IN set_of_list ul}`);
(ABBREV_TAC `s1 =
UNIONS {rogers V (
left_action_list p ul) | p
permutes 0..i - 1}`);
(ABBREV_TAC `s2 =
UNIONS {
voronoi_closed V (s:real^3) | s
IN set_of_list ul}`);
(ABBREV_TAC `s3 =
UNIONS {
ball (s:real^3,&2) | s
IN set_of_list ul}`);
(DEL_TAC THEN DEL_TAC THEN DEL_TAC);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
SUBSET;
IN_UNIONS;
IN;
IN_ELIM_THM;
IN_BALL]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?t. (?s.
set_of_list ul s /\ t =
ball (s:real^3,&2)) /\ t x`);
(ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `
dist (s, x:real^3) < &2`);
(REWRITE_TAC[GSYM
IN_BALL]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `?t. (?s.
set_of_list ul s /\ t =
ball (s:real^3,&2)) /\ t v`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `
dist (s', v:real^3) < &2`);
(REWRITE_TAC[GSYM
IN_BALL]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `
dist (v, x:real^3) <=
dist (s', v) +
dist (s', s) +
dist (s, x)`);
(NORM_ARITH_TAC);
(NEW_GOAL `
dist (s', s:real^3) < &4`);
(REWRITE_TAC[GSYM
IN_BALL]);
(NEW_GOAL `
set_of_list ul
SUBSET ball (s':real^3,&4)`);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:real^3->bool`);
(ASM_REWRITE_TAC[
IN]);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 31 *)
(* ==================================================================== *)
(* Lemma 32 *)
(* ==================================================================== *)
(* Lemma 33 *)
let CONIC_CAP_WEDGE_EQ_0 =prove_by_refinement (
`!v0 v1 a r w1 w2. a < &1 /\ &0 < r /\
vol (
conic_cap v0 v1 r a
INTER wedge v0 v1 w1 w2) = &0 ==>
coplanar {v0,v1,w1, w2:real^3}`,
[(REPEAT STRIP_TAC);
(MATCH_MP_TAC (MESON[] `(~A==> F) ==> A`) THEN STRIP_TAC);
(NEW_GOAL `~collinear {v0, v1, w1:real^3}`);
(MATCH_MP_TAC
NOT_COPLANAR_NOT_COLLINEAR);
(EXISTS_TAC `w2:real^3` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `~collinear {v0, v1, w2:real^3}`);
(MATCH_MP_TAC
NOT_COPLANAR_NOT_COLLINEAR);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`] THEN
EXISTS_TAC `w1:real^3` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `vol (
conic_cap v0 v1 r a
INTER wedge v0 v1 w1 (w2:real^3)) =
(if &1 < a \/ r < &0
then &0
else
azim v0 v1 w1 w2 / &3 * (&1 - max a (-- &1)) * r pow 3)`);
(ASM_MESON_TAC[
VOLUME_CONIC_CAP_WEDGE]);
(UP_ASM_TAC THEN COND_CASES_TAC);
(STRIP_TAC THEN ASM_REAL_ARITH_TAC);
(ASM_REWRITE_TAC[REAL_ARITH `&0 = a <=> a = &0`;
REAL_ENTIRE; REAL_ARITH `a / &3 = &0 <=> a = &0`]);
(REWRITE_TAC[REAL_ARITH `&1 - max a (-- &1) = &0 <=> a = &1`]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `~coplanar {v0, v1, w1, w2:real^3}`);
(ASM_SIMP_TAC[
AZIM_EQ_0_PI_IMP_COPLANAR]);
(ASM_REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[] THEN MATCH_MP_TAC
REAL_POW_NZ);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 34 *)
let CONIC_CAP_AFF_GT_EQ_0 =prove_by_refinement (
`!v0 v1 a r w1 w2. a < &1 /\ &0 < r /\
vol (
conic_cap v0 v1 r a
INTER aff_gt {v0, v1} {w1, w2}) = &0 ==>
coplanar {v0,v1,w1, w2:real^3}`,
[(REPEAT STRIP_TAC);
(MATCH_MP_TAC (MESON[] `(~A==> F) ==> A`) THEN STRIP_TAC);
(NEW_GOAL `~collinear {v0, v1, w1:real^3}`);
(MATCH_MP_TAC
NOT_COPLANAR_NOT_COLLINEAR);
(EXISTS_TAC `w2:real^3` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `~collinear {v0, v1, w2:real^3}`);
(MATCH_MP_TAC
NOT_COPLANAR_NOT_COLLINEAR);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`] THEN
EXISTS_TAC `w1:real^3` THEN ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `
azim v0 v1 w1 (w2:real^3) <
pi`);
(NEW_GOAL `
wedge v0 v1 w1 w2 = aff_gt {v0, v1} {w1, w2:real^3}`);
(ASM_MESON_TAC[
WEDGE_LUNE]);
(ASM_MESON_TAC[
CONIC_CAP_WEDGE_EQ_0]);
(ASM_CASES_TAC `
azim v0 v1 w1 (w2:real^3) >
pi`);
(NEW_GOAL `
azim v0 v1 w2 (w1:real^3) =
(if
azim v0 v1 w1 w2 = &0 then &0 else &2 *
pi -
azim v0 v1 w1 w2)`);
(MATCH_MP_TAC
AZIM_COMPL);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN COND_CASES_TAC);
(UNDISCH_TAC `
azim v0 v1 w1 (w2:real^3) >
pi` THEN ASM_REWRITE_TAC[]);
(MESON_TAC[
PI_POS_LE; REAL_ARITH `&0 > a <=> ~(&0 <= a)`]);
(STRIP_TAC);
(NEW_GOAL `
azim v0 v1 w2 (w1:real^3) <
pi`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `
wedge v0 v1 w2 w1 = aff_gt {v0, v1} {w1, w2:real^3}`);
(REWRITE_WITH `{w1, w2:real^3} = {w2, w1}`);
(SET_TAC[]);
(UNDISCH_TAC `~coplanar {v0, v1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);
(ASM_MESON_TAC[
WEDGE_LUNE]);
(UNDISCH_TAC `~coplanar {v0, v1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);
(ASM_MESON_TAC[
CONIC_CAP_WEDGE_EQ_0]);
(NEW_GOAL `
azim v0 v1 w1 (w2:real^3) =
pi`);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[
AZIM_EQ_0_PI_IMP_COPLANAR])]);;
(* ==================================================================== *)
(* Lemma 35 *)
let CONIC_CAP_INTER_CONVEX_HULL_4_GT_0 = prove_by_refinement (
`!u0:real^3 u1 w1 w2 r a.
&0 < r /\ a < &1 /\ &0 <= a /\ ~coplanar {u0, u1, w1, w2} ==>
vol (
conic_cap u0 u1 r a
INTER convex hull {u0, u1, w1, w2}) > &0`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `
measurable
(
conic_cap u0 u1 r a
INTER convex hull {u0, u1, w1, w2:real^3})`);
(MATCH_MP_TAC
MEASURABLE_INTER);
(REWRITE_TAC[
MEASURABLE_CONIC_CAP;
MEASURABLE_CONVEX_HULL]);
(SIMP_TAC[
MEASURABLE_CONVEX_HULL;
FINITE_IMP_BOUNDED;Geomdetail.FINITE6]);
(REWRITE_TAC[REAL_ARITH `a > &0 <=> &0 <= a /\ ~(a = &0)`]);
(ASM_SIMP_TAC[
MEASURE_POS_LE]);
(REWRITE_WITH
`vol (
conic_cap u0 u1 r a
INTER convex hull {u0, u1, w1, w2}) = &0 <=>
NULLSET (
conic_cap u0 u1 r a
INTER convex hull {u0, u1, w1, w2})`);
(ASM_SIMP_TAC[
MEASURABLE_MEASURE_EQ_0]);
(REPEAT STRIP_TAC);
(NEW_GOAL `~(u0 = u1:real^3)`);
(STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}` THEN REWRITE_TAC[]);
(REWRITE_WITH `{u0, u1, w1, w2} = {u1:real^3, w1, w2}`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[
COPLANAR_3]);
(NEW_GOAL `?r1 a1. &0 < r1 /\ a1 < &1 /\
conic_cap u0 u1 r1 a1
INTER aff_ge {u0, u1} {w1, w2:real^3} =
conic_cap u0 u1 r1 a1
INTER convex hull {u0, u1,w1, w2} /\
conic_cap u0 u1 r1 a1
SUBSET conic_cap u0 u1 r a`);
(ABBREV_TAC `s =
closest_point (
affine hull {u1, w1, w2:real^3}) u0`);
(ABBREV_TAC `r2 =
dist (u0:real^3, s)`);
(ABBREV_TAC `r1 = min r2 r`);
(ABBREV_TAC `s2 =
smallest_angle_line w1 (w2:real^3) u0 u1`);
(ABBREV_TAC
`a2 = ((s2 - u0:real^3)
dot (u1 - u0)) /(
norm (s2 - u0) *
norm (u1 - u0))`);
(ABBREV_TAC `a1 = max a2 a`);
(EXISTS_TAC `r1:real` THEN EXISTS_TAC `a1:real`);
(NEW_GOAL `&0 < r1 /\ a1 < &1`);
(EXPAND_TAC "r1" THEN EXPAND_TAC "a1");
(REWRITE_TAC[REAL_ARITH `&0 < min a b <=> &0 < a /\ &0 < b`;
REAL_ARITH `max a b < &1 <=> a < &1 /\ b < &1`;]);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(EXPAND_TAC "r2");
(MATCH_MP_TAC
DIST_POS_LT);
(STRIP_TAC);
(NEW_GOAL `u0
IN affine hull {u1, w1, w2:real^3}`);
(ASM_REWRITE_TAC[]);
(DEL_TAC THEN EXPAND_TAC "s");
(MATCH_MP_TAC
CLOSEST_POINT_IN_SET);
(REWRITE_TAC[
CLOSED_AFFINE_HULL;
AFFINE_HULL_EQ_EMPTY] THEN SET_TAC[]);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u0, u1, w1, w2} =
affine hull {u1:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR;
COPLANAR_3]);
(EXPAND_TAC "a2");
(MATCH_MP_TAC
REAL_DIV_LT_1_TACTICS);
(NEW_GOAL `s2
IN convex hull {w1, w2:real^3}`);
(MATCH_MP_TAC
SMALLEST_ANGLE_IN_CONVEX_HULL);
(EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u0, u1, w1, w2} =
affine hull {u1:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(NEW_GOAL `
convex hull {w1, w2}
SUBSET affine hull {u1, w1, w2:real^3}`);
(NEW_GOAL `
convex hull {w1, w2}
SUBSET affine hull {w1, w2:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `
affine hull {w1, w2}
SUBSET affine hull {u1, w1, w2:real^3}`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);
(SET_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3;
COPLANAR_AFFINE_HULL_COPLANAR]);
(NEW_GOAL `~(s2 = u0:real^3)`);
(STRIP_TAC);
(UNDISCH_TAC `s2
IN convex hull {w1, w2:real^3}` THEN ASM_REWRITE_TAC[]);
(STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u0, u1, w1, w2} =
affine hull {u1:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(NEW_GOAL `
convex hull {w1, w2}
SUBSET affine hull {u1, w1, w2:real^3}`);
(NEW_GOAL `
convex hull {w1, w2}
SUBSET affine hull {w1, w2:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `
affine hull {w1, w2}
SUBSET affine hull {u1, w1, w2:real^3}`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);
(SET_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3;
COPLANAR_AFFINE_HULL_COPLANAR]);
(STRIP_TAC);
(MATCH_MP_TAC
REAL_LT_MUL);
(ASM_REWRITE_TAC[
NORM_POS_LT; VECTOR_ARITH `a - b =
vec 0 <=> a = b`]);
(REWRITE_TAC[REAL_ARITH `a < b <=> (a <= b) /\ ~(a = b)`]);
(STRIP_TAC);
(REWRITE_TAC[
NORM_CAUCHY_SCHWARZ]);
(REWRITE_TAC[
NORM_CAUCHY_SCHWARZ_EQ]);
(STRIP_TAC);
(ABBREV_TAC `
t1 =
norm (s2 - u0:real^3)`);
(ABBREV_TAC `t2 =
norm (u1 - u0:real^3)`);
(NEW_GOAL `~(t2 = &0)`);
(EXPAND_TAC "t2" THEN REWRITE_TAC[
NORM_EQ_0;
VECTOR_ARITH `a - b =
vec 0 <=> a = b`]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `s2 =
t1 / t2 % u1 + (t2 -
t1) / t2 % u0:real^3`);
(REWRITE_TAC[VECTOR_ARITH `
t1 / t2 % u1 + (t2 -
t1) / t2 % u0:real^3 =
&1 / t2 % (
t1 % u1 + (t2 -
t1) % u0)`]);
(REWRITE_WITH `
t1 % u1 + (t2 -
t1) % u0 = t2 % (s2:real^3)`);
(UNDISCH_TAC `
t1 % (u1 - u0) = t2 % (s2 - u0:real^3)` THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH `&1 / t2 % t2 % s2 = (t2 / t2) % s2`]);
(REWRITE_WITH `t2 / t2 = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(UNDISCH_TAC `s2
IN convex hull {w1, w2:real^3}`);
(ASM_REWRITE_TAC[
IN;
CONVEX_HULL_2;
IN_ELIM_THM]);
(STRIP_TAC);
(ABBREV_TAC `t =
t1 / t2`);
(ABBREV_TAC `t' = (
t1 - t2) / t2`);
(NEW_GOAL `u1
IN affine hull {u0, w1, w2:real^3}`);
(REWRITE_TAC[
AFFINE_HULL_3;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `t'/ t` THEN EXISTS_TAC `u / t` THEN EXISTS_TAC `v / t`);
(STRIP_TAC);
(ASM_REWRITE_TAC[REAL_ARITH `a / t + b/ t + c / t = (a + b + c) / t `]);
(REWRITE_WITH `t' + &1 = t`);
(EXPAND_TAC "t'" THEN EXPAND_TAC "t");
(NEW_GOAL `t2 / t2 = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_DIV_REFL);
(EXPAND_TAC "t");
(ONCE_REWRITE_TAC[REAL_ARITH `a / b = a * (&1 / b)`]);
(REWRITE_TAC[
REAL_ENTIRE]);
(REWRITE_WITH `~(
t1 = &0)`);
(EXPAND_TAC "t1" THEN REWRITE_TAC[
NORM_EQ_0; VECTOR_ARITH
`a - b =
vec 0 <=> a = b`] THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Trigonometry2.NOT_EQ0_IMP_NEITHER_INVERT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[VECTOR_ARITH `t' / t % u0 + u / t % w1 + v / t % w2 =
&1 / t % (t' % u0 + u % w1 + v % w2)`]);
(REWRITE_WITH `t' % u0 + u % w1 + v % w2 = t % u1:real^3`);
(EXPAND_TAC "t'");
(UNDISCH_TAC `t % u1 + (t2 -
t1) / t2 % u0 = u % w1 + v % w2:real^3`
THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH `&1 / t % t % u = t / t % u`]);
(REWRITE_WITH `t / t = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(EXPAND_TAC "t");
(ONCE_REWRITE_TAC[REAL_ARITH `a / b = a * (&1 / b)`]);
(REWRITE_TAC[
REAL_ENTIRE]);
(REWRITE_WITH `~(
t1 = &0)`);
(EXPAND_TAC "t1" THEN REWRITE_TAC[
NORM_EQ_0; VECTOR_ARITH
`a - b =
vec 0 <=> a = b`] THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Trigonometry2.NOT_EQ0_IMP_NEITHER_INVERT);
(ASM_REWRITE_TAC[]);
(VECTOR_ARITH_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {b,a,c,d}`]);
(REWRITE_WITH `
affine hull {u1, u0, w1, w2} =
affine hull {u0:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
COPLANAR_3;
COPLANAR_AFFINE_HULL_COPLANAR]);
(NEW_GOAL `
conic_cap (u0:real^3) u1 r1 a1
SUBSET conic_cap u0 u1 r a`);
(REWRITE_TAC[
conic_cap;
NORMBALL_BALL] THEN MATCH_MP_TAC
(SET_RULE `a
SUBSET b /\ c
SUBSET d ==> a
INTER c
SUBSET b
INTER d`));
(STRIP_TAC);
(MATCH_MP_TAC
SUBSET_BALL);
(EXPAND_TAC "r1" THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
RCONE_GT_SUBSET);
(EXPAND_TAC "a1" THEN REAL_ARITH_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[SET_RULE `b = a <=> a
SUBSET b /\ b
SUBSET a`]);
(STRIP_TAC);
(MATCH_MP_TAC (SET_RULE `a
SUBSET b ==> x
INTER a
SUBSET x
INTER b`));
(REWRITE_TAC[Marchal_cells_2_new.CONVEX_HULL_4_SUBSET_AFF_GE_2_2]);
(REWRITE_TAC[
SUBSET;
IN_INTER]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC);
(NEW_GOAL `
DISJOINT {u0, u1:real^3} {w1, w2}`);
(REWRITE_TAC[
DISJOINT]);
(ASM_CASES_TAC `w1
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2:real^3} = {u0, u1, w2:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_CASES_TAC `w2
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2:real^3} = {u0, u1, w1:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_SET_TAC[]);
(ASM_SIMP_TAC[Marchal_cells_2.AFF_GE_2_2;
CONVEX_HULL_4;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(EXISTS_TAC `t1:real` THEN EXISTS_TAC `t2:real` THEN
EXISTS_TAC `t3:real` THEN EXISTS_TAC `t4:real`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `&0 <= t <=> ~(t < &0)`] THEN STRIP_TAC);
(NEW_GOAL `!x. x
IN affine hull {u1, w1, w2} ==>
dist (u0,s:real^3) <=
dist (u0,x:real^3)`);
(REPEAT STRIP_TAC THEN EXPAND_TAC "s");
(MATCH_MP_TAC
CLOSEST_POINT_LE);
(ASM_REWRITE_TAC[
CLOSED_AFFINE_HULL]);
(NEW_GOAL `&1 < t2 + t3+ t4`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `~(t2 + t3+ t4 = &0)`);
(ASM_REAL_ARITH_TAC);
(ABBREV_TAC `y = t2 / (t2 + t3 + t4) % u1 + t3 / (t2 + t3 + t4) % w1 +
t4 / (t2 + t3 + t4) % w2:real^3`);
(NEW_GOAL `x =
t1 % u0 + (t2 + t3 + t4) % (y:real^3)`);
(ASM_REWRITE_TAC[] THEN EXPAND_TAC "y");
(REWRITE_TAC[VECTOR_ARITH
`
t1 % u0 + t2 % u1 + t3 % w1 + t4 % w2 =
t1 % u0 + t % (t2 / t % u1 + t3 / t % w1 + t4 / t % w2) <=>
t2 % u1 + t3 % w1 + t4 % w2 = t / t % (t2 % u1 + t3 % w1 + t4 % w2)`]);
(REWRITE_WITH `(t2 + t3 + t4) / (t2 + t3 + t4) = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(NEW_GOAL `y
IN affine hull {u1, w1, w2:real^3}`);
(REWRITE_TAC[
AFFINE_HULL_3;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `t2 / (t2 + t3 + t4)` THEN
EXISTS_TAC `t3 / (t2 + t3 + t4)` THEN EXISTS_TAC `t4 / (t2 + t3 + t4)`);
(ASM_REWRITE_TAC[REAL_ARITH `a/x + b/ x + c/ x = (a+b+c) / x`]);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(NEW_GOAL `
dist (u0, s:real^3) <=
dist (u0, y:real^3)`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `
dist (u0, s) <=
dist (u0, x:real^3)`);
(REWRITE_TAC[ASSUME `x =
t1 % u0 + (t2 + t3 + t4) % y:real^3`;
dist]);
(REWRITE_WITH `u0 - (
t1 % u0 + (t2 + t3 + t4) % y) =
(
t1 + t2 + t3 + t4) % u0 - (
t1 % u0 + (t2 + t3 + t4) % y:real^3)`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH
`(
t1 + t) % u0 - (
t1 % u0 + t % y) = t % (u0 - y)`;
NORM_MUL]);
(REWRITE_WITH `abs (t2 + t3 + t4) = t2 + t3 + t4`);
(REWRITE_TAC[
REAL_ABS_REFL] THEN ASM_REAL_ARITH_TAC);
(REWRITE_TAC[GSYM
dist]);
(NEW_GOAL `
dist (u0, y:real^3) <= (t2 + t3 + t4) *
dist (u0, y)`);
(REWRITE_TAC[REAL_ARITH `a <= b * a <=> &0 <= (b - &1) * a`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIST_POS_LE]);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `x
IN ball (u0:real^3, r1)`);
(UNDISCH_TAC `x
IN conic_cap u0 (u1:real^3) r1 a1`);
(REWRITE_TAC[
conic_cap;
NORMBALL_BALL] THEN SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN_BALL]);
(EXPAND_TAC "r1" THEN EXPAND_TAC "r2");
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(* ========================================================================= *)
(* OK here *)
(REWRITE_TAC[REAL_ARITH `&0 <= t <=> ~(t < &0)`] THEN STRIP_TAC);
(NEW_GOAL `!y. y
IN convex hull {w1, w2:real^3}
==> ((y - u0)
dot (u1 - u0)) / (
norm (y - u0) *
norm (u1 - u0)) <=
((s2 - u0)
dot (u1 - u0)) / (
norm (s2 - u0) *
norm (u1 - u0))`);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC
SMALLEST_ANGLE_LINE_PROPERTY);
(EXISTS_TAC `w1:real^3` THEN EXISTS_TAC `w2:real^3`);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u0, u1, w1, w2} =
affine hull {u1:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(NEW_GOAL `
convex hull {w1, w2:real^3}
SUBSET affine hull {u1,w1, w2}`);
(NEW_GOAL `
convex hull {w1, w2:real^3}
SUBSET affine hull {w1, w2}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `
affine hull {w1, w2:real^3}
SUBSET affine hull {u1,w1, w2}`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA THEN SET_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR;
COPLANAR_3]);
(NEW_GOAL `~(t3+ t4 = &0)`);
(STRIP_TAC);
(NEW_GOAL `t3 = &0 /\ t4 = &0`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `x =
t1 % u0 + t2 % u1:real^3`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(NEW_GOAL `x:real^3
IN rcone_gt u0 u1 a1`);
(UNDISCH_TAC `x:real^3
IN conic_cap u0 u1 r1 a1`);
(REWRITE_TAC[
conic_cap] THEN SET_TAC[
conic_cap]);
(UP_ASM_TAC THEN REWRITE_TAC[
rcone_gt;
rconesgn;
IN;
IN_ELIM_THM] THEN STRIP_TAC);
(NEW_GOAL `(x - u0)
dot (u1 - u0:real^3) <= &0`);
(REWRITE_TAC[ASSUME `x =
t1 % u0 + t2 % u1:real^3`]);
(REWRITE_WITH `(
t1 % u0 + t2 % u1) - u0 =
(
t1 % u0 + t2 % u1) - (
t1 + t2 + t3 + t4) % u0:real^3`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[ASSUME `t3 = &0 /\ t4 = &0`; VECTOR_ARITH
`(
t1 % u0 + t2 % u1) - (
t1 + t2 + &0 + &0) % u0 = t2 % (u1 - u0)`;
DOT_LMUL;
REAL_ARITH `a * b <= &0 <=> &0 <= (--a) * b`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DOT_POS_LE] THEN ASM_REAL_ARITH_TAC);
(NEW_GOAL `&0 <=
dist (x,u0) *
dist (u1,u0:real^3) * a1`);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIST_POS_LE]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIST_POS_LE]);
(ASM_REAL_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(ABBREV_TAC `y = t3 / (t3 + t4) % w1 + t4 / (t3 + t4) % w2:real^3`);
(NEW_GOAL `x =
t1 % u0 + t2 % u1 + (t3 + t4) % (y:real^3)`);
(ASM_REWRITE_TAC[] THEN EXPAND_TAC "y");
(REWRITE_TAC[VECTOR_ARITH
`
t1 % u0 + t2 % u1 + t3 % w1 + t4 % w2 =
t1 % u0 + t2 % u1 + t % (t3 / t % w1 + t4 / t % w2) <=>
t3 % w1 + t4 % w2 = t / t % (t3 % w1 + t4 % w2)`]);
(REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(NEW_GOAL `y
IN convex hull {w1, w2:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_2;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `t3 / (t3 + t4)` THEN EXISTS_TAC `t4 / (t3 + t4)`);
(ASM_REWRITE_TAC[REAL_ARITH `a / x + b / x = (a + b) / x`]);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC
REAL_LE_DIV);
(ASM_REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_LE_DIV);
(ASM_REAL_ARITH_TAC);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(ABBREV_TAC `f = (\y:real^3.
((y - u0)
dot (u1 - u0)) / (
norm (y - u0:real^3) *
norm (u1 - u0)))`);
(NEW_GOAL `a1 < (f:real^3->
real) x`);
(NEW_GOAL `x:real^3
IN rcone_gt u0 u1 a1`);
(UNDISCH_TAC `x:real^3
IN conic_cap u0 u1 r1 a1` THEN
REWRITE_TAC[
conic_cap] THEN SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
rcone_gt;
rconesgn;
IN;
IN_ELIM_THM;
dist]);
(STRIP_TAC THEN EXPAND_TAC "f");
(REWRITE_WITH
`a1 < ((x - u0)
dot (u1 - u0)) / (
norm (x - u0) *
norm (u1 - u0)) <=>
a1 * (
norm (x - u0) *
norm (u1 - u0)) < ((x - u0:real^3)
dot (u1 - u0))`);
(MATCH_MP_TAC
REAL_LT_RDIV_EQ);
(MATCH_MP_TAC
REAL_LT_MUL);
(REWRITE_TAC[
NORM_POS_LE; REAL_ARITH `a < b <=> (a <= b) /\ ~(b = a)`]);
(SIMP_TAC[
NORM_EQ_0; VECTOR_ARITH `a - b =
vec 0 <=> a = b`]);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(NEW_GOAL `u1
IN affine hull {u0, w1, w2:real^3}`);
(REWRITE_TAC[
IN;
IN_ELIM_THM;
AFFINE_HULL_3]);
(EXISTS_TAC `(t2 + t3 + t4) / t2` THEN EXISTS_TAC `(--t3) / t2`
THEN EXISTS_TAC `(--t4) / t2`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[REAL_ARITH
`(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`]);
(MATCH_MP_TAC
REAL_DIV_REFL);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(REWRITE_WITH `(t2 + t3 + t4) = &1 -
t1`);
(UNDISCH_TAC `
t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);
(NEW_GOAL `u0 -
t1 % u0 - t3 % w1 - t4 % w2:real^3 = t2 % u1`);
(UP_ASM_TAC THEN VECTOR_ARITH_TAC);
(ASM_REWRITE_TAC[VECTOR_ARITH
`(&1 -
t1) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % u3 =
(&1 / t2) % (u0 -
t1 % u0 - t3 % u2 - t4 % u3)`]);
(REWRITE_TAC[
VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);
(REWRITE_WITH `t2 / t2 = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(VECTOR_ARITH_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {b,a,c,d}`]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u1, u0, w1, w2} =
affine hull {u0:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
COPLANAR_3;
COPLANAR_AFFINE_HULL_COPLANAR]);
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(NEW_GOAL `(f:real^3->
real) y <= f s2`);
(EXPAND_TAC "f");
(ASM_SIMP_TAC[]);
(NEW_GOAL `&1 <
t1 + t3+ t4`);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `~(
t1 + t3+ t4 = &0)`);
(ASM_REAL_ARITH_TAC);
(ABBREV_TAC `w =
t1 / (
t1 + t3 + t4) % u0 + t3 / (
t1 + t3 + t4) % w1 +
t4 / (
t1 + t3 + t4) % w2:real^3`);
(NEW_GOAL `(f:real^3->
real) y = f w`);
(EXPAND_TAC "f");
(REWRITE_WITH `y:real^3 - u0 =
&1 / (t3 + t4) % (t3 % w1 + t4 % w2 - (t3 + t4) % u0)`);
(EXPAND_TAC "y");
(REWRITE_TAC[VECTOR_ARITH
`(t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3) - u0 =
&1 / (t3 + t4) % (t3 % u2 + t4 % u3 - (t3 + t4) % u0) <=>
(t3 + t4) / (t3 + t4) % u0 = u0`]);
(REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(ASM_REWRITE_TAC[]);
(VECTOR_ARITH_TAC);
(REWRITE_TAC[
NORM_MUL;
DOT_LMUL]);
(REWRITE_WITH `w:real^3 - u0 =
&1 / (
t1 + t3 + t4) % (t3 % w1 + t4 % w2 - (t3 + t4) % u0)`);
(EXPAND_TAC "w");
(REWRITE_TAC[VECTOR_ARITH
`(
t1 / (
t1 + t3 + t4) % u0 +
t3 / (
t1 + t3 + t4) % u2 + t4 / (
t1 + t3 + t4) % u3) - u0 =
&1 / (
t1 + t3 + t4) % (t3 % u2 + t4 % u3 - (t3 + t4) % u0) <=>
(
t1 + t3 + t4) / (
t1 + t3 + t4) % u0 = u0`]);
(REWRITE_WITH `(
t1 + t3 + t4) / (
t1 + t3 + t4) = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(ASM_REWRITE_TAC[]);
(VECTOR_ARITH_TAC);
(REWRITE_TAC[
NORM_MUL;
DOT_LMUL]);
(REWRITE_WITH `abs (&1 / (t3 + t4)) = &1 / (t3 + t4)`);
(REWRITE_TAC[
REAL_ABS_REFL]);
(ASM_SIMP_TAC[
REAL_LE_DIV;
REAL_LE_ADD; REAL_ARITH `&0 <= &1`]);
(REWRITE_WITH `abs (&1 / (
t1 + t3 + t4)) = &1 / (
t1 + t3 + t4)`);
(REWRITE_TAC[
REAL_ABS_REFL]);
(MATCH_MP_TAC
REAL_LE_DIV THEN REWRITE_TAC[REAL_ARITH `&0 <= &1`]);
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[REAL_ARITH `(a * x) / ((a * y) * z) =
(a * x) / (a * (y * z))`]);
(ABBREV_TAC
`b1 =
norm (t3 % w1 + t4 % w2 - (t3 + t4) % u0) *
norm (u1 - u0:real^3)`);
(NEW_GOAL `~(b1 = &0)`);
(EXPAND_TAC "b1" THEN ASM_REWRITE_TAC[
REAL_ENTIRE;
NORM_EQ_0;
VECTOR_ARITH `(a - b =
vec 0 <=> a = b)/\(a + b-c =
vec 0 <=> a + b = c)`]);
(STRIP_TAC);
(NEW_GOAL `u0
IN convex hull {w1, w2:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_2;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `t3 / (t3 + t4)` THEN EXISTS_TAC `t4 / (t3 + t4)`);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC
REAL_LE_DIV THEN ASM_REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_LE_DIV THEN ASM_REAL_ARITH_TAC);
(ASM_SIMP_TAC[
REAL_DIV_REFL; REAL_ARITH `a / x + b / x = (a + b) / x`]);
(SIMP_TAC[VECTOR_ARITH `a/ x % u + b/ x % v = &1/ x % (a % u + b % v)`]);
(REWRITE_TAC[ASSUME `t3 % w1 + t4 % w2 = (t3 + t4) % u0:real^3`; VECTOR_ARITH
`&1 / a % (a % b) = (a / a) % b`]);
(REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[]);
(ONCE_REWRITE_TAC[GSYM
COPLANAR_AFFINE_HULL_COPLANAR]);
(REWRITE_WITH `
affine hull {u0, u1, w1, w2} =
affine hull {u1:real^3, w1, w2}`);
(MATCH_MP_TAC
AFFINE_HULL_3_INSERT);
(NEW_GOAL `
convex hull {w1, w2:real^3}
SUBSET affine hull {u1,w1, w2}`);
(NEW_GOAL `
convex hull {w1, w2:real^3}
SUBSET affine hull {w1, w2}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `
affine hull {w1, w2:real^3}
SUBSET affine hull {u1,w1, w2}`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA THEN SET_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR;
COPLANAR_3]);
(NEW_GOAL `~(&1 / (t3 + t4) = &0)`);
(MATCH_MP_TAC Trigonometry2.NOT_EQ0_IMP_NEITHER_INVERT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`(&1 / (t3 + t4) * ((t3 % w1 + t4 % w2 - (t3 + t4) % u0)
dot (u1 - u0))) /
(&1 / (t3 + t4) * b1) =
((t3 % w1 + t4 % w2 - (t3 + t4) % u0)
dot (u1 - u0:real^3)) / b1`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);
(NEW_GOAL `~(&1 / (
t1 + t3 + t4) = &0)`);
(MATCH_MP_TAC Trigonometry2.NOT_EQ0_IMP_NEITHER_INVERT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`(&1 / (
t1 + t3 + t4) * ((t3 % w1 + t4 % w2 - (t3 + t4) % u0)
dot (u1 - u0))) /
(&1 / (
t1 + t3 + t4) * b1) =
((t3 % w1 + t4 % w2 - (t3 + t4) % u0)
dot (u1 - u0:real^3)) / b1`);
(UP_ASM_TAC THEN UNDISCH_TAC `~(b1 = &0)` THEN
MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);
(NEW_GOAL `(f:real^3->
real) x <= f w`);
(EXPAND_TAC "f");
(REWRITE_WITH
`((x - u0)
dot (u1 - u0:real^3)) / (
norm (x - u0) *
norm (u1 - u0)) <=
((w - u0)
dot (u1 - u0)) / (
norm (w - u0) *
norm (u1 - u0)) <=>
((x - u0)
dot (u1 - u0)) * (
norm (w - u0) *
norm (u1 - u0)) <=
((w - u0)
dot (u1 - u0)) * (
norm (x - u0) *
norm (u1 - u0))`);
(MATCH_MP_TAC
RAT_LEMMA4);
(STRIP_TAC);
(MATCH_MP_TAC
REAL_LT_MUL);
(ASM_REWRITE_TAC[
NORM_POS_LT; VECTOR_ARITH `x - b =
vec 0 <=> x = b`]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}` THEN REWRITE_TAC[]);
(REWRITE_TAC[
coplanar]);
(EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `w1:real^3` THEN
EXISTS_TAC `w2:real^3`);
(ONCE_REWRITE_TAC[SET_RULE `{u0, u1, u2, u3} = {u1, u0, u2, u3}`]);
(MATCH_MP_TAC (SET_RULE `u0
IN S /\ b
SUBSET S ==> (u0
INSERT b)
SUBSET S`));
(REWRITE_TAC[
SET_SUBSET_AFFINE_HULL]);
(REWRITE_TAC[
AFFINE_HULL_3;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `(t2 + t3 + t4) / t2` THEN EXISTS_TAC `(--t3) / t2`
THEN EXISTS_TAC `(--t4) / t2`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[REAL_ARITH
`(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`]);
(MATCH_MP_TAC
REAL_DIV_REFL);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(REWRITE_WITH `(t2 + t3 + t4) = &1 -
t1`);
(UNDISCH_TAC `
t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);
(NEW_GOAL `u0 -
t1 % u0 - t3 % w1 - t4 % w2:real^3 = t2 % u1`);
(UP_ASM_TAC THEN VECTOR_ARITH_TAC);
(ASM_REWRITE_TAC[VECTOR_ARITH
`(&1 -
t1) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % u3 =
(&1 / t2) % (u0 -
t1 % u0 - t3 % u2 - t4 % u3)`]);
(REWRITE_TAC[
VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);
(REWRITE_WITH `t2 / t2 = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(VECTOR_ARITH_TAC);
(MATCH_MP_TAC
REAL_LT_MUL);
(REWRITE_TAC[REAL_ARITH `&0 < a <=> (&0 <= a) /\ ~(a = &0)`]);
(REWRITE_TAC[
NORM_POS_LE;
NORM_EQ_0; VECTOR_ARITH `x - y=
vec 0 <=>x = y`]);
(STRIP_TAC);
(EXPAND_TAC "w" THEN STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_TAC[
coplanar]);
(EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `w1:real^3` THEN
EXISTS_TAC `w2:real^3`);
(MATCH_MP_TAC (SET_RULE `u0
IN S /\ b
SUBSET S ==> (u0
INSERT b)
SUBSET S`));
(REWRITE_TAC[
SET_SUBSET_AFFINE_HULL]);
(REWRITE_TAC[
AFFINE_HULL_3;
IN;
IN_ELIM_THM]);
(EXISTS_TAC `&0` THEN EXISTS_TAC `t3 / (t3 + t4)`
THEN EXISTS_TAC `t4 / (t3 + t4)`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `&0 + t3 / (t3 + t4) + t4 / (t3 + t4) =
(t3 + t4) / (t3 + t4)`]);
(MATCH_MP_TAC
REAL_DIV_REFL);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[VECTOR_ARITH
`&0 % u1 + t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3 =
(&1 / (t3 + t4)) % (t3 % u2 + t4 % u3)`]);
(UP_ASM_TAC THEN REWRITE_TAC[VECTOR_ARITH
`
t1 / x % u0 + t3 / x % u2 + t4 / x % u3 =
(&1 / x) % (
t1 % u0 + t3 % u2 + t4 % u3)`]);
(REWRITE_WITH `&1 / (
t1 + t3 + t4) % (
t1 % u0 + t3 % w1 + t4 % w2) = u0 <=>
t1 % u0 + t3 % w1 + t4 % w2 = (
t1 + t3 + t4) % u0:real^3`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Collect_geom.CHANGE_SIDE);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[VECTOR_ARITH `
t1 % u0 + t3 % u2 + t4 % u3 = (
t1 + t3 + t4) % u0
<=> t3 % u2 + t4 % u3 = (t3 + t4) % u0`]);
(STRIP_TAC THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[
VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);
(REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `x = t2 % u1 + (
t1 + t3 + t4) % w:real^3`);
(ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");
(REWRITE_TAC[VECTOR_ARITH
`x % (
t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (
t1 % u0 + t3 % u2 + t4 % u3)`]);
(REWRITE_WITH `(
t1 + t3 + t4) / (
t1 + t3 + t4) = &1`);
(ASM_SIMP_TAC[
REAL_DIV_REFL]);
(VECTOR_ARITH_TAC);
(ABBREV_TAC `t =
t1 + t3 + t4`);
(REWRITE_WITH `(t2 % u1 + t % w) - u0:real^3 =
(t2 % u1 + t % w) - (
t1 + t2 + t3 + t4) % u0`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_WITH `
t1 + t2 + t3 + t4 = t2 + t:real`);
(EXPAND_TAC "t" THEN REAL_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH
`(t2 % u1 + t % w) - (t2 + t) % u0 = t2 % (u1 - u0) + t % (w - u0)`]);
(ABBREV_TAC `x1 = u1 - u0:real^3`);
(ABBREV_TAC `x2 = w - u0:real^3`);
(REWRITE_WITH `(t2 % x1 + t % x2)
dot x1 =
t2 *
norm x1 pow 2 + t * x2
dot (x1:real^3)`);
(REWRITE_TAC[
NORM_POW_2]);
(VECTOR_ARITH_TAC);
(NEW_GOAL `t2 *
norm x1 pow 2 *
norm x2 *
norm x1 <=
t2 * (x2
dot x1) *
norm x1 *
norm (x1:real^3)`);
(REWRITE_TAC[REAL_POW_2; REAL_ARITH `t2 * (x1 * x1) * x2 * x1 <=
t2 * x3 * x1 * x1 <=> &0 <= (x1 pow 2) * (--t2) * (x2 * x1 - x3)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(ASM_SIMP_TAC[
REAL_LE_MUL;
NORM_POS_LE]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`]);
(STRIP_TAC);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(REWRITE_TAC[
NORM_CAUCHY_SCHWARZ]);
(NEW_GOAL
`t2 * (x2
dot x1) *
norm x1 *
norm x1 + t * (x2
dot x1) *
norm x2 *
norm x1 <= (x2
dot x1) *
norm (t2 % x1 + t % x2) *
norm (x1:real^3)`);
(REWRITE_TAC[REAL_ARITH `t2 * x3 * x1 * x1 + t * x3 * x2 * x1 <=
x3 * x4 * x1 <=> &0 <= (x1 * x3) * (x4 - t2 * x1 - t * x2)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
NORM_POS_LE]);
(ASM_CASES_TAC `x2
dot (x1:real^3) < &0`);
(NEW_GOAL `F`);
(NEW_GOAL `(f:real^3->
real) x <= &0`);
(EXPAND_TAC "f");
(REWRITE_TAC[REAL_ARITH `a / b <= &0 <=> &0 <= (--a) / b`]);
(MATCH_MP_TAC
REAL_LE_DIV);
(SIMP_TAC[
NORM_POS_LE;
REAL_LE_MUL]);
(REWRITE_WITH `x = t2 % u1 + (
t1 + t3 + t4) % w:real^3`);
(ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");
(REWRITE_TAC[VECTOR_ARITH
`x % (
t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (
t1 % u0 + t3 % u2 + t4 % u3)`]);
(EXPAND_TAC "t");
(REWRITE_WITH `(
t1 + t3 + t4) / (
t1 + t3 + t4) = &1`);
(MATCH_MP_TAC
REAL_DIV_REFL);
(ASM_REWRITE_TAC[]);
(VECTOR_ARITH_TAC);
(REWRITE_TAC[REAL_ARITH `&0 <= --a <=> a <= &0`]);
(REWRITE_WITH `(t2 % u1 + (
t1 + t3 + t4) % w) - u0:real^3 =
(t2 % u1 + (
t1 + t3 + t4) % w) - (
t1 + t2 + t3 + t4) % u0`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_WITH `(t2 % u1 + (
t1 + t3 + t4) % w) - (
t1 + t2 + t3 + t4) % u0 =
t2 % x1 + t % x2:real^3`);
(EXPAND_TAC "x1" THEN EXPAND_TAC "x2" THEN EXPAND_TAC "t"
THEN VECTOR_ARITH_TAC);
(NEW_GOAL `t % x2
dot (x1:real^3) <= &0`);
(REWRITE_TAC[
DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= a * (--b)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `
t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(NEW_GOAL `t2 % x1
dot (x1:real^3) <= &0`);
(REWRITE_TAC[
DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= (--a) * b`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `
t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);
(REWRITE_TAC[
DOT_POS_LE]);
(REWRITE_TAC[
DOT_LADD]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);
(UP_ASM_TAC THEN UNDISCH_TAC `a1 < (f:real^3->
real) x`);
(EXPAND_TAC "a1" THEN UNDISCH_TAC `&0 <= a` THEN REAL_ARITH_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(REWRITE_TAC [REAL_ARITH `&0 <= a - b * d - c <=> c <= a + (--b) * d`]);
(REWRITE_WITH `t *
norm (x2:real^3) = abs t *
norm x2`);
(AP_THM_TAC THEN AP_TERM_TAC);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[
REAL_ABS_REFL]);
(EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `
t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);
(REWRITE_WITH `(--t2) *
norm (x1:real^3) = abs (--t2) *
norm x1`);
(AP_THM_TAC THEN AP_TERM_TAC);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[
REAL_ABS_REFL]);
(UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);
(REWRITE_TAC[GSYM
NORM_MUL]);
(REWRITE_WITH
`
norm (t % x2:real^3) =
norm ((t2 % x1 + t % x2) + (--t2 % x1))`);
(AP_TERM_TAC THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[
NORM_TRIANGLE]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);
(NEW_GOAL `(f:real^3->
real) x <= f s2`);
(UNDISCH_TAC `(f:real^3->
real) y <= f s2`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);
(NEW_GOAL `(f:real^3->
real) s2 <= a1`);
(EXPAND_TAC "f");
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "a1" THEN REAL_ARITH_TAC);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC `a1 < (f:real^3->
real) x`);
(REAL_ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(* ========================================================================= *)
(NEW_GOAL
`
NULLSET (
conic_cap u0 u1 r1 a1
INTER aff_ge {u0:real^3, u1} {w1, w2})`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `
conic_cap u0 u1 r a
INTER convex hull {u0:real^3, u1, w1, w2}`);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `vol (
conic_cap u0 u1 r1 a1
INTER aff_ge {u0, u1} {w1, w2}) = &0`);
(ASM_SIMP_TAC[
MEASURE_EQ_0]);
(UP_ASM_TAC THEN REWRITE_WITH
`vol (
conic_cap u0 u1 r1 a1
INTER aff_ge {u0, u1} {w1, w2}) =
vol (
conic_cap u0 u1 r1 a1
INTER aff_gt {u0, u1} {w1, w2})`);
(MATCH_MP_TAC
MEASURE_NEGLIGIBLE_SYMDIFF);
(REWRITE_WITH `
conic_cap u0 u1 r1 a1
INTER aff_gt {u0, u1} {w1, w2}
DIFF
conic_cap u0 u1 r1 a1
INTER aff_ge {u0, u1:real^3} {w1, w2} =
{}`);
(MATCH_MP_TAC (SET_RULE `A
SUBSET B ==> (C
INTER A)
DIFF (C
INTER B) = {}`));
(REWRITE_TAC[
AFF_GT_SUBSET_AFF_GE]);
(REWRITE_TAC[SET_RULE `a
UNION {} = a`]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `aff_ge {u0, u1:real^3} {w1, w2}
DIFF
aff_gt {u0, u1} {w1, w2}`);
(REWRITE_TAC[SET_RULE `A
INTER B
DIFF A
INTER C
SUBSET B
DIFF C`]);
(REWRITE_WITH `aff_ge {u0, u1:real^3} {w1, w2} =
aff_gt {u0, u1} {w1, w2}
UNION
UNIONS {aff_ge {u0, u1} ({w1, w2}
DELETE a) | a | a
IN {w1, w2}}`);
(MATCH_MP_TAC
AFF_GE_AFF_GT_DECOMP);
(REWRITE_TAC[Geomdetail.FINITE6]);
(REWRITE_TAC[
DISJOINT]);
(ASM_CASES_TAC `w1
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2} = {u0, u1, w2:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN MESON_TAC[]);
(ASM_CASES_TAC `w2
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2} = {u0, u1, w1:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN MESON_TAC[]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC
`
UNIONS {aff_ge {u0, u1:real^3} ({w1, w2}
DELETE a) | a | a
IN {w1, w2}}`);
(STRIP_TAC);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC
`aff_ge {u0, u1:real^3} {w1}
UNION aff_ge {u0, u1:real^3} {w2}`);
(STRIP_TAC);
(MATCH_MP_TAC
NEGLIGIBLE_UNION);
(STRIP_TAC);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `
affine hull {u0, u1:real^3, w1}`);
(STRIP_TAC);
(REWRITE_TAC[
NEGLIGIBLE_AFFINE_HULL_3]);
(REWRITE_WITH `{u0,u1,w1:real^3} = {u0,u1}
UNION {w1}`);
(SET_TAC[]);
(REWRITE_TAC[
AFF_GE_SUBSET_AFFINE_HULL]);
(MATCH_MP_TAC
NEGLIGIBLE_SUBSET);
(EXISTS_TAC `
affine hull {u0, u1:real^3, w2}`);
(STRIP_TAC);
(REWRITE_TAC[
NEGLIGIBLE_AFFINE_HULL_3]);
(REWRITE_WITH `{u0,u1,w2:real^3} = {u0,u1}
UNION {w2}`);
(SET_TAC[]);
(REWRITE_TAC[
AFF_GE_SUBSET_AFFINE_HULL]);
(REWRITE_TAC[SET_RULE
`
UNIONS {aff_ge {u0, u1} ({m, s3}
DELETE a) | a | a
IN {m, s3}} =
aff_ge {u0, u1} ({m, s3}
DELETE s3)
UNION aff_ge {u0, u1} ({m, s3}
DELETE m)`]);
(MATCH_MP_TAC (SET_RULE
`A
SUBSET B /\ C
SUBSET D ==> A
UNION C
SUBSET B
UNION D`));
(STRIP_TAC);
(MATCH_MP_TAC
AFF_GE_MONO_RIGHT);
(STRIP_TAC);
(SET_TAC[]);
(REWRITE_TAC[
DISJOINT]);
(ASM_CASES_TAC `w1
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2} = {u0, u1, w2:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN MESON_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(MATCH_MP_TAC
AFF_GE_MONO_RIGHT);
(STRIP_TAC);
(SET_TAC[]);
(REWRITE_TAC[
DISJOINT]);
(ASM_CASES_TAC `w2
IN {u0, u1:real^3}`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}`);
(REWRITE_WITH `{u0, u1, w1, w2} = {u0, u1, w1:real^3}`);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
COPLANAR_3]);
(UP_ASM_TAC THEN MESON_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(SET_TAC[]);
(STRIP_TAC);
(UNDISCH_TAC `~coplanar {u0, u1, w1, w2:real^3}` THEN REWRITE_TAC[]);
(MATCH_MP_TAC
CONIC_CAP_AFF_GT_EQ_0);
(EXISTS_TAC `a1:real` THEN EXISTS_TAC `r1:real`);
(ASM_REWRITE_TAC[])]);;
(* ==================================================================== *)
(* Lemma 36 *)
(* ==================================================================== *)
(* Currently added lemmas *)
(* Lemma 37 *)
let FINITE_LIST_KY_LEMMA_2 = prove
(`!s:A->bool.
FINITE s
==> FINITE
{y | ?u0 u1.
u0
IN s /\
u1
IN s /\
y = [u0; u1]}`,
REWRITE_TAC[SET_RULE
`{y | ?u0 u1. u0
IN s /\ u1
IN s /\ y = [u0; u1]} =
{[u0;u1] | u0
IN s /\ u1
IN s}`] THEN
REPEAT
(GEN_TAC THEN DISCH_TAC THEN
MATCH_MP_TAC
FINITE_PRODUCT_DEPENDENT THEN ASM_REWRITE_TAC[]));;
(* ==================================================================== *)
(* Lemma 38: BETA_PAIR_THM - formal proof by TCHales *)
(* ==================================================================== *)
(* Lemma 39 *)
let DIHX_RANGE = prove_by_refinement (
`!V X u v. &0 <= dihX V X (u,v) /\ dihX V X (u,v) <=
pi`,
[(REWRITE_TAC[dihX] THEN REPEAT GEN_TAC);
(COND_CASES_TAC);
(REWRITE_TAC[
PI_POS_LE; REAL_ARITH `a <= a`]);
(REPEAT LET_TAC THEN COND_CASES_TAC);
(REWRITE_TAC[dihu2;
DIHV_RANGE]);
(COND_CASES_TAC);
(REWRITE_TAC[dihu3;
DIHV_RANGE]);
(COND_CASES_TAC);
(REWRITE_TAC[dihu4;
DIHV_RANGE]);
(REWRITE_TAC[
PI_POS_LE; REAL_ARITH `a <= a`])]);;
(* ==================================================================== *)
(* Lemma 40 *)
let BOUNDED_VOLUME_MCELL = prove_by_refinement (
`!V. ?c. !X. saturated V /\ packing V /\
mcell_set V X ==> vol X <= c`,
[(GEN_TAC);
(ASM_CASES_TAC `saturated V /\ packing V`);
(EXISTS_TAC `&4 / &3 *
pi * &8 pow 3`);
(REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[
mcell_set_2;
IN_ELIM_THM;
IN]);
(STRIP_TAC);
(ASM_CASES_TAC `X:real^3->bool = {}`);
(REWRITE_TAC[
MEASURE_EMPTY; ASSUME `X:real^3->bool = {}`]);
(REWRITE_TAC[REAL_ARITH `&0 <= &4 / &3 *
pi * &8 pow 3 <=> &0 <=
pi`]);
(REWRITE_TAC[
PI_POS_LE]);
(UP_ASM_TAC THEN REWRITE_TAC[SET_RULE `~(x = {}) <=> (?v. v
IN x)`]);
(STRIP_TAC);
(NEW_GOAL `vol X <= vol (
ball (v, &8))`);
(MATCH_MP_TAC
MEASURE_SUBSET);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[] THEN MATCH_MP_TAC
MEASURABLE_MCELL);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
MEASURABLE_BALL]);
(ASM_REWRITE_TAC[] THEN MATCH_MP_TAC
MCELL_SUBSET_BALL8);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN SIMP_TAC[
VOLUME_BALL; REAL_ARITH `&0 <= &8`]);
(EXISTS_TAC `&0`);
(REPEAT STRIP_TAC THEN ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 41 *)
let LEFT_ACTION_LIST_2_EXISTS = prove_by_refinement (
`!u0 u1 u2 x y z d:A.
CARD {u0, u1, u2, d} = 4 /\ {x, y, z} = {u0, u1, u2}
==> (?p. p
permutes 0..2 /\
[x; y; z; d] =
left_action_list p [u0; u1; u2; d])`,
[(REPEAT STRIP_TAC);
(REWRITE_TAC[
left_action_list;
LENGTH;
TABLE_4;
ARITH_RULE `SUC (SUC (SUC (SUC 0))) = 4`]);
(NEW_GOAL `{u0, u1, u2:A} =
{
EL 0 [u0;u1;u2;d] ,
EL 1 [u0;u1;u2;d],
EL 2 [u0;u1;u2;d]}`);
(REWRITE_TAC[
EL;
HD; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`;
TL]);
(NEW_GOAL `{x, y, z:A} =
{
EL 0 [u0;u1;u2;d] ,
EL 1 [u0;u1;u2;d],
EL 2 [u0;u1;u2;d]}`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `?i1. i1
IN {0,1,2} /\
EL i1 [u0;u1;u2;d] = x:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `?i2. i2
IN {0,1,2} /\
EL i2 [u0;u1;u2;d] = y:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `?i3. i3
IN {0,1,2} /\
EL i3 [u0;u1;u2;d] = z:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `~(i1 = i2) /\ ~(i1 = i3) /\ ~(i2 = i3:num)`);
(REPEAT STRIP_TAC);
(NEW_GOAL `{u0,u1,u2,d:A} = {x, z,d}`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,d:A} = 4` THEN ASM_REWRITE_TAC[]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `{u0,u1,u2,d:A} = {x, y,d}`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,d:A} = 4` THEN ASM_REWRITE_TAC[]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `{u0,u1,u2,d:A} = {x, y,d}`);
(ASM_SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,d:A} = 4` THEN ASM_REWRITE_TAC[]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(SWITCH_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REPEAT STRIP_TAC);
(NEW_GOAL `{i1, i2, i3} = {0,1,2}`);
(ASM_SET_TAC[]);
(ABBREV_TAC `p = (\i:num. if i = i1 then 0
else if i = i2 then 1
else if i = i3 then 2
else i)`);
(NEW_GOAL `p i1 = 0 /\ p i2 = 1 /\ p (i3:num) = 2`);
(ASM_MESON_TAC[]);
(EXISTS_TAC `p:num->num`);
(NEW_GOAL `p
permutes 0..2`);
(REWRITE_TAC[
permutes;
EXISTS_UNIQUE;
IN_NUMSEG_0;
ARITH_RULE `a <= 2 <=> a = 0 \/ a = 1 \/ a = 2`;
SET_RULE `x = 0 \/ x = 1 \/ x = 2 <=> x
IN {0,1,2}`]);
(NEW_GOAL `(!x. ~(x
IN {0, 1, 2}) ==> p x = x)`);
(REPEAT STRIP_TAC);
(EXPAND_TAC "p");
(COND_CASES_TAC);
(ASM_SET_TAC[]);
(COND_CASES_TAC);
(ASM_SET_TAC[]);
(COND_CASES_TAC);
(ASM_SET_TAC[]);
(REFL_TAC);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `y' = 0`);
(EXISTS_TAC `i1:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(ASM_SET_TAC[]);
(ASM_CASES_TAC `y' = 1`);
(EXISTS_TAC `i2:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(ASM_SET_TAC[]);
(ASM_CASES_TAC `y' = 2`);
(EXISTS_TAC `i3:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(ASM_SET_TAC[]);
(NEW_GOAL `~(y'
IN {0,1,2})`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(EXISTS_TAC `y':num`);
(ASM_SIMP_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(NEW_GOAL `(p:num->num) y'' = y''`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_WITH `
inverse (p:num->num) 0 = i1 /\
inverse p 1 = i2 /\
inverse p 2 = i3`);
(UP_ASM_TAC THEN MESON_TAC[
PERMUTES_INVERSE_EQ;
ASSUME `(p:num->num) i1 = 0 /\ p i2 = 1 /\ p i3 = 2`]);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `
inverse (p:num->num) 3 = 3`);
(NEW_GOAL `p 3 = 3`);
(MP_TAC (ASSUME `p
permutes 0..2`) THEN REWRITE_TAC[
permutes]);
(STRIP_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(REWRITE_TAC[
IN_NUMSEG_0] THEN ARITH_TAC);
(UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[
PERMUTES_INVERSE_EQ]);
(REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`])]);;
(* ==================================================================== *)
(* Lemma 42 *)
let LEFT_ACTION_LIST_3_EXISTS = prove_by_refinement (
`!u0 u1 u2 u3 x y z t:A.
CARD {u0, u1, u2, u3} = 4 /\ {x, y, z, t} = {u0, u1, u2, u3}
==> (?p. p
permutes 0..3 /\
[x; y; z; t] =
left_action_list p [u0; u1; u2; u3])`,
[(REPEAT STRIP_TAC);
(REWRITE_TAC[
left_action_list;
LENGTH;
TABLE_4;
ARITH_RULE `SUC (SUC (SUC (SUC 0))) = 4`]);
(NEW_GOAL `{u0, u1, u2, u3:A} = {
EL 0 [u0;u1;u2;u3],
EL 1 [u0;u1;u2;u3],
EL 2 [u0;u1;u2;u3],
EL 3 [u0;u1;u2;u3]}`);
(REWRITE_TAC[
EL;
HD; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
TL]);
(NEW_GOAL `{x, y, z, t:A} = {
EL 0 [u0;u1;u2;u3],
EL 1 [u0;u1;u2;u3],
EL 2 [u0;u1;u2;u3],
EL 3 [u0;u1;u2;u3]}`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `?i1. i1
IN {0,1,2,3} /\
EL i1 [u0;u1;u2;u3] = x:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `?i2. i2
IN {0,1,2,3} /\
EL i2 [u0;u1;u2;u3] = y:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `?i3. i3
IN {0,1,2,3} /\
EL i3 [u0;u1;u2;u3] = z:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `?i4. i4
IN {0,1,2,3} /\
EL i4 [u0;u1;u2;u3] = t:A`);
(UP_ASM_TAC THEN SET_TAC[]);
(FIRST_X_ASSUM CHOOSE_TAC THEN SWITCH_TAC);
(NEW_GOAL `~(i1 = i2) /\ ~(i1 = i3) /\ ~(i1 = i4:num) /\ ~(i2 = i3) /\
~(i2 = i4) /\ ~(i3 = i4)`);
(REPEAT STRIP_TAC);
(NEW_GOAL `x = y:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, z,t}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, z, t:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `x = z:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, y,t}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, y, t:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `x = t:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, y, z}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, y, z:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `y = z:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, z,t}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, z, t:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `y = t:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, z,t}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, z, t:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(NEW_GOAL `z = t:A`);
(ASM_MESON_TAC[]);
(NEW_GOAL `{u0,u1,u2,u3:A} = {x, y,t}`);
(UNDISCH_TAC `{x, y, z, t:A} = {u0, u1, u2, u3}` THEN UP_ASM_TAC
THEN SET_TAC[]);
(UNDISCH_TAC `
CARD {u0,u1,u2,u3:A} = 4` THEN
REWRITE_TAC[ASSUME `{u0, u1, u2, u3} = {x, y, t:A}`]);
(MESON_TAC[Geomdetail.CARD3; ARITH_RULE `a <= 3 ==> ~(a = 4)`]);
(SWITCH_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REPEAT STRIP_TAC);
(NEW_GOAL `{i1, i2, i3,i4} = {0,1,2,3}`);
(REWRITE_TAC[SET_EQ_LEMMA]);
(REPEAT STRIP_TAC);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(ABBREV_TAC `p = (\i:num. if i = i1 then 0
else if i = i2 then 1
else if i = i3 then 2
else if i = i4 then 3
else i)`);
(NEW_GOAL `p i1 = 0 /\ p i2 = 1 /\ p (i3:num) = 2 /\ p i4 = 3`);
(REPEAT STRIP_TAC);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(EXPAND_TAC "p" THEN COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(REFL_TAC);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(EXISTS_TAC `p:num->num`);
(NEW_GOAL `p
permutes 0..3`);
(REWRITE_TAC[
permutes;
EXISTS_UNIQUE;
IN_NUMSEG_0;
ARITH_RULE `a <= 3 <=> a = 0 \/ a = 1 \/ a = 2 \/ a = 3`;
SET_RULE `x = 0 \/ x = 1 \/ x = 2 \/ x = 3 <=> x
IN {0,1,2,3}`]);
(NEW_GOAL `(!x. ~(x
IN {0, 1, 2, 3}) ==> p x = x)`);
(REPEAT STRIP_TAC);
(EXPAND_TAC "p");
(COND_CASES_TAC);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(x'
IN {0, 1, 2, 3})` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(x'
IN {0, 1, 2, 3})` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(x'
IN {0, 1, 2, 3})` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(x'
IN {0, 1, 2, 3})` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `y' = 0`);
(EXISTS_TAC `i1:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i4:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2,3})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 0` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(REPLICATE_TAC 4 UP_ASM_TAC THEN REWRITE_TAC[] THEN
UNDISCH_TAC `{i1,i2,i3,i4} = {0,1,2,3}` THEN SET_TAC[]);
(ASM_CASES_TAC `y' = 1`);
(EXISTS_TAC `i2:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i4:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2,3})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 1` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(REPLICATE_TAC 4 UP_ASM_TAC THEN REWRITE_TAC[] THEN
UNDISCH_TAC `{i1,i2,i3,i4} = {0,1,2,3}` THEN SET_TAC[]);
(ASM_CASES_TAC `y' = 2`);
(EXISTS_TAC `i3:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i4:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2,3})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 2` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(REPLICATE_TAC 4 UP_ASM_TAC THEN REWRITE_TAC[] THEN
UNDISCH_TAC `{i1,i2,i3,i4} = {0,1,2,3}` THEN SET_TAC[]);
(ASM_CASES_TAC `y' = 3`);
(EXISTS_TAC `i4:num`);
(ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 3` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 3` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 3` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `~(y''
IN {0,1,2,3})`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = 3` THEN ASM_SIMP_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(REPLICATE_TAC 4 UP_ASM_TAC THEN REWRITE_TAC[] THEN
UNDISCH_TAC `{i1,i2,i3,i4} = {0,1,2,3}` THEN SET_TAC[]);
(NEW_GOAL `~(y'
IN {0,1,2,3})`);
(REPLICATE_TAC 4 UP_ASM_TAC THEN SET_TAC[]);
(EXISTS_TAC `y':num`);
(ASM_SIMP_TAC[] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `y'' = i1:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i2:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i3:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `y'' = i4:num`);
(NEW_GOAL `F`);
(UNDISCH_TAC `(p:num->num) y'' = y'` THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(NEW_GOAL `(p:num->num) y'' = y''`);
(FIRST_ASSUM MATCH_MP_TAC);
(REPLICATE_TAC 4 UP_ASM_TAC THEN REWRITE_TAC[] THEN
UNDISCH_TAC `{i1,i2,i3,i4} = {0,1,2,3}` THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_WITH `
inverse (p:num->num) 0 = i1 /\
inverse p 3 = i4 /\
inverse p 1 = i2 /\
inverse p 2 = i3`);
(UP_ASM_TAC THEN MESON_TAC[
PERMUTES_INVERSE_EQ;
ASSUME `(p:num->num) i1 = 0 /\ p i2 = 1 /\ p i3 = 2 /\ p i4 = 3`]);
(ASM_REWRITE_TAC[])]);;
(* ==================================================================== *)
(* Lemma 43 *)
let lmfun_bounded = prove_by_refinement (
`!h. &0 <= h ==> lmfun h <= h0 / (h0 - &1)`,
[(REPEAT STRIP_TAC THEN REWRITE_TAC[lmfun] THEN COND_CASES_TAC);
(REWRITE_TAC[REAL_ARITH `(h0 - h) / (h0 - &1) <= h0 / (h0 - &1) <=>
&0 <= h / (h0 - &1)`]);
(MATCH_MP_TAC
REAL_LE_DIV);
(REWRITE_TAC[h0] THEN ASM_REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_LE_DIV);
(REWRITE_TAC[h0] THEN REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 44 *)
let lmfun_pos_le = prove_by_refinement (
`!h. &0 <= lmfun h`,
[(REPEAT STRIP_TAC THEN REWRITE_TAC[lmfun] THEN COND_CASES_TAC);
(MATCH_MP_TAC
REAL_LE_DIV);
(STRIP_TAC);
(ASM_REAL_ARITH_TAC);
(ASM_REWRITE_TAC[h0] THEN REAL_ARITH_TAC);
(REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 45 *)
(* ==================================================================== *)
(* Lemma 46 *)
let MCELL_ID_MXI_2 = prove_by_refinement (
`!V i j ul vl.
packing V /\
saturated V /\
barV V 3 ul /\
barV V 3 vl /\
mcell i V ul = mcell j V vl /\
~NULLSET (mcell i V ul) /\
i
IN {2, 3} /\
j
IN {2, 3}
==> mxi V ul = mxi V vl`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `i = j /\
(!k. i - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V vl k)`);
(MATCH_MP_TAC
MCELL_ID_OMEGA_LIST_N);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_CASES_TAC `hl (truncate_simplex 2 (ul:(real^3)list)) >=
sqrt (&2)`);
(ASM_CASES_TAC `hl (truncate_simplex 2 (vl:(real^3)list)) >=
sqrt (&2)`);
(REWRITE_WITH `mxi V ul = omega_list_n V ul 2`);
(REWRITE_TAC[mxi] THEN COND_CASES_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(REWRITE_WITH `mxi V vl = omega_list_n V vl 2`);
(REWRITE_TAC[mxi] THEN COND_CASES_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `F`);
(ASM_MESON_TAC[]);
(ASM_MESON_TAC[]);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(ABBREV_TAC `xl = truncate_simplex 2 (ul:(real^3)list)`);
(ABBREV_TAC `yl = truncate_simplex 2 (vl:(real^3)list)`);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `V
INTER mcell i V ul =
set_of_list (truncate_simplex (i - 1) ul)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `V
INTER mcell j V vl =
set_of_list (truncate_simplex (j - 1) vl)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `hl (xl:(real^3)list) <=
dist (omega_list V xl,
HD xl)`);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN] THEN EXPAND_TAC "xl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `!w:real^3. w
IN set_of_list yl
==>
dist (circumcenter (
set_of_list yl),w) = hl yl`);
(MATCH_MP_TAC Rogers.HL_PROPERTIES);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `2` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "yl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `circumcenter (
set_of_list yl) =
omega_list V (yl:(real^3)list)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "yl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(STRIP_TAC);
(NEW_GOAL `hl yl =
dist (omega_list V yl,
HD xl)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `
HD (xl:(real^3)list) =
HD (truncate_simplex (i - 1) ul)`);
(REWRITE_WITH `
HD (xl:(real^3)list) =
HD ul`);
(EXPAND_TAC "xl");
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `i
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
HD (xl:(real^3)list)
IN
set_of_list (truncate_simplex (i - 1) ul)`);
(REWRITE_TAC[ASSUME `
HD (xl:(real^3)list) =
HD (truncate_simplex (i - 1) ul)`]);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `i - 1`);
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`] THEN ARITH_TAC);
(UP_ASM_TAC);
(NEW_GOAL `
set_of_list (truncate_simplex (j - 1) vl)
SUBSET
set_of_list (yl:(real^3)list)`);
(EXPAND_TAC "yl");
(MATCH_MP_TAC Rogers.TRUNCATE_SIMPLEX_SUBSET);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(SET_TAC[]);
(NEW_GOAL `omega_list V xl = omega_list V yl`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (xl:(real^3)list) = 3 /\
LENGTH (yl:(real^3)list) = 3`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_TAC[ARITH_RULE `3 = 2 + 1`]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH
`truncate_simplex 2 ul = truncate_simplex (2 + 0) (ul:(real^3)list) /\
truncate_simplex 2 vl = truncate_simplex (2 + 0) (vl:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) ul) 2 = omega_list_n V ul 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) vl) 2 = omega_list_n V vl 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `hl (yl:(real^3)list) =
dist (omega_list V xl,
HD xl)`);
(ASM_REWRITE_TAC[]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[]);
(* ======================================================================= *)
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(ASM_CASES_TAC `hl (truncate_simplex 2 (vl:(real^3)list)) >=
sqrt (&2)`);
(ABBREV_TAC `xl = truncate_simplex 2 (ul:(real^3)list)`);
(ABBREV_TAC `yl = truncate_simplex 2 (vl:(real^3)list)`);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `V
INTER mcell i V ul =
set_of_list (truncate_simplex (i - 1) ul)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `V
INTER mcell j V vl =
set_of_list (truncate_simplex (j - 1) vl)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(NEW_GOAL `hl (yl:(real^3)list) <=
dist (omega_list V yl,
HD yl)`);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN] THEN EXPAND_TAC "yl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `!w:real^3. w
IN set_of_list xl
==>
dist (circumcenter (
set_of_list xl),w) = hl xl`);
(MATCH_MP_TAC Rogers.HL_PROPERTIES);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `2` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "xl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `circumcenter (
set_of_list xl) =
omega_list V (xl:(real^3)list)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "xl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(STRIP_TAC);
(NEW_GOAL `hl xl =
dist (omega_list V xl,
HD yl)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `
HD (yl:(real^3)list) =
HD (truncate_simplex (i - 1) vl)`);
(REWRITE_WITH `
HD (yl:(real^3)list) =
HD vl`);
(EXPAND_TAC "yl");
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `i
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(NEW_GOAL `
HD (yl:(real^3)list)
IN
set_of_list (truncate_simplex (i - 1) vl)`);
(REWRITE_TAC[ASSUME `
HD (yl:(real^3)list) =
HD (truncate_simplex (i - 1) vl)`]);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `i - 1`);
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`] THEN ARITH_TAC);
(UP_ASM_TAC);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) vl)
SUBSET
set_of_list (xl:(real^3)list)`);
(EXPAND_TAC "xl");
(REWRITE_TAC[GSYM (ASSUME
`
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`)]);
(MATCH_MP_TAC Rogers.TRUNCATE_SIMPLEX_SUBSET);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `i
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(SET_TAC[]);
(NEW_GOAL `omega_list V xl = omega_list V yl`);
(REWRITE_TAC[
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (xl:(real^3)list) = 3 /\
LENGTH (yl:(real^3)list) = 3`);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_TAC[ARITH_RULE `3 = 2 + 1`]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_TAC[ARITH_RULE `3 - 1 = 2`]);
(EXPAND_TAC "xl" THEN EXPAND_TAC "yl");
(REWRITE_WITH
`truncate_simplex 2 ul = truncate_simplex (2 + 0) (ul:(real^3)list) /\
truncate_simplex 2 vl = truncate_simplex (2 + 0) (vl:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) ul) 2 = omega_list_n V ul 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(REWRITE_WITH
`omega_list_n V (truncate_simplex (2 + 0) vl) 2 = omega_list_n V vl 2`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (
set_of_list vl) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(NEW_GOAL `hl (xl:(real^3)list) =
dist (omega_list V yl,
HD yl)`);
(ASM_REWRITE_TAC[]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[REAL_ARITH `~(a >= b) <=> a < b`]);
(STRIP_TAC);
(* ======================================================================= *)
(NEW_GOAL `
sqrt (&2) <= hl (ul:(real^3)list)`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_CASES_TAC `i = 2`);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `i = 2`; mcell2]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `i = 3`);
(ASM_SET_TAC[]);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `i = 3`; mcell3]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `
sqrt (&2) <= hl (vl:(real^3)list)`);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[]);
(ASM_CASES_TAC `j = 2`);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `j = 2`; mcell2]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `j = 3`);
(ASM_SET_TAC[]);
(REWRITE_TAC[
MCELL_EXPLICIT; ASSUME `j = 3`; mcell3]);
(COND_CASES_TAC);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ABBREV_TAC `s2 = omega_list_n V ul 2`);
(ABBREV_TAC `s3 = omega_list_n V ul 3`);
(NEW_GOAL `s2 = omega_list_n V vl 2`);
(EXPAND_TAC "s2" THEN FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(NEW_GOAL `s3 = omega_list_n V vl 3`);
(EXPAND_TAC "s3" THEN FIRST_ASSUM MATCH_MP_TAC);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_ARITH_TAC);
(ABBREV_TAC `u0:real^3 =
HD ul`);
(NEW_GOAL `?s.
between s (s2,s3) /\
dist (u0,s) =
sqrt (&2) /\
mxi V ul = s`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "s3");
(MATCH_MP_TAC
MXI_EXPLICIT);
(NEW_GOAL `?v0 u1 u2 u3. ul = [v0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `v0:real^3 =
HD ul`);
(REWRITE_TAC[ASSUME `ul = [v0;u1;u2;u3:real^3]`;
HD]);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ABBREV_TAC `v0:real^3 =
HD vl`);
(NEW_GOAL `?t.
between t (s2,s3) /\
dist (v0,t) =
sqrt (&2) /\
mxi V vl = t`);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "v0");
(MATCH_MP_TAC
MXI_EXPLICIT);
(NEW_GOAL `?w0 u1 u2 u3. vl = [
w0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);
(ASM_REWRITE_TAC[
HD]);
(EXPAND_TAC "v0");
(REWRITE_TAC[ASSUME `vl = [
w0;u1;u2;u3:real^3]`;
HD]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `
dist (u0:real^3, t) =
sqrt (&2)`);
(NEW_GOAL `(t:real^3)
IN voronoi_list V (truncate_simplex 2 vl)`);
(NEW_GOAL `s2
IN voronoi_list V (truncate_simplex 2 vl)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(NEW_GOAL `s3
IN voronoi_list V (truncate_simplex 2 vl)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[] THEN ARITH_TAC);
(NEW_GOAL `
convex hull {s2, s3:real^3}
SUBSET
convex hull (voronoi_list V (truncate_simplex 2 vl))`);
(MATCH_MP_TAC Marchal_cells.CONVEX_HULL_SUBSET THEN ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_WITH
`
convex hull voronoi_list V (truncate_simplex 2 vl) =
voronoi_list V (truncate_simplex 2 vl)`);
(REWRITE_TAC[
CONVEX_HULL_EQ;
CONVEX_VORONOI_LIST]);
(STRIP_TAC);
(NEW_GOAL `t
IN convex hull {s2, s3:real^3}`);
(REWRITE_TAC[GSYM
BETWEEN_IN_CONVEX_HULL]);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(NEW_GOAL `u0:real^3
IN set_of_list (truncate_simplex 2 vl)`);
(EXPAND_TAC "u0");
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)) =
set_of_list (truncate_simplex (i - 1) vl)`);
(NEW_GOAL `V
INTER mcell i V ul =
set_of_list (truncate_simplex (i - 1) ul)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `V
INTER mcell j V vl =
set_of_list (truncate_simplex (j - 1) vl)`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(NEW_GOAL `i = 2 \/ i = 3`);
(ASM_SET_TAC[]);
(ASM_REWRITE_TAC[]);
(REPEAT STRIP_TAC);
(ASM_ARITH_TAC);
(ASM_ARITH_TAC);
(UNDISCH_TAC `~NULLSET (mcell i V ul)`);
(ASM_REWRITE_TAC[
NEGLIGIBLE_EMPTY]);
(ASM_MESON_TAC[]);
(NEW_GOAL `
HD (ul:(real^3)list) =
HD (truncate_simplex (i - 1) ul)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `i
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(NEW_GOAL `
HD (ul:(real^3)list)
IN
set_of_list (truncate_simplex (i - 1) ul)`);
(REWRITE_TAC[ASSUME `
HD (ul:(real^3)list) =
HD (truncate_simplex (i - 1) ul)`]);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `i - 1`);
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`] THEN ARITH_TAC);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (truncate_simplex (j - 1) vl)
SUBSET
set_of_list (truncate_simplex 2 (vl:(real^3)list))`);
(MATCH_MP_TAC Rogers.TRUNCATE_SIMPLEX_SUBSET);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[]);
(SET_TAC[]);
(NEW_GOAL `v0:real^3
IN set_of_list (truncate_simplex 2 vl)`);
(EXPAND_TAC "v0");
(REWRITE_WITH `(
HD vl):real^3 =
HD (truncate_simplex 2 vl)`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (vl:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UNDISCH_TAC `j
IN {2,3}` THEN REWRITE_TAC[SET_RULE
`x
IN {2,3} <=> x = 2 \/ x = 3`]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `2`);
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `t:real^3
IN voronoi_closed V u0`);
(UNDISCH_TAC `t:real^3
IN voronoi_list V (truncate_simplex 2 vl)`);
(REWRITE_TAC[
VORONOI_LIST;
VORONOI_SET;]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN;
IN_ELIM_THM;
voronoi_closed]);
(STRIP_TAC);
(NEW_GOAL `
dist (u0:real^3, t) <=
dist (v0:real^3, t)`);
(ONCE_REWRITE_TAC[
DIST_SYM]);
(FIRST_ASSUM MATCH_MP_TAC THEN EXPAND_TAC "v0");
(REWRITE_TAC[MESON[
IN] `(V:real^3->bool) s <=> s
IN V`]);
(NEW_GOAL `
HD (vl:(real^3)list)
IN set_of_list vl`);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (vl:(real^3)list)
SUBSET V`);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(NEW_GOAL `t:real^3
IN voronoi_closed V v0`);
(UNDISCH_TAC `t:real^3
IN voronoi_list V (truncate_simplex 2 vl)`);
(REWRITE_TAC[
VORONOI_LIST;
VORONOI_SET;]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN;
IN_ELIM_THM;
voronoi_closed]);
(STRIP_TAC);
(NEW_GOAL `
dist (v0:real^3, t) <=
dist (u0:real^3, t)`);
(ONCE_REWRITE_TAC[
DIST_SYM]);
(FIRST_ASSUM MATCH_MP_TAC THEN EXPAND_TAC "u0");
(REWRITE_TAC[MESON[
IN] `(V:real^3->bool) s <=> s
IN V`]);
(NEW_GOAL `
HD (ul:(real^3)list)
IN set_of_list ul`);
(MATCH_MP_TAC Packing3.BARV_IMP_HD_IN_SET_OF_LIST);
(EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (ul:(real^3)list)
SUBSET V`);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(ASM_REAL_ARITH_TAC);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `!n.
between n (s2, s3:real^3) ==>
dist (u0, n) pow 2 =
dist (s2, n) pow 2 +
dist (u0, s2) pow 2`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[
dist]);
(MATCH_MP_TAC
PYTHAGORAS);
(REWRITE_TAC[
orthogonal]);
(ABBREV_TAC `zl = truncate_simplex 2 (ul:(real^3)list)`);
(REWRITE_WITH `s2:real^3 = circumcenter (
set_of_list zl)`);
(REWRITE_WITH `s2 = omega_list V zl`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "zl");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Rogers.XNHPWAB1);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(MATCH_MP_TAC Rogers.MHFTTZN4);
(EXISTS_TAC `V:real^3->bool`);
(EXISTS_TAC `2`);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `s2
IN voronoi_list V zl`);
(REWRITE_WITH `s2 = omega_list V zl`);
(EXPAND_TAC "s2" THEN EXPAND_TAC "zl");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.OMEGA_LIST_IN_VORONOI_LIST);
(EXISTS_TAC `2`);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(NEW_GOAL `s3
IN voronoi_list V zl`);
(EXPAND_TAC "s3" THEN EXPAND_TAC "zl");
(MATCH_MP_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3 /\ 3 <= 3`]);
(NEW_GOAL `
affine hull {s2, s3}
SUBSET affine hull voronoi_list V zl`);
(MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);
(ASM_SET_TAC[]);
(NEW_GOAL `n
IN affine hull {s2, s3:real^3}`);
(NEW_GOAL `
convex hull {s2,s3}
SUBSET affine hull {s2,s3:real^3}`);
(REWRITE_TAC[
CONVEX_HULL_SUBSET_AFFINE_HULL]);
(NEW_GOAL `n
IN convex hull {s2, s3:real^3}`);
(REWRITE_TAC[GSYM
BETWEEN_IN_CONVEX_HULL]);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(MATCH_MP_TAC Marchal_cells_2_new.IN_AFFINE_KY_LEMMA1);
(REWRITE_WITH `u0:real^3 =
HD zl`);
(EXPAND_TAC "zl" THEN EXPAND_TAC "u0");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Packing3.HD_IN_SET_OF_LIST);
(REWRITE_WITH `
LENGTH (zl:(real^3)list) = 2 + 1 /\
CARD (
set_of_list zl) = 2 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(ARITH_TAC);
(NEW_GOAL `
dist (u0,s) pow 2 =
dist (s2,s:real^3) pow 2 +
dist (u0,s2) pow 2`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `
dist (u0,t) pow 2 =
dist (s2,t:real^3) pow 2 +
dist (u0,s2) pow 2`);
(ASM_SIMP_TAC[]);
(NEW_GOAL `
dist (s2, s:real^3) =
dist (s2, t)`);
(REWRITE_TAC[
DIST_EQ]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC);
(UNDISCH_TAC `
between s (s2, s3:real^3)` THEN
UNDISCH_TAC `
between t (s2, s3:real^3)`);
(REWRITE_TAC[
BETWEEN_IN_CONVEX_HULL;
CONVEX_HULL_2;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `
dist (s2,s) =
dist (s2,t:real^3)`);
(REWRITE_TAC[
dist;ASSUME `s = u' % s2 + v' % s3:real^3`;
ASSUME `t = u % s2 + v % s3:real^3` ]);
(REWRITE_WITH `s2 - (u' % s2 + v' % s3) =
(u' + v') % s2 - (u' % s2 + v' % s3:real^3)`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_WITH `s2 - (u % s2 + v % s3) =
(u + v) % s2 - (u % s2 + v % s3:real^3)`);
(ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);
(REWRITE_TAC[VECTOR_ARITH `(u + v) % s - (u % s + v % t) = v % (s - t)`]);
(REWRITE_TAC[
NORM_MUL]);
(REWRITE_WITH `abs v = v /\ abs v' = v'`);
(ASM_SIMP_TAC[
REAL_ABS_REFL]);
(REWRITE_TAC[REAL_ARITH `a * b = c * b <=> (a - c) * b = &0`;
REAL_ENTIRE]);
(STRIP_TAC);
(REWRITE_WITH `v = v':real /\ u = u':real`);
(ASM_REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[
NORM_EQ_0]);
(REWRITE_TAC[VECTOR_ARITH `a - b =
vec 0 <=> a = b`] THEN STRIP_TAC);
(NEW_GOAL `F`);
(NEW_GOAL `hl (ul:(real^3)list) <=
dist (s3,u0:real^3)`);
(REWRITE_WITH `s3 = omega_list V ul /\ u0 =
HD ul`);
(STRIP_TAC);
(REWRITE_TAC[GSYM (ASSUME `omega_list_n V ul 3 = s3`);
OMEGA_LIST]);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Rogers.WAUFCHE1);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[
IN]);
(ABBREV_TAC `zl:(real^3)list = truncate_simplex 2 ul`);
(NEW_GOAL `hl (zl:(real^3)list) =
dist (s3, u0:real^3)`);
(REWRITE_WITH `s3 = omega_list V zl /\ u0 =
HD zl`);
(STRIP_TAC);
(REWRITE_TAC[GSYM (ASSUME `s2:real^3 = s3`);
OMEGA_LIST]);
(EXPAND_TAC "s2");
(REWRITE_WITH `
LENGTH (zl:(real^3)list) = 2 + 1 /\
CARD (
set_of_list zl) = 2 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(REWRITE_TAC[ARITH_RULE `(2 + 1) - 1 = 2`]);
(EXPAND_TAC "zl");
(REWRITE_WITH `truncate_simplex 2 (ul:(real^3)list) =
truncate_simplex (2 + 0) (ul:(real^3)list)`);
(REWRITE_TAC[ARITH_RULE `2 + 0 = 2`]);
(MATCH_MP_TAC Packing3.OMEGA_LIST_N_LEMMA);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(EXPAND_TAC "zl" THEN EXPAND_TAC "u0");
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(MATCH_MP_TAC Rogers.WAUFCHE2);
(EXISTS_TAC `2` THEN ASM_REWRITE_TAC[
IN]);
(EXPAND_TAC "zl");
(MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);
(ASM_REAL_ARITH_TAC);
(ASM_MESON_TAC[])]);;
(* ==================================================================== *)
(* Lemma 47 *)
(* ==================================================================== *)
(* Lemma 48 *)
let DIHX_SYM = prove_by_refinement (
`!V X u v.
packing V /\ saturated V /\
mcell_set V X /\ {u, v}
IN edgeX V X
==> dihX V X (u,v) = dihX V X (v,u)`,
[(REPEAT STRIP_TAC);
(REWRITE_TAC[dihX]);
(COND_CASES_TAC);
(COND_CASES_TAC);
(REFL_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(DEL_TAC THEN REWRITE_TAC[
cell_params_d] THEN REPEAT LET_TAC);
(UNDISCH_TAC `{u, v}
IN edgeX V X` THEN REWRITE_TAC[edgeX;
IN;
IN_ELIM_THM]);
(REWRITE_WITH `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(ASM_REWRITE_TAC[]);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set;
IN_ELIM_THM;
IN]);
(MESON_TAC[]);
(STRIP_TAC);
(MP_TAC (ASSUME `(V
INTER X) (u':real^3)`) THEN
MP_TAC (ASSUME `(V
INTER X) (v':real^3)`));
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set_2;
IN_ELIM_THM;
IN]);
(STRIP_TAC);
(REWRITE_TAC[ASSUME `X = mcell i V ul''`]);
(REWRITE_WITH `(V
INTER mcell i V ul'') =
set_of_list (truncate_simplex (i-1) ul'')`);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell i V ul''`)]);
(STRIP_TAC);
(REWRITE_TAC[ARITH_RULE `1 <= i <=> ~(i = 0)`]);
(STRIP_TAC);
(MP_TAC (ASSUME `(V
INTER X) (u':real^3)`));
(REWRITE_WITH `V
INTER X:real^3->bool = {}`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`]);
(SET_TAC[]);
(UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `i <= 1`);
(NEW_GOAL `?w0 w1 w2 w3. ul'' = [
w0;w1;w2;w3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(NEW_GOAL `i - 1 = 0`);
(UNDISCH_TAC `i <= 1` THEN ARITH_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_0;
set_of_list;
MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REWRITE_TAC[SET_RULE `a
IN {b} <=> a = b`]);
(UNDISCH_TAC `~(u' = v':real^3)`);
(SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[ARITH_RULE `~(i <= 1) <=> 2 <= i`]
THEN STRIP_TAC);
(* ========================================================================== *)
(NEW_GOAL `?p. p
permutes 0..i - 1 /\
initial_sublist [u:real^3; v] (
left_action_list p ul'')`);
(NEW_GOAL `?w0 w1 w2 w3. ul'' = [
w0;w1;w2;w3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_CASES_TAC `i = 2`);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(NEW_GOAL `i - 1 = 1`);
(UNDISCH_TAC `i = 2` THEN ARITH_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
set_of_list;
MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `u = w0:real^3`);
(NEW_GOAL `v = w1:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`~(u' = v':real^3)` THEN UNDISCH_TAC `{u,v} = {u',v':real^3}`
THEN SET_TAC[]);
(EXISTS_TAC `I:num->num`);
(ASM_REWRITE_TAC[
PERMUTES_I; Packing3.LEFT_ACTION_LIST_I]);
(REWRITE_WITH `initial_sublist [
w0; w1] [
w0; w1; w2;
w3] /\
LENGTH [
w0;w1:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `v = w0:real^3 /\ u = w1:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`~(u' = v':real^3)` THEN UNDISCH_TAC `{u,v} = {u',v':real^3}`
THEN SET_TAC[]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `?p. p
permutes 0..1 /\
[w1;
w0; w2; w3:real^3] =
left_action_list p ul''`);
(MATCH_MP_TAC Qzksykg.TWO_REARRANGEMENT_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC);
(EXISTS_TAC `p:num->num` THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[GSYM
(ASSUME `[w1;
w0; w2;
w3] =
left_action_list p [
w0; w1; w2; w3:real^3]`)]);
(REWRITE_WITH `initial_sublist [w1;
w0] [w1;
w0; w2;
w3] /\
LENGTH [w1;w0:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
LENGTH] THEN ARITH_TAC);
(ASM_CASES_TAC `i = 3`);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(ASM_REWRITE_TAC[ARITH_RULE `3 - 1 = 2`;
TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list; MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(NEW_GOAL `u
IN {
w0, w1, w2} /\ v
IN {
w0, w1, w2:real^3} /\ ~(u = v)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?a. {u,v, a} = {
w0, w1, w2:real^3}`);
(NEW_GOAL `?w:real^3. w
IN {
w0, w1, w2}
DIFF {u, v}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2}
DIFF {u, v:real^3} = {} <=>
CARD ({
w0, w1, w2}
DIFF {u, v}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2} =
CARD ({
w0, w1, w2}
DIFF {u, v:real^3}) +
CARD {u, v}`);
(MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2:real^3}) = 3`);
(ASM_CASES_TAC `
CARD {
w0,w1,w2:real^3} <= 2`);
(NEW_GOAL `F`);
(NEW_GOAL `
CARD {
w0, w1, w2, w3:real^3} = 4`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD {
w0, w1, w2,
w3} =
CARD {
w3,
w0,w1,w2:real^3}`);
(AP_TERM_TAC THEN SET_TAC[]);
(NEW_GOAL `
CARD ({
w3,
w0, w1, w2}) <= SUC (
CARD {
w0, w1, w2:real^3})`);
(SIMP_TAC[Geomdetail.CARD_CLAUSES_IMP; Geomdetail.FINITE6]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(ASM_MESON_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2:real^3} <= 3`);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(SUBGOAL_THEN `
CARD {u,v:real^3} <= 2` MP_TAC);
(REWRITE_TAC[Geomdetail.CARD2]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `w:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?p. p
permutes 0..2 /\
[u; v; a;
w3] =
left_action_list p [
w0; w1; w2; w3:real^3]`);
(MATCH_MP_TAC
LEFT_ACTION_LIST_2_EXISTS);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `[u; v; a; w3:real^3] =
left_action_list p [
w0; w1; w2;
w3]`)]);
(REWRITE_WITH `initial_sublist [u; v] [u; v; a;
w3] /\
LENGTH [u; v:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST;
LENGTH;
TRUNCATE_SIMPLEX_EXPLICIT_1] THEN ARITH_TAC);
(NEW_GOAL `i = 4`);
(ASM_ARITH_TAC);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(ASM_REWRITE_TAC[ARITH_RULE `4 - 1 = 3`;
TRUNCATE_SIMPLEX_EXPLICIT_3;
set_of_list; MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(NEW_GOAL `u
IN {
w0, w1, w2,
w3} /\ v
IN {
w0, w1, w2, w3:real^3} /\
~(u = v)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?a b. {u,v,a,b} = {
w0, w1, w2, w3:real^3}`);
(NEW_GOAL `?w:real^3. w
IN {
w0, w1, w2,
w3}
DIFF {u, v}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2,
w3}
DIFF {u, v:real^3} = {} <=>
CARD ({
w0, w1, w2,
w3}
DIFF {u, v}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2, w3:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2,
w3} =
CARD ({
w0, w1, w2,
w3}
DIFF {u, v:real^3}) +
CARD {u, v}`);
(MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2, w3:real^3}) = 3 + 1`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD {u, v:real^3} <= 2`);
(REWRITE_TAC[Geomdetail.CARD2]);
(UP_ASM_TAC THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?m:real^3. m
IN {
w0, w1, w2,
w3}
DIFF {u, v, w}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2,
w3}
DIFF {u, v, w:real^3} = {} <=>
CARD ({
w0, w1, w2,
w3}
DIFF {u, v, w}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2, w3:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD ({
w0, w1, w2,
w3}
DIFF {u,v,w:real^3}) =
CARD {
w0, w1, w2,
w3} -
CARD {u,v,w}`);
(MATCH_MP_TAC
CARD_DIFF);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2, w3:real^3}) = 3 + 1`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD {u, v, w:real^3} <= 3`);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `w:real^3` THEN EXISTS_TAC `m:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN
UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?p. p
permutes 0..3 /\
[u; v; a; b] =
left_action_list p [
w0; w1; w2; w3:real^3]`);
(MATCH_MP_TAC
LEFT_ACTION_LIST_3_EXISTS);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `[u; v; a; b:real^3] =
left_action_list p [
w0; w1; w2;
w3]`)]);
(REWRITE_WITH `initial_sublist [u; v] [u; v; a; b] /\
LENGTH [u; v:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST;
LENGTH;
TRUNCATE_SIMPLEX_EXPLICIT_1] THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(* ========================================================================== *)
(NEW_GOAL `?q. q
permutes 0..i - 1 /\
initial_sublist [v:real^3; u] (
left_action_list q ul'')`);
(NEW_GOAL `?w0 w1 w2 w3. ul'' = [
w0;w1;w2;w3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_CASES_TAC `i = 2`);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(NEW_GOAL `i - 1 = 1`);
(UNDISCH_TAC `i = 2` THEN ARITH_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
set_of_list;
MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `v = w0:real^3`);
(NEW_GOAL `u = w1:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`~(u' = v':real^3)` THEN UNDISCH_TAC `{u,v} = {u',v':real^3}`
THEN SET_TAC[]);
(EXISTS_TAC `I:num->num`);
(ASM_REWRITE_TAC[
PERMUTES_I; Packing3.LEFT_ACTION_LIST_I]);
(REWRITE_WITH `initial_sublist [
w0; w1] [
w0; w1; w2;
w3] /\
LENGTH [
w0;w1:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `u = w0:real^3 /\ v = w1:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`~(u' = v':real^3)` THEN UNDISCH_TAC `{u,v} = {u',v':real^3}`
THEN SET_TAC[]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `?q. q
permutes 0..1 /\
[w1;
w0; w2; w3:real^3] =
left_action_list q ul''`);
(MATCH_MP_TAC Qzksykg.TWO_REARRANGEMENT_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC);
(EXISTS_TAC `q:num->num` THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[GSYM
(ASSUME `[w1;
w0; w2;
w3] =
left_action_list q [
w0; w1; w2; w3:real^3]`)]);
(REWRITE_WITH `initial_sublist [w1;
w0] [w1;
w0; w2;
w3] /\
LENGTH [w1;w0:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_1;
LENGTH] THEN ARITH_TAC);
(ASM_CASES_TAC `i = 3`);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(ASM_REWRITE_TAC[ARITH_RULE `3 - 1 = 2`;
TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list; MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(NEW_GOAL `u
IN {
w0, w1, w2} /\ v
IN {
w0, w1, w2:real^3} /\ ~(u = v)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?a. {u,v, a} = {
w0, w1, w2:real^3}`);
(NEW_GOAL `?w:real^3. w
IN {
w0, w1, w2}
DIFF {u, v}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2}
DIFF {u, v:real^3} = {} <=>
CARD ({
w0, w1, w2}
DIFF {u, v}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2} =
CARD ({
w0, w1, w2}
DIFF {u, v:real^3}) +
CARD {u, v}`);
(MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2:real^3}) = 3`);
(ASM_CASES_TAC `
CARD {
w0,w1,w2:real^3} <= 2`);
(NEW_GOAL `F`);
(NEW_GOAL `
CARD {
w0, w1, w2, w3:real^3} = 4`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD {
w0, w1, w2,
w3} =
CARD {
w3,
w0,w1,w2:real^3}`);
(AP_TERM_TAC THEN SET_TAC[]);
(NEW_GOAL `
CARD ({
w3,
w0, w1, w2}) <= SUC (
CARD {
w0, w1, w2:real^3})`);
(SIMP_TAC[Geomdetail.CARD_CLAUSES_IMP; Geomdetail.FINITE6]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(ASM_MESON_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2:real^3} <= 3`);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);
(SUBGOAL_THEN `
CARD {u,v:real^3} <= 2` MP_TAC);
(REWRITE_TAC[Geomdetail.CARD2]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `w:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `{u,v,a} = {v, u, a:real^3}`);
(SET_TAC[]);
(STRIP_TAC);
(NEW_GOAL `?q. q
permutes 0..2 /\
[v; u; a;
w3] =
left_action_list q [
w0; w1; w2; w3:real^3]`);
(MATCH_MP_TAC
LEFT_ACTION_LIST_2_EXISTS);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `q:num->num`);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `[v; u; a; w3:real^3] =
left_action_list q [
w0; w1; w2;
w3]`)]);
(REWRITE_WITH `initial_sublist [v; u] [v; u; a;
w3] /\
LENGTH [v; u:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST;
LENGTH;
TRUNCATE_SIMPLEX_EXPLICIT_1] THEN ARITH_TAC);
(NEW_GOAL `i = 4`);
(ASM_ARITH_TAC);
(UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (v':real^3)` THEN
UNDISCH_TAC `
set_of_list (truncate_simplex (i - 1) ul'') (u':real^3)`);
(ASM_REWRITE_TAC[ARITH_RULE `4 - 1 = 3`;
TRUNCATE_SIMPLEX_EXPLICIT_3;
set_of_list; MESON[
IN] `(A:real^3->bool) b <=> b
IN A`]);
(REPEAT STRIP_TAC);
(NEW_GOAL `u
IN {
w0, w1, w2,
w3} /\ v
IN {
w0, w1, w2, w3:real^3} /\
~(u = v)`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?a b. {u,v,a,b} = {
w0, w1, w2, w3:real^3}`);
(NEW_GOAL `?w:real^3. w
IN {
w0, w1, w2,
w3}
DIFF {u, v}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2,
w3}
DIFF {u, v:real^3} = {} <=>
CARD ({
w0, w1, w2,
w3}
DIFF {u, v}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2, w3:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD {
w0, w1, w2,
w3} =
CARD ({
w0, w1, w2,
w3}
DIFF {u, v:real^3}) +
CARD {u, v}`);
(MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2, w3:real^3}) = 3 + 1`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD {u, v:real^3} <= 2`);
(REWRITE_TAC[Geomdetail.CARD2]);
(UP_ASM_TAC THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?m:real^3. m
IN {
w0, w1, w2,
w3}
DIFF {u, v, w}`);
(REWRITE_TAC[SET_RULE `(?x. x
IN s) <=> ~(s = {})`]);
(REWRITE_WITH `{
w0, w1, w2,
w3}
DIFF {u, v, w:real^3} = {} <=>
CARD ({
w0, w1, w2,
w3}
DIFF {u, v, w}) = 0`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
CARD_EQ_0);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{
w0, w1, w2, w3:real^3}`);
(REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);
(NEW_GOAL `
CARD ({
w0, w1, w2,
w3}
DIFF {u,v,w:real^3}) =
CARD {
w0, w1, w2,
w3} -
CARD {u,v,w}`);
(MATCH_MP_TAC
CARD_DIFF);
(ASM_REWRITE_TAC[Geomdetail.FINITE6]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_WITH `
CARD ({
w0, w1, w2, w3:real^3}) = 3 + 1`);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD {u, v, w:real^3} <= 3`);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `w:real^3` THEN EXISTS_TAC `m:real^3`);
(UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN
UP_ASM_TAC THEN SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_WITH `{u,v,a,b} = {v, u, a, b:real^3}`);
(SET_TAC[]);
(STRIP_TAC);
(NEW_GOAL `?q. q
permutes 0..3 /\
[v; u; a; b] =
left_action_list q [
w0; w1; w2; w3:real^3]`);
(MATCH_MP_TAC
LEFT_ACTION_LIST_3_EXISTS);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `{
w0, w1, w2, w3:real^3} =
set_of_list ul''`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `
LENGTH (ul'':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul'') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(EXISTS_TAC `q:num->num`);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `[v; u; a; b:real^3] =
left_action_list q [
w0; w1; w2;
w3]`)]);
(REWRITE_WITH `initial_sublist [v; u] [v; u; a; b] /\
LENGTH [v; u:real^3] = 1 + 1`);
(REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST;
LENGTH;
TRUNCATE_SIMPLEX_EXPLICIT_1] THEN ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(* ========================================================================= *)
(ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul
IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [v; u] ul)`);
(NEW_GOAL `(P:num#(real^3)list->bool) (k, ul)`);
(REWRITE_TAC[GSYM (ASSUME `(@) (P:num#(real^3)list->bool) = k,ul`)]);
(MATCH_MP_TAC SELECT_AX);
(EXISTS_TAC `(i:num,
left_action_list q (ul'':(real^3)list))`);
(EXPAND_TAC "P" THEN REWRITE_TAC[
BETA_THM]);
(ASM_REWRITE_TAC[
IN]);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul'':(real^3)list`);
(EXISTS_TAC `i:num` THEN EXISTS_TAC `q:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell i V ul''`)]);
(UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Rvfxzbu.RVFXZBU);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(ABBREV_TAC `Q = (\(k, ul). k <= 4 /\
ul
IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u; v] ul)`);
(NEW_GOAL `(Q:num#(real^3)list->bool) (k', ul')`);
(REWRITE_TAC[GSYM (ASSUME `(@) (Q:num#(real^3)list->bool) = k',ul'`)]);
(MATCH_MP_TAC SELECT_AX);
(EXISTS_TAC `(i:num,
left_action_list p (ul'':(real^3)list))`);
(EXPAND_TAC "Q" THEN REWRITE_TAC[
BETA_THM]);
(ASM_REWRITE_TAC[
IN]);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul'':(real^3)list`);
(EXISTS_TAC `i:num` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell i V ul''`)]);
(UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Rvfxzbu.RVFXZBU);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(UP_ASM_TAC THEN EXPAND_TAC "Q" THEN REWRITE_TAC[] THEN DEL_TAC);
(UP_ASM_TAC THEN EXPAND_TAC "P" THEN REWRITE_TAC[
IN] THEN DEL_TAC);
(REPEAT STRIP_TAC);
(NEW_GOAL `i = k:num`);
(REWRITE_WITH `i = k /\ mcell i V ul'' = mcell k V ul`);
(MATCH_MP_TAC Ajripqn.AJRIPQN);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell i V ul''`);
GSYM (ASSUME `X = mcell k V ul`); SET_RULE `a
INTER a = a`]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `i = k':num`);
(REWRITE_WITH `i = k' /\ mcell i V ul'' = mcell k' V ul'`);
(MATCH_MP_TAC Ajripqn.AJRIPQN);
(ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell i V ul''`); GSYM (ASSUME `i = k:num`);
GSYM (ASSUME `X = mcell k' V ul'`); SET_RULE `a
INTER a = a`]);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `i = k /\ (!k. i - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V ul' k)`);
(MATCH_MP_TAC
MCELL_ID_OMEGA_LIST_N);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_MESON_TAC[]);
(STRIP_TAC);
(ASM_MESON_TAC[]);
(REWRITE_TAC[SET_RULE `a
IN {m,n,p} <=> a = m \/ a = n \/ a = p`]);
(ASM_ARITH_TAC);
(UP_ASM_TAC THEN STRIP_TAC);
(REWRITE_WITH `k' = k:num`);
(ASM_MESON_TAC[]);
(ASM_CASES_TAC `i < 4`);
(NEW_GOAL `mxi V ul' = mxi V ul`);
(MATCH_MP_TAC
MCELL_ID_MXI_2);
(EXISTS_TAC `k':num` THEN EXISTS_TAC `k:num`);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell k' V ul'`)]);
(REWRITE_TAC[ASSUME `X = mcell k V ul`; ASSUME `~NULLSET X`]);
(REWRITE_TAC[SET_RULE `a
IN {b,c} <=> a = b \/ a = c`]);
(ASM_ARITH_TAC);
(NEW_GOAL `
HD ul =
HD [v; u:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_INITIAL_SUBLIST);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `
HD ul' =
HD [u; v:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_INITIAL_SUBLIST);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `
EL 1 ul =
EL 1 ([v; u:real^3])`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_WITH `[v; u:real^3] = truncate_simplex 1 ul`);
(REWRITE_WITH `truncate_simplex 1 ul = [v;u:real^3] /\ 1 + 1 <=
LENGTH ul`);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `
EL 1 ul' =
EL 1 ([u; v:real^3])`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_WITH `[u; v:real^3] = truncate_simplex 1 ul'`);
(REWRITE_WITH `truncate_simplex 1 ul' =[u;v:real^3] /\ 1 + 1 <=
LENGTH ul'`);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(COND_CASES_TAC);
(COND_CASES_TAC);
(REWRITE_TAC[dihu2]);
(REWRITE_WITH `omega_list_n V ul 3 = omega_list_n V ul' 3`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_ARITH_TAC);
(ASM_REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `1 = SUC 0`;
DIHV_SYM]);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(DEL_TAC THEN DEL_TAC);
(REWRITE_TAC[dihu3]);
(ASM_REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `1 = SUC 0`]);
(REWRITE_WITH `
EL 2 ul' =
EL 2 (ul:(real^3)list)`);
(NEW_GOAL `
set_of_list (truncate_simplex 2 (ul:(real^3)list)) =
set_of_list (truncate_simplex 2 ul')`);
(REWRITE_TAC[ARITH_RULE `2 = 3 - 1`]);
(REWRITE_WITH `
set_of_list (truncate_simplex (3 - 1) ul) =
(V:real^3->bool)
INTER X`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[ASSUME `X = mcell k V ul`; ASSUME `k = 3`]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[ARITH_RULE `1 <= 3 /\ 3 <= 4`]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell k V ul`); GSYM (ASSUME `k = 3`)]);
(UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(REWRITE_TAC[ASSUME `X = mcell k' V ul'`]);
(REWRITE_WITH `k' = 3`);
(ASM_ARITH_TAC);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[ARITH_RULE `1 <= 3 /\ 3 <= 4`]);
(REWRITE_WITH `3 = k'`);
(ASM_ARITH_TAC);
(REWRITE_TAC[GSYM (ASSUME `X = mcell k' V ul'`)]);
(UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `?y0 y1 y2 y3. ul = [y0;y1;y2;y3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?z0 z1 z2 z3. ul' = [z0;z1;z2;z3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UNDISCH_TAC `
EL 1 ul =
EL 1 [v; u:real^3]` THEN
UNDISCH_TAC `
HD ul =
HD [v; u:real^3]`
THEN ASM_REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `
EL 1 ul' =
EL 1 [u; v:real^3]` THEN
UNDISCH_TAC `
HD ul' =
HD [u; v:real^3]`
THEN ASM_REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);
(REPEAT STRIP_TAC);
(UNDISCH_TAC `
set_of_list (truncate_simplex 2 (ul:(real^3)list)) =
set_of_list (truncate_simplex 2 ul')`);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list]);
(NEW_GOAL `~(y2
IN {u, v:real^3})`);
(STRIP_TAC);
(NEW_GOAL `
CARD (
set_of_list (ul:(real^3)list)) <= 3`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH ` {v, u, y2, y3} = {v,u, y3:real^3}`);
(ASM_SET_TAC[]);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN REWRITE_WITH`
CARD (
set_of_list (ul:(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
DIHV_SYM]);
(UP_ASM_TAC THEN MESON_TAC[]);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(ASM_MESON_TAC[]);
(NEW_GOAL `k = 4`);
(ASM_ARITH_TAC);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(NEW_GOAL `F`);
(ASM_ARITH_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(COND_CASES_TAC);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(ASM_MESON_TAC[]);
(COND_CASES_TAC);
(REWRITE_TAC[dihu4]);
(* ========================================================================= *)
(MATCH_MP_TAC
DIHV_SYM_3);
(REWRITE_TAC[
EL]);
(NEW_GOAL `
HD ul =
HD [v; u:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_INITIAL_SUBLIST);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `
HD ul' =
HD [u; v:real^3]`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Packing3.HD_INITIAL_SUBLIST);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(NEW_GOAL `
EL 1 ul =
EL 1 ([v; u:real^3])`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_WITH `[v; u:real^3] = truncate_simplex 1 ul`);
(REWRITE_WITH `truncate_simplex 1 ul = [v;u:real^3] /\ 1 + 1 <=
LENGTH ul`);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul) = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `
EL 1 ul' =
EL 1 ([u; v:real^3])`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_WITH `[u; v:real^3] = truncate_simplex 1 ul'`);
(REWRITE_WITH `truncate_simplex 1 ul' =[u;v:real^3] /\ 1 + 1 <=
LENGTH ul'`);
(REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);
(ASM_REWRITE_TAC[
LENGTH] THEN ARITH_TAC);
(MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul':(real^3)list) = 3 + 1 /\
CARD (
set_of_list ul') = 3 + 1`);
(MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `?y0 y1 y2 y3. ul = [y0;y1;y2;y3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(NEW_GOAL `?z0 z1 z2 z3. ul' = [z0;z1;z2;z3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(UNDISCH_TAC `
EL 1 ul =
EL 1 [v; u:real^3]` THEN
UNDISCH_TAC `
HD ul =
HD [v; u:real^3]` THEN
UNDISCH_TAC `
EL 1 ul' =
EL 1 [u; v:real^3]` THEN
UNDISCH_TAC `
HD ul' =
HD [u; v:real^3]` THEN
ASM_REWRITE_TAC[
EL;
HD;
TL; ARITH_RULE `3 = SUC 2 /\2 = SUC 1 /\ 1 = SUC 0`]);
(REPEAT STRIP_TAC);
(ASM_SET_TAC[]);
(NEW_GOAL `~(z2
IN {u,v:real^3})`);
(STRIP_TAC);
(NEW_GOAL `
CARD (
set_of_list (ul':(real^3)list)) <= 3`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `{u, v, z2, z3} = {v,u, z3:real^3}`);
(ASM_SET_TAC[]);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN REWRITE_WITH`
CARD (
set_of_list (ul':(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `~(z3
IN {u,v:real^3})`);
(STRIP_TAC);
(NEW_GOAL `
CARD (
set_of_list (ul':(real^3)list)) <= 3`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `{u, v, z2, z3} = {v,u, z2:real^3}`);
(ASM_SET_TAC[]);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN REWRITE_WITH`
CARD (
set_of_list (ul':(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `~(y2
IN {u,v:real^3})`);
(STRIP_TAC);
(NEW_GOAL `
CARD (
set_of_list (ul:(real^3)list)) <= 3`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `{v, u, y2, y3} = {v,u, y3:real^3}`);
(ASM_SET_TAC[]);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN REWRITE_WITH`
CARD (
set_of_list (ul:(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `~(y3
IN {u,v:real^3})`);
(STRIP_TAC);
(NEW_GOAL `
CARD (
set_of_list (ul:(real^3)list)) <= 3`);
(ASM_REWRITE_TAC[
set_of_list]);
(REWRITE_WITH `{v, u, y2, y3} = {v,u, y2:real^3}`);
(ASM_SET_TAC[]);
(REWRITE_TAC[Geomdetail.CARD3]);
(UP_ASM_TAC THEN REWRITE_WITH`
CARD (
set_of_list (ul:(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(NEW_GOAL `
set_of_list (truncate_simplex 3 (ul:(real^3)list)) =
set_of_list (truncate_simplex 3 ul')`);
(REWRITE_WITH `
set_of_list (truncate_simplex 3 (ul:(real^3)list)) =
V
INTER X`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(REWRITE_TAC[ASSUME `X = mcell k V ul`; ASSUME `k = 4`; ARITH_RULE `3 = 4 - 1`]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(REWRITE_TAC[ARITH_RULE `1 <= 4 /\ 4 <= 4`]);
(REWRITE_TAC[GSYM (ASSUME `X = mcell k V ul`); GSYM (ASSUME `k = 4`)]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(REWRITE_TAC[ASSUME `X = mcell k' V ul'`]);
(REWRITE_WITH `k' = 4`);
(ASM_ARITH_TAC);
(REWRITE_TAC[ARITH_RULE `3 = 4 - 1`]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(REWRITE_TAC[ARITH_RULE `1 <= 4 /\ 4 <= 4`]);
(REWRITE_WITH `4 = k'`);
(ASM_ARITH_TAC);
(REWRITE_TAC[GSYM (ASSUME `X = mcell k' V ul'`)]);
(REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[
NEGLIGIBLE_EMPTY]);
(UP_ASM_TAC);
(ASM_REWRITE_TAC[
TRUNCATE_SIMPLEX_EXPLICIT_3;
set_of_list]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(REFL_TAC)]);;
(* ==================================================================== *)
(* Lemma 49 *)
let gamma_y_lmfun_bound = prove_by_refinement (
`!V. packing V /\ saturated V
==> (?d. !X e.
mcell_set V X /\ edgeX V X e ==> gammaY V X lmfun e <= d)`,
[(REPEAT STRIP_TAC);
(EXISTS_TAC `
pi * h0 / (h0 - &1)`);
(REPEAT STRIP_TAC);
(ABBREV_TAC `f = (\u v. if {u, v}
IN edgeX V X
then dihX V X (u,v) * lmfun (hl [u; v])
else &0)`);
(REWRITE_WITH `gammaY V X lmfun = (\({u, v}). f u v)`);
(EXPAND_TAC "f" THEN REWRITE_TAC[gammaY]);
(NEW_GOAL `!u v. (f:real^3->real^3->
real) u v = f v u`);
(EXPAND_TAC "f" THEN REWRITE_TAC[
BETA_THM]);
(REWRITE_TAC[
HL;
set_of_list; SET_RULE `{a,b} = {b,a}`]);
(REPEAT GEN_TAC THEN COND_CASES_TAC);
(COND_CASES_TAC);
(REWRITE_WITH `dihX V X (u,v) = dihX V X (v,u)`);
(MATCH_MP_TAC
DIHX_SYM);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(REFL_TAC);
(UNDISCH_TAC `edgeX V X e` THEN REWRITE_TAC[
IN;
IN_ELIM_THM; edgeX]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `(\({u, v}). f u v) {u, v} =
(f:real^3->real^3->
real) u v`);
(MATCH_MP_TAC
BETA_PAIR_THM);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "f");
(COND_CASES_TAC);
(NEW_GOAL `dihX V X (u,v) * lmfun (hl [u;v]) <=
pi * lmfun (hl [u;v])`);
(REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
lmfun_pos_le; REAL_ARITH `&0 <= a - b <=> b <= a`;
DIHX_LE_PI]);
(NEW_GOAL `
pi * lmfun (hl [u:real^3;v]) <=
pi * h0 / (h0 - &1)`);
(REWRITE_TAC[REAL_ARITH `a * x <= a * y <=> &0 <= (y - x) * a`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
PI_POS_LE; REAL_ARITH `&0 <= a - b <=> b <= a`]);
(MATCH_MP_TAC
lmfun_bounded);
(REWRITE_TAC[
HL_2; REAL_ARITH `&0 <= inv (&2) * x <=> &0 <= x`;
DIST_POS_LE]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
PI_POS_LE]);
(MATCH_MP_TAC
REAL_LE_DIV);
(REWRITE_TAC[h0] THEN REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 50 *)
let BETA_SET_2_THM = prove
(`!g:(A->bool)->B u0 v0. (\({u, v}). g {u, v}) {u0, v0} = g {u0, v0}`,
GEN_TAC THEN REWRITE_TAC[
GABS_DEF;
GEQ_DEF] THEN
CONV_TAC SELECT_CONV THEN EXISTS_TAC `g:(A->bool)->B` THEN
REWRITE_TAC[]);;
(* ==================================================================== *)
(* Lemma 51 *)
(* Formal proof by John Harrison *)
let SUM_PAIR_2_SET = prove
(`!f s:real^N->bool d.
FINITE s
==>
sum {(m,n) | m
IN s /\ n
IN s /\ ~(m = n) /\
dist(m,n) <= d}
(\(m,n). f {m, n}) = &2 *
sum {{m, n} | m
IN s /\ n
IN s /\ ~(m = n) /\
dist(m,n) <= d} f`,
REPEAT STRIP_TAC THEN MP_TAC(ISPECL
[`\(m:real^N,n). {m,n}`;`(\(m,n). f {m,n}):real^N#real^N->
real`;
`{(m,n) | m
IN s /\ n
IN s /\ ~(m:real^N = n) /\
dist(m,n) <= d}`;
`{{m,n} | m
IN s /\ n
IN s /\ ~(m:real^N = n) /\
dist(m,n) <= d}`]
SUM_GROUP) THEN
ANTS_TAC THENL
[CONJ_TAC THENL
[ONCE_REWRITE_TAC[SET_RULE
`m
IN s /\ n
IN s /\ P m n <=>
m
IN s /\ n
IN {n | n
IN s /\ P m n}`] THEN
MATCH_MP_TAC
FINITE_PRODUCT_DEPENDENT THEN
ASM_SIMP_TAC[
FINITE_RESTRICT];
REWRITE_TAC[
SUBSET;
FORALL_IN_IMAGE;
FORALL_IN_GSPEC] THEN SET_TAC[]];
DISCH_THEN(SUBST1_TAC o SYM) THEN REWRITE_TAC[GSYM
SUM_LMUL] THEN
MATCH_MP_TAC
SUM_EQ THEN REWRITE_TAC[
FORALL_IN_GSPEC] THEN
MAP_EVERY X_GEN_TAC [`m:real^N`; `n:real^N`] THEN STRIP_TAC THEN
MATCH_MP_TAC
EQ_TRANS THEN
EXISTS_TAC `
sum {(m:real^N,n), (n,m)} (\(m,n). f {m,n})` THEN
CONJ_TAC THENL
[AP_THM_TAC THEN AP_TERM_TAC THEN GEN_REWRITE_TAC I [
EXTENSION] THEN
REWRITE_TAC[
FORALL_PAIR_THM] THEN
REWRITE_TAC[
IN_ELIM_THM;
PAIR_EQ;
IN_INSERT;
NOT_IN_EMPTY;
SET_RULE `{a,b} = {c,d} <=> a = c /\ b = d \/ a = d /\ b = c`] THEN
ASM_MESON_TAC[
DIST_SYM];
SIMP_TAC[
SUM_CLAUSES;
FINITE_INSERT;
FINITE_EMPTY] THEN
ASM_REWRITE_TAC[
IN_SING;
NOT_IN_EMPTY;
PAIR_EQ;
REAL_ADD_RID] THEN
REWRITE_TAC[
INSERT_AC] THEN REAL_ARITH_TAC]]);;
(* ==================================================================== *)
(* Lemma 52 *)
open Flyspeck_constants;;
(* ==================================================================== *)
(* Lemma 53 *)
let gamma_y_pos_le = prove_by_refinement (
`!V X e. packing V /\ saturated V /\
mcell_set V X /\ edgeX V X e
==> &0 <= gammaY V X lmfun e`,
[(REPEAT STRIP_TAC);
(REWRITE_TAC[gammaY]);
(NEW_GOAL `?u v. (
VX V X u /\
VX V X v /\ ~(u = v)) /\ e = {u, v}`);
(UP_ASM_TAC THEN REWRITE_TAC[edgeX;
IN_ELIM_THM]);
(UP_ASM_TAC THEN STRIP_TAC);
(ASM_REWRITE_TAC[]);
(ABBREV_TAC `f = (\u v. if {u, v}
IN edgeX V X
then dihX V X (u,v) * lmfun (hl [u; v])
else &0)`);
(REWRITE_WITH `(\({u, v}). if {u, v}
IN edgeX V X
then dihX V X (u,v) * lmfun (hl [u; v])
else &0) = (\({u, v}). f u v)`);
(EXPAND_TAC "f" THEN REWRITE_TAC[]);
(REWRITE_WITH `(\({u:real^3, v}). f u v) {u, v} = (f:real^3->real^3->
real) u v`);
(MATCH_MP_TAC
BETA_PAIR_THM);
(EXPAND_TAC "f" THEN REPEAT STRIP_TAC);
(REPEAT COND_CASES_TAC);
(REWRITE_TAC[
HL;
set_of_list; SET_RULE `{a,b} = {b,a}`]);
(REWRITE_WITH `dihX V X (u',v') = dihX V X (v',u')`);
(MATCH_MP_TAC
DIHX_SYM);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `F`);
(UP_ASM_TAC THEN REWRITE_TAC[]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b} = {b,a}`] THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(NEW_GOAL `F`);
(UP_ASM_TAC THEN REWRITE_TAC[]);
(ONCE_REWRITE_TAC[SET_RULE `{a,b} = {b,a}`] THEN ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(REFL_TAC);
(EXPAND_TAC "f");
(COND_CASES_TAC);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
DIHX_POS;
lmfun_pos_le]);
(REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 54 *)
let CARD_LIST_klemma = prove_by_refinement (
`!s t. FINITE (s:A->bool) /\ FINITE t ==>
CARD {CONS u0 y1 | u0
IN s /\ y1
IN t} =
CARD s *
CARD t`,
[(REPEAT STRIP_TAC);
(ABBREV_TAC `S = {u0:A, y1:(A)list| u0
IN s /\ y1
IN t}`);
(ABBREV_TAC `f = (\(u0:A, y1:(A)list). CONS u0 y1)`);
(REWRITE_WITH `{CONS u0 y1 | u0
IN s /\ y1
IN t} =
(
IMAGE (f:A#(A)list->(A)list) S)`);
(EXPAND_TAC "f" THEN EXPAND_TAC "S" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[SET_RULE `A = B <=> A
SUBSET B /\ B
SUBSET A`]);
(STRIP_TAC);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `(u0:A,y1:(A)list)`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `u0:A` THEN EXISTS_TAC `y1:(A)list` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[ASSUME `x' = u0:A,y1:(A)list`] THEN STRIP_TAC);
(EXISTS_TAC `u0:A` THEN EXISTS_TAC `y1:(A)list` THEN ASM_REWRITE_TAC[]);
(REWRITE_WITH `
CARD (
IMAGE (f:A#(A)list->(A)list) S) =
CARD S`);
(MATCH_MP_TAC
CARD_IMAGE_INJ);
(STRIP_TAC);
(EXPAND_TAC "S" THEN EXPAND_TAC "f" THEN
REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[ASSUME `x = u0:A,y1:(A)list`;
ASSUME `y = u0':A,y1':(A)list`;
CONS_11]);
(STRIP_TAC THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "S" THEN MATCH_MP_TAC
FINITE_PRODUCT THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "S" THEN MATCH_MP_TAC
CARD_PRODUCT THEN ASM_REWRITE_TAC[])]);;
(* ==================================================================== *)
(* Lemma 55 *)
let CARD_LIST_klemma_2 = prove_by_refinement (
`!s t. FINITE (s:A->bool) /\ FINITE t ==>
CARD {[u0;y1] | u0
IN s /\ y1
IN t} =
CARD s *
CARD t`,
[(REPEAT STRIP_TAC);
(ABBREV_TAC `S = {u0:A, y1:A| u0
IN s /\ y1
IN t}`);
(ABBREV_TAC `f = (\(u0:A, y1:A). [u0; y1])`);
(REWRITE_WITH `{[u0; y1] | u0
IN s /\ y1
IN t} =
(
IMAGE (f:A#A->(A)list) S)`);
(EXPAND_TAC "f" THEN EXPAND_TAC "S" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[SET_RULE `A = B <=> A
SUBSET B /\ B
SUBSET A`]);
(STRIP_TAC);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `(u0:A,y1:A)`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `u0:A` THEN EXISTS_TAC `y1:A` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[ASSUME `x' = u0:A,y1:A`] THEN STRIP_TAC);
(EXISTS_TAC `u0:A` THEN EXISTS_TAC `y1:A` THEN ASM_REWRITE_TAC[]);
(REWRITE_WITH `
CARD (
IMAGE (f:A#A->(A)list) S) =
CARD S`);
(MATCH_MP_TAC
CARD_IMAGE_INJ);
(STRIP_TAC);
(EXPAND_TAC "S" THEN EXPAND_TAC "f" THEN
REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[ASSUME `x = u0:A,y1:A`;
ASSUME `y = u0':A,y1':A`]);
(REWRITE_TAC[
PAIR_EQ]);
(STRIP_TAC);
(REWRITE_WITH `u0 =
HD [u0':A; y1']`);
(UP_ASM_TAC THEN MESON_TAC[
HD]);
(REWRITE_TAC[
HD]);
(REWRITE_WITH `y1 =
HD (
TL [u0':A; y1'])`);
(UP_ASM_TAC THEN MESON_TAC[
HD;
TL]);
(REWRITE_TAC[
HD;
TL]);
(EXPAND_TAC "S" THEN MATCH_MP_TAC
FINITE_PRODUCT THEN ASM_REWRITE_TAC[]);
(EXPAND_TAC "S" THEN MATCH_MP_TAC
CARD_PRODUCT THEN ASM_REWRITE_TAC[])]);;
(* ==================================================================== *)
(* Lemma 56 *)
(* ==================================================================== *)
(* Lemma 57 *)
(* ==================================================================== *)
(* Lemma 58 *)
let BOUNDS_VGEN_klemma = prove_by_refinement(
`!u0 V r. &0 <= r /\ packing V ==>
&(
CARD (V
INTER ball (u0,r))) <= (r + &1) pow 3`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `
sum (V
INTER ball (u0,r)) (\x. vol (
ball (x:real^3, &1)))
= & (
CARD (V
INTER ball (u0,r))) * (&4 / &3 *
pi)`);
(NEW_GOAL `&0 <= &1`);
(REAL_ARITH_TAC);
(REWRITE_WITH `(\x. vol (
ball (x,&1))) = (\x. &4 / &3 *
pi)`);
(REWRITE_TAC[
FUN_EQ_THM]);
(ASM_SIMP_TAC[
VOLUME_BALL] THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
SUM_CONST);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(UP_ASM_TAC);
(ABBREV_TAC `f = (\x:real^3.
ball (x, &1))`);
(REWRITE_WITH `(\x. vol (
ball (x:real^3,&1))) = (\x. vol (f x))`);
(REWRITE_TAC[
FUN_EQ_THM] THEN STRIP_TAC);
(EXPAND_TAC "f" THEN REWRITE_TAC[]);
(REWRITE_WITH `
sum (V
INTER ball (u0:real^3,r)) (\x. vol (f x)) =
vol (
UNIONS (
IMAGE f (V
INTER ball (u0,r))))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
MEASURE_DISJOINT_UNIONS_IMAGE);
(EXPAND_TAC "f" THEN REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(REWRITE_TAC[
MEASURABLE_BALL]);
(REWRITE_TAC[
DISJOINT; SET_RULE `a = {} <=> ~(?s. s
IN a)`]);
(REWRITE_TAC[
IN_INTER;
IN_BALL]);
(STRIP_TAC);
(UNDISCH_TAC `packing V` THEN REWRITE_TAC[packing]);
(REPEAT STRIP_TAC);
(NEW_GOAL `&2 <=
dist (x,y:real^3)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(NEW_GOAL `
dist (x,y) <=
dist (x,s) +
dist (y,s:real^3)`);
(NORM_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(STRIP_TAC);
(NEW_GOAL `vol (
UNIONS (
IMAGE f (V
INTER ball (u0:real^3,r))))
<= vol (
ball (u0, r + &1))`);
(MATCH_MP_TAC
MEASURE_SUBSET);
(EXPAND_TAC "f" THEN REWRITE_TAC[
IMAGE;
MEASURABLE_BALL]);
(STRIP_TAC);
(MATCH_MP_TAC
MEASURABLE_UNIONS);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
MEASURABLE_BALL]);
(REWRITE_TAC[
UNIONS_SUBSET;
IN_INTER;
IN_BALL;
IN_ELIM_THM;
SUBSET]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (u0, x') <=
dist (u0,x:real^3) +
dist (x, x')`);
(NORM_ARITH_TAC);
(NEW_GOAL `
dist (x,x':real^3) < &1`);
(REWRITE_TAC[GSYM
IN_BALL] THEN ASM_MESON_TAC[]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `&(
CARD (V
INTER ball (u0,r))) * &4 / &3 *
pi <=
vol (
ball (u0,r + &1))`);
(ASM_REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH
`vol (
ball (u0, r + &1)) = &4 / &3 *
pi * (r + &1) pow 3`);
(NEW_GOAL `&0 <= r + &1`);
(ASM_REAL_ARITH_TAC);
(SIMP_TAC[
VOLUME_BALL; ASSUME `&0 <= r + &1`]);
(REWRITE_TAC[REAL_ARITH `a * &4 / &3 *
pi <= &4 / &3 *
pi * b <=>
&0 <=
pi * (b - a)`]);
(STRIP_TAC);
(NEW_GOAL `&0 <= (r + &1) pow 3 - &(
CARD (V
INTER ball (u0:real^3,r)))`);
(MATCH_MP_TAC Real_ext.REAL_PROP_NN_LCANCEL);
(EXISTS_TAC `
pi`);
(ASM_REWRITE_TAC[
PI_POS]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 59 *)
let BOUNDS_V4_klemma = prove_by_refinement (
`!u0 V. packing V ==>
CARD (V
INTER ball (u0, &4)) <= 125`,
[(REPEAT STRIP_TAC);
(NEW_GOAL `
sum (V
INTER ball (u0,&4)) (\x. vol (
ball (x:real^3, &1)))
= & (
CARD (V
INTER ball (u0,&4))) * (&4 / &3 *
pi)`);
(NEW_GOAL `&0 <= &1`);
(REAL_ARITH_TAC);
(REWRITE_WITH `(\x. vol (
ball (x,&1))) = (\x. &4 / &3 *
pi)`);
(REWRITE_TAC[
FUN_EQ_THM]);
(ASM_SIMP_TAC[
VOLUME_BALL] THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
SUM_CONST);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(UP_ASM_TAC);
(ABBREV_TAC `f = (\x:real^3.
ball (x, &1))`);
(REWRITE_WITH `(\x. vol (
ball (x:real^3,&1))) = (\x. vol (f x))`);
(REWRITE_TAC[
FUN_EQ_THM] THEN STRIP_TAC);
(EXPAND_TAC "f" THEN REWRITE_TAC[]);
(REWRITE_WITH `
sum (V
INTER ball (u0:real^3,&4)) (\x. vol (f x)) =
vol (
UNIONS (
IMAGE f (V
INTER ball (u0,&4))))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC
MEASURE_DISJOINT_UNIONS_IMAGE);
(EXPAND_TAC "f" THEN REWRITE_TAC[] THEN REPEAT STRIP_TAC);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(REWRITE_TAC[
MEASURABLE_BALL]);
(REWRITE_TAC[
DISJOINT; SET_RULE `a = {} <=> ~(?s. s
IN a)`]);
(REWRITE_TAC[
IN_INTER;
IN_BALL]);
(STRIP_TAC);
(UNDISCH_TAC `packing V` THEN REWRITE_TAC[packing]);
(REPEAT STRIP_TAC);
(NEW_GOAL `&2 <=
dist (x,y:real^3)`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_SET_TAC[]);
(NEW_GOAL `
dist (x,y) <=
dist (x,s) +
dist (y,s:real^3)`);
(NORM_ARITH_TAC);
(ASM_REAL_ARITH_TAC);
(STRIP_TAC);
(NEW_GOAL `vol (
UNIONS (
IMAGE f (V
INTER ball (u0:real^3,&4))))
<= vol (
ball (u0, &5))`);
(MATCH_MP_TAC
MEASURE_SUBSET);
(EXPAND_TAC "f" THEN REWRITE_TAC[
IMAGE;
MEASURABLE_BALL]);
(STRIP_TAC);
(MATCH_MP_TAC
MEASURABLE_UNIONS);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE_EXPAND);
(ASM_SIMP_TAC[FINITE_PACK_LEMMA]);
(REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
MEASURABLE_BALL]);
(REWRITE_TAC[
UNIONS_SUBSET;
IN_INTER;
IN_BALL;
IN_ELIM_THM;
SUBSET]);
(REPEAT STRIP_TAC);
(NEW_GOAL `
dist (u0, x') <=
dist (u0,x:real^3) +
dist (x, x')`);
(NORM_ARITH_TAC);
(NEW_GOAL `
dist (x,x':real^3) < &1`);
(REWRITE_TAC[GSYM
IN_BALL] THEN ASM_MESON_TAC[]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `&(
CARD (V
INTER ball (u0,&4))) * &4 / &3 *
pi <=
vol (
ball (u0,&5))`);
(ASM_REAL_ARITH_TAC);
(UP_ASM_TAC THEN REWRITE_WITH
`vol (
ball (u0,&5)) = &4 / &3 *
pi * (&5) pow 3`);
(SIMP_TAC[
VOLUME_BALL; REAL_ARITH `&0 <= &5`]);
(REWRITE_TAC[REAL_ARITH `a * &4 / &3 *
pi <= &4 / &3 *
pi * b <=>
&0 <=
pi * (b - a)`]);
(STRIP_TAC);
(NEW_GOAL `&0 <= &5 pow 3 - &(
CARD (V
INTER ball (u0:real^3,&4)))`);
(MATCH_MP_TAC Real_ext.REAL_PROP_NN_LCANCEL);
(EXISTS_TAC `
pi`);
(ASM_REWRITE_TAC[
PI_POS]);
(REWRITE_TAC[GSYM REAL_OF_NUM_LE]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 60 *)
let CARD_MCELL_CONTAINS_POINT_klemma = prove_by_refinement (
`?c. (!V u0. saturated V /\ packing V /\ u0
IN V
==>
CARD {X |
mcell_set V X /\
VX V X u0} <= c)`,
[(EXISTS_TAC `1220703125`);
(REPEAT STRIP_TAC);
(ABBREV_TAC `S = {ul,i | barV V 3 ul /\ i
IN 0..4 /\
u0
IN set_of_list ul}`);
(NEW_GOAL `FINITE (S:(real^3)list#num->bool)`);
(REWRITE_WITH `S = {ul,i | ul
IN {ul | barV V 3 ul /\
u0
IN set_of_list ul} /\ i
IN 0..4}`);
(EXPAND_TAC "S");
(SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(REWRITE_TAC[
FINITE_NUMSEG]);
(MATCH_MP_TAC
FINITE_SUBSET);
(ABBREV_TAC `T1 = V
INTER ball (u0:real^3, &4)`);
(NEW_GOAL `FINITE (T1:real^3->bool)`);
(EXPAND_TAC "T1" THEN MATCH_MP_TAC FINITE_PACK_LEMMA);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `{ul | ?v0 v1 v2 v3.
v0
IN T1 /\ v1
IN T1 /\ v2
IN T1 /\ v3
IN T1 /\
ul = [v0;v1;v2;v3:real^3]}`);
(STRIP_TAC);
(MATCH_MP_TAC Ajripqn.FINITE_SET_LIST_LEMMA THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?v0 v1 v2 v3. x = [v0:real^3; v1; v2; v3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC THEN EXISTS_TAC `v0:real^3` THEN EXISTS_TAC
`v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (x:(real^3)list)
SUBSET T1`);
(EXPAND_TAC "T1" THEN REWRITE_TAC[
SUBSET_INTER]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:(real^3->bool)`);
(ASM_REWRITE_TAC[]);
(UNDISCH_TAC `
set_of_list (x:(real^3)list) u0` THEN ASM_REWRITE_TAC[
IN]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[
set_of_list] THEN SET_TAC[]);
(ABBREV_TAC `f = (\(ul,i). mcell i V ul)`);
(NEW_GOAL `{X |
mcell_set V X /\
VX V X u0}
SUBSET
(
IMAGE (f:(real^3)list#num->real^3->bool) S) `);
(EXPAND_TAC "S" THEN EXPAND_TAC "f" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[
mcell_set_2;
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `ul:(real^3)list,i:num`);
(REWRITE_TAC[]);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(REWRITE_TAC[MESON[
IN] `(0..4) i <=> i
IN 0..4`]);
(ASM_REWRITE_TAC[
IN_NUMSEG_0]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(ASM_REWRITE_TAC[
IN_NUMSEG_0]);
(NEW_GOAL `(u0:real^3)
IN V
INTER x`);
(REWRITE_WITH `V
INTER x =
VX V x`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(SWITCH_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[
VX]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(SET_TAC[]);
(ASM_REWRITE_TAC[
IN]);
(UP_ASM_TAC THEN REWRITE_WITH
`V
INTER (x:real^3->bool) =
set_of_list (truncate_simplex (i - 1) ul)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
VX V x = V
INTER x`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(SWITCH_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[
VX]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(SET_TAC[]);
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `i = 0`);
(NEW_GOAL `F`);
(UNDISCH_TAC `
VX V x u0` THEN ASM_REWRITE_TAC[]);
(ASM_SIMP_TAC [Lepjbdj.LEPJBDJ_0]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(SET_TAC[]);
(ASM_MESON_TAC[]);
(ASM_ARITH_TAC);
(UNDISCH_TAC `
VX V x u0` THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(SET_TAC[]);
(REWRITE_TAC[MESON[
IN] `(A:real^3->bool) i <=> i
IN A`]);
(MATCH_MP_TAC (SET_RULE `A
SUBSET B ==> (u0
IN A ==> u0
IN B)`));
(MATCH_MP_TAC Rogers.SET_OF_LIST_TRUNCATE_SIMPLEX_SUBSET);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool`);
(ASM_REWRITE_TAC[]);
(ASM_ARITH_TAC);
(MATCH_MP_TAC (ARITH_RULE `(?b. a:num <= b /\ b <= c) ==> a <= c`));
(EXISTS_TAC `
CARD (
IMAGE (f:(real^3)list#num->real^3->bool) S)`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_SUBSET);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
FINITE_IMAGE);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC (ARITH_RULE `(?b. a:num <= b /\ b <= c) ==> a <= c`));
(EXISTS_TAC `
CARD (S:(real^3)list#num->bool)`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_IMAGE_LE);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`S = {ul,i |ul
IN {ul | barV V 3 ul /\ u0
IN set_of_list ul}/\ i
IN 0..4}`);
(EXPAND_TAC "S" THEN SET_TAC[]);
(REWRITE_WITH
`
CARD {ul,i |ul
IN {ul | barV V 3 ul /\ u0
IN set_of_list ul}/\ i
IN 0..4} =
CARD {ul | barV V 3 ul /\ u0
IN set_of_list ul} *
CARD (0..4)`);
(MATCH_MP_TAC
CARD_PRODUCT);
(REWRITE_TAC[
FINITE_NUMSEG]);
(MATCH_MP_TAC
FINITE_SUBSET);
(ABBREV_TAC `T1 = V
INTER ball (u0:real^3, &4)`);
(NEW_GOAL `FINITE (T1:real^3->bool)`);
(EXPAND_TAC "T1" THEN MATCH_MP_TAC FINITE_PACK_LEMMA);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `{ul | ?v0 v1 v2 v3.
v0
IN T1 /\ v1
IN T1 /\ v2
IN T1 /\ v3
IN T1 /\
ul = [v0;v1;v2;v3:real^3]}`);
(STRIP_TAC);
(MATCH_MP_TAC Ajripqn.FINITE_SET_LIST_LEMMA THEN ASM_REWRITE_TAC[]);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?v0 v1 v2 v3. x = [v0:real^3; v1; v2; v3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC THEN EXISTS_TAC `v0:real^3` THEN EXISTS_TAC
`v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (x:(real^3)list)
SUBSET T1`);
(EXPAND_TAC "T1" THEN REWRITE_TAC[
SUBSET_INTER]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:(real^3->bool)`);
(ASM_REWRITE_TAC[]);
(UNDISCH_TAC `
set_of_list (x:(real^3)list) u0` THEN ASM_REWRITE_TAC[
IN]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[
set_of_list] THEN SET_TAC[]);
(REWRITE_TAC[
CARD_NUMSEG; ARITH_RULE `(4 + 1) - 0 = 5`]);
(REWRITE_TAC[ARITH_RULE `a * 5 <= 1220703125 <=> a <= 244140625`]);
(ABBREV_TAC `T1 = V
INTER ball (u0:real^3, &4)`);
(NEW_GOAL `FINITE (T1:real^3->bool)`);
(EXPAND_TAC "T1" THEN MATCH_MP_TAC FINITE_PACK_LEMMA);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `{ul | barV V 3 ul /\ u0
IN set_of_list ul}
SUBSET
{ul | ?v0 v1 v2 v3.
v0
IN T1 /\ v1
IN T1 /\ v2
IN T1 /\ v3
IN T1 /\
ul = [v0;v1;v2;v3]}`);
(REWRITE_TAC[
SUBSET;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `?v0 v1 v2 v3. x = [v0:real^3; v1; v2; v3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC THEN EXISTS_TAC `v0:real^3` THEN EXISTS_TAC
`v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
set_of_list (x:(real^3)list)
SUBSET T1`);
(EXPAND_TAC "T1" THEN REWRITE_TAC[
SUBSET_INTER]);
(STRIP_TAC);
(MATCH_MP_TAC Packing3.BARV_SUBSET);
(EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:(real^3->bool)`);
(ASM_REWRITE_TAC[]);
(UNDISCH_TAC `
set_of_list (x:(real^3)list) u0` THEN ASM_REWRITE_TAC[
IN]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[
set_of_list] THEN SET_TAC[]);
(MATCH_MP_TAC (ARITH_RULE `(?x. a <= x /\ x <= b:num) ==> a <= b`));
(EXISTS_TAC `
CARD {ul | ?v0 v1 v2 v3.
v0
IN T1 /\
v1
IN T1 /\
v2
IN T1 /\
v3
IN T1 /\
ul = [v0:real^3; v1; v2; v3]}`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_SUBSET);
(ASM_REWRITE_TAC[] THEN MATCH_MP_TAC
FINITE_SET_LIST_LEMMA);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `
CARD
{y | ?u0 u1 u2 u3.
u0
IN T1 /\
u1
IN T1 /\
u2
IN T1 /\
u3
IN T1 /\
y = [u0:real^3; u1; u2; u3:real^3]} =
CARD T1 *
CARD T1 *
CARD T1 *
CARD T1`);
(ASM_SIMP_TAC [
CARD_LIST_4_klemma]);
(NEW_GOAL `
CARD (T1:real^3->bool) <= 125`);
(EXPAND_TAC "T1");
(MATCH_MP_TAC
BOUNDS_V4_klemma);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD (T1:real^3->bool) *
CARD T1 <= 125 * 125`);
(MATCH_MP_TAC
LE_MULT2);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD (T1:real^3->bool) *
CARD T1 *
CARD T1 <= 125 * 125 * 125`);
(MATCH_MP_TAC
LE_MULT2);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
CARD (T1:real^3->bool) *
CARD T1 *
CARD T1 *
CARD T1 <=
125 * 125 * 125 * 125`);
(MATCH_MP_TAC
LE_MULT2);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 61 *)
let BOUND_BETA_BUMP = prove_by_refinement (
`?c. !V X e.
saturated V /\ packing V /\
mcell_set V X /\
critical_edgeX V X e
==> beta_bump V e X <= c`,
[(EXISTS_TAC `&614400`);
(REWRITE_TAC[
mcell_set_2;
IN_ELIM_THM;
IN; beta_bump]);
(REPEAT STRIP_TAC THEN LET_TAC);
(UP_ASM_TAC THEN REWRITE_TAC[
cell_params]);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ]);
(STRIP_TAC);
(ABBREV_TAC `P = (\(k,ul'). k <= 4 /\ ul'
IN barV V 3 /\
mcell i V ul = mcell k V ul')`);
(NEW_GOAL `(P:(num#(real^3)list->bool)) (k,ul')`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC SELECT_AX);
(EXISTS_TAC `(i:num,ul:(real^3)list)`);
(EXPAND_TAC "P");
(REWRITE_TAC[
BETA_THM]);
(ASM_REWRITE_TAC[
IN]);
(UP_ASM_TAC THEN EXPAND_TAC "P");
(REWRITE_TAC[
BETA_THM;
IN] THEN STRIP_TAC);
(ABBREV_TAC `S = {e',e'',p,vl | 4 = k /\
{e', e''} =
critical_edgeX V X /\
e' = e /\
p
permutes 0..3 /\
left_action_list p ul' = vl /\
{
EL 0 vl,
EL 1 vl} = e' /\
{
EL 2 vl,
EL 3 vl} = e''}`);
(NEW_GOAL `?u0 u1 u2 u3. ul = [u0;u1;u2;u3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(ABBREV_TAC `K1 = {us:real^3->bool | us
SUBSET set_of_list ul}`);
(NEW_GOAL `FINITE (K1:(real^3->bool)->bool)`);
(EXPAND_TAC "K1" THEN MATCH_MP_TAC
FINITE_POWERSET);
(ASM_REWRITE_TAC[
set_of_list; Geomdetail.FINITE6]);
(NEW_GOAL `
critical_edgeX V X
SUBSET K1`);
(EXPAND_TAC "K1" THEN
REWRITE_TAC[
critical_edgeX; edgeX;
SUBSET;
IN;
IN_ELIM_THM]);
(REPEAT STRIP_TAC);
(NEW_GOAL `(x:real^3->bool)
SUBSET set_of_list ul`);
(REWRITE_TAC[ASSUME `x = {u, v:real^3}`; ASSUME `{u, v} = {u', v':real^3}`]);
(NEW_GOAL `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(NEW_GOAL `
VX V X = {}`);
(ASM_REWRITE_TAC[
VX]);
(UNDISCH_TAC `
VX V X u'` THEN
ASM_REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(NEW_GOAL
`V
INTER (X:real^3->bool) =
set_of_list (truncate_simplex (i - 1) ul)`);
(REWRITE_TAC[ASSUME `X = mcell i V ul`]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_CASES_TAC `i = 0`);
(NEW_GOAL `F`);
(NEW_GOAL `
VX V X = {}`);
(REWRITE_TAC[ASSUME `
VX V X = V
INTER X`; ASSUME `X = mcell i V ul`;
ASSUME `i = 0`]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);
(ASM_REWRITE_TAC[]);
(UNDISCH_TAC `
VX V X u'` THEN REWRITE_TAC[ASSUME `
VX V X = {}`;
MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(ASM_MESON_TAC[]);
(ASM_ARITH_TAC);
(REWRITE_TAC[GSYM (ASSUME `mcell i V ul = mcell k V ul'`);
GSYM (ASSUME `X = mcell i V ul`)]);
(STRIP_TAC);
(NEW_GOAL `
NULLSET X`);
(REWRITE_TAC[
NEGLIGIBLE_EMPTY; ASSUME `X = {}:real^3->bool`]);
(NEW_GOAL `
VX V X = {}`);
(REWRITE_TAC[
VX; ASSUME `
NULLSET X`]);
(UNDISCH_TAC `
VX V X u'` THEN REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`;
ASSUME `
VX V X = {}`] THEN SET_TAC[]);
(NEW_GOAL `
set_of_list (truncate_simplex (i - 1) ul)
SUBSET
set_of_list (ul:(real^3)list)`);
(MATCH_MP_TAC Rogers.SET_OF_LIST_TRUNCATE_SIMPLEX_SUBSET);
(ASM_REWRITE_TAC[
LENGTH] THEN ASM_ARITH_TAC);
(ASM_SET_TAC[]);
(ASM_SET_TAC[]);
(NEW_GOAL
`FINITE
(S:(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list->bool)`);
(EXPAND_TAC "S");
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{e',e'',p,vl | {e', e''} =
critical_edgeX V X /\
p
permutes 0..3 /\
left_action_list p ul' = vl:(real^3)list}`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{e',e'',p,vl | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3 /\
left_action_list p ul' = vl:(real^3)list}`);
(STRIP_TAC);
(ABBREV_TAC `S_temp = {e',e'',p | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3}`);
(ABBREV_TAC
`f_temp = (\(e':real^3->bool,e'':real^3->bool,p).
e',e'',p, (
left_action_list p (ul':(real^3)list)))`);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `
IMAGE (f_temp:(real^3->bool)#(real^3->bool)#(num->num)->(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list) S_temp`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(EXPAND_TAC "f_temp" THEN EXPAND_TAC "S_temp" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[
IN;
SUBSET;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `e':real^3->bool,e'':real^3->bool,p:num->num`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `e':real^3->bool` THEN
EXISTS_TAC `e'':real^3->bool` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN SET_TAC[]);
(SET_TAC[]);
(* ------------------------------------------------------------------------ *)
(* Finish proving S is FINITE *)
(* ------------------------------------------------------------------------ *)
(MATCH_MP_TAC (REAL_ARITH `(?x. a <= x /\ x <= b) ==> a <= b`));
(EXISTS_TAC
`
sum (S:(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list->bool)
(\x. &100)`);
(STRIP_TAC);
(MATCH_MP_TAC
SUM_LE);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "S" THEN REWRITE_TAC[
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `4 = k`); REAL_ARITH `a / &4 <= &100 <=> a <= &400`]);
(REWRITE_TAC[bump]);
(REWRITE_TAC[REAL_ARITH
`#0.005 * (&1 - a) - #0.005 * (&1 - b) <= &400 <=>
b - a <= &80000`]);
(MATCH_MP_TAC (REAL_ARITH `(&0 <= a /\ b <= c ==> b - a <= c)`));
(STRIP_TAC);
(MATCH_MP_TAC
REAL_LE_DIV);
(REWRITE_TAC[Real_ext.REAL_LE_POW_2]);
(REWRITE_TAC[hplus; h0; REAL_ARITH
`a / (#1.3254 - #1.26) pow 2 <= &80000 <=> a <= #342.1728`]);
(NEW_GOAL `barV V 3 vl`);
(MATCH_MP_TAC Qzksykg.QZKSYKG1);
(EXISTS_TAC `ul':(real^3)list`);
(EXISTS_TAC `4` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[ARITH_RULE `4 - 1 = 3`]);
(STRIP_TAC);
(SET_TAC[]);
(REWRITE_TAC[GSYM (ASSUME `mcell i V ul = mcell k V ul'`);
GSYM (ASSUME `X = mcell i V ul`)]);
(STRIP_TAC);
(NEW_GOAL `
critical_edgeX V X = {}`);
(REWRITE_TAC[
critical_edgeX ; edgeX;
IN;
IN_ELIM_THM;
SET_RULE `X = {} <=> ~(?s. s
IN X)`]);
(STRIP_TAC);
(NEW_GOAL `
NULLSET X`);
(ASM_MESON_TAC[
NEGLIGIBLE_EMPTY]);
(UNDISCH_TAC `
VX V X v'` THEN REWRITE_TAC[
VX; ASSUME `
NULLSET X`]);
(REWRITE_TAC[MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(UNDISCH_TAC `
critical_edgeX V X e`);
(REWRITE_TAC[ASSUME `
critical_edgeX V X = {}`; MESON[
IN] `{} x <=> x
IN {}`]
THEN SET_TAC[]);
(NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);
(MATCH_MP_TAC
BARV_3_EXPLICIT);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN REPEAT STRIP_TAC);
(ASM_REWRITE_TAC[
EL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
HD;
TL]);
(REWRITE_TAC[ARITH_RULE `SUC (SUC 0) = 2`]);
(NEW_GOAL `(hl [v2; v3:real^3] - #1.26) pow 2 <= (&10) pow 2`);
(REWRITE_TAC[GSYM
REAL_LE_SQUARE_ABS; REAL_ARITH `abs (&10) = &10`]);
(ASM_CASES_TAC `&0 <= hl [v2; v3:real^3] - #1.26`);
(REWRITE_WITH `abs (hl [v2; v3:real^3] - #1.26) = hl [v2; v3] - #1.26`);
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
HL_2;
REAL_ARITH `inv (&2) * a - #1.26 <= &10 <=> a <= #22.52`]);
(NEW_GOAL `
set_of_list vl
SUBSET ball (v2:real^3,&4)`);
(MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[
set_of_list]);
(SET_TAC[]);
(UP_ASM_TAC THEN ASM_REWRITE_TAC[
set_of_list] THEN STRIP_TAC);
(SUBGOAL_THEN `v3:real^3
IN ball (v2, &k)` MP_TAC);
(UP_ASM_TAC THEN SET_TAC[]);
(REWRITE_TAC[
IN_BALL; GSYM (ASSUME `4 = k`)]);
(REAL_ARITH_TAC);
(REWRITE_WITH `abs (hl [v2; v3] - #1.26) = #1.26 - hl [v2; v3:real^3]`);
(ASM_REAL_ARITH_TAC);
(MATCH_MP_TAC (REAL_ARITH `&0 <= a ==> #1.26 - a <= &10`));
(REWRITE_TAC[
HL_2] THEN NORM_ARITH_TAC);
(UP_ASM_TAC THEN REAL_ARITH_TAC);
(ASM_SIMP_TAC[
SUM_CONST]);
(EXPAND_TAC "S");
(MATCH_MP_TAC (REAL_ARITH `(?s. x <= s /\ s <= b) ==> x <= b`));
(EXISTS_TAC `& (
CARD {e',e'',p,vl | {e', e''} =
critical_edgeX V X /\
p
permutes 0..3 /\
left_action_list p ul' = vl:(real^3)list}) * &100 `);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `a * &100 <= b * &100 <=> a <= b`]);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(SET_TAC[]);
(MATCH_MP_TAC
FINITE_SUBSET);
(*****)
(EXISTS_TAC `{e',e'',p,vl | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3 /\
left_action_list p ul' = vl:(real^3)list}`);
(STRIP_TAC);
(ABBREV_TAC `S_temp = {e',e'',p | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3}`);
(ABBREV_TAC
`f_temp = (\(e':real^3->bool,e'':real^3->bool,p).
e',e'',p, (
left_action_list p (ul':(real^3)list)))`);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `
IMAGE (f_temp:(real^3->bool)#(real^3->bool)#(num->num)->(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list) S_temp`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(EXPAND_TAC "f_temp" THEN EXPAND_TAC "S_temp" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[
IN;
SUBSET;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `e':real^3->bool,e'':real^3->bool,p:num->num`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `e':real^3->bool` THEN
EXISTS_TAC `e'':real^3->bool` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(SWITCH_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(MATCH_MP_TAC (REAL_ARITH `(?s. x <= s /\ s <= b) ==> x <= b`));
(EXISTS_TAC `& (
CARD {e',e'',p,vl | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3 /\
left_action_list p ul' = vl:(real^3)list}) * &100 `);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `a * &100 <= b * &100 <=> a <= b`]);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(SWITCH_TAC THEN UP_ASM_TAC THEN SET_TAC[]);
(* **** *)
(ABBREV_TAC `S_temp = {e',e'',p | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3}`);
(ABBREV_TAC
`f_temp = (\(e':real^3->bool,e'':real^3->bool,p).
e',e'',p, (
left_action_list p (ul':(real^3)list)))`);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `
IMAGE (f_temp:(real^3->bool)#(real^3->bool)#(num->num)->(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list) S_temp`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_IMAGE);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(EXPAND_TAC "f_temp" THEN EXPAND_TAC "S_temp" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[
IN;
SUBSET;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `e':real^3->bool,e'':real^3->bool,p:num->num`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `e':real^3->bool` THEN
EXISTS_TAC `e'':real^3->bool` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC (REAL_ARITH `(?s. x <= s /\ s <= b) ==> x <= b`));
(ABBREV_TAC `S_temp = {e',e'',p | (e':real^3->bool)
IN K1 /\ e''
IN K1 /\
p
permutes 0..3}`);
(ABBREV_TAC
`f_temp = (\(e':real^3->bool,e'':real^3->bool,p).
e',e'',p, (
left_action_list p (ul':(real^3)list)))`);
(EXISTS_TAC `& (
CARD (
IMAGE (f_temp:(real^3->bool)#(real^3->bool)#(num->num)->(real^3->bool)#(real^3->bool)#(num->num)#(real^3)list) S_temp)) * &100`);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `a * &100 <= b * &100 <=> a <= b`]);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(EXPAND_TAC "f_temp" THEN EXPAND_TAC "S_temp" THEN REWRITE_TAC[
IMAGE]);
(REWRITE_TAC[
IN;
SUBSET;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `e':real^3->bool,e'':real^3->bool,p:num->num`);
(ASM_REWRITE_TAC[]);
(EXISTS_TAC `e':real^3->bool` THEN
EXISTS_TAC `e'':real^3->bool` THEN EXISTS_TAC `p:num->num`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
FINITE_IMAGE);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(MATCH_MP_TAC (REAL_ARITH `(?s. x <= s /\ s <= b) ==> x <= b`));
(EXISTS_TAC
`& (
CARD (S_temp:(real^3->bool)#(real^3->bool)#(num->num)->bool)) * &100`);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `a * &100 <= b * &100 <=> a <= b`]);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_IMAGE_LE);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(REWRITE_WITH `S_temp = {e':real^3->bool,u | e'
IN K1 /\
u
IN {e'', p | e''
IN K1 /\p
permutes 0..3}}`);
(EXPAND_TAC "S_temp");
(SET_TAC[]);
(ABBREV_TAC `K2 = {e'':real^3->bool, p | e''
IN K1 /\p
permutes 0..3}`);
(REWRITE_WITH `
CARD {e':real^3->bool,u:(real^3->bool)#(num->num) |
e'
IN K1 /\ u
IN K2} =
CARD K1 *
CARD K2`);
(MATCH_MP_TAC
CARD_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(REWRITE_WITH `
CARD (K2:(real^3->bool)#(num->num)->bool) =
CARD (K1:(real^3->bool)->bool) *
CARD {p | p
permutes 0..3}`);
(REWRITE_WITH
`K2 = {e'':real^3->bool,p | e''
IN K1 /\ p
IN {p | p
permutes 0..3}}`);
(EXPAND_TAC "K2" THEN SET_TAC[]);
(MATCH_MP_TAC
CARD_PRODUCT);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[GSYM
NUMSEG_LE; ARITH_RULE `a <= 3 <=> a < 4`;
Marchal_cells_2_new.SET_OF_0_TO_3;
Upfzbzm_support_lemmas.FINITE_PERMUTE_4]);
(REWRITE_WITH `
CARD (K1:(real^3->bool)->bool) = 16`);
(REWRITE_WITH `16 = 2
EXP (
CARD (
set_of_list (ul:(real^3)list)))`);
(REWRITE_WITH `
CARD (
set_of_list (ul:(real^3)list)) = 3 + 1`);
(MATCH_MP_TAC
BARV_CARD_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ARITH_TAC);
(EXPAND_TAC "K1");
(MATCH_MP_TAC
CARD_POWERSET);
(ASM_REWRITE_TAC[
set_of_list; Geomdetail.FINITE6]);
(REWRITE_WITH `
CARD {p | p
permutes 0..3} =
FACT (
CARD (0..3))`);
(MATCH_MP_TAC
CARD_PERMUTATIONS);
(REWRITE_TAC[
FINITE_NUMSEG]);
(REWRITE_TAC[
CARD_NUMSEG; ARITH_RULE `16 * 16 *
FACT ((3 + 1) - 0) = 6144`]);
(REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 62 *)
(* ==================================================================== *)
(* Lemma 63 *)
(* ==================================================================== *)
(* Lemma 64 *)
let EDGEX_SUBSET_MCELL = prove_by_refinement (
`!V X e. packing V /\ saturated V /\
mcell_set V X /\ edgeX V X e
==> e
SUBSET X`,
[(REWRITE_TAC[edgeX;
IN;
IN_ELIM_THM;
mcell_set] THEN REPEAT STRIP_TAC);
(NEW_GOAL `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num` THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC THEN UNDISCH_TAC `
VX V X u` THEN
ASM_REWRITE_TAC[
VX; MESON[
IN] `{} x <=> x
IN {}`] THEN SET_TAC[]);
(ASM_SET_TAC[])]);;
(* ==================================================================== *)
(* Lemma 65 *)
let FINITE_VX = prove_by_refinement (
`!V X. packing V /\ saturated V /\
mcell_set V X ==> FINITE (
VX V X)`,
[(REWRITE_TAC[
mcell_set_2;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(ASM_CASES_TAC `
VX V X = {}`);
(ASM_REWRITE_TAC[
FINITE_EMPTY]);
(REWRITE_WITH `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num` THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC THEN UNDISCH_TAC `~(
VX V X = {})` THEN
ASM_REWRITE_TAC[
VX]);
(ASM_CASES_TAC `V
INTER (X:real^3->bool) = {}`);
(ASM_REWRITE_TAC[
FINITE_EMPTY]);
(REWRITE_WITH
`(V:real^3->bool)
INTER X =
set_of_list (truncate_simplex (i-1) ul)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_CASES_TAC `i = 0`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(V
INTER (X:real^3->bool) = {})`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);
(ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_ARITH_TAC);
(STRIP_TAC);
(UNDISCH_TAC `~(
VX V X = {})` THEN ASM_REWRITE_TAC[
VX;
NEGLIGIBLE_EMPTY]);
(REWRITE_TAC[
FINITE_SET_OF_LIST])]);;
(* ==================================================================== *)
(* Lemma 66 *)
let CARD_EDGEX_LE_16 = prove_by_refinement (
`!V X. packing V /\ saturated V /\
mcell_set V X
==>
CARD (edgeX V X) <= 16`,
[(REWRITE_TAC[edgeX] THEN REPEAT STRIP_TAC);
(ABBREV_TAC `S = {u, v |
VX V X u /\
VX V X v /\ ~(u = v)}`);
(ABBREV_TAC `f = (\(u,v:real^3). {u,v})`);
(MATCH_MP_TAC (ARITH_RULE `(?x:num. y <= x /\ x <= z) ==> y <= z`));
(EXISTS_TAC `
CARD (
IMAGE (f:(real^3#real^3)->(real^3->bool)) S)`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(EXPAND_TAC "f" THEN EXPAND_TAC "S" THEN
REWRITE_TAC[
IMAGE;
SUBSET;
IN;
IN_ELIM_THM] THEN REPEAT STRIP_TAC);
(EXISTS_TAC `u:real^3,v:real^3` THEN ASM_REWRITE_TAC[]);
(EXISTS_TAC `u:real^3` THEN EXISTS_TAC `v:real^3` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
FINITE_IMAGE);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{u,v | u
IN VX V X /\ v
IN VX V X}`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_PRODUCT);
(REWRITE_TAC[] THEN MATCH_MP_TAC
FINITE_VX);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(MATCH_MP_TAC (ARITH_RULE `(?x:num. y <= x /\ x <= z) ==> y <= z`));
(EXISTS_TAC `
CARD (S:(real^3#real^3)->bool)`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_IMAGE_LE);
(MATCH_MP_TAC
FINITE_SUBSET);
(EXISTS_TAC `{u,v | u
IN VX V X /\ v
IN VX V X}`);
(STRIP_TAC);
(MATCH_MP_TAC
FINITE_PRODUCT);
(REWRITE_TAC[] THEN MATCH_MP_TAC
FINITE_VX);
(ASM_REWRITE_TAC[]);
(ASM_SET_TAC[]);
(MATCH_MP_TAC (ARITH_RULE `(?x:num. y <= x /\ x <= z) ==> y <= z`));
(EXISTS_TAC `
CARD {u,v | u
IN VX V X /\ v
IN VX V X}`);
(STRIP_TAC);
(MATCH_MP_TAC
CARD_SUBSET);
(STRIP_TAC);
(ASM_SET_TAC[]);
(MATCH_MP_TAC
FINITE_PRODUCT);
(REWRITE_TAC[] THEN MATCH_MP_TAC
FINITE_VX);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH
`
CARD {u,v | u
IN VX V X /\ v
IN VX V X} =
CARD (
VX V X) *
CARD (
VX V X)`);
(MATCH_MP_TAC
CARD_PRODUCT THEN ASM_SIMP_TAC[
FINITE_VX]);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set_2;
IN;
IN_ELIM_THM]);
(STRIP_TAC);
(ASM_CASES_TAC `
VX V X = {}`);
(ASM_REWRITE_TAC[
CARD_CLAUSES] THEN ARITH_TAC);
(REWRITE_WITH `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num` THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC THEN UNDISCH_TAC `~(
VX V X = {})` THEN
ASM_REWRITE_TAC[
VX]);
(ASM_CASES_TAC `V
INTER (X:real^3->bool) = {}`);
(ASM_REWRITE_TAC[
CARD_CLAUSES] THEN ARITH_TAC);
(REWRITE_WITH
`(V:real^3->bool)
INTER X =
set_of_list (truncate_simplex (i-1) ul)`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ);
(ASM_REWRITE_TAC[]);
(STRIP_TAC);
(ASM_CASES_TAC `i = 0`);
(NEW_GOAL `F`);
(UNDISCH_TAC `~(V
INTER (X:real^3->bool) = {})`);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);
(ASM_REWRITE_TAC[]);
(ASM_MESON_TAC[]);
(ASM_ARITH_TAC);
(STRIP_TAC);
(UNDISCH_TAC `~(
VX V X = {})` THEN ASM_REWRITE_TAC[
VX;
NEGLIGIBLE_EMPTY]);
(NEW_GOAL `
CARD (
set_of_list (truncate_simplex (i - 1) ul)) <=
LENGTH (truncate_simplex (i - 1) (ul:(real^3)list))`);
(REWRITE_TAC[
CARD_SET_OF_LIST_LE]);
(UP_ASM_TAC THEN REWRITE_WITH
`
LENGTH (truncate_simplex (i - 1) (ul:(real^3)list)) = (i - 1 + 1)`);
(MATCH_MP_TAC Packing3.LENGTH_TRUNCATE_SIMPLEX);
(REWRITE_WITH `
LENGTH (ul:(real^3)list) = 3 + 1`);
(MATCH_MP_TAC
BARV_LENGTH_LEMMA);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(ASM_ARITH_TAC);
(STRIP_TAC);
(ABBREV_TAC
`s =
CARD (
set_of_list (truncate_simplex (i - 1) (ul:(real^3)list)))`);
(NEW_GOAL `s <= 4`);
(ASM_ARITH_TAC);
(NEW_GOAL `s * s <= s * 4 /\ s * 4 <= 4 * 4`);
(ASM_REWRITE_TAC[
LE_MULT_LCANCEL;
LE_MULT_RCANCEL]);
(ASM_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 67 *)
let gamma_y_lmfun_bound2 = prove_by_refinement (
`?d. (!V X e. packing V /\ saturated V /\
mcell_set V X /\ edgeX V X e ==> gammaY V X lmfun e <= d)`,
[
(EXISTS_TAC `
pi * h0 / (h0 - &1)`);
(REPEAT STRIP_TAC);
(ABBREV_TAC `f = (\u v. if {u, v}
IN edgeX V X
then dihX V X (u,v) * lmfun (hl [u; v])
else &0)`);
(REWRITE_WITH `gammaY V X lmfun = (\({u, v}). f u v)`);
(EXPAND_TAC "f" THEN REWRITE_TAC[gammaY]);
(NEW_GOAL `!u v. (f:real^3->real^3->
real) u v = f v u`);
(EXPAND_TAC "f" THEN REWRITE_TAC[
BETA_THM]);
(REWRITE_TAC[
HL;
set_of_list; SET_RULE `{a,b} = {b,a}`]);
(REPEAT GEN_TAC THEN COND_CASES_TAC);
(COND_CASES_TAC);
(REWRITE_WITH `dihX V X (u,v) = dihX V X (v,u)`);
(MATCH_MP_TAC
DIHX_SYM);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN MESON_TAC[]);
(COND_CASES_TAC);
(UP_ASM_TAC THEN MESON_TAC[]);
(REFL_TAC);
(UNDISCH_TAC `edgeX V X e` THEN REWRITE_TAC[
IN;
IN_ELIM_THM; edgeX]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(REWRITE_WITH `(\({u, v}). f u v) {u, v} =
(f:real^3->real^3->
real) u v`);
(MATCH_MP_TAC
BETA_PAIR_THM);
(ASM_REWRITE_TAC[]);
(EXPAND_TAC "f");
(COND_CASES_TAC);
(NEW_GOAL `dihX V X (u,v) * lmfun (hl [u;v]) <=
pi * lmfun (hl [u;v])`);
(REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
lmfun_pos_le; REAL_ARITH `&0 <= a - b <=> b <= a`;
DIHX_LE_PI]);
(NEW_GOAL `
pi * lmfun (hl [u:real^3;v]) <=
pi * h0 / (h0 - &1)`);
(REWRITE_TAC[REAL_ARITH `a * x <= a * y <=> &0 <= (y - x) * a`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
PI_POS_LE; REAL_ARITH `&0 <= a - b <=> b <= a`]);
(MATCH_MP_TAC
lmfun_bounded);
(REWRITE_TAC[
HL_2; REAL_ARITH `&0 <= inv (&2) * x <=> &0 <= x`;
DIST_POS_LE]);
(UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);
(MATCH_MP_TAC
REAL_LE_MUL);
(REWRITE_TAC[
PI_POS_LE]);
(MATCH_MP_TAC
REAL_LE_DIV);
(REWRITE_TAC[h0] THEN REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 68 *)
let BOUND_GAMMA_X_lmfun = prove_by_refinement (
`?c.
(!V X. packing V /\ saturated V /\
mcell_set V X ==> gammaX V X lmfun <= c)`,
[(MP_TAC
gamma_y_lmfun_bound2 THEN STRIP_TAC);
(ABBREV_TAC `e = max d (&0)`);
(EXISTS_TAC `&4 / &3 *
pi * (&8) pow 3 + (&8 * mm2 /
pi) * &16 * e`);
(REPEAT STRIP_TAC);
(REWRITE_TAC[gammaX]);
(MATCH_MP_TAC (REAL_ARITH
`a <= x /\ &0 <= b /\ c <= y ==> a - b + c <= x + y`));
(REPEAT STRIP_TAC);
(ASM_CASES_TAC `X:real^3->bool = {}`);
(ASM_REWRITE_TAC[
MEASURE_EMPTY;
REAL_ARITH `&0 <= &4 / &3 *
pi * &8 pow 3 <=> &0 <=
pi`]);
(REWRITE_TAC[
PI_POS_LE]);
(NEW_GOAL `?p:real^3. p
IN X`);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN STRIP_TAC);
(REWRITE_WITH `&4 / &3 *
pi * &8 pow 3 = vol (
ball (p, &8))`);
(ONCE_REWRITE_TAC[
EQ_SYM_EQ] THEN MATCH_MP_TAC
VOLUME_BALL);
(REAL_ARITH_TAC);
(MATCH_MP_TAC
MEASURE_SUBSET);
(REWRITE_TAC[
MEASURABLE_BALL]);
(STRIP_TAC);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set;
IN;
IN_ELIM_THM]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MEASURABLE_MCELL);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MCELL_SUBSET_BALL8_2);
(EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `&0 <= &2 * a <=> &0 <= a`]);
(MATCH_MP_TAC
REAL_LE_DIV);
(STRIP_TAC);
(NEW_GOAL `#1.012080 < mm1`);
(REWRITE_TAC[Flyspeck_constants.bounds]);
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
PI_POS_LE]);
(REWRITE_TAC[
total_solid]);
(MATCH_MP_TAC
SUM_POS_LE);
(REPEAT STRIP_TAC);
(MATCH_MP_TAC
FINITE_VX);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[sol]);
(NEW_GOAL `
eventually_radial (x:real^3) X`);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set;
IN;
IN_ELIM_THM]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Urrphbz2.URRPHBZ2);
(ASM_REWRITE_TAC[]);
(NEW_GOAL `
VX V X = V
INTER X`);
(MATCH_MP_TAC Hdtfnfz.HDTFNFZ);
(EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);
(ASM_REWRITE_TAC[]);
(STRIP_TAC THEN UNDISCH_TAC `x
IN VX V X`);
(ASM_REWRITE_TAC[
VX] THEN SET_TAC[]);
(ASM_SET_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
eventually_radial]);
(STRIP_TAC);
(REWRITE_WITH `sol x X = &3 * vol (X
INTER normball x r) / r pow 3`);
(MATCH_MP_TAC sol);
(REWRITE_TAC[GSYM Marchal_cells_2_new.RADIAL_VS_RADIAL_NORM;
NORMBALL_BALL]);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MEASURABLE_INTER);
(REWRITE_TAC[
MEASURABLE_BALL]);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set;
IN;
IN_ELIM_THM]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MEASURABLE_MCELL);
(ASM_REWRITE_TAC[]);
(REWRITE_TAC[REAL_ARITH `&0 <= &3 * a <=> &0 <= a`]);
(MATCH_MP_TAC
REAL_LE_DIV);
(STRIP_TAC);
(MATCH_MP_TAC
MEASURE_POS_LE);
(REWRITE_TAC[
NORMBALL_BALL]);
(MATCH_MP_TAC
MEASURABLE_INTER);
(REWRITE_TAC[
MEASURABLE_BALL]);
(UNDISCH_TAC `
mcell_set V X` THEN REWRITE_TAC[
mcell_set;
IN;
IN_ELIM_THM]);
(STRIP_TAC);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC
MEASURABLE_MCELL);
(ASM_REWRITE_TAC[]);
(MATCH_MP_TAC Real_ext.REAL_PROP_NN_POW);
(ASM_REAL_ARITH_TAC);
(ONCE_REWRITE_TAC[REAL_ARITH `a <= b <=> &0 <= b - a`]);
(REWRITE_TAC[REAL_ARITH `a * x - a * y = a * (x - y)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(REWRITE_TAC[REAL_ARITH `&0 <= &8 * a <=> &0 <= a`]);
(MATCH_MP_TAC
REAL_LE_DIV);
(STRIP_TAC);
(NEW_GOAL `#0.02541 < mm2`);
(REWRITE_TAC[Flyspeck_constants.bounds]);
(ASM_REAL_ARITH_TAC);
(REWRITE_TAC[
PI_POS_LE]);
(REWRITE_TAC[GSYM gammaY]);
(ONCE_REWRITE_TAC[REAL_ARITH `&0 <= b - a <=> a <= b`]);
(NEW_GOAL `
sum (edgeX V X) (gammaY V X lmfun) <=
sum (edgeX V X) (\x. e)`);
(MATCH_MP_TAC
SUM_LE);
(REWRITE_TAC[Upfzbzm_support_lemmas.FINITE_edgeX]);
(REPEAT STRIP_TAC);
(NEW_GOAL `gammaY V X lmfun x <= d`);
(FIRST_ASSUM MATCH_MP_TAC);
(ASM_REWRITE_TAC[]);
(UP_ASM_TAC THEN REWRITE_TAC[
IN]);
(ASM_REAL_ARITH_TAC);
(NEW_GOAL `
sum (edgeX V X) (\x. e) <= &16 * e`);
(REWRITE_WITH `
sum (edgeX V X) (\x. e) = &(
CARD (edgeX V X)) * e`);
(MATCH_MP_TAC
SUM_CONST);
(REWRITE_TAC[Upfzbzm_support_lemmas.FINITE_edgeX]);
(ONCE_REWRITE_TAC[REAL_ARITH `a <= b <=> &0 <= b - a`]);
(REWRITE_TAC[REAL_ARITH `a * x - b * x = x * (a - b)`]);
(MATCH_MP_TAC
REAL_LE_MUL);
(STRIP_TAC);
(ASM_REAL_ARITH_TAC);
(ONCE_REWRITE_TAC[REAL_ARITH `&0 <= b - a <=> a <= b`]);
(REWRITE_TAC[REAL_OF_NUM_LE]);
(MATCH_MP_TAC
CARD_EDGEX_LE_16);
(ASM_REWRITE_TAC[]);
(ASM_REAL_ARITH_TAC)]);;
(* ==================================================================== *)
(* Lemma 69 *)
(* ==================================================================== *)
(* Lemma 70 *)
(* ==================================================================== *)
(* Lemma 71 *)