(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION                                              *)
(*                                                                            *)
(* Chapter: Fan                                              *)
(* Author: Hoang Le Truong                                        *)
(* Date: 2010-02-09                                                           *)
(* ========================================================================= *)

(*
tame_lemmas-compiled.hl needs Conforming2.hl which is an almost exact copy of Conforming.hl. The content of Conforming2.hl should replace Conforming.hl. I think there will be no problems with such a replacement but I never tested it. The only difference between Conforming2.hl and Conforming.hl is that I removed the assumption `~(conforming_fan (x,V,E))` from some lemmas where it is not used.


Alexey
*)



module  Conforming2 = struct









open Sphere;;
open Fan_defs;;
open Hypermap;;
open Vol1;;
open Fan;;
open Topology;;		
open Fan_misc;;
open Planarity;; 







let conforming_bijection_fan = new_definition `conforming_bijection_fan (x,V,E) <=>
  !s. s IN topological_component_yfan (x,V,E) ==> (?!f. f IN face_set (hypermap1_of_fanx (x,V,E)) /\ 
							 s = dartset_leads_into_fan x V E f)`;;
let conforming_half_space_fan = new_definition `conforming_half_space_fan (x,V,E) <=>
	!f. f IN face_set (hypermap1_of_fanx (x,V,E)) ==> 
		dartset_leads_into_fan x V E f = 
			INTERS {aff_gt {x, pr2 y, pr3 y} {pr3 (f1_fan x V E y) } |  y IN f}`;;
let conforming_solid_angle_fan = new_definition `conforming_solid_angle_fan (x,V,E) <=>
  !f. f IN face_set (hypermap1_of_fanx (x,V,E)) ==>
  (let U = dartset_leads_into_fan x V E f in
     (!r. measurable (ball (x,r) INTER U)) /\
       eventually_radial x U /\
       sol x U = &2 * pi + sum (f) (\y. (azim_fan x V E (pr2 y) (pr3 y))  - pi))`;;
let conforming_diagonal_fan = new_definition `conforming_diagonal_fan (x,V,E) <=>
	(!f y z. f IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN f /\ z IN f /\ ~(y = z) ==> 
		~collinear {x, pr2 y, pr2 z} /\
		((y = f1_fan x V E z) \/ (z = f1_fan  x V E y) \/ 
			aff_gt {x} {pr2 y, pr2 z} SUBSET (dartset_leads_into_fan  x V E f)))`;;
let conforming_fan = new_definition `conforming_fan (x,V,E) <=>
 (!v. v IN V==>CARD (set_of_edge v V E) >1)/\
        fan80(x,V,E) /\
	conforming_bijection_fan (x,V,E) /\
	conforming_half_space_fan (x,V,E) /\
	conforming_solid_angle_fan (x,V,E) /\
	conforming_diagonal_fan (x,V,E)`;;
let N_FAN = new_definition `N_FAN (x,V,E) = nsum (face_set (hypermap1_of_fanx (x,V,E))) (\f. CARD f -3)`;;
let minimally_nonconforming_fan=new_definition`minimally_nonconforming_fan(x,V,E)<=>
FAN(x,V,E)
 /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1)
/\ fan80(x,V,E)
/\ ~(conforming_fan (x,V,E))
/\ (!E1. FAN(x,V,E1)  /\ 
         (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ 
         fan80(x,V,E1)/\ 
         N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1))`;;
