(* ========================================================================== *) (* FLYSPECK - BOOK FORMALIZATION *) (* *) (* Chapter: Fan *) (* Author: Hoang Le Truong *) (* Date: 2010-02-09 *) (* ========================================================================== *) module Leads_intos = struct open Sphere;; open Fan_defs;; open Hypermap_of_fan;; open Tactic_fan;; open Lemma_fan;; open Fan;; open Hypermap_of_fan;; open Node_fan;; open Azim_node;; open Sum_azim_node;; open Disjoint_fan;; open Lead_fan;; open Fan_misc;; open Leads_into_fan;; open Fully_surrounded;; open Sin_azim_cross_dot;; (* ========================================================================== *) (* FAN AND CONVEX *) (* ========================================================================== *)let origin_point_not1_in_convex_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3). FAN(x,V,E) /\ {v,u} IN E ==> ~(x IN convex hull{v,u})`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] remark1_fan) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`~(u IN aff {x,v:real^3})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[CONVEX_HULL_2; IN_ELIM_THM;] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(v':real= &0) \/ ~(v':real= &0)`) THENL[ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC THEN ASM_MESON_TAC[]; POP_ASSUM MP_TAC THEN REPEAT REMOVE_ASSUM_TAC THEN REWRITE_TAC[VECTOR_ARITH`A=B+C<=>C= A-B:real^3`;REAL_ARITH`a+b= &1<=> a= &1 -b:real`] THEN REPEAT DISCH_TAC THEN MP_TAC(SET_RULE`v'% u =x- u' % v ==> (inv (v')) % v' % u = (inv (v')) % (x-u' % v:real^3)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`(A%(B-(&1-U)%C)=(A%B)+(A*U-A)%C:real^3)`]) THEN MP_TAC(ISPEC`(v':real)`REAL_MUL_LINV) THEN RESA_TAC THEN REDUCE_VECTOR_TAC THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN EXISTS_TAC`inv(v':real)` THEN EXISTS_TAC`&1-inv(v':real)` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC]);;let origin_point_not_in_convex_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3). FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) ==> ~(x IN convex hull{v,u,w})`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[CONVEX_HULL_3; IN_ELIM_THM; coplanar] THEN STRIP_TAC THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`w:real^3` THEN SUBGOAL_THEN`(x:real^3)IN affine hull {v,u,w:real^3}` ASSUME_TAC THENL(*3*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`u':real` THEN EXISTS_TAC`v':real` THEN EXISTS_TAC`w':real` THEN ASM_MESON_TAC[]; SUBGOAL_THEN`(v:real^3)IN affine hull {v,u,w:real^3}` ASSUME_TAC THENL(*4*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(u:real^3)IN affine hull {v,u,w:real^3}` ASSUME_TAC THENL(*5*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(w:real^3)IN affine hull {v,u,w:real^3}` ASSUME_TAC THENL(*6*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; ASM_TAC THEN SET_TAC[]]]]]);;let separate_point_convex_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3). FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) ==> ?(h:real). &0< h /\ (!(y:real^3). y IN convex hull{v,u,w} ==> h < norm(y-x))`,REPEAT STRIP_TAC THEN SUBGOAL_THEN `FINITE {(v:real^3),(u:real^3),(w:real^3)}` ASSUME_TAC THENL(*1*)[ MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; `(u:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (w:real^3)`] remark1_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(SET_RULE`(v:real^3) IN (V:real^3->bool) /\ (u:real^3) IN (V:real^3->bool) /\ (w:real^3) IN (V:real^3->bool)==> {v,u,w} SUBSET V`) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MATCH_MP_TAC(ISPECL[`{(v:real^3),(u:real^3),(w:real^3)}`;`V:real^3->bool`]FINITE_SUBSET) THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REWRITE_TAC[FAN;fan1] THEN SET_TAC[]; MP_TAC(ISPEC`{(v:real^3),(u:real^3),(w:real^3)}`FINITE_IMP_COMPACT_CONVEX_HULL) THEN POP_ASSUM (fun th-> REWRITE_TAC[th;COMPACT_EQ_BOUNDED_CLOSED]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`]origin_point_not_in_convex_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`convex hull {(v:real^3),(u:real^3),(w:real^3)}`;`x:real^3`]SEPARATE_POINT_CLOSED) THEN RESA_TAC THEN EXISTS_TAC`d:real/ &2` THEN STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; ONCE_REWRITE_TAC[NORM_SUB] THEN GEN_TAC THEN POP_ASSUM (fun th ->MP_TAC(ISPEC`y:real^3`th)) THEN REWRITE_TAC[dist;] THEN DISCH_THEN(LABEL_TAC"A") THEN DISCH_TAC THEN REMOVE_THEN "A" MP_TAC THEN POP_ASSUM (fun th ->REWRITE_TAC[th]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]);;(* ========================================================================== *) (* ESILON OF FAN *) (* ========================================================================== *)let bounded_convex_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3). FAN(x,V,E) /\ {v,u} IN E ==> ?(h:real). &0< h /\ (!(y:real^3). y IN convex hull{v,u} ==> norm(y-x)<h )`,REPEAT STRIP_TAC THEN SUBGOAL_THEN `FINITE {(v:real^3),(u:real^3)}` ASSUME_TAC THENL(*1*)[SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY]; MP_TAC(ISPEC`{(v:real^3),(u:real^3)}`FINITE_IMP_COMPACT_CONVEX_HULL) THEN POP_ASSUM (fun th-> REWRITE_TAC[th;]) THEN DISCH_TAC THEN ASSUME_TAC(ISPEC`x:real^3` norm_origin_fan ) THEN ASSUME_TAC(SET_RULE`convex hull {(v:real^3), u} SUBSET (:real^3)`) THEN MP_TAC(ISPECL[`(\(y:real^3). lift(norm(y-x:real^3)))`;`(:real^3)`;`convex hull {(v:real^3),(u:real^3)}`]CONTINUOUS_ON_SUBSET) THEN RESA_TAC THEN MP_TAC(ISPECL[`(\(y:real^3). lift(norm(y-x:real^3)))`;`convex hull {(v:real^3),(u:real^3)}`]COMPACT_CONTINUOUS_IMAGE) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[COMPACT_EQ_BOUNDED_CLOSED;bounded;IMAGE;IN_ELIM_THM] THEN ONCE_REWRITE_TAC[TAUT`A/\B<=>B/\A`;] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN SUBGOAL_THEN `(?x':real^3. x' IN convex hull {v, u} /\ lift (norm (v - x:real^3)) = lift (norm (x' - x)))`ASSUME_TAC THENL[ EXISTS_TAC`v:real^3` THEN SIMP_TAC[CONVEX_HULL_2; IN_ELIM_THM;] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC; SUBGOAL_THEN `&0< (a:real)` ASSUME_TAC THENL[ REMOVE_THEN "A" (fun th-> MP_TAC(ISPEC`lift (norm (v - (x:real^3)))`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[NORM_LIFT;REAL_ABS_NORM ] THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`v:real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`v-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(v-x:real^3)) /\ &0 <= norm(v-x:real^3)==> &0 <norm(v-x:real^3)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; EXISTS_TAC`&2 * a:real` THEN STRIP_TAC THENL[ REPEAT STRIP_TAC THEN SUBGOAL_THEN `(?x':real^3. x' IN convex hull {v, u} /\ lift (norm (y - x:real^3)) = lift (norm (x' - x)))`ASSUME_TAC THENL[ EXISTS_TAC`y:real^3` THEN ASM_SIMP_TAC[]; REMOVE_THEN "A"(fun th-> MP_TAC(ISPEC`lift (norm (y - x:real^3))`th)) THEN ASM_REWRITE_TAC[NORM_LIFT;REAL_ABS_NORM ] THEN ASM_TAC THEN REAL_ARITH_TAC]; ASM_TAC THEN REAL_ARITH_TAC]]]]);;let exists_open_not_collinear=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E ==> ?t1:real. &0 < t1 /\ t1 <= &1 /\ (!t:real. &0<= t /\ t<= t1==> ~(collinear{x,v,(&1-t)%u+ t % w}))`,REPEAT STRIP_TAC THEN REWRITE_TAC[SET_RULE`{A,B,C}={B,A,C}`] THEN ONCE_REWRITE_TAC[COLLINEAR_3;] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`v:real^3`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `; `(E:(real^3->bool)->bool)`;` w:real^3`;` u:real^3`] THEN FIND_ASSUM MP_TAC`~collinear {(x:real^3),(u:real^3),(w:real^3)}` THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B,C}={B,C,A}`;] THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[collinear_fan] THEN ASM_REWRITE_TAC[aff; AFFINE_HULL_2;IN_ELIM_THM] THEN DISCH_THEN(LABEL_TAC"MA") THEN FIND_ASSUM MP_TAC`~((u:real^3) IN aff {(x:real^3), (v:real^3)})` THEN REWRITE_TAC[aff; AFFINE_HULL_2;IN_ELIM_THM] THEN DISCH_THEN(LABEL_TAC"A") THEN SUBGOAL_THEN`!(t:real). ~((&1 - t) % u + t % w = x:real^3)`ASSUME_TAC THENL(*1*)[ GEN_TAC THEN REMOVE_THEN "MA" MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN DISCH_TAC THEN EXISTS_TAC`&1-(t:real)` THEN EXISTS_TAC`(t:real)` THEN ASM_REWRITE_TAC[REAL_ARITH`&1 - t + t = &1`];(*1*) SUBGOAL_THEN`!(t:real). (collinear {vec 0, v - x, ((&1 - t) % u + t % w) - x} <=> vector_angle (v - x:real^3) (((&1 - t) % u + t % w) - x) = &0 \/ vector_angle (v - x) (((&1 - t) % u + t % w) - x) = pi)`ASSUME_TAC THENL(*2*)[ GEN_TAC THEN MP_TAC(ISPECL[`(v:real^3)-(x:real^3)`;`((&1 - t) % (u:real^3) + (t:real) % (w:real^3)) - (x:real^3)`] COLLINEAR_VECTOR_ANGLE) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A-B=vec 0<=> A=B`];(*2*) ASM_REWRITE_TAC[] THEN MRESA_TAC open_vector_angle_fan[ `x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`;`c:real`;`&0`] THEN MRESA_TAC open_vector_angle_fan[ `x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`;`c:real`;`pi`] THEN REWRITE_TAC[DE_MORGAN_THM;] THEN MP_TAC(ISPECL[`{(t:real^1) | ~( vector_angle ((v:real^3) - x) (((&1 - drop(t)) % (u:real^3) + drop(t) % (w:real^3)) - x) = &0)}` ;`{(t:real^1) | ~(vector_angle (v - x) (((&1 - drop (t)) % u + drop (t) % w) - (x:real^3)) = pi)}`]OPEN_INTER) THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM] THEN DISCH_TAC THEN SUBGOAL_THEN` ((vec 0):real^1) IN {(t:real^1) | ~( vector_angle ((v:real^3) - x) (((&1 - drop(t)) % (u:real^3) + drop(t) % (w:real^3)) - x) = &0 )/\ ~(vector_angle (v - x) (((&1 - drop (t)) % u + drop (t) % w) - (x:real^3)) = pi)}` ASSUME_TAC THENL(*3*)[ SIMP_TAC[IN_ELIM_THM;drop;VEC_COMPONENT;GSYM(DE_MORGAN_THM)] THEN REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN MP_TAC(ISPECL[`((v:real^3)-(x:real^3))`;`((u:real^3)-(x:real^3))`]COLLINEAR_VECTOR_ANGLE) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A-B=vec 0<=> A=B:real^3`] THEN ONCE_REWRITE_TAC[GSYM(COLLINEAR_3);] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={B,A,C}`] THEN ASM_REWRITE_TAC[];(*3*) POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"G") THEN DISCH_TAC THEN REMOVE_THEN "G" MP_TAC THEN REWRITE_TAC[open_def] THEN DISCH_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`(vec 0):real^1`th)) THEN ASM_REWRITE_TAC[IN_ELIM_THM;dist; VECTOR_ARITH`A-vec 0=A`] THEN STRIP_TAC THEN EXISTS_TAC`min ((e:real)/ &2) (&1)` THEN STRIP_TAC THENL(*4*)[ POP_ASSUM (fun th->REWRITE_TAC[]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC;(*4*) STRIP_TAC THENL(*5*)[ REAL_ARITH_TAC; GEN_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`lift(t:real)`th)) THEN REWRITE_TAC[LIFT_DROP;NORM_LIFT] THEN DISCH_THEN(LABEL_TAC"G") THEN STRIP_TAC THEN REMOVE_THEN "G" MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]]);;let exist_close_fan=prove(`(!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (w:real^3) (v1:real^3) (w1:real^3). FAN(x,V,E) /\ {v,w} INTER {v1,w1}={} /\ {v1,w1} IN E /\ {v,w} IN E ==> ?h:real. (&0 < h) /\ (!y1:real^3 y2:real^3. y1 IN (aff_ge {x} {v, w} INTER ballnorm_fan x) /\ y2 IN (aff_ge {x} {v1, w1} INTER ballnorm_fan x) ==> h <= dist(y1,y2) ))`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v1:real^3)`] THEN MATCH_MP_TAC( ISPECL [`aff_ge {(x:real^3)} {(v:real^3), (w:real^3)} INTER ballnorm_fan x`; `aff_ge {(x:real^3)} {(v1:real^3), (w1:real^3)} INTER ballnorm_fan x`] SEPARATE_CLOSED_COMPACT) THEN MP_TAC(ISPECL[`(x:real^3) `;` (v:real^3)`;` (w:real^3)`]closed_aff_ge_ballnorm_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3) `;` (v1:real^3)`;` (w1:real^3)`]compact_aff_ge_ballnorm_fan) THEN RESA_TAC THEN FIND_ASSUM(MP_TAC)`FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(v:real^3),(w:real^3)}`;`{(v1:real^3),(w1:real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN ASM_REWRITE_TAC[AFF_GE_EQ_AFFINE_HULL; SET_RULE`(A INTER C) INTER (B INTER C)= (A INTER B) INTER C`;] THEN ASSUME_TAC(AFFINE_SING) THEN MP_TAC(ISPEC`{ (x:real^3) }` AFFINE_HULL_EQ ) THEN RESA_TAC THEN RESA_TAC THEN REWRITE_TAC[ballnorm_fan;INTER; IN_SING; EXTENSION;EMPTY;IN_ELIM_THM;] THEN GEN_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[DIST_REFL ] THEN REAL_ARITH_TAC);;let inequality1_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d ==> ?(h:real). &0 <h /\ h<= &1 /\ (!t:real. &0 <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> s * inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))* norm(u-((&1-t)%u+ t%w))< d ))`,REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`u-((&1-t)%u+ t%w)=t%(u-w):real^3`;NORM_MUL] THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;` (w:real^3)`]separate_point_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN EXISTS_TAC`min ((h:real)*(d:real) *inv(norm(u-w:real^3))) (&1)` THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_gl_zero_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(d:real)`;`inv(norm(u-w:real^3))`] REAL_LT_MUL) THEN RESA_TAC THEN STRIP_TAC THENL[ MP_TAC(ISPECL[`h:real`;`d:real`] REAL_LT_MUL) THEN RESA_TAC THEN ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0 <(h:real)==> ~(h= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)< min ((h:real) * (d:real) * inv (norm (u - w:real^3))) (&1)/\ min (h * d * inv (norm (u - w))) (&1)<= &1 ==>t<= &1/\ (t:real)< (h * d * inv (norm (u - w:real^3)))`) THEN ASM_REWRITE_TAC[REAL_ARITH`min (h * d * inv (norm (u - w))) (&1)<= &1`] THEN STRIP_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN RESA_TAC THEN REMOVE_THEN "A"(fun th -> MP_TAC(ISPEC`(&1-s)%v+s%((&1-t)%u+ t%w):real^3`th)) THEN RESA_TAC THEN MP_TAC(ISPECL[`h:real`;`norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <h /\ (h:real)< norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)==> &0 <= norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`t:real`REAL_ABS_REFL) THEN RESP_TAC THEN MP_TAC(ISPECL[`inv(norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))`; `inv(h:real)`;`t:real`;`(h * d * inv (norm (u - w:real^3)))`; ]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm(u-w:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`u-w:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(u-w:real^3)) /\ &0 <= norm(u-w:real^3)==> &0 <norm(u-w:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)) * (t:real)`;`inv (h:real) * h * d * inv (norm (u - w:real^3))`;`norm (u - w:real^3)`]REAL_LT_RMUL) THEN ASM_REWRITE_TAC[REAL_ARITH`(A*B*C*D)*E=(A*B)*C*(D*E)`] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))`;`(t:real)`;] REAL_LE_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))*(t:real)`;`norm(u-w:real^3)`] REAL_LE_MUL) THEN RESA_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(s= &1) \/ ~((s:real)= &1)`) THENL[ POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*B*C=(A*B)*C:real`;VECTOR_ARITH`(&1 - s) % v + s % ((&1 - t) % u + t % w) - x=((&1 - s) % v + s % ((&1 - t) % u + t % w))- x :real^3`]; MP_TAC(REAL_ARITH`~(s= &1) /\ s<= &1==> (s:real)< &1`) THEN RESA_TAC THEN MP_TAC(ISPECL[`s:real`;`&1`;`(inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))*(t:real)) * norm(u-w:real^3)`; `d:real`]REAL_LT_MUL2) THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*d*B*C=A*(d*B)*C:real`;VECTOR_ARITH`(&1 - s) % v + s % ((&1 - t) % u + t % w) - x=((&1 - s) % v + s % ((&1 - t) % u + t % w))- x :real^3`]]]]);;let inequaility2_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d ==> ?(h:real). &0 <h /\ h<= &1 /\ (!t:real. &0 <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> (norm(inv(norm((&1-s)%v+s%u-x))%((&1-s)%v+s%u-x) - inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))% ((&1-s)%v+s%u-x)))< d ))`,REWRITE_TAC[VECTOR_ARITH`A%B-C%B=(A-C)%B`;NORM_MUL] THEN REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`u-((&1-t)%u+ t%w)=t%(u-w):real^3`;NORM_MUL] THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;` (w:real^3)`]separate_point_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`]origin_point_not_in_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"B") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`]bounded_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"C") THEN EXISTS_TAC`min (h*h*(inv (h'))* inv(norm(u-w:real^3))*d:real) (&1)` THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`u-w:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(u-w:real^3)) /\ &0 <= norm(u-w:real^3)==> &0 <norm(u-w:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm(u-w:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <(h:real)==> ~(h= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <(h':real)==> ~(h'= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h':real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (u-w:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (u-w:real^3)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <inv (h:real)==> &0 <= inv(h)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <inv (h':real)==> &0 <= inv(h')`) THEN RESA_TAC THEN STRIP_TAC THENL(*1*)[ MP_TAC(ISPECL[`(h:real)`;`inv (h':real) `]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)`;`(h:real)*inv (h':real) `]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(h:real)*inv (h':real)`;`inv(norm(u-w:real^3))`]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(h:real)*inv (h':real) *inv(norm(u-w:real^3))`;`d:real`]REAL_LT_MUL) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC;(*1*) STRIP_TAC THENL(*2*)[ REAL_ARITH_TAC;(*2*) REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3)`;` s:real`]expansion1_convex_fan) THEN RESA_TAC THEN REMOVE_THEN "C"(fun th->MP_TAC(ISPEC`(&1 - s) % v + s % u:real^3`th)) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`] origin_point_not1_in_convex_fan) THEN RESA_TAC THEN SUBGOAL_THEN`~(x=(&1-s)%v+s%u:real^3)` ASSUME_TAC THENL(*3*)[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN RESA_TAC;(*3*) MP_TAC(ISPECL[`(&1-s)%v+s%u:real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN ASSUME_TAC(ISPEC`(&1-s)%v+s%u-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(norm((&1-s)%v+s%u-x:real^3)= &0) /\ &0 <= norm((&1-s)%v+s%u-x:real^3)==> &0 <norm((&1-s)%v+s%u-x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1-s)%v+s%u-x:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1-s)%v+s%u-x:real^3))`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)< min (h * h * inv h' * inv (norm (u - w)) * d) (&1)/\ min (h * h * inv h' * inv (norm (u - w)) * d) (&1)<= &1 ==> t<= &1/\ (t:real)< (h * h * inv h' * inv (norm (u - w:real^3)) * d) `) THEN ASM_REWRITE_TAC[REAL_ARITH`min (h * h * inv h' * inv (norm (u - w:real^3)) * d) (&1)<= &1`] THEN STRIP_TAC THEN MP_TAC(ISPECL[`norm ((&1 - s) % v + s % u - x:real^3) `; `(h':real)`;`t:real`;`(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(&0:real) `;`s:real`]expansion_convex_fan) THEN REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`&0<= &0/\ &0<= &1`] THEN DISCH_TAC THEN USE_THEN "A" (fun th-> MP_TAC(ISPEC`((&1 - s) % v + s % u:real^3)`th)) THEN POP_ASSUM(fun th-> REWRITE_TAC[th; VECTOR_ARITH`(A+B)-C=A+B-C:real^3`]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`h:real`;`norm ((&1 - s) % v + s % u-x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(ISPECL[`norm((&1-s)%v+s%u-x:real^3)`;`t:real`]REAL_LE_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm ((&1 - s) % v + s % u - x:real^3))`;`inv(h:real)`;`norm ((&1 - s) % v + s % u - x:real^3)*(t:real)`;`(h':real)*(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN USE_THEN "A" (fun th-> MP_TAC(ISPEC`(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3`th)) THEN POP_ASSUM(fun th-> REWRITE_TAC[th; VECTOR_ARITH`(A+B)-C=A+B-C:real^3`]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`h:real`;`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm((&1-s)%v+s%u-x:real^3))`;`norm((&1-s)%v+s%u-x:real^3)*(t:real)`]REAL_LE_MUL) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`NORM_POS_LE) THEN MP_TAC(ISPEC`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3))`;`inv(h:real)`;`inv(norm ((&1 - s) % v + s % u - x:real^3)) * norm ((&1 - s) % v + s % u - x:real^3)*(t:real)`;`inv(h:real)*(h':real)*(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`norm (u - w:real^3)`; `inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)) * inv (norm ((&1 - s) % v + s % u - x)) * norm ((&1 - s) % v + s % u - x) * t`;`inv h * inv h * h' * h * h * inv h' * inv (norm (u - w:real^3)) * d`;]REAL_LT_LMUL) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(B*C)*E*A*D`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*E*(C*D)`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*E*(C*D)`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D=(A*B)*C*D`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*(C*D)*E`] THEN ONCE_REWRITE_TAC[REAL_ARITH`(A*B*C)*D*E=A*B*(C*D)*E`] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B*C)*D=A*B*(C*D)`] THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`((A*B)*C*D)*E=(A*C)*(B*D)*E`] THEN REDUCE_ARITH_TAC THEN REWRITE_TAC[REAL_ARITH`((A*B)*C)*D*E=(A*B)*(C*D)*E`] THEN ASSUME_TAC(ISPECL[`u:real^3`;`w:real^3`]NORM_SUB) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN MP_TAC(ISPECL[`t:real`;`w-u:real^3`]NORM_MUL) THEN MP_TAC(ISPEC`t:real`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[REAL_ARITH`(A*B)*C*D=C*A*(B*D)`] THEN REDUCE_ARITH_TAC THEN DISCH_THEN(LABEL_TAC"BA") THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN RESA_TAC THEN SUBGOAL_THEN`~(x=(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3)` ASSUME_TAC THENL(*4*)[ POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"MA") THEN STRIP_TAC THEN REMOVE_THEN"MA" MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[];(*4*) MP_TAC(ISPECL[`(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN MP_TAC(ISPECL[`norm((&1 - s) % v + s % u-x:real^3)`;`norm((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`]REAL_SUB_INV) THEN RESP_TAC THEN ASM_REWRITE_TAC[REAL_ABS_ABS;REAL_ABS_DIV;REAL_ABS_MUL;REAL_ABS_NORM;real_div;REAL_INV_MUL; REAL_ARITH`(A*B*C)*D=A*C*(B*D)`] THEN REDUCE_ARITH_TAC THEN MP_TAC(ISPECL[`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`;`((&1 - s) % v + s % u-x:real^3)`]REAL_ABS_SUB_NORM) THEN REWRITE_TAC[VECTOR_ARITH` ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)-((&1 - s) % v + s % u - x)=s%(t)%(w-u) :real^3`] THEN ONCE_REWRITE_TAC[NORM_MUL] THEN MP_TAC(ISPEC`s:real`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN MP_TAC(ISPECL[`abs (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3) - norm ((&1 - s) % v + s % u - x))`;`s * norm (t % (w - u):real^3)`;`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`]REAL_LE_RMUL) THEN RESA_TAC THEN REMOVE_THEN "BA" MP_TAC THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(s= &1)\/ ~((s:real) = &1)`) THENL(*5*)[ ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*5*) MP_TAC(REAL_ARITH`~(s= &1) /\ s<= &1==> (s:real)< &1`) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`(t % (w - u):real^3)`NORM_POS_LE) THEN MP_TAC(ISPECL[`norm (t % (w - u):real^3)`;`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`]REAL_LE_MUL) THEN RESA_TAC THEN REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`s:real`;`&1`;`norm (t % (w - u)) * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`; `d:real`]REAL_LT_MUL2) THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]]);;let exists_point_small_edges_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d ==> ?(h:real). &0 <h /\ h<= &1 /\ (!t:real. &0 <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> norm(inv(norm((&1-s)%v+s%u-x))%((&1-s)%v+s%u-x) - inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))% ((&1-s)%v+s%((&1-t)%u+ t%w)-x))< d ))`,REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0< (d:real)==> &0< d/ &2`) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`]origin_point_not_in_convex_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`;` (d:real)/ &2`]inequaility2_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool) `;`(v:real^3)`;` (u:real^3)`;` (w:real^3)`;` (d:real)/ &2`]inequality1_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"B") THEN EXISTS_TAC`min (h:real) (h':real)` THEN STRIP_TAC THENL[ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`t< min (h:real) (h':real)==> t< (h:real) /\ t< (h':real)`) THEN RESA_TAC THEN REMOVE_THEN"B" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"B") THEN REMOVE_THEN"A" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN ASSUME_TAC(ISPEC`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`NORM_POS_LE) THEN MP_TAC(ISPEC`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPECL[`s * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)):real`;`(u - ((&1 - t) % u + t % w)):real^3`]NORM_MUL) THEN REWRITE_TAC[REAL_ABS_MUL] THEN MP_TAC(ISPEC`s:real`REAL_ABS_REFL) THEN RESP_TAC THEN MP_TAC(ISPEC`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)):real`REAL_ABS_REFL) THEN RESP_TAC THEN REWRITE_TAC[REAL_ARITH`(A*B)*C=A*B*C`] THEN DISCH_TAC THEN REMOVE_THEN"B"MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REWRITE_TAC[VECTOR_ARITH`(s * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x))) % (u - ((&1 - t) % u + t % w))= inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3`] THEN DISCH_TAC THEN MP_TAC(ISPECL[`norm(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)`;`(d:real)/ &2`; `norm (inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x):real^3)`;`(d:real)/ &2`; ]REAL_LT_ADD2) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`d / &2 + d/ &2 = d`] THEN MP_TAC(ISPECL[`(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)`; `(inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x):real^3)`]NORM_TRIANGLE) THEN REWRITE_TAC[VECTOR_ARITH`(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)+ (inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % u - x):real^3)=(inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) `] THEN REAL_ARITH_TAC]]);;let same_projective_sphere_ge_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) (t:real) (y1:real^3). FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~collinear {x, v, (&1 - t) % u + t % w} /\ ~(y1=x) /\ (y1 IN aff_ge {x} {v, (&1-t)%u+(t:real)% (w:real^3)} INTER ballnorm_fan x) ==> ?s:real. &0 <= s/\ s<= &1 /\ y1=inv(norm((&1 - s) % v + s % ((&1 - t) % u + t % w)-x))%((&1 - s) % v + s % ((&1 - t) % u + t % w)-x)+x`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;]th3) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;]AFF_GE_1_2) THEN RESA_TAC THEN REMOVE_THEN"A" MP_TAC THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;dist;ballnorm_fan] THEN STRIP_TAC THEN SUBGOAL_THEN`~(&1 - t1:real= &0)/\ &0 <= &1-t1` ASSUME_TAC THENL[ STRIP_TAC THENL[ FIND_ASSUM MP_TAC`t1+t2+t3= &1:real` THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REWRITE_TAC[REAL_ARITH`(A+B)-A=B`] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`(&0 <= t2) /\ (&0 <= t3) /\(t2+t3= &0)==> t2= &0 /\ t3= &0`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`y1 = t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w) :real^3` THEN FIND_ASSUM MP_TAC`t1+t2+t3= &1:real` THEN POP_ASSUM (fun th-> REWRITE_TAC[(th)]) THEN POP_ASSUM (fun th-> REWRITE_TAC[(th)]) THEN REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[(th)]) THEN REDUCE_VECTOR_TAC THEN ASM_REWRITE_TAC[]; REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPECL[`t2:real`;`t3:real`]REAL_LT_ADD) THEN REAL_ARITH_TAC]; MP_TAC(REAL_ARITH`~(&1 - t1= &0)/\ &0 <= &1-t1==> &0< (&1 -t1:real)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(&1 -t1:real)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`(&1-t1:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv ((&1 - t1:real))`;`(t2:real)`]REAL_LE_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv ((&1 - t1:real))`;`(t3:real)`]REAL_LE_MUL) THEN RESA_TAC THEN FIND_ASSUM MP_TAC `t1+t2+t3= &1:real` THEN REWRITE_TAC[REAL_ARITH`A+B+C=D<=>B+C=D-A`] THEN DISCH_TAC THEN MP_TAC(SET_RULE`t2+t3 = &1-t1 ==> (inv (&1-t1))*(t2+t3) = (inv (&1-t1))* (&1-t1:real)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)=D<=>D- A*C=A*B`] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN EXISTS_TAC`inv ((&1 - t1:real))*(t3:real)` THEN STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; ASM_REWRITE_TAC[VECTOR_ARITH`(inv (&1 - t1) * t2) % v + (inv (&1 - t1) * t3) % ((&1 - t) % u + t % w)-x= inv (&1 - t1) %( t2 % v + t3 % ((&1 - t) % u + t % w))-x:real^3`] THEN FIND_ASSUM MP_TAC `norm(x-y1:real^3)= &1` THEN FIND_ASSUM MP_TAC `y1 = t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w):real^3` THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[NORM_SUB] THEN REWRITE_TAC[VECTOR_ARITH`(B%A+C+D)-A=C+D-(&1-B)%A`] THEN DISCH_TAC THEN MP_TAC(SET_RULE`norm (t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x:real^3) = &1 ==> (inv (&1-t1))*(norm (t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x) ) = (inv (&1-t1))* (&1):real`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN MP_TAC(ISPECL[`inv(&1-t1:real)`;`t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x:real^3`]NORM_MUL) THEN MP_TAC(ISPEC`inv(&1-t1:real)`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B+C-E%D)=A%(B+C)-(A*E)%D`] THEN REDUCE_VECTOR_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[(th)]) THEN ASM_REWRITE_TAC[REAL_INV_INV;VECTOR_ARITH`(&1-A)%(B%C-D)+D= A%D+(B*(&1-A))%C:real^3`] THEN REDUCE_VECTOR_TAC]]]);;let same_projective_sphere_gt_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) (t:real) (y1:real^3). FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~collinear {x, v, (&1 - t) % u + t % w} /\ (y1 IN aff_gt {x} {v, (&1-t)%u+(t:real)% (w:real^3)} INTER ballnorm_fan x) ==> ?s:real. &0 <= s/\ s<= &1 /\ y1=inv(norm((&1 - s) % v + s % ((&1 - t) % u + t % w)-x))%((&1 - s) % v + s % ((&1 - t) % u + t % w)-x)+x`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;]th3) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;]AFF_GT_1_2) THEN RESA_TAC THEN REMOVE_THEN"A" MP_TAC THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;dist;ballnorm_fan] THEN STRIP_TAC THEN SUBGOAL_THEN`~(&1 - t1= &0)/\ &0 < &1-t1` ASSUME_TAC THENL[ REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPECL[`t2:real`;`t3:real`]REAL_LT_ADD) THEN REAL_ARITH_TAC; MP_TAC(ISPEC`(&1 -t1:real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`(&1-t1:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv ((&1 - t1:real))`;`(t2:real)`]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv ((&1 - t1:real))`;`(t3:real)`]REAL_LT_MUL) THEN RESA_TAC THEN FIND_ASSUM MP_TAC `t1+t2+t3= &1:real` THEN REWRITE_TAC[REAL_ARITH`A+B+C=D<=>B+C=D-A`] THEN DISCH_TAC THEN MP_TAC(SET_RULE`t2+t3 = &1-t1 ==> (inv (&1-t1))*(t2+t3) = (inv (&1-t1))* (&1-t1:real)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)=D<=>D- A*C=A*B`] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN EXISTS_TAC`inv ((&1 - t1:real))*(t3:real)` THEN STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; ASM_REWRITE_TAC[VECTOR_ARITH`(inv (&1 - t1) * t2) % v + (inv (&1 - t1) * t3) % ((&1 - t) % u + t % w)-x= inv (&1 - t1) %( t2 % v + t3 % ((&1 - t) % u + t % w))-x:real^3`] THEN FIND_ASSUM MP_TAC `norm(x-y1:real^3)= &1` THEN FIND_ASSUM MP_TAC `y1 = t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w):real^3` THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[NORM_SUB] THEN REWRITE_TAC[VECTOR_ARITH`(B%A+C+D)-A=C+D-(&1-B)%A`] THEN DISCH_TAC THEN MP_TAC(SET_RULE`norm (t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x:real^3) = &1 ==> (inv (&1-t1))*(norm (t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x) ) = (inv (&1-t1))* (&1):real`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN MP_TAC(REAL_ARITH`&0<inv(&1-t1:real)==> &0<= inv(&1-t1:real)`) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(&1-t1:real)`;`t2 % v + t3 % ((&1 - t) % u + t % w) - (&1 - t1) % x:real^3`]NORM_MUL) THEN MP_TAC(ISPEC`inv(&1-t1:real)`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B+C-E%D)=A%(B+C)-(A*E)%D`] THEN REDUCE_VECTOR_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[(th)]) THEN ASM_REWRITE_TAC[REAL_INV_INV;VECTOR_ARITH`(&1-A)%(B%C-D)+D= A%D+(B*(&1-A))%C:real^3`] THEN REDUCE_VECTOR_TAC]]]);;let separate1_sphere_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) (v1:real^3) (u1:real^3). FAN(x,V,E) /\ {v,u} INTER {v1,u1}={} /\ {v,u} IN E/\ {u,w} IN E /\ {v1,u1} IN E /\ ~(coplanar{x,v,u,w}) ==> ?h:real. (&0 < h) /\ (h<= &1) /\ (!t:real. &0<t /\ t<h ==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge {x} {v1, u1} INTER ballnorm_fan x={})`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC exist_close_fan[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`; `(v1:real^3)`;` (u1:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"THA") THEN MRESA_TAC exists_open_not_collinear[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A" ) THEN MRESA_TAC exists_point_small_edges_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3)`;`(u:real^3) `;`(w:real^3)`;`h:real`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"B" ) THEN EXISTS_TAC`min ((h':real)/ &2) (t1:real)` THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*1*)[ ASM_TAC THEN REAL_ARITH_TAC;(*1*) STRIP_TAC THENL(*2*)[ ASM_TAC THEN REAL_ARITH_TAC;(*2*) REPEAT STRIP_TAC THEN REWRITE_TAC[EXTENSION] THEN GEN_TAC THEN EQ_TAC THENL(*3*)[ STRIP_TAC THEN REWRITE_TAC[EMPTY;IN_ELIM_THM] THEN SUBGOAL_THEN `!y1:real^3. y1 IN aff_gt {x} {v, (&1-t)%u+(t:real)% (w:real^3)} INTER ballnorm_fan x ==> ?y2:real^3. y2 IN aff_ge {x:real^3} {(v:real^3), (u:real^3)} INTER ballnorm_fan x /\ dist (y1,y2)<(h:real)` ASSUME_TAC THENL(*4*)[ MP_TAC(REAL_ARITH`&0 <(t:real)/\ &0< h' /\ t < min ((h':real)/ &2) (t1:real)==> &0 <= t /\ t<=t1 /\ t< h'`) THEN RESA_TAC THEN REMOVE_THEN"A" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN REPEAT STRIP_TAC THEN MRESA_TAC same_projective_sphere_gt_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3)`;`(u:real^3) `;`(w:real^3)`;` (t:real) `;`(y1:real^3)`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC AFF_GE_1_2[`(x:real^3)` ;` (v:real^3)`;`(u:real^3) `;] THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;dist] THEN MRESA_TAC expansion1_convex_fan[`(v:real^3)`;` (u:real^3)`;` s:real`] THEN MRESA_TAC origin_point_not1_in_convex_fan[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`] THEN SUBGOAL_THEN`~(x=(&1-s)%v+s%u:real^3)` ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN RESA_TAC;(*5*) MP_TAC(ISPECL[`x:real^3`;`(&1 - s) % v + s % u:real^3`]imp_norm_not_zero_fan) THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[NORM_SUB] THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN ASSUME_TAC(ISPEC`(&1 - s) % v + s % u-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm((&1 - s) % v + s % u-x:real^3)) /\ &0 <= norm((&1 - s) % v + s % u-x:real^3)==> &0 <norm((&1 - s) % v + s % u-x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % u-x:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % u-x:real^3))`REAL_LE_INV) THEN RESA_TAC THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) +x:real^3` THEN STRIP_TAC THENL(*6*)[ STRIP_TAC THENL(*7*)[ EXISTS_TAC`&1 - inv (norm ((&1 - s) % v + s % u - x:real^3)) ` THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % u - x:real^3)) * (&1 - s)` THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % u - x:real^3)) * (s)` THEN REWRITE_TAC[VECTOR_ARITH`A%(B%C + a%b-c)+c=(&1-A)%c+(A*B)%C+(A*a)%b:real^3`] THEN ASM_REWRITE_TAC[REAL_ARITH`&1-A+A*(&1-C)+A*C= &1`] THEN STRIP_TAC THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REAL_ARITH_TAC;(*7*) REWRITE_TAC[ballnorm_fan;IN_ELIM_THM;dist;VECTOR_ARITH`A-(B+A)=(--B):real^3`;NORM_NEG;NORM_MUL] THEN MP_TAC(ISPEC`inv (norm ((&1 - s) % v + s % u - x:real^3))`REAL_ABS_REFL) THEN RESP_TAC THEN ASM_REWRITE_TAC[]](*7*);(*6*) ASM_REWRITE_TAC[VECTOR_ARITH`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x) + x - (inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) + x)= inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x) - (inv (norm ((&1 - s) % v + s % u - x)) % ((&1 - s) % v + s % u - x) ):real^3`] THEN REMOVE_THEN "B" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN ASM_REWRITE_TAC[NORM_SUB]](*6*)](*5*);(*4*) POP_ASSUM (fun th->MP_TAC(ISPEC`x':real^3`th)) THEN MP_TAC(SET_RULE` x' IN aff_gt {x} {v, (&1 - t) % u + t % w} INTER aff_ge {x} {v1, u1} INTER ballnorm_fan x ==> x' IN aff_ge {x} {v1, u1:real^3} INTER ballnorm_fan x /\ x' IN aff_gt {x} {v, (&1 - t) % u + t % w:real^3} INTER ballnorm_fan x`) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN SIMP_TAC[] THEN REPEAT STRIP_TAC THEN REMOVE_THEN "THA" (fun th-> MP_TAC(ISPECL[`y2:real^3`;`x':real^3`]th)) THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(RAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(RAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN SIMP_TAC[dist;NORM_SUB] THEN REAL_ARITH_TAC](*4*);(*3*) SET_TAC[]]]]);;let fan_run_in_small1_is_fan=prove( `!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 v1:real^3 u1:real^3. FAN(x,V,E) /\ {v,u} INTER {v1,u1}={} /\ {v,u} IN E/\ {u,w} IN E /\ {v1,u1} IN E /\ ~(coplanar{x,v,u,w}) ==> ?t1:real. &0 < t1 /\ t1 <= &1 /\ (!t:real. &0< t /\ t< t1 ==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v1,u1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u1:real^3)`; ` (v1:real^3)`] THEN MRESA_TAC exists_open_not_collinear[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"BA") THEN MRESA_TAC separate1_sphere_fan[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3)`;` (w:real^3)`;` (v1:real^3)`;`(u1:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` &0 < t1/\ &0 < h ==> &0 < min (h:real) (t1:real)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` t1 <= &1 /\ h <= &1==> min (h:real) (t1:real)<= &1`) THEN RESA_TAC THEN EXISTS_TAC`min (h:real) (t1:real)` THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` &0 < t /\ t< min (h:real) (t1:real)==> t< h /\ t<= t1 /\ &0 <= t`) THEN RESA_TAC THEN REMOVE_THEN "A"(fun th-> MRESA1_TAC th `(t:real)`) THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN REMOVE_THEN "BA"(fun th-> MRESA1_TAC th `(t:real)`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC origin_is_not_aff_gt_fan[`x:real^3`;`v:real^3`;`(&1-t)%u+t%w:real^3`] THEN REWRITE_TAC[EXTENSION;INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN SUBGOAL_THEN`~(x=x':real^3)`ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]; MRESA_TAC imp_norm_not_zero_fan[`x':real^3`;`x:real^3`] THEN ASSUME_TAC(ISPEC`x'-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(norm(x'-x:real^3)= &0) /\ &0 <= norm(x'-x:real^3)==> &0 <norm(x'-x:real^3)`) THEN RESA_TAC THEN MRESA1_TAC REAL_LE_INV `norm(x'-x:real^3)` THEN MRESA1_TAC REAL_LT_INV `norm(x'-x:real^3)` THEN MRESA1_TAC REAL_MUL_LINV `norm(x'-x:real^3)` THEN MRESA_TAC scale_aff_ge_fan[`x:real^3`;`v1:real^3`;`u1:real^3`] THEN POP_ASSUM(fun th -> MRESA_TAC th [`x':real^3`;`inv(norm(x'-x:real^3))`]) THEN MRESA_TAC scale_aff_gt_fan[`x:real^3`;`v:real^3`;`(&1-t)%u+t%w:real^3`] THEN POP_ASSUM(fun th -> MRESA_TAC th [`x':real^3`;`inv(norm(x'-x:real^3))`]) THEN SUBGOAL_THEN`inv (norm (x' - x)) % (x' - x) + x IN ballnorm_fan x:real^3->bool` ASSUME_TAC THENL[ MRESA1_TAC REAL_ABS_REFL `inv(norm(x'-x:real^3))` THEN ASM_REWRITE_TAC[ballnorm_fan;IN_ELIM_THM;dist;VECTOR_ARITH`B-(A+B)= --A:real^3`;NORM_NEG;NORM_MUL]; ASM_TAC THEN SET_TAC[]]]; SET_TAC[]]);;let fan_run_in_small21_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v,w1} IN E /\ ~coplanar {x,v,u,w} ==> ?t1:real. &0<t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t<= t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v,w1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC exists_open_not_collinear[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN DISJ_CASES_TAC(SET_RULE`(?h:real. &0<h /\ h<= &1/\ azim x v u w1=azim x v u ((&1-h)%u+h%w:real^3))\/ ~(?h:real. &0<h /\ h<= &1 /\ azim x v u ((&1-h)%u+h%w:real^3)=azim x v u w1)`) THENL(*1*)[ POP_ASSUM MP_TAC THEN STRIP_TAC THEN EXISTS_TAC`min (t1:real) ((h:real)/ &2)` THEN STRIP_TAC THENL(*2*)[ ASM_TAC THEN REAL_ARITH_TAC;(*2*) STRIP_TAC THENL(*3*)[ASM_TAC THEN REAL_ARITH_TAC;(*3*) REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)<= min (t1:real) (h:real/ &2) ==> t <= t1`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v:real^3)`] THEN REWRITE_TAC[INTER;EXTENSION;IN_ELIM_THM;] THEN GEN_TAC THEN EQ_TAC THENL(*4*)[ DISCH_TAC THEN SUBGOAL_THEN `(&1-t)%u+t%w IN aff_ge {x,v} {w1}:real^3->bool` ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = t1'' % x + t2' % v + t3' % w1<=> t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3`] THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`(t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3 ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w)) = (inv (t3))%((t1''-t1') % x + (t2'-t2) % v + t3' % w1)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`A%(B%X+C%Y+D%Z)=(A*B)%X+(A*C)%Y+(A*D)%Z`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN FIND_ASSUM MP_TAC`t1'' + t2' + t3' = &1:real` THEN FIND_ASSUM MP_TAC`t1' + t2 + t3 = &1:real` THEN DISCH_TAC THEN POP_ASSUM (fun th -> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM(th)]) THEN REWRITE_TAC[REAL_ARITH`t1'' + t2' + t3' = t1' + t2 + t3<=> (t1''-t1') + (t2'-t2) + t3' = t3:real`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (t1''-t1') + (t2'-t2) + t3' = t3 ==> (inv (t3))*((t1''-t1') + (t2'-t2) + t3') = (inv (t3))*t3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C+D)=A*B+A*C+A*D`] THEN STRIP_TAC THEN EXISTS_TAC`inv t3 * (t1'' - t1'):real` THEN EXISTS_TAC`inv t3 * (t2' - t2):real` THEN EXISTS_TAC`inv t3 * t3':real` THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_INV THEN ASM_TAC THEN REAL_ARITH_TAC;(*5*) MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`v:real^3`;`u:real^3`;`w1:real^3`;`(&1 - t) % u + t % w:real^3`;] THEN MRESA_TAC injective_azim_coplanar[`x:real^3`;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th->MRESA_TAC th [`h:real`;`t:real`]) THEN ASM_TAC THEN REAL_ARITH_TAC](*5*)(*4*); SET_TAC[]]]];(*1*) POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[NOT_EXISTS_THM] THEN DISCH_THEN(LABEL_TAC"B") THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v:real^3)`] THEN REWRITE_TAC[INTER;EXTENSION;IN_ELIM_THM;] THEN GEN_TAC THEN EQ_TAC THENL(*2*)[ DISCH_TAC THEN SUBGOAL_THEN `(&1-t)%u+t%w IN aff_ge {x,v} {w1}:real^3->bool` ASSUME_TAC THENL(*3*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = t1'' % x + t2' % v + t3' % w1<=> t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3`] THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`(t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3 ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w)) = (inv (t3))%((t1''-t1') % x + (t2'-t2) % v + t3' % w1)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`A%(B%X+C%Y+D%Z)=(A*B)%X+(A*C)%Y+(A*D)%Z`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN FIND_ASSUM MP_TAC`t1'' + t2' + t3' = &1:real` THEN FIND_ASSUM MP_TAC`t1' + t2 + t3 = &1:real` THEN DISCH_TAC THEN POP_ASSUM (fun th -> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM(th)]) THEN REWRITE_TAC[REAL_ARITH`t1'' + t2' + t3' = t1' + t2 + t3<=> (t1''-t1') + (t2'-t2) + t3' = t3:real`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (t1''-t1') + (t2'-t2) + t3' = t3 ==> (inv (t3))*((t1''-t1') + (t2'-t2) + t3') = (inv (t3))*t3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C+D)=A*B+A*C+A*D`] THEN STRIP_TAC THEN EXISTS_TAC`inv t3 * (t1'' - t1'):real` THEN EXISTS_TAC`inv t3 * (t2' - t2):real` THEN EXISTS_TAC`inv t3 * t3':real` THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_INV THEN ASM_TAC THEN REAL_ARITH_TAC;(*3*) MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`v:real^3`;`u:real^3`;`w1:real^3`;`(&1 - t) % u + t % w:real^3`;] THEN REMOVE_THEN "B"(fun th -> MRESAL1_TAC th `t:real`[DE_MORGAN_THM]) THEN ASM_TAC THEN REAL_ARITH_TAC]; SET_TAC[]]]);;let fan_run_in_small2_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 w1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v,w1} IN E /\ ~coplanar {x,v,u,w} ==> ?t1:real. &0<t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v,w1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC fan_run_in_small21_is_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`t<t1==>t<=t1`) THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`));;let extension_in_aff_2_2_fan=prove(`!x:real^3 v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E ==> (!t:real. &0< t /\ t< &1 ==> (!t1:real t2:real t3:real. &0<t3 /\ &0<t2 /\ t1+t2+t3= &1 ==>t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w) IN aff_gt {x,u} {w,v}))`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN SUBGOAL_THEN `DISJOINT {x,u:real^3} {w,v:real^3}` ASSUME_TAC THENL[ REWRITE_TAC[DISJOINT_SYM;SET_RULE`{v:real^3,w:real^3}= {v} UNION {w}`;DISJOINT_UNION] THEN REWRITE_TAC[SET_RULE`{v} UNION {w}={v:real^3,w:real^3}`] THEN ONCE_REWRITE_TAC[DISJOINT_SYM] THEN ASM_REWRITE_TAC[]; MRESAL_TAC AFF_GT_2_2[`x:real^3`;`u:real^3`;`w:real^3`;`v:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`t1:real` THEN EXISTS_TAC`t3*(&1-t):real` THEN EXISTS_TAC`t3*(t):real` THEN EXISTS_TAC`t2:real` THEN ASM_REWRITE_TAC[REAL_ARITH`t1 + t3 * (&1 - t) + t3 * t +t2 = t1+t2+t3:real`;VECTOR_ARITH`t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w) = t1 % x + (t3 * (&1 - t)) % u + (t3 * t) % w+ t2 % v:real^3`] THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_TAC THEN REAL_ARITH_TAC]);;let inequality3_aim_in_convex_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) ==> (!t:real. &0< t /\ t< &1 ==> (!t1:real t2:real t3:real. &0<t3 /\ &0<t2 /\ t1+t2+t3= &1 ==> &0< azim x u w (t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w)) /\ azim x u w (t1 % x + t2 % v + t3 % ((&1 - t) % u + t % w))< azim x u w v))`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC`{v,u} IN (E:(real^3->bool)->bool)` THEN ONCE_REWRITE_TAC[SET_RULE`{v,u}={u,v}`] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v:real^3)`; ` (u:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC WEDGE_LUNE_GT[`x:real^3`;` u:real^3`;`w:real^3`;`v:real^3`] THEN POP_ASSUM (fun th-> MP_TAC(SYM(th))) THEN DISCH_TAC THEN MRESA_TAC extension_in_aff_2_2_fan[`x:real^3`;` v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th `t:real`) THEN POP_ASSUM(fun th-> MRESAL_TAC th [`t1:real`;`t2:real`;`t3:real`][wedge;IN_ELIM_THM]));;let fan_run_in_small3_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 w1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {u,w1} IN E /\ ~coplanar {x,v,u,w} /\ sigma_fan x V E u w=v /\ (&0< azim x u w v ) /\ (azim x u w v <pi) ==> ?t1:real. &0<t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {u,w1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC exists_open_not_collinear[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t /\ ~(t= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`t<t1 /\ t1<= &1==>t<=t1 /\ t< &1`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (u:real^3)`] THEN REWRITE_TAC[EXTENSION;INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL(*1*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN SUBGOAL_THEN `x' IN (aff_ge {x,u} {w1}:real^3->bool)`ASSUME_TAC THENL(*2*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`u:real^3`;`w1:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN EXISTS_TAC`t1'':real` THEN EXISTS_TAC`t2':real` THEN EXISTS_TAC`t3':real` THEN ASM_REWRITE_TAC[];(*2*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC inequality3_aim_in_convex_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;` w:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th `t:real`) THEN POP_ASSUM(fun th-> MRESA_TAC th [`t1':real`;`t2:real`;`t3:real`]) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"BE") THEN DISCH_THEN(LABEL_TAC"YEU") THEN SUBGOAL_THEN`~collinear {x, u, x':real^3}`ASSUME_TAC THENL(*3*)[ MRESA_TAC continuous_coplanar_fan [`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `t:real`) THEN ASM_REWRITE_TAC[collinear_fan;] THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[coplanar;aff; AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN SUBGOAL_THEN`(x:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*4*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC;(*4*) SUBGOAL_THEN`(v:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*5*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC;(*5*) SUBGOAL_THEN`(u:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*6*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC;(*6*) SUBGOAL_THEN`((&1 - t) % u + t % w:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*7*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(t3:real)`REAL_MUL_LINV) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = u' % x + v' % u <=>t3 % ((&1 - t) % u + t % w) = (u'-t1') % x -t2 % v+v' % u:real^3`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (u'-t1') % x -t2 % v+v' % u ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w) ) = (inv (t3))%((u'-t1') % x -t2 % v+v' % u):real^3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B-C+D)=A%B-A%C+A%D`;VECTOR_ARITH`A%B%C=(A*B)%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv t3 * (u' - t1')):real` THEN EXISTS_TAC`-- (inv t3 * t2):real` THEN EXISTS_TAC`(inv t3 * v'):real` THEN ASM_REWRITE_TAC[VECTOR_ARITH`A+(--b)%C+d=A-b%C+d`;REAL_ARITH`inv t3 * (u' - t1') + --(inv t3 * t2) + inv t3 * v'=inv t3 * (t3+(u'+v') - (t1'+ t2+t3))`;REAL_ARITH`A+ &1- &1=A`];(*7*) ASM_TAC THEN SET_TAC[]](*7*)](*6*)](*5*)](*4*);(*3*) MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`u:real^3`;`x':real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`u:real^3`;`x':real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`u:real^3`;`w:real^3`;`w1:real^3`;`x':real^3`;] THEN REMOVE_THEN"BE" MP_TAC THEN REMOVE_THEN"YEU" MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN FIND_ASSUM MP_TAC`(sigma_fan x V E u w = (v:real^3))` THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge u V E = {w:real^3}) \/ ~(set_of_edge u V E = {w})`) THENL(*4*)[ FIND_ASSUM MP_TAC`w1 IN set_of_edge (u:real^3) V E` THEN POP_ASSUM (fun th-> REWRITE_TAC[(th);IN_SING]) THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC (ISPECL[`x:real^3`;`u:real^3`;`w:real^3`]AZIM_REFL) THEN REAL_ARITH_TAC;(*4*) DISJ_CASES_TAC(SET_RULE`(w1:real^3)=w \/ ~((w1:real^3)=w)`) THENL(*5*)[ ASM_REWRITE_TAC[] THEN MP_TAC (ISPECL[`x:real^3`;`u:real^3`;`w:real^3`]AZIM_REFL) THEN REAL_ARITH_TAC;(*5*) MRESA_TAC SIGMA_FAN[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w1:real^3`) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]; SET_TAC[]]);;let fan_run_in_small_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 v1:real^3 w1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v1,w1} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v ==> ?t1:real. &0<t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v1,w1}={})`,(let lem=prove(`!x v v1. aff_ge {x} {v1, v}=aff_ge {x} {v, v1}`, REPEAT STRIP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN SIMP_TAC[]) in REPEAT STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN DISJ_CASES_TAC(SET_RULE`(v1=v)\/ ~(v1=v:real^3)`) THENL[ MRESA_TAC fan_run_in_small2_is_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v1:real^3`;`u:real^3`;` w:real^3`;`w1:real^3`]; DISJ_CASES_TAC(SET_RULE`(v1=u)\/ ~(v1=u:real^3)`) THENL[ MRESA_TAC fan_run_in_small3_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` v1:real^3`;` w:real^3`;`w1:real^3`]; DISJ_CASES_TAC(SET_RULE`(w1=v)\/ ~(w1=v:real^3)`) THENL[ FIND_ASSUM MP_TAC`{v1,w1} IN (E:(real^3->bool)->bool)` THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small2_is_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w1:real^3`;`u:real^3`;` w:real^3`;`v1:real^3`] THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[lem]; DISJ_CASES_TAC(SET_RULE`(w1=u)\/ ~(w1=u:real^3)`) THENL[ FIND_ASSUM MP_TAC`{v1,w1} IN (E:(real^3->bool)->bool)` THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small3_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` w1:real^3`;` w:real^3`;`v1:real^3`] THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[lem]; SUBGOAL_THEN`{v,u} INTER {v1,w1:real^3}={}` ASSUME_TAC THENL[ ASM_TAC THEN SET_TAC[]; MRESA_TAC fan_run_in_small1_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` u:real^3`;` w:real^3`;`v1:real^3`;`w1:real^3`]]]]]]));;let fan_run1_in_small_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) (E':(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ E' SUBSET E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v ==> ?h:real. &0<h /\ h<= &1 /\ (!s:real. &0< s /\ s< h==> aff_gt{x} {v,(&1-s)%u+ s % w} INTER {v | ?e. e IN E' /\ v IN aff_ge {x} e}={})`,REPEAT STRIP_TAC THEN MRESA_TAC set_edges_is_finite_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN MRESA_TAC FINITE_SUBSET [`(E':(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`] THEN ABBREV_TAC`n=CARD (E':(real^3->bool)->bool)` THEN REPEAT(POP_ASSUM MP_TAC) THEN SPEC_TAC (`(E':(real^3->bool)->bool)`,`(E':(real^3->bool)->bool)`) THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL(*1*)[ REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`E':(real^3->bool)->bool`]CARD_EQ_0) THEN RESA_TAC THEN EXISTS_TAC`&1 / &2` THEN REWRITE_TAC[REAL_ARITH`&0< &1/ &2`;REAL_ARITH`&1 / &2 <= &1`] THEN ASM_SET_TAC[];(*1*) REPEAT GEN_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC "A") THEN REPEAT STRIP_TAC THEN MP_TAC(ISPEC`(E':(real^3->bool)->bool)` CHOOSE_SUBSET) THEN RESA_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`n:num `th)) THEN REWRITE_TAC[ARITH_RULE `n:num <= SUC n`; HAS_SIZE] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t SUBSET E' /\ E' SUBSET E ==> (t:(real^3->bool)->bool) SUBSET E`) THEN RESA_TAC THEN REMOVE_THEN "A" (fun th-> MP_TAC(ISPEC`(t:(real^3->bool)->bool)`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN SUBGOAL_THEN `~((E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)= {})` ASSUME_TAC THENL(*2*)[ STRIP_TAC THEN MP_TAC(SET_RULE`(E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)={} /\ t SUBSET E' ==> t= E'`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`CARD (t:(real^3->bool)->bool)=n` THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN ASM_REWRITE_TAC[] THEN ARITH_TAC;(*2*) SUBGOAL_THEN`?e. e IN (E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)` ASSUME_TAC THENL(*3*)[ ASM_SET_TAC[];(*3*) POP_ASSUM MP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`e IN (E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)/\ (E':(real^3->bool)->bool) SUBSET (E:(real^3->bool)->bool) /\ t SUBSET E' ==> e IN E'/\ e IN E/\ ~(e IN t) /\ {e} UNION t SUBSET E'`) THEN RESA_TAC THEN MP_TAC(ISPECL [`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;`(E':(real^3->bool)->bool)`] FINITE_SUBSET) THEN RESA_TAC THEN ASSUME_TAC(SET_RULE`e IN {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`) THEN MP_TAC(ISPECL[`e:real^3->bool`;`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;]CARD_DELETE) THEN RESA_TAC THEN MP_TAC(SET_RULE `e IN {e:(real^3->bool)} UNION (t:(real^3->bool)->bool) ==> ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e PSUBSET {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`) THEN RESA_TAC THEN MP_TAC(ISPECL[`({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))DELETE e`;`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`]CARD_PSUBSET) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN FIND_ASSUM MP_TAC`FINITE ( {e:(real^3->bool)} UNION (t:(real^3->bool)->bool))` THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN DISCH_TAC THEN MP_TAC(ARITH_RULE`CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) < CARD ( {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) /\ CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) = CARD ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))-1 <=>CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) +1= CARD ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))`) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th;]) THEN REWRITE_TAC[ARITH_RULE`A=A`; ] THEN MP_TAC(SET_RULE`~(e IN t)==>({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e=t`) THEN RESA_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN FIND_ASSUM MP_TAC`(CARD (E':(real^3->bool)->bool)=SUC n)` THEN REWRITE_TAC[ARITH_RULE`SUC n=(n:num) +1`] THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;`E':(real^3->bool)->bool`]CARD_SUBSET_EQ) THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)]) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"MA") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`]expand_edge_graph_fan) THEN RESA_TAC THEN MRESA_TAC fan_run_in_small_is_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w:real^3`;`v':real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)] THEN ASSUME_TAC(th)) THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"BE") THEN EXISTS_TAC` min (h:real) (t1:real)` THEN STRIP_TAC THENL(*4*)[ ASM_TAC THEN REAL_ARITH_TAC;(*4*) STRIP_TAC THENL(*5*)[ ASM_TAC THEN REAL_ARITH_TAC;(*5*) REPEAT STRIP_TAC THEN REMOVE_THEN "MA" MP_TAC THEN DISCH_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)] THEN ASSUME_TAC(th)) THEN REWRITE_TAC[UNION;IN_ELIM_THM;EXTENSION; INTER;] THEN GEN_TAC THEN EQ_TAC THENL(*6*)[ ASM_REWRITE_TAC[IN_SING] THEN MP_TAC(REAL_ARITH`s< min h t1==> s<h /\ s<t1`) THEN RESA_TAC THEN STRIP_TAC THENL(*7*)[ POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "BE"(fun th-> MRESA1_TAC th `s:real`) THEN ASM_SET_TAC[]; POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "YEU"(fun th-> MRESA1_TAC th `s:real`) THEN ASM_SET_TAC[]]; SET_TAC[]]]]]]]);;let fan_run_in_small_is_not_meet_xfan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v ==> ?h:real. &0<h /\ h<= &1 /\ (!s:real. &0< s /\ s< h==> aff_gt{x} {v,(&1-s)%u+ s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={})`,REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`u:real^3`;` (w:real^3)`]fan_run1_in_small_is_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`A SUBSET A`] THEN RESA_TAC THEN EXISTS_TAC`h:real` THEN ASM_REWRITE_TAC[] THEN ASM_SET_TAC[]);;let fan_run_in_small_is_subset_yfan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v ==> ?h:real. &0<h /\ h<= &1 /\ (!s:real. &0< s /\ s< h==> aff_gt{x} {v,(&1-s)%u+ s % w} SUBSET yfan(x,V,E))`,REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`u:real^3`;` (w:real^3)`]fan_run1_in_small_is_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`A SUBSET A`;yfan;xfan] THEN RESA_TAC THEN EXISTS_TAC`h:real` THEN ASM_REWRITE_TAC[] THEN ASM_SET_TAC[]);;let not_collinear_is_properties_fully_surrounded1=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 t:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0<=t /\ t<= &1 ==> ~ collinear {x,v,(&1-t)%u+ t % w}`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`&0<=t /\ t<= &1 ==> t= &0 \/ t= &1 \/ (&0<t /\ t< &1)`) THEN RESA_TAC THENL[ REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] ; REWRITE_TAC[REAL_ARITH`&1- &1= &0`] THEN REDUCE_VECTOR_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC NOT_COPLANAR_NOT_COLLINEAR[`x:real^3`;`v:real^3`;`w:real^3`;`u:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,B,D,C}`] THEN ASM_REWRITE_TAC[]; MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC collinear1_fan [`x:real^3`;`v:real^3`;`(&1-t)% u+t% w:real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN MRESA_TAC properties_fully_surrounded[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;` w:real^3`] THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff; AFFINE_HULL_2; IN_ELIM_THM; coplanar] THEN STRIP_TAC THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN SUBGOAL_THEN`(x:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(v:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(u:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(w:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> ~(t= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(t:real)`REAL_MUL_LINV) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[VECTOR_ARITH`(&1 - t) % u + t % w = u' % x + v' % v <=>t % w = u' % x + v' % v-(&1 - t) % u :real^3`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t % w = u' % x + v' % v-(&1 - t) % u ==> (inv (t))%(t % w ) = (inv (t))%(u' % x + v' % v-(&1 - t) % u ):real^3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B+C-(&1-E)%D)=A%B+A%C+(A*E-A)%D`;VECTOR_ARITH`A%B%C=(A*B)%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv t * u'):real` THEN EXISTS_TAC`(inv t * v'):real` THEN EXISTS_TAC`(&1-inv t):real` THEN ASM_REWRITE_TAC[REAL_ARITH`A*B+A*C+D-E=A*(B+C)+D-E`] THEN ASM_TAC THEN REAL_ARITH_TAC; ASM_TAC THEN SET_TAC[]]]]]]);;let not_collinear_is_properties_fully_surrounded=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 t:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0<t /\ t< &1 ==> ~ collinear {x,v,(&1-t)%u+ t % w}`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`&0 <t /\ t < &1==> &0<= t /\ t <= &1`) THEN RESA_TAC THEN MRESA_TAC not_collinear_is_properties_fully_surrounded1 [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`t:real`] );;let exists_inf_element_fix_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u1:real^3 . FAN(x,V,E)/\ v IN V /\ CARD (set_of_edge v V E) >1 ==> (?(u:real^3). (u IN (set_of_edge v V E)) /\ (!(w:real^3). (w IN (set_of_edge v V E)) ==> azim x v u1 u <= azim x v u1 w))`,(let lemma = prove (`!X:real->bool. FINITE X /\ ~(X = {}) ==> ?a. a IN X /\ !x. x IN X ==> a <= x`, MESON_TAC[INF_FINITE]) in MP_TAC(lemma) THEN DISCH_THEN(LABEL_TAC "a") THEN REPEAT GEN_TAC THEN REWRITE_TAC[FAN;fan1] THEN STRIP_TAC THEN MRESA_TAC remark_finite_fan1[`(v:real^3)` ;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN DISJ_CASES_TAC(SET_RULE`((set_of_edge (v:real^3) (V:real^3->bool) (E:(real^3->bool)->bool))={})\/ ~((set_of_edge (v:real^3) (V:real^3->bool) (E:(real^3->bool)->bool)) ={})`) THENL[ FIND_ASSUM MP_TAC `CARD ((set_of_edge v V E):real^3->bool) > 1` THEN POP_ASSUM (fun th->REWRITE_TAC[th;CARD_CLAUSES]) THEN ARITH_TAC; SUBGOAL_THEN`~(IMAGE (azim x v u1) ((set_of_edge (v:real^3) (V:real^3->bool) (E:(real^3->bool)->bool)) )={})` ASSUME_TAC THENL[ REWRITE_TAC[IMAGE_EQ_EMPTY] THEN ASM_MESON_TAC[]; SUBGOAL_THEN` FINITE (IMAGE (azim x v u1) (set_of_edge (v:real^3) (V:real^3->bool) (E:(real^3->bool)->bool)))` ASSUME_TAC THENL[ASM_MESON_TAC[FINITE_IMAGE]; REMOVE_THEN "a" (fun th ->MRESAL1_TAC th `(IMAGE (azim x v u1) ((set_of_edge (v:real^3) (V:real^3->bool) (E:(real^3->bool)->bool)) ))`[IMAGE;IN_ELIM_THM]) THEN EXISTS_TAC`x':real^3` THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[]]]]));;let exists_element_in_half_sapace_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u1:real^3 w1:real^3. FAN(x,V,E)/\ v IN V /\ ~coplanar{x,v,u1,w1} /\ CARD (set_of_edge v V E) >1 /\ fan80(x,V,E) ==> ?u:real^3. {v,u} IN E /\ &0< azim x v u1 (u:real^3)/\ azim x v u1 (u:real^3) <pi `,REWRITE_TAC[fan80] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "BE") THEN MRESA_TAC NOT_COPLANAR_NOT_COLLINEAR [`x:real^3`;`v:real^3`;`u1:real^3`;`w1:real^3`] THEN MRESA_TAC exists_inf_element_fix_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u1:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "YEU") THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC SUR_SIGMA_FAN[`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3) `;`(u:real^3)`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`v:real^3`] THEN DISJ_CASES_TAC(REAL_ARITH`(pi<= azim (x:real^3) (v:real^3) (u1:real^3) u )\/ azim x v u1 (u:real^3) <pi `) THENL[ REMOVE_THEN "BE" (fun th-> MRESA_TAC th [`v:real^3`;`w:real^3`]) THEN MP_TAC(REAL_ARITH`pi <= azim (x:real^3) (v:real^3) (u1:real^3) (u:real^3) /\ azim x v w u < pi==> azim x v w u <= azim x v u1 u`) THEN RESA_TAC THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`v:real^3`;`u1:real^3`;`w:real^3`;`u:real^3`] THEN MP_TAC(REAL_ARITH`&0 < azim x v w u /\ azim (x:real^3) (v:real^3) (u1:real^3) (u:real^3) = azim x v u1 w + azim x v w u ==> azim x v u1 w < azim x v u1 u`) THEN POP_ASSUM (fun th-> GEN_REWRITE_TAC( LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN RESA_TAC THEN REMOVE_THEN "YEU" (fun th-> MRESA1_TAC th `w:real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; ASSUME_TAC(ISPECL[`(x:real^3)`;`(v:real^3)`;`(u1:real^3)`;`u:real^3`]azim) THEN MP_TAC(REAL_ARITH`(&0<= azim (x:real^3) (v:real^3) (u1:real^3) u) ==>(azim (x:real^3) (v:real^3) (u1:real^3) u = &0 ) \/ &0< azim x v u1 (u:real^3) `) THEN POP_ASSUM (fun th-> GEN_REWRITE_TAC( LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN REWRITE_TAC[]) THEN STRIP_TAC THENL[ EXISTS_TAC`sigma_fan x V E v (u:real^3)` THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E = {u:real^3})\/ ~(set_of_edge v V E = {u})`) THENL[ MRESA_TAC CARD_SING[`u:real^3`; `(set_of_edge v V E):real^3->bool`] THEN FIND_ASSUM MP_TAC `CARD ((set_of_edge v V E):real^3->bool) >1` THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun TH-> REWRITE_TAC[TH]) THEN ARITH_TAC; MRESA_TAC SIGMA_FAN[`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3) `;`(u:real^3)`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`sigma_fan x V E v (u:real^3)`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN REMOVE_THEN "YEU" (fun th-> MRESA1_TAC th `sigma_fan x V E v (u:real^3)`) THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`v:real^3`;`u1:real^3`;`u:real^3`;`sigma_fan x V E v (u:real^3)`] THEN REDUCE_ARITH_TAC THEN REMOVE_THEN "BE" (fun th-> MRESA_TAC th [`v:real^3`;`(u:real^3)`])]; EXISTS_TAC`(u:real^3)` THEN ASM_REWRITE_TAC[]]]);;let independent_run_edges_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ fan80(x,V,E) /\ sigma_fan x V E u w = v /\ &0<a /\ a<= &1 ==> independent {v - x, u - x, ((&1 - a) % u + a % w) - x}`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MP_TAC(REAL_ARITH`&0< a==> ~(a= &0)`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, v, u, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3,v:real^3,u:real^3,(&1 - a) % u + a % w:real^3}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REMOVE_ASSUM_TAC THEN DISCH_TAC THEN MRESA_TAC NOT_COPLANAR_0_4_IMP_INDEPENDENT[`v - x:real^3`; `u - x:real^3`; `((&1 - a) % u + a % w) - x:real^3`]);;let span_run_edges_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ fan80(x,V,E) /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 ==> ?t1:real t2:real t3:real. u1-x =t1 % (v-x)+t2 % ((&1 - a) % u + a % w - x)+t3 %(u-x)`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MP_TAC(REAL_ARITH`&0< a==> ~(a= &0)`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, v, u, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3,v:real^3,u:real^3,(&1 - a) % u + a % w:real^3}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REMOVE_ASSUM_TAC THEN DISCH_TAC THEN MRESA_TAC NOT_COPLANAR_0_4_IMP_INDEPENDENT[`v - x:real^3`; `u - x:real^3`; `((&1 - a) % u + a % w) - x:real^3`] THEN MRESA_TAC NOT_COPLANAR_NOT_COLLINEAR[`v - x:real^3`; `u - x:real^3`; `((&1 - a) % u + a % w) - x:real^3`;`(vec 0):real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={D,A,B,C}`] THEN RESA_TAC THEN POP_ASSUM(fun th-> MP_TAC(th) THEN ASSUME_TAC(th)) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,D}={D,A,B}`] THEN DISCH_TAC THEN MRESA_TAC th3[`v - x:real^3`; `u - x:real^3`; `((&1 - a) % u + a % w) - x:real^3`] THEN MRESA_TAC th3[ `((&1 - a) % u + a % w) - x:real^3`;`v - x:real^3`; `u - x:real^3`;] THEN MP_TAC(ISPECL [`(:real^3)`; `{v - x, u - x, ((&1 - a) % u + a % w) - x:real^3}`] CARD_EQ_DIM) THEN ASM_SIMP_TAC[ORTHONORMAL_IMP_INDEPENDENT; SUBSET_UNIV] THEN REWRITE_TAC[DIM_UNIV; DIMINDEX_3; HAS_SIZE; FINITE_INSERT; FINITE_EMPTY] THEN SIMP_TAC[CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT;] THEN ASM_REWRITE_TAC[NOT_IN_EMPTY; ARITH;SUBSET] THEN DISCH_TAC THEN POP_ASSUM(fun th-> MRESAL1_TAC th `u1-x:real^3`[IN_UNIV;SPAN_3;IN_ELIM_THM]) THEN EXISTS_TAC`u':real` THEN EXISTS_TAC`w':real` THEN EXISTS_TAC`v':real` THEN VECTOR_ARITH_TAC);;let cross_dot_fully_surrounded1_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> &0< ((v1 - x) cross (u1 - x)) dot ((&1 - a) % u + a % w-x)`,REPEAT STRIP_TAC THEN MRESAL_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`v1:real^3`; `(&1 - a) % u + a % w:real^3`;`u1:real^3`][VECTOR_ARITH`((&1 - a) % u + a % w) - x=(&1 - a) % u + a % w - x`] THEN POP_ASSUM MATCH_MP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_THEN(LABEL_TAC"yeu em") THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN REMOVE_THEN "yeu em" (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESA_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`] THEN MRESA_TAC properties_of_collinear4_points_fan[`x:real^3`;`v:real^3`;`(&1-a)%u+ a%w:real^3`;`v1:real^3`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA_TAC AFF_GT_1_2[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3) `;] THEN FIND_ASSUM MP_TAC `(v1:real^3) IN aff_gt {x} {v,(&1-a)%u+ a%(w:real^3)}` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;IN_ELIM_THM]) THEN STRIP_TAC THEN SUBGOAL_THEN`~collinear {x, v1, (&1 - a) % u + a % w:real^3}` ASSUME_TAC THENL[ ASM_REWRITE_TAC[collinear1_fan;] THEN FIND_ASSUM MP_TAC`~((&1 - a) % u + a % w IN aff {x, v:real^3})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1 % x + t2 % v + t3 % ((&1 - a) % u + a % w) = u' % x + v' % ((&1 - a) % u + a % w)<=> (&1-(t1+t2+t3)) % x + (v'-t3) % ((&1 - a) % u + a % w-x) = (&1-(u'+v') ) % x + t2 % (v-x)`;REAL_ARITH`a-a= &0`] THEN REDUCE_VECTOR_TAC THEN DISJ_CASES_TAC(REAL_ARITH`v' - t3= &0 \/ ~(v' - (t3:real)= &0)`) THENL[ ASM_REWRITE_TAC[VECTOR_ARITH`&0 %A=B<=> B= vec 0`;VECTOR_MUL_EQ_0] THEN MP_TAC(REAL_ARITH`&0< t2==> ~(t2 = &0)`) THEN RESA_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`A-B= vec 0<=> A=B`]; MRESA1_TAC REAL_MUL_LINV `(v'-t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(v' - t3) % ((&1 - a) % u + a % w - x) = t2 % (v - x:real^3) ==> (inv (v'-t3)) % (v' - t3) % ((&1 - a) % u + a % w - x) = (inv (v'-t3)) % ( t2 % (v - x))`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN ASM_REWRITE_TAC[VECTOR_ARITH`(A%B%C=(A*B)%C:real^3)`]) THEN REWRITE_TAC[VECTOR_ARITH`&1 % ((&1 - a) % u + a % w - x) = (inv (v' - t3) * t2) % (v - x)<=> (&1 - a) % u + a % w = (&1-(inv (v' - t3) * t2))%x +(inv (v' - t3) * t2) % v:real^3`] THEN STRIP_TAC THEN EXISTS_TAC`&1-(inv (v' - t3) * (t2:real))` THEN EXISTS_TAC`(inv (v' - t3) * (t2:real))` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN DISCH_TAC THEN REMOVE_THEN "A" MP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`v1:real^3`;`v:real^3`;`u1:real^3`;`((&1 - a) % u + a % w):real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"B") THEN DISCH_TAC THEN SUBGOAL_THEN`azim x v1 v ((&1 - a) % u + a % w)= pi` ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN MRESA_TAC th3[`(x:real^3)` ;`v1:real^3`;` (v:real^3)`] THEN MRESA_TAC AFF_LT_2_1[`x:real^3`;`v1:real^3`;`v:real^3`] THEN MRESAL_TAC AZIM_EQ_PI_ALT[`x:real^3`;`v1:real^3`;`v:real^3`;`((&1 - a) % u + a % w):real^3`][IN_ELIM_THM] THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[VECTOR_ARITH`A=B+C+D <=> D=A-B-C:real^3`] THEN MP_TAC(REAL_ARITH`&0<t3==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV `(t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE`t3 % ((&1 - a) % u + a % w) = v1 - t1 % x - t2 % v ==> (inv (t3)) % t3 % ((&1 - a) % u + a % w) = (inv (t3)) % ( v1 - t1 % x - t2 % v:real^3)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN ASM_REWRITE_TAC[VECTOR_ARITH`(A%B%C=(A*B)%C:real^3)`]) THEN REWRITE_TAC[VECTOR_ARITH`&1 % ((&1 - a) % u + a % w) = inv t3 % (v1 - t1 % x - t2 % v) <=> (&1 - a) % u + a % w = (-- inv t3 * t1) % x + (inv t3) % v1 +(-- (inv t3* t2)) % v`] THEN STRIP_TAC THEN EXISTS_TAC`(-- inv t3 * t1):real` THEN EXISTS_TAC`(inv t3):real` THEN EXISTS_TAC`(-- (inv t3 * t2)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`--inv t3 * t1 + inv t3 + --(inv t3 * t2)= inv t3 *(t3+ &1-(t1+t2+t3))`;REAL_ARITH`(t3 + &1 - &1)=t3`;REAL_ARITH`--A< &0 <=> &0< A`] THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LT_INV THEN ASM_REWRITE_TAC[]; REMOVE_THEN "B" MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN REMOVE_ASSUM_TAC THEN MP_TAC(REAL_ARITH`azim x v1 v u1 < pi==> azim x v1 v u1 <= pi`) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM MP_TAC`azim x v1 v (u1:real^3) < pi` THEN FIND_ASSUM MP_TAC`&0< azim x v1 v (u1:real^3) ` THEN REAL_ARITH_TAC]]);;let exists_cross_dot_fully_surrounded1_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> ?t. &0< t/\ t < &1 /\( !h:real. &0< h/\ h<t ==> &0< ((v1 - x) cross (u1 - x)) dot (((&1 - h) % ((&1 - a) % u + a % w) + h % u) - x))`,REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`(((&1 - t) % ((&1 - a) % u + a % w) + t % u) - x)= ((&1 - a) % u + a % w - x) + t % (--a) % ( w-u)`;] THEN ABBREV_TAC`va=(&1 - a) % u + a % w-x:real^3` THEN REWRITE_TAC[DOT_RADD;DOT_RMUL; REAL_ARITH`&0<A+C*(--B)*D<=> (B*D)*C<A`] THEN MRESA_TAC cross_dot_fully_surrounded1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` v:real^3`;` u:real^3`;`w:real^3`;`a:real`;`v1:real^3`;`u1:real^3`] THEN DISJ_CASES_TAC(REAL_ARITH`(((v1 - x) cross (u1 - x:real^3)) dot (w - u)<= &0 )\/ (&0<((v1 - x) cross (u1 - x)) dot (w - u))`) THENL[ EXISTS_TAC`&1/ &2` THEN REWRITE_TAC[REAL_ARITH`&0 < &1 / &2 /\ &1 / &2 < &1`] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0 < a ==> &0<= (a:real)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 < h ==> &0<= (h:real)`) THEN RESA_TAC THEN MRESAL_TAC REAL_LE_LMUL[`a:real`;`((v1 - x) cross (u1 - x)) dot ((w - u):real^3)`;`&0`][REAL_ARITH`(A:real)* &0= &0`] THEN MRESAL_TAC REAL_LE_RMUL[`a*((v1 - x) cross (u1 - x)) dot ((w - u):real^3)`;`&0`;`h:real`][REAL_ARITH`&0 * (A:real)= &0`] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; MRESA_TAC REAL_LT_MUL[`a:real`;`((v1 - x) cross (u1 - x)) dot ((w - u):real^3)`] THEN MP_TAC(REAL_ARITH`&0<(a:real)*((v1 - x) cross (u1 - x)) dot ((w - u):real^3)==> ~( (a:real)*((v1 - x) cross (u1 - x)) dot ((w - u):real^3)= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_RINV`(a:real)*((v1 - x) cross (u1 - x)) dot ((w - u):real^3)` THEN MRESA1_TAC REAL_LT_INV`(a:real)*((v1 - x) cross (u1 - x)) dot ((w - u):real^3)` THEN MRESA_TAC REAL_LT_MUL[`inv((a:real)*((v1 - x) cross (u1 - x)) dot ((w - u):real^3))`;`((v1 - x) cross (u1 - x)) dot (va:real^3)`] THEN EXISTS_TAC `min ((inv(a *(((v1 - x) cross (u1 - x)) dot (w - u)))*(((v1 - x) cross (u1 - x)) dot va)) / &2 ) (&1/ &2)` THEN STRIP_TAC THENL[POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` h< min ((inv (a * (((v1 - x) cross (u1 - x)) dot (w - u))) * (((v1 - x) cross (u1 - x)) dot va)) / &2) (&1 / &2) ==> h< ((inv (a * (((v1 - x) cross (u1 - x)) dot (w - u))) * (((v1 - x) cross (u1 - x)) dot va)) / &2)`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_LMUL[`(a * (((v1 - x) cross (u1 - x)) dot (w - u:real^3)))`;`h:real`;`((inv (a * (((v1 - x) cross (u1 - x)) dot (w - u))) * (((v1 - x) cross (u1 - x:real^3)) dot va)) / &2)`] THEN ASM_TAC THEN ABBREV_TAC`vb=a * (((v1 - x) cross (u1 - x)) dot (w - u))` THEN REPEAT DISCH_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`vb * (inv vb * (((v1 - x) cross (u1 - x)) dot va)) / &2= (vb * inv vb) * (((v1 - x) cross (u1 - x)) dot va)/ &2`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]);;let cross_dot_fully_surrounded2_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> &0 < (((&1 - a) % u + a % w - x) cross (v - x)) dot (u1 - x)`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_THEN(LABEL_TAC"yeu em") THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN REMOVE_THEN "yeu em" (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESA_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`] THEN MRESA_TAC properties_of_collinear4_points_fan[`x:real^3`;`v:real^3`;`(&1-a)%u+ a%w:real^3`;`v1:real^3`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA1_TAC SIN_POS_PI`azim x v1 v (u1:real^3)` THEN POP_ASSUM MP_TAC THEN MRESA_TAC AZIM_TRANSLATION[`-- x:real^3`;`x:real^3`;`v1:real^3`;` v:real^3`;`u1:real^3`] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`x-x= vec 0`;VECTOR_ARITH`(-- X)+A= A-X:real^3`] THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN MRESA_TAC JBDNJJB[`(v1-x):real^3`;`v-x:real^3`;`u1-x:real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM COLLINEAR_3;] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={B,A,C}`] THEN RESA_TAC THEN MRESAL_TAC REAL_LT_LMUL_EQ [` &0:real `;`(((v1 - x) cross (v - x)) dot ((u1 - x):real^3)):real`;`t:real`][REAL_ARITH`a * &0 = &0`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN MRESA_TAC AFF_GT_1_2[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3) `;] THEN FIND_ASSUM MP_TAC `v1 IN aff_gt {x} {v,(&1-a)%u+ a%(w:real^3)}` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;IN_ELIM_THM]) THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[th;VECTOR_ARITH`A- vec 0= A`;VECTOR_ARITH`(t1 % x + t2 % v + t3 % ((&1 - a) % u + a % w)) - x=(t1- &1) % x + t2 % v + t3 % ((&1 - a) % u + a % w)`]) THEN FIND_ASSUM MP_TAC `t1 + t2 + t3 = &1:real` THEN REWRITE_TAC[REAL_ARITH`t1 + t2 + t3 = &1<=> t1- &1= (-- t2)- t3 `] THEN DISCH_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`(--t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w)= t2 % (v-x) + t3 % ((&1 - a) % u + a % w-x)`] THEN REWRITE_TAC[CROSS_LADD; CROSS_RADD; CROSS_LMUL; CROSS_RMUL;CROSS_REFL;CROSS_RNEG;CROSS_LNEG] THEN REDUCE_VECTOR_TAC THEN REWRITE_TAC[GSYM CROSS_LMUL;GSYM CROSS_LADD;DOT_LMUL] THEN MRESAL_TAC REAL_LT_LMUL_EQ [` &0:real `;`((((&1 - a) % u + a % w - x) cross (v - x)) dot (u1 - x)):real`;`t3:real`][REAL_ARITH`a * &0 = &0`]);;let exists_cross_dot_fully_surrounded2_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> ?t:real. &0< t/\ t < &1 /\ (!h:real. &0<h /\ h< t ==> &0 < ((((&1 - h) % ((&1 - a) % u + a % w) + h % u) - x) cross (v - x)) dot (u1 - x))`,REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`(((&1 - t) % ((&1 - a) % u + a % w) + t % u) - x)= ((&1 - a) % u + a % w - x) + t % (--a) % ( w-u)`;] THEN ABBREV_TAC`va=(&1 - a) % u + a % w-x:real^3` THEN REWRITE_TAC[CROSS_LADD;CROSS_LMUL;DOT_LADD;DOT_LMUL; REAL_ARITH`&0<A+C*(--B)*D<=> (B*D)*C<A`] THEN MRESA_TAC cross_dot_fully_surrounded2_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` v:real^3`;` u:real^3`;`w:real^3`;`a:real`;`v1:real^3`;`u1:real^3`] THEN DISJ_CASES_TAC(REAL_ARITH`(((w - u) cross (v - x:real^3)) dot (u1- x)<= &0 )\/ (&0<((w - u) cross (v - x:real^3)) dot (u1- x))`) THENL[ EXISTS_TAC`&1/ &2` THEN REWRITE_TAC[REAL_ARITH`&0 < &1 / &2 /\ &1 / &2 < &1`] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0 < a ==> &0<= (a:real)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 < h ==> &0<= (h:real)`) THEN RESA_TAC THEN MRESAL_TAC REAL_LE_LMUL[`a:real`;`((w - u) cross (v - x:real^3)) dot (u1- x:real^3)`;`&0`][REAL_ARITH`(A:real)* &0= &0`] THEN MRESAL_TAC REAL_LE_RMUL[`a*(((w - u) cross (v - x:real^3)) dot (u1- x))`;`&0`;`h:real`][REAL_ARITH`&0 * (A:real)= &0`] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; MRESA_TAC REAL_LT_MUL[`a:real`;`((w - u) cross (v - x:real^3)) dot (u1- x:real^3)`] THEN MP_TAC(REAL_ARITH`&0<(a:real)*(((w - u) cross (v - x:real^3)) dot (u1- x))==> ~( (a:real)*(((w - u) cross (v - x:real^3)) dot (u1- x))= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_RINV`(a:real)*(((w - u) cross (v - x:real^3)) dot (u1- x))` THEN MRESA1_TAC REAL_LT_INV`(a:real)*(((w - u) cross (v - x:real^3)) dot (u1- x))` THEN MRESA_TAC REAL_LT_MUL[`inv((a:real)*(((w - u) cross (v - x:real^3)) dot (u1- x)))`;`((va cross (v - x)) dot (u1 - x))`] THEN EXISTS_TAC `min ((inv(a *(((w - u) cross (v - x:real^3)) dot (u1- x)))*((va cross (v - x)) dot (u1 - x))) / &2 ) (&1/ &2)` THEN STRIP_TAC THENL[POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` h< min ((inv(a *(((w - u) cross (v - x:real^3)) dot (u1- x)))*((va cross (v - x)) dot (u1 - x))) / &2 ) (&1/ &2) ==> h< ((inv(a *(((w - u) cross (v - x:real^3)) dot (u1- x)))*((va cross (v - x)) dot (u1 - x))) / &2 )`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_LMUL[`(a *(((w - u) cross (v - x:real^3)) dot (u1- x)))`;`h:real`;`((inv(a *(((w - u) cross (v - x:real^3)) dot (u1- x)))*((va cross (v - x)) dot (u1 - x))) / &2 )`] THEN ASM_TAC THEN ABBREV_TAC`vb=a * (((w - u) cross (v - x:real^3)) dot (u1- x))` THEN REPEAT DISCH_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`vb * (inv vb * ((va cross (v - x)) dot (u1 - x))) / &2= (vb * inv vb) * ((va cross (v - x)) dot (u1 - x))/ &2`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]);;let lie_in_half_space_and_azim=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> &0 < ((v-x) cross (u - x)) dot (v1-x)`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_THEN(LABEL_TAC"yeu em") THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN REMOVE_THEN "yeu em" (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESA_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA_TAC AFF_GT_1_2[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3) `;] THEN FIND_ASSUM MP_TAC `v1 IN aff_gt {x} {v,(&1-a)%u+ a%(w:real^3)}` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;IN_ELIM_THM]) THEN STRIP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`A- vec 0= A`;VECTOR_ARITH`(t1 % x + t2 % v + t3 % ((&1 - a) % u + a % w)) - x=(t1- &1) % x + t2 % v + t3 % ((&1 - a) % u + a % w)`] THEN FIND_ASSUM MP_TAC `t1 + t2 + t3 = &1:real` THEN REWRITE_TAC[REAL_ARITH`t1 + t2 + t3 = &1<=> t1- &1= (-- t2)- t3 `] THEN DISCH_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`(--t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w)= t2 % (v-x) + t3 % ((&1 - a) % (u-x) + a % (w-x))`] THEN REWRITE_TAC[ DOT_RADD;DOT_RMUL;DOT_CROSS_SELF] THEN REDUCE_ARITH_TAC THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`; `u:real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[CROSS_TRIPLE]);;let exists_cut_small_edges_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real v1:real^3 u1:real^3. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ fan80(x,V,E) /\ ~collinear{x,v1,u1} /\ v1 IN aff_gt {x} {v,(&1-a)%u+ a%w} /\ &0< azim x v1 v u1 /\ azim x v1 v u1 < pi ==> ?t:real. &0< t/\ t < &1 /\ ~(aff_gt {x} {v,(&1-t)%((&1-a)%u+ a%w)+t%u} INTER aff_gt {x} {v1,u1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC lie_in_half_space_and_azim[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v1:real^3`;` u1:real^3`] THEN MRESA_TAC exists_cross_dot_fully_surrounded1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v1:real^3`;` u1:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"MA") THEN MRESA_TAC exists_cross_dot_fully_surrounded2_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v1:real^3`;` u1:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"BE NHO") THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_THEN(LABEL_TAC"yeu em") THEN ABBREV_TAC`ta=min (t:real) (t':real)/ &2` THEN EXISTS_TAC `(ta:real)` THEN SUBGOAL_THEN `&0< ta:real /\ ta < &1 /\ ta< t /\ ta< t'` ASSUME_TAC THENL(*1*)[ POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN FIND_ASSUM MP_TAC`&0<t:real` THEN FIND_ASSUM MP_TAC`t:real < &1` THEN FIND_ASSUM MP_TAC`&0<t':real` THEN FIND_ASSUM MP_TAC`t':real < &1` THEN REAL_ARITH_TAC;(*1*) ASM_REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`ta< &1 ==> &0< (&1-ta):real`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL [`(&1-ta):real`;`a:real`] THEN MRESA_TAC REAL_LT_LMUL [`(&1-ta):real`;`a:real`;`&1`] THEN MP_TAC(REAL_ARITH` &0< ta /\ (&1-ta)*a< (&1-ta)* &1 :real==> (&1-ta)*a< &1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`v:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN REMOVE_THEN "yeu em" (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN MRESAL_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`((&1-ta)*a):real`][VECTOR_ARITH`(&1 - ((&1 - ta) * a)) % u + ((&1 - ta) * a ) % w= (&1 - ta) % ((&1 - a) % u + a % w) + ta % u:real^3`] THEN MRESA_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`] THEN MRESA_TAC properties_of_collinear4_points_fan[`x:real^3`;`v:real^3`;`(&1-a)%u+ a%w:real^3`;`v1:real^3`] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`v1:real^3`;`u1:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"CON") THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - ta) % ((&1 - a) % u + a % w) + ta % u:real^3`;] THEN MRESA_TAC th3[`(x:real^3)` ;` (v1:real^3)`;`u1:real^3`;] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA_TAC AFF_GT_1_2[`(x:real^3)` ;` (v1:real^3)`;`(u1:real^3) `;] THEN MRESA_TAC AFF_GT_1_2[`(x:real^3)` ;` (v:real^3)`;`(&1 - ta) % ((&1 - a) % u + a % w) + ta % u:real^3 `;] THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;EXTENSION;EMPTY;IN;NOT_FORALL_THM] THEN ABBREV_TAC`a1=(v-x):real^3` THEN ABBREV_TAC`a2=(((&1-ta)%((&1-a)%u+ a%w)+ta%u)-x):real^3` THEN ABBREV_TAC`a3=(v1-x) :real^3` THEN ABBREV_TAC`a4=u1-x:real^3` THEN ABBREV_TAC`va=a1 cross a2:real^3` THEN ABBREV_TAC`vb=a3 cross a4:real^3` THEN EXISTS_TAC`(vb:real^3) cross (va:real^3)+(x:real^3)` THEN STRIP_TAC THENL(*2*)[ EXISTS_TAC`&1-(vb:real^3) dot (a2:real^3)+ vb dot (a1:real^3)` THEN EXISTS_TAC`(vb:real^3) dot (a2:real^3)` THEN EXISTS_TAC`--((vb:real^3) dot (a1:real^3))` THEN REMOVE_THEN "MA"(fun th-> MRESA1_TAC th `ta:real`) THEN ASM_REWRITE_TAC[REAL_ARITH`(&1 - vb dot a2 + vb dot a1) + vb dot a2 + --(vb dot a1) = &1`] THEN SUBGOAL_THEN `&0< --((vb:real^3) dot (a1:real^3))` ASSUME_TAC THENL(*3*)[EXPAND_TAC"vb" THEN ONCE_REWRITE_TAC[CROSS_SKEW;] THEN REWRITE_TAC[DOT_LNEG] THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN REMOVE_THEN "CON"MP_TAC THEN REAL_ARITH_TAC;(*3*) ASM_REWRITE_TAC[] THEN EXPAND_TAC"va" THEN REWRITE_TAC[CROSS_LAGRANGE;VECTOR_MUL_LNEG] THEN EXPAND_TAC"a1" THEN EXPAND_TAC"a2" THEN VECTOR_ARITH_TAC];(*2*) ONCE_REWRITE_TAC[CROSS_SKEW] THEN EXPAND_TAC"vb" THEN REWRITE_TAC[CROSS_LAGRANGE;] THEN EXISTS_TAC`&1+(va:real^3) dot (a4:real^3)- va dot (a3:real^3)` THEN EXISTS_TAC`--(va:real^3) dot (a4:real^3)` THEN EXISTS_TAC`((va:real^3) dot (a3:real^3))` THEN REMOVE_THEN "BE NHO"(fun th-> MRESA1_TAC th `ta:real`) THEN ASM_REWRITE_TAC[DOT_LNEG;VECTOR_MUL_LNEG;REAL_ARITH`(&1 + va dot a4 - va dot a3) + --(va dot a4) + va dot a3 = &1`;] THEN STRIP_TAC THENL(*3*)[ EXPAND_TAC"va" THEN ONCE_REWRITE_TAC[CROSS_SKEW;] THEN REWRITE_TAC[DOT_LNEG] THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC;(*3*) STRIP_TAC THENL(*4*)[ EXPAND_TAC"va" THEN EXPAND_TAC"a2" THEN REWRITE_TAC[VECTOR_ARITH`((&1 - ta) % ((&1 - a) % u + a % w) + ta % u) - x =(&1 - ta) % ((&1 - a) % u + a % w-x) + ta % (u - x)`] THEN ABBREV_TAC`vu=(&1 - a) % u + a % w - x:real^3` THEN REWRITE_TAC[CROSS_RADD;CROSS_RMUL;DOT_LADD;DOT_LMUL;] THEN MRESAL_TAC coplanar_is_cross_fan[`x:real^3`;`v:real^3`;`(&1 - a) % u + a % w:real^3`;`v1:real^3`] [VECTOR_ARITH`((&1 - a) % u + a % w) - x=(&1 - a) % u + a % w - x`] THEN REDUCE_ARITH_TAC THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[];(*4*) EXPAND_TAC"a3" THEN EXPAND_TAC"a4" THEN REWRITE_TAC[VECTOR_ARITH`-- A+B= B-A:real^3`;VECTOR_ARITH`(&1+A-B)%X+B%U-A%V=X-A%(V-X)+B%(U-X)`] THEN VECTOR_ARITH_TAC]]]]);;let not_cut_inside_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ (!h:real. &0<h /\ h< a ==> aff_gt{x} {v,(&1-h)%u+ h % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={}) ==> aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={}`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN DISCH_TAC THEN POP_ASSUM (fun th-> MP_TAC (th) THEN ASSUME_TAC(th)) THEN REWRITE_TAC[fan80] THEN DISCH_THEN(LABEL_TAC"BE") THEN DISCH_THEN(LABEL_TAC"YEU") THEN REWRITE_TAC[INTER;EXTENSION;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL(*1*)[ STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC expand_edge_graph_fan [`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN DISCH_TAC THEN REMOVE_THEN "A" MP_TAC THEN POP_ASSUM(fun th->REWRITE_TAC[(th)]) THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN DISCH_TAC THEN REMOVE_THEN "A" MP_TAC THEN REMOVE_THEN "BE" (fun th-> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"BE") ) THEN MRESA_TAC not_collinear_is_properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w':real^3)`; ` (v':real^3)`] THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`v':real^3`;`w':real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "VUT1") THEN MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-a)%u +a%w:real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "VUT") THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "VUT1") THEN DISCH_TAC THEN DISCH_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(t3'= &0) \/ ~(t3':real= &0)`) THENL(*2*)[ ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(t2'= &0) \/ ~(t2':real= &0)`) THENL(*3*)[ ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN REDUCE_VECTOR_TAC THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(t3:real)`REAL_MUL_LINV) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM (fun th-> REWRITE_TAC[SYM(th)])`t1 + t2 + t3 = &1:real` THEN REWRITE_TAC[VECTOR_ARITH`t1 % x + t2 % v + t3 % (((t1 + t2 + t3) - a) % u + a % w) = (t1 + t2 + t3) % x<=>(t3) % (((t1 + t2 + t3) - a) % u + a % w- x)=(-- t2) % (v-x) `] THEN ASM_REWRITE_TAC[IN;EMPTY] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (t3) % ((&1 - a) % u + a % w- x)=(-- t2) % (v-x) ==> (inv (t3))%((t3) % ((&1 - a) % u + a % w- x) ) = (inv (t3))%((-- t2) % (v-x)):real^3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;] THEN REDUCE_VECTOR_TAC THEN REWRITE_TAC[VECTOR_ARITH`E+A-B=C%(D-B)<=>E+A=(&1-C)%B+C%D`;] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC `~((&1 - a) % u + a % w IN aff {x, v:real^3})` THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN EXISTS_TAC`&1-(inv t3 * (--t2)):real` THEN EXISTS_TAC`(inv t3 * (--t2)):real` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*3*) FIND_ASSUM MP_TAC`t1 + t2 + t3 = &1:real` THEN REWRITE_TAC[REAL_ARITH`t1 + t2 + t3 = &1<=> t1= &1 -t2 -t3`; REAL_ARITH`A+B= &1<=> A= &1-B`] THEN DISCH_THEN(LABEL_TAC"MAI") THEN DISCH_THEN (LABEL_TAC"YEU EM") THEN ASM_REWRITE_TAC[VECTOR_ARITH`(&1 - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w) = (&1 - t2') % x + t2' % v'<=> t2' % v'=(t2' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3 `] THEN MP_TAC(ISPEC`(t2':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2' % v'=(t2' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3 ==> (inv (t2'))%(t2' % v' ) = (inv (t2'))%((t2' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C+D)=(A%B+A%C+A%D)`;REAL_ARITH`a*(b-c-d)=a*b-a*c-a*d`] THEN REDUCE_VECTOR_TAC THEN DISCH_TAC THEN SUBGOAL_THEN `~coplanar{x:real^3,v':real^3,v:real^3,u:real^3}` ASSUME_TAC THENL(*4*)[ POP_ASSUM MP_TAC THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, v', v, u}= {(--x) +x, (--x) +v', (--x) +v, (--x) +u}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3,v':real^3,v:real^3,u:real^3}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`]) THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th;VECTOR_ARITH`((&1 - inv t2' * t2 - inv t2' * t3) % x + (inv t2' * t2) % v + (inv t2' * t3) % ((&1 - a) % u + a % w)) - x=(inv t2' * t2) % (v-x) + (inv t2' * t3) % ((&1 - a) % u + a % w-x)`]) THEN MP_TAC(REAL_ARITH`&0< t2 /\ &0< t3 /\ t1+t2+t3= &1==> &0 < &1- t1 /\ ~(&1- t1 = &0)/\ t2+t3= &1- t1`) THEN REMOVE_THEN"MAI" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1:real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1:real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2 + t3 = &1 - t1:real ==> (inv ( &1 - t1))*(t2 + t3) = (inv ( &1 - t1))*( &1 - t1:real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> A*B = &1 -A*C`] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH` ~(t2' = &0) /\ &0 <= t2'==> &0 <t2'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` &0 < a==> ~(a = &0) `) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`t2':real`;`inv (&1- t1):real`] THEN MRESA_TAC REAL_LT_MUL[`inv (&1- t1):real`;`t3:real`;] THEN MP_TAC(REAL_ARITH`&0< (inv (&1- t1)) * t3 ==> ~( (inv(&1- t1)) * t3= &0)`) THEN MP_TAC(REAL_ARITH`&0< (t2') * inv (&1- t1) ==> ~((t2')* inv(&1- t1)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1 = &0)`) THEN MRESA_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`(t2')* inv(&1- t1)`;`u - x:real^3`; `v - x:real^3`; `(inv t2' * t2) % (v - x) +(inv t2' * t3) % ((&1 - a) % u + a % w - x):real^3`] THEN POP_ASSUM (fun th -> ONCE_REWRITE_TAC[SYM(th);]) THEN REDUCE_VECTOR_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B+E%(C+D))=A%B+(A*E)%(C+D)`; VECTOR_ARITH`A%B%C=(A*B)%C`; REAL_ARITH`(t2' * inv (&1 - t1)) * inv t2' * t2= (inv (t2')* t2' ) * inv (&1-t1) * t2`] THEN REDUCE_ARITH_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`(inv(&1- t1)) * t3:real`) THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[VECTOR_ARITH` (&1 - inv (&1 - t1) * t3) % (v - x) + (inv (&1 - t1) * t3) % (((&1 - a) % u + a % w) - x)= (&1 - inv (&1 - t1) * t3) % (v - x) + (inv (&1 - t1) * t3) % ((&1 - a) % u + a % w - x)`];(*4*) POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"DICH") THEN DISCH_TAC THEN ABBREV_TAC `va=((&1 - a) % u + a % w):real^3` THEN MP_TAC(REAL_ARITH` ~(t2' = &0) /\ &0 <= t2'==> &0 <t2'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` &0 < a==> ~(a = &0) `) THEN RESA_TAC THEN MRESA1_TAC REAL_LT_INV`t2':real` THEN MRESA_TAC REAL_LT_MUL[`inv (t2'):real`;`t2:real`;] THEN MRESA_TAC REAL_LT_MUL[`inv (t2'):real`;`t3:real`;] THEN SUBGOAL_THEN `(v':real^3) IN aff_gt {x} {v,va:real^3}` ASSUME_TAC THENL(*5*)[ ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`(&1 - inv t2' * t2 - inv t2' * t3:real)` THEN EXISTS_TAC`inv t2' * t2:real` THEN EXISTS_TAC`(inv t2' * t3:real)` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*5*) REMOVE_THEN "DICH" MP_TAC THEN REMOVE_THEN "VUT" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `v':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (v':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v':real^3`;`u':real^3`] THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN REWRITE_TAC[EMPTY;IN] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`v':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{v',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[]](*5*)](*4*)](*3*);(*2*) DISJ_CASES_TAC(REAL_ARITH`(t2'= &0) \/ ~(t2':real= &0)`) THENL(*3*)[ FIND_ASSUM MP_TAC`t1 + t2 + t3 = &1:real` THEN REWRITE_TAC[REAL_ARITH`t1 + t2 + t3 = &1<=> t1= &1 -t2 -t3`; REAL_ARITH`A+B= &1<=> A= &1-B`] THEN DISCH_THEN(LABEL_TAC"MAI") THEN DISCH_THEN (LABEL_TAC"YEU EM") THEN ASM_REWRITE_TAC[VECTOR_ARITH`(&1 - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w) = (&1 - &0 - t3') % x + &0% v'+t3' % w'<=> t3' % w'=(t3' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3 `] THEN MP_TAC(ISPEC`(t3':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3' % w'=(t3' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3 ==> (inv (t3'))%(t3' % w' ) = (inv (t3'))%((t3' - t2 - t3) % x + t2 % v + t3 % ((&1 - a) % u + a % w):real^3) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C+D)=(A%B+A%C+A%D)`;REAL_ARITH`a*(b-c-d)=a*b-a*c-a*d`] THEN REDUCE_VECTOR_TAC THEN DISCH_TAC THEN SUBGOAL_THEN `~coplanar{x:real^3,w':real^3,v:real^3,u:real^3}` ASSUME_TAC THENL(*4*)[ POP_ASSUM MP_TAC THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, w', v, u}= {(--x) +x, (--x) +w', (--x) +v, (--x) +u}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3,w':real^3,v:real^3,u:real^3}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`]) THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th;VECTOR_ARITH`((&1 - inv t2' * t2 - inv t2' * t3) % x + (inv t2' * t2) % v + (inv t2' * t3) % ((&1 - a) % u + a % w)) - x=(inv t2' * t2) % (v-x) + (inv t2' * t3) % ((&1 - a) % u + a % w-x)`]) THEN MP_TAC(REAL_ARITH`&0< t2 /\ &0< t3 /\ t1+t2+t3= &1==> &0 < &1- t1 /\ ~(&1- t1 = &0)/\ t2+t3= &1- t1`) THEN REMOVE_THEN"MAI" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1:real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1:real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2 + t3 = &1 - t1:real ==> (inv ( &1 - t1))*(t2 + t3) = (inv ( &1 - t1))*( &1 - t1:real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> A*B = &1 -A*C`] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH` ~(t3' = &0) /\ &0 <= t3'==> &0 <t3'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` &0 < a==> ~(a = &0) `) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`t3':real`;`inv (&1- t1):real`] THEN MRESA_TAC REAL_LT_MUL[`inv (&1- t1):real`;`t3:real`;] THEN MP_TAC(REAL_ARITH`&0< (inv (&1- t1)) * t3 ==> ~( (inv(&1- t1)) * t3= &0)`) THEN MP_TAC(REAL_ARITH`&0< (t3') * inv (&1- t1) ==> ~((t3')* inv(&1- t1)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1 = &0)`) THEN MRESA_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`(t3')* inv(&1- t1)`;`u - x:real^3`; `v - x:real^3`; `(inv t3' * t2) % (v - x) +(inv t3' * t3) % ((&1 - a) % u + a % w - x):real^3`] THEN POP_ASSUM (fun th -> ONCE_REWRITE_TAC[SYM(th);]) THEN REDUCE_VECTOR_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B+E%(C+D))=A%B+(A*E)%(C+D)`; VECTOR_ARITH`A%B%C=(A*B)%C`; REAL_ARITH`(t2' * inv (&1 - t1)) * inv t2' * t2= (inv (t2')* t2' ) * inv (&1-t1) * t2`] THEN REDUCE_ARITH_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`(inv(&1- t1)) * t3:real`) THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[VECTOR_ARITH` (&1 - inv (&1 - t1) * t3) % (v - x) + (inv (&1 - t1) * t3) % (((&1 - a) % u + a % w) - x)= (&1 - inv (&1 - t1) * t3) % (v - x) + (inv (&1 - t1) * t3) % ((&1 - a) % u + a % w - x)`];(*4*) POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"DICH") THEN DISCH_TAC THEN ABBREV_TAC `va=((&1 - a) % u + a % w):real^3` THEN MP_TAC(REAL_ARITH` ~(t3' = &0) /\ &0 <= t3'==> &0 <t3'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` &0 < a==> ~(a = &0) `) THEN RESA_TAC THEN MRESA1_TAC REAL_LT_INV`t3':real` THEN MRESA_TAC REAL_LT_MUL[`inv (t3'):real`;`t2:real`;] THEN MRESA_TAC REAL_LT_MUL[`inv (t3'):real`;`t3:real`;] THEN SUBGOAL_THEN `(w':real^3) IN aff_gt {x} {v,va:real^3}` ASSUME_TAC THENL[(*5*) ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`(&1 - inv t3' * t2 - inv t3' * t3:real)` THEN EXISTS_TAC`inv t3' * t2:real` THEN EXISTS_TAC`(inv t3' * t3:real)` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*5*) REMOVE_THEN "DICH" MP_TAC THEN REMOVE_THEN "VUT" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN FIND_ASSUM MP_TAC`{v',w':real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN DISCH_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v':real^3)`; ` (w':real^3)`] THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `w':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (w':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`w':real^3`;`u':real^3`] THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN REWRITE_TAC[EMPTY;IN] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`w':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{w',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[]](*5*)](*4*);(*3*) ASM_REWRITE_TAC[] THEN DISCH_TAC THEN DISCH_THEN(LABEL_TAC"BO") THEN ABBREV_TAC `va=((&1 - a) % u + a % w):real^3` THEN MP_TAC(REAL_ARITH` ~(t3' = &0) /\ &0 <= t3'==> &0 <t3'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` ~(t2' = &0) /\ &0 <= t2'==> &0 <t2'`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` &0 < a==> ~(a = &0) `) THEN RESA_TAC THEN MRESA1_TAC REAL_LT_INV`t2':real` THEN MRESA1_TAC REAL_MUL_LINV`t2':real` THEN MRESA_TAC REAL_LT_MUL[`inv (t2'):real`;`t2:real`;] THEN MRESA_TAC REAL_LT_MUL[`inv (t2'):real`;`t3:real`;] THEN MRESA1_TAC REAL_LT_INV`t3':real` THEN MRESA1_TAC REAL_MUL_LINV`t3':real` THEN MRESA_TAC REAL_LT_MUL[`inv (t3'):real`;`t2:real`;] THEN MRESA_TAC REAL_LT_MUL[`inv (t3'):real`;`t3:real`;] THEN SUBGOAL_THEN`(x':real^3) IN aff_gt {x} {v',w'}` ASSUME_TAC THENL(*4*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v':real^3`;`w':real^3`][IN_ELIM_THM] THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`t1':real` THEN EXISTS_TAC`t2':real` THEN EXISTS_TAC`t3':real` THEN ASM_REWRITE_TAC[];(*4*) SUBGOAL_THEN`(x':real^3) IN aff_ge {x} {v',w'}` ASSUME_TAC THENL(*5*)[ ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`t1':real` THEN EXISTS_TAC`t2':real` THEN EXISTS_TAC`t3':real` THEN ASM_REWRITE_TAC[];(*5*) SUBGOAL_THEN `(x':real^3) IN aff_gt {x} {v,va:real^3}` ASSUME_TAC THENL(*6*)[ ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`t1:real` THEN EXISTS_TAC`t2:real` THEN EXISTS_TAC`t3:real` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*6*) SUBGOAL_THEN `(x':real^3) IN aff_ge {x} {v,va:real^3}` ASSUME_TAC THENL(*7*)[ MRESA_TAC AFF_GE_1_2[`x:real^3`;`v:real^3`;`va:real^3`] THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`t1:real` THEN EXISTS_TAC`t2:real` THEN EXISTS_TAC`t3:real` THEN MP_TAC(REAL_ARITH`&0< t2==> &0 <= t2`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0< t3==> &0 <= t3`) THEN RESA_TAC THEN ASM_REWRITE_TAC[];(*7*) FIND_ASSUM MP_TAC`{v',w':real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN DISCH_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v':real^3)`; ` (w':real^3)`] THEN SUBGOAL_THEN `~collinear {x, x', w':real^3}` ASSUME_TAC THENL(*8*)[ ASM_REWRITE_TAC[collinear1_fan;] THEN FIND_ASSUM MP_TAC `~((v':real^3) IN aff{x,w'})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff; AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[VECTOR_ARITH`t1' % x + t2' % v' + t3' % w' = u' % x + v'' % w' <=> t2' % v' = (u'-t1') % x + (v''-t3') % w'`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2' % v' = (u'-t1') % x + (v''-t3') % w':real^3 ==> (inv ( t2'))%(t2' % v') = (inv (t2'))%((u'-t1') % x + (v''-t3') % w') `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C= (A*B)%C`;VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC `(inv t2' * (u' - t1':real))` THEN EXISTS_TAC `(inv t2' * (v'' - t3':real))` THEN ASM_REWRITE_TAC[REAL_ARITH`inv t2' * (u' - t1') + inv t2' * (v'' - t3')=inv t2'* (t2'+ (u'+v'') - (t1'+t2'+t3'))`;REAL_ARITH`t2'+ &1 - &1=t2'`];(*8*) SUBGOAL_THEN `~collinear {x, x', v':real^3}` ASSUME_TAC THENL(*9*)[ ASM_REWRITE_TAC[collinear1_fan;] THEN FIND_ASSUM MP_TAC `~((w':real^3) IN aff{x,v'})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff; AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[VECTOR_ARITH`t1' % x + t2' % v' + t3' % w' = u' % x + v'' % v' <=> t3' % w' = (u'-t1') % x + (v''-t2') % v'`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3' % w' = (u'-t1') % x + (v''-t2') % v':real^3 ==> (inv ( t3'))%(t3' % w') = (inv (t3'))%((u'-t1') % x + (v''-t2') % v') `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C= (A*B)%C`;VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC `(inv t3' * (u' - t1':real))` THEN EXISTS_TAC `(inv t3' * (v'' - t2':real))` THEN ASM_REWRITE_TAC[REAL_ARITH`inv t3' * (u' - t1') + inv t3' * (v'' - t2')=inv t3'* (t3'+ (u'+v'') - (t1'+t2'+t3'))`;REAL_ARITH`t3'+ &1 - &1=t3'`];(*9*) SUBGOAL_THEN`~collinear {x, x', va:real^3}` ASSUME_TAC THENL(*10*)[ REMOVE_THEN "BO" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN ASM_REWRITE_TAC[collinear1_fan;] THEN FIND_ASSUM MP_TAC`~(va IN aff {x, v:real^3})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1 % x + t2 % v + t3 % (va) = u' % x + v' % (va)<=> (&1-(t1+t2+t3)) % x + (v'-t3) % (va-x) = (&1-(u'+v') ) % x + t2 % (v-x)`;REAL_ARITH`a-a= &0`] THEN REDUCE_VECTOR_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(v'' - t3 = &0) \/ ~(v'' - (t3:real)= &0)`) THENL(*11*)[ ASM_REWRITE_TAC[VECTOR_ARITH`&0 %A=B<=> B= vec 0`;VECTOR_MUL_EQ_0] THEN MP_TAC(REAL_ARITH`&0< t2==> ~(t2 = &0)`) THEN RESA_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`A-B= vec 0<=> A=B`];(*11*) MRESA1_TAC REAL_MUL_LINV `(v''-t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(v'' - t3) % (va- x) = t2 % (v - x:real^3) ==> (inv (v'' -t3)) % ((v'' - t3) % (va - x)) = (inv (v'' -t3)) % ( t2 % (v - x))`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN ASM_REWRITE_TAC[VECTOR_ARITH`(A%B%C=(A*B)%C:real^3)`]) THEN REWRITE_TAC[VECTOR_ARITH`&1 % (va - x) = (inv (v' - t3) * t2) % (v - x)<=> va = (&1-(inv (v' - t3) * t2))%x +(inv (v' - t3) * t2) % v:real^3`] THEN STRIP_TAC THEN EXISTS_TAC`&1-(inv (v'' - t3) * (t2:real))` THEN EXISTS_TAC`(inv (v'' - t3) * (t2:real))` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC](*11*);(*10*) SUBGOAL_THEN `~collinear {x, x', v:real^3}` ASSUME_TAC THENL(*11*)[ REMOVE_THEN "BO" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN ASM_REWRITE_TAC[collinear1_fan] THEN FIND_ASSUM MP_TAC `~(va IN aff {x, v:real^3})` THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff; AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[VECTOR_ARITH`t1' % x + t2' % v' + t3' % w' = u' % x + v'' % v' <=> t3' % w' = (u'-t1') % x + (v''-t2') % v'`] THEN MP_TAC(REAL_ARITH`&0< t3 ==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`t3:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % va = (u'-t1) % x + (v''-t2) % v:real^3 ==> (inv ( t3))%(t3 % va) = (inv (t3))%((u'-t1) % x + (v''-t2) % v) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C= (A*B)%C`;VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC `(inv t3 * (u' - t1:real))` THEN EXISTS_TAC `(inv t3 * (v'' - t2:real))` THEN ASM_REWRITE_TAC[REAL_ARITH`inv t3' * (u' - t1') + inv t3' * (v'' - t2')=inv t3'* (t3'+ (u'+v'') - (t1'+t2'+t3'))`;REAL_ARITH`t3'+ &1 - &1=t3'`];(*11*) ABBREV_TAC`an=t1' % x + t2' % v' + t3' % w':real^3` THEN REMOVE_THEN "VUT1" MP_TAC THEN REMOVE_THEN "VUT1" MP_TAC THEN REMOVE_THEN "BO" MP_TAC THEN REMOVE_THEN "VUT" MP_TAC THEN DISCH_TAC THEN DISCH_TAC THEN DISCH_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN DISJ_CASES_TAC(SET_RULE`(&0 < azim x (x':real^3) v w' /\ azim x (x') v w' < pi)\/ ~(&0 < azim x (x') v w' /\ azim x (x') v w' < pi)`) THENL(*12*)[ MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`x':real^3`;`w':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt1_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{v',w'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[];(*12*) ASSUME_TAC(ISPECL[`x:real^3`;`v':real^3`;`w':real^3`;`x':real^3`]azim) THEN ASSUME_TAC(PI_WORKS) THEN MP_TAC(REAL_ARITH`~(&0 < azim x x' v w' /\ azim x x' v w' < pi)/\ &0 <= azim x x' v w' /\ &0< pi==> pi< azim x x' v w' \/(azim x x' v w'= &0 \/ azim x x' v w'=pi) `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*13*)(*3SUBGOAL*)[ POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3 `;`x':real^3`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN DISCH_TAC THEN MP_TAC(REAL_ARITH`azim x x' v' w' < azim x x' v w'==>azim x x' v' w' <= azim x x' v w'`) THEN RESA_TAC THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`v':real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3 `;`x':real^3`] THEN DISCH_TAC THEN DISCH_TAC THEN MP_TAC(REAL_ARITH`pi < azim x x' v w' /\ azim x x' v w' = azim x x' v v' + pi /\ azim x x' v w' < &2 * pi==> &0 <azim x x' v v' /\ azim x x' v v' < pi`) THEN RESA_TAC THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`x':real^3`;`v':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN SUBGOAL_THEN ` aff_ge {x} {w', v':real^3}=aff_ge {x} {v', w'}` ASSUME_TAC THENL(*14*)[ REWRITE_TAC[SET_RULE`{A,B}={B,A}`];(*14*) MRESA_TAC aff_gt1_subset_aff_ge[`x:real^3`;`w':real^3`;`v':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{v',w'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[]](*14*);(*13*) MRESA_TAC AZIM_EQ_0[`x:real^3`;`x':real^3`;`v:real^3`;`w':real^3`] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`x':real^3`;`v:real^3`;`w':real^3`] THEN MRESA_TAC AZIM_EQ_0[`x:real^3`;`x':real^3`;`w':real^3`;`v:real^3`] THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`w':real^3`;`v:real^3`] THEN DISJ_CASES_TAC(SET_RULE`w' IN aff_gt {x} {v,va:real^3}\/ ~(w' IN aff_gt {x} {v,va:real^3})`) THENL(*14*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-a)%u +a%w:real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"DICH CHUYEN") THEN DISCH_TAC THEN REMOVE_THEN "DICH CHUYEN"(fun th->MP_TAC(th) THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN ASSUME_TAC(th)) THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`w' = t1'' % x + t2'' % v + t3'' % va<=> ((t1''+t2''+t3'')- &1) % x + t2'' % (v-x) + t3'' % (va-x)= w' -x:real^3`;REAL_ARITH`&1- &1 = &0`] THEN REDUCE_VECTOR_TAC THEN MP_TAC(REAL_ARITH`&0< t2'' /\ &0< t3'' /\ t1''+t2''+t3''= &1==> &0 < &1- t1'' /\ ~(&1- t1'' = &0)/\ t2''+t3''= &1- t1''`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2'' + t3'' = &1 - t1'':real ==> (inv ( &1 - t1''))*(t2'' + t3'') = (inv ( &1 - t1''))*( &1 - t1'':real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> &1- A*C = A*B`] THEN STRIP_TAC THEN MRESA_TAC REAL_LT_MUL[`inv(&1- t1'':real)`;`t3'':real`] THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)*(t3'':real)==> ~(inv(&1- t1'':real)*(t3'':real)= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)==> ~(inv(&1- t1'':real)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1= &0)`) THEN STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(inv(&1- t1'')) * t3'':real`[VECTOR_ARITH`(A*B)%X+(A*C)%Y=A%(B%X+C%Y)`]) THEN POP_ASSUM MP_TAC THEN MRESAL_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`inv(&1- t1'')`;`u - x:real^3`; `v - x:real^3`; `w'-x:real^3`] [VECTOR_ARITH`&1 %A=A`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v,w'}= {(--x) +x, (--x) +u, (--x) +v, (--x) + w'}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, w'}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN DISCH_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `w':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (w':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`w':real^3`;`u':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`w':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{w',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[];(*14*) DISJ_CASES_TAC(SET_RULE`v' IN aff_gt {x} {v,va:real^3}\/ ~(v' IN aff_gt {x} {v,va:real^3})`) THENL(*15*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-a)%u +a%w:real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"DICH CHUYEN") THEN DISCH_TAC THEN REMOVE_THEN "DICH CHUYEN"(fun th->MP_TAC(th) THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN ASSUME_TAC(th)) THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`v' = t1'' % x + t2'' % v + t3'' % va<=> ((t1''+t2''+t3'')- &1) % x + t2'' % (v-x) + t3'' % (va-x)= v' -x:real^3`;REAL_ARITH`&1- &1 = &0`] THEN REDUCE_VECTOR_TAC THEN MP_TAC(REAL_ARITH`&0< t2'' /\ &0< t3'' /\ t1''+t2''+t3''= &1==> &0 < &1- t1'' /\ ~(&1- t1'' = &0)/\ t2''+t3''= &1- t1''`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2'' + t3'' = &1 - t1'':real ==> (inv ( &1 - t1''))*(t2'' + t3'') = (inv ( &1 - t1''))*( &1 - t1'':real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> &1- A*C = A*B`] THEN STRIP_TAC THEN MRESA_TAC REAL_LT_MUL[`inv(&1- t1'':real)`;`t3'':real`] THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)*(t3'':real)==> ~(inv(&1- t1'':real)*(t3'':real)= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)==> ~(inv(&1- t1'':real)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1= &0)`) THEN STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(inv(&1- t1'')) * t3'':real`[VECTOR_ARITH`(A*B)%X+(A*C)%Y=A%(B%X+C%Y)`]) THEN POP_ASSUM MP_TAC THEN MRESAL_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`inv(&1- t1'')`;`u - x:real^3`; `v - x:real^3`; `v'-x:real^3`] [VECTOR_ARITH`&1 %A=A`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v,v'}= {(--x) +x, (--x) +u, (--x) +v, (--x) + v'}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, v'}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN DISCH_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `v':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (v':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v':real^3`;`u':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`v':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{v',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[];(*15*) SUBGOAL_THEN`~(w' IN aff_gt {x} { x',v:real^3})` ASSUME_TAC THENL(*16*)[ REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC aff_gt3_subset_aff_gt[`x:real^3`;`v:real^3`;`va:real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*16*) MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`v:real^3`;`w':real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*17*)[ MRESA_TAC aff_gt1_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3`;`x':real^3`] THEN MP_TAC(SET_RULE`v IN aff_gt {x} {x', w':real^3} /\ aff_gt {x} {x', w'} SUBSET aff_ge {x} {v', w'} ==>v IN aff_ge {x} {v', w':real^3}`) THEN RESA_TAC THEN MP_TAC(ISPECL[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`; `v':real^3`;`w':real^3`]properties_of_fan7) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*18*)[ MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`; `w':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)]) THEN MP_TAC(PI_WORKS) THEN REAL_ARITH_TAC;(*18*) MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`; `w':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)]) THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_PI_SYM [`x:real^3`;`x':real^3`; `v':real^3`;`v:real^3`] THEN ASSUME_TAC(REAL_ARITH`pi <= pi`) THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`va:real^3`;`v':real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`A=A+B <=> B= &0`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`va:real^3`;`v':real^3`] THEN MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`v':real^3`;`va:real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*19*)[ MRESA_TAC aff_gt1_subset_aff_gt[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASM_TAC THEN SET_TAC[];(*19*) MRESA_TAC aff_ge1_subset_aff_ge[`x:real^3`;`w':real^3`; `v':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`va IN aff_ge {x} {v', x':real^3} /\ aff_ge {x} {v', x'} SUBSET aff_ge {x} {v', w'} ==>va IN aff_ge {x} {v', w':real^3}`) THEN RESA_TAC THEN SUBGOAL_THEN `va IN aff_ge {x} {u,w:real^3}` ASSUME_TAC THENL(*20*)[ MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1 -a:real` THEN EXISTS_TAC`a:real` THEN MP_TAC(REAL_ARITH`&0< a /\ a < &1 ==> &0 <= &1 - a /\ &0 <= a`) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC;(*20*) MP_TAC(SET_RULE`va IN aff_ge {x} {v', w':real^3} /\ va IN aff_ge {x} {u, w} ==>va IN aff_ge {x} {u, w} INTER aff_ge {x} {v', w':real^3} `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPECL[`{(u:real^3),(w:real^3)}`;`{(v':real^3),(w':real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION;IN_ELIM_THM;] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN DISJ_CASES_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}\/ ~({u, w} INTER {v', w'}={u,w:real^3})`) THENL(*21*)[ DISCH_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}/\ ~(w=u) /\ ~(v'=w') ==> {v', w'}={u,w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC `v IN aff_ge {x} {v', w':real^3}` THEN POP_ASSUM(fun th->REWRITE_TAC[th]) THEN MRESAL_TAC aff_ge_inter_aff_ge[`x:real^3`;`u:real^3`;`w:real^3`][INTER;IN_ELIM_THM] THEN STRIP_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_PI_IMP_COPLANAR[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*21*) MP_TAC(SET_RULE`~({u, w} INTER {v', w'} = {u, w:real^3}) ==> {u, w} INTER {v', w'} PSUBSET {u, w} `) THEN RESA_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'} PSUBSET {u, w:real^3} ==> {u, w} INTER {v', w'} SUBSET {u}\/ {u, w} INTER {v', w'} SUBSET {w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*22*)[ MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{u:real^3}`][DISJOINT;SET_RULE`{x} INTER {u} = {}<=> ~(x=u:real^3)`] THEN STRIP_TAC THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{u:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {u}/\ aff_ge {x} {u} SUBSET aff {x, u}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,u}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % u <=> a % w = u' % x + (v''+a- &1) % u`] THEN MRESA1_TAC REAL_MUL_LINV`a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`a % w = u' % x + (v'' + a - &1) % u:real^3 ==> (inv (a))%(a % w ) = (inv (a))%( u' % x + (v'' + a - &1) % u)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv a * u'):real` THEN EXISTS_TAC`(inv a * (v'' + a - &1)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv a * u' + inv a * (v'' + a - &1) =inv a * ( a+ (u' + v'') - &1)`;REAL_ARITH`A+ &1- &1=A`];(*22*) STRIP_TAC THEN FIND_ASSUM MP_TAC`{u,w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`w:real^3`] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {w} = {}<=> ~(x=w:real^3)`] THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{w:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {w}/\ aff_ge {x} {w} SUBSET aff {x, w}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,w}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `~(u IN aff {x, w:real^3})` THEN REWRITE_TAC[] THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % w <=> (&1-a )% u = u' % x + (v''-a) % w`] THEN MP_TAC(REAL_ARITH`a< &1==> ~(&1-a= &0)` )THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`&1-a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(&1-a )% u = u' % x + (v''-a) % w:real^3 ==> (inv (&1-a))%((&1-a )% u ) = (inv (&1-a))%( u' % x + (v''-a) % w)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv (&1-a) * u'):real` THEN EXISTS_TAC`(inv (&1-a) * (v'' - a)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv (&1 - a) * u' + inv (&1 - a) * (v'' - a)=inv (&1 - a) * ((u' + v'') - a)`]](*22*)](*21*)](*20*)](*19*)](*18*);(*17*) POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN DISCH_TAC THEN MRESA_TAC aff_ge_subset_aff_gt_union_aff_ge[`(x:real^3)`;`(v:real^3)`;`(x':real^3)`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC(SET_RULE`aff_ge {x} {v, x':real^3} SUBSET aff_gt {x, v} {x'} UNION aff_ge {x} {v} /\ w' IN aff_ge {x} {v, x'} ==> w' IN aff_gt {x, v} {x'} UNION aff_ge {x} {v}`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt_inter_aff_gt[`(x:real^3)`;`(x':real^3)`;`(v:real^3)`] THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;UNION] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(ISPECL[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `w':real^3`; `v':real^3`; `v:real^3`;`u:real^3`]properties1_of_fan7) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC(SYM(th))) THEN DISCH_TAC THEN MRESA_TAC point_in_aff_ge[`(x:real^3)`;`(v':real^3)`;`(w':real^3)`] THEN SUBGOAL_THEN`v IN aff_ge {x} {v', w':real^3}`ASSUME_TAC THENL(*18*)[ POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[];(*18*) POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"NHAT") THEN DISCH_TAC THEN REMOVE_THEN "NHAT" MP_TAC THEN DISCH_TAC THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`; `w':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)]) THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_PI_SYM [`x:real^3`;`x':real^3`; `v':real^3`;`v:real^3`] THEN ASSUME_TAC(REAL_ARITH`pi <= pi`) THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`va:real^3`;`v':real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`A=A+B <=> B= &0`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`va:real^3`;`v':real^3`] THEN MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`v':real^3`;`va:real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*19*)[ MRESA_TAC aff_gt1_subset_aff_gt[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASM_TAC THEN SET_TAC[];(*19*) MRESA_TAC aff_ge1_subset_aff_ge[`x:real^3`;`w':real^3`; `v':real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`va IN aff_ge {x} {v', x':real^3} /\ aff_ge {x} {v', x'} SUBSET aff_ge {x} {v', w'} ==>va IN aff_ge {x} {v', w':real^3}`) THEN RESA_TAC THEN SUBGOAL_THEN `va IN aff_ge {x} {u,w:real^3}` ASSUME_TAC THENL(*20*)[ MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1 -a:real` THEN EXISTS_TAC`a:real` THEN MP_TAC(REAL_ARITH`&0< a /\ a < &1 ==> &0 <= &1 - a /\ &0 <= a`) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC;(*20*) MP_TAC(SET_RULE`va IN aff_ge {x} {v', w':real^3} /\ va IN aff_ge {x} {u, w} ==>va IN aff_ge {x} {u, w} INTER aff_ge {x} {v', w':real^3} `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPECL[`{(u:real^3),(w:real^3)}`;`{(v':real^3),(w':real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION;IN_ELIM_THM;] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN DISJ_CASES_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}\/ ~({u, w} INTER {v', w'}={u,w:real^3})`) THENL(*21*)[ DISCH_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}/\ ~(w=u) /\ ~(v'=w') ==> {v', w'}={u,w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC `v IN aff_ge {x} {v', w':real^3}` THEN POP_ASSUM(fun th->REWRITE_TAC[th]) THEN MRESAL_TAC aff_ge_inter_aff_ge[`x:real^3`;`u:real^3`;`w:real^3`][INTER;IN_ELIM_THM] THEN STRIP_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_PI_IMP_COPLANAR[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*21*) MP_TAC(SET_RULE`~({u, w} INTER {v', w'} = {u, w:real^3}) ==> {u, w} INTER {v', w'} PSUBSET {u, w} `) THEN RESA_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'} PSUBSET {u, w:real^3} ==> {u, w} INTER {v', w'} SUBSET {u}\/ {u, w} INTER {v', w'} SUBSET {w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*22*)[ MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{u:real^3}`][DISJOINT;SET_RULE`{x} INTER {u} = {}<=> ~(x=u:real^3)`] THEN STRIP_TAC THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{u:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {u}/\ aff_ge {x} {u} SUBSET aff {x, u}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,u}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % u <=> a % w = u' % x + (v''+a- &1) % u`] THEN MRESA1_TAC REAL_MUL_LINV`a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`a % w = u' % x + (v'' + a - &1) % u:real^3 ==> (inv (a))%(a % w ) = (inv (a))%( u' % x + (v'' + a - &1) % u)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv a * u'):real` THEN EXISTS_TAC`(inv a * (v'' + a - &1)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv a * u' + inv a * (v'' + a - &1) =inv a * ( a+ (u' + v'') - &1)`;REAL_ARITH`A+ &1- &1=A`];(*22*) STRIP_TAC THEN FIND_ASSUM MP_TAC`{u,w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`w:real^3`] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {w} = {}<=> ~(x=w:real^3)`] THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{w:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {w}/\ aff_ge {x} {w} SUBSET aff {x, w}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,w}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `~(u IN aff {x, w:real^3})` THEN REWRITE_TAC[] THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % w <=> (&1-a )% u = u' % x + (v''-a) % w`] THEN MP_TAC(REAL_ARITH`a< &1==> ~(&1-a= &0)` )THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`&1-a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(&1-a )% u = u' % x + (v''-a) % w:real^3 ==> (inv (&1-a))%((&1-a )% u ) = (inv (&1-a))%( u' % x + (v''-a) % w)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv (&1-a) * u'):real` THEN EXISTS_TAC`(inv (&1-a) * (v'' - a)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv (&1 - a) * u' + inv (&1 - a) * (v'' - a)=inv (&1 - a) * ((u' + v'') - a)`]](*22*)](*21*)](*20*)](*19*)](*18*)](*17*)](*16*)](*15*)](*14*);(*13*) POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"CUOI") THEN MRESA_TAC aff_gt2_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3 `;`x':real^3`] THEN ASSUME_TAC(REAL_ARITH`pi<= pi`) THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`v':real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`A=B+A<=>B= &0`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0[`x:real^3`;`x':real^3`;`v:real^3`;`v':real^3`] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`x':real^3`;`v:real^3`;`v':real^3`] THEN MRESA_TAC AZIM_EQ_0[`x:real^3`;`x':real^3`;`v':real^3`;`v:real^3`] THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`v':real^3`;`v:real^3`] THEN DISJ_CASES_TAC(SET_RULE`w' IN aff_gt {x} {v,va:real^3}\/ ~(w' IN aff_gt {x} {v,va:real^3})`) THENL(*14*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-a)%u +a%w:real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"DICH CHUYEN") THEN DISCH_TAC THEN REMOVE_THEN "DICH CHUYEN"(fun th->MP_TAC(th) THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN ASSUME_TAC(th)) THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`w' = t1'' % x + t2'' % v + t3'' % va<=> ((t1''+t2''+t3'')- &1) % x + t2'' % (v-x) + t3'' % (va-x)= w' -x:real^3`;REAL_ARITH`&1- &1 = &0`] THEN REDUCE_VECTOR_TAC THEN MP_TAC(REAL_ARITH`&0< t2'' /\ &0< t3'' /\ t1''+t2''+t3''= &1==> &0 < &1- t1'' /\ ~(&1- t1'' = &0)/\ t2''+t3''= &1- t1''`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2'' + t3'' = &1 - t1'':real ==> (inv ( &1 - t1''))*(t2'' + t3'') = (inv ( &1 - t1''))*( &1 - t1'':real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> &1- A*C = A*B`] THEN STRIP_TAC THEN MRESA_TAC REAL_LT_MUL[`inv(&1- t1'':real)`;`t3'':real`] THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)*(t3'':real)==> ~(inv(&1- t1'':real)*(t3'':real)= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)==> ~(inv(&1- t1'':real)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1= &0)`) THEN STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(inv(&1- t1'')) * t3'':real`[VECTOR_ARITH`(A*B)%X+(A*C)%Y=A%(B%X+C%Y)`]) THEN POP_ASSUM MP_TAC THEN MRESAL_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`inv(&1- t1'')`;`u - x:real^3`; `v - x:real^3`; `w'-x:real^3`] [VECTOR_ARITH`&1 %A=A`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v,w'}= {(--x) +x, (--x) +u, (--x) +v, (--x) + w'}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, w'}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN DISCH_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `w':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (w':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`w':real^3`;`u':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`w':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{w',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[];(*14*) DISJ_CASES_TAC(SET_RULE`v' IN aff_gt {x} {v,va:real^3}\/ ~(v' IN aff_gt {x} {v,va:real^3})`) THENL(*15*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-a)%u +a%w:real^3`][IN_ELIM_THM] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"DICH CHUYEN") THEN DISCH_TAC THEN REMOVE_THEN "DICH CHUYEN"(fun th->MP_TAC(th) THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN ASSUME_TAC(th)) THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`v' = t1'' % x + t2'' % v + t3'' % va<=> ((t1''+t2''+t3'')- &1) % x + t2'' % (v-x) + t3'' % (va-x)= v' -x:real^3`;REAL_ARITH`&1- &1 = &0`] THEN REDUCE_VECTOR_TAC THEN MP_TAC(REAL_ARITH`&0< t2'' /\ &0< t3'' /\ t1''+t2''+t3''= &1==> &0 < &1- t1'' /\ ~(&1- t1'' = &0)/\ t2''+t3''= &1- t1''`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`&1- (t1'':real)`REAL_MUL_LINV) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` t2'' + t3'' = &1 - t1'':real ==> (inv ( &1 - t1''))*(t2'' + t3'') = (inv ( &1 - t1''))*( &1 - t1'':real) `) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C)= &1<=> &1- A*C = A*B`] THEN STRIP_TAC THEN MRESA_TAC REAL_LT_MUL[`inv(&1- t1'':real)`;`t3'':real`] THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)*(t3'':real)==> ~(inv(&1- t1'':real)*(t3'':real)= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0<inv(&1- t1'':real)==> ~(inv(&1- t1'':real)= &0)`) THEN RESA_TAC THEN ASSUME_TAC(REAL_ARITH`~(&1= &0)`) THEN STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC continuous_coplanar_fan[`x:real^3 `;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v, (&1 - a) % u + a % w}= {(--x) +x, (--x) +v, (--x) +u, (--x) +(&1 - a) % u + a % w}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, (&1 - a) % u + a % w}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)] ) THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MRESA_TAC continuous_coplanar_fan[`(vec 0):real^3 `;` u-x:real^3`;` v-x:real^3`;` ((&1 - a) % u + a % w)-x:real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(inv(&1- t1'')) * t3'':real`[VECTOR_ARITH`(A*B)%X+(A*C)%Y=A%(B%X+C%Y)`]) THEN POP_ASSUM MP_TAC THEN MRESAL_TAC COPLANAR_SCALE_ALL [`&1`;`&1`;`inv(&1- t1'')`;`u - x:real^3`; `v - x:real^3`; `v'-x:real^3`] [VECTOR_ARITH`&1 %A=A`] THEN ASSUME_TAC(SET_RULE`IMAGE (\x'. --x + x') {x:real^3, u, v,v'}= {(--x) +x, (--x) +u, (--x) +v, (--x) + v'}`) THEN MRESAL_TAC COPLANAR_TRANSLATION_EQ[`--(x:real^3)`;`{x:real^3, u, v, v'}`][VECTOR_ARITH`(--A)+B=B-A:real^3`;VECTOR_ARITH`A-A=(vec 0):real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN DISCH_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th `v':real^3` THEN MP_TAC (th) THEN DISCH_THEN(LABEL_TAC"EM")) THEN MRESA_TAC exists_element_in_half_sapace_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;` v:real^3`;`u:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u':real^3)`; ` (v':real^3)`] THEN MRESA_TAC exists_cut_small_edges_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`a:real`;`v':real^3`;`u':real^3`] THEN REWRITE_TAC[EMPTY;IN] THEN MP_TAC(REAL_ARITH`&0<t /\ t< &1==> &0< &1-t:real /\ &1-t< &1`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`(&1-t:real)`;`a:real`] THEN MRESAL_TAC REAL_LT_RMUL[`(&1-t:real)`;`&1`;`a:real`][REAL_ARITH`&1 *a=a`] THEN REMOVE_THEN "YEU"(fun th-> MRESAL1_TAC th `(&1- t) *a`[VECTOR_ARITH`(&1 - (&1 - t) * a) % u + ((&1 - t) * a) % w=(&1 - t) % ((&1-a)%u+a % w)+t%u`;]) THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`v':real^3`;`u':real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`{v',u'} IN (E:(real^3->bool)->bool)` THEN SET_TAC[];(*15*) SUBGOAL_THEN`~(v' IN aff_gt {x} { x',v:real^3})` ASSUME_TAC THENL(*16*)[ REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC aff_gt3_subset_aff_gt[`x:real^3`;`v:real^3`;`va:real^3`;`x':real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*16*) MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`v:real^3`;`v':real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*17*)[ MRESA_TAC aff_gt12_subset_aff_ge[`x:real^3`;`v':real^3`;`w':real^3`;`x':real^3`] THEN MP_TAC(SET_RULE`v IN aff_gt {x} {x', v':real^3} /\ aff_gt {x} {x', v'} SUBSET aff_ge {x} {v', w'} ==>v IN aff_ge {x} {v', w':real^3}`) THEN RESA_TAC THEN MP_TAC(ISPECL[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`; `v':real^3`;`w':real^3`]properties_of_fan7) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*18*)[ MRESA_TAC aff_gt2_subset_aff_ge [`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASSUME_TAC(REAL_ARITH`pi <= pi`) THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`va:real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`A=A+B <=> B= &0`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`va:real^3`;`w':real^3`] THEN MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`w':real^3`;`va:real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*19*)[ MRESA_TAC aff_gt1_subset_aff_gt[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASM_TAC THEN SET_TAC[];(*19*) MRESA_TAC aff_gt1_subset_aff_gt[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASM_TAC THEN SET_TAC[]](*19*);(*18*) REMOVE_THEN "CUOI" MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN REWRITE_TAC[AZIM_REFL] THEN MP_TAC(PI_WORKS) THEN REAL_ARITH_TAC](*18*);(*17*) POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN DISCH_TAC THEN MRESA_TAC aff_ge_subset_aff_gt_union_aff_ge[`(x:real^3)`;`(v:real^3)`;`(x':real^3)`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC(SET_RULE`aff_ge {x} {v, x':real^3} SUBSET aff_gt {x, v} {x'} UNION aff_ge {x} {v} /\ v' IN aff_ge {x} {v, x'} ==> v' IN aff_gt {x, v} {x'} UNION aff_ge {x} {v}`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt_inter_aff_gt[`(x:real^3)`;`(x':real^3)`;`(v:real^3)`] THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;UNION] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(ISPECL[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `v':real^3`; `w':real^3`; `v:real^3`;`u:real^3`]properties1_of_fan7) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC(SYM(th))) THEN DISCH_TAC THEN MRESA_TAC point_in_aff_ge[`(x:real^3)`;`(v':real^3)`;`(w':real^3)`] THEN MRESA_TAC aff_gt2_subset_aff_ge [`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASSUME_TAC(REAL_ARITH`pi <= pi`) THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`x':real^3`;`v:real^3`;`va:real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`A=A+B <=> B= &0`] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`x':real^3`;`va:real^3`;`w':real^3`] THEN MP_TAC(ISPECL[`x:real^3`;`x':real^3`;`w':real^3`;`va:real^3`] decomposition_planar_by_angle_fan) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*18*)[ MRESA_TAC aff_gt1_subset_aff_gt[`x:real^3`;`v:real^3`; `va:real^3`;`x':real^3`] THEN ASM_TAC THEN SET_TAC[];(*18*) MRESA_TAC aff_ge1_subset_aff_ge[`x:real^3`;`v':real^3`; `w':real^3`;`x':real^3`] THEN MP_TAC(SET_RULE`va IN aff_ge {x} { x',w':real^3} /\ aff_ge {x} { x',w'} SUBSET aff_ge {x} {v', w'} ==>va IN aff_ge {x} {v', w':real^3}`) THEN RESA_TAC THEN SUBGOAL_THEN `va IN aff_ge {x} {u,w:real^3}` ASSUME_TAC THENL(*19*)[ MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1 -a:real` THEN EXISTS_TAC`a:real` THEN MP_TAC(REAL_ARITH`&0< a /\ a < &1 ==> &0 <= &1 - a /\ &0 <= a`) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC;(*19*) MP_TAC(SET_RULE`va IN aff_ge {x} {v', w':real^3} /\ va IN aff_ge {x} {u, w} ==>va IN aff_ge {x} {u, w} INTER aff_ge {x} {v', w':real^3} `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPECL[`{(u:real^3),(w:real^3)}`;`{(v':real^3),(w':real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION;IN_ELIM_THM;] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN DISJ_CASES_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}\/ ~({u, w} INTER {v', w'}={u,w:real^3})`) THENL(*20*)[ DISCH_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'}={u,w:real^3}/\ ~(w=u) /\ ~(v'=w') ==> {v', w'}={u,w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC `v' IN aff_ge {x} {v', w':real^3}` THEN POP_ASSUM(fun th->REWRITE_TAC[th]) THEN MRESAL_TAC aff_ge_inter_aff_ge[`x:real^3`;`u:real^3`;`w:real^3`][INTER;IN_ELIM_THM] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC `~collinear {x, v, u:real^3}` THEN FIND_ASSUM MP_TAC `v=v':real^3` THEN DISCH_TAC THEN POP_ASSUM(fun th->REWRITE_TAC[th]) THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MRESA_TAC AZIM_EQ_0_PI_IMP_COPLANAR[`x:real^3`;`u:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*20*) MP_TAC(SET_RULE`~({u, w} INTER {v', w'} = {u, w:real^3}) ==> {u, w} INTER {v', w'} PSUBSET {u, w} `) THEN RESA_TAC THEN MP_TAC(SET_RULE`{u, w} INTER {v', w'} PSUBSET {u, w:real^3} ==> {u, w} INTER {v', w'} SUBSET {u}\/ {u, w} INTER {v', w'} SUBSET {w} `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*21*)[ MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{u:real^3}`][DISJOINT;SET_RULE`{x} INTER {u} = {}<=> ~(x=u:real^3)`] THEN STRIP_TAC THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{u:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {u}/\ aff_ge {x} {u} SUBSET aff {x, u}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,u}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % u <=> a % w = u' % x + (v''+a- &1) % u`] THEN MRESA1_TAC REAL_MUL_LINV`a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`a % w = u' % x + (v'' + a - &1) % u:real^3 ==> (inv (a))%(a % w ) = (inv (a))%( u' % x + (v'' + a - &1) % u)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv a * u'):real` THEN EXISTS_TAC`(inv a * (v'' + a - &1)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv a * u' + inv a * (v'' + a - &1) =inv a * ( a+ (u' + v'') - &1)`;REAL_ARITH`A+ &1- &1=A`];(*21*) STRIP_TAC THEN FIND_ASSUM MP_TAC`{u,w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`w:real^3`] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v', w':real^3}`; `{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {w} = {}<=> ~(x=w:real^3)`] THEN MRESAL_TAC AFF_GE_SUBSET_AFFINE_HULL[`{x:real^3}`;`{w:real^3}`][SET_RULE`{x} UNION {u}={x,u}`;GSYM aff] THEN MP_TAC(SET_RULE`aff_ge {x:real^3} ({u, w} INTER {v', w'}) SUBSET aff_ge {x} {w}/\ aff_ge {x} {w} SUBSET aff {x, w}/\ va IN aff_ge {x} ({u, w} INTER {v', w'})==> va IN aff {x,w}`) THEN RESA_TAC THEN REWRITE_TAC[IN;EMPTY] THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `~(u IN aff {x, w:real^3})` THEN REWRITE_TAC[] THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`(&1 - a) % u + a % w = u' % x + v'' % w <=> (&1-a )% u = u' % x + (v''-a) % w`] THEN MP_TAC(REAL_ARITH`a< &1==> ~(&1-a= &0)` )THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`&1-a:real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(&1-a )% u = u' % x + (v''-a) % w:real^3 ==> (inv (&1-a))%((&1-a )% u ) = (inv (&1-a))%( u' % x + (v''-a) % w)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv (&1-a) * u'):real` THEN EXISTS_TAC`(inv (&1-a) * (v'' - a)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv (&1 - a) * u' + inv (&1 - a) * (v'' - a)=inv (&1 - a) * ((u' + v'') - a)`]](*21*)](*20*)](*19*)](*18*)](*17*)](*16*)](*15*)](*14*)](*13*)](*12*)](*11*)](*10*)](*9*)] (*8*)](*7*)](*6*)](*5*)](*4*)](*3*)](*2*);(*1*) SET_TAC[]]);;let exist_close1_fan=prove(`(!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) (v1:real^3) (w1:real^3) a:real. FAN(x,V,E) /\ {v,u} INTER {v1,w1}={} /\ {v1,w1} IN E /\ {v,u} IN E /\ {u,w} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 <a /\ a< &1 /\(aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> ?h:real. (&0 < h) /\ (!y1:real^3 y2:real^3. y1 IN (aff_ge {x} {v, (&1 - a) % u + a % w} INTER ballnorm_fan x) /\ y2 IN (aff_ge {x} {v1, w1} INTER ballnorm_fan x) ==> h <= dist(y1,y2) ))`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v1:real^3)`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN MRESA_TAC not_collinear_is_properties_fully_surrounded[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`;`a:real`] THEN MATCH_MP_TAC( ISPECL [`aff_ge {(x:real^3)} {(v:real^3), ((&1 - a) % u + a % w:real^3)} INTER ballnorm_fan x`; `aff_ge {(x:real^3)} {(v1:real^3), (w1:real^3)} INTER ballnorm_fan x`] SEPARATE_CLOSED_COMPACT) THEN MP_TAC(ISPECL[`(x:real^3) `;` (v:real^3)`;` ((&1 - a) % u + a % w:real^3)`]closed_aff_ge_ballnorm_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3) `;` (v1:real^3)`;` (w1:real^3)`]compact_aff_ge_ballnorm_fan) THEN RESA_TAC THEN REMOVE_THEN "EM" MP_TAC THEN FIND_ASSUM MP_TAC `{v1,w1:real^3} IN E` THEN MRESA_TAC aff_ge_eq_aff_gt_union_aff_ge[`(x:real^3)`;` (v:real^3)`;`((&1 - a) % u + a % w:real^3)`] THEN FIND_ASSUM(MP_TAC)`FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(v:real^3)}`;`{(v1:real^3),(w1:real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN MP_TAC(SET_RULE`(v:real^3) IN V==>(?v'. v' IN V /\ {v} = {v'})`) THEN REDA_TAC THEN MP_TAC(SET_RULE`{(v:real^3),u} INTER {v1,w1}={} ==> {v} INTER {v1,w1}={}`) THEN REDA_TAC THEN REWRITE_TAC[AFF_GE_EQ_AFFINE_HULL;AFFINE_HULL_1;] THEN STRIP_TAC THEN SUBGOAL_THEN`(aff_ge {x} {v} INTER aff_ge {x} {v1, w1:real^3}) INTER ballnorm_fan x={}` ASSUME_TAC THENL(*1*)[ ASM_REWRITE_TAC[INTER;ballnorm_fan;EXTENSION;IN_ELIM_THM;SET_RULE`(?u. u = &1 /\ x' = u % x)<=> x'= &1 % x`;] THEN REDUCE_VECTOR_TAC THEN GEN_TAC THEN EQ_TAC THENL(*2*)[ STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[DIST_REFL] THEN REAL_ARITH_TAC; SET_TAC[]]; ABBREV_TAC`va=(&1 - a) % u + a % w:real^3` THEN SUBGOAL_THEN `va IN aff_ge {x} {u,w:real^3}` ASSUME_TAC THENL(*2*)[ MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1 -a:real` THEN EXISTS_TAC`a:real` THEN MP_TAC(REAL_ARITH`&0< a /\ a < &1 ==> &0 <= &1 - a /\ &0 <= a`) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC;(*2*) SUBGOAL_THEN`(aff_ge {x} {va} INTER aff_ge {x} {v1, w1:real^3}) SUBSET {x}` ASSUME_TAC THENL(*3*)[ MRESA_TAC th3[` (x:real^3)`;`(v:real^3)`;`(va:real^3)`] THEN MRESA_TAC aff_ge1_1_subset_aff_ge[`x:real^3`;`u:real^3`;`w:real^3`;`va:real^3`] THEN FIND_ASSUM(MP_TAC)`FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(u:real^3),(w:real^3)}`;`{(v1:real^3),(w1:real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN MP_TAC(SET_RULE`{v,u} INTER {v1,w1}={}==> {u,w} INTER {v1,w1} SUBSET {w:real^3}`) THEN RESA_TAC THEN STRIP_TAC THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v1, w1:real^3}`; `{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {u} = {}<=> ~(x=u:real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)]) THEN REMOVE_ASSUM_TAC THEN DISCH_TAC THEN MP_TAC(SET_RULE`aff_ge {x} {va} SUBSET aff_ge {x} {u, w}/\ aff_ge {x} {u, w} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {w} ==> aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {va} INTER aff_ge {x} {w}`) THEN RESA_TAC THEN MATCH_MP_TAC(SET_RULE` aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {va} INTER aff_ge {x} {w} /\ aff_ge {x} {va} INTER aff_ge {x} {w} SUBSET {x:real^3} ==>aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET {x}`) THEN ASM_REWRITE_TAC[] THEN MRESAL_TAC AFF_GE_1_1[`x:real^3`;`va:real^3`;][IN_ELIM_THM;SUBSET;INTER] THEN MRESAL_TAC AFF_GE_1_1[`x:real^3`;`w:real^3`;][IN_ELIM_THM;SUBSET;IN_SING] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`t1 % x + t2 % ((&1 - a) % u + a % w) = t1' % x + t2' % w <=> (t2 *(&1 - a)) % u = (t1'-t1) % x + (t2'- t2*a) % w:real^3`] THEN MP_TAC(REAL_ARITH`&0<= t2==> t2= &0 \/ &0 < t2:real`) THEN RES_TAC THENL(*4*)[ FIND_ASSUM MP_TAC`t1+ t2:real= &1` THEN POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN REDUCE_ARITH_TAC THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC;(*4*) MP_TAC(REAL_ARITH`a< &1==> &0< &1-a:real`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`t2:real`;`&1- a:real`] THEN MP_TAC(REAL_ARITH` &0< t2*(&1-a)==> ~(t2*(&1-a):real= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`t2*(&1-a):real` THEN MRESA1_TAC REAL_LT_INV`t2*(&1-a):real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(t2 * (&1 - a)) % u = (t1' - t1) % x + (t2' - t2 * a) % w:real^3 ==> (inv (t2 * (&1 - a)))%((t2 * (&1 - a)) % u ) = (inv (t2 * (&1 - a)))%((t1' - t1) % x + (t2' - t2 * a) % w)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN SUBGOAL_THEN`u IN aff {x,w:real^3}`ASSUME_TAC THENL(*5*)[ REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN EXISTS_TAC`(inv (t2 * (&1 - a)) * (t1' - t1)):real` THEN EXISTS_TAC`(inv (t2 * (&1 - a)) * (t2' - t2 * a)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv (t2 * (&1 - a)) * (t1' - t1) + inv (t2 * (&1 - a)) * (t2' - t2 * a) = inv (t2 * (&1 - a)) * ((t1' +t2')- (t1+t2)+ t2*(&1 - a)):real`; REAL_ARITH`&1- &1 + A= A`];(*5*) FIND_ASSUM MP_TAC `~collinear {x, u, w:real^3}` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN STRIP_TAC THEN MRESA_TAC th3[`x:real^3`;`w:real^3`;`u:real^3`]]];(*3*) SUBGOAL_THEN`(aff_ge {x} {va} INTER aff_ge {x} {v1, w1:real^3}) INTER ballnorm_fan x={}` ASSUME_TAC THENL(*4*)[ ASM_REWRITE_TAC[INTER;ballnorm_fan;EXTENSION;IN_ELIM_THM;] THEN REDUCE_VECTOR_TAC THEN GEN_TAC THEN EQ_TAC THENL(*5*)[ STRIP_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE`x' IN aff_ge {x} {va} /\ x' IN aff_ge {x} {v1, w1} /\ aff_ge {x} {va} INTER aff_ge {x} {v1, w1} SUBSET {x} ==> x' IN {x:real^3}`) THEN REWRITE_TAC[IN_SING] THEN RESA_TAC THEN ASM_REWRITE_TAC[DIST_REFL;] THEN REAL_ARITH_TAC;(*5*) SET_TAC[]]; ASM_TAC THEN SET_TAC[]]]]]);;let lemma_proof0_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (u:real^3) (w:real^3) (v1:real^3) (w1:real^3) a:real. FAN(x,V,E) /\ {v1,w1} IN E /\ {u,w} IN E /\ ~(u IN {v1,w1}) /\ &0 <a /\ a< &1 ==> (aff_ge {x} {(&1 - a) % u + a % w} INTER aff_ge {x} {v1, w1:real^3}) SUBSET {x}`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v1:real^3)`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN FIND_ASSUM MP_TAC `{v1,w1:real^3} IN E` THEN ABBREV_TAC`va=(&1 - a) % u + a % w:real^3` THEN MRESA_TAC properties1_inside_fan[`(x:real^3)`;` (u:real^3)`;`(w:real^3)`;] THEN MRESA_TAC properties_inside_collinear_fan[`(x:real^3)`;` (u:real^3)`;`(w:real^3)`;`a:real`] THEN MRESA_TAC th3[` (x:real^3)`;`(va:real^3)`;`(u:real^3)`] THEN MRESA_TAC aff_ge1_1_subset_aff_ge[`x:real^3`;`u:real^3`;`w:real^3`;`va:real^3`] THEN FIND_ASSUM(MP_TAC)`FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(u:real^3),(w:real^3)}`;`{(v1:real^3),(w1:real^3)}`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN MP_TAC(SET_RULE`~(u IN {v1,w1})==> {u,w} INTER {v1,w1} SUBSET {w:real^3}`) THEN RESA_TAC THEN STRIP_TAC THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER {v1, w1:real^3}`; `{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {u} = {}<=> ~(x=u:real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)]) THEN REMOVE_ASSUM_TAC THEN DISCH_TAC THEN MP_TAC(SET_RULE`aff_ge {x} {va} SUBSET aff_ge {x} {u, w}/\ aff_ge {x} {u, w} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {w} ==> aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {va} INTER aff_ge {x} {w}`) THEN RESA_TAC THEN MATCH_MP_TAC(SET_RULE` aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET aff_ge {x} {va} INTER aff_ge {x} {w} /\ aff_ge {x} {va} INTER aff_ge {x} {w} SUBSET {x:real^3} ==>aff_ge {x} {va:real^3} INTER aff_ge {x} {v1, w1} SUBSET {x}`) THEN ASM_REWRITE_TAC[] THEN MRESAL_TAC AFF_GE_1_1[`x:real^3`;`va:real^3`;][IN_ELIM_THM;SUBSET;INTER] THEN MRESAL_TAC AFF_GE_1_1[`x:real^3`;`w:real^3`;][IN_ELIM_THM;SUBSET;IN_SING] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN EXPAND_TAC"va" THEN REWRITE_TAC[VECTOR_ARITH`t1 % x + t2 % ((&1 - a) % u + a % w) = t1' % x + t2' % w <=> (t2 *(&1 - a)) % u = (t1'-t1) % x + (t2'- t2*a) % w:real^3`] THEN MP_TAC(REAL_ARITH`&0<= t2==> t2= &0 \/ &0 < t2:real`) THEN RES_TAC THENL(*4*)[ FIND_ASSUM MP_TAC`t1+ t2:real= &1` THEN POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN REDUCE_ARITH_TAC THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN REDUCE_VECTOR_TAC; MP_TAC(REAL_ARITH`a< &1==> &0< &1-a:real`) THEN RESA_TAC THEN MRESA_TAC REAL_LT_MUL[`t2:real`;`&1- a:real`] THEN MP_TAC(REAL_ARITH` &0< t2*(&1-a)==> ~(t2*(&1-a):real= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`t2*(&1-a):real` THEN MRESA1_TAC REAL_LT_INV`t2*(&1-a):real` THEN STRIP_TAC THEN MP_TAC(SET_RULE`(t2 * (&1 - a)) % u = (t1' - t1) % x + (t2' - t2 * a) % w:real^3 ==> (inv (t2 * (&1 - a)))%((t2 * (&1 - a)) % u ) = (inv (t2 * (&1 - a)))%((t1' - t1) % x + (t2' - t2 * a) % w)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`; VECTOR_ARITH`A%(B+C)=A%B+A%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN SUBGOAL_THEN`u IN aff {x,w:real^3}`ASSUME_TAC THENL(*5*)[ REWRITE_TAC[aff;AFFINE_HULL_2;IN_ELIM_THM] THEN EXISTS_TAC`(inv (t2 * (&1 - a)) * (t1' - t1)):real` THEN EXISTS_TAC`(inv (t2 * (&1 - a)) * (t2' - t2 * a)):real` THEN ASM_REWRITE_TAC[REAL_ARITH`inv (t2 * (&1 - a)) * (t1' - t1) + inv (t2 * (&1 - a)) * (t2' - t2 * a) = inv (t2 * (&1 - a)) * ((t1' +t2')- (t1+t2)+ t2*(&1 - a)):real`; REAL_ARITH`&1- &1 + A= A`]; FIND_ASSUM MP_TAC `~collinear {x, u, w:real^3}` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN STRIP_TAC THEN MRESA_TAC th3[`x:real^3`;`w:real^3`;`u:real^3`]]]);;let lemma_proof1_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (u:real^3) (w:real^3) (v1:real^3) (w1:real^3) a:real. FAN(x,V,E) /\ {v1,w1} IN E /\ {u,w} IN E /\ ~(w IN {v1,w1}) /\ &0 <a /\ a< &1 ==> (aff_ge {x} {(&1 - a) % u + a % w} INTER aff_ge {x} {v1, w1:real^3}) SUBSET {x}`,REPEAT STRIP_TAC THEN MRESAL_TAC lemma_proof0_fan[`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(w:real^3)`;` (u:real^3)`;`(v1:real^3)`;`(w1:real^3)`;`&1 -a:real`][VECTOR_ARITH`(&1 - (&1 - a)) % w + (&1 - a) % u=(&1 - a) % u + a % w`;] THEN POP_ASSUM MATCH_MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REAL_ARITH_TAC);;let lemma_proof_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (u:real^3) (w:real^3) (v1:real^3) (w1:real^3) a:real. FAN(x,V,E) /\ {v1,w1} IN E /\ {u,w} IN E /\ ~({u,w} = {v1,w1}) /\ &0 <a /\ a< &1 ==> (aff_ge {x} {(&1 - a) % u + a % w} INTER aff_ge {x} {v1, w1:real^3}) SUBSET {x}`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v1:real^3)`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN MP_TAC(SET_RULE` ~(u=w) /\ ~(v1=w1:real^3)==> ({u,w} = {v1,w1}<=> {u,w} SUBSET {v1,w1})`) THEN ASM_REWRITE_TAC[SET_RULE`~({u,w} SUBSET {v1,w1})<=> ~(w IN {v1,w1})\/ ~( u IN {v1,w1})`] THEN ASM_TAC THEN SET_TAC[lemma_proof0_fan;lemma_proof1_fan]);;let remark012_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (u:real^3) (w:real^3) a:real. FAN(x,V,E) /\ {u,w} IN E /\ &0 <a /\ a< &1 ==> ~((&1 - a) % u + a % w IN V)`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN ABBREV_TAC`v1=(&1 - a) % u + a % w:real^3` THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan2] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE`~(x IN V) /\ v1 IN V==> ~(x=(v1:real^3))`) THEN RESA_TAC THEN MRESA_TAC properties_inside_collinear_fan[`(x:real^3)`;`(u:real^3)`;`(w:real^3)`;`a:real`] THEN MRESA_TAC th3[`(x:real^3)`;`((&1-a)%u+ a%w:real^3)`;`(w:real^3)`] THEN MRESA_TAC th3[`(x:real^3)`;`((&1-a)%u+ a%w:real^3)`;`(u:real^3)`] THEN MP_TAC(SET_RULE`DISJOINT {x, v1} {u}==> ~(v1=u:real^3)`) THEN RESA_TAC THEN MP_TAC(SET_RULE`DISJOINT {x, v1} {w}==> ~(v1=w:real^3)`) THEN RESA_TAC THEN MP_TAC(SET_RULE` ~(v1=w:real^3) /\ ~(v1=u:real^3) ==> {u,w} INTER {v1}={}`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(u:real^3),w}`;`({v1:real^3})`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN MP_TAC(SET_RULE`(v1:real^3) IN V==>(?v'. v' IN V /\ {v1} = {v'})`) THEN REDA_TAC THEN MRESA_TAC properties1_inside_fan[`(x:real^3)`;` (u:real^3)`;`(w:real^3)`;] THEN MRESA_TAC aff_ge1_subset_aff_ge[`x:real^3`;`u:real^3`; `w:real^3`;`v1:real^3`] THEN MRESA_TAC aff_ge_eq_aff_gt_union_aff_ge[`(x:real^3)`;`((&1 - a) % u + a % w:real^3)`;` (w:real^3)`] THEN MP_TAC(SET_RULE`aff_ge {x} {v1, w} SUBSET aff_ge {x} {u, w}/\ aff_ge {x} {v1, w} = aff_gt {x} {v1, w} UNION aff_ge {x} {v1} UNION aff_ge {x} {w} ==> aff_ge {x} {u, w} INTER aff_ge {x} {v1}=aff_ge {x} {v1:real^3}`) THEN RESA_TAC THEN STRIP_TAC THEN SUBGOAL_THEN`v1 IN aff_ge {x} {v1:real^3}` ASSUME_TAC THENL[MRESAL_TAC AFF_GE_1_1[`x:real^3`;`v1:real^3`;][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC; POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[AFF_GE_EQ_AFFINE_HULL;AFFINE_HULL_1;SUBSET;IN_SING;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`&1 %A=A`]]);;let remark01_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (u:real^3) (w:real^3) (v1:real^3) (w1:real^3) a:real. FAN(x,V,E) /\ {v1,w1} IN E /\ {u,w} IN E /\ ~({u,w} = {v1,w1}) /\ &0 <a /\ a< &1 ==> ~((&1 - a) % u + a % w IN {v1, w1:real^3})`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w1:real^3`;`v1:real^3`] THEN FIND_ASSUM MP_TAC `{v1,w1:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` v1:real^3`;`w1:real^3`] THEN MRESA_TAC remark012_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` u:real^3`;`w:real^3`;`a:real`] THEN ASM_TAC THEN SET_TAC[]);;let remark0_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) e:real^3->bool. FAN(x,V,E)/\ e IN E ==> {x} INTER e={}`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`]expand_edge_graph_fan) THEN RESA_TAC THEN REMOVE_THEN "A" MP_TAC THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`v:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]);;let case2_proof_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v,w1} IN E /\ &0 < azim x u w v /\ azim x u w v < pi /\ &0<a /\ a< &1 /\ (&1-a)%u+ a%w=ua /\ ~(ua=w) /\ ~collinear {x,w,ua} /\ (aff_gt {x} {v, ua} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> (!e. e IN (E DELETE {u,w}) ==> aff_ge {x} e INTER aff_ge {x} {ua,w} = aff_ge {x} (e INTER {ua,w}))`,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `~collinear {x,w,ua:real^3}` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN DISCH_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` w:real^3`;`u:real^3`] THEN FIND_ASSUM MP_TAC `e IN E DELETE {u,w:real^3}` THEN REWRITE_TAC[DELETE;IN_ELIM_THM;SET_RULE`~(e={u,w:real^3})<=> ~({u,w:real^3}=e)`] THEN DISCH_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`]expand_edge_graph_fan) THEN RESA_TAC THEN MRESA_TAC lemma_proof_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`(w:real^3)`;`(v':real^3)`;`(w':real^3)`;`a:real`] THEN MRESA_TAC remark01_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (u:real^3)`;`(w:real^3)`;`(v':real^3)`;`(w':real^3)`;`a:real`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM(th)]) THEN RESA_TAC THEN RESA_TAC THEN MP_TAC(SET_RULE`~(ua IN e)==> e INTER {ua,w:real^3} SUBSET {w}`) THEN RESA_TAC THEN MRESA_TAC properties1_inside_fan[`(x:real^3)`;` (u:real^3)`;`(w:real^3)`;] THEN MRESA_TAC aff_ge1_subset_aff_ge[`x:real^3`;`u:real^3`; `w:real^3`;`ua:real^3`] THEN MRESA_TAC th3[` (x:real^3)`;`(ua:real^3)`;`(w:real^3)`] THEN MRESA_TAC remark0_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`e:real^3->bool`] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`e INTER { ua,w:real^3}`;`e:real^3->bool`][DISJOINT;SET_RULE` e INTER {ua,w} SUBSET e`;] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`e INTER { ua,w:real^3}`;`{ua,w:real^3}`][DISJOINT;SET_RULE` e INTER {ua,w} SUBSET {ua,w:real^3}`;] THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{}:real^3->bool`;`{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {w}={} <=> ~(x=w)`;SET_RULE` {} SUBSET {w:real^3}`;] THEN MATCH_MP_TAC(SET_RULE`C SUBSET A /\ C SUBSET B /\ A INTER B SUBSET C==>A INTER B= C`) THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM MP_TAC `FAN(x:real^3,V,E)` THEN REWRITE_TAC[FAN;fan7] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPECL[`{(u:real^3),w}`;`(e:real^3->bool)`]th)) THEN ASM_REWRITE_TAC[UNION; IN_ELIM_THM;] THEN DISJ_CASES_TAC(SET_RULE`{u,w:real^3} INTER e= {u,w} \/ ~({u,w} INTER e= {u,w})`) THENL[MP_TAC(SET_RULE`{u,w} INTER e= {u,w:real^3}==> {u,w} SUBSET e`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`]expand_edge_graph_fan) THEN RESA_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE` ~(u=w:real^3) ==> ({u,w} = {v',w'}<=> {u,w} SUBSET {v',w'})`) THEN RESA_TAC THEN ASM_TAC THEN SET_TAC[]; MP_TAC(SET_RULE` e INTER {ua,w:real^3} SUBSET {w}==> e INTER { ua,w:real^3} = {w} \/ e INTER { ua,w:real^3}= {}`) THEN RESA_TAC THENL[ MP_TAC(SET_RULE`e INTER {ua, w} = {w:real^3}==> w IN e`) THEN RESA_TAC THEN MP_TAC(SET_RULE`~({u, w} INTER e = {u, w:real^3}) ==> {u, w} INTER e PSUBSET {u, w} `) THEN RESA_TAC THEN MP_TAC(SET_RULE`{u, w} INTER e PSUBSET {u, w:real^3} /\ w IN e /\ ~(u=w) ==> {u, w} INTER e SUBSET {w} `) THEN RESA_TAC THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER (e:real^3->bool)`;`{w:real^3}`][DISJOINT;SET_RULE`{x} INTER {w}={} <=> ~(x=w)`;SET_RULE` {} SUBSET {w:real^3}`;] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]; MP_TAC(SET_RULE`e INTER {ua, w:real^3} = {}==> ~(w IN e)`) THEN RESA_TAC THEN MP_TAC(SET_RULE`~({u, w} INTER e = {u, w:real^3}) ==> {u, w} INTER e PSUBSET {u, w} `) THEN RESA_TAC THEN MP_TAC(SET_RULE`{u, w} INTER e PSUBSET {u, w:real^3} /\ ~(w IN e) ==> {u, w} INTER e SUBSET {u} `) THEN RESA_TAC THEN MRESAL_TAC AFF_GE_MONO_RIGHT [`{x:real^3}`;`{u, w} INTER (e:real^3->bool)`;`{u:real^3}`][DISJOINT;SET_RULE`{x} INTER {u}={} <=> ~(x=u)`;SET_RULE` {} SUBSET {w:real^3}`;] THEN STRIP_TAC THEN SUBGOAL_THEN `aff_ge {x} e INTER aff_ge {x} {ua, w} SUBSET aff_ge {x} {u} INTER aff_ge {x} {ua, w:real^3}`ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]; MRESA_TAC properties_inside_collinear1_fan[`x:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]]]]);;let inequality1_not0_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real a:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d /\ &0<a /\ a < &1 ==> ?(h:real). a <h /\ h<= &1 /\ (!t:real. a <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> s * inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))* norm( ((&1-a)%u + a %w)-((&1-t)%u+ t%w))< d ))`,REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`((&1-a)%u + a %w)-((&1-t)%u+ t%w)=(t-a)%(u-w):real^3`;NORM_MUL] THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;` (w:real^3)`]separate_point_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN EXISTS_TAC`min (a+(h:real)*(d:real) *inv(norm(u-w:real^3))) (&1)` THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_gl_zero_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(d:real)`;`inv(norm(u-w:real^3))`] REAL_LT_MUL) THEN RESA_TAC THEN STRIP_TAC THENL[ MP_TAC(ISPECL[`h:real`;`d:real`] REAL_LT_MUL) THEN RESA_TAC THEN ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0 <(h:real)==> ~(h= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)< min (a+(h:real) * (d:real) * inv (norm (u - w:real^3))) (&1)/\ min (a+h * d * inv (norm (u - w))) (&1)<= &1 /\ &0 <a /\ a <= t ==> &0 <= t /\ t <= &1 /\ &0 <= t-a /\ t - a<= &1/\ (t:real)-a < (h * d * inv (norm (u - w:real^3)))`) THEN ASM_REWRITE_TAC[REAL_ARITH`min (a+h * d * inv (norm (u - w))) (&1)<= &1`] THEN STRIP_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN RESA_TAC THEN REMOVE_THEN "A"(fun th -> MP_TAC(ISPEC`(&1-s)%v+s%((&1-t)%u+ t%w):real^3`th)) THEN RESA_TAC THEN MP_TAC(ISPECL[`h:real`;`norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <h /\ (h:real)< norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)==> &0 <= norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`t-a:real`REAL_ABS_REFL) THEN RESP_TAC THEN MP_TAC(ISPECL[`inv(norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))`; `inv(h:real)`;`t:real-a`;`(h * d * inv (norm (u - w:real^3)))`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm(u-w:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`u-w:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(u-w:real^3)) /\ &0 <= norm(u-w:real^3)==> &0 <norm(u-w:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3)) * (t:real-a)`;`inv (h:real) * h * d * inv (norm (u - w:real^3))`;`norm (u - w:real^3)`]REAL_LT_RMUL) THEN ASM_REWRITE_TAC[REAL_ARITH`(A*B*C*D)*E=(A*B)*C*(D*E)`] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))`;`(t:real-a)`;] REAL_LE_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))*(t-a:real)`;`norm(u-w:real^3)`] REAL_LE_MUL) THEN RESA_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(s= &1) \/ ~((s:real)= &1)`) THENL[ POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*B*C=(A*B)*C:real`;VECTOR_ARITH`(&1 - s) % v + s % ((&1 - t) % u + t % w) - x=((&1 - s) % v + s % ((&1 - t) % u + t % w))- x :real^3`]; MP_TAC(REAL_ARITH`~(s= &1) /\ s<= &1==> (s:real)< &1`) THEN RESA_TAC THEN MP_TAC(ISPECL[`s:real`;`&1`;`(inv (norm (((&1 - s) % v + s % ((&1 - t) % u + t % w)) - x:real^3))*(t-a:real)) * norm(u-w:real^3)`; `d:real`]REAL_LT_MUL2) THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*d*B*C=A*(d*B)*C:real`;VECTOR_ARITH`(&1 - s) % v + s % ((&1 - t) % u + t % w) - x=((&1 - s) % v + s % ((&1 - t) % u + t % w))- x :real^3`]]]]);;let bounded_convex1_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) w:real^3. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E ==> ?(h:real). &0< h /\ (!(y:real^3). y IN convex hull{v,u,w} ==> norm(y-x)<h )`,REPEAT STRIP_TAC THEN SUBGOAL_THEN `FINITE {(v:real^3),(u:real^3),w}` ASSUME_TAC THENL(*1*)[ SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY]; MP_TAC(ISPEC`{(v:real^3),(u:real^3),w}`FINITE_IMP_COMPACT_CONVEX_HULL) THEN POP_ASSUM (fun th-> REWRITE_TAC[th;]) THEN DISCH_TAC THEN ASSUME_TAC(ISPEC`x:real^3` norm_origin_fan ) THEN ASSUME_TAC(SET_RULE`convex hull {(v:real^3), u,w} SUBSET (:real^3)`) THEN MP_TAC(ISPECL[`(\(y:real^3). lift(norm(y-x:real^3)))`;`(:real^3)`;`convex hull {(v:real^3),(u:real^3),w}`]CONTINUOUS_ON_SUBSET) THEN RESA_TAC THEN MP_TAC(ISPECL[`(\(y:real^3). lift(norm(y-x:real^3)))`;`convex hull {(v:real^3),(u:real^3),w}`]COMPACT_CONTINUOUS_IMAGE) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[COMPACT_EQ_BOUNDED_CLOSED;bounded;IMAGE;IN_ELIM_THM] THEN ONCE_REWRITE_TAC[TAUT`A/\B<=>B/\A`;] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN SUBGOAL_THEN `(?x':real^3. x' IN convex hull {v, u,w} /\ lift (norm (v - x:real^3)) = lift (norm (x' - x)))`ASSUME_TAC THENL[ EXISTS_TAC`v:real^3` THEN SIMP_TAC[CONVEX_HULL_3; IN_ELIM_THM;] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN REDUCE_VECTOR_TAC THEN REAL_ARITH_TAC; SUBGOAL_THEN `&0< (a:real)` ASSUME_TAC THENL[ REMOVE_THEN "A" (fun th-> MP_TAC(ISPEC`lift (norm (v - (x:real^3)))`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[NORM_LIFT;REAL_ABS_NORM ] THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`v:real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`v-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(v-x:real^3)) /\ &0 <= norm(v-x:real^3)==> &0 <norm(v-x:real^3)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC; EXISTS_TAC`&2 * a:real` THEN STRIP_TAC THENL[ REPEAT STRIP_TAC THEN SUBGOAL_THEN `(?x':real^3. x' IN convex hull {v, u,w} /\ lift (norm (y - x:real^3)) = lift (norm (x' - x)))`ASSUME_TAC THENL[ EXISTS_TAC`y:real^3` THEN ASM_SIMP_TAC[]; REMOVE_THEN "A"(fun th-> MP_TAC(ISPEC`lift (norm (y - x:real^3))`th)) THEN ASM_REWRITE_TAC[NORM_LIFT;REAL_ABS_NORM ] THEN ASM_TAC THEN REAL_ARITH_TAC]; ASM_TAC THEN REAL_ARITH_TAC]]]]);;let inequaility2_not0_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real a:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d /\ &0 <a /\ a< &1 ==> ?(h:real). a <h /\ h<= &1 /\ (!t:real. a <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> (norm(inv(norm((&1-s)%v+s%((&1-a)%u+ a%w)-x))%((&1-s)%v+s%((&1-a)%u+ a%w)-x) - inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))% ((&1-s)%v+s%((&1-a)%u+ a%w)-x)))< d ))`,REWRITE_TAC[VECTOR_ARITH`A%B-C%B=(A-C)%B`;NORM_MUL] THEN REPEAT STRIP_TAC THEN REWRITE_TAC[VECTOR_ARITH`u-((&1-t)%u+ t%w)=t%(u-w):real^3`;NORM_MUL] THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;` (w:real^3)`]separate_point_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`]origin_point_not_in_convex_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"B") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`w:real^3`]bounded_convex1_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"C") THEN EXISTS_TAC`min (a+h*h*(inv (h'))* inv(norm(u-w:real^3))*d:real) (&1)` THEN MP_TAC(ISPECL[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] remark1_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`u:real^3`;`w:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`u-w:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm(u-w:real^3)) /\ &0 <= norm(u-w:real^3)==> &0 <norm(u-w:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm(u-w:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <(h:real)==> ~(h= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <(h':real)==> ~(h'= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h':real)`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (u-w:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`norm (u-w:real^3)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(ISPEC`(h:real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <inv (h:real)==> &0 <= inv(h)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(h':real)`REAL_LT_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <inv (h':real)==> &0 <= inv(h')`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 <a /\ a< &1==> &0 <= a/\ a <= &1`) THEN RESA_TAC THEN STRIP_TAC THENL(*1*)[ MP_TAC(ISPECL[`(h:real)`;`inv (h':real) `]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)`;`(h:real)*inv (h':real) `]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(h:real)*inv (h':real)`;`inv(norm(u-w:real^3))`]REAL_LT_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`(h:real)*(h:real)*inv (h':real) *inv(norm(u-w:real^3))`;`d:real`]REAL_LT_MUL) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`a:real < &1 ` THEN REAL_ARITH_TAC;(*1*) STRIP_TAC THENL(*2*)[ REAL_ARITH_TAC;(*2*) REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3)`;`w:real^3`;`a:real`;` s:real`]expansion_convex_fan) THEN RESA_TAC THEN REMOVE_THEN "C"(fun th->MP_TAC(ISPEC`(&1 - s) % v + s % ((&1 - a) % u + a % w):real^3`th)) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN SUBGOAL_THEN`~(x=(&1 - s) % v + s % ((&1 - a) % u + a % w):real^3)` ASSUME_TAC THENL(*3*)[ ASM_TAC THEN SET_TAC[];(*3*) MP_TAC(ISPECL[`(&1 - s) % v + s % ((&1 - a) % u + a % w):real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN ASSUME_TAC(ISPEC`(&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)= &0) /\ &0 <= norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)==> &0 <norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3))`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)< min (a+h * h * inv h' * inv (norm (u - w)) * d) (&1)/\ min (a+h * h * inv h' * inv (norm (u - w)) * d) (&1)<= &1 /\ &0<a /\ a<=t ==> &0<= t-a /\ &0<= t /\ t<= &1/\ (t:real)-a< (h * h * inv h' * inv (norm (u - w:real^3)) * d) `) THEN ASM_REWRITE_TAC[REAL_ARITH`min (a+h * h * inv h' * inv (norm (u - w:real^3)) * d) (&1)<= &1`] THEN STRIP_TAC THEN MP_TAC(ISPECL[`norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3) `; `(h':real)`;`t-a:real`;`(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`&0<= &0/\ &0<= &1`] THEN USE_THEN "A" (fun th-> MP_TAC(ISPEC`((&1 - s) % v + s % ((&1 - a) % u + a % w):real^3)`th)) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC(ISPECL[`h:real`;`norm ((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(ISPECL[`norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`;`t-a:real`]REAL_LE_MUL) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3))`;`inv(h:real)`;`norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)*(t:real-a)`;`(h':real)*(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN USE_THEN "A" (fun th-> MP_TAC(ISPEC`(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3`th)) THEN POP_ASSUM(fun th-> REWRITE_TAC[th; VECTOR_ARITH`(A+B)-C=A+B-C:real^3`]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`h:real`;`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`]REAL_LT_INV2) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3))`;`norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)*(t-a:real)`]REAL_LE_MUL) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`NORM_POS_LE) THEN MP_TAC(ISPEC`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPECL[`inv(norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3))`;`inv(h:real)`;`inv(norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)) * norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)*(t-a:real)`;`inv(h:real)*(h':real)*(h * h * inv h' * inv (norm (u - w:real^3)) * d)`;]REAL_LT_MUL2) THEN RESA_TAC THEN MP_TAC(ISPECL[`norm (u - w:real^3)`; `inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)) * inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) * norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) * (t-a)`;`inv h * inv h * h' * h * h * inv h' * inv (norm (u - w:real^3)) * d`;]REAL_LT_LMUL) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(B*C)*E*A*D`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*E*(C*D)`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*E*(C*D)`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D=(A*B)*C*D`] THEN ONCE_REWRITE_TAC[REAL_ARITH`A*B*C*D*E=(A*B)*(C*D)*E`] THEN ONCE_REWRITE_TAC[REAL_ARITH`(A*B*C)*D*E=A*B*(C*D)*E`] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B*C)*D=A*B*(C*D)`] THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[REAL_ARITH`((A*B)*C*D)*E=(A*C)*(B*D)*E`] THEN REDUCE_ARITH_TAC THEN REWRITE_TAC[REAL_ARITH`((A*B)*C)*D*E=(A*B)*(C*D)*E`] THEN ASSUME_TAC(ISPECL[`u:real^3`;`w:real^3`]NORM_SUB) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN MP_TAC(ISPECL[`t-a:real`;`w-u:real^3`]NORM_MUL) THEN MP_TAC(ISPEC`t-a:real`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[REAL_ARITH`(A*B)*C*D=C*A*(B*D)`] THEN REDUCE_ARITH_TAC THEN DISCH_THEN(LABEL_TAC"BA") THEN MP_TAC(ISPECL[`(v:real^3)`;` (u:real^3) `;`(w:real^3) `;`(t:real) `;`s:real`]expansion_convex_fan) THEN RESA_TAC THEN SUBGOAL_THEN`~(x=(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3)` ASSUME_TAC THENL(*4*)[ POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"MA") THEN STRIP_TAC THEN REMOVE_THEN"MA" MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN ASM_REWRITE_TAC[];(*4*) MP_TAC(ISPECL[`(&1 - s) % v + s % ((&1 - t) % u + t % w):real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN MP_TAC(ISPECL[`norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`;`norm((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`]REAL_SUB_INV) THEN RESP_TAC THEN ASM_REWRITE_TAC[REAL_ABS_ABS;REAL_ABS_DIV;REAL_ABS_MUL;REAL_ABS_NORM;real_div;REAL_INV_MUL; REAL_ARITH`(A*B*C)*D=A*C*(B*D)`] THEN REDUCE_ARITH_TAC THEN MP_TAC(ISPECL[`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`;`((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`]REAL_ABS_SUB_NORM) THEN REWRITE_TAC[VECTOR_ARITH` ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)-((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)=s%(t-a)%(w-u) :real^3`] THEN ONCE_REWRITE_TAC[NORM_MUL] THEN MP_TAC(ISPEC`s:real`REAL_ABS_REFL) THEN RESP_TAC THEN DISCH_TAC THEN MP_TAC(ISPECL[`abs (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3) - norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x))`;`s * norm ((t-a) % (w - u):real^3)`;`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`]REAL_LE_RMUL) THEN RESA_TAC THEN REMOVE_THEN "BA" MP_TAC THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(s= &1)\/ ~((s:real) = &1)`) THENL(*5*)[ ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC;(*5*) MP_TAC(REAL_ARITH`~(s= &1) /\ s<= &1==> (s:real)< &1`) THEN RESA_TAC THEN ASSUME_TAC(ISPEC`((t-a) % (w - u):real^3)`NORM_POS_LE) THEN MP_TAC(ISPECL[`norm ((t-a) % (w - u):real^3)`;`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`]REAL_LE_MUL) THEN RESA_TAC THEN REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`s:real`;`&1`;`norm ((t-a) % (w - u)) * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3))`; `d:real`]REAL_LT_MUL2) THEN REDUCE_ARITH_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]]);;let exists_point_small_edges_not0_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) d:real a:real. FAN(x,V,E) /\ {v,u} IN E/\ {u,w} IN E /\ ~(coplanar{x,v,u,w}) /\ &0 < d /\ &0 <a /\ a< &1 ==> ?(h:real). a <h /\ h<= &1 /\ (!t:real. a <= t /\ t<h ==> (!(s:real). &0 <= s /\ s <= &1 ==> norm(inv(norm((&1-s)%v+s%((&1-a)%u+ a%w)-x))%((&1-s)%v+s%((&1-a)%u+ a%w)-x) - inv(norm((&1-s)%v+s%((&1-t)%u+ t%w)-x))% ((&1-s)%v+s%((&1-t)%u+ t%w)-x))< d ))`,REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0< (d:real)==> &0< d/ &2`) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`]origin_point_not_in_convex_fan) THEN RESA_TAC THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3) `;`(w:real^3)`;` (d:real)/ &2`;`a:real`]inequaility2_not0_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool) `;`(v:real^3)`;` (u:real^3)`;` (w:real^3)`;` (d:real)/ &2`;`a:real`]inequality1_not0_fan) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"B") THEN EXISTS_TAC`min (h:real) (h':real)` THEN STRIP_TAC THENL[ASM_TAC THEN REAL_ARITH_TAC; STRIP_TAC THENL[ ASM_TAC THEN REAL_ARITH_TAC; REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`t< min (h:real) (h':real)==> t< (h:real) /\ t< (h':real)`) THEN RESA_TAC THEN REMOVE_THEN"B" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"B") THEN REMOVE_THEN"A" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN ASSUME_TAC(ISPEC`((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`NORM_POS_LE) THEN MP_TAC(ISPEC`norm ((&1 - s) % v + s % ((&1 - t) % u + t % w)-x:real^3)`REAL_LE_INV) THEN RESA_TAC THEN MP_TAC(ISPECL[`s * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)):real`;`(((&1 - a) % u + a % w) - ((&1 - t) % u + t % w)):real^3`]NORM_MUL) THEN REWRITE_TAC[REAL_ABS_MUL] THEN MP_TAC(ISPEC`s:real`REAL_ABS_REFL) THEN RESP_TAC THEN MP_TAC(ISPEC`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x:real^3)):real`REAL_ABS_REFL) THEN RESP_TAC THEN REWRITE_TAC[REAL_ARITH`(A*B)*C=A*B*C`] THEN DISCH_TAC THEN REMOVE_THEN"B"MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REWRITE_TAC[VECTOR_ARITH`(s * inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x))) % (((&1 - a) % u + a % w) - ((&1 - t) % u + t % w))= inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3`] THEN DISCH_TAC THEN MP_TAC(ISPECL[`norm(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)`;`(d:real)/ &2`; `norm (inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x):real^3)`;`(d:real)/ &2`; ]REAL_LT_ADD2) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[REAL_ARITH`d / &2 + d/ &2 = d`] THEN MP_TAC(ISPECL[`(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)`; `(inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x):real^3)`]NORM_TRIANGLE) THEN REWRITE_TAC[VECTOR_ARITH`(inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)- inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x):real^3)+ (inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x):real^3)=(inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) - inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) `] THEN REAL_ARITH_TAC]]);;let separate1_sphere_not0_fan=prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (v:real^3) (u:real^3) (w:real^3) (v1:real^3) (u1:real^3) a:real. FAN(x,V,E) /\ {v,u} INTER {v1,u1}={} /\ {v,u} IN E/\ {u,w} IN E /\ {v1,u1} IN E /\ ~(coplanar{x,v,u,w}) /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 < a /\ a < &1 /\ aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {} ==> ?h:real. (a < h) /\ (h<= &1) /\ (!t:real. a<t /\ t<h ==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge {x} {v1, u1} INTER ballnorm_fan x={})`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC exist_close1_fan[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`w:real^3`;`(v1:real^3)`;` (u1:real^3)`;`a:real`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"THA") THEN MRESA_TAC not_collinear_is_properties_fully_surrounded[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`;] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A" ) THEN MRESA_TAC exists_point_small_edges_not0_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3)`;`(u:real^3) `;`(w:real^3)`;`h:real`;`a:real`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"B" ) THEN EXISTS_TAC`min (a+((h'-a:real)/ &2)) (&1:real)` THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*1*)[ MP_TAC(REAL_ARITH`a< h':real==> &0< (h'-a)/ &2`) THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM MP_TAC`a:real< &1` THEN REAL_ARITH_TAC;(*1*) STRIP_TAC THENL(*2*)[ ASM_TAC THEN REAL_ARITH_TAC;(*2*) REPEAT STRIP_TAC THEN REWRITE_TAC[EXTENSION] THEN GEN_TAC THEN EQ_TAC THENL(*3*)[ STRIP_TAC THEN REWRITE_TAC[EMPTY;IN_ELIM_THM] THEN SUBGOAL_THEN `!y1:real^3. y1 IN aff_gt {x} {v, (&1-t)%u+(t:real)% (w:real^3)} INTER ballnorm_fan x ==> ?y2:real^3. y2 IN aff_ge {x:real^3} {(v:real^3), ((&1 - a) % u + a % w:real^3)} INTER ballnorm_fan x /\ dist (y1,y2)<(h:real)` ASSUME_TAC THENL(*4*)[ MP_TAC(REAL_ARITH`&0<a /\ a < &1 /\ a <(t:real)/\ a< h' /\ t < min (a+(h'-a:real)/ &2) (&1:real)==> &0<t /\ t< &1 /\ &0 <= t /\ t<= &1 /\ t< h'/\ &0<=a /\ a<= &1/\ a<=t`) THEN RESA_TAC THEN USE_THEN"A" (fun th-> MP_TAC(ISPEC`a:real`th)) THEN REMOVE_THEN"A" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN RESA_TAC THEN REPEAT STRIP_TAC THEN MRESA_TAC same_projective_sphere_gt_fan [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(v:real^3)`;`(u:real^3) `;`(w:real^3)`;` (t:real) `;`(y1:real^3)`] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - a) % (u:real^3) + a % (w:real^3)`;] THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC AFF_GE_1_2[`(x:real^3)` ;` (v:real^3)`;`((&1 - a) % u + a % w:real^3) `;] THEN ASM_REWRITE_TAC[INTER;IN_ELIM_THM;dist] THEN MRESA_TAC expansion_convex_fan[`(v:real^3)`;` (u:real^3)`;`w:real^3`;`a:real`;` s:real`;] THEN MRESA_TAC origin_point_not_in_convex_fan[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`w:real^3`] THEN SUBGOAL_THEN`~(x=(&1-s)%v+s%((&1 - a) % u + a % w):real^3)` ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN RESA_TAC;(*5*) MP_TAC(ISPECL[`x:real^3`;`(&1 - s) % v + s % ((&1 - a) % u + a % w):real^3`]imp_norm_not_zero_fan) THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[NORM_SUB] THEN REWRITE_TAC[VECTOR_ARITH`(A+B)-C=A+B-C:real^3`] THEN RESA_TAC THEN ASSUME_TAC(ISPEC`(&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(&0 =norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)) /\ &0 <= norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)==> &0 <norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`(norm((&1 - s) % v + s % ((&1 - a) % u + a % w)-x:real^3))`REAL_LE_INV) THEN RESA_TAC THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) +x:real^3` THEN STRIP_TAC THENL(*6*)[ STRIP_TAC THENL(*7*)[ EXISTS_TAC`&1 - inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)) ` THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)) * (&1 - s)` THEN EXISTS_TAC`inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3)) * (s)` THEN REWRITE_TAC[VECTOR_ARITH`A%(B%C + a%b-c)+c=(&1-A)%c+(A*B)%C+(A*a)%b:real^3`] THEN ASM_REWRITE_TAC[REAL_ARITH`&1-A+A*(&1-C)+A*C= &1`] THEN STRIP_TAC THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REAL_ARITH_TAC;(*7*) REWRITE_TAC[ballnorm_fan;IN_ELIM_THM;dist;VECTOR_ARITH`A-(B+A)=(--B):real^3`;NORM_NEG;NORM_MUL] THEN MP_TAC(ISPEC`inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x:real^3))`REAL_ABS_REFL) THEN RESP_TAC THEN ASM_REWRITE_TAC[]](*7*);(*6*) ASM_REWRITE_TAC[VECTOR_ARITH`inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x) + x - (inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) + x)= inv (norm ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x)) % ((&1 - s) % v + s % ((&1 - t) % u + t % w) - x) - (inv (norm ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x)) % ((&1 - s) % v + s % ((&1 - a) % u + a % w) - x) ):real^3`] THEN REMOVE_THEN "B" (fun th-> MP_TAC(ISPEC`t:real`th)) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC`s:real`th)) THEN RESA_TAC THEN ASM_REWRITE_TAC[NORM_SUB]](*6*)](*5*);(*4*) POP_ASSUM (fun th->MP_TAC(ISPEC`x':real^3`th)) THEN MP_TAC(SET_RULE` x' IN aff_gt {x} {v, (&1 - t) % u + t % w} INTER aff_ge {x} {v1, u1} INTER ballnorm_fan x ==> x' IN aff_ge {x} {v1, u1:real^3} INTER ballnorm_fan x /\ x' IN aff_gt {x} {v, (&1 - t) % u + t % w:real^3} INTER ballnorm_fan x`) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN SIMP_TAC[] THEN REPEAT STRIP_TAC THEN REMOVE_THEN "THA" (fun th-> MP_TAC(ISPECL[`y2:real^3`;`x':real^3`]th)) THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(RAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(RAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN SIMP_TAC[dist;NORM_SUB] THEN REAL_ARITH_TAC](*4*);(*3*) SET_TAC[]]]]);;let fan_run_in_small11_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 v1:real^3 u1:real^3 a:real. FAN(x,V,E) /\ {v,u} INTER {v1,u1}={} /\ {v,u} IN E/\ {u,w} IN E /\ {v1,u1} IN E /\ ~(coplanar{x,v,u,w}) /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 < a /\ a < &1 /\ aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {} ==> ?t1:real. a < t1 /\ t1 <= &1 /\ (!t:real. a< t /\ t< t1 ==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v1,u1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u1:real^3)`; ` (v1:real^3)`] THEN MRESA_TAC not_collinear_is_properties_fully_surrounded[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`;] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"BA") THEN MRESA_TAC separate1_sphere_not0_fan[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3) `;`(u:real^3)`;` (w:real^3)`;` (v1:real^3)`;`(u1:real^3)`;`a:real`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` a < &1 /\ a < h ==> a < min (h:real) (&1:real)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH` h <= &1==> min (h:real) (&1:real)<= &1`) THEN RESA_TAC THEN EXISTS_TAC`min (h:real) (&1:real)` THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH` &0< a /\ a < t /\ t< min (h:real) (&1:real)==> t< h /\ t<= &1 /\ &0 <= t/\ &0<t /\ t< &1`) THEN RESA_TAC THEN REMOVE_THEN "A"(fun th-> MRESA1_TAC th `(t:real)`) THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN REMOVE_THEN "BA"(fun th-> MRESA1_TAC th `(t:real)`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC origin_is_not_aff_gt_fan[`x:real^3`;`v:real^3`;`(&1-t)%u+t%w:real^3`] THEN REWRITE_TAC[EXTENSION;INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN SUBGOAL_THEN`~(x=x':real^3)`ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]; MRESA_TAC imp_norm_not_zero_fan[`x':real^3`;`x:real^3`] THEN ASSUME_TAC(ISPEC`x'-x:real^3`NORM_POS_LE) THEN MP_TAC(REAL_ARITH`~(norm(x'-x:real^3)= &0) /\ &0 <= norm(x'-x:real^3)==> &0 <norm(x'-x:real^3)`) THEN RESA_TAC THEN MRESA1_TAC REAL_LE_INV `norm(x'-x:real^3)` THEN MRESA1_TAC REAL_LT_INV `norm(x'-x:real^3)` THEN MRESA1_TAC REAL_MUL_LINV `norm(x'-x:real^3)` THEN MRESA_TAC scale_aff_ge_fan[`x:real^3`;`v1:real^3`;`u1:real^3`] THEN POP_ASSUM(fun th -> MRESA_TAC th [`x':real^3`;`inv(norm(x'-x:real^3))`]) THEN MRESA_TAC scale_aff_gt_fan[`x:real^3`;`v:real^3`;`(&1-t)%u+t%w:real^3`] THEN POP_ASSUM(fun th -> MRESA_TAC th [`x':real^3`;`inv(norm(x'-x:real^3))`]) THEN SUBGOAL_THEN`inv (norm (x' - x)) % (x' - x) + x IN ballnorm_fan x:real^3->bool` ASSUME_TAC THENL[ MRESA1_TAC REAL_ABS_REFL `inv(norm(x'-x:real^3))` THEN ASM_REWRITE_TAC[ballnorm_fan;IN_ELIM_THM;dist;VECTOR_ARITH`B-(A+B)= --A:real^3`;NORM_NEG;NORM_MUL]; ASM_TAC THEN SET_TAC[]]]; SET_TAC[]]);;let fan_run_in_small1_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 v1:real^3 u1:real^3 a:real. FAN(x,V,E) /\ {v,u} INTER {v1,u1}={} /\ {v,u} IN E/\ {u,w} IN E /\ {v1,u1} IN E /\ ~(coplanar{x,v,u,w}) /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 < a /\ a < &1 /\ aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {} /\ (!s. &0 < s /\ s < a ==> aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> (?t1:real. a < t1 /\ t1 <= &1 /\ (!t:real. &0< t /\ t< t1 ==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v1,u1}={}))`,REPEAT STRIP_TAC THEN MRESA_TAC fan_run_in_small11_not0_is_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;` w:real^3`;`v1:real^3`;`u1:real^3`;`a:real`] THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[] THEN GEN_TAC THEN MP_TAC(REAL_ARITH`&0<a /\ a< t1==>((&0<t /\ t<t1) <=> (&0<t /\ t<a)\/ t=a \/ (a<t/\ t<t1:real))`) THEN RESA_TAC THEN STRIP_TAC THEN ASM_TAC THEN SET_TAC[]);;let fan_run_in_small2_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 w1:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v,w1} IN E /\ ~coplanar {x,v,u,w} /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 <a /\ a< &1 /\(aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) /\ (!s. &0 < s /\ s < a ==> aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> ?t1. a < t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v,w1}={})`,REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"MAI MAI") THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN MRESA_TAC not_collinear_is_properties_fully_surrounded[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`;] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN DISJ_CASES_TAC(SET_RULE`(?h:real. a<h /\ h<= &1/\ azim x v u w1=azim x v u ((&1-h)%u+h%w:real^3))\/ ~(?h:real. a<h /\ h<= &1 /\ azim x v u ((&1-h)%u+h%w:real^3)=azim x v u w1)`) THENL(*1*)[ POP_ASSUM MP_TAC THEN STRIP_TAC THEN EXISTS_TAC`(h:real)` THEN STRIP_TAC THENL(*2*)[ ASM_TAC THEN REAL_ARITH_TAC;(*2*) STRIP_TAC THENL(*3*)[ ASM_TAC THEN REAL_ARITH_TAC;(*3*) REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`(t:real)< (h:real) /\ h <= &1 ==> t < &1`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v:real^3)`] THEN REWRITE_TAC[INTER;EXTENSION;IN_ELIM_THM;] THEN GEN_TAC THEN EQ_TAC THENL(*4*)[ DISCH_TAC THEN SUBGOAL_THEN `(&1-t)%u+t%w IN aff_ge {x,v} {w1}:real^3->bool` ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = t1'' % x + t2' % v + t3' % w1<=> t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3`] THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`(t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (t1'-t1) % x + (t2'-t2) % v + t3' % w1:real^3 ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w)) = (inv (t3))%((t1'-t1) % x + (t2'-t2) % v + t3' % w1)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`A%(B%X+C%Y+D%Z)=(A*B)%X+(A*C)%Y+(A*D)%Z`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN FIND_ASSUM MP_TAC`t1' + t2' + t3' = &1:real` THEN FIND_ASSUM MP_TAC`t1 + t2 + t3 = &1:real` THEN DISCH_TAC THEN POP_ASSUM (fun th -> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM(th)]) THEN REWRITE_TAC[REAL_ARITH`t1'' + t2' + t3' = t1' + t2 + t3<=> (t1''-t1') + (t2'-t2) + t3' = t3:real`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (t1'-t1) + (t2'-t2) + t3' = t3 ==> (inv (t3))*((t1'-t1) + (t2'-t2) + t3') = (inv (t3))*t3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C+D)=A*B+A*C+A*D`] THEN STRIP_TAC THEN EXISTS_TAC`inv t3 * (t1' - t1):real` THEN EXISTS_TAC`inv t3 * (t2' - t2):real` THEN EXISTS_TAC`inv t3 * t3':real` THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_INV THEN ASM_TAC THEN REAL_ARITH_TAC;(*5*) MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`v:real^3`;`u:real^3`;`w1:real^3`;`(&1 - t) % u + t % w:real^3`;] THEN MRESA_TAC injective_azim_coplanar[`x:real^3`;` v:real^3`;` u:real^3`;` w:real^3`] THEN POP_ASSUM (fun th->MRESA_TAC th [`h:real`;`t:real`]) THEN ASM_TAC THEN REAL_ARITH_TAC](*5*)(*4*); SET_TAC[]]]];(*1*) POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[NOT_EXISTS_THM] THEN DISCH_THEN(LABEL_TAC"B") THEN EXISTS_TAC`&1:real` THEN ASM_REWRITE_TAC[REAL_ARITH `&1<= &1`] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (v:real^3)`] THEN REWRITE_TAC[INTER;EXTENSION;IN_ELIM_THM;] THEN GEN_TAC THEN EQ_TAC THENL(*2*)[ DISCH_TAC THEN SUBGOAL_THEN `(&1-t)%u+t%w IN aff_ge {x,v} {w1}:real^3->bool` ASSUME_TAC THENL(*3*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`v:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = t1'' % x + t2' % v + t3' % w1<=> t3 % ((&1 - t) % u + t % w) = (t1''-t1') % x + (t2'-t2) % v + t3' % w1:real^3`] THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MRESA1_TAC REAL_MUL_LINV`(t3:real)` THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (t1'-t1) % x + (t2'-t2) % v + t3' % w1:real^3 ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w)) = (inv (t3))%((t1'-t1) % x + (t2'-t2) % v + t3' % w1)`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`A%(B%X+C%Y+D%Z)=(A*B)%X+(A*C)%Y+(A*D)%Z`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN FIND_ASSUM MP_TAC`t1' + t2' + t3' = &1:real` THEN FIND_ASSUM MP_TAC`t1 + t2 + t3 = &1:real` THEN DISCH_TAC THEN POP_ASSUM (fun th -> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM(th)]) THEN REWRITE_TAC[REAL_ARITH`t1'' + t2' + t3' = t1' + t2 + t3<=> (t1''-t1') + (t2'-t2) + t3' = t3:real`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (t1'-t1) + (t2'-t2) + t3' = t3 ==> (inv (t3))*((t1'-t1) + (t2'-t2) + t3') = (inv (t3))*t3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[REAL_ARITH`A*(B+C+D)=A*B+A*C+A*D`] THEN STRIP_TAC THEN EXISTS_TAC`inv t3 * (t1' - t1):real` THEN EXISTS_TAC`inv t3 * (t2' - t2):real` THEN EXISTS_TAC`inv t3 * t3':real` THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_MUL THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC REAL_LE_INV THEN ASM_TAC THEN REAL_ARITH_TAC;(*3*) MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`v:real^3`;`(&1 - t) % u + t % w:real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`v:real^3`;`u:real^3`;`w1:real^3`;`(&1 - t) % u + t % w:real^3`;] THEN REMOVE_THEN "B"(fun th -> MRESAL1_TAC th `t:real`[DE_MORGAN_THM; REAL_ARITH`~(A<B)<=> B<A\/ B=A`]) THENL(*4*)[REMOVE_THEN"YEU EM"(fun th-> MRESA1_TAC th `t:real`) THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `{v,w1:real^3} IN E` THEN SET_TAC[]; REMOVE_THEN"MAI MAI" MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC `{v,w1:real^3} IN E` THEN SET_TAC[]; ASM_TAC THEN REAL_ARITH_TAC](*4*)]; SET_TAC[]]]);;let fan_run_in_small3_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 w1:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {u,w1} IN E /\ ~coplanar {x,v,u,w} /\ sigma_fan x V E u w=v /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ &0 <a /\ a< &1 /\(aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) /\ (!s. &0 < s /\ s < a ==> aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> ?t1. a < t1 /\ t1 <= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {u,w1}={})`,REPEAT STRIP_TAC THEN MRESA_TAC not_collinear_is_properties_fully_surrounded[`(x:real^3)` ;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` (v:real^3)`;`(u:real^3)`;`(w:real^3)`;] THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC"A") THEN EXISTS_TAC`&1:real` THEN ASM_REWRITE_TAC[REAL_ARITH`&1<= &1`] THEN REPEAT STRIP_TAC THEN MP_TAC(REAL_ARITH`&0<t:real==> &0<=t /\ ~(t= &0)`) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`t< &1 ==>t<= &1`) THEN RESA_TAC THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `t:real`) THEN MRESA_TAC th3[`(x:real^3)` ;` (v:real^3)`;`(&1 - t) % (u:real^3) + t % (w:real^3)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; ` (u:real^3)`] THEN REWRITE_TAC[EXTENSION;INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL(*1*)[ MRESAL_TAC AFF_GT_1_2[`x:real^3`;`v:real^3`;`(&1-t)%u +t%w:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN SUBGOAL_THEN `x' IN (aff_ge {x,u} {w1}:real^3->bool)`ASSUME_TAC THENL(*2*)[ POP_ASSUM MP_TAC THEN MRESAL_TAC AFF_GE_1_2[`x:real^3`;`u:real^3`;`w1:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GE_2_1[`x:real^3`;`u:real^3`;`w1:real^3`][IN_ELIM_THM] THEN STRIP_TAC THEN EXISTS_TAC`t1':real` THEN EXISTS_TAC`t2':real` THEN EXISTS_TAC`t3':real` THEN ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC inequality3_aim_in_convex_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;` w:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th `t:real`) THEN POP_ASSUM(fun th-> MRESA_TAC th [`t1:real`;`t2:real`;`t3:real`]) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"BE") THEN DISCH_THEN(LABEL_TAC"YEU") THEN SUBGOAL_THEN`~collinear {x, u, x':real^3}`ASSUME_TAC THENL(*3*)[ MRESA_TAC continuous_coplanar_fan [`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `t:real`) THEN ASM_REWRITE_TAC[collinear_fan;] THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN REWRITE_TAC[coplanar;aff; AFFINE_HULL_2;IN_ELIM_THM] THEN STRIP_TAC THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN SUBGOAL_THEN`(x:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*4*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(v:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*5*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN EXISTS_TAC`&0` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`(u:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*6*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1` THEN REDUCE_ARITH_TAC THEN VECTOR_ARITH_TAC; SUBGOAL_THEN`((&1 - t) % u + t % w:real^3)IN affine hull {x,v,u:real^3}` ASSUME_TAC THENL(*7*)[ REWRITE_TAC[ AFFINE_HULL_3;IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(REAL_ARITH`&0<t3:real==> ~(t3= &0)`) THEN RESA_TAC THEN MP_TAC(ISPEC`(t3:real)`REAL_MUL_LINV) THEN RESA_TAC THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[VECTOR_ARITH`t1' % x + t2 % v + t3 % ((&1 - t) % u + t % w) = u' % x + v' % u <=>t3 % ((&1 - t) % u + t % w) = (u'-t1') % x -t2 % v+v' % u:real^3`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t3 % ((&1 - t) % u + t % w) = (u'-t1) % x -t2 % v+v' % u ==> (inv (t3))%(t3 % ((&1 - t) % u + t % w) ) = (inv (t3))%((u'-t1) % x -t2 % v+v' % u):real^3`) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%(B-C+D)=A%B-A%C+A%D`;VECTOR_ARITH`A%B%C=(A*B)%C`] THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN EXISTS_TAC`(inv t3 * (u' - t1)):real` THEN EXISTS_TAC`-- (inv t3 * t2):real` THEN EXISTS_TAC`(inv t3 * v'):real` THEN ASM_REWRITE_TAC[VECTOR_ARITH`A+(--b)%C+d=A-b%C+d`;REAL_ARITH`inv t3 * (u' - t1') + --(inv t3 * t2) + inv t3 * v'=inv t3 * (t3+(u'+v') - (t1'+ t2+t3))`;REAL_ARITH`A+ &1- &1=A`];(*7*) ASM_TAC THEN SET_TAC[]](*7*)](*6*)](*5*)](*4*);(*3*) MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w:real^3)`; ` (u:real^3)`] THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`u:real^3`;`x':real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`u:real^3`;`x':real^3`;`w1:real^3`;] THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`u:real^3`;`w:real^3`;`w1:real^3`;`x':real^3`;] THEN REMOVE_THEN"BE" MP_TAC THEN REMOVE_THEN"YEU" MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN FIND_ASSUM MP_TAC`(sigma_fan x V E u w = (v:real^3))` THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)]) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge u V E = {w:real^3}) \/ ~(set_of_edge u V E = {w})`) THENL(*4*)[ FIND_ASSUM MP_TAC`w1 IN set_of_edge (u:real^3) V E` THEN POP_ASSUM (fun th-> REWRITE_TAC[(th);IN_SING]) THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC (ISPECL[`x:real^3`;`u:real^3`;`w:real^3`]AZIM_REFL) THEN REAL_ARITH_TAC;(*4*) DISJ_CASES_TAC(SET_RULE`(w1:real^3)=w \/ ~((w1:real^3)=w)`) THENL(*5*)[ ASM_REWRITE_TAC[] THEN MP_TAC (ISPECL[`x:real^3`;`u:real^3`;`w:real^3`]AZIM_REFL) THEN REAL_ARITH_TAC; MRESA_TAC SIGMA_FAN[`(x:real^3)`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(u:real^3)`;`(w:real^3)`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w1:real^3`) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]; SET_TAC[]]);;let fan_run_in_small_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 v1:real^3 w1:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ {v1,w1} IN E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v /\ &0 <a /\ a< &1 /\(aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) /\ (!s. &0 < s /\ s < a ==> aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> ?t1:real. a<t1 /\ t1<= &1 /\ (!t:real. &0< t /\ t< t1==> aff_gt{x} {v,(&1-t)%u+ t % w} INTER aff_ge{x} {v1,w1}={})`,(let lem=prove(`!x v v1. aff_ge {x} {v1, v}=aff_ge {x} {v, v1}`, REPEAT STRIP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN SIMP_TAC[]) in REPEAT STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN DISJ_CASES_TAC(SET_RULE`(v1=v)\/ ~(v1=v:real^3)`) THENL[ MRESA_TAC fan_run_in_small2_not0_is_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v1:real^3`;`u:real^3`;` w:real^3`;`w1:real^3`;`a:real`]; DISJ_CASES_TAC(SET_RULE`(v1=u)\/ ~(v1=u:real^3)`) THENL[ MRESA_TAC fan_run_in_small3_not0_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` v1:real^3`;` w:real^3`;`w1:real^3`;`a:real`]; DISJ_CASES_TAC(SET_RULE`(w1=v)\/ ~(w1=v:real^3)`) THENL[ FIND_ASSUM MP_TAC`{v1,w1} IN (E:(real^3->bool)->bool)` THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small2_not0_is_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w1:real^3`;`u:real^3`;` w:real^3`;`v1:real^3`;`a:real`] THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[lem]; DISJ_CASES_TAC(SET_RULE`(w1=u)\/ ~(w1=u:real^3)`) THENL[ FIND_ASSUM MP_TAC`{v1,w1} IN (E:(real^3->bool)->bool)` THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{v,u}={u,v}`] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small3_not0_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` w1:real^3`;` w:real^3`;`v1:real^3`;`a:real`] THEN EXISTS_TAC`t1:real` THEN ASM_REWRITE_TAC[lem]; SUBGOAL_THEN`{v,u} INTER {v1,w1:real^3}={}` ASSUME_TAC THENL[ ASM_TAC THEN SET_TAC[]; MRESA_TAC fan_run_in_small1_not0_is_fan[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` v:real^3`;` u:real^3`;` w:real^3`;`v1:real^3`;`w1:real^3`;`a:real`]]]]]]));;let fan_run1_in_small_not0_is_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) (E':(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ E' SUBSET E /\ (&0< azim x u w v ) /\ (azim x u w v <pi) /\ sigma_fan x V E u w = v /\ &0 <a /\ a< &1 /\(aff_gt {x} {v, (&1 - a) % u + a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) /\ (!s. &0 < s /\ s < a ==> aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e} = {}) ==> ?h:real. a<h /\ h<= &1 /\ (!s:real. &0< s /\ s< h==> aff_gt{x} {v,(&1-s)%u+ s % w} INTER {v | ?e. e IN E' /\ v IN aff_ge {x} e}={})`,REPEAT STRIP_TAC THEN MRESA_TAC set_edges_is_finite_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN MRESA_TAC FINITE_SUBSET [`(E':(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`] THEN ABBREV_TAC`n=CARD (E':(real^3->bool)->bool)` THEN REPEAT(POP_ASSUM MP_TAC) THEN SPEC_TAC (`(E':(real^3->bool)->bool)`,`(E':(real^3->bool)->bool)`) THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL(*1*)[ REPEAT STRIP_TAC THEN MP_TAC(ISPECL[`E':(real^3->bool)->bool`]CARD_EQ_0) THEN RESA_TAC THEN EXISTS_TAC`a+ (&1-a:real) / &2` THEN MP_TAC(REAL_ARITH`&0<a /\ a < &1 ==> a< a+ (&1-a:real) / &2/\ a+ (&1-a:real) / &2 <= &1`) THEN RESA_TAC THEN ASM_SET_TAC[];(*1*) REPEAT GEN_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC "A") THEN REPEAT STRIP_TAC THEN MP_TAC(ISPEC`(E':(real^3->bool)->bool)` CHOOSE_SUBSET) THEN RESA_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`n:num `th)) THEN REWRITE_TAC[ARITH_RULE `n:num <= SUC n`; HAS_SIZE] THEN STRIP_TAC THEN MP_TAC(SET_RULE` t SUBSET E' /\ E' SUBSET E ==> (t:(real^3->bool)->bool) SUBSET E`) THEN RESA_TAC THEN REMOVE_THEN "A" (fun th-> MP_TAC(ISPEC`(t:(real^3->bool)->bool)`th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN SUBGOAL_THEN `~((E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)= {})` ASSUME_TAC THENL(*2*)[ STRIP_TAC THEN MP_TAC(SET_RULE`(E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)={} /\ t SUBSET E' ==> t= E'`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`CARD (t:(real^3->bool)->bool)=n` THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN ASM_REWRITE_TAC[] THEN ARITH_TAC;(*2*) SUBGOAL_THEN`?e. e IN (E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)` ASSUME_TAC THENL(*3*)[ ASM_SET_TAC[];(*3*) POP_ASSUM MP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`e IN (E':(real^3->bool)->bool) DIFF (t:(real^3->bool)->bool)/\ (E':(real^3->bool)->bool) SUBSET (E:(real^3->bool)->bool) /\ t SUBSET E' ==> e IN E'/\ e IN E/\ ~(e IN t) /\ {e} UNION t SUBSET E'`) THEN RESA_TAC THEN MP_TAC(ISPECL [`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;`(E':(real^3->bool)->bool)`] FINITE_SUBSET) THEN RESA_TAC THEN ASSUME_TAC(SET_RULE`e IN {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`) THEN MP_TAC(ISPECL[`e:real^3->bool`;`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;]CARD_DELETE) THEN RESA_TAC THEN MP_TAC(SET_RULE `e IN {e:(real^3->bool)} UNION (t:(real^3->bool)->bool) ==> ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e PSUBSET {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`) THEN RESA_TAC THEN MP_TAC(ISPECL[`({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))DELETE e`;`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`]CARD_PSUBSET) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN FIND_ASSUM MP_TAC`FINITE ( {e:(real^3->bool)} UNION (t:(real^3->bool)->bool))` THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN DISCH_TAC THEN MP_TAC(ARITH_RULE`CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) < CARD ( {e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) /\ CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) = CARD ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))-1 <=>CARD (({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e) +1= CARD ({e:(real^3->bool)} UNION (t:(real^3->bool)->bool))`) THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM (fun th->GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th;]) THEN REWRITE_TAC[ARITH_RULE`A=A`; ] THEN MP_TAC(SET_RULE`~(e IN t)==>({e:(real^3->bool)} UNION (t:(real^3->bool)->bool)) DELETE e=t`) THEN RESA_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN FIND_ASSUM MP_TAC`(CARD (E':(real^3->bool)->bool)=SUC n)` THEN REWRITE_TAC[ARITH_RULE`SUC n=(n:num) +1`] THEN DISCH_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)]) THEN DISCH_TAC THEN MP_TAC(ISPECL[`{e:(real^3->bool)} UNION (t:(real^3->bool)->bool)`;`E':(real^3->bool)->bool`]CARD_SUBSET_EQ) THEN POP_ASSUM (fun th->REWRITE_TAC[SYM(th)]) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"MA") THEN MP_TAC(ISPECL[`(x:real^3)`;` (V:real^3->bool) `;`(E:(real^3->bool)->bool)`;`(e:real^3->bool)`]expand_edge_graph_fan) THEN RESA_TAC THEN MRESA_TAC fan_run_in_small_not0_is_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w:real^3`;`v':real^3`;`w':real^3`;`a:real`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)] THEN ASSUME_TAC(th)) THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"BE") THEN EXISTS_TAC` min (h:real) (t1:real)` THEN STRIP_TAC THENL(*4*)[ ASM_TAC THEN REAL_ARITH_TAC;(*4*) STRIP_TAC THENL(*5*)[ ASM_TAC THEN REAL_ARITH_TAC;(*5*) REPEAT STRIP_TAC THEN REMOVE_THEN "MA" MP_TAC THEN DISCH_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)] THEN ASSUME_TAC(th)) THEN REWRITE_TAC[UNION;IN_ELIM_THM;EXTENSION; INTER;] THEN GEN_TAC THEN EQ_TAC THENL(*6*)[ ASM_REWRITE_TAC[IN_SING] THEN MP_TAC(REAL_ARITH`s< min h t1==> s<h /\ s<t1`) THEN RESA_TAC THEN STRIP_TAC THENL(*7*)[ POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "BE"(fun th-> MRESA1_TAC th `s:real`) THEN ASM_SET_TAC[]; POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "YEU"(fun th-> MRESA1_TAC th `s:real`) THEN ASM_SET_TAC[]]; SET_TAC[]]]]]]]);;let cut_in_edges_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a<= &1 /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ ~(aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={}) ==> a= &1 `,REPEAT STRIP_TAC THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN ABBREV_TAC`s1={h:real| &0< h/\ h<= &1 /\ ~(aff_gt{x} {v,(&1-h)%u+ h % w:real^3} INTER {v | ?e. e IN E /\ v IN aff_ge {x:real^3} e}={})}` THEN SUBGOAL_THEN`(a:real) IN (s1:real->bool)` ASSUME_TAC THENL(*1*)[ POP_ASSUM(fun th->ASM_REWRITE_TAC[SYM(th);IN_ELIM_THM]); MP_TAC(SET_RULE`(a:real) IN (s1:real->bool)==> ~(s1={})`) THEN RESA_TAC THEN SUBGOAL_THEN`(?b. !x:real. x IN s1 ==> b <= x)`ASSUME_TAC THENL(*2*)[ EXISTS_TAC`&0` THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th->ASM_REWRITE_TAC[SYM(th);IN_ELIM_THM]) THEN REAL_ARITH_TAC; MRESA1_TAC INF`s1:real->bool` THEN ABBREV_TAC`b= inf (s1:real->bool)` THEN SUBGOAL_THEN`b<= &1` ASSUME_TAC THENL(*3*)[POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `a:real`) THEN ASM_TAC THEN REAL_ARITH_TAC;(*3*) SUBGOAL_THEN`~(?s. &0 < s /\ s < b /\ ~( aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x:real^3} e} = {}))` ASSUME_TAC THENL(*4*)[STRIP_TAC THEN SUBGOAL_THEN`s IN (s1:real->bool)` ASSUME_TAC THENL(*5*)[ EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM] THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REAL_ARITH_TAC;(*5*) POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`s:real` th)) THEN DISCH_THEN (LABEL_TAC"DICH") THEN REPEAT STRIP_TAC THEN REMOVE_THEN"DICH" MP_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC];(*4*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM;IMP_IMP] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small_is_not_meet_xfan [`x:real^3`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` v:real^3`;`u:real^3`;`w:real^3`] THEN SUBGOAL_THEN`~(?x:real. x IN s1 /\ ~(h <= x))`ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM; REAL_ARITH`~(A<=B)<=> B<A`] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `x':real`);(*5*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM] THEN STRIP_TAC THEN SUBGOAL_THEN`&0<b:real`ASSUME_TAC THENL(*6*)[ POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`h:real` th)) THEN DISCH_THEN (LABEL_TAC"DICH") THEN REPEAT STRIP_TAC THEN REMOVE_THEN"DICH" MP_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC;(*6*) MRESA_TAC not_cut_inside_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3` ;`b:real`] THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(REAL_ARITH`(b:real)< &1\/ &1 <= b`) THENL(*7*)[ ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC fan_run1_in_small_not0_is_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`b:real`][SET_RULE`A SUBSET A`] THEN SUBGOAL_THEN`~(?x:real. x IN s1 /\ ~(h' <= x))`ASSUME_TAC THENL(*8*)[ POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM; REAL_ARITH`~(A<=B)<=> B<A`] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `x':real`);(*8*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM] THEN STRIP_TAC THEN SUBGOAL_THEN `h':real <= b`ASSUME_TAC THENL(*9*)[POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`h':real` th)) THEN REWRITE_TAC[];(*9*) POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC](*9*)](*8*);(*7*) STRIP_TAC THEN MP_TAC(REAL_ARITH`&1<=b /\ b<= &1==> b= &1`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`a:real` th)) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]]]]);;let DHVFGBC=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a<= &1 /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ ~(aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={}) ==> a= &1 /\ independent {v - x, u - x, ((&1 - a) % u + a % w) - x}`,MESON_TAC[independent_run_edges_fan;cut_in_edges_fan]);;end;;let not_cut_in_edges_fan=prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 u:real^3 w:real^3 a:real. FAN(x,V,E)/\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ &0<a /\ a< &1 /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) ==> (aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={})`,REPEAT STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE`(?a. &0< a /\ a< &1 /\ ~(aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x} e}={})) \/ (!a. &0< a /\ a< &1 ==> (aff_gt{x} {v,(&1-a)%u+ a % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x:real^3} e}={})) `) THENL[ POP_ASSUM MP_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM BE") THEN FIND_ASSUM MP_TAC `fan80(x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN ABBREV_TAC`s1={h:real| &0< h/\ h< &1 /\ ~(aff_gt{x} {v,(&1-h)%u+ h % w:real^3} INTER {v | ?e. e IN E /\ v IN aff_ge {x:real^3} e}={})}` THEN SUBGOAL_THEN`(a':real) IN (s1:real->bool)` ASSUME_TAC THENL(*1*)[ POP_ASSUM(fun th->ASM_REWRITE_TAC[SYM(th);IN_ELIM_THM]); MP_TAC(SET_RULE`(a':real) IN (s1:real->bool)==> ~(s1={})`) THEN RESA_TAC THEN SUBGOAL_THEN`(?b. !x:real. x IN s1 ==> b <= x)`ASSUME_TAC THENL(*2*)[EXISTS_TAC`&0` THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th->ASM_REWRITE_TAC[SYM(th);IN_ELIM_THM]) THEN REAL_ARITH_TAC;(*2*) MRESA1_TAC INF`s1:real->bool` THEN ABBREV_TAC`b= inf (s1:real->bool)` THEN SUBGOAL_THEN`b< &1` ASSUME_TAC THENL(*3*)[ POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `a':real`) THEN ASM_TAC THEN REAL_ARITH_TAC;(*3*) SUBGOAL_THEN`~(?s. &0 < s /\ s < b /\ ~( aff_gt {x} {v, (&1 - s) % u + s % w} INTER {v | ?e. e IN E /\ v IN aff_ge {x:real^3} e} = {}))` ASSUME_TAC THENL(*4*)[ STRIP_TAC THEN SUBGOAL_THEN`s IN (s1:real->bool)` ASSUME_TAC THENL(*5*)[EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM] THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REAL_ARITH_TAC;(*5*) POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`s:real` th)) THEN DISCH_THEN (LABEL_TAC"DICH") THEN REPEAT STRIP_TAC THEN REMOVE_THEN"DICH" MP_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC];(*4*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM;IMP_IMP] THEN STRIP_TAC THEN MRESA_TAC fan_run_in_small_is_not_meet_xfan [`x:real^3`;` (V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` v:real^3`;`u:real^3`;`w:real^3`] THEN SUBGOAL_THEN`~(?x:real. x IN s1 /\ ~(h <= x))`ASSUME_TAC THENL(*5*)[POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM; REAL_ARITH`~(A<=B)<=> B<A`] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `x':real`);(*5*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM] THEN STRIP_TAC THEN SUBGOAL_THEN`&0<b:real`ASSUME_TAC THENL(*6*)[ POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`h:real` th)) THEN DISCH_THEN (LABEL_TAC"DICH") THEN REPEAT STRIP_TAC THEN REMOVE_THEN"DICH" MP_TAC THEN POP_ASSUM (fun th->REWRITE_TAC[th]) THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC;(*6*) MRESA_TAC not_cut_inside_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3` ;`b:real`] THEN MRESAL_TAC fan_run1_in_small_not0_is_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`b:real`][SET_RULE`A SUBSET A`] THEN SUBGOAL_THEN`~(?x:real. x IN s1 /\ ~(h' <= x))`ASSUME_TAC THENL(*7*)[ POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") THEN EXPAND_TAC"s1" THEN REWRITE_TAC[IN_ELIM_THM; REAL_ARITH`~(A<=B)<=> B<A`] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN"A"(fun th-> MRESA1_TAC th `x':real`);(*7*) POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM NOT_IMP; GSYM NOT_FORALL_THM] THEN STRIP_TAC THEN SUBGOAL_THEN `h':real <= b`ASSUME_TAC THENL(*8*)[POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th->MP_TAC(ISPEC`h':real` th)) THEN REWRITE_TAC[]; POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]]]]]]]]; POP_ASSUM (fun th-> MRESA1_TAC th`a:real`)]);;