module Lp_ineqs_def = struct
open Sphere;;
open Fan_defs;;
(* Definitions of all fan variables *)
(* All variables must be positive without any side conditions *)
(* A diagonal *)
let fan_defs =
[
azim2_fan; azim3_fan; yn_fan; ln_fan; ye_fan;
rho_fan; sol_fan; tau_fan; rhazim_fan; rhazim2_fan; rhazim3_fan;
y1_fan; y2_fan; y3_fan; y4_fan; y5_fan; y6_fan; y8_fan; y9_fan; y4'_fan;
]
(* Variables for lists *)
(* g - an isomorphism from hypermap_of_list to hypermap_of_fan *)
(* fan = (V,E) - a fan *)
(* g x = h (FST x), h (SND x) *)
let list_defs = map new_definition
[
`azim_list (g,fan) = (azim_dart fan o g):num#num->real`;
`azim2_list (g,fan) = (azim2_fan fan o g):num#num->real`;
`azim3_list (g,fan) = (azim3_fan fan o g):num#num->real`;
`yn_list h = (yn_fan o h):num->real`;
`ln_list h = (ln_fan o h):num->real`;
`rho_list h = (rho_fan o h):num->real`;
`rhazim_list (g,fan) = (rhazim_fan fan o g):num#num->real`;
`rhazim2_list (g,fan) = (rhazim2_fan fan o g):num#num->real`;
`rhazim3_list (g,fan) = (rhazim3_fan fan o g):num#num->real`;
`(ye_list g):(num#num->real) = ye_fan o g`;
`(sol_list (g,fan)):(num#num->bool)->real = sol_fan fan o IMAGE g`;
`(tau_list (g,fan)):(num#num->bool)->real = tau_fan fan o IMAGE g`;
`(y1_list g):(num#num->real) = y1_fan o g`;
`(y2_list g):(num#num->real) = y2_fan o g`;
`(y3_list (g,fan)):(num#num->real) = y3_fan fan o g`;
`(y4_list (g,fan)):(num#num->real) = y4_fan fan o g`;
`(y5_list (g,fan)):(num#num->real) = y5_fan fan o g`;
`(y6_list g):(num#num->real) = y6_fan o g`;
`(y8_list (g,fan)):(num#num->real) = y8_fan fan o g`;
`(y9_list (g,fan)):(num#num->real) = y9_fan fan o g`;
`(y4'_list (g,fan)):(num#num->real) = y4'_fan fan o g`;
];;
let list_defs2 = map (REWRITE_RULE[FUN_EQ_THM; o_THM]) list_defs;;
let list_defs_th = end_itlist CONJ list_defs;;
let list_var_rewrites =
map GSYM list_defs @ map GSYM list_defs2;;
(* All variables are nonnegative *)
let list_var_pos = map (fun tm -> prove(tm,
GEN_TAC THEN REWRITE_TAC list_defs2 THEN
MP_TAC (ISPEC `fan:(real^3->bool)#((real^3->bool)->bool)` PAIR_SURJECTIVE) THEN
STRIP_TAC THEN ASM_REWRITE_TAC fan_defs THEN
TRY (MATCH_MP_TAC REAL_LE_MUL) THEN
REWRITE_TAC[AZIM_DART_POS; REAL_ABS_POS; NORM_POS_LE; DIST_POS; Fnjlbxs.lmfun_ge0]))
[
`!x. &0 <= azim_list (g,fan) x`;
`!x. &0 <= azim2_list (g,fan) x`;
`!x. &0 <= azim3_list (g,fan) x`;
`!x. &0 <= rhazim_list (g,fan) x`;
`!x. &0 <= rhazim2_list (g,fan) x`;
`!x. &0 <= rhazim3_list (g,fan) x`;
`!v. &0 <= yn_list h v`;
`!v. &0 <= ln_list h v`;
`!v. &0 <= rho_list h v`;
`!f. &0 <= sol_list (g,fan) f`;
`!f. &0 <= tau_list (g,fan) f`;
`!x. &0 <= ye_list g x`;
`!x. &0 <= y1_list g x`;
`!x. &0 <= y2_list g x`;
`!x. &0 <= y3_list (g,fan) x`;
`!x. &0 <= y4_list (g,fan) x`;
`!x. &0 <= y5_list (g,fan) x`;
`!x. &0 <= y6_list g x`;
`!x. &0 <= y8_list (g,fan) x`;
`!x. &0 <= y9_list (g,fan) x`;
`!x. &0 <= y4'_list (g,fan) x`;
];;
end;;