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;;
open Marchal_cells_3;;
open Grutoti;;
open Sum_beta_bump;;
open Kizhltl;;
open Sum_gammax_lmfun_estimate;;
open Upfzbzm;;
open Rdwkarc;;
open Ineq;;
open Merge_ineq;;
open Hales_tactic;;
(* ======================================================================== *)
(* Some axioms *)
let KY_CHEAT_TAC = MP_TAC (mk_fthm([],`F`)) THEN MESON_TAC[];;
(* ======================================================================== *)
let REUHADY_concl1 =
`!V u0 u1 vl1 vl2 v1 v2 e.
saturated V /\
packing V /\
u0 IN V /\
u1 IN V /\
~(u0 = u1) /\
hl [u0; u1] < sqrt (&2) /\
e = {u0, u1} /\
~(azim u0 u1 n1 n2 = &0) /\
~(vl1 = vl2) /\
hl vl1 < sqrt2 /\
hl vl2 < sqrt2 /\
vl1 IN barV V 2 /\
vl2 IN barV V 2 /\
set_of_list (truncate_simplex 1 vl1) = e /\
set_of_list (truncate_simplex 1 vl2) = e /\
n1 = EL 2 vl1 /\
n2 = EL 2 vl2 /\
(!X. X IN mcell_set V /\ e IN edgeX V X
==> X SUBSET wedge_ge u0 u1 n1 n2 \/
X SUBSET wedge_ge u0 u1 n2 n1)
==> sum
{X | mcell_set V X /\ e IN edgeX V X /\ X SUBSET wedge_ge u0 u1 n1 n2}
(\t. dihX V t (u0,u1)) =
azim u0 u1 n1 n2`;;
g REUHADY_concl1;;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `barV V 1 [u0;u1:real^3]`);;
e (MATCH_MP_TAC HL_LE_SQRT2_IMP_BARV_1);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL
`{k | k IN 1..3 /\
voronoi_list V [u0;u1:real^3] =
UNIONS
{convex hull
({omega_list_n V vl i | i IN 1..k - 1} UNION
voronoi_list V vl) | vl | barV V k vl /\
truncate_simplex 1 vl = [u0;u1]}} =
1..3`);;
e (MATCH_MP_TAC Rogers.GLTVHUM_lemma1);;
e (ASM_REWRITE_TAC[] THEN ARITH_TAC);;
e (NEW_GOAL
`3 IN {k | k IN 1..3 /\
voronoi_list V [u0; u1] =
UNIONS
{convex hull
({omega_list_n V vl i | i IN 1..k - 1} UNION voronoi_list V vl) | vl |
barV V k vl /\
truncate_simplex 1 vl = [u0; u1]}}`);;
e (ASM_REWRITE_TAC[IN_NUMSEG] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);;
e (REWRITE_WITH
`UNIONS
{convex hull ({omega_list_n V vl i | i IN 1..3 - 1} UNION voronoi_list V vl) | vl | barV V 3 vl /\
truncate_simplex 1 vl = [u0; u1]} =
UNIONS {convex hull {omega_list_n V vl 1, omega_list_n V vl 2,
omega_list_n V vl 3} | vl | barV V 3 vl /\
truncate_simplex 1 vl = [u0; u1]}`);;
e (ONCE_REWRITE_TAC[SET_EQ_LEMMA]);;
e (REWRITE_TAC[IN_UNIONS] THEN ONCE_REWRITE_TAC[IN] THEN
REWRITE_TAC[IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `t:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?a. voronoi_list V vl = {a} /\
a = circumcenter (set_of_list vl) /\
hl vl = dist (HD vl,a)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.VORONOI_LIST_3_SINGLETON_EXPLICIT);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `omega_list_n V vl 3 IN voronoi_list V vl`);;
e (REWRITE_WITH `omega_list_n V vl 3 = omega_list V vl`);;
e (REWRITE_TAC[OMEGA_LIST]);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);;
e (MATCH_MP_TAC Packing3.OMEGA_LIST_IN_VORONOI_LIST);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `omega_list_n V vl 3 = a`);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `3 - 1 = 2`; IN_NUMSEG;
ARITH_RULE `1 <= i /\ i <= 2 <=> i = 1 \/ i = 2`]);;
e (REWRITE_WITH `{omega_list_n V vl i | i = 1 \/ i = 2} =
{omega_list_n V vl 1,omega_list_n V vl 2}`);;
e (SET_TAC[]);;
e (REWRITE_WITH `{omega_list_n V vl 1, omega_list_n V vl 2} UNION
{circumcenter (set_of_list vl)} = {omega_list_n V vl 1, omega_list_n V vl 2, circumcenter (set_of_list vl)}`);;
e (SET_TAC[]);;
e (EXISTS_TAC `t:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?a. voronoi_list V vl = {a} /\
a = circumcenter (set_of_list vl) /\
hl vl = dist (HD vl,a)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.VORONOI_LIST_3_SINGLETON_EXPLICIT);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `omega_list_n V vl 3 IN voronoi_list V vl`);;
e (REWRITE_WITH `omega_list_n V vl 3 = omega_list V vl`);;
e (REWRITE_TAC[OMEGA_LIST]);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `(3 + 1) - 1 = 3`]);;
e (MATCH_MP_TAC Packing3.OMEGA_LIST_IN_VORONOI_LIST);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `omega_list_n V vl 3 = a`);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `3 - 1 = 2`; IN_NUMSEG;
ARITH_RULE `1 <= i /\ i <= 2 <=> i = 1 \/ i = 2`]);;
e (REWRITE_WITH `{omega_list_n V vl i | i = 1 \/ i = 2} =
{omega_list_n V vl 1,omega_list_n V vl 2}`);;
e (SET_TAC[]);;
e (REWRITE_WITH `{omega_list_n V vl 1, omega_list_n V vl 2} UNION
{circumcenter (set_of_list vl)} = {omega_list_n V vl 1, omega_list_n V vl 2,
circumcenter (set_of_list vl)}`);;
e (SET_TAC[]);;
e (STRIP_TAC);;
(* ======================================================================= *)
e (ABBREV_TAC `p = circumcenter {u0, u1:real^3}`);;
e (NEW_GOAL `aff_dim (u0 INSERT voronoi_list V [u0;u1]) = &3`);;
e (REWRITE_TAC[AFF_DIM_INSERT]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `affine hull voronoi_list V [u0; u1] SUBSET
affine hull {x | &2 % (u0 - u1) dot x = norm u0 pow 2 - norm u1 pow 2}`);;
e (MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);;
e (REWRITE_TAC[VORONOI_LIST; set_of_list; Packing3.VORONOI_SET_2]);;
e (ONCE_REWRITE_TAC[SET_RULE `a INTER b = b INTER a`]);;
e (ASM_SIMP_TAC[Pack2.INTER_VORONOI_SUBSET_BISECTOR]);;
e (NEW_GOAL
`affine hull {x | &2 % (u0 - u1) dot x = norm u0 pow 2 - norm u1 pow 2} =
{x:real^3 | &2 % (u0 - u1) dot x = norm u0 pow 2 - norm u1 pow 2}`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (NEW_GOAL
`~(u0 IN {x:real^3 | &2 % (u0 - u1) dot x = norm u0 pow 2 - norm u1 pow 2})`);;
e (REWRITE_TAC[IN; IN_ELIM_THM; NORM_POW_2]);;
e (ONCE_REWRITE_TAC [REAL_ARITH `a = b <=> a - b = &0`]);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (u0 - u1) dot u0 - (u0 dot u0 - u1 dot u1) =
(u0 - u1) dot (u0 - u1)`]);;
e (REWRITE_TAC[DOT_EQ_0] THEN ASM_NORM_ARITH_TAC);;
e (ASM_SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `a + &1 = b:int <=> a = b - &1`]);;
e (MATCH_MP_TAC Packing3.AFF_DIM_VORONOI_LIST);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `aff_dim (u0 INSERT voronoi_list V [u0; u1]) = &(dimindex (:3))`);;
e (ASM_REWRITE_TAC[DIMINDEX_3]);;
e (UP_ASM_TAC THEN REWRITE_TAC[AFF_DIM_EQ_FULL]);;
e (STRIP_TAC);;
e (ABBREV_TAC `S = voronoi_list V [u0;u1]`);;
e (NEW_GOAL `!x. x IN S ==> (x - u0) dot (u1 - u0) =
dist (p, u0) * dist (u1, u0:real^3)`);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `p = inv (&2) % (u0 + (u1:real^3))`);;
e (EXPAND_TAC "p" THEN REWRITE_TAC[Rogers.CIRCUMCENTER_2; midpoint]);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `u1 - u0 = &2 % (p - u0:real^3)`);;
e (ASM_REWRITE_TAC[]);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_MUL; REAL_ARITH `abs (&2) = &2`;
REAL_ARITH `a * b * a = b * a pow 2`; NORM_POW_2; DOT_RMUL]);;
e (REWRITE_WITH `(x - u0) dot (p - u0:real^3) =
(p - u0) dot (p - u0) - (x - p) dot (u0 - p)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(x - p) dot (u0 - p:real^3) = &0`);;
e (EXPAND_TAC "p");;
e (REWRITE_WITH `{u0, u1} = set_of_list [u0; u1:real^3]`);;
e (REWRITE_TAC[set_of_list]);;
e (MATCH_MP_TAC Rogers.MHFTTZN4);;
e (EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `1`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `S SUBSET affine hull voronoi_list V [u0; u1]`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[set_of_list]);;
e (NEW_GOAL `{u0,u1} SUBSET affine hull {u0,u1:real^3}`);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (ASM_SET_TAC[]);;
e (REAL_ARITH_TAC);;
(* ========================================================================= *)
e (ABBREV_TAC `S1 = {x:real^3 | &2 % (u0 - u1) dot x =
norm u0 pow 2 - norm u1 pow 2}`);;
e (ABBREV_TAC `S2:real^3->bool = (S1 DIFF (relative_interior S))`);;
e (NEW_GOAL `closed_in (subtopology euclidean (S1:real^3->bool)) S2`);;
e (EXPAND_TAC "S2");;
e (MATCH_MP_TAC CLOSED_IN_DIFF);;
e (STRIP_TAC);;
e (NEW_GOAL `closed (S1:real^3->bool)`);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[CLOSED_HYPERPLANE]);;
e (MATCH_MP_TAC CLOSED_SUBSET);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (REWRITE_WITH `S1 = affine hull (S:real^3->bool)`);;
e (EXPAND_TAC "S");;
e (NEW_GOAL `affine hull S1 = S1:real^3->bool`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (ONCE_REWRITE_TAC[GSYM (ASSUME `affine hull S1 = S1:real^3->bool`)]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC AFF_DIM_EQ_AFFINE_HULL);;
e (STRIP_TAC);;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `INTERS {f x | x IN {a, b}} = f a INTER f b`]);;
e (DEL_TAC THEN EXPAND_TAC "S1");;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `aff_dim (S1:(real^3->bool)) = &(dimindex (:3)) - &1`);;
e (DEL_TAC THEN EXPAND_TAC "S1");;
e (MATCH_MP_TAC AFF_DIM_HYPERPLANE);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (s - t) = vec 0 <=> s = t`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[DIMINDEX_3]);;
e (REWRITE_WITH `aff_dim (voronoi_list V [u0;u1:real^3]) = &3 - &1`);;
e (MATCH_MP_TAC Packing3.AFF_DIM_VORONOI_LIST);;
e (ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (REWRITE_TAC[OPEN_IN_RELATIVE_INTERIOR]);;
e (NEW_GOAL `closed (S2:real^3->bool)`);;
e (MATCH_MP_TAC CLOSED_IN_CLOSED_TRANS);;
e (EXISTS_TAC `S1:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "S1");;
e (REWRITE_TAC[CLOSED_HYPERPLANE]);;
e (NEW_GOAL `~(S2:real^3->bool = {})`);;
e (EXPAND_TAC "S2");;
e (REWRITE_TAC [SET_RULE `A DIFF B = {} <=> A SUBSET B`]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `S1 SUBSET S:real^3->bool`);;
e (NEW_GOAL `relative_interior S SUBSET S:real^3->bool`);;
e (REWRITE_TAC[RELATIVE_INTERIOR_SUBSET]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (NEW_GOAL `S1 = S:real^3->bool`);;
e (NEW_GOAL `S SUBSET S1:real^3->bool`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `INTERS {f x | x IN {a, b}} = f a INTER f b`]);;
e (EXPAND_TAC "S1");;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (NEW_GOAL `bounded (S1:real^3->bool)`);;
e (REWRITE_TAC[ASSUME `S1 = S:real^3->bool`]);;
e (DEL_TAC THEN EXPAND_TAC "S");;
e (MATCH_MP_TAC Packing3.BOUNDED_VORONOI_LIST);;
e (EXISTS_TAC `1`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `~bounded (S1:real^3->bool)`);;
e (EXPAND_TAC "S1");;
e (MATCH_MP_TAC UNBOUNDED_HYPERPLANE);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (u0 - u1) = vec 0 <=> u0 = u1`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (NEW_GOAL `?z:real^3. z IN S2 /\
(!w. w IN S2 ==> dist (u0,z) <= dist (u0,w))`);;
e (MATCH_MP_TAC DISTANCE_ATTAINS_INF);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
(* ======================================================================== *)
e (ABBREV_TAC `a = dist (p, u0:real^3) / dist (z, u0)`);;
e (NEW_GOAL `&0 < a /\ a < &1`);;
e (EXPAND_TAC "a");;
e (NEW_GOAL `~(u0:real^3 IN S1)`);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[IN; IN_ELIM_THM; NORM_POW_2]);;
e (REWRITE_TAC[REAL_ARITH `a = b - c <=> a + c - b = &0`]);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (u0 - u1) dot u0 + u1 dot u1 - u0 dot u0 =
(u0 - u1) dot (u0 - u1)`]);;
e (REWRITE_TAC[DOT_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> a = b`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `&0 < dist (p,u0:real^3)`);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (EXPAND_TAC "p" THEN REWRITE_TAC[Rogers.CIRCUMCENTER_2; midpoint]);;
e (REWRITE_TAC[VECTOR_ARITH `inv (&2) % (u0 + u1) = u0 <=> u0 = u1`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `&0 < dist (z,u0:real^3)`);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (STRIP_TAC);;
e (NEW_GOAL `z:real^3 IN S1`);;
e (ASM_SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH
`dist (p,u0) / dist (z,u0:real^3) < &1 <=> dist (p,u0) < &1 * dist (z,u0)`);;
e (ASM_SIMP_TAC[REAL_LT_LDIV_EQ]);;
e (REWRITE_TAC[REAL_MUL_LID]);;
e (MATCH_MP_TAC Tactics_jordan.REAL_POW_2_LT);;
e (REPEAT STRIP_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `norm (z - u0:real^3) pow 2 =
norm (p - u0) pow 2 + norm (z - p) pow 2`);;
e (MATCH_MP_TAC PYTHAGORAS);;
e (REWRITE_TAC[orthogonal]);;
e (REWRITE_WITH `p = circumcenter (set_of_list [u0;u1:real^3])`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (ONCE_REWRITE_TAC[DOT_SYM]);;
e (MATCH_MP_TAC Rogers.MHFTTZN4);;
e (EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `1`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ASSUME `voronoi_list V [u0; u1] = S`]);;
e (REWRITE_WITH `affine hull (S:real^3->bool) = S1`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (EXPAND_TAC "S");;
e (NEW_GOAL `affine hull S1 = S1:real^3->bool`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (ONCE_REWRITE_TAC[GSYM (ASSUME `affine hull S1 = S1:real^3->bool`)]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC AFF_DIM_EQ_AFFINE_HULL);;
e (STRIP_TAC);;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `INTERS {f x | x IN {a, b}} = f a INTER f b`]);;
e (DEL_TAC THEN EXPAND_TAC "S1");;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `aff_dim (S1:(real^3->bool)) = &(dimindex (:3)) - &1`);;
e (DEL_TAC THEN EXPAND_TAC "S1");;
e (MATCH_MP_TAC AFF_DIM_HYPERPLANE);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (s - t) = vec 0 <=> s = t`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[DIMINDEX_3]);;
e (REWRITE_WITH `aff_dim (voronoi_list V [u0;u1:real^3]) = &3 - &1`);;
e (MATCH_MP_TAC Packing3.AFF_DIM_VORONOI_LIST);;
e (ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[set_of_list]);;
e (NEW_GOAL `{u0, u1:real^3} SUBSET affine hull {u0, u1}`);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a < a + b <=> &0 < b`; NORM_POW_2; DOT_POS_LT]);;
e (REWRITE_TAC[VECTOR_ARITH `a - b = vec 0 <=> a = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `~(z:real^3 IN S2)`);;
e (REWRITE_TAC[ASSUME `z = p:real^3`]);;
e (EXPAND_TAC "S2");;
e (NEW_GOAL `p:real^3 IN relative_interior S`);;
e (ABBREV_TAC `B = V INTER ball (p:real^3, &8)`);;
e (ABBREV_TAC `A = B DIFF {u0, u1:real^3}`);;
e (NEW_GOAL `FINITE (A:real^3->bool)`);;
e (EXPAND_TAC "A");;
e (MATCH_MP_TAC FINITE_DIFF);;
e (EXPAND_TAC "B");;
e (MATCH_MP_TAC Packing3.KIUMVTC THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?y. dist (p,y:real^3) = &4`);;
e (MATCH_MP_TAC VECTOR_CHOOSE_DIST);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UNDISCH_TAC `saturated (V:real^3->bool)`);;
e (REWRITE_TAC[saturated] THEN STRIP_TAC);;
e (NEW_GOAL `?z. z IN V /\ dist (y:real^3, z) < &2`);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `z':real^3 IN A`);;
e (EXPAND_TAC "A" THEN EXPAND_TAC "B");;
e (REWRITE_TAC[IN_DIFF; IN_INTER; IN_BALL]);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `dist (p,z') <= dist (p, y) + dist (y, z':real^3)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `dist (p, y) <= dist (p, z') + dist (z', y:real^3)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DIST_SYM]);;
e (STRIP_TAC);;
e (NEW_GOAL `&2 < dist (z', p:real^3)`);;
e (ASM_REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DIST_SYM]);;
e (REWRITE_WITH `p = circumcenter (set_of_list [u0;u1:real^3])`);;
e (ASM_MESON_TAC[set_of_list]);;
e (NEW_GOAL `(!w. w IN set_of_list [u0;u1:real^3]
==> dist (circumcenter (set_of_list [u0;u1]),w) = hl [u0;u1])`);;
e (MATCH_MP_TAC Rogers.HL_PROPERTIES);;
e (EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `1`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `dist (circumcenter (set_of_list [u0; u1:real^3]),z') =
hl [u0; u1]`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (NEW_GOAL `sqrt (&2) <= &2`);;
e (MATCH_MP_TAC Tactics_jordan.REAL_POW_2_LE);;
e (SIMP_TAC[REAL_ARITH `&0 <= &2`; SQRT_POS_LE; SQRT_POW_2]);;
e (REAL_ARITH_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `?a:real^3. a IN A /\ (!x. x IN A ==> dist (p,a) <= dist (p,x))`);;
e (MATCH_MP_TAC Packing3.REAL_FINITE_ARGMIN);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `d = inv (&4) * (dist (p, a') - dist (p, u0:real^3))`);;
e (NEW_GOAL `&0 < d`);;
e (EXPAND_TAC "d");;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (STRIP_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 < a - b <=> a > b`]);;
e (ONCE_REWRITE_TAC[DIST_SYM]);;
e (NEW_GOAL `!u v. u IN {u0,u1} /\ v IN V DIFF {u0,u1} ==>
dist (v,p) > dist (u,p:real^3)`);;
e (MATCH_MP_TAC Rogers.XYOFCGX);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[AFFINE_INDEPENDENT_2]);;
e (ASM_MESON_TAC[set_of_list]);;
e (REWRITE_WITH `radV {u0, u1:real^3} = hl [u0;u1]`);;
e (REWRITE_TAC[HL;set_of_list]);;
e (ASM_REWRITE_TAC[]);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[relative_interior; IN; IN_ELIM_THM]);;
e (ABBREV_TAC `St = S INTER ball (p:real^3, d)`);;
e (EXISTS_TAC `St:real^3->bool`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[open_in]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `S SUBSET affine hull (S:real^3->bool)`);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (EXISTS_TAC `d - dist (p:real^3, x)`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 < a - b <=> b < a`]);;
e (REWRITE_TAC[GSYM IN_BALL]);;
e (ASM_SET_TAC[]);;
e (EXPAND_TAC "St");;
e (REWRITE_TAC[IN_INTER]);;
e (STRIP_TAC);;
e (NEW_GOAL `dist (x',x:real^3) < d`);;
e (NEW_GOAL `&0 <= dist (p,x:real^3)`);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `x' IN voronoi_closed V (u0:real^3)`);;
e (REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_CASES_TAC `w IN {u0, u1:real^3}`);;
e (ASM_CASES_TAC `w = u0:real^3`);;
e (REWRITE_TAC[ASSUME `w = u0:real^3`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `w = u1:real^3`);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[ASSUME `w = u1:real^3`]);;
e (MATCH_MP_TAC (REAL_ARITH `a = b ==> a <= b`));;
e (NEW_GOAL `x':real^3 IN S1`);;
e (NEW_GOAL `affine hull S SUBSET affine hull (S1:real^3->bool)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[GSYM
(ASSUME `voronoi_list V [u0; u1] = S`); VORONOI_LIST; VORONOI_SET;
set_of_list; SET_RULE `INTERS {f v | v IN {a, b}} = f a INTER f b`]);;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `x' IN S1 <=> x':real^3 IN affine hull S1`);;
e (REWRITE_WITH `affine hull S1 = S1:real^3->bool`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "S1" THEN REWRITE_TAC[IN_ELIM_THM; NORM_POW_2]);;
e (ONCE_REWRITE_TAC[REAL_ARITH `a = b <=> a - b = &0`]);;
e (REWRITE_TAC[
VECTOR_ARITH `&2 % (u0 - u1) dot x - (u0 dot u0 - u1 dot u1) =
(u1 - x) dot (u1 - x) - (u0 - x) dot (u0 - x)`]);;
e (REWRITE_TAC[REAL_ARITH `a - b = &0 <=> a = b`; GSYM NORM_POW_2; GSYM dist]);;
e (STRIP_TAC);;
e (REWRITE_TAC[DIST_EQ]);;
e (ONCE_REWRITE_TAC[DIST_SYM]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `dist (x', u0:real^3) <= dist (x', x) + dist (x, u0)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (NEW_GOAL `dist (x, u0:real^3) <= dist (x, p:real^3) + dist (p, u0)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (NEW_GOAL `dist (x,p:real^3) < d`);;
e (NEW_GOAL `x IN ball (p:real^3, d)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN_BALL]);;
e (REWRITE_TAC[DIST_SYM]);;
e (NEW_GOAL `dist (x',u0) < &2 * d + dist (p:real^3,u0)`);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `dist (p, w:real^3)- &2 * d <= dist (x',w)`);;
e (NEW_GOAL `dist (x, w:real^3) <= dist (x, x') + dist (x', w)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (NEW_GOAL `dist (p, w:real^3) <= dist (p, x) + dist (x, w)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (NEW_GOAL `dist (x, x':real^3) < d /\ dist (p, x:real^3) < d`);;
e (ONCE_REWRITE_TAC[DIST_SYM] THEN ASM_REWRITE_TAC[]);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `dist (p, u0) + &4 * d <= dist (p, w:real^3)`);;
e (EXPAND_TAC "d");;
e (REWRITE_TAC[REAL_ARITH `&4 * inv (&4) * a = a`]);;
e (REWRITE_TAC[REAL_ARITH `a + b - a = b`]);;
e (ASM_CASES_TAC `w:real^3 IN B`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `~(dist (p,w:real^3) < &8)`);;
e (REWRITE_TAC[GSYM IN_BALL]);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `dist (p,a':real^3) < &8`);;
e (REWRITE_TAC[GSYM IN_BALL]);;
e (ASM_SET_TAC[]);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `x' IN voronoi_closed V (u1:real^3)`);;
e (NEW_GOAL `x':real^3 IN S1`);;
e (NEW_GOAL `affine hull S SUBSET affine hull (S1:real^3->bool)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[GSYM
(ASSUME `voronoi_list V [u0; u1] = S`); VORONOI_LIST; VORONOI_SET;
set_of_list; SET_RULE `INTERS {f v | v IN {a, b}} = f a INTER f b`]);;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `x' IN S1 <=> x':real^3 IN affine hull S1`);;
e (REWRITE_WITH `affine hull S1 = S1:real^3->bool`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "S1" THEN REWRITE_TAC[IN_ELIM_THM; NORM_POW_2]);;
e (ONCE_REWRITE_TAC[REAL_ARITH `a = b <=> a - b = &0`]);;
e (REWRITE_TAC[
VECTOR_ARITH `&2 % (u0 - u1) dot x - (u0 dot u0 - u1 dot u1) =
(u1 - x) dot (u1 - x) - (u0 - x) dot (u0 - x)`]);;
e (REWRITE_TAC[REAL_ARITH `a - b = &0 <=> a = b`; GSYM NORM_POW_2; GSYM dist]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `x' IN voronoi_closed V (u0:real^3)`);;
e (REWRITE_TAC[voronoi_closed; IN_ELIM_THM; IN]);;
e (REPEAT STRIP_TAC);;
e (REWRITE_WITH `dist (x', u1)= dist (x', u0:real^3)`);;
e (ONCE_REWRITE_TAC[DIST_SYM]);;
e (ASM_REWRITE_TAC[DIST_EQ]);;
e (ASM_SIMP_TAC[]);;
e (REWRITE_TAC[GSYM
(ASSUME `voronoi_list V [u0; u1] = S`); VORONOI_LIST; VORONOI_SET;
set_of_list; SET_RULE `INTERS {f v | v IN {a, b}} = f a INTER f b`]);;
e (ASM_REWRITE_TAC[IN_INTER]);;
e (REWRITE_TAC[IN_BALL]);;
e (NEW_GOAL `dist (p,x':real^3) <= dist (p,x) + dist (x, x':real^3)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (NEW_GOAL `dist (x,x':real^3) = dist (x',x)`);;
e (REWRITE_TAC[DIST_SYM]);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_WITH `St p <=> p:real^3 IN St`);;
e (REWRITE_TAC[IN]);;
e (EXPAND_TAC "St" THEN REWRITE_TAC[IN_INTER; IN_BALL; DIST_REFL]);;
e (STRIP_TAC);;
e (REWRITE_WITH `p = omega_list V [u0; u1]`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH `p = circumcenter (set_of_list [u0;u1:real^3])`);;
e (ASM_MESON_TAC[set_of_list]);;
e (MATCH_MP_TAC Rogers.XNHPWAB1);;
e (EXISTS_TAC `1`);;
e (ASM_REWRITE_TAC[IN]);;
e (REWRITE_TAC[GSYM (ASSUME `voronoi_list V [u0;u1] = S`)]);;
e (MATCH_MP_TAC Packing3.OMEGA_LIST_IN_VORONOI_LIST);;
e (EXISTS_TAC `1` THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_MESON_TAC[]);;
(* ======================================================================== *)
e (NEW_GOAL `?b. &0 < b /\ b < &1 /\
rcone_gt u0 u1 b SUBSET aff_ge_alt {u0:real^3} S`);;
e (EXISTS_TAC `a:real`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[SET_RULE `A SUBSET B <=> (!x. ~(x IN B) ==> ~(x IN A))`]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `x:real^3 IN affine hull (u0 INSERT S)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[AFFINE_HULL_EXPLICIT_ALT; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ABBREV_TAC `h = sum (s DELETE u0:real^3) u`);;
e (NEW_GOAL `(x - u0) dot (u1 - u0:real^3) =
h * dist (p, u0) * dist (u1, u0:real^3)`);;
e (EXPAND_TAC "x");;
e (NEW_GOAL `u0 = vsum s (\v:real^3. (u:real^3->real) v % (u0:real^3))`);;
e (ASM_SIMP_TAC[VSUM_RMUL]);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_WITH `vsum (s:real^3->bool) (\v. u v % v) - u0:real^3 =
vsum s (\v. u v % v) - vsum s (\v:real^3. u v % u0)`);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `vsum s (\v. u v % v) - vsum s (\v:real^3. u v % u0:real^3) =
vsum s (\x. (\v. u v % v) x - (\v. u v % u0) x)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC VSUM_SUB);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ARITH `a % x - a % y = a % (x - y)`]);;
e (REWRITE_WITH `vsum s (\x:real^3. u x % (x - u0)) dot (u1 - u0) =
sum s (\x. (\x. u x % (x - u0)) x dot (u1 - u0:real^3))`);;
e (ASM_SIMP_TAC[DOT_LSUM]);;
e (REWRITE_TAC[DOT_LMUL]);;
e (REWRITE_WITH `sum s (\x:real^3. u x * ((x - u0) dot (u1 - u0:real^3))) =
sum (s DELETE u0) (\x. u x * (dist (p,u0) * dist (u1,u0)))`);;
e (ASM_CASES_TAC `u0:real^3 IN s`);;
e (NEW_GOAL `s = u0 INSERT (s DELETE u0:real^3)`);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `FINITE (s DELETE u0:real^3)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `s:real^3->bool` THEN ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (REWRITE_WITH `sum s (\x:real^3. u x * ((x - u0) dot (u1 - u0:real^3))) =
sum (u0 INSERT (s DELETE u0)) (\x. u x * ((x - u0) dot (u1 - u0)))`);;
e (ASM_MESON_TAC[]);;
e (ABBREV_TAC `f = (\x:real^3. u x * ((x - u0) dot (u1 - u0:real^3)))`);;
e (REWRITE_WITH `sum (u0:real^3 INSERT (s DELETE u0)) f =
(if u0 IN (s DELETE u0) then sum (s DELETE u0) f
else f u0 + sum (s DELETE u0) f)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.SUM_CLAUSES_alt);;
e (ASM_REWRITE_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (ASM_SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `f (u0:real^3) = &0`);;
e (EXPAND_TAC "f");;
e (REWRITE_TAC[VECTOR_ARITH `(u0 - u0) dot (u1 - u0) = &0`]);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 + a = a`]);;
e (MATCH_MP_TAC SUM_EQ);;
e (EXPAND_TAC "f");;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a * x = a * y * z <=> a * (x - y * z) = &0`]);;
e (NEW_GOAL `(x' - u0) dot (u1 - u0) - dist (p,u0) * dist (u1,u0:real^3) = &0`);;
e (REWRITE_TAC[REAL_ARITH `a - b = &0 <=> a = b`]);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `s DELETE u0:real^3 = s`);;
e (ASM_SET_TAC[]);;
e (MATCH_MP_TAC SUM_EQ);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a * x = a * y * z <=> a * (x - y * z) = &0`]);;
e (NEW_GOAL `(x' - u0) dot (u1 - u0) - dist (p,u0) * dist (u1,u0:real^3) = &0`);;
e (REWRITE_TAC[REAL_ARITH `a - b = &0 <=> a = b`]);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `FINITE (s DELETE u0:real^3)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `s:real^3->bool` THEN ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (ASM_SIMP_TAC[SUM_RMUL]);;
e (ASM_CASES_TAC `h <= &0`);;
e (NEW_GOAL `~(x IN rcone_gt u0 (u1:real^3) a)`);;
e (REWRITE_TAC[rcone_gt; rconesgn; IN; IN_ELIM_THM]);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (REAL_ARITH `&0 <= x /\ y <= &0 ==> ~(y > x)`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `a * b * c <= &0 <=> &0 <= b * c * (--a)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ABBREV_TAC `y = inv (h) % vsum (s DELETE u0) (\v:real^3. u v % v)`);;
e (NEW_GOAL `?t. t + h = &1 /\ x = t % u0 + h % (y:real^3)`);;
e (EXISTS_TAC `&1 - h`);;
e (STRIP_TAC);;
e (REAL_ARITH_TAC);;
e (ASM_CASES_TAC `u0:real^3 IN s`);;
e (REWRITE_TAC[GSYM (ASSUME `sum s (u:real^3->real) = &1`)]);;
e (EXPAND_TAC "h");;
e (REWRITE_WITH `sum s u = sum (u0 INSERT (s DELETE u0)) (u:real^3->real)`);;
e (REWRITE_WITH `(u0 INSERT (s DELETE u0:real^3)) = s`);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `FINITE (s DELETE u0:real^3)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `s:real^3->bool` THEN ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (SIMP_TAC[Marchal_cells_2_new.SUM_CLAUSES_alt;
ASSUME `FINITE (s DELETE u0:real^3)`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `(a + b:real) - b = a`]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "y");;
e (REWRITE_TAC[VECTOR_MUL_ASSOC]);;
e (REWRITE_WITH `h * inv h = &1`);;
e (NEW_GOAL `~(h = &0)`);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_SIMP_TAC[Trigonometry2.REAL_MUL_LRINV]);;
e (REWRITE_TAC[VECTOR_MUL_LID]);;
e (EXPAND_TAC "x");;
e (REWRITE_WITH `vsum s (\v. u v % v) =
vsum (u0 INSERT (s DELETE u0)) (\v:real^3. u v % v)`);;
e (REWRITE_WITH `(u0 INSERT (s DELETE u0:real^3)) = s`);;
e (ASM_SET_TAC[]);;
e (SIMP_TAC[Marchal_cells_2_new.VSUM_CLAUSES_alt;
ASSUME `FINITE (s DELETE u0:real^3)`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REFL_TAC);;
e (NEW_GOAL `h = &1`);;
e (EXPAND_TAC "h" THEN REWRITE_WITH `s DELETE u0:real^3 = s`);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "y" THEN REWRITE_TAC[ASSUME `h = &1`]);;
e (REWRITE_WITH `s DELETE u0:real^3 = s`);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[REAL_ARITH `inv (&1) = &1 /\ &1 - &1 = &0`]);;
e (VECTOR_ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `~(y:real^3 IN S)`);;
e (STRIP_TAC);;
e (NEW_GOAL `x IN aff_ge_alt {u0:real^3} S`);;
e (REWRITE_TAC[IN; aff_ge_alt; lin_combo]);;
e (ABBREV_TAC `f = (\v:real^3. if v = u0 then t
else if v = y then h else &0)`);;
e (EXISTS_TAC `f:real^3->real`);;
e (EXISTS_TAC `{y:real^3}`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[FINITE_SING]);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[SET_RULE `{a} UNION {b} = {a, b}`]);;
e (REWRITE_WITH `vsum {u0:real^3, y} (\v. f v % v) =
(\v. f v % v) u0 + (\v. f v % v) y`);;
e (MATCH_MP_TAC Geomdetail.VSUM_DIS2);;
e (STRIP_TAC);;
e (NEW_GOAL `~(u0:real^3 IN S)`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `v IN {a,b} <=> v = a \/ v = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `u0 IN voronoi_closed V (u1:real^3)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,u1) <= dist (u0,u0:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_REFL; REAL_ARITH `~(a <= b) <=> b < a`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `(f:real^3->real) u0 = t`);;
e (EXPAND_TAC "f");;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `F`);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `(f:real^3->real) y = h`);;
e (EXPAND_TAC "f");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `~(u0:real^3 IN S)`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `v IN {a,b} <=> v = a \/ v = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `u0 IN voronoi_closed V (u1:real^3)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,u1) <= dist (u0,u0:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_REFL; REAL_ARITH `~(a <= b) <=> b < a`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `F`);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "f");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `~({y:real^3} u0)`);;
e (REWRITE_WITH `~({y} u0) <=> ~(u0:real^3 IN {y})`);;
e (MESON_TAC[IN]);;
e (REWRITE_TAC[IN_SING]);;
e (STRIP_TAC);;
e (NEW_GOAL `~(u0:real^3 IN S)`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `v IN {a,b} <=> v = a \/ v = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `u0 IN voronoi_closed V (u1:real^3)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,u1) <= dist (u0,u0:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_REFL; REAL_ARITH `~(a <= b) <=> b < a`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (COND_CASES_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[SET_RULE `{a} UNION {b} = {a,b}`]);;
e (REWRITE_WITH `sum {u0:real^3, y} f = f u0 + f y`);;
e (MATCH_MP_TAC Geomdetail.SUM_DIS2);;
e (STRIP_TAC);;
e (NEW_GOAL `~(u0:real^3 IN S)`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `v IN {a,b} <=> v = a \/ v = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `u0 IN voronoi_closed V (u1:real^3)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,u1) <= dist (u0,u0:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_REFL; REAL_ARITH `~(a <= b) <=> b < a`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `(f:real^3->real) u0 = t`);;
e (EXPAND_TAC "f");;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `F`);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `(f:real^3->real) y = h`);;
e (EXPAND_TAC "f");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `~(u0:real^3 IN S)`);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `v IN {a,b} <=> v = a \/ v = b`]);;
e (STRIP_TAC);;
e (NEW_GOAL `u0 IN voronoi_closed V (u1:real^3)`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,u1) <= dist (u0,u0:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_REFL; REAL_ARITH `~(a <= b) <=> b < a`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `F`);;
e (ASM_MESON_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_MESON_TAC[]);;
e (NEW_GOAL `y:real^3 IN S2`);;
e (EXPAND_TAC "S2");;
e (NEW_GOAL `y:real^3 IN S1`);;
e (NEW_GOAL `y:real^3 IN affine hull S`);;
e (REWRITE_TAC[AFFINE_HULL_EXPLICIT_ALT]);;
e (REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `s DELETE u0:real^3`);;
e (EXISTS_TAC `(\v:real^3. inv h * u v)`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[FINITE_DELETE]);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[SUM_LMUL]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[Trigonometry2.REAL_MUL_LRINV;
REAL_ARITH `~(h <= &0) ==> ~(h = &0)`]);;
e (REWRITE_TAC[GSYM VECTOR_MUL_ASSOC]);;
e (ASM_SIMP_TAC[VSUM_LMUL; FINITE_DELETE]);;
e (NEW_GOAL `affine hull S1 = S1:real^3->bool`);;
e (REWRITE_TAC[AFFINE_HULL_EQ]);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[AFFINE_HYPERPLANE]);;
e (NEW_GOAL `affine hull S SUBSET affine hull (S1:real^3->bool)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.AFFINE_SUBSET_KY_LEMMA);;
e (EXPAND_TAC "S");;
e (REWRITE_TAC[VORONOI_LIST; VORONOI_SET; set_of_list;
SET_RULE `INTERS {f x | x IN {a, b}} = f a INTER f b`]);;
e (DEL_TAC THEN EXPAND_TAC "S1");;
e (MATCH_MP_TAC Pack2.INTER_VORONOI_SUBSET_BISECTOR);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `relative_interior S SUBSET S:real^3->bool`);;
e (REWRITE_TAC[RELATIVE_INTERIOR_SUBSET]);;
e (ASM_SET_TAC[]);;
e (NEW_GOAL `dist (z,u0) <= dist (y,u0:real^3)`);;
e (ONCE_REWRITE_TAC[DIST_SYM]);;
e (ASM_SIMP_TAC[]);;
e (UNDISCH_TAC `x:real^3 IN rcone_gt u0 u1 a`);;
e (REWRITE_TAC[rcone_gt; rconesgn; IN; IN_ELIM_THM]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `dist (t % u0 + h % y,u0) = h * dist (y, u0:real^3)`);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `(t % u0 + h % y:real^3) - u0 = (t % u0 + h % y) - (t + h) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `(t % u0 + h % y) - (t + h) % u0 = h % (y - u0)`]);;
e (REWRITE_TAC[NORM_MUL]);;
e (REWRITE_WITH `abs h = h`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `~(a > b) <=> a <= b`]);;
e (REWRITE_WITH `h * dist (p,u0:real^3) * dist (u1,u0) =
(h * dist (z,u0)) * dist (u1,u0) * a`);;
e (EXPAND_TAC "a");;
e (REWRITE_TAC[REAL_ARITH `(a * b) * c * d / b = (a * d * c) * (b / b)`]);;
e (REWRITE_WITH `dist (z,u0) / dist (z,u0:real^3) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[DIST_EQ_0]);;
e (STRIP_TAC);;
e (NEW_GOAL `~(u0:real^3 IN S1)`);;
e (EXPAND_TAC "S1" THEN REWRITE_TAC[IN; IN_ELIM_THM; NORM_POW_2]);;
e (REWRITE_TAC[REAL_ARITH `a = b - c <=> a + c - b = &0`]);;
e (REWRITE_TAC[VECTOR_ARITH `&2 % (u0 - u1) dot u0 + u1 dot u1 - u0 dot u0 =
(u0 - u1) dot (u0 - u1)`]);;
e (REWRITE_TAC[DOT_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> a = b`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `z:real^3 IN S1`);;
e (ASM_SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH
`(a * x) * b * c <= (a * y) * b * c <=> &0 <= a * b * c *(y - x)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
(* OK until here *)
(* ========================================================================= *)
e (ABBREV_TAC `W = aff_ge_alt {u0:real^3} S`);;
e (ABBREV_TAC `c = max b (hl[u0;u1:real^3] / sqrt (&2))`);;
e (NEW_GOAL `&0 < c /\ c < &1`);;
e (EXPAND_TAC "c" THEN REWRITE_TAC[REAL_LT_MAX]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "c" THEN REWRITE_TAC[REAL_MAX_LT]);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `hl [u0; u1:real^3] / sqrt (&2) < &1 <=>
hl [u0; u1] < &1 * sqrt (&2)`);;
e (MATCH_MP_TAC REAL_LT_LDIV_EQ);;
e (ASM_SIMP_TAC[SQRT_POS_LT; REAL_ARITH `&0 < &2`]);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `rcone_gt u0 u1 c SUBSET
W INTER (rcone_gt u0 u1 (hl [u0; u1:real^3] / sqrt (&2)))`);;
e (REWRITE_TAC[SUBSET_INTER]);;
e (STRIP_TAC);;
e (NEW_GOAL `rcone_gt (u0:real^3) u1 c SUBSET rcone_gt u0 u1 b`);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "c" THEN REAL_ARITH_TAC);;
e (ASM_SET_TAC[]);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "c" THEN REAL_ARITH_TAC);;
e (ABBREV_TAC `C = ball (u0:real^3,&1) INTER rcone_gt u0 u1 c`);;
e (NEW_GOAL `C SUBSET
UNIONS
{rogers V vl | vl | barV V 3 vl /\ truncate_simplex 1 vl = [u0; u1]}`);;
e (REWRITE_TAC[SUBSET]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `x IN ball (u0:real^3,&1) /\ x IN aff_ge_alt {u0} S`);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `(x:real^3) IN convex hull (u0 INSERT S)`);;
e (REWRITE_TAC[CONVEX_HULL_EXPLICIT; IN; IN_ELIM_THM]);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN; aff_ge_alt; lin_combo]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `{u0:real^3} UNION q`);;
e (EXISTS_TAC `f:real^3->real`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[SET_RULE `{a} UNION b = a INSERT b`; FINITE_INSERT]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SET_TAC[]);;
e (ASM_CASES_TAC `x':real^3 IN q`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[IN]);;
e (REWRITE_WITH `x' = u0:real^3`);;
e (NEW_GOAL `x' IN ({u0:real^3} UNION q)`);;
e (ASM_REWRITE_TAC[IN]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `&0 <= x <=> ~(x < &0)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `x IN ball (u0:real^3,&1)`);;
e (ASM_REWRITE_TAC[IN_BALL; SET_RULE `{u} UNION q = u INSERT (q DELETE u)`]);;
e (REWRITE_WITH `vsum (u0 INSERT (q DELETE u0:real^3)) (\v. f v % v) =
(if u0 IN (q DELETE u0) then vsum (q DELETE u0) (\v. f v % v)
else (\v. f v % v) u0 + vsum (q DELETE u0) (\v. f v % v))`);;
e (MATCH_MP_TAC Marchal_cells_2_new.VSUM_CLAUSES_alt);;
e (ASM_REWRITE_TAC[FINITE_DELETE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ONCE_REWRITE_TAC[DIST_SYM]);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `!a. a - u0 = a - (sum ({u0:real^3} UNION q) f) % u0`);;
e (ASM_REWRITE_TAC[]);;
e (VECTOR_ARITH_TAC);;
e (NEW_GOAL `sum ({u0} UNION q) f = f u0 + sum (q DELETE u0:real^3) f`);;
e (REWRITE_TAC[SET_RULE `{u} UNION q = u INSERT (q DELETE u)`]);;
e (REWRITE_WITH `sum (u0 INSERT (q DELETE u0:real^3)) f =
(if u0 IN (q DELETE u0) then sum (q DELETE u0) f
else f u0 + sum (q DELETE u0) f)`);;
e (MATCH_MP_TAC Marchal_cells_2_new.SUM_CLAUSES_alt);;
e (ASM_REWRITE_TAC[FINITE_DELETE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_MESON_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ADD_RDISTRIB;
VECTOR_ARITH `(a + b) - (a + c:real^3) = b - c`;
ASSUME `sum ({u0} UNION q) f = f u0 + sum (q DELETE u0:real^3) f`; ]);;
e (ABBREV_TAC `h = sum (q DELETE u0:real^3) f`);;
e (ABBREV_TAC `y = inv (h) % vsum (q DELETE u0) (\v:real^3. f v % v)`);;
e (NEW_GOAL `h > &1`);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_WITH `vsum (q DELETE u0) (\v. f v % v) = h % y:real^3`);;
e (EXPAND_TAC "y");;
e (REWRITE_TAC[VECTOR_MUL_ASSOC]);;
e (REWRITE_WITH `h * inv h = &1`);;
e (ASM_SIMP_TAC [Trigonometry2.REAL_MUL_LRINV; REAL_ARITH `h > &1 ==> ~(h = &0)`]);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `h % a - h % b = h % (a - b)`; NORM_MUL]);;
e (REWRITE_TAC[REAL_ARITH `~(a < b) <=> b <= a`]);;
e (NEW_GOAL `norm (p - u0) <= norm (y - u0:real^3)`);;
e (MATCH_MP_TAC Tactics_jordan.REAL_POW_2_LE);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (REWRITE_WITH
`norm (y - u0) pow 2 = norm (p - u0) pow 2 + norm (y - p:real^3) pow 2`);;
e (MATCH_MP_TAC PYTHAGORAS);;
e (REWRITE_TAC[orthogonal]);;
e (REWRITE_WITH `p = circumcenter (set_of_list [u0;u1:real^3])`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (ONCE_REWRITE_TAC[DOT_SYM]);;
e (MATCH_MP_TAC Rogers.MHFTTZN4);;
e (EXISTS_TAC `V:real^3->bool` THEN EXISTS_TAC `1`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[ASSUME `voronoi_list V [u0; u1] = S`]);;
e (REWRITE_TAC[AFFINE_HULL_EXPLICIT_ALT; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `q DELETE u0:real^3`);;
e (EXISTS_TAC `(\v:real^3. inv h * f v)`);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[FINITE_DELETE]);;
e (ASM_SET_TAC[]);;
e (ASM_REWRITE_TAC[SUM_LMUL]);;
e (ASM_SIMP_TAC [Trigonometry2.REAL_MUL_LRINV; REAL_ARITH `h > &1 ==> ~(h = &0)`]);;
e (REWRITE_TAC[GSYM VECTOR_MUL_ASSOC]);;
e (ASM_REWRITE_TAC[VSUM_LMUL]);;
e (REWRITE_TAC[set_of_list]);;
e (NEW_GOAL `{u0, u1:real^3} SUBSET affine hull {u0, u1}`);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (ASM_SET_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a <= a + b <=> &0 <= b`; NORM_POW_2; DOT_POS_LE]);;
e (NEW_GOAL `&1 <= norm (p - u0:real^3)`);;
e (EXPAND_TAC "p");;
e (REWRITE_TAC[CIRCUMCENTER_2; midpoint;
VECTOR_ARITH `inv (&2) % (u0 + u1) - u0 = inv (&2) % (u1 - u0)`;
NORM_MUL; REAL_ARITH `abs (inv(&2)) = inv (&2)`]);;
e (REWRITE_TAC[GSYM dist]);;
e (REWRITE_WITH `&1 = inv (&2) * &2`);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `inv (&2) * &2 <= inv (&2) * a <=> &2 <= a`]);;
e (MP_TAC (ASSUME `packing (V:real^3->bool)`));;
e (REWRITE_TAC[packing] THEN STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[] THEN ASM_SET_TAC[]);;
e (REWRITE_WITH `abs h = h`);;
e (ASM_REAL_ARITH_TAC);;
e (NEW_GOAL `h <= h * norm (y - u0:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `h <= h * a <=> &0 <= h * (a - &1)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `~(S:real^3->bool = {})`);;
e (STRIP_TAC);;
e (NEW_GOAL `~(aff_dim (u0:real^3 INSERT S) = &3)`);;
e (REWRITE_TAC[ASSUME `S:real^3->bool = {}`; AFF_DIM_SING]);;
e (ARITH_TAC);;
e (ASM_MESON_TAC[]);;
e (SWITCH_TAC);;
e (UP_ASM_TAC THEN SIMP_TAC[CONVEX_HULL_INSERT;
ASSUME `~(S:real^3->bool = {})`]);;
e (REWRITE_WITH `convex hull S = S:real^3->bool`);;
e (REWRITE_TAC[CONVEX_HULL_EQ]);;
e (EXPAND_TAC "S" THEN REWRITE_TAC[Packing3.CONVEX_VORONOI_LIST]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[IN_UNIONS; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `rogers V vl`);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[Marchal_cells_2.ROGERS_EXPLICIT]);;
e (REWRITE_TAC[CONVEX_HULL_4; IN_ELIM_THM]);;
e (UNDISCH_TAC `(t:real^3->bool) b'`);;
e (ASM_REWRITE_TAC[CONVEX_HULL_3; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `u:real`);;
e (EXISTS_TAC `v * u'`);;
e (EXISTS_TAC `v * v'`);;
e (EXISTS_TAC `v * w`);;
e (ASM_SIMP_TAC[REAL_LE_MUL]);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `u + v * u' + v * v' + v * w = u + v * (u' + v' +w)`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REAL_ARITH_TAC);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\ CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (VECTOR_ARITH_TAC);;
(* ========================================================================== *)
e (NEW_GOAL
`!X. mcell_set V X /\ ~NULLSET (X INTER C)
==> (?k vl.
2 <= k /\
barV V 3 vl /\
X = mcell k V vl /\
truncate_simplex 1 vl = [u0; u1])`);;
e (REWRITE_TAC[mcell_set_2; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `~NULLSET (X INTER UNIONS
{rogers V vl | vl | barV V 3 vl /\ truncate_simplex 1 vl = [u0; u1]})`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER C)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER
UNIONS
{rogers V vl | vl | barV V 3 vl /\ truncate_simplex 1 vl = [u0; u1]}`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[INTER_UNIONS]);;
e (STRIP_TAC);;
e (NEW_GOAL
`!s. ~NULLSET (UNIONS s) /\ FINITE s ==> (?t. t IN s /\ ~NULLSET t)`);;
e (MESON_TAC[NEGLIGIBLE_UNIONS]);;
e (ABBREV_TAC `St = {X INTER x | x IN
{rogers V vl | vl | barV V 3 vl /\
truncate_simplex 1 vl = [u0; u1]}}`);;
e (NEW_GOAL `?t. t IN St /\ ~NULLSET t`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "St");;
e (ABBREV_TAC `Sr = {rogers V vl | vl | barV V 3 vl /\
truncate_simplex 1 vl = [u0; u1]}`);;
e (ABBREV_TAC `f = (\x:real^3->bool. X INTER x)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y:real^3->bool | ?x:real^3->bool. x IN Sr /\ y = f x }`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (ABBREV_TAC `Ss = {vl | barV V 3 vl /\ truncate_simplex 1 vl = [u0; u1]}`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?vl. vl IN Ss /\ y = rogers V vl}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (ABBREV_TAC `Sx = V INTER ball (u0:real^3, &4)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?u0 u1 u2 u3:real^3.
u0 IN Sx /\
u1 IN Sx /\
u2 IN Sx /\
u3 IN Sx /\
y = [u0; u1; u2; u3]}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC Ajripqn.FINITE_SET_LIST_LEMMA);;
e (EXPAND_TAC "Sx");;
e (MATCH_MP_TAC Pack2.KIUMVTC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "Ss");;
e (REWRITE_TAC[SUBSET; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. x = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v0:real^3`);;
e (EXISTS_TAC `v1:real^3`);;
e (EXISTS_TAC `v2:real^3`);;
e (EXISTS_TAC `v3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `{v0, v1, v2, v3:real^3} SUBSET Sx`);;
e (EXPAND_TAC "Sx");;
e (REWRITE_TAC[SUBSET_INTER]);;
e (REWRITE_WITH `{v0, v1, v2, v3:real^3} = set_of_list x`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC Packing3.BARV_SUBSET);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `HD (truncate_simplex 1 x) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 x) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `x = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (REWRITE_WITH `u0 = v0:real^3`);;
e (ASM_MESON_TAC[]);;
e (REWRITE_TAC[set_of_list] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (EXPAND_TAC "Sr" THEN EXPAND_TAC "Ss");;
e (SET_TAC[]);;
e (REWRITE_WITH `{X INTER x:real^3->bool | x IN Sr} = {f x | x IN Sr}`);;
e (EXPAND_TAC "f");;
e (REFL_TAC);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "St" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `x SUBSET UNIONS {mcell i V vl | i <= 4}`);;
e (ASM_REWRITE_TAC[SUBSET; IN_UNIONS; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?i. i <= 4 /\ x' IN mcell i V vl`);;
e (MATCH_MP_TAC Sltstlo.SLTSTLO1);;
e (ASM_REWRITE_TAC[IN]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `mcell i' V vl`);;
e (STRIP_TAC);;
e (EXISTS_TAC `i':num` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN]);;
e (NEW_GOAL `~NULLSET (X INTER UNIONS {mcell i V vl | i <= 4})`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (t)`);;
e (REWRITE_TAC[ASSUME `t:real^3->bool = X INTER x`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER UNIONS {mcell i V vl | i <= 4}`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[INTER_UNIONS]);;
e (STRIP_TAC);;
e (NEW_GOAL
`!s. ~NULLSET (UNIONS s) /\ FINITE s ==> (?t. t IN s /\ ~NULLSET t)`);;
e (MESON_TAC[NEGLIGIBLE_UNIONS]);;
e (ABBREV_TAC `Sx = {X INTER x | x IN {mcell i V vl | i <= 4}}`);;
e (NEW_GOAL `?t. t IN Sx /\ ~NULLSET t`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "Sx");;
e (ABBREV_TAC `Sy = {mcell i V vl | i <= 4}`);;
e (ABBREV_TAC `f = (\x:real^3->bool. X INTER x)`);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y:real^3->bool | ?x:real^3->bool. x IN Sy /\ y = f x }`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (EXPAND_TAC "Sy");;
e (REWRITE_TAC[GSYM IN_NUMSEG_0]);;
e (ABBREV_TAC `g = (\i:num. mcell i V vl)`);;
e (REWRITE_WITH `{mcell i V vl | i IN 0..4} = {g i | i IN 0..4}`);;
e (EXPAND_TAC "g" THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y:real^3->bool | ?i. i IN 0..4 /\ y = g i}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (REWRITE_TAC[FINITE_NUMSEG]);;
e (SET_TAC[]);;
e (REWRITE_WITH `{X INTER x:real^3->bool | x IN Sy} = {f x | x IN Sy}`);;
e (EXPAND_TAC "f" THEN REWRITE_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Sx" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
(* ========================================================================= *)
e (NEW_GOAL `i = i' /\ mcell i V ul = mcell i' V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[GSYM Ajripqn.UP_TO_4_KY_LEMMA]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `ul IN barV V 3` THEN REWRITE_TAC[IN]);;
e (UNDISCH_TAC `~NULLSET t'`);;
e (ASM_REWRITE_TAC[]);;
e (EXISTS_TAC `i:num` THEN EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
(* ========================================================================= *)
e (ASM_CASES_TAC `i' = 0`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER C)`);;
e (REWRITE_TAC[]);;
e (REWRITE_WITH `X INTER C = {}:real^3->bool`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell0]);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\ CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `C SUBSET ball (u0:real^3, sqrt (&2))`);;
e (NEW_GOAL `ball (u0:real^3, &1) SUBSET ball (u0, sqrt (&2))`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (MATCH_MP_TAC (REAL_ARITH `a < b ==> a <= b`));;
e (REWRITE_TAC[Marchal_cells_2_new.ZERO_LT_SQRT_2]);;
e (ASM_SET_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (ASM_MESON_TAC[]);;
e (ASM_CASES_TAC `i' = 1`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER C)`);;
e (REWRITE_TAC[]);;
e (REWRITE_WITH `X INTER C = {}:real^3->bool`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell1]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 vl) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 vl) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `vl = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `vl = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (ASM_MESON_TAC[]);;
e (NEW_GOAL `C SUBSET (rcone_gt u0 u1 (hl [u0:real^3; u1] / sqrt (&2)))`);;
e (EXPAND_TAC "C");;
e (SET_TAC[ASSUME `rcone_gt u0 u1 c SUBSET
W INTER rcone_gt u0 u1 (hl [u0:real^3; u1] / sqrt (&2))`]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_ARITH_TAC);;
(* ========================================================================= *)
e (ABBREV_TAC `f1 =
(\ul. dist (u0:real^3,
closest_point (affine hull {u1, EL 2 ul, mxi V ul}) u0))`);;
e (ABBREV_TAC `P1 = { (f1:(real^3)list->real) ul |ul | barV V 3 ul /\
~NULLSET (mcell 3 V ul INTER C) /\
truncate_simplex 1 ul = [u0; u1]}`);;
e (NEW_GOAL `~(P1 = {}) ==> (?b:real. b IN P1 /\ (!x. x IN P1 ==> b <= x))`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC INF_FINITE_LEMMA);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P1");;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x | P x} = {f x | x IN {y | P y}}`]);;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x IN s} = {y | ?x. x IN s /\ y = f x}`]);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?v0:real^3 v1 u2 u3.
v0 IN (V INTER ball (u0:real^3, &4)) /\
v1 IN (V INTER ball (u0, &4)) /\
u2 IN (V INTER ball (u0, &4)) /\
u3 IN (V INTER ball (u0, &4)) /\
y = [v0; v1; u2; u3]}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_SET_LIST_LEMMA);;
e (ASM_SIMP_TAC[FINITE_PACK_LEMMA]);;
e (REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v0 v1 u2 u3. x = [v0; v1; u2; u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v0:real^3` THEN EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (x:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (x:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `set_of_list x SUBSET ball (u0:real^3,&4)`);;
e (MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (NEW_GOAL `set_of_list x SUBSET V:real^3->bool`);;
e (MATCH_MP_TAC Packing3.BARV_SUBSET);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (ABBREV_TAC `r1 = (if (P1 = {}:real->bool) then &1
else (@b. b IN P1 /\ (!x. x IN P1 ==> b <= x)))`);;
e (NEW_GOAL `&0 < r1`);;
e (EXPAND_TAC "r1");;
e (COND_CASES_TAC);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `?b:real. b IN P1 /\ (!x. x IN P1 ==> b <= x)`);;
e (ASM_SIMP_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `P = (\b:real. b IN P1 /\ (!x. x IN P1 ==> b <= x))`);;
e (ABBREV_TAC `zz = (@) (P:real->bool)`);;
e (NEW_GOAL `(P:real->bool) zz`);;
e (EXPAND_TAC "zz");;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b':real`);;
e (EXPAND_TAC "P" THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "P" THEN REWRITE_TAC[]);;
e (EXPAND_TAC "P1" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "f1");;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH `closest_point (affine hull {u1, EL 2 ul, mxi V ul}) u0 = u0
<=> u0 IN (affine hull {u1:real^3, EL 2 ul, mxi V ul})`);;
e (MATCH_MP_TAC CLOSEST_POINT_REFL);;
e (REWRITE_TAC[CLOSED_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_EQ_EMPTY] THEN SET_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 3 V ul INTER C)`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 3 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (REWRITE_TAC[MCELL_EXPLICIT; mcell3]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, mxi V [u0; u1; v2; v3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_WITH `affine hull {u0, u1, v2, mxi V [u0; u1; v2; v3]} =
affine hull {u1, v2, mxi V [u0; u1; v2; v3]}`);;
e (MATCH_MP_TAC AFFINE_HULL_3_INSERT);;
e (REWRITE_WITH `affine hull {u1, v2, mxi V [u0; u1; v2; v3]} =
affine hull {u1, EL 2 ul, mxi V ul}`);;
e (ASM_REWRITE_TAC[EL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`; HD; TL]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (ASM_MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
(* ========================================================================= *)
e (ABBREV_TAC `f2 =
(\ul. dist (u0:real^3,
closest_point (affine hull {u1, EL 2 ul, EL 3 ul}) u0))`);;
e (ABBREV_TAC `P2 = { (f2:(real^3)list->real) ul |ul | barV V 3 ul /\
~NULLSET (mcell 4 V ul INTER C) /\
truncate_simplex 1 ul = [u0; u1]}`);;
e (NEW_GOAL `~(P2 = {}) ==> (?b:real. b IN P2 /\ (!x. x IN P2 ==> b <= x))`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC INF_FINITE_LEMMA);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P2");;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x | P x} = {f x | x IN {y | P y}}`]);;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x IN s} = {y | ?x. x IN s /\ y = f x}`]);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?v0:real^3 v1 u2 u3.
v0 IN (V INTER ball (u0:real^3, &4)) /\
v1 IN (V INTER ball (u0, &4)) /\
u2 IN (V INTER ball (u0, &4)) /\
u3 IN (V INTER ball (u0, &4)) /\
y = [v0; v1; u2; u3]}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_SET_LIST_LEMMA);;
e (ASM_SIMP_TAC[FINITE_PACK_LEMMA]);;
e (REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v0 v1 u2 u3. x = [v0; v1; u2; u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v0:real^3` THEN EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (x:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (x:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `set_of_list x SUBSET ball (u0:real^3,&4)`);;
e (MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (NEW_GOAL `set_of_list x SUBSET V:real^3->bool`);;
e (MATCH_MP_TAC Packing3.BARV_SUBSET);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (ABBREV_TAC `r2 = (if (P2 = {}:real->bool) then &1
else (@b. b IN P2 /\ (!x. x IN P2 ==> b <= x)))`);;
e (NEW_GOAL `&0 < r2`);;
e (EXPAND_TAC "r2");;
e (COND_CASES_TAC);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `?b:real. b IN P2 /\ (!x. x IN P2 ==> b <= x)`);;
e (ASM_SIMP_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `P = (\b:real. b IN P2 /\ (!x. x IN P2 ==> b <= x))`);;
e (ABBREV_TAC `zz = (@) (P:real->bool)`);;
e (NEW_GOAL `(P:real->bool) zz`);;
e (EXPAND_TAC "zz");;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b':real`);;
e (EXPAND_TAC "P" THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "P" THEN REWRITE_TAC[]);;
e (EXPAND_TAC "P2" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "f2");;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH `closest_point (affine hull {u1, EL 2 ul, EL 3 ul}) u0 = u0
<=> u0 IN (affine hull {u1:real^3, EL 2 ul, EL 3 ul})`);;
e (MATCH_MP_TAC CLOSEST_POINT_REFL);;
e (REWRITE_TAC[CLOSED_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_EQ_EMPTY] THEN SET_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 4 V ul INTER C)`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 4 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_WITH `affine hull {u0, u1, v2, v3:real^3} =
affine hull {u1, v2, v3}`);;
e (MATCH_MP_TAC AFFINE_HULL_3_INSERT);;
e (REWRITE_WITH `affine hull {u1, v2, v3:real^3} =
affine hull {u1, EL 2 ul, EL 3 ul}`);;
e (ASM_REWRITE_TAC[EL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`; HD; TL]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
(* ========================================================================= *)
e (ABBREV_TAC `r = min (&1) (min r1 r2)`);;
e (NEW_GOAL `&0 < r`);;
e (EXPAND_TAC "r");;
e (UNDISCH_TAC `&0 < r1` THEN UNDISCH_TAC `&0 < r2` THEN REAL_ARITH_TAC);;
(* ========================================================================= *)
e (ABBREV_TAC `f3 =
(\ul. (((smallest_angle_line (EL 2 ul) (mxi V ul) u0 u1) - u0)
dot (u1 - u0)) /
(norm ((smallest_angle_line (EL 2 ul) (mxi V ul) u0 u1) - u0)
* norm (u1 - u0)))`);;
e (ABBREV_TAC `P3 = {(f3:(real^3)list->real) ul |ul | barV V 3 ul /\
~NULLSET (mcell 3 V ul INTER C) /\
truncate_simplex 1 ul = [u0; u1]}`);;
e (NEW_GOAL `~(P3 = {}) ==> (?b:real. b IN P3 /\ (!x. x IN P3 ==> x <= b))`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUP_FINITE_LEMMA);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P3");;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x | P x} = {f x | x IN {y | P y}}`]);;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x IN s} = {y | ?x. x IN s /\ y = f x}`]);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?v0:real^3 v1 u2 u3.
v0 IN (V INTER ball (u0:real^3, &4)) /\
v1 IN (V INTER ball (u0, &4)) /\
u2 IN (V INTER ball (u0, &4)) /\
u3 IN (V INTER ball (u0, &4)) /\
y = [v0; v1; u2; u3]}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_SET_LIST_LEMMA);;
e (ASM_SIMP_TAC[FINITE_PACK_LEMMA]);;
e (REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v0 v1 u2 u3. x = [v0; v1; u2; u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v0:real^3` THEN EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (x:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (x:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `set_of_list x SUBSET ball (u0:real^3,&4)`);;
e (MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (NEW_GOAL `set_of_list x SUBSET V:real^3->bool`);;
e (MATCH_MP_TAC Packing3.BARV_SUBSET);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (ABBREV_TAC `d1 = (if (P3 = {}:real->bool) then c
else (@b. b IN P3 /\ (!x. x IN P3 ==> x <= b)))`);;
e (NEW_GOAL `d1 < &1`);;
e (EXPAND_TAC "d1");;
e (COND_CASES_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?b:real. b IN P3 /\ (!x. x IN P3 ==> x <= b)`);;
e (ASM_SIMP_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `P = (\b:real. b IN P3 /\ (!x. x IN P3 ==> x <= b))`);;
e (ABBREV_TAC `zz = (@) (P:real->bool)`);;
e (NEW_GOAL `(P:real->bool) zz`);;
e (EXPAND_TAC "zz");;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b':real`);;
e (EXPAND_TAC "P" THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "P" THEN REWRITE_TAC[]);;
e (EXPAND_TAC "P3" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "f3");;
e (ABBREV_TAC `xx = smallest_angle_line (EL 2 ul) (mxi V ul) u0 u1`);;
e (MATCH_MP_TAC REAL_DIV_LT_1_TACTICS);;
e (STRIP_TAC);;
e (MATCH_MP_TAC (REAL_ARITH `&0 <= a /\ ~(a = &0) ==> &0 < a`));;
e (STRIP_TAC);;
e (SIMP_TAC[REAL_LE_MUL; NORM_POS_LE]);;
e (REWRITE_TAC[REAL_ENTIRE; NORM_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> a = b`]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "xx");;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN
REWRITE_TAC[smallest_angle_line; smallest_angle_set]);;
e (STRIP_TAC);;
e (ABBREV_TAC `Q = (\x:real^3. x IN convex hull {EL 2 ul, mxi V ul} /\
(!y. y IN convex hull {EL 2 ul, mxi V ul}
==> ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)) <=
((x - u0) dot (u1 - u0)) /
(norm (x - u0) * norm (u1 - u0))))`);;
e (NEW_GOAL `(Q:real^3->bool) u0`);;
e (REWRITE_TAC[ASSUME `u0 = (@) (Q:real^3->bool)`]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXPAND_TAC "Q");;
e (MATCH_MP_TAC SMALLEST_ANGLE_LINE_EXISTS);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v1 v2 v3. ul = [u0; v1; v2; v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (ul:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (ul:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[ASSUME `v0 = u0:real^3`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `EL 2 ul = v2:real^3`);;
e (ASM_REWRITE_TAC[EL;HD;TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 3 V ul INTER C)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 3 V ul` THEN STRIP_TAC);;
e (REWRITE_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; ASSUME `ul = [u0; v1; v2; v3:real^3]`;
SET_RULE `{a,b,c} UNION {d} = {a,b, c,d}`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, v1, v2, mxi V ul}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {v2, mxi V ul}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN
EXISTS_TAC `mxi V ul`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q");;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 3 V ul INTER C)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 3 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (REWRITE_TAC[MCELL_EXPLICIT; mcell3]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v2 v3. ul = [u0;u1;v2;v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0;v1;v2;v3:real^3]`]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_TAC[GSYM (ASSUME `u0 = (@) (Q:real^3->bool)`)]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, mxi V ul}`);;
e (REWRITE_TAC[ASSUME `ul = [u0; u1; v2; v3:real^3]`;
CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_WITH `affine hull {u0, u1, v2, mxi V [u0; u1; v2; v3]} =
affine hull {u1, v2, mxi V [u0; u1; v2; v3]}`);;
e (MATCH_MP_TAC AFFINE_HULL_3_INSERT);;
e (NEW_GOAL `convex hull {EL 2 ul, mxi V ul} SUBSET
affine hull {EL 2 ul, mxi V ul}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (NEW_GOAL `affine hull {EL 2 ul, mxi V ul} SUBSET
affine hull {u1, v2, mxi V [u0; u1; v2; v3]}`);;
e (MATCH_MP_TAC AFFINE_SUBSET_KY_LEMMA);;
e (ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN
UNDISCH_TAC `u0 IN convex hull {EL 2 ul, mxi V ul}` THEN SET_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (MATCH_MP_TAC (REAL_ARITH `(a <= b) /\ ~(a = b) ==> a < b`));;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ; NORM_CAUCHY_SCHWARZ_EQ]);;
e (NEW_GOAL `xx IN convex hull {(EL 2 ul) ,(mxi V ul)}`);;
e (MATCH_MP_TAC SMALLEST_ANGLE_IN_CONVEX_HULL);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v1 v2 v3. ul = [u0; v1; v2; v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (ul:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (ul:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[ASSUME `v0 = u0:real^3`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `EL 2 ul = v2:real^3`);;
e (ASM_REWRITE_TAC[EL;HD;TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 3 V ul INTER C)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 3 V ul` THEN STRIP_TAC);;
e (REWRITE_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; ASSUME `ul = [u0; v1; v2; v3:real^3]`;
SET_RULE `{a,b,c} UNION {d} = {a,b, c,d}`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, v1, v2, mxi V ul}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {v2, mxi V ul}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN
EXISTS_TAC `mxi V ul`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 3 V ul INTER C)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 3 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (REWRITE_TAC[MCELL_EXPLICIT; mcell3]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v2 v3. ul = [u0;u1;v2;v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, mxi V ul}`);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (ABBREV_TAC `m = mxi V ul`);;
e (NEW_GOAL `mxi V [u0; u1;v2;v3] = m`);;
e (EXPAND_TAC "m" THEN AP_TERM_TAC THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ABBREV_TAC `k1 = norm (xx - u0:real^3)`);;
e (ABBREV_TAC `k2 = norm (u1 - u0:real^3)`);;
e (UNDISCH_TAC `xx IN convex hull {EL 2 ul, m:real^3}`);;
e (ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `2 = SUC 1/\ 1 = SUC 0`;
CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (UNDISCH_TAC `k1 % (u1 - u0) = k2 % (xx - u0:real^3)`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (REWRITE_TAC[coplanar]);;
e (NEW_GOAL `~(k2 = &0)`);;
e (EXPAND_TAC "k2");;
e (REWRITE_TAC[NORM_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> b = a`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_CASES_TAC `~(v = &0)`);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3` THEN
EXISTS_TAC `v2:real^3`);;
e (MATCH_MP_TAC (SET_RULE `{a,b,c} SUBSET X /\ d IN X ==> {a,b,c,d} SUBSET X`));;
e (STRIP_TAC);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(k2 - k1:real) / (k2 * v)`);;
e (EXISTS_TAC `k1 / (k2 * v)`);;
e (EXISTS_TAC `(--k2 * u) / (k2 * v)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (REWRITE_WITH `k2 - k1 + k1 + --k2 * u = k2 * (u + v) - k1 + k1 + --k2 * u`);;
e (ASM_REWRITE_TAC[ARITH_RULE `SUC 0 = 1`] THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `k2 * (u + v) - k1 + k1 + --k2 * u = k2 * v`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ARITH `a / x % u0 + b / x % u1 + d / x % u2 =
(&1 / x) % (a % u0 + b % u1 + d % u2)`]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH
`&1 / (k2 * v) % ((k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2) = m:real^3 <=>
((k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2) = (k2 * v) % m`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2 = (k2 * v) % m <=>
k1 % (u1 - u0) = k2 % ((u % v2 + v % m) - u0)`]);;
e (NEW_GOAL `~(u = &0)`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `u + v = &(SUC 0):real` THEN
REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REAL_ARITH_TAC);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3` THEN
EXISTS_TAC `m:real^3`);;
e (MATCH_MP_TAC (SET_RULE `{a,b,c} SUBSET X /\ d IN X ==> {a,b,d,c} SUBSET X`));;
e (STRIP_TAC);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(k2 - k1:real) / (k2 * u)`);;
e (EXISTS_TAC `k1 / (k2 * u)`);;
e (EXISTS_TAC `(--k2 * v) / (k2 * u)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (REWRITE_WITH `k2 - k1 + k1 + --k2 * v = k2 * (u + v) - k1 + k1 + --k2 * v`);;
e (ASM_REWRITE_TAC[ARITH_RULE `SUC 0 = 1`] THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `k2 * (u + v) - k1 + k1 + --k2 * v = k2 * u`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ARITH `a / x % u0 + b / x % u1 + d / x % u2 =
(&1 / x) % (a % u0 + b % u1 + d % u2)`]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH
`&1 / (k2 * u) % ((k2 - k1) % u0 + k1 % u1 + (--k2 * v) % m) = v2:real^3 <=>
((k2 - k1) % u0 + k1 % u1 + (--k2 * v) % m) = (k2 * u) % v2`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(k2 - k1) % u0 + k1 % u1 + (--k2 * v) % m = (k2 * u) % v2 <=>
k1 % (u1 - u0) = k2 % ((u % v2 + v % m) - u0)`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
(* ========================================================================== *)
e (ABBREV_TAC `f4 =
(\ul. (((smallest_angle_line (EL 2 ul) (EL 3 ul) u0 u1) - u0)
dot (u1 - u0)) /
(norm ((smallest_angle_line (EL 2 ul) (EL 3 ul) u0 u1) - u0)
* norm (u1 - u0)))`);;
e (ABBREV_TAC `P4 = {(f4:(real^3)list->real) ul |ul | barV V 3 ul /\
~NULLSET (mcell 4 V ul INTER C) /\
truncate_simplex 1 ul = [u0; u1]}`);;
e (NEW_GOAL `~(P4 = {}) ==> (?b:real. b IN P4 /\ (!x. x IN P4 ==> x <= b))`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUP_FINITE_LEMMA);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P4");;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x | P x} = {f x | x IN {y | P y}}`]);;
e (ONCE_REWRITE_TAC [SET_RULE `{f x| x IN s} = {y | ?x. x IN s /\ y = f x}`]);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{y | ?v0:real^3 v1 u2 u3.
v0 IN (V INTER ball (u0:real^3, &4)) /\
v1 IN (V INTER ball (u0, &4)) /\
u2 IN (V INTER ball (u0, &4)) /\
u3 IN (V INTER ball (u0, &4)) /\
y = [v0; v1; u2; u3]}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_SET_LIST_LEMMA);;
e (ASM_SIMP_TAC[FINITE_PACK_LEMMA]);;
e (REWRITE_TAC[SUBSET] THEN ONCE_REWRITE_TAC[IN] THEN REWRITE_TAC[IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v0 v1 u2 u3. x = [v0; v1; u2; u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v0:real^3` THEN EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (x:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (x:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `set_of_list x SUBSET ball (u0:real^3,&4)`);;
e (MATCH_MP_TAC Qzyzmjc.BARV_3_IMP_FINITE_lemma2);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (NEW_GOAL `set_of_list x SUBSET V:real^3->bool`);;
e (MATCH_MP_TAC Packing3.BARV_SUBSET);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ASM_REWRITE_TAC[set_of_list]);;
e (SET_TAC[]);;
e (ABBREV_TAC `d2 = (if (P4 = {}:real->bool) then c
else (@b. b IN P4 /\ (!x. x IN P4 ==> x <= b)))`);;
e (NEW_GOAL `d2 < &1`);;
e (EXPAND_TAC "d2");;
e (COND_CASES_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?b:real. b IN P4 /\ (!x. x IN P4 ==> x <= b)`);;
e (ASM_SIMP_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `P = (\b:real. b IN P4 /\ (!x. x IN P4 ==> x <= b))`);;
e (ABBREV_TAC `zz = (@) (P:real->bool)`);;
e (NEW_GOAL `(P:real->bool) zz`);;
e (EXPAND_TAC "zz");;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b':real`);;
e (EXPAND_TAC "P" THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "P" THEN REWRITE_TAC[]);;
e (EXPAND_TAC "P4" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "f4");;
e (ABBREV_TAC `xx = smallest_angle_line (EL 2 ul) (EL 3 ul) u0 u1`);;
e (MATCH_MP_TAC REAL_DIV_LT_1_TACTICS);;
e (STRIP_TAC);;
e (MATCH_MP_TAC (REAL_ARITH `&0 <= a /\ ~(a = &0) ==> &0 < a`));;
e (STRIP_TAC);;
e (SIMP_TAC[REAL_LE_MUL; NORM_POS_LE]);;
e (REWRITE_TAC[REAL_ENTIRE; NORM_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> a = b`]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "xx");;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN
REWRITE_TAC[smallest_angle_line; smallest_angle_set]);;
e (STRIP_TAC);;
e (ABBREV_TAC `Q = (\x:real^3. x IN convex hull {EL 2 ul, EL 3 ul} /\
(!y. y IN convex hull {EL 2 ul, EL 3 ul}
==> ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)) <=
((x - u0) dot (u1 - u0)) /
(norm (x - u0) * norm (u1 - u0))))`);;
e (NEW_GOAL `(Q:real^3->bool) u0`);;
e (ONCE_ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXPAND_TAC "Q");;
e (MATCH_MP_TAC SMALLEST_ANGLE_LINE_EXISTS);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v1 v2 v3. ul = [u0; v1; v2; v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (ul:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (ul:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[ASSUME `v0 = u0:real^3`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `EL 2 ul = v2:real^3 /\ EL 3 ul = v3`);;
e (ASM_REWRITE_TAC[EL;HD;TL; ARITH_RULE `3 = SUC 2 /\2 = SUC 1 /\ 1 = SUC 0`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 4 V ul INTER C)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 4 V ul` THEN STRIP_TAC);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list;ARITH_RULE `4 >= 4`;
ASSUME `ul = [u0; v1; v2; v3:real^3]`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, v1, v2, v3:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN
EXISTS_TAC `v3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q");;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 4 V ul INTER C)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 4 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; ARITH_RULE `4 >= 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v2 v3. ul = [u0;u1;v2;v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (REWRITE_TAC[GSYM (ASSUME `u0 = (@) (Q:real^3->bool)`)]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_WITH `affine hull {u0, u1, v2, v3} =
affine hull {u1, v2, v3:real^3}`);;
e (MATCH_MP_TAC AFFINE_HULL_3_INSERT);;
e (NEW_GOAL `convex hull {EL 2 ul, (EL 3 ul):real^3} SUBSET
affine hull {EL 2 ul, EL 3 ul}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (NEW_GOAL `affine hull {EL 2 ul, (EL 3 ul):real^3} SUBSET
affine hull {u1, v2, v3}`);;
e (MATCH_MP_TAC AFFINE_SUBSET_KY_LEMMA);;
e (ASM_REWRITE_TAC[EL; HD; TL;
ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN
UNDISCH_TAC `u0 IN convex hull {EL 2 ul, (EL 3 ul):real^3}` THEN SET_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (MATCH_MP_TAC (REAL_ARITH `(a <= b) /\ ~(a = b) ==> a < b`));;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ; NORM_CAUCHY_SCHWARZ_EQ]);;
e (NEW_GOAL `xx IN convex hull {(EL 2 ul) ,(EL 3 ul):real^3}`);;
e (MATCH_MP_TAC SMALLEST_ANGLE_IN_CONVEX_HULL);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v1 v2 v3. ul = [u0; v1; v2; v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN
EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (NEW_GOAL `v0 = u0:real^3`);;
e (REWRITE_WITH `v0 = HD (ul:(real^3)list)`);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `u0 = HD (truncate_simplex 1 (ul:(real^3)list))`);;
e (ASM_REWRITE_TAC[HD]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[ASSUME `v0 = u0:real^3`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `EL 2 ul = v2:real^3 /\ EL 3 ul = v3`);;
e (ASM_REWRITE_TAC[EL;HD;TL; ARITH_RULE `3 = SUC 2 /\2 = SUC 1 /\ 1 = SUC 0`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 4 V ul INTER C)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 4 V ul` THEN STRIP_TAC);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list;ARITH_RULE `4 >= 4`;
ASSUME `ul = [u0; v1; v2; v3:real^3]`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, v1, v2, v3:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `v1:real^3` THEN EXISTS_TAC `v2:real^3` THEN
EXISTS_TAC `v3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (mcell 4 V ul INTER C)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `mcell 4 V ul`);;
e (REWRITE_TAC[SET_RULE `A INTER B SUBSET A`]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; ARITH_RULE `4 >= 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v2 v3. ul = [u0;u1;v2;v3:real^3]`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v2:real^3` THEN EXISTS_TAC `v3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `v0 = u0:real^3`);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = u0:real^3`);;
e (ASM_REWRITE_TAC[HD]);;
e (NEW_GOAL `HD (truncate_simplex 1 ul) = v0:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `v1 = u1:real^3`);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 ul)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, v2, v3:real^3}`);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ABBREV_TAC `k1 = norm (xx - u0:real^3)`);;
e (ABBREV_TAC `k2 = norm (u1 - u0:real^3)`);;
e (UNDISCH_TAC `xx IN convex hull {EL 2 ul,(EL 3 ul):real^3}`);;
e (ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1/\ 1 = SUC 0`;
CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (UNDISCH_TAC `k1 % (u1 - u0) = k2 % (xx - u0:real^3)`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (REWRITE_TAC[coplanar]);;
e (NEW_GOAL `~(k2 = &0)`);;
e (EXPAND_TAC "k2");;
e (REWRITE_TAC[NORM_EQ_0; VECTOR_ARITH `a - b = vec 0 <=> b = a`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_CASES_TAC `~(v = &0)`);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3` THEN
EXISTS_TAC `v2:real^3`);;
e (MATCH_MP_TAC (SET_RULE `{a,b,c} SUBSET X /\ d IN X ==> {a,b,c,d} SUBSET X`));;
e (STRIP_TAC);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(k2 - k1:real) / (k2 * v)`);;
e (EXISTS_TAC `k1 / (k2 * v)`);;
e (EXISTS_TAC `(--k2 * u) / (k2 * v)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (REWRITE_WITH `k2 - k1 + k1 + --k2 * u = k2 * (u + v) - k1 + k1 + --k2 * u`);;
e (ASM_REWRITE_TAC[ARITH_RULE `SUC 0 = 1`] THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `k2 * (u + v) - k1 + k1 + --k2 * u = k2 * v`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ARITH `a / x % u0 + b / x % u1 + d / x % u2 =
(&1 / x) % (a % u0 + b % u1 + d % u2)`]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH
`&1 / (k2 * v) % ((k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2) = v3:real^3 <=>
((k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2) = (k2 * v) % v3`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(k2 - k1) % u0 + k1 % u1 + (--k2 * u) % v2 = (k2 * v) % v3 <=>
k1 % (u1 - u0) = k2 % ((u % v2 + v % v3) - u0)`]);;
e (NEW_GOAL `~(u = &0)`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `u + v = &(SUC 0):real` THEN
REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REAL_ARITH_TAC);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3` THEN
EXISTS_TAC `v3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `{a,b,c} SUBSET X /\ d IN X ==> {a,b,d,c} SUBSET X`));;
e (STRIP_TAC);;
e (REWRITE_TAC[Qzksykg.SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(k2 - k1:real) / (k2 * u)`);;
e (EXISTS_TAC `k1 / (k2 * u)`);;
e (EXISTS_TAC `(--k2 * v) / (k2 * u)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (REWRITE_WITH `k2 - k1 + k1 + --k2 * v = k2 * (u + v) - k1 + k1 + --k2 * v`);;
e (ASM_REWRITE_TAC[ARITH_RULE `SUC 0 = 1`] THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `k2 * (u + v) - k1 + k1 + --k2 * v = k2 * u`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_ARITH `a / x % u0 + b / x % u1 + d / x % u2 =
(&1 / x) % (a % u0 + b % u1 + d % u2)`]);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_WITH
`&1 / (k2 * u) % ((k2 - k1) % u0 + k1 % u1 + (--k2 * v) % v3) = v2:real^3 <=>
((k2 - k1) % u0 + k1 % u1 + (--k2 * v) % v3) = (k2 * u) % v2`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (REWRITE_TAC[REAL_ENTIRE] THEN ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(k2 - k1) % u0 + k1 % u1 + (--k2 * v) % m = (k2 * u) % v2 <=>
k1 % (u1 - u0) = k2 % ((u % v2 + v % m) - u0)`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
(* ========================================================================== *)
e (ABBREV_TAC `d = max c (max d1 d2)`);;
e (NEW_GOAL `d < &1`);;
e (UNDISCH_TAC `d2 < &1` THEN UNDISCH_TAC `d1 < &1` THEN
UNDISCH_TAC `&0 < c /\ c < &1`);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
(* ========================================================================== *)
e (ABBREV_TAC `D = ball (u0:real^3,r) INTER rcone_gt u0 u1 d`);;
e (NEW_GOAL `D SUBSET C:real^3->bool`);;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (NEW_GOAL `!X. mcell_set V X /\ ~NULLSET (X INTER D)
==> (?k vl.
2 <= k /\
barV V 3 vl /\
X = mcell k V vl /\
truncate_simplex 1 vl = [u0; u1])`);;
e (REPEAT STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER C:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN UNDISCH_TAC `D SUBSET C:real^3->bool`);;
e (SET_TAC[]);;
(* ========================================================================= *)
e (NEW_GOAL `D = conic_cap (u0:real^3) u1 r d`);;
e (EXPAND_TAC "D" THEN REWRITE_TAC[conic_cap; NORMBALL_BALL]);;
e (NEW_GOAL `!X. mcell_set V X /\ ~NULLSET (X INTER D) ==>
vol (X INTER D) = vol (D) * (dihX V X (u0,u1)) / (&2 * pi)`);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?k vl.
2 <= k /\
barV V 3 vl /\
X = mcell k V vl /\
truncate_simplex 1 vl = [u0; u1]`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN REPEAT STRIP_TAC);;
(* ========================================================================= *)
(* Case k = 2 *)
(* ========================================================================= *)
e (ASM_CASES_TAC `k = 2`);;
e (ABBREV_TAC `m = mxi V vl`);;
e (ABBREV_TAC `s3 = omega_list_n V vl 3`);;
e (ABBREV_TAC `L = aff_ge{u0, u1} {m, s3:real^3}`);;
e (REWRITE_WITH `vol (X INTER D) = vol (L INTER D)`);;
e (AP_TERM_TAC);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2]);;
e (LET_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `HD vl = u0 /\ HD (TL vl) = u1:real^3`);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `vl = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC [SET_RULE `(A INTER B INTER C) INTER D = C INTER D
<=> (!x. x IN C INTER D ==> x IN A /\ x IN B)`]);;
e (REPEAT GEN_TAC THEN STRIP_TAC);;
e (NEW_GOAL `x:real^3 IN D`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `D = conic_cap (u0:real^3) u1 r d`);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "D" THEN STRIP_TAC);;
e (NEW_GOAL `x:real^3 IN rcone_gt u0 u1 a'`);;
e (NEW_GOAL `rcone_gt (u0:real^3) u1 d SUBSET rcone_gt u0 u1 c`);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`rcone_gt (u0:real^3) u1 c SUBSET W INTER rcone_gt u0 u1 a'`);;
e (SET_TAC[]);;
e (STRIP_TAC);;
e (UP_ASM_TAC THEN SET_TAC[RCONE_GT_SUBSET_RCONE_GE]);;
(* ========================================================================== *)
e (UP_ASM_TAC THEN REWRITE_TAC[rcone_ge; rconesgn; rcone_gt; IN; IN_ELIM_THM]);;
e (STRIP_TAC);;
e (ABBREV_TAC `y = u0 + proj_point (u1 - u0:real^3) (x - u0)`);;
e (NEW_GOAL `orthogonal (x - y) (u1 - u0:real^3)`);;
e (REWRITE_WITH `x - y = (x - u0) - proj_point (u1 - u0) (x - u0:real^3)`);;
e (EXPAND_TAC "y" THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[GSYM Marchal_cells_2_new.projection_proj_point]);;
e (REWRITE_TAC[orthogonal; Packing3.PROJECTION_ORTHOGONAL]);;
e (NEW_GOAL `norm (x - u0) pow 2 = norm (y - u0) pow 2 + norm (x - y:real^3) pow 2`);;
e (MATCH_MP_TAC PYTHAGORAS);;
e (REWRITE_TAC[orthogonal]);;
e (ONCE_REWRITE_TAC[VECTOR_ARITH `(a - b) dot c = --(c dot (b - a))`]);;
e (REWRITE_WITH `y - u0 = proj_point (u1 - u0) (x - u0:real^3)`);;
e (EXPAND_TAC "y" THEN REWRITE_TAC[VECTOR_ARITH `(a + b) - a:real^3 = b`]);;
e (REWRITE_TAC[PRO_EXP; DOT_RMUL]);;
e (UP_ASM_TAC THEN REWRITE_TAC[orthogonal] THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `norm (x - u1) pow 2 = norm (y - u1) pow 2 + norm (x - y:real^3) pow 2`);;
e (MATCH_MP_TAC PYTHAGORAS);;
e (REWRITE_TAC[orthogonal]);;
e (ONCE_REWRITE_TAC[VECTOR_ARITH `(a - b) dot c = c dot (a - b)`]);;
e (REWRITE_WITH `u1 - y = (u1 - u0) - proj_point (u1 - u0) (x - u0:real^3)`);;
e (EXPAND_TAC "y" THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[PRO_EXP; VECTOR_ARITH `x - a % x = (&1 - a) % x`]);;
e (REWRITE_TAC[DOT_RMUL] THEN DEL_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[orthogonal] THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (REAL_ARITH_TAC);;
e (MP_TAC (ASSUME `(x - u0:real^3) dot (u1 - u0) >
dist (x,u0) * dist (u1,u0) * a'`));;
e (REWRITE_WITH `(x - u0) dot (u1 - u0) =
(x - y) dot (u1 - u0) + (y - u0) dot (u1 - u0:real^3)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(x - u1) dot (u0 - u1) =
(x - y) dot (u0 - u1) + (y - u1) dot (u0 - u1:real^3)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(x - y) dot (u1 - u0:real^3) = &0`);;
e (ASM_REWRITE_TAC[GSYM orthogonal]);;
e (REWRITE_WITH `(x - y) dot (u0 - u1:real^3) = &0`);;
e (ONCE_REWRITE_TAC[VECTOR_ARITH `a dot (u0 - u1) = --(a dot (u1 - u0))`]);;
e (REWRITE_TAC[REAL_ARITH `--a = &0 <=> a = &0`]);;
e (ASM_REWRITE_TAC[GSYM orthogonal]);;
e (REWRITE_TAC[REAL_ARITH `&0 + a = a`]);;
e (STRIP_TAC);;
e (NEW_GOAL `(y - u0) dot (u1 - u0) = norm (y - u0) * norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ_EQ]);;
e (REWRITE_WITH `y - u0 = proj_point (u1 - u0) (x - u0:real^3)`);;
e (EXPAND_TAC "y" THEN REWRITE_TAC[VECTOR_ARITH `(a + b) - a:real^3 = b`]);;
e (REWRITE_TAC[PRO_EXP; NORM_MUL; VECTOR_MUL_ASSOC]);;
e (MATCH_MP_TAC (MESON[] `a = b ==> a % x = b % x`));;
e (REWRITE_TAC[REAL_ARITH `a * norm b = norm b * a`]);;
e (MATCH_MP_TAC (MESON[] `a = b ==> x * a = x * b`));;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (MATCH_MP_TAC REAL_LE_DIV);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (REWRITE_WITH `(x - u0) dot (u1 - u0) =
(x - y) dot (u1 - u0) + (y - u0) dot (u1 - u0:real^3)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(x - y) dot (u1 - u0:real^3) = &0`);;
e (ASM_REWRITE_TAC[GSYM orthogonal]);;
e (REWRITE_TAC[REAL_ARITH `&0 + a = a`]);;
e (NEW_GOAL `y IN convex hull {u0, u1:real^3}`);;
e (NEW_GOAL `y IN affine hull {u0, u1:real^3}`);;
e (REWRITE_TAC[AFFINE_HULL_2; IN; IN_ELIM_THM]);;
e (EXPAND_TAC "y" THEN REWRITE_TAC[PRO_EXP]);;
e (ABBREV_TAC `rtemp = ((x - u0) dot (u1 - u0)) / ((u1 - u0) dot (u1 -
u0:real^3))`);;
e (EXISTS_TAC `&1 - rtemp` THEN EXISTS_TAC `rtemp:real`);;
e (STRIP_TAC);;
e (REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN; AFFINE_HULL_2; CONVEX_HULL_2; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `y - u0 = v % (u1 - u0:real^3)`);;
e (NEW_GOAL `y - u0 = y - (u + v) % u0:real^3`);;
e (REWRITE_TAC[ASSUME `u + v = &1`; VECTOR_MUL_LID]);;
e (UP_ASM_TAC THEN REWRITE_WITH `y - (u + v) % u0 = v % (u1 - u0:real^3)`);;
e (REWRITE_TAC[ASSUME `y = u % u0 + v % u1:real^3`] THEN VECTOR_ARITH_TAC);;
e (ASM_CASES_TAC `u < &0`);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `norm (y - u0) <= norm (x - u0:real^3)`);;
e (MATCH_MP_TAC Tactics_jordan.REAL_POW_2_LE);;
e (REWRITE_TAC[NORM_POS_LE; ASSUME
`norm (x - u0:real^3) pow 2 = norm (y - u0) pow 2 + norm (x - y) pow 2`;
REAL_ARITH `a <= a + b <=> &0 <= b`; REAL_LE_POW_2]);;
e (NEW_GOAL `norm (x - u0:real^3) < &1`);;
e (REWRITE_TAC[GSYM dist] THEN ONCE_REWRITE_TAC[DIST_SYM] THEN
REWRITE_TAC[GSYM IN_BALL]);;
e (NEW_GOAL `ball (u0:real^3, r) SUBSET ball (u0, &1)`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC
`x IN ball (u0:real^3,r) INTER rcone_gt u0 u1 d` THEN SET_TAC[]);;
e (NEW_GOAL `norm (y - u0) = v * norm (u1:real^3 - u0)`);;
e (ASM_REWRITE_TAC[NORM_MUL]);;
e (REWRITE_WITH `abs v = v`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (UNDISCH_TAC `u + v = &1` THEN UNDISCH_TAC `u < &0` THEN REAL_ARITH_TAC);;
e (NEW_GOAL `&2 <= norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[GSYM dist]);;
e (UNDISCH_TAC `packing (V:real^3->bool)` THEN REWRITE_TAC[packing]);;
e (REPEAT STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[MESON[IN] `V x <=> x IN (V:real^3->bool)`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `v * &2 <= v * norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `a * b <= a * c <=> &0 <= a * (c - b)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (UNDISCH_TAC `u + v = &1` THEN UNDISCH_TAC `u < &0` THEN UP_ASM_TAC);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `&1 < v`);;
e (UNDISCH_TAC `u + v = &1` THEN UNDISCH_TAC `u < &0` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN
UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `v < &0`);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(y - u0) dot (u1 - u0:real^3) <= &0`);;
e (ASM_REWRITE_TAC[DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= (--a) * b`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `&0 <= dist (x,u0) * dist (u1,u0:real^3) * a'`);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (EXPAND_TAC "a'" THEN MATCH_MP_TAC REAL_LE_DIV);;
e (STRIP_TAC);;
e (REWRITE_TAC[HL_2]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE] THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC SQRT_POS_LE THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC
`(y - u0:real^3) dot (u1 - u0) > dist (x,u0) * dist (u1,u0) * a'`);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `&0 <= dist (x,u0) * dist (u1,u0:real^3) * a'`);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (EXPAND_TAC "a'" THEN MATCH_MP_TAC REAL_LE_DIV);;
e (STRIP_TAC);;
e (REWRITE_TAC[HL_2]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE] THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC SQRT_POS_LE THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `(y - u1) dot (u0 - u1) = norm (y - u1) * norm (u0 - u1:real^3)`);;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ_EQ]);;
e (REWRITE_WITH `y - u1 = proj_point (u1 - u0) (x - u0:real^3) - (u1 - u0)`);;
e (EXPAND_TAC "y" THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[PRO_EXP; VECTOR_ARITH `x % a - a = (x - &1) % a`; NORM_MUL;
VECTOR_MUL_ASSOC]);;
e (REWRITE_WITH `
(norm (u0 - u1) *
(((x - u0) dot (u1 - u0)) / ((u1 - u0) dot (u1 - u0)) - &1)) % (u1 - u0) =
(norm (u0 - u1:real^3) *
(&1 - ((x - u0) dot (u1 - u0)) / ((u1 - u0) dot (u1 - u0)))) % (u0 - u1)`);;
e (VECTOR_ARITH_TAC);;
e (MATCH_MP_TAC (MESON[] `a = b ==> a % x = b % x`));;
e (REWRITE_TAC[REAL_ARITH `a * norm b = norm b * a`]);;
e (REWRITE_TAC[NORM_ARITH `norm (a - b) = norm (b - a)`]);;
e (MATCH_MP_TAC (MESON[] `a = b ==> x * a = x * b`));;
e (REWRITE_TAC[REAL_ARITH `abs (x - &1) = abs (&1 - x)`]);;
e (REWRITE_TAC[REAL_ABS_REFL; REAL_ARITH `&0 <= a - b <=> b <= a`]);;
e (REWRITE_WITH `((x - u0) dot (u1 - u0)) / ((u1 - u0) dot (u1 - u0)) <= &1
<=> ((x - u0) dot (u1 - u0)) <= &1 * ((u1 - u0) dot (u1 - u0:real^3))`);;
e (MATCH_MP_TAC REAL_LE_LDIV_EQ);;
e (REWRITE_TAC[DOT_POS_LT; VECTOR_ARITH `a - b = vec 0 <=> b = a`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `(x - u0) dot (u1 - u0) <= norm (x - u0) * norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ]);;
e (NEW_GOAL `norm (x - u0) * norm (u1 - u0) <= &1 * norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE; REAL_ARITH `&0 <= a - b <=> b <= a`; GSYM dist]);;
e (MATCH_MP_TAC (REAL_ARITH `a < x ==> a <= x`));;
e (ONCE_REWRITE_TAC[DIST_SYM] THEN REWRITE_TAC[GSYM IN_BALL]);;
e (NEW_GOAL `ball (u0:real^3, r) SUBSET ball (u0, &1)`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC
`x IN ball (u0:real^3,r) INTER rcone_gt u0 u1 d` THEN SET_TAC[]);;
e (REWRITE_TAC[GSYM NORM_POW_2; REAL_ARITH `&1 * a pow 2 = a * a`]);;
e (NEW_GOAL `&1 * norm (u1 - u0) <= norm (u1 - u0) * norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `a * x <= b * x <=> &0 <= (b - a) * x`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE; REAL_ARITH `&0 <= a - b <=> b <= a`; GSYM dist]);;
e (MATCH_MP_TAC (REAL_ARITH `&2 <= x ==> &1 <= x`));;
e (UNDISCH_TAC `packing (V:real^3->bool)` THEN REWRITE_TAC[packing]);;
e (STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[MESON[IN] `V x <=> x IN (V:real^3->bool)`]);;
e (ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `(x - u0:real^3) dot (u1 - u0) <=
norm (x - u0) * norm (u1 - u0)` THEN
UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[dist]);;
e (REWRITE_TAC[REAL_ARITH `a * b >= x * b * c <=> &0 <= b * (a - x * c)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE; REAL_ARITH `&0 <= a - b <=> b <= a`]);;
e (MATCH_MP_TAC Tactics_jordan.REAL_POW_2_LE);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (EXPAND_TAC "a'" THEN MATCH_MP_TAC REAL_LE_DIV);;
e (STRIP_TAC);;
e (REWRITE_TAC[HL_2]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE] THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC SQRT_POS_LE THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[NORM_POS_LE; REAL_ARITH `(a * b) pow 2 = a pow 2 * b pow 2`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `(a + b) * x <= a <=> b * x <= (&1 - x) * a`]);;
e (UNDISCH_TAC `(y - u0) dot (u1 - u0) > dist (x,u0) * dist (u1,u0:real^3) * a'`);;
e (ASM_REWRITE_TAC[dist]);;
e (REWRITE_TAC[REAL_ARITH `a * b > x * b * c <=> &0 < b * (a - x * c)`]);;
e (REWRITE_TAC[REAL_MUL_POS_LT]);;
e (REWRITE_WITH `~(norm (u1 - u0:real^3) < &0 /\
norm (y - u0) - norm (x - u0) * a' < &0)`);;
e (NEW_GOAL `&0 <= norm (u1 - u0:real^3)`);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 < a - b <=> b < a`]);;
e (REWRITE_WITH `norm (x - u0) * a' < norm (y - u0:real^3) <=>
(norm (x - u0) * a') pow 2 < norm (y - u0) pow 2`);;
e (MATCH_MP_TAC Pack1.bp_bdt);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (EXPAND_TAC "a'" THEN MATCH_MP_TAC REAL_LE_DIV);;
e (STRIP_TAC);;
e (REWRITE_TAC[HL_2]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE] THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC SQRT_POS_LE THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (ASM_REWRITE_TAC[REAL_ARITH `(a * b) pow 2 = a pow 2 * b pow 2`]);;
e (REWRITE_TAC[REAL_ARITH `(a + b) * x < a <=> b * x < (&1 - x) * a`]);;
e (STRIP_TAC);;
e (NEW_GOAL `(&1 - a' pow 2) * norm (y - u0) pow 2 <=
(&1 - a' pow 2) * norm (y - u1:real^3) pow 2`);;
e (REWRITE_TAC[REAL_ARITH `a * x <= a * y <=> &0 <= a * (y - x)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 <= &1 - b <=> b <= &1 pow 2`]);;
e (REWRITE_WITH `a' pow 2 <= &1 pow 2 <=> a' <= &1`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.POW2_COND);;
e (REWRITE_TAC[REAL_ARITH `&0 <= &1`]);;
e (EXPAND_TAC "a'" THEN MATCH_MP_TAC REAL_LE_DIV);;
e (STRIP_TAC);;
e (REWRITE_TAC[HL_2]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE] THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC SQRT_POS_LE THEN REAL_ARITH_TAC);;
e (EXPAND_TAC "a'");;
e (MATCH_MP_TAC REAL_DIV_LE_1_TACTICS);;
e (ASM_SIMP_TAC[SQRT_POS_LT; REAL_ARITH `&0 < &2`]);;
e (UNDISCH_TAC `hl [u0; u1:real^3] < sqrt (&2)` THEN REAL_ARITH_TAC);;
e (NEW_GOAL `norm (x - u0) pow 2 <= norm (x - u1:real^3) pow 2`);;
e (REWRITE_WITH `norm (x - u0) pow 2 <= norm (x - u1:real^3) pow 2 <=>
norm (x - u0) <= norm (x - u1:real^3)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.POW2_COND);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (MATCH_MP_TAC (REAL_ARITH `&2 * x <= x + y ==> x <= y`));;
e (REWRITE_TAC[GSYM dist]);;
e (NEW_GOAL `dist (x, u0:real^3) < &1`);;
e (ONCE_REWRITE_TAC[DIST_SYM] THEN REWRITE_TAC[GSYM IN_BALL]);;
e (NEW_GOAL `ball (u0:real^3, r) SUBSET ball (u0, &1)`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC
`x IN ball (u0:real^3,r) INTER rcone_gt u0 u1 d` THEN SET_TAC[]);;
e (NEW_GOAL `&2 * dist (x, u0:real^3) < &2`);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `&2 <= dist (x, u0) + dist (x, u1:real^3)`);;
e (NEW_GOAL `&2 <= dist (u0, u1:real^3)`);;
e (UNDISCH_TAC `packing (V:real^3->bool)` THEN REWRITE_TAC[packing]);;
e (STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[MESON[IN] `V a <=> a:real^3 IN V`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `dist (u0, u1:real^3) <= dist (u0, x) + dist (x, u1)`);;
e (REWRITE_TAC[DIST_TRIANGLE]);;
e (UP_ASM_TAC THEN REWRITE_TAC[DIST_SYM]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER C:real^3->bool`);;
e (ASM_SIMP_TAC [SET_RULE `A SUBSET B ==> X INTER A SUBSET X INTER B`]);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2; SET_RULE `{} INTER s = {}`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (NEW_GOAL `~coplanar {u0, u1:real^3, m, s3}`);;
e (ONCE_REWRITE_TAC[GSYM COPLANAR_AFFINE_HULL_COPLANAR]);;
e (STRIP_TAC);;
e (NEW_GOAL `NULLSET X`);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, m, s3:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2]);;
e (COND_CASES_TAC);;
e (LET_TAC);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> M INTER N INTER A SUBSET B`));;
e (NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `HD vl = u0 /\ HD (TL vl) = u1:real^3`);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = u1:real^3`);;
e (ASM_REWRITE_TAC[HD; TL]);;
e (NEW_GOAL `HD (TL(truncate_simplex 1 vl)) = v1:real^3`);;
e (REWRITE_TAC[ASSUME `vl = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `{u0, u1, m, s3} = {u0, u1} UNION {m:real^3, s3}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (SET_TAC[]);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
(* ========================================================================= *)
e (ASM_CASES_TAC `azim u0 u1 m (s3:real^3) < pi`);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 m s3)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {m, s3} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {m, s3} =
aff_gt {u0, u1} {m, s3} UNION
UNIONS {aff_ge {u0, u1} ({m, s3} DELETE a) | a | a IN {m, s3}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, s3} = {u0, u1, s3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `s3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, s3} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({m, s3} DELETE a) | a | a IN {m, s3}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {m} UNION aff_ge {u0, u1:real^3} {s3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, m}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,m:real^3} = {u0,u1} UNION {m}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, s3}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,s3:real^3} = {u0,u1} UNION {s3}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, s3} = {u0, u1, s3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `s3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, s3} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 m s3) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 m s3 / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, m} /\ ~collinear {u0, u1, s3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `s3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 m s3 = dihV u0 u1 m s3`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `s3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(2, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `2 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] vl /\ LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 2 /\ mcell k' V ul = mcell 2 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 2 V vl = X`);;
e (SET_TAC[ASSUME `X = mcell k' V ul`;
ASSUME `X = mcell k V vl`; ASSUME `k = 2`]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu2]);;
e (REWRITE_WITH `omega_list_n V ul 3 = s3`);;
e (EXPAND_TAC "s3");;
e (NEW_GOAL `2 = 2 /\
(!k. 2 - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V vl k)`);;
e (MATCH_MP_TAC MCELL_ID_OMEGA_LIST_N);;
e (ASM_REWRITE_TAC[SET_RULE `2 IN {2,3,4}`]);;
e (REWRITE_TAC[GSYM (ASSUME `X = mcell k' V ul`); GSYM (ASSUME `k' = 2`)]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ARITH_TAC);;
e (REWRITE_WITH `mxi V ul = m`);;
e (EXPAND_TAC "m");;
e (MATCH_MP_TAC MCELL_ID_MXI);;
e (EXISTS_TAC `2` THEN EXISTS_TAC `2`);;
e (ASM_REWRITE_TAC[SET_RULE `2 IN {2,3}`]);;
e (STRIP_TAC);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `(HD ul):real^3 = HD (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (REWRITE_WITH `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[HD]);;
e (REWRITE_TAC[GSYM (ASSUME `X = mcell k' V ul`); GSYM (ASSUME `k' = 2`)]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `initial_sublist [u0; u1:real^3] ul /\ LENGTH [u0; u1] = 1 + 1`);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (REWRITE_WITH `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[EL; HD; ARITH_RULE `1 = SUC 0`; TL]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN MESON_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d /\ --(&1) < &0 ==> max d (--(&1)) = d`));;
e (REWRITE_TAC[REAL_NEG_LT0]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
(* OK here *)
e (ASM_CASES_TAC `azim u0 u1 s3 (m:real^3) < pi`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (STRIP_TAC);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 s3 m)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {s3, m} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {m, s3} =
aff_gt {u0, u1} {m, s3} UNION
UNIONS {aff_ge {u0, u1} ({m, s3} DELETE a) | a | a IN {m, s3}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, s3, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, s3, m} = {u0, u1, s3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `s3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, s3, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, s3, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({m, s3} DELETE a) | a | a IN {m, s3}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {m} UNION aff_ge {u0, u1:real^3} {s3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, m}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,m:real^3} = {u0,u1} UNION {m}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, s3}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,s3:real^3} = {u0,u1} UNION {s3}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, s3, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, s3, m} = {u0, u1, s3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `s3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, s3, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, s3, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 s3 m) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 s3 m / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, m} /\ ~collinear {u0, u1, s3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `s3:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 s3 m = dihV u0 u1 s3 m`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `s3:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(2, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `2 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] vl /\ LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `?v0 v1 v2 v3. vl = [v0;v1;v2;v3:real^3]`);;
e (MATCH_MP_TAC Marchal_cells.BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 2 /\ mcell k' V ul = mcell 2 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 2 V vl = X`);;
e (REWRITE_TAC[ASSUME `X = mcell k V vl`; GSYM (ASSUME `X = mcell k' V ul`);
ASSUME `k = 2`]);;
e (SET_TAC[]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UNDISCH_TAC `~NULLSET X` THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu2]);;
e (REWRITE_WITH `omega_list_n V ul 3 = s3`);;
e (EXPAND_TAC "s3");;
e (NEW_GOAL `2 = 2 /\
(!k. 2 - 1 <= k /\ k <= 3
==> omega_list_n V ul k = omega_list_n V vl k)`);;
e (MATCH_MP_TAC MCELL_ID_OMEGA_LIST_N);;
e (ASM_REWRITE_TAC[SET_RULE `2 IN {2,3,4}`]);;
e (STRIP_TAC);;
e (MESON_TAC[ASSUME `X = mcell k V vl`; ASSUME `X = mcell k' V ul`;
ASSUME `k = 2`; ASSUME `k' = 2`]);;
e (REWRITE_WITH `mcell 2 V ul = X`);;
e (MESON_TAC[ASSUME `X = mcell k' V ul`; ASSUME `k' = 2`]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ARITH_TAC);;
e (REWRITE_WITH `mxi V ul = m`);;
e (EXPAND_TAC "m");;
e (MATCH_MP_TAC MCELL_ID_MXI);;
e (EXISTS_TAC `2` THEN EXISTS_TAC `2`);;
e (ASM_REWRITE_TAC[SET_RULE `2 IN {2,3}`]);;
e (STRIP_TAC);;
e (REWRITE_WITH `(HD vl):real^3 = HD (truncate_simplex 1 vl)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (vl:(real^3)list) = 3 + 1 /\
CARD (set_of_list vl) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `(HD ul):real^3 = HD (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (REWRITE_WITH `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (REWRITE_TAC[HD]);;
e (STRIP_TAC);;
e (MESON_TAC[ASSUME `X = mcell k V vl`; ASSUME `X = mcell k' V ul`;
ASSUME `k = 2`; ASSUME `k' = 2`]);;
e (REWRITE_WITH `mcell 2 V ul = X`);;
e (MESON_TAC[ASSUME `X = mcell k' V ul`; ASSUME `k' = 2`]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `initial_sublist [u0; u1:real^3] ul /\ LENGTH [u0; u1] = 1 + 1`);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (REWRITE_WITH `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[EL; HD; ARITH_RULE `1 = SUC 0`; TL]);;
e (REWRITE_TAC[DIHV_SYM_2]);;
e (REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `d < &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `&0 < r` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d ==> max d (--(&1)) = d`));;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================== *)
e (NEW_GOAL `F`);;
e (NEW_GOAL `azim (u0:real^3) u1 s3 m =
(if azim u0 u1 m s3 = &0 then &0 else &2 * pi - azim u0 u1 m s3)`);;
e (MATCH_MP_TAC AZIM_COMPL);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `s3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b, d, c}`]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(&0 < pi)`);;
e (REWRITE_TAC[PI_POS]);;
e (UNDISCH_TAC `~(azim (u0:real^3) u1 m s3 < pi)`);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `azim (u0:real^3) u1 m s3 = pi`);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, s3:real^3}`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC AZIM_EQ_0_PI_IMP_COPLANAR);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
(* Case k >= 4 *)
(* ========================================================================= *)
e (ASM_CASES_TAC `k >= 4`);;
e (NEW_GOAL `?u2 u3. vl = [u0; u1;u2;u3:real^3]`);;
e (NEW_GOAL `?v0 v1 u2 u3. vl = [v0; v1;u2;u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (REWRITE_WITH `u0 = v0:real^3`);;
e (REWRITE_WITH `v0:real^3 = HD (truncate_simplex 1 vl)`);;
e (REWRITE_TAC[ASSUME `vl = [v0;v1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (REWRITE_WITH `u1 = v1:real^3`);;
e (REWRITE_WITH `v1:real^3 = HD (TL (truncate_simplex 1 vl))`);;
e (REWRITE_TAC[ASSUME `vl = [v0;v1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `L = aff_ge{u0, u1} {u2, u3:real^3}`);;
e (REWRITE_WITH `vol (X INTER D) = vol (L INTER D)`);;
e (AP_TERM_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4; ARITH_RULE `4 >= 4`;set_of_list]);;
e (COND_CASES_TAC);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `A = B <=> A SUBSET B /\ B SUBSET A`]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> A INTER X SUBSET B INTER X`));;
e (REWRITE_TAC[Marchal_cells_2.CONVEX_HULL_4_SUBSET_AFF_GE_2_2]);;
e (MATCH_MP_TAC (SET_RULE `(!x. x IN A /\ x IN B ==> x IN C) ==>
A INTER B SUBSET C INTER B`));;
e (NEW_GOAL `DISJOINT {u0,u1:real^3} {u2, u3}`);;
e (REWRITE_TAC[DISJOINT]);;
e (MATCH_MP_TAC (MESON[] `(~A:bool ==> F) ==> A`));;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN REWRITE_TAC[SET_RULE `A INTER X SUBSET A`]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (NEW_GOAL `u3 IN {u0, u1:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (SIMP_TAC[ASSUME `DISJOINT {u0, u1} {u2, u3:real^3}`; AFF_GE_2_2]);;
e (REWRITE_TAC[CONVEX_HULL_4; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `t1:real` THEN EXISTS_TAC `t2:real` THEN
EXISTS_TAC `t3:real` THEN EXISTS_TAC `t4:real`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 <= a <=> (a < &0 ==> F)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `conic_cap (u0:real^3) u1 r d x`);;
e (REWRITE_TAC[MESON[IN] `conic_cap u0 u1 r d x <=> x IN conic_cap u0 u1 r d`;
GSYM (ASSUME `D = conic_cap (u0:real^3) u1 r d`)]);;
e (EXPAND_TAC "D");;
e (REWRITE_TAC[IN_INTER; MESON[] `~(x:bool /\ y) <=> (~x \/ ~y)`]);;
e (DISJ1_TAC);;
e (REWRITE_TAC[IN_BALL] THEN STRIP_TAC);;
e (NEW_GOAL `(?b1:real. b1 IN P2 /\ (!x. x IN P2 ==> b1 <= x))`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f2:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P2" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (FIRST_X_ASSUM CHOOSE_TAC);;
e (NEW_GOAL `r2 = (@b. b IN P2 /\ (!x. x IN P2 ==> b <= x:real))`);;
e (EXPAND_TAC "r2");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f2:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P2" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[]);;
e (ABBREV_TAC `Q1 = (\b:real. b IN P2 /\ (!x. x IN P2 ==> b <= x))`);;
e (NEW_GOAL `(Q1:real->bool) r2`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b1:real` THEN EXPAND_TAC "Q1");;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q1" THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `r2 <= f2 (vl:(real^3)list)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P2" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN EXPAND_TAC "f2" THEN REWRITE_TAC[EL; HD; TL;
ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `vl= [u0; u1; u2; u3:real^3]`] THEN STRIP_TAC);;
e (NEW_GOAL `!v. v IN affine hull {u1, u2, u3:real^3} ==> r2 <= dist (u0, v)`);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,closest_point (affine hull {u1, u2, u3}) u0) <=
dist (u0, v:real^3)`);;
e (MATCH_MP_TAC CLOSEST_POINT_LE);;
e (ASM_REWRITE_TAC[CLOSED_AFFINE_HULL]);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `r <= dist (u0:real^3, x)`);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `u0:real^3 - x = (t1 + t2 + t3 + t4) % u0 - x`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ADD_RDISTRIB]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH `(t1 % u0 + t2 % u0 + t3 % u0 + t4 % u0) -
(t1 % u0 + t2 % u1 + t3 % u2 + t4 % u3) =
(t2 + t3 + t4) % u0 - (t2 % u1 + t3 % u2 + t4 % u3)`]);;
e (ABBREV_TAC `y:real^3 = t2 /(t2 + t3 + t4) % u1 +
t3 /(t2 + t3 + t4) % u2 +
t4 /(t2 + t3 + t4) % u3`);;
e (REWRITE_WITH `(t2 % u1 + t3 % u2 + t4 % u3) = (t2 + t3 + t4) % (y:real^3)`);;
e (EXPAND_TAC "y");;
e (REWRITE_TAC[VECTOR_ARITH `x % (t2 / x % u1 + t3 / x % u2 + t4 / x % u3) =
(x / x) % (t2 % u1 + t3 % u2 + t4 % u3)`]);;
e (REWRITE_WITH `(t2 + t3 + t4) / (t2 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t1 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`);;
e (REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `a % x - a % y = a % (x - y)`; NORM_MUL]);;
e (NEW_GOAL `&1 < t2 + t3 + t4`);;
e (UNDISCH_TAC `t1 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `abs (t2 + t3 + t4) = t2 + t3 + t4`);;
e (REWRITE_TAC[REAL_ABS_REFL] THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[GSYM dist]);;
e (NEW_GOAL `r2 <= dist (u0, y:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `t2 / (t2 + t3 + t4)` THEN EXISTS_TAC `t3 / (t2 + t3 + t4)` THEN
EXISTS_TAC `t4 / (t2 + t3 + t4)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `r2 <= (t2 + t3 + t4) * dist (u0,y:real^3)`);;
e (NEW_GOAL `dist (u0,y) <= (t2 + t3 + t4) * dist (u0,y:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `a <= b * a <=> &0 <= (b - &1) * a`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (DEL_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (EXPAND_TAC "r" THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `dist (u0, x:real^3) < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
(* ========================================================================== *)
e (REWRITE_TAC[REAL_ARITH `&0 <= a <=> (a < &0 ==> F)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `conic_cap (u0:real^3) u1 r d x`);;
e (REWRITE_TAC[MESON[IN] `conic_cap u0 u1 r d x <=> x IN conic_cap u0 u1 r d`;
GSYM (ASSUME `D = conic_cap (u0:real^3) u1 r d`)]);;
e (EXPAND_TAC "D");;
e (REWRITE_TAC[IN_INTER; MESON[] `~(x:bool /\ y) <=> (~x \/ ~y)`]);;
e (DISJ2_TAC);;
e (REWRITE_TAC[IN; IN_ELIM_THM; rcone_gt; rconesgn] THEN STRIP_TAC);;
e (NEW_GOAL `(?b1:real. b1 IN P4 /\ (!x. x IN P4 ==> x <= b1))`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f4:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P4" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (FIRST_X_ASSUM CHOOSE_TAC);;
e (NEW_GOAL `d2 = (@b. b IN P4 /\ (!x. x IN P4 ==> x <= b:real))`);;
e (EXPAND_TAC "d2");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f4:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P4" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[]);;
e (ABBREV_TAC `Q1 = (\b:real. b IN P4 /\ (!x. x IN P4 ==> x <= b))`);;
e (NEW_GOAL `(Q1:real->bool) d2`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b1:real` THEN EXPAND_TAC "Q1");;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q1" THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `f4 (vl:(real^3)list) <= d2`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P4" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 4 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN EXPAND_TAC "f4");;
e (REWRITE_TAC[EL; HD; TL;
ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `vl= [u0; u1; u2; u3:real^3]`] THEN STRIP_TAC);;
e (ABBREV_TAC `xx = smallest_angle_line u2 u3 u0 u1`);;
e (MP_TAC (ASSUME `smallest_angle_line u2 u3 u0 u1 = xx`));;
e (REWRITE_TAC[smallest_angle_line; smallest_angle_set]);;
e (ABBREV_TAC `Q2 =
(\x:real^3. x IN convex hull {u2, u3} /\
(!y. y IN convex hull {u2, u3}
==> ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)) <=
((x - u0) dot (u1 - u0)) /
(norm (x - u0) * norm (u1 - u0))))`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN STRIP_TAC);;
e (NEW_GOAL `(Q2:real^3->bool) xx`);;
e (ONCE_ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXPAND_TAC "Q2");;
e (MATCH_MP_TAC SMALLEST_ANGLE_LINE_EXISTS);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list;ARITH_RULE `4 >= 4`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q2");;
e (STRIP_TAC);;
e (ABBREV_TAC `g = (\y:real^3. ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)))`);;
e (NEW_GOAL `d < (g:real^3->real) x`);;
e (EXPAND_TAC "g");;
e (REWRITE_WITH
`d < ((x - u0) dot (u1 - u0)) / (norm (x - u0) * norm (u1 - u0:real^3)) <=>
d * (norm (x - u0) * norm (u1 - u0)) < (x - u0) dot (u1 - u0)`);;
e (MATCH_MP_TAC REAL_LT_RDIV_EQ);;
e (MATCH_MP_TAC (REAL_ARITH `&0 <= a /\ ~(a = &0) ==> &0 < a`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LE]);;
e (REWRITE_TAC[REAL_ENTIRE; NORM_EQ_0; VECTOR_ARITH `x - y = vec 0 <=> x = y`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `t1 % u0 + t2 % u1 + t3 % u2 + t4 % u3 = u0:real^3 <=>
t1 % u0 + t2 % u1 + t3 % u2 + t4 % u3 = (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `t1 % u0 + u = (t1 + t2) % u0 <=> u = t2 % u0`]);;
e (STRIP_TAC);;
e (MP_TAC (ASSUME `~NULLSET (X INTER D)`) THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4;set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (REWRITE_TAC[affine_dependent]);;
e (EXISTS_TAC `u1:real^3`);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (NEW_GOAL `~(u1 IN {u0, u2, u3:real^3})`);;
e (STRIP_TAC);;
e (MP_TAC (ASSUME `~NULLSET (X INTER D)`) THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4;set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0:real^3,u2, u3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (SET_TAC[]);;
e (REWRITE_WITH `{u0, u1, u2, u3} DELETE u1 = {u0, u2, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(t2 + t3 + t4) / t2`);;
e (EXISTS_TAC `(-- t3) / t2`);;
e (EXISTS_TAC `(-- t4) / t2`);;
e (STRIP_TAC);;
e (REWRITE_WITH `(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`);;
e (REAL_ARITH_TAC);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`u1 = (t2 + t3 + t4) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % u3:real^3 <=>
u1 = (&1 / t2) % ((t2 + t3 + t4) % u0 - t3 % u2 - t4 % u3)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[GSYM (ASSUME `t2 % u1 + t3 % u2 + t4 % u3 =
(t2 + t3 + t4) % u0:real^3`)]);;
e (REWRITE_TAC[VECTOR_ARITH
`(t2 % u1 + t3 % u2 + t4 % u3) - t3 % u2 - t4 % u3 = t2 % u1`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC]);;
e (REWRITE_WITH `&1 / t2 * t2 = &1`);;
e (REWRITE_TAC[REAL_ARITH `&1 / t2 * t2 = t2 / t2`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a * b * c < d <=> d > b * c * a`; GSYM dist]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `g x <= (g:real^3->real) xx`);;
e (NEW_GOAL `!y. y IN convex hull {u2 , u3:real^3} ==> g y <= g xx`);;
e (EXPAND_TAC "g" THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `&0 < (t3 + t4)`);;
e (MATCH_MP_TAC (REAL_ARITH `(&0 <= x) /\ ~(x = &0) ==> &0 < x`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_ADD);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `t3 = &0 /\ t4 = &0`);;
e (UNDISCH_TAC `&0 <= t3` THEN UNDISCH_TAC `&0 <= t4` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `(x - u0) dot (u1 - u0:real^3) > dist (x,u0) * dist (u1,u0) * d`);;
e (REWRITE_WITH `x = t1 % u0 + t2 % u1:real^3`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (MATCH_MP_TAC (REAL_ARITH `a <= &0 /\ &0 <= b ==> ~(a > b)`));;
e (STRIP_TAC);;
e (REWRITE_WITH `(t1 % u0 + t2 % u1) - u0 = (t1 % u0 + t2 % u1) -
(t1 + t2 + t3 + t4) % u0:real^3`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[ASSUME `t3 = &0`; ASSUME `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`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c/\ c < &1`);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ABBREV_TAC `y = t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3:real^3`);;
e (NEW_GOAL `(g:real^3->real) y <= g xx`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `t3 / (t3 + t4)` THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_DIV);;
e (ASM_SIMP_TAC[REAL_LE_ADD]);;
e (ASM_SIMP_TAC[REAL_LE_ADD; REAL_LE_DIV]);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x = (a + b) / x`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ABBREV_TAC `w = t1 / (t1 + t3 + t4) % u0 + t3 / (t1 + t3 + t4) % u2 +
t4 / (t1 + t3 + t4) % u3:real^3`);;
e (NEW_GOAL `(g:real^3->real) y = g w`);;
e (EXPAND_TAC "g");;
e (REWRITE_WITH `y:real^3 - u0 =
&1 / (t3 + t4) % (t3 % u2 + t4 % u3 - (t3 + t4) % u0)`);;
e (EXPAND_TAC "y");;
e (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`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_MUL; DOT_LMUL]);;
e (REWRITE_WITH `w:real^3 - u0 =
&1 / (t1 + t3 + t4) % (t3 % u2 + t4 % u3 - (t3 + t4) % u0)`);;
e (EXPAND_TAC "w");;
e (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`]);;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`
THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_MUL; DOT_LMUL]);;
e (REWRITE_WITH `abs (&1 / (t3 + t4)) = &1 / (t3 + t4)`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (ASM_SIMP_TAC[REAL_LE_DIV;REAL_LE_ADD; REAL_ARITH `&0 <= &1`]);;
e (REWRITE_WITH `abs (&1 / (t1 + t3 + t4)) = &1 / (t1 + t3 + t4)`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (MATCH_MP_TAC REAL_LE_DIV THEN REWRITE_TAC[REAL_ARITH `&0 <= &1`]);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`
THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `(a * x) / ((a * y) * z) =
(a * x) / (a * (y * z))`]);;
e (ABBREV_TAC
`a1 = norm (t3 % u2 + t4 % u3 - (t3 + t4) % u0) * norm (u1 - u0:real^3)`);;
e (NEW_GOAL `~(a1 = &0)`);;
e (EXPAND_TAC "a1" 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)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell4; MCELL_EXPLICIT; set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `t3 / (t3 + t4)`
THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 + t3 / (t3 + t4) + t4 / (t3 + t4) =
(t3 + t4) / (t3 + t4)`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`&0 % u1 + t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3 =
(&1 / (t3 + t4)) % (t3 % u2 + t4 % u3)`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (NEW_GOAL `~(&1 / (t3 + t4) = &0)`);;
e (NEW_GOAL `&0 < &1 / (t3 + t4)`);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (ASM_REWRITE_TAC[REAL_ARITH `&0 < &1`]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`(&1 / (t3 + t4) * ((t3 % u2 + t4 % u3 - (t3 + t4) % u0) dot (u1 - u0))) /
(&1 / (t3 + t4) * a1) =
((t3 % u2 + t4 % u3 - (t3 + t4) % u0) dot (u1 - u0:real^3)) / a1`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);;
e (NEW_GOAL `~(&1 / (t1 + t3 + t4) = &0)`);;
e (NEW_GOAL `&0 < &1 / (t1 + t3 + t4)`);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (ASM_REWRITE_TAC[REAL_ARITH `&0 < &1`]);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`(&1 / (t1 + t3 + t4) * ((t3 % u2 + t4 % u3 - (t3 + t4) % u0) dot (u1 - u0))) /
(&1 / (t1 + t3 + t4) * a1) =
((t3 % u2 + t4 % u3 - (t3 + t4) % u0) dot (u1 - u0:real^3)) / a1`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(a1 = &0)` THEN
MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);;
e (NEW_GOAL `(g:real^3->real) x <= g w`);;
e (EXPAND_TAC "g");;
e (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))`);;
e (MATCH_MP_TAC RAT_LEMMA4);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LT; VECTOR_ARITH `x - b = vec 0 <=> x = b`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell4; MCELL_EXPLICIT; set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{u0, u1, u2, u3} = {u1, u0, u2, u3}`]);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(t2 + t3 + t4) / t2` THEN EXISTS_TAC `(--t3) / t2`
THEN EXISTS_TAC `(--t4) / t2`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH
`(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH `(t2 + t3 + t4) = &1 - t1`);;
e (UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (NEW_GOAL `u0 - t1 % u0 - t3 % u2 - t4 % u3:real^3 = t2 % u1`);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(&1 - t1) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % u3 =
(&1 / t2) % (u0 - t1 % u0 - t3 % u2 - t4 % u3)`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `t2 / t2 = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LT; VECTOR_ARITH `x - b = vec 0 <=> x = b`]);;
e (EXPAND_TAC "w" THEN STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell4; MCELL_EXPLICIT; set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `u3:real^3`);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `t3 / (t3 + t4)`
THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 + t3 / (t3 + t4) + t4 / (t3 + t4) =
(t3 + t4) / (t3 + t4)`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`&0 % u1 + t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3 =
(&1 / (t3 + t4)) % (t3 % u2 + t4 % u3)`]);;
e (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)`]);;
e (REWRITE_WITH `&1 / (t1 + t3 + t4) % (t1 % u0 + t3 % u2 + t4 % u3) = u0 <=>
t1 % u0 + t3 % u2 + t4 % u3 = (t1 + t3 + t4) % u0:real^3`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 +t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `t1 % u0 + t3 % u2 + t4 % u3 = (t1 + t3 + t4) % u0
<=> t3 % u2 + t4 % u3 = (t3 + t4) % u0`]);;
e (STRIP_TAC THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (REWRITE_WITH `x = t2 % u1 + (t1 + t3 + t4) % w:real^3`);;
e (ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");;
e (REWRITE_TAC[VECTOR_ARITH
`x % (t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (t1 % u0 + t3 % u2 + t4 % u3)`]);;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (ABBREV_TAC `t = t1 + t3 + t4`);;
e (REWRITE_WITH `(t2 % u1 + t % w) - u0:real^3 =
(t2 % u1 + t % w) - (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_WITH `t1 + t2 + t3 + t4 = t2 + t:real`);;
e (EXPAND_TAC "t" THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH
`(t2 % u1 + t % w) - (t2 + t) % u0 = t2 % (u1 - u0) + t % (w - u0)`]);;
e (ABBREV_TAC `x1 = u1 - u0:real^3`);;
e (ABBREV_TAC `x2 = w - u0:real^3`);;
e (REWRITE_WITH `(t2 % x1 + t % x2) dot x1 =
t2 * norm x1 pow 2 + t * x2 dot (x1:real^3)`);;
e (REWRITE_TAC[NORM_POW_2]);;
e (VECTOR_ARITH_TAC);;
e (NEW_GOAL `t2 * norm x1 pow 2 * norm x2 * norm x1 <=
t2 * (x2 dot x1) * norm x1 * norm (x1:real^3)`);;
e (REWRITE_TAC[REAL_POW_2; REAL_ARITH `t2 * (x1 * x1) * x2 * x1 <=
t2 * x3 * x1 * x1 <=> &0 <= (x1 pow 2) * (--t2) * (x2 * x1 - x3)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (ASM_SIMP_TAC[REAL_LE_MUL; NORM_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ]);;
e (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)`);;
e (REWRITE_TAC[REAL_ARITH `t2 * x3 * x1 * x1 + t * x3 * x2 * x1 <=
x3 * x4 * x1 <=> &0 <= (x1 * x3) * (x4 - t2 * x1 - t * x2)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (ASM_CASES_TAC `x2 dot (x1:real^3) < &0`);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(g:real^3->real) x <= &0`);;
e (EXPAND_TAC "g");;
e (REWRITE_TAC[REAL_ARITH `a / b <= &0 <=> &0 <= (--a) / b`]);;
e (MATCH_MP_TAC REAL_LE_DIV);;
e (SIMP_TAC[NORM_POS_LE; REAL_LE_MUL]);;
e (REWRITE_WITH `x = t2 % u1 + (t1 + t3 + t4) % w:real^3`);;
e (ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");;
e (REWRITE_TAC[VECTOR_ARITH
`x % (t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (t1 % u0 + t3 % u2 + t4 % u3)`]);;
e (EXPAND_TAC "t");;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 <= --a <=> a <= &0`]);;
e (REWRITE_WITH `(t2 % u1 + (t1 + t3 + t4) % w) - u0:real^3 =
(t2 % u1 + (t1 + t3 + t4) % w) - (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(t2 % u1 + (t1 + t3 + t4) % w) - (t1 + t2 + t3 + t4) % u0 =
t2 % x1 + t % x2:real^3`);;
e (EXPAND_TAC "x1" THEN EXPAND_TAC "x2" THEN EXPAND_TAC "t"
THEN VECTOR_ARITH_TAC);;
e (NEW_GOAL `t % x2 dot (x1:real^3) <= &0`);;
e (REWRITE_TAC[DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= a * (--b)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `t2 % x1 dot (x1:real^3) <= &0`);;
e (REWRITE_TAC[DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= (--a) * b`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (REWRITE_TAC[DOT_LADD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `d < (g:real^3->real) x`);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1`);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_TAC [REAL_ARITH `&0 <= a - b * d - c <=> c <= a + (--b) * d`]);;
e (REWRITE_WITH `t * norm (x2:real^3) = abs t * norm x2`);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH `(--t2) * norm (x1:real^3) = abs (--t2) * norm x1`);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[GSYM NORM_MUL]);;
e (REWRITE_WITH
`norm (t % x2:real^3) = norm ((t2 % x1 + t % x2) + (--t2 % x1))`);;
e (AP_TERM_TAC THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_TRIANGLE]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `(g:real^3->real) y <= g xx`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `(g:real^3->real) xx <= d2`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P4");;
e (EXPAND_TAC "g" THEN EXPAND_TAC "f4");;
e (REWRITE_TAC[IN_ELIM_THM; IN]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (REWRITE_TAC[ASSUME `barV V 3 vl`; ASSUME `vl = [u0;u1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1]);;
e (SIMP_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (EXPAND_TAC "xx");;
e (SIMP_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell 4 V vl = mcell k V vl`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (REWRITE_TAC[GSYM (ASSUME `X = mcell k V vl`)]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN EXPAND_TAC "d");;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell4; MCELL_EXPLICIT; set_of_list]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
e (NEW_GOAL `~coplanar {u0, u1, u2, u3:real^3}`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell4; MCELL_EXPLICIT; set_of_list]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (ASM_REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (ASM_CASES_TAC `azim u0 u1 u2 (u3:real^3) < pi`);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 u2 u3)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {u2, u3} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {u2, u3} =
aff_gt {u0, u1} {u2, u3} UNION
UNIONS {aff_ge {u0, u1} ({u2, u3} DELETE a) | a | a IN {u2, u3}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `u3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({u2, u3} DELETE a) | a | a IN {u2, u3}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {u2} UNION aff_ge {u0, u1:real^3} {u3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u2}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u2:real^3} = {u0,u1} UNION {u2}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u3}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u3:real^3} = {u0,u1} UNION {u3}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, u3} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
(* begin the computation *)
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 u2 u3) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 u2 u3 / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, u2} /\ ~collinear {u0, u1, u3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 u2 u3 = dihV u0 u1 u2 u3`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(4, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `4 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] [u0; u1; u2; u3] /\
LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 4 /\ mcell k' V ul = mcell 4 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 4 V vl = X`);;
e (REWRITE_WITH `mcell 4 V vl = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (SET_TAC[ASSUME `X = mcell k' V ul`]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu4]);;
e (REWRITE_WITH `dihV (EL 0 (ul:(real^3)list)) (EL 1 ul) (EL 2 ul) (EL 3 ul) =
dihV u0 u1 u2 (u3:real^3)`);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `{EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} = {u0, u1,u2,u3:real^3}`);;
e (REWRITE_WITH `
{EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} = {u0, u1,u2,u3:real^3} <=>
convex hull {EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} =
convex hull {u0, u1,u2,u3:real^3}`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.CONVEX_HULL_EQ_EQ_SET_EQ);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (UNDISCH_TAC
`affine_dependent {EL 0 ul, EL 1 ul, EL 2 ul, (EL 3 ul):real^3}`);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (REWRITE_WITH `convex hull {u0, u1, u2, u3:real^3} = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (COND_CASES_TAC);;
e (MESON_TAC[]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_TAC[set_of_list; ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `1 = SUC 0`]);;
e (STRIP_TAC);;
e (ASM_CASES_TAC `EL 2 ul = u2:real^3`);;
e (NEW_GOAL `EL 3 ul = u3:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u2,u3:real^3}` THEN REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `EL 2 ul = u3:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0:real^3, u1, EL 2 ul, EL 3 ul} = {u0, u1, EL 3 ul}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u2,u3:real^3}` THEN REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0,u1:real^3, EL 3 ul}`; COPLANAR_3]);;
e (NEW_GOAL `EL 3 ul = u2:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u2,u3:real^3}` THEN REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u3:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[DIHV_SYM_2]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN MESON_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d /\ --(&1) < &0 ==> max d (--(&1)) = d`));;
e (REWRITE_TAC[REAL_NEG_LT0]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `k' = 4 /\ mcell k' V ul = mcell 4 V vl`
THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
(* OK here *)
e (ASM_CASES_TAC `azim u0 u1 u3 (u2:real^3) < pi`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (STRIP_TAC);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 u3 u2)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {u3, u2} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {u2, u3} =
aff_gt {u0, u1} {u2, u3} UNION
UNIONS {aff_ge {u0, u1} ({u2, u3} DELETE a) | a | a IN {u2, u3}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u3, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, u3, u2} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `u3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u3, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, u3, u2} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({u2, u3} DELETE a) | a | a IN {u2, u3}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {u2} UNION aff_ge {u0, u1:real^3} {u3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u2}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u2:real^3} = {u0,u1} UNION {u2}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u3}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u3:real^3} = {u0,u1} UNION {u3}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u3, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, u3, u2} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u3 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u3, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, u3, u2} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 u3 u2) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 u3 u2 / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, u2} /\ ~collinear {u0, u1, u3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u3:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 u3 u2 = dihV u0 u1 u3 u2`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u3:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(4, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `4 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] [u0; u1; u2; u3] /\
LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 4 /\ mcell k' V ul = mcell 4 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 4 V vl = X`);;
e (REWRITE_WITH `mcell 4 V vl = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (SET_TAC[ASSUME `X = mcell k' V ul`]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu4]);;
e (REWRITE_WITH `dihV (EL 0 (ul:(real^3)list)) (EL 1 ul) (EL 2 ul) (EL 3 ul) =
dihV u0 u1 u2 (u3:real^3)`);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `{EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} = {u0, u1,u2,u3:real^3}`);;
e (REWRITE_WITH `
{EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} = {u0, u1,u2,u3:real^3} <=>
convex hull {EL 0 ul, EL 1 ul, EL 2 ul, EL 3 ul} =
convex hull {u0, u1,u2,u3:real^3}`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.CONVEX_HULL_EQ_EQ_SET_EQ);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (UNDISCH_TAC
`affine_dependent {EL 0 ul, EL 1 ul, EL 2 ul, (EL 3 ul):real^3}`);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (REWRITE_WITH `convex hull {u0, u1, u2, u3:real^3} = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (COND_CASES_TAC);;
e (MESON_TAC[]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4; set_of_list]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_TAC[set_of_list; ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; mcell4;
ASSUME `X = mcell k' V ul`; ASSUME `k' = 4`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `1 = SUC 0`]);;
e (STRIP_TAC);;
e (ASM_CASES_TAC `EL 2 ul = u2:real^3`);;
e (NEW_GOAL `EL 3 ul = u3:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u3,u2:real^3}`);;
e (REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `EL 2 ul = u3:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0:real^3, u1, EL 2 ul, EL 3 ul} = {u0, u1, EL 3 ul}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u3,u2:real^3}`);;
e (REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0,u1:real^3, EL 3 ul}`; COPLANAR_3]);;
e (NEW_GOAL `EL 3 ul = u2:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u3:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u3,u2:real^3}`);;
e (REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u2, u3:real^3}`);
ASSUME `{u0, u1, EL 2 ul, EL 3 ul} = {u0, u1, u3:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[DIHV_SYM_2]);;
e (REWRITE_TAC[DIHV_SYM_2]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN MESON_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d /\ --(&1) < &0 ==> max d (--(&1)) = d`));;
e (REWRITE_TAC[REAL_NEG_LT0]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `k' = 4 /\ mcell k' V ul = mcell 4 V vl`
THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================== *)
e (NEW_GOAL `F`);;
e (NEW_GOAL `azim (u0:real^3) u1 u3 u2 =
(if azim u0 u1 u2 u3 = &0 then &0 else &2 * pi - azim u0 u1 u2 u3)`);;
e (MATCH_MP_TAC AZIM_COMPL);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u3:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b, d, c}`]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(&0 < pi)`);;
e (REWRITE_TAC[PI_POS]);;
e (UNDISCH_TAC `~(azim (u0:real^3) u1 u2 u3 < pi)`);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `azim (u0:real^3) u1 u2 u3 = pi`);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, u3:real^3}`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC AZIM_EQ_0_PI_IMP_COPLANAR);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
(* Case k = 3 *)
(* ========================================================================= *)
e (NEW_GOAL `k = 3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (NEW_GOAL `?u2 u3. vl = [u0; u1;u2;u3:real^3]`);;
e (NEW_GOAL `?v0 v1 u2 u3. vl = [v0; v1;u2;u3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `u2:real^3` THEN EXISTS_TAC `u3:real^3`);;
e (REWRITE_WITH `u0 = v0:real^3`);;
e (REWRITE_WITH `v0:real^3 = HD (truncate_simplex 1 vl)`);;
e (REWRITE_TAC[ASSUME `vl = [v0;v1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_1; HD]);;
e (REWRITE_WITH `u1 = v1:real^3`);;
e (REWRITE_WITH `v1:real^3 = HD (TL (truncate_simplex 1 vl))`);;
e (REWRITE_TAC[ASSUME `vl = [v0;v1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `L = aff_ge{u0, u1} {u2, mxi V vl}`);;
e (REWRITE_WITH `vol (X INTER D) = vol (L INTER D)`);;
e (AP_TERM_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2;
mcell3; set_of_list; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (COND_CASES_TAC);;
e (ABBREV_TAC `m = mxi V vl`);;
e (REWRITE_WITH `mxi V [u0; u1; u2; u3] = m`);;
e (EXPAND_TAC "m" THEN DEL_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `A = B <=> A SUBSET B /\ B SUBSET A`]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> A INTER X SUBSET B INTER X`));;
e (REWRITE_TAC[Marchal_cells_2.CONVEX_HULL_4_SUBSET_AFF_GE_2_2]);;
e (MATCH_MP_TAC (SET_RULE `(!x. x IN A /\ x IN B ==> x IN C) ==>
A INTER B SUBSET C INTER B`));;
e (NEW_GOAL `DISJOINT {u0,u1:real^3} {u2, m}`);;
e (REWRITE_TAC[DISJOINT]);;
e (MATCH_MP_TAC (MESON[] `(~A:bool ==> F) ==> A`));;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN REWRITE_TAC[SET_RULE `A INTER X SUBSET A`]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2;
mcell3; set_of_list; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0; u1; u2; u3] = m`);;
e (EXPAND_TAC "m" THEN REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (NEW_GOAL `m IN {u0, u1:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (SIMP_TAC[ASSUME `DISJOINT {u0, u1} {u2, m:real^3}`; AFF_GE_2_2]);;
e (REWRITE_TAC[CONVEX_HULL_4; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (EXISTS_TAC `t1:real` THEN EXISTS_TAC `t2:real` THEN
EXISTS_TAC `t3:real` THEN EXISTS_TAC `t4:real`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 <= a <=> (a < &0 ==> F)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `conic_cap (u0:real^3) u1 r d x`);;
e (REWRITE_TAC[MESON[IN] `conic_cap u0 u1 r d x <=> x IN conic_cap u0 u1 r d`;
GSYM (ASSUME `D = conic_cap (u0:real^3) u1 r d`)]);;
e (EXPAND_TAC "D");;
e (REWRITE_TAC[IN_INTER; MESON[] `~(x:bool /\ y) <=> (~x \/ ~y)`]);;
e (DISJ1_TAC);;
e (REWRITE_TAC[IN_BALL] THEN STRIP_TAC);;
e (NEW_GOAL `(?b1:real. b1 IN P1 /\ (!x. x IN P1 ==> b1 <= x))`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f1:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P1" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (FIRST_X_ASSUM CHOOSE_TAC);;
e (NEW_GOAL `r1 = (@b. b IN P1 /\ (!x. x IN P1 ==> b <= x:real))`);;
e (EXPAND_TAC "r1");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f1:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P1" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[]);;
e (ABBREV_TAC `Q1 = (\b:real. b IN P1 /\ (!x. x IN P1 ==> b <= x))`);;
e (NEW_GOAL `(Q1:real->bool) r1`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b1:real` THEN EXPAND_TAC "Q1");;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q1" THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `r1 <= f1 (vl:(real^3)list)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P1" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN EXPAND_TAC "f1" THEN REWRITE_TAC[EL; HD; TL;
ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `vl= [u0; u1; u2; u3:real^3]`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0;u1;u2;u3:real^3]`]);;
e (STRIP_TAC);;
e (NEW_GOAL `!v. v IN affine hull {u1, u2, m:real^3} ==> r1 <= dist (u0, v)`);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `dist (u0,closest_point (affine hull {u1, u2, m}) u0) <=
dist (u0, v:real^3)`);;
e (MATCH_MP_TAC CLOSEST_POINT_LE);;
e (ASM_REWRITE_TAC[CLOSED_AFFINE_HULL]);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `r <= dist (u0:real^3, x)`);;
e (REWRITE_TAC[dist]);;
e (REWRITE_WITH `u0:real^3 - x = (t1 + t2 + t3 + t4) % u0 - x`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ADD_RDISTRIB]);;
e (ASM_REWRITE_TAC[VECTOR_ARITH `(t1 % u0 + t2 % u0 + t3 % u0 + t4 % u0) -
(t1 % u0 + t2 % u1 + t3 % u2 + t4 % u3) =
(t2 + t3 + t4) % u0 - (t2 % u1 + t3 % u2 + t4 % u3)`]);;
e (ABBREV_TAC `y:real^3 = t2 /(t2 + t3 + t4) % u1 +
t3 /(t2 + t3 + t4) % u2 +
t4 /(t2 + t3 + t4) % m`);;
e (REWRITE_WITH `(t2 % u1 + t3 % u2 + t4 % m) = (t2 + t3 + t4) % (y:real^3)`);;
e (EXPAND_TAC "y");;
e (REWRITE_TAC[VECTOR_ARITH `x % (t2 / x % u1 + t3 / x % u2 + t4 / x % u3) =
(x / x) % (t2 % u1 + t3 % u2 + t4 % u3)`]);;
e (REWRITE_WITH `(t2 + t3 + t4) / (t2 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t1 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`);;
e (REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `a % x - a % y = a % (x - y)`; NORM_MUL]);;
e (NEW_GOAL `&1 < t2 + t3 + t4`);;
e (UNDISCH_TAC `t1 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `abs (t2 + t3 + t4) = t2 + t3 + t4`);;
e (REWRITE_TAC[REAL_ABS_REFL] THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[GSYM dist]);;
e (NEW_GOAL `r1 <= dist (u0, y:real^3)`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `t2 / (t2 + t3 + t4)` THEN EXISTS_TAC `t3 / (t2 + t3 + t4)` THEN
EXISTS_TAC `t4 / (t2 + t3 + t4)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x + c / x = (a+b+c)/ x`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `r1 <= (t2 + t3 + t4) * dist (u0,y:real^3)`);;
e (NEW_GOAL `dist (u0,y) <= (t2 + t3 + t4) * dist (u0,y:real^3)`);;
e (REWRITE_TAC[REAL_ARITH `a <= b * a <=> &0 <= (b - &1) * a`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (DEL_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (EXPAND_TAC "r" THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `dist (u0, x:real^3) < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
(* ========================================================================== *)
e (REWRITE_TAC[REAL_ARITH `&0 <= a <=> (a < &0 ==> F)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `conic_cap (u0:real^3) u1 r d x`);;
e (REWRITE_TAC[MESON[IN] `conic_cap u0 u1 r d x <=> x IN conic_cap u0 u1 r d`;
GSYM (ASSUME `D = conic_cap (u0:real^3) u1 r d`)]);;
e (EXPAND_TAC "D");;
e (REWRITE_TAC[IN_INTER; MESON[] `~(x:bool /\ y) <=> (~x \/ ~y)`]);;
e (DISJ2_TAC);;
e (REWRITE_TAC[IN; IN_ELIM_THM; rcone_gt; rconesgn] THEN STRIP_TAC);;
e (NEW_GOAL `(?b1:real. b1 IN P3 /\ (!x. x IN P3 ==> x <= b1))`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f3:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P3" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (FIRST_X_ASSUM CHOOSE_TAC);;
e (NEW_GOAL `d1 = (@b. b IN P3 /\ (!x. x IN P3 ==> x <= b:real))`);;
e (EXPAND_TAC "d1");;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (REWRITE_TAC[SET_RULE `~(X = {}) <=> (?x. x IN X)`]);;
e (EXISTS_TAC `(f3:(real^3)list -> real) vl`);;
e (EXPAND_TAC "P3" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[]);;
e (ABBREV_TAC `Q1 = (\b:real. b IN P3 /\ (!x. x IN P3 ==> x <= b))`);;
e (NEW_GOAL `(Q1:real->bool) d1`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `b1:real` THEN EXPAND_TAC "Q1");;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q1" THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `f3 (vl:(real^3)list) <= d1`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P3" THEN REWRITE_TAC[IN; IN_ELIM_THM]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN EXPAND_TAC "f3");;
e (REWRITE_TAC[EL; HD; TL;
ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`; ASSUME `mxi V vl = m`;
ASSUME `vl= [u0; u1; u2; u3:real^3]`] THEN STRIP_TAC);;
e (ABBREV_TAC `xx = smallest_angle_line u2 m u0 u1`);;
e (MP_TAC (ASSUME `smallest_angle_line u2 m u0 u1 = xx`));;
e (REWRITE_TAC[smallest_angle_line; smallest_angle_set]);;
e (ABBREV_TAC `Q2 =
(\x:real^3. x IN convex hull {u2, m} /\
(!y. y IN convex hull {u2, m}
==> ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)) <=
((x - u0) dot (u1 - u0)) /
(norm (x - u0) * norm (u1 - u0))))`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ] THEN STRIP_TAC);;
e (NEW_GOAL `(Q2:real^3->bool) xx`);;
e (ONCE_ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXPAND_TAC "Q2");;
e (MATCH_MP_TAC SMALLEST_ANGLE_LINE_EXISTS);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell3; set_of_list;TRUNCATE_SIMPLEX_EXPLICIT_2;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (UNDISCH_TAC `u0 IN convex hull {u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `m:real^3`);;
e (MATCH_MP_TAC (SET_RULE `a IN s /\ b SUBSET s ==> (a INSERT b) SUBSET s`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `u:real` THEN EXISTS_TAC `v:real`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `u + v = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN EXPAND_TAC "Q2");;
e (STRIP_TAC);;
e (ABBREV_TAC `g = (\y:real^3. ((y - u0) dot (u1 - u0)) /
(norm (y - u0) * norm (u1 - u0)))`);;
e (NEW_GOAL `d < (g:real^3->real) x`);;
e (EXPAND_TAC "g");;
e (REWRITE_WITH
`d < ((x - u0) dot (u1 - u0)) / (norm (x - u0) * norm (u1 - u0:real^3)) <=>
d * (norm (x - u0) * norm (u1 - u0)) < (x - u0) dot (u1 - u0)`);;
e (MATCH_MP_TAC REAL_LT_RDIV_EQ);;
e (MATCH_MP_TAC (REAL_ARITH `&0 <= a /\ ~(a = &0) ==> &0 < a`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LE]);;
e (REWRITE_TAC[REAL_ENTIRE; NORM_EQ_0; VECTOR_ARITH `x - y = vec 0 <=> x = y`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `t1 % u0 + t2 % u1 + t3 % u2 + t4 % m = u0:real^3 <=>
t1 % u0 + t2 % u1 + t3 % u2 + t4 % m = (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `t1 % u0 + u = (t1 + t2) % u0 <=> u = t2 % u0`]);;
e (STRIP_TAC);;
e (MP_TAC (ASSUME `~NULLSET (X INTER D)`) THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell3;set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (REWRITE_TAC[affine_dependent]);;
e (EXISTS_TAC `u1:real^3`);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (NEW_GOAL `~(u1 IN {u0, u2, m:real^3})`);;
e (STRIP_TAC);;
e (MP_TAC (ASSUME `~NULLSET (X INTER D)`) THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool` THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell3;set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0:real^3,u2, m}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (SET_TAC[]);;
e (REWRITE_WITH `{u0, u1, u2, m} DELETE u1 = {u0, u2, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(t2 + t3 + t4) / t2`);;
e (EXISTS_TAC `(-- t3) / t2`);;
e (EXISTS_TAC `(-- t4) / t2`);;
e (STRIP_TAC);;
e (REWRITE_WITH `(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`);;
e (REAL_ARITH_TAC);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`u1 = (t2 + t3 + t4) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % m:real^3 <=>
u1 = (&1 / t2) % ((t2 + t3 + t4) % u0 - t3 % u2 - t4 % m)`);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[GSYM (ASSUME `t2 % u1 + t3 % u2 + t4 % m =
(t2 + t3 + t4) % u0:real^3`)]);;
e (REWRITE_TAC[VECTOR_ARITH
`(t2 % u1 + t3 % u2 + t4 % u3) - t3 % u2 - t4 % u3 = t2 % u1`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC]);;
e (REWRITE_WITH `&1 / t2 * t2 = &1`);;
e (REWRITE_TAC[REAL_ARITH `&1 / t2 * t2 = t2 / t2`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a * b * c < d <=> d > b * c * a`; GSYM dist]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `g x <= (g:real^3->real) xx`);;
e (NEW_GOAL `!y. y IN convex hull {u2 , m:real^3} ==> g y <= g xx`);;
e (EXPAND_TAC "g" THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `&0 < (t3 + t4)`);;
e (MATCH_MP_TAC (REAL_ARITH `(&0 <= x) /\ ~(x = &0) ==> &0 < x`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_ADD);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `t3 = &0 /\ t4 = &0`);;
e (UNDISCH_TAC `&0 <= t3` THEN UNDISCH_TAC `&0 <= t4` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `(x - u0) dot (u1 - u0:real^3) > dist (x,u0) * dist (u1,u0) * d`);;
e (REWRITE_WITH `x = t1 % u0 + t2 % u1:real^3`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (MATCH_MP_TAC (REAL_ARITH `a <= &0 /\ &0 <= b ==> ~(a > b)`));;
e (STRIP_TAC);;
e (REWRITE_WITH `(t1 % u0 + t2 % u1) - u0 = (t1 % u0 + t2 % u1) -
(t1 + t2 + t3 + t4) % u0:real^3`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[ASSUME `t3 = &0`; ASSUME `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`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[DIST_POS_LE]);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c/\ c < &1`);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ABBREV_TAC `y = t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % m:real^3`);;
e (NEW_GOAL `(g:real^3->real) y <= g xx`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (REWRITE_TAC[CONVEX_HULL_2; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `t3 / (t3 + t4)` THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_DIV);;
e (ASM_SIMP_TAC[REAL_LE_ADD]);;
e (ASM_SIMP_TAC[REAL_LE_ADD; REAL_LE_DIV]);;
e (REWRITE_TAC[REAL_ARITH `a / x + b / x = (a + b) / x`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ABBREV_TAC `w = t1 / (t1 + t3 + t4) % u0 + t3 / (t1 + t3 + t4) % u2 +
t4 / (t1 + t3 + t4) % m:real^3`);;
e (NEW_GOAL `(g:real^3->real) y = g w`);;
e (EXPAND_TAC "g");;
e (REWRITE_WITH `y:real^3 - u0 =
&1 / (t3 + t4) % (t3 % u2 + t4 % m - (t3 + t4) % u0)`);;
e (EXPAND_TAC "y");;
e (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`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_MUL; DOT_LMUL]);;
e (REWRITE_WITH `w:real^3 - u0 =
&1 / (t1 + t3 + t4) % (t3 % u2 + t4 % m - (t3 + t4) % u0)`);;
e (EXPAND_TAC "w");;
e (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`]);;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`
THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_MUL; DOT_LMUL]);;
e (REWRITE_WITH `abs (&1 / (t3 + t4)) = &1 / (t3 + t4)`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (ASM_SIMP_TAC[REAL_LE_DIV;REAL_LE_ADD; REAL_ARITH `&0 <= &1`]);;
e (REWRITE_WITH `abs (&1 / (t1 + t3 + t4)) = &1 / (t1 + t3 + t4)`);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (MATCH_MP_TAC REAL_LE_DIV THEN REWRITE_TAC[REAL_ARITH `&0 <= &1`]);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1`
THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `(a * x) / ((a * y) * z) =
(a * x) / (a * (y * z))`]);;
e (ABBREV_TAC
`a1 = norm (t3 % u2 + t4 % m - (t3 + t4) % u0) * norm (u1 - u0:real^3)`);;
e (NEW_GOAL `~(a1 = &0)`);;
e (EXPAND_TAC "a1" 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)`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `m:real^3`);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `t3 / (t3 + t4)`
THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 + t3 / (t3 + t4) + t4 / (t3 + t4) =
(t3 + t4) / (t3 + t4)`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`&0 % u1 + t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3 =
(&1 / (t3 + t4)) % (t3 % u2 + t4 % u3)`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (NEW_GOAL `~(&1 / (t3 + t4) = &0)`);;
e (NEW_GOAL `&0 < &1 / (t3 + t4)`);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (ASM_REWRITE_TAC[REAL_ARITH `&0 < &1`]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`(&1 / (t3 + t4) * ((t3 % u2 + t4 % m - (t3 + t4) % u0) dot (u1 - u0))) /
(&1 / (t3 + t4) * a1) =
((t3 % u2 + t4 % m - (t3 + t4) % u0) dot (u1 - u0:real^3)) / a1`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);;
e (NEW_GOAL `~(&1 / (t1 + t3 + t4) = &0)`);;
e (NEW_GOAL `&0 < &1 / (t1 + t3 + t4)`);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (ASM_REWRITE_TAC[REAL_ARITH `&0 < &1`]);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_WITH
`(&1 / (t1 + t3 + t4) * ((t3 % u2 + t4 % m - (t3 + t4) % u0) dot (u1 - u0))) /
(&1 / (t1 + t3 + t4) * a1) =
((t3 % u2 + t4 % m - (t3 + t4) % u0) dot (u1 - u0:real^3)) / a1`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(a1 = &0)` THEN
MESON_TAC[Trigonometry1.REAL_DIV_MUL2]);;
e (NEW_GOAL `(g:real^3->real) x <= g w`);;
e (EXPAND_TAC "g");;
e (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))`);;
e (MATCH_MP_TAC RAT_LEMMA4);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LT; VECTOR_ARITH `x - b = vec 0 <=> x = b`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{u0, u1, u2, u3} = {u1, u0, u2, u3}`]);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `(t2 + t3 + t4) / t2` THEN EXISTS_TAC `(--t3) / t2`
THEN EXISTS_TAC `(--t4) / t2`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH
`(t2 + t3 + t4) / t2 + --t3 / t2 + --t4 / t2 = t2 / t2`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH `(t2 + t3 + t4) = &1 - t1`);;
e (UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (NEW_GOAL `u0 - t1 % u0 - t3 % u2 - t4 % m:real^3 = t2 % u1`);;
e (UP_ASM_TAC THEN VECTOR_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`(&1 - t1) / t2 % u0 + --t3 / t2 % u2 + --t4 / t2 % u3 =
(&1 / t2) % (u0 - t1 % u0 - t3 % u2 - t4 % u3)`]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `t2 / t2 = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (ASM_REWRITE_TAC[NORM_POS_LT; VECTOR_ARITH `x - b = vec 0 <=> x = b`]);;
e (EXPAND_TAC "w" THEN STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[coplanar]);;
e (EXISTS_TAC `u1:real^3` THEN EXISTS_TAC `u2:real^3` THEN
EXISTS_TAC `m:real^3`);;
e (MATCH_MP_TAC (SET_RULE `u0 IN S /\ b SUBSET S ==> (u0 INSERT b) SUBSET S`));;
e (REWRITE_TAC[SET_SUBSET_AFFINE_HULL]);;
e (REWRITE_TAC[AFFINE_HULL_3; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `&0` THEN EXISTS_TAC `t3 / (t3 + t4)`
THEN EXISTS_TAC `t4 / (t3 + t4)`);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 + t3 / (t3 + t4) + t4 / (t3 + t4) =
(t3 + t4) / (t3 + t4)`]);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[VECTOR_ARITH
`&0 % u1 + t3 / (t3 + t4) % u2 + t4 / (t3 + t4) % u3 =
(&1 / (t3 + t4)) % (t3 % u2 + t4 % u3)`]);;
e (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)`]);;
e (REWRITE_WITH `&1 / (t1 + t3 + t4) % (t1 % u0 + t3 % u2 + t4 % m) = u0 <=>
t1 % u0 + t3 % u2 + t4 % m = (t1 + t3 + t4) % u0:real^3`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Collect_geom.CHANGE_SIDE);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 +t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH `t1 % u0 + t3 % u2 + t4 % u3 = (t1 + t3 + t4) % u0
<=> t3 % u2 + t4 % u3 = (t3 + t4) % u0`]);;
e (STRIP_TAC THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[VECTOR_MUL_ASSOC; REAL_ARITH `&1 / a * a = a / a`]);;
e (REWRITE_WITH `(t3 + t4) / (t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `&0 < t3 + t4` THEN REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (SET_TAC[]);;
e (REWRITE_WITH `x = t2 % u1 + (t1 + t3 + t4) % w:real^3`);;
e (ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");;
e (REWRITE_TAC[VECTOR_ARITH
`x % (t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (t1 % u0 + t3 % u2 + t4 % u3)`]);;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (ABBREV_TAC `t = t1 + t3 + t4`);;
e (REWRITE_WITH `(t2 % u1 + t % w) - u0:real^3 =
(t2 % u1 + t % w) - (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_WITH `t1 + t2 + t3 + t4 = t2 + t:real`);;
e (EXPAND_TAC "t" THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[VECTOR_ARITH
`(t2 % u1 + t % w) - (t2 + t) % u0 = t2 % (u1 - u0) + t % (w - u0)`]);;
e (ABBREV_TAC `x1 = u1 - u0:real^3`);;
e (ABBREV_TAC `x2 = w - u0:real^3`);;
e (REWRITE_WITH `(t2 % x1 + t % x2) dot x1 =
t2 * norm x1 pow 2 + t * x2 dot (x1:real^3)`);;
e (REWRITE_TAC[NORM_POW_2]);;
e (VECTOR_ARITH_TAC);;
e (NEW_GOAL `t2 * norm x1 pow 2 * norm x2 * norm x1 <=
t2 * (x2 dot x1) * norm x1 * norm (x1:real^3)`);;
e (REWRITE_TAC[REAL_POW_2; REAL_ARITH `t2 * (x1 * x1) * x2 * x1 <=
t2 * x3 * x1 * x1 <=> &0 <= (x1 pow 2) * (--t2) * (x2 * x1 - x3)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (ASM_SIMP_TAC[REAL_LE_MUL; NORM_POS_LE]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[REAL_ARITH `&0 <= a - b <=> b <= a`]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[NORM_CAUCHY_SCHWARZ]);;
e (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)`);;
e (REWRITE_TAC[REAL_ARITH `t2 * x3 * x1 * x1 + t * x3 * x2 * x1 <=
x3 * x4 * x1 <=> &0 <= (x1 * x3) * (x4 - t2 * x1 - t * x2)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (REWRITE_TAC[NORM_POS_LE]);;
e (ASM_CASES_TAC `x2 dot (x1:real^3) < &0`);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(g:real^3->real) x <= &0`);;
e (EXPAND_TAC "g");;
e (REWRITE_TAC[REAL_ARITH `a / b <= &0 <=> &0 <= (--a) / b`]);;
e (MATCH_MP_TAC REAL_LE_DIV);;
e (SIMP_TAC[NORM_POS_LE; REAL_LE_MUL]);;
e (REWRITE_WITH `x = t2 % u1 + (t1 + t3 + t4) % w:real^3`);;
e (ASM_REWRITE_TAC[] THEN EXPAND_TAC "w");;
e (REWRITE_TAC[VECTOR_ARITH
`x % (t1 /x % u0 + t3 / x % u2 + t4 /x % u3) =
(x / x) % (t1 % u0 + t3 % u2 + t4 % u3)`]);;
e (EXPAND_TAC "t");;
e (REWRITE_WITH `(t1 + t3 + t4) / (t1 + t3 + t4) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (UNDISCH_TAC `t2 < &0` THEN UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN
REAL_ARITH_TAC);;
e (VECTOR_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&0 <= --a <=> a <= &0`]);;
e (REWRITE_WITH `(t2 % u1 + (t1 + t3 + t4) % w) - u0:real^3 =
(t2 % u1 + (t1 + t3 + t4) % w) - (t1 + t2 + t3 + t4) % u0`);;
e (ASM_REWRITE_TAC[] THEN VECTOR_ARITH_TAC);;
e (REWRITE_WITH `(t2 % u1 + (t1 + t3 + t4) % w) - (t1 + t2 + t3 + t4) % u0 =
t2 % x1 + t % x2:real^3`);;
e (EXPAND_TAC "x1" THEN EXPAND_TAC "x2" THEN EXPAND_TAC "t"
THEN VECTOR_ARITH_TAC);;
e (NEW_GOAL `t % x2 dot (x1:real^3) <= &0`);;
e (REWRITE_TAC[DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= a * (--b)`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `t2 % x1 dot (x1:real^3) <= &0`);;
e (REWRITE_TAC[DOT_LMUL; REAL_ARITH `a * b <= &0 <=> &0 <= (--a) * b`]);;
e (MATCH_MP_TAC REAL_LE_MUL);;
e (STRIP_TAC);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[DOT_POS_LE]);;
e (REWRITE_TAC[DOT_LADD]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `d < (g:real^3->real) x`);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1`);;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (REWRITE_TAC [REAL_ARITH `&0 <= a - b * d - c <=> c <= a + (--b) * d`]);;
e (REWRITE_WITH `t * norm (x2:real^3) = abs t * norm x2`);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (EXPAND_TAC "t" THEN UNDISCH_TAC `t2 < &0` THEN
UNDISCH_TAC `t1 + t2 + t3 + t4 = &1` THEN REAL_ARITH_TAC);;
e (REWRITE_WITH `(--t2) * norm (x1:real^3) = abs (--t2) * norm x1`);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (REWRITE_TAC[REAL_ABS_REFL]);;
e (UNDISCH_TAC `t2 < &0` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[GSYM NORM_MUL]);;
e (REWRITE_WITH
`norm (t % x2:real^3) = norm ((t2 % x1 + t % x2) + (--t2 % x1))`);;
e (AP_TERM_TAC THEN VECTOR_ARITH_TAC);;
e (REWRITE_TAC[NORM_TRIANGLE]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `(g:real^3->real) y <= g xx`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `(g:real^3->real) xx <= d1`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (EXPAND_TAC "P3");;
e (EXPAND_TAC "g" THEN EXPAND_TAC "f3");;
e (REWRITE_TAC[IN_ELIM_THM; IN]);;
e (EXISTS_TAC `vl:(real^3)list`);;
e (REWRITE_TAC[ASSUME `barV V 3 vl`; ASSUME `vl = [u0;u1;u2;u3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_1]);;
e (STRIP_TAC);;
e (SIMP_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell 3 V vl = mcell k V vl`);;
e (ASM_SIMP_TAC[]);;
e (REWRITE_TAC[GSYM (ASSUME `X = mcell k V vl`)]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (C:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC (SET_RULE `D SUBSET C ==> X INTER D SUBSET X INTER C`));;
e (EXPAND_TAC "D" THEN EXPAND_TAC "C");;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A INTER C SUBSET B INTER D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN REAL_ARITH_TAC);;
e (EXPAND_TAC "xx");;
e (SIMP_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN EXPAND_TAC "d");;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
e (ABBREV_TAC `m = mxi V vl`);;
e (NEW_GOAL `~coplanar {u0, u1, u2, m:real^3}`);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER D)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; set_of_list]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (ASM_REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (SET_TAC[]);;
e (ASM_CASES_TAC `azim u0 u1 u2 (m:real^3) < pi`);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 u2 m)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {u2, m} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {u2, m} =
aff_gt {u0, u1} {u2, m} UNION
UNIONS {aff_ge {u0, u1} ({u2, m} DELETE a) | a | a IN {u2, m}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({u2, m} DELETE a) | a | a IN {u2, m}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {u2} UNION aff_ge {u0, u1:real^3} {m}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u2}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u2:real^3} = {u0,u1} UNION {u2}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, m}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,m:real^3} = {u0,u1} UNION {m}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET B /\ C SUBSET D ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (REWRITE_WITH `{u0, u1, u2, m} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
(* begin the computation *)
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 u2 m) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 u2 m / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, u2} /\ ~collinear {u0, u1, m}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 u2 m = dihV u0 u1 u2 m`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(3, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `3 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] [u0; u1; u2; u3] /\
LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 3 /\ mcell k' V ul = mcell 3 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 3 V vl = X`);;
e (REWRITE_WITH `mcell 3 V vl = X`);;
e (ASM_SIMP_TAC[]);;
e (SET_TAC[ASSUME `X = mcell k' V ul`]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu3]);;
e (REWRITE_WITH `dihV (EL 0 ul) (EL 1 ul) (EL 2 ul) (mxi V ul) =
dihV u0 u1 u2 (m:real^3)`);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `{EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} = {u0, u1,u2,m:real^3}`);;
e (REWRITE_WITH `
{EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} = {u0, u1,u2,m:real^3} <=>
convex hull {EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} =
convex hull {u0, u1,u2,m:real^3}`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.CONVEX_HULL_EQ_EQ_SET_EQ);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list; TRUNCATE_SIMPLEX_EXPLICIT_2;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, mxi V [v0; v1; v2; v3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (UNDISCH_TAC `affine_dependent {EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul}`);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, mxi V [u0; u1; u2; u3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (REWRITE_WITH `convex hull {u0, u1, u2, m:real^3} = X`);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; set_of_list]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; set_of_list]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_TAC[set_of_list; ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `1 = SUC 0`]);;
e (NEW_GOAL `mxi V ul = m`);;
e (EXPAND_TAC "m");;
e (MATCH_MP_TAC MCELL_ID_MXI);;
e (EXISTS_TAC `k':num` THEN EXISTS_TAC `k:num`);;
e (ASM_REWRITE_TAC[SET_RULE `3 IN {2, 3}`]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `HD (ul) = (HD (truncate_simplex 1 ul)):real^3`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `EL 2 ul = u2:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,u2,m:real^3}` THEN REWRITE_TAC[
GSYM (ASSUME `{u0, u1, EL 2 ul, m} = {u0, u1, u2, m:real^3}`);
ASSUME `{u0, u1, EL 2 ul, m} = {u0, u1, m:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN MESON_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d /\ --(&1) < &0 ==> max d (--(&1)) = d`));;
e (REWRITE_TAC[REAL_NEG_LT0]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `k' = 3 /\ mcell k' V ul = mcell 3 V vl`
THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
e (ASM_CASES_TAC `azim u0 u1 m (u2:real^3) < pi`);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (STRIP_TAC);;
e (REWRITE_WITH `vol (L INTER D) = vol (D INTER wedge u0 u1 m u2)`);;
e (ASM_SIMP_TAC[WEDGE_LUNE]);;
e (REWRITE_WITH `L INTER conic_cap (u0:real^3) u1 r d =
conic_cap u0 u1 r d INTER L`);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH `conic_cap (u0:real^3) u1 r d INTER
aff_gt {u0, u1} {m, u2} DIFF conic_cap u0 u1 r d INTER L = {}`);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A DIFF C INTER B = {}`));;
e (REWRITE_TAC[AFF_GT_SUBSET_AFF_GE]);;
e (REWRITE_TAC[SET_RULE `A UNION {} = A`]);;
e (EXPAND_TAC "L");;
e (REWRITE_TAC[SET_RULE `{a,b} = {b, a}`]);;
e (REWRITE_WITH `aff_ge {u0, u1:real^3} {m, u2} =
aff_gt {u0, u1} {m, u2} UNION
UNIONS {aff_ge {u0, u1} ({m, u2} DELETE a) | a | a IN {m, u2}}`);;
e (MATCH_MP_TAC AFF_GE_AFF_GT_DECOMP);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, u2} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, u2} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`UNIONS {aff_ge {u0, u1:real^3} ({m, u2} DELETE a) | a | a IN {m, u2}}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC
`aff_ge {u0, u1:real^3} {u2} UNION aff_ge {u0, u1:real^3} {m}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, u2}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,u2:real^3} = {u0,u1} UNION {u2}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1:real^3, m}`);;
e (STRIP_TAC);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_WITH `{u0,u1,m:real^3} = {u0,u1} UNION {m}`);;
e (SET_TAC[]);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL]);;
e (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)`]);;
e (MATCH_MP_TAC (SET_RULE
`A SUBSET D /\ C SUBSET B ==> A UNION C SUBSET B UNION D`));;
e (STRIP_TAC);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `m IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, u2} = {u0, u1, u2:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC AFF_GE_MONO_RIGHT);;
e (STRIP_TAC);;
e (SET_TAC[]);;
e (REWRITE_TAC[DISJOINT]);;
e (ASM_CASES_TAC `u2 IN {u0, u1:real^3}`);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~coplanar {u0, u1, m, u2:real^3}`);;
e (REWRITE_WITH `{u0, u1, m, u2} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[COPLANAR_3]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_TAC[ASSUME `D = conic_cap (u0:real^3) u1 r d`]);;
e (REWRITE_WITH `vol (conic_cap u0 u1 r d INTER wedge u0 u1 m u2) =
(if &1 < d \/ r < &0
then &0
else azim u0 u1 m u2 / &3 * (&1 - max d (-- &1)) * r pow 3)`);;
e (NEW_GOAL `~collinear {u0:real^3, u1, u2} /\ ~collinear {u0, u1, m}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP_WEDGE]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `&0 < r` THEN UNDISCH_TAC `d < &1` THEN
UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_WITH `azim (u0:real^3) u1 m u2 = dihV u0 u1 m u2`);;
e (MATCH_MP_TAC AZIM_DIHV_SAME);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[dihX]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET (X INTER D)`);;
e (REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[] THEN SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (LET_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[cell_params_d]);;
e (ABBREV_TAC `P = (\(k, ul). k <= 4 /\
ul IN barV V 3 /\
X = mcell k V ul /\
initial_sublist [u0; u1] ul)`);;
e (STRIP_TAC);;
e (NEW_GOAL `(P:num#(real^3)list->bool) ((@) P)`);;
e (MATCH_MP_TAC SELECT_AX);;
e (EXISTS_TAC `(3, vl:(real^3)list)`);;
e (EXPAND_TAC "P");;
e (REWRITE_TAC[BETA_THM]);;
e (REWRITE_TAC[IN; ARITH_RULE `3 <= 4`] THEN ASM_REWRITE_TAC[]);;
e (REWRITE_WITH `initial_sublist [u0;u1:real^3] [u0; u1; u2; u3] /\
LENGTH [u0;u1] = 1 + 1`);;
e (REWRITE_TAC[GSYM Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "P" THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (NEW_GOAL `k' = 3 /\ mcell k' V ul = mcell 3 V vl`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[GSYM (ASSUME `vl = [u0; u1; u2; u3:real^3]`)]);;
e (REWRITE_WITH `mcell k' V ul INTER mcell 3 V vl = X`);;
e (REWRITE_WITH `mcell 3 V vl = X`);;
e (ASM_SIMP_TAC[]);;
e (SET_TAC[ASSUME `X = mcell k' V ul`]);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `k' <= 4` THEN REWRITE_TAC[ARITH_RULE
`a <= 4 <=> a = 0 \/a = 1 \/ a = 2 \/ a = 3 \/ a = 4`] THEN SET_TAC[]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~NULLSET X` THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[dihu3]);;
e (REWRITE_WITH `dihV (EL 0 ul) (EL 1 ul) (EL 2 ul) (mxi V ul) =
dihV u0 u1 u2 (m:real^3)`);;
e (NEW_GOAL `truncate_simplex 1 ul = [u0;u1:real^3] /\ 1 + 1 <= LENGTH ul`);;
e (REWRITE_TAC[Packing3.TRUNCATE_SIMPLEX_INITIAL_SUBLIST]);;
e (ASM_REWRITE_TAC[LENGTH] THEN ARITH_TAC);;
e (NEW_GOAL `EL 0 (ul:(real^3)list) = EL 0 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `EL 1 (ul:(real^3)list) = EL 1 (truncate_simplex 1 ul)`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.EL_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (NEW_GOAL `{EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} = {u0, u1,u2,m:real^3}`);;
e (REWRITE_WITH `
{EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} = {u0, u1,u2,m:real^3} <=>
convex hull {EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul} =
convex hull {u0, u1,u2,m:real^3}`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.CONVEX_HULL_EQ_EQ_SET_EQ);;
e (REPEAT STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[set_of_list; TRUNCATE_SIMPLEX_EXPLICIT_2;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, mxi V [v0; v1; v2; v3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (UNDISCH_TAC `affine_dependent {EL 0 ul, EL 1 ul, EL 2 ul, mxi V ul}`);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2; SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0, u1, u2, mxi V [u0; u1; u2; u3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (MATCH_MP_TAC Rogers.AFF_DIM_LE_2_IMP_COPLANAR);;
e (MATCH_MP_TAC Njiutiu.AFF_DEPENDENT_AFF_DIM_4);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (REWRITE_WITH `convex hull {u0, u1, u2, m:real^3} = X`);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; set_of_list]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_WITH `mxi V [u0;u1;u2;u3] = m`);;
e (EXPAND_TAC "m");;
e (REWRITE_TAC[ASSUME `vl = [u0; u1; u2; u3:real^3]`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (ASM_SIMP_TAC[mcell3; MCELL_EXPLICIT; set_of_list]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2; v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_TAC[set_of_list; ASSUME `ul = [v0; v1; v2; v3:real^3]`;
TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list;
SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (REWRITE_TAC[EL; HD; TL; ARITH_RULE `3 = SUC 2 /\ 2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET X`);;
e (REWRITE_TAC[]);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell3; ASSUME `X = mcell k' V ul`; ASSUME `k' = 3`]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[EL; HD; TL; ARITH_RULE `1 = SUC 0`]);;
e (NEW_GOAL `mxi V ul = m`);;
e (EXPAND_TAC "m");;
e (MATCH_MP_TAC MCELL_ID_MXI);;
e (EXISTS_TAC `k':num` THEN EXISTS_TAC `k:num`);;
e (ASM_REWRITE_TAC[SET_RULE `3 IN {2, 3}`]);;
e (REWRITE_WITH `mcell 3 V [u0; u1; u2; u3] = X`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[HD]);;
e (REWRITE_WITH `HD (ul) = (HD (truncate_simplex 1 ul)):real^3`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC Packing3.HD_TRUNCATE_SIMPLEX);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (ARITH_TAC);;
e (ASM_REWRITE_TAC[HD]);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `EL 2 ul = u2:real^3`);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1, EL 2 ul, m} = {u0, u1, m:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~coplanar {u0,u1,m,u2:real^3}`);;
e (REWRITE_TAC[]);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b,d,c}`]);;
e (REWRITE_TAC[GSYM (ASSUME `{u0, u1, EL 2 ul, m} = {u0, u1, u2, m:real^3}`);
ASSUME `{u0, u1, EL 2 ul, m} = {u0, u1, m:real^3}`; COPLANAR_3]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[DIHV_SYM_2]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c * d pow 3 = (c/ b * d pow 3) * a`]);;
e (REWRITE_TAC[REAL_ARITH `a * b / (&2 * c) = (a / (&2 * c)) * b`]);;
e (AP_THM_TAC THEN AP_TERM_TAC);;
e (REWRITE_WITH
`measurable (conic_cap u0 u1 r d) /\
vol (conic_cap u0 u1 r d) =
(if u1 = u0 \/ &1 <= d \/ r < &0
then &0
else &2 / &3 * pi * (&1 - d) * r pow 3)`);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN MESON_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `SUC 0 = 1`]);;
e (REWRITE_WITH `max d (--(&1)) = d`);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < d /\ --(&1) < &0 ==> max d (--(&1)) = d`));;
e (REWRITE_TAC[REAL_NEG_LT0]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d");;
e (UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `
(&2 / &3 * pi * (&1 - d) * r pow 3) / (&2 * pi) = (&1 - d) / &3 * r pow 3 *
((&2 * pi) / (&2 * pi))`);;
e (REAL_ARITH_TAC);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (REWRITE_TAC[REAL_ENTIRE; PI_NZ; REAL_ARITH `~(&2 = &0)`]);;
e (REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UNDISCH_TAC `k' = 3 /\ mcell k' V ul = mcell 3 V vl`
THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
e (NEW_GOAL `F`);;
e (NEW_GOAL `azim (u0:real^3) u1 m u2 =
(if azim u0 u1 u2 m = &0 then &0 else &2 * pi - azim u0 u1 u2 m)`);;
e (MATCH_MP_TAC AZIM_COMPL);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `m:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC NOT_COPLANAR_NOT_COLLINEAR);;
e (EXISTS_TAC `u2:real^3`);;
e (ONCE_REWRITE_TAC[SET_RULE `{a,b,c,d} = {a,b, d, c}`]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL `(&0 < pi)`);;
e (REWRITE_TAC[PI_POS]);;
e (UNDISCH_TAC `~(azim (u0:real^3) u1 u2 m < pi)`);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (STRIP_TAC);;
e (NEW_GOAL `azim (u0:real^3) u1 u2 m = pi`);;
e (UP_ASM_TAC THEN DEL_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `~coplanar {u0, u1, u2, m:real^3}`);;
e (REWRITE_TAC[] THEN MATCH_MP_TAC AZIM_EQ_0_PI_IMP_COPLANAR);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================================================= *)
(* ========================================================================= *)
(* ========================================================================= *)
(* ========================================================================= *)
e (ABBREV_TAC `E = D INTER wedge_ge u0 u1 n1 n2`);;
e (ABBREV_TAC
`s = {X | mcell_set V X /\ edgeX V X e /\ X SUBSET wedge_ge u0 u1 n1 n2}`);;
e (NEW_GOAL `sum s (\t. vol (t INTER E)) = vol (E)`);;
e (ABBREV_TAC `f = (\t:real^3->bool. t INTER E)`);;
e (REWRITE_WITH `(\t. vol (t INTER E)) = (\x:real^3->bool. vol (f x))`);;
e (EXPAND_TAC "f");;
e (REWRITE_TAC[]);;
e (REWRITE_WITH `sum s (\x:real^3->bool. vol (f x)) = vol (UNIONS (IMAGE f s))`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNIONS_IMAGE);;
e (REPEAT STRIP_TAC);;
e (EXPAND_TAC "s");;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{X | mcell_set V X /\ edgeX V X e}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC FINITE_EDGE_X2);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);;
e (ASM_REWRITE_TAC[]);;
e (SET_TAC[]);;
e (EXPAND_TAC "f");;
e (MATCH_MP_TAC MEASURABLE_INTER);;
e (STRIP_TAC);;
e (UP_ASM_TAC THEN EXPAND_TAC "s");;
e (REWRITE_TAC[mcell_set; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_SIMP_TAC[MEASURABLE_MCELL]);;
e (EXPAND_TAC "E");;
e (REWRITE_TAC[ASSUME `D:real^3->bool = conic_cap u0 u1 r d`]);;
e (REWRITE_TAC[MEASURABLE_CONIC_CAP_WEDGE_GE]);;
e (EXPAND_TAC "f");;
e (UNDISCH_TAC `(x:real^3->bool) IN s` THEN
UNDISCH_TAC `(y:real^3->bool) IN s` THEN EXPAND_TAC "s");;
e (REWRITE_TAC[mcell_set_2; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `x INTER (y:real^3->bool)`);;
e (ASM_REWRITE_TAC[SET_RULE `(x INTER D) INTER y INTER D SUBSET x INTER y`]);;
e (MATCH_MP_TAC (MESON[] `(~A ==> F) ==> A`));;
e (STRIP_TAC);;
e (NEW_GOAL `i' = i /\ mcell i' V ul' = mcell i V ul`);;
e (MATCH_MP_TAC Ajripqn.AJRIPQN);;
e (ASM_REWRITE_TAC[SET_RULE `i IN {0, 1, 2, 3, 4} <=>
i = 0 \/ i = 1 \/ i = 2 \/ i = 3 \/ i = 4`]);;
e (UNDISCH_TAC `i <= 4` THEN UNDISCH_TAC `i' <= 4` THEN ARITH_TAC);;
e (UNDISCH_TAC `~(x = y:real^3->bool)` THEN ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "s");;
e (EXPAND_TAC "f" THEN REWRITE_TAC[IMAGE]);;
e (MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF);;
e (REWRITE_WITH
`UNIONS
{y | ?x. x IN
{X | mcell_set V X /\ edgeX V X e /\ X SUBSET wedge_ge u0 u1 n1 n2} /\
y = x INTER E} DIFF E = {}`);;
e (REWRITE_TAC[SET_RULE `A DIFF B = {} <=> A SUBSET B`]);;
e (REWRITE_TAC[UNIONS_SUBSET; IN; IN_ELIM_THM]);;
e (SET_TAC[]);;
e (REWRITE_TAC[SET_RULE `{} UNION A = A`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `UNIONS {y | ?x. x IN {X | mcell_set V X /\ NULLSET (X INTER E) /\
~(X INTER E = {})} /\ y = x INTER E}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNIONS);;
e (STRIP_TAC);;
e (REWRITE_WITH
`{y | ?x. x IN
{X | mcell_set V X /\ NULLSET (X INTER E) /\ ~(X INTER E = {})} /\
y = x INTER E} =
{y | ?x. x IN
{X | mcell_set V X /\ NULLSET (X INTER E) /\ ~(X INTER E = {})} /\
y = f x}`);;
e (EXPAND_TAC "f" THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC FINITE_IMAGE_EXPAND);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{X | X SUBSET ball (u0, &10) /\ mcell_set V X}`);;
e (STRIP_TAC);;
e (ASM_SIMP_TAC[FINITE_MCELL_SET_LEMMA_2]);;
e (REWRITE_TAC[SUBSET; IN_BALL; IN; IN_ELIM_THM; mcell_set] THEN
REPEAT STRIP_TAC);;
e (NEW_GOAL `?v1:real^3. v1 IN x /\ v1 IN D`);;
e (REWRITE_TAC[GSYM IN_INTER]);;
e (UNDISCH_TAC `~(x:real^3->bool INTER E = {})` THEN EXPAND_TAC "E" THEN SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `dist (u0, x') <= dist (u0, v1:real^3) + dist (v1, x')`);;
e (NORM_ARITH_TAC);;
e (NEW_GOAL `dist (u0, v1:real^3) < &1`);;
e (REWRITE_TAC[GSYM IN_BALL]);;
e (NEW_GOAL `D SUBSET ball (u0:real^3, &1)`);;
e (EXPAND_TAC "D");;
e (NEW_GOAL `ball (u0, r) SUBSET ball (u0:real^3, &1)`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN UNDISCH_TAC `v1:real^3 IN D` THEN SET_TAC[]);;
e (NEW_GOAL `dist (v1,x':real^3) < &8`);;
e (REWRITE_TAC[GSYM IN_BALL]);;
e (NEW_GOAL `x SUBSET ball (v1:real^3, &8)`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC MCELL_SUBSET_BALL8);;
e (REWRITE_TAC[GSYM (ASSUME `x = mcell i V ul`)] THEN ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `(x:real^3->bool) x'` THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (EXISTS_TAC `i:num` THEN EXISTS_TAC `ul:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (REWRITE_TAC[ASSUME `t:real^3->bool = x INTER E`]);;
e (ASM_REWRITE_TAC[]);;
(* ========================================================================= *)
e (REWRITE_TAC[SUBSET; IN_UNIONS]);;
e (REPEAT STRIP_TAC);;
e (NEW_GOAL `?v:real^3. v IN V /\ x IN voronoi_closed V v`);;
e (ASM_SIMP_TAC[TIWWFYQ]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (UP_ASM_TAC THEN REWRITE_WITH
`x IN voronoi_closed V v <=> (?vl. vl IN barV V 3 /\ x IN rogers V vl /\
truncate_simplex 0 vl = [v])`);;
e (ASM_SIMP_TAC[GLTVHUM]);;
e (REWRITE_TAC[IN] THEN STRIP_TAC);;
e (NEW_GOAL `?i. i <= 4 /\ x IN mcell i V vl`);;
e (ASM_SIMP_TAC[IN;SLTSTLO1]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ABBREV_TAC `X = mcell i V vl`);;
e (NEW_GOAL `~NULLSET (X INTER E) ==> F`);;
e (STRIP_TAC);;
e (NEW_GOAL `?k ul.
2 <= k /\
barV V 3 ul /\
X = mcell k V ul /\
truncate_simplex 1 ul = [u0; u1]`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (STRIP_TAC);;
e (REWRITE_TAC[mcell_set; IN_ELIM_THM; IN]);;
e (EXISTS_TAC `i:num` THEN EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `X INTER (D:real^3->bool)`);;
e (STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "E" THEN SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (MP_TAC (ASSUME `x IN
E DIFF
UNIONS
{y | ?x. x IN
{X | mcell_set V X /\
edgeX V X e /\
(!x. x IN X ==> x IN wedge_ge u0 u1 n1 n2)} /\
y = x INTER E}`));;
e (REWRITE_TAC[IN_DIFF; MESON[] `~(A /\ ~B) <=> ~A \/ B`]);;
e (DISJ2_TAC);;
e (REWRITE_TAC[IN_UNIONS; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `X INTER (E:real^3->bool)`);;
e (STRIP_TAC);;
e (EXISTS_TAC `(X:real^3->bool)`);;
e (REWRITE_TAC[mcell_set; IN; IN_ELIM_THM] THEN STRIP_TAC);;
e (EXISTS_TAC `i:num` THEN EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[edgeX; IN_ELIM_THM]);;
e (STRIP_TAC);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);;
e (STRIP_TAC);;
e (NEW_GOAL `VX V X = V INTER X`);;
e (MATCH_MP_TAC Hdtfnfz.HDTFNFZ);;
e (EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `(if k < 4 then k else 4)`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (COND_CASES_TAC);;
e (MESON_TAC[]);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN ASM_REWRITE_TAC[]);;
e (MESON_TAC[NEGLIGIBLE_SUBSET; SET_RULE `A INTER B SUBSET A`]);;
e (NEW_GOAL `(V:real^3->bool) INTER X =
set_of_list (truncate_simplex ((if k < 4 then k else 4) - 1) ul)`);;
e (REWRITE_WITH `X = mcell (if k < 4 then k else 4) V ul`);;
e (ASM_REWRITE_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (MATCH_MP_TAC Lepjbdj.LEPJBDJ);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (STRIP_TAC);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (REWRITE_WITH `mcell (if k < 4 then k else 4) V ul = X`);;
e (ASM_REWRITE_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN
REWRITE_TAC[ASSUME `X = {}:real^3->bool`; SET_RULE `{} INTER x = {}`;
NEGLIGIBLE_EMPTY]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `set_of_list (truncate_simplex 1 (ul:(real^3)list)) SUBSET
set_of_list (truncate_simplex ((if k < 4 then k else 4) - 1) ul)`);;
e (MATCH_MP_TAC Rogers.TRUNCATE_SIMPLEX_SUBSET);;
e (REWRITE_WITH `LENGTH ul = 3 + 1 /\
CARD (set_of_list (ul:(real^3)list)) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (REWRITE_TAC[MESON[IN] `(s:real^3->bool) u <=> u IN s`]);;
e (UP_ASM_TAC THEN REWRITE_TAC[ASSUME `truncate_simplex 1 ul = [u0; u1:real^3]`;
set_of_list]);;
e (SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[MESON[IN] `(X:real^3->bool) a <=> a IN X`]);;
e (REWRITE_TAC[GSYM SUBSET]);;
e (NEW_GOAL `X SUBSET wedge_ge u0 u1 n1 n2 \/ X SUBSET wedge_ge u0 u1 n2 n1`);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (STRIP_TAC);;
e (REWRITE_TAC[mcell_set; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `k:num` THEN EXISTS_TAC `ul:(real^3)list` THEN ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[edgeX; IN; IN_ELIM_THM]);;
e (EXISTS_TAC `u0:real^3` THEN EXISTS_TAC `u1:real^3`);;
e (NEW_GOAL `VX V X = V INTER X`);;
e (MATCH_MP_TAC Hdtfnfz.HDTFNFZ);;
e (EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `(if k < 4 then k else 4)`);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (COND_CASES_TAC);;
e (MESON_TAC[]);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN ASM_REWRITE_TAC[]);;
e (MESON_TAC[NEGLIGIBLE_SUBSET; SET_RULE `A INTER B SUBSET A`]);;
e (NEW_GOAL `(V:real^3->bool) INTER X =
set_of_list (truncate_simplex ((if k < 4 then k else 4) - 1) ul)`);;
e (REWRITE_WITH `X = mcell (if k < 4 then k else 4) V ul`);;
e (ASM_REWRITE_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (MATCH_MP_TAC Lepjbdj.LEPJBDJ);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (STRIP_TAC);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (REWRITE_WITH `mcell (if k < 4 then k else 4) V ul = X`);;
e (ASM_REWRITE_TAC[]);;
e (COND_CASES_TAC);;
e (REFL_TAC);;
e (NEW_GOAL `k >= 4`);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; ARITH_RULE `4 >= 4`; ]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN
REWRITE_TAC[ASSUME `X = {}:real^3->bool`; SET_RULE `{} INTER x = {}`;
NEGLIGIBLE_EMPTY]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `set_of_list (truncate_simplex 1 (ul:(real^3)list)) SUBSET
set_of_list (truncate_simplex ((if k < 4 then k else 4) - 1) ul)`);;
e (MATCH_MP_TAC Rogers.TRUNCATE_SIMPLEX_SUBSET);;
e (REWRITE_WITH `LENGTH ul = 3 + 1 /\
CARD (set_of_list (ul:(real^3)list)) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `2 <= k` THEN ARITH_TAC);;
e (REWRITE_TAC[MESON[IN] `(s:real^3->bool) u <=> u IN s`]);;
e (UP_ASM_TAC THEN REWRITE_TAC[ASSUME `truncate_simplex 1 ul = [u0; u1:real^3]`;
set_of_list]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `F`);;
e (NEW_GOAL
`X INTER E SUBSET (wedge_ge u0 u1 n1 n2 INTER wedge_ge u0 u1 n2 n1)`);;
e (REWRITE_TAC[SUBSET_INTER]);;
e (STRIP_TAC);;
e (EXPAND_TAC "E" THEN SET_TAC[]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (UNDISCH_TAC `~NULLSET (X INTER E)` THEN REWRITE_TAC[]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `wedge_ge u0 u1 n1 n2 INTER wedge_ge u0 u1 n2 n1`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `aff_ge {u0,u1} {n1} UNION aff_ge {u0,u1} {n2:real^3}`);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_UNION);;
e (STRIP_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0,u1,n1:real^3}`);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[SET_RULE `{a,b,c} = {a,b} UNION {c}`;
AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {u0,u1,n2:real^3}`);;
e (REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);;
e (REWRITE_TAC[SET_RULE `{a,b,c} = {a,b} UNION {c}`;
AFF_GE_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC INTER_2_WEDGE_GE_SUBSET_UNION_2_AFF_GE_LEMMA);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (NEW_GOAL `(x:real^3) IN E`);;
e (UNDISCH_TAC `x IN
E DIFF
UNIONS
{y | ?x. x IN
{X | mcell_set V X /\
edgeX V X e /\
(!x. x IN X ==> x IN wedge_ge u0 u1 n1 n2)} /\
y = x INTER E}` THEN SET_TAC[]);;
e (REWRITE_TAC[MESON[IN] `(X INTER Y) a <=> a IN (X INTER Y)`]);;
e (REWRITE_TAC[IN_INTER]);;
e (ASM_REWRITE_TAC[]);;
e (EXISTS_TAC `X INTER (E:real^3 ->bool)`);;
e (STRIP_TAC);;
e (REWRITE_TAC[IN_ELIM_THM]);;
e (EXISTS_TAC `X:real^3->bool`);;
e (ASM_REWRITE_TAC[mcell_set; IN_ELIM_THM]);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN] THEN REPEAT STRIP_TAC);;
e (EXISTS_TAC `i:num` THEN EXISTS_TAC `vl:(real^3)list`);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `(x:real^3) IN X INTER E`);;
e (REWRITE_TAC[IN_INTER]);;
e (ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `x IN
E DIFF
UNIONS
{y | ?x. x IN
{X | mcell_set V X /\
edgeX V X e /\
(!x. x IN X ==> x IN wedge_ge u0 u1 n1 n2)} /\
y = x INTER E}` THEN SET_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[MESON[IN] `(X INTER Y) a <=> a IN (X INTER Y)`]);;
e (REWRITE_TAC[IN_INTER]);;
e (ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `x IN
E DIFF
UNIONS
{y | ?x. x IN
{X | mcell_set V X /\
edgeX V X e /\
(!x. x IN X ==> x IN wedge_ge u0 u1 n1 n2)} /\
y = x INTER E}` THEN SET_TAC[]);;
e (UP_ASM_TAC THEN
REWRITE_WITH `sum s (\t. vol (t INTER E)) = sum s (\t. vol (t INTER D))`);;
e (MATCH_MP_TAC SUM_EQ);;
e (EXPAND_TAC "s" THEN REWRITE_TAC[IN; IN_ELIM_THM; BETA_THM] THEN
REPEAT STRIP_TAC);;
e (AP_TERM_TAC);;
e (EXPAND_TAC "E" THEN UP_ASM_TAC THEN SET_TAC[]);;
(* ========================================================================= *)
e (ABBREV_TAC
`t = {X | mcell_set V X /\ edgeX V X e /\ X SUBSET wedge_ge u0 u1 n1 n2 /\
~NULLSET (X INTER D)}`);;
e (REWRITE_WITH `sum s (\t. dihX V t (u0,u1)) =
sum t (\t. dihX V t (u0,u1))`);;
e (MATCH_MP_TAC SUM_SUPERSET);;
e (EXPAND_TAC "s" THEN EXPAND_TAC "t" THEN REPEAT STRIP_TAC);;
e (SET_TAC[]);;
e (NEW_GOAL `NULLSET (x INTER D)`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REWRITE_TAC[IN; IN_ELIM_THM] );;
e (MESON_TAC[]);;
e (NEW_GOAL `mcell_set V x /\ edgeX V x e`);;
e (UNDISCH_TAC
`x IN {X | mcell_set V X /\ edgeX V X e /\ X SUBSET wedge_ge u0 u1 n1 n2}`);;
e (REWRITE_TAC[IN; IN_ELIM_THM]);;
e (MESON_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[mcell_set_2; IN_ELIM_THM;IN] THEN STRIP_TAC);;
e (NEW_GOAL `~NULLSET x`);;
e (UP_ASM_TAC THEN REWRITE_TAC[edgeX; VX; IN_ELIM_THM]);;
e (COND_CASES_TAC THEN REPEAT STRIP_TAC);;
e (UNDISCH_TAC `{} (u:real^3)` THEN REWRITE_TAC[MESON[IN] `{} x <=> x IN {}`]);;
e (SET_TAC[]);;
e (NEW_GOAL `VX V x = V INTER (x:real^3->bool)`);;
e (MATCH_MP_TAC Hdtfnfz.HDTFNFZ);;
e (EXISTS_TAC `ul:(real^3)list` THEN EXISTS_TAC `i:num`);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `V INTER (x:real^3->bool) =
set_of_list (truncate_simplex (i - 1) ul)`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC Lepjbdj.LEPJBDJ);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (ASM_CASES_TAC `i = 0`);;
e (NEW_GOAL `V INTER (x:real^3->bool) = {}`);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC Lepjbdj.LEPJBDJ_0);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `edgeX V x e` THEN REWRITE_TAC[edgeX; IN_ELIM_THM]);;
e (STRIP_TAC);;
e (UNDISCH_TAC `VX V x u` THEN ASM_REWRITE_TAC[MESON[IN] `{} x <=> x IN {}`]);;
e (SET_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (REWRITE_TAC[GSYM (ASSUME `x = mcell i V ul`)] THEN STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET x` THEN REWRITE_TAC[ASSUME `x:real^3->bool = {}`;
NEGLIGIBLE_EMPTY]);;
e (NEW_GOAL `(u0:real^3) IN VX V x /\ u1 IN VX V x`);;
e (UNDISCH_TAC `edgeX V x e` THEN REWRITE_TAC[edgeX; IN_ELIM_THM;
ASSUME `e = {u0, u1:real^3}`]);;
e (STRIP_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
(* ========================================================================== *)
e (NEW_GOAL `F`);;
e (ASM_CASES_TAC `i <= 1`);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2 ;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `i - 1 = 0`);;
e (UNDISCH_TAC `i <= 1` THEN ARITH_TAC);;
e (UNDISCH_TAC `u0 IN VX V x /\ u1 IN VX V x`);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_0; set_of_list]);;
e (UNDISCH_TAC `~(u0 = u1:real^3)` THEN SET_TAC[]);;
e (ASM_CASES_TAC `i = 3`);;
e (NEW_GOAL `vol (x INTER D) > &0`);;
e (ONCE_REWRITE_TAC[SET_RULE `a INTER b = b INTER a`]);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2 ;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell3; TRUNCATE_SIMPLEX_EXPLICIT_2;
set_of_list; SET_RULE `{a,c,d} UNION {x} = {a,c,d,x}`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `i - 1 = 2`);;
e (UNDISCH_TAC `i = 3` THEN ARITH_TAC);;
e (UNDISCH_TAC `u0 IN VX V x /\ u1 IN VX V x`);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list]);;
e (STRIP_TAC);;
e (NEW_GOAL `?v:real^3. {u0, u1, v} = {v0, v1, v2}`);;
e (NEW_GOAL `?v:real^3. v IN {v0, v1, v2} DIFF {u0, u1}`);;
e (REWRITE_TAC[SET_RULE `(?x. x IN s) <=> ~(s = {})`]);;
e (REWRITE_WITH `{v0, v1, v2} DIFF {u0, u1:real^3} = {} <=>
CARD ({v0, v1, v2} DIFF {u0, u1}) = 0`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC CARD_EQ_0);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{v0, v1, v2:real^3}`);;
e (REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `~(a = 0) <=> 1 <= a`]);;
e (NEW_GOAL `CARD {v0, v1, v2} = CARD ({v0, v1, v2} DIFF {u0, u1:real^3}) +
CARD {u0, u1}`);;
e (MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);;
e (ASM_REWRITE_TAC[Geomdetail.FINITE6]);;
e (UP_ASM_TAC THEN REWRITE_WITH `CARD ({v0, v1, v2:real^3}) = 3`);;
e (REWRITE_WITH `{v0, v1, v2:real^3} = set_of_list (truncate_simplex 2 ul)`);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_2; set_of_list]);;
e (ABBREV_TAC `xl = truncate_simplex 2 (ul:(real^3)list)`);;
e (REWRITE_WITH `LENGTH (xl:(real^3)list) = 2 + 1 /\
CARD (set_of_list xl) = 2 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "xl" THEN MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV);;
e (EXISTS_TAC `3` THEN ASM_REWRITE_TAC[ARITH_RULE `2 <= 3`]);;
e (ARITH_TAC);;
e (NEW_GOAL `CARD {u0, u1:real^3} <= 2`);;
e (REWRITE_TAC[Geomdetail.CARD2]);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v:real^3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN
UNDISCH_TAC `~(u0 = u1:real^3)` THEN SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `{v0, v1, v2, mxi V [v0; v1; v2; v3]} =
{u0, u1, v, mxi V [v0; v1; v2; v3]}`);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC CONIC_CAP_INTER_CONVEX_HULL_4_GT_0);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[GSYM (ASSUME `{v0, v1, v2, mxi V [v0; v1; v2; v3]} =
{u0, u1, v, mxi V [v0; v1; v2; v3]}`)] THEN STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET x`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2]);;
e (REWRITE_TAC[SET_RULE `{a,b,c} UNION {d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, mxi V [v0; v1; v2; v3]}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET x`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell3; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_2]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (NEW_GOAL `vol (x INTER D) = &0`);;
e (MATCH_MP_TAC MEASURE_EQ_0);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
(* ========================================== *)
e (ASM_CASES_TAC `i = 4`);;
e (NEW_GOAL `vol (x INTER D) > &0`);;
e (ONCE_REWRITE_TAC[SET_RULE `a INTER b = b INTER a`]);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2 ;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_SIMP_TAC[MCELL_EXPLICIT; mcell4; ARITH_RULE `4 >= 4`;
set_of_list]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `i - 1 = 3`);;
e (UNDISCH_TAC `i = 4` THEN ARITH_TAC);;
e (UNDISCH_TAC `u0 IN VX V x /\ u1 IN VX V x`);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_3; set_of_list]);;
e (STRIP_TAC);;
e (NEW_GOAL `?v w:real^3. {u0, u1, v, w} = {v0, v1, v2, v3}`);;
e (NEW_GOAL `?v:real^3. v IN {v0, v1, v2, v3} DIFF {u0, u1}`);;
e (REWRITE_TAC[SET_RULE `(?x. x IN s) <=> ~(s = {})`]);;
e (REWRITE_WITH `{v0, v1, v2, v3} DIFF {u0, u1:real^3} = {} <=>
CARD ({v0, v1, v2, v3} DIFF {u0, u1}) = 0`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC CARD_EQ_0);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{v0, v1, v2, v3:real^3}`);;
e (REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `~(a = 0) <=> 1 <= a`]);;
e (NEW_GOAL `CARD {v0, v1, v2, v3} =
CARD ({v0, v1, v2, v3} DIFF {u0, u1:real^3}) + CARD {u0, u1}`);;
e (MATCH_MP_TAC Hypermap.CARD_MINUS_DIFF_TWO_SET);;
e (ASM_REWRITE_TAC[Geomdetail.FINITE6]);;
e (UP_ASM_TAC THEN REWRITE_WITH `CARD ({v0, v1, v2, v3:real^3}) = 3 + 1`);;
e (REWRITE_WITH `{v0, v1, v2, v3:real^3} = set_of_list ul`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `CARD {u0, u1:real^3} <= 2`);;
e (REWRITE_TAC[Geomdetail.CARD2]);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (NEW_GOAL `?w:real^3. w IN {v0, v1, v2, v3} DIFF {u0, u1, v}`);;
e (REWRITE_TAC[SET_RULE `(?x. x IN s) <=> ~(s = {})`]);;
e (REWRITE_WITH `{v0, v1, v2, v3} DIFF {u0, u1, v:real^3} = {} <=>
CARD ({v0, v1, v2, v3} DIFF {u0, u1, v}) = 0`);;
e (ONCE_REWRITE_TAC[EQ_SYM_EQ]);;
e (MATCH_MP_TAC CARD_EQ_0);;
e (MATCH_MP_TAC FINITE_SUBSET);;
e (EXISTS_TAC `{v0, v1, v2, v3:real^3}`);;
e (REWRITE_TAC[Geomdetail.FINITE6] THEN SET_TAC[]);;
e (REWRITE_TAC[ARITH_RULE `~(a = 0) <=> 1 <= a`]);;
e (NEW_GOAL `CARD ({v0, v1, v2, v3} DIFF {u0, u1,v:real^3}) =
CARD {v0, v1, v2, v3} - CARD {u0,u1,v}`);;
e (MATCH_MP_TAC CARD_DIFF);;
e (ASM_REWRITE_TAC[Geomdetail.FINITE6]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_WITH `CARD ({v0, v1, v2, v3:real^3}) = 3 + 1`);;
e (REWRITE_WITH `{v0, v1, v2, v3:real^3} = set_of_list ul`);;
e (ASM_REWRITE_TAC[set_of_list]);;
e (REWRITE_WITH `LENGTH (ul:(real^3)list) = 3 + 1 /\
CARD (set_of_list ul) = 3 + 1`);;
e (MATCH_MP_TAC Rogers.BARV_IMP_LENGTH_EQ_CARD);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `CARD {u0, u1, v:real^3} <= 3`);;
e (REWRITE_TAC[Geomdetail.CARD3]);;
e (UP_ASM_TAC THEN ARITH_TAC);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (EXISTS_TAC `v:real^3` THEN EXISTS_TAC `w:real^3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN
UNDISCH_TAC `~(u0 = u1:real^3)` THEN SET_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_TAC[GSYM (ASSUME `{u0:real^3, u1, v, w} = {v0, v1, v2, v3}`)]);;
e (MATCH_MP_TAC CONIC_CAP_INTER_CONVEX_HULL_4_GT_0);;
e (ASM_REWRITE_TAC[]);;
e (STRIP_TAC);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (STRIP_TAC);;
e (UNDISCH_TAC `~NULLSET x`);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list; ARITH_RULE `4 >= 4`;
ASSUME `x = mcell i V ul`; ASSUME `i = 4`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (COND_CASES_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull {v0, v1, v2, v3:real^3}`);;
e (REWRITE_TAC[CONVEX_HULL_SUBSET_AFFINE_HULL]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET x`);;
e (SIMP_TAC[MCELL_EXPLICIT; mcell4; set_of_list; ARITH_RULE `4 >= 4`;
ASSUME `x = mcell i V ul`; ASSUME `i = 4`;
ASSUME `ul = [v0; v1; v2; v3:real^3]`]);;
e (COND_CASES_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (NEW_GOAL `vol (x INTER D) = &0`);;
e (MATCH_MP_TAC MEASURE_EQ_0);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
(* ========================================== *)
e (NEW_GOAL `i = 2`);;
e (UNDISCH_TAC `i <= 4` THEN UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC
THEN ARITH_TAC);;
e (NEW_GOAL `vol (x INTER D) > &0`);;
e (ONCE_REWRITE_TAC[SET_RULE `a INTER b = b INTER a`]);;
e (NEW_GOAL `?v0 v1 v2 v3. ul = [v0; v1; v2 ;v3:real^3]`);;
e (MATCH_MP_TAC BARV_3_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2; TRUNCATE_SIMPLEX_EXPLICIT_1;
set_of_list; HD; TL]);;
e (LET_TAC);;
e (COND_CASES_TAC);;
e (NEW_GOAL `i - 1 = 1`);;
e (UNDISCH_TAC `i = 2` THEN ARITH_TAC);;
e (UNDISCH_TAC `u0 IN VX V x /\ u1 IN VX V x`);;
e (ASM_REWRITE_TAC[TRUNCATE_SIMPLEX_EXPLICIT_1; set_of_list]);;
e (STRIP_TAC);;
e (NEW_GOAL `{u0, u1} = {v0, v1:real^3}`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UNDISCH_TAC `~(u0 = u1:real^3)` THEN
SET_TAC[]);;
e (REWRITE_TAC[SET_RULE `A INTER B INTER C INTER D =
(A INTER (B INTER C)) INTER D`]);;
e (REWRITE_WITH `rcone_ge v0 v1 a' INTER rcone_ge v1 v0 a' =
rcone_ge u0 u1 a' INTER rcone_ge u1 (u0:real^3) a'`);;
e (ASM_CASES_TAC `u0:real^3 = v0`);;
e (NEW_GOAL `u1 = v1:real^3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (NEW_GOAL `u0 = v1:real^3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (NEW_GOAL `u1 = v0:real^3`);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (SET_TAC[]);;
e (REWRITE_WITH
`conic_cap u0 u1 r d INTER rcone_ge u0 u1 a' INTER rcone_ge u1 u0 a' =
conic_cap (u0:real^3) u1 r d`);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> A INTER B = A`));;
e (NEW_GOAL `conic_cap (u0:real^3) u1 r d SUBSET rcone_ge u0 u1 a'`);;
e (REWRITE_TAC[conic_cap]);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A SUBSET B`));;
e (NEW_GOAL `rcone_gt u0 u1 d SUBSET rcone_gt (u0:real^3) u1 a'`);;
e (MATCH_MP_TAC RCONE_GT_SUBSET);;
e (EXPAND_TAC "d" THEN EXPAND_TAC "c");;
e (MATCH_MP_TAC (REAL_ARITH `a = x ==> a <= max (max y x) (max z t)`));;
e (EXPAND_TAC "a'" THEN REWRITE_TAC[HL; set_of_list] THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `rcone_gt u0 u1 a' SUBSET rcone_ge (u0:real^3) u1 a'`);;
e (REWRITE_TAC[RCONE_GT_SUBSET_RCONE_GE]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (REWRITE_TAC[SUBSET_INTER] THEN STRIP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (REWRITE_TAC[SUBSET]);;
e (REPEAT STRIP_TAC);;
e (MATCH_MP_TAC Marchal_cells_2_new.RCONEGE_INTER_VORONOI_CLOSED_IMP_RCONEGE);;
e (EXISTS_TAC `V:real^3->bool`);;
e (ASM_REWRITE_TAC[]);;
e (REPEAT STRIP_TAC);;
e (REWRITE_WITH `a' = hl [u0; u1:real^3] / sqrt (&2)`);;
e (EXPAND_TAC "a'");;
e (REWRITE_TAC[HL; set_of_list] THEN ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC REAL_LT_DIV);;
e (REWRITE_TAC[HL_2]);;
e (STRIP_TAC);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (REWRITE_TAC[REAL_ARITH `&0 < inv (&2)`]);;
e (MATCH_MP_TAC DIST_POS_LT);;
e (ASM_REWRITE_TAC[]);;
e (MATCH_MP_TAC SQRT_POS_LT);;
e (REAL_ARITH_TAC);;
e (EXPAND_TAC "a'");;
e (MATCH_MP_TAC REAL_DIV_LE_1_TACTICS);;
e (STRIP_TAC);;
e (MATCH_MP_TAC SQRT_POS_LT);;
e (REAL_ARITH_TAC);;
e (MATCH_MP_TAC (REAL_ARITH `a < b ==> a <= b`));;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (NEW_GOAL `x':real^3 IN ball (u0, (&1))`);;
e (UP_ASM_TAC THEN REWRITE_TAC[conic_cap;NORMBALL_BALL] THEN STRIP_TAC);;
e (NEW_GOAL `ball (u0, r) SUBSET ball (u0:real^3, &1)`);;
e (MATCH_MP_TAC SUBSET_BALL);;
e (EXPAND_TAC "r");;
e (REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN SET_TAC[]);;
e (UP_ASM_TAC THEN REWRITE_TAC[IN_BALL] THEN ONCE_REWRITE_TAC[DIST_SYM]
THEN STRIP_TAC);;
e (REWRITE_TAC[voronoi_closed; IN; IN_ELIM_THM]);;
e (REPEAT STRIP_TAC);;
e (ASM_CASES_TAC `u0 = w:real^3`);;
e (ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC);;
e (NEW_GOAL `&2 <= dist (u0, w:real^3)`);;
e (UNDISCH_TAC `packing (V:real^3->bool)` THEN REWRITE_TAC[packing]);;
e (STRIP_TAC);;
e (FIRST_ASSUM MATCH_MP_TAC);;
e (ASM_REWRITE_TAC[]);;
e (UNDISCH_TAC `u0:real^3 IN V` THEN REWRITE_TAC[IN]);;
e (NEW_GOAL `dist (x', u0) >= dist (u0, w) - dist (x', w:real^3)`);;
e (NORM_ARITH_TAC);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN DEL_TAC THEN DEL_TAC THEN UP_ASM_TAC
THEN REAL_ARITH_TAC);;
e (ABBREV_TAC `M = mxi V [v0; v1; v2; v3]`);;
e (ABBREV_TAC `R = omega_list_n V [v0; v1; v2; v3] 3`);;
e (NEW_GOAL `vol (conic_cap u0 u1 r d INTER convex hull {v0:real^3,v1,M,R})
<= vol (conic_cap u0 u1 r d INTER aff_ge {v0, v1} {M, R})`);;
e (MATCH_MP_TAC MEASURE_SUBSET);;
e (REPEAT STRIP_TAC);;
e (MATCH_MP_TAC MEASURABLE_INTER);;
e (REWRITE_TAC[MEASURABLE_CONIC_CAP]);;
e (MATCH_MP_TAC MEASURABLE_CONVEX_HULL);;
e (MATCH_MP_TAC FINITE_IMP_BOUNDED);;
e (REWRITE_TAC[Geomdetail.FINITE6]);;
e (REWRITE_TAC[conic_cap; NORMBALL_BALL]);;
e (ONCE_REWRITE_TAC[SET_RULE `(a INTER b) INTER c =
(a INTER b) INTER (a INTER c)`]);;
e (MATCH_MP_TAC MEASURABLE_INTER);;
e (REWRITE_TAC[MEASURABLE_BALL_AFF_GE]);;
e (REWRITE_TAC[GSYM conic_cap; GSYM NORMBALL_BALL; MEASURABLE_CONIC_CAP]);;
e (MATCH_MP_TAC (SET_RULE `A SUBSET B ==> C INTER A SUBSET C INTER B`));;
e (REWRITE_TAC[Marchal_cells_2_new.CONVEX_HULL_4_SUBSET_AFF_GE_2_2]);;
e (NEW_GOAL `vol (conic_cap u0 u1 r d INTER convex hull {v0, v1, M, R}) > &0`);;
e (REWRITE_WITH `{v0, v1, M, R} = {u0, u1, M, R:real^3}`);;
e (UNDISCH_TAC `{u0, u1} = {v0, v1:real^3}` THEN SET_TAC[]);;
e (MATCH_MP_TAC CONIC_CAP_INTER_CONVEX_HULL_4_GT_0);;
e (ASM_REWRITE_TAC[]);;
e (REPEAT STRIP_TAC);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (UNDISCH_TAC `~NULLSET x`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (LET_TAC);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `aff_ge {v0, v1} {M, R:real^3}`);;
e (REWRITE_TAC[SET_RULE `a INTER B INTER c SUBSET c`]);;
e (MATCH_MP_TAC NEGLIGIBLE_SUBSET);;
e (EXISTS_TAC `affine hull ({v0, v1} UNION {M, R:real^3})`);;
e (REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL; SET_RULE
`{a, b} UNION {c, d} = {a,b,c,d}`]);;
e (MATCH_MP_TAC COPLANAR_IMP_NEGLIGIBLE);;
e (REWRITE_TAC[COPLANAR_AFFINE_HULL_COPLANAR]);;
e (REWRITE_WITH `{v0, v1, M, R} = {u0, u1, M, R:real^3}`);;
e (UNDISCH_TAC `{u0, u1} = {v0, v1:real^3}` THEN SET_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (NEW_GOAL `F`);;
e (UNDISCH_TAC `~NULLSET x`);;
e (ASM_REWRITE_TAC[MCELL_EXPLICIT; mcell2; set_of_list;
TRUNCATE_SIMPLEX_EXPLICIT_1; HD; TL]);;
e (REWRITE_TAC[NEGLIGIBLE_EMPTY]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (NEW_GOAL `vol (x INTER D) = &0`);;
e (MATCH_MP_TAC MEASURE_EQ_0);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
(* ========================================== *)
e (REWRITE_WITH `sum s (\t. vol (t INTER D)) =
sum t (\t. vol (t INTER D))`);;
e (MATCH_MP_TAC SUM_SUPERSET);;
e (EXPAND_TAC "s" THEN EXPAND_TAC "t" THEN REPEAT STRIP_TAC);;
e (SET_TAC[]);;
e (MATCH_MP_TAC MEASURE_EQ_0);;
e (UP_ASM_TAC THEN UP_ASM_TAC THEN REWRITE_TAC[IN; IN_ELIM_THM] );;
e (MESON_TAC[]);;
e (REWRITE_WITH `sum t (\t. vol (t INTER D)) =
sum t (\t. vol D * dihX V t (u0,u1) / (&2 * pi))`);;
e (MATCH_MP_TAC SUM_EQ);;
e (EXPAND_TAC "t" THEN REWRITE_TAC[IN_ELIM_THM; IN] THEN REPEAT STRIP_TAC);;
e (ASM_SIMP_TAC[]);;
e (REWRITE_TAC[REAL_ARITH `a * b / c = (a / c) * b`]);;
e (REWRITE_TAC[SUM_LMUL]);;
e (ABBREV_TAC `R = sum t (\t. dihX V t (u0,u1))`);;
e (REWRITE_WITH `vol E = vol D * azim u0 u1 n1 n2 / (&2 * pi)`);;
e (EXPAND_TAC "E" THEN
REWRITE_TAC[ASSUME `D:real^3->bool = conic_cap u0 u1 r d`]);;
e (MATCH_MP_TAC VOLUME_CONIC_CAP_WEDGE_GE_VS_CONIC_CAP);;
e (REPEAT STRIP_TAC);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (ASM_REWRITE_TAC[]);;
e (EXPAND_TAC "r" THEN REAL_ARITH_TAC);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (NEW_GOAL `?a0 a1 a2. vl1 = [a0;a1;a2:real^3]`);;
e (MATCH_MP_TAC Qzksykg.BARV_2_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN
ASM_REWRITE_TAC[MESON[IN] `barV V 2 vl1 <=> vl1 IN barV V 2`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `{u0,u1,n1:real^3} = set_of_list vl1`);;
e (ASM_REWRITE_TAC[set_of_list; EL; HD; TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `{a0, a1:real^3} = {u0,u1}`);;
e (REWRITE_TAC[GSYM (ASSUME `e = {u0,u1:real^3}`);
GSYM (ASSUME `set_of_list (truncate_simplex 1 vl1) = e:real^3->bool`)]);;
e (REWRITE_TAC[ASSUME `vl1 = [a0; a1; a2:real^3]`; TRUNCATE_SIMPLEX_EXPLICIT_1;
set_of_list]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC BARV_2_IMP_NOT_COLLINEAR_SET_OF_LIST);;
e (EXISTS_TAC `V:real^3->bool` THEN
ASM_REWRITE_TAC[MESON[IN] `barV V 2 vl1 <=> vl1 IN barV V 2`]);;
e (UP_ASM_TAC THEN REWRITE_TAC[]);;
e (NEW_GOAL `?a0 a1 a2. vl2 = [a0;a1;a2:real^3]`);;
e (MATCH_MP_TAC Qzksykg.BARV_2_EXPLICIT);;
e (EXISTS_TAC `V:real^3->bool` THEN
ASM_REWRITE_TAC[MESON[IN] `barV V 2 vl2 <=> vl2 IN barV V 2`]);;
e (UP_ASM_TAC THEN STRIP_TAC);;
e (REWRITE_WITH `{u0,u1,n2:real^3} = set_of_list vl2`);;
e (ASM_REWRITE_TAC[set_of_list; EL; HD; TL; ARITH_RULE `2 = SUC 1 /\ 1 = SUC 0`]);;
e (NEW_GOAL `{a0, a1:real^3} = {u0,u1}`);;
e (REWRITE_TAC[GSYM (ASSUME `e = {u0,u1:real^3}`);
GSYM (ASSUME `set_of_list (truncate_simplex 1 vl2) = e:real^3->bool`)]);;
e (REWRITE_TAC[ASSUME `vl2 = [a0; a1; a2:real^3]`; TRUNCATE_SIMPLEX_EXPLICIT_1;
set_of_list]);;
e (UP_ASM_TAC THEN SET_TAC[]);;
e (MATCH_MP_TAC BARV_2_IMP_NOT_COLLINEAR_SET_OF_LIST);;
e (EXISTS_TAC `V:real^3->bool` THEN
ASM_REWRITE_TAC[MESON[IN] `barV V 2 vl2 <=> vl2 IN barV V 2`]);;
e (REWRITE_TAC[REAL_ARITH `a / b * c = (a * c) / b`]);;
e (REWRITE_WITH
`(vol D * R) / (&2 * pi) = vol D * azim u0 u1 n1 n2 / (&2 * pi) <=>
(vol D * R) = (vol D * azim u0 u1 n1 n2 / (&2 * pi)) * (&2 * pi)`);;
e (MATCH_MP_TAC REAL_EQ_LDIV_EQ);;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (REWRITE_TAC[PI_POS]);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `(a * b / c) * c = (a * b) * c/c`]);;
e (REWRITE_WITH `(&2 * pi) / (&2 * pi) = &1`);;
e (MATCH_MP_TAC REAL_DIV_REFL);;
e (MATCH_MP_TAC (REAL_ARITH `&0 < a ==> ~(a = &0)`));;
e (MATCH_MP_TAC REAL_LT_MUL);;
e (REWRITE_TAC[PI_POS]);;
e (REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `a * x = (a * t) * &1 <=> a * (x - t) = &0`]);;
e (REWRITE_TAC[REAL_ENTIRE]);;
e (STRIP_TAC);;
e (NEW_GOAL `F`);;
e (UP_ASM_TAC THEN ASM_REWRITE_TAC[]);;
e (NEW_GOAL `&0 < d`);;
e (EXPAND_TAC "d" THEN UNDISCH_TAC `&0 < c /\ c < &1` THEN REAL_ARITH_TAC);;
e (ASM_SIMP_TAC[VOLUME_CONIC_CAP]);;
e (COND_CASES_TAC);;
e (REWRITE_TAC[]);;
e (UNDISCH_TAC `d < &1` THEN UNDISCH_TAC `&0 < r` THEN UP_ASM_TAC
THEN REAL_ARITH_TAC);;
e (REWRITE_TAC[REAL_ARITH `&2 / &3 * a = &0 <=> a = &0`]);;
e (REWRITE_TAC[REAL_ENTIRE]);;
e (NEW_GOAL `~(pi = &0)`);;
e (MP_TAC PI_POS THEN REAL_ARITH_TAC);;
e (NEW_GOAL `~(&1 - d = &0)`);;
e (UNDISCH_TAC `d < &1` THEN REAL_ARITH_TAC);;
e (NEW_GOAL `~(r pow 3 = &0)`);;
e (MATCH_MP_TAC REAL_POW_NZ);;
e (UNDISCH_TAC `&0 < r` THEN REAL_ARITH_TAC);;
e (ASM_REWRITE_TAC[]);;
e (UP_ASM_TAC THEN MESON_TAC[]);;
e (UP_ASM_TAC THEN REAL_ARITH_TAC);;
let REUHADY = top_thm();;