(* ========================================================================== *)
(* FLYSPECK - BOOK FORMALIZATION *)
(* *)
(* Chapter: Packing *)
(* Lemma: TSKAJXY *)
(* Author: Thomas C. Hales *)
(* Date: 2012-01-15 *)
(* ========================================================================== *)
(*
Remaining cases of TSKAJXY.
*)
flyspeck_needs "usr/thales/hales_tactic.hl";;
module Tskajxy = struct
open Hales_tactic;;
let GAMMAX_NULLSET = prove_by_refinement(
`!V f X ul k. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell k V ul) /\
NULLSET X ==>
gammaX V X f = &0`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[Pack_defs.gammaX];
TYPIFY `
total_solid V X = &0` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[Pack_defs.total_solid];
TYPIFY `(
VX V X = {})` (C SUBGOAL_THEN SUBST1_TAC);
ASM_REWRITE_TAC[];
MATCH_MP_TAC Bump.VX_EMPTY;
BY(ASM_MESON_TAC[]);
BY(REWRITE_TAC[
SUM_CLAUSES]);
TYPIFY `(edgeX V X = {})` (C SUBGOAL_THEN SUBST1_TAC);
ASM_REWRITE_TAC[];
MATCH_MP_TAC Bump.RIJRIED;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[
SUM_CLAUSES];
TYPIFY `vol X = &0` (C SUBGOAL_THEN SUBST1_TAC);
BY(ASM_MESON_TAC[
volume_props]);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
let GAMMAX_MCELL1 = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell1 V ul) /\ ~(
NULLSET X) ==>
gammaX V X lmfun = vol X - (&2 * mm1 /pi) * sol (
EL 0 ul) X`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.gammaX];
REPEAT WEAK_STRIP_TAC;
TYPIFY `edgeX V X = {}` (C SUBGOAL_THEN SUBST1_TAC);
BY(ASM_MESON_TAC[Bump.EDGE_IMP_K2;Bump.MCELL1;arith `1 <= 1`]);
REWRITE_TAC[
SUM_CLAUSES;Pack_defs.total_solid;arith `x + y* &0 = x`];
REPEAT AP_TERM_TAC;
TYPIFY `
VX V X = {
EL 0 ul}` ENOUGH_TO_SHOW_TAC;
DISCH_THEN SUBST1_TAC;
BY(REWRITE_TAC[
SUM_SING]);
REWRITE_TAC[
EL];
MATCH_MP_TAC
SUBSET_ANTISYM;
CONJ_TAC;
MATCH_MP_TAC
SUBSET_TRANS;
TYPIFY `V
INTER X` EXISTS_TAC;
CONJ_TAC;
MATCH_MP_TAC Bump.HDTFNFZ_SUBSET;
BY(ASM_MESON_TAC[Bump.MCELL1]);
ASM_REWRITE_TAC[];
MATCH_MP_TAC Bump.V_CELL1_SINGLE;
BY(ASM_REWRITE_TAC[]);
GMATCH_SIMP_TAC Hdtfnfz.HDTFNFZ;
REWRITE_TAC[
SUBSET;
IN_SING;
IN_INTER];
CONJ_TAC;
BY(ASM_MESON_TAC[Bump.MCELL1]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
CONJ2_TAC;
MATCH_MP_TAC Marchal_cells_3.HD_IN_MCELL;
BY(ASM_MESON_TAC[
NEGLIGIBLE_EMPTY;arith `~(1=0)`;Bump.MCELL1]);
INTRO_TAC Packing3.BARV_SUBSET [`V`;`3`;`ul`];
GMATCH_SIMP_TAC Bump.set_of_list4;
REWRITE_TAC[
EL;
SUBSET;
IN_INSERT;
NOT_IN_EMPTY];
BY(ASM_MESON_TAC[
IN;Sphere.BARV;arith `3 + 1 = 4`])
]);;
(* }}} *)
let MCELL2_VX_PROPS = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell2 V ul) /\ ~(
NULLSET X) ==>
(
VX V X = {
EL 0 ul,
EL 1 ul}) /\ ~(
EL 0 ul =
EL 1 ul) /\ (edgeX V X = {{
EL 0 ul,
EL 1 ul}})`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.gammaX];
REPEAT WEAK_STRIP_TAC;
TYPIFY `
VX V X = {
EL 0 ul,
EL 1 ul}` (C SUBGOAL_THEN MP_TAC);
GMATCH_SIMP_TAC Bump.HDTFNFZ_ALT;
CONJ_TAC;
BY(ASM_MESON_TAC[Bump.MCELL2]);
ASM_REWRITE_TAC[Bump.MCELL2];
GMATCH_SIMP_TAC Lepjbdj.LEPJBDJ;
ASM_REWRITE_TAC[arith `1 <= 2 /\ 2 <= 4 /\ 2 -1 = 1`];
CONJ_TAC;
BY(ASM_MESON_TAC[
NEGLIGIBLE_EMPTY;Bump.MCELL2]);
MATCH_MP_TAC Bump.SET_OF_LIST_TRUNCATE_1;
BY(ASM_MESON_TAC[Sphere.BARV;
IN;arith `2 <= 3 + 1`]);
DISCH_TAC;
TYPIFY `~(
EL 0 ul =
EL 1 ul)` (C SUBGOAL_THEN MP_TAC);
INTRO_TAC Marchal_cells_3.BARV_CARD_LEMMA [`V`;`ul`;`3`];
ASM_REWRITE_TAC[arith ` 3 + 1 = 4`];
GMATCH_SIMP_TAC Bump.set_of_list4;
CONJ_TAC;
BY(ASM_MESON_TAC[
IN;Sphere.BARV;arith `3 + 1 = 4`]);
BY(MESON_TAC[Marchal_cells_2_new.CARD4_IMP_DISTINCT]);
DISCH_TAC;
TYPIFY `edgeX V X = {{
EL 0 ul,
EL 1 ul}}` (C SUBGOAL_THEN MP_TAC);
REWRITE_TAC[Pack_defs.edgeX];
REWRITE_TAC[GSYM
SUBSET_ANTISYM_EQ];
TYPIFY `!w.
VX V X w <=> w
IN VX V X` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(SET_TAC[]);
CONJ_TAC;
ASM_REWRITE_TAC[
SUBSET;
IN_INSERT;
IN_SING;
IN_ELIM_THM];
REBIND_TAC (`x:real^3->bool`,"A");
GEN_TAC;
REPEAT WEAK_STRIP_TAC;
BY(ASM_MESON_TAC[]);
BY(ASM_MESON_TAC[]);
BY(ASM_REWRITE_TAC[] THEN SET_TAC[]);
BY(ASM_MESON_TAC[]);
REWRITE_TAC[
SUBSET];
ASM_REWRITE_TAC[];
FIRST_X_ASSUM MP_TAC;
BY(SET_TAC[]);
BY(ASM_SIMP_TAC[])
]);;
(* }}} *)
let GAMMAX_MCELL2 = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell2 V ul) /\ ~(
NULLSET X) ==>
gammaX V X lmfun = vol X - (&2 * mm1 /pi) * (sol (
EL 0 ul) X + sol (
EL 1 ul) X) +
(&8*mm2/
pi) * lmfun (hl [
EL 0 ul;
EL 1 ul]) * dihX V X (
EL 0 ul,
EL 1 ul)`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.gammaX];
REPEAT WEAK_STRIP_TAC;
TYPIFY `X
IN mcell_set V` (C SUBGOAL_THEN ASSUME_TAC);
REWRITE_TAC[Pack_defs.mcell_set;Bump.MCELL2;
IN_ELIM_THM];
BY(ASM_MESON_TAC[
IN;Bump.MCELL2]);
INTRO_TAC
MCELL2_VX_PROPS [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
REPEAT WEAK_STRIP_TAC;
TYPIFY `
total_solid V X = (sol (
EL 0 ul) X + sol (
EL 1 ul) X)` (C SUBGOAL_THEN SUBST1_TAC);
ASM_REWRITE_TAC[Pack_defs.total_solid];
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC Geomdetail.SUM_DIS2;
BY(ASM_REWRITE_TAC[]);
ASM_REWRITE_TAC[
IN_SING;
SUM_SING];
GMATCH_SIMP_TAC Marchal_cells_3.BETA_PAIR_THM;
CONJ_TAC;
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[Pack_defs.HL;Bump.set_of_list2_explicit];
TYPIFY `{v,u} = {u,v}` (C SUBGOAL_THEN SUBST1_TAC);
BY(SET_TAC[]);
COND_CASES_TAC;
REWRITE_TAC[];
AP_THM_TAC;
AP_TERM_TAC;
MATCH_MP_TAC Marchal_cells_3.DIHX_SYM;
BY(ASM_MESON_TAC[
IN_SING;
IN]);
BY(REWRITE_TAC[]);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
(* renamed from RCONE_GT_BALL_PLANE *)
let RCONE_GT_HYPERPLANE = prove_by_refinement(
`!v0 v1 b t (p:real^A) r.
p
dot (v1 - v0) = b /\ ~(v1 = v0) /\ (&0 < t) /\ (b - v0
dot (v1 - v0) = r * t *
dist(v1,v0)) ==>
(p
IN rcone_gt v0 v1 t <=> p
IN ball (v0,r))`,
(* {{{ proof *)
[
REWRITE_TAC[Sphere.rcone_gt;Sphere.rconesgn;
ball;
IN_ELIM_THM];
REPEAT WEAK_STRIP_TAC;
TYPIFY `(p - v0)
dot (v1 - v0) = p
dot (v1 - v0) - v0
dot (v1 - v0)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `dp * d * t > r * t * d <=> (&0 < d * t * (dp - r))`];
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
ASM_REWRITE_TAC[GSYM
DIST_NZ];
BY(MESON_TAC[
DIST_SYM;arith `&0 < x - y <=> y < x`])
]);;
(* }}} *)
let RCONE_GE_HYPERPLANE = prove_by_refinement(
`!v0 v1 b t (p:real^A) r.
p
dot (v1 - v0) = b /\ ~(v1 = v0) /\ (&0 < t) /\ (b - v0
dot (v1 - v0) = r * t *
dist(v1,v0)) ==>
(p
IN rcone_ge v0 v1 t <=> p
IN cball (v0,r))`,
(* {{{ proof *)
[
REWRITE_TAC[Sphere.rcone_ge;Sphere.rconesgn;
cball;
IN_ELIM_THM];
REPEAT WEAK_STRIP_TAC;
TYPIFY `(p - v0)
dot (v1 - v0) = p
dot (v1 - v0) - v0
dot (v1 - v0)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `dp * d * t >= r * t * d <=> (&0 <= d * t * (dp - r))`];
GMATCH_SIMP_TAC
REAL_LE_MUL_EQ;
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC
REAL_LE_MUL_EQ;
ASM_REWRITE_TAC[GSYM
DIST_NZ];
BY(MESON_TAC[
DIST_SYM;arith `&0 <= x - y <=> y <= x`])
]);;
(* }}} *)
(* renamed from BALL_DIFF_RCONE_GE *)
let BALL_DIFF_RCONE_GT = prove_by_refinement(
`!u0 u1 (p:real^A) a r.
p
IN ball(u0,r)
DIFF rcone_gt u0 u1 a /\ &0 <= a ==>
p
dot (u1 - u0) <= u0
dot (u1 - u0) + r * a *
dist(u1,u0)`,
(* {{{ proof *)
[
REWRITE_TAC[Sphere.rcone_gt;Sphere.rconesgn;
ball;
IN_ELIM_THM;
IN_DIFF;arith `~(x > y) <=> (x <= y)`];
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `
dot` MP_TAC;
TYPIFY `(p - u0)
dot (u1 - u0) = p
dot (u1 - u0) - u0
dot (u1 - u0)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
TYPIFY `
dist (p,u0) *
dist (u1,u0) * a <= r * a *
dist(u1,u0)` ENOUGH_TO_SHOW_TAC;
BY(REAL_ARITH_TAC);
MATCH_MP_TAC (arith `&0 <= (r - dp) * d1 * a ==> dp * d1 * a <= r * a * d1`);
GMATCH_SIMP_TAC
REAL_LE_MUL;
CONJ_TAC;
BY(ASM_MESON_TAC [arith `d < r ==> &0 <= r - d`;
DIST_SYM]);
GMATCH_SIMP_TAC
REAL_LE_MUL;
ASM_REWRITE_TAC[];
BY(REWRITE_TAC[
DIST_POS_LE])
]);;
(* }}} *)
(* renamed from BALL_DIFF_RCONE_GT_BISECTOR *)
let BALL_DIFF_RCONE_GT_BISECTOR = prove_by_refinement(
`!u0 u1 (p:real^A) r h.
p
IN ball(u0,r)
DIFF rcone_gt u0 u1 (h/r) /\ &2 * h =
dist(u1,u0) /\ &0 < r ==>
dist(p,u0) <=
dist(p,u1)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
BALL_DIFF_RCONE_GT [`u0`;`u1`;`p`;`h/r`;`r`];
ASM_REWRITE_TAC[];
ANTS_TAC;
GMATCH_SIMP_TAC
REAL_LE_RDIV_EQ;
ASM_REWRITE_TAC[arith `&0 * x = &0`];
ONCE_REWRITE_TAC[arith `&0 <= h <=> &0 <= &2 * h`];
BY(ASM_MESON_TAC[
DIST_POS_LE]);
TYPIFY `r * h / r *
dist(u1,u0) = (
dist(u1,u0)) pow 2 / &2` (C SUBGOAL_THEN SUBST1_TAC);
FIRST_X_ASSUM (SUBST1_TAC o SYM);
Calc_derivative.CALC_ID_TAC;
BY((FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
REWRITE_TAC[Leaf_cell.DIST_LE_HALF_PLANE];
REWRITE_TAC[Collect_geom.DIST_POW2_DOT];
MATCH_MP_TAC (arith `&2 * a + c - b - &2 * b1 = &0 ==> (a <= b1 + b / &2 ==> &0 <= c)`);
BY(VECTOR_ARITH_TAC)
]);;
(* }}} *)
let MCELL1_EXPLICIT = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell1 V ul) /\ ~(
NULLSET X) ==>
(X = rogers V ul
INTER cball (
HD ul,
sqrt (&2))
DIFF
rcone_gt (
HD ul) (
HD (
TL ul)) (hl (truncate_simplex 1 ul) /
sqrt (&2)))`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.mcell1];
REPEAT WEAK_STRIP_TAC;
TYPIFY `
sqrt (&2) <= hl ul` (C SUBGOAL_THEN ASSUME_TAC);
PROOF_BY_CONTR_TAC;
FIRST_X_ASSUM_ST `rogers` MP_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[
NEGLIGIBLE_EMPTY]);
FIRST_X_ASSUM_ST `rogers` MP_TAC;
BY(ASM_REWRITE_TAC[])
]);;
(* }}} *)
(* }}} *)
let MCELL1_SOL_RESTRICT = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell1 V ul) /\ ~(
NULLSET X) ==>
sol (
EL 0 ul) X = sol (
EL 0 ul) (X
INTER ball(
EL 0 ul,
sqrt(&2)))`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Urrphbz2.URRPHBZ2 [`V`;`ul`;`1`;`
EL 0 ul`];
ANTS_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC Packing3.BARV_SUBSET [`V`;`3`;`ul`];
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC Bump.set_of_list4;
CONJ2_TAC;
BY(SET_TAC[]);
BY(ASM_MESON_TAC[Sphere.BARV;
IN;arith `3 + 1 = 4`]);
REWRITE_TAC[Sphere.eventually_radial];
REPEAT WEAK_STRIP_TAC;
TYPIFY `?r'. (&0 < r' /\ r' <= r /\ r' <=
sqrt(&2))` (C SUBGOAL_THEN ASSUME_TAC);
EXISTS_TAC `if (r <=
sqrt(&2)) then r else
sqrt(&2)`;
COND_CASES_TAC;
BY(ASM_SIMP_TAC[arith `r > &0 ==> &0 < r`;arith `r <= r`]);
ASM_SIMP_TAC[arith `s <= s`;arith `~(r <= s) ==> (s <= r)`];
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
BY(REAL_ARITH_TAC);
FIRST_X_ASSUM MP_TAC THEN WEAK_STRIP_TAC;
INTRO_TAC Conforming.RADIAL_NORM_CO [`r`;`r'`;`
EL 0 ul`;`X`];
ASM_REWRITE_TAC[GSYM Marchal_cells_2_new.RADIAL_VS_RADIAL_NORM;Bump.MCELL1;
NORMBALL_BALL];
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Vol1.sol [`
EL 0 ul`;`X`;`r'`];
INTRO_TAC Vol1.sol [`
EL 0 ul`;`X
INTER ball (
EL 0 ul,
sqrt(&2))`;`r'`];
ASM_REWRITE_TAC[arith `r' > &0 <=> &0 < r'`;
NORMBALL_BALL;
INTER_ASSOC;GSYM Marchal_cells_2_new.RADIAL_VS_RADIAL_NORM;Bump.MCELL1];
TYPIFY `
ball(
EL 0 ul,
sqrt(&2))
INTER ball(
EL 0 ul,r') =
ball(
EL 0 ul,r')` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[
ball;
EXTENSION;
IN_ELIM_THM;
IN_INTER];
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
TYPIFY `
measurable (mcell 1 V ul
INTER ball (
EL 0 ul,r'))` (C SUBGOAL_THEN ((unlist ASM_REWRITE_TAC)));
MATCH_MP_TAC
MEASURABLE_INTER;
CONJ2_TAC;
BY(ASM_REWRITE_TAC[
MEASURABLE_BALL]);
BY(ASM_MESON_TAC[Urrphbz1.MEASURABLE_MCELL;Bump.MCELL1]);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
let CONVEX_HULL_4_AFF_GE = prove_by_refinement(
`!(w0:real^3) w1 w2 w3. ~coplanar {
w0,w1, w2,
w3} ==>
(
convex hull {
w0,w1,w2,
w3} = aff_ge {
w0} {w1,w2,
w3}
INTER aff_ge {w1,w2,
w3} {
w0})`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC DIMINDEX_3 [];
DISCH_TAC;
INTRO_TAC Collect_geom2.ARIKWRQ [`
w0`;`w1`;`w2`;`
w3`];
REWRITE_TAC[
LET_DEF;
LET_END_DEF;
CONV_CONVEX_HULL];
TYPIFY `~coplanar_alt {
w0,w1,w2,
w3}` (C SUBGOAL_THEN ASSUME_TAC);
BY(ASM_MESON_TAC[Leaf_cell.coplanar_eq_coplanar_alt;arith `2 <= 3`]);
ASM_REWRITE_TAC[];
TYPIFY `
CARD {
w0,w1,w2,
w3} = 4` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC Collect_geom2.NOT_COPLANAR_IMP_CARD4;
BY(ASM_REWRITE_TAC[]);
ASM_REWRITE_TAC[];
DISCH_THEN SUBST1_TAC;
TYPIFY `({
w0,w1,w2,
w3}
DIFF {
w0} = {w1,w2,
w3}) /\ ({
w0,w1,w2,
w3}
DIFF {w1} = {
w0,w2,
w3}) /\ ({
w0,w1,w2,
w3}
DIFF {w2} = {
w0,
w3,w1} ) /\ ({
w0,w1,w2,
w3}
DIFF {
w3} = {
w0,w1,w2})` (C SUBGOAL_THEN (unlist REWRITE_TAC));
FIRST_X_ASSUM (MP_TAC o (MATCH_MP Leaf_cell.CARD4_ALL_DISTINCT));
BY(SET_TAC[]);
INTRO_TAC Cfyxfty.inter_aff_ge_3_1_is_aff_ge_1_3 [`
w0`;`w1`;`w2`;`
w3`];
ASM_REWRITE_TAC[];
BY(SET_TAC[])
]);;
(* }}} *)
let RADIAL_ALT = prove_by_refinement(
`!(x:real^A) r A. radial r x A <=> (A
SUBSET ball(x,r) /\
(!y t. &0 < t /\ y
IN A /\ x + t % (y- x)
IN ball(x,r) ==> x + t % (y - x)
IN A))`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[Sphere.radial];
TYPIFY `A
SUBSET ball(x,r)` ASM_CASES_TAC;
ASM_REWRITE_TAC[];
MATCH_MP_TAC (TAUT `((a ==> b) /\ (b ==> a)) ==> (a = b)`);
CONJ_TAC;
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM (C INTRO_TAC [`y - (x:real^A)`]);
ANTS_TAC;
TYPIFY `x + y - x = (y:real^A)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
BY(ASM_REWRITE_TAC[]);
DISCH_THEN (C INTRO_TAC [`t`]);
DISCH_THEN MATCH_MP_TAC;
ASM_SIMP_TAC[arith `&0 < t ==> t > &0`];
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[
ball;
IN_ELIM_THM;
dist];
TYPIFY `x - (x + t % (y - x)) = (-- t) % (y - x)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
REWRITE_TAC[
NORM_MUL];
BY(ASM_SIMP_TAC[arith `&0 < t ==> abs (-- t) = t`]);
COMMENT "second direction";
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `ball` (C INTRO_TAC [`x + (u:real^A)`;`t`]);
TYPIFY `(x + u) - x = (u:real^A)` (C SUBGOAL_THEN SUBST1_TAC);
BY(VECTOR_ARITH_TAC);
DISCH_THEN MATCH_MP_TAC;
ASM_SIMP_TAC[arith `t > &0 ==> &0 < t`];
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[ball;IN_ELIM_THM;dist;varith `x - (x + t % u) = (-- t) % (u:real^A)`;NORM_MUL];
BY(ASM_SIMP_TAC[arith `t > &0 ==> abs(-- t) = t`]);
BY(ASM_REWRITE_TAC[])
]);;
(* }}} *)
let CONVEX_HULL_SCALE = prove_by_refinement(
`!(w0:real^3) w1 w2
w3 w t. ~coplanar {
w0,w1,w2,
w3} /\ w
IN convex hull {
w0,w1,w2,
w3} /\ &0 <= t /\
(
w0 + t % (w -
w0)
IN aff_ge {w1,w2,
w3} {
w0} ) ==>
(
w0 + t % (w -
w0)
IN convex hull {
w0,w1,w2,
w3})`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
ASM_SIMP_TAC[
CONVEX_HULL_4_AFF_GE];
REPEAT WEAK_STRIP_TAC;
ASM_SIMP_TAC[
CONVEX_HULL_4_AFF_GE];
ASM_REWRITE_TAC[
IN_INTER];
TYPIFY `
DISJOINT {
w0} {w1,w2,
w3}` (C SUBGOAL_THEN ASSUME_TAC);
BY(ASM_MESON_TAC[Planarity.notcoplanar_disjoints]);
ASM_SIMP_TAC[ Planarity.AFF_GE_1_3];
REWRITE_TAC[
IN_ELIM_THM];
FIRST_X_ASSUM_ST `
convex` MP_TAC;
REWRITE_TAC[Marchal_cells_2_new.CONVEX_HULL_4;
IN_ELIM_THM];
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
GEXISTL_TAC [`&1 + t * (u - &1)`;`t * v`;`t * w'`;`t * z`];
GMATCH_SIMP_TAC
REAL_LE_MUL;
GMATCH_SIMP_TAC
REAL_LE_MUL;
GMATCH_SIMP_TAC
REAL_LE_MUL;
ASM_REWRITE_TAC[];
CONJ_TAC;
FIRST_X_ASSUM_ST `&1` MP_TAC;
BY(CONV_TAC REAL_RING);
BY(VECTOR_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
let NULLSET_MCELL1 = prove_by_refinement(
`!V ul. packing V /\ saturated V /\ ul
IN barV V 3 /\ ~NULLSET (mcell1 V ul) ==> ~NULLSET (rogers V ul)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
MCELL1_EXPLICIT [`V`;`mcell1 V ul`;`ul`];
ANTS_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[
IN]);
DISCH_TAC;
TYPIFY `mcell1 V ul
SUBSET rogers V ul` (C SUBGOAL_THEN ASSUME_TAC);
FIRST_X_ASSUM MP_TAC;
BY(SET_TAC[]);
BY(ASM_MESON_TAC[
NEGLIGIBLE_SUBSET])
]);;
(* }}} *)
(* }}} *)
(* }}} *)
let BARV_DISTINCT = prove_by_refinement(
`!V ul. packing V /\ saturated V /\ ul
IN barV V 1 ==>
~(
EL 0 ul =
EL 1 ul)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Packing3.TRUNCATE_SIMPLEX_BARV [`V`;`0`;`1`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[
IN;arith `0 <= 1`]);
FIRST_X_ASSUM_ST `barV` MP_TAC;
REWRITE_TAC[Sphere.BARV;
IN;Sphere.VORONOI_NONDG];
REWRITE_TAC[Sphere.VORONOI_LIST;Sphere.VORONOI_SET];
REPEAT WEAK_STRIP_TAC;
(FIRST_X_ASSUM (C INTRO_TAC [`truncate_simplex 0 ul`]));
(FIRST_X_ASSUM (C INTRO_TAC [`ul`]));
ASM_REWRITE_TAC[Packing3.INITIAL_SUBLIST_REFL;arith `0 < 1 + 1 /\ 0 < 0 + 1 /\ 1 + 1 < 5 /\ 0 + 1 < 5`];
REWRITE_TAC[arith `1 + 1 = 2 /\ 0 + 1 = 1`];
TYPIFY `
set_of_list (truncate_simplex 0 ul) =
set_of_list ul` ENOUGH_TO_SHOW_TAC;
DISCH_THEN SUBST1_TAC;
BY(INT_ARITH_TAC);
GMATCH_SIMP_TAC Packing3.TRUNCATE_0_EQ_HEAD;
REWRITE_TAC[
set_of_list];
GMATCH_SIMP_TAC Bump.set_of_list2;
FIRST_X_ASSUM SUBST1_TAC;
FIRST_X_ASSUM SUBST1_TAC;
FIRST_X_ASSUM (SUBST1_TAC o GSYM);
REWRITE_TAC[arith `1 + 1 = 2 /\ 1 <= 1 + 1`;
EL];
BY(SET_TAC[])
]);;
(* }}} *)
let OMEGA_LIST_BISECTOR = prove_by_refinement(
`!V ul. packing V /\ saturated V /\ ul
IN barV V 3 /\ ~NULLSET (mcell1 V ul) ==>
aff_ge {omega_list_n V ul 1, omega_list_n V ul 2, omega_list_n V ul 3} {
EL 0 ul} =
bis_le (
EL 0 ul) (
EL 1 ul)`,
(* {{{ proof *)
[
REWRITE_TAC[Sphere.bis_le;
EXTENSION;
IN_ELIM_THM];
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
NOT_COPLANAR_OMEGA_LIST_N [`V`;`ul`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
ASM_REWRITE_TAC[
IMAGE_4_EXPLICIT];
REWRITE_TAC[Sphere.OMEGA_LIST_N;GSYM
EL];
DISCH_TAC;
GMATCH_SIMP_TAC Cfyxfty.AFF_GE_3_1;
SUBCONJ_TAC;
ONCE_REWRITE_TAC[
DISJOINT_SYM];
BY(ASM_MESON_TAC[Planarity.notcoplanar_disjoints]);
DISCH_TAC;
REWRITE_TAC[
IN_ELIM_THM];
TYPIFY `!t1 t2 t3 t4.
t1 + t2 + t3 + t4 = &1 /\ x =
t1 % omega_list_n V ul 1 + t2 % omega_list_n V ul 2 + t3 % omega_list_n V ul 3 + t4 %
EL 0 ul ==> (&0 <= t4 <=>
dist(x,
EL 0 ul) <=
dist(x,
EL 1 ul))` ENOUGH_TO_SHOW_TAC;
REPEAT WEAK_STRIP_TAC;
MATCH_MP_TAC (TAUT `((a ==> b) /\ (b ==> a)) ==> (a = b)`);
CONJ_TAC;
REPEAT WEAK_STRIP_TAC;
BY(ASM_MESON_TAC[]);
DISCH_TAC;
FIRST_X_ASSUM_ST `
coplanar` MP_TAC;
TYPIFY `!a b c d. {a,b,c,d} = {b,c,d,(a:real^3)}` (C SUBGOAL_THEN (unlist ONCE_REWRITE_TAC));
BY(SET_TAC[]);
DISCH_THEN (MP_TAC o (MATCH_MP
NOT_COPLANAR_R3));
REWRITE_TAC[Collect_geom2.AFFINE_HULL_4;
EXTENSION;
IN_UNIV;
IN_ELIM_THM];
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
TYPIFY `
dist(omega_list_n V ul 1,
EL 0 ul) =
dist(omega_list_n V ul 1,
EL 1 ul) /\
dist(omega_list_n V ul 2,
EL 0 ul) =
dist(omega_list_n V ul 2,
EL 1 ul) /\
dist(omega_list_n V ul 3,
EL 0 ul) =
dist(omega_list_n V ul 3,
EL 1 ul)` (C SUBGOAL_THEN ASSUME_TAC);
INTRO_TAC Rogers.OMEGA_LIST_N_IN_VORONOI_LIST_GEN [`V`;`ul`;`3`;`1`];
DISCH_TAC;
FIRST_ASSUM (C INTRO_TAC [`1`]);
FIRST_ASSUM (C INTRO_TAC [`2`]);
FIRST_X_ASSUM (C INTRO_TAC [`3`]);
ASM_REWRITE_TAC[arith `1 <= 3 /\ 3 <= 3 /\ 1 <= 2 /\ 2 <= 3 /\ 1 <= 1`];
TYPIFY `barV V 3 ul` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(ASM_MESON_TAC[
IN]);
INTRO_TAC Leaf_cell.VORONOI_LIST_EQ [`V`;`truncate_simplex 1 ul`];
TYPIFY `
set_of_list (truncate_simplex 1 ul) = {
EL 0 ul,
EL 1 ul}` (C SUBGOAL_THEN SUBST1_TAC);
MATCH_MP_TAC Bump.SET_OF_LIST_TRUNCATE_1;
BY(ASM_MESON_TAC[Sphere.BARV;
IN;arith `2 <= 3 + 1`]);
REWRITE_TAC[
IN_INSERT;
NOT_IN_EMPTY];
ONCE_REWRITE_TAC[MESON[] `(!x y. P x y) = !y x. P x y`];
DISCH_THEN (C INTRO_TAC [`1`]);
TYPIFY `barV V 1 (truncate_simplex 1 ul)` (C SUBGOAL_THEN (unlist REWRITE_TAC));
MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV;
EXISTS_TAC `3`;
BY(ASM_MESON_TAC[
IN;arith `1 <= 3`]);
BY(MESON_TAC[]);
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[Leaf_cell.DIST_EQ_HALF_PLANE];
ASM_REWRITE_TAC[Leaf_cell.DIST_LE_HALF_PLANE];
TYPED_ABBREV_TAC `(n:real^3) = (
EL 0 ul -
EL 1 ul)`;
TYPED_ABBREV_TAC `(m:real^3) = (
EL 0 ul +
EL 1 ul)`;
TYPIFY `n
dot (&2 % (
t1 % omega_list_n V ul 1 + t2 % omega_list_n V ul 2 + t3 % omega_list_n V ul 3 + t4 %
EL 0 ul) - m) =
t1 * n
dot (&2 % omega_list_n V ul 1 - m) + t2 * n
dot (&2 % omega_list_n V ul 2 - m) + t3 * n
dot (&2 % omega_list_n V ul 3 - m) + t4 * n
dot (&2 %
EL 0 ul - m)` (C SUBGOAL_THEN SUBST1_TAC);
FIRST_X_ASSUM (MP_TAC o (MATCH_MP (arith `
t1 + t2 + t3 + t4 = &1 ==> t4 = &1 -
t1 - t2 - t3`)));
DISCH_THEN SUBST1_TAC;
BY(VECTOR_ARITH_TAC);
DISCH_THEN ((unlist REWRITE_TAC) o GSYM);
REWRITE_TAC[arith `x * &0 = &0 /\ &0 + x = x`];
MATCH_MP_TAC (TAUT `((a ==> b) /\ (b ==> a)) ==> (a = b)`);
CONJ_TAC;
DISCH_TAC;
GMATCH_SIMP_TAC
REAL_LE_MUL;
ASM_REWRITE_TAC[];
EXPAND_TAC "n";
EXPAND_TAC "m";
BY(REWRITE_TAC[GSYM Leaf_cell.DIST_LE_HALF_PLANE;DIST_REFL;DIST_POS_LE]);
COMMENT "other direction";
TYPIFY `&0 < (n dot (&2 % EL 0 ul - m))` ENOUGH_TO_SHOW_TAC;
REPEAT WEAK_STRIP_TAC;
MATCH_MP_TAC Real_ext.REAL_PROP_NN_RCANCEL;
BY(ASM_MESON_TAC[]);
EXPAND_TAC "n";
EXPAND_TAC "m";
REWRITE_TAC[GSYM Collect_geom.DIST_LT_HALF_PLANE];
REWRITE_TAC[DIST_REFL];
MATCH_MP_TAC DIST_POS_LT;
INTRO_TAC BARV_DISTINCT [`V`;`truncate_simplex 1 ul`];
ANTS_TAC;
ASM_REWRITE_TAC[IN];
MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV;
BY(ASM_MESON_TAC[IN;arith `1 <= 3`]);
REPEAT (GMATCH_SIMP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
BY(ASM_MESON_TAC[arith `1 + 1 <= 3 + 1 /\ 1 <= 1 /\ 0 <= 1`;IN;Sphere.BARV])
]);;
(* }}} *)
(* }}} *)
(* }}} *)
let BARV3_TRUNC1 = prove_by_refinement(
`!V ul. ul
IN barV V 3 ==> truncate_simplex 1 ul = [
EL 0 ul;
EL 1 ul]`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `ul = [
EL 0 ul;
EL 1 ul;
EL 2 ul;
EL 3 ul]` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC Bump.LENGTH4;
BY(ASM_MESON_TAC[
IN;Sphere.BARV;arith `3+1 = 4`]);
BY(ASM_MESON_TAC[Marchal_cells.TRUNCATE_SIMPLEX_EXPLICIT_1])
]);;
(* }}} *)
let MCELL1_RADIAL = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell1 V ul) /\ ~(
NULLSET X) ==>
radial (
sqrt(&2)) (
EL 0 ul) (X
INTER ball(
EL 0 ul,
sqrt (&2)))
`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[Sphere.radial];
CONJ_TAC;
BY(SET_TAC[]);
ASM_REWRITE_TAC[];
INTRO_TAC
MCELL1_EXPLICIT [`V`;`mcell1 V ul`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[Bump.MCELL1];
DISCH_THEN SUBST1_TAC;
REWRITE_TAC [GSYM
EL];
REPEAT WEAK_STRIP_TAC;
TYPIFY `
ball (
EL 0 ul,
sqrt(&2))
SUBSET cball(
EL 0 ul,
sqrt(&2))` (C SUBGOAL_THEN ASSUME_TAC);
BY(REWRITE_TAC[
BALL_SUBSET_CBALL]);
FIRST_X_ASSUM_ST `rogers` MP_TAC;
TYPIFY `((rogers V ul
INTER cball (
EL 0 ul,
sqrt(&2)))
DIFF rcone_gt (
EL 0 ul) (
EL (SUC 0) ul) (hl (truncate_simplex 1 ul) /
sqrt (&2)))
INTER ball (
EL 0 ul,
sqrt (&2)) = (rogers V ul
INTER ball (
EL 0 ul,
sqrt(&2)))
DIFF rcone_gt (
EL 0 ul) (
EL (SUC 0) ul) (hl (truncate_simplex 1 ul) /
sqrt (&2))` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[GSYM
DIFF_INTER];
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[
INTER_ASSOC];
BY(SET_TAC[]);
REWRITE_TAC[
IN_INTER;
IN_DIFF];
REPEAT WEAK_STRIP_TAC;
TYPIFY `~(
EL 0 ul =
EL 1 ul)` (C SUBGOAL_THEN ASSUME_TAC);
INTRO_TAC
BARV_DISTINCT [`V`;`truncate_simplex 1 ul`];
ANTS_TAC;
ASM_REWRITE_TAC[
IN];
MATCH_MP_TAC Packing3.TRUNCATE_SIMPLEX_BARV;
BY(ASM_MESON_TAC[
IN;arith `1 <= 3`]);
REPEAT (GMATCH_SIMP_TAC Packing3.EL_TRUNCATE_SIMPLEX);
BY(ASM_MESON_TAC[arith `1 + 1 <= 3 + 1 /\ 1 <= 1 /\ 0 <= 1`;
IN;Sphere.BARV]);
MATCH_MP_TAC (TAUT `a /\ b ==> b /\ a`);
SUBCONJ_TAC;
REPEAT (FIRST_X_ASSUM_ST `SUC` MP_TAC);
REWRITE_TAC[arith `SUC 0 = 1`];
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `~` MP_TAC;
REWRITE_TAC[];
TYPIFY `
EL 0 ul + u = (
EL 0 ul + (&1/t) % (t % u))` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[
VECTOR_MUL_ASSOC];
TYPIFY `(&1 / t) * t = &1` ENOUGH_TO_SHOW_TAC;
DISCH_THEN SUBST1_TAC;
BY(VECTOR_ARITH_TAC);
Calc_derivative.CALC_ID_TAC;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
MATCH_MP_TAC
RCONE_GT_SCALE;
GMATCH_SIMP_TAC
REAL_LT_DIV;
ASM_REWRITE_TAC[];
BY(ASM_REWRITE_TAC[arith `&0 < &1 /\ ( &0 < t <=> t > &0)`]);
COMMENT "down to 1";
DISCH_TAC;
MATCH_MP_TAC (TAUT `a /\ b ==> b /\ a`);
SUBCONJ_TAC;
REWRITE_TAC[ball;IN_ELIM_THM;dist];
TYPIFY `!u v. (u:real^3) - (u + t % v) = (-- t) % v` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(VECTOR_ARITH_TAC);
REWRITE_TAC[NORM_MUL];
BY(ASM_SIMP_TAC[arith `t > &0 ==> abs(-- t) = t`]);
DISCH_TAC;
COMMENT "last goal";
FIRST_X_ASSUM_ST `rogers` MP_TAC;
REPEAT (GMATCH_SIMP_TAC Marchal_cells_2_new.ROGERS_EXPLICIT);
ASM_REWRITE_TAC[GSYM EL];
TYPED_ABBREV_TAC `(w:real^3) = EL 0 ul + u`;
TYPIFY `t % u = t % (w - EL 0 ul)` (C SUBGOAL_THEN SUBST1_TAC);
EXPAND_TAC "w";
BY(VECTOR_ARITH_TAC);
DISCH_TAC;
MATCH_MP_TAC CONVEX_HULL_SCALE;
ASM_SIMP_TAC[arith `t > &0 ==> &0 <= t`];
SUBCONJ_TAC;
INTRO_TAC NOT_COPLANAR_OMEGA_LIST_N [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[IN]);
REWRITE_TAC[IMAGE_4_EXPLICIT];
BY(MESON_TAC[Sphere.OMEGA_LIST_N;EL]);
DISCH_TAC;
GMATCH_SIMP_TAC OMEGA_LIST_BISECTOR;
ASM_REWRITE_TAC[IN];
INTRO_TAC BALL_DIFF_RCONE_GT_BISECTOR [`EL 0 ul`;`EL 1 ul`;`EL 0 ul + t % u`;`sqrt(&2)`;`hl(truncate_simplex 1 ul)`];
ANTS_TAC;
ASM_REWRITE_TAC[IN_DIFF];
CONJ_TAC;
BY(ASM_MESON_TAC[arith `1 = SUC 0`]);
CONJ2_TAC;
GMATCH_SIMP_TAC REAL_LT_RSQRT;
BY(REAL_ARITH_TAC);
GMATCH_SIMP_TAC BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[IN]);
ONCE_REWRITE_TAC[DIST_SYM];
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
REWRITE_TAC[Sphere.bis_le;IN_ELIM_THM];
REWRITE_TAC[dist];
EXPAND_TAC "w";
REWRITE_TAC[arith `!u v. (u + w) - u = (w:real^3)`];
DISCH_THEN (unlist REWRITE_TAC);
BY(ASM_MESON_TAC[])
]);;
(* }}} *)
(* }}} *)
let HJKDESR1a_1cell = prove_by_refinement(
`&0 < &8 *
pi * sqrt2 / &3 - &8 * mm1 `,
(* {{{ proof *)
[
REWRITE_TAC[ arith `&8 *
pi * sqrt2 / &3 = (&8 / &3) * (
pi * sqrt2)`];
MATCH_MP_TAC (arith `&3 * mm1 < z ==> &0 < (&8/ &3) * z - &8 * mm1`);
MATCH_MP_TAC
REAL_LT_TRANS;
EXISTS_TAC (`&3 * #1.3`);
GMATCH_SIMP_TAC
REAL_LT_LMUL_EQ;
GMATCH_SIMP_TAC
REAL_LT_MUL2;
MP_TAC Flyspeck_constants.bounds;
BY(REAL_ARITH_TAC)
]);;
let TSKAJXY_1 = prove_by_refinement(
`!V ul. saturated V /\ packing V /\ barV V 3 ul ==>
gammaX V (mcell1 V ul) lmfun >= &0 `,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
ASM_CASES_TAC `
NULLSET (mcell1 V ul)`;
BY(ASM_MESON_TAC[
GAMMAX_NULLSET;arith `x = &0 ==> x >= &0`;Bump.MCELL1]);
GMATCH_SIMP_TAC
GAMMAX_MCELL1;
TYPIFY `ul` EXISTS_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC
MCELL1_VOL [`V`;`mcell1 V ul`;`ul`];
ASM_REWRITE_TAC[];
DISCH_TAC;
TYPIFY `sol (
EL 0 ul) (mcell1 V ul) = (&3 /
sqrt(&2) pow 3) * vol (mcell1 V ul)` (C SUBGOAL_THEN SUBST1_TAC);
ASM_REWRITE_TAC[];
Calc_derivative.CALC_ID_TAC;
GMATCH_SIMP_TAC
SQRT_EQ_0;
BY(REAL_ARITH_TAC);
REWRITE_TAC[arith `b - c * d* b = (&1 - c* d) * b`;arith `x >= &0 <=> &0 <= x`];
GMATCH_SIMP_TAC
REAL_LE_MUL;
CONJ2_TAC;
REWRITE_TAC[arith `&0 <= x <=> x >= &0`];
MATCH_MP_TAC Vol1.VOLUME_PROPS_MEASURABLE;
REWRITE_TAC[Bump.MCELL1];
MATCH_MP_TAC Urrphbz1.URRPHBZ1;
BY(ASM_REWRITE_TAC[]);
INTRO_TAC
HJKDESR1a_1cell [];
SUBGOAL_THEN `!x y. (x = (&8 *
pi *
sqrt(&2) / &3) * y) ==> (&0 < x ==> &0 <= y)` MATCH_MP_TAC;
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM MP_TAC;
ASM_REWRITE_TAC[];
DISCH_THEN (MP_TAC o (MATCH_MP (arith `&0 < x ==> &0 <= x`)));
DISCH_TAC;
MATCH_MP_TAC Real_ext.REAL_PROP_NN_LCANCEL;
TYPIFY `(&8 *
pi *
sqrt (&2) / &3)` EXISTS_TAC;
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
REWRITE_TAC[
REAL_OF_NUM_LT];
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
GMATCH_SIMP_TAC
REAL_LT_DIV;
REWRITE_TAC[
REAL_OF_NUM_LT];
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
REWRITE_TAC[
PI_POS];
CONJ_TAC;
BY(REAL_ARITH_TAC);
BY(ARITH_TAC);
Calc_derivative.CALC_ID_TAC;
ASM_SIMP_TAC[
PI_POS;arith `&0 < x ==> ~(x = &0)`;arith `~(&3= &0)`];
GMATCH_SIMP_TAC
SQRT_EQ_0;
REWRITE_TAC[Sphere.sqrt2];
CONJ_TAC;
BY(REAL_ARITH_TAC);
CONJ_TAC;
BY(REAL_ARITH_TAC);
TYPIFY `
sqrt(&2) pow 3 = &2 *
sqrt(&2)` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[arith `3 = SUC 2`;
real_pow];
GMATCH_SIMP_TAC
SQRT_POW_2;
BY(REAL_ARITH_TAC);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
let MCELL_CELL_PARAMETERS_D_EXIST = prove_by_refinement(
`!V ul vl k X. (k <= 4) /\ packing V /\ saturated V /\ (X = mcell k V ul) /\ ul
IN barV V 3 /\
initial_sublist vl ul /\
~NULLSET X ==>
FST (
cell_params_d V X vl) = k`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.cell_params_d];
REPEAT WEAK_STRIP_TAC;
SELECT_TAC THEN (REPEAT (FIRST_X_ASSUM MP_TAC)) THEN (REWRITE_TAC[Bump.BETA_ORDERED_PAIR_THM]);
INTRO_TAC Ajripqn.AJRIPQN [`V`;`ul`;`
SND t`;`k`;`
FST t`];
REWRITE_TAC[
IN_INSERT;
NOT_IN_EMPTY;arith `x = 0 \/ x = 1 \/ x = 2 \/ x = 3 \/ x = 4 <=> x <= 4`];
REWRITE_TAC[
IN];
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `==>` MP_TAC;
ANTS_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[
INTER_IDEMPOT]);
BY(DISCH_THEN (unlist REWRITE_TAC));
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[
NOT_EXISTS_THM];
DISCH_THEN (C INTRO_TAC [`k,ul`]);
BY(ASM_REWRITE_TAC[])
]);;
(* }}} *)
let INITIAL_SUBLIST_2 = prove_by_refinement(
`!ul.
LENGTH ul = 4 ==> initial_sublist [
EL 0 (ul:(A)list);
EL 1 ul] ul`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Bump.LENGTH4 [`ul`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
DISCH_TAC;
TYPIFY `ul =
APPEND [
EL 0 ul;
EL 1 ul] [
EL 2 ul;
EL 3 ul]` ENOUGH_TO_SHOW_TAC;
BY(ASM_MESON_TAC[Packing3.INITIAL_SUBLIST_APPEND]);
REWRITE_TAC[
APPEND];
BY(ASM_MESON_TAC[])
]);;
(* }}} *)
(* }}} *)
let MCELL_PARAM_D_UL = prove_by_refinement(
`!V ul ul' vl X k. (k<= 4) /\ packing V /\ saturated V /\ (X = mcell k V ul) /\ ul
IN barV V 3 /\ ~NULLSET X /\
initial_sublist ul' ul /\
vl =
SND (
cell_params_d V X ul') ==>
(X = mcell k V vl /\ vl
IN barV V 3 /\ initial_sublist ul' vl)`,
(* {{{ proof *)
[
REWRITE_TAC[Pack_defs.cell_params_d];
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
MCELL_CELL_PARAMETERS_D_EXIST [`V`;`ul`;`ul'`;`k`;`X`];
ASM_REWRITE_TAC[];
REWRITE_TAC[Pack_defs.cell_params_d];
Bump.WEAK_SELECT_TAC THEN (REPEAT (FIRST_X_ASSUM MP_TAC)) THEN (REWRITE_TAC[Bump.BETA_ORDERED_PAIR_THM]);
Bump.WEAK_SELECT_TAC THEN (REPEAT (FIRST_X_ASSUM MP_TAC)) THEN (REWRITE_TAC[Bump.BETA_ORDERED_PAIR_THM]);
REPEAT WEAK_STRIP_TAC;
CONJ_TAC;
BY(MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
CONJ_TAC;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[
NOT_EXISTS_THM];
DISCH_THEN (C INTRO_TAC [`k,ul`]);
BY(ASM_MESON_TAC[
FST;
SND])
]);;
(* }}} *)
let MCELL2_PARAM_D_UL = prove_by_refinement(
`!V ul ul' vl X. packing V /\ saturated V /\ (X = mcell2 V ul) /\ ul
IN barV V 3 /\ ~NULLSET X /\
initial_sublist ul' ul /\
vl =
SND (
cell_params_d V X ul') ==>
(X = mcell2 V (vl) /\ vl
IN barV V 3 /\ initial_sublist ul' vl)`,
(* {{{ proof *)
[
REWRITE_TAC[Bump.MCELL2];
REPEAT WEAK_STRIP_TAC THEN MATCH_MP_TAC
MCELL_PARAM_D_UL;
BY(ASM_MESON_TAC[arith `2 <= 4`])
]);;
(* }}} *)
let MCELL2_DIHX = prove_by_refinement(
`!V X ul. saturated V /\ packing V /\ barV V 3 ul /\ (X = mcell2 V ul) /\ ~(
NULLSET X) ==>
dihX V X (
EL 0 ul,
EL 1 ul) =
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[Pack_defs.dihX;Pack_defs.dihu2;
LET_DEF;
LET_END_DEF;Bump.BETA_ORDERED_PAIR_THM];
GMATCH_SIMP_TAC
MCELL2_CELL_PARAMETERS_EXIST;
ASM_REWRITE_TAC[
IN];
CONJ_TAC;
BY(ASM_MESON_TAC[]);
TYPED_ABBREV_TAC `(vl:(real^3)list) =
SND (
cell_params_d V (mcell2 V ul) [
EL 0 ul;
EL 1 ul])`;
INTRO_TAC
MCELL2_PARAM_D_UL [`V`;`ul`;`[
EL 0 ul;
EL 1 ul]`;`vl`;`X`];
ASM_REWRITE_TAC[
IN];
ANTS_TAC;
MATCH_MP_TAC
INITIAL_SUBLIST_2;
BY(ASM_MESON_TAC[Sphere.BARV;
IN;arith `3 + 1 = 4`]);
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Marchal_cells_3.MCELL_ID_OMEGA_LIST_N [`V`;`2`;`2`;`ul`;`vl`];
ANTS_TAC;
ASM_REWRITE_TAC[
IN_INSERT];
BY(ASM_MESON_TAC[Bump.MCELL2]);
REWRITE_TAC[arith `2 = 2`;arith `2 - 1 = 1`];
DISCH_THEN (C INTRO_TAC [`3`]);
REWRITE_TAC[arith `1 <= 3 /\ 3 <= 3`];
DISCH_THEN SUBST1_TAC;
INTRO_TAC Marchal_cells_3.MCELL_ID_MXI_2 [`V`;`2`;`2`;`ul`;`vl`];
ANTS_TAC;
ASM_REWRITE_TAC[
IN_INSERT];
BY(ASM_MESON_TAC[Bump.MCELL2]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC
INITIAL_SUBLIST_2 [`vl`];
ANTS_TAC;
BY(ASM_MESON_TAC[Sphere.BARV;arith `3 + 1 = 4`]);
DISCH_TAC;
INTRO_TAC Packing3.INITIAL_SUBLIST_UNIQUE [`2`;`[
EL 0 ul;
EL 1 ul]`;`[
EL 0 vl;
EL 1 vl]`;`vl`];
ASM_REWRITE_TAC[
LENGTH;arith `SUC (SUC 0) = 2`];
REWRITE_TAC[
CONS_11];
BY(DISCH_THEN (unlist REWRITE_TAC))
]);;
(* }}} *)
(* }}} *)
(* }}} *)
let BIS_HYPERPLANE = prove_by_refinement(
`!u0 (u1:real^A). bis u0 u1 = { p | (&2 % (u0 - u1))
dot p = (u0 - u1)
dot (u0 + u1)}`,
(* {{{ proof *)
[
REWRITE_TAC[Sphere.bis;
EXTENSION;Leaf_cell.DIST_EQ_HALF_PLANE;
IN_ELIM_THM];
REPEAT WEAK_STRIP_TAC;
MATCH_MP_TAC (arith `u = a - (b) ==> (&0 = u <=> a = b)`);
BY(VECTOR_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
(* }}} *)
let RCONE_GE_COS = prove_by_refinement(
`!(u:real^3) v a. ~(u=v) ==>
rcone_ge u v a = {u}
UNION { x | a <=
cos(
arcV u v x) }`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
ONCE_REWRITE_TAC[Trigonometry2.ARC_SYM];
REWRITE_TAC[Sphere.rcone_ge;Sphere.rconesgn;
EXTENSION;
IN_ELIM_THM;
IN_UNION;
IN_SING;Trigonometry1.DOT_COS];
REWRITE_TAC[
dist;arith `x >= y <=> y <= x`];
REPEAT WEAK_STRIP_TAC;
TYPIFY `x = u` ASM_CASES_TAC;
ASM_REWRITE_TAC[];
REWRITE_TAC[
VECTOR_SUB_REFL;
NORM_0];
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `nu * nv * a <= nu * nv * c <=> &0 <= nu * nv * (c - a)`];
GMATCH_SIMP_TAC
REAL_LE_MUL_EQ;
GMATCH_SIMP_TAC
REAL_LE_MUL_EQ;
REWRITE_TAC[
NORM_POS_LT];
REWRITE_TAC[GSYM Trigonometry2.ARCV_VEC0_FORM];
REWRITE_TAC[varith `(v:real^3) - u =
vec 0 <=> (v = u)`];
ASM_REWRITE_TAC[];
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
let ATN_INV = prove_by_refinement(
`!x y. &0 < x /\ &0 < y ==>
atn (x / y) =
pi / &2 -
atn (y/x) `,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Merge_ineq.atn_inv [`y/x`];
ANTS_TAC;
GMATCH_SIMP_TAC
REAL_LT_DIV;
BY(ASM_REWRITE_TAC[]);
TYPIFY `&1 / (y / x) = x / y` (C SUBGOAL_THEN SUBST1_TAC);
Calc_derivative.CALC_ID_TAC;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
let ATN2_Y_NEG = prove_by_refinement(
`!x y. y < &0 ==> atn2(x,y) = -- (
pi / &2) -
atn(x/y)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[Trigonometry2.atn2];
TYPIFY `abs y < x` ASM_CASES_TAC;
ASM_REWRITE_TAC[];
TYPED_ABBREV_TAC `(u:real) = -- y`;
REPEAT (FIRST_X_ASSUM_ST `<` MP_TAC);
TYPIFY `y = -- u` (C SUBGOAL_THEN SUBST1_TAC);
BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC);
REWRITE_TAC[arith `-- u < &0 <=> &0 < u`;arith `-- u / x = -- (u/x)`;
REAL_DIV_NEG];
REWRITE_TAC[
ATN_NEG];
REPEAT WEAK_STRIP_TAC;
GMATCH_SIMP_TAC
ATN_INV;
CONJ2_TAC;
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
BY(ASM_SIMP_TAC[arith `y < &0 ==> ~(&0 < y)`])
]);;
(* }}} *)
let RCONE_PAIR = prove_by_refinement(
`!(u:real^3) v t. ~(u=v) /\ &0 < t /\ t <= &1 ==>
rcone_ge u v t
INTER bis_le u v
SUBSET rcone_ge v u t`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
GMATCH_SIMP_TAC
RCONE_GE_COS;
GMATCH_SIMP_TAC
RCONE_GE_COS;
ASM_REWRITE_TAC[
SUBSET;
IN_INTER;
IN_UNION;
IN_SING;
IN_ELIM_THM;Sphere.bis_le];
GEN_TAC;
TYPIFY `x = u` ASM_CASES_TAC;
BY(ASM_SIMP_TAC[Local_lemmas1.ACR_REFL;
COS_0]);
ASM_REWRITE_TAC[];
TYPIFY `x = v` ASM_CASES_TAC;
BY(ASM_SIMP_TAC[Local_lemmas1.ACR_REFL;
COS_0]);
ASM_REWRITE_TAC[];
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `
cos` MP_TAC;
MATCH_MP_TAC (arith `(t <= x ==> x <= y) ==> (t <= x ==> t <= y)`);
DISCH_TAC;
MATCH_MP_TAC
COS_MONO_LE;
REWRITE_TAC[Local_lemmas1.ARCV_BOUNDS];
TYPIFY `&0 <
cos (
arcV u v x)` (C SUBGOAL_THEN ASSUME_TAC);
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
REPLICATE_TAC 2 (GMATCH_SIMP_TAC Trigonometry1.arcVarc);
ASM_REWRITE_TAC[];
TYPIFY `
dist(v,x) pow 2 <
dist(u,v) pow 2 +
dist(u,x) pow 2` (C SUBGOAL_THEN ASSUME_TAC);
INTRO_TAC
DIST_LAW_OF_COS_ALT [`u`;`v`;`x`];
TYPIFY `&0 < &2 *
dist(u,v) *
dist (u,x) *
cos (
arcV u v x)` ENOUGH_TO_SHOW_TAC;
BY(REAL_ARITH_TAC);
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
CONJ_TAC;
BY(REAL_ARITH_TAC);
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
BY(ASM_SIMP_TAC[GSYM
DIST_POS_LT]);
TYPIFY `
dist(v,u) =
dist(u,v)` (C SUBGOAL_THEN SUBST1_TAC);
BY(MESON_TAC[
DIST_SYM]);
TYPED_ABBREV_TAC `(c:real) =
dist(u,v)` ;
TYPED_ABBREV_TAC `(b:real) =
dist(v,x)` ;
TYPED_ABBREV_TAC `(a:real) =
dist(u,x)` ;
REWRITE_TAC[Local_lemmas1.COS_ARCV];
REWRITE_TAC[Sphere.arclength];
REWRITE_TAC[arith `t + u <= t + v <=> u <= v`];
FIRST_X_ASSUM_ST `
dist(x,u) <=
dist(x,v)` MP_TAC;
ONCE_REWRITE_TAC[
DIST_SYM];
ASM_REWRITE_TAC[];
DISCH_TAC;
TYPIFY `a pow 2 <= b pow 2` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC Collect_geom2.POS_IMP_POW2;
ASM_REWRITE_TAC[];
EXPAND_TAC "a";
BY(REWRITE_TAC[DIST_POS_LE]);
TYPIFY `ups_x (c*c) (a*a) (b*b) = ups_x (c*c) (b*b) (a*a)` (C SUBGOAL_THEN SUBST1_TAC);
BY(MESON_TAC[Collect_geom.UPS_X_SYM]);
TYPED_ABBREV_TAC `(up:real) = ups_x (c*c) (b*b) (a*a)` ;
REPEAT (GMATCH_SIMP_TAC ATN2_Y_NEG);
SUBCONJ_TAC;
FIRST_X_ASSUM_ST `<` MP_TAC;
BY(REAL_ARITH_TAC);
DISCH_TAC;
SUBCONJ_TAC;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
DISCH_TAC;
MATCH_MP_TAC (arith `y <= x ==> u - x <= u - y`);
REWRITE_TAC[ATN_MONO_LE_EQ];
TYPIFY `&0 <= sqrt up` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC SQRT_POS_LE;
EXPAND_TAC "up";
BY(ASM_MESON_TAC[Collect_geom.TROI_OI_DAT_HOI;REAL_POW_2]);
REWRITE_TAC[real_div];
GMATCH_SIMP_TAC Real_ext.REAL_LE_LMUL_IMP;
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `x - y - z = --(y + z - x)`;REAL_INV_NEG;arith `-- x <= --y <=> y <= x`];
GMATCH_SIMP_TAC REAL_LE_INV2;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC)
]);;
(* }}} *)
let MCELL2_SPLIT = prove_by_refinement(
`!V X ul.
saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
~NULLSET X ==>
(X
INTER bis_le (
EL 0 ul) (
EL 1 ul) =
rcone_ge (
EL 0 ul) (
EL 1 ul) (hl (truncate_simplex 1 ul) /
sqrt (&2))
INTER
aff_ge {
EL 0 ul,
EL 1 ul} {mxi V ul,omega_list_n V ul 3}
INTER bis_le (
EL 0 ul) (
EL 1 ul))`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Pack_defs.mcell2 [`V`;`ul`];
TYPIFY `~(hl (truncate_simplex 1 ul) <
sqrt (&2) /\
sqrt (&2) <= hl ul)` ASM_CASES_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[
NEGLIGIBLE_EMPTY]);
FIRST_ASSUM ((unlist REWRITE_TAC) o (REWRITE_RULE[NOT_CLAUSES]));
ASM_REWRITE_TAC[
LET_DEF;
LET_END_DEF];
DISCH_THEN SUBST1_TAC;
TYPED_ABBREV_TAC `(a:real) = hl (truncate_simplex 1 ul)/ (
sqrt (&2))` ;
TYPIFY `
HD ul =
EL 0 ul /\
HD(
TL ul) =
EL 1 ul` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(REWRITE_TAC[
EL;arith `1 = SUC 0`]);
SUBGOAL_THEN `!(a:real^3->bool) b c d. (a
INTER d
SUBSET b) ==> ((a
INTER b
INTER c)
INTER d = a
INTER c
INTER d)` (MATCH_MP_TAC);
BY(SET_TAC[]);
MATCH_MP_TAC
RCONE_PAIR;
EXPAND_TAC "a";
SUBCONJ_TAC;
BY(ASM_MESON_TAC[MCELL2_VX_PROPS]);
DISCH_TAC;
TYPIFY `&0 < sqrt(&2)` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC REAL_LT_RSQRT;
BY(REAL_ARITH_TAC);
CONJ2_TAC;
GMATCH_SIMP_TAC REAL_LE_LDIV_EQ;
ASM_REWRITE_TAC[arith `&1 * x = x`];
FIRST_X_ASSUM_ST `~ ~ x` MP_TAC THEN REWRITE_TAC[];
BY(REAL_ARITH_TAC);
GMATCH_SIMP_TAC REAL_LT_DIV;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT])
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
ONCE_REWRITE_TAC[INTER_COMM];
MATCH_MP_TAC NEGLIGIBLE_SUBSET;
TYPIFY `SDIFF (wedge u v w1 w2) (wedge_ge u v w1 w2)` EXISTS_TAC;
CONJ2_TAC;
BY(MESON_TAC[SDIFF_SUBSET]);
REWRITE_TAC[SDIFF];
MATCH_MP_TAC NEGLIGIBLE_UNION;
CONJ_TAC;
TYPIFY `wedge u v w1 w2 DIFF wedge_ge u v w1 w2 = {}` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(SET_TAC[Leaf_cell.WEDGE_SUBSET_WEDGE_GE]);
BY(REWRITE_TAC[NEGLIGIBLE_EMPTY]);
MATCH_MP_TAC NEGLIGIBLE_SUBSET;
TYPIFY `affine hull {u,v,w1} UNION affine hull {u,v,w2}` EXISTS_TAC;
CONJ_TAC;
MATCH_MP_TAC NEGLIGIBLE_UNION;
BY(REWRITE_TAC[NEGLIGIBLE_AFFINE_HULL_3]);
MATCH_MP_TAC SUBSET_TRANS;
TYPIFY `aff_ge {u,v} {w1} UNION aff_ge {u,v} {w2}` EXISTS_TAC;
CONJ_TAC;
INTRO_TAC Leaf_cell.WEDGE_WEDGE_GE [`u`;`v`;`w1`;`w2`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
BY(SET_TAC[]);
TYPIFY `!(A:real^3->bool) B A' B'. A SUBSET A' /\ B SUBSET B' ==> (A UNION B) SUBSET (A' UNION B')` (C SUBGOAL_THEN MATCH_MP_TAC);
BY(SET_TAC[]);
TYPIFY `!(u:real^3) v w. {u,v,w} = {u,v} UNION {w}` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(SET_TAC[]);
BY(REWRITE_TAC[AFF_GE_SUBSET_AFFINE_HULL])
]);;
(* }}} *)
(* }}} *)
let NOT_COPLANAR_EXTREME_MCELL2 = prove_by_refinement(
`!V ul. packing V /\ saturated V /\ ul
IN barV V 3 /\ ~NULLSET (mcell2 V ul) ==>
~coplanar {
EL 0 ul,
EL 1 ul, mxi V ul, omega_list_n V ul 3 }`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM_ST `~` MP_TAC;
REWRITE_TAC[];
MATCH_MP_TAC
COPLANAR_IMP_NEGLIGIBLE;
MATCH_MP_TAC
COPLANAR_SUBSET;
TYPIFY `
affine hull {
EL 0 ul,
EL 1 ul, mxi V ul, omega_list_n V ul 3}` EXISTS_TAC;
CONJ_TAC;
BY(ASM_REWRITE_TAC[
COPLANAR_AFFINE_HULL_COPLANAR]);
MATCH_MP_TAC
SUBSET_TRANS;
TYPIFY `aff_ge {
EL 0 ul,
EL 1 ul} {mxi V ul, omega_list_n V ul 3}` EXISTS_TAC;
ASM_SIMP_TAC[
MCELL2_SUBSET_AFF_GE];
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b}
UNION {c,d}` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(SET_TAC[]);
BY(REWRITE_TAC[
AFF_GE_SUBSET_AFFINE_HULL])
]);;
(* }}} *)
let MCELL2_DIHV_LT_PI = prove_by_refinement(
`!V X ul. packing V /\ saturated V /\
barV V 3 ul /\
X = mcell2 V ul /\
~NULLSET X ==>
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) <
pi`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `~(
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) =
pi)` ENOUGH_TO_SHOW_TAC;
MATCH_MP_TAC (arith `(x <=
pi) ==> (~(x =
pi) ==> x <
pi)`);
BY(REWRITE_TAC[
DIHV_RANGE]);
TYPIFY `~coplanar {
EL 0 ul,
EL 1 ul, mxi V ul, omega_list_n V ul 3 }` ((C SUBGOAL_THEN ASSUME_TAC));
BY(ASM_MESON_TAC[
NOT_COPLANAR_EXTREME_MCELL2;
IN]);
TYPIFY `~collinear {
EL 0 ul,
EL 1 ul,mxi V ul} /\ ~collinear {
EL 0 ul,
EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[
NOT_COPLANAR_NOT_COLLINEAR]);
BY(ASM_MESON_TAC[
DIHV_EQ_0_PI_EQ_COPLANAR])
]);;
(* }}} *)
let MCELL2_DIHV_AZIM = prove_by_refinement(
`!V X ul h. packing V /\ saturated V /\
barV V 3 ul /\
X = mcell2 V ul /\
~NULLSET X ==> ?w1 w2. {w1,w2} = {mxi V ul,omega_list_n V ul 3} /\
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) =
azim (
EL 0 ul) (
EL 1 ul) w1 w2`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
NOT_COPLANAR_EXTREME_MCELL2 [`V`;`ul`];
ASM_REWRITE_TAC[];
ANTS_TAC;
BY(ASM_MESON_TAC[
IN]);
DISCH_TAC;
TYPIFY `~collinear {
EL 0 ul,
EL 1 ul,mxi V ul} /\ ~collinear {
EL 0 ul,
EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[
NOT_COPLANAR_NOT_COLLINEAR]);
TYPIFY `
azim (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) <=
pi` ASM_CASES_TAC;
BY(ASM_MESON_TAC[Local_lemmas.AZIM_LE_PI_EQ_DIHV]);
FIRST_ASSUM MP_TAC;
DISCH_THEN (MP_TAC o (ONCE_REWRITE_RULE[Rogers.AZIM_COMPL_EXT]));
COND_CASES_TAC;
BY(ASM_MESON_TAC[
PI_POS;arith `&0 < x ==> &0 <= x`]);
DISCH_TAC;
TYPIFY `
azim (
EL 0 ul) (
EL 1 ul) (omega_list_n V ul 3) (mxi V ul) <=
pi` (C SUBGOAL_THEN ASSUME_TAC);
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
ONCE_REWRITE_TAC[
DIHV_SYM];
TYPIFY `!b. {mxi V ul,b} = {b,mxi V ul}` (C SUBGOAL_THEN (unlist REWRITE_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[Local_lemmas.AZIM_LE_PI_EQ_DIHV])
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let MCELL2_VOL_SPLIT_EXPLICIT = prove_by_refinement(
`!V X ul h. saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
h = hl (truncate_simplex 1 ul) /\
h <
sqrt(&2) /\
~NULLSET X ==>
vol (X
INTER bis_le (
EL 0 ul) (
EL 1 ul)) =
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) * (&2 - h pow 2) * h / &6`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) <
pi` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC
MCELL2_DIHV_LT_PI;
BY(ASM_MESON_TAC[]);
INTRO_TAC
MCELL2_DIHV_AZIM [`V`;`X`;`ul`;`h`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC
NOT_COPLANAR_EXTREME_MCELL2 [`V`;`ul`];
ASM_REWRITE_TAC[];
ANTS_TAC;
BY(ASM_MESON_TAC[
IN]);
DISCH_TAC;
TYPIFY `~collinear {
EL 0 ul,
EL 1 ul,mxi V ul} /\ ~collinear {
EL 0 ul,
EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[
NOT_COPLANAR_NOT_COLLINEAR]);
TYPIFY `~collinear {
EL 0 ul,
EL 1 ul,w1} /\ ~collinear {
EL 0 ul,
EL 1 ul, w2}` (C SUBGOAL_THEN ASSUME_TAC);
FIRST_X_ASSUM_ST `{a,b} = {c,d}` MP_TAC;
REWRITE_TAC[Geomdetail.PAIR_EQ_EXPAND];
BY(REPEAT WEAK_STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[]);
TYPIFY `&0 < h` (C SUBGOAL_THEN ASSUME_TAC);
ASM_REWRITE_TAC[];
MATCH_MP_TAC Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT;
BY(ASM_MESON_TAC[]);
INTRO_TAC
VOLUME_FRUSTT_WEDGE [`
EL 0 ul`;`
EL 1 ul`;`w1`;`w2`;`h`;`h /
sqrt(&2)`];
ANTS_TAC;
ASM_REWRITE_TAC[];
REWRITE_TAC[
real_div];
GMATCH_SIMP_TAC
REAL_LT_MUL_EQ;
GMATCH_SIMP_TAC
REAL_LT_INV;
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
CONJ_TAC;
BY(REAL_ARITH_TAC);
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
FIRST_X_ASSUM MP_TAC;
COND_CASES_TAC;
PROOF_BY_CONTR_TAC;
FIRST_X_ASSUM_ST `\/` MP_TAC;
ASM_SIMP_TAC[arith `&0 < h ==> ~(h < &0)`];
GMATCH_SIMP_TAC
REAL_LE_RDIV_EQ;
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
BY(REPEAT (FIRST_X_ASSUM_ST `<` MP_TAC) THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC);
TYPIFY `(h / (h /
sqrt(&2))) pow 2 = &2` (C SUBGOAL_THEN SUBST1_TAC);
Calc_derivative.CALC_ID_TAC;
CONJ2_TAC;
REWRITE_TAC[GSYM Sphere.sqrt2;
REAL_POW_MUL];
REWRITE_TAC[Nonlin_def.sqrt2_sqrt2;REAL_POW_2];
BY(REAL_ARITH_TAC);
ASM_SIMP_TAC[arith `&0 < h ==> ~(h = &0)`;arith `~(&1 = &0)`];
GMATCH_SIMP_TAC
SQRT_EQ_0;
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
DISCH_THEN (SUBST1_TAC o GSYM);
MATCH_MP_TAC Vol1.VOLUME_PROPS_SDIFF;
CONJ_TAC;
MATCH_MP_TAC
MCELL2_INTER_BIS_LE_MEASURABLE;
BY(ASM_MESON_TAC[]);
CONJ_TAC;
FIRST_X_ASSUM_ST `
frustt` MP_TAC;
BY(ASM_REWRITE_TAC[]);
GMATCH_SIMP_TAC
MCELL2_SPLIT;
TYPIFY `V` EXISTS_TAC;
ASM_REWRITE_TAC[];
FIRST_X_ASSUM_ST `{a,b} = {c,d}` (ASSUME_TAC o GSYM);
ASM_REWRITE_TAC[];
GMATCH_SIMP_TAC (GSYM Local_lemmas.WEDGE_GE_EQ_AFF_GE);
ASM_REWRITE_TAC[];
CONJ_TAC;
BY(ASM_MESON_TAC[]);
CONJ_TAC;
BY(ASM_MESON_TAC[]);
ONCE_REWRITE_TAC[
SDIFF_SYM];
ONCE_REWRITE_TAC[SET_RULE `a
INTER b
INTER c = a
INTER c
INTER b`];
REWRITE_TAC[
BIS_LE_NORM];
TYPIFY `hl (truncate_simplex 1 ul) =
dist(
EL 1 ul,
EL 0 ul) / &2` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC
BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[
IN]);
ONCE_REWRITE_TAC[
DIST_SYM];
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
TYPIFY `
norm (
EL 1 ul -
EL 0 ul) pow 2 / &2 = hl (truncate_simplex 1 ul) *
norm (
EL 1 ul -
EL 0 ul)` (C SUBGOAL_THEN SUBST1_TAC);
ASM_REWRITE_TAC[
dist];
BY(REAL_ARITH_TAC);
MATCH_MP_TAC
FRUSTT_WEDGE_RCONE_GE;
FIRST_X_ASSUM kill;
ASM_REWRITE_TAC[];
TYPIFY `&0 <
sqrt(&2)` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
BY(REAL_ARITH_TAC);
TYPIFY `&0 < hl(truncate_simplex 1 ul)` (C SUBGOAL_THEN ASSUME_TAC);
BY(ASM_MESON_TAC[Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT]);
SUBCONJ_TAC;
GMATCH_SIMP_TAC
REAL_LT_DIV;
BY(ASM_REWRITE_TAC[]);
DISCH_TAC;
SUBCONJ_TAC;
BY(ASM_MESON_TAC[
IN;
MCELL2_VX_PROPS]);
DISCH_TAC;
ASM_SIMP_TAC[arith `&0 < h ==> &0 <= h`];
GMATCH_SIMP_TAC
REAL_LE_LDIV_EQ;
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `&1 * x = x`];
MATCH_MP_TAC (arith `x < y ==> x <= y`);
BY(ASM_MESON_TAC[])
]);;
(* }}} *)
(* }}} *)
let LEFT_ACTION_LIST_1_PROPERTIES_ALT = prove_by_refinement(
`!V ul xl p.
packing V /\
saturated V /\
barV V 3 ul /\
p
permutes 0..1 /\
hl (truncate_simplex 1 ul) <
sqrt (&2) /\
sqrt (&2) <= hl ul /\
xl =
left_action_list p ul
==> xl
IN barV V 3 /\
omega_list_n V xl 1 = omega_list_n V ul 1 /\
omega_list_n V xl 2 = omega_list_n V ul 2 /\
omega_list_n V xl 3 = omega_list_n V ul 3 /\
mxi V xl = mxi V ul`,
(* {{{ proof *)
[
REWRITE_TAC[Marchal_cells_2_new.LEFT_ACTION_LIST_1_PROPERTIES]
]);;
(* }}} *)
let MCELL2_PERMUTE_01 = prove_by_refinement(
`!V ul. saturated V /\ packing V /\ barV V 3 ul /\ ~NULLSET (mcell2 V ul) ==>
(?vl. (
EL 0 ul =
EL 1 vl) /\ (
EL 1 ul =
EL 0 vl) /\ (mxi V ul = mxi V vl) /\
(omega_list_n V ul 3 = omega_list_n V vl 3) /\
(hl (truncate_simplex 1 ul) = hl (truncate_simplex 1 vl)) /\
(mcell2 V ul = mcell2 V vl) /\ barV V 3 vl)`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `
LENGTH ul = 4` (C SUBGOAL_THEN ASSUME_TAC);
BY(ASM_MESON_TAC[
IN;Sphere.BARV;arith `3 + 1 = 4`]);
INTRO_TAC Bump.LENGTH4 [`ul`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
INTRO_TAC
MCELL2_HL_LT_SQRT2 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
INTRO_TAC Leaf_cell.TWO_REARRANGEMENT_LEMMA_ALT [`V`;`ul`;`
EL 0 ul`;`
EL 1 ul`;`
EL 2 ul`;`
EL 3 ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
TYPED_ABBREV_TAC `(vl:(real^3) list) =
left_action_list p ul` ;
TYPIFY `vl` EXISTS_TAC;
INTRO_TAC
LEFT_ACTION_LIST_1_PROPERTIES_ALT [`V`;`ul`;`vl`;`p`];
ANTS_TAC;
ASM_REWRITE_TAC[];
PROOF_BY_CONTR_TAC;
FIRST_X_ASSUM_ST `mcell2` MP_TAC;
BY(ASM_REWRITE_TAC[Pack_defs.mcell2;
NEGLIGIBLE_EMPTY]);
REWRITE_TAC[
IN;Bump.MCELL2];
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC Rvfxzbu.RVFXZBU [`V`;`ul`;`2`;`p`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[arith `2 - 1 = 1`;
IN_INSERT]);
DISCH_TAC;
REWRITE_TAC[
CONJ_ASSOC];
CONJ2_TAC;
BY(ASM_MESON_TAC[]);
PROOF_BY_CONTR_TAC;
TYPIFY `
LENGTH vl = 4` (C SUBGOAL_THEN ASSUME_TAC);
BY(ASM_MESON_TAC[
IN;Sphere.BARV;arith `3 + 1 = 4`]);
INTRO_TAC Bump.LENGTH4 [`vl`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
DISCH_TAC;
FIRST_X_ASSUM_ST `~` MP_TAC;
REWRITE_TAC[];
SUBCONJ_TAC;
BY(ASM_MESON_TAC[
CONS_11]);
DISCH_TAC;
REWRITE_TAC[Pack_defs.HL];
AP_TERM_TAC;
REPEAT (GMATCH_SIMP_TAC Bump.SET_OF_LIST_TRUNCATE_1);
ASM_SIMP_TAC[arith `x = 4 ==> 2 <= x`];
BY(SET_TAC[])
]);;
(* }}} *)
let MCELL2_VOL = prove_by_refinement(
`!V X ul h. saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
h = hl (truncate_simplex 1 ul) /\
~NULLSET X ==>
vol X =
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) * (&2 - h pow 2) * h / &3`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
MCELL2_VOL_SPLIT [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
MATCH_MP_TAC (arith `x = a/ &2 /\ y = a / &2 ==> (x + y = a)`);
TYPIFY `h <
sqrt(&2)` (C SUBGOAL_THEN ASSUME_TAC);
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[
MCELL2_HL_LT_SQRT2]);
COMMENT "first branch";
CONJ_TAC;
INTRO_TAC MCELL2_VOL_SPLIT_EXPLICIT [`V`;`X`;`ul`;`h`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
BY(REAL_ARITH_TAC);
COMMENT "second branch";
INTRO_TAC MCELL2_PERMUTE_01 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
ONCE_REWRITE_TAC[Marchal_cells_2_new.DIHV_SYM];
INTRO_TAC MCELL2_VOL_SPLIT_EXPLICIT [`V`;`X`;`vl`;`hl (truncate_simplex 1 vl)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
ASM_REWRITE_TAC[];
DISCH_THEN SUBST1_TAC;
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
(* }}} *)
(* }}} *)
(* }}} *)
let MCELL2_SOL = prove_by_refinement(
`!V X ul h. saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
h = hl (truncate_simplex 1 ul) /\
h <
sqrt(&2) /\
~NULLSET X ==>
sol (
EL 0 ul) X =
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) * (&1 - h /
sqrt(&2))`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `
dist(
EL 0 ul,
EL 1 ul) / &2 = hl (truncate_simplex 1 ul) ` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC
BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[
IN]);
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
TYPIFY `!r. r < h ==> X
INTER ball (
EL 0 ul,r) = (X
INTER bis_le (
EL 0 ul) (
EL 1 ul))
INTER ball(
EL 0 ul,r)` (C SUBGOAL_THEN ASSUME_TAC);
REPEAT WEAK_STRIP_TAC;
TYPIFY `
ball (
EL 0 ul,r)
SUBSET bis_le (
EL 0 ul) (
EL 1 ul)` ENOUGH_TO_SHOW_TAC;
BY(SET_TAC[]);
MATCH_MP_TAC
BALL_SUBSET_BIS_LE;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
TYPIFY `&0 <
sqrt(&2) ` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC
REAL_LT_RSQRT;
BY(REAL_ARITH_TAC);
TYPIFY `&0 < h` (C SUBGOAL_THEN ASSUME_TAC);
ASM_REWRITE_TAC[];
MATCH_MP_TAC Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT;
BY(ASM_MESON_TAC[]);
TYPIFY `&0 < h /
sqrt(&2) /\ h /
sqrt(&2) < &1` (C SUBGOAL_THEN ASSUME_TAC);
GMATCH_SIMP_TAC
REAL_LT_DIV;
CONJ_TAC;
BY(ASM_MESON_TAC[]);
GMATCH_SIMP_TAC
REAL_LT_LDIV_EQ;
ASM_REWRITE_TAC[arith `(&1 * x = x)`];
BY(ASM_MESON_TAC[]);
COMMENT "0. basic setup of
azim and dih";
TYPIFY `dihV (EL 0 ul) (EL 1 ul) (mxi V ul) (omega_list_n V ul 3) < pi` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC MCELL2_DIHV_LT_PI;
BY(ASM_MESON_TAC[]);
INTRO_TAC MCELL2_DIHV_AZIM [`V`;`X`;`ul`;`h`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
COMMENT "show non-degeneracy";
INTRO_TAC NOT_COPLANAR_EXTREME_MCELL2 [`V`;`ul`];
ASM_REWRITE_TAC[];
ANTS_TAC;
BY(ASM_MESON_TAC[IN]);
DISCH_TAC;
TYPIFY `~collinear {EL 0 ul,EL 1 ul,mxi V ul} /\ ~collinear {EL 0 ul, EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[NOT_COPLANAR_NOT_COLLINEAR]);
TYPIFY `~collinear {EL 0 ul, EL 1 ul,w1} /\ ~collinear {EL 0 ul,EL 1 ul, w2}` (C SUBGOAL_THEN ASSUME_TAC);
FIRST_X_ASSUM_ST `{a,b} = {c,d}` MP_TAC;
REWRITE_TAC[Geomdetail.PAIR_EQ_EXPAND];
BY(REPEAT WEAK_STRIP_TAC THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[]);
COMMENT "next";
TYPIFY `EL 0 ul IN V` (C SUBGOAL_THEN ASSUME_TAC);
INTRO_TAC MCELL2_VX_PROPS [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
INTRO_TAC Bump.HDTFNFZ_ALT [`V`;`ul`;`2`;`X`];
ANTS_TAC;
BY(ASM_MESON_TAC[Bump.MCELL2]);
DISCH_THEN SUBST1_TAC;
BY(SET_TAC[]);
INTRO_TAC Urrphbz2.URRPHBZ2 [`V`;`ul`;`2`;`EL 0 ul`];
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
REWRITE_TAC[GSYM Bump.MCELL2];
REWRITE_TAC[Sphere.eventually_radial];
REPEAT WEAK_STRIP_TAC;
COMMENT "next2";
TYPIFY `?r'. r' <= h /\ &0 < r' /\ radial r' (EL 0 ul) (mcell2 V ul INTER ball (EL 0 ul,r'))` (C SUBGOAL_THEN MP_TAC);
TYPIFY `if (r <= h) then r else h` EXISTS_TAC;
COND_CASES_TAC;
BY(ASM_REWRITE_TAC[arith `&0 < r <=> r > &0`]);
REWRITE_TAC[arith `h <= h`];
BY(ASM_MESON_TAC[RADIAL_LE;arith `~(r <= h) ==> (h <= r)`]);
REPLICATE_TAC 2 (FIRST_X_ASSUM kill);
REPEAT WEAK_STRIP_TAC;
GMATCH_SIMP_TAC Vol1.sol_spec;
TYPIFY `r'` EXISTS_TAC;
ASM_REWRITE_TAC[arith `r' > &0 <=> &0 < r'`];
SUBCONJ_TAC;
MATCH_MP_TAC MEASURABLE_INTER;
REWRITE_TAC[MEASURABLE_BALL;Bump.MCELL2];
BY(ASM_MESON_TAC[Urrphbz1.MEASURABLE_MCELL]);
DISCH_TAC;
COMMENT "1. done with sol ";
INTRO_TAC MCELL2_VX_PROPS [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
INTRO_TAC VOLUME_CONIC_CAP_STRONG [`EL 0 ul`;`EL 1 ul`;`r'`;`h/ sqrt(&2)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
COND_CASES_TAC;
TYPIFY `~(&1 <= h / sqrt(&2))` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC (arith `a < b ==> ~(b <= a)`);
BY(ASM_REWRITE_TAC[]);
BY(ASM_MESON_TAC[arith `&0 < r' ==> ~(r' < &0)`]);
REPEAT WEAK_STRIP_TAC;
COMMENT "add wedge";
INTRO_TAC Vol1.VOLUME_PROPS_CONIC_CAP [`EL 0 ul`;`EL 1 ul`;`w1`;`w2`;`r'`;`h / sqrt(&2)`];
ANTS_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[arith `&0 < r' ==> r' >= &0`;arith `&0 < h' ==> h' >= -- &1`;arith `h' < &1 ==> h' <= &1`]);
REWRITE_TAC[vol_conic_cap_wedge];
TYPIFY `!v x. &3 * v / r' pow 3 = x <=> v = x * r' pow 3 / &3` (C SUBGOAL_THEN (unlist REWRITE_TAC));
REPEAT WEAK_STRIP_TAC;
MATCH_MP_TAC (TAUT `((a ==> b) /\ (b ==> a)) ==> (a = b)`);
CONJ_TAC THEN REPEAT WEAK_STRIP_TAC;
EXPAND_TAC "x";
Calc_derivative.CALC_ID_TAC;
BY(ASM_MESON_TAC[arith `~(&3 = &0)`;arith `&0 < r' ==> ~(r' = &0)`]);
ASM_REWRITE_TAC[];
Calc_derivative.CALC_ID_TAC;
BY(ASM_MESON_TAC[arith `~(&3 = &0)`;arith `&0 < r' ==> ~(r' = &0)`]);
ASM_REWRITE_TAC[GSYM REAL_MUL_ASSOC];
DISCH_THEN (SUBST1_TAC o SYM);
COMMENT "pure volumes left";
MATCH_MP_TAC Vol1.VOLUME_PROPS_SDIFF;
ASM_REWRITE_TAC[];
CONJ_TAC;
BY(REWRITE_TAC[MEASURABLE_CONIC_CAP_WEDGE]);
REWRITE_TAC[conic_cap;NORMBALL_BALL];
COMMENT "SDIFF to match volumes";
ONCE_REWRITE_TAC[SDIFF_SYM];
INTRO_TAC FRUSTT_WEDGE_RCONE_GE [`EL 0 ul`;`EL 1 ul`;`w1`;`w2`;`h`;`h/ sqrt(&2)`];
ANTS_TAC;
ASM_REWRITE_TAC[];
BY(ASM_MESON_TAC[arith `h' < y ==> h' <= y`]);
ASM_REWRITE_TAC[];
DISCH_TAC;
INTRO_TAC SDIFF_SUBSET [`(frustt (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul)) (hl (truncate_simplex 1 ul) / sqrt (&2)) INTER wedge (EL 0 ul) (EL 1 ul) w1 w2)`;` (rcone_ge (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul) / sqrt (&2)) INTER {y | (y - EL 0 ul) dot (EL 1 ul - EL 0 ul) <= hl (truncate_simplex 1 ul) * norm (EL 1 ul - EL 0 ul)} INTER wedge_ge (EL 0 ul) (EL 1 ul) w1 w2)`;`ball ((EL 0 ul),r')`];
DISCH_THEN (MP_TAC o (MATCH_MP (REWRITE_RULE[TAUT `(a /\ b ==> c) <=> (b ==> (a ==> c))`] NEGLIGIBLE_SUBSET)));
ANTS_TAC;
BY(ASM_REWRITE_TAC[]);
COMMENT "match frustt";
TYPIFY `(frustt (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul)) (hl (truncate_simplex 1 ul) / sqrt (&2)) INTER wedge (EL 0 ul) (EL 1 ul) w1 w2) INTER ball (EL 0 ul,r') = (ball (EL 0 ul,r') INTER rcone_gt (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul) / sqrt (&2))) INTER wedge (EL 0 ul) (EL 1 ul) w1 w2` (C SUBGOAL_THEN SUBST1_TAC);
REWRITE_TAC[frustt;frustum;LET_DEF;EXTENSION;IN_ELIM_THM;LET_DEF;LET_END_DEF;IN_INTER];
REPEAT WEAK_STRIP_TAC;
REWRITE_TAC[arith `&0 * x = &0`];
TYPIFY `~(x IN ball(EL 0 ul,r'))` ASM_CASES_TAC;
BY(ASM_REWRITE_TAC[]);
TYPIFY `~(x IN rcone_gt (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul) / sqrt (&2)))` ASM_CASES_TAC;
BY(ASM_MESON_TAC[IN]);
TYPIFY `~(x IN wedge (EL 0 ul) (EL 1 ul) w1 w2)` ASM_CASES_TAC;
BY(ASM_REWRITE_TAC[]);
REPEAT (FIRST_X_ASSUM_ST `~ ~ x` MP_TAC) THEN REWRITE_TAC[] THEN REPEAT WEAK_STRIP_TAC THEN ASM_REWRITE_TAC[];
CONJ_TAC;
BY(ASM_MESON_TAC[IN]);
CONJ_TAC;
FIRST_X_ASSUM_ST `rcone_gt` MP_TAC;
REWRITE_TAC[Sphere.rcone_gt;Sphere.rconesgn;IN_ELIM_THM];
TYPIFY `&0 <= dist (x,EL 0 ul) * dist (EL 1 ul,EL 0 ul) * hl (truncate_simplex 1 ul) / sqrt (&2)` ENOUGH_TO_SHOW_TAC;
BY(REAL_ARITH_TAC);
GMATCH_SIMP_TAC REAL_LE_MUL;
GMATCH_SIMP_TAC REAL_LE_MUL;
REWRITE_TAC[DIST_POS_LE];
MATCH_MP_TAC (arith `&0 < h' ==> &0 <= h'`);
BY(ASM_MESON_TAC[]);
INTRO_TAC BALL_SUBSET_BIS_LT [`EL 0 ul`;`EL 1 ul`;`r'`];
ANTS_TAC;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
REWRITE_TAC[SUBSET;IN_ELIM_THM];
DISCH_THEN (C INTRO_TAC [`x`]);
ASM_REWRITE_TAC[];
REWRITE_TAC[BIS_LT_NORM];
ONCE_REWRITE_TAC[arith `x pow 2 / &2 = (x / &2) * x`];
FIRST_X_ASSUM_ST `dist a / &2 = h` (SUBST1_TAC o GSYM);
ONCE_REWRITE_TAC[DIST_SYM];
BY(REWRITE_TAC[dist]);
TYPIFY `((rcone_ge (EL 0 ul) (EL 1 ul) (hl (truncate_simplex 1 ul) / sqrt (&2)) INTER {y | (y - EL 0 ul) dot (EL 1 ul - EL 0 ul) <= hl (truncate_simplex 1 ul) * norm (EL 1 ul - EL 0 ul)} INTER wedge_ge (EL 0 ul) (EL 1 ul) w1 w2) INTER ball (EL 0 ul,r')) = (mcell2 V ul INTER ball (EL 0 ul,r'))` ENOUGH_TO_SHOW_TAC;
DISCH_THEN SUBST1_TAC;
BY(REWRITE_TAC[]);
TYPIFY `mcell2 V ul INTER ball (EL 0 ul,r') = mcell2 V ul INTER bis_le (EL 0 ul) (EL 1 ul) INTER ball (EL 0 ul,r')` (C SUBGOAL_THEN SUBST1_TAC);
INTRO_TAC BALL_SUBSET_BIS_LE [`EL 0 ul`;`EL 1 ul`;`r'`];
ANTS_TAC;
BY(REPEAT (FIRST_X_ASSUM MP_TAC) THEN REAL_ARITH_TAC);
BY(SET_TAC[]);
INTRO_TAC MCELL2_SPLIT [`V`;`mcell2 V ul`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[GSYM INTER_ASSOC];
DISCH_THEN SUBST1_TAC;
FIRST_X_ASSUM_ST `{a,b} = {c,d}` (SUBST1_TAC o SYM);
TYPIFY `wedge_ge (EL 0 ul) (EL 1 ul) w1 w2 = aff_ge {EL 0 ul, EL 1 ul} {w1,w2}` (C SUBGOAL_THEN SUBST1_TAC);
MATCH_MP_TAC Local_lemmas.WEDGE_GE_EQ_AFF_GE;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[BIS_LE_NORM];
ONCE_REWRITE_TAC[arith `x pow 2 / &2 = (x / &2) * x`];
FIRST_X_ASSUM_ST `dist a / &2 = h` (SUBST1_TAC o GSYM);
ONCE_REWRITE_TAC[DIST_SYM];
REWRITE_TAC[dist];
BY(SET_TAC[])
]);;
(* }}} *)
(*
let GAMMAX_GAMMA2_X = prove_by_refinement(
`!V X ul y1 y2 y3 y4 y5 y6.
saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
~NULLSET X /\
y1 = dist(EL 0 ul,EL 1 ul) /\
y2 = dist(EL 0 ul,mxi V ul) /\
y3 = dist(EL 0 ul,omega_list_n V ul 3) /\
y4 = dist(mxi V ul,omega_list_n V ul 3) /\
y5 = dist(EL 1 ul,omega_list_n V ul 3) /\
y6 = dist(EL 1 ul,mxi V ul)
==>
gammaX V X lmfun =
gamma2_x_div_azim_v2 (h0cut y1) (y1 * y1) * dih_y y1 y2 y3 y4 y5 y6`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC GAMMAX_MCELL2 [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC MCELL2_VOL [`V`;`X`;`ul`;`hl (truncate_simplex 1 ul)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC MCELL2_HL_LT_SQRT2 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
INTRO_TAC MCELL2_SOL [`V`;`X`;`ul`;`hl (truncate_simplex 1 ul)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
TYPIFY `sol (EL 1 ul) X = dihV (EL 0 ul) (EL 1 ul) (mxi V ul) (omega_list_n V ul 3) * (&1 - hl (truncate_simplex 1 ul) / sqrt (&2))` (C SUBGOAL_THEN MP_TAC);
INTRO_TAC MCELL2_PERMUTE_01 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC MCELL2_SOL [`V`;`X`;`vl`;`hl (truncate_simplex 1 vl)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
ASM_REWRITE_TAC[];
DISCH_THEN SUBST1_TAC;
BY(MESON_TAC[Marchal_cells_2_new.DIHV_SYM]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC MCELL2_DIHX [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
REWRITE_TAC[arith `d * a - m * (d * a' + d * a') + m' * l * d = (a - &2 * m * a' + m' * l) * d`];
MATCH_MP_TAC (arith `a = b /\ c = d ==> (a*c = b * d)`);
COMMENT "show non-degeneracy";
INTRO_TAC NOT_COPLANAR_EXTREME_MCELL2 [`V`;`ul`];
ASM_REWRITE_TAC[];
ANTS_TAC;
BY(ASM_MESON_TAC[IN]);
DISCH_TAC;
TYPIFY `~collinear {EL 0 ul,EL 1 ul,mxi V ul} /\ ~collinear {EL 0 ul, EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[NOT_COPLANAR_NOT_COLLINEAR]);
CONJ2_TAC;
INTRO_TAC Merge_ineq.DIHV_EQ_DIH_Y [`EL 0 ul`;`EL 1 ul`;`mxi V ul`;`omega_list_n V ul 3`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
BY(REWRITE_TAC[LET_DEF;LET_END_DEF]);
TYPED_ABBREV_TAC `(h:real) = hl (truncate_simplex 1 ul)` ;
TYPIFY `dist(EL 0 ul,EL 1 ul) = &2 * hl (truncate_simplex 1 ul) ` (C SUBGOAL_THEN ASSUME_TAC);
ONCE_REWRITE_TAC[arith `(x = &2 * h <=> x / &2 = h)`];
GMATCH_SIMP_TAC BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[IN]);
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
REWRITE_TAC[gamma2_x_div_azim_v2];
COMMENT "simplify polynomial identity";
TYPIFY `&0 < h` (C SUBGOAL_THEN ASSUME_TAC);
EXPAND_TAC "h";
MATCH_MP_TAC Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT;
BY(ASM_MESON_TAC[]);
TYPIFY `[EL 0 ul; EL 1 ul] = truncate_simplex 1 ul` (C SUBGOAL_THEN SUBST1_TAC);
BY(ASM_MESON_TAC[BARV3_TRUNC1;IN]);
TYPIFY `sqrt((&2 * h) * (&2 * h)) = &2 * h` (C SUBGOAL_THEN SUBST1_TAC);
GMATCH_SIMP_TAC Nonlinear_lemma.sqrtxx;
BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC);
MATCH_MP_TAC (arith `(a = a') /\ (b = b') /\ (c = c') ==> a - b + c = a' - (b' - c')`);
CONJ_TAC;
BY(REAL_ARITH_TAC);
CONJ2_TAC;
AP_TERM_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC Merge_ineq.lmfun_h0cut [`(&2 * h)`];
REWRITE_TAC[arith `(&2 * h) / &2 = h`];
BY(REAL_ARITH_TAC);
AP_TERM_TAC;
AP_TERM_TAC;
AP_TERM_TAC;
REWRITE_TAC[Nonlinear_lemma.sqrt8_sqrt2;Sphere.sqrt2];
Calc_derivative.CALC_ID_TAC;
REPEAT (GMATCH_SIMP_TAC SQRT_EQ_0);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
*)
let GAMMAX_GAMMA2_X = prove_by_refinement(
`!V X ul y1 y2 y3 y4 y5 y6.
saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul /\
~NULLSET X /\
y1 =
dist(
EL 0 ul,
EL 1 ul) /\
y2 =
dist(
EL 0 ul,mxi V ul) /\
y3 =
dist(
EL 0 ul,omega_list_n V ul 3) /\
y4 =
dist(mxi V ul,omega_list_n V ul 3) /\
y5 =
dist(
EL 1 ul,omega_list_n V ul 3) /\
y6 =
dist(
EL 1 ul,mxi V ul)
==>
&0 <=
dih_y y1 y2 y3 y4 y5 y6 /\
gammaX V X lmfun =
gamma2_x_div_azim_v2 (h0cut y1) (y1 * y1) *
dih_y y1 y2 y3 y4 y5 y6`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
GAMMAX_MCELL2 [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC
MCELL2_VOL [`V`;`X`;`ul`;`hl (truncate_simplex 1 ul)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC
MCELL2_HL_LT_SQRT2 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
INTRO_TAC
MCELL2_SOL [`V`;`X`;`ul`;`hl (truncate_simplex 1 ul)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
TYPIFY `sol (
EL 1 ul) X =
dihV (
EL 0 ul) (
EL 1 ul) (mxi V ul) (omega_list_n V ul 3) * (&1 - hl (truncate_simplex 1 ul) /
sqrt (&2))` (C SUBGOAL_THEN MP_TAC);
INTRO_TAC
MCELL2_PERMUTE_01 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC
MCELL2_SOL [`V`;`X`;`vl`;`hl (truncate_simplex 1 vl)`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
ASM_REWRITE_TAC[];
DISCH_THEN SUBST1_TAC;
BY(MESON_TAC[Marchal_cells_2_new.DIHV_SYM]);
DISCH_THEN SUBST1_TAC;
INTRO_TAC
MCELL2_DIHX [`V`;`X`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
DISCH_THEN SUBST1_TAC;
REWRITE_TAC[arith `d * a - m * (d * a' + d * a') + m' * l * d = (a - &2 * m * a' + m' * l) * d`];
MATCH_MP_TAC (arith `&0 <= c /\ a = b /\ c = d ==> (&0 <= d /\ a*c = b * d)`);
CONJ_TAC;
BY(REWRITE_TAC[
DIHV_RANGE]);
COMMENT "show non-degeneracy";
INTRO_TAC NOT_COPLANAR_EXTREME_MCELL2 [`V`;`ul`];
ASM_REWRITE_TAC[];
ANTS_TAC;
BY(ASM_MESON_TAC[IN]);
DISCH_TAC;
TYPIFY `~collinear {EL 0 ul,EL 1 ul,mxi V ul} /\ ~collinear {EL 0 ul, EL 1 ul,omega_list_n V ul 3}` ((C SUBGOAL_THEN ASSUME_TAC));
TYPIFY `!a b c (d:real^3). {a,b,c,d} = {a,b,d,c}` ((C SUBGOAL_THEN MP_TAC));
BY(SET_TAC[]);
BY(ASM_MESON_TAC[NOT_COPLANAR_NOT_COLLINEAR]);
CONJ2_TAC;
INTRO_TAC Merge_ineq.DIHV_EQ_DIH_Y [`EL 0 ul`;`EL 1 ul`;`mxi V ul`;`omega_list_n V ul 3`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
BY(REWRITE_TAC[LET_DEF;LET_END_DEF]);
TYPED_ABBREV_TAC `(h:real) = hl (truncate_simplex 1 ul)` ;
TYPIFY `dist(EL 0 ul,EL 1 ul) = &2 * hl (truncate_simplex 1 ul) ` (C SUBGOAL_THEN ASSUME_TAC);
ONCE_REWRITE_TAC[arith `(x = &2 * h <=> x / &2 = h)`];
GMATCH_SIMP_TAC BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[IN]);
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
REWRITE_TAC[gamma2_x_div_azim_v2];
COMMENT "simplify polynomial identity";
TYPIFY `&0 < h` (C SUBGOAL_THEN ASSUME_TAC);
EXPAND_TAC "h";
MATCH_MP_TAC Marchal_cells_2_new.BARV_IMP_HL_1_POS_LT;
BY(ASM_MESON_TAC[]);
TYPIFY `[EL 0 ul; EL 1 ul] = truncate_simplex 1 ul` (C SUBGOAL_THEN SUBST1_TAC);
BY(ASM_MESON_TAC[BARV3_TRUNC1;IN]);
TYPIFY `sqrt((&2 * h) * (&2 * h)) = &2 * h` (C SUBGOAL_THEN SUBST1_TAC);
GMATCH_SIMP_TAC Nonlinear_lemma.sqrtxx;
BY(FIRST_X_ASSUM MP_TAC THEN REAL_ARITH_TAC);
MATCH_MP_TAC (arith `(a = a') /\ (b = b') /\ (c = c') ==> a - b + c = a' - (b' - c')`);
CONJ_TAC;
BY(REAL_ARITH_TAC);
CONJ2_TAC;
AP_TERM_TAC;
ASM_REWRITE_TAC[];
INTRO_TAC Merge_ineq.lmfun_h0cut [`(&2 * h)`];
REWRITE_TAC[arith `(&2 * h) / &2 = h`];
BY(REAL_ARITH_TAC);
AP_TERM_TAC;
AP_TERM_TAC;
AP_TERM_TAC;
REWRITE_TAC[Nonlinear_lemma.sqrt8_sqrt2;Sphere.sqrt2];
Calc_derivative.CALC_ID_TAC;
REPEAT (GMATCH_SIMP_TAC SQRT_EQ_0);
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
let TSKAJXY_2 = prove_by_refinement(
`!V X ul.
pack_nonlinear_non_ox3q1h /\ saturated V /\
packing V /\
barV V 3 ul /\
X = mcell2 V ul
==> gammaX V X lmfun >= &0`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY `
NULLSET X` ASM_CASES_TAC;
INTRO_TAC
GAMMAX_NULLSET [`V`;`lmfun`;`X`;`ul`;`2`];
ANTS_TAC;
BY(ASM_MESON_TAC[Bump.MCELL2]);
BY(REAL_ARITH_TAC);
INTRO_TAC
GAMMAX_GAMMA2_X [`V`;`X`;`ul`;`
dist(
EL 0 ul,
EL 1 ul)`;`
dist(
EL 0 ul,mxi V ul)`;`
dist(
EL 0 ul,omega_list_n V ul 3)`;`
dist(mxi V ul,omega_list_n V ul 3)`;`
dist(
EL 1 ul,omega_list_n V ul 3)`;`
dist(
EL 1 ul,mxi V ul)`];
ASM_REWRITE_TAC[];
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[];
REWRITE_TAC[arith `a * b >= &0 <=> &0 <= a * b`];
GMATCH_SIMP_TAC
REAL_LE_MUL;
ASM_REWRITE_TAC[];
TYPIFY ` (!y. &2 <= y /\ y <= sqrt8 ==> &0 <=
gamma2_x_div_azim_v2 (h0cut y) (y * y))` (C SUBGOAL_THEN ASSUME_TAC);
MATCH_MP_TAC Merge_ineq.GRKIBMP;
INTRO_TAC (Merge_ineq.get_pack_nonlinear_non_ox3q1h "
GRKIBMP A V2") [];
INTRO_TAC (Merge_ineq.get_pack_nonlinear_non_ox3q1h "
GRKIBMP B V2") [];
BY(MESON_TAC[]);
FIRST_X_ASSUM MATCH_MP_TAC;
INTRO_TAC
MCELL2_VX_PROPS [`V`;`X`;`ul`];
ASM_REWRITE_TAC[];
INTRO_TAC Bump.HDTFNFZ_ALT [`V`;`ul`;`2`;`X`];
ANTS_TAC;
BY(ASM_MESON_TAC[Bump.MCELL2]);
ASM_REWRITE_TAC[];
DISCH_THEN SUBST1_TAC;
REPEAT WEAK_STRIP_TAC;
TYPIFY `
EL 0 ul
IN V /\
EL 1 ul
IN V` (C SUBGOAL_THEN ASSUME_TAC);
BY(FIRST_X_ASSUM_ST `
INTER` MP_TAC THEN SET_TAC[]);
CONJ_TAC;
FIRST_X_ASSUM_ST `packing` MP_TAC;
REWRITE_TAC[Sphere.packing];
DISCH_THEN MATCH_MP_TAC;
BY(ASM_MESON_TAC[
IN]);
INTRO_TAC
MCELL2_HL_LT_SQRT2 [`V`;`ul`];
ANTS_TAC;
BY(ASM_MESON_TAC[]);
REWRITE_TAC[Nonlinear_lemma.sqrt8_sqrt2;Sphere.sqrt2];
TYPIFY `
dist(
EL 0 ul,
EL 1 ul) = &2 * hl (truncate_simplex 1 ul) ` (C SUBGOAL_THEN ASSUME_TAC);
ONCE_REWRITE_TAC[arith `(x = &2 * h <=> x / &2 = h)`];
GMATCH_SIMP_TAC
BARV3_TRUNC1;
CONJ_TAC;
BY(ASM_MESON_TAC[
IN]);
REWRITE_TAC[Marchal_cells_3.HL_2];
BY(REAL_ARITH_TAC);
ASM_REWRITE_TAC[];
BY(REAL_ARITH_TAC)
]);;
(* }}} *)
let tsk_required_ineq =
let cell3_hyp = ["QZECFIC wt0";"QZECFIC wt0 corner";"QZECFIC wt0 sqrt8";
"QZECFIC wt1";"QZECFIC wt2 A";"CIHTIUM";"CJFZZDW";] in
let tsk = ["TSKAJXY-GXSABWC DIV"; "TSKAJXY-IYOUOBF sharp v2";
"TSKAJXY-IYOUOBF sym";
"TSKAJXY-RIBCYXU sharp"; "TSKAJXY-RIBCYXU sym"; "TSKAJXY-TADIAMB";
"TSKAJXY-WKGUESB sym"; "TSKAJXY-XLLIPLS"; "TSKAJXY-delta_x4";
"TSKAJXY-eulerA"] in
let grk = ["GRKIBMP A V2";"GRKIBMP B V2"] in
cell3_hyp @ tsk @ grk;;
let TSKAJXY = prove_by_refinement(
`!V X.
pack_nonlinear_non_ox3q1h /\
saturated V /\
packing V /\
mcell_set V X /\
critical_edgeX V X = {}
==> gammaX V X lmfun >= &0`,
(* {{{ proof *)
[
REPEAT WEAK_STRIP_TAC;
TYPIFY ` ~(?i ul. ul
IN barV V 3 /\ (i = 1 \/ i = 2) /\ X = mcell i V ul)` ASM_CASES_TAC;
INTRO_TAC Tskajxy_034.TSKAJXY_034 [];
ANTS_TAC;
EVERY (map (fun t -> INTRO_TAC (Merge_ineq.get_pack_nonlinear_non_ox3q1h t) []) tsk_required_ineq);
REPEAT WEAK_STRIP_TAC THEN ASM_REWRITE_TAC[];
CONJ_TAC;
MATCH_MP_TAC Merge_ineq.GRKIBMP;
BY(ASM_REWRITE_TAC[]);
MATCH_MP_TAC Merge_ineq.cell3_from_ineq_thm;
BY(ASM_REWRITE_TAC[]);
REWRITE_TAC[Tskajxy_034.TSKAJXY_statement_special_case];
DISCH_THEN MATCH_MP_TAC;
BY(ASM_MESON_TAC[]);
FIRST_X_ASSUM MP_TAC;
REWRITE_TAC[];
REPEAT WEAK_STRIP_TAC;
ASM_REWRITE_TAC[GSYM Bump.MCELL1];
MATCH_MP_TAC
TSKAJXY_1;
BY(ASM_MESON_TAC[
IN]);
ASM_REWRITE_TAC[GSYM Bump.MCELL2];
MATCH_MP_TAC
TSKAJXY_2;
BY(ASM_MESON_TAC[
IN])
]);;
(* }}} *)
end;;