(* ========================================================================= *) (* Brunn-Minkowski theorem and related results. *) (* ========================================================================= *) needs "Multivariate/realanalysis.ml";; (* ------------------------------------------------------------------------- *) (* First, the special case of a box. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* Now for a finite union of boxes. *) (* ------------------------------------------------------------------------- *)"dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[IN_DELETE; FINITE_DELETE; FINITE_IMAGE; FINITE_RESTRICT; IMP_CONJ] THEN REWRITE_TAC[IN_ELIM_THM; IMP_CONJ; FORALL_IN_IMAGE; IN_DELETE] THEN FIRST_ASSUM(fun th -> GEN_REWRITE_TAC I [MATCH_MP FORALL_IN_DIVISION th]) THEN ASM_SIMP_TAC[INTERVAL_SPLIT; COMPACT_INTERVAL]; MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]]; MATCH_MP_TAC MEASURABLE_COMPACT THEN MATCH_MP_TAC COMPACT_SUMS THEN CONJ_TAC THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]; MATCH_MP_TAC(SET_RULE `s SUBSET s' ==> {x + y:real^N | x IN s /\ y IN t} SUBSET {x + y:real^N | x IN s' /\ y IN t}`) THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN REWRITE_TAC[SUBSET; FORALL_IN_UNIONS] THEN REWRITE_TAC[FORALL_IN_GSPEC; IMP_CONJ; RIGHT_FORALL_IMP_THM] THEN SIMP_TAC[IN_DELETE; IN_INTER; IN_ELIM_THM] THEN RULE_ASSUM_TAC(REWRITE_RULE[division_of]) THEN ASM_MESON_TAC[IN_UNIONS]]); ALL_TAC] THEN SUBGOAL_THEN `s = (s INTER {x:real^N | x$k <= &0}) UNION (s INTER {x | x$k >= &0}) /\ t = (t INTER {x:real^N | x$k <= &0}) UNION (t INTER {x | x$k >= &0})` MP_TAC THENL [CONJ_TAC THEN MATCH_MP_TAC(SET_RULE `(!x. P x \/ Q x) ==> s = (s INTER {x | P x}) UNION (s INTER {x | Q x})`) THEN REAL_ARITH_TAC; DISCH_THEN(fun th -> GEN_REWRITE_TAC (RAND_CONV o ONCE_DEPTH_CONV) [th])] THEN W(MP_TAC o PART_MATCH (rand o rand) MEASURE_NEGLIGIBLE_UNION o lhand o snd) THEN ANTS_TAC THENL [REPEAT(CONJ_TAC THENL [MATCH_MP_TAC MEASURABLE_COMPACT THEN MATCH_MP_TAC COMPACT_SUMS THEN CONJ_TAC THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]; ALL_TAC]) THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `{x:real^N | x$k = &0}` THEN ASM_SIMP_TAC[NEGLIGIBLE_STANDARD_HYPERPLANE] THEN REWRITE_TAC[GSYM REAL_LE_ANTISYM] THEN MATCH_MP_TAC(SET_RULE `s SUBSET {x | P x} /\ t SUBSET {x | Q x} ==> (s INTER t) SUBSET {x | P x /\ Q x}`) THEN REWRITE_TAC[SUBSET; FORALL_IN_GSPEC] THEN SIMP_TAC[IN_INTER; IN_ELIM_THM; REAL_LE_ADD; VECTOR_ADD_COMPONENT; real_ge; REAL_ARITH `x <= &0 /\ y <= &0 ==> x + y <= &0`]; DISCH_THEN(SUBST1_TAC o SYM)] THEN MATCH_MP_TAC MEASURE_SUBSET THEN REPEAT CONJ_TAC THENL [MATCH_MP_TAC MEASURABLE_UNION THEN CONJ_TAC THEN MATCH_MP_TAC MEASURABLE_COMPACT THEN MATCH_MP_TAC COMPACT_SUMS THEN CONJ_TAC THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]; MATCH_MP_TAC MEASURABLE_COMPACT THEN MATCH_MP_TAC COMPACT_SUMS THEN CONJ_TAC THEN MATCH_MP_TAC COMPACT_UNION THEN CONJ_TAC THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]; SET_TAC[]]] THEN SUBGOAL_THEN `&0 < measure(s INTER {x:real^N | x$k <= &0}) /\ &0 < measure(s INTER {x:real^N | x$k >= &0})` STRIP_ASSUME_TAC THENL [ASM_SIMP_TAC[MEASURABLE_MEASURE_POS_LT; MEASURABLE_INTER_HALFSPACE_LE; MEASURABLE_INTER_HALFSPACE_GE] THEN CONJ_TAC THENL [UNDISCH_TAC `~negligible(i:real^N->bool)`; UNDISCH_TAC `~negligible(j:real^N->bool)`] THEN REWRITE_TAC[CONTRAPOS_THM] THEN MATCH_MP_TAC(REWRITE_RULE[IMP_CONJ_ALT] NEGLIGIBLE_SUBSET) THEN ASM_REWRITE_TAC[SUBSET_INTER] THEN UNDISCH_TAC `d1 division_of (s:real^N->bool)` THEN REWRITE_TAC[division_of] THEN ASM SET_TAC[]; ALL_TAC] THEN FIRST_X_ASSUM(fun th -> MP_TAC(SPECL [`dl:(real^N->bool)->bool`; `{l INTER {x:real^N | x$k <= &0} |l| l IN d2 /\ ~(l INTER {x | x$k <= &0} = {})}`; `UNIONS dl :real^N->bool`; `t INTER {x:real^N | x$k <= &0}`] th) THEN MP_TAC(SPECL [`dr:(real^N->bool)->bool`; `{l INTER {x:real^N | x$k >= &0} |l| l IN d2 /\ ~(l INTER {x | x$k >= &0} = {})}`; `UNIONS dr :real^N->bool`; `t INTER {x:real^N | x$k >= &0}`] th)) THEN ASM_REWRITE_TAC[] THEN ANTS_TAC THENL [REPEAT CONJ_TAC THENL [EXPAND_TAC "n" THEN MATCH_MP_TAC LTE_ADD2 THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN CONJ_TAC THENL [MATCH_MP_TAC LET_TRANS THEN EXISTS_TAC `CARD(d1 DELETE (i:real^N->bool))` THEN CONJ_TAC THENL [ALL_TAC; MATCH_MP_TAC CARD_PSUBSET THEN ASM SET_TAC[]]; ALL_TAC] THEN MATCH_MP_TAC(ARITH_RULE `CARD {x | x IN IMAGE f s /\ P x} <= CARD(IMAGE f s) /\ CARD(IMAGE f s) <= CARD s ==> CARD {x | x IN IMAGE f s /\ P x} <= CARD s`) THEN ASM_SIMP_TAC[CARD_IMAGE_LE; FINITE_DELETE] THEN MATCH_MP_TAC CARD_SUBSET THEN ASM_SIMP_TAC[FINITE_IMAGE; FINITE_DELETE] THEN SET_TAC[]; REWRITE_TAC[GSYM MEMBER_NOT_EMPTY; IN_UNIONS] THEN ONCE_REWRITE_TAC[SWAP_EXISTS_THM] THEN EXISTS_TAC `j INTER {x:real^N | x$k >= &0}` THEN REWRITE_TAC[RIGHT_EXISTS_AND_THM; MEMBER_NOT_EMPTY] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN REWRITE_TAC[IN_ELIM_THM; IN_IMAGE; IN_DELETE; GSYM CONJ_ASSOC] THEN CONJ_TAC THENL [EXISTS_TAC `j:real^N->bool` THEN ASM_REWRITE_TAC[]; MATCH_MP_TAC(SET_RULE `~(s = {}) /\ s SUBSET t ==> ~(s INTER t = {})`) THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[division_of]]; DISCH_TAC THEN UNDISCH_TAC `measure (t INTER {x:real^N | x$k >= &0}) / measure t = measure (s INTER {x:real^N | x$k >= &0}) / measure s` THEN ASM_SIMP_TAC[MEASURE_EMPTY; REAL_EQ_RDIV_EQ] THEN REWRITE_TAC[real_div; REAL_MUL_LZERO] THEN CONV_TAC(RAND_CONV SYM_CONV) THEN ASM_SIMP_TAC[REAL_LT_IMP_NZ]; REWRITE_TAC[division_of] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[FINITE_RESTRICT; FINITE_IMAGE; FINITE_DELETE] THEN REWRITE_TAC[IN_ELIM_THM; IMP_CONJ; FORALL_IN_IMAGE; IN_DELETE] THEN REWRITE_TAC[RIGHT_FORALL_IMP_THM; FORALL_IN_IMAGE; IN_DELETE] THEN CONJ_TAC THENL [FIRST_ASSUM(fun th -> GEN_REWRITE_TAC I [MATCH_MP FORALL_IN_DIVISION th]) THEN REPEAT GEN_TAC THEN REPEAT DISCH_TAC THEN ASM_REWRITE_TAC[] THEN CONJ_TAC THENL [ALL_TAC; ASM_SIMP_TAC[INTERVAL_SPLIT] THEN MESON_TAC[]] THEN MATCH_MP_TAC(SET_RULE `x IN s ==> x SUBSET UNIONS s`) THEN ASM SET_TAC[]; REPEAT STRIP_TAC THEN MATCH_MP_TAC(SET_RULE `interior(s) INTER interior(s') = {} /\ interior(s INTER t) SUBSET interior s /\ interior(s' INTER t) SUBSET interior s' ==> interior(s INTER t) INTER interior(s' INTER t) = {}`) THEN SIMP_TAC[SUBSET_INTERIOR; INTER_SUBSET] THEN ASM_MESON_TAC[division_of]]; REWRITE_TAC[division_of] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[FINITE_RESTRICT; FINITE_IMAGE; FINITE_DELETE] THEN REWRITE_TAC[IN_ELIM_THM; IMP_CONJ; FORALL_IN_IMAGE; IN_DELETE] THEN REWRITE_TAC[RIGHT_FORALL_IMP_THM; FORALL_IN_IMAGE; IN_DELETE] THEN REPEAT CONJ_TAC THENL [FIRST_ASSUM(fun th -> GEN_REWRITE_TAC I [MATCH_MP FORALL_IN_DIVISION th]) THEN REPEAT GEN_TAC THEN REPEAT DISCH_TAC THEN ASM_REWRITE_TAC[] THEN CONJ_TAC THENL [ALL_TAC; ASM_SIMP_TAC[INTERVAL_SPLIT] THEN MESON_TAC[]] THEN MATCH_MP_TAC(SET_RULE `s SUBSET t ==> s INTER u SUBSET t INTER u`) THEN RULE_ASSUM_TAC(REWRITE_RULE[division_of]) THEN ASM_MESON_TAC[]; REPEAT STRIP_TAC THEN MATCH_MP_TAC(SET_RULE `interior(s) INTER interior(s') = {} /\ interior(s INTER t) SUBSET interior s /\ interior(s' INTER t) SUBSET interior s' ==> interior(s INTER t) INTER interior(s' INTER t) = {}`) THEN SIMP_TAC[SUBSET_INTERIOR; INTER_SUBSET] THEN ASM_MESON_TAC[division_of]; REWRITE_TAC[SET_RULE `{x | x IN s /\ ~(x = a)} = s DELETE a`] THEN GEN_REWRITE_TAC LAND_CONV [SET_RULE `s = {} UNION s`] THEN REWRITE_TAC[GSYM UNIONS_INSERT] THEN REWRITE_TAC[SET_RULE `x INSERT (s DELETE x) = x INSERT s`] THEN REWRITE_TAC[UNIONS_INSERT; UNION_EMPTY] THEN REWRITE_TAC[GSYM SIMPLE_IMAGE; GSYM INTER_UNIONS] THEN AP_THM_TAC THEN AP_TERM_TAC THEN ASM_MESON_TAC[division_of]]]; ALL_TAC] THEN ONCE_REWRITE_TAC[TAUT `p ==> q ==> r <=> q ==> p ==> r`] THEN ANTS_TAC THENL [REPEAT CONJ_TAC THENL [EXPAND_TAC "n" THEN MATCH_MP_TAC LTE_ADD2 THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN CONJ_TAC THENL [MATCH_MP_TAC LET_TRANS THEN EXISTS_TAC `CARD(d1 DELETE (j:real^N->bool))` THEN CONJ_TAC THENL [ALL_TAC; MATCH_MP_TAC CARD_PSUBSET THEN ASM SET_TAC[]]; ALL_TAC] THEN MATCH_MP_TAC(ARITH_RULE `CARD {x | x IN IMAGE f s /\ P x} <= CARD(IMAGE f s) /\ CARD(IMAGE f s) <= CARD s ==> CARD {x | x IN IMAGE f s /\ P x} <= CARD s`) THEN ASM_SIMP_TAC[CARD_IMAGE_LE; FINITE_DELETE] THEN MATCH_MP_TAC CARD_SUBSET THEN ASM_SIMP_TAC[FINITE_IMAGE; FINITE_DELETE] THEN SET_TAC[]; REWRITE_TAC[GSYM MEMBER_NOT_EMPTY; IN_UNIONS] THEN ONCE_REWRITE_TAC[SWAP_EXISTS_THM] THEN EXISTS_TAC `i INTER {x:real^N | x$k <= &0}` THEN REWRITE_TAC[RIGHT_EXISTS_AND_THM; MEMBER_NOT_EMPTY] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN REWRITE_TAC[IN_ELIM_THM; IN_IMAGE; IN_DELETE; GSYM CONJ_ASSOC] THEN CONJ_TAC THENL [EXISTS_TAC `i:real^N->bool` THEN ASM_REWRITE_TAC[]; MATCH_MP_TAC(SET_RULE `~(s = {}) /\ s SUBSET t ==> ~(s INTER t = {})`) THEN ASM_REWRITE_TAC[] THEN ASM_MESON_TAC[division_of]]; DISCH_TAC THEN UNDISCH_TAC `measure (t INTER {x:real^N | x$k <= &0}) / measure t = measure (s INTER {x:real^N | x$k <= &0}) / measure s` THEN ASM_SIMP_TAC[MEASURE_EMPTY; REAL_EQ_RDIV_EQ] THEN REWRITE_TAC[real_div; REAL_MUL_LZERO] THEN CONV_TAC(RAND_CONV SYM_CONV) THEN ASM_SIMP_TAC[REAL_LT_IMP_NZ]; REWRITE_TAC[division_of] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[FINITE_RESTRICT; FINITE_IMAGE; FINITE_DELETE] THEN REWRITE_TAC[IN_ELIM_THM; IMP_CONJ; FORALL_IN_IMAGE; IN_DELETE] THEN REWRITE_TAC[RIGHT_FORALL_IMP_THM; FORALL_IN_IMAGE; IN_DELETE] THEN CONJ_TAC THENL [FIRST_ASSUM(fun th -> GEN_REWRITE_TAC I [MATCH_MP FORALL_IN_DIVISION th]) THEN REPEAT GEN_TAC THEN REPEAT DISCH_TAC THEN ASM_REWRITE_TAC[] THEN CONJ_TAC THENL [ALL_TAC; ASM_SIMP_TAC[INTERVAL_SPLIT] THEN MESON_TAC[]] THEN MATCH_MP_TAC(SET_RULE `x IN s ==> x SUBSET UNIONS s`) THEN ASM SET_TAC[]; REPEAT STRIP_TAC THEN MATCH_MP_TAC(SET_RULE `interior(s) INTER interior(s') = {} /\ interior(s INTER t) SUBSET interior s /\ interior(s' INTER t) SUBSET interior s' ==> interior(s INTER t) INTER interior(s' INTER t) = {}`) THEN SIMP_TAC[SUBSET_INTERIOR; INTER_SUBSET] THEN ASM_MESON_TAC[division_of]]; REWRITE_TAC[division_of] THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[FINITE_RESTRICT; FINITE_IMAGE; FINITE_DELETE] THEN REWRITE_TAC[IN_ELIM_THM; IMP_CONJ; FORALL_IN_IMAGE; IN_DELETE] THEN REWRITE_TAC[RIGHT_FORALL_IMP_THM; FORALL_IN_IMAGE; IN_DELETE] THEN REPEAT CONJ_TAC THENL [FIRST_ASSUM(fun th -> GEN_REWRITE_TAC I [MATCH_MP FORALL_IN_DIVISION th]) THEN REPEAT GEN_TAC THEN REPEAT DISCH_TAC THEN ASM_REWRITE_TAC[] THEN CONJ_TAC THENL [ALL_TAC; ASM_SIMP_TAC[INTERVAL_SPLIT] THEN MESON_TAC[]] THEN MATCH_MP_TAC(SET_RULE `s SUBSET t ==> s INTER u SUBSET t INTER u`) THEN RULE_ASSUM_TAC(REWRITE_RULE[division_of]) THEN ASM_MESON_TAC[]; REPEAT STRIP_TAC THEN MATCH_MP_TAC(SET_RULE `interior(s) INTER interior(s') = {} /\ interior(s INTER t) SUBSET interior s /\ interior(s' INTER t) SUBSET interior s' ==> interior(s INTER t) INTER interior(s' INTER t) = {}`) THEN SIMP_TAC[SUBSET_INTERIOR; INTER_SUBSET] THEN ASM_MESON_TAC[division_of]; REWRITE_TAC[SET_RULE `{x | x IN s /\ ~(x = a)} = s DELETE a`] THEN GEN_REWRITE_TAC LAND_CONV [SET_RULE `s = {} UNION s`] THEN REWRITE_TAC[GSYM UNIONS_INSERT] THEN REWRITE_TAC[SET_RULE `x INSERT (s DELETE x) = x INSERT s`] THEN REWRITE_TAC[UNIONS_INSERT; UNION_EMPTY] THEN REWRITE_TAC[GSYM SIMPLE_IMAGE; GSYM INTER_UNIONS] THEN AP_THM_TAC THEN AP_TERM_TAC THEN ASM_MESON_TAC[division_of]]]; ALL_TAC] THEN REWRITE_TAC[real_ge; IMP_IMP] THEN SUBGOAL_THEN `compact(UNIONS dl:real^N->bool) /\ compact(UNIONS dr:real^N->bool)` STRIP_ASSUME_TAC THENL [CONJ_TAC THEN MATCH_MP_TAC COMPACT_UNIONS THEN MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN ASM_SIMP_TAC[FINITE_RESTRICT; FINITE_IMAGE; FINITE_DELETE] THEN REWRITE_TAC[IMP_CONJ; IN_ELIM_THM; FORALL_IN_IMAGE; IN_DELETE] THEN REPEAT STRIP_TAC THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[division_of; COMPACT_INTERVAL]; ALL_TAC] THEN SUBGOAL_THEN `measurable(UNIONS dl:real^N->bool) /\ measurable(UNIONS dr:real^N->bool)` STRIP_ASSUME_TAC THENL [ASM_SIMP_TAC[MEASURABLE_COMPACT]; ALL_TAC] THEN SUBGOAL_THEN `measurable { x + y:real^N | x IN UNIONS dl /\ y IN t INTER {x | x$k <= &0}} /\ measurable { x + y:real^N | x IN UNIONS dr /\ y IN t INTER {x | &0 <= x$k}}` STRIP_ASSUME_TAC THENL [CONJ_TAC THEN MATCH_MP_TAC MEASURABLE_COMPACT THEN MATCH_MP_TAC COMPACT_SUMS THEN ASM_REWRITE_TAC[] THEN MATCH_MP_TAC COMPACT_INTER_CLOSED THEN REWRITE_TAC[REAL_ARITH `&0 <= x <=> x >= &0`; CLOSED_HALFSPACE_COMPONENT_LE; CLOSED_HALFSPACE_COMPONENT_GE] THEN ASM_MESON_TAC[ELEMENTARY_COMPACT]; ALL_TAC] THEN ASM (CONV_TAC o GEN_SIMPLIFY_CONV TOP_DEPTH_SQCONV (basic_ss []) 5) [REAL_LE_ROOT; DIMINDEX_NONZERO; REAL_LE_ADD; ROOT_POS_LE; MEASURE_POS_LE; MEASURABLE_INTER_HALFSPACE_LE; MEASURABLE_INTER_HALFSPACE_GE; REAL_ARITH `&0 <= x <=> x >= &0`] THEN MATCH_MP_TAC(REAL_ARITH `x <= a' + b' ==> a' <= a /\ b' <= b ==> x <= a + b`) THEN SUBGOAL_THEN `measure(UNIONS dl :real^N->bool) = measure(s INTER {x:real^N | x$k <= &0}) /\ measure(UNIONS dr :real^N->bool) = measure(s INTER {x:real^N | x$k >= &0})` (CONJUNCTS_THEN SUBST1_TAC) THENL [MAP_EVERY EXPAND_TAC ["dl"; "dr"] THEN ONCE_REWRITE_TAC[SET_RULE `{f x |x| x IN s /\ ~(f x = a)} = {t | t IN IMAGE f s /\ ~(t = a)}`] THEN REWRITE_TAC[SET_RULE `{x | x IN s /\ ~(x = a)} = s DELETE a`] THEN CONJ_TAC THEN GEN_REWRITE_TAC (LAND_CONV o RAND_CONV) [SET_RULE `s = {} UNION s`] THEN REWRITE_TAC[GSYM UNIONS_INSERT] THEN REWRITE_TAC[SET_RULE `x INSERT (s DELETE x) = x INSERT s`] THEN REWRITE_TAC[UNIONS_INSERT; UNION_EMPTY] THEN REWRITE_TAC[GSYM SIMPLE_IMAGE; GSYM INTER_UNIONS] THEN MATCH_MP_TAC MEASURE_NEGLIGIBLE_SYMDIFF THEN MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `{x:real^N | x$k = &0}` THEN ASM_SIMP_TAC[NEGLIGIBLE_STANDARD_HYPERPLANE] THEN MATCH_MP_TAC(SET_RULE `s SUBSET t /\ t DIFF s SUBSET u ==> (s DIFF t UNION t DIFF s) SUBSET u`) THEN REWRITE_TAC[SET_RULE `s INTER u DIFF t INTER u = (s DIFF t) INTER u`] THEN (SUBGOAL_THEN `s:real^N->bool = UNIONS d1` SUBST1_TAC THENL [ASM_MESON_TAC[division_of]; ALL_TAC] THEN CONJ_TAC THENL [SET_TAC[]; ALL_TAC]) THEN REWRITE_TAC[GSYM REAL_LE_ANTISYM; real_ge; SET_RULE `{x | P x /\ Q x} = {x | P x} INTER {x | Q x}`] THENL [MATCH_MP_TAC(SET_RULE `s SUBSET t ==> s INTER u SUBSET u INTER t`); MATCH_MP_TAC(SET_RULE `s SUBSET t ==> s INTER u SUBSET t INTER u`)] THEN RULE_ASSUM_TAC(REWRITE_RULE[real_ge]) THEN FIRST_ASSUM(MATCH_MP_TAC o MATCH_MP (REWRITE_RULE[IMP_CONJ_ALT] SUBSET_TRANS)) THEN SET_TAC[]; ALL_TAC] THEN SUBGOAL_THEN `root (dimindex (:N)) (measure (s INTER {x:real^N | x$k <= &0})) + root (dimindex (:N)) (measure (t INTER {x:real^N | x$k <= &0})) = root (dimindex (:N)) (measure (s INTER {x | x$k <= &0})) * (&1 + root (dimindex (:N)) (measure (t INTER {x | x$k <= &0})) / root (dimindex (:N)) (measure (s INTER {x | x$k <= &0}))) /\ root (dimindex (:N)) (measure (s INTER {x:real^N | x$k >= &0})) + root (dimindex (:N)) (measure (t INTER {x:real^N | x$k >= &0})) = root (dimindex (:N)) (measure (s INTER {x | x$k >= &0})) * (&1 + root (dimindex (:N)) (measure (t INTER {x | x$k >= &0})) / root (dimindex (:N)) (measure (s INTER {x | x$k >= &0})))` (CONJUNCTS_THEN SUBST1_TAC) THENL [CONJ_TAC THEN MATCH_MP_TAC(REAL_FIELD `&0 < s ==> s + t = s * (&1 + t / s)`) THEN ASM_SIMP_TAC[ROOT_POS_LT; DIMINDEX_NONZERO]; ALL_TAC] THEN ASM_SIMP_TAC[DIMINDEX_NONZERO; GSYM REAL_ROOT_DIV; MEASURE_POS_LE; MEASURABLE_INTER_HALFSPACE_LE; MEASURABLE_INTER_HALFSPACE_GE] THEN SUBGOAL_THEN `measure(t INTER {x:real^N | x$k <= &0}) / measure(s INTER {x:real^N | x$k <= &0}) = measure t / measure s /\ measure(t INTER {x:real^N | x$k >= &0}) / measure(s INTER {x:real^N | x$k >= &0}) = measure t / measure s` (CONJUNCTS_THEN SUBST1_TAC) THENL [MATCH_MP_TAC(REAL_FIELD `tn / t = sn / s /\ tp / t = sp / s /\ &0 < sp /\ &0 < sn /\ &0 < s /\ &0 < t ==> tn / sn = t / s /\ tp / sp = t / s`) THEN ASM_REWRITE_TAC[]; ALL_TAC] THEN REWRITE_TAC[GSYM REAL_ADD_RDISTRIB; REAL_POW_MUL] THEN ASM_SIMP_TAC[REAL_POW_ROOT; DIMINDEX_NONZERO; MEASURE_POS_LE; MEASURABLE_INTER_HALFSPACE_LE; MEASURABLE_INTER_HALFSPACE_GE] THEN SUBGOAL_THEN `measure (s INTER {x | x$k <= &0}) + measure (s INTER {x | x$k >= &0}) = root (dimindex(:N)) (measure(s:real^N->bool)) pow (dimindex(:N))` SUBST1_TAC THENL [ASM_SIMP_TAC[REAL_POW_ROOT; DIMINDEX_NONZERO; REAL_LT_IMP_LE] THEN MATCH_MP_TAC MEASURE_NEGLIGIBLE_UNION_EQ THEN ASM_SIMP_TAC[MEASURABLE_INTER_HALFSPACE_LE; MEASURABLE_INTER_HALFSPACE_GE] THEN CONJ_TAC THENL [REWRITE_TAC[EXTENSION; IN_UNION; IN_INTER; IN_ELIM_THM] THEN X_GEN_TAC `x:real^N` THEN ASM_CASES_TAC `(x:real^N) IN s` THEN ASM_REWRITE_TAC[] THEN REAL_ARITH_TAC; MATCH_MP_TAC NEGLIGIBLE_SUBSET THEN EXISTS_TAC `{x:real^N | x$k = &0}` THEN ASM_SIMP_TAC[NEGLIGIBLE_STANDARD_HYPERPLANE] THEN REWRITE_TAC[GSYM REAL_LE_ANTISYM; real_ge] THEN SET_TAC[]]; ASM_SIMP_TAC[GSYM REAL_ROOT_MUL; MEASURE_POS_LE; DIMINDEX_NONZERO; REAL_LE_DIV; GSYM REAL_POW_MUL; REAL_ADD_LDISTRIB; REAL_MUL_RID] THEN ASM_SIMP_TAC[REAL_DIV_LMUL; REAL_LT_IMP_NZ; REAL_LE_REFL]]);; (* ------------------------------------------------------------------------- *) (* Now for open sets. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* Now for convex sets. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* Now for compact sets. *) (* ------------------------------------------------------------------------- *) (* ------------------------------------------------------------------------- *) (* Finally, for an arbitrary measurable set. In this general case, the *) (* measurability of the sum-set is needed as an additional hypothesis. *) (* ------------------------------------------------------------------------- *)let BRUNN_MINKOWSKI_ELEMENTARY =prove (`!s t:real^N->bool. (s = {} <=> t = {}) /\ (?d. d division_of s) /\ (?d. d division_of t) ==> root (dimindex(:N)) (measure {x + y | x IN s /\ y IN t}) >= root (dimindex(:N)) (measure s) + root (dimindex(:N)) (measure t)`,