let GINGUAP=
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) /\ conforming_fan (x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) ==> convex(dartset_leads_into_fan x V E ds)`,
REWRITE_TAC[conforming_fan;conforming_half_space_fan] 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 DISCH_THEN(LABEL_TAC"EM") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th`ds:real^3#real^3#real^3#real^3->bool`) THEN MATCH_MP_TAC CONVEX_INTERS THEN REWRITE_TAC[IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[CONVEX_AFF_GT]);;
let fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v w. FAN(x,V,E) /\ {v,w} IN E /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) ==> aff_gt {x, v,w} {sigma_fan x V E v w} = aff_gt {x, v, w} {inverse1_sigma_fan x V E w v}`,
REPEAT STRIP_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`v:real^3`;`w:real^3`] THEN MRESA_TAC th [`w:real^3`;`inverse1_sigma_fan x V E w v:real^3`] ) THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_THEN "EM" MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v:real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,B,D,C}`] THEN DISCH_TAC THEN ASSUME_TAC th) 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 sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`v:real^3`;`w: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 w:real^3`;`(v:real^3)`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`sigma_fan x V E v w:real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,B,D}`] THEN DISCH_TAC THEN MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN DISCH_TAC THEN ASSUME_TAC th) THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`v:real^3`;`sigma_fan x V E v w:real^3`; `w:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;`(w:real^3)`;`inverse1_sigma_fan x V E w v:real^3`] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`w:real^3`;`v:real^3`;`inverse1_sigma_fan x V E w v:real^3`; ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`;CROSS_TRIPLE] THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`v:real^3`;`w:real^3`;`sigma_fan x V E v w:real^3`;] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`v:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w v:real^3`]);;
let IMAGE_F1_IN_FACE_IMP_IN_FACE=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y y1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds /\ y1 IN d_fan(x,V,E) /\ f1_fan x V E y1= y ==> y1 IN ds`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN ASM_REWRITE_TAC[face_set;set_of_orbits;IN_ELIM_THM;orbit_map] THEN RESA_TAC THEN REWRITE_TAC[IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`x':real^3#real^3#real^3#real^3`) THEN STRIP_TAC THEN SUBGOAL_THEN`face (hypermap1_of_fanx (x,V,E)) y1 IN face_set (hypermap1_of_fanx (x,V,E))`ASSUME_TAC THENL[ REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits;face] THEN EXISTS_TAC`y1:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[]; MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x,V,E)) y1):real^3#real^3#real^3#real^3->bool`] THEN SUBGOAL_THEN`?N:num. CARD (face (hypermap1_of_fanx (x,V,E)) y1)= SUC N /\ N>0`ASSUME_TAC THENL[ EXISTS_TAC`CARD (face (hypermap1_of_fanx (x:real^3,V,E)) y1)-1` THEN POP_ASSUM MP_TAC THEN ARITH_TAC; POP_ASSUM MP_TAC THEN STRIP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`CARD (face (hypermap1_of_fanx (x,V,E)) y1):num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y1:real^3#real^3#real^3#real^3`) THEN STRIP_TAC THEN MRESA_TAC lemma_face_cycle[`hypermap1_of_fanx (x:real^3,V,E)`;`y1:real^3#real^3#real^3#real^3`] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[POWER;o_DEF;GSYM lemma_add_exponent_function] THEN STRIP_TAC THEN EXISTS_TAC`N+n:num` THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`N+n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`x':real^3#real^3#real^3#real^3`) THEN MP_TAC(ARITH_RULE`n>=0/\ N>0==> N+n>=0`) THEN ASM_REWRITE_TAC[]]]);;
let IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE=
prove(`!m x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y y1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds /\ y1 IN d_fan(x,V,E) /\ (f1_fan x V E POWER m) y1= y ==> y1 IN ds`,
INDUCT_TAC THENL[ ASM_REWRITE_TAC[POWER;I_DEF] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN ASM_REWRITE_TAC[POWER;o_DEF] THEN REPEAT STRIP_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA_TAC th[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`;` (f1_fan x V E y1):real^3#real^3#real^3#real^3`;]) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN STRIP_TAC THEN MRESAL_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`1:num`][POWER_1] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y1:real^3#real^3#real^3#real^3`) THEN STRIP_TAC THEN STRIP_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E y1):real^3#real^3#real^3#real^3`;`y1:real^3#real^3#real^3#real^3`;]]);;
let REP_OF_INVERSE1_SIGMA_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds ==> f1_fan x V E (x,sigma_fan x V E (pr2 y) (pr3 y),(pr2 y),sigma_fan x V E (sigma_fan x V E (pr2 y) (pr3 y)) (pr2 y))=y `,
REPEAT STRIP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`ds SUBSET d1_fan (x,V,E) /\ y IN ds ==> y IN d1_fan (x,V,E)`) THEN ASM_REWRITE_TAC[f1_fan;d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`w:real^3`));;
let REP_OF_INVERSE1_SIGMA_FAN_IN_D_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds ==> (x,sigma_fan x V E (pr2 y) (pr3 y),(pr2 y),sigma_fan x V E (sigma_fan x V E (pr2 y) (pr3 y)) (pr2 y)) IN d_fan (x:real^3,V:real^3->bool,E)`,
REPEAT STRIP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`ds SUBSET d1_fan (x,V,E) /\ y IN ds ==> y IN d1_fan (x,V,E)`) THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`(sigma_fan x V E v w):real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`(sigma_fan x V E (sigma_fan x V E v w) v):real^3` THEN ASM_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] 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 sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` v:real^3`;`w: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 w):real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN RESA_TAC);;
let DARTSET_LEADS_INTO_SUBSET_WDART_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y. FAN(x,V,E) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds /\ conforming_fan (x,V,E) ==> (dartset_leads_into_fan x V E ds) SUBSET (w_dart_fan x V E y)`,
REWRITE_TAC[conforming_fan;conforming_half_space_fan] THEN 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 REPEAT STRIP_TAC THEN REMOVE_THEN "EM"(fun th-> MRESA1_TAC th`ds:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y IN ds /\ ds SUBSET d1_fan (x,V,E)==> y IN d1_fan (x,V,E)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN 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 FIND_ASSUM MP_TAC`(!v:real^3. v IN V==>CARD (set_of_edge v V E) >1)` THEN DISCH_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC `v:real^3` th) THEN FIND_ASSUM MP_TAC `(v:real^3) IN V` THEN DISCH_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN STRIP_TAC) THEN ASM_REWRITE_TAC[w_dart_fan;] THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`v:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM1")) THEN MRESA_TAC sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` v:real^3`;`w: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 w):real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC WEDGE_LUNE_GT[`x:real^3`;`v:real^3`;`w:real^3`;`(sigma_fan x V E v w):real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(sigma_fan x V E v w):real^3`;`v:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN DISCH_TAC THEN MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN DISCH_TAC THEN ASSUME_TAC th) THEN MRESA_TAC inter_aff_gt_3_1_is_aff_gt_2_2[`x:real^3`;`w:real^3`;`v:real^3`;`(sigma_fan x V E v w):real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;]) THEN SUBGOAL_THEN`x,sigma_fan x V E v w,v,sigma_fan x V E (sigma_fan x V E v w) v IN d1_fan (x:real^3,V:real^3->bool,E)` ASSUME_TAC THENL[ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`(sigma_fan x V E v w):real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`(sigma_fan x V E (sigma_fan x V E v w) v):real^3` THEN ASM_REWRITE_TAC[SET_RULE`{A,B}={B,A}`]; MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E (x,sigma_fan x V E v w, v, sigma_fan x V E (sigma_fan x V E v w) v)):real^3#real^3#real^3#real^3)` ;`((x,sigma_fan x V E v w,v,sigma_fan x V E (sigma_fan x V E v w) v):real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[pr2;pr3;f1_fan] THEN REWRITE_TAC[] THEN STRIP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[pr2;pr3;f1_fan] THEN REWRITE_TAC[INTERS;INTER;IN_ELIM_THM; SUBSET] THEN REPEAT STRIP_TAC THENL[POP_ASSUM(fun th-> MRESA1_TAC th `aff_gt {x, w, v} {sigma_fan x V E v w:real^3}` THEN POP_ASSUM MATCH_MP_TAC) THEN EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[pr2;pr3;f1_fan] THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B,C}={A,C,B}`] THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`]; POP_ASSUM(fun th-> MRESA1_TAC th `aff_gt {x, v, sigma_fan x V E v w} {w}` THEN POP_ASSUM MATCH_MP_TAC) THEN EXISTS_TAC`(x,sigma_fan x V E v w,v,sigma_fan x V E (sigma_fan x V E v w:real^3) v):real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[pr2;pr3;f1_fan] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`w:real^3`) THEN MRESAL_TAC REP_OF_INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`][pr2;pr3] THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`;`(x,sigma_fan x V E v w,v,sigma_fan x V E (sigma_fan x V E v w:real^3) v):real^3#real^3#real^3#real^3`] THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B,C}={A,C,B}`] THEN REWRITE_TAC[]]]);;
let power_map_points_edge_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v:real^3 w:real^3 n:num. FAN(x,V,E) /\ {v,w} IN E ==> {v,power_map_points sigma_fan x V E v w n} IN E`,
REPEAT STRIP_TAC THEN MRESA_TAC i_IN_ORBITS_FAN[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v:real^3)`;` (w:real^3)`;`n:num`] THEN MRESA_TAC ORBITS_SUBSET_EDGE_FAN[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`v:real^3`;` (w:real^3)`] THEN MP_TAC (SET_RULE`power_map_points sigma_fan x V E v w n IN set_of_orbits_points_fan x V E v w /\ set_of_orbits_points_fan x V E v w SUBSET set_of_edge v V E ==> power_map_points sigma_fan x V E v w n IN set_of_edge v V E`) THEN ASM_REWRITE_TAC[] THEN MRESA_TAC properties_of_set_of_edge_fan[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`v:real^3`;` ((power_map_points sigma_fan x V E v w n):real^3)`]);;
let     SRPRNPL=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ conforming_fan (x,V,E) ==> simple_hypermap(hypermap1_of_fanx (x,V,E))`,
REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN REWRITE_TAC[conforming_fan] THEN ASSUME_TAC th) THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN ASM_REWRITE_TAC[simple_hypermap;node;EXTENSION;INTER;IN_ELIM_THM;orbit_map] THEN REPEAT STRIP_TAC THEN EQ_TAC THEN STRIP_TAC THENL[POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN (LABEL_TAC "EM") THEN REPEAT STRIP_TAC THEN SUBGOAL_THEN`x' IN face (hypermap1_of_fanx (x:real^3,V,E)) x'`ASSUME_TAC THENL[ REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN EXISTS_TAC`0` THEN REWRITE_TAC[POWER;I_DEF;ARITH_RULE`0>=0`]; SUBGOAL_THEN `face (hypermap1_of_fanx (x,V,E)) x' IN face_set (hypermap1_of_fanx (x:real^3,V,E))` ASSUME_TAC THENL[ ASM_REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits;orbit_map;face] THEN EXISTS_TAC`x':real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[]; MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN REMOVE_THEN"EM"MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`x':real^3#real^3#real^3#real^3`) THEN POP_ASSUM MP_TAC THEN REMOVE_THEN"EM"MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[d1_fan;] THEN REWRITE_TAC[IN_ELIM_THM] THEN STRIP_TAC THEN STRIP_TAC THEN MRESA_TAC power_n_fan[`n:num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN MRESAL_TAC DARTSET_LEADS_INTO_SUBSET_WDART_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x,V,E)) x'):real^3#real^3#real^3#real^3->bool`;`x'':real^3#real^3#real^3#real^3`][pr2;pr3;] THEN MRESAL_TAC DARTSET_LEADS_INTO_SUBSET_WDART_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x,V,E)) x'):real^3#real^3#real^3#real^3->bool`;`x':real^3#real^3#real^3#real^3`][pr2;pr3] THEN MRESA_TAC power_map_points_edge_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`; `w:real^3`; `n:num`] THEN MRESA_TAC dartset_leads_into_is_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x,V,E)) x'):real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC exists_point_in_component_yfan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)` ;`(dartset_leads_into_fan x V E (face (hypermap1_of_fanx (x,V,E)) (x,v,w,sigma_fan x V E v w))):real^3->bool`] THEN MP_TAC(SET_RULE`dartset_leads_into_fan x V E (face (hypermap1_of_fanx (x,V,E)) (x,v,w,sigma_fan x V E v w)) SUBSET w_dart_fan x V E (x, v, power_map_points sigma_fan x V E v w n, power_map_points sigma_fan x V E v w (SUC n))/\ dartset_leads_into_fan x V E (face (hypermap1_of_fanx (x,V,E)) (x,v,w,sigma_fan x V E v w)) SUBSET w_dart_fan x V E (x,v,w,sigma_fan x V E v w) /\ z IN dartset_leads_into_fan x V E (face (hypermap1_of_fanx (x,V,E)) (x,v,w,sigma_fan x V E v w)) ==> ~(w_dart_fan x V E (x,v,w,sigma_fan x V E v w) INTER w_dart_fan x V E (x, v, power_map_points sigma_fan x V E v w n, power_map_points sigma_fan x V E v w (SUC n)) ={})`) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[power_map_points] THEN STRIP_TAC THEN MRESA_TAC disjoint_fan2[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`; `w:real^3`;`(power_map_points sigma_fan x V E v w n):real^3`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;IN_SING])]]; POP_ASSUM MP_TAC THEN REWRITE_TAC[IN_SING] THEN RESA_TAC THEN STRIP_TAC THENL[ EXISTS_TAC `0` THEN REWRITE_TAC[ARITH_RULE`0>=0`; POWER;I_DEF]; REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN EXISTS_TAC `0` THEN REWRITE_TAC[ARITH_RULE`0>=0`; POWER;I_DEF]]]);;
let N_FAN_GE_0=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) ==> 0<= N_FAN(x,V,E) `,
REPEAT STRIP_TAC THEN MRESA_TAC NSUM_EQ_0[`(\f:real^3#real^3#real^3#real^3->bool. 0)`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN MRESA_TAC NSUM_LE[`(\f:real^3#real^3#real^3#real^3->bool. 0)`;`(\f:real^3#real^3#real^3#real^3->bool. CARD f - 3)`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN REWRITE_TAC[N_FAN] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[FINITE_HYPERMAP_ORBITS] THEN REPEAT STRIP_TAC THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`x':real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM MP_TAC THEN ARITH_TAC);;
let NSUM_EQ_0_IFF = 
prove (`!s f. FINITE s ==> (nsum s f = 0 <=> !x. x IN s ==> f x = 0)`,
REPEAT STRIP_TAC THEN EQ_TAC THEN ASM_SIMP_TAC[NSUM_EQ_0] THEN ASM_MESON_TAC[ARITH_RULE `n = 0 <=> n <= 0`; NSUM_POS_BOUND]);;
let N_FAN_EQ_0_IMP_CARD_FACE_EQ_3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ N_FAN(x,V,E)=0 /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) ==> CARD ds=3`,
REWRITE_TAC[N_FAN] THEN REPEAT STRIP_TAC THEN MRESAL_TAC NSUM_EQ_0_IFF[`face_set (hypermap1_of_fanx (x:real^3,V,E))`;`(\f:real^3#real^3#real^3#real^3->bool. CARD f -3)`][FINITE_HYPERMAP_ORBITS] THEN POP_ASSUM (fun th-> MRESA1_TAC th`ds:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ARITH_TAC);;
let version_JUTSTKG=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) U:real^3->bool. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ U IN topological_component_yfan (x,V,E) ==> ?f. f IN face_set (hypermap1_of_fanx (x,V,E)) /\ dartset_leads_into_fan x V E f = U`,
REPEAT STRIP_TAC THEN MRESA_TAC JUTSTKG[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`U:real^3->bool`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN ABBREV_TAC`y=(x,v,u:real^3,sigma_fan x V E v u)` THEN ABBREV_TAC`ds=face (hypermap1_of_fanx (x:real^3,V,E)) y` THEN EXISTS_TAC`ds:real^3#real^3#real^3#real^3->bool` THEN ASM_REWRITE_TAC[] THEN SUBGOAL_THEN`y IN dart (hypermap1_of_fanx (x:real^3,V,E))`ASSUME_TAC THENL[ REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;]) THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESAL_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`][d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`(sigma_fan x (V:real^3->bool) E v u):real^3` THEN ASM_REWRITE_TAC[]; SUBGOAL_THEN `ds IN face_set (hypermap1_of_fanx (x:real^3,V,E))`ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;face_set; IN_ELIM_THM;set_of_orbits;face]) THEN STRIP_TAC THEN EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[]; SUBGOAL_THEN`y IN ds:real^3#real^3#real^3#real^3->bool`ASSUME_TAC THENL[ EXPAND_TAC"ds" THEN REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0` THEN REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]; MRESA_TAC DARTSET_LEADS_INTO_FAN [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr2;pr3]]]]);;
let measurable_dartset_leads_into30_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds e. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds=3 ==> measurable((dartset_leads_into_fan x V E ds) INTER ball (x,e))`,
REPEAT STRIP_TAC THEN MRESA_TAC KVQWYDL_lemma10[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)]) THEN ONCE_REWRITE_TAC[SET_RULE`A INTER B=B INTER A`] THEN MESON_TAC[MEASURABLE_BALL_AFF_GT]);;
let   DWFBRQY=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ N_FAN(x,V,E)=0 ==> conforming_fan (x,V,E)`,
REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[conforming_fan] THEN MRESA_TAC N_FAN_EQ_0_IMP_CARD_FACE_EQ_3[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN STRIP_TAC THENL[ REWRITE_TAC[conforming_bijection_fan;EXISTS_UNIQUE] THEN REPEAT STRIP_TAC THEN MRESA_TAC version_JUTSTKG[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`s:real^3->bool`] THEN EXISTS_TAC`f:real^3#real^3#real^3#real^3->bool` THEN ASM_REWRITE_TAC[] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC exists_point_dart_leads_into_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `y:real^3#real^3#real^3#real^3->bool`;] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"MA") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" (fun th-> MRESA1_TAC th `f:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`y:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y' IN y /\ y SUBSET d_fan(x,V,E)==> y' IN d_fan(x,V,E)`) THEN RESA_TAC THEN MRESA_TAC KVQWYDL_lemma30[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y':real^3#real^3#real^3#real^3`) THEN REMOVE_THEN "MA" MP_TAC THEN ASM_TAC THEN REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MRESAL_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`;`y':real^3#real^3#real^3#real^3`][face] THEN MRESAL_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x'':real^3#real^3#real^3#real^3`;`y':real^3#real^3#real^3#real^3`][face]; STRIP_TAC THENL[ REWRITE_TAC[conforming_half_space_fan] THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" (fun th-> MRESA1_TAC th `f:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC KVQWYDL_lemma10[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th);]) THEN MRESA_TAC CARD_FACE_SET_EQ_3_FULLY_SURROUNDED_FAN1[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN ASM_REWRITE_TAC[SET_RULE`INTERS {aff_gt {x, pr2 y, pr3 y} {pr3 (f1_fan x V E y)} | y IN {f1, f2, f3}} = aff_gt {x, pr2 f1, pr3 f1} {pr3 (f1_fan x V E f1)} INTER aff_gt {x, pr2 f2, pr3 f2} {pr3 (f1_fan x V E f2)} INTER aff_gt {x, pr2 f3, pr3 f3} {pr3 (f1_fan x V E f3)}`;SET_RULE`{pr2 y | y IN {f1, f2, f3}}={pr2 f1, pr2 f2, pr2 f3}`] THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`pr2 f2:real^3`;`pr2 f3:real^3`]) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(pr2 f1):real^3`;`(pr2 f2):real^3`;`(pr2 f3):real^3`] THEN MRESA_TAC inter_aff_gt_3_1_is_aff_gt_1_3[`x:real^3`;`(pr3 f3):real^3`;`(pr3 f1):real^3`;`(pr3 f2):real^3`]; STRIP_TAC THENL[ REWRITE_TAC[conforming_solid_angle_fan] THEN REPEAT STRIP_TAC THEN CONV_TAC(TOP_DEPTH_CONV let_CONV) THEN ONCE_REWRITE_TAC[SET_RULE`A INTER B= B INTER A`] THEN REMOVE_THEN "EM" (fun th-> MRESA1_TAC th `f:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC measurable_dartset_leads_into30_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;] THEN MRESA_TAC dartset_leads_into_fan_eventually_radial_norm[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[eventually_radial_norm;eventually_radial;radial_norm; radial;ball_eq_normball] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC solid_of_dartset_leads_into_fan_triangle_fan [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;]; REWRITE_TAC[conforming_diagonal_fan] THEN REPEAT GEN_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "EM" (fun th-> MRESA1_TAC th `f:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC CARD_FACE_SET_EQ_3_FULLY_SURROUNDED_FAN1[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (pr2 f2):real^3`;`(pr2 f1):real^3`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (pr2 f3):real^3`;`(pr2 f2):real^3`] THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` (pr2 f1):real^3`;`(pr2 f3):real^3`] THEN REPEAT DISCH_TAC THEN MP_TAC(SET_RULE`y IN {f1, f2, f3:real^3#real^3#real^3#real^3} /\ z IN {f1, f2, f3}/\ ~(y = z) ==> (y=f1 /\ z= f2) \/ (y=f1 /\ z= f3) \/ (y=f2 /\ z= f1) \/ (y=f2 /\ z= f3)\/ (y=f3 /\ z= f1) \/ (y=f3 /\ z= f2)` ) THEN RESA_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[]]]]);;
let NEGLIGIBLE_AFF_3=
prove(`!x:real^3 v:real^3 u:real^3. negligible (aff {x,v,u})`,
MESON_TAC[NEGLIGIBLE_AFFINE_HULL_3;aff]);;
let NEGLIGIBLE_AFF_GE_2_1=
prove(`!x:real^3 v:real^3 u:real^3. ~collinear {x,v,u} ==> negligible (aff_ge {x,v} {u})`,
REPEAT GEN_TAC THEN GEOM_ORIGIN_TAC `x:real^3` THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC`{w:real^3| (w) dot (e2_fan (vec 0) v u)= &0}` THEN MRESAL_TAC exp_aff_ge_by_dot[`(vec 0):real^3`;`v:real^3`;`u:real^3`][VECTOR_ARITH`A- vec 0=A`] THEN REWRITE_TAC[SET_RULE`{w | w dot e2_fan (vec 0) v u = &0 /\ &0 <= w dot e1_fan (vec 0) v u} SUBSET {w | w dot e2_fan (vec 0) v u = &0}`] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN MATCH_MP_TAC NEGLIGIBLE_HYPERPLANE THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC properties_coordinate[`((vec 0):real^3)`;` (v:real^3)`;` (u:real^3)`][orthonormal;DOT_LZERO] THEN ASM_TAC THEN REAL_ARITH_TAC);;
let NEGLIGIBLE_AFF_GE_1_2=
prove(`!x:real^3 v:real^3 u:real^3. ~collinear {x,v,u} ==> negligible (aff_ge {x} {v,u})`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `aff_ge {x,v} {u:real^3}` THEN MRESA_TAC aff_ge_inter_aff_ge[`x:real^3`;`v:real^3`;`u:real^3`] THEN ASM_SIMP_TAC[SET_RULE`A INTER B SUBSET A`;NEGLIGIBLE_AFF_GE_2_1]);;
let NEGLIGIBLE_AFF_GT_1_2=
prove(`!x:real^3 v:real^3 u:real^3. ~collinear {x,v,u} ==> negligible (aff_gt {x} {v,u})`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `aff_ge {x} {v,u:real^3}` THEN MP_TAC(ISPECL[`(x:real^3)`;` (v:real^3)`;` (u:real^3)`]th3) THEN RESA_TAC THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`v:real^3`;`u:real^3`] THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_GE_1_2]);;
let MEASURE_AFF_3=
prove(`!x:real^3 v:real^3 u:real^3. measure (aff {x,v,u})= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_3]);;
let MEASURE_AFF_GT_2_1=
prove(`!x:real^3 v:real^3 u:real^3. ~collinear {x,v,u}==> measure (aff_gt {x} {v,u})= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_GT_1_2]);;
let NEGLIGIBLE_AFF_3_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. negligible (aff {x,v,u} INTER normball x r)`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `aff {x,v,u:real^3}` THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_3; SET_RULE`A INTER B SUBSET A`]);;
let NEGLIGIBLE_AFF_GT_1_2_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. ~collinear {x,v,u} ==> negligible (aff_gt {x} {v,u} INTER normball x r)`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `aff_gt {x} {v,u:real^3}` THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_GT_1_2; SET_RULE`A INTER B SUBSET A`]);;
let MEASURE_AFF_3_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. measure (aff {x,v,u} INTER normball x r)= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_3_INTER_BALL]);;
let MEASURE_AFF_GT_2_1_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. ~collinear {x,v,u}==> measure (aff_gt {x} {v,u} INTER normball x r)= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_GT_1_2_INTER_BALL]);;
let HAS_MEASURE_AFF_3_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. (aff {x,v,u} INTER normball x r) has_measure &0`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_3_INTER_BALL;HAS_MEASURE_0]);;
let HAS_MEASURE_AFF_GT_1_2_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. ~collinear {x,v,u}==> (aff_gt {x} {v,u} INTER normball x r) has_measure &0`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[NEGLIGIBLE_AFF_GT_1_2_INTER_BALL;HAS_MEASURE_0]);;
let MEASURABLE_AFF_GT_2_1_INTER_BALL=
prove(`!x:real^3 v:real^3 u:real^3 r:real. ~collinear {x,v,u}==> measurable (aff_gt {x} {v,u} INTER normball x r)`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[measurable;] THEN EXISTS_TAC`&0` THEN MRESA_TAC HAS_MEASURE_AFF_GT_1_2_INTER_BALL[`x:real^3`;`v:real^3`;`u:real^3`;`r:real`]);;
let XFAN_EQ_UNIONS_AFF_GE_1_2=
prove(`!x V E. xfan(x,V,E) =UNIONS {y | ?e. e IN E /\ y = aff_ge {x} e}`,
REWRITE_TAC[xfan;UNIONS;IN_ELIM_THM] THEN SET_TAC[]);;
let NEGLIGIBLE_XFAN=
prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool). FAN (x,V,E) ==> negligible (xfan (x,V,E))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[XFAN_EQ_UNIONS_AFF_GE_1_2] THEN MATCH_MP_TAC NEGLIGIBLE_UNIONS THEN MRESAL_TAC set_edges_is_finite_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`][IN_ELIM_THM] THEN MRESAL_TAC FINITE_IMAGE[`(\e:real^3->bool. aff_ge {x:real^3} e)`;`E:(real^3->bool)->bool`][IMAGE;] THEN REPEAT STRIP_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 REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "EM") THEN STRIP_TAC THEN REMOVE_THEN "EM" 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 ASM_MESON_TAC[NEGLIGIBLE_AFF_GE_1_2]);;
let NEGLIGIBLE_XFAN_INTER_BALL=
prove(`!x:real^3 V:real^3->bool (E:(real^3->bool)->bool) r:real. FAN (x,V,E) ==> negligible (xfan (x,V,E) INTER normball x r)`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC`xfan ((x:real^3),(V:real^3->bool),(E:(real^3->bool)->bool))` THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[NEGLIGIBLE_XFAN;SET_RULE`xfan (x,V,E) INTER normball x r SUBSET xfan (x,V,E)`]);;
let MEASURE_XFAN=
prove(`!x:real^3 V E. FAN (x,V,E) ==> measure (xfan (x,V,E))= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_XFAN]);;
let HAS_MEASURE_XFAN=
prove(`!x:real^3 V E. FAN (x,V,E) ==> (xfan (x,V,E)) has_measure &0`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[NEGLIGIBLE_XFAN;HAS_MEASURE_0]);;
let MEASURE_XFAN_INTER_BALL=
prove(`!x:real^3 V E r. FAN (x,V,E) ==> measure (xfan (x,V,E) INTER normball x r)= &0`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURE_EQ_0 THEN ASM_SIMP_TAC[NEGLIGIBLE_XFAN_INTER_BALL]);;
let HAS_MEASURE_XFAN_INTER_BALL=
prove(`!x:real^3 V E r. FAN (x,V,E) ==> (xfan (x,V,E) INTER normball x r) has_measure &0`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[NEGLIGIBLE_XFAN_INTER_BALL;HAS_MEASURE_0]);;
let MEASURABLE_BALL_INTER_UNIV=
prove(`!x r. measurable ((:real^3) INTER normball x r)`,
REWRITE_TAC[SET_RULE`(:real^3) INTER (A:real^3->bool)=A`;GSYM ball_eq_normball;MEASURABLE_BALL]);;
let MEASURE_YFAN_INTER_BALL=
prove(`!x:real^3 V E r. FAN(x,V,E)/\ &0<= r ==> measure ( (yfan (x,V,E)) INTER normball x r)= &4/ &3 *pi *r pow 3`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;SET_RULE`((:real^3) DIFF xfan (x,V,E)) INTER normball x r= normball x r DIFF (xfan (x,V,E) INTER normball x r)`] THEN MRESAL_TAC HAS_MEASURE_XFAN_INTER_BALL[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` r:real`][HAS_MEASURE_MEASURABLE_MEASURE;GSYM ball_eq_normball] THEN MRESAL_TAC MEASURE_DIFF_SUBSET[`normball (x:real^3) (r:real)`;`(xfan ((x:real^3),V:real^3->bool,E) INTER normball x r)`][GSYM ball_eq_normball;MEASURABLE_BALL;SET_RULE`xfan (x,V,E) INTER ball (x,r) SUBSET ball (x,r)`;] THEN ASM_SIMP_TAC[VOLUME_BALL] THEN REAL_ARITH_TAC);;
let MESURABLE_YFAN_INTER_BALL=
prove(`!x:real^3 V E r. FAN(x,V,E)/\ &0<= r ==> measurable ( (yfan (x,V,E)) INTER normball x r)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;SET_RULE`((:real^3) DIFF xfan (x,V,E)) INTER normball x r= normball x r DIFF (xfan (x,V,E) INTER normball x r)`] THEN MRESAL_TAC HAS_MEASURE_XFAN_INTER_BALL[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` r:real`][HAS_MEASURE_MEASURABLE_MEASURE;GSYM ball_eq_normball] THEN MRESAL_TAC MEASURABLE_DIFF[`normball (x:real^3) (r:real)`;`(xfan ((x:real^3),V:real^3->bool,E) INTER normball x r)`][GSYM ball_eq_normball;MEASURABLE_BALL;SET_RULE`xfan (x,V,E) INTER ball (x,r) SUBSET ball (x,r)`;]);;
let RADIAL_DIFF=
prove(`!r v0 A B:real^N->bool. radial_norm r v0 A /\ radial_norm r v0 B /\ A SUBSET B ==> radial_norm r v0 (B DIFF A)`,
REWRITE_TAC[radial_norm] THEN REPEAT STRIP_TAC THENL[ ASM_TAC THEN SET_TAC[]; MP_TAC(SET_RULE`v0 + u:real^N IN B DIFF A==> v0 + u IN B /\ ~(v0 + u IN A)`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC `!u:real^N. v0 + u IN B ==> (!t. t > &0 /\ t * norm u < r ==> v0 + t % u IN B)` THEN DISCH_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC `u:real^N` th)) THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[th] THEN ASSUME_TAC th) THEN REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `t:real`) THEN FIND_ASSUM MP_TAC `!u:real^N. v0 + u IN A ==> (!t. t > &0 /\ t * norm u < r ==> v0 + t % u IN A)` THEN DISCH_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC `t% u:real^N` th)) THEN DISJ_CASES_TAC(SET_RULE`v0 + t % u IN A \/ ~(v0 + t % u:real^N IN A)`) THENL[POP_ASSUM (fun th-> REWRITE_TAC[th] THEN ASSUME_TAC th) THEN REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `inv t:real`) THEN POP_ASSUM MP_TAC THEN MP_TAC(REAL_ARITH`t> &0==> ~(t= &0) /\ &0<= t`) THEN RESA_TAC THEN MRESA1_TAC REAL_ABS_REFL`t:real` THEN MRESA1_TAC REAL_MUL_LINV`t:real` THEN MRESAL1_TAC REAL_LT_INV `t:real`[REAL_ARITH`&0<A <=> A> &0`;NORM_MUL; REAL_ARITH`A*B*C=(A*B)*C`;REAL_ARITH`&1 *A=A`;VECTOR_ARITH`A % B%C=(A*B)%C`;VECTOR_ARITH`&1 %A=A`] THEN MP_TAC(SET_RULE`B SUBSET normball v0 r /\ v0 + u:real^N IN B==> v0 + u IN normball v0 r`) THEN ASM_REWRITE_TAC[normball;IN_ELIM_THM;dist;VECTOR_ARITH`(A+B)-A=B:real^N`] THEN SET_TAC[]; ASM_TAC THEN SET_TAC[]]]);;
let RADIAL_UNION=
prove(`!r v0 A B:real^N->bool. radial_norm r v0 A /\ radial_norm r v0 B ==> radial_norm r v0 (A UNION B)`,
REWRITE_TAC[radial_norm;IN_UNION] THEN REPEAT STRIP_TAC THEN ASM_TAC THEN SET_TAC[]);;
let RADIAL_EMPTY=
prove(`!r v0:real^N. radial_norm r v0 {}`,
REWRITE_TAC[radial_norm;] THEN SET_TAC[]);;
let RADIAL_UNIONS=
prove(`!r v0 f:(real^N->bool)->bool. FINITE f /\ (!s. s IN f ==> radial_norm r v0 s) ==> (radial_norm r v0 (UNIONS f))`,
GEN_TAC THEN GEN_TAC THEN REWRITE_TAC[IMP_CONJ] THEN MATCH_MP_TAC FINITE_INDUCT_STRONG THEN SIMP_TAC[UNIONS_0; UNIONS_INSERT; RADIAL_EMPTY] THEN REWRITE_TAC[IN_INSERT] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC RADIAL_UNION THEN ASM_SIMP_TAC[]);;
let RADIAL_UNIV=
prove(`!r x. r> &0 ==> radial_norm r x ((:real^N) INTER normball x r)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[radial_norm] THEN REPEAT STRIP_TAC THENL [ SET_TAC[]; UNDISCH_TAC `(x:real^N) + u IN (:real^N) INTER normball x r` THEN ASM_SIMP_TAC[aff_normball;SET_RULE`(:real^N) INTER (A:real^N->bool)=A`]]);;
let RADIAL_AFF_GE_1_2 = 
prove(`!x u v r. (DISJOINT {(x:real^B)} {u,v} /\ (r > &0) ) ==> radial_norm r x (aff_ge {x} {u,v} INTER normball x r)`,
REWRITE_TAC[radial_norm] THEN REPEAT STRIP_TAC THENL[SET_TAC[]; UNDISCH_TAC `(x:real^B) + u' IN aff_ge {x} {u, v} INTER normball x r` THEN ASM_SIMP_TAC[AFF_GE_1_2] THEN REWRITE_TAC[IN_ELIM_THM;IN_INTER] THEN REPEAT STRIP_TAC THENL[EXISTS_TAC `&1 + (t:real) * t1 - t` THEN EXISTS_TAC `(t:real) * t2` THEN EXISTS_TAC `(t:real) * t3` THEN ASM_REWRITE_TAC[REAL_ARITH`(&1 + t * t1 - t) + t * t2 + t * t3 = &1 + t * (t1 + t2 +t3)-t `; REAL_ARITH`&1 + t * &1 - t = &1`;VECTOR_ARITH`(&1 + t * t1 - t) % x + (t * t2) % u + (t * t3) % v=x + t % (t1 % x + t2 % u + t3 % v) - t %x`;] THEN MP_TAC(REAL_ARITH`t> &0 ==> &0<= t`) THEN RESA_TAC THEN SUBGOAL_THEN `&0 <= t * t2 /\ &0 <= t * t3` (fun t -> REWRITE_TAC[t]) THENL[ ASM_MESON_TAC[REAL_LE_MUL]; REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN VECTOR_ARITH_TAC]; MATCH_MP_TAC aff_normball THEN ASM_REWRITE_TAC[]]]);;
let RADIAL_AFF_GT_3_1 = 
prove_by_refinement(`!x u v w r. (DISJOINT {(x:real^B),u,v} {w} /\ (r > &0) ) ==> radial_norm r x (aff_gt {x,u,v} {w} INTER normball x r)`,
[ REWRITE_TAC[radial_norm]; REPEAT STRIP_TAC; SET_TAC[]; UNDISCH_TAC `(x:real^B) + u' IN aff_gt {x,u,v} {w} INTER normball x r`; ASM_SIMP_TAC[AFF_GT_3_1]; REWRITE_TAC[IN_ELIM_THM;IN_INTER]; REPEAT STRIP_TAC; EXISTS_TAC `&1 + (t:real) * t1 - t`; EXISTS_TAC `(t:real) * t2`; EXISTS_TAC `(t:real) * t3`; EXISTS_TAC `(t:real) * t4`; SUBGOAL_THEN `&0 < t * t4` (fun t -> REWRITE_TAC[t]); ASM_MESON_TAC[REAL_MUL_POS_LT;REAL_ARITH `r > &0 <=> &0 < r`]; CONJ_TAC; SUBGOAL_THEN `(&1 + t * t1 - t) + t * t2 + t * t3 + t * t4 = &1 - t + t * (t1 + t2 + t3 + t4)` (fun t-> ASM_REWRITE_TAC[t]); REAL_ARITH_TAC; REAL_ARITH_TAC; ONCE_REWRITE_TAC[ VECTOR_ARITH `( &1 + t * t1 - t) % (x:real^B) + (t * t2) % u + (t * t3) % v + (t * t4) % w = x - t % x + t % (t1 % x + t2 % u + t3 % v + t4 % w)`]; UNDISCH_TAC `(x:real^B) + u' = t1 % x + t2 % u + t3 % v + t4 % w`; DISCH_THEN(fun thm -> ONCE_REWRITE_TAC[GSYM thm]); VECTOR_ARITH_TAC; MATCH_MP_TAC aff_normball; ASM_REWRITE_TAC[]; ]);;
let RADIAL_INTERS=
prove(`!r v0 f:(real^N->bool)->bool. FINITE f /\ (!s. s IN f ==> radial_norm r v0 (s INTER normball v0 r))/\ r> &0 ==> (radial_norm r v0 (INTERS f INTER normball v0 r))`,
GEN_TAC THEN GEN_TAC THEN REWRITE_TAC[IMP_CONJ] THEN MATCH_MP_TAC FINITE_INDUCT_STRONG THEN SIMP_TAC[ INTERS_0; INTERS_INSERT;RADIAL_UNIV;FORALL_IN_CLAUSES] THEN REWRITE_TAC[IN_INSERT;SET_RULE`(x INTER INTERS f) INTER normball v0 r=(x INTER normball v0 r) INTER (INTERS f INTER normball v0 r)`] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC inter_radial THEN ASM_SIMP_TAC[]);;
let XFAN_INTER_BALL_UNIONS=
prove(`!x:real^N V E. xfan(x,V,E) INTER normball x r= UNIONS {y | ?e. e IN E /\ y = (aff_ge {x} e) INTER normball x r}`,
REPEAT GEN_TAC THEN REWRITE_TAC[XFAN_EQ_UNIONS_AFF_GE_1_2] THEN ONCE_REWRITE_TAC[ EXTENSION] THEN REWRITE_TAC[UNIONS; INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC `{x' | x' IN aff_ge {x} e /\ x' IN normball (x:real^N) (r:real)}` THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN RESA_TAC THEN EXISTS_TAC`e:real^N->bool` THEN ASM_REWRITE_TAC[]; STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN EXISTS_TAC `aff_ge {x:real^N} e ` THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC `e:real^N->bool` THEN ASM_REWRITE_TAC[]]);;
let RADIAL_XFAN_INTER_BALL=
prove(`!(x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) r. FAN (x,V,E) /\ r> &0 ==> radial_norm r x (xfan (x,V,E) INTER normball x r)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[XFAN_INTER_BALL_UNIONS] THEN MATCH_MP_TAC RADIAL_UNIONS THEN MRESAL_TAC set_edges_is_finite_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`][IN_ELIM_THM] THEN MRESAL_TAC FINITE_IMAGE[`(\e:real^3->bool. aff_ge {x:real^3} e INTER normball x r)`;`E:(real^3->bool)->bool`][IMAGE;] THEN REPEAT STRIP_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 REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "EM") THEN STRIP_TAC THEN REMOVE_THEN "EM" 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 ASM_MESON_TAC[RADIAL_AFF_GE_1_2]);;
let RADIAL_NORM_YFAN_INTER_BALL=
prove(`!x:real^3 V E r. FAN(x,V,E) /\ r> &0 ==> radial_norm r x ( (yfan (x,V,E)) INTER normball x r)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;SET_RULE`((:real^3) DIFF xfan (x,V,E)) INTER normball x r= ((:real^3) INTER normball x r) DIFF (xfan (x,V,E) INTER normball x r)`] THEN MRESA_TAC RADIAL_UNIV[`r:real`;`x:real^3`] THEN MRESA_TAC RADIAL_XFAN_INTER_BALL[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` r:real`] THEN MRESAL_TAC RADIAL_DIFF[`r:real`;`x:real^3`;`(xfan ((x:real^3),V:real^3->bool,E) INTER normball x r)`;`(:real^3) INTER normball (x:real^3) (r:real)`;][SET_RULE`xfan (x,V,E) INTER normball x r SUBSET (:real^3) INTER normball x r`;]);;
let SOLID_ANGLE_YFAN=
prove(`!x:real^3 V E. FAN (x,V,E) ==> sol x (yfan (x,V,E))= &4 * pi`,
REPEAT STRIP_TAC THEN MRESAL_TAC RADIAL_NORM_YFAN_INTER_BALL[`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` &1:real`][REAL_ARITH`&1> &0`] THEN MRESAL_TAC MESURABLE_YFAN_INTER_BALL [`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` &1:real`][REAL_ARITH`&0<= &1`] THEN MRESAL_TAC MEASURE_YFAN_INTER_BALL [`x:real^3 `;`(V:real^3->bool) `;`(E:(real^3->bool)->bool)`;` &1:real`][REAL_ARITH`&0<= &1`] THEN MRESAL_TAC sol[`x:real^3`;`yfan(x:real^3,V:real^3->bool,E)`;`&1`][REAL_ARITH`&1> &0`] THEN REAL_ARITH_TAC);;
let SUM_SOL_IN_TOPOLOGICAL_COMPONENET_EQ_IN_FACE_SET=
prove(`!x:real^3 V E. FAN(x,V,E) /\ conforming_fan (x,V,E) ==> sum (topological_component_yfan (x,V,E)) (\f. sol x f) = sum (face_set (hypermap1_of_fanx (x,V,E))) (\f. sol x (dartset_leads_into_fan x V E f))`,
REWRITE_TAC[conforming_fan;conforming_bijection_fan;EXISTS_UNIQUE] THEN REPEAT STRIP_TAC THEN MRESA_TAC SUM_IMAGE[`(\f. (dartset_leads_into_fan x V E f))`;`(\f. sol x f)`;`(face_set (hypermap1_of_fanx (x:real^3,V,E)))`] THEN POP_ASSUM MP_TAC THEN SUBGOAL_THEN`(!x' y. x' IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN face_set (hypermap1_of_fanx (x,V,E)) /\ dartset_leads_into_fan x V E x' = dartset_leads_into_fan x V E y ==> x' = y)`ASSUME_TAC THENL[ REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "A") THEN REPEAT STRIP_TAC THEN MRESA_TAC dartset_leads_into_is_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`x':real^3#real^3#real^3#real^3->bool`] THEN REMOVE_THEN "A" (fun th-> MRESA1_TAC th`dartset_leads_into_fan (x:real^3) V E x'` ) THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3->bool` THEN MRESA1_TAC th`x':real^3#real^3#real^3#real^3->bool`); POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN REWRITE_TAC[FUN_EQ_THM;o_DEF;] THEN SUBGOAL_THEN`(IMAGE (\f. dartset_leads_into_fan x V E f) (face_set (hypermap1_of_fanx (x,V,E))))=topological_component_yfan (x,V,E)` ASSUME_TAC THENL[ ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[IMAGE;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[STRIP_TAC THEN ASM_SIMP_TAC[dartset_leads_into_is_topological_component_yfan]; REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "A") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "A" (fun th-> MRESA1_TAC th`x':real^3->bool` ) THEN EXISTS_TAC`f:real^3#real^3#real^3#real^3->bool` THEN ASM_REWRITE_TAC[]]; ASM_REWRITE_TAC[]]]);;
let SOL_EMPTY=
prove(`!x:real^3. sol x {} = &0`,
GEN_TAC THEN MRESAL_TAC sol[`x:real^3`;`{}:real^3->bool`;`&1`][REAL_ARITH`&1> &0`;SET_RULE`{} INTER normball x (&1)={}`;MEASURABLE_EMPTY;RADIAL_EMPTY;MEASURE_EMPTY] THEN REAL_ARITH_TAC);;
let SOL_DISJOINT_UNION =
prove(`!x:real^3 s t r. r > &0 /\ measurable (s INTER normball x r) /\ measurable (t INTER normball x r) /\ DISJOINT s t /\ radial_norm r x (s INTER normball x r) /\ radial_norm r x (t INTER normball x r) ==> sol x (s UNION t) = sol x s + sol x t`,
REPEAT STRIP_TAC THEN MRESAL_TAC MEASURABLE_UNION[`(s INTER normball x r):real^3->bool`;`(t INTER normball x r):real^3->bool`][SET_RULE`(s INTER normball x r) UNION (t INTER normball x r):real^3->bool=((s UNION t) INTER normball x r):real^3->bool`] THEN MP_TAC(SET_RULE`DISJOINT (s:real^3->bool) t ==>DISJOINT (s INTER normball x r) (t INTER normball x r)`) THEN RESA_TAC THEN MRESAL_TAC MEASURE_DISJOINT_UNION[`(s INTER normball x r):real^3->bool`;`(t INTER normball x r):real^3->bool`][SET_RULE`(s INTER normball x r) UNION (t INTER normball x r):real^3->bool=((s UNION t) INTER normball x r):real^3->bool`] THEN MRESAL_TAC RADIAL_UNION[`r:real`;`x:real^3`;`(s INTER normball x r):real^3->bool`;`(t INTER normball x r):real^3->bool`][SET_RULE`(s INTER normball x r) UNION (t INTER normball x r):real^3->bool=((s UNION t) INTER normball x r):real^3->bool`] THEN MRESA_TAC sol[`x:real^3`;`s:real^3->bool`;`r:real`] THEN MRESA_TAC sol[`x:real^3`;`t:real^3->bool`;`r:real`] THEN MRESA_TAC sol[`x:real^3`;`s UNION t:real^3->bool`;`r:real`] THEN REAL_ARITH_TAC);;
let UNIONS_INTER=
prove(`!f t:A->bool. UNIONS f INTER t= UNIONS {s INTER t| s IN f}`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[UNIONS;INTER;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC`{x | x IN u /\ x IN t}:A->bool` THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`u :A->bool` THEN ASM_REWRITE_TAC[]; STRIP_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN EXISTS_TAC`s :A->bool` THEN ASM_REWRITE_TAC[]]);;
let UNIONS_INTER1=
prove(`!f t:A->bool. UNIONS f INTER t= UNIONS {y | ?s. s IN f /\ y = s INTER t}`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[UNIONS;INTER;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC`{x | x IN u /\ x IN t}:A->bool` THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN EXISTS_TAC`u :A->bool` THEN ASM_REWRITE_TAC[]; STRIP_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN EXISTS_TAC`s :A->bool` THEN ASM_REWRITE_TAC[]]);;
let MEASURABLE_UNIONS = 
prove (`!f:(real^N->bool)->bool. FINITE f /\ (!s. s IN f ==> measurable s) ==> measurable (UNIONS f)`,
REWRITE_TAC[IMP_CONJ] THEN MATCH_MP_TAC FINITE_INDUCT_STRONG THEN SIMP_TAC[UNIONS_0; UNIONS_INSERT; MEASURABLE_EMPTY] THEN REWRITE_TAC[IN_INSERT] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURABLE_UNION THEN ASM_SIMP_TAC[]);;
let SOL_UNIONS=
prove(`!r x f:(real^3->bool)->bool. FINITE f /\ r> &0 /\ (!s. s IN f ==> measurable (s INTER normball x r) /\ radial_norm r x (s INTER normball x r)) /\ (!s t. s IN f /\ t IN f /\ ~(s = t) ==> DISJOINT s t) ==> sol x (UNIONS f) = sum f (\s. sol x s)`,
GEN_TAC THEN GEN_TAC THEN REWRITE_TAC[IMP_CONJ] THEN MATCH_MP_TAC FINITE_INDUCT_STRONG THEN SIMP_TAC[UNIONS_0; UNIONS_INSERT; SOL_EMPTY;SUM_CLAUSES] THEN REWRITE_TAC[IN_INSERT] THEN REPEAT STRIP_TAC THEN ASM_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN ASM_REWRITE_TAC[SET_RULE`(!s. P s \/ Q s==> C s)<=> (!s. P s ==> C s) /\ (!s. Q s ==> C s)`;SET_RULE`(!s. P s /\ Q s) <=> (!s. P s) /\ (!s. Q s)`; SET_RULE`(!s. E s ==> P s \/ Q s==> C s)<=> (!s. E s==> P s ==> C s) /\ (!s. E s ==> Q s ==> C s)`] THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN MATCH_MP_TAC SOL_DISJOINT_UNION THEN EXISTS_TAC`r:real` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM (fun th-> MP_TAC (SPEC `x':real^3->bool` th))`!s:real^3->bool. s = x' ==> measurable (s INTER normball x r) /\ radial_norm r x (s INTER normball x r)` THEN REWRITE_TAC[] THEN DISCH_TAC THEN ASM_SIMP_TAC[UNIONS_INTER1] THEN MRESAL_TAC FINITE_IMAGE[`(\s:real^3->bool. s INTER normball x r)`;`f:(real^3->bool)->bool`][IMAGE;] THEN FIND_ASSUM MP_TAC`!s:real^3->bool. s IN f ==> measurable (s INTER normball x r) /\ radial_norm r x (s INTER normball x r)` THEN REWRITE_TAC[SET_RULE`(!s. P s==> Q s /\ Q1 s)<=>(!s. P s==> Q s )/\ (!s. P s==> Q1 s)`] THEN STRIP_TAC THEN MRESAL_TAC RADIAL_UNIONS[`r:real`;`x:real^3`;`{y | ?s. s IN f /\ y = s INTER normball x r}:(real^3->bool)->bool`;][IN_ELIM_THM;SET_RULE`(!s. (?s'. s' IN f /\ s = P s') ==> Q s) <=> (!s. s IN f ==> Q (P s))` ] THEN MRESAL_TAC MEASURABLE_UNIONS[`{y | ?s. s IN f /\ y = s INTER normball x r}:(real^3->bool)->bool`;][IN_ELIM_THM;SET_RULE`(!s. (?s'. s' IN f /\ s = P s') ==> Q s) <=> (!s. s IN f ==> Q (P s))`;DISJOINT] THEN ONCE_REWRITE_TAC[SET_RULE`A INTER B= B INTER A`] THEN REWRITE_TAC[UNIONS_INTER1] 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-> MRESAL1_TAC th `x':real^3->bool`[SET_RULE` (!t. t IN f ==> ~(x' = t) ==> DISJOINT x' t) <=> (!t. t IN f /\ ~(x' = t) ==> DISJOINT x' t)`]) THEN FIND_ASSUM MP_TAC`~((x':real^3->bool) IN f)` THEN REWRITE_TAC[SET_RULE`~(x' IN f)<=> (!t. t IN f ==> ~(x' = t))`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` (!t. t IN f /\ ~(x' = t:real^3->bool) ==> DISJOINT x' t) /\ (!t. t IN f ==> ~(x' = t:real^3->bool))==> (!t. t IN f ==> DISJOINT x' t)`) THEN ASM_REWRITE_TAC[DISJOINT] THEN SET_TAC[]);;
let BOUNDED_INTER_BALL=
prove(`!x:real^3 V E. FAN(x,V,E) /\ conforming_fan (x,V,E) ==>(!f. f IN topological_component_yfan (x,V,E) ==> bounded (f INTER normball x r)) `,
REPEAT STRIP_TAC THEN MATCH_MP_TAC BOUNDED_SUBSET THEN EXISTS_TAC`(normball x r):real^3->bool` THEN SIMP_TAC[GSYM ball_eq_normball;BOUNDED_BALL] THEN SET_TAC[]);;
let OPEN_AFF_GT_3_1=
prove(`!x v u w:real^3. (~coplanar {x,v,u,w}) ==> open (aff_gt {x,v,u} {w})`,
GEOM_ORIGIN_TAC `x:real^3` THEN REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN DISCH_TAC THEN MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,B,C}`] THEN DISCH_TAC THEN ASSUME_TAC th) THEN MRESAL_TAC coplanar_cross_dot[`vec 0:real^3`;`v:real^3`;`u:real^3`;`w:real^3`][VECTOR_ARITH`A- vec 0=A`] THEN MP_TAC (REAL_ARITH`~((v cross u) dot w = &0)==> &0< (v cross u) dot w \/ &0< --((v cross u) dot w)`) THEN RESA_TAC THENL[POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN DISCH_TAC THEN ASSUME_TAC th) THEN ASSUME_TAC th) THEN MRESAL_TAC aff_gt_3_1_rep_cross_dot[`(vec 0):real^3`;`v:real^3`;`u:real^3`;`w:real^3`][VECTOR_ARITH`A- vec 0=A`;] THEN REWRITE_TAC[REAL_ARITH`&0<A <=> A> &0`; OPEN_HALFSPACE_GT]; POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM DOT_LNEG] THEN ONCE_REWRITE_TAC[GSYM CROSS_SKEW] THEN ASM_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN REPEAT DISCH_TAC THEN MRESAL_TAC aff_gt_3_1_rep_cross_dot[`(vec 0):real^3`;`u:real^3`;`v:real^3`;`w:real^3`][VECTOR_ARITH`A- vec 0=A`;] THEN REWRITE_TAC[ REAL_ARITH`&0<A <=> A> &0`;OPEN_HALFSPACE_GT;] ]);;
let EQ_SET_THM=
prove(`!f' f.{(f:A->B) y| y IN f'}= {t|(?y. y IN f' /\ t = f y)}`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[IN_ELIM_THM]);;
let fully_surrounded_imp_aff_gt_3_1_of_dart_eq_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ y IN ds ==> aff_gt {x, pr2 y, pr3 y} {pr3 (f1_fan x V E y)} = aff_gt {x, pr2 y, pr3 y} {sigma_fan x V E (pr2 y) (pr3 y)}`,
REPEAT STRIP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y IN ds /\ ds SUBSET d1_fan(x,V,E)==> y IN d1_fan (x,V,E)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3;f1_fan] THEN ASM_SIMP_TAC[fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan]);;
let OPEN_TOPOLOGICAL_COMPONENT_YFAN=
prove(`!x:real^3 V E f. FAN(x,V,E) /\ conforming_fan (x,V,E)/\ f IN topological_component_yfan (x,V,E) ==> open f`,
REWRITE_TAC[conforming_fan;conforming_bijection_fan;conforming_half_space_fan] 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"EM") THEN DISCH_THEN(LABEL_TAC"YEU") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" (fun th-> MRESAL1_TAC th`f:real^3->bool`[EXISTS_UNIQUE]) THEN REMOVE_THEN "YEU" (fun th-> MRESA1_TAC th`f':real^3#real^3#real^3#real^3->bool`) THEN MATCH_MP_TAC OPEN_INTERS THEN ASM_REWRITE_TAC[IN_ELIM_THM;] THEN MRESA_TAC FINITE_FACE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`] THEN MRESAL_TAC FINITE_IMAGE[`(\y:real^3#real^3#real^3#real^3. aff_gt {x:real^3, pr2 y, pr3 y} {pr3 (f1_fan x V E y)})`;`f':real^3#real^3#real^3#real^3->bool`][IMAGE;EQ_SET_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_dart_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`] THEN MATCH_MP_TAC OPEN_AFF_GT_3_1 THEN MRESA_TAC properties_of_elements_in_face_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] 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 [`(pr2 y):real^3`;`(pr3 y):real^3`] ) THEN MRESA_TAC sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(pr3 y):real^3`] THEN POP_ASSUM MP_TAC THEN MRESA_TAC properties_of_set_of_edge_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(pr3 y):real^3`] THEN DISCH_TAC THEN MRESA_TAC properties_of_set_of_edge_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(sigma_fan x V E (pr2 y) (pr3 y)):real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(sigma_fan x V E (pr2 y) (pr3 y)):real^3`;`(pr2 y):real^3`;`(pr3 y):real^3`;] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN ASM_REWRITE_TAC[]);;
let OPEN_TOPOLOGICAL_COMPONENT_YFAN_INTER_BALL=
prove(`!x:real^3 V E f. FAN(x,V,E) /\ conforming_fan (x,V,E)/\ f IN topological_component_yfan (x,V,E) ==> open (f INTER normball x r)`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC OPEN_INTER THEN ASM_SIMP_TAC[GSYM ball_eq_normball;OPEN_BALL;] THEN ASM_MESON_TAC[OPEN_TOPOLOGICAL_COMPONENT_YFAN]);;
let MEASURABLE_TOPOLOGICAL_COMPONENT_YFAN_INTER_BALL=
prove(`!x:real^3 V E r f. FAN(x,V,E) /\ conforming_fan (x,V,E) /\ f IN topological_component_yfan (x,V,E) ==> measurable (f INTER normball x r) `,
REPEAT STRIP_TAC THEN MATCH_MP_TAC MEASURABLE_OPEN THEN ASM_MESON_TAC[OPEN_TOPOLOGICAL_COMPONENT_YFAN_INTER_BALL;BOUNDED_INTER_BALL]);;
let RADIAL_TOPOLOGICAL_COMPONENT_YFAN=
prove(`!x:real^3 V E r f. FAN(x,V,E) /\ r> &0 /\ conforming_fan (x,V,E) /\ f IN topological_component_yfan (x,V,E) ==> radial_norm r x (f INTER normball x r) `,
REWRITE_TAC[conforming_fan;conforming_bijection_fan;conforming_half_space_fan] 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"EM") THEN DISCH_THEN(LABEL_TAC"YEU") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" (fun th-> MRESAL1_TAC th`f:real^3->bool`[EXISTS_UNIQUE]) THEN REMOVE_THEN "YEU" (fun th-> MRESA1_TAC th`f':real^3#real^3#real^3#real^3->bool`) THEN MATCH_MP_TAC RADIAL_INTERS THEN ASM_REWRITE_TAC[IN_ELIM_THM;] THEN MRESA_TAC FINITE_FACE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`] THEN MRESAL_TAC FINITE_IMAGE[`(\y:real^3#real^3#real^3#real^3. aff_gt {x:real^3, pr2 y, pr3 y} {pr3 (f1_fan x V E y)})`;`f':real^3#real^3#real^3#real^3->bool`][IMAGE;EQ_SET_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_dart_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`] THEN MATCH_MP_TAC RADIAL_AFF_GT_3_1 THEN ASM_REWRITE_TAC[] THEN MRESA_TAC properties_of_elements_in_face_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f':real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] 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 [`(pr2 y):real^3`;`(pr3 y):real^3`] ) THEN MRESA_TAC sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(pr3 y):real^3`] THEN POP_ASSUM MP_TAC THEN MRESA_TAC properties_of_set_of_edge_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(pr3 y):real^3`] THEN DISCH_TAC THEN MRESA_TAC properties_of_set_of_edge_fan [`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`(pr2 y):real^3`;`(sigma_fan x V E (pr2 y) (pr3 y)):real^3`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(sigma_fan x V E (pr2 y) (pr3 y)):real^3`;`(pr2 y):real^3`;`(pr3 y):real^3`;] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[notcoplanar_disjoints]);;
let FINITE_TOPOLOGICAL_COMPONENT_YFAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ fan80(x,V,E) ==> FINITE (topological_component_yfan (x,V,E))`,
REPEAT STRIP_TAC THEN MRESA1_TAC FINITE_HYPERMAP_ORBITS`hypermap1_of_fanx (x:real^3,V,E)` THEN MRESAL_TAC FINITE_IMAGE[`(\f:real^3#real^3#real^3#real^3->bool. dartset_leads_into_fan x V E f)`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`][IMAGE;] THEN POP_ASSUM MP_TAC THEN SUBGOAL_THEN`{y | ?f. f IN face_set (hypermap1_of_fanx (x,V,E)) /\ y = dartset_leads_into_fan x V E f} =topological_component_yfan (x:real^3,V,E)` (fun th-> REWRITE_TAC[th]) THEN ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN ASM_SIMP_TAC[dartset_leads_into_is_topological_component_yfan]; REPEAT STRIP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`A=B<=> B=A`] THEN ASM_SIMP_TAC[version_JUTSTKG]]);;
let SUM_SOL_TOPOLOGICAL_COMPONENT_YFAN_EQ_SOL_UNIONS=
prove(`!x:real^3 V E. FAN(x,V,E) /\ conforming_fan (x,V,E) ==> sol x (UNIONS (topological_component_yfan (x,V,E)))=sum (topological_component_yfan (x,V,E)) (\f. sol x f)`,
REPEAT STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN REWRITE_TAC[conforming_fan]; THEN ASSUME_TAC th THEN STRIP_TAC) THEN MATCH_MP_TAC SOL_UNIONS THEN MRESAL_TAC FINITE_TOPOLOGICAL_COMPONENT_YFAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;][SET_RULE`(!s. P s==> Q s /\ R s)<=>(!s. P s==> Q s) /\(!s. P s==> R s)`] THEN EXISTS_TAC`&1` THEN MRESAL_TAC RADIAL_TOPOLOGICAL_COMPONENT_YFAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`&1:real`][REAL_ARITH`&1> &0`] THEN MRESA_TAC MEASURABLE_TOPOLOGICAL_COMPONENT_YFAN_INTER_BALL[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`&1:real`] THEN REWRITE_TAC[topological_component_yfan;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[DISJOINT;CONNECTED_COMPONENT_NONOVERLAP]);;
let UNIONS_TOPOLOGICAL_COMPONENT_EQ_YFAN=
prove(`!x:real^3 V E. UNIONS (topological_component_yfan (x,V,E))= yfan(x,V,E)`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[UNIONS;topological_component_yfan;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MATCH_MP_TAC(SET_RULE`!x B A. x IN B /\ B SUBSET A==> x IN A`) THEN EXISTS_TAC`connected_component (yfan (x:real^3,V:real^3->bool,E)) (y:real^3)` THEN ASM_REWRITE_TAC[CONNECTED_COMPONENT_SUBSET]; STRIP_TAC THEN EXISTS_TAC`connected_component (yfan (x,V:real^3->bool,E)) x'` THEN STRIP_TAC THENL[EXISTS_TAC`x':real^3` THEN ASM_REWRITE_TAC[]; ASM_REWRITE_TAC[IN;CONNECTED_COMPONENT_REFL_EQ]]]);;
let SUM_SOL_IN_FACE_SET_EQ_4PI=
prove(`!x:real^3 V E. FAN(x,V,E) /\ conforming_fan (x,V,E) ==> sum (face_set (hypermap1_of_fanx (x,V,E))) (\f. sol x (dartset_leads_into_fan x V E f))= &4 * pi`,
REPEAT STRIP_TAC THEN MRESA_TAC SUM_SOL_IN_TOPOLOGICAL_COMPONENET_EQ_IN_FACE_SET[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SUM_SOL_TOPOLOGICAL_COMPONENT_YFAN_EQ_SOL_UNIONS[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;UNIONS_TOPOLOGICAL_COMPONENT_EQ_YFAN]) THEN ASM_SIMP_TAC[SOLID_ANGLE_YFAN]);;
let DART_EQ_UNIONS_FACE_SET_NODE_SET_EDGE_SET=
prove(`!(H:(A)hypermap). dart H = UNIONS (face_set H)/\ dart H = UNIONS (node_set H)/\ dart H = UNIONS (edge_set H)`,
GEN_TAC THEN REWRITE_TAC[face_set;node_set;edge_set] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC lemma_partition THEN REWRITE_TAC[hypermap_lemma]);;
let FINITE_NODE_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. ds IN node_set(hypermap1_of_fanx (x,V,E)) ==> FINITE ds `,
REWRITE_TAC[node_set;set_of_orbits;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[GSYM node;NODE_FINITE]);;
let lemma_properties_of_node_set_fan=
prove(`!x V E f y y1. FAN (x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1)/\ f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ y IN f /\ y1 IN f ==> pr2 y = pr2 y1 `,
REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[orbit_map;IN_ELIM_THM;] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`;] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`x':real^3#real^3#real^3#real^3`) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n':num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`;] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`x':real^3#real^3#real^3#real^3`) THEN FIND_ASSUM MP_TAC `x' IN d1_fan (x:real^3,V,E)` THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN MRESA_TAC power_n_fan[`n:num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN MRESA_TAC power_n_fan[`n':num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[pr2]);;
let lemma_node_identity_fan=
prove(`!x V E f y. f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ y IN f ==> f= node (hypermap1_of_fanx (x,V,E)) y`,
REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[node] THEN MESON_TAC[lemma_orbit_identity; hypermap_lemma]);;
let node_subset_dart_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. FAN(x,V,E) /\ ds IN node_set(hypermap1_of_fanx (x,V,E)) ==> ds SUBSET d_fan (x,V,E)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN MRESA_TAC lemma_node_representation[`hypermap1_of_fanx(x:real^3,V,E)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC lemma_node_subset[`hypermap1_of_fanx(x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`]);;
let rep_node_set_fan=
prove(`!x V E f y. FAN (x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ y IN f ==> f = {z| ?i. i >= 0 /\ z=(x, pr2 y,power_map_points (sigma_fan) x V E (pr2 y) (pr3 y) i, power_map_points (sigma_fan) x V E (pr2 y) (pr3 y) (SUC i))}`,
REPEAT STRIP_TAC THEN ASM_SIMP_TAC[lemma_node_identity_fan;] THEN REWRITE_TAC[node;orbit_map;EXTENSION;IN_ELIM_THM] THEN MRESA_TAC node_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MP_TAC(SET_RULE`y IN (f:real^3#real^3#real^3#real^3->bool) /\ f SUBSET d_fan(x,V,E)==> y IN d_fan(x,V,E)`) THEN RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN ASSUME_TAC th) THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN GEN_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`;] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN MRESA_TAC power_n_fan[`n:num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN RESA_TAC THEN EXISTS_TAC`n:num` THEN ASM_SIMP_TAC[]; REPEAT STRIP_TAC THEN EXISTS_TAC`i:num` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`i:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`;] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN MRESA_TAC power_n_fan[`i:num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN RESA_TAC]);;
let properties_of_elements_in_node_fully_surroundedfan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) /\ ds IN node_set(hypermap1_of_fanx (x,V,E)) /\ y IN ds ==> {pr2 y, pr3 y} IN E`,
REPEAT GEN_TAC THEN STRIP_TAC THEN MRESA_TAC node_subset_dart_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y IN ds /\ ds SUBSET d_fan (x,V,E)==> y IN d_fan (x,V,E)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3]);;
let lemma_card_node_eq_set_of_orbits=
prove(`!x V E f y. FAN (x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ y IN f ==> CARD {z| ?i. i >= 0 /\ z=(x, pr2 y,power_map_points (sigma_fan) x V E (pr2 y) (pr3 y) i, power_map_points (sigma_fan) x V E (pr2 y) (pr3 y) (SUC i))}= CARD( set_of_orbits_points_fan (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) ((pr2 y):real^3) ((pr3 y):real^3) )`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC BIJECTIONS_CARD_EQ THEN EXISTS_TAC`pr3:real^3#real^3#real^3#real^3->real^3` THEN EXISTS_TAC`(\z:real^3. x,pr2 y, z, sigma_fan x V E (pr2 y) z)` THEN MRESA_TAC properties_of_elements_in_node_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MP_TAC (ISPECL[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`(pr2 y):real^3`;` ((pr3 y):real^3)`]FINITE_ORBITS_SIGMA_FAN) THEN RESA_TAC THEN REWRITE_TAC[set_of_orbits_points_fan;IN_ELIM_THM; pr3] THEN REWRITE_TAC[GSYM pr3] THEN STRIP_TAC THENL[ STRIP_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[ARITH_RULE`0<= i <=> i>=0`;pr3;power_map_points] THEN EXISTS_TAC`i:num` THEN ASM_REWRITE_TAC[]; STRIP_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[ARITH_RULE`i>=0 <=> 0<=i`;power_map_points] THEN EXISTS_TAC`i:num` THEN ASM_REWRITE_TAC[]]);;
let lemma_card_node_eq_set_of_edge=
prove(`!x V E f y. FAN (x,V,E) /\ f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ y IN f ==> CARD (set_of_edge (pr2 y) V E)=CARD f `,
REPEAT STRIP_TAC THEN MRESA_TAC rep_node_set_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC lemma_card_node_eq_set_of_orbits[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC properties_of_elements_in_node_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC CARD_SET_OF_ORBITS_POINTS_FAN[`(x:real^3)`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`(pr2 y):real^3`;` ((pr3 y):real^3)`]);;
let mono_cyclic_power_sigma_fan=
prove(`!x V E v u i j. FAN(x,V,E)/\ {v,u} IN E /\ i IN 0..CARD (set_of_edge (v) V E) - 1 /\ j IN 0..CARD (set_of_edge (v) V E) - 1 /\ power_map_points sigma_fan x V E (v) (u) i = power_map_points sigma_fan x V E (v) (u) j ==> i = j`,
REWRITE_TAC[IN_NUMSEG_0] THEN REPEAT STRIP_TAC THEN DISJ_CASES_TAC(ARITH_RULE`i=j \/ i< j\/ j< i:num`) THENL[ ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN STRIP_TAC THENL[ MP_TAC(SPECL[`(x:real^3)`;` (V:real^3->bool)`; ` (E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;`j:num`;`i:num`]cyclic_power_sigma_fan) THEN RESA_TAC THEN ASM_TAC THEN ARITH_TAC; MP_TAC(SPECL[`(x:real^3)`;` (V:real^3->bool)`; ` (E:(real^3->bool)->bool)`;` (v:real^3)`;` (u:real^3)`;`i:num`;`j:num`]cyclic_power_sigma_fan) THEN RESA_TAC THEN ASM_TAC THEN ARITH_TAC]]);;
let SUM_AZIM_FAN_OF_NODE_EQ_SUM_AZIM_I_FAN=
prove(`!x V E f y. FAN (x,V,E) /\ f IN node_set (hypermap1_of_fanx (x,V,E)) /\ y IN f /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) ==> sum (0..CARD (set_of_edge (pr2 y) V E) - 1) (\i. azim_i_fan x V E (pr2 y) (pr3 y) i) = sum f (\y1. azim_fan x V E (pr2 y1) (pr3 y1))`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "EM") THEN MRESA_TAC rep_node_set_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN SUBGOAL_THEN`(!x' y1. x' IN set_of_orbits_points_fan x V E (pr2 y) (pr3 y) /\ y1 IN set_of_orbits_points_fan x V E (pr2 y) (pr3 y) /\ x,pr2 y,x',sigma_fan x V E (pr2 y) x' = x,pr2 y,y1,sigma_fan x V E (pr2 y) y1 ==> x' = y1)`ASSUME_TAC THENL[MESON_TAC[EQ_PAIR_4]; MRESAL_TAC SUM_IMAGE[`(\z:real^3. x,pr2 y, z, sigma_fan x V E (pr2 y) z)`;`(\y. azim_fan x V E (pr2 y) (pr3 y))`;`set_of_orbits_points_fan (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) ((pr2 y):real^3) ((pr3 y):real^3)`][IMAGE] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[set_of_orbits_points_fan] THEN REWRITE_TAC[IN_ELIM_THM;SET_RULE`{y' | ?x'. (?i. 0 <= i /\ x' = power_map_points sigma_fan x V E (pr2 y) (pr3 y) i) /\ y' = x,pr2 y,x',sigma_fan x V E (pr2 y) x'} = {y' | ?i. 0 <= i /\ y' = x,pr2 y,power_map_points sigma_fan x V E (pr2 y) (pr3 y) i,sigma_fan x V E (pr2 y) (power_map_points sigma_fan x V E (pr2 y) (pr3 y) i)}`;power_map_points;ARITH_RULE`i>= 0<=> 0<= i`] THEN RESA_TAC THEN REWRITE_TAC[o_DEF;pr2;pr3] THEN ASM_REWRITE_TAC[GSYM pr2; GSYM pr3;azim_fan;azim_i_fan] THEN MRESA_TAC properties_of_elements_in_node_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` ((pr3 y):real^3)`;` ((pr2 y):real^3)`] THEN REMOVE_ASSUM_TAC THEN USE_THEN "EM"(fun th-> MP_TAC(ISPEC `(pr2 y):real^3` th) THEN POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN RESA_TAC) THEN MRESA_TAC SIMP_ORBITS_POINTS_FAN[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` ((pr2 y):real^3)`;` ((pr3 y):real^3)`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MP_TAC(SPECL[`(x:real^3)`;` (V:real^3->bool)`; ` (E:(real^3->bool)->bool)`;` ((pr2 y):real^3)`;` ((pr3 y):real^3)`]mono_cyclic_power_sigma_fan ) THEN RESA_TAC THEN MRESAL_TAC SUM_IMAGE[`(\i:num. power_map_points sigma_fan x V E (pr2 y) (pr3 y) i)`;`(\x'. azim x (pr2 y) x' (sigma_fan x V E (pr2 y) x'))`;`0..CARD (set_of_edge (pr2 y) (V:real^3->bool) E) - 1`][IMAGE;o_DEF;power_map_points] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;IN_NUMSEG_0]) THEN MP_TAC(ARITH_RULE`CARD (set_of_edge (pr2 y) V E) > 1==> (!i. i <= CARD (set_of_edge (pr2 y) V E) - 1<=> i < CARD (set_of_edge (pr2 y) V E)) `) THEN RESA_TAC THEN SUBGOAL_THEN`{y1 | ?i. i < CARD (set_of_edge (pr2 y) V E) /\ y1 = power_map_points sigma_fan x V E (pr2 y) (pr3 y) i} = {power_map_points sigma_fan x V E (pr2 y) (pr3 y) i | i | i < CARD (set_of_edge (pr2 y) V E)} `(fun th-> REWRITE_TAC[th]) THEN REWRITE_TAC[EXTENSION;IN_ELIM_THM]]);;
let exists_point_in_node=
prove(`!x V E f. f IN node_set (hypermap1_of_fanx (x,V,E)) ==> ?y. y IN f`,
REWRITE_TAC[node_set;set_of_orbits;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`x':real^3#real^3#real^3#real^3` THEN EXISTS_TAC`0` THEN REWRITE_TAC[POWER;ARITH_RULE`0>=0`;I_DEF]);;
let SUM_AZIM_FAN_OF_NODE_EQ_2PI_I_FAN=
prove(`!x V E f. FAN (x,V,E) /\ f IN node_set (hypermap1_of_fanx (x,V,E)) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) ==> sum f (\y. azim_fan x V E (pr2 y) (pr3 y))= &2 * pi`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC exists_point_in_node[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;] THEN MRESA_TAC SUM_AZIM_FAN_OF_NODE_EQ_SUM_AZIM_I_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;]) THEN SUBGOAL_THEN`(\i. azim_i_fan x V E (pr2 y) (pr3 y) i)= azim_i_fan x V E (pr2 y) (pr3 y) `(fun th-> REWRITE_TAC[th]) THEN REWRITE_TAC[FUN_EQ_THM] THEN MATCH_MP_TAC SUM_AZIMS_EQ_2PI_FAN THEN ASM_REWRITE_TAC[] THEN MRESA_TAC properties_of_elements_in_node_fully_surroundedfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`; `y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` ((pr3 y):real^3)`;` ((pr2 y):real^3)`] THEN REMOVE_ASSUM_TAC THEN USE_THEN "EM"(fun th-> MP_TAC(ISPEC `(pr2 y):real^3` th) THEN POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN RESA_TAC) THEN ASM_REWRITE_TAC[ARITH_RULE`1<A<=> A>1`] THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge (pr2 y) V E = {(pr3 y):real^3})\/ ~(set_of_edge (pr2 y) V E = {pr3 y})`) THENL[ MRESA_TAC CARD_SING[`(pr3 y):real^3`; `(set_of_edge (pr2 y) V E):real^3->bool`] THEN FIND_ASSUM MP_TAC `CARD ((set_of_edge (pr2 y) V E):real^3->bool) >1` THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun TH-> REWRITE_TAC[TH]) THEN ARITH_TAC; ASM_REWRITE_TAC[]]);;
let SUM_CARD_FACE_NODE_DART_FAN=
prove(`!x V E. FAN (x,V,E) /\ conforming_fan (x,V,E) ==> &2 * &(CARD (face_set (hypermap1_of_fanx (x,V,E)))) + &2 * &(CARD (node_set (hypermap1_of_fanx (x,V,E)))) - &(CARD (dart (hypermap1_of_fanx (x,V,E)))) = &4 `,
REPEAT STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN REWRITE_TAC[conforming_fan;conforming_solid_angle_fan] THEN CONV_TAC(TOP_DEPTH_CONV let_CONV) THEN REWRITE_TAC[SET_RULE`(!s. P s ==> Q s /\ Q1 s/\ Q2 s) <=> (!s. P s ==> Q s ) /\ (!s. P s ==> Q1 s) /\ (!s. P s ==> Q2 s)`] THEN ASSUME_TAC th THEN STRIP_TAC) THEN MRESA_TAC SUM_SOL_IN_FACE_SET_EQ_4PI[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN POP_ASSUM MP_TAC THEN MRESA_TAC SUM_EQ[`(\f. sol x (dartset_leads_into_fan (x:real^3) V E f))`;`(\f. (&2 * pi + sum f (\y. azim_fan x V E (pr2 y) (pr3 (y:real^3#real^3#real^3#real^3)) - pi)))`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN MRESA1_TAC FINITE_HYPERMAP_ORBITS`hypermap1_of_fanx (x:real^3,V,E)` THEN MRESA_TAC SUM_ADD[`(\f:real^3#real^3#real^3#real^3->bool. &2 * pi)`;`(\f. sum f (\y. azim_fan x V E (pr2 y) (pr3 (y:real^3#real^3#real^3#real^3)) - pi))`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN MRESA_TAC SUM_CONST[`&2 * pi`;`face_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN MRESA_TAC FINITE_FACE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;] THEN SUBGOAL_THEN`(!t1 t2 y. t1 IN face_set (hypermap1_of_fanx (x,V,E)) /\ t2 IN face_set (hypermap1_of_fanx (x,V,E)) /\ ~(t1 = t2) /\ y IN t1 /\ y IN t2 ==> azim_fan x V E (pr2 y) (pr3 y) - pi = &0)` ASSUME_TAC THENL[ REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (LABEL_TAC "EM") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" MP_TAC THEN MRESAL_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][face] THEN MRESAL_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x'':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][face]; MRESA_TAC SUM_UNIONS_NONZERO[` (\y. azim_fan x (V:real^3->bool) E (pr2 y) (pr3 (y:real^3#real^3#real^3#real^3)) - pi)`;`face_set (hypermap1_of_fanx (x:real^3,V:real^3->bool,E))`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SUM_SUB[`(\y. azim_fan x V E (pr2 y) (pr3 (y:real^3#real^3#real^3#real^3)))`;`(\f:real^3#real^3#real^3#real^3. pi)`;`(UNIONS (node_set (hypermap1_of_fanx (x:real^3,V,E))))`] THEN POP_ASSUM MP_TAC THEN MRESA1_TAC DART_EQ_UNIONS_FACE_SET_NODE_SET_EDGE_SET`(hypermap1_of_fanx (x:real^3,V:real^3->bool,E))` THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA_TAC SUM_CONST[`pi`;`(UNIONS (node_set (hypermap1_of_fanx (x:real^3,V,E))))`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[SYM th;hypermap_lemma] THEN STRIP_TAC THEN POP_ASSUM (fun th -> REWRITE_TAC[th]) THEN REWRITE_TAC[th] THEN MP_TAC th THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASSUME_TAC th THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "MA")) THEN RESA_TAC THEN SUBGOAL_THEN`(!t1 t2 y. t1 IN node_set (hypermap1_of_fanx (x,V,E)) /\ t2 IN node_set (hypermap1_of_fanx (x,V,E)) /\ ~(t1 = t2) /\ y IN t1 /\ y IN t2 ==> azim_fan x V E (pr2 y) (pr3 y) = &0)` ASSUME_TAC THENL[ REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (LABEL_TAC "EM") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "EM" MP_TAC THEN MRESAL_TAC lemma_node_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][node] THEN MRESAL_TAC lemma_node_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x'':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][node]; MRESAL_TAC SUM_UNIONS_NONZERO[` (\y. azim_fan x (V:real^3->bool) E (pr2 y) (pr3 (y:real^3#real^3#real^3#real^3)))`;`node_set (hypermap1_of_fanx (x:real^3,V:real^3->bool,E))`][FINITE_NODE_FAN] THEN MRESA_TAC SUM_AZIM_FAN_OF_NODE_EQ_2PI_I_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;] THEN MRESA_TAC SUM_EQ[`(\t:real^3#real^3#real^3#real^3->bool. sum t (\y. azim_fan x V E (pr2 y) (pr3 y)))`;`(\t:real^3#real^3#real^3#real^3->bool. &2 * pi)`;`(node_set (hypermap1_of_fanx (x:real^3,V,E)))`] THEN MRESA_TAC SUM_CONST[`&2 * pi`;`node_set (hypermap1_of_fanx (x:real^3,V,E))`] THEN REMOVE_THEN "MA"(fun th-> REWRITE_TAC[SYM th]) THEN RESA_TAC THEN ONCE_REWRITE_TAC[REAL_ARITH`A= A * &1`] THEN MP_TAC(REAL_ARITH`&0< pi==> ~(pi= &0)`) THEN ASM_REWRITE_TAC[PI_WORKS] THEN STRIP_TAC THEN MRESA1_TAC REAL_MUL_RINV`pi:real` THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th;REAL_ARITH`(A+B-C)*D*E=(A*D+B*D-C*D)*E/\ (A*B)*C=B*A*C`;]) THEN REAL_ARITH_TAC]]);;
let nonconformin_fan_imp_n_fan_ge0=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ~(conforming_fan (x,V,E)) ==> N_FAN(x,V,E)> 0`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[GSYM CONTRAPOS_THM] THEN ASM_SIMP_TAC[ARITH_RULE`~(A>0)<=> A=0`;DWFBRQY]);;
let nonconformin_fan_imp_exist_face_gt_3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ~(conforming_fan (x,V,E)) ==> ?ds. ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3`,
REPEAT STRIP_TAC THEN MRESA_TAC nonconformin_fan_imp_n_fan_ge0[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[N_FAN] THEN DISJ_CASES_TAC(SET_RULE`(!f. f IN face_set (hypermap1_of_fanx (x,V,E))==> CARD f -3=0)\/ ~(!f. f IN face_set (hypermap1_of_fanx (x:real^3,V,E))==> CARD f -3=0)`) THENL[ ASM_SIMP_TAC[NSUM_EQ_0] THEN ARITH_TAC; POP_ASSUM MP_TAC THEN REWRITE_TAC[NOT_FORALL_THM;NOT_IMP;ARITH_RULE`~(A=0)<=> A>0`] THEN REPEAT STRIP_TAC THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`] THEN EXISTS_TAC`f:real^3#real^3#real^3#real^3->bool` THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN ARITH_TAC]);;
let exists_face_in_face_set=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. ds IN face_set(hypermap1_of_fanx (x,V,E)) ==> ?f1. f1 IN ds `,
REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN EXISTS_TAC`x':real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[orbit_map;IN_ELIM_THM;] THEN EXISTS_TAC`0` THEN REWRITE_TAC[POWER;I_DEF;ARITH_RULE`0>=0`]);;
let exists_node_in_face_set=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. ds IN node_set(hypermap1_of_fanx (x,V,E)) ==> ?f1. f1 IN ds `,
REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN EXISTS_TAC`x':real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[orbit_map;IN_ELIM_THM;] THEN EXISTS_TAC`0` THEN REWRITE_TAC[POWER;I_DEF;ARITH_RULE`0>=0`]);;
let identity_face_in_face_set=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds f1. ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ f1 IN ds ==> ds= face (hypermap1_of_fanx (x,V,E)) f1 `,
REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_SIMP_TAC[GSYM face;] THEN MESON_TAC[lemma_face_identity]);;
let identity_node_in_face_set=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds f1. ds IN node_set(hypermap1_of_fanx (x,V,E)) /\ f1 IN ds ==> ds= node (hypermap1_of_fanx (x,V,E)) f1 `,
REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_SIMP_TAC[GSYM node;] THEN MESON_TAC[lemma_node_identity]);;
let condition_f1_eq_fan=
prove(`!x V E v u w. FAN(x,V,E) /\ {u,w} IN E /\ {v,u} IN E /\ sigma_fan x V E u w = v ==> f1_fan x V E (x,v,u,sigma_fan x V E v u)=(x,u,w,v)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN ASM_SIMP_TAC[INVERSE1_SIGMA_FAN]);;
let nonconformin_fan_imp_exist_3point_in_face=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 ==> ?f1 f2 f3. {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ {pr2 f2, pr2 f3} IN E /\ ~({pr2 f3, pr2 f1 } IN E) /\ {pr2 f1, pr2 f2 } IN E /\ sigma_fan x V E (pr2 f2) (pr2 f3)=pr2 f1 /\ pr2 f3= pr3 f2 /\ pr2 f2= pr3 f1`,
REPEAT STRIP_TAC THEN MRESA_TAC exists_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN ABBREV_TAC`f2=f1_fan x V E (f1:real^3#real^3#real^3#real^3)` THEN ABBREV_TAC`f3=f1_fan x V E (f2:real^3#real^3#real^3#real^3)` THEN ABBREV_TAC`f4=f1_fan x V E (f3:real^3#real^3#real^3#real^3)` THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"VUT") THEN MRESA_TAC condition_f1_fan_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f2:real^3#real^3#real^3#real^3)` ;`(f1:real^3#real^3#real^3#real^3)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC condition_f1_fan_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f3:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC condition_f1_fan_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f4:real^3#real^3#real^3#real^3)` ;`(f3:real^3#real^3#real^3#real^3)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`f1 IN ds /\ f2 IN ds /\ f3 IN ds /\ ds SUBSET d1_fan (x,V,E)==> {f1,f2,f3} SUBSET (ds:real^3#real^3#real^3#real^3->bool)/\ f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)`) THEN RESA_TAC THEN MRESA_TAC f_fan_no_fix_point[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(f1:real^3#real^3#real^3#real^3)` THEN MRESA1_TAC th`(f2:real^3#real^3#real^3#real^3)` THEN MRESA1_TAC th`(f3:real^3#real^3#real^3#real^3)`) THEN DISJ_CASES_TAC(SET_RULE`f3=f1 \/ ~(f3=f1:real^3#real^3#real^3#real^3)`) THENL(*1*)[ MP_TAC(SET_RULE`f1=f3:real^3#real^3#real^3#real^3==> pr2 f1= pr2 f3`) THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f3:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`] THEN REMOVE_ASSUM_TAC THEN MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f2:real^3#real^3#real^3#real^3)` ;`(f1:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` pr2 (f3:real^3#real^3#real^3#real^3)`; ` pr2 (f2:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN RESA_TAC THEN DISJ_CASES_TAC(SET_RULE`set_of_edge (pr2 (f2:real^3#real^3#real^3#real^3)) V E = {pr2 f3} \/ ~(set_of_edge (pr2 (f2:real^3#real^3#real^3#real^3)) V E = {pr2 f3})`) THENL[ MRESA_TAC CARD_SING[`(pr2 f3):real^3`; `(set_of_edge (pr2 (f2:real^3#real^3#real^3#real^3)) V E):real^3->bool`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th->REWRITE_TAC[SYM(th)]) THEN FIND_ASSUM (fun th -> MP_TAC(ISPEC `(pr2 (f2:real^3#real^3#real^3#real^3))` th))`(!v:real^3. v IN V==>CARD (set_of_edge v V E) >1)` THEN FIND_ASSUM (fun th-> REWRITE_TAC[th])`(pr2 (f2:real^3#real^3#real^3#real^3)) IN V` THEN ARITH_TAC; MRESA_TAC SIGMA_FAN [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` pr2 (f2:real^3#real^3#real^3#real^3)`; ` pr2 (f3:real^3#real^3#real^3#real^3)`] THEN ASM_TAC THEN SET_TAC[]];(*1*) DISJ_CASES_TAC(SET_RULE`f4=f1 \/ ~(f4=f1:real^3#real^3#real^3#real^3)`) THENL(*2*)[ SUBGOAL_THEN(`((f1_fan (x:real^3) V E) POWER 3) f1=f1`) ASSUME_TAC THENL(*3*)[ ASM_SIMP_TAC[ARITH_RULE`3= SUC(2)/\ 2= SUC(1) /\ 1= SUC(0)`;POWER;I_DEF;o_DEF];(*3*) SUBGOAL_THEN`face (hypermap1_of_fanx (x:real^3,V:real^3->bool,E)) f1=orbit_map (f1_fan x V E) f1`ASSUME_TAC THENL(*4*)[ ASM_REWRITE_TAC[face;orbit_map;EXTENSION;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THEN STRIP_TAC THEN MRESAL_TAC into_domain_power_efn_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`n:num`;`( \ t. res (t x V E ) (d1_fan (x:real^3,V,E))) `][POWER_1;I_DEF] THEN POP_ASSUM(fun th-> MRESA1_TAC th `f1:real^3#real^3#real^3#real^3`) THEN EXISTS_TAC`n:num` THEN ASM_REWRITE_TAC[];(*4*) MRESAL_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`f1:real^3#real^3#real^3#real^3`][] THEN MRESAL_TAC card_orbit_le[`f1_fan (x:real^3) V E`;`3`;`f1:real^3#real^3#real^3#real^3`][ARITH_RULE`~(3=0)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th -> REWRITE_TAC[SYM th]) THEN ASM_TAC THEN ARITH_TAC]]; POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN EXISTS_TAC`f1:real^3#real^3#real^3#real^3` THEN EXISTS_TAC`f2:real^3#real^3#real^3#real^3` THEN EXISTS_TAC`f3:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f2:real^3#real^3#real^3#real^3)` ;`(f1:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f3:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM(th)] THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)] THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)] THEN MP_TAC th) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[SYM(th)] THEN MP_TAC th) THEN ASSUME_TAC th) THEN STRIP_TAC THEN STRIP_TAC THEN POP_ASSUM (fun th-> ASM_REWRITE_TAC[th] THEN MP_TAC th) THEN REPEAT STRIP_TAC THEN ASSUME_TAC (SYM th)) THEN MRESA_TAC PROPERTIES_TRIANGLE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(pr2 f1):real^3`;`(pr3 f1):real^3`;` (pr2 f3):real^3`] 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 POP_ASSUM(fun th-> REWRITE_TAC[SYM th] THEN ASSUME_TAC (SYM th)) THEN REPEAT STRIP_TAC THEN MRESA_TAC condition_f1_eq_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` (pr2 f3):real^3`;`(pr2 f1):real^3`;`(pr3 f1):real^3`;] THEN REMOVE_THEN "EMYEU" MP_TAC THEN REMOVE_THEN"VUT"(fun th-> REWRITE_TAC[SYM th]) THEN ASM_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN REPEAT (ASM_REWRITE_TAC[pr2;pr3] THEN STRIP_TAC THEN ASM_REWRITE_TAC[]) THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM th]) THEN STRIP_TAC THEN MRESA_TAC MONO_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` v'':real^3`;`v:real^3`;`w'':real^3`;]]]);;
let condition_aff_gt_subset_yfan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ~({w,v} IN E) ==> aff_gt {x} {v,w} SUBSET yfan (x,V,E)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;SET_RULE`A SUBSET (:real^3) DIFF B<=> A INTER B= {}`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[GSYM CONTRAPOS_THM] THEN REWRITE_TAC[xfan;IN;SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESAL_TAC AFF_GT_CUT_XFAN_IMP_EDGE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`; `w:real^3`][IN]);;
let segment_subset_aff_gt_union=
prove(`!x:real^3 y z v u w. ~coplanar{x,v,u,w} /\ y IN aff_gt {x} {v, u, w} /\ z IN aff_gt {x} {w, v} ==> segment[y,z] SUBSET aff_gt {x} {w, v} UNION aff_gt {x} {v, u, w}`,
REWRITE_TAC[segment;UNION;SUBSET;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(REAL_ARITH`u'<= &1==> u'= &1 \/ u'< &1`) THEN RESA_TAC THENL[ REWRITE_TAC[REAL_ARITH`&1- &1= &0`] THEN REDUCE_VECTOR_TAC THEN RESA_TAC; STRIP_TAC THEN MATCH_MP_TAC(SET_RULE`B==> A\/ B`) THEN ASM_TAC THEN DISCH_TAC THEN MRESA_TAC notcoplanar_disjoints[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC AFF_GT_1_2[`x:real^3`;`w:real^3`;`v:real^3`;] THEN MRESA_TAC AFF_GT_1_3[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN REWRITE_TAC[IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`(&1 - u') % (t1 % x + t2 % v + t3 % u + t4 % w) + u' % (t1' % x + t2' % w + t3' % v) =((&1 - u') *t1 + u' *t1') % x + ((&1 - u')*t2+ u' * t3') % v + ((&1 - u')*t3) % u + ((&1 - u')*t4+ u' * t2') % w`] THEN EXISTS_TAC`(&1 - u') * t1 + u' * t1':real` THEN EXISTS_TAC`(&1 - u') * t2 + u' * t3':real` THEN EXISTS_TAC`(&1 - u') * t3:real` THEN EXISTS_TAC`(&1 - u') * t4 + u' * t2':real` THEN ASM_REWRITE_TAC[REAL_ARITH` ((&1 - u') * t1 + u' * t1') + ((&1 - u') * t2 + u' * t3') + (&1 - u') * t3 + (&1 - u') * t4 + u' * t2' = (&1 - u') * (t1 + t2+ t3 + t4)+ u'*(t1' +t2'+t3') `;REAL_ARITH`(&1 - u') * &1 + u' * &1 = &1`] THEN STRIP_TAC THENL[ MATCH_MP_TAC (REAL_ARITH`&0< A/\ &0<=B ==> &0< A+B`) THEN STRIP_TAC THENL[MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[REAL_ARITH`&0< &1- u'<=> u'< &1`]; MATCH_MP_TAC REAL_LE_MUL THEN ASM_TAC THEN REAL_ARITH_TAC]; STRIP_TAC THENL[ MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[REAL_ARITH`&0< &1- u'<=> u'< &1`]; MATCH_MP_TAC (REAL_ARITH`&0< A/\ &0<=B ==> &0< A+B`) THEN STRIP_TAC THENL[ MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[REAL_ARITH`&0< &1- u'<=> u'< &1`]; MATCH_MP_TAC REAL_LE_MUL THEN ASM_TAC THEN REAL_ARITH_TAC]]]]);;
let SEGMENT_CONNECTED=
prove(`!a b. connected(segment [a,b])`,
REPEAT GEN_TAC THEN MATCH_MP_TAC CONVEX_CONNECTED THEN REWRITE_TAC[SEGMENT_CONVEX_HULL;CONVEX_CONVEX_HULL]);;
let AFF_GT_SUBSET_DART_LEADS_INTO_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) ==> aff_gt {x} {w,v} SUBSET dart_leads_into x V E u w`,
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 MRESA_TAC notcoplanar_disjoints[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC aff_gt_1_3_subset_dart_leads_into_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` v:real^3`;`u:real^3`;`w:real^3`;] THEN MRESA_TAC dart_leads_into_fan_in_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`u:real^3`; `w:real^3`] THEN MRESA_TAC in_topological_component_yfan_is_connected[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`(dart_leads_into x V E u w):real^3->bool`] THEN MRESAL_TAC notcoplanar_4point_aff_gt_1_3_not_empty[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`][SET_RULE`~(A={})<=> ?y. y IN A`] THEN MP_TAC(SET_RULE`y IN aff_gt {x} {v, u, w}/\ aff_gt {x} {v, u, w} SUBSET dart_leads_into x V E u w ==> y IN dart_leads_into x V E u w`) THEN RESA_TAC THEN MRESA_TAC topological_component_subset_yfan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(dart_leads_into x V E u w):real^3->bool`] THEN MP_TAC(SET_RULE`dart_leads_into x V E u w SUBSET yfan (x,V,E) /\ aff_gt {x} {v, u, w} SUBSET dart_leads_into x V E u w ==> aff_gt {x} {v, u, w} SUBSET yfan (x,V,E)`) THEN RESA_TAC THEN MRESA_TAC expand_element_in_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`(dart_leads_into x V E u w):real^3->bool`;`y:real^3`] THEN MRESA_TAC exists_in_aff_gt_disjoint[`x:real^3`;`w:real^3`;`v:real^3`] THEN MRESA_TAC condition_aff_gt_subset_yfan[`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 GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MRESA_TAC segment_subset_aff_gt_union[`x:real^3`;`y:real^3`;`y':real^3`;` v:real^3`;`u:real^3`;`w:real^3`;] THEN MP_TAC(SET_RULE` segment [y,y'] SUBSET aff_gt {x} {w, v} UNION aff_gt {x} {v, u, w} /\ aff_gt {x} {w, v} SUBSET yfan (x,V:real^3->bool,E) /\ aff_gt {x} {v, u, w} SUBSET yfan (x,V,E) ==> segment [y,y':real^3] SUBSET yfan(x,V,E) `) THEN RESA_TAC THEN MRESA_TAC CONVEX_AFF_GT[`{x:real^3}`;`{ w,v:real^3}`] THEN MRESA_TAC CONVEX_CONNECTED[`aff_gt {x} {w,v}:real^3->bool`] THEN MRESA_TAC SEGMENT_CONNECTED[`y:real^3`;`y':real^3`] THEN MRESA_TAC ENDS_IN_SEGMENT[`y:real^3`;`y':real^3`] THEN MRESA1_TAC CONNECTED_IFF_CONNECTED_COMPONENT`segment[y,y':real^3]` THEN POP_ASSUM (fun th-> MRESA_TAC th [`y:real^3`;`y':real^3`]) THEN MRESA_TAC CONNECTED_COMPONENT_OF_SUBSET[`segment [y,y':real^3]`;`yfan(x:real^3,V:real^3->bool,E)`;`y:real^3`;`y':real^3`] THEN MRESAL_TAC CONNECTED_COMPONENT_EQ[`yfan(x:real^3,V:real^3->bool,E)`;`y:real^3`;`y':real^3`][IN] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC CONNECTED_COMPONENT_MAXIMAL[`yfan(x:real^3,V:real^3->bool,E)`;`aff_gt {x} {w,v}:real^3->bool`;`y':real^3`]);;
let STEP2_REDUCE_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds f1 f2 f3 v u w. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v ==> aff_gt {x} {v,w} SUBSET dartset_leads_into_fan x V E ds`,
REPEAT STRIP_TAC THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds /\ ds SUBSET d1_fan(x,V,E)==> f1 IN d1_fan(x,V,E)/\ f2 IN d1_fan(x,V,E) /\ f3 IN d1_fan(x,V,E) /\ f1 IN ds /\ f2 IN ds/\ f3 IN ds`) THEN RESA_TAC THEN MRESA_TAC properties_of_f1_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f3:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`] THEN REMOVE_ASSUM_TAC THEN MRESA_TAC AFF_GT_SUBSET_DART_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`] THEN MRESA_TAC UNIQUE_DARTSET_LEADS_INTO1_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`dart_leads_into (x:real^3) V E (pr2 f2) (pr3 f2)`;`f2:real^3#real^3#real^3#real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]);;
let STEP3_REDUCE_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ E UNION {{v,w}}= E1 ==> FAN (x,V,E1)`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP2_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w: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 POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN 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 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 MRESAL_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`;`&1:real`][REAL_ARITH`&0<= &1 /\ &1<= &1`;VECTOR_ARITH`(&1 - &1) % u + &1 % w=w`] THEN MRESA_TAC DWWUTKW[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`; `ds:real^3#real^3#real^3#real^3->bool`;]);;
let SET_OF_EDGE_UNION_GRAPH=
prove(`!v V E1 E2. set_of_edge v V (E1 UNION E2)= (set_of_edge v V E1) UNION (set_of_edge v V E2)`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[set_of_edge;UNION;IN_ELIM_THM;SET_RULE`(A\/B)/\C<=>(A/\C)\/ (B/\C)`;] THEN REPEAT STRIP_TAC THEN EQ_TAC THEN SET_TAC[]);;
let add_edge_imp_card_set_edge_ge1_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E1=E UNION {{v,w}} ==> (!v. v IN V==>CARD (set_of_edge v V E1) > 1)`,
REWRITE_TAC[FAN;fan1] THEN REPEAT STRIP_TAC THEN MRESA_TAC remark_finite_fan1[`v':real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[SET_OF_EDGE_UNION_GRAPH;] THEN STRIP_TAC THEN MRESAL_TAC CARD_SUBSET[`(set_of_edge v' (V:real^3->bool) E):real^3->bool`;`(set_of_edge v' (V:real^3->bool) E UNION set_of_edge v' V {{v, w}}):real^3->bool`][SET_RULE`A SUBSET A UNION B`] THEN POP_ASSUM MP_TAC THEN FIRST_ASSUM (MP_TAC o SPEC `v':real^3`) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN ARITH_TAC);;
let pr23=new_definition`pr23=(\(x,y,z,t). (y,z))`
;;
let PR23_OF_D1_FAN=
prove(`!x:real^3 V:real^3->bool E:(real^3->bool)->bool. IMAGE pr23 (d1_fan(x,V,E))={ (v,w) | {v,w} IN E}`,
REWRITE_TAC[IMAGE;d1_fan;IN_ELIM_THM;EXTENSION;] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[pr23;] THEN RESA_TAC THEN EXISTS_TAC `v:real^3` THEN EXISTS_TAC `w:real^3` THEN ASM_REWRITE_TAC[]; REPEAT STRIP_TAC THEN EXISTS_TAC`x,v,w,sigma_fan x V E v w:real^3` THEN ASM_REWRITE_TAC[pr23] THEN EXISTS_TAC `x:real^3` THEN EXISTS_TAC `v:real^3` THEN EXISTS_TAC `w:real^3` THEN EXISTS_TAC `sigma_fan x V E v w:real^3` THEN ASM_REWRITE_TAC[]]);;
let PR23_OF_D20_FAN=
prove(`!x:real^3 V:real^3->bool E:(real^3->bool)->bool. IMAGE pr23 (d20_fan(x,V,E))={ (v,v) | v IN V/\ set_of_edge v V E={}}`,
REWRITE_TAC[IMAGE;d20_fan;IN_ELIM_THM;EXTENSION;] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[pr23;] THEN RESA_TAC THEN EXISTS_TAC `v:real^3` THEN ASM_REWRITE_TAC[IN]; REPEAT STRIP_TAC THEN EXISTS_TAC`(x:real^3),v,v,(v:real^3)` THEN ASM_REWRITE_TAC[pr23] THEN EXISTS_TAC `x:real^3` THEN EXISTS_TAC `v:real^3` THEN ASM_REWRITE_TAC[IN] THEN ASM_TAC THEN SIMP_TAC[IN]]);;
let add_edge_graph=
prove(`!v w E. {v',w' | {v', w'} IN E UNION {{v, w}}}= {v',w' | {v', w'} IN E} UNION {(v',w')| {v',w'}={v,w}}`,
ONCE_REWRITE_TAC[EXTENSION] THEN REWRITE_TAC[UNION;IN_ELIM_THM;IN_SING;SET_RULE`(A\/B)/\C<=>(A/\C)\/ (B/\C)`;] THEN REPEAT STRIP_TAC THEN EQ_TAC THEN SET_TAC[]);;
let expand_set_edge_fan=
prove(`!v w.{(v',w')| {v',w'}={v,w}}={(v,w), (w,v)}`,
REWRITE_TAC[SET_RULE`{v',w'}={v,w}<=> (v=v' /\ w= w') \/ v= w' /\ w=v'`] THEN SET_TAC[]);;
let DART_FANADD_EQ_DART_FAN_ADD_2DART=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ~(v=w) /\ E UNION {{v,w}}=E1 ==> IMAGE pr23 (dart (hypermap1_of_fanx (x,V,E1))) = (IMAGE pr23 (dart (hypermap1_of_fanx (x,V,E)))) UNION {(v,w),(w,v)}`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d_fan;IMAGE_UNION;PR23_OF_D20_FAN;PR23_OF_D1_FAN] THEN REMOVE_THEN"YEU"(fun th-> REWRITE_TAC[SYM th;add_edge_graph;expand_set_edge_fan;SET_OF_EDGE_UNION_GRAPH]));;
let pr23_inj_in_dfan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool). FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1) ==> (!y y1. y IN d_fan(x,V,E) /\ y1 IN d_fan(x,V,E) /\ pr23 y= pr23 y1 ==> y=y1)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN REWRITE_TAC[PAIR_EQ;IN_ELIM_THM;d1_fan] THEN STRIP_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr23;PAIR_EQ] THEN STRIP_TAC THEN ASM_REWRITE_TAC[]);;
let condition_set_of_edge_eq_empty=
prove(`!v:A V E1 E2. ~(v IN UNIONS E2) ==> set_of_edge v V E2= {}`,
REWRITE_TAC[set_of_edge;SET_RULE`A={}<=> !s. ~(s IN A)`;IN_ELIM_THM;DE_MORGAN_THM;] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC(SET_RULE`A==> A\/B`) THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN STRIP_TAC THEN REWRITE_TAC[UNIONS;IN_ELIM_THM] THEN EXISTS_TAC`{v:A,s}` THEN ASM_REWRITE_TAC[] THEN SET_TAC[]);;
let SET_OF_EDGE_INVARIANT=
prove(`!v V E1 E2. ~(v IN UNIONS E2) ==> set_of_edge v V (E1 UNION E2)= (set_of_edge v V E1)`,
let expand_unions=
prove(`!v w:A. UNIONS {{v,w}}= {v,w}`,
SIMP_TAC[UNIONS;IN_SING;] THEN ONCE_REWRITE_TAC[EXTENSION;] THEN SIMP_TAC[IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[SET_TAC[]; STRIP_TAC THEN EXISTS_TAC`{v,w:A}` THEN ASM_REWRITE_TAC[]]);;
let SIGMA_FAN_OF_FANADD1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 v w. FAN(x,V,E)/\ FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ ~({v,w} IN E) /\ E UNION {{v,w}}=E1 ==> (!v1 w1. {v1,w1} IN E /\ ~(v1 IN {v,w})==> sigma_fan x V E1 v1 w1 = sigma_fan x V E v1 w1) `,
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 add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `v1:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v1 V E1 = {w1:real^3})\/ ~(set_of_edge v1 V E1 = {w1})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; POP_ASSUM MP_TAC THEN MRESAL_TAC SET_OF_EDGE_INVARIANT[`v1:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` ({{v,w}}:(real^3->bool)->bool)`;][expand_unions] THEN STRIP_TAC THEN STRIP_TAC THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v1:real^3`;`w1:real^3`;`sigma_fan x V E v1 w1:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v1:real^3`;`w1:real^3`] ]);;
let add_edge_graph=
prove(`!v w E E1. E UNION {{v,w}}=E1 ==> {w,v} IN E1/\ {v,w}IN E1`,
REPEAT STRIP_TAC THENL [ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN SET_TAC[]; POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN SET_TAC[]]);;
let not_in_set_of_edge=
prove(` !v w V E. ~({w,v} IN E) ==> ~(w IN set_of_edge v V E)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN SIMP_TAC[set_of_edge;IN_ELIM_THM;SET_RULE`{A,B}={B,A}`]);;
let set_of_only_edge=
prove(`!v w V. w IN V ==> set_of_edge v V {{v, w}}={w}`,
REWRITE_TAC[set_of_edge;IN_SING;SET_RULE`{v',w'}={v,w}<=> (v=v' /\ w= w') \/ v= w' /\ w=v'`;EXTENSION;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[]);;
let set_of_only_edge1=
prove(`!v w V. v IN V ==> set_of_edge w V {{v, w}}={v}`,
REWRITE_TAC[set_of_edge;IN_SING;SET_RULE`{v',w'}={v,w}<=> (v=v' /\ w= w') \/ v= w' /\ w=v'`;EXTENSION;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EQ_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[]);;
let SIGMA_FAN_OF_FANADD_AT_POINT1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 v u w. FAN(x,V,E)/\ FAN(x,V,E1) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 v w = sigma_fan x V E v u`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") 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 add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E1 = {w:real^3})\/ ~(set_of_edge v V E1 = {w})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w:real^3)`; `(v:real^3)`] THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`;`sigma_fan x V E v u:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN REMOVE_THEN "YEU"(fun th -> MRESA1_TAC th`v:real^3` THEN POP_ASSUM MP_TAC THEN ASSUME_TAC th) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E = {u:real^3})\/ ~(set_of_edge v V E = {u})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"QUY") THEN ASM_SIMP_TAC[SET_RULE`x IN A==> x IN A UNION B`] THEN MRESA_TAC not_in_set_of_edge[`v:real^3`;`w:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;] THEN STRIP_TAC THENL[ MATCH_MP_TAC (SET_RULE`!x y A. x IN A /\ ~(y IN A)==> ~(x=y)`) THEN EXISTS_TAC`set_of_edge (v:real^3) V E` THEN ASM_REWRITE_TAC[]; MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(w:real^3)`] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASM_SIMP_TAC[UNION;IN_ELIM_THM;set_of_only_edge;IN_SING;SET_RULE`((A \/ B)/\ (~ B)) <=>A /\ ~ B`] THEN REPEAT STRIP_TAC THEN MRESA_TAC angle_is_small_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w:real^3`] THEN ABBREV_TAC`u1=sigma_fan x V E v u` THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u1:real^3)`; `(v:real^3)`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`;`u1:real^3`] THEN MATCH_MP_TAC(REAL_ARITH`!A B C D. A=B+C /\ A<= B+D ==> C<= D`) THEN EXISTS_TAC`azim x v u (u1:real^3)` THEN EXISTS_TAC`azim x v u (w:real^3)` THEN ASM_REWRITE_TAC[] THEN FIRST_X_ASSUM (fun th-> REWRITE_TAC[SYM th] THEN MP_TAC(SYM th) THEN DISCH_THEN(LABEL_TAC"NHO")) THEN DISJ_CASES_TAC(SET_RULE`(w1=u:real^3)\/ ~(w1=u)`) THENL[ ASM_REWRITE_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 MRESAL_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`][DE_MORGAN_THM;] THEN MRESAL_TAC AZIM_COMPL[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`][REAL_ARITH`A+B-A=B`;] THEN MATCH_MP_TAC (REAL_ARITH`A<B==> A<=B`) THEN SIMP_TAC[azim]; REMOVE_THEN"QUY" (fun th-> MRESA1_TAC th`w1:real^3`) THEN MP_TAC(REAL_ARITH`azim x v u w + azim x v w u1 = azim x v u u1 /\ azim x v u u1 <= azim x v u w1 /\ &0<= azim x v w u1==> azim x v u w <= azim x v u w1`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN SIMP_TAC[azim] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(v:real^3)`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`;`w1:real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th])]]]]);;
let SIGMA_FAN_OF_FANADD_AT_POINT2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 v u w. FAN(x,V,E)/\ FAN(x,V,E1) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 v u = w`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] 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 remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w:real^3)`; `(v:real^3)`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E1 = {u:real^3})\/ ~(set_of_edge v V E1 = {u})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN ASM_SIMP_TAC[SET_RULE`x IN A==> x IN A UNION B`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`; `(w:real^3)`] THEN ASM_SIMP_TAC[UNION;IN_ELIM_THM;set_of_only_edge;IN_SING;SET_RULE`((A \/ B)/\ (~ B)) <=>A /\ ~ B`] THEN REPEAT STRIP_TAC THENL[ REMOVE_THEN "YEU"(fun th -> MRESA1_TAC th`v:real^3` THEN POP_ASSUM MP_TAC THEN ASSUME_TAC th) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E = {u:real^3})\/ ~(set_of_edge v V E = {u})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w1:real^3`) THEN MRESA_TAC angle_is_small_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 POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]; ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC]]);;
let XFAN_INTER_SET=
prove(`!x:real^N V E s:real^N->bool. xfan(x,V,E) INTER s = UNIONS {y | ?e. e IN E /\ y = (aff_ge {x} e) INTER s}`,
REPEAT GEN_TAC THEN REWRITE_TAC[XFAN_EQ_UNIONS_AFF_GE_1_2] THEN ONCE_REWRITE_TAC[ EXTENSION] THEN REWRITE_TAC[UNIONS; INTER;IN_ELIM_THM] THEN GEN_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC `{x' | x' IN aff_ge {x:real^N} e /\ x' IN s}` THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN RESA_TAC THEN EXISTS_TAC`e:real^N->bool` THEN ASM_REWRITE_TAC[]; STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN RESA_TAC THEN EXISTS_TAC `aff_ge {x:real^N} e ` THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC `e:real^N->bool` THEN ASM_REWRITE_TAC[]]);;
let condition_azim_imp_edge_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w w1. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ {w,w1} IN E /\ sigma_fan x V E u w = v /\ sigma_fan x V E w w1 = u /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ azim x w v u = azim x w w1 u ==> {v,w} IN E`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_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 [`w:real^3`;`w1:real^3`] THEN 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)`;`u:real^3`;`w:real^3`;`w1: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 MRESA_TAC notcoplanar_imp_notcollinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC notcoplanar_imp_notcollinear_fan[`x:real^3`;`u:real^3`;`w:real^3`;`w1:real^3`] THEN MRESA_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN ASM_REWRITE_TAC[DE_MORGAN_THM;] THEN RESA_TAC THEN MRESA_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`w:real^3`;`u:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,B,C}`] THEN ASM_REWRITE_TAC[DE_MORGAN_THM;] THEN RESA_TAC THEN MRESA_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN MRESA_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;`u:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN REWRITE_TAC[REAL_ARITH`A-B=A-C<=> B=C`] THEN STRIP_TAC THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN MATCH_MP_TAC AFF_GT_CUT_XFAN_IMP_EDGE_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`u:real^3` THEN ASM_SIMP_TAC[SET_RULE`A INTER B= B INTER A`] THEN MRESAL_TAC XFAN_INTER_SET[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`aff_gt {x:real^3} {v, w}`][IN;xfan] THEN ASM_REWRITE_TAC[UNIONS;IN_ELIM_THM;SET_RULE`~(A={})<=> ?y. y IN A`] THEN SUBGOAL_THEN`?y. y IN aff_gt {x:real^3} {v,w} INTER aff_ge {x} {w,w1}`ASSUME_TAC THENL[ MRESA_TAC AFF_GT_SUBSET_AFF_GE[`{x:real^3,w:real^3}`;`{w1:real^3}`] THEN MP_TAC(SET_RULE`v IN aff_gt {x, w} {w1} /\ aff_gt {x, w} {w1} SUBSET aff_ge {x, w} {w1} ==> v IN aff_ge {x, w} {w1:real^3}`) THEN RESA_TAC THEN MRESA_TAC decomposition_planar_by_angle_fan[`x:real^3`;`w:real^3`;`w1:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THENL[ POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{B,C}={C,B}`] THEN STRIP_TAC THEN MRESAL_TAC point_in_aff_ge[`x:real^3`;`w:real^3`;`w1:real^3`][INTER;IN_ELIM_THM] THEN EXISTS_TAC`w1:real^3` THEN ASM_REWRITE_TAC[]; MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC aff_gt12_subset_aff_ge[`x:real^3`;`w:real^3`;`w1:real^3`;`v:real^3`] THEN ASM_SIMP_TAC[SET_RULE`A SUBSET B==> A INTER B= A`] THEN MATCH_MP_TAC exists_in_aff_gt THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v:real^3)`; `(w:real^3)`]]; POP_ASSUM MP_TAC THEN STRIP_TAC THEN EXISTS_TAC `y:real^3` THEN EXISTS_TAC `aff_gt {x} {v, w} INTER aff_ge {x} {w, w1:real^3}` THEN ASM_REWRITE_TAC[] THEN EXISTS_TAC`{w,w1:real^3}` THEN ASM_SIMP_TAC[SET_RULE`A INTER B= B INTER A`;] THEN ASM_TAC THEN SIMP_TAC[IN]]);;
let condition_azim_le_pi=
prove( `!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ sigma_fan x V E u w = v /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) ==> &0< azim x w v u/\ azim x w v u < pi`,
REPEAT GEN_TAC THEN 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 [`w:real^3`;`w1:real^3`] THEN 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 MRESA_TAC notcoplanar_imp_notcollinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] 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 RESA_TAC THEN MRESA_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN ASM_REWRITE_TAC[DE_MORGAN_THM;] THEN RESA_TAC THEN MRESA_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`w:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,C,B}`] THEN ASM_REWRITE_TAC[DE_MORGAN_THM;] THEN RESA_TAC THEN MP_TAC(ARITH_RULE`~(azim x w v u = &0) /\ &0<= azim x w v u==> &0< azim x w v u `) THEN ASM_SIMP_TAC[azim] THEN RESA_TAC THEN DISJ_CASES_TAC(REAL_ARITH`pi<= azim x w v u \/ azim x w v u < pi`) THENL[ MRESA_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN MP_TAC(ARITH_RULE`~(azim x w v u = pi)/\ pi<= azim x w v u /\ azim x w v u < &2 * pi /\ azim x w v u = &2 * pi - azim x w u v ==> &0 < azim x w u v /\ azim x w u v< pi`) THEN ASM_SIMP_TAC[azim] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`; `w:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[CROSS_SKEW] THEN REWRITE_TAC[DOT_LNEG] THEN ASM_TAC THEN REAL_ARITH_TAC; ASM_REWRITE_TAC[]]);;
let azim_trangle_le_azim_face_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w w1. FAN(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ {w,w1} IN E /\ ~({v,w} IN E) /\ sigma_fan x V E u w = v /\ sigma_fan x V E w w1 = u /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) ==> azim x w v u < azim x w w1 u`,
REPEAT STRIP_TAC THEN REWRITE_TAC[REAL_ARITH`A<B <=> ~(B<=A) `] THEN 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 [`w:real^3`;`w1:real^3`] THEN MRESA_TAC th [`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC "YEU EM")) THEN POP_ASSUM MP_TAC THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`;`w1: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 (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN DISCH_TAC THEN MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,D,B,C}`] THEN DISCH_TAC THEN ASSUME_TAC th) THEN MRESA_TAC notcoplanar_imp_notcollinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC condition_azim_imp_edge_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`w1:real^3`] THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`v:real^3`;`w1:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN MP_TAC(REAL_ARITH`azim x w v u = azim x w v w1 + azim x w w1 u /\ azim x w w1 u <= azim x w v u /\ &0< azim x w w1 u /\ ~(azim x w v u = azim x w w1 u) ==> &0 < azim x w v w1 /\ azim x w v w1 < azim x w v u`) THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th] THEN ASSUME_TAC (SYM th)) THEN RESA_TAC THEN MRESA_TAC condition_azim_le_pi[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC WEDGE_LUNE_GT[`x:real^3`;`w:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN SUBGOAL_THEN`w1 IN wedge x w v (u:real^3)` ASSUME_TAC THENL[ REWRITE_TAC[wedge;IN_ELIM_THM] THEN ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC inter_aff_gt_3_1_is_aff_gt_2_2[`x:real^3`;`v:real^3`;`w:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,B,D,C}`] THEN RESA_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) 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 RESA_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN DISCH_TAC THEN ASSUME_TAC th) THEN ASSUME_TAC th) THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`u:real^3`;`w:real^3`;`v:real^3`] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`w:real^3`;`v:real^3`;`u:real^3`] THEN MRESA_TAC invariant_crossr_dot_esilon_3piont[`x:real^3`;`u:real^3`;`w:real^3`;`v:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN CONV_TAC(TOP_DEPTH_CONV let_CONV) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ABBREV_TAC`h=t/ &2:real` THEN MP_TAC(REAL_ARITH`&0< t/\ t< &1/\ h= t/ &2 ==> &0 <= h/\ &0< h/\ &0<= &1 -h /\ h< t`) THEN RESA_TAC THEN DISCH_THEN(fun th-> MRESA1_TAC th `h:real`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN STRIP_TAC THEN REWRITE_TAC[INTER;IN_ELIM_THM] THEN ONCE_REWRITE_TAC[CROSS_TRIPLE] THEN STRIP_TAC THEN SUBGOAL_THEN`&0 < ((w - x) cross (v - x)) dot ((&1 - h) % w + h % w1 - x:real^3)/\ &0 < ((u - x) cross (w - x)) dot ((&1 - h) % w + h % w1 - x:real^3)` ASSUME_TAC THENL[ REWRITE_TAC[VECTOR_ARITH`(&1 - h) % w + h % w1-x=(&1 - h) % (w-x) + h % (w1-x)`] THEN REWRITE_TAC[DOT_RADD;DOT_RMUL;DOT_CROSS_SELF] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN MATCH_MP_TAC REAL_LT_MUL THEN ASM_REWRITE_TAC[]; SUBGOAL_THEN`(&1 - h) % w + h % w1 IN aff_gt {x} {v,u,w:real^3}`ASSUME_TAC THENL[ MRESA_TAC inter_aff_gt_3_1_is_aff_gt_1_3[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th;IN_ELIM_THM;INTER;VECTOR_ARITH`(A+B)-C=A+B-C:real^3`]); SUBGOAL_THEN`(&1 - h:real) % w + h % (w1:real^3) IN aff_ge {x} {w,w1:real^3}`ASSUME_TAC THENL[ MRESAL_TAC AFF_GE_1_2[`x:real^3`;`w:real^3`;` w1:real^3`][IN_ELIM_THM] THEN EXISTS_TAC`&0` THEN EXISTS_TAC`&1-h:real` THEN EXISTS_TAC`h:real` THEN ASM_REWRITE_TAC[REAL_ARITH`&0 + &1 - h + h = &1`] THEN REDUCE_VECTOR_TAC; MRESA_TAC AFF_GE_SUBSET_XFAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`;] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt_1_3_subset_dart_leads_into_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;` v:real^3`;`u:real^3`;`w:real^3`;] THEN MRESA_TAC dart_leads_into_fan_in_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`u:real^3`; `w:real^3`] THEN MRESA_TAC topological_component_subset_yfan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(dart_leads_into x V E u w):real^3->bool`] THEN MP_TAC(SET_RULE`dart_leads_into x V E u w SUBSET yfan (x,V,E) /\ aff_gt {x} {v, u, w} SUBSET dart_leads_into x V E u w ==> aff_gt {x} {v, u, w} SUBSET yfan (x,V,E)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[yfan] THEN SET_TAC[]]]]]);;
let SIGMA_FAN_OF_FANADD_AT_POINT3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 v u w. FAN(x,V,E)/\ FAN(x,V,E1) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ fan80(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 w v = u`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN MP_TAC(SET_RULE`{u,w:real^3} IN E /\ E UNION {{v,w}}=E1==> {u,w} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (u:real^3)`; `(w:real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`; `(w:real^3)`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E1 = {v:real^3})\/ ~(set_of_edge w V E1 = {v})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN ASM_SIMP_TAC[UNION;IN_ELIM_THM;set_of_only_edge1;IN_SING;SET_RULE`((A \/ B)/\ (~ B)) <=>A /\ ~ B`] THEN REPEAT STRIP_TAC THEN ABBREV_TAC`w2=inverse1_sigma_fan x V E w u:real^3` THEN REMOVE_THEN "YEU"(fun th-> MRESA1_TAC th`w:real^3` THEN POP_ASSUM MP_TAC THEN ASSUME_TAC(th)) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E = {w2:real^3})\/ ~(set_of_edge w V E = {w2})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] 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) `;` (w2:real^3)`; `(w:real^3)`] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`w2:real^3`] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`w1:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(w1 = w2:real^3)\/ (w1 = w2)`) THENL[ RESA_TAC THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` w2:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MP_TAC(REAL_ARITH`azim x w v u < azim x w w2 u==> azim x w v u <= azim x w w2 u`) THEN RESA_TAC THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`w2:real^3`;`v:real^3`;`u: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_THEN(LABEL_TAC "ME1") THEN MP_TAC(REAL_ARITH`azim x w w2 (u:real^3) = azim x w w2 v + azim x w v u /\ azim x w w2 u <= azim x w w2 w1 /\ &0 <= azim x w v u ==> azim x w w2 v <= azim x w w2 w1 `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN SIMP_TAC[azim] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`w:real^3`;`w2:real^3`;`v:real^3`;`w1:real^3`] THEN MATCH_MP_TAC(REAL_ARITH`!B A C. A+C<=A+B==>C<=B`) THEN EXISTS_TAC`azim x w w2 (v:real^3)` THEN POP_ASSUM (fun th -> REWRITE_TAC[SYM th;]) THEN REMOVE_THEN "ME1"(fun th -> ASM_REWRITE_TAC[SYM th;]); STRIP_TAC THEN REMOVE_ASSUM_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` w2:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MP_TAC(REAL_ARITH`azim x w v u < azim x w w2 u==> azim x w v u <= azim x w w2 u`) THEN RESA_TAC THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`w2:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MATCH_MP_TAC(REAL_ARITH`!B A C. A+C<=A+B==>C<=B`) THEN EXISTS_TAC`azim x w w2 (v:real^3)` THEN POP_ASSUM (fun th -> REWRITE_TAC[SYM th;] THEN MP_TAC(REAL_ARITH`azim x w v u < azim x w w2 u /\ azim x w w2 u = azim x w w2 v + azim x w v u ==> ~(azim x w w2 v = &0)`) THEN ASM_REWRITE_TAC[SYM th] THEN STRIP_TAC) THEN MRESAL_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;`w2:real^3`;`v:real^3`][REAL_ARITH`A+ B-A=B`] THEN MATCH_MP_TAC(REAL_ARITH`!a b. a< b==> a<= b`) THEN SIMP_TAC[azim]]]]);;
let elements_in_ds2_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ E UNION {{v,w}}= E1 ==> f10 IN ds2`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN REWRITE_TAC[face;orbit_map; IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[POWER;ARITH_RULE`0>=0`;I_DEF;EQ_PAIR_4] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ]);;
let SIGMA_FAN_OF_FANADD_AT_POINT4=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w w1. FAN(x,V,E)/\ FAN(x,V,E1) /\ fan80(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ ~(u=w1) /\ {v,w1} IN E /\ sigma_fan x V E u w = v /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 v w1 = sigma_fan x V E v w1`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] 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 add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E1 = {w1:real^3})\/ ~(set_of_edge v V E1 = {w1})`) THENL(*1*)[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC;(*1*) STRIP_TAC THEN MP_TAC(SET_RULE`{v,w1:real^3} IN E /\ E UNION {{v,w}}=E1==> {v,w1} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w1: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 MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`w1:real^3`;`sigma_fan x V E v w1:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN REMOVE_THEN "YEU"(fun th -> MRESA1_TAC th`v:real^3` THEN POP_ASSUM MP_TAC THEN ASSUME_TAC th) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge v V E = {w1:real^3})\/ ~(set_of_edge v V E = {w1})`) THENL(*2*)[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC;(*2*) STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`; `(w:real^3)`] THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN ASM_SIMP_TAC[SET_RULE`x IN A==> x IN A UNION B`] THEN ASM_SIMP_TAC[UNION;IN_ELIM_THM;set_of_only_edge;IN_SING;SET_RULE`((A \/ B)/\ (~ B)) <=>A /\ ~ B`] THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"MA") THEN REPEAT STRIP_TAC THENL(*3*)[ REMOVE_THEN "MA"(fun th-> MRESA1_TAC th`w1':real^3`);(*3*) ASM_REWRITE_TAC[] THEN REMOVE_THEN "MA"(fun th-> MRESA1_TAC th`u:real^3`) THEN MRESA_TAC sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`v:real^3`;`u:real^3`] THEN DISJ_CASES_TAC(SET_RULE`~(sigma_fan x V E v u = w1)\/ (sigma_fan x V E v u = w1)`) THENL(*4*)[ ASM_REWRITE_TAC[] THEN MRESA_TAC MONO_AZIM_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`v:real^3`;`w1: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 MRESA_TAC sum4_azim_fan[`x:real^3`;`v:real^3`;`w1:real^3`;`u:real^3`;`(sigma_fan x V E v u):real^3`] THEN MRESA_TAC angle_is_small_fan[`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`azim x v w1 (sigma_fan x V E v u) = azim x v w1 u + azim x v u (sigma_fan x V E v u) /\ azim x v u w <= azim x v u (sigma_fan x V E v u) ==> azim x v w1 u+ azim x v u w<= azim x v w1 (sigma_fan x V E v u) `) 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 ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH` azim x v w1 (sigma_fan x V E v u)< &2 * pi /\ azim x v w1 u+ azim x v u w<= azim x v w1 (sigma_fan x V E v u) ==> azim x v w1 u+ azim x v u w< &2 * pi `) THEN ASM_SIMP_TAC[azim] THEN STRIP_TAC THEN MP_TAC(SET_RULE`E UNION {{v,w}}=E1==> {v,w} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E1:(real^3->bool)->bool)`;`w:real^3`;`v:real^3`] THEN MRESA_TAC sum3_azim_fan[`x:real^3`;`v:real^3`;`w1:real^3`;`u:real^3`;`w:real^3`] THEN MATCH_MP_TAC(REAL_ARITH`!A B C.A<=B /\ &0<= C ==>A<= B+C`) THEN ASM_SIMP_TAC[azim];(*4*) MRESA_TAC angle_is_small_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w:real^3`] THEN MRESA_TAC AZIM_COMPL[`x:real^3`;`v:real^3`;` u:real^3`;`w1:real^3`] THEN MP_TAC(REAL_ARITH` azim x v w1 u + azim x v u (sigma_fan x V E v u) = &2 * pi /\ azim x v u w <= azim x v u (sigma_fan x V E v u) ==> azim x v w1 u+ azim x v u w<= &2 * pi `) THEN POP_ASSUM(fun th -> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN ASM_REWRITE_TAC[] THEN DISJ_CASES_TAC(SET_RULE`azim x v u w1 = &0\/ ~(azim x v u w1 = &0)`) THENL(*5*)[ MRESA_TAC UNIQUE_AZIM_0_POINT_FAN[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w1:real^3`];(*5*) ASM_REWRITE_TAC[REAL_ARITH`A-B+B=A`] THEN STRIP_TAC THEN MP_TAC(SET_RULE`E UNION {{v,w}}=E1==> {v,w} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`x:real^3 `;`(V:real^3->bool) `;`(E1:(real^3->bool)->bool)`;`w:real^3`;`v:real^3`] THEN MP_TAC(REAL_ARITH`azim x v w1 u + azim x v u w <= &2 * pi ==> azim x v w1 u + azim x v u w < &2 * pi\/ azim x v w1 u + azim x v u w = &2 * pi`) THEN RESA_TAC THENL(*6*)[ MRESA_TAC sum3_azim_fan[`x:real^3`;`v:real^3`;`w1:real^3`;`u:real^3`;`w:real^3`] THEN MATCH_MP_TAC(REAL_ARITH`!A B C.A<=B /\ &0<= C ==>A<= B+C`) THEN ASM_SIMP_TAC[azim];(*6*) POP_ASSUM MP_TAC THEN MRESAL_TAC AZIM_COMPL[`x:real^3`;`v:real^3`;` u:real^3`;`w1:real^3`][REAL_ARITH`A-C+D=A<=> C=D`] THEN STRIP_TAC THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`v:real^3`;`u:real^3`;`w1:real^3`;`w:real^3`] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`v:real^3`;`w:real^3`;`w1:real^3`] THEN MRESA_TAC AZIM_EQ_0_GE[`x:real^3`;`v:real^3`;`w:real^3`;`w1:real^3`] THEN MP_TAC(ISPECL[`x:real^3`;`v:real^3`;`w1:real^3`;`w:real^3`] decomposition_planar_by_angle_fan) THEN RESA_TAC THENL(*7*)[ MRESA_TAC aff_gt3_subset_aff_gt[`x:real^3`;`v:real^3`;`w:real^3`;`w1:real^3`] THEN MRESA_TAC exists_in_aff_gt_disjoint[`x:real^3`;`v:real^3`;`w1:real^3`] THEN MRESA_TAC aff_gt_subset_aff_ge[`x:real^3`;`v:real^3`;`w1:real^3`;] THEN SUBGOAL_THEN`aff_gt {x} {v, w1:real^3} SUBSET xfan(x,V:real^3->bool,E)` ASSUME_TAC THENL(*8*)[ REWRITE_TAC[xfan;SUBSET;IN_ELIM_THM] THEN GEN_TAC THEN STRIP_TAC THEN EXISTS_TAC`{v,w1}:real^3->bool` THEN MP_TAC(SET_RULE`x' IN aff_gt {x}{v,w1}/\ aff_gt {x} { v,w1} SUBSET aff_ge {x} {v, w1} ==> x' IN aff_ge {x:real^3} {v, w1}`) THEN RESA_TAC THEN ASM_TAC THEN SIMP_TAC[IN];(*8*) MP_TAC(SET_RULE`aff_gt {x} {v, w1} SUBSET aff_gt {x} {v, w}/\y IN aff_gt {x} {v, w1} /\ aff_gt {x} {v, w1} SUBSET xfan (x,V,E) ==> ~(aff_gt {x:real^3} {v, w} INTER xfan (x,V:real^3->bool,E) ={})`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[xfan;IN ] THEN STRIP_TAC THEN MRESAL_TAC AFF_GT_CUT_XFAN_IMP_EDGE_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`; `w:real^3`][IN] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_TAC THEN SIMP_TAC[IN] ];(*7*) MRESA_TAC aff_gt12_subset_aff_ge[`x:real^3`;`v:real^3`;`w1:real^3`;`w:real^3`] THEN SUBGOAL_THEN`aff_gt {x} {w, v:real^3} SUBSET xfan(x,V:real^3->bool,E)` ASSUME_TAC THENL(*8*)[ REWRITE_TAC[xfan;SUBSET;IN_ELIM_THM] THEN GEN_TAC THEN STRIP_TAC THEN EXISTS_TAC`{v,w1}:real^3->bool` THEN MP_TAC(SET_RULE`x' IN aff_gt {x}{w,v}/\ aff_gt {x} {w, v} SUBSET aff_ge {x} {v, w1} ==> x' IN aff_ge {x:real^3} {v, w1}`) THEN RESA_TAC THEN ASM_TAC THEN SIMP_TAC[IN]; MRESA_TAC condition_aff_gt_subset_yfan[`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}={B,A}`] THEN REWRITE_TAC[yfan] THEN POP_ASSUM MP_TAC THEN MRESA_TAC exists_in_aff_gt_disjoint[`x:real^3`;`w:real^3`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN SET_TAC[]]]]]]]]]);;
let SIGMA_FAN_OF_FANADD_AT_POINT5=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w w1. FAN(x,V,E)/\ FAN(x,V,E1) /\ fan80(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ ~(w1=inverse1_sigma_fan x V E w u ) /\ {w,w1} IN E /\ sigma_fan x V E u w = v /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 w w1 = sigma_fan x V E w w1`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(w:real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`{w:real^3, w1} IN E /\ E UNION {{v,w}}=E1 ==>{w, w1} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E1 = {w1:real^3})\/ ~(set_of_edge w V E1 = {w1})`) THENL(*1*)[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC;(*1*) STRIP_TAC THEN REMOVE_THEN "YEU"(fun th-> MRESA1_TAC th`w:real^3` THEN POP_ASSUM MP_TAC THEN ASSUME_TAC(th)) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E = {w1:real^3})\/ ~(set_of_edge w V E = {w1})`) THENL(*2*)[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC;(*2*) STRIP_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC "MA") THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` ((sigma_fan x V E w w1):real^3)`;`(w:real^3)`] THEN POP_ASSUM MP_TAC THEN RESA_TAC THEN MP_TAC(SET_RULE`{w:real^3, sigma_fan x V E w w1} IN E /\ E UNION {{v,w}}=E1 ==>{w, sigma_fan x V E w w1} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` ((sigma_fan x V E w w1):real^3)`;`(w:real^3)`] THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`;`sigma_fan x V E w w1:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN ASM_SIMP_TAC[SET_RULE`x IN A==> x IN A UNION B`] THEN ASM_SIMP_TAC[UNION;IN_ELIM_THM;set_of_only_edge;IN_SING;SET_RULE`((A \/ B)/\ (~ B)) <=>A /\ ~ B`] THEN REPEAT STRIP_TAC THENL(*3*)[ REMOVE_THEN "MA"(fun th-> MRESA1_TAC th`w1':real^3`);(*3*) POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`;`(v:real^3)`] THEN ASM_SIMP_TAC[set_of_only_edge;IN_SING] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REPEAT STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` ((inverse1_sigma_fan x V E w u):real^3)`;`(w:real^3)`] THEN REMOVE_THEN "MA"(fun th-> MRESA1_TAC th`inverse1_sigma_fan x V E w (u:real^3)`) THEN MRESA_TAC MONO_AZIM_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`;`(inverse1_sigma_fan x V E w u):real^3`] THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(u=w1:real^3)\/ u=w1`) THENL(*4*)[ ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`w:real^3`;`w1:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{B,C}={C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w v u < azim x w (inverse1_sigma_fan x V E w u) u ==> azim x w v u <= azim x w (inverse1_sigma_fan x V E w u) (u:real^3)`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`;`(w:real^3)`] THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) u = azim x w (inverse1_sigma_fan x V E w u) v + azim x w v u /\ &0<= azim x w v u ==> azim x w (inverse1_sigma_fan x V E w u) v<=azim x w (inverse1_sigma_fan x V E w u) u `) THEN ASM_SIMP_TAC[azim] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) v <= azim x w (inverse1_sigma_fan x V E w u) u /\ azim x w w1 u = azim x w w1 (inverse1_sigma_fan x V E w u) + azim x w (inverse1_sigma_fan x V E w u) u /\ azim x w w1 u< &2 *pi ==> azim x w w1 (inverse1_sigma_fan x V E w u) + azim x w (inverse1_sigma_fan x V E w u) v < &2 *pi `) THEN SIMP_TAC[azim] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC sum3_azim_fan[`x:real^3`;`w:real^3`;`w1:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`] THEN MATCH_MP_TAC (REAL_ARITH`!A B C. A<= B/\ &0<= C==> A<= B +C`) THEN ASM_SIMP_TAC[azim];(*4*) POP_ASSUM(fun th -> ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{B,C}={C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w v u < azim x w (inverse1_sigma_fan x V E w u) u ==> azim x w v u <= azim x w (inverse1_sigma_fan x V E w u) (u:real^3)`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`;`(w:real^3)`] THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) u = azim x w (inverse1_sigma_fan x V E w u) v + azim x w v u /\ &0<= azim x w v u ==> azim x w (inverse1_sigma_fan x V E w u) v<=azim x w (inverse1_sigma_fan x V E w u) u `) THEN ASM_SIMP_TAC[azim] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) v <= azim x w (inverse1_sigma_fan x V E w u) u ==> azim x w u (inverse1_sigma_fan x V E w u) + azim x w (inverse1_sigma_fan x V E w u) v <= azim x w u (inverse1_sigma_fan x V E w u) + azim x w (inverse1_sigma_fan x V E w u) u `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`azim x w (inverse1_sigma_fan x V E w u) u = &0\/ ~(azim x w (inverse1_sigma_fan x V E w u) (u:real^3) = &0)`) THENL(*5*)[ MRESA_TAC UNIQUE_AZIM_0_POINT_FAN[`x:real^3`;` (V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`;`u:real^3`]; MRESAL_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`;`u:real^3`][REAL_ARITH`A-B+B=A`] THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[SYM th;REAL_ARITH`A<=B<=> A<B \/ A=B`]) THEN STRIP_TAC THENL(*6*)[ MRESA_TAC sum3_azim_fan[`x:real^3`;`w:real^3`;`u:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`] THEN MATCH_MP_TAC (REAL_ARITH`!A B C. A<= B/\ &0<= C==> A<= B +C`) THEN ASM_SIMP_TAC[azim]; POP_ASSUM MP_TAC THEN MRESAL_TAC AZIM_COMPL[`x:real^3`;`w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`;`u:real^3`][REAL_ARITH`A-B+C=A<=> B=C`] THEN STRIP_TAC THEN MRESA_TAC AZIM_EQ_ALT[`x:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`u:real^3`;`v:real^3`] THEN MRESA_TAC AZIM_EQ_0_ALT[`x:real^3`;`w:real^3`;`v:real^3`;`u:real^3`] THEN MRESA_TAC AZIM_EQ_0_PI_IMP_COPLANAR[`x:real^3`;`w:real^3`;`v:real^3`;`u:real^3`] THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) 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 EM1")) 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,D,B,C}`] THEN ASM_REWRITE_TAC[]]]]]]]);;
let SIGMA_FAN_OF_FANADD_AT_POINT6=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) v u w w1. FAN(x,V,E)/\ FAN(x,V,E1) /\ fan80(x,V,E) /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ w1=inverse1_sigma_fan x V E w u /\ {w,w1} IN E /\ sigma_fan x V E u w = v /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ E UNION {{v,w}}=E1 ==> sigma_fan x V E1 w w1 = v`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC add_edge_graph[`v:real^3`;`w:real^3`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(w:real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`{w:real^3, w1} IN E /\ E UNION {{v,w}}=E1 ==>{w, w1} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w1:real^3)`; `(w:real^3)`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `w:real^3`) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E1 = {w1:real^3})\/ ~(set_of_edge w V E1 = {w1})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN REMOVE_THEN "YEU"(fun th-> MRESA1_TAC th`w:real^3` THEN POP_ASSUM MP_TAC THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"YEU")) THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E = {w1:real^3})\/ ~(set_of_edge w V E = {w1})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; DISCH_THEN(LABEL_TAC"LINHYEU") THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` v:real^3`;`(w:real^3)`] THEN MRESA_TAC UNIQUE_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`;`v:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN STRIP_TAC THENL[ STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "EM"(fun th -> REWRITE_TAC[SYM th;SET_OF_EDGE_UNION_GRAPH]) THEN REWRITE_TAC[UNION;IN_ELIM_THM;IN_SING] THEN REPEAT STRIP_TAC THENL[(*4*) REMOVE_THEN "LINHYEU" MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(set_of_edge w V E = {w1':real^3})\/ ~(set_of_edge w V E = {w1'})`) THENL[ ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC; STRIP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`w1:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w1':real^3`) THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`] 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(REAL_ARITH`azim x w v u < azim x w (inverse1_sigma_fan x V E w u) u ==> azim x w v u <= azim x w (inverse1_sigma_fan x V E w u) (u:real^3)`) THEN RESA_TAC THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) u = azim x w (inverse1_sigma_fan x V E w u) v + azim x w v u /\ &0<= azim x w v u ==> azim x w (inverse1_sigma_fan x V E w u) v<=azim x w (inverse1_sigma_fan x V E w u) u `) THEN ASM_SIMP_TAC[azim] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_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 MRESAL_TAC set_of_only_edge1[`v:real^3`;`w:real^3`;`V:real^3->bool`][IN_SING] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN REAL_ARITH_TAC]]]]);;
let f1_fan_of_f10_eq_f20=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ f20=(x,v,u,w) /\ E UNION {{v,w}}= E1 ==> f20=f1_fan x V E1 f10`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE`{v,u:real^3} IN E /\ E UNION {{v,w}}= E1 ==> {v,u} IN E1`) THEN RESA_TAC THEN RESA_TAC);;
let f1_fan_of_f20_eq_f30=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f20=(x,v,u,w) /\ f30=(x,u,w,v) /\ E UNION {{v,w}}= E1 ==> f30=f1_fan x V E1 f20`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] 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 remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN MP_TAC(SET_RULE`~(v=u:real^3)/\ ~(u=w)==> ~(u IN {v,w})`) THEN RESA_TAC THEN DISCH_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`u:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w:real^3`) THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE`{u:real^3,w} IN E /\ E UNION {{v,w}}= E1 ==> {u,w} IN E1`) THEN RESA_TAC THEN RESA_TAC);;
let f1_fan_of_f30_eq_f10=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ f30=(x,u,w,v) /\ E UNION {{v,w}}= E1 ==> f10=f1_fan x V E1 f30`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`;`w:real^3` ] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`v:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MP_TAC(SET_RULE` E UNION {{v,w:real^3}}= E1 ==> {v,w} IN E1`) THEN RESA_TAC THEN RESA_TAC);;
let f10_in_d1_fanadd=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> f10 IN d1_fan (x,V,E1)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC f1_fan_of_f10_eq_f20[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)` ] THEN MRESA_TAC f1_fan_of_f20_eq_f30[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC f1_fan_of_f30_eq_f10[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f30:real^3#real^3#real^3#real^3)`; ] THEN MRESAL_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`;`w:real^3` ][d1_fan; IN_ELIM_THM] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E1 w v:real^3` THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REMOVE_THEN "EM"(fun th-> REWRITE_TAC[SYM th]) THEN SET_TAC[]);;
let pair_disjoint_f10_f20_f30=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ f20=(x,v,u,w) /\ f30=(x,u,w,v) /\ E UNION {{v,w}}= E1 ==> ~(f10= f20)/\ ~(f20= f30)/\ ~(f30=f10)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[EQ_PAIR_4;SET_RULE`~(A/\B)<=> ~ A\/ ~ B`] 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)`]);;
let n_fan_permutes_prime=
prove(`!x:real^3 V:real^3->bool (E:(real^3->bool)->bool) p. FAN(x,V,E) /\ p = ( \ t. res (t x V E ) (d1_fan (x,V,E))) ==> (p n_fan) permutes (d_fan (x,V,E))`,
REPEAT STRIP_TAC THEN MRESA_TAC finite_d_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN MRESA_TAC PERMUTES_FINITE_SURJECTIVE[`d_fan (x:real^3,V,E)`;`res (n_fan x V E) (d1_fan (x:real^3,V,E))`] THEN STRIP_TAC THENL[ REWRITE_TAC[res;d_fan;UNION;IN_ELIM_THM;DE_MORGAN_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[]; MRESA_TAC into_domain_n_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN REPEAT STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(y IN d1_fan (x,V,E) )\/ (y IN d1_fan (x:real^3,V,E))`) THENL[ EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[res]; MRESA_TAC permuters_of_enf_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN REWRITE_TAC[res] THEN EXISTS_TAC`b:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC subset_d_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN ASM_TAC THEN SET_TAC[]]]);;
let f1_fan_permutes_prime=
prove(`!x:real^3 V:real^3->bool (E:(real^3->bool)->bool) p. FAN(x,V,E) /\ p = ( \ t. res (t x V E ) (d1_fan (x,V,E))) ==> (p f1_fan) permutes (d_fan (x,V,E))`,
REPEAT STRIP_TAC THEN MRESA_TAC finite_d_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN MRESA_TAC PERMUTES_FINITE_SURJECTIVE[`d_fan (x:real^3,V,E)`;`res (f1_fan x V E) (d1_fan (x:real^3,V,E))`] THEN STRIP_TAC THENL[ REWRITE_TAC[res;d_fan;UNION;IN_ELIM_THM;DE_MORGAN_THM] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[]; MRESA_TAC into_domain_f1_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN REPEAT STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(y IN d1_fan (x,V,E) )\/ (y IN d1_fan (x:real^3,V,E))`) THENL[ EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[res]; MRESA_TAC permuters_of_enf_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN REWRITE_TAC[res] THEN EXISTS_TAC`b:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC subset_d_fan[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`] THEN ASM_TAC THEN SET_TAC[]]]);;
let card_ds2_fanadd_eq3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> CARD ds2=3`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC f1_fan_of_f10_eq_f20[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)` ] THEN MRESA_TAC f1_fan_of_f20_eq_f30[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC f1_fan_of_f30_eq_f10[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f30:real^3#real^3#real^3#real^3)`; ] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM YEU") THEN MRESAL_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`;`w:real^3` ][face;orbit_map] THEN MRESA_TAC f10_in_d1_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`3:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`2:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`1:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESAL_TAC card_orbit_le[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`3:num`;`(f10:real^3#real^3#real^3#real^3)`][ARITH_RULE`~(3=0)`;ARITH_RULE`3=SUC 2`;POWER_2;POWER;o_DEF] THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "EM YEU"(fun th -> REWRITE_TAC[SYM th;ARITH_RULE`SUC 2=3`;]) THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`0:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f10:real^3#real^3#real^3#real^3)`] [POWER;I_DEF] THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`1:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`] [POWER_1] THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`2:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`] [POWER_2;o_DEF] THEN MP_TAC(SET_RULE`f10 IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 /\ f1_fan x V E1 f10 IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 /\ f1_fan x V E1 (f1_fan x V E1 f10) IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 ==> {f10, f1_fan x V E1 f10,f1_fan x V E1 (f1_fan x V E1 f10)} SUBSET orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10`) THEN RESA_TAC THEN MRESA_TAC pair_disjoint_f10_f20_f30[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN SUBGOAL_THEN(`CARD {f10,f20,f30:real^3#real^3#real^3#real^3}=3`)ASSUME_TAC THENL[ SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ASM_REWRITE_TAC[] THEN ARITH_TAC; POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC f1_fan_permutes_prime[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC finite_d_fan[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`] THEN MRESA_TAC lemma_orbit_finite[`d1_fan(x:real^3,V,E1)`;`(res (f1_fan x V E1) (d1_fan (x:real^3,V,E1)))`;`(f10:real^3#real^3#real^3#real^3)`] THEN MRESAL_TAC CARD_SUBSET_LE[`{f10, f1_fan x V E1 f10, f1_fan (x:real^3) V E1 (f1_fan x V E1 f10)}`;`orbit_map (res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))) f10`;][orbit_map] ]);;
let reperentation_of_ds2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> ds2={f10,f20,f30}`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC f1_fan_of_f10_eq_f20[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)` ] THEN MRESA_TAC f1_fan_of_f20_eq_f30[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC f1_fan_of_f30_eq_f10[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f30:real^3#real^3#real^3#real^3)`; ] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM YEU") THEN MRESAL_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `u:real^3`;`w:real^3` ][face;orbit_map] THEN MRESA_TAC f10_in_d1_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`3:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`2:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`1:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`f10:real^3#real^3#real^3#real^3` ) THEN MRESAL_TAC card_orbit_le[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`3:num`;`(f10:real^3#real^3#real^3#real^3)`][ARITH_RULE`~(3=0)`;ARITH_RULE`3=SUC 2`;POWER_2;POWER;o_DEF] THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "EM YEU"(fun th -> REWRITE_TAC[SYM th;ARITH_RULE`SUC 2=3`;]) THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`0:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f10:real^3#real^3#real^3#real^3)`] [POWER;I_DEF] THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`1:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`] [POWER_1] THEN MRESAL_TAC in_orbit_lemma[`res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))`;`2:num`;`(f10:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`] [POWER_2;o_DEF] THEN MP_TAC(SET_RULE`f10 IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 /\ f1_fan x V E1 f10 IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 /\ f1_fan x V E1 (f1_fan x V E1 f10) IN orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10 ==> {f10, f1_fan x V E1 f10,f1_fan x V E1 (f1_fan x V E1 f10)} SUBSET orbit_map (res (f1_fan x V E1) (d1_fan (x,V,E1))) f10`) THEN RESA_TAC THEN MRESA_TAC pair_disjoint_f10_f20_f30[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN SUBGOAL_THEN(`CARD {f10,f20,f30:real^3#real^3#real^3#real^3}=3`)ASSUME_TAC THENL[ SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ASM_REWRITE_TAC[] THEN ARITH_TAC; POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC f1_fan_permutes_prime[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC finite_d_fan[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`] THEN MRESA_TAC lemma_orbit_finite[`d1_fan(x:real^3,V,E1)`;`(res (f1_fan x V E1) (d1_fan (x:real^3,V,E1)))`;`(f10:real^3#real^3#real^3#real^3)`] THEN MRESAL_TAC CARD_SUBSET_LE[`{f10, f1_fan x V E1 f10, f1_fan (x:real^3) V E1 (f1_fan x V E1 f10)}`;`orbit_map (res (f1_fan x V E1) (d1_fan (x:real^3,V,E1))) f10`;][orbit_map]]);;
let edge_not_in_ds2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ f10=(x,w,v,u) /\ f20=(x,v,u,w) /\ f30=(x,u,w,v) /\ E UNION {{v,w}}=E1 ==> ~((x,v,w,sigma_fan x V E1 v w) IN ds2)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN MRESAL_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ][SET_RULE`~(a IN {b,c,d})<=> ~(a=b)/\ ~(a=c)/\ ~(a=d) `;EQ_PAIR_4;SET_RULE`~(A/\B)<=> ~ A\/ ~ B`] 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 ASM_TAC THEN DISJ_CASES_TAC(SET_RULE`v=w \/ ~(v=w:real^3)`) THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MRESA_TAC SIGMA_FAN [`(x:real^3)`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`; ` w:real^3`] THEN FIND_ASSUM (MP_TAC)`(!v. v IN V==>CARD (set_of_edge (v:real^3) V E) > 1)` THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC (ISPEC `u:real^3` th) ) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY] THEN ARITH_TAC);;
let disjoint_ds1_and_ds2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> ~(ds1=ds2)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN MRESA_TAC edge_not_in_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;face;orbit_map;IN_ELIM_THM]) THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]);;
let card_eq_image_in_d_fan=
prove(`!x V E ds. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) >1)/\ ds SUBSET d_fan(x,V,E) ==> CARD(IMAGE pr23 ds)= CARD ds`,
REPEAT STRIP_TAC THEN MATCH_MP_TAC CARD_IMAGE_INJ THEN MRESA_TAC finite_d_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN MRESA_TAC FINITE_SUBSET[`ds:real^3#real^3#real^3#real^3->bool`; `d_fan(x:real^3,V,E):real^3#real^3#real^3#real^3->bool`] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE`x' IN ds /\ y IN ds /\ ds SUBSET d_fan(x,V,E)==> x' IN d_fan(x:real^3,V,E)/\ y IN d_fan(x,V,E)`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN REWRITE_TAC[d_fan;UNION;d1_fan;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[pr23;PAIR_EQ] THEN RESA_TAC);;
let trans=new_definition`trans (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) E1=(\(x,y:real^3,z,sigma_fan x V E y z). (x,y,z,sigma_fan x V E1 y z))`
;;
let tran=new_definition`tran x V E1=(\(x,y:real^3,z,w). (x,y,z,sigma_fan x V E1 y z))`
;;
let tranf=new_definition`tranf x V E E1 ds=(@f. ?y. f = face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 y)/\ y IN ds)`
;;
let exists_tranf_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> ?f. ?y. f = face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 y)/\ y IN ds0`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MP_TAC(SET_RULE` ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> ds0 IN face_set (hypermap1_of_fanx (x,V,E)) `) THEN ASM_REWRITE_TAC[face_set;set_of_orbits;IN_ELIM_THM;] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISCH_THEN(LABEL_TAC"EM") THEN REMOVE_THEN "YEU" MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN REMOVE_THEN "EM" MP_TAC THEN RESA_TAC THEN EXISTS_TAC`face (hypermap1_of_fanx (x:real^3,V,E1)) (tran x V E1 (x':real^3#real^3#real^3#real^3))` THEN EXISTS_TAC`x':real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[tran;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]);;
let TRANF=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> ?y. tranf x V E E1 ds0 = face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 y)/\ y IN ds0`,
REPEAT GEN_TAC THEN STRIP_TAC THEN ONCE_REWRITE_TAC[tranf] THEN MRESA_TAC exists_tranf_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;`ds0:real^3#real^3#real^3#real^3->bool` ] THEN SELECT_ELIM_TAC THEN EXISTS_TAC`f:real^3#real^3#real^3#real^3->bool` THEN EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[]);;
let exists_edge_not_edge_in_face=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y n:num. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ y IN d_fan(x,V,E) ==> ?y1. y1 IN d_fan(x,V,E)/\ ~(pr2 y1 IN {v,w})/\ face (hypermap1_of_fanx (x,V,E)) y1= face (hypermap1_of_fanx (x,V,E)) y `,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(pr2 y IN {v,w})\/ pr2 y IN {v,w}`) THENL[ EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[]; POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`A IN {B,C}<=> A=B\/ A=C`] THEN STRIP_TAC THENL[ EXISTS_TAC`f1_fan x V E (y:real^3#real^3#real^3#real^3)` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC into_domain1_f1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN SUBGOAL_THEN`f1_fan x V E y IN face (hypermap1_of_fanx (x:real^3,V,E)) y` ASSUME_TAC THENL[ ASM_REWRITE_TAC[face;IN_ELIM_THM;orbit_map;] THEN EXISTS_TAC`1:num` THEN REWRITE_TAC[ARITH_RULE`1>=0`;] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`1:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN REWRITE_TAC[POWER_1]; MRESA_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`y:real^3#real^3#real^3#real^3`;`(f1_fan x V E y):real^3#real^3#real^3#real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[d1_fan; IN_ELIM_THM;] THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;pr2] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN 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 REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]]; EXISTS_TAC`f1_fan x V E (y:real^3#real^3#real^3#real^3)` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC into_domain1_f1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN SUBGOAL_THEN`f1_fan x V E y IN face (hypermap1_of_fanx (x:real^3,V,E)) y` ASSUME_TAC THENL[ ASM_REWRITE_TAC[face;IN_ELIM_THM;orbit_map;] THEN EXISTS_TAC`1:num` THEN REWRITE_TAC[ARITH_RULE`1>=0`;] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`1:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN REWRITE_TAC[POWER_1]; MRESA_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`y:real^3#real^3#real^3#real^3`;`(f1_fan x V E y):real^3#real^3#real^3#real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[d1_fan; IN_ELIM_THM;] THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;pr2] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN REPEAT STRIP_TAC THEN REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (w':real^3)`; `(v':real^3)`]]]]);;
let TRAN_COMMUTATIVE_F1_FAN1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(pr3 y IN {v,w}) /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E ) y)=(f1_fan x V E1 ) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;tran;PAIR_EQ] THEN REMOVE_THEN"EMYEU" MP_TAC THEN ASM_REWRITE_TAC[pr3] THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MRESA_TAC th[`w':real^3`;`(inverse1_sigma_fan (x:real^3) V E w' v')`]) THEN POP_ASSUM MP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w':real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REPEAT RESA_TAC THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(RAND_CONV o ONCE_DEPTH_CONV)[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w':real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`inverse1_sigma_fan x V E w' (v':real^3)`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MP_TAC(SET_RULE`{inverse1_sigma_fan x V E w' v', w'} IN E /\ E1= E UNION {{v,w}}==> {inverse1_sigma_fan x V E w' v', w'} IN E1`) THEN REPEAT RESA_TAC);;
let TRAN_COMMUTATIVE_F1_FAN2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(pr2 y= u) /\ pr3 y = w /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E ) y)=(f1_fan x V E1 ) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;tran;PAIR_EQ] THEN REMOVE_THEN"EMYEU" MP_TAC THEN ASM_REWRITE_TAC[pr3] THEN DISCH_THEN(LABEL_TAC"LINH") THEN REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[pr2] THEN RESA_TAC THEN SUBGOAL_THEN(`~(inverse1_sigma_fan (x:real^3) V E w v'=inverse1_sigma_fan x V E w u)`) ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN STRIP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`u:real^3` THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REMOVE_THEN "LINH"(fun th-> ASM_REWRITE_TAC[SYM th] THEN ASSUME_TAC th THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH")) THEN RESA_TAC THEN MRESA1_TAC th`v':real^3` THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "LINH"(fun th-> ASM_REWRITE_TAC[SYM th] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC)); MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "LINH"(fun th-> ASM_REWRITE_TAC[SYM th] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ASSUME_TAC th) THEN RESA_TAC THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT5[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w v'):real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`inverse1_sigma_fan x V E w (v':real^3)`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MP_TAC(SET_RULE`{inverse1_sigma_fan x V E w v', w} IN E /\ E1= E UNION {{v,w}}==> {inverse1_sigma_fan x V E w v', w} IN E1`) THEN REPEAT RESA_TAC]);;
let TRAN_COMMUTATIVE_F1_FAN3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(pr2 y= sigma_fan x V E v u) /\ pr3 y = v /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E ) y)=(f1_fan x V E1 ) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;tran;PAIR_EQ] THEN REMOVE_THEN"EMYEU" MP_TAC THEN ASM_REWRITE_TAC[pr3] THEN DISCH_THEN(LABEL_TAC"LINH") THEN REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[pr2] THEN RESA_TAC THEN SUBGOAL_THEN(`~(u=inverse1_sigma_fan (x:real^3) V E v v')`) ASSUME_TAC THENL[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3` THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REMOVE_THEN "LINH"(fun th-> ASM_REWRITE_TAC[SYM th] THEN ASSUME_TAC th THEN RESA_TAC)); MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3` THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN REMOVE_THEN "LINH"(fun th-> ASM_REWRITE_TAC[SYM th] THEN ASSUME_TAC th THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[SYM th] THEN ASSUME_TAC th THEN RESA_TAC )) THEN STRIP_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT4[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E v v'):real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`inverse1_sigma_fan x V E v (v':real^3)`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MP_TAC(SET_RULE`{inverse1_sigma_fan x V E v v', v} IN E /\ E1= E UNION {{v,w}}==> {inverse1_sigma_fan x V E v v', v} IN E1`) THEN REPEAT RESA_TAC]);;
let TRAN_COMMUTATIVE_F1_FAN=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(y IN ds) /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E ) y)=(f1_fan x V E1 ) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE` ((pr2 y= sigma_fan x V E v u)/\ pr3 y = v)\/ ((pr2 y= u)/\ pr3 y = w)\/ (~(pr2 y= sigma_fan x V E v u)/\ pr3 y = v)\/ (~(pr2 y= u)/\ pr3 y = w)\/ ~(pr3 y IN {v,w})`) THENL[ POP_ASSUM MP_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN REMOVE_THEN "LINH" ( fun th->MP_TAC th THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN MP_TAC th THEN RESA_TAC) THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;tran;PAIR_EQ] THEN REMOVE_THEN"EMYEU" MP_TAC THEN ASM_REWRITE_TAC[pr2] THEN RESA_TAC THEN REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[pr3] THEN RESA_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"EMYEU") THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN STRIP_TAC THEN STRIP_TAC THEN REMOVE_THEN"YEU EM" MP_TAC THEN REMOVE_THEN"EMYEU" MP_TAC THEN RESA_TAC THEN STRIP_TAC THEN SUBGOAL_THEN`f1= f1_fan x V E (y:real^3#real^3#real^3#real^3)`ASSUME_TAC THENL[ ASM_REWRITE_TAC[f1_fan] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`u:real^3` ) THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds /\ ds SUBSET d1_fan (x,V,E)==> {f1,f2,f3} SUBSET (ds:real^3#real^3#real^3#real^3->bool)/\ f1 IN d1_fan (x,V,E) `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr2 f1 =v:real^3` THEN FIND_ASSUM(MP_TAC)`pr3 f1= u :real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;pr2;pr3]) THEN RESA_TAC THEN RESA_TAC; POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN DISCH_THEN(fun th-> ASSUME_TAC(SYM th)) THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds /\ ds SUBSET d1_fan (x,V,E)==> {f1,f2,f3} SUBSET (ds:real^3#real^3#real^3#real^3->bool)/\ f1 IN ds `) THEN RESA_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`f1:real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`]]; POP_ASSUM MP_TAC THEN STRIP_TAC THENL[ POP_ASSUM MP_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_THEN(LABEL_TAC"EMYEU") THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN REMOVE_THEN "LINH" ( fun th->MP_TAC th THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN MP_TAC th THEN RESA_TAC) THEN RESA_TAC THEN ASM_REWRITE_TAC[f1_fan;tran;PAIR_EQ] THEN REMOVE_THEN"EMYEU" MP_TAC THEN ASM_REWRITE_TAC[pr2] THEN RESA_TAC THEN REMOVE_THEN"YEU EM" MP_TAC THEN ASM_REWRITE_TAC[pr3] THEN RESA_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"EMYEU") THEN DISCH_THEN(LABEL_TAC"YEU EM") THEN STRIP_TAC THEN STRIP_TAC THEN REMOVE_THEN"YEU EM" MP_TAC THEN REMOVE_THEN"EMYEU" MP_TAC THEN RESA_TAC THEN STRIP_TAC THEN SUBGOAL_THEN`f2= (y:real^3#real^3#real^3#real^3)`ASSUME_TAC THENL[ MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds /\ ds SUBSET d1_fan (x,V,E)==> {f1,f2,f3} SUBSET (ds:real^3#real^3#real^3#real^3->bool)/\ f2 IN d1_fan (x,V,E) `) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr2 f2 =u:real^3` THEN FIND_ASSUM(MP_TAC)`pr3 f2= w :real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;pr2;pr3]) THEN RESA_TAC THEN RESA_TAC; POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN DISCH_TAC THEN MP_TAC(SET_RULE`{f1,f2,f3:real^3#real^3#real^3#real^3} SUBSET ds ==> f2 IN ds `) THEN RESA_TAC]; MRESA_TAC TRAN_COMMUTATIVE_F1_FAN3 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`]; MRESA_TAC TRAN_COMMUTATIVE_F1_FAN2 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`]; MRESA_TAC TRAN_COMMUTATIVE_F1_FAN1 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`]]]);;
let f1_fan_power_in_face=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y n. FAN(x,V,E)/\ (!v. v IN V ==> CARD (set_of_edge v V E) > 1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E))/\ y IN d1_fan (x,V,E) /\ ~(y IN ds) ==> ~((f1_fan x V E POWER n) y IN ds)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[] THEN MATCH_MP_TAC MONO_NOT THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ ASM_REWRITE_TAC[POWER;I_DEF]; REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN MP_TAC(SET_RULE`(f1_fan x V E POWER n) y IN d1_fan (x,V,E)/\ d_fan (x,V,E)=d1_fan (x,V,E) UNION d20_fan (x,V,E) ==> (f1_fan x V E POWER n) y IN d_fan (x,V,E)`) THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o DEPTH_CONV)[d_fan] THEN RESA_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E ((f1_fan x V E POWER n) y)):real^3#real^3#real^3#real^3`;`((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3`]]);;
let f1_fan_power_in_face_imp_in_face=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) ds y n. FAN(x,V,E)/\ (!v. v IN V ==> CARD (set_of_edge v V E) > 1) /\ ds IN face_set (hypermap1_of_fanx (x,V,E))/\ y IN d1_fan (x,V,E) /\ ((f1_fan x V E POWER n) y IN ds) ==> (y IN ds)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ ASM_REWRITE_TAC[POWER;I_DEF]; REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN MP_TAC(SET_RULE`(f1_fan x V E POWER n) y IN d1_fan (x,V,E)/\ d_fan (x,V,E)=d1_fan (x,V,E) UNION d20_fan (x,V,E) ==> (f1_fan x V E POWER n) y IN d_fan (x,V,E)`) THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o DEPTH_CONV)[d_fan] THEN RESA_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E ((f1_fan x V E POWER n) y)):real^3#real^3#real^3#real^3`;`((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3`]]);;
let TRAN_COMMUTATIVE_F1_FAN0=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ((~(pr2 y= sigma_fan x V E v u)/\ pr3 y = v)\/ (~(pr2 y= u)/\ pr3 y = w) \/ ~(pr3 y IN {v,w})) /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E ) y)=(f1_fan x V E1 ) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN1 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN2 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN3 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`]);;
let TRAN_COMMUTATIVE_F1_FAN_POWER=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y n. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(y IN ds) /\ y IN d_fan(x,V,E) ==> tran x V E1 ((f1_fan x V E POWER n) y)=(f1_fan x V E1 POWER n) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ REWRITE_TAC[POWER;I_DEF]; REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN ASM_SIMP_TAC[f1_fan_power_in_face]]);;
let TRAN_COMMUTATIVE_F1_FAN_POWER1=
prove( `!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y n. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ y IN d_fan(x,V,E) /\ (!m. m < n ==> ~(pr3 ((f1_fan x V E POWER m) y) IN {v,w})) ==> tran x V E1 ((f1_fan x V E POWER n) y)=(f1_fan x V E1 POWER n) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ REWRITE_TAC[POWER;I_DEF]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINK") THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_TAC THEN SUBGOAL_THEN`(!m. m < n ==> ~(pr3 ((f1_fan x V E POWER m) y) IN {v, w:real^3}))` ASSUME_TAC THENL[ REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC (ARITH_RULE`!m n. m<n ==> m< SUC n`)[`m:num`;`n:num`]; REMOVE_THEN "LINH" MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESAL1_TAC th`n:num`[ARITH_RULE`n< SUC n`]) THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN1 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN REMOVE_THEN "LINK" MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN ASM_SIMP_TAC[f1_fan_power_in_face]]]);;
let TRAN_COMMUTATIVE_F1_FAN_POWER2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y n. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ y IN d_fan(x,V,E) /\ (!m. m < n ==> ((~(pr2 ((f1_fan x V E POWER m) y)= sigma_fan x V E v u)/\ pr3 ((f1_fan x V E POWER m) y) = v)\/ (~(pr2 ((f1_fan x V E POWER m) y)= u)/\ pr3 ((f1_fan x V E POWER m) y) = w)) ) ==> tran x V E1 ((f1_fan x V E POWER n) y)=(f1_fan x V E1 POWER n) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ REWRITE_TAC[POWER;I_DEF]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINK") THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_TAC THEN SUBGOAL_THEN`(!m. m < n ==> ((~(pr2 ((f1_fan x V E POWER m) y)= sigma_fan x V E v u)/\ pr3 ((f1_fan x V E POWER m) y) = v)\/ (~(pr2 ((f1_fan x V E POWER m) y)= u)/\ pr3 ((f1_fan x V E POWER m) y) = w:real^3)) )` ASSUME_TAC THENL[ REPEAT STRIP_TAC THEN MRESA_TAC (ARITH_RULE`!m n. m<n ==> m< SUC n`)[`m:num`;`n:num`]; REMOVE_THEN "LINH" MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESAL1_TAC th`n:num`[ARITH_RULE`n< SUC n`]) THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN0 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN REMOVE_THEN "LINK" MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN ASM_SIMP_TAC[f1_fan_power_in_face]]]);;
let TRAN_COMMUTATIVE_F1_FAN_POWER3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y n. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ y IN d_fan(x,V,E) /\ (!m. m < n ==> (~(pr2 ((f1_fan x V E POWER m) y) = sigma_fan x V E v u) /\ pr3 ((f1_fan x V E POWER m) y) = v) \/ (~(pr2 ((f1_fan x V E POWER m) y) = u) /\ pr3 ((f1_fan x V E POWER m) y) = w) \/ ~(pr3 ((f1_fan x V E POWER m) y) IN {v, w})) ==> tran x V E1 ((f1_fan x V E POWER n) y)=(f1_fan x V E1 POWER n) (tran x V E1 y)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN SPEC_TAC (`n:num`,`n:num`) THEN INDUCT_TAC THENL[ REWRITE_TAC[POWER;I_DEF]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINK") THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_TAC THEN SUBGOAL_THEN`(!m. m < n ==> (~(pr2 ((f1_fan x V E POWER m) y) = sigma_fan x V E v u) /\ pr3 ((f1_fan x V E POWER m) y) = v) \/ (~(pr2 ((f1_fan x V E POWER m) y) = u) /\ pr3 ((f1_fan x V E POWER m) y) = w) \/ ~(pr3 ((f1_fan x V E POWER m) y) IN {v, w}) )` ASSUME_TAC THENL[ REPEAT STRIP_TAC THEN MRESA_TAC (ARITH_RULE`!m n. m<n ==> m< SUC n`)[`m:num`;`n:num`]; REMOVE_THEN "LINH" MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESAL1_TAC th`n:num`[ARITH_RULE`n< SUC n`]) THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN0 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(((f1_fan x V E POWER n) y):real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN REMOVE_THEN "LINK" MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3`) THEN ASM_SIMP_TAC[f1_fan_power_in_face]]]);;
let unique_tranf_fan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0 f y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ f= face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 y)/\ y IN ds0 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> tranf x V E E1 ds0 = f`,
REPEAT STRIP_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[DELETE;IN_ELIM_THM] THEN STRIP_TAC THEN ASSUME_TAC th) THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC TRANF[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;`ds0:real^3#real^3#real^3#real^3->bool` ] THEN FIND_ASSUM(MP_TAC) `ds0 IN face_set (hypermap1_of_fanx (x:real^3,V,E))` THEN REWRITE_TAC[face_set;set_of_orbits;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[face_set;set_of_orbits;IN_ELIM_THM] THEN SUBGOAL_THEN`orbit_map (res (f1_fan x V E) (d1_fan (x,V,E))) x'=face (hypermap1_of_fanx (x:real^3,V,E)) x'`(fun th-> REWRITE_TAC[th]) THENL[ ASM_REWRITE_TAC[face]; STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC lemma_face_subset[`hypermap1_of_fanx (x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`] THEN MP_TAC(SET_RULE`face (hypermap1_of_fanx (x,V,E)) x' SUBSET d1_fan (x,V,E) /\ y IN face (hypermap1_of_fanx (x,V,E)) x' ==> y IN d1_fan(x,V,E)`) THEN RESA_TAC THEN MRESA_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`] THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN DISCH_TAC THEN REMOVE_THEN "EM" MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[face;] THEN ASM_REWRITE_TAC[IN_ELIM_THM;orbit_map] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN RESA_TAC THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN_POWER [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`;`n:num`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x:real^3,V,E1)) ((f1_fan x V E1 POWER n) (tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3)))):real^3#real^3#real^3#real^3->bool`;`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3)):real^3#real^3#real^3#real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN SUBGOAL_THEN`face (hypermap1_of_fanx (x,V,E1)) ((f1_fan x V E1 POWER n) (tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))) IN face_set (hypermap1_of_fanx (x:real^3,V,E1))`ASSUME_TAC THENL[ ASM_REWRITE_TAC[face_set;IN_ELIM_THM;set_of_orbits;face] THEN EXISTS_TAC`(f1_fan (x:real^3) V E1 POWER n) (tran x V E1 (y:real^3#real^3#real^3#real^3))` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))`) THEN POP_ASSUM MATCH_MP_TAC THEN FIND_ASSUM(MP_TAC)`y IN d1_fan (x:real^3,V,E)` THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN ASM_REWRITE_TAC[tran] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E1 v' (w':real^3)` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM] THEN ASM_REWRITE_TAC[])` E UNION {{v:real^3,w}}= E1`; MRESA_TAC f1_fan_power_in_face_imp_in_face[`x:real^3`;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool)`; `(face (hypermap1_of_fanx (x,V,E1)) ((f1_fan x V E1 POWER n) (tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3)))):real^3#real^3#real^3#real^3->bool`;`tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3)` ;`n:num`] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN STRIP_TAC THENL[ FIND_ASSUM(MP_TAC)`y IN d1_fan (x:real^3,V,E)` THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN ASM_REWRITE_TAC[tran] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E1 v' (w':real^3)` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM] THEN ASM_REWRITE_TAC[])` E UNION {{v:real^3,w}}= E1`; EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]]]]);;
let tran_in_dart_newfan=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 y . FAN(x,V,E)/\ FAN(x,V,E1) /\ E SUBSET E1 /\ y IN d1_fan(x,V,E) ==> tran x V E1 y IN d1_fan(x,V,E1)`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN RESA_TAC THEN REWRITE_TAC[tran] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`sigma_fan x V E1 v (w:real^3)` THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN SET_TAC[]);;
let INJ_TRAN_D1_FAN=
prove(` !x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 y y1. FAN(x,V,E)/\ FAN(x,V,E1) /\ E SUBSET E1 /\ y IN d1_fan(x,V,E) /\ y1 IN d1_fan(x,V,E) /\ tran x V E1 y = tran x V E1 y1 ==> y =y1`,
REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[tran;PAIR_EQ] THEN RESA_TAC);;
let INJ_TRANF_FACE_DELETE_DS= 
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0 ds0'. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds /\ ds0' IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds /\ tranf x V E E1 ds0=tranf x V E E1 ds0' ==> ds0 = ds0'`,
REPEAT STRIP_TAC THEN MRESA_TAC TRANF[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;`ds0:real^3#real^3#real^3#real^3->bool` ] THEN SUBGOAL_THEN`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3)) IN face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 y)`ASSUME_TAC THENL[ REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]; POP_ASSUM MP_TAC THEN MRESA_TAC TRANF[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;`ds0':real^3#real^3#real^3#real^3->bool` ] THEN REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM(MP_TAC)`ds0' IN face_set (hypermap1_of_fanx (x:real^3,V,E)) DELETE ds` THEN REWRITE_TAC[DELETE;IN_ELIM_THM] THEN RESA_TAC THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0':real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y' IN ds0'/\ ds0' SUBSET d1_fan (x:real^3,V,E)==> y' IN d1_fan (x,V,E)`) THEN RESA_TAC THEN FIND_ASSUM(MP_TAC)`ds0 IN face_set (hypermap1_of_fanx (x:real^3,V,E)) DELETE ds` THEN REWRITE_TAC[DELETE;IN_ELIM_THM] THEN RESA_TAC THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y IN ds0/\ ds0 SUBSET d1_fan (x:real^3,V,E)==> y IN d1_fan (x,V,E)`) THEN RESA_TAC THEN MP_TAC(SET_RULE`E UNION {{v:real^3,w}}= E1==> E SUBSET E1`) THEN RESA_TAC THEN MRESA_TAC tran_in_dart_newfan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(E1:(real^3->bool)->bool)`; `y':real^3#real^3#real^3#real^3`] THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`n:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`tran (x:real^3) V E1 (y':real^3#real^3#real^3#real^3)`) THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0':real^3#real^3#real^3#real^3->bool`;`y':real^3#real^3#real^3#real^3`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y':real^3#real^3#real^3#real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN_POWER [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y':real^3#real^3#real^3#real^3)`;`n:num`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`n:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(y':real^3#real^3#real^3#real^3)`) THEN MRESA_TAC INJ_TRAN_D1_FAN [`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(E1:(real^3->bool)->bool)`; `y:real^3#real^3#real^3#real^3`;`(f1_fan x V E POWER n) (y':real^3#real^3#real^3#real^3)`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0':real^3#real^3#real^3#real^3->bool`;`y':real^3#real^3#real^3#real^3`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(face (hypermap1_of_fanx (x:real^3,V,E)) ((f1_fan x V E POWER n) (y':real^3#real^3#real^3#real^3))):real^3#real^3#real^3#real^3->bool`;` (y':real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MATCH_MP_TAC THEN SUBGOAL_THEN`face (hypermap1_of_fanx (x:real^3,V,E)) ((f1_fan x V E POWER n) y') IN face_set (hypermap1_of_fanx (x,V,E))`ASSUME_TAC THENL[ REWRITE_TAC[face_set;set_of_orbits;IN_ELIM_THM] THEN EXISTS_TAC`(f1_fan x V E POWER n) (y':real^3#real^3#real^3#real^3)` THEN ASM_REWRITE_TAC[face]; MRESA_TAC f1_fan_power_in_face_imp_in_face[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(face (hypermap1_of_fanx (x,V,E)) ((f1_fan x V E POWER n) (y':real^3#real^3#real^3#real^3))):real^3#real^3#real^3#real^3->bool`;`(y':real^3#real^3#real^3#real^3)` ;`n:num`] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF]]]);;
let ds1_in_face_set_fanadd=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1=face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2=face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> ds1 IN face_set (hypermap1_of_fanx (x,V,E1))`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[face_set;face;set_of_orbits;IN_ELIM_THM] THEN EXISTS_TAC`(x,v:real^3,w,sigma_fan x V E1 v w)` THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`sigma_fan x V E1 v w:real^3` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM;IN_SING] THEN ASM_REWRITE_TAC[])` E UNION {{v:real^3,w}}= E1`);;
let ds2_in_face_set_fanadd=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ ds2=face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> ds2 IN face_set (hypermap1_of_fanx (x,V,E1))`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[face_set;face;set_of_orbits;IN_ELIM_THM] THEN EXISTS_TAC`(x,w:real^3,v,sigma_fan x V E1 w v)` THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E1 w v:real^3` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM;IN_SING] THEN ASM_REWRITE_TAC[])` E UNION {{v:real^3,w}}= E1` THEN SET_TAC[]);;
let condition_f1_fan_power_in_face_set=
prove(`!n:num x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) y y1 ds. FAN(x,V,E) /\ y = (f1_fan x V E POWER n) y1 /\ ds IN face_set (hypermap1_of_fanx (x,V,E)) /\ d_fan (x,V,E) =d1_fan (x,V,E) /\ y1 IN ds ==> y IN ds`,
INDUCT_TAC THENL[MESON_TAC[POWER;I_DEF]; POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN REPEAT STRIP_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESAL_TAC th[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f1_fan x V E POWER n) y1:real^3#real^3#real^3#real^3`;`y1:real^3#real^3#real^3#real^3`;`ds:real^3#real^3#real^3#real^3->bool`;][COM_POWER;o_DEF]) THEN MRESA_TAC condition_f1_fan_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`(f1_fan x V E ((f1_fan x V E POWER n) y1):real^3#real^3#real^3#real^3)` ;`((f1_fan x V E POWER n) y1:real^3#real^3#real^3#real^3)`;`ds:real^3#real^3#real^3#real^3->bool`]]);;
let SUR_TRANF_FACE_DELETE_DS =
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 f. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ f IN (face_set (hypermap1_of_fanx (x,V,E1)) DELETE ds1 ) DELETE ds2 ==> ?ds0. ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds /\ tranf x V E E1 ds0=f`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN ASM_REWRITE_TAC[DELETE;IN_ELIM_THM;face_set;set_of_orbits;] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC) `x' IN d1_fan (x:real^3,V,E1)` THEN GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[d1_fan;] THEN REWRITE_TAC[IN_ELIM_THM;] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"NHO") THEN SUBGOAL_THEN`{v', w':real^3} IN E`ASSUME_TAC THENL(*1*)[ FIND_ASSUM(MP_TAC) `{v', w':real^3} IN E1` THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM;IN_SING;SET_RULE`{v', w'} = {v, w}<=> (v'=v/\ w'=w)\/ (v'=w/\ w'=v)`]) `E UNION {{v:real^3, w}} = E1` THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM(fun th -> ASM_TAC THEN ASM_REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC)`face_map (hypermap1_of_fanx (x:real^3,V,E1)) = res (f1_fan x V E1) (d1_fan (x,V,E1))` THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN SET_TAC[];(*1*) ABBREV_TAC`y=(x,(v':real^3),w',sigma_fan x V E v' w')` THEN SUBGOAL_THEN`y IN d1_fan(x:real^3,V,E)`ASSUME_TAC THENL(*2*)[ ASM_REWRITE_TAC[face;d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E v' (w':real^3)` THEN EXPAND_TAC"y" THEN ASM_REWRITE_TAC[];(*2*) EXISTS_TAC`face (hypermap1_of_fanx (x:real^3,V,E)) (y:real^3#real^3#real^3#real^3)` THEN SUBGOAL_THEN `((?x'. x' IN d1_fan (x,V,E) /\ face (hypermap1_of_fanx (x,V,E)) y = orbit_map (res (f1_fan x V E) (d1_fan (x,V,E))) x') /\ ~(face (hypermap1_of_fanx (x,V,E)) y = ds)) ` ASSUME_TAC THENL(*3*)[ STRIP_TAC THENL(*4*)[ EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[face];(*4*) STRIP_TAC THEN MP_TAC(SET_RULE`{f1, f2, (f3:real^3#real^3#real^3#real^3)} SUBSET ds ==> f2 IN ds`) THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"ME") THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`(CARD (ds:real^3#real^3#real^3#real^3->bool)):num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(y:real^3#real^3#real^3#real^3)`) THEN MRESA_TAC lemma_face_cycle[`hypermap1_of_fanx (x:real^3,V:real^3->bool,E)`;`y:real^3#real^3#real^3#real^3`] THEN MP_TAC(ARITH_RULE`(CARD (ds:real^3#real^3#real^3#real^3->bool)):num>3 ==> ~((CARD (ds:real^3#real^3#real^3#real^3->bool)):num =0)`) THEN RESA_TAC THEN MRESA_TAC orbit_cyclic[`(res (f1_fan x V E) (d1_fan (x:real^3,V,E)))`;`(CARD (ds:real^3#real^3#real^3#real^3->bool)):num`;`y:real^3#real^3#real^3#real^3`] THEN REMOVE_THEN "ME"(fun th-> REWRITE_TAC[SYM th;face;]) THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(ARITH_RULE`k=0 \/ k=1\/ k>=2`) THENL(*5*)[ ASM_REWRITE_TAC[POWER;I_DEF] 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 STRIP_TAC THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr2 f2 = u:real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr2] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr3 f2 = w` THEN REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr3] THEN STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] 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 remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN MP_TAC(SET_RULE`~(v=u:real^3)/\ ~(u=w)==> ~(u IN {v,w})`) THEN RESA_TAC THEN RESA_TAC THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MP_TAC(SET_RULE`ds2 = {(f10:real^3#real^3#real^3#real^3), f20, f30}==> f30 IN ds2`) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds2:real^3#real^3#real^3#real^3->bool`;` (f30:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC) THEN ASM_MESON_TAC[];(*5*) POP_ASSUM MP_TAC THEN STRIP_TAC THENL(*6*)[ ASM_REWRITE_TAC[POWER_1] THEN MRESAL_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`1:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`][POWER_1] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(y:real^3#real^3#real^3#real^3)`) 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 STRIP_TAC THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`ds SUBSET d1_fan (x,V,E) /\ {f1, f2, f3} SUBSET ds ==> f1 IN d1_fan(x,V,E)`) THEN RESA_TAC THEN MRESA_TAC MONO_F1_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA_TAC th[` (f1:real^3#real^3#real^3#real^3)`;` (y:real^3#real^3#real^3#real^3)`]) THEN FIND_ASSUM(MP_TAC)`pr2 f1 = v:real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr2] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr3 f1 = u` THEN REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr3] THEN STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN 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 ASM_REWRITE_TAC[] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MP_TAC(SET_RULE`ds2 = {(f10:real^3#real^3#real^3#real^3), f20, f30}==> f20 IN ds2`) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds2:real^3#real^3#real^3#real^3->bool`;` (f20:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC) THEN ASM_MESON_TAC[];(*6*) SUBGOAL_THEN`?m. k=SUC (SUC m)/\ m>=0`ASSUME_TAC THENL(*7*)[ EXISTS_TAC`k-2:num` THEN REWRITE_TAC[ARITH_RULE`SUC n= n+1`] THEN POP_ASSUM MP_TAC THEN ARITH_TAC;(*7*) POP_ASSUM MP_TAC 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 REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REPEAT RESA_TAC THEN POP_ASSUM MP_TAC THEN MRESAL_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`SUC (SUC m):num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`][POWER_1] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(y:real^3#real^3#real^3#real^3)`) THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN REWRITE_TAC[COM_POWER;o_DEF] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"CHUYEN") THEN DISCH_TAC THEN REMOVE_THEN "CHUYEN" MP_TAC THEN ASM_REWRITE_TAC[ARITH_RULE`SUC n= n+1`] THEN REMOVE_ASSUM_TAC THEN STRIP_TAC THEN MP_TAC(ARITH_RULE`(m + 1) + 1 < CARD (ds:real^3# real^3#real^3#real^3->bool)==> m< CARD ds -2`) THEN ASM_REWRITE_TAC[] THEN REMOVE_ASSUM_TAC THEN STRIP_TAC THEN ASM_TAC THEN SPEC_TAC (`m:num`,`m:num`) THEN INDUCT_TAC THENL(*8*)[ ASM_REWRITE_TAC[POWER;I_DEF] THEN REPEAT STRIP_TAC THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`ds SUBSET d1_fan (x,V,E) /\ {f1, f2, f3} SUBSET ds ==> f1 IN d1_fan(x,V,E)`) THEN RESA_TAC THEN MRESA_TAC into_domain1_f1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th` y:real^3#real^3#real^3#real^3`) THEN MRESA_TAC MONO_F1_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA_TAC th[` (f1:real^3#real^3#real^3#real^3)`;` (f1_fan x V E y:real^3#real^3#real^3#real^3)`]) THEN FIND_ASSUM(MP_TAC)`pr2 f1 = v:real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr2;f1_fan] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr3 f1 = u` THEN REWRITE_TAC[th] THEN EXPAND_TAC"y" THEN REWRITE_TAC[pr3;f1_fan] THEN STRIP_TAC) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;] THEN REPEAT STRIP_TAC THEN ASSUME_TAC th) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w':real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v':real^3`) THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN SUBGOAL_THEN`((x,v:real^3,w,sigma_fan x V E1 v w)=f1_fan x V E1 x')`ASSUME_TAC THENL(*9*)[ ASM_REWRITE_TAC[f1_fan;PAIR_EQ] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`w:real^3`) THEN POP_ASSUM MP_TAC THEN FIND_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o DEPTH_CONV)[SYM th;UNION;IN_ELIM_THM;] THEN ASM_REWRITE_TAC[IN_SING])` E UNION {{v:real^3,w}}= E1` THEN RESA_TAC;(*9*) SUBGOAL_THEN`(x,v,w,sigma_fan x V E1 v w) IN face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)`ASSUME_TAC THENL(*10*)[ REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF];(*10*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN FIND_ASSUM(MP_TAC)`x' IN d1_fan (x:real^3,V,E1)` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`x' = (x'',v',v,(w1:real^3)):real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`f1_fan x V E1 x':real^3#real^3#real^3#real^3`;`x':real^3#real^3#real^3#real^3`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`x':real^3#real^3#real^3#real^3`] THEN FIND_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC THEN MP_TAC th THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC) )`x' = (x'',v',v,(w1:real^3)):real^3#real^3#real^3#real^3` THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;] THEN REPEAT STRIP_TAC) THEN ASM_MESON_TAC[]](*10*)](*9*);(*8*) POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"A") 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 POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"NHO") THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "A" MP_TAC THEN MP_TAC(ARITH_RULE`SUC m < CARD (ds:real^3# real^3#real^3#real^3->bool) - 2==> m < CARD ds - 2`) THEN RESA_TAC THEN ASM_REWRITE_TAC[ARITH_RULE`m>=0`] THEN STRIP_TAC THEN ABBREV_TAC`y1=(f1_fan (x:real^3) V E POWER SUC(m)) y` THEN STRIP_TAC THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`ds SUBSET d1_fan (x,V,E) /\ {f1, f2, f3} SUBSET ds ==> f1 IN d1_fan(x,V,E)`) THEN RESA_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`SUC m:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(y:real^3#real^3#real^3#real^3)`) THEN MRESA_TAC into_domain1_f1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th` y1:real^3#real^3#real^3#real^3`) THEN MRESA_TAC MONO_F1_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA_TAC th[` (f1:real^3#real^3#real^3#real^3)`;` (f1_fan x V E y1:real^3#real^3#real^3#real^3)`]) THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN ASSUME_TAC th THEN STRIP_TAC) THEN ASM_REWRITE_TAC[f1_fan] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr2 f1 = v:real^3` THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN REWRITE_TAC[pr2;] THEN STRIP_TAC THEN FIND_ASSUM(MP_TAC)`pr3 f1 = u` THEN REWRITE_TAC[pr3;th] THEN STRIP_TAC) THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "NHO" MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"AN") THEN DISCH_THEN(LABEL_TAC"NHO") THEN STRIP_TAC THEN ASSUME_TAC th) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v'':real^3`) THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN SUBGOAL_THEN`((x,v:real^3,w,sigma_fan x V E1 v w)=f1_fan x V E1 (x,sigma_fan x V E1 v w,v,sigma_fan x V E1 v'' v))`ASSUME_TAC THENL(*9*)[ ASM_REWRITE_TAC[f1_fan;PAIR_EQ] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`w:real^3`) THEN POP_ASSUM MP_TAC THEN FIND_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o DEPTH_CONV)[SYM th;UNION;IN_ELIM_THM;] THEN ASM_REWRITE_TAC[IN_SING])` E UNION {{v:real^3,w}}= E1` THEN RESA_TAC;(*9*) SUBGOAL_THEN`(x,v,w,sigma_fan x V E1 v w) IN face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)`ASSUME_TAC THENL(*10*)[ REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF];(*10*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN SUBGOAL_THEN`x,v'',v,sigma_fan x V E1 v'' v IN d1_fan (x:real^3,V,E1)`ASSUME_TAC THENL(*11*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v'':real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E1 v'' v:real^3` THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;UNION;IN_ELIM_THM;] THEN ASM_REWRITE_TAC[IN_SING])` E UNION {{v:real^3,w}}= E1`;(*11*) MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`f1_fan x V E1 (x,v'',v,sigma_fan x V E1 v'' v):real^3#real^3#real^3#real^3`;`(x,v'',v,sigma_fan x V E1 v'' v):real^3#real^3#real^3#real^3`] THEN POP_ASSUM MP_TAC THEN SUBGOAL_THEN`(x,v'',v,sigma_fan x V E1 v'' v)=tran x V E1 (y1:real^3#real^3#real^3#real^3)`ASSUME_TAC THENL(*12*)[ ASM_REWRITE_TAC[tran];(*12*) ASM_REWRITE_TAC[] THEN REMOVE_THEN "NHO" MP_TAC THEN FIND_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC THEN MP_TAC th THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> POP_ASSUM MP_TAC THEN REWRITE_TAC[SYM th]) THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"NHO") THEN ASSUME_TAC (SYM th) THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"AN") )`y1 = (x''',v'',v,(w1':real^3)):real^3#real^3#real^3#real^3` THEN MRESAL_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`1:num`;][POWER_1] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` THEN MRESA1_TAC th`y1:real^3#real^3#real^3#real^3`) THEN MRESA_TAC TRAN_COMMUTATIVE_F1_FAN_POWER3 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`;`SUC m:num`] THEN POP_ASSUM MP_TAC THEN MRESA_TAC finite_d1_fan[`x:real^3`;` V:real^3->bool`;` (E:(real^3->bool)->bool)`] THEN MRESA_TAC AAUHTVE[`x:real^3`;` V:real^3->bool`;` (E:(real^3->bool)->bool)`;`( \ t. res (t x V E ) (d1_fan (x:real^3,V,E)) )`] 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 MP_TAC (SET_RULE`{f1, f2:real^3#real^3#real^3#real^3, f3} SUBSET ds==> f2 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E (f1_fan x V E y1)):real^3#real^3#real^3#real^3`;`f1_fan x V E y1:real^3#real^3#real^3#real^3`;] THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E y1):real^3#real^3#real^3#real^3`;` y1:real^3#real^3#real^3#real^3`;] THEN MRESA_TAC lemma_face_representation[`hypermap1_of_fanx(x:real^3,V,E)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`SUC m`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y1:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;] THEN MRESAL_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E)`;`x'''':real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][face] THEN MRESA_TAC lemma_segment_orbit[`d1_fan (x:real^3,V,E)`;`res (f1_fan x V E) (d1_fan ((x:real^3),V,E))`;`(y:real^3#real^3#real^3#real^3)`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[face] THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;lemma_def_inj_orbit]) THEN REMOVE_ASSUM_TAC THEN MP_TAC(ARITH_RULE `SUC (m:num) < CARD (ds:real^3#real^3#real^3#real^3->bool) - 2 ==> CARD ds -1 < CARD ds /\ SUC (m:num) <= CARD (ds:real^3#real^3#real^3#real^3->bool) - 1 /\ SUC( SUC(SUC (m:num))) <= CARD (ds:real^3#real^3#real^3#real^3->bool) - 1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN STRIP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th `CARD (ds:real^3#real^3#real^3#real^3->bool) -1 :num`) THEN SUBGOAL_THEN`!m'. m' < SUC m==> ~((f1_fan (x:real^3) V E POWER m') y=y1) /\ ~((f1_fan (x:real^3) V E POWER m') y=f2)` ASSUME_TAC THENL(*13*)[ POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN REPEAT STRIP_TAC THENL(*14*)[ POP_ASSUM MP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`m':num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`SUC m:num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN REMOVE_THEN "LINH"(fun th-> MRESA_TAC th [`SUC (m:num)`;`m':num`;]);(*14*) POP_ASSUM MP_TAC THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`m':num`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool) `;`SUC (SUC(SUC m:num))`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`y:real^3#real^3#real^3#real^3` ) THEN MP_TAC (ARITH_RULE`m'< SUC m ==> m'< SUC(SUC(SUC m)) `) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA_TAC th [`SUC (SUC (SUC (m:num)))`;`m':num`;]) THEN REMOVE_THEN "AN" MP_TAC THEN DISCH_TAC THEN REMOVE_ASSUM_TAC THEN EXPAND_TAC"y1" THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[COM_POWER;o_DEF;SET_RULE`~(A=B)<=> ~(B=A)`]](*14*);(*13*) POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN SUBGOAL_THEN`!m'. m' < SUC m ==> (~(pr2 ((f1_fan x V E POWER m') y) = v'') /\ pr3 ((f1_fan x V E POWER m') y) = v) \/ (~(pr2 ((f1_fan x V E POWER m') y) = u) /\ pr3 ((f1_fan x V E POWER m') y) = w) \/ ~(pr3 ((f1_fan x V E POWER m') y) IN {v, w})` ASSUME_TAC THENL(*14*)[ REPEAT STRIP_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th`m':num`) THEN MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`SUC m`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y1:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;] THEN MRESA_TAC condition_f1_fan_power_in_face_set[`m':num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3` ;` y:real^3#real^3#real^3#real^3`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`f1_fan x V E (f1_fan x V E y1) IN ds /\ (f1_fan x V E POWER m') y IN ds/\ ds SUBSET d1_fan (x,V,E)==> (f1_fan x V E POWER m') y IN d1_fan (x:real^3,V,E) /\ f1_fan x V E (f1_fan x V E y1) IN d1_fan (x:real^3,V,E)`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3`;`y1:real^3#real^3#real^3#real^3`][PAIR_EQ] THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "AN"(fun th-> REWRITE_TAC[SYM th;pr2;pr3]) THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3`;`f2:real^3#real^3#real^3#real^3`][PAIR_EQ;pr2;pr3] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*14*) ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASM_REWRITE_TAC[POWER] THEN STRIP_TAC THEN MRESAL_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`SUC m`; `x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;` ((f1_fan (x:real^3) (V:real^3->bool) (E1:(real^3->bool)->bool) POWER SUC m) (tran (x:real^3) (V:real^3->bool) (E1:(real^3->bool)->bool) (y:real^3#real^3#real^3#real^3)))`;`tran (x:real^3) (V:real^3->bool) (E1:(real^3->bool)->bool) (y:real^3#real^3#real^3#real^3)`;][POWER] THEN POP_ASSUM MP_TAC THEN FIND_ASSUM (fun th-> REWRITE_TAC[SYM th;tran])`x,(v':real^3),w',sigma_fan x V E v' w' = y` THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "NHO" MP_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM(th)] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`x':real^3#real^3#real^3#real^3`] THEN ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC THEN ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC THEN MP_TAC th THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;face] THEN REPEAT STRIP_TAC) ) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;] THEN REPEAT STRIP_TAC) THEN ASM_MESON_TAC[]](*14*)](*13*)](*12*)](*11*)](*10*)](*9*)] (*8*)](*7*)](*6*)](*5*)](*4*);(*3*) ASM_REWRITE_TAC[] THEN MRESAL_TAC unique_tranf_fan [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ; `(face (hypermap1_of_fanx (x:real^3,V:real^3->bool,E)) (y:real^3#real^3#real^3#real^3)):real^3#real^3#real^3#real^3->bool` ;`(f:real^3#real^3#real^3#real^3->bool)` ;`(y:real^3#real^3#real^3#real^3)`;][face] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;tran;face]) THEN ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THENL(*4*)[ REWRITE_TAC[orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0` THEN REWRITE_TAC[POWER;I_DEF;ARITH_RULE`0>=0`];(*4*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASM_REWRITE_TAC[DELETE;IN_ELIM_THM;face_set;set_of_orbits] THEN EXISTS_TAC`x''':real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] ]]]]);;
let  DOMAIN_TRANF_FACE_DELETE_DS=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> tranf x V E E1 ds0 IN face_set (hypermap1_of_fanx (x,V,E1)) DELETE ds1 DELETE ds2`,
REWRITE_TAC[DELETE;IN_ELIM_THM;] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN DISCH_THEN(LABEL_TAC"LINK") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESAL_TAC TRANF[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;`ds0:real^3#real^3#real^3#real^3->bool` ][DELETE;IN_ELIM_THM] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(SET_RULE`y IN ds0/\ ds0 SUBSET d1_fan (x:real^3,V,E)==> y IN d1_fan (x,V,E)`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC (SYM th) THEN DISCH_THEN(LABEL_TAC"NHO")) THEN ASSUME_TAC th) THEN MP_TAC(SET_RULE`{v', w'} IN E /\ E UNION {{v, w}} = E1==> {v', w':real^3} IN E1 /\ {v, w:real^3} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*1*)[ REWRITE_TAC[face_set;face;IN_ELIM_THM;set_of_orbits] THEN EXISTS_TAC`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))` THEN ASM_REWRITE_TAC[] THEN REMOVE_THEN "NHO"(fun th-> REWRITE_TAC[SYM th;tran;d1_fan;IN_ELIM_THM]) THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E1 v' (w':real^3)` THEN ASM_REWRITE_TAC[];(*1*) REMOVE_THEN "LINH" MP_TAC THEN ASM_REWRITE_TAC[] THEN SUBGOAL_THEN`(x,v,w,sigma_fan x V E1 v w) IN face (hypermap1_of_fanx (x,V,E1)) (tran x V E1 (y:real^3#real^3#real^3#real^3))` ASSUME_TAC THENL(*2*)[ FIND_ASSUM(fun th-> REWRITE_TAC[SYM th])`ds1 = face (hypermap1_of_fanx (x,V,E1)) (tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))` THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th])`face (hypermap1_of_fanx (x,V,E1)) ((x:real^3),v,w,sigma_fan x V E1 v w) = ds1` THEN REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF];(*2*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN SUBGOAL_THEN`tran x V E1 (y:real^3#real^3#real^3#real^3) IN d1_fan (x:real^3,V,E1)` ASSUME_TAC THENL(*3*)[ REMOVE_THEN "NHO" (fun th-> REWRITE_TAC[SYM th;tran;d1_fan;IN_ELIM_THM]) THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E1 v' w':real^3` THEN ASM_REWRITE_TAC[];(*3*) MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`n:num`;`( \ t. res (t (x:real^3) V E1 ) (d1_fan (x:real^3, V:real^3->bool, (E1:(real^3->bool)->bool))))`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))`) THEN DISJ_CASES_TAC(ARITH_RULE`n=0\/ n=1\/ n:num>1`) THENL(*4*)[ REMOVE_THEN"NHO"(fun th-> ASM_REWRITE_TAC[SYM th;tran;POWER;I_DEF;EQ_PAIR_4]) THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM MP_TAC`{v':real^3, w'} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[];(*4*) POP_ASSUM MP_TAC THEN SUBGOAL_THEN`x,v,w,sigma_fan x V E1 v w= f1_fan x V E1 (x,sigma_fan x V E1 v w,v, sigma_fan x V E1 (sigma_fan x V E1 v w) v )` ASSUME_TAC THENL(*5*)[ REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w:real^3`);(*5*) SUBGOAL_THEN`x,sigma_fan x V E1 v w,v,sigma_fan x V E1 (sigma_fan x V E1 v w) v IN d1_fan (x,V,E1)` ASSUME_TAC THENL(*6*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`sigma_fan x V E1 v w:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E1 (sigma_fan x V E1 v w ) v :real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w:real^3)`; `v:real^3`] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC sigma_fan_in_set_of_edge[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`;`v:real^3`;`w:real^3`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` sigma_fan x V E1 v (w:real^3)`; `v:real^3`];(*6*) SUBGOAL_THEN `f1= f1_fan x V E (x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v)` ASSUME_TAC THENL(*7*)[ REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f1:real^3#real^3#real^3#real^3`;`(x,v,u,sigma_fan x V E v u):real^3#real^3#real^3#real^3`;][pr2;pr3] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`sigma_fan x V E v u :real^3` THEN ASM_REWRITE_TAC[];(*7*) SUBGOAL_THEN`x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v IN d1_fan (x,V,E)` ASSUME_TAC THENL(*8*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`sigma_fan x V E v u:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E (sigma_fan x V E v u ) v :real^3` THEN ASM_REWRITE_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 ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC sigma_fan_in_set_of_edge[`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`];(*8*) MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`f1:real^3#real^3#real^3#real^3`;`(x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v):real^3#real^3#real^3#real^3`;] THEN STRIP_TAC THENL(*9*)[ ASM_REWRITE_TAC[POWER_1] THEN STRIP_TAC THEN MRESA_TAC MONO_F1_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA_TAC th[`(x:real^3,sigma_fan x V E1 v w,v,sigma_fan x V E1 (sigma_fan x V E1 v w) v)`;`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))`]) THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "NHO"(fun th-> ASM_REWRITE_TAC[SYM th;tran;EQ_PAIR_4] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"NHO" )) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_THEN"NHO" MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`];(*9*) SUBGOAL_THEN`?m. n=SUC (SUC m)/\ m>=0`ASSUME_TAC THENL(*10*)[ EXISTS_TAC`n-2:num` THEN REWRITE_TAC[ARITH_RULE`SUC n= n+1`] THEN POP_ASSUM MP_TAC THEN ARITH_TAC;(*10*) POP_ASSUM MP_TAC THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[COM_POWER] THEN REWRITE_TAC[o_DEF] THEN STRIP_TAC THEN MRESA_TAC into_domain1_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`SUC m:num`;] THEN POP_ASSUM(fun th-> MRESA1_TAC th`(tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))`) THEN MRESA_TAC MONO_F1_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`] THEN POP_ASSUM(fun th-> MRESA_TAC th[`(x:real^3,sigma_fan x V E1 v w,v,sigma_fan x V E1 (sigma_fan x V E1 v w) v)`;`(f1_fan x V E1 POWER SUC m) (tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3))`]) THEN POP_ASSUM MP_TAC THEN ABBREV_TAC`y1=(x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v)` THEN DISJ_CASES_TAC(SET_RULE`~((y:real^3#real^3#real^3#real^3) IN ds)\/ y IN ds`) THENL(*11*)[ SUBGOAL_THEN`!m'. m' < SUC m==> ~((f1_fan (x:real^3) V E POWER m') y=y1) /\ ~((f1_fan (x:real^3) V E POWER m') y=f2)` ASSUME_TAC THENL(*12*)[ REPEAT STRIP_TAC THENL(*13*)[ MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`m':num`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y1:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;];(*13*) MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`m':num`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`f2:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;](*13*)];(*12*) POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN SUBGOAL_THEN`!m'. m' < SUC m ==> (~(pr2 ((f1_fan x V E POWER m') y) = sigma_fan x V E v u) /\ pr3 ((f1_fan x V E POWER m') y) = v) \/ (~(pr2 ((f1_fan x V E POWER m') y) = u) /\ pr3 ((f1_fan x V E POWER m') y) = w) \/ ~(pr3 ((f1_fan x V E POWER m') y) IN {v, w})` ASSUME_TAC THENL(*13*)[ REPEAT STRIP_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th`m':num`) THEN MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`SUC m`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y1:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;] THEN MP_TAC(SET_RULE`f1_fan x V E (f1_fan x V E y1) IN ds /\ (f1_fan x V E POWER m') y IN ds0/\ ds SUBSET d1_fan (x,V,E) /\ ds0 SUBSET d1_fan (x,V,E)==> (f1_fan x V E POWER m') y IN d1_fan (x:real^3,V,E) /\ f1_fan x V E (f1_fan x V E y1) IN d1_fan (x:real^3,V,E)`) THEN FIND_ASSUM (fun th->REWRITE_TAC[SYM th])`f1 = f1_fan x V E (y1:real^3#real^3#real^3#real^3)` THEN MRESA_TAC condition_f1_fan_power_in_face_set[`m':num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3` ;` y:real^3#real^3#real^3#real^3`;`ds0:real^3#real^3#real^3#real^3->bool`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3`;`y1:real^3#real^3#real^3#real^3`][PAIR_EQ] THEN POP_ASSUM MP_TAC THEN EXPAND_TAC"y1" THEN REWRITE_TAC[pr2;pr3] THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER m') y):real^3#real^3#real^3#real^3`;`f2:real^3#real^3#real^3#real^3`][PAIR_EQ;pr2;pr3] THEN POP_ASSUM MP_TAC THEN SET_TAC[];(*13*) MRESA_TAC TRAN_COMMUTATIVE_F1_FAN_POWER3 [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3)`;`SUC m:num`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN SUBGOAL_THEN`(x,sigma_fan x V E1 v w,v,sigma_fan x V E1 (sigma_fan x V E1 v w) v)=tran x V E1 (y1:real^3#real^3#real^3#real^3)`ASSUME_TAC THENL(*14*)[ EXPAND_TAC"y1" THEN REWRITE_TAC[tran] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ];(*14*) ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC condition_f1_fan_power_in_face_set[`SUC m:num`;`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`((f1_fan x V E POWER (SUC m)) y):real^3#real^3#real^3#real^3` ;` y:real^3#real^3#real^3#real^3`;`ds0:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE` (f1_fan x V E POWER (SUC m)) y IN ds0 /\ ds0 SUBSET d1_fan (x,V,E)/\ E UNION {{v, w}} = E1 ==> (f1_fan x V E POWER (SUC m)) y IN d1_fan (x:real^3,V,E) /\ E SUBSET E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC INJ_TRAN_D1_FAN [`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(E1:(real^3->bool)->bool)`; `y1:real^3#real^3#real^3#real^3`;`(f1_fan x V E POWER (SUC m)) (y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC IMAGE_F1_POWER_IN_FACE_IMP_IN_FACE[`SUC m`; `x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`y1:real^3#real^3#real^3#real^3`;` y:real^3#real^3#real^3#real^3`;]](*14*)](*13*)](*12*);(*11*) MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`]](*11*)](*10*)](*9*)](*8*)](*7*)](*6*)](*5*)](*4*)](*3*)](*2*);(*1*) REMOVE_THEN "LINH" MP_TAC THEN ASM_REWRITE_TAC[] THEN SUBGOAL_THEN`tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3) IN ds2` ASSUME_TAC THENL(*2*)[ ASM_REWRITE_TAC[face;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[ARITH_RULE`0 >=0 `;POWER;I_DEF];(*2*) POP_ASSUM MP_TAC THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool`;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ] THEN STRIP_TAC THEN MP_TAC(SET_RULE`tran (x:real^3) V E1 (y:real^3#real^3#real^3#real^3) IN {f10, (f20:real^3#real^3#real^3#real^3), f30}==> tran x V E1 y =f10 \/ tran x V E1 y =f20 \/ tran x V E1 y = f30`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL(*3*)[ POP_ASSUM MP_TAC THEN REMOVE_THEN"NHO"(fun th-> REWRITE_TAC[SYM th;tran]) THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;EQ_PAIR_4])`x,w,v,u = f10:real^3#real^3#real^3#real^3` THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM MP_TAC`{w, v:real^3} IN E` THEN FIND_ASSUM MP_TAC`~({w, v:real^3} IN E)` THEN SET_TAC[];(*3*) POP_ASSUM MP_TAC THEN REMOVE_THEN"NHO"(fun th-> REWRITE_TAC[SYM th;tran]THEN ASSUME_TAC (SYM(th))) THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;EQ_PAIR_4])`x,v,u,w = f20:real^3#real^3#real^3#real^3` THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN SUBGOAL_THEN `f1=y:real^3#real^3#real^3#real^3`ASSUME_TAC THENL(*4*)[ ASM_REWRITE_TAC[] THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f1:real^3#real^3#real^3#real^3`;`(x,v,u,sigma_fan x V E v u):real^3#real^3#real^3#real^3`;][pr2;pr3] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`sigma_fan x V E v u :real^3` THEN ASM_REWRITE_TAC[];(*4*) MP_TAC(SET_RULE`f1=y /\ f1 IN ds ==> (y:real^3#real^3#real^3#real^3) IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`]](*4*);(*3*) POP_ASSUM MP_TAC THEN REMOVE_THEN"NHO"(fun th-> REWRITE_TAC[SYM th;tran]THEN ASSUME_TAC (SYM(th))) THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;EQ_PAIR_4])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN SUBGOAL_THEN `f2=y:real^3#real^3#real^3#real^3`ASSUME_TAC THENL(*4*)[ ASM_REWRITE_TAC[] THEN MRESA_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f2:real^3#real^3#real^3#real^3`;`(x,u,w,w1):real^3#real^3#real^3#real^3`;] THEN POP_ASSUM MATCH_MP_TAC THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`v :real^3` THEN ASM_REWRITE_TAC[];(*4*) MP_TAC(SET_RULE`f2=y /\ f2 IN ds ==> (y:real^3#real^3#real^3#real^3) IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds0:real^3#real^3#real^3#real^3->bool`;` (y:real^3#real^3#real^3#real^3)`]]]]]);;
let EQ_CARD_FACE_FAN_AND_FANADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> CARD ((face_set (hypermap1_of_fanx (x,V,E1)) DELETE ds1 ) DELETE ds2 )= CARD (face_set (hypermap1_of_fanx (x,V,E)) DELETE ds) `,
REPEAT STRIP_TAC THEN MATCH_MP_TAC CARD_IMAGE_INJ_EQ THEN EXISTS_TAC`tranf (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (E1:(real^3->bool)->bool):(real^3#real^3#real^3#real^3->bool)->real^3#real^3#real^3#real^3->bool` THEN MRESAL1_TAC FINITE_HYPERMAP_ORBITS`hypermap1_of_fanx (x:real^3,V:real^3->bool,E)`[FINITE_DELETE;EXISTS_UNIQUE] THEN STRIP_TAC THENL[ REPEAT STRIP_TAC THEN MRESA_TAC DOMAIN_TRANF_FACE_DELETE_DS [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(x':real^3#real^3#real^3#real^3->bool)`;]; REPEAT STRIP_TAC THEN MRESA_TAC SUR_TRANF_FACE_DELETE_DS [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y:real^3#real^3#real^3#real^3->bool)`;] THEN EXISTS_TAC`ds0:real^3#real^3#real^3#real^3->bool` THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC INJ_TRANF_FACE_DELETE_DS [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(y':real^3#real^3#real^3#real^3->bool)`;`(ds0:real^3#real^3#real^3#real^3->bool)`]]);;
let CARD_DART_FANADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ ~(v=w) /\ E UNION {{v,w}}=E1 ==> CARD (dart (hypermap1_of_fanx (x,V,E1))) = CARD (dart (hypermap1_of_fanx (x,V,E))) +2`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC card_eq_image_in_d_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`; `d1_fan (x,V,E1):real^3#real^3#real^3#real^3->bool`][SET_RULE`d1_fan (x,V,E1) SUBSET d1_fan (x,V,E1)`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESAL_TAC card_eq_image_in_d_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`; `d1_fan (x,V,E):real^3#real^3#real^3#real^3->bool`][SET_RULE`d1_fan (x,V,E) SUBSET d1_fan (x,V,E)`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC DART_FANADD_EQ_DART_FAN_ADD_2DART[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC finite_d1_fan[`x:real^3`;` V:real^3->bool`;` (E:(real^3->bool)->bool)`] THEN MRESA_TAC FINITE_IMAGE[`pr23:real^3#real^3#real^3#real^3->real^3#real^3`;`(d1_fan ((x:real^3),V,E))`] THEN MRESA_TAC CARD_UNION[`IMAGE pr23 (d1_fan ((x:real^3),V,E))`;`{(v,w), (w,(v:real^3))}`] THEN POP_ASSUM MP_TAC THEN ASM_SIMP_TAC[HAS_SIZE; CARD_CLAUSES; FINITE_INSERT; FINITE_EMPTY; IN_INSERT; NOT_IN_EMPTY;PAIR_EQ;SET_RULE`v = w /\ w = v <=> v=w`;ARITH_RULE`SUC(SUC 0)=2`] THEN STRIP_TAC THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[EXTENSION;INTER;IN_ELIM_THM;NOT_IN_EMPTY;PR23_OF_D1_FAN;SET_RULE`x' IN {(v,w), (w,v)} <=> x'=(v,w) \/ x'=(w,v)`] THEN GEN_TAC THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[PAIR_EQ] THEN STRIP_TAC THEN POP_ASSUM (fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM (fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]);;
let     ZSZIUQE_LEMMA=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> N_FAN (x,V,E1)< N_FAN(x,V,E)`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN REWRITE_TAC[N_FAN] THEN MRESA1_TAC FINITE_HYPERMAP_ORBITS`hypermap1_of_fanx (x:real^3,V:real^3->bool,E)` THEN MRESA1_TAC FINITE_HYPERMAP_ORBITS`hypermap1_of_fanx (x:real^3,V:real^3->bool,E1)` THEN MRESA_TAC NSUM_CONST[`3:num`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E1)))`] THEN MRESA_TAC NSUM_CONST[`3:num`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E)))`] THEN SUBGOAL_THEN`!y. y IN (face_set (hypermap1_of_fanx ((x:real^3),V,E1)))==> (\x. CARD x - 3 + 3) y=(\x. CARD x ) y` ASSUME_TAC THENL[ ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool)`;`y:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM MP_TAC THEN ARITH_TAC; SUBGOAL_THEN`!y. y IN (face_set (hypermap1_of_fanx ((x:real^3),V,E)))==> (\x. CARD x - 3 + 3) y=(\x. CARD x ) y` ASSUME_TAC THENL[ ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;`y:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM MP_TAC THEN ARITH_TAC; MP_TAC(SET_RULE` E UNION {{v,w:real^3}}= E1 ==> {v,w} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w:real^3)`; `(v:real^3)`] THEN MRESA_TAC NSUM_EQ[`(\(f:real^3#real^3#real^3#real^3->bool). CARD f - 3+3)`;`(\(f:real^3#real^3#real^3#real^3->bool). CARD f)`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E1)))`] THEN MRESA_TAC NSUM_EQ[`(\(f:real^3#real^3#real^3#real^3->bool). CARD f - 3+3)`;`(\(f:real^3#real^3#real^3#real^3->bool). CARD f)`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E)))`] THEN MRESA_TAC finite_d1_fan[`x:real^3`;` V:real^3->bool`;` (E1:(real^3->bool)->bool)`] THEN MRESA_TAC finite_d1_fan[`x:real^3`;` V:real^3->bool`;` (E:(real^3->bool)->bool)`] THEN MRESA_TAC AAUHTVE[`x:real^3`;` V:real^3->bool`;` (E:(real^3->bool)->bool)`;`( \ t. res (t x V E ) (d1_fan (x:real^3,V,E)) )`] 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 MRESA_TAC AAUHTVE[`x:real^3`;` V:real^3->bool`;` (E1:(real^3->bool)->bool)`;`( \ t. res (t x V E1 ) (d1_fan (x:real^3,V,E1)) )`] 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 MRESA_TAC card_partition_formula[`dart (hypermap1_of_fanx (x:real^3,V,E1))`;`face_map (hypermap1_of_fanx (x:real^3,V,E1))`] THEN MRESA_TAC NSUM_ADD[`(\(f:real^3#real^3#real^3#real^3->bool). CARD f - 3)`;`(\(f:real^3#real^3#real^3#real^3->bool). 3)`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E1)))`] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[face_set] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC card_partition_formula[`dart (hypermap1_of_fanx (x:real^3,V,E))`;`face_map (hypermap1_of_fanx (x:real^3,V,E))`] THEN MRESA_TAC NSUM_ADD[`(\(f:real^3#real^3#real^3#real^3->bool). CARD f - 3)`;`(\(f:real^3#real^3#real^3#real^3->bool). 3)`;`(face_set (hypermap1_of_fanx ((x:real^3),V,E)))`] THEN POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[face_set] THEN ASM_REWRITE_TAC[] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC CARD_DART_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN MRESA_TAC EQ_CARD_FACE_FAN_AND_FANADD [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`] THEN MRESA_TAC CARD_MINUS_ONE[`(face_set (hypermap1_of_fanx ((x:real^3),V,E)))`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC CARD_MINUS_ONE[`(face_set (hypermap1_of_fanx ((x:real^3),V,E1)))`;`ds1:real^3#real^3#real^3#real^3->bool`] THEN SUBGOAL_THEN `ds2 IN (face_set (hypermap1_of_fanx ((x:real^3),V,E1))) DELETE (ds1:real^3#real^3#real^3#real^3->bool)`ASSUME_TAC THENL[ REWRITE_TAC[DELETE;IN_ELIM_THM] THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC disjoint_ds1_and_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]; MRESAL_TAC CARD_MINUS_ONE[`(face_set (hypermap1_of_fanx ((x:real^3),V,E1))) DELETE (ds1:real^3#real^3#real^3#real^3->bool)`;`ds2:real^3#real^3#real^3#real^3->bool`][FINITE_DELETE] THEN ARITH_TAC]]]);;
let ZSZIUQE=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> ~(ds1= ds2)/\ CARD ds2=3 /\ ds2={f10,f20,f30} /\ N_FAN (x,V,E1)< N_FAN(x,V,E)`,
REPEAT STRIP_TAC THENL[ POP_ASSUM MP_TAC THEN MRESA_TAC disjoint_ds1_and_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]; MRESA_TAC card_ds2_fanadd_eq3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]; MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]; MRESA_TAC ZSZIUQE_LEMMA[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]]);;
let FAN80_FANADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> fan80(x,V,E1)`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[fan80] THEN STRIP_TAC THEN REPEAT GEN_TAC THEN FIND_ASSUM (fun th-> GEN_REWRITE_TAC(LAND_CONV o ONCE_DEPTH_CONV)[SYM th] THEN REWRITE_TAC[IN_ELIM_THM;UNION;IN_SING])`E UNION {{v, w:real^3}} = E1` THEN STRIP_TAC THENL(*1*)[ FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MRESA_TAC th[`v':real^3`;`u':real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"NHOLINH")) THEN DISJ_CASES_TAC(SET_RULE` ~(v' IN {v, w:real^3})\/ (v'=v/\ u'=u)\/ (v'=v/\ ~(u'=u))\/ (v'=w/\ u'= inverse1_sigma_fan x V E w u)\/ (v'=w/\ ~(u'=inverse1_sigma_fan x V E w u))`) THENL(*2*)[ MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w: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 STRIP_TAC THEN POP_ASSUM(fun th-> MRESA_TAC th[`v':real^3`;`u':real^3`] );(*2*) POP_ASSUM MP_TAC THEN STRIP_TAC THENL(*3*)(*4GOAL*)[ ASM_REWRITE_TAC[] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN MATCH_MP_TAC properties_of_fully_surrounded1_fan THEN REMOVE_THEN "NHOLINH"(fun th-> MRESA_TAC th[`u: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`];(*3*) POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT4[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`u':real^3`];(*3*) ASM_REWRITE_TAC[] THEN REMOVE_THEN "NHOLINH"(fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"NHOLINH")) 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 notcoplanar_imp_notcollinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN STRIP_TAC THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT6[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`u':real^3`] THEN MRESA_TAC azim_trangle_le_azim_face_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`; `w:real^3`;` (inverse1_sigma_fan x V E w u):real^3`] 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(REAL_ARITH`azim x w v u < azim x w (inverse1_sigma_fan x V E w u) u ==> azim x w v u <= azim x w (inverse1_sigma_fan x V E w u) (u:real^3)`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (inverse1_sigma_fan x V E w u:real^3)`; `(w:real^3)`] THEN MRESA_TAC sum5_azim_fan[`x:real^3`;`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) u = azim x w (inverse1_sigma_fan x V E w u) v + azim x w v u /\ &0<= azim x w v u ==> azim x w (inverse1_sigma_fan x V E w u) v<=azim x w (inverse1_sigma_fan x V E w u) u `) THEN ASM_SIMP_TAC[azim] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th] THEN MP_TAC (SYM th) THEN DISCH_THEN(LABEL_TAC"YEUEMLINH")) THEN REMOVE_THEN "NHOLINH"(fun th-> MRESA_TAC th[`w:real^3`;`(inverse1_sigma_fan x V E w u):real^3`] ) THEN STRIP_TAC THEN MP_TAC(REAL_ARITH` azim x w (inverse1_sigma_fan x V E w u) v <= azim x w (inverse1_sigma_fan x V E w u) u /\ azim x w (inverse1_sigma_fan x V E w u) u < pi ==> azim x w (inverse1_sigma_fan x V E w u) (v:real^3) < pi`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC(REAL_ARITH`azim x w (inverse1_sigma_fan x V E w u) u = azim x w (inverse1_sigma_fan x V E w u) v + azim x w v u /\ azim x w v u < azim x w (inverse1_sigma_fan x V E w u) u ==> &0 < azim x w (inverse1_sigma_fan x V E w u) v `) THEN ASM_REWRITE_TAC[];(*3*) POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT5[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`u':real^3`]](*3*)](*2*);(*1*) MP_TAC(SET_RULE`{v', u':real^3} = {v, w}==> (v'=v /\ u'=w) \/ (v'=w /\ u'=v)`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THENL[ POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;] THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN REWRITE_TAC[fan80] THEN STRIP_TAC THEN POP_ASSUM(fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"NHOLINH")) 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 notcoplanar_imp_notcollinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`] THEN MRESAL_TAC AZIM_EQ_0_PI_EQ_COPLANAR[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`][DE_MORGAN_THM;] THEN MRESA_TAC angle_is_small_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;` u:real^3`;`w:real^3`] THEN ABBREV_TAC`u1=sigma_fan x V E v u` 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 sigma_fan_in_set_of_edge[`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) `;` (u1:real^3)`; `(v:real^3)`] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC sum4_azim_fan[`x:real^3`;`v:real^3`;`u:real^3`;`w:real^3`;`u1:real^3`] THEN REMOVE_THEN "NHOLINH"(fun th-> MRESA_TAC th[`v:real^3`;`u:real^3`] THEN MP_TAC th THEN DISCH_THEN(LABEL_TAC"NHOLINH")) THEN MP_TAC(REAL_ARITH` azim x v u w + azim x v w u1< pi/\ &0 <= azim x v u w /\ &0 <= azim x v w u1 ==> azim x v w (u1:real^3)<pi`) THEN ASM_SIMP_TAC[azim] THEN MP_TAC(REAL_ARITH` &0<= azim x v w u1 ==> azim x v w u1 = &0\/ &0<azim x v w (u1:real^3)`) THEN ASM_SIMP_TAC[azim] THEN STRIP_TAC THEN MP_TAC(SET_RULE`{v, u1} IN E/\ E UNION {{v, w:real^3}} = E1==>{v, w} IN E1 /\ {v, u1} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC UNIQUE_AZIM_0_POINT_FAN[`(x:real^3)`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`(v:real^3)`;`(w:real^3)`;`u1:real^3`] THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM MP_TAC`{v,w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]; POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`;` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;] THEN MRESA_TAC condition_azim_le_pi[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`;`w:real^3`]]]);;
let FANADD_CONFORMING=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) ==> conforming_fan (x,V,E1)`,
REPEAT STRIP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`(E1:(real^3->bool)->bool)`) THEN POP_ASSUM MATCH_MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC ZSZIUQE_LEMMA[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;]);;
let dartset_leads_in_fanadd_topological_component_yfan =
prove( `!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ds0 IN face_set (hypermap1_of_fanx (x,V,E)) DELETE ds ==> dartset_leads_into_fan x V E1 (tranf x V E E1 ds0) IN topological_component_yfan (x,V,E1)`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC DOMAIN_TRANF_FACE_DELETE_DS [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(ds0:real^3#real^3#real^3#real^3->bool)`;] THEN MP_TAC(SET_RULE`tranf (x:real^3) V (E:(real^3->bool)->bool) E1 (ds0:real^3#real^3#real^3#real^3->bool) IN face_set (hypermap1_of_fanx (x,V,E1)) DELETE ds1 DELETE ds2 ==> tranf (x:real^3) V E E1 (ds0:real^3#real^3#real^3#real^3->bool) IN face_set (hypermap1_of_fanx ((x:real^3),V,E1))`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC dartset_leads_into_is_topological_component_yfan[`x:real^3`;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool)`;`tranf (x:real^3) V (E:(real^3->bool)->bool) E1 (ds0:real^3#real^3#real^3#real^3->bool)`]);;
let INVARANT_SIGMA_FAN_ADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 y. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ ds1 = face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) /\ ds2 = face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v) /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ ~(y IN ds) /\ y IN d_fan(x,V,E) ==> sigma_fan x V E1 (pr2(y)) (pr3(y))= sigma_fan x V E (pr2(y)) (pr3(y))`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[fan80] THEN STRIP_TAC THEN STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC th THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN MP_TAC th THEN ASM_REWRITE_TAC[] THEN STRIP_TAC) THEN ASM_REWRITE_TAC[pr2;pr3] THEN DISJ_CASES_TAC(SET_RULE` ~(v' IN {v, w:real^3})\/ (v'=v/\ w'=u)\/ (v'=v/\ ~(w'=u))\/ (v'=w/\ w'= inverse1_sigma_fan x V E w u)\/ (v'=w/\ ~(w'=inverse1_sigma_fan x V E w u))`) THENL[ MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w: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 STRIP_TAC THEN POP_ASSUM(fun th-> MRESA_TAC th[`v':real^3`;`w':real^3`] );(*1*) POP_ASSUM MP_TAC THEN STRIP_TAC THENL[ SUBGOAL_THEN`y= f1:real^3#real^3#real^3#real^3`ASSUME_TAC THENL[ ASM_REWRITE_TAC[] THEN MATCH_MP_TAC EQ_PAIR_IMP_EQ_4_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E:(real^3->bool)->bool` THEN ASM_REWRITE_TAC[pr3;pr2] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]); MP_TAC(SET_RULE`y=(f1:real^3#real^3#real^3#real^3) /\ f1 IN ds ==> y IN ds`) THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN SET_TAC[]]; POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT4[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`w':real^3`]; SUBGOAL_THEN`y=f3:real^3#real^3#real^3#real^3`ASSUME_TAC THENL[ ASM_REWRITE_TAC[] THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MATCH_MP_TAC EQ_PAIR_IMP_EQ_4_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E:(real^3->bool)->bool` THEN ASM_REWRITE_TAC[pr3;pr2;PAIR_EQ] THEN SUBGOAL_THEN`f2= (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3`ASSUME_TAC THENL[ MATCH_MP_TAC EQ_PAIR_IMP_EQ_4_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E:(real^3->bool)->bool` THEN REWRITE_TAC[pr3;pr2;PAIR_EQ] THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REWRITE_TAC[pr2;pr3] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`v:real^3` THEN ASM_REWRITE_TAC[]; MP_TAC(SET_RULE`f2= (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3 ==> f1_fan x V E f2= f1_fan x V E (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3`) THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN REWRITE_TAC[pr2;pr3]) THEN STRIP_TAC THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;])`f1_fan x V E (f2:real^3#real^3#real^3#real^3) = (f3:real^3#real^3#real^3#real^3)` THEN POP_ASSUM(fun th-> REWRITE_TAC[th;f1_fan]) THEN ASM_TAC THEN REWRITE_TAC[pr2;pr3] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[]]; MP_TAC(SET_RULE`y=(f3:real^3#real^3#real^3#real^3) /\ f3 IN ds ==> y IN ds`) THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN SET_TAC[]]; POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT5[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`w':real^3`]]]);;
let lemma_yfanadd_aff_ge=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> yfan(x,V,E) SUBSET yfan(x,V,E1) UNION aff_ge {x} {v, w}`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;XFAN_EQ_UNIONS_AFF_GE_1_2;] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th;DIFF;UNION;UNIONS;IN_ELIM_THM;GSYM FORALL_NOT_THM;IN_SING;DE_MORGAN_THM;SUBSET]) THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[SET_RULE`x' IN (:real^3)`] THEN DISJ_CASES_TAC(SET_RULE`~(x' IN aff_ge {x} {v, w:real^3})\/ (x' IN aff_ge {x} {v, w:real^3})`) THENL[ ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM (fun th-> MP_TAC(ISPEC `u':real^3->bool`th)) THEN DISJ_CASES_TAC(SET_RULE`~(x' IN (u':real^3->bool))\/ (x' IN (u':real^3->bool))`) THENL[ ASM_REWRITE_TAC[]; ASM_REWRITE_TAC[] THEN REPEAT STRIP_TAC THEN DISJ_CASES_TAC(SET_RULE`~(e = {v, w})\/ (e = {v, w:real^3})`) THENL[ ASM_REWRITE_TAC[]; ASM_REWRITE_TAC[] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[CONTRAPOS_THM] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN ASM_REWRITE_TAC[]]]; ASM_REWRITE_TAC[]]);;
let lemma_yfanadd_aff_gt= 
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> yfan(x,V,E) SUBSET yfan(x,V,E1) UNION aff_gt {x} {v, w}`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (w:real^3)`; ` (v:real^3)`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;` (v:real^3)`; ` (w: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 STRIP_TAC THEN MRESA_TAC aff_ge_eq_aff_gt_union_aff_ge[`x:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC lemma_yfanadd_aff_ge[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN SUBGOAL_THEN`aff_ge {x} {w} SUBSET xfan(x:real^3,V:real^3->bool,E)` ASSUME_TAC THENL[ REWRITE_TAC[xfan;SUBSET;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN MRESA_TAC exists_edge_fully_surround_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` w:real^3`] THEN EXISTS_TAC `{w,v'}:real^3->bool` THEN ASM_REWRITE_TAC[] THEN REMOVE_ASSUM_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 MRESA_TAC aff_ge_eq_aff_gt_union_aff_ge[`(x:real^3)`;`(w:real^3)`;` (v':real^3)`] THEN ASM_TAC THEN SET_TAC[IN]; SUBGOAL_THEN`aff_ge {x} {v} SUBSET xfan(x:real^3,V:real^3->bool,E)` ASSUME_TAC THENL[ REWRITE_TAC[xfan;SUBSET;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN MRESA_TAC exists_edge_fully_surround_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;` v:real^3`] THEN EXISTS_TAC `{v,v'}:real^3->bool` THEN ASM_REWRITE_TAC[] THEN REMOVE_ASSUM_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v':real^3)`; ` (v:real^3)`] THEN MRESA_TAC aff_ge_eq_aff_gt_union_aff_ge[`(x:real^3)`;`(v:real^3)`;` (v':real^3)`] THEN ASM_TAC THEN SET_TAC[IN]; POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[yfan;SUBSET;UNION;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `x':real^3` th)) THEN REWRITE_TAC[th] THEN ASSUME_TAC th) THEN STRIP_TAC THENL[ ASM_REWRITE_TAC[]; ASM_REWRITE_TAC[]; REPEAT STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `x':real^3` th)) THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]; STRIP_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `x':real^3` th)) THEN ASM_REWRITE_TAC[] THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]]]]);;
let lemma_yfanadd_aff_gt1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> yfan(x,V,E1) SUBSET yfan(x,V,E)`,
REPEAT STRIP_TAC THEN REWRITE_TAC[yfan;XFAN_EQ_UNIONS_AFF_GE_1_2] THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;IN_ELIM_THM;IN_SING;UNION]) THEN SET_TAC[]);;
let YFANADD_AFF_GT=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> yfan(x,V,E) = yfan(x,V,E1) UNION aff_gt {x} {v, w}`,
REPEAT STRIP_TAC THEN MRESA_TAC lemma_yfanadd_aff_gt[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC lemma_yfanadd_aff_gt1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC condition_aff_gt_subset_yfan[`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 POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN SET_TAC[]);;
let dartset_leads_into_fanadd1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> dartset_leads_into_fan x V E1 ds1 SUBSET dartset_leads_into_fan x V E ds`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN ABBREV_TAC`y=(x,sigma_fan x V E v u,v:real^3,sigma_fan x V E (sigma_fan x V E v u) v )` THEN SUBGOAL_THEN `f1=f1_fan x V E (y:real^3#real^3#real^3#real^3)` ASSUME_TAC THENL(*1*)[ POP_ASSUM(fun th-> REWRITE_TAC[SYM th;f1_fan;EQ_PAIR_4]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`u:real^3`) THEN MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f1:real^3#real^3#real^3#real^3`;`(x,v,u,sigma_fan x V E v u):real^3#real^3#real^3#real^3`;][pr2;pr3] THEN POP_ASSUM MATCH_MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`sigma_fan x V E v u :real^3` THEN ASM_REWRITE_TAC[];(*1*) SUBGOAL_THEN`x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v IN d1_fan (x:real^3,V,E)` ASSUME_TAC THENL(*2*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`sigma_fan x V E v u:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E (sigma_fan x V E v u ) v :real^3` THEN ASM_REWRITE_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 ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC sigma_fan_in_set_of_edge[`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`];(*2*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`;`f1:real^3#real^3#real^3#real^3`;`(x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v):real^3#real^3#real^3#real^3`;] THEN MRESA_TAC DARTSET_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN SUBGOAL_THEN `(x,v,w,sigma_fan x V E1 v w)=f1_fan x V E1 (y:real^3#real^3#real^3#real^3)` ASSUME_TAC THENL(*3*)[ EXPAND_TAC"y" THEN REWRITE_TAC[f1_fan;EQ_PAIR_4] THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MP_TAC(SET_RULE`E UNION {{v, w:real^3}} = E1==>{v, w}IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`v:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w:real^3`);(*3*) SUBGOAL_THEN`x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v IN d1_fan (x:real^3,V,E1)` ASSUME_TAC THENL(*4*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`sigma_fan x V E v u:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`sigma_fan x V E (sigma_fan x V E v u ) v :real^3` THEN ASM_REWRITE_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 ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC sigma_fan_in_set_of_edge[`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 MP_TAC(SET_RULE`E UNION {{v, w:real^3}} = E1 /\ {v, sigma_fan x V E v u} IN E ==> {v, sigma_fan x V E v u} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESAL_TAC th[`sigma_fan x V E v u:real^3`;`v:real^3`][SET_RULE`~(A IN {B,C}) <=> ~(A=B)/\ ~(C=A)`]) THEN POP_ASSUM MP_TAC THEN DISJ_CASES_TAC(SET_RULE`(sigma_fan x V E v u = w:real^3) \/ ~(sigma_fan x V E v u = w)`) THENL(*5*)[ POP_ASSUM (fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM MP_TAC`{v, w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[];(*5*) ASM_REWRITE_TAC[] THEN RESA_TAC](*5*);(*4*) POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN SUBGOAL_THEN`x,v,w,sigma_fan x V E1 v w IN ds1:real^3#real^3#real^3#real^3->bool`ASSUME_TAC THENL(*5*)[ FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;face;orbit_map;IN_ELIM_THM])`face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) = ds1:real^3#real^3#real^3#real^3->bool` THEN EXISTS_TAC`0` THEN ASM_REWRITE_TAC[ARITH_RULE`0>=0`;POWER;I_DEF];(*5*) MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC IMAGE_F1_IN_FACE_IMP_IN_FACE[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`;`(x,sigma_fan x V E v u,v,sigma_fan x V E (sigma_fan x V E v u) v):real^3#real^3#real^3#real^3`;] THEN MRESA_TAC DARTSET_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`; `ds1:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `y:real^3#real^3#real^3#real^3`) THEN FIND_ASSUM MP_TAC `(y:real^3#real^3#real^3#real^3) IN d1_fan (x,V,E)` THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN ASM_REWRITE_TAC[pr2;pr3] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC DART_LEADS_INTO [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN MP_TAC(SET_RULE`{v', w'} IN E /\ E UNION {{v, w}} = E1 ==> {v':real^3, w'} IN E1`) THEN RESA_TAC THEN MRESA_TAC DART_LEADS_INTO [`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v':real^3`;`w':real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH1") THEN MP_TAC(REAL_ARITH`&0<h /\ &0< pi /\ &0< h'==> &0< (min (min (h:real) (h':real)) (pi/ &2))/ &2 /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2 < (pi/ &2) /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2< h /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2< h'`) THEN ASM_REWRITE_TAC[PI_WORKS;] THEN STRIP_TAC THEN MRESA_TAC not_empty_rw_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;`w':real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(min (min (h:real) (h':real)) (pi/ &2))/ &2`[SET_RULE`~(A={})<=> ?y. y IN A`]) THEN SUBGOAL_THEN`y' IN rw_dart_fan x V E1 (x,v',w',sigma_fan x V E1 v' w') (cos (min (min h h') (pi / &2) / &2))` ASSUME_TAC THENL(*6*)[ POP_ASSUM MP_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 FIND_ASSUM MP_TAC`(!v. v IN V==>CARD (set_of_edge (v:real^3) V E1) > 1)` THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `v':real^3`th) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN STRIP_TAC THEN ASSUME_TAC th)) THEN FIND_ASSUM MP_TAC`(!v. v IN V==>CARD (set_of_edge (v:real^3) V E) > 1)` THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `v':real^3`th) THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN STRIP_TAC THEN ASSUME_TAC th)) THEN ASM_REWRITE_TAC[rw_dart_fan;w_dart_fan] THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`v':real^3`;`w':real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[SET_RULE`~(v' IN {v, w}) <=> ~(v =v') /\ ~(v' = w)`] 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 sigma_fan_in_set_of_edge[`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 "EM" (fun th-> MP_TAC th THEN ASSUME_TAC(th)) THEN EXPAND_TAC"y" THEN REWRITE_TAC[EQ_PAIR_4] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM (fun th-> ASM_TAC THEN REWRITE_TAC[SYM th] THEN REPEAT STRIP_TAC) THEN POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`~(v:real^3 = sigma_fan x V E v u)` THEN DISJ_CASES_TAC(SET_RULE`(sigma_fan x V E v u = w:real^3) \/ ~(sigma_fan x V E v u = w)`) THENL(*7*)[ POP_ASSUM (fun th-> ASM_TAC THEN REWRITE_TAC[th] THEN REPEAT STRIP_TAC) THEN FIND_ASSUM MP_TAC`{v, w:real^3} IN E` THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`~({w, v:real^3} IN E)`;(*7*) POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[th]) THEN ASM_REWRITE_TAC[]](*7*);(*6*) REMOVE_THEN"LINH"(fun th-> MRESA_TAC th[`(min (min (h:real) (h':real)) (pi/ &2))/ &2`;`y':real^3`]) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_THEN"LINH1"(fun th-> MRESA_TAC th[`(min (min (h:real) (h':real)) (pi/ &2))/ &2`;`y':real^3`]) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC CONNECTED_COMPONENT_MONO[`yfan (x:real^3,(V:real^3->bool),E1)`;`(yfan (x:real^3,(V:real^3->bool),E1) UNION aff_gt {x} {v:real^3, w})`;`y':real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN SET_TAC[]]]]]]]);;
let dartset_leads_into_fanadd2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> dartset_leads_into_fan x V E1 ds2 SUBSET dartset_leads_into_fan x V E ds`,
REPEAT STRIP_TAC THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC DARTSET_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `f2:real^3#real^3#real^3#real^3`) THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MP_TAC(SET_RULE`ds2 = {(f10:real^3#real^3#real^3#real^3), f20, f30}==> f30 IN ds2`) THEN RESA_TAC THEN MRESA_TAC DARTSET_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`; `ds2:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESA1_TAC th `f30:real^3#real^3#real^3#real^3`) THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN MRESA_TAC DART_LEADS_INTO [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH") THEN MP_TAC(SET_RULE`{u, w} IN E /\ E UNION {{v, w}} = E1 ==> {u:real^3, w} IN E1`) THEN RESA_TAC THEN MRESA_TAC DART_LEADS_INTO [`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"LINH1") THEN MP_TAC(REAL_ARITH`&0<h /\ &0< pi /\ &0< h'==> &0< (min (min (h:real) (h':real)) (pi/ &2))/ &2 /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2 < (pi/ &2) /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2< h /\ (min (min (h:real) (h':real)) (pi/ &2))/ &2< h'`) THEN ASM_REWRITE_TAC[PI_WORKS;] THEN STRIP_TAC THEN MRESA_TAC not_empty_rw_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th`(min (min (h:real) (h':real)) (pi/ &2))/ &2`[SET_RULE`~(A={})<=> ?y. y IN A`]) THEN SUBGOAL_THEN`y IN rw_dart_fan x V E1 (x,u,w,sigma_fan x V E1 u w) (cos (min (min h h') (pi / &2) / &2))` ASSUME_TAC THENL[ 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 FIND_ASSUM MP_TAC`(!v. v IN V==>CARD (set_of_edge (v:real^3) V E1) > 1)` THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `u:real^3`th) THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN STRIP_TAC THEN ASSUME_TAC th)) THEN FIND_ASSUM MP_TAC`(!v. v IN V==>CARD (set_of_edge (v:real^3) V E) > 1)` THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC `u:real^3`th) THEN POP_ASSUM(fun th-> REWRITE_TAC[th] THEN STRIP_TAC THEN ASSUME_TAC th)) THEN ASM_REWRITE_TAC[rw_dart_fan;w_dart_fan] THEN FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;rw_dart_fan;w_dart_fan])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN ASM_REWRITE_TAC[SET_RULE`~(v' IN {v, w}) <=> ~(v =v') /\ ~(v' = w)`] THEN STRIP_TAC THEN ASM_REWRITE_TAC[]; REMOVE_THEN"LINH"(fun th-> MRESA_TAC th[`(min (min (h:real) (h':real)) (pi/ &2))/ &2`;`y:real^3`]) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN REMOVE_THEN"LINH1"(fun th-> MRESA_TAC th[`(min (min (h:real) (h':real)) (pi/ &2))/ &2`;`y:real^3`]) THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC CONNECTED_COMPONENT_MONO[`yfan (x:real^3,(V:real^3->bool),E1)`;`(yfan (x:real^3,(V:real^3->bool),E1) UNION aff_gt {x} {v:real^3, w})`;`y:real^3`] THEN POP_ASSUM MATCH_MP_TAC THEN SET_TAC[]]);;
let INTERS_HALF_SPACE_DS_FANADD1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 U1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ INTERS {aff_gt {x, pr2 y, pr3 y} {pr3 (f1_fan x V E y) } | y IN ds} =U1 ==> U1 INTER aff_gt {x, v, w} {u} SUBSET dartset_leads_into_fan x V E1 ds2`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[conforming_fan;conforming_half_space_fan] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`ds2:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN REWRITE_TAC[INTERS;IN_ELIM_THM;SUBSET] THEN REMOVE_THEN "EM"(fun th-> REWRITE_TAC[SYM th;INTERS;IN_ELIM_THM;INTER]) 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 DISCH_THEN(LABEL_TAC"LINH") THEN REPEAT STRIP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASSUME_TAC th THEN STRIP_TAC) THEN MP_TAC(SET_RULE`y IN {f10, f20, f30:real^3#real^3#real^3#real^3}==> y =f10\/ y =f20\/ y =f30`) THEN RESA_TAC THENL[ FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,w,v,u = f10:real^3#real^3#real^3#real^3` THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`v:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]; FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,v,u,w = f20:real^3#real^3#real^3#real^3` THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 /\ {v, u} IN E==> {v, u} IN E1`) THEN RESA_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th `aff_gt {x:real^3, v, u} {w}`) THEN POP_ASSUM MATCH_MP_TAC THEN SUBGOAL_THEN `x,v,u,sigma_fan x V E v u IN d1_fan (x,V,E)` ASSUME_TAC THENL[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`sigma_fan x V E v u:real^3` THEN ASM_REWRITE_TAC[]; MRESAL_TAC EQ_PAIR_IMP_EQ_4_FAN[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f1:real^3#real^3#real^3#real^3`;`(x,v,u,sigma_fan x V E v u):real^3#real^3#real^3#real^3`;][pr2;pr3] THEN EXISTS_TAC`(x,v,u:real^3, sigma_fan x (V:real^3->bool) E v u)` THEN ASM_REWRITE_TAC[f1_fan] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`u:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w:real^3`)]; FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 /\ {u,w} IN E==> {u,w} IN E1`) THEN RESA_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] 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 remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN MP_TAC(SET_RULE`~(v=u:real^3)/\ ~(u=w)==> ~(u IN {v,w})`) THEN RESA_TAC THEN RESA_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th `aff_gt {x:real^3, u,w} {v}`) THEN POP_ASSUM MATCH_MP_TAC THEN EXISTS_TAC`f2:real^3#real^3#real^3#real^3` THEN SUBGOAL_THEN`f2= (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3`ASSUME_TAC THENL[ MATCH_MP_TAC EQ_PAIR_IMP_EQ_4_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E:(real^3->bool)->bool` THEN REWRITE_TAC[pr3;pr2;PAIR_EQ] THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REWRITE_TAC[pr2;pr3] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`u:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`v:real^3` THEN ASM_REWRITE_TAC[]; MP_TAC(SET_RULE`f2= (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3 ==> f1_fan x V E f2= f1_fan x V E (x, pr2 f2,pr3 f2,sigma_fan x V E (pr2 f2) (pr3 f2)):real^3#real^3#real^3#real^3`) THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th] THEN REWRITE_TAC[pr2;pr3]) THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[th;f1_fan]) THEN ASM_REWRITE_TAC[] THEN ASM_TAC THEN REWRITE_TAC[pr2;pr3] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[] THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`]]]);;
let inverse1_sigma_fan_FANADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> inverse1_sigma_fan x V E1 w v = inverse1_sigma_fan x V E w u`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MATCH_MP_TAC MONO_SIGMA_FAN THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E1:(real^3->bool)->bool` THEN EXISTS_TAC`w:real^3` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MP_TAC(SET_RULE`{inverse1_sigma_fan x V E w u, w:real^3} IN E /\ E UNION {{v,w}}= E1 ==> {inverse1_sigma_fan x V E w u, w} IN E1`) THEN RESA_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN RESA_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT6[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ;`inverse1_sigma_fan x V E w u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC);;
let aff_gt_eq_fanadd=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> aff_gt {x, w, inverse1_sigma_fan x V E1 w v} {v} = aff_gt {x, w, inverse1_sigma_fan x V E w u} {u}`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC inverse1_sigma_fan_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MP_TAC(SET_RULE`{w:real^3,inverse1_sigma_fan x V E w u } IN E /\ E UNION {{v,w}}= E1 ==> {w:real^3,inverse1_sigma_fan x V E w u} IN E1`) THEN RESA_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN RESA_TAC THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E1:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `v:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[fan80] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`]) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN RESA_TAC THEN MRESA_TAC NOT_COPLANAR_NOT_COLLINEAR [`x:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`;`v:real^3`;] THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool) `;`(v:real^3)`;`w: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 RESA_TAC THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`w:real^3`;`v:real^3`;`inverse1_sigma_fan x V E w u:real^3`; ] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`;`v :real^3`;] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN FIND_ASSUM MP_TAC`fan80 (x,V:real^3->bool,E)` THEN REWRITE_TAC[fan80] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`]) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN RESA_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 POP_ASSUM MP_TAC THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN MRESA_TAC cross_dot_fully_surrounded_fan[`x:real^3`;`w:real^3`;`u:real^3`;`inverse1_sigma_fan x V E w u:real^3`; ] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`x:real^3`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`;`u :real^3`;]);;
let f2_EQ_F30_FANADD=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ f30=(x,u,w,v) /\ E UNION {{v,w}}= E1 ==> f30= f2`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E)`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN POP_ASSUM(fun th-> ASM_TAC THEN REWRITE_TAC[th;pr2;pr3] THEN REPEAT STRIP_TAC THEN ASM_REWRITE_TAC[]));;
let CONDITION_DART_IN_NODE=
prove(`!x V E f y y1. FAN (x,V,E) /\(!v. v IN V ==> CARD (set_of_edge v V E) > 1) /\ f IN (node_set (hypermap1_of_fanx (x,V,E)) ) /\ y IN f /\ y1 IN d1_fan(x,V,E) /\ pr2 y1= pr2 y ==> y1 IN f`,
REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC node_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;] THEN MP_TAC(SET_RULE`y IN f /\ f SUBSET d1_fan (x,V,E)==> y IN d1_fan (x,V,E)`) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN STRIP_TAC THEN MRESAL_TAC rep_node_set_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`f:real^3#real^3#real^3#real^3->bool`;`y:real^3#real^3#real^3#real^3`][pr2;pr3] THEN RESA_TAC THEN MRESA_TAC ORBITS_EQ_SET_EDGE_FAN[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (v:real^3)`;` (w':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 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 REWRITE_TAC[set_of_orbits_points_fan;IN_ELIM_THM] THEN RESA_TAC THEN EXISTS_TAC`i:num` THEN ASM_REWRITE_TAC[power_map_points ] THEN ARITH_TAC);;
let INTERS_HALF_SPACE_DS_FANADD2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 ds0. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ INTERS {aff_gt {x, pr2 y, pr3 y} {pr3 (f1_fan x V E y) } | y IN ds} =U1 ==> U1 INTER aff_gt {x, v, w} {sigma_fan x V E v u} SUBSET dartset_leads_into_fan x V E1 ds1`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[conforming_fan;conforming_half_space_fan] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`ds1:real^3#real^3#real^3#real^3->bool`) THEN REWRITE_TAC[INTERS;IN_ELIM_THM;SUBSET] THEN REMOVE_THEN "EM"(fun th-> REWRITE_TAC[SYM th;INTERS;IN_ELIM_THM;INTER]) 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 DISCH_THEN(LABEL_TAC"LINH") THEN STRIP_TAC THEN DISCH_THEN(LABEL_TAC"LINH1") THEN STRIP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASSUME_TAC th THEN STRIP_TAC) THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`y IN ds1/\ ds1 SUBSET d1_fan (x,V,E1)==> y IN d1_fan (x,V:real^3->bool,E1)`) THEN ASM_REWRITE_TAC[] THEN REWRITE_TAC[d1_fan;IN_ELIM_THM;pr2;pr3;f1_fan] THEN RESA_TAC THEN MRESA_TAC CARD_FACE_SET_GE_3_FULLY_SURROUNDED_FAN[`x:real^3`;`(V:real^3->bool)`;` (E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(ARITH_RULE`3 <= ( CARD (ds1:real^3#real^3#real^3#real^3->bool)):num ==> ~((CARD (ds1:real^3#real^3#real^3#real^3->bool)):num =0)`) THEN RESA_TAC THEN MRESA_TAC lemma_face_cycle[`hypermap1_of_fanx (x:real^3,V:real^3->bool,E1)`;`(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`] THEN MRESA_TAC orbit_cyclic[`(res (f1_fan x V E1) (d1_fan (x:real^3,V,E1)))`;`(CARD (ds1:real^3#real^3#real^3#real^3->bool)):num`;`(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`] THEN USE_THEN "LINH1" MP_TAC THEN FIND_ASSUM (fun th-> REWRITE_TAC[SYM th;face;] THEN ASM_REWRITE_TAC[IN_ELIM_THM] THEN STRIP_TAC)`face (hypermap1_of_fanx (x,V:real^3->bool,E1)) (x,v,w,sigma_fan x V E1 v w) = ds1` THEN POP_ASSUM MP_TAC THEN SUBGOAL_THEN`(x,v,w,sigma_fan x V E1 v w) IN d1_fan(x:real^3,V,E1)`ASSUME_TAC THENL(*1*)[ ASM_REWRITE_TAC[face;d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`sigma_fan x V E1 v (w:real^3)` THEN ASM_REWRITE_TAC[];(*1*) MRESA_TAC into_domain_power_efn_fan[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool) `;`k:num`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN POP_ASSUM(fun th-> MRESA1_TAC th`((x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3)`) THEN DISCH_THEN(LABEL_TAC"YEU") THEN DISJ_CASES_TAC(SET_RULE`(v' IN {v,w:real^3}) \/ ~(v' IN {v,w})`) THENL(*2*)[ POP_ASSUM MP_TAC THEN REWRITE_TAC[SET_RULE`A IN {B,C}<=> A=B\/ A=C`] THEN STRIP_TAC THENL(*3*)[ MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESAL_TAC SRPRNPL[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;][simple_hypermap] THEN POP_ASSUM (fun th-> MRESA1_TAC th `(x,v,w,sigma_fan x V E1 v w:real^3)`) THEN MP_TAC(SET_RULE`y IN ds1/\ ds1 SUBSET d1_fan (x,V,E1)==> y IN d1_fan (x,V:real^3->bool,E1)`) THEN RESA_TAC THEN SUBGOAL_THEN`node (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) IN node_set (hypermap1_of_fanx (x,V:real^3->bool,E1))` ASSUME_TAC THENL(*4*)[ ASM_REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN EXISTS_TAC`(x,v,w,sigma_fan x V E1 v w:real^3)` THEN ASM_REWRITE_TAC[node];(*4*) SUBGOAL_THEN`x,v,w,sigma_fan x V E1 v w IN node (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w:real^3)`ASSUME_TAC THENL(*5*)[ ASM_REWRITE_TAC[node;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC;(*5*) MRESAL_TAC CONDITION_DART_IN_NODE[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`node (hypermap1_of_fanx (x,V:real^3->bool,E1)) (x,v,w,sigma_fan x V E1 v w)`;`(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][pr2] THEN MP_TAC(SET_RULE`y IN node (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)/\ node (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w) INTER ds1 = {(x,v,w,sigma_fan x V E1 v w)} /\ y IN ds1==> y IN {(x,v,w,sigma_fan x V E1 v w)} `) THEN ASM_REWRITE_TAC[IN_SING;EQ_PAIR_4] THEN STRIP_TAC THEN REMOVE_THEN "YEU" MP_TAC THEN ASM_REWRITE_TAC[POWER;I_DEF;EQ_PAIR_4] THEN RESA_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`w:real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ]](*5*)](*4*);(*3*) MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v:real^3`) THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`v:real^3`) THEN STRIP_TAC THEN SUBGOAL_THEN`x,w,inverse1_sigma_fan x V E1 w v,v IN d1_fan (x,V,E1)`ASSUME_TAC THENL(*4*)[ REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`w:real^3` THEN EXISTS_TAC`inverse1_sigma_fan x V E1 w v:real^3` THEN EXISTS_TAC`v:real^3` THEN ASM_REWRITE_TAC[];(*4*) MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESAL_TAC SRPRNPL[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;][simple_hypermap] THEN POP_ASSUM (fun th-> MRESA1_TAC th `x,w,inverse1_sigma_fan x V E1 w v,v:real^3`) THEN SUBGOAL_THEN`(x,w,inverse1_sigma_fan x V E1 w v,v:real^3) =f1_fan x V E1 (x,v,w,sigma_fan x V E1 v w)` ASSUME_TAC THENL(*5*)[ REWRITE_TAC[f1_fan];(*5*) SUBGOAL_THEN`x:real^3,v,w,sigma_fan x V E1 v w IN ds1`ASSUME_TAC THENL(*6*)[ FIND_ASSUM (fun th-> REWRITE_TAC[SYM th;face;IN_ELIM_THM;orbit_map])`face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w:real^3) = ds1` THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC;(*6*) MRESA_TAC condition_f1_fan_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`((x,w,inverse1_sigma_fan x V E1 w v,v):real^3#real^3#real^3#real^3)` ;`((x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3)`;`ds1:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM MP_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MRESA_TAC lemma_face_identity[`hypermap1_of_fanx (x:real^3,V,E1)`;`(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`;`(x,w,inverse1_sigma_fan x V E1 w v,v):real^3#real^3#real^3#real^3`;] THEN MP_TAC(SET_RULE`y IN ds1/\ ds1 SUBSET d1_fan (x,V,E1)==> y IN d1_fan (x,V:real^3->bool,E1)`) THEN RESA_TAC THEN SUBGOAL_THEN`node (hypermap1_of_fanx (x,V,E1)) (x,w,inverse1_sigma_fan x V E1 w v,v) IN node_set (hypermap1_of_fanx (x,V:real^3->bool,E1))` ASSUME_TAC THENL(*7*)[ ASM_REWRITE_TAC[node_set;IN_ELIM_THM;set_of_orbits] THEN EXISTS_TAC`(x,w,inverse1_sigma_fan x V E1 w v,v:real^3)` THEN ASM_REWRITE_TAC[node];(*7*) SUBGOAL_THEN`(x,w,inverse1_sigma_fan x V E1 w v,v)IN node (hypermap1_of_fanx (x,V,E1)) (x,w,inverse1_sigma_fan x V E1 w v,v:real^3)`ASSUME_TAC THENL(*8*)[ ASM_REWRITE_TAC[node;orbit_map;IN_ELIM_THM] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC;(*8*) MRESAL_TAC CONDITION_DART_IN_NODE[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`node (hypermap1_of_fanx (x,V:real^3->bool,E1)) (x,w,inverse1_sigma_fan x V E1 w v,v)`;`(x,w,inverse1_sigma_fan x V E1 w v,v):real^3#real^3#real^3#real^3`;`y:real^3#real^3#real^3#real^3`][pr2] THEN MP_TAC(SET_RULE`y IN node (hypermap1_of_fanx (x,V,E1)) (x,w,inverse1_sigma_fan x V E1 w v,v)/\ node (hypermap1_of_fanx (x,V,E1)) (x,w,inverse1_sigma_fan x V E1 w v,v) INTER ds1 = {(x,w,inverse1_sigma_fan x V E1 w v,v)} /\ y IN ds1==> y IN {(x,w,inverse1_sigma_fan x V E1 w v,v:real^3)} `) THEN ASM_REWRITE_TAC[IN_SING;EQ_PAIR_4] THEN STRIP_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`inverse1_sigma_fan x V E1 w v:real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN MRESA_TAC aff_gt_eq_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th `aff_gt {x:real^3, w, inverse1_sigma_fan x V E w u} {u}`) THEN POP_ASSUM MATCH_MP_TAC THEN EXISTS_TAC`(x, w, inverse1_sigma_fan x V E w u,u:real^3)` THEN REWRITE_TAC[pr2;pr3;f1_fan] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`E:(real^3->bool)->bool`;`w:real^3`] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th `u:real^3`) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN STRIP_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`w:real^3`;`inverse1_sigma_fan x V E w u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN SUBGOAL_THEN`x,w,inverse1_sigma_fan x V E w u,u= f1_fan x V E ((x,u,w,sigma_fan x V E u w):real^3#real^3#real^3#real^3)` ASSUME_TAC THENL(*9*)[REWRITE_TAC[f1_fan;EQ_PAIR_4];(*9*) POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN MATCH_MP_TAC condition_f1_fan_in_face_set THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`V:real^3->bool` THEN EXISTS_TAC`E:(real^3->bool)->bool` THEN EXISTS_TAC`(x,u,w,sigma_fan x V E u w:real^3)` THEN ASM_REWRITE_TAC[] THEN MRESA_TAC f2_EQ_F30_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] ](*9*)](*8*)](*7*)](*6*)](*5*)](*4*)](*3*);(*2*) MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v':real^3`;`w':real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]) THEN FIND_ASSUM MP_TAC`{v', w':real^3} IN E1` THEN FIND_ASSUM( fun th-> GEN_REWRITE_TAC(LAND_CONV o DEPTH_CONV)[SYM th;UNION;IN_ELIM_THM])`E UNION {{v, w:real^3}}=E1` THEN STRIP_TAC THENL(*3*)[ MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`v':real^3`;`w':real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN REMOVE_THEN "LINH"(fun th-> MRESA1_TAC th `aff_gt {x, v', w'} {sigma_fan x V E1 v' w':real^3}`) THEN POP_ASSUM MATCH_MP_TAC THEN EXISTS_TAC`y:real^3#real^3#real^3#real^3` THEN ASM_REWRITE_TAC[pr2;pr3;f1_fan] THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v':real^3`;`w':real^3`] THEN DISJ_CASES_TAC(SET_RULE`~(x,v',w',sigma_fan x V E v' w' IN ds)\/ x,v',w',sigma_fan x V E v' w' IN (ds:real^3#real^3#real^3#real^3->bool)`) THENL(*4*)[ SUBGOAL_THEN`~(ds = face (hypermap1_of_fanx (x,V,E)) (x,v',w',sigma_fan x V E v' w':real^3))`ASSUME_TAC THENL(*5*)[ POP_ASSUM MP_TAC THEN MATCH_MP_TAC MONO_NOT THEN RESA_TAC THEN REWRITE_TAC[face;IN_ELIM_THM;orbit_map] THEN EXISTS_TAC`0:num` THEN REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC;(*5*) ABBREV_TAC`ds0=face (hypermap1_of_fanx (x,V,E)) (x,v',w',sigma_fan x V E v' (w':real^3))` THEN SUBGOAL_THEN`ds0 IN face_set (hypermap1_of_fanx (x:real^3,V,E))` ASSUME_TAC THENL(*6*)[ REWRITE_TAC[face_set; set_of_orbits;IN_ELIM_THM] THEN EXISTS_TAC`(x,v',w':real^3,sigma_fan x V E v' w')` THEN ASM_REWRITE_TAC[] THEN EXPAND_TAC "ds0" THEN REWRITE_TAC[face] THEN ASM_REWRITE_TAC[d1_fan;IN_ELIM_THM] THEN EXISTS_TAC`x:real^3` THEN EXISTS_TAC`v':real^3` THEN EXISTS_TAC`w':real^3` THEN EXISTS_TAC`sigma_fan x V E v' w':real^3` THEN ASM_REWRITE_TAC[];(*6*) MRESAL_TAC DOMAIN_TRANF_FACE_DELETE_DS [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ;`(ds0:real^3#real^3#real^3#real^3->bool)`;][DELETE;IN_ELIM_THM] THEN REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN MRESA_TAC unique_tranf_fan [`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ;`ds1:real^3#real^3#real^3#real^3->bool` ;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)` ;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)` ; `(face (hypermap1_of_fanx (x:real^3,V:real^3->bool,E)) (y:real^3#real^3#real^3#real^3)):real^3#real^3#real^3#real^3->bool` ;`(ds1:real^3#real^3#real^3#real^3->bool)` ;`((x,v',w':real^3,sigma_fan x V E v' w'):real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MATCH_MP_TAC THEN ASM_REWRITE_TAC[DELETE;IN_ELIM_THM;tran] THEN REMOVE_THEN "YEU" MP_TAC THEN RESA_TAC THEN REMOVE_THEN "LINH1" MP_TAC THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESAL_TAC identity_face_in_face_set[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`ds1:real^3#real^3#real^3#real^3->bool`;`(f1_fan x V E1 POWER k) (x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`][] THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN EXPAND_TAC "ds0" THEN POP_ASSUM(fun th-> REWRITE_TAC[th;face;IN_ELIM_THM;orbit_map]) THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC](*6*)](*5*);(*4*) ASM_REWRITE_TAC[]](*4*);(*3*) POP_ASSUM MP_TAC THEN REWRITE_TAC[IN_SING] THEN POP_ASSUM MP_TAC THEN SET_TAC[]]]]);;
let lemmaINTERS_HALF_SPACE_DS_FANADD1=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 U1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ aff_gt {x, u, w} {v } INTER aff_gt {x, v,u} {sigma_fan x V E v u } INTER aff_gt {x, v, sigma_fan x V E v u } {w} INTER aff_gt {x, sigma_fan x V E v u,w} {v}=U1 ==> U1 INTER aff_gt {x, v, w} {u} SUBSET dartset_leads_into_fan x V E1 ds2`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds2_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[conforming_fan;conforming_half_space_fan] THEN STRIP_TAC THEN REMOVE_ASSUM_TAC THEN REMOVE_ASSUM_TAC THEN POP_ASSUM(fun th-> MRESA1_TAC th`ds2:real^3#real^3#real^3#real^3->bool`) THEN MRESA_TAC reperentation_of_ds2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN REWRITE_TAC[INTERS;IN_ELIM_THM;SUBSET] THEN REMOVE_THEN "EM"(fun th-> REWRITE_TAC[SYM th;INTERS;IN_ELIM_THM;INTER]) THEN REPEAT STRIP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1==> {v, w} IN E1`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B}={B,A}`] THEN ASSUME_TAC th THEN STRIP_TAC) THEN MP_TAC(SET_RULE`y IN {f10, f20, f30:real^3#real^3#real^3#real^3}==> y =f10\/ y =f20\/ y =f30`) THEN RESA_TAC THENL[ FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,w,v,u = f10:real^3#real^3#real^3#real^3` THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`w:real^3`;`v:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT3[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN ASM_REWRITE_TAC[]; FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,v,u,w = f20:real^3#real^3#real^3#real^3` THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 /\ {v, u} IN E==> {v, u} IN E1`) THEN RESA_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC INVERSE1_SIGMA_FAN[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`u:real^3`] THEN POP_ASSUM (fun th-> MRESA1_TAC th`w:real^3`) THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`v:real^3`;`u:real^3`] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th]); FIND_ASSUM(fun th-> REWRITE_TAC[SYM th;pr2;pr3;f1_fan])`x,u,w,v = f30:real^3#real^3#real^3#real^3` THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 /\ {u,w} IN E==> {u,w} IN E1`) THEN RESA_TAC THEN MRESA_TAC fully_surrounded_imp_aff_gt_3_1_of_edge_eq_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`u:real^3`;`w:real^3`] THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`; `w:real^3` ] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN RESA_TAC THEN POP_ASSUM (fun th-> MRESA_TAC th[`u:real^3`;`w:real^3`]) THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] 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 remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E:(real^3->bool)->bool) `;` (u:real^3)`; `(v:real^3)`] THEN MP_TAC(SET_RULE`~(v=u:real^3)/\ ~(u=w)==> ~(u IN {v,w})`) THEN RESA_TAC THEN RESA_TAC]);;
let lemmaINTERS_HALF_SPACE_DS_FANADD2=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 U1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ aff_gt {x, u, w} {v } INTER aff_gt {x, v,u} {sigma_fan x V E v u } INTER aff_gt {x, v, sigma_fan x V E v u } {w} INTER aff_gt {x, sigma_fan x V E v u,w} {v}=U1 ==> U1 INTER aff_gt {x, v, w} {sigma_fan x V E v u} SUBSET dartset_leads_into_fan x V E1 ds1`,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC ds1_in_face_set_fanadd[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC FANADD_CONFORMING[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN POP_ASSUM MP_TAC THEN REMOVE_THEN "EM"(fun th-> REWRITE_TAC[SYM th;INTERS;IN_ELIM_THM;INTER;SUBSET]) THEN REPEAT STRIP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 ==> {v,w:real^3} IN E1`) THEN RESA_TAC THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT1[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `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 sigma_fan_in_set_of_edge[`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 REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1/\ {sigma_fan x V E v u,v} IN E ==> { sigma_fan x V E v u,v} IN E1`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E1)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`v:real^3`;`w:real^3`]) THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`sigma_fan x V E v u:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC inter_aff_gt_3_1_is_aff_gt_1_3[`x:real^3`;`sigma_fan x V E v u:real^3`;`v:real^3`;`w:real^3`] THEN MRESA_TAC aff_gt_1_3_subset_dart_leads_into_fan[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`;`sigma_fan x V E v u:real^3`;` v:real^3`;` w:real^3`] THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[SYM th]) THEN STRIP_TAC THEN MP_TAC(SET_RULE` x' IN aff_gt {x, sigma_fan x V E v u,v} {w} /\ x' IN aff_gt {x, w, sigma_fan x V E v u} {v} /\ x' IN aff_gt {x, v, w} {sigma_fan x V E v u} /\ aff_gt {x, sigma_fan x V E v u, v} {w} INTER aff_gt {x, v, w} {sigma_fan x V E v u} INTER aff_gt {x, w, sigma_fan x V E v u} {v} SUBSET dart_leads_into x V E1 v w ==> (x':real^3) IN dart_leads_into x V E1 v w`) THEN RESA_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C}={A,C,B}`] THEN RESA_TAC THEN SUBGOAL_THEN`(x,v,w:real^3,sigma_fan x V E v u:real^3) IN ds1` ASSUME_TAC THENL[ FIND_ASSUM (fun th-> REWRITE_TAC[SYM th;face;IN_ELIM_THM;orbit_map])`face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w:real^3) = ds1` THEN EXISTS_TAC`0:num` THEN ASM_REWRITE_TAC[POWER;I_DEF] THEN ARITH_TAC; MRESA_TAC DARTSET_LEADS_INTO_FAN[`x:real^3`;`(V:real^3->bool)`;`(E1:(real^3->bool)->bool)`; `ds1:real^3#real^3#real^3#real^3->bool`] THEN POP_ASSUM (fun th-> MRESAL1_TAC th `(x,v,w,sigma_fan x V E1 v w):real^3#real^3#real^3#real^3`[pr2;pr3])]);;
let aff_gt_3_1_INTER_aff_SUBSET_aff_gt_2_1=
prove(`!a x y z w:real^3. azim a x y z < pi /\ &0< azim a x y z /\ azim a x y w < pi /\ &0< azim a x y w /\ DISJOINT {a, x} {w} /\ ~collinear {a, x, w} /\ ~coplanar {a, x, y, z} ==> aff_gt {a,x,y}{z} INTER aff{a,x,w} SUBSET aff_gt {a,x} {w}`,
REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,B,D,C}`] THEN RESA_TAC THEN ASSUME_TAC th) THEN MRESA_TAC notcoplanar_imp_notcollinear_fan[`a:real^3`;`x:real^3`;`z:real^3`;`y:real^3`] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`a:real^3`; `x:real^3`;`z:real^3`;`y:real^3`] THEN MRESA_TAC aff_gt_3_1_rep_cross_dot[`a:real^3`;`x:real^3`;`y:real^3`;`z:real^3`] THEN REWRITE_TAC[AFFINE_HULL_3;aff;INTER;SUBSET;IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_2_1[`a:real^3`;`x:real^3`;`w:real^3`][IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EXISTS_TAC`u:real` THEN EXISTS_TAC`v:real` THEN EXISTS_TAC`w':real` THEN ASM_REWRITE_TAC[] THEN POP_ASSUM(fun th-> POP_ASSUM MP_TAC THEN POP_ASSUM MP_TAC THEN REWRITE_TAC[th]) THEN REWRITE_TAC[VECTOR_ARITH`(u % a + v % x + w' % w) - a= v % (x-a) + w' % (w-a) +((u+v +w')- &1)% a`] THEN REPEAT STRIP_TAC THEN POP_ASSUM(fun th-> POP_ASSUM MP_TAC THEN REWRITE_TAC[th;VECTOR_ARITH`v % (x - a) + w' % (w - a) + (&1 - &1) % a=v % (x - a) + w' % (w - a)`;]) THEN REWRITE_TAC[DOT_RADD;DOT_RMUL;DOT_CROSS_SELF;REAL_ARITH`v * &0 +A=A`] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`a:real^3`; `x:real^3`;`w:real^3`;`y:real^3`] THEN STRIP_TAC THEN MRESA_TAC REAL_LT_LCANCEL_IMP[`((x - a) cross (y - a)) dot (w - a:real^3)`;`&0`;`w':real`] THEN POP_ASSUM MATCH_MP_TAC THEN POP_ASSUM MP_TAC THEN REAL_ARITH_TAC);;
let aff_gt_3_1_INTER_aff_SUBSET_aff_gt_2_14=
prove(`!a x y z:real^3. ~coplanar {a, x, y, z} ==> aff_gt {a,x,y}{z} INTER aff{a,x,z} SUBSET aff_gt {a,x} {z}`,
REPEAT STRIP_TAC THEN POP_ASSUM (fun th-> MP_TAC th THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,B,D,C}`] THEN RESA_TAC THEN ASSUME_TAC th) THEN MRESA_TAC notcoplanar_imp_notcollinear_fan[`a:real^3`;`x:real^3`;`z:real^3`;`y:real^3`] THEN MRESA_TAC cross_dot_fully_surrounded_fan[`a:real^3`; `x:real^3`;`z:real^3`;`y:real^3`] THEN REWRITE_TAC[AFFINE_HULL_3;aff;INTER;SUBSET;IN_ELIM_THM] THEN MRESA_TAC notcoplanar_disjoint[`a:real^3`;`x:real^3`;`y:real^3`;`z:real^3`] THEN MRESA_TAC notcoplanar_disjoints[`a:real^3`;`x:real^3`;`y:real^3`;`z:real^3`] THEN MP_TAC(SET_RULE`~(a=z) /\ ~(x=z:real^3)==>DISJOINT {a, x} {z}`) THEN RESA_TAC THEN MRESAL_TAC AFF_GT_2_1[`a:real^3`;`x:real^3`;`z:real^3`][IN_ELIM_THM] THEN MRESAL_TAC AFF_GT_3_1[`a:real^3`;`x:real^3`;`y:real^3`;`z:real^3`][IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EXISTS_TAC`u:real` THEN EXISTS_TAC`v:real` THEN EXISTS_TAC`w:real` THEN ASM_REWRITE_TAC[] THEN POP_ASSUM(fun th-> ASM_REWRITE_TAC[SYM th] THEN MP_TAC th) THEN ASM_REWRITE_TAC[VECTOR_ARITH`t1 % a + t2 % x + t3 % y + t4 % z = u % a + v % x + w % z <=> ((u+v+w)-(t1+t2+t3+t4))%a+(w-t4)%(z-a)= t3%(y-a)+(t2-v)%(x-a)`;VECTOR_ARITH`(&1 - &1) % a +A=A`] THEN DISJ_CASES_TAC(REAL_ARITH`~(w-t4= &0)\/ w=t4:real`) THENL[ STRIP_TAC THEN MP_TAC(SET_RULE`(w - t4) % (z - a:real^3) = t3 % (y - a) + (t2 - v) % (x - a) ==> (inv (w-t4))%((w - t4) % (z - a)) =(inv (w-t4))%( t3 % (y - a) + (t2 - v) % (x - a))`) THEN POP_ASSUM(fun th-> GEN_REWRITE_TAC( LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN MRESA1_TAC REAL_MUL_LINV `w-t4:real` THEN ASM_REWRITE_TAC[VECTOR_ARITH`A%B%C=(A*B)%C`;VECTOR_ARITH`A%(B+C)=A%B+A%C`;VECTOR_ARITH`&1 %A=A`] THEN STRIP_TAC THEN FIND_ASSUM MP_TAC`~(coplanar{a, x, y, z:real^3})` THEN REWRITE_TAC[COPLANAR_DET_EQ_0] THEN ASM_REWRITE_TAC[DET_3;VECTOR_3;VECTOR_ADD_COMPONENT;VECTOR_MUL_COMPONENT] THEN REAL_ARITH_TAC; ASM_REWRITE_TAC[]]);;
let lemmaINTERS_HALF_SPACE_DS_FANADD3=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30 U1. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 /\ (!E1. FAN(x,V,E1) /\ (!v. v IN V==>CARD (set_of_edge v V E1) > 1) /\ fan80(x,V,E1)/\ N_FAN(x,V,E1)< N_FAN(x,V,E) ==> conforming_fan (x,V,E1)) /\ U1= aff_gt {x, u, w} {v } INTER aff_gt {x, v,u} {sigma_fan x V E v u } INTER aff_gt {x, v, sigma_fan x V E v u } {w} INTER aff_gt {x, sigma_fan x V E v u,w} {v} ==> U1 INTER aff {x,v,w} SUBSET aff_gt {x} {v, w} `,
REPEAT STRIP_TAC THEN POP_ASSUM MP_TAC THEN DISCH_THEN(LABEL_TAC"EM") THEN MRESA_TAC STEP3_REDUCE_FAN[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; `(E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`;`(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3` ] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E:(real^3->bool)->bool)`;`(\t. res (t x V E) (d1_fan (x,V,E)))`] THEN MRESA_TAC hypermap_of_fan_rep[`x:real^3`;`V:real^3->bool`;`(E1:(real^3->bool)->bool)`;`(\t. res (t x V E1) (d1_fan (x,V,E1)))`] THEN MRESA_TAC add_edge_imp_card_set_edge_ge1_fan[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`;] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E:(real^3->bool)->bool)`] THEN MRESA_TAC dartset_fully_surrounded_is_non_isolated_fan[`x:real^3`;`(V:real^3->bool)`; `(E1:(real^3->bool)->bool)`] THEN MRESA_TAC face_subset_dart_fan[`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`ds:real^3#real^3#real^3#real^3->bool`] THEN MP_TAC(SET_RULE`{f1,f2,f3} SUBSET ds/\ ds SUBSET d1_fan (x:real^3,V,E)==> f1 IN d1_fan (x,V,E) /\ f2 IN d1_fan (x,V,E) /\ f3 IN d1_fan (x,V,E)/\ f1 IN ds /\ f2 IN ds /\ f3 IN ds`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN MRESA_TAC FAN80_FANADD[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN MRESA_TAC YFANADD_AFF_GT[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `ds:real^3#real^3#real^3#real^3->bool`; `(f1:real^3#real^3#real^3#real^3)` ;`(f2:real^3#real^3#real^3#real^3)`;`(f3:real^3#real^3#real^3#real^3)`;`v:real^3`;`u:real^3`; `w:real^3`;`ds1:real^3#real^3#real^3#real^3->bool`;`ds2:real^3#real^3#real^3#real^3->bool` ;`(f10:real^3#real^3#real^3#real^3)`;`(f20:real^3#real^3#real^3#real^3)`;`(f30:real^3#real^3#real^3#real^3)`;] THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`v:real^3`;`u:real^3`]) THEN MRESA_TAC SIGMA_FAN_OF_FANADD_AT_POINT2[`x:real^3`;`(V:real^3->bool)`;` (E:(real^3->bool)->bool)`; ` (E1:(real^3->bool)->bool)`; `v:real^3`;`u:real^3`; `w:real^3` ] THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1/\ {v,u} IN E ==> { v,u} IN E1`) THEN RESA_TAC THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E1)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`v:real^3`;`u:real^3`]) THEN MP_TAC(SET_RULE` E UNION {{v, w:real^3}} = E1 ==> {v,w:real^3} IN E1`) THEN RESA_TAC THEN MRESA_TAC remark1_fan[`(x:real^3) `;`(V:real^3->bool)`;` (E1:(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) `;` (u:real^3)`; `v:real^3`] THEN MRESA_TAC sigma_fan_in_set_of_edge[`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 REMOVE_ASSUM_TAC THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN STRIP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B}={B,A}`] THEN MRESA_TAC properties_fully_surrounded [`x:real^3`;`(V:real^3->bool)`;`(E:(real^3->bool)->bool)`;`sigma_fan x V E v u:real^3`;`v:real^3`;`u:real^3`] THEN POP_ASSUM MP_TAC THEN ONCE_REWRITE_TAC[SET_RULE`{A,B,C,D}={A,C,D,B}`] THEN STRIP_TAC THEN MRESA_TAC aff_gt_3_1_INTER_aff_SUBSET_aff_gt_2_1[`x:real^3`;`v:real^3`;`u:real^3`;`sigma_fan x V E v u:real^3`;`w:real^3`] THEN POP_ASSUM MP_TAC THEN FIND_ASSUM MP_TAC`fan80 (x:real^3,V,E)` THEN DISCH_TAC THEN POP_ASSUM (fun th -> MP_TAC th THEN REWRITE_TAC[fan80] THEN ASSUME_TAC th) THEN DISCH_TAC THEN POP_ASSUM (fun th -> MRESA_TAC th [`u: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,D,C,B}`] THEN STRIP_TAC THEN MRESA_TAC aff_gt_3_1_INTER_aff_SUBSET_aff_gt_2_14[`x:real^3`;`w:real^3`;`u:real^3`;`v:real^3`;] THEN POP_ASSUM MP_TAC THEN MRESA_TAC aff_gt_inter_aff_gt[`(x:real^3)`;`(v:real^3)`;`(w:real^3)`] THEN GEN_REWRITE_TAC(LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[SET_RULE`{A,B,C}={A,C,B}`] THEN SET_TAC[]);;
let aff_3_rep_cross_dot=
prove(`!x:real^3 v:real^3 u:real^3. ~collinear {x,v,u} ==> aff {x,v,u} ={y:real^3| (((v-x) cross (u-x)) dot (y-x)) = &0}`,
REWRITE_TAC[AFFINE_HULL_3;aff;IN_ELIM_THM;EXTENSION] THEN REPEAT STRIP_TAC THEN EQ_TAC THENL[ STRIP_TAC THEN ASM_REWRITE_TAC[VECTOR_ARITH`(u' % x + v' % v + w % u) - x= ((u'+v'+w)- &1)%x + v'%(v-x)+ w%(u-x)` ;VECTOR_ARITH`(&1- &1)%X+A=A`;DOT_RADD;DOT_RMUL;DOT_CROSS_SELF] THEN REAL_ARITH_TAC; DISCH_THEN(LABEL_TAC"ME") THEN MP_TAC(ISPECL[`x:real^3`;`v:real^3`;`u:real^3`]properties_coordinate) THEN RESA_TAC THEN MRESA_TAC ORTHONORMAL_IMP_SPANNING[`e1_fan (x:real^3) (v:real^3) (u:real^3)`;`e2_fan (x:real^3)( v:real^3) (u:real^3)`;`e3_fan (x:real^3) (v:real^3) (u:real^3)`;] THEN POP_ASSUM MP_TAC THEN ASM_REWRITE_TAC[SPAN_3;EXTENSION] THEN DISCH_TAC THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`(x':real^3)-(x:real^3)`th) THEN ASSUME_TAC(th)) THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`(u:real^3)-(x:real^3)`th)THEN ASSUME_TAC(th)) THEN POP_ASSUM(fun th-> MP_TAC(ISPEC`(v:real^3)-(x:real^3)`th)) THEN REWRITE_TAC[SET_RULE`(x:real^3) IN (:real^3)`;IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN ABBREV_TAC`e1=e1_fan x v u:real^3` THEN ABBREV_TAC`e2=e2_fan x v u:real^3` THEN ABBREV_TAC`e3=e3_fan x v u:real^3` THEN ONCE_REWRITE_TAC[VECTOR_ARITH`x' = u' % x + v' % v + w % u <=> x'-x = ((u'+v'+w)- &1)%x+ v'%(v-x)+ w%(u-x)`] THEN MRESA_TAC ORTHONORMAL_CROSS[`e1:real^3`;`e2:real^3`;`e3:real^3`;] THEN REMOVE_THEN "ME" MP_TAC THEN ASM_REWRITE_TAC[CROSS_LMUL;CROSS_RMUL;CROSS_LADD;CROSS_RADD;CROSS_REFL;] THEN REDUCE_VECTOR_TAC THEN ONCE_REWRITE_TAC[CROSS_SKEW] THEN ASM_REWRITE_TAC[] THEN ASM_REWRITE_TAC[DOT_LADD;DOT_RADD;DOT_LMUL;DOT_RMUL;DOT_LNEG] THEN ASM_REWRITE_TAC[] THEN FIND_ASSUM MP_TAC`orthonormal e1 e2 (e3:real^3)` THEN REWRITE_TAC[orthonormal] THEN STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN FIND_ASSUM MP_TAC`(v - x) dot (e2:real^3) = &0:real` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`v - x = u' % e1 + v' % e2 + w % e3:real^3` THEN REWRITE_TAC[DOT_LADD;DOT_RADD;DOT_LMUL;DOT_RMUL;DOT_LNEG] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN FIND_ASSUM MP_TAC`(u - x) dot (e2:real^3) = &0:real` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`u - x = u'' % e1 + v'' % e2 + w' % e3:real^3` THEN REWRITE_TAC[DOT_LADD;DOT_RADD;DOT_LMUL;DOT_RMUL;DOT_LNEG] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN REDUCE_ARITH_TAC THEN FIND_ASSUM MP_TAC`(v - x) dot (e1:real^3) = &0:real` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`v - x = u' % e1 + v' % e2 + w % e3:real^3` THEN REWRITE_TAC[DOT_LADD;DOT_RADD;DOT_LMUL;DOT_RMUL;DOT_LNEG] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN REWRITE_TAC[REAL_ARITH`u' * w' * --v''' + w * u'' * v''' = (w * u''-u' * w') * v''':real `] THEN REDUCE_ARITH_TAC THEN FIND_ASSUM MP_TAC`&0 < (u - x) dot (e1:real^3)` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`u - x = u'' % e1 + v'' % e2 + w' % e3:real^3` THEN REWRITE_TAC[DOT_LADD;DOT_RADD;DOT_LMUL;DOT_RMUL;DOT_LNEG] THEN ASM_REWRITE_TAC[] THEN ONCE_REWRITE_TAC[DOT_SYM] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN RESA_TAC THEN REDUCE_ARITH_TAC THEN FIND_ASSUM MP_TAC`dist (v,x) % e3 = v - x :real^3` THEN FIND_ASSUM(fun th-> REWRITE_TAC[th])`v - x = u' % e1 + v' % e2 + w % e3:real^3` THEN POP_ASSUM MP_TAC THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN POP_ASSUM(fun th-> REWRITE_TAC[th]) THEN STRIP_TAC THEN REDUCE_VECTOR_TAC THEN STRIP_TAC THEN MP_TAC(SET_RULE`dist (v,x:real^3) % e3 = w % (e3:real^3) ==> dist (v,x) % e3 dot e3 = w % e3 dot e3`) THEN POP_ASSUM( fun th-> GEN_REWRITE_TAC( LAND_CONV o LAND_CONV o LAND_CONV o ONCE_DEPTH_CONV)[th]) THEN REWRITE_TAC[DOT_LMUL] THEN ASM_REWRITE_TAC[] THEN REDUCE_ARITH_TAC THEN STRIP_TAC THEN POP_ASSUM (fun th-> REWRITE_TAC[SYM th;dist]) THEN MRESA_TAC collinear_fan[`x:real^3`;`v:real^3`;`u:real^3`;] THEN MP_TAC(ISPECL[`v:real^3`;`x:real^3`]imp_norm_not_zero_fan) THEN RESA_TAC THEN MP_TAC(REAL_ARITH`&0 < u''==> ~(u''= &0)`) THEN RESA_TAC THEN ASM_REWRITE_TAC[REAL_ENTIRE] THEN RESA_TAC THEN MP_TAC(ISPEC`(norm(v-x:real^3))`REAL_MUL_LINV) THEN RESA_TAC THEN MP_TAC(ISPEC`u'':real`REAL_MUL_LINV) THEN RESA_TAC THEN REDUCE_VECTOR_TAC THEN EXISTS_TAC`&1- (w''-u''' * inv(u'':real) * w') * inv(norm(v-x:real^3))- u''' * inv(u'':real)` THEN EXISTS_TAC`(w''-u''' * inv(u'':real) * w') * inv(norm(v-x:real^3))` THEN EXISTS_TAC`u''' * inv(u'':real)` THEN ASM_REWRITE_TAC[REAL_ARITH`&1 - (w'' - u''' * inv u'' * w') * inv (norm (v - x)) - u''' * inv u'' + (w'' - u''' * inv u'' * w') * inv (norm (v - x)) + u''' * inv u'' = &1`;VECTOR_ARITH`(&1- &1) %A+B+C=B+C`;VECTOR_ARITH`A%(B+C)=A %B+ A%C`;VECTOR_ARITH`A %B %C=(A*B)%C` ;REAL_ARITH`(A*B)*C=A*(B*C)`] THEN VECTOR_ARITH_TAC]);;
let SPACE3_EQ_UNION_3SET=
prove(`!x:real^3 (V:real^3->bool) (E:(real^3->bool)->bool) E1 ds f1 f2 f3 v u w ds1 ds2 f10 f20 f30. FAN(x,V,E) /\ (!v. v IN V==>CARD (set_of_edge v V E) > 1) /\ fan80(x,V,E) /\ ds IN face_set(hypermap1_of_fanx (x,V,E)) /\ CARD ds >3 /\ {f1,f2,f3} SUBSET ds /\ f1_fan x V E f1=f2 /\ f1_fan x V E f2 =f3 /\ ~(f1_fan x V E f3 =f1) /\ pr2 f1 =v /\ pr2 f2 =u /\ pr2 f3=w /\ {v,u} IN E /\ {u,w} IN E /\ ~({w,v} IN E) /\ sigma_fan x V E u w = v /\ pr3 f1= u /\ pr3 f2= w /\ face (hypermap1_of_fanx (x,V,E1)) (x,v,w,sigma_fan x V E1 v w)= ds1 /\ face (hypermap1_of_fanx (x,V,E1)) (x,w,v,sigma_fan x V E1 w v)=ds2 /\ (x,w,v,u)=f10 /\ (x,v,u,w)=f20 /\ (x,u,w,v)=f30 /\ E UNION {{v,w}}= E1 ==> aff {x,v,w} UNION aff_gt {x, v, w} {