(`!V v1 v2 v3 v4. V
V /\
~(v1 = v3) /\ ~(v2 = v4) /\ v1 = v2 /\ ~(v3 = v4) /\
REWRITE_TAC[
SUBSET; packing] THEN REPEAT STRIP_TAC THEN
ASM_REWRITE_TAC[] THEN
SUBGOAL_THEN `{v2,v3}
INTER {v2,v4} = {v2:real^3}` (fun
th -> REWRITE_TAC[
th]) THENL
[
REWRITE_TAC[
EXTENSION;
IN_INTER;
IN_SING;
IN_INSERT;
NOT_IN_EMPTY] THEN
GEN_TAC THEN
ASM_CASES_TAC `x = v2:real^3` THEN ASM_REWRITE_TAC[] THEN
STRIP_TAC THEN POP_ASSUM MP_TAC THEN
POP_ASSUM (fun
th -> ASM_REWRITE_TAC[
th]);
ALL_TAC
] THEN
SUBGOAL_THEN `~(v2 =
vec 0:real^3) /\ ~(v3 =
vec 0:real^3) /\ ~(v4 =
vec 0:real^3)` ASSUME_TAC THENL
[
FIRST_X_ASSUM (MP_TAC o SPEC `x:real^3`) THEN
MAP_EVERY (fun tm -> FIRST_ASSUM (MP_TAC o SPEC tm)) [`v2:real^3`; `v3:real^3`; `v4:real^3`] THEN
ASM_SIMP_TAC[
in_ball_annulus];
ALL_TAC
] THEN
ASM_SIMP_TAC[
aff_ge_0_2] THEN
REWRITE_TAC[
EXTENSION;
IN_INTER;
HALFLINE;
VECTOR_MUL_RZERO;
VECTOR_ADD_LID;
IN_ELIM_THM] THEN
GEN_TAC THEN EQ_TAC THENL
[
STRIP_TAC THEN
POP_ASSUM (LABEL_TAC "x2" o SYM) THEN
UNDISCH_TAC `x =
t1 % v2 + t2 % v3:real^3` THEN
DISCH_THEN (LABEL_TAC "x1" o SYM) THEN
ASM_CASES_TAC `
t1 <= t1'` THENL
[
ASM_CASES_TAC `t2 = &0` THENL
[
EXISTS_TAC `t1:real` THEN
REMOVE_THEN "x1" MP_TAC THEN
ASM_SIMP_TAC[
VECTOR_MUL_LZERO;
VECTOR_ADD_RID];
ALL_TAC
] THEN
REMOVE_THEN "x1" (MP_TAC o AP_TERM `\v:real^3. inv t2 % v`) THEN
REMOVE_THEN "x2" (fun
th -> REWRITE_TAC[SYM
th]) THEN
ASM_SIMP_TAC[
VECTOR_MUL_ASSOC;
VECTOR_ADD_LDISTRIB; REAL_MUL_LINV;
VECTOR_MUL_LID] THEN
REWRITE_TAC[VECTOR_ARITH `a % v2 + v3:real^3 = b % v2 + c % v4 <=> v3 = (b - a) % v2 + c % v4`] THEN
REWRITE_TAC[GSYM
REAL_SUB_LDISTRIB] THEN DISCH_TAC THEN
SUBGOAL_THEN `v3:real^3
IN aff_ge {
vec 0} {v2, v4}` ASSUME_TAC THENL
[
ASM_SIMP_TAC[
aff_ge_0_2;
IN_ELIM_THM] THEN
MAP_EVERY EXISTS_TAC [`inv t2 * (t1' -
t1)`; `inv t2 * t2'`] THEN
SUBGOAL_THEN `&0 <= inv t2` ASSUME_TAC THENL [ MATCH_MP_TAC
REAL_LE_INV THEN ASM_REWRITE_TAC[]; ALL_TAC ] THEN
REWRITE_TAC[] THEN
CONJ_TAC THEN MATCH_MP_TAC
REAL_LE_MUL THEN ASM_REWRITE_TAC[REAL_ARITH `&0 <= t1' -
t1 <=>
t1 <= t1'`];
ALL_TAC
] THEN
MATCH_MP_TAC (TAUT `F ==> A`) THEN
MATCH_MP_TAC
LEMMA_3_POINTS_FINAL THEN
MAP_EVERY EXISTS_TAC [`v2:real^3`; `v4:real^3`; `v3:real^3`] THEN
POP_ASSUM (fun
th -> REWRITE_TAC[
th]) THEN REMOVE_ASSUM THEN
ASM_SIMP_TAC[] THEN
FIRST_X_ASSUM MATCH_MP_TAC THEN
ASM_REWRITE_TAC[] THEN
UNDISCH_TAC `v1 = v2:real^3` THEN DISCH_THEN (fun
th -> ASM_REWRITE_TAC[SYM
th]);
ALL_TAC
] THEN
POP_ASSUM MP_TAC THEN REWRITE_TAC[
REAL_NOT_LE] THEN DISCH_TAC THEN
ASM_CASES_TAC `t2' = &0` THENL
[
EXISTS_TAC `t1':real` THEN
REMOVE_THEN "x2" MP_TAC THEN
ASM_SIMP_TAC[
VECTOR_MUL_LZERO;
VECTOR_ADD_RID];
ALL_TAC
] THEN
REMOVE_THEN "x2" (MP_TAC o AP_TERM `\v:real^3. inv t2' % v`) THEN
REMOVE_THEN "x1" (fun
th -> REWRITE_TAC[SYM
th]) THEN
ASM_SIMP_TAC[
VECTOR_MUL_ASSOC;
VECTOR_ADD_LDISTRIB; REAL_MUL_LINV;
VECTOR_MUL_LID] THEN
REWRITE_TAC[VECTOR_ARITH `a % v2 + v4:real^3 = b % v2 + c % v3 <=> v4 = (b - a) % v2 + c % v3`] THEN
REWRITE_TAC[GSYM
REAL_SUB_LDISTRIB] THEN DISCH_TAC THEN
SUBGOAL_THEN `v4:real^3
IN aff_ge {
vec 0} {v2, v3}` ASSUME_TAC THENL
[
ASM_SIMP_TAC[
aff_ge_0_2;
IN_ELIM_THM] THEN
MAP_EVERY EXISTS_TAC [`inv t2' * (
t1 - t1')`; `inv t2' * t2`] THEN
SUBGOAL_THEN `&0 <= inv t2'` ASSUME_TAC THENL [ MATCH_MP_TAC
REAL_LE_INV THEN ASM_REWRITE_TAC[]; ALL_TAC ] THEN
REWRITE_TAC[] THEN
CONJ_TAC THEN MATCH_MP_TAC
REAL_LE_MUL THEN ASM_SIMP_TAC[REAL_ARITH `t1' <
t1 ==> &0 <=
t1 - t1'`];
ALL_TAC
] THEN
MATCH_MP_TAC (TAUT `F ==> A`) THEN
MATCH_MP_TAC
LEMMA_3_POINTS_FINAL THEN
MAP_EVERY EXISTS_TAC [`v2:real^3`; `v3:real^3`; `v4:real^3`] THEN
POP_ASSUM (fun
th -> REWRITE_TAC[
th]) THEN REMOVE_ASSUM THEN
ASM_SIMP_TAC[] THEN
UNDISCH_TAC `v1 = v2:real^3` THEN DISCH_THEN (fun
th -> ASM_REWRITE_TAC[SYM
th]);
ALL_TAC
] THEN
STRIP_TAC THEN
CONJ_TAC THEN MAP_EVERY EXISTS_TAC [`t:real`; `&0`] THEN ASM_REWRITE_TAC[
VECTOR_MUL_LZERO;
VECTOR_ADD_RID;
REAL_LE_REFL]);;