(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Lemma: SZIPOAS *)
(* Chapter: Tame *)
(* Author: Vu Quang Thanh *)
(* Date: 2010-02-13 *)
(* ========================================================================== *)
module type Szipoas_type = sig
end;;
flyspeck_needs "hypermap/hypermap.hl";;
flyspeck_needs "tame/pishort.hl";;
module Szipoas= struct
prioritize_num();;
let LEFT_MULT_MAP = Hypermap.LEFT_MULT_MAP;;
(* Definition of the tameness, actually I do not need this formally in my proof *)
let tr_set = prove (`!(H:(A)hypermap) (x:A). (?tr:A->bool. (!y:A. (node H x) y ==> tr y =
triangle (face H y)))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM
SKOLEM_THM] THEN GEN_TAC THEN EXISTS_TAC `
triangle (face (H:(A)hypermap) (y:A))` THEN REWRITE_TAC[]);;
let quad_set = prove (`!(H:(A)hypermap) (x:A). (?qd:A->bool. (!y:A. (node H x) y ==> qd y = quadrilateral (face H y)))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM
SKOLEM_THM] THEN GEN_TAC THEN EXISTS_TAC `quadrilateral (face (H:(A)hypermap) (y:A))` THEN REWRITE_TAC[]);;
let ex_set = prove (`!(H:(A)hypermap) (x:A). (?ex:A->bool. (!y:A. (node H x) y ==> ex y = exceptional (face H y)))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM
SKOLEM_THM] THEN GEN_TAC THEN EXISTS_TAC `exceptional (face (H:(A)hypermap) (y:A))` THEN REWRITE_TAC[]);;
let b_tame = new_definition `b_tame p q = if p,q = 0,3 then &618 / &1000 else
if p,q = 0,4 then &1 / &1 else
if p,q = 1,2 then &66 / &100 else
if p,q = 1,3 then &618 / &1000 else
if p,q = 2,1 then &8 / &10 else
if p,q = 2,2 then &412 / &1000 else
if p,q = 2,3 then &12851 / &10000 else
if p,q = 3,1 then &315 / &1000 else
if p,q = 3,2 then &83 / &100 else
if p,q = 4,0 then &35 / &100 else
if p,q = 4,1 then &374 / &1000 else
if p,q = 5,0 then &4 / &100 else
if p,q = 5,1 then &1144 / &1000 else
if p,q = 6,0 then &689 / &1000 else
if p,q = 7,0 then &145 / &100 else tgt`;;
let d_tame = new_definition `d n = if n = 3 then &0 else
if n = 4 then &206 / &1000 else
if n = 5 then &483 / &1000 else
if n = 6 then &760 / &1000 else tgt`;;
let weight =
REWRITE_RULE[]
(new_type_definition "weight" ("weight","we")
(prove(`?f:(A->bool)->real. !x. f x >= &0`,EXISTS_TAC `(\x:(A->bool). &0)` THEN REAL_ARITH_TAC)));;
let adm_1 = new_definition `adm_1 (H:(A)hypermap) (w:(A->bool)->real) <=> (!x:A. w (face H x) >= d (CARD (face H x)))`;;
let face_of_node = prove (`!(H:(A)hypermap) (x:A). (?fn:A->bool. (!y:A. fn y = ~(node H x
INTER face H y = {})))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM
SKOLEM_THM] THEN GEN_TAC THEN EXISTS_TAC `~((node (H:(A)hypermap) (x:A))
INTER (face (H:(A)hypermap) (y:A))= {})` THEN REWRITE_TAC[]);;
let triangle_of_node = prove (`!(H:(A)hypermap) (x:A). (?trn:A->bool. (!y:A. trn y = (
triangle (face H y) /\ ~(node H x
INTER face H y = {}))))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[GSYM
SKOLEM_THM] THEN GEN_TAC THEN EXISTS_TAC `(
triangle (face (H:(A)hypermap) (y:A)) /\ ~((node (H:(A)hypermap) (x:A))
INTER (face (H:(A)hypermap) (y:A))= {}))` THEN REWRITE_TAC[]);;
let tame_4 = new_definition `tame_4 (H:(A)hypermap) <=> (!x:A. (!y:A. y IN edge H x /\ ~(y = x) ==> (node H x INTER node H y = {})))`;;
let tame_5 = new_definition `tame_5 (H:(A)hypermap) <=> (!x:A y:A. ~(y IN node H x) ==> CARD {z:A | ~(edge H z INTER node H x = {}) /\ ~(edge H z INTER node H y = {})} <= 1)`;;
let inj_path = new_recursive_definition num_RECURSION
`(inj_path (p:num->A) 0 <=> T) /\ (inj_path (p:num->A) (SUC n) <=> (inj_path p n /\ (!j:num. j <= n ==> ~(p (SUC n) = p j))))`;;
let tame_12 = new_definition `tame_12 (H:(A)hypermap) <=> (!(x:A) (y:A). (~((node H x) INTER (face H y) = {}) /\ exceptional (face H y)) ==> (CARD (node H x) <= 6 /\ CARD (node H x) = 6 ==> type_of_node H x = 5,0,1))`;;
(* Definition of the opposite hypermap and some lemmas concerned. *)
let plain_op_lm = prove (`!D:A->bool e:A->A n:A->A f:A->A. FINITE D /\ e
permutes D /\ n
permutes D /\ f
permutes D /\ e o n o f = I /\ e o e = I ==> f o n o f o n = I`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL[`e:A->A`;`D:A->bool`]
PERMUTES_INVERSES_o) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL[`
inverse (e:A->A)`; `(e:A->A) o (n:A->A) o (f:A->A)`; `(e:A->A) o (e:A->A)`]
LEFT_MULT_MAP) THEN ASM_REWRITE_TAC[
o_ASSOC;
I_O_ID] THEN DISCH_TAC THEN MP_TAC(MESON [GSYM
o_ASSOC] `(n:A->A) o (f:A->A) = e ==> (f o n) o f = f o e`) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL[`D:A->bool`; `e:A->A`; `n:A->A`; `f:A->A`]
cyclic_maps) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_SIMP_TAC[GSYM
o_ASSOC]);;
prioritize_real();;
(* Definition of fan, and the construction of the hypermap of fan. I follow the things on the sphere.hl and fan.ml, actually, I modify to fit the part on hypermap *)
let atn2 = new_definition (`atn2 (x,y) =
if ( abs y < x ) then atn(y / x) else
(if (&0 < y) then ((pi / &2) - atn(x / y)) else
(if (y < &0) then (-- (pi/ &2) - atn (x / y)) else ( pi )))`);;
let azim_cycle_fan1 = REWRITE_RULE[SKOLEM_THM] azim_cycle_fan;;
let D1 = new_definition `D1 (x:real^3,V:real^3->bool,E:(real^3->bool)->bool) = {(x:real^3,v:real^3,w:real^3,w1:real^3)|(V v)/\(w IN incident_edges v E) /\ (w1 = sigma_fan x V E v w)}`;;
let D2 = new_definition `D2 (x:real^3,V:real^3->bool,E:(real^3->bool)->bool) = {(x,v,v,v)| (V v) /\ (incident_edges v E = {})}`;;
let e_fan = new_definition `e_fan (x:real^3) V E = (\((x:real^3),(v:real^3),(w:real^3),(w1:real^3)). (x,w,v,(sigma_fan x V E w v)))`;;
let n_fan = new_definition `n_fan (x:real^3) V E = (\(x:real^3,v:real^3,w:real^3,w1:real^3). (x, v, w1, sigma_fan x V E v w1))`;;
(* I made the following as my assumption, this should have been done in the fan part, by that I means, actually when you need a hypermap out of a fan *)
(* If the above assumption, the followings are the properties of the hypermap associated with the fan *)
let hyp_fan_tup = prove (`!x:real^3 V E. fan (x, V, E) ==> tuple_hypermap (hypermap (
dart_fan (x,V,E),
e_fan x V E,
n_fan x V E,
f_fan x V E)) = (
dart_fan (x,V,E),
e_fan x V E,
n_fan x V E,
f_fan x V E)`,
(* A lemma on the bound of the sum related to the cardinality *)
(* Characterization of the node in hypermap associated with a fan *)
let node_fan_map = prove (`!x V E v w i. fan (x, V, E) ==>
node_map (
hypermap_of_fan (x, V, E)) (x, v,
pow_sigma_fan x V E v w i,
pow_sigma_fan x V E v w (SUC i)) = (x, v,
pow_sigma_fan x V E v w (SUC i),
pow_sigma_fan x V E v w (SUC (SUC i)))`,
REPEAT STRIP_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
n_hyp_of_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_REWRITE_TAC[
n_fan;
pow_sigma_fan]);;
(* The following is also not necessary in my task, I put it for the coherent, and following the note, actually, we need to redefine the node edge, face map in the hypermap associated with a fan, and it should be modified in the fan part *)
let pow_node_fan = prove (`!x V E v w. fan (x, V, E) ==> (!i. (
node_map (
hypermap_of_fan (x, V, E))
POWER i) (x, v, w,
sigma_fan x V E v w) = (x, v,
pow_sigma_fan x V E v w i,
pow_sigma_fan x V E v w (SUC i)))`,
REPEAT GEN_TAC THEN DISCH_TAC THEN INDUCT_TAC THENL[REWRITE_TAC[
POWER;
I_THM;
pow_sigma_0;
pow_sigma_1; ARITH_RULE `SUC 0 = 1`]; ASM_REWRITE_TAC[
COM_POWER;
o_THM] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`;`w:real^3`; `i:num`]
node_fan_map) THEN ASM_REWRITE_TAC[]]);;
let triv_ch = prove (`!a:num->A n. {a i | i >= 0 /\ i < n} = {a i | i < n}`,
REPEAT STRIP_TAC THEN REWRITE_TAC[
EXTENSION;
IN_ELIM_THM] THEN STRIP_TAC THEN EQ_TAC THENL[REPEAT STRIP_TAC THEN EXISTS_TAC `i:num` THEN ASM_SIMP_TAC[]; REPEAT STRIP_TAC THEN EXISTS_TAC `i:num` THEN ASM_SIMP_TAC[] THEN ARITH_TAC]);;
let lm2 = prove (`!s:A->bool p:A->A (n:num) x:A. FINITE s /\ p
permutes s ==> ((!m:num. ~(m = 0) /\ (m < n) ==> ~((p
POWER m) x = x)) ==> (!i:num j:num. (i < n) /\ (j < i) ==> ~((p
POWER i) x = (p
POWER j) x)))`,
REPEAT GEN_TAC THEN DISCH_TAC THEN DISCH_THEN (LABEL_TAC "c3") THEN REPLICATE_TAC 3 STRIP_TAC THEN DISCH_THEN (LABEL_TAC "c4") THEN FIRST_X_ASSUM(MP_TAC o MATCH_MP
LM_AUX) THEN REPEAT STRIP_TAC THEN REMOVE_THEN "c3" MP_TAC THEN MP_TAC (ARITH_RULE `(i:num < n:num) /\ (i = (j:num) + (k:num)) ==> k < n`) THEN ASM_REWRITE_TAC[] THEN STRIP_TAC THEN DISCH_THEN (MP_TAC o SPEC `k:num`) THEN ASM_REWRITE_TAC[] THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `k:num`; `j:num`] lm1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`]
INV_MULT_POW) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (ASSUME_TAC o SPEC `j:num`) THEN MP_TAC (MESON [
o_THM] `((p:A->A)
POWER i) x = (p
POWER j) x ==> ((
inverse p
POWER j) o (p
POWER i)) x = ((
inverse p
POWER j) o (p
POWER j)) x`) THEN ASM_REWRITE_TAC[
I_O_ID;
I_THM]);;
let lm3 = prove (`!s:A->bool p:A->A x:A. FINITE s /\ p
permutes s ==> (!m:num. ~(m = 0) /\ (m <
CARD (
orbit_map p x)) ==> ~((p
POWER m) x = x))`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL[`p:A->A`; `m:num`; `x:A`]
card_orbit_le) THEN ASM_REWRITE_TAC[] THEN ASM_ARITH_TAC);;
let lm4 = prove (`!s:A->bool p:A->A x:A m n. FINITE s /\ p
permutes s ==> ((p
POWER (m +n)) x = (p
POWER m) x ==> (p
POWER n) x = x)`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `n:num`; `m:num`] lm1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`]
INV_MULT_POW) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (ASSUME_TAC o SPEC `m:num`) THEN MP_TAC (MESON [
o_THM] `((p:A->A)
POWER (m + n)) x = (p
POWER m) x ==> ((
inverse p
POWER m) o (p
POWER (m + n))) x = ((
inverse p
POWER m) o (p
POWER m)) x`) THEN ASM_REWRITE_TAC[
I_O_ID;
I_THM]);;
let lm5 = prove (`!s:A->bool p:A->A x:A. FINITE s /\ p
permutes s ==> (!i:num j:num. (i <
CARD (
orbit_map (p:A->A) x)) /\ (j < i) ==> ~((p
POWER i) x = (p
POWER j) x))`,
REPLICATE_TAC 7 STRIP_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`] lm3) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `
CARD (
orbit_map (p:A->A) x)`; `x:A`] lm2) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (MP_TAC o SPEC `i:num`) THEN DISCH_THEN (MP_TAC o SPEC `j:num`) THEN ASM_REWRITE_TAC[]);;
let fin_lem = prove (`!s:A->bool p:A->A x. FINITE s /\ p
permutes s ==> FINITE (
orbit_map p x)`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`]
finite_order) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (X_CHOOSE_TAC `n:num`) THEN SUBGOAL_THEN `((p:A->A)
POWER n) x = x` ASSUME_TAC THENL[ASM_SIMP_TAC[
I_THM]; MP_TAC (ISPECL [`p:A->A`; `n:num`; `x:A`]
orbit_cyclic) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL[`n:num`; `(\i. ((p:A->A)
POWER i) x)`]
FINITE_SERIES) THEN REWRITE_TAC[BETA_CONV `(\i. ((p:A->A)
POWER i) x) i`] THEN ASM_SIMP_TAC[]]);;
let lm_sub_inc = prove (`!s:A->bool p:A->A x n. {(p
POWER i) x | i >= 0 /\ i < n}
SUBSET {(p
POWER i) x | i >= 0 /\ i < SUC n}`,
REPEAT STRIP_TAC THEN REWRITE_TAC[
orbit_map;
SUBSET] THEN GEN_TAC THEN REWRITE_TAC[
IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN EXISTS_TAC `i:num` THEN ASM_REWRITE_TAC [] THEN ASM_ARITH_TAC);;
let lm6 = prove (`!p:A->A x n. FINITE {(p
POWER i) x | i >= 0 /\ i < n}`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL [`n:num`; `(\i. ((p:A->A)
POWER i) x)`]
FINITE_SERIES) THEN BETA_TAC THEN MP_TAC (ISPECL [`\i. ((p:A->A)
POWER i) x`; `n:num`]
triv_ch) THEN BETA_TAC THEN SIMP_TAC[]);;
let lm7 = prove (`!s:A->bool p:A->A x n. FINITE s /\ p
permutes s ==>
CARD {(p
POWER i) x | i >= 0 /\ i < n} <=
CARD (
orbit_map p x) /\
CARD {(p
POWER i) x | i >= 0 /\ i < n} <=
CARD {(p
POWER i) x | i >= 0 /\ i < SUC n}`,
REPEAT STRIP_TAC THENL [MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`]
fin_lem) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`; `n:num`] abcd) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`{((p:A->A)
POWER i) x | i >= 0 /\ i < n}`; `
orbit_map (p:A->A) x`] NEW_CARD_SUBSET) THEN ASM_REWRITE_TAC[]; MP_TAC (ISPECL [`p:A->A`; `x:A`; `SUC n`] lm6) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`; `n:num`]
lm_sub_inc) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`{((p:A->A)
POWER i) x | i >= 0 /\ i < n}`; `{((p:A->A)
POWER i) x | i >= 0 /\ i < SUC n}`] NEW_CARD_SUBSET) THEN ASM_REWRITE_TAC[]]);;
let lm9 = prove (`!s:A->bool p:A->A x. FINITE s /\ p
permutes s ==> (!n.
CARD (
orbit_map (p:A->A) x) <= n ==>
CARD {(p
POWER i) x |i >= 0 /\ i < n} =
CARD (
orbit_map (p:A->A) x))`,
let NULL_SERIES_1 = prove(`!f:num->A. {f(i) | i >= 0 /\ i < 0} = {}`, GEN_TAC THEN REWRITE_TAC[EXTENSION; EMPTY; IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN FIRST_ASSUM (MP_TAC o MATCH_MP (ARITH_RULE `i < 0 ==> F`)) THEN SIMP_TAC[]) in REPLICATE_TAC 4 STRIP_TAC THEN INDUCT_TAC THENL [REWRITE_TAC[ARITH_RULE `i <= 0 <=> i = 0`] THEN DISCH_TAC THEN MP_TAC (ISPEC `\i. ((p:A->A) POWER i) x` NULL_SERIES_1) THEN BETA_TAC THEN DISCH_TAC THEN ASM_REWRITE_TAC[CARD_CLAUSES]; DISCH_TAC THEN ASM_CASES_TAC `CARD (orbit_map (p:A->A) x) <= n` THENL [SUBGOAL_THEN `CARD {((p:A->A) POWER i) x | i >= 0 /\ i < n} = CARD (orbit_map (p:A->A) x)` ASSUME_TAC THENL [ASM_MESON_TAC[]; MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`; `n:num`] lm7) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`; `SUC n`] lm7) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_ARITH_TAC]; MP_TAC (ARITH_RULE `CARD (orbit_map (p:A->A) x) <= SUC n /\ ~(CARD (orbit_map (p:A->A) x) <= n) ==> CARD (orbit_map (p:A->A) x) = SUC n`) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`SUC n`; `\i:num. ((p:A->A) POWER i) x`] CARD_FINITE_SERIES_EQ) THEN BETA_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`] lm5) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN SUBGOAL_THEN `{((p:A->A) POWER i) x | i < SUC n} = {((p:A->A) POWER i) x | i >= 0 /\ i < SUC n}` ASSUME_TAC THENL[REWRITE_TAC[EXTENSION; IN_ELIM_THM] THEN REPEAT STRIP_TAC THEN SIMP_TAC [ARITH_RULE `i >= 0`]; ASM_MESON_TAC[]]]]);;
let orbit_character = prove (`!s:A->bool p:A->A x. FINITE s /\ p
permutes s ==> (!n.
CARD (
orbit_map (p:A->A) x) <= n ==> {(p
POWER i) x |i >= 0 /\ i < n} =
orbit_map (p:A->A) x)`,
REPEAT STRIP_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`]
fin_lem) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`; `n:num`] abcd) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`s:A->bool`; `p:A->A`; `x:A`] lm9) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (MP_TAC o SPEC `n:num`) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`{((p:A->A)
POWER i) x | i >= 0 /\ i < n}`; `
orbit_map (p:A->A) x`]
CARD_SUBSET_EQ) THEN ASM_REWRITE_TAC[]);;
let node_fan_character = prove (`!x V E v w w1. fan (x, V, E) /\ (x, v, w, w1)
IN D1 (x, V, E) ==> (!n.
card_node x V E (x, v, w, w1) <= n ==> node (
hypermap_of_fan (x, V, E)) (x, v, w, w1) = {(x, v,
pow_sigma_fan x V E v w i,
pow_sigma_fan x V E v w (SUC i)) | i >= 0 /\ i < n})`,
REPEAT STRIP_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`; `w1:real^3`]
in_d1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_REWRITE_TAC[node] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan3) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
n_hyp_of_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`
dart_fan (x:real^3, V, E)`; `
n_fan (x:real^3) V E`; `((x:real^3), (v:real^3), (w:real^3),
sigma_fan (x:real^3) V E (v:real^3) (w:real^3))`]
orbit_character) THEN ASM_REWRITE_TAC[] THEN ABBREV_TAC `m =
CARD (
orbit_map (
n_fan (x:real^3) V E) (x:real^3,v:real^3,w:real^3,
sigma_fan (x:real^3) V E v w))` THEN SUBGOAL_THEN `(m:num) <= (n:num)` ASSUME_TAC THENL[ASM_MESON_TAC[
card_node;node]; DISCH_THEN (MP_TAC o SPEC `n:num`) THEN ASM_REWRITE_TAC[] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`]
pow_node_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_SIMP_TAC[]]);;
let card_nfan_neq0 = prove (`!x V E v w w1. fan (x, V, E) /\ (x, v, w, w1)
IN D1 (x, V, E) ==> ~(
CARD (
orbit_map (
n_fan x V E) (x, v, w, w1)) = 0)`,
REPEAT GEN_TAC THEN STRIP_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`; `w1:real^3`]
in_d1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan3) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`
dart_fan (x:real^3, V:real^3->bool, E:(real^3->bool)->bool)`; `
n_fan (x:real^3) V E`; `(x:real^3, v:real^3, w:real^3, w1:real^3)`]
card_orb_neq0) THEN ASM_REWRITE_TAC[]);;
(* Characterization of the sum in a node, related to the sum in a segment, that is a communication with the things on part 1, related to azim *)
let sum_in_seg = prove (`!f:A->
real s:A->bool n a:num->A. ~(n = 0) /\ s = {a i | i >= 0 /\ i < n} /\ (!i j. i < j /\ j < n ==> ~(a i = a j)) ==>
sum s f =
sum (0..(n - 1)) (f o a)`,
REPEAT GEN_TAC THEN DISCH_THEN (CONJUNCTS_THEN2 (ASSUME_TAC) (CONJUNCTS_THEN2 (ASSUME_TAC) (LABEL_TAC "h1"))) THEN SUBGOAL_THEN `!i j. i
IN 0..n - 1 /\ j
IN 0..n - 1 /\ (a:num->A) i = a j ==> i = j` ASSUME_TAC THENL[REWRITE_TAC[
IN_NUMSEG] THEN REPEAT STRIP_TAC THEN MP_TAC (ARITH_RULE `i <= n - 1 /\ j <= n - 1 /\ ~(n = 0) ==> i < n /\ j < n`) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_CASES_TAC `(i:num) < j` THENL[USE_THEN "h1" (fun
th -> MP_TAC (SPECL [`i:num`; `j:num`]
th)) THEN ASM_MESON_TAC[]; ASM_CASES_TAC `(j:num) < i` THENL[USE_THEN "h1" (fun
th -> MP_TAC (SPECL [`j:num`; `i:num`]
th)) THEN ASM_MESON_TAC[]; ASM_ARITH_TAC]]; MP_TAC (ISPECL [`n:num`; `a:num->A`]
IMAGE_SEG) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASSUME_TAC (ISPECL [`a:num->A`; `n:num`]
triv_ch) THEN MP_TAC (ISPECL [`a:num->A`; `f:A->
real`; `0..n - 1`]
SUM_IMAGE) THEN ASM_REWRITE_TAC[]]);;
let alt_azim_fan_sum = prove (`!x V E v w w1. fan (x, V, E) /\ (x, v, w, w1)
IN D1 (x, V, E) ==>
sum (node (
hypermap_of_fan (x, V, E)) (x, v, w, w1))
azim_dart =
sum (0..((
card_node x V E (x, v, w, w1)) - 1)) (\i.
azim x v (
pow_sigma_fan x V E v w i) (
pow_sigma_fan x V E v w (SUC i)))`,
REPEAT STRIP_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`; `w1:real^3`]
in_d1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`; `w1:real^3`]
node_fan_character) THEN ASM_REWRITE_TAC[] THEN ABBREV_TAC `m =
CARD (
orbit_map (
n_fan (x:real^3) V E) (x:real^3,v:real^3,w:real^3,
sigma_fan (x:real^3) V E v w))` THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
n_hyp_of_fan) THEN ASM_REWRITE_TAC[
card_node;node] THEN DISCH_TAC THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (MP_TAC o SPEC `m:num`) THEN ASM_REWRITE_TAC[
LE_REFL] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`; `w1:real^3`]
card_nfan_neq0) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan3) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`
dart_fan (x:real^3, V:real^3->bool, E:(real^3->bool)->bool)`; `
n_fan (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool)`; `(x:real^3, v:real^3, w:real^3, w1:real^3)`] lm5) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3`; `w:real^3`]
pow_node_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`
azim_dart`; `{(x , v ,
pow_sigma_fan x V E v w i,
pow_sigma_fan x V E v w (SUC i)) | i >= 0 /\ i < m}`; `m:num`; `\i. (x , v ,
pow_sigma_fan x V E v w i,
pow_sigma_fan x V E v w (SUC i))`]
sum_in_seg) THEN ASM_SIMP_TAC[] THEN SUBGOAL_THEN `(~(m = 0) /\ (!i j. i < j /\ j < m ==> ~(x:real^3,v:real^3,
pow_sigma_fan (x:real^3) V E v w i,
pow_sigma_fan (x:real^3) V E v w (SUC i) = x,v,
pow_sigma_fan (x:real^3) V E v w j,
pow_sigma_fan (x:real^3) V E v w (SUC j))))` ASSUME_TAC THENL[ASM_MESON_TAC[]; ASM_REWRITE_TAC[] THEN SUBGOAL_THEN `(
azim_dart o (\i. x:real^3,v:real^3,
pow_sigma_fan (x:real^3) (V:real^3->bool) E v w i,
pow_sigma_fan (x:real^3) V E v w (SUC i))) = (\i.
azim (x:real^3) (v:real^3) (
pow_sigma_fan (x:real^3) V E v w i) (
pow_sigma_fan (x:real^3) V E v w (SUC i)))` ASSUME_TAC THENL[REWRITE_TAC[
o_DEF;
azim_dart]; ASM_SIMP_TAC[]]]);;
(* I will modify this, when this lemma is finised *)
let lemmaULEKUUB = prove (`!x:real^3 V:real^3->bool (E:(real^3->bool)->bool) (v:real^3) (w:real^3) (w1:real^3). fan (x,V,E) /\ (x,v,w,w1)
IN D1 (x,V,E) ==>
sum (0..card_node x V E (x,v,w,w1) - 1) (\i.
azim x v (
pow_sigma_fan x V E v w i) (
pow_sigma_fan x V E v w (SUC i))) = &2 *
pi`,
CHEAT_TAC);;
(* I use a non precise statement as in the note, since I have not define the contravening hypermap, if you can convince other to change his task, I would like to work on this lemma, for the completion of my lemma, this lemma is essential to my lemma *)
let finite_nfan = prove (`!x V E v w w1. fan (x, V, E) /\ (x, v, w, w1)
IN D1 (x, V, E) ==> FINITE (node (
hypermap_of_fan (x, V, E)) (x, v, w, w1))`,
REPEAT STRIP_TAC THEN REWRITE_TAC[node] THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
n_hyp_of_fan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan1) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`]
hyp_fan3) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (ISPECL [`
dart_fan (x:real^3, V:real^3->bool, E:(real^3->bool)->bool)` ; `
n_fan x V E`; `(x:real^3, v:real^3, w:real^3, w1:real^3)`]
fin_lem) THEN ASM_REWRITE_TAC[]);;
(* This one is for the completeness, actually, when you look at the fan part, you will see the hole in that *)
(* In this lemma, I state in a not precise way, as I have said, since I have not define the contravening. Also, I use a lemma, in the pishort.ml *)
let lemmaSZIPOAS = prove (`!x V E v w w1. fan (x, V, E) /\ (x, v, w, w1)
IN D1 (x, V, E) ==>
card_node x V E (x, v, w, w1) <= 7`,
REPEAT STRIP_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3` ;`w:real^3`; `w1:real^3`] lemmaULEKUUB) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3` ;`w:real^3`; `w1:real^3`]
alt_azim_fan_sum) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `v:real^3` ;`w:real^3`; `w1:real^3`]
finite_nfan) THEN ASM_REWRITE_TAC[] THEN DISCH_TAC THEN MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`] lemmaCDTETAT) THEN ASM_REWRITE_TAC[] THEN DISCH_THEN (LABEL_TAC "fh1") THEN MP_TAC (SPECL [`&852 / &1000`; `x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `(x:real^3, v:real^3, w:real^3, w1:real^3)`]
node_lbound_lm) THEN ASM_REWRITE_TAC[] THEN SUBGOAL_THEN `!d:real^3#real^3#real^3#real^3. &852 / &1000 <=
azim_dart d` ASSUME_TAC THENL[STRIP_TAC THEN ASM_CASES_TAC `(d:real^3#real^3#real^3#real^3)
IN D1 (x:real^3, V:real^3->bool, E:(real^3->bool)->bool)` THENL[USE_THEN "fh1" (MP_TAC o SPEC `d:real^3#real^3#real^3#real^3`) THEN ASM_SIMP_TAC[]; MP_TAC (SPECL [`x:real^3`; `V:real^3->bool`; `E:(real^3->bool)->bool`; `(d:real^3#real^3#real^3#real^3)`]
azim_dart_nin_d1) THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC]; ASM_REWRITE_TAC[] THEN MP_TAC (SPEC `
card_node (x:real^3) (V:real^3->bool) (E:(real^3->bool)->bool) (x, v, w, w1)`
bound_for_pi) THEN ASM_SIMP_TAC[]]);;
end;;