REPEAT GEN_TAC
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`v:real^3`;`r':real`]
CHANGE_TARJJUW_1)
THEN DISCH_THEN (MP_TAC o SPEC `p:real^3`)
THEN MP_TAC (ISPECL [`&2`;`r:real`;`r':real`]
REAL_LE_TRANS)
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`&0`;`&2`;`r':real`]
REAL_LTE_TRANS)
THEN ASM_REWRITE_TAC[ARITH_RULE `&0 < &2`]
THEN STRIP_TAC
THEN ASM_REWRITE_TAC[]
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `(v:real^3) = (r':real) /
norm p % (p:real^3)`
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`v:real^3`]
NORM_POS_LE)
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`((u:real^3)
dot (p:real^3))`;`((g:real^3->
real)(u:real^3))`;`(
norm (v:real^3))`]
REAL_LE_RMUL)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `((u:real^3)
dot (p:real^3)) <= ((g:real^3->
real)(u:real^3))`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `&0 <=
norm (v:real^3)`
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`(((u:real^3)
dot (p:real^3)) * (
norm (v:real^3)))`;`(((g:real^3->
real)(u:real^3)) *
norm v)`;`&2`](GSYM
REAL_LE_DIV2_EQ))
THEN REWRITE_TAC [ARITH_RULE `&0 < &2`]
THEN STRIP_TAC
(*Sub 1*)
THEN SUBGOAL_THEN `((u
dot p) *
norm (v:real^3)) / &2 <= (((g:real^3->
real)(u:real^3)) *
norm v) / &2` ASSUME_TAC
THENL [ASM_ARITH_TAC;MP_TAC (ISPECL [`((u:real^3)
dot (p:real^3))`;`(r':real)`]REAL_MUL_SYM)
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`r':real`;`u:real^3`;`p:real^3`]
DOT_RMUL)
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`v:real^3`;`r':real`;`p:real^3`]
CHANGE_TARJJUW_2)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `~(p:real^3 =
vec 0)`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `v:real^3 = (r':real) /
norm p % (p:real^3)`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `v:real^3 = (r':real) /
norm p % (p:real^3)`
THEN STRIP_TAC
THEN
(*Sub 1.1 ]]*)
SUBGOAL_THEN `(u:real^3)
dot ((r':real)% (p:real^3)) = u
dot ((
norm p)%v)` ASSUME_TAC
THENL [ASM_MESON_TAC[];MP_TAC (ISPECL [`(
norm (p:real^3))`;`(u:real^3)`;`(v:real^3)`]
DOT_RMUL)
THEN STRIP_TAC (*]]);;*)
(*Sub 1.1.1]]]*)
THEN SUBGOAL_THEN `((u:real^3)
dot (p:real^3)) * (r':real) =
norm p * (u
dot (v:real^3))` ASSUME_TAC
THENL [FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `((u:real^3)
dot (p:real^3)) * (r':real) = r' * (u
dot p)`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `(u:real^3)
dot (r':real) % (p:real^3)= r' * (u
dot p)`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `(u:real^3)
dot (r':real) % (p:real^3)= r' * (u
dot p)`
THEN POP_ASSUM MP_TAC
THEN POP_ASSUM MP_TAC
THEN MESON_TAC[
EQ_TRANS];
MP_TAC (ISPECL [`(u:real^3)`;`(v:real^3)`]
DOT_NORM_NEG)
THEN STRIP_TAC (*]]]);;*)
(*Sub 1.1.1.1 ]]]]*)
THEN SUBGOAL_THEN `((
norm (p:real^3)) * ((u:real^3)
dot (v:real^3))) = (((
norm p) *(((
norm u pow 2 +
norm v pow 2) - (
norm (u - v)) pow 2)) / &2))` ASSUME_TAC
THENL [POP_ASSUM MP_TAC
THEN MESON_TAC[];
POP_ASSUM MP_TAC THEN REWRITE_TAC[GSYM
dist] THEN STRIP_TAC
THEN MP_TAC (ISPECL [`V:real^3->bool`;`u:real^3`]
CHANGE_TARJJUW_3)
THEN ASM_REWRITE_TAC[]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`&2`]
REAL_ABS_REFL)
THEN REWRITE_TAC [ARITH_RULE `&0 <= &2`]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`u:real^3`]
REAL_ABS_NORM) THEN STRIP_TAC (*]]]]);;*)
THEN
(*Sub 1.1.1.1.1 ]]]]]*)
SUBGOAL_THEN `abs (&2) <= abs (
norm (u:real^3))` ASSUME_TAC
THENL [ASM_ARITH_TAC;
MP_TAC (ISPECL [`&2`;`
norm (u:real^3)`]
REAL_LE_SQUARE_ABS)
THEN POP_ASSUM (fun
th -> REWRITE_TAC [
th])
THEN REWRITE_TAC [ARITH_RULE `&2 pow 2 = &4`]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`u:real^3`;`v:real^3`;`r:real`]
CHANGE_TARJJUW_4)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `
dist (u:real^3,v:real^3) < r:real`
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`((r:real) pow 2)`;`
dist (u:real^3,v:real^3) pow 2`]
REAL_LT_NEG)
THEN FIRST_ASSUM (fun
th -> REWRITE_TAC [
th])
THEN STRIP_TAC (*]]]]]);;*)
(*Sub 1.1.1.1.1.1 ]]]]]]*)
THEN SUBGOAL_THEN `(
norm (v:real^3)) pow 2 = (r':real) pow 2`ASSUME_TAC
THENL [UNDISCH_TAC `r':real =
norm (v:real^3)`
THEN MESON_TAC[];
(*Sub 1.1.1.1.1.1.2*)
SUBGOAL_THEN `((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) =
(
norm (u:real^3)) pow 2 + (r':real) pow 2` ASSUME_TAC
THENL [ASM_ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2*)
SUBGOAL_THEN `&4 + (
norm (v:real^3)) pow 2 <= ((
norm (u:real^3)) pow 2 + (
norm v) pow 2 )` ASSUME_TAC
THENL [ASM_ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2.2*)
SUBGOAL_THEN `(((u:real^3)
dot (p:real^3)) * (r':real)) / &2 < (
norm (p))` ASSUME_TAC
THENL [UNDISCH_TAC `(((u:real^3)
dot (p:real^3)) *
norm (v:real^3)) / &2 <= ((g:real^3->
real) u *
norm v) / &2`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `r':real =
norm (v:real^3)`
THEN UNDISCH_TAC `((g:real^3->
real) (u:real^3) * (r':real)) / &2 <
norm (p:real^3)`
THEN ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2.2.2*)
SUBGOAL_THEN `((
norm (p:real^3)) * ((u:real^3)
dot (v:real^3))) / &2 < (
norm (p))`ASSUME_TAC
THENL [ASM_ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2.2.2*)
SUBGOAL_THEN `&4 + (r':real) pow 2 <= ((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2 )` ASSUME_TAC
THENL [ASM_ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2.2.2*)
SUBGOAL_THEN `&4 + (r':real) pow 2 + --(
dist ((u:real^3),(v:real^3)) pow 2) <= ((
norm (u)) pow 2 + (
norm (v)) pow 2 + --(
dist (u,v) pow 2) )` ASSUME_TAC
THENL [ASM_ARITH_TAC;
(*Sub 1.1.1.1.1.1.2.2.2.2*)
SUBGOAL_THEN `&4 + (r':real) pow 2 + --((r:real) pow 2) <= &4 + (r':real) pow 2 + --(
dist ((u:real^3),(v:real^3)) pow 2)` ASSUME_TAC
THENL [ASM_ARITH_TAC;
SUBGOAL_THEN `&4 + (r':real) pow 2 + --((r:real) pow 2) <= ((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2 + --(
dist (u,v) pow 2))` ASSUME_TAC
THENL [ASM_ARITH_TAC;
MP_TAC (ISPECL [`&0`;`&2`;`r:real`]
REAL_LE_TRANS)
THEN ASM_REWRITE_TAC[ARITH_RULE `&0 <= &2`]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`&0`;`r:real`;`r':real`]
REAL_LE_TRANS)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `&0 <= r:real`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `r:real <= r':real`
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`r':real`]
REAL_ABS_REFL)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `&0 <= r':real`
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`r:real`]
REAL_ABS_REFL)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [GSYM
th]) `&0 <= r:real`
THEN STRIP_TAC(*]]]]]]]]]]]]]]);;*)
THEN SUBGOAL_THEN `abs (r:real) <= abs(r':real)` ASSUME_TAC
THENL [POP_ASSUM (fun
th -> REWRITE_TAC[
th])
THEN POP_ASSUM (fun
th -> REWRITE_TAC[
th])
THEN ASM_REWRITE_TAC[];
MP_TAC (ISPECL [`r:real`;`r':real`]
REAL_LE_SQUARE_ABS)
THEN POP_ASSUM (fun
th -> REWRITE_TAC[
th])
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`r':real`;`r:real`]
REAL_SUB_LE)
THEN UNDISCH_TAC `r:real <= r':real`
THEN STRIP_TAC THEN POP_ASSUM (fun
th -> REWRITE_TAC[
th])
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`(r':real) pow 2`;`(r:real) pow 2 `]
REAL_SUB_LE)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `(r:real) pow 2 <= (r':real) pow 2`
THEN STRIP_TAC(*]]]]]]]]]]]]]]]);;*)
THEN SUBGOAL_THEN `&4 <= &4 + (r':real) pow 2 - (r:real) pow 2` ASSUME_TAC
THENL [MP_TAC (ISPECL [`&4`;`&0`;`(r':real) pow 2 - (r:real) pow 2`]
REAL_LE_LADD)
THEN POP_ASSUM (fun
th -> REWRITE_TAC[
th])
THEN REWRITE_TAC [ARITH_RULE `&4 + &0 = &4`];
MP_TAC (ISPECL [`&4 + ((r':real) pow 2)`;`((r:real) pow 2)`]
real_sub)
THEN STRIP_TAC(*]]]]]]]]]]]]]]]]);;*)
THEN SUBGOAL_THEN `&4 + ((r':real) pow 2) - ((r:real) pow 2) <= ((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) + --(
dist (u,v) pow 2)` ASSUME_TAC
THENL [ASM_ARITH_TAC;SUBGOAL_THEN `&4 <= ((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) + --(
dist (u,v) pow 2)` ASSUME_TAC
THENL [ASM_ARITH_TAC;
MP_TAC (ISPECL [`(((
norm (p:real^3)) * ((u:real^3)
dot (v:real^3)))/ &2)`;`(
norm (p:real^3))`;`&2`]
REAL_LT_RMUL)
THEN REWRITE_TAC [ARITH_RULE `&0 < &2`]
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `(
norm (p:real^3) * ((u:real^3)
dot (v:real^3))) / &2 <
norm p`
THEN REWRITE_TAC [ARITH_RULE `(((
norm (p:real^3)) * ((u:real^3)
dot (v:real^3)))/ &2) * (&2) = ((
norm (p:real^3)) * ((u:real^3)
dot (v:real^3)))`]
THEN STRIP_TAC(*]]]]]]]]]]]]]]]]]]);;*)
THEN SUBGOAL_THEN `(((
norm (p:real^3)) * (((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) -
dist (u,v) pow 2)) / &2) < (
norm p) * (&2) ` ASSUME_TAC
THENL [ASM_ARITH_TAC;
MP_TAC (ISPECL [`((((
norm (p:real^3)) * (((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) -
dist (u,v) pow 2)) / &2))`;`(
norm (p:real^3)) * (&2)`;`&2`]
REAL_LT_RMUL)
THEN REWRITE_TAC [ARITH_RULE `&0 < &2`]
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `(
norm (p:real^3) * ((
norm (u:real^3) pow 2 +
norm (v:real^3) pow 2) -
dist (u,v) pow 2)) / &2 <
norm p * &2`
THEN REWRITE_TAC [ARITH_RULE `((((
norm (p:real^3)) * (((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) -
dist (u,v) pow 2)) / &2))*(&2) = ((
norm (p:real^3)) * (((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) -
dist (u,v) pow 2))`]
THEN STRIP_TAC
THEN MP_TAC (ISPECL [`((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2)`;`(
dist (u:real^3,v:real^3) pow 2)`]
real_sub)
THEN STRIP_TAC(*]]]]]]]]]]]]]]]]]]]);;*)
THEN SUBGOAL_THEN `&4 <= ((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) - (
dist (u,v) pow 2)` ASSUME_TAC
THENL [ASM_ARITH_TAC;
MP_TAC (ISPECL [`p:real^3`]
NORM_POS_LE) THEN STRIP_TAC
THEN MP_TAC (ISPECL [`(
norm (p:real^3))`;`&4`;`(((
norm (u:real^3)) pow 2 + (
norm (v:real^3)) pow 2) -
dist (u,v) pow 2)`]
REAL_LE_LMUL)
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `&4 <= (
norm (u:real^3) pow 2 +
norm (v:real^3) pow 2) -
dist (u,v) pow 2`
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `&0 <=
norm (p:real^3)`
THEN STRIP_TAC(*]]]]]]]]]]]]]]]]]]]]);; *)
THEN MP_TAC (ISPECL [`(
norm (p:real^3)) * (&4)`;`
norm (p:real^3) * ((
norm (u:real^3) pow 2 +
norm v pow 2) -
dist (u,v) pow 2)`;`(
norm (p:real^3) * &2) * &2`]
REAL_LET_TRANS)
THEN POP_ASSUM (fun
th -> REWRITE_TAC [
th])
THEN FIND_ASSUM (fun
th -> REWRITE_TAC [
th]) `
norm (p:real^3) * ((
norm (u:real^3) pow 2 +
norm v pow 2) -
dist (u,v) pow 2) <
(
norm p * &2) * &2`
THEN ARITH_TAC]]]]]]]]]]]]]]]]]]]]);;