prioritize_overload `:real^N`;;
needs "tame/ssreflect/sort-compiled.hl";;

(* Module Fnjlbxs*)
module Fnjlbxs = struct

open Ssrfun;;
open Ssrbool;;
open Ssrnat;;
open Seq;;
open Seq2;;
open Sort;;
open Tame_defs;;
open Fan_defs;;

(* Lemma packing *)
let packing = Sections.section_proof ["V"]
`packing V <=> (!u v. u IN V /\ v IN V /\ ~(u = v) ==> &2 <= dist (u,v))`
[
   (((((use_arg_then2 ("Sphere.packing", [Sphere.packing]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("IN", [IN])) (fun fst_arg -> (use_arg_then2 ("V", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))))) THEN (done_tac));
];;
let inE = CONJUNCT2 IN_ELIM_THM;;

(* Section MoreList *)
Sections.begin_section "MoreList";;

(* Lemma uniq_lift *)
let uniq_lift = Sections.section_proof ["l"]
`uniq (map lift l) <=> uniq l`
[
   (((((use_arg_then2 ("map_inj_uniq", [map_inj_uniq]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("LIFT_EQ", [LIFT_EQ]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
];;

(* Lemma list_sum_continuous *)
let list_sum_continuous = Sections.section_proof ["f";"s";"s'";"net"]
`lift o f continuous_on (UNIV:real^N->bool) /\
        (!k. LENGTH (s' k) = LENGTH s) /\
        (!i. i < LENGTH s ==> ((\k. EL i (s' k)) --> EL i s) net) ==>
        ((\k. list_sum (s' k) f) ---> list_sum s f) net`
[
   ((BETA_TAC THEN (case THEN (move ["f_cont"]))) THEN (((THENL) (((use_arg_then2 ("s'", [])) (disch_tac [])) THEN (clear_assumption "s'") THEN ((use_arg_then2 ("s", [])) (disch_tac [])) THEN (clear_assumption "s") THEN elim) [ALL_TAC; ((move ["h"]) THEN (move ["t"]) THEN (move ["IH"]))]) THEN (move ["s'"])) THEN (repeat_tactic 1 9 (((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] []))))));
   (((((use_arg_then2 ("LENGTH_EQ_NIL", [LENGTH_EQ_NIL]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["_"])) THEN (((use_arg_then2 ("REALLIM_CONST", [REALLIM_CONST]))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
   (BETA_TAC THEN (case THEN (move ["len_eq"])) THEN (move ["s'_to"]));
   ((fun arg_tac -> arg_tac (Arg_term (`!k. s' k = EL 0 (s' k) :: TL (s' k)`))) (term_tac (have_gen_tac [](move ["s'_eq"]))));
   ((BETA_TAC THEN (move ["k"])) THEN ((((use_arg_then2 ("EL", [EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CONS_HD_TL", [CONS_HD_TL]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LENGTH_EQ_NIL", [LENGTH_EQ_NIL]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_SUC", [NOT_SUC]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((THENL_ROT (-1)) (((((use_arg_then2 ("s'_eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("list_sum_cons", [list_sum_cons]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REALLIM_ADD", [REALLIM_ADD]))(thm_tac (new_rewrite [] []))))) THEN (split_tac)));
   ((THENL_FIRST) ((((use_arg_then2 ("IH", [])) (disch_tac [])) THEN (clear_assumption "IH") THEN (DISCH_THEN apply_tac)) THEN (split_tac)) ((BETA_TAC THEN (move ["k"])) THEN (((fun arg_tac -> (use_arg_then2 ("len_eq", [])) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("s'_eq", []))(thm_tac (new_rewrite [1] [])))) THEN (((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eqSS", [eqSS]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)));
   ((BETA_TAC THEN (move ["i"]) THEN (move ["i_lt"])) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL EL_TL)))(thm_tac (new_rewrite [] [])))));
   ((((fun arg_tac -> (use_arg_then2 ("s'_to", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`SUC i`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("ltSS", [ltSS]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("ADD1", [ADD1]))(thm_tac (new_rewrite [1] [])))) THEN (((use_arg_then2 ("EL", [EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("TL", [TL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   (((use_arg_then2 ("LIM_REAL_CONTINUOUS_FUNCTION", [LIM_REAL_CONTINUOUS_FUNCTION]))(thm_tac (new_rewrite [] []))));
   ((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REAL_CONTINUOUS_CONTINUOUS1)))(thm_tac (new_rewrite [] [])))) THEN (split_tac));
   (((use_arg_then2 ("CONTINUOUS_ON_INTERIOR", [CONTINUOUS_ON_INTERIOR])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`UNIV`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("INTERIOR_UNIV", [INTERIOR_UNIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_UNIV", [IN_UNIV]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((((fun arg_tac -> (use_arg_then2 ("s'_to", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("gtS0", [gtS0]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("EL", [EL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("HD", [HD]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
];;

(* Lemma list_sum_continuous_alt *)
let list_sum_continuous_alt = Sections.section_proof ["f";"s";"v";"net"]
`lift o f continuous_on (UNIV:real^N->bool) /\
        (!i. i < LENGTH s ==> ((\k. v k i) --> EL i s) net) ==>
        ((\k. list_sum (mkseq (v k) (LENGTH s)) f) ---> list_sum s f) net`
[
   (BETA_TAC THEN (case THEN ((move ["f_cont"]) THEN (move ["v_to"]))));
   (((((use_arg_then2 ("list_sum_continuous", [list_sum_continuous]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("f_cont", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"]));
   ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`!k. EL i (mkseq (v k) (sizel s)) = v k i`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) (((((use_arg_then2 ("v_to", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)));
   ((BETA_TAC THEN (move ["k"])) THEN ((((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
];;

(* Finalization of the section MoreList *)
let uniq_lift = Sections.finalize_theorem uniq_lift;;
let list_sum_continuous = Sections.finalize_theorem list_sum_continuous;;
let list_sum_continuous_alt = Sections.finalize_theorem list_sum_continuous_alt;;
Sections.end_section "MoreList";;

(* Section MoreMinK *)
Sections.begin_section "MoreMinK";;

(* Lemma min_k_continuous *)
let min_k_continuous = Sections.section_proof ["k";"n";"f";"net"]
`(!i. i < n ==> f i real_continuous net) ==>
        (\x. min_k k (mkseq (\i. f i x) n)) real_continuous net`
[
   ((THENL_ROT (-1)) (((fun arg_tac -> arg_tac (Arg_term (`k < n:num`))) (disch_eq_tac "k_lt" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)));
   ((((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] [])))) THEN ((fun arg_tac -> arg_tac (Arg_term (`\x. _ x`))) (term_tac (set_tac "r"))));
   ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`r = \x. EL k (nseq n ((@)UNIV))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((((use_arg_then2 ("REAL_CONTINUOUS_CONST", [REAL_CONTINUOUS_CONST]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)));
   ((((((use_arg_then2 ("r_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["m"]) THEN (simp_tac)) THEN ((use_arg_then2 ("ge_length_imp_EL_eq", [ge_length_imp_EL_eq])) (thm_tac apply_tac)));
   (((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_merge_sort", [size_merge_sort]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_nseq", [size_nseq]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leqNgt", [leqNgt]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((repeat_tactic 1 9 (((use_arg_then2 ("real_continuous", [real_continuous]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REALLIM)))(thm_tac (new_rewrite [] []))))));
   (((fun arg_tac -> arg_tac (Arg_term (`trivial_limit net`))) (disch_tac [])) THEN case THEN (simp_tac) THEN (move ["f_cont"]) THEN (move ["e"]) THEN (move ["e_gt0"]));
   (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`?y. (?x. netord net x y) /\
        (!x. netord net x y ==> (!i:num. i < n ==> abs (f i x - f i (netlimit net)) < e))`))) (term_tac (have_gen_tac []ALL_TAC))));
   ((((use_arg_then2 ("MONO_EXISTS", [MONO_EXISTS])) (thm_tac apply_tac)) THEN (move ["y"]) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["all_f"])) THEN ((((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (move ["x"]) THEN (move ["net_x"])));
   (repeat_tactic 1 9 (((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] [])))));
   (((fun arg_tac -> arg_tac (Arg_term (`merge_sort (<=) _`))) (term_tac (set_tac "s"))) THEN ((fun arg_tac -> arg_tac (Arg_term (`merge_sort (<=) _`))) (term_tac (set_tac "s'"))));
   ((repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("s'_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_merge_sort", [size_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)));
   ((((use_arg_then2 ("s_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s'_def", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("sort_continuous", [sort_continuous])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. f i x) n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. f i (netlimit net)) n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))));
   (((((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("s'_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("real_merge_sort", [real_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"]));
   (((repeat_tactic 1 9 (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("all_f", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((fun arg_tac -> arg_tac (Arg_term (`?y x. netord net x y`))) (term_tac (have_gen_tac [](move ["ord_xy"]))));
   ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f_cont", [])) (fun fst_arg -> (use_arg_then2 ("k_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["y"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["x"])) THEN (move ["h"]) THEN (move ["_"])) THEN (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac))) THEN (done_tac));
   (((THENL) (((use_arg_then2 ("f_cont", [])) (disch_tac [])) THEN (clear_assumption "f_cont") THEN ((use_arg_then2 ("n", [])) (disch_tac [])) THEN (clear_assumption "n") THEN elim) [ALL_TAC; ((move ["m"]) THEN (move ["IH"]))]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("ltn0", [ltn0]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)));
   ((((use_arg_then2 ("ord_xy", [])) (disch_tac [])) THEN (clear_assumption "ord_xy") THEN BETA_TAC THEN (case THEN (move ["y"])) THEN (case THEN (move ["x"])) THEN (move ["ord_xy"])) THEN (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac))) THEN (done_tac));
   ((BETA_TAC THEN (move ["f_cont"])) THEN (((use_arg_then2 ("IH", [])) (disch_tac [])) THEN (clear_assumption "IH") THEN BETA_TAC) THEN ((THENL) (ANTS_TAC) [((move ["i"]) THEN (move ["i_lt_m"]) THEN (move ["e'"]) THEN (move ["e'_gt0"])); ALL_TAC]));
   (((((use_arg_then2 ("f_cont", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("e'_gt0", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("i_lt_m", [])) (disch_tac [])) THEN (clear_assumption "i_lt_m") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac));
   (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f_cont", [])) (fun fst_arg -> (use_arg_then2 ("m", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("ltnSn", [ltnSn])) (fun fst_arg -> (use_arg_then2 ("m", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC);
   ((((use_arg_then2 ("IMP_IMP", [IMP_IMP]))(fun arg -> ONCE_REWRITE_TAC[get_arg_thm arg]))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("NET_DILEMMA", [NET_DILEMMA])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (case THEN (move ["y"])) THEN (case THEN (move ["x_ord"])) THEN (move ["h"]));
   (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN (((((use_arg_then2 ("x_ord", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `i < SUC m <=> i = m \/ i < m`)))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (move ["ord_xy"]) THEN (move ["i"])));
   ((THENL_FIRST) ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (move ["i_lt_m"])]) ((((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)));
   ((((fun arg_tac -> (use_arg_then2 ("h", [])) (fun fst_arg -> (use_arg_then2 ("ord_xy", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac));
];;

(* Lemma min_k_limit *)
let min_k_limit = Sections.section_proof ["k";"s";"s'";"net"]
`(!n. LENGTH (s' n) = LENGTH s) /\
        (!i. i < LENGTH s ==> ((\n. EL i (s' n)) ---> EL i s) net) ==>
        ((\n. min_k k (s' n)) ---> min_k k s) net`
[
   (BETA_TAC THEN (case THEN ((move ["len_eq"]) THEN (move ["s'_to"]))));
   ((THENL_ROT (-1)) (((fun arg_tac -> arg_tac (Arg_term (`k < LENGTH s`))) (disch_eq_tac "k_lt" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)));
   ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`(\n. min_k k (s' n)) = (\n. min_k k s)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((((use_arg_then2 ("REALLIM_CONST", [REALLIM_CONST]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)));
   ((((repeat_tactic 1 9 (((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["m"]) THEN (simp_tac)) THEN ((use_arg_then2 ("ge_length_imp_EL_eq", [ge_length_imp_EL_eq])) (thm_tac apply_tac)));
   (((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("size_merge_sort", [size_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leqNgt", [leqNgt]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((((use_arg_then2 ("s'_to", [])) (disch_tac [])) THEN (clear_assumption "s'_to") THEN BETA_TAC) THEN (repeat_tactic 1 9 (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REALLIM)))(thm_tac (new_rewrite [] []))))));
   (((fun arg_tac -> arg_tac (Arg_term (`trivial_limit net`))) (disch_tac [])) THEN case THEN (simp_tac) THEN (move ["el_cont"]) THEN (move ["e"]) THEN (move ["e_gt0"]));
   (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`?y. (?x. netord net x y) /\
        (!x. netord net x y ==> (!i. i < LENGTH s ==> abs (EL i (s' x) - EL i s) < e))`))) (term_tac (have_gen_tac []ALL_TAC))));
   ((((use_arg_then2 ("MONO_EXISTS", [MONO_EXISTS])) (thm_tac apply_tac)) THEN (move ["y"]) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["all_el"])) THEN ((((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (move ["x"]) THEN (move ["net_x"])));
   (repeat_tactic 1 9 (((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] [])))));
   (((fun arg_tac -> arg_tac (Arg_term (`merge_sort (<=) _`))) (term_tac (set_tac "l"))) THEN ((fun arg_tac -> arg_tac (Arg_term (`merge_sort (<=) _`))) (term_tac (set_tac "l'"))));
   ((repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("l_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("l'_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_merge_sort", [size_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)));
   ((((use_arg_then2 ("l_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("l'_def", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("sort_continuous", [sort_continuous])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`s' x`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))));
   (((((use_arg_then2 ("l_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("l'_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("real_merge_sort", [real_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"]));
   (((repeat_tactic 1 9 (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("all_el", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((fun arg_tac -> arg_tac (Arg_term (`?y x. netord net x y`))) (term_tac (have_gen_tac [](move ["ord_xy"]))));
   ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("el_cont", [])) (fun fst_arg -> (use_arg_then2 ("k_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["y"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["x"])) THEN (move ["h"]) THEN (move ["_"])) THEN (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac))) THEN (done_tac));
   (((THENL) (((use_arg_then2 ("el_cont", [])) (disch_tac [])) THEN (clear_assumption "el_cont") THEN ((use_arg_then2 ("len_eq", [])) (disch_tac [])) THEN (clear_assumption "len_eq") THEN ((use_arg_then2 ("s'", [])) (disch_tac [])) THEN (clear_assumption "s'") THEN ((use_arg_then2 ("s", [])) (disch_tac [])) THEN (clear_assumption "s") THEN elim) [ALL_TAC; ((move ["h"]) THEN (move ["t"]) THEN (move ["IH"]))]) THEN (((repeat_tactic 1 9 (((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("ltn0", [ltn0]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["s'"]) THEN (move ["len_eq"]) THEN (move ["el_cont"])));
   ((((fun arg_tac -> (use_arg_then2 ("IH", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\n. TL (s' n)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (repeat_tactic 1 9 ((ANTS_TAC))));
   ((THENL_LAST) ((BETA_TAC THEN (move ["n"])) THEN ((((use_arg_then2 ("LENGTH_TL", [LENGTH_TL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))))) ((arith_tac) THEN (done_tac)));
   ((((fun arg_tac -> (use_arg_then2 ("len_eq", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac));
   (BETA_TAC THEN (move ["i"]) THEN (move ["i_lt"]) THEN (move ["e'"]) THEN (move ["e'_gt0"]));
   ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("el_cont", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`SUC i`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e'_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("ltSS", [ltSS]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("EL", [EL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("TL", [TL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
   ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("el_cont", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("gtS0", [gtS0]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)));
   ((((use_arg_then2 ("IMP_IMP", [IMP_IMP]))(fun arg -> ONCE_REWRITE_TAC[get_arg_thm arg]))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("NET_DILEMMA", [NET_DILEMMA])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (case THEN (move ["y"])) THEN (case THEN (move ["x_ord"])) THEN (move ["h"]));
   ((THENL_FIRST) (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN (((((use_arg_then2 ("x_ord", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (move ["ord_xy"]) THEN ((THENL) case [(move ["_"]); (move ["i"])]))) ((((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)));
   (((((use_arg_then2 ("ltSS", [ltSS]))(thm_tac (new_rewrite [] [])))) THEN (move ["i_lt"])) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("EL", [EL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("TL", [TL]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("h", [])) (fun fst_arg -> (use_arg_then2 ("ord_xy", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (done_tac));
];;
let min_dist_k = new_definition
        `min_dist_k k (l:(real^N)list) = min_k 0 (map (\v. dist (v, EL k l)) (delete_at k l))`;;
(* Lemma min_dist_k_limit *) let min_dist_k_limit = Sections.section_proof ["k";"s";"s'";"net"] `(!n. LENGTH (s' n) = LENGTH s) /\ (!i. i < LENGTH s ==> ((\n. EL i (s' n)) --> EL i s) net) ==> ((\n. min_dist_k k (s' n)) ---> min_dist_k k s) net` [ (BETA_TAC THEN (case THEN (move ["len_eq"])) THEN (move ["s'_to"])); (repeat_tactic 1 9 (((use_arg_then2 ("min_dist_k", [min_dist_k]))(thm_tac (new_rewrite [] []))))); (((use_arg_then2 ("min_k_limit", [min_k_limit])) (thm_tac apply_tac)) THEN ((THENL) (split_tac) [(move ["n"]); (move ["i"])]) THEN ((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)))); ((in_tac ["len_eq"] true (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (BETA_TAC THEN (move ["i_lt"]))); ((fun arg_tac -> arg_tac (Arg_term (`(\n. EL i (map (\v. dist (v, EL k (s' n))) (delete_at k (s' n)))) = (\n. norm (EL i (delete_at k (s' n)) - EL k (s' n)))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((((((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))) THEN (move ["n"]) THEN (simp_tac)) THEN ((((use_arg_then2 ("EL_map", [EL_map]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("EL_map", [EL_map]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); (((use_arg_then2 ("LIM_REAL_CONTINUOUS_FUNCTION", [LIM_REAL_CONTINUOUS_FUNCTION])) (thm_tac apply_tac)) THEN ((((use_arg_then2 ("REAL_CONTINUOUS_NORM_AT", [REAL_CONTINUOUS_NORM_AT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LIM_SUB", [LIM_SUB]))(thm_tac (new_rewrite [] [])))))); ((THENL_ROT (-1)) (((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN ((fun arg_tac -> arg_tac (Arg_term (`k < sizel s`))) (disch_eq_tac "k_lt" [])) THEN case THEN (simp_tac) THEN (move ["i_lt"]) THEN (process_fst_eq_tac))); ((fun arg_tac -> arg_tac (Arg_term (`!n. delete_at k (s' n) = s' n`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((BETA_TAC THEN (move ["n"])) THEN ((((use_arg_then2 ("delete_at_eq_imp", [delete_at_eq_imp]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_FIRST) ((((fun arg_tac -> (use_arg_then2 ("delete_at_eq_imp", [delete_at_eq_imp])) (fun fst_arg -> (use_arg_then2 ("k_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s'_to", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))))) ((((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`!n. EL k (s' n) = EL k s`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((((use_arg_then2 ("LIM_CONST", [LIM_CONST]))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); ((BETA_TAC THEN (move ["n"])) THEN ((use_arg_then2 ("ge_length_imp_EL_eq", [ge_length_imp_EL_eq])) (thm_tac apply_tac)) THEN ((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leqNgt", [leqNgt]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`!n. EL i (delete_at k (s' n)) = EL (if i < k then i else SUC i) (s' n)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((BETA_TAC THEN (move ["n"])) THEN ((((use_arg_then2 ("EL_delete_at", [EL_delete_at]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("EL_delete_at", [EL_delete_at]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((repeat_tactic 1 9 (((use_arg_then2 ("s'_to", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma min_dist_min *) let min_dist_min = Sections.section_proof ["l";"k"] `!i. i < sizel l /\ ~(i = k) ==> min_dist_k k l <= dist (EL i l, EL k l)` [ ((BETA_TAC THEN (move ["i"]) THEN (case THEN ((move ["i_lt"]) THEN (move ["neq"])))) THEN ((((use_arg_then2 ("min_dist_k", [min_dist_k]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> arg_tac (Arg_term (`map _1 _2`))) (term_tac (set_tac "s"))); ((fun arg_tac -> (use_arg_then2 ("real_merge_sort", [real_merge_sort])) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["sort"]))); (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))); (((((use_arg_then2 ("size_merge_sort", [size_merge_sort]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN ((use_arg_then2 ("neq", [])) (disch_tac [])) THEN (clear_assumption "neq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `!a b. a <= b <=> a <= b \/ b = a`)))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_term (`_1 = _2`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac))); ((((fun arg_tac -> (use_arg_then2 ("nth0_sorted_imp", [nth0_sorted_imp])) (fun fst_arg -> (use_arg_then2 ("sort", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("mapP", [mapP]))(thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> arg_tac (Arg_term (`EL i l`))) (term_tac exists_tac)) THEN (simp_tac)) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`if i < k then i else i - 1`))) (term_tac (set_tac "j"))); ((fun arg_tac -> arg_tac (Arg_term (`j < sizel (delete_at k l)`))) (term_tac (have_gen_tac [](move ["j_lt"])))); (((((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("j_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("neq", [])) (disch_tac [])) THEN (clear_assumption "neq") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((use_arg_then2 ("j", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("EL_delete_at", [EL_delete_at]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("j_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); (congr_tac (`EL _ l`)); ((((use_arg_then2 ("j_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("neq", [])) (disch_tac [])) THEN (clear_assumption "neq") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma min_dist_exists *) let min_dist_exists = Sections.section_proof ["l";"k"] `2 <= sizel l ==> ?m. m < sizel l /\ ~(m = k) /\ min_dist_k k l = dist (EL m l, EL k l)` [ ((BETA_TAC THEN (move ["size_ge"])) THEN (((use_arg_then2 ("min_dist_k", [min_dist_k]))(thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`map _1 _2`))) (term_tac (set_tac "s"))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("mem_min_k", [mem_min_k])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)); (((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_ge", [])) (disch_tac [])) THEN (clear_assumption "size_ge") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["i"])) THEN (case THEN (move ["i_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`if i < k then i else SUC i`))) (term_tac (set_tac "m"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`m < sizel l`))) (term_tac (have_gen_tac [](move ["m_lt"])))) ((((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((THENL_FIRST) (((use_arg_then2 ("m", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("m_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (split_tac)) ((((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EL_map", [EL_map]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac))); (((((use_arg_then2 ("EL_delete_at", [EL_delete_at]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("m_def", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size_delete_at", [size_delete_at]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma min_distP *) let min_distP = Sections.section_proof ["l";"k";"x"] `2 <= sizel l ==> (min_dist_k k l = x <=> ?m. m < sizel l /\ ~(m = k) /\ dist (EL m l, EL k l) = x /\ (!i. i < sizel l /\ ~(i = k) ==> x <= dist (EL i l, EL k l)) )` [ (BETA_TAC THEN (move ["size_ge"])); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("size_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["r"])) THEN (case THEN (move ["r_lt"])) THEN (case THEN (move ["rnk"])) THEN (move ["r_dist_eq"])); ((THENL) (split_tac) [(((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] []))))); ((case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["mnk"])) THEN (case THEN (move ["dist_eq"])) THEN (move ["dist_le"]))]); (((use_arg_then2 ("r", [])) (term_tac exists_tac)) THEN (((((use_arg_then2 ("r_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("rnk", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("r_dist_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["i"]) THEN (case THEN (move ["i_lt"])) THEN (move ["neq"]))); ((((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((((use_arg_then2 ("REAL_LE_ANTISYM", [REAL_LE_ANTISYM]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (split_tac)); (((((use_arg_then2 ("dist_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("r_dist_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_le", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma min_dist_imp_packing *) let min_dist_imp_packing = Sections.section_proof ["l"] `(!i. i < sizel l ==> &2 <= min_dist_k i l) ==> packing (set_of_list l)` [ (((((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))))) THEN (move ["h"]) THEN (move ["u"]) THEN (move ["v"])); (((repeat_tactic 1 9 (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN ALL_TAC) THEN (case THEN (move ["i"])) THEN (case THEN (move ["i_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN (case THEN ALL_TAC) THEN (case THEN (move ["j"])) THEN (case THEN (move ["j_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN (move ["neq"])); ((((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k j l`))) (term_tac exists_tac))); ((((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("neq", [])) (disch_tac [])) THEN (clear_assumption "neq") THEN ((use_arg_then2 ("contra", [contra])) (disch_tac [])) THEN (clear_assumption "contra") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma packing_eq_min_dist *) let packing_eq_min_dist = Sections.section_proof ["l"] `uniq l /\ 2 <= sizel l ==> (packing (set_of_list l) <=> !i. i < sizel l ==> &2 <= min_dist_k i l)` [ ((THENL_LAST) ((BETA_TAC THEN (case THEN ((move ["uniq_l"]) THEN (move ["size_ge"])))) THEN (split_tac)) (((use_arg_then2 ("min_dist_imp_packing", [min_dist_imp_packing])) (disch_tac [])) THEN (clear_assumption "min_dist_imp_packing") THEN (exact_tac))); (((((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))))) THEN (move ["pack"]) THEN (move ["k"]) THEN (move ["k_lt"])); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("size_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["n_mk"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("pack", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("nth_uniq", [nth_uniq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma min_dist_imp_uniq *) let min_dist_imp_uniq = Sections.section_proof ["l"] `(!i. i < sizel l ==> &0 < min_dist_k i l) ==> uniq l` [ ((THENL_FIRST) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`sizel l < 2`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) (((DISCH_THEN (fun snd_th -> (use_arg_then2 ("uniq_small_size", [uniq_small_size])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (move ["size_ge"]) THEN (move ["n0"])); ((((fun arg_tac -> (use_arg_then2 ("uniq_nthP", [uniq_nthP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (move ["i"]) THEN (move ["j"]) THEN (case THEN (move ["i_lt_j"])) THEN (move ["j_lt"])); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`i < sizel l`))) (term_tac (have_gen_tac [](move ["i_lt"])))) ((((use_arg_then2 ("j_lt", [])) (disch_tac [])) THEN (clear_assumption "j_lt") THEN ((use_arg_then2 ("i_lt_j", [])) (disch_tac [])) THEN (clear_assumption "i_lt_j") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((fun arg_tac -> (use_arg_then2 ("n0", [])) (fun fst_arg -> (use_arg_then2 ("j_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac)) THEN (((repeat_tactic 1 9 (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac))) THEN (move ["el_eq"]))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("size_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("j", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["n_mj"])) THEN (move ["dist_eq"])); ((((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_min", [min_dist_min])) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("j", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)) ((((use_arg_then2 ("i_lt_j", [])) (disch_tac [])) THEN (clear_assumption "i_lt_j") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("el_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma uniq_min_distP *) let uniq_min_distP = Sections.section_proof ["l"] `uniq l <=> sizel l < 2 \/ (!i. i < sizel l ==> &0 < min_dist_k i l)` [ ((THENL_LAST) (split_tac) (((THENL) case [(DISCH_THEN (fun snd_th -> (use_arg_then2 ("uniq_small_size", [uniq_small_size])) (thm_tac (match_mp_then snd_th MP_TAC)))); (DISCH_THEN (fun snd_th -> (use_arg_then2 ("min_dist_imp_uniq", [min_dist_imp_uniq])) (thm_tac (match_mp_then snd_th MP_TAC))))]) THEN (done_tac))); ((BETA_TAC THEN (move ["uniq_l"])) THEN (((THENL) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`sizel l < 2`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); ALL_TAC]) THEN ((TRY done_tac)))); (((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (move ["size_ge"])) THEN ((DISJ2_TAC) THEN (move ["k"]) THEN (move ["k_lt"]))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("size_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["n_mk"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); (in_tac ["uniq_l"] false (((fun arg_tac -> (use_arg_then2 ("uniq_nthP", [uniq_nthP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("k_lt", [])) (disch_tac [])) THEN (clear_assumption "k_lt") THEN ((use_arg_then2 ("m_lt", [])) (disch_tac [])) THEN (clear_assumption "m_lt") THEN ((use_arg_then2 ("n_mk", [])) (disch_tac [])) THEN (clear_assumption "n_mk") THEN BETA_TAC) THEN (((THENL) ((fun arg_tac -> arg_tac (Arg_term (`m < k:num`))) (term_tac (wlog_tac ALL_TAC[`m`; `k`]))) [(move ["h"]); (move ["m_lt_k"])]) THEN (move ["n_mk"]) THEN (move ["m_lt"]) THEN (move ["k_lt"]))); (((THENL) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`m < k:num`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [((DISCH_THEN (fun snd_th -> (use_arg_then2 ("h", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ALL_TAC]) THEN ((TRY done_tac))); ((((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LE_LT", [LE_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_mk", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("orbF", [orbF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("h", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_LT_LE", [REAL_LT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_POS_LE", [DIST_POS_LE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("uniq_l", [])) (fun fst_arg -> (use_arg_then2 ("m_lt_k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("contra", [contra])) (disch_tac [])) THEN (clear_assumption "contra") THEN (DISCH_THEN apply_tac)); (((((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_EQ_0", [DIST_EQ_0]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma uniq_open *) let uniq_open = Sections.section_proof ["l"] `uniq l ==> ?e. &0 < e /\ (!s. sizel s = sizel l /\ (!i. i < sizel l ==> dist (EL i s, EL i l) < e) ==> uniq s)` [ ((BETA_TAC THEN (move ["uniq_l"])) THEN (((use_arg_then2 ("uniq_l", [])) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("uniq_min_distP", [uniq_min_distP]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_term (`sizel l < 2`))) (disch_eq_tac "size_ge" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); (((fun arg_tac -> arg_tac (Arg_term (`&1`))) (term_tac exists_tac)) THEN (((((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["s"]) THEN (case THEN (move ["size_eq"])) THEN (move ["_"]))); (((((use_arg_then2 ("uniq_small_size", [uniq_small_size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((in_tac ["size_ge"] false (((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] []))))) THEN (BETA_TAC THEN (move ["h"]))); ((fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. min_dist_k i l) (sizel l)`))) (term_tac (set_tac "r"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`sizel r = sizel l`))) (term_tac (have_gen_tac [](move ["size_r"])))) (((((use_arg_then2 ("r_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((fun arg_tac -> arg_tac (Arg_term (`min_k 0 r / &2`))) (term_tac exists_tac)) THEN ((THENL) (split_tac) [ALL_TAC; ((move ["s"]) THEN (case THEN ((move ["size_eq"]) THEN (move ["dist_lt"]))))])); ((THENL_FIRST) ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("mem_min_k", [mem_min_k])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("r", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)) (((((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_r", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_ge", [])) (disch_tac [])) THEN (clear_assumption "size_ge") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((BETA_TAC THEN (move ["mem_r"])) THEN ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("nth_index", [nth_index])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("mem_r", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("r_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 0 10 (((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_r", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("index_mem", [index_mem]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (arith_tac) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("uniq_nthP", [uniq_nthP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (move ["i"]) THEN (move ["j"]) THEN (case THEN ((move ["i_lt_j"]) THEN (move ["j_lt"])))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`i < sizel s`))) (term_tac (have_gen_tac [](move ["i_lt"])))) ((((use_arg_then2 ("i_lt_j", [])) (disch_tac [])) THEN (clear_assumption "i_lt_j") THEN ((use_arg_then2 ("j_lt", [])) (disch_tac [])) THEN (clear_assumption "j_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DIST_LE_0", [DIST_LE_0]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] []))))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`min_k 0 r <= dist (EL i l, EL j l)`))) (term_tac (have_gen_tac []ALL_TAC)))); (in_tac ["dist_lt"] false (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL i l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL i s`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL j l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL i s`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL j s`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL j l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((((fun arg_tac -> (use_arg_then2 ("dist_lt", [])) (fun fst_arg -> (use_arg_then2 ("j_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (use_arg_then2 ("dist_lt", [])) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k j l`))) (term_tac exists_tac))); ((THENL_FIRST) ((((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))) ((((use_arg_then2 ("i_lt_j", [])) (disch_tac [])) THEN (clear_assumption "i_lt_j") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((use_arg_then2 ("r_def", [])) (disch_tac [])) THEN (clear_assumption "r_def") THEN (DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("f_equal", [f_equal])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\x. nth (&0) x j`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC); (((((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("BETA_THM", [BETA_THM]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_r", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("min_k0_le_EL", [min_k0_le_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_r", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ];; (* Lemma uniq_real_open *) let uniq_real_open = Sections.section_proof ["l"] `uniq l ==> ?e. &0 < e /\ (!s. sizel s = sizel l /\ (!i. i < sizel l ==> abs (EL i s - EL i l) < e) ==> uniq s)` [ ((repeat_tactic 1 9 (((use_arg_then2 ("uniq_lift", [uniq_lift]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("uniq_open", [uniq_open])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (case THEN (move ["e"])) THEN (case THEN (move ["e_gt0"])) THEN (move ["h"])); (((use_arg_then2 ("e", [])) (term_tac exists_tac)) THEN (((((use_arg_then2 ("e_gt0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_LIFT", [DIST_LIFT]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["s"]) THEN (case THEN (move ["size_eq"])) THEN (move ["dist_lt"]))); ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN (DISCH_THEN apply_tac)) THEN (((repeat_tactic 1 9 (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"]))); (((repeat_tactic 1 9 (((use_arg_then2 ("EL_map", [EL_map]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dist_lt", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Finalization of the section MoreMinK *) let min_k_continuous = Sections.finalize_theorem min_k_continuous;; let min_k_limit = Sections.finalize_theorem min_k_limit;; let min_dist_k_limit = Sections.finalize_theorem min_dist_k_limit;; let min_dist_min = Sections.finalize_theorem min_dist_min;; let min_dist_exists = Sections.finalize_theorem min_dist_exists;; let min_distP = Sections.finalize_theorem min_distP;; let min_dist_imp_packing = Sections.finalize_theorem min_dist_imp_packing;; let packing_eq_min_dist = Sections.finalize_theorem packing_eq_min_dist;; let min_dist_imp_uniq = Sections.finalize_theorem min_dist_imp_uniq;; let uniq_min_distP = Sections.finalize_theorem uniq_min_distP;; let uniq_open = Sections.finalize_theorem uniq_open;; let uniq_real_open = Sections.finalize_theorem uniq_real_open;; Sections.end_section "MoreMinK";; (* Section MoreSortedReal *) Sections.begin_section "MoreSortedReal";; (* Lemma real_sorted_lt2 *) let real_sorted_lt2 = Sections.section_proof ["l";"l'";"s";"s'";"r"] `sorted (<=) s l /\ sorted (<=) s' l' /\ sizel l' = sizel l /\ r < sizel l /\ EL r l < EL r l' /\ (!i. i < sizel l /\ EL i l <= EL r l ==> EL i l <= EL i l') /\ (!i. i < sizel l /\ EL r l < EL i l ==> EL r l < EL i l') ==> ?k. k < sizel l /\ (!i. i < k ==> EL i s = EL i s') /\ EL k s < EL k s'` [ (BETA_TAC THEN (case THEN (move ["sort_s"])) THEN (case THEN (move ["sort_s'"])) THEN (case THEN (move ["size_eq"])) THEN (case THEN (move ["r_lt"])) THEN (case THEN (move ["el_r_lt"])) THEN (case THEN (move ["el_le"])) THEN (move ["el_gt"])); ((((use_arg_then2 ("sort_s'", [])) (disch_tac [])) THEN ((use_arg_then2 ("sort_s", [])) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("sorted", [sorted]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN ((move ["ord_s"]) THEN (move ["perm_s"]))) THEN (case THEN ((move ["ord_s'"]) THEN (move ["perm_s'"]))))); (((fun arg_tac -> arg_tac (Arg_term (`sizel l`))) (term_tac (set_tac "n"))) THEN ((fun arg_tac -> arg_tac (Arg_term (`EL r l`))) (term_tac (set_tac "u")))); ((fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. if EL i l <= u then EL i l else u) n`))) (term_tac (set_tac "m"))); ((fun arg_tac -> arg_tac (Arg_term (`merge_sort (<=) m`))) (term_tac (set_tac "t"))); ((((fun arg_tac -> (use_arg_then2 ("real_merge_sort", [real_merge_sort])) (fun fst_arg -> (use_arg_then2 ("m", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("t_def", []))(thm_tac (new_rewrite [] [])))) THEN (move ["sort_t"]))); ((fun arg_tac -> arg_tac (Arg_term (`sizel t = n /\ sizel m = n /\ sizel s' = n /\ sizel l' = n /\ sizel s = n`))) (term_tac (have_gen_tac [](move ["sizes"])))); (((((fun arg_tac -> (use_arg_then2 ("sorted_size", [sorted_size])) (fun fst_arg -> (use_arg_then2 ("sort_t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("sorted_size", [sorted_size])) (fun fst_arg -> (use_arg_then2 ("sort_s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("sorted_size", [sorted_size])) (fun fst_arg -> (use_arg_then2 ("sort_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("real_sorted_lt", [real_sorted_lt])) (fun fst_arg -> (use_arg_then2 ("sort_t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("sort_s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)) THEN (ANTS_TAC)); ((THENL_ROT (-1)) (((repeat_tactic 1 9 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (split_tac))); (((use_arg_then2 ("r", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("r_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)))); (((((use_arg_then2 ("u_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((BETA_TAC THEN (move ["i"]) THEN (move ["i_lt"])) THEN ((((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)))); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`EL i l <= u`))) (disch_eq_tac "neq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) ((((use_arg_then2 ("el_le", [])) (disch_tac [])) THEN (clear_assumption "el_le") THEN (exact_tac)) THEN (done_tac))); (((((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("el_gt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (move ["k"])) THEN (case THEN (move ["k_lt"])) THEN (case THEN (move ["el_eq"])) THEN (move ["el_k_lt"])); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("perm_eq_filter", [perm_eq_filter])) (fun fst_arg -> (use_arg_then2 ("perm_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\x. x <= u`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["perm_l0"]))); ((fun arg_tac -> arg_tac (Arg_term (`\x. x <= u`))) (term_tac (set_tac "a"))); ((fun arg_tac -> arg_tac (Arg_term (`filter a l`))) (term_tac (set_tac "l0"))); ((fun arg_tac -> arg_tac (Arg_term (`sizel l0`))) (term_tac (set_tac "n0"))); ((fun arg_tac -> arg_tac (Arg_term (`n0 <= n:num`))) (term_tac (have_gen_tac [](move ["n0_le"])))); (((((use_arg_then2 ("n0_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("l0_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("count_filter", [count_filter]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("n_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("count_size", [count_size]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`filter a s = take n0 s`))) (term_tac (have_gen_tac [](move ["take_eq"])))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ordered_cat_filter", [ordered_cat_filter])) (fun fst_arg -> (use_arg_then2 ("ord_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("u", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("f_equal", [f_equal])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`take n0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("a_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("take_size_cat", [take_size_cat]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("count_filter", [count_filter]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("iffLR", [iffLR])) (fun fst_arg -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("perm_eqP", [perm_eqP])) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("l", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("perm_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("count_filter", [count_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("l0_def", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`perm_eq l (l0 ++ filter (predC a) l)`))) (term_tac (have_gen_tac []ALL_TAC))); (((((use_arg_then2 ("perm_eq_sym", [perm_eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("l0_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("perm_filterC", [perm_filterC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("perm_eq_refl", [perm_eq_refl]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("perm_eq_bij", [perm_eq_bij])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC) THEN ((((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (move ["p"])) THEN (case THEN (move ["p_perm"])) THEN (move ["nth_eq"]))); ((fun arg_tac -> arg_tac (Arg_term (` i < n ==> p i < n:num`))) (term_tac (have_gen_tac ["i"](move ["p_lt"])))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("PERMUTES_IN_IMAGE", [PERMUTES_IN_IMAGE])) (fun fst_arg -> (use_arg_then2 ("p_perm", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`take n0 s = take n0 t`))) (term_tac (have_gen_tac [](move ["st_eq"])))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`perm_eq m (l0 ++ nseq (n - n0) u)`))) (term_tac (have_gen_tac [](move ["perm_m"]))))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ordered_cat_filter", [ordered_cat_filter])) (fun fst_arg -> (use_arg_then2 ("ord_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("u", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("sort_t", [])) (disch_tac [])) THEN (clear_assumption "sort_t") THEN BETA_TAC) THEN ((((use_arg_then2 ("sorted", [sorted]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN ((move ["ord_t"]) THEN (move ["perm_t"]))))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`t = filter a s ++ nseq (n - n0) u`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))); (((repeat_tactic 1 9 (((use_arg_then2 ("take_size_cat", [take_size_cat]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("take_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_takel", [size_takel]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> arg_tac (Arg_term (`_1 ++ _2`))) (term_tac (set_tac "t2"))) THEN ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ordered_eq", [ordered_eq])) (fun fst_arg -> (use_arg_then2 ("ord_t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("t2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)))); (((THENL) (split_tac) [((move ["x"]) THEN (move ["y"])); ALL_TAC]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("REAL_LE_ANTISYM", [REAL_LE_ANTISYM]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("t2_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (split_tac)); (((use_arg_then2 ("perm_eq_trans", [perm_eq_trans])) (thm_tac apply_tac)) THEN ((use_arg_then2 ("m", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("perm_t", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (use_arg_then2 ("perm_eq_trans", [perm_eq_trans])) (fun fst_arg -> (use_arg_then2 ("perm_m", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("perm_eq_cat", [perm_eq_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("perm_eq_refl", [perm_eq_refl]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("perm_eq_sym", [perm_eq_sym]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("ordered_cat", [ordered_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ordered_filter", [ordered_filter]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("ordered_real_nseq", [ordered_real_nseq]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("allP", [allP]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (simp_tac)); (((((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("mem_nseq", [mem_nseq]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("perm_eq_permutesP", [perm_eq_permutesP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_cat", [size_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_nseq", [size_nseq]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("subnKC", [subnKC])) (fun fst_arg -> (use_arg_then2 ("n0_le", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); (((use_arg_then2 ("p", [])) (term_tac exists_tac)) THEN (((((use_arg_then2 ("p_perm", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"])) THEN (((fun arg_tac -> (use_arg_then2 ("nth_eq", [])) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC)); (((fun arg_tac -> arg_tac (Arg_term (`i < n0:num`))) (disch_eq_tac "i_n0" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); (((repeat_tactic 1 9 (((use_arg_then2 ("nth_cat", [nth_cat]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_n0", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (repeat_tactic 1 9 (((use_arg_then2 ("COND_CLAUSES", [COND_CLAUSES]))(thm_tac (new_rewrite [] [])))))) THEN (move ["eq"])); ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac)) THEN (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("i_n0", [])) (disch_tac [])) THEN (clear_assumption "i_n0") THEN BETA_TAC) THEN ((((use_arg_then2 ("n0_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("mem_nth", [mem_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))))); (((((use_arg_then2 ("l0_def", []))(gsym_then (thm_tac (new_rewrite [2] []))))) THEN (((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (done_tac)); ((repeat_tactic 1 9 (((use_arg_then2 ("nth_cat", [nth_cat]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_n0", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (repeat_tactic 1 9 (((use_arg_then2 ("COND_CLAUSES", [COND_CLAUSES]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("nth_nseq", [nth_nseq]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ltn_sub2r", [ltn_sub2r]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN ((use_arg_then2 ("i_n0", [])) (disch_tac [])) THEN (clear_assumption "i_n0") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("m_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["eq"])); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("mem_nth", [mem_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`i - n0:num`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`filter (predC a) l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("count_filter", [count_filter]))(gsym_then (thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("count_predC", [count_predC])) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("l", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("count_filter", [count_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("l0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] [])))))); (((((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `!x. n0 <= n:num ==> (n0 + x = n <=> x = n - n0)`)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((((use_arg_then2 ("ltn_sub2r", [ltn_sub2r]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) ((((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN ((use_arg_then2 ("i_n0", [])) (disch_tac [])) THEN (clear_assumption "i_n0") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (done_tac)); (((use_arg_then2 ("k", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`k < n0:num`))) (term_tac (have_gen_tac [](move ["k_lt_n0"]))))); (((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("EL_take", [EL_take])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("st_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EL_take", [EL_take]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("el_k_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_lt"])); (((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("EL_take", [EL_take])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("EL_take", [EL_take])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("st_eq", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("EL_take", [EL_take]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))))) THEN (TRY (((((use_arg_then2 ("k_lt", [])) (disch_tac [])) THEN (clear_assumption "k_lt") THEN ((use_arg_then2 ("k_lt_n0", [])) (disch_tac [])) THEN (clear_assumption "k_lt_n0") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac))))); ((((use_arg_then2 ("el_eq", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (move ["n0_le_k"]))); ((fun arg_tac -> arg_tac (Arg_term (`count (predC a) s' <= n - n0`))) (term_tac (have_gen_tac []ALL_TAC))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("cat_take_drop", [cat_take_drop])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("count_cat", [count_cat]))(thm_tac (new_rewrite [] []))))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`count (predC a) (take n0 s') = 0`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))); ((((use_arg_then2 ("add0n", [add0n]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq_trans", [leq_trans])) (disch_tac [])) THEN (clear_assumption "leq_trans") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`sizel (dropl n0 s')`))) (term_tac exists_tac))); (((((use_arg_then2 ("count_size", [count_size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_drop", [size_drop]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leqnn", [leqnn]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("count0", [count0]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("ETA_AX", [ETA_AX]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("all_EL_P", [all_EL_P]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_takel", [size_takel]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["i"]) THEN (move ["i_lt"])); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`i < n:num /\ i < k`))) (term_tac (have_gen_tac [](move ["i_lt2"])))) ((((use_arg_then2 ("n0_le_k", [])) (disch_tac [])) THEN (clear_assumption "n0_le_k") THEN ((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("EL_take", [EL_take]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("el_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((fun arg_tac -> (use_arg_then2 ("EL_take", [EL_take])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("st_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EL_take", [EL_take]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`EL i s <- filter a s`))) (term_tac (have_gen_tac []ALL_TAC)))) (((((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((((use_arg_then2 ("take_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("EL_take", [EL_take])) (fun fst_arg -> (use_arg_then2 ("n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_takel", [size_takel]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`count (predC a) l' >= (n - n0) + 1`))) (term_tac (have_gen_tac []ALL_TAC)))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("iffLR", [iffLR])) (fun fst_arg -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("perm_eqP", [perm_eqP])) (fun fst_arg -> (use_arg_then2 ("s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("l'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("perm_s'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("REAL_OF_NUM_GE", [REAL_OF_NUM_GE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("count_eq_list_sum_iota", [count_eq_list_sum_iota])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> (use_arg_then2 ("permutes_imp_perm_eq_iota", [permutes_imp_perm_eq_iota])) (fun fst_arg -> (use_arg_then2 ("p_perm", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((THENL_FIRST) ((((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `0 < n ==> n - 1 + 1 = n`)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] [])))))) ((((use_arg_then2 ("k_lt", [])) (disch_tac [])) THEN (clear_assumption "k_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((DISCH_THEN (fun snd_th -> (use_arg_then2 ("list_sum_perm_eq", [list_sum_perm_eq])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (use_arg_then2 ("list_sum_nth", [list_sum_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("subnKC", [subnKC])) (fun fst_arg -> (use_arg_then2 ("n0_le", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("iota_add", [iota_add]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("list_sum_cat", [list_sum_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("add0n", [add0n]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_term (`list_sum _1 _2`))) (term_tac (set_tac "s1"))) THEN ((fun arg_tac -> arg_tac (Arg_term (`list_sum _1 _2`))) (term_tac (set_tac "s2")))); ((fun arg_tac -> arg_tac (Arg_term (`sizel (filter (predC a) l) = n - n0`))) (term_tac (have_gen_tac [](move ["C_size"])))); ((((use_arg_then2 ("count_filter", [count_filter]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("count_predC", [count_predC])) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("l", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC)); (((((use_arg_then2 ("count_filter", [count_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("l0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`s2 = &(n - n0)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((((use_arg_then2 ("C_size", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("count_predT", [count_predT]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("count_eq_list_sum_iota", [count_eq_list_sum_iota])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("C_size", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("predT", [predT]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("s2_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("list_sum_nth_eq", [list_sum_nth_eq])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac apply_tac)); (((repeat_tactic 1 9 (((use_arg_then2 ("size_iota", [size_iota]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"])); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`n0 + i < n:num`))) (term_tac (have_gen_tac [](move ["n0i"])))) ((((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("nth_iota", [nth_iota]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); ((((fun arg_tac -> (use_arg_then2 ("nth_eq", [])) (fun fst_arg -> (use_arg_then2 ("n0i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("nth_cat", [nth_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `~(n0 + i < n0:num)`)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("addKn", [addKn]))(thm_tac (new_rewrite [] []))))) THEN (move ["eq"]))); (((fun arg_tac -> (use_arg_then2 ("el_gt", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`p (n0 + i:num)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sizes", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("mem_nth", [mem_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`filter (predC a) l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("C_size", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); ((((((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("p_lt", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`s1 >= &1`))) (term_tac (have_gen_tac []ALL_TAC)))); (((((use_arg_then2 ("REAL_OF_NUM_ADD", [REAL_OF_NUM_ADD]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("REAL_OF_NUM_SUB", [REAL_OF_NUM_SUB])) (fun fst_arg -> (use_arg_then2 ("n0_le", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (arith_tac) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`?i:num. p i = r /\ i < n0`))) (term_tac (have_gen_tac []ALL_TAC)))); (BETA_TAC THEN (case THEN (move ["i"])) THEN (case THEN ((move ["pi_eq"]) THEN (move ["i_lt"])))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("count_uniq_mem", [count_uniq_mem])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`iota 0 n0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("iota_uniq", [iota_uniq]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("mem_iota", [mem_iota]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("add0n", [add0n]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); ((BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((((fun arg_tac -> (use_arg_then2 ("count_eq_list_sum_iota", [count_eq_list_sum_iota])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_iota", [size_iota]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_ge", [real_ge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s1_def", []))(gsym_then (thm_tac (new_rewrite [] []))))))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("list_sum_nth_le2", [list_sum_nth_le2])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac apply_tac)) THEN (((((use_arg_then2 ("size_iota", [size_iota]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["j"]) THEN (move ["j_lt"]))); ((repeat_tactic 1 9 (((use_arg_then2 ("nth_iota", [nth_iota]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("add0n", [add0n]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("pred1", [pred1]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((THENL_LAST) (((fun arg_tac -> arg_tac (Arg_term (`j = i`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) ((arith_tac) THEN (done_tac))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`i < n:num`))) (term_tac (have_gen_tac [](move ["i_lt_n"])))) ((((use_arg_then2 ("n0_le", [])) (disch_tac [])) THEN (clear_assumption "n0_le") THEN ((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("nth_mkseq", [nth_mkseq]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("pi_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("el_r_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("PERMUTES_SURJECTIVE", [PERMUTES_SURJECTIVE])) (fun fst_arg -> (use_arg_then2 ("p_perm", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("r", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["i"])) THEN (move ["pi_eq"])); (((use_arg_then2 ("i", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("pi_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (move ["n0_le_i"]))); ((fun arg_tac -> arg_tac (Arg_term (`i < n:num`))) (term_tac (have_gen_tac [](move ["i_lt"])))); (((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac) THEN (move ["not_lt"])); ((((use_arg_then2 ("p_perm", [])) (disch_tac [])) THEN (clear_assumption "p_perm") THEN BETA_TAC) THEN ((((use_arg_then2 ("permutes", [permutes]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC))))); ((THENL_FIRST) (((((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("NOT_LE", [NOT_LE]))(thm_tac (new_rewrite [] []))))) THEN (ANTS_TAC)) ((((use_arg_then2 ("r_lt", [])) (disch_tac [])) THEN (clear_assumption "r_lt") THEN ((use_arg_then2 ("not_lt", [])) (disch_tac [])) THEN (clear_assumption "not_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("pi_eq", []))(thm_tac (new_rewrite [] [])))) THEN (move ["eq"])) THEN (((use_arg_then2 ("not_lt", [])) (disch_tac [])) THEN (clear_assumption "not_lt") THEN BETA_TAC) THEN ((((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("r_lt", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("nth_eq", [])) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("pi_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("u_def", []))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("nth_cat", [nth_cat]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n0_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_LE", [NOT_LE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("n0_le_i", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("mem_nth", [mem_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`filter (predC a) l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`i - n0:num`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)); ((((use_arg_then2 ("C_size", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", [])) (disch_tac [])) THEN (clear_assumption "i_lt") THEN ((use_arg_then2 ("n0_le_i", [])) (disch_tac [])) THEN (clear_assumption "n0_le_i") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Finalization of the section MoreSortedReal *) let real_sorted_lt2 = Sections.finalize_theorem real_sorted_lt2;; Sections.end_section "MoreSortedReal";; (* Section SomeResults *) Sections.begin_section "SomeResults";; (* Lemma packing_empty *) let packing_empty = Sections.section_proof [] `packing {}` [ (((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL Sphere.packing_lt)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma in_ball_annulus *) let in_ball_annulus = Sections.section_proof ["v"] `v IN ball_annulus <=> &2 <= norm v /\ norm v <= &2 * h0` [ ((((use_arg_then2 ("Pack_defs.ball_annulus", [Pack_defs.ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_CBALL", [IN_CBALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_BALL", [IN_BALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))); (((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL VECTOR_SUB_RZERO)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CONJ_SYM", [CONJ_SYM]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma closed_ball_annulus *) let closed_ball_annulus = Sections.section_proof [] `closed ball_annulus` [ (((((use_arg_then2 ("Pack_defs.ball_annulus", [Pack_defs.ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CLOSED_DIFF", [CLOSED_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("OPEN_BALL", [OPEN_BALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CLOSED_CBALL", [CLOSED_CBALL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma finite_packing_ball_annulus *) let finite_packing_ball_annulus = Sections.section_proof ["V"] `packing V /\ V SUBSET ball_annulus ==> FINITE V` [ (BETA_TAC THEN (case THEN ((move ["pack"]) THEN (move ["subV"])))); ((fun arg_tac -> arg_tac (Arg_term (`?r. V SUBSET ball(vec 0, r)`))) (term_tac (have_gen_tac [](case THEN (move ["r"]))))); (((fun arg_tac -> arg_tac (Arg_term (`&5`))) (term_tac exists_tac)) THEN (((use_arg_then2 ("subV", [])) (disch_tac [])) THEN (clear_assumption "subV") THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Pack_defs.ball_annulus", [Pack_defs.ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_CBALL", [IN_CBALL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_BALL", [IN_BALL]))(thm_tac (new_rewrite [] []))))))); ((BETA_TAC THEN (move ["h"]) THEN (move ["x"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("h", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (((use_arg_then2 ("Pack_defs.h0", [Pack_defs.h0]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("SUBSET_INTER_ABSORPTION", [SUBSET_INTER_ABSORPTION]))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))); (((use_arg_then2 ("Packing3.KIUMVTC", [Packing3.KIUMVTC])) (disch_tac [])) THEN (clear_assumption "Packing3.KIUMVTC") THEN (exact_tac)); ];; (* Lemma ECTC_sub_ESTD *) let ECTC_sub_ESTD = Sections.section_proof ["V"] `ECTC V SUBSET ESTD V` [ (((((use_arg_then2 ("ECTC", [ECTC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ESTD", [ESTD]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["x"]) THEN (case THEN (move ["v"])) THEN (case THEN (move ["w"])) THEN (case THEN (move ["h"])) THEN (move ["x_eq"])); ((((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("w", [])) (term_tac exists_tac))) THEN ((((use_arg_then2 ("x_eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma in_set_of_edge_ECTC *) let in_set_of_edge_ECTC = Sections.section_proof ["V";"v"] `v IN V ==> (!u. u IN set_of_edge v V (ECTC V) <=> u IN V /\ dist (u, v) = &2)` [ (((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ECTC", [ECTC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["vV"]) THEN (move ["u"])); ((THENL_ROT (-1)) (((THENL) (split_tac) [((case THEN ALL_TAC) THEN (case THEN (move ["x"])) THEN (case THEN (move ["y"])) THEN (case THEN (move ["h"])) THEN (move ["eq"]) THEN (move ["uV"])); (case THEN ((move ["uV"]) THEN (move ["d_eq"])))]) THEN ((((use_arg_then2 ("uV", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac ->(use_arg_then2 ("andTb", [andTb]))(fun tmp_arg1 -> (use_arg_then2 ("andbT", [andbT]))(fun tmp_arg2 -> arg_tac (Arg_theorem (CONJ (get_arg_thm tmp_arg1) (get_arg_thm tmp_arg2))))))(thm_tac (new_rewrite [] []))))))); ((THENL_LAST) ((((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("u", [])) (term_tac exists_tac))) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))) ((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); ((((use_arg_then2 ("d_eq", [])) (disch_tac [])) THEN (clear_assumption "d_eq") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); (in_tac ["eq"] false (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL Collect_geom.PAIR_EQ_EXPAND)))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("eq", [])) (disch_tac [])) THEN (clear_assumption "eq") THEN BETA_TAC THEN (case THEN ALL_TAC) THEN (case THEN ((((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac))) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma vector_eq_neg *) let vector_eq_neg = Sections.section_proof ["v"] `(v:real^N = --v) <=> (v = vec 0)` [ (VECTOR_ARITH_TAC); ];; (* Lemma bij_scriptL *) let bij_scriptL = Sections.section_proof ["f";"V";"W"] `BIJ f V W /\ (!v. v IN V ==> norm v = norm (f v)) ==> scriptL W = scriptL V` [ (((((use_arg_then2 ("BIJ", [BIJ]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("INJ", [INJ]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (case THEN ((case THEN ((move ["_"]) THEN (move ["inj_f"]))) THEN (move ["surj_f"])))) THEN (move ["norm_eq"])); ((repeat_tactic 1 9 (((use_arg_then2 ("Tame_defs.scriptL", [Tame_defs.scriptL]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("Hypermap_iso.surj_image", [Hypermap_iso.surj_image])) (fun fst_arg -> (use_arg_then2 ("surj_f", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_IMAGE", [SUM_IMAGE]))(thm_tac (new_rewrite [] []))))); ((BETA_TAC THEN (move ["x"]) THEN (move ["y"]) THEN (case THEN (move ["x_in"])) THEN (case THEN (move ["y_in"])) THEN (move ["f_eq"])) THEN (((use_arg_then2 ("inj_f", [])) (disch_tac [])) THEN (clear_assumption "inj_f") THEN (DISCH_THEN apply_tac)) THEN (done_tac)); ((((use_arg_then2 ("SUM_EQ", [SUM_EQ])) (thm_tac apply_tac)) THEN (move ["v"]) THEN (move ["v_in"]) THEN (simp_tac)) THEN ((((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("norm_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ];; (* Lemma lmfun_ge0 *) let lmfun_ge0 = Sections.section_proof ["h"] `&0 <= lmfun h` [ (((((use_arg_then2 ("Sphere.lmfun", [Sphere.lmfun]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma lmfun_in_ball_annulus *) let lmfun_in_ball_annulus = Sections.section_proof ["v"] `v IN ball_annulus ==> lmfun (norm v / &2) <= &1` [ (((((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.lmfun", [Sphere.lmfun]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma scriptL_le_card *) let scriptL_le_card = Sections.section_proof ["V"] `packing V /\ V SUBSET ball_annulus ==> scriptL V <= &(CARD V)` [ ((BETA_TAC THEN (case THEN ((move ["packV"]) THEN (move ["subV"])))) THEN (((fun arg_tac -> (use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&(CARD V)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("Tame_defs.scriptL", [Tame_defs.scriptL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUM_BOUND", [SUM_BOUND]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["v"]) THEN (move ["vV"]) THEN (simp_tac)); ((((use_arg_then2 ("lmfun_in_ball_annulus", [lmfun_in_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("subV", [])) (disch_tac [])) THEN (clear_assumption "subV") THEN BETA_TAC) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (DISCH_THEN apply_tac) THEN (done_tac)); ];; (* Lemma card_counterexample_ge13 *) let card_counterexample_ge13 = Sections.section_proof ["V"] `packing V /\ V SUBSET ball_annulus /\ scriptL V > &12 ==> 13 <= CARD V` [ (BETA_TAC THEN (case THEN (move ["packV"])) THEN (case THEN (move ["subV"]))); ((((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac)) THEN (((((use_arg_then2 ("NOT_LE", [NOT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_gt", [real_gt]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(thm_tac (new_rewrite [] []))))) THEN (move ["card_lt"]))); ((((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`&(CARD V)`))) (term_tac exists_tac))); (((((use_arg_then2 ("scriptL_le_card", [scriptL_le_card]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_OF_NUM_LE", [REAL_OF_NUM_LE]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("card_lt", [])) (disch_tac [])) THEN (clear_assumption "card_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma piecewise_real_continuous *) let piecewise_real_continuous = Sections.section_proof ["a";"b";"t";"f1";"f2";"f"] `f1 real_continuous_on (real_interval [a,t]) /\ f2 real_continuous_on (real_interval [t,b]) /\ f1 t = f2 t /\ f = (\x. if x <= t then f1 x else f2 x) ==> f real_continuous_on (real_interval [a,b])` [ (((repeat_tactic 1 9 (((use_arg_then2 ("real_continuous_on", [real_continuous_on]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_REAL_INTERVAL", [IN_REAL_INTERVAL]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["f1_cont"])) THEN (case THEN (move ["f2_cont"])) THEN (case THEN (move ["f12_eq"])) THEN (move ["f_eq"]) THEN (move ["x"]) THEN (move ["e"]) THEN (case THEN ((move ["x_in"]) THEN (move ["e_gt0"])))); ((THENL) (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `x < t \/ t < x \/ x = t`))) (disch_tac [])) THEN case) [(move ["h"]); ALL_TAC]); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f1_cont", [])) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE])) (fun fst_arg -> (use_arg_then2 ("h", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("x_in", []))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac))) THEN ALL_TAC THEN (case THEN (move ["d"])) THEN (case THEN (move ["d_gt0"])) THEN (move ["ineq"]))); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`min d (t - x)`))) (term_tac exists_tac)) THEN (split_tac)) ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN ((use_arg_then2 ("d_gt0", [])) (disch_tac [])) THEN (clear_assumption "d_gt0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (BETA_TAC THEN (move ["y"]) THEN (case THEN ((move ["y_ineq"]) THEN (move ["xy_lt"])))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`y < t`))) (term_tac (have_gen_tac [](move ["y_lt"])))) ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN ((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("f_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("ineq", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN ((use_arg_then2 ("y_lt", [])) (disch_tac [])) THEN (clear_assumption "y_lt") THEN ((use_arg_then2 ("y_ineq", [])) (disch_tac [])) THEN (clear_assumption "y_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (case THEN (move ["h"])); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f2_cont", [])) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE])) (fun fst_arg -> (use_arg_then2 ("h", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("x_in", []))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac))) THEN ALL_TAC THEN (case THEN (move ["d"])) THEN (case THEN (move ["d_gt0"])) THEN (move ["ineq"]))); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`min d (x - t)`))) (term_tac exists_tac)) THEN (split_tac)) ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN ((use_arg_then2 ("d_gt0", [])) (disch_tac [])) THEN (clear_assumption "d_gt0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (BETA_TAC THEN (move ["y"]) THEN (case THEN ((move ["y_ineq"]) THEN (move ["xy_lt"])))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`t < y`))) (term_tac (have_gen_tac [](move ["y_lt"])))) ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN ((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("f_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("y_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("ineq", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN ((use_arg_then2 ("y_lt", [])) (disch_tac [])) THEN (clear_assumption "y_lt") THEN ((use_arg_then2 ("y_ineq", [])) (disch_tac [])) THEN (clear_assumption "y_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f2_cont", [])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("f1_cont", [])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("h", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("x_in", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac))); (BETA_TAC THEN (case THEN (move ["d1"])) THEN (case THEN (move ["d1_gt0"])) THEN (move ["ineq1"]) THEN (case THEN (move ["d2"])) THEN (case THEN (move ["d2_gt0"])) THEN (move ["ineq2"])); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`min d1 d2`))) (term_tac exists_tac)) THEN (split_tac)) ((((use_arg_then2 ("d2_gt0", [])) (disch_tac [])) THEN (clear_assumption "d2_gt0") THEN ((use_arg_then2 ("d1_gt0", [])) (disch_tac [])) THEN (clear_assumption "d1_gt0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (BETA_TAC THEN (move ["y"]) THEN (case THEN ((move ["y_ineq"]) THEN (move ["xy_lt"])))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("REAL_LET_TOTAL", [REAL_LET_TOTAL])) (fun fst_arg -> (use_arg_then2 ("y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case THEN (move ["xy_ineq"])); (((((use_arg_then2 ("f_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("h", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("xy_ineq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("ineq1", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("xy_ineq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("y_ineq", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("f_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("h", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("xy_ineq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("f12_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("h", []))(gsym_then (thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("ineq2", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("xy_lt", [])) (disch_tac [])) THEN (clear_assumption "xy_lt") THEN ((use_arg_then2 ("y_ineq", [])) (disch_tac [])) THEN (clear_assumption "y_ineq") THEN ((use_arg_then2 ("xy_ineq", [])) (disch_tac [])) THEN (clear_assumption "xy_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma piecewise_real_continuous_univ *) let piecewise_real_continuous_univ = Sections.section_proof ["t";"f1";"f2";"f"] `f1 real_continuous_on UNIV /\ f2 real_continuous_on UNIV /\ f1 t = f2 t /\ f = (\x. if x <= t then f1 x else f2 x) ==> f real_continuous_on UNIV` [ (BETA_TAC THEN (case THEN (move ["f1_cont"])) THEN (case THEN (move ["f2_con"])) THEN (case THEN (move ["f12_eq"])) THEN (move ["f_eq"])); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`!a b. f real_continuous_on real_interval (a,b)`))) (term_tac (have_gen_tac [](move ["cont_int"]))))); (((((use_arg_then2 ("REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT", [REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_OPEN_UNIV", [REAL_OPEN_UNIV]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["x"]) THEN (move ["_"])); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("cont_int", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`x - &1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`x + &1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((((use_arg_then2 ("REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT", [REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_OPEN_REAL_INTERVAL", [REAL_OPEN_REAL_INTERVAL]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (DISCH_THEN apply_tac)); ((((use_arg_then2 ("IN_REAL_INTERVAL", [IN_REAL_INTERVAL]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((BETA_TAC THEN (move ["a"]) THEN (move ["b"])) THEN (((use_arg_then2 ("REAL_CONTINUOUS_ON_SUBSET", [REAL_CONTINUOUS_ON_SUBSET])) (disch_tac [])) THEN (clear_assumption "REAL_CONTINUOUS_ON_SUBSET") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`real_interval [a,b]`))) (term_tac exists_tac))); ((((use_arg_then2 ("REAL_INTERVAL_OPEN_SUBSET_CLOSED", [REAL_INTERVAL_OPEN_SUBSET_CLOSED]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("piecewise_real_continuous", [piecewise_real_continuous])) (fun fst_arg -> (use_arg_then2 ("f_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("f12_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); ((split_tac) THEN ((((fun arg_tac -> (use_arg_then2 ("REAL_CONTINUOUS_ON_SUBSET", [REAL_CONTINUOUS_ON_SUBSET])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`(:real)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET_UNIV", [SUBSET_UNIV]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma lmfun_continuous *) let lmfun_continuous = Sections.section_proof [] `lmfun real_continuous_on UNIV` [ ((fun arg_tac -> arg_tac (Arg_term (`lmfun = (\x. if x <= h0 then (h0 - x) / (h0 - &1) else &0)`))) (term_tac (have_gen_tac [](move ["eq"])))); (((((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Sphere.lmfun", [Sphere.lmfun]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_ROT (1)) ((((fun arg_tac -> (use_arg_then2 ("piecewise_real_continuous_univ", [piecewise_real_continuous_univ])) (fun fst_arg -> (use_arg_then2 ("eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (split_tac))); ((((use_arg_then2 ("REAL_CONTINUOUS_ON_CONST", [REAL_CONTINUOUS_ON_CONST]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_CONTINUOUS_ON_RMUL", [REAL_CONTINUOUS_ON_RMUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_CONTINUOUS_ON_SUB", [REAL_CONTINUOUS_ON_SUB]))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("REAL_CONTINUOUS_ON_ID", [REAL_CONTINUOUS_ON_ID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_CONTINUOUS_ON_CONST", [REAL_CONTINUOUS_ON_CONST]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma lmfun_norm2_continuous *) let lmfun_norm2_continuous = Sections.section_proof [] `lift o (\v:real^N. lmfun (norm v / &2)) continuous_on UNIV` [ ((((use_arg_then2 ("CONTINUOUS_AT_IMP_CONTINUOUS_ON", [CONTINUOUS_AT_IMP_CONTINUOUS_ON]))(thm_tac (new_rewrite [] [])))) THEN (move ["x"]) THEN (move ["_"])); (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REAL_CONTINUOUS_CONTINUOUS1)))(gsym_then (thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`(\v. lmfun (norm v / &2)) = lmfun o (\v:real^N. norm v / &2)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); (((((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("REAL_CONTINUOUS_AT_COMPOSE", [REAL_CONTINUOUS_AT_COMPOSE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_CONTINUOUS_RMUL", [REAL_CONTINUOUS_RMUL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_CONTINUOUS_NORM_AT", [REAL_CONTINUOUS_NORM_AT]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); (((use_arg_then2 ("REAL_CONTINUOUS_ATREAL_WITHINREAL", [REAL_CONTINUOUS_ATREAL_WITHINREAL]))(thm_tac (new_rewrite [] [])))); ((((use_arg_then2 ("lmfun_continuous", [lmfun_continuous])) (disch_tac [])) THEN (clear_assumption "lmfun_continuous") THEN BETA_TAC) THEN ((((use_arg_then2 ("REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT", [REAL_CONTINUOUS_ON_EQ_REAL_CONTINUOUS_AT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_OPEN_UNIV", [REAL_OPEN_UNIV]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)))); ((DISCH_THEN apply_tac) THEN (((use_arg_then2 ("IN_UNIV", [IN_UNIV]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma simple_card_inequality *) let simple_card_inequality = Sections.section_proof ["r";"s";"t"] `measurable s /\ pairwise DISJOINT t /\ &0 < r /\ (!x. x IN t ==> measurable x /\ r <= measure x /\ x SUBSET s) ==> FINITE t /\ &(CARD t) <= floor (measure s / r)` [ (BETA_TAC THEN (case THEN (move ["vol_s"])) THEN (case THEN (move ["disjoint"])) THEN (case THEN (move ["r_gt0"])) THEN (move ["in_t"])); ((fun arg_tac -> arg_tac (Arg_term (`!b. b SUBSET t /\ FINITE b ==> r * &(CARD b) <= measure (UNIONS b)`))) (term_tac (have_gen_tac [](move ["ineq"])))); ((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (move ["b"]) THEN (case THEN ((move ["b_sub"]) THEN (move ["fin_b"])))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("HAS_MEASURE_DISJOINT_UNIONS", [HAS_MEASURE_DISJOINT_UNIONS])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\x. measure x`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("fin_b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((repeat_tactic 1 9 (((use_arg_then2 ("HAS_MEASURE_MEASURABLE_MEASURE", [HAS_MEASURE_MEASURABLE_MEASURE]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((THENL) (split_tac) [((move ["y"]) THEN (move ["yb"])); ((move ["x"]) THEN (move ["y"]) THEN (move ["in_b"]))]) (((((use_arg_then2 ("in_t", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("b_sub", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((use_arg_then2 ("disjoint", [])) (disch_tac [])) THEN (clear_assumption "disjoint") THEN BETA_TAC) THEN (((use_arg_then2 ("pairwise", [pairwise]))(thm_tac (new_rewrite [] [])))) THEN (DISCH_THEN apply_tac) THEN ((((use_arg_then2 ("in_b", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("b_sub", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((((use_arg_then2 ("CARD_EQ_SUM", [CARD_EQ_SUM]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("SUM_LMUL", [SUM_LMUL]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_LE", [SUM_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("fin_b", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("b_sub", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["xt"]) THEN (simp_tac)); (((((use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_t", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`!b. b SUBSET t /\ FINITE b ==> measure (UNIONS b) <= measure s`))) (term_tac (have_gen_tac [](move ["ineq2"])))); ((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (move ["b"]) THEN (case THEN ((move ["b_sub"]) THEN (move ["fin_b"])))); ((((use_arg_then2 ("MEASURE_SUBSET", [MEASURE_SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vol_s", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEASURABLE_UNIONS", [MEASURABLE_UNIONS]))(thm_tac (new_rewrite [] []))))); ((((((use_arg_then2 ("fin_b", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("b_sub", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["xt"])) THEN (((use_arg_then2 ("in_t", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((((((use_arg_then2 ("UNIONS_SUBSET", [UNIONS_SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("b_sub", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["xt"])) THEN (((use_arg_then2 ("in_t", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`FINITE t`))) (term_tac (have_gen_tac [](move ["fin_t"])))); (((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac) THEN (move ["inf_t"])); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("REAL_ARCH", [REAL_ARCH])) (fun fst_arg -> (use_arg_then2 ("r_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`measure s`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["n"])) THEN (move ["ineq3"])); ((THENL_FIRST) ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("CHOOSE_SUBSET_STRONG", [CHOOSE_SUBSET_STRONG])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("inf_t", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("HAS_SIZE", [HAS_SIZE]))(thm_tac (new_rewrite [] []))))) THEN (ANTS_TAC)) ((ALL_TAC) THEN (done_tac))); (BETA_TAC THEN (case THEN (move ["b"])) THEN (case THEN (move ["b_sub"])) THEN (case THEN ((move ["fin_b"]) THEN (move ["card_b"])))); (((use_arg_then2 ("ineq3", [])) (disch_tac [])) THEN (clear_assumption "ineq3") THEN ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ineq2", [])) (fun fst_arg -> (use_arg_then2 ("b_sub", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("fin_b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ineq", [])) (fun fst_arg -> (use_arg_then2 ("b_sub", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("fin_b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((((use_arg_then2 ("card_b", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("fin_t", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ineq2", [])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("fin_t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("ineq", [])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("fin_t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((DISCH_THEN (fun snd_th -> (use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC THEN (move ["h"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("h", [])) (thm_tac (match_mp_then snd_th MP_TAC))))); ((((((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_RDIV_EQ", [REAL_LE_RDIV_EQ]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("FLOOR_MONO", [FLOOR_MONO])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (((use_arg_then2 ("FLOOR_NUM", [FLOOR_NUM]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma card_packing_ball_annulus *) let card_packing_ball_annulus = Sections.section_proof ["V"] `packing V /\ V SUBSET ball_annulus ==> CARD V <= 43` [ (BETA_TAC THEN (case THEN ((move ["pack"]) THEN (move ["subV"])))); ((fun arg_tac -> arg_tac (Arg_term (`IMAGE (\v. ball (v, &1)) V`))) (term_tac (set_tac "t"))); (((fun arg_tac -> (use_arg_then2 ("CARD_IMAGE_INJ", [CARD_IMAGE_INJ])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\v. ball (v,&1)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (move ["y"]) THEN (case THEN (move ["xV"])) THEN (case THEN (move ["yV"])) THEN (simp_tac) THEN (move ["ball_eq"])); ((in_tac ["pack"] false (((use_arg_then2 ("Sphere.packing_lt", [Sphere.packing_lt]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("pack", [])) (disch_tac [])) THEN (clear_assumption "pack") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("yV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("xV", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))))); ((((fun arg_tac -> (use_arg_then2 ("ball_eq", [])) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("CENTRE_IN_BALL", [CENTRE_IN_BALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("IN_BALL", [IN_BALL]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); (((use_arg_then2 ("REAL_OF_NUM_LE", [REAL_OF_NUM_LE]))(gsym_then (thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`&43 = floor (measure (ball (vec 0:real^3, #3.52)) / measure (ball (vec 0:real^3, &1)))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((repeat_tactic 1 9 (((use_arg_then2 ("VOLUME_BALL", [VOLUME_BALL]))(thm_tac (new_rewrite [] []))))) THEN (TRY ((arith_tac)))); ((repeat_tactic 1 9 (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(thm_tac (new_rewrite [] []))))) THEN ((fun arg_tac -> arg_tac (Arg_term (`_ * pi`))) (term_tac (set_tac "a")))); ((((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_INV_MUL", [REAL_INV_MUL]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `!x y. (a * x) * inv a * y = (a * inv a) * x * y`)))(thm_tac (new_rewrite [] [])))); ((THENL_FIRST) (((use_arg_then2 ("REAL_MUL_RINV", [REAL_MUL_RINV]))(thm_tac (new_rewrite [] [])))) ((((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("PI_POS", [PI_POS])) (disch_tac [])) THEN (clear_assumption "PI_POS") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FLOOR_UNIQUE", [FLOOR_UNIQUE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("INTEGER_CLOSED", [INTEGER_CLOSED]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("simple_card_inequality", [simple_card_inequality]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEASURABLE_BALL", [MEASURABLE_BALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (split_tac)); (((((use_arg_then2 ("pairwise", [pairwise]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("DISJOINT", [DISJOINT]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"]) THEN (move ["y"]) THEN (case THEN ALL_TAC) THEN (case THEN (move ["u"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["uV"]) THEN (case THEN ALL_TAC) THEN (case THEN (move ["v"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["vV"])); ((((use_arg_then2 ("contraR", [contraR])) (disch_tac [])) THEN (clear_assumption "contraR") THEN (DISCH_THEN apply_tac)) THEN (((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INTER", [IN_INTER]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_BALL", [IN_BALL]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["x"])) THEN (case THEN ((move ["du"]) THEN (move ["dv"]))))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`u = v`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((ALL_TAC) THEN (done_tac))); ((in_tac ["pack"] false (((use_arg_then2 ("Sphere.packing_lt", [Sphere.packing_lt]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("pack", [])) (disch_tac [])) THEN (clear_assumption "pack") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("uV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vV", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (use_arg_then2 ("u", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dv", [])) (disch_tac [])) THEN (clear_assumption "dv") THEN ((use_arg_then2 ("du", [])) (disch_tac [])) THEN (clear_assumption "du") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((THENL_FIRST) (split_tac) ((((use_arg_then2 ("VOLUME_BALL", [VOLUME_BALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("PI_POS", [PI_POS])) (disch_tac [])) THEN (clear_assumption "PI_POS") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["x"]) THEN (case THEN (move ["v"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["vV"])); (((((use_arg_then2 ("MEASURABLE_BALL", [MEASURABLE_BALL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("VOLUME_BALL", [VOLUME_BALL]))(thm_tac (new_rewrite [] [])))))) THEN (TRY ((arith_tac)))); (((((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_BALL", [IN_BALL]))(thm_tac (new_rewrite [] [])))))) THEN (move ["x"])); (in_tac ["subV"] false ((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Pack_defs.ball_annulus", [Pack_defs.ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_CBALL", [IN_CBALL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma SIN_NEG_PI_2PI *) let SIN_NEG_PI_2PI = Sections.section_proof ["x"] `pi <= x /\ x <= &2 * pi ==> sin x <= &0` [ (BETA_TAC THEN (move ["x_ineq"])); ((((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `x = (x - pi) + pi`)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SIN_PERIODIC_PI", [SIN_PERIODIC_PI]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NEG_LE0", [REAL_NEG_LE0]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("SIN_POS_PI_LE", [SIN_POS_PI_LE])) (disch_tac [])) THEN (clear_assumption "SIN_POS_PI_LE") THEN (DISCH_THEN apply_tac)) THEN (((use_arg_then2 ("x_ineq", [])) (disch_tac [])) THEN (clear_assumption "x_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma not_surrounded_imp_on_one_side_of_plane *) let not_surrounded_imp_on_one_side_of_plane = Sections.section_proof ["V";"E";"v"] `FAN (vec 0,V,E) ==> v IN V ==> ~(set_of_edge v V E = {}) ==> ~(surrounded_node (V,E) v) ==> ?n. ~(n = vec 0) /\ v dot n = &0 /\ (!w. w IN set_of_edge v V E ==> w dot n <= &0)` [ ((((use_arg_then2 ("surrounded_node", [surrounded_node]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(thm_tac (new_rewrite [] []))))); ((BETA_TAC THEN (move ["fan"]) THEN (move ["vV"]) THEN (move ["not_isolated"]) THEN (case THEN ALL_TAC) THEN (case THEN ((move ["v1"]) THEN (move ["w"]))) THEN (simp_tac) THEN (case THEN ((case THEN (move ["in_vw"])) THEN (move ["v1_eq"]) THEN (move ["ge_pi"])))) THEN (in_tac ["ge_pi"; "in_vw"] false (((use_arg_then2 ("v1_eq", []))(thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> arg_tac (Arg_term (`v,w IN dart1_of_fan (V,E)`))) (term_tac (have_gen_tac [](move ["in1_vw"])))); ((((use_arg_then2 ("in_vw", [])) (disch_tac [])) THEN (clear_assumption "in_vw") THEN BETA_TAC) THEN ((((use_arg_then2 ("dart1_of_fan", [dart1_of_fan]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dart_of_fan", [dart_of_fan]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_UNION", [IN_UNION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_ELIM_PAIR_THM", [IN_ELIM_PAIR_THM]))(thm_tac (new_rewrite [] []))))) THEN (case THEN ((TRY done_tac)))); ((((((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ALL_TAC THEN (case THEN (move ["v'"])) THEN (case THEN (move ["h1"]))) THEN ((((use_arg_then2 ("PAIR_EQ", [PAIR_EQ]))(thm_tac (new_rewrite [] [])))) THEN (move ["eq"]))); ((((use_arg_then2 ("h1", [])) (disch_tac [])) THEN (clear_assumption "h1") THEN BETA_TAC) THEN ((((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("not_isolated", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`v cross w`))) (term_tac exists_tac)); (((((use_arg_then2 ("DOT_CROSS_SELF", [DOT_CROSS_SELF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CROSS_EQ_0", [CROSS_EQ_0]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (split_tac)); ((((fun arg_tac -> (use_arg_then2 ("Hypermap_and_fan.DART1_NOT_COLLINEAR", [Hypermap_and_fan.DART1_NOT_COLLINEAR])) (fun fst_arg -> (use_arg_then2 ("fan", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (done_tac)); (BETA_TAC THEN (move ["w2"]) THEN (move ["in_w2"])); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`sin (azim (vec 0) v w w2) <= &0`))) (term_tac (have_gen_tac [](move ["sin_le0"]))))); ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Trigonometry.JBDNJJB", [Trigonometry.JBDNJJB])) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("w", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("w2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)); ((((use_arg_then2 ("Trigonometry2.re_eqvl", [Trigonometry2.re_eqvl]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (move ["t"])) THEN (case THEN (move ["t_gt0"]))); ((DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("f_equal", [f_equal])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`real_mul (inv t)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC); ((THENL_FIRST) ((((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_MUL_LID", [REAL_MUL_LID]))(thm_tac (new_rewrite [] [])))))) ((((use_arg_then2 ("t_gt0", [])) (disch_tac [])) THEN (clear_assumption "t_gt0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("DOT_SYM", [DOT_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("REAL_LE_NEG", [REAL_LE_NEG]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_NEG_0", [REAL_NEG_0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NEG_RMUL", [REAL_NEG_RMUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_MUL", [REAL_LE_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NEG_GE0", [REAL_NEG_GE0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sin_le0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("REAL_LE_INV", [REAL_LE_INV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("t_gt0", [])) (disch_tac [])) THEN (clear_assumption "t_gt0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((THENL) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`w = w2`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [(((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] []))))); (move ["n_ww2"])]); (((((use_arg_then2 ("AZIM_REFL", [AZIM_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SIN_0", [SIN_0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_LAST) ((((use_arg_then2 ("SIN_NEG_PI_2PI", [SIN_NEG_PI_2PI])) (disch_tac [])) THEN (clear_assumption "SIN_NEG_PI_2PI") THEN (DISCH_THEN apply_tac)) THEN (split_tac)) (((((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("azim", [azim]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((fun arg_tac -> (use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (fun fst_arg -> (use_arg_then2 ("ge_pi", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (((use_arg_then2 ("real_ge", [real_ge]))(gsym_then (thm_tac (new_rewrite [] [])))))); (((fun arg_tac -> (use_arg_then2 ("Fatugpd.azim_ge_azim_dart", [Fatugpd.azim_ge_azim_dart])) (fun fst_arg -> (use_arg_then2 ("fan", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Hypermap_and_fan.PAIR_IN_DART1_OF_FAN_IMP_NOT_EQ", [Hypermap_and_fan.PAIR_IN_DART1_OF_FAN_IMP_NOT_EQ])) (fun fst_arg -> (use_arg_then2 ("fan", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("in1_vw", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_ww2", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_w2", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Hypermap_and_fan.PAIR_IN_DART1_OF_FAN", [Hypermap_and_fan.PAIR_IN_DART1_OF_FAN])) (fun fst_arg -> (use_arg_then2 ("fan", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("in1_vw", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma perturbation_lemma *) let perturbation_lemma = Sections.section_proof ["d";"S";"v";"n"] `&0 < d /\ ~(n = vec 0) /\ v dot n = &0 /\ (!w. w IN S ==> w dot n <= &0 /\ &0 < w dot v) ==> ?v2. norm v2 = norm v /\ (!w. w IN S ==> dist (v, w) < dist (v2, w)) /\ dist (v, v2) < d` [ (BETA_TAC THEN (case THEN (move ["d_gt0"])) THEN (case THEN (move ["n_n0"])) THEN (case THEN (move ["vn0"])) THEN (move ["w_dot"])); ((THENL) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`S = {}`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (move ["nS"])]); (((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("d_gt0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(v = vec 0)`))) (term_tac (have_gen_tac [](move ["v_n0"])))); ((((use_arg_then2 ("nS", [])) (disch_tac [])) THEN (clear_assumption "nS") THEN BETA_TAC) THEN ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["x"])) THEN (move ["xS"]))); (((fun arg_tac -> (use_arg_then2 ("w_dot", [])) (fun fst_arg -> (use_arg_then2 ("xS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["_"]))); ((((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN ((((use_arg_then2 ("DOT_RZERO", [DOT_RZERO]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_REFL", [REAL_LT_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`max (&0) (&1 - (d * d) / (&4 * (v dot v)))`))) (term_tac (set_tac "a"))); ((fun arg_tac -> arg_tac (Arg_term (`sqrt ((v dot v) * (&1 - a * a) / (n dot n))`))) (term_tac (set_tac "b"))); ((fun arg_tac -> arg_tac (Arg_term (`&0 <= a /\ a < &1`))) (term_tac (have_gen_tac [](move ["a_ineq"])))); ((((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MAX_MAX", [REAL_MAX_MAX]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MAX_LT", [REAL_MAX_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `!x. &1 - x < &1 <=> &0 < x`)))(thm_tac (new_rewrite [] [])))); (((((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_LT_MUL", [REAL_LT_MUL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("d_gt0", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DOT_POS_LT", [DOT_POS_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("v_n0", []))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`a % v + b % n`))) (term_tac exists_tac)); ((fun arg_tac -> arg_tac (Arg_term (`&0 <= (v dot v) * (&1 - a * a) / (n dot n)`))) (term_tac (have_gen_tac [](move ["h1"])))); ((((use_arg_then2 ("REAL_LE_MUL", [REAL_LE_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_DIV", [REAL_LE_DIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DOT_POS_LE", [DOT_POS_LE]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `&0 <= &1 - a * a <=> a * a <= &1`)))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("REAL_POW_2", [REAL_POW_2]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("ABS_SQUARE_LE_1", [ABS_SQUARE_LE_1]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("a_ineq", [])) (disch_tac [])) THEN (clear_assumption "a_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`b * b * (n dot n) = (&1 - a * a) * (v dot v)`))) (term_tac (have_gen_tac [](move ["bn_eq"])))); ((((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_POW_2", [REAL_POW_2]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SQRT_POW_2", [SQRT_POW_2]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); (((((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DOT_EQ_0", [DOT_EQ_0]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("NORM_EQ", [NORM_EQ]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RADD", [DOT_RADD]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LADD", [DOT_LADD]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RMUL", [DOT_RMUL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LMUL", [DOT_LMUL]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("DOT_SYM", [DOT_SYM])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vn0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("bn_eq", []))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) (split_tac) ((arith_tac) THEN (done_tac))); ((THENL_ROT (-1)) (split_tac)); ((((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL NORM_LT_SQUARE)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("d_gt0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_theorem (VECTOR_ARITH `!v n a b. v - (a % v + b % n) = (&1 - a) % v - b % n`)))(thm_tac (new_rewrite [] [])))); ((repeat_tactic 1 9 (((use_arg_then2 ("DOT_RSUB", [DOT_RSUB]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LSUB", [DOT_LSUB]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RMUL", [DOT_RMUL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LMUL", [DOT_LMUL]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("DOT_SYM", [DOT_SYM])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vn0", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_MUL_RZERO", [REAL_MUL_RZERO]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("bn_eq", []))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("REAL_SUB_RZERO", [REAL_SUB_RZERO]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_SUB_LZERO", [REAL_SUB_LZERO]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_LNEG", [REAL_MUL_LNEG]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_SUB_RDISTRIB", [REAL_SUB_RDISTRIB]))(gsym_then (thm_tac (new_rewrite [] [])))))); (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `(&1 - a) * (&1 - a) - --(&1 - a * a) = &2 * (&1 - a)`)))(thm_tac (new_rewrite [] [])))); ((THENL_FIRST) ((((use_arg_then2 ("REAL_LT_RDIV_EQ", [REAL_LT_RDIV_EQ]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DOT_POS_LT", [DOT_POS_LT]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_RDIV_EQ", [REAL_LT_RDIV_EQ]))(gsym_then (thm_tac (new_rewrite [] [])))))) ((arith_tac) THEN (done_tac))); (((fun arg_tac -> arg_tac (Arg_theorem (REAL_ARITH `!x. &0 < x /\ &1 - x / &4 <= a ==> &1 - a < x / &2`)))(thm_tac (new_rewrite [] [])))); ((((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_POW_2", [REAL_POW_2]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_LT_SQUARE", [REAL_LT_SQUARE]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DOT_POS_LT", [DOT_POS_LT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("v_n0", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_POS_NZ", [REAL_POS_NZ]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((repeat_tactic 1 9 (((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_INV_MUL", [REAL_INV_MUL]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("real_div", [real_div]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] [(`_ * &4`)])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MAX_MAX", [REAL_MAX_MAX]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (BETA_TAC THEN (move ["w"]) THEN (move ["wS"])); ((repeat_tactic 1 9 (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NORM_LT", [NORM_LT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RSUB", [DOT_RSUB]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LSUB", [DOT_LSUB]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RADD", [DOT_RADD]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LADD", [DOT_LADD]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_RMUL", [DOT_RMUL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DOT_LMUL", [DOT_LMUL]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("DOT_SYM", [DOT_SYM])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vn0", []))(thm_tac (new_rewrite [] []))))); ((repeat_tactic 1 9 (((use_arg_then2 ("REAL_MUL_RZERO", [REAL_MUL_RZERO]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_ADD_RID", [REAL_ADD_RID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ADD_LID", [REAL_ADD_LID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("bn_eq", []))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`a * a * (v dot v) + (&1 - a * a) * (v dot v) = v dot v`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))) ((arith_tac) THEN (done_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("real_sub", [real_sub]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_NEG_ADD", [REAL_NEG_ADD]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_ADD_ASSOC", [REAL_ADD_ASSOC]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LT_RADD", [REAL_LT_RADD]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_ADD_ASSOC", [REAL_ADD_ASSOC]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("REAL_LT_LADD", [REAL_LT_LADD]))(thm_tac (new_rewrite [] []))))); ((((fun arg_tac -> (use_arg_then2 ("DOT_SYM", [DOT_SYM])) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("DOT_SYM", [DOT_SYM])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`!x y. --x + --x < --(a * x) + --(b * y) + --(a * x) + --(b * y) <=> (a - &1) * x < b * --y`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))) ((arith_tac) THEN (done_tac))); ((((use_arg_then2 ("REAL_LTE_TRANS", [REAL_LTE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LTE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`&0`))) (term_tac exists_tac))); ((((use_arg_then2 ("REAL_LE_MUL", [REAL_LE_MUL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_NEG_GE0", [REAL_NEG_GE0]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("w_dot", [])) (fun fst_arg -> (use_arg_then2 ("wS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("b_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SQRT_POS_LE", [SQRT_POS_LE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("REAL_NEG_GT0", [REAL_NEG_GT0]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_NEG_LMUL", [REAL_NEG_LMUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_MUL", [REAL_LT_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("w_dot", [])) (fun fst_arg -> (use_arg_then2 ("wS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("a_ineq", [])) (disch_tac [])) THEN (clear_assumption "a_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma COMPACT_SUP_SET *) let COMPACT_SUP_SET = Sections.section_proof ["f";"s"] `compact s /\ lift o f continuous_on s ==> compact {x | x IN s /\ (!y. y IN s ==> f y <= f x)}` [ ((fun arg_tac -> arg_tac (Arg_term (`GSPEC _`))) (term_tac (set_tac "c"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`c SUBSET s`))) (term_tac (have_gen_tac [](move ["cs"])))) (((((use_arg_then2 ("c_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); (((repeat_tactic 1 9 (((use_arg_then2 ("COMPACT_EQ_BOUNDED_CLOSED", [COMPACT_EQ_BOUNDED_CLOSED]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN ALL_TAC) THEN (case THEN ((move ["boundedS"]) THEN (move ["closedS"]))) THEN (move ["f_cont"])) THEN (split_tac)); ((((fun arg_tac -> (use_arg_then2 ("BOUNDED_SUBSET", [BOUNDED_SUBSET])) (fun fst_arg -> (use_arg_then2 ("boundedS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (done_tac)); (in_tac ["closedS"] true (repeat_tactic 1 9 (((use_arg_then2 ("CLOSED_SEQUENTIAL_LIMITS", [CLOSED_SEQUENTIAL_LIMITS]))(thm_tac (new_rewrite [] [])))))); ((BETA_TAC THEN (move ["x"]) THEN (move ["y"]) THEN (case THEN ((move ["x_in_c"]) THEN (move ["x_to_y"])))) THEN ((((use_arg_then2 ("c_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`!n. x n IN s`))) (term_tac (have_gen_tac [](move ["x_in_s"])))) ((BETA_TAC THEN (move ["n"])) THEN (((use_arg_then2 ("cs", [])) (disch_tac [])) THEN (clear_assumption "cs") THEN BETA_TAC) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (DISCH_THEN apply_tac) THEN (done_tac))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`y IN s`))) (term_tac (have_gen_tac [](move ["ys"])))) ((((fun arg_tac -> (use_arg_then2 ("closedS", [])) (fun fst_arg -> (use_arg_then2 ("x_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (done_tac))); (((((use_arg_then2 ("ys", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["a"]) THEN (move ["as"])); ((((use_arg_then2 ("f_cont", [])) (disch_tac [])) THEN (clear_assumption "f_cont") THEN BETA_TAC) THEN ((((use_arg_then2 ("CONTINUOUS_ON_SEQUENTIALLY", [CONTINUOUS_ON_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("x_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("ys", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("x_in_s", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC)))); (((((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("o_ASSOC", [o_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL TENDSTO_REAL)))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["lim"])); (((fun arg_tac -> (use_arg_then2 ("REALLIM_LBOUND", [REALLIM_LBOUND])) (fun fst_arg -> (use_arg_then2 ("lim", [lim])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)); (((((use_arg_then2 ("TRIVIAL_LIMIT_SEQUENTIALLY", [TRIVIAL_LIMIT_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL ALWAYS_EVENTUALLY)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (move ["n"])); ((((fun arg_tac -> (use_arg_then2 ("x_in_c", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("c_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["_"]))) THEN (DISCH_THEN apply_tac) THEN (done_tac)); ];; (* Finalization of the section SomeResults *) let packing_empty = Sections.finalize_theorem packing_empty;; let in_ball_annulus = Sections.finalize_theorem in_ball_annulus;; let closed_ball_annulus = Sections.finalize_theorem closed_ball_annulus;; let finite_packing_ball_annulus = Sections.finalize_theorem finite_packing_ball_annulus;; let ECTC_sub_ESTD = Sections.finalize_theorem ECTC_sub_ESTD;; let in_set_of_edge_ECTC = Sections.finalize_theorem in_set_of_edge_ECTC;; let vector_eq_neg = Sections.finalize_theorem vector_eq_neg;; let bij_scriptL = Sections.finalize_theorem bij_scriptL;; let lmfun_ge0 = Sections.finalize_theorem lmfun_ge0;; let lmfun_in_ball_annulus = Sections.finalize_theorem lmfun_in_ball_annulus;; let scriptL_le_card = Sections.finalize_theorem scriptL_le_card;; let card_counterexample_ge13 = Sections.finalize_theorem card_counterexample_ge13;; let piecewise_real_continuous = Sections.finalize_theorem piecewise_real_continuous;; let piecewise_real_continuous_univ = Sections.finalize_theorem piecewise_real_continuous_univ;; let lmfun_continuous = Sections.finalize_theorem lmfun_continuous;; let lmfun_norm2_continuous = Sections.finalize_theorem lmfun_norm2_continuous;; let simple_card_inequality = Sections.finalize_theorem simple_card_inequality;; let card_packing_ball_annulus = Sections.finalize_theorem card_packing_ball_annulus;; let SIN_NEG_PI_2PI = Sections.finalize_theorem SIN_NEG_PI_2PI;; let not_surrounded_imp_on_one_side_of_plane = Sections.finalize_theorem not_surrounded_imp_on_one_side_of_plane;; let perturbation_lemma = Sections.finalize_theorem perturbation_lemma;; let COMPACT_SUP_SET = Sections.finalize_theorem COMPACT_SUP_SET;; Sections.end_section "SomeResults";; (* Section VectorOfList *) Sections.begin_section "VectorOfList";;
let vector_of_list = new_definition `vector_of_list d list =
        lambda i. if (i - 1) DIV d < LENGTH list then (EL ((i - 1) DIV d) list)$((i - 1) MOD d + 1) else &0`;;
let list_of_vector = new_definition `list_of_vector d n v = TABLE (\k. lambda i. v$(k * d + i)) n`;;
let LAMBDA_BETA = GEN_ALL LAMBDA_BETA;; (* Lemma vector_of_list_nil *) let vector_of_list_nil = Sections.section_proof ["d"] `vector_of_list d [] = vec 0` [ ((((((use_arg_then2 ("vector_of_list", [vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LAMBDA_UNIQUE", [LAMBDA_UNIQUE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vec", [vec]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_ineq"])) THEN ((((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)))); ((((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma length_list_of_vector *) let length_list_of_vector = Sections.section_proof ["d";"n";"v"] `LENGTH (list_of_vector d n v) = n` [ (((((use_arg_then2 ("list_of_vector", [list_of_vector]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Packing3.LENGTH_TABLE", [Packing3.LENGTH_TABLE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma sum_lemma *) let sum_lemma = Sections.section_proof ["n";"k";"f"] `sum (1..k * n) f = sum (1..n) (\j. sum (1..k) (\i. f ((j - 1) * k + i)))` [ ((THENL_FIRST) (((THENL) (((use_arg_then2 ("n", [])) (disch_tac [])) THEN (clear_assumption "n") THEN elim) [ALL_TAC; ((move ["n"]) THEN (move ["IH"]))]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("muln0", [muln0]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL SUM_CLAUSES_NUMSEG)))(thm_tac (new_rewrite [] []))))))) ((arith_tac) THEN (done_tac))); ((THENL_FIRST) ((((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `1 <= SUC n`)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("mulnSr", [mulnSr]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IH", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_ADD_SPLIT", [SUM_ADD_SPLIT]))(thm_tac (new_rewrite [] []))))) ((arith_tac) THEN (done_tac))); ((((use_arg_then2 ("REAL_EQ_ADD_LCANCEL", [REAL_EQ_ADD_LCANCEL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("addnC", [addnC])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`k * n:num`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_OFFSET", [SUM_OFFSET]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("SUM_EQ", [SUM_EQ])) (thm_tac apply_tac)) THEN (move ["i"])) THEN ((((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("succnK", [succnK]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("addnC", [addnC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("mulnC", [mulnC]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (Sections.add_section_var (mk_var ("d", (`:num`))));; (Sections.add_section_var (mk_var ("list", (`:(real^N)list`))));; (Sections.add_section_hyp "d_eq" (`dimindex (:N) = d`));; (Sections.add_section_hyp "dim_ge" (`d * LENGTH list <= dimindex (:M)`));; (* Lemma vector_of_list_comp0 *) let vector_of_list_comp0 = Sections.section_proof ["i"] `d * LENGTH list + 1 <= i /\ i <= dimindex (:M) ==> (vector_of_list d list:real^M)$i = &0` [ (BETA_TAC THEN (move ["i_ineqs"])); ((THENL_FIRST) ((((use_arg_then2 ("vector_of_list", [vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) ((((use_arg_then2 ("i_ineqs", [])) (disch_tac [])) THEN (clear_assumption "i_ineqs") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`~((i - 1) DIV d < LENGTH list)`))) (term_tac (have_gen_tac []((((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))))))); ((fun arg_tac -> arg_tac (Arg_term (`~(d = 0)`))) (term_tac (have_gen_tac [](move ["dn0"])))); ((((fun arg_tac -> (use_arg_then2 ("DIMINDEX_GE_1", [DIMINDEX_GE_1])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`(:N)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("d_eq", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("DIV_MULT", [DIV_MULT])) (fun fst_arg -> (use_arg_then2 ("dn0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("DIV_MONO", [DIV_MONO]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dn0", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("i_ineqs", [])) (disch_tac [])) THEN (clear_assumption "i_ineqs") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma vector_of_list_comp *) let vector_of_list_comp = Sections.section_proof ["k";"i"] `(1 <= i /\ i <= d) /\ k < LENGTH list ==> (vector_of_list d list:real^M)$(k * d + i) = (EL k list)$i` [ (BETA_TAC THEN (case THEN (move ["i_ineq"])) THEN (move ["k_lt"])); ((((use_arg_then2 ("vector_of_list", [vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((THENL_FIRST) (split_tac) ((((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("LE_TRANS", [LE_TRANS])) (disch_tac [])) THEN (clear_assumption "LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`d * LENGTH list`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dim_ge", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("LE_TRANS", [LE_TRANS])) (disch_tac [])) THEN (clear_assumption "LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`k * d + d:num`))) (term_tac exists_tac))); ((((use_arg_then2 ("LE_ADD_LCANCEL", [LE_ADD_LCANCEL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_ineq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `k * d + d = d * SUC k`)))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("LE_MULT_LCANCEL", [LE_MULT_LCANCEL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("k_lt", [])) (disch_tac [])) THEN (clear_assumption "k_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIVMOD_UNIQ", [DIVMOD_UNIQ])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`(k * d + i) - 1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("d", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`i - 1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["div_mod"]))); (((repeat_tactic 1 9 (((use_arg_then2 ("div_mod", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("k_lt", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (TRY (((((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN BETA_TAC) THEN (arith_tac))))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`i - 1 + 1 = i`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((ALL_TAC) THEN (done_tac))); ((((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma vector_of_list_left_inverse *) let vector_of_list_left_inverse = Sections.section_proof [] `list_of_vector d (LENGTH list) ((vector_of_list d list):real^M) = list` [ (((((use_arg_then2 ("Packing3.LIST_EL_EQ", [Packing3.LIST_EL_EQ]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("list_of_vector", [list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Packing3.LENGTH_TABLE", [Packing3.LENGTH_TABLE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["k"]) THEN (move ["k_lt"])); (((((use_arg_then2 ("Packing3.EL_TABLE", [Packing3.EL_TABLE]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("LAMBDA_UNIQUE", [LAMBDA_UNIQUE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("d_eq", []))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_ineq"])); ((((use_arg_then2 ("vector_of_list_comp", [vector_of_list_comp]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma dot_vector_of_list *) let dot_vector_of_list = Sections.section_proof [] `(vector_of_list d list:real^M) dot (vector_of_list d list) = sum (1..LENGTH list) (\i. (EL (i - 1) list) dot (EL (i - 1) list))` [ ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`~(d = 0)`))) (term_tac (have_gen_tac [](move ["d_n0"])))) ((((fun arg_tac -> (use_arg_then2 ("DIMINDEX_GE_1", [DIMINDEX_GE_1])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`(:N)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("d_eq", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`LENGTH list <= dimindex (:M)`))) (term_tac (have_gen_tac [](move ["len_le"])))); ((((use_arg_then2 ("LE_TRANS", [LE_TRANS])) (disch_tac [])) THEN (clear_assumption "LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`d * LENGTH list`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dim_ge", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); (((((fun arg_tac -> arg_tac (Arg_theorem (ARITH_RULE `!a. a = 1 * a`)))(thm_tac (new_rewrite [1] [])))) THEN (((use_arg_then2 ("LE_MULT_RCANCEL", [LE_MULT_RCANCEL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("d_n0", [])) (disch_tac [])) THEN (clear_assumption "d_n0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((repeat_tactic 1 9 (((use_arg_then2 ("dot", [dot]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("subnKC", [subnKC])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_ADD_SPLIT", [SUM_ADD_SPLIT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("LE_ADDR", [LE_ADDR]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((use_arg_then2 ("REAL_ADD_RID", [REAL_ADD_RID]))(gsym_then (thm_tac (new_rewrite [] [(`sum (1..LENGTH list) _`)]))))); ((THENL_ROT (-1)) (congr_tac (`_1 + _2:real`))); (((use_arg_then2 ("SUM_EQ_0_NUMSEG", [SUM_EQ_0_NUMSEG])) (thm_tac apply_tac)) THEN (move ["i"]) THEN (move ["i_ineq"]) THEN (simp_tac)); ((THENL_FIRST) ((((use_arg_then2 ("vector_of_list", [vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) ((((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN ((use_arg_then2 ("dim_ge", [])) (disch_tac [])) THEN (clear_assumption "dim_ge") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`~((i - 1) DIV d < LENGTH list)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) (((simp_tac) THEN (((use_arg_then2 ("REAL_MUL_LZERO", [REAL_MUL_LZERO]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((((use_arg_then2 ("NOT_LT", [NOT_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LE_RDIV_EQ", [LE_RDIV_EQ]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))) THEN (((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("sum_lemma", [sum_lemma]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ((use_arg_then2 ("SUM_EQ", [SUM_EQ])) (thm_tac apply_tac)) THEN (((((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("d_eq", []))(thm_tac (new_rewrite [] []))))) THEN (move ["k"]) THEN (move ["k_ineq"]) THEN (simp_tac))); ((((use_arg_then2 ("SUM_EQ", [SUM_EQ])) (thm_tac apply_tac)) THEN (move ["i"])) THEN ((((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (move ["i_ineq"]) THEN (simp_tac))); (((((use_arg_then2 ("vector_of_list_comp", [vector_of_list_comp]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (repeat_tactic 1 9 (((use_arg_then2 ("i_ineq", []))(thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("k_ineq", [])) (disch_tac [])) THEN (clear_assumption "k_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma vector_of_list_norm_bound *) let vector_of_list_norm_bound = Sections.section_proof ["r"] `(!x:real^N. MEM x list ==> norm x <= r) ==> norm (vector_of_list d list:real^M) <= sqrt (&(LENGTH list)) * r` [ (BETA_TAC THEN (move ["norm_le"])); ((THENL) (((fun arg_tac -> (use_arg_then2 ("EXCLUDED_MIDDLE", [EXCLUDED_MIDDLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`list = []`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (move ["list_not_nil"])]); (((((use_arg_then2 ("LENGTH", [LENGTH]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vector_of_list_nil", [vector_of_list_nil]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NORM_0", [NORM_0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SQRT_0", [SQRT_0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_LZERO", [REAL_MUL_LZERO]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`&0 <= r`))) (term_tac (have_gen_tac [](move ["r_pos"])))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`0 < LENGTH list`))) (term_tac (have_gen_tac [](move ["len_pos"])))) ((((use_arg_then2 ("list_not_nil", [])) (disch_tac [])) THEN (clear_assumption "list_not_nil") THEN BETA_TAC) THEN (((use_arg_then2 ("LENGTH_EQ_NIL", [LENGTH_EQ_NIL]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac))); ((fun arg_tac -> (use_arg_then2 ("norm_le", [])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("MEM_EL", [MEM_EL])) (fun fst_arg -> (use_arg_then2 ("len_pos", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)); ((((fun arg_tac -> (use_arg_then2 ("NORM_POS_LE", [NORM_POS_LE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL 0 list`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("vector_norm", [vector_norm]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dot_vector_of_list", [dot_vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`LENGTH list`))) (term_tac (set_tac "n"))); ((fun arg_tac -> arg_tac (Arg_term (`sqrt (&n) * r = sqrt (&n * r pow 2)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); (((((use_arg_then2 ("SQRT_MUL", [SQRT_MUL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_LE_POW_2", [REAL_LE_POW_2]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_POS", [REAL_POS]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("POW_2_SQRT", [POW_2_SQRT]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("SQRT_MONO_LE", [SQRT_MONO_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUM_POS_LE_NUMSEG", [SUM_POS_LE_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); ((BETA_TAC THEN (move ["i"]) THEN (move ["_"])) THEN (((use_arg_then2 ("DOT_POS_LE", [DOT_POS_LE]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); (((((fun arg_tac -> (use_arg_then2 ("CARD_NUMSEG_1", [CARD_NUMSEG_1])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [2] []))))) THEN (((use_arg_then2 ("SUM_BOUND", [SUM_BOUND]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FINITE_NUMSEG", [FINITE_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_ineq"]) THEN (simp_tac)); ((((use_arg_then2 ("DOT_SQUARE_NORM", [DOT_SQUARE_NORM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_SQUARE_ABS", [REAL_LE_SQUARE_ABS]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_ABS_NORM", [REAL_ABS_NORM]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("iffRL", [iffRL])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("REAL_ABS_REFL", [REAL_ABS_REFL])) (fun fst_arg -> (use_arg_then2 ("r", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); (((((use_arg_then2 ("norm_le", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_def", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("i_ineq", [])) (disch_tac [])) THEN (clear_assumption "i_ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Finalization of the section VectorOfList *) let vector_of_list_nil = Sections.finalize_theorem vector_of_list_nil;; let length_list_of_vector = Sections.finalize_theorem length_list_of_vector;; let sum_lemma = Sections.finalize_theorem sum_lemma;; let vector_of_list_comp0 = Sections.finalize_theorem vector_of_list_comp0;; let vector_of_list_comp = Sections.finalize_theorem vector_of_list_comp;; let vector_of_list_left_inverse = Sections.finalize_theorem vector_of_list_left_inverse;; let dot_vector_of_list = Sections.finalize_theorem dot_vector_of_list;; let vector_of_list_norm_bound = Sections.finalize_theorem vector_of_list_norm_bound;; Sections.end_section "VectorOfList";; (* Lemma infnorm_lt *) let infnorm_lt = Sections.section_proof ["e"] `!(v:real^N). (!i. 1 <= i /\ i <= dimindex (:N) ==> abs (v$i) < e) ==> infnorm v < e` [ ((THENL_ROT (-1)) ((BETA_TAC THEN (move ["v"]) THEN (move ["ineqs"])) THEN ((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL infnorm)))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REAL_SUP_LT_FINITE)))(thm_tac (new_rewrite [] []))))))); ((BETA_TAC THEN (move ["x"])) THEN (((((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ALL_TAC THEN (case THEN (move ["i"])) THEN (case THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("ineqs", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (simp_tac)) THEN (done_tac)); (split_tac); ((fun arg_tac -> arg_tac (Arg_term (`GSPEC _`))) (term_tac (set_tac "s"))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`s = IMAGE (\i. abs (v$i)) (1..dimindex (:N))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))); (((((use_arg_then2 ("FINITE_IMAGE", [FINITE_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FINITE_NUMSEG", [FINITE_NUMSEG]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("s_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL CONJ_ACI)))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_term (`abs (v$1)`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`1`))) (term_tac exists_tac))); (((((use_arg_then2 ("DIMINDEX_GE_1", [DIMINDEX_GE_1]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LE_REFL", [LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma lim_not_equal *) let lim_not_equal = Sections.section_proof ["a";"b";"f";"g"] `~(a = b) /\ (f --> a) sequentially /\ (g --> b) sequentially ==> ?N. !n. N <= n ==> ~(f n = g n)` [ (((repeat_tactic 1 9 (((use_arg_then2 ("LIM_SEQUENTIALLY", [LIM_SEQUENTIALLY]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("DIST_NZ", [DIST_NZ]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["n_ab"])) THEN (case THEN ((move ["f_to_a"]) THEN (move ["g_to_b"])))); ((fun arg_tac -> arg_tac (Arg_term (`dist (a, b) / &2`))) (term_tac (set_tac "e"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`&0 < e`))) (term_tac (have_gen_tac [](move ["e_gt0"])))) (((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_ab", []))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac))); (((fun arg_tac -> (use_arg_then2 ("g_to_b", [])) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (use_arg_then2 ("f_to_a", [])) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN ((move ["n1"]) THEN (move ["ineq1"]))) THEN (case THEN ((move ["n2"]) THEN (move ["ineq2"])))); (((fun arg_tac -> arg_tac (Arg_term (`n1 + n2:num`))) (term_tac exists_tac)) THEN (move ["n"]) THEN (move ["le_n"])); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`n1 <= n /\ n2 <= n:num`))) (term_tac (have_gen_tac [](move ["n_ineqs"])))) ((((use_arg_then2 ("le_n", [])) (disch_tac [])) THEN (clear_assumption "le_n") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((fun arg_tac -> (use_arg_then2 ("ineq2", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (use_arg_then2 ("ineq1", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("n_ineqs", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac))); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`f n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`g n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`f n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`f n`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("e_def", [])) (disch_tac [])) THEN (clear_assumption "e_def") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Section VectorOfList_Sets *) Sections.begin_section "VectorOfList_Sets";; (Sections.add_section_var (mk_var ("k", (`:num`))));; (Sections.add_section_hyp "dim_ge" (`3 * k <= dimindex (:M)`));; (* Section Lim_inS *) Sections.begin_section "Lim_inS";; (Sections.add_section_var (mk_var ("S", (`:(real^3)list -> bool`))));; (* Lemma lim_inS_EL *) let lim_inS_EL = Sections.section_proof ["v";"y"] `(!n. v n IN IMAGE (vector_of_list 3) S) /\ (v --> y:real^M) sequentially ==> !i. i < k ==> ((\n. EL i (list_of_vector 3 k (v n):(real^3)list)) --> EL i (list_of_vector 3 k y:(real^3)list)) sequentially` [ (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("LIM_SEQUENTIALLY", [LIM_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["vS"])) THEN (move ["v_to_y"]) THEN (move ["i"]) THEN (move ["i_lt_k"]) THEN (move ["e"]) THEN (move ["e_gt0"]) THEN (simp_tac)); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`&0 < e / sqrt (&3)`))) (term_tac (have_gen_tac [](move ["e3_gt0"])))) (((((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("e_gt0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SQRT_POS_LT", [SQRT_POS_LT]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac))); (((fun arg_tac -> (use_arg_then2 ("v_to_y", [])) (fun fst_arg -> (use_arg_then2 ("e3_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["N"])) THEN (move ["d_lt"])); ((((use_arg_then2 ("N", [])) (term_tac exists_tac)) THEN (move ["n"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("d_lt", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("NORM_BOUND_COMPONENT_LT", [NORM_BOUND_COMPONENT_LT])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["bounds"]))); ((repeat_tactic 1 9 (((use_arg_then2 ("list_of_vector", [list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("Packing3.EL_TABLE", [Packing3.EL_TABLE]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`_1 - _2:real^3`))) (term_tac (set_tac "z"))); ((((fun arg_tac -> (use_arg_then2 ("NORM_LE_INFNORM", [NORM_LE_INFNORM])) (fun fst_arg -> (use_arg_then2 ("z", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("REAL_LET_TRANS", [REAL_LET_TRANS])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (DISCH_THEN apply_tac)); ((((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LTE_TRANS", [REAL_LTE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LTE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`sqrt (&3) * (e / sqrt (&3))`))) (term_tac exists_tac))); ((THENL_ROT (-1)) (split_tac)); ((((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((((use_arg_then2 ("SQRT_EQ_0", [SQRT_EQ_0]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((THENL_FIRST) ((((use_arg_then2 ("REAL_LT_LMUL", [REAL_LT_LMUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SQRT_POS_LT", [SQRT_POS_LT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))) ((arith_tac) THEN (done_tac))); (((((use_arg_then2 ("infnorm_lt", [infnorm_lt]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (move ["j"]) THEN (move ["j_ineqs"])); ((((use_arg_then2 ("z_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("VECTOR_SUB_COMPONENT", [VECTOR_SUB_COMPONENT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac))); (((((use_arg_then2 ("VECTOR_SUB_COMPONENT", [VECTOR_SUB_COMPONENT]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("bounds", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("dim_ge", [])) (disch_tac [])) THEN (clear_assumption "dim_ge") THEN ((use_arg_then2 ("i_lt_k", [])) (disch_tac [])) THEN (clear_assumption "i_lt_k") THEN ((use_arg_then2 ("j_ineqs", [])) (disch_tac [])) THEN (clear_assumption "j_ineqs") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (Sections.add_section_hyp "inS_imp" (`!l. l IN S ==> LENGTH l <= k`));; (* Lemma lim_inS_eq *) let lim_inS_eq = Sections.section_proof ["v";"y"] `(!n. v n IN IMAGE (vector_of_list 3) S) /\ (v --> y) sequentially ==> vector_of_list 3 (list_of_vector 3 k y:(real^3)list):real^M = y` [ (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LIM_SEQUENTIALLY", [LIM_SEQUENTIALLY]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN ((move ["vS"]) THEN (move ["v_to_y"])))); (((((use_arg_then2 ("vector_of_list", [vector_of_list]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LAMBDA_UNIQUE", [LAMBDA_UNIQUE]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_ineqs"])); (((fun arg_tac -> arg_tac (Arg_term (`(i - 1) DIV 3 < k`))) (disch_eq_tac "h" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((THENL_FIRST) ((((use_arg_then2 ("list_of_vector", [list_of_vector]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Packing3.EL_TABLE", [Packing3.EL_TABLE]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("LAMBDA_BETA", [LAMBDA_BETA]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] [])))))) ((arith_tac) THEN (done_tac))); ((THENL_FIRST) ((((use_arg_then2 ("ADD_ASSOC", [ADD_ASSOC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIVISION", [DIVISION]))(gsym_then (thm_tac (new_rewrite [] [])))))) ((arith_tac) THEN (done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`i - 1 + 1 = i`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((ALL_TAC) THEN (done_tac))); ((((use_arg_then2 ("i_ineqs", [])) (disch_tac [])) THEN (clear_assumption "i_ineqs") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`!e. &0 < e ==> abs(y$i) < e`))) (term_tac (have_gen_tac []ALL_TAC)))); ((((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac)) THEN (((((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] []))))) THEN (move ["yn0"]))); (((fun arg_tac -> arg_tac (Arg_term (`abs (y$i)`))) (term_tac exists_tac)) THEN (((use_arg_then2 ("yn0", [])) (disch_tac [])) THEN (clear_assumption "yn0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((BETA_TAC THEN (move ["e"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("v_to_y", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (case THEN (move ["N"])) THEN (move ["hh"])) THEN (((fun arg_tac -> (use_arg_then2 ("hh", [])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("LE_REFL", [LE_REFL])) (fun fst_arg -> (use_arg_then2 ("N", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC)); (((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("NORM_BOUND_COMPONENT_LT", [NORM_BOUND_COMPONENT_LT])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("i_ineqs", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC))); (((use_arg_then2 ("VECTOR_SUB_COMPONENT", [VECTOR_SUB_COMPONENT]))(thm_tac (new_rewrite [] [])))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`v N$i = &0`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) ((((use_arg_then2 ("REAL_SUB_RZERO", [REAL_SUB_RZERO]))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); (((fun arg_tac -> (use_arg_then2 ("vS", [])) (fun fst_arg -> (use_arg_then2 ("N", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["x"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("inS_imp", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["len_leq"])); (((((use_arg_then2 ("vector_of_list_comp0", [vector_of_list_comp0]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_ineqs", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (split_tac)); ((((use_arg_then2 ("leq_trans", [leq_trans])) (disch_tac [])) THEN (clear_assumption "leq_trans") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`3 * k`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dim_ge", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq_mul2l", [leq_mul2l]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_FIRST) ((((use_arg_then2 ("leq_trans", [leq_trans])) (disch_tac [])) THEN (clear_assumption "leq_trans") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`3 * k + 1`))) (term_tac exists_tac)) THEN (split_tac)) ((((use_arg_then2 ("len_leq", [])) (disch_tac [])) THEN (clear_assumption "len_leq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`(a DIV d) * d <= a`))) (term_tac (have_gen_tac ["a"; "d"](move ["div"])))); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`d = 0`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("muln0", [muln0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIVISION", [DIVISION])) (fun fst_arg -> (use_arg_then2 ("eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [2] [])))) THEN (arith_tac) THEN (done_tac)); ((THENL_FIRST) ((((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN BETA_TAC) THEN ((((use_arg_then2 ("leqNgt", [leqNgt]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("leq_pmul2r", [leq_pmul2r])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`3`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))))) ((arith_tac) THEN (done_tac))); ((((use_arg_then2 ("i_ineqs", [])) (disch_tac [])) THEN (clear_assumption "i_ineqs") THEN ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("div", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`i - 1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`3`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Finalization of the section Lim_inS *) let lim_inS_EL = Sections.finalize_theorem lim_inS_EL;; let lim_inS_eq = Sections.finalize_theorem lim_inS_eq;; Sections.end_section "Lim_inS";; (* Section ContinuousOnCompact *) Sections.begin_section "ContinuousOnCompact";; (Sections.add_section_var (mk_var ("S", (`:(real^3)list -> bool`))));; (Sections.add_section_hyp "inS" (`!l. l IN S ==> LENGTH l = k`));; (Sections.add_section_hyp "compactS" (`compact (IMAGE (vector_of_list 3) S:real^M->bool)`));; (Sections.add_section_hyp "n_S_empty" (`~(S = {})`));; (* Lemma max_onS *) let max_onS = Sections.section_proof ["f"] `(lift o f o set_of_list o (list_of_vector 3 k:real^M->(real^3)list)) continuous_on (IMAGE (vector_of_list 3) S) ==> ?W. W IN IMAGE set_of_list S /\ (!V. V IN IMAGE set_of_list S ==> f V <= f W)` [ (((DISCH_THEN (fun snd_th -> (use_arg_then2 ("CONTINUOUS_ATTAINS_SUP", [CONTINUOUS_ATTAINS_SUP])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC) THEN ((((use_arg_then2 ("compactS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IMAGE_EQ_EMPTY", [IMAGE_EQ_EMPTY]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("n_S_empty", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["v"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["lS"]) THEN (move ["le"])); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`set_of_list l`))) (term_tac exists_tac)) THEN (split_tac)) (((use_arg_then2 ("l", [])) (term_tac exists_tac)) THEN (done_tac))); (BETA_TAC THEN (move ["V"]) THEN (case THEN (move ["y"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["yS"])); ((THENL_FIRST) ((((fun arg_tac -> (use_arg_then2 ("le", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vector_of_list 3 y:real^M`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)) (((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN (done_tac))); (((fun arg_tac -> (use_arg_then2 ("inS", [])) (fun fst_arg -> (use_arg_then2 ("lS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (use_arg_then2 ("inS", [])) (fun fst_arg -> (use_arg_then2 ("yS", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (move ["y_eq"]) THEN (move ["l_eq"])); (((repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("y_eq", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("l_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("l_eq", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ];; (* Finalization of the section ContinuousOnCompact *) let max_onS = Sections.finalize_theorem max_onS;; Sections.end_section "ContinuousOnCompact";; (Sections.add_section_var (mk_var ("S", (`:(real^3)list -> bool`))));; (* Section NormSet *) Sections.begin_section "NormSet";; (Sections.add_section_var (mk_var ("g", (`:num -> real`))));; (Sections.add_section_hyp "inS" (`!l. l IN S <=> LENGTH l = k /\ (!i. i < k ==> norm (EL i l) = g i)`));; (* Lemma closedNormS *) let closedNormS = Sections.section_proof [] `closed (IMAGE (vector_of_list 3) S:real^M->bool)` [ (((((use_arg_then2 ("CLOSED_SEQUENTIAL_LIMITS", [CLOSED_SEQUENTIAL_LIMITS]))(thm_tac (new_rewrite [] [])))) THEN (move ["v"]) THEN (move ["y"]) THEN (case THEN ((move ["vn_eq"]) THEN (move ["v_to_y"])))) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_term (`list_of_vector 3 k y`))) (term_tac exists_tac)) THEN (split_tac)); ((((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_eq", [lim_inS_eq])) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac) THEN (move ["l"]))); (((((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("leqnn", [leqnn])) (disch_tac [])) THEN (clear_assumption "leqnn") THEN (exact_tac)) THEN (done_tac)); (((((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt_k"])); ((fun arg_tac -> arg_tac (Arg_term (`EL i _`))) (term_tac (set_tac "x"))); ((((fun arg_tac -> (use_arg_then2 ("CONTINUOUS_AT_LIFT_NORM", [CONTINUOUS_AT_LIFT_NORM])) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("CONTINUOUS_AT_SEQUENTIALLY", [CONTINUOUS_AT_SEQUENTIALLY]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("x_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i_lt_k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC)) THEN BETA_TAC)); ((fun arg_tac -> arg_tac (Arg_term (`(lift o norm) o _`))) (term_tac (set_tac "r"))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`r = (\n. lift (g i))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))); (((((use_arg_then2 ("LIM_CONST_EQ", [LIM_CONST_EQ]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("TRIVIAL_LIMIT_SEQUENTIALLY", [TRIVIAL_LIMIT_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("LIFT_EQ", [LIFT_EQ]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac)); (((((use_arg_then2 ("r_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] [])))))) THEN (move ["n"]) THEN (simp_tac)); ((((fun arg_tac -> (use_arg_then2 ("vn_eq", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["len_eq"])) THEN (move ["norm_eq"]))); (((((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("norm_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Finalization of the section NormSet *) let closedNormS = Sections.finalize_theorem closedNormS;; Sections.end_section "NormSet";; (Sections.add_section_hyp "inS" (`!l. l IN S <=> set_of_list l SUBSET ball_annulus /\ packing (set_of_list l) /\ LENGTH l = k /\ uniq l`));; (* Lemma closedS *) let closedS = Sections.section_proof [] `closed (IMAGE (vector_of_list 3) S:real^M->bool)` [ (((((use_arg_then2 ("CLOSED_SEQUENTIAL_LIMITS", [CLOSED_SEQUENTIAL_LIMITS]))(thm_tac (new_rewrite [] [])))) THEN (move ["v"]) THEN (move ["y"]) THEN (case THEN ((move ["vn_eq"]) THEN (move ["v_to_y"])))) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> arg_tac (Arg_term (`list_of_vector 3 k y`))) (term_tac exists_tac)) THEN (split_tac)); ((((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_eq", [lim_inS_eq])) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac) THEN (move ["l"]))); (((((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("leqnn", [leqnn])) (disch_tac [])) THEN (clear_assumption "leqnn") THEN (exact_tac)) THEN (done_tac)); (((((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (split_tac)); (((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (move ["a"]) THEN (case THEN (move ["i"])) THEN (case THEN ((move ["i_lt"]) THEN (move ["a_eq"])))); ((((use_arg_then2 ("closed_ball_annulus", [closed_ball_annulus])) (disch_tac [])) THEN (clear_assumption "closed_ball_annulus") THEN BETA_TAC) THEN (((use_arg_then2 ("CLOSED_SEQUENTIAL_LIMITS", [CLOSED_SEQUENTIAL_LIMITS]))(thm_tac (new_rewrite [] [])))) THEN (DISCH_THEN apply_tac)); ((fun arg_tac -> arg_tac (Arg_term (`\n. EL i (list_of_vector 3 k (v n))`))) (term_tac exists_tac)); (((((use_arg_then2 ("a_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] []))))) THEN (move ["n"]) THEN (simp_tac)); ((((fun arg_tac -> (use_arg_then2 ("vn_eq", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["sub_l"])) THEN (case THEN (move ["_"])) THEN (move ["len_eq"]))); ((((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((((use_arg_then2 ("sub_l", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_ROT (-1)) (split_tac)); (((((fun arg_tac -> (use_arg_then2 ("uniq_nthP", [uniq_nthP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["j"]) THEN (case THEN ((move ["i_lt_j"]) THEN (move ["j_lt"])))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`i < k:num`))) (term_tac (have_gen_tac [](move ["i_lt"])))) ((((use_arg_then2 ("i_lt_j", [])) (disch_tac [])) THEN (clear_assumption "i_lt_j") THEN ((use_arg_then2 ("j_lt", [])) (disch_tac [])) THEN (clear_assumption "j_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((fun arg_tac -> arg_tac (Arg_term (`EL i _`))) (term_tac (set_tac "a"))) THEN ((fun arg_tac -> arg_tac (Arg_term (`EL j _`))) (term_tac (set_tac "b")))); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("j_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((fun arg_tac -> arg_tac (Arg_term (`\n. _ n`))) (term_tac (set_tac "f2"))); ((fun arg_tac -> arg_tac (Arg_term (`\n. _ n`))) (term_tac (set_tac "f1"))); ((((use_arg_then2 ("a_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("b_def", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("LIM_SEQUENTIALLY", [LIM_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))))); (BETA_TAC THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("REAL_LT_01", [REAL_LT_01])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC)) THEN (case THEN (move ["n1"])) THEN (move ["d2b"]) THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("REAL_LT_01", [REAL_LT_01])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC)) THEN (case THEN (move ["n2"])) THEN (move ["d1a"])); (((fun arg_tac -> (use_arg_then2 ("d2b", [])) (fun fst_arg -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("leq_addr", [leq_addr])) (fun fst_arg -> (use_arg_then2 ("n2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n1", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((fun arg_tac -> (use_arg_then2 ("d1a", [])) (fun fst_arg -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("leq_addl", [leq_addl])) (fun fst_arg -> (use_arg_then2 ("n1", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((((use_arg_then2 ("f1_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("f2_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)); ((((fun arg_tac -> (use_arg_then2 ("vn_eq", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`n1 + n2:num`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["_"])) THEN (case THEN (move ["pack"])) THEN (case THEN (move ["len_eq"])) THEN (move ["uniq_l"]))); (((((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["da"]) THEN (move ["db"])); ((in_tac ["uniq_l"] false (((fun arg_tac -> (use_arg_then2 ("uniq_nthP", [uniq_nthP])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (in_tac ["pack"] false (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL Sphere.packing_lt)))(thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("uniq_l", [])) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("j", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("i_lt_j", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("j_lt", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("EL_nth", [EL_nth]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["neq"]))); ((((use_arg_then2 ("neq", [])) (disch_tac [])) THEN (clear_assumption "neq") THEN ((use_arg_then2 ("contra", [contra])) (disch_tac [])) THEN (clear_assumption "contra") THEN (DISCH_THEN apply_tac) THEN (move ["eq"])) THEN (((use_arg_then2 ("pack", [])) (disch_tac [])) THEN (clear_assumption "pack") THEN (DISCH_THEN apply_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (repeat_tactic 1 9 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("da", [])) (disch_tac [])) THEN (clear_assumption "da") THEN ((use_arg_then2 ("db", [])) (disch_tac [])) THEN (clear_assumption "db") THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL i l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL j l`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (use_arg_then2 ("b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL Sphere.packing)))(thm_tac (new_rewrite [] [])))) THEN (move ["a"]) THEN (move ["b"])); ((((use_arg_then2 ("IN", [IN]))(gsym_then (thm_tac (new_rewrite [] [(`set_of_list _ a`)]))))) THEN (((use_arg_then2 ("IN", [IN]))(gsym_then (thm_tac (new_rewrite [] [(`set_of_list _ b`)]))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))))); ((repeat_tactic 1 9 (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))); (BETA_TAC THEN (case THEN ALL_TAC) THEN (case THEN (move ["i"])) THEN (case THEN ((move ["i_lt"]) THEN (move ["a_eq"]))) THEN (case THEN ALL_TAC) THEN (case THEN (move ["j"])) THEN (case THEN ((move ["j_lt"]) THEN (move ["b_eq"]))) THEN (move ["n_ab"])); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("vn_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_to_y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("j_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); ((fun arg_tac -> arg_tac (Arg_term (`\n. _ n`))) (term_tac (set_tac "f2"))); ((fun arg_tac -> arg_tac (Arg_term (`\n. _ n`))) (term_tac (set_tac "f1"))); (((((use_arg_then2 ("a_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("b_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["f2b"]) THEN (move ["f1a"])); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("LIM_NORM_LBOUND", [LIM_NORM_LBOUND])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`sequentially`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\n. f1 n - f2 n:real^3`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)); ((((use_arg_then2 ("TRIVIAL_LIMIT_SEQUENTIALLY", [TRIVIAL_LIMIT_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("LIM_SUB", [LIM_SUB]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EVENTUALLY_SEQUENTIALLY", [EVENTUALLY_SEQUENTIALLY]))(thm_tac (new_rewrite [] []))))); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("lim_not_equal", [lim_not_equal])) (fun fst_arg -> (use_arg_then2 ("n_ab", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("f1a", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("f2b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["N"])) THEN (move ["neq"])); ((((use_arg_then2 ("N", [])) (term_tac exists_tac)) THEN (move ["n"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("neq", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN ((((use_arg_then2 ("dist", [dist]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("f1_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("f2_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac))); ((((fun arg_tac -> (use_arg_then2 ("vn_eq", [])) (fun fst_arg -> (use_arg_then2 ("n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.packing", [Sphere.packing]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["_"])) THEN (case THEN ((move ["pack"]) THEN (move ["len_eq"]))))); (((((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (move ["el_neq"])); (((((use_arg_then2 ("pack", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN", [IN]))(gsym_then (thm_tac (new_rewrite [] [(`set_of_list l _`)]))))) THEN (((use_arg_then2 ("IN", [IN]))(gsym_then (thm_tac (new_rewrite [] [(`set_of_list l _`)]))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ];; (* Lemma compactS *) let compactS = Sections.section_proof [] `compact (IMAGE (vector_of_list 3) S:real^M->bool)` [ ((((use_arg_then2 ("COMPACT_EQ_BOUNDED_CLOSED", [COMPACT_EQ_BOUNDED_CLOSED]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("closedS", [closedS]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("bounded", [bounded]))(thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`sqrt (&k) * (&2 * h0)`))) (term_tac exists_tac)); (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN (move ["v"]) THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["sub_l"])) THEN (case THEN (move ["_"])) THEN (move ["len_eq"])); (in_tac ["dim_ge"] true (((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))); (((((fun arg_tac -> (use_arg_then2 ("vector_of_list_norm_bound", [vector_of_list_norm_bound])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["x"])); (((((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("sub_l", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (((use_arg_then2 ("Pack_defs.ball_annulus", [Pack_defs.ball_annulus]))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_CBALL_0", [IN_CBALL_0]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac)); ];; (* Lemma set_of_listS *) let set_of_listS = Sections.section_proof ["V"] `V IN (IMAGE set_of_list S) <=> packing V /\ V SUBSET ball_annulus /\ CARD V = k` [ (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] []))))) THEN ((THENL) (split_tac) [((case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN ((move ["len_eq"]) THEN (move ["uniq_l"])))); ((case THEN (move ["pack"])) THEN (case THEN (move ["sub"])) THEN (move ["card_eq"]))])); (((((use_arg_then2 ("card_set_of_list_uniq", [card_set_of_list_uniq]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`list_of_set V`))) (term_tac exists_tac)); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus])) (fun fst_arg -> (use_arg_then2 ("pack", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("sub", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["finV"]))); (((((use_arg_then2 ("SET_OF_LIST_OF_SET", [SET_OF_LIST_OF_SET]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("sub", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("pack", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LENGTH_LIST_OF_SET", [LENGTH_LIST_OF_SET]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("card_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("uniq_list_of_set", [uniq_list_of_set]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma scriptL_eq *) let scriptL_eq = Sections.section_proof ["v"] `v:real^M IN IMAGE (vector_of_list 3) S ==> scriptL (set_of_list (list_of_vector 3 k v)) = list_sum (list_of_vector 3 k v:(real^3)list) (\v. lmfun (norm v / &2))` [ (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["l"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (move ["_"])) THEN (case THEN (move ["_"])) THEN (case THEN ((move ["len_eq"]) THEN (move ["uniq_l"])))); ((((use_arg_then2 ("scriptL", [scriptL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("len_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac))); ((((use_arg_then2 ("list_sum_set_of_list", [list_sum_set_of_list]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma scriptL_continuous *) let scriptL_continuous = Sections.section_proof [] `(lift o scriptL o set_of_list o (list_of_vector 3 k:real^M->(real^3)list)) continuous_on (IMAGE (vector_of_list 3) S)` [ ((((use_arg_then2 ("CONTINUOUS_ON_SEQUENTIALLY", [CONTINUOUS_ON_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN (move ["v"]) THEN (move ["a"]) THEN (case THEN (move ["a_in"])) THEN (case THEN (move ["v_in"])) THEN (move ["v_to_a"])); ((fun arg_tac -> arg_tac (Arg_term (`_ o v`))) (term_tac (set_tac "f"))); ((fun arg_tac -> arg_tac (Arg_term (`f = lift o (\n. list_sum (list_of_vector 3 k (v n)) (\v:real^3. lmfun (norm v / &2)))`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((((((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("eq_ext", [eq_ext]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] [])))))) THEN (move ["n"])) THEN (((use_arg_then2 ("scriptL_eq", [scriptL_eq]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("scriptL_eq", [scriptL_eq]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL TENDSTO_REAL)))(gsym_then (thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("list_sum_continuous", [list_sum_continuous]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("lmfun_norm2_continuous", [lmfun_norm2_continuous]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"])); ((((fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma min_dist_k_continuous *) let min_dist_k_continuous = Sections.section_proof ["j"] `(lift o min_dist_k j o (list_of_vector 3 k:real^M->(real^3)list)) continuous_on (IMAGE (vector_of_list 3) S)` [ ((((use_arg_then2 ("CONTINUOUS_ON_SEQUENTIALLY", [CONTINUOUS_ON_SEQUENTIALLY]))(thm_tac (new_rewrite [] [])))) THEN (move ["v"]) THEN (move ["a"]) THEN (case THEN (move ["a_in"])) THEN (case THEN (move ["v_in"])) THEN (move ["v_to_a"])); ((repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("o_ASSOC", [o_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL TENDSTO_REAL)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("o_ASSOC", [o_ASSOC]))(gsym_then (thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (use_arg_then2 ("ETA_AX", [ETA_AX])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`min_dist_k j o _`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("min_dist_k_limit", [min_dist_k_limit]))(thm_tac (new_rewrite [] []))))); (((repeat_tactic 1 9 (((use_arg_then2 ("length_list_of_vector", [length_list_of_vector]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"])); ((((fun arg_tac -> (use_arg_then2 ("lim_inS_EL", [lim_inS_EL])) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Finalization of the section VectorOfList_Sets *) let lim_inS_EL = Sections.finalize_theorem lim_inS_EL;; let lim_inS_eq = Sections.finalize_theorem lim_inS_eq;; let max_onS = Sections.finalize_theorem max_onS;; let closedNormS = Sections.finalize_theorem closedNormS;; let closedS = Sections.finalize_theorem closedS;; let compactS = Sections.finalize_theorem compactS;; let set_of_listS = Sections.finalize_theorem set_of_listS;; let scriptL_eq = Sections.finalize_theorem scriptL_eq;; let scriptL_continuous = Sections.finalize_theorem scriptL_continuous;; let min_dist_k_continuous = Sections.finalize_theorem min_dist_k_continuous;; Sections.end_section "VectorOfList_Sets";; (* Section FNJLBXS *) Sections.begin_section "FNJLBXS";; (* Lemma sup_in_unions *) let sup_in_unions = Sections.section_proof ["f";"S"] `FINITE S ==> ~(UNIONS S = {}) /\ (!s. s IN S ==> s = {} \/ ?u. u IN s /\ (!y. y IN s ==> f y <= f u)) ==> ?v. v IN UNIONS S /\ (!y. y IN UNIONS S ==> f y <= f v)` [ ((((use_arg_then2 ("S", [])) (disch_tac [])) THEN (clear_assumption "S") THEN ((use_arg_then2 ("FINITE_INDUCT_STRONG", [FINITE_INDUCT_STRONG])) (thm_tac apply_tac))) THEN (((repeat_tactic 0 10 (((use_arg_then2 ("UNIONS_0", [UNIONS_0]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (move ["t"]) THEN (move ["S"]) THEN (case THEN (move ["IH"])) THEN (case THEN (move ["tnS"])) THEN (move ["finS"]))); (((repeat_tactic 1 9 (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL UNIONS_INSERT)))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_UNION", [IN_UNION]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["not_empty"])) THEN (move ["h"])); (((use_arg_then2 ("IH", [])) (disch_tac [])) THEN (clear_assumption "IH") THEN ((fun arg_tac -> arg_tac (Arg_term (`UNIONS S = {}`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(t = {})`))) (term_tac (have_gen_tac [](move ["t_not_empty"])))); ((((use_arg_then2 ("not_empty", [])) (disch_tac [])) THEN (clear_assumption "not_empty") THEN ((use_arg_then2 ("contra", [contra])) (disch_tac [])) THEN (clear_assumption "contra") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("UNION_EMPTY", [UNION_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("h", [])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("t_not_empty", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (done_tac)); ((THENL_FIRST) (ANTS_TAC) ((BETA_TAC THEN (move ["s"]) THEN (move ["sS"])) THEN (((use_arg_then2 ("h", [])) (disch_tac [])) THEN (clear_assumption "h") THEN (DISCH_THEN apply_tac)) THEN (done_tac))); ((BETA_TAC THEN (case THEN (move ["u1"])) THEN (case THEN (move ["u1_in"])) THEN (move ["u1_ineq"])) THEN (((fun arg_tac -> (use_arg_then2 ("h", [])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (simp_tac))); (((fun arg_tac -> arg_tac (Arg_term (`t = {}`))) (disch_eq_tac "t_eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); (((use_arg_then2 ("u1", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("u1_in", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("t_eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("h", [])) (fun fst_arg -> (use_arg_then2 ("t", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (simp_tac)) THEN (((((use_arg_then2 ("t_eq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ALL_TAC THEN (case THEN (move ["u0"])) THEN (case THEN (move ["u0t"])) THEN (move ["u0_ineq"]))); ((THENL) (((fun arg_tac -> arg_tac (Arg_term (`f u1 <= f u0`))) (disch_eq_tac "ineq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) [((use_arg_then2 ("u0", [])) (term_tac exists_tac)); ((use_arg_then2 ("u1", [])) (term_tac exists_tac))]); (((((use_arg_then2 ("u0t", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["y"])); ((((THENL) case [(DISCH_THEN (fun snd_th -> (use_arg_then2 ("u0_ineq", [])) (thm_tac (match_mp_then snd_th MP_TAC)))); (DISCH_THEN (fun snd_th -> (use_arg_then2 ("u1_ineq", [])) (thm_tac (match_mp_then snd_th MP_TAC))))]) THEN ((TRY done_tac))) THEN (((use_arg_then2 ("ineq", [])) (disch_tac [])) THEN (clear_assumption "ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("u1_in", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["y"])); ((((THENL) case [(DISCH_THEN (fun snd_th -> (use_arg_then2 ("u0_ineq", [])) (thm_tac (match_mp_then snd_th MP_TAC)))); (DISCH_THEN (fun snd_th -> (use_arg_then2 ("u1_ineq", [])) (thm_tac (match_mp_then snd_th MP_TAC))))]) THEN ((TRY done_tac))) THEN (((use_arg_then2 ("ineq", [])) (disch_tac [])) THEN (clear_assumption "ineq") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];;
let type150 = define_finite_type 150;;
(* Lemma type150_ineq *) let type150_ineq = Sections.section_proof [] `!k. k <= 43 ==> 3 * k <= dimindex (:150)` [ ((((fun arg_tac -> (use_arg_then2 ("DIMINDEX_UNIQUE", [DIMINDEX_UNIQUE])) (fun fst_arg -> (use_arg_then2 ("type150", [type150])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ];; (* Lemma scriptL_attains_max_in_ball_annulus *) let scriptL_attains_max_in_ball_annulus = Sections.section_proof [] `?W. packing W /\ W SUBSET ball_annulus /\ (!V. packing V /\ V SUBSET ball_annulus ==> scriptL V <= scriptL W)` [ ((fun arg_tac -> arg_tac (Arg_term (`\k. {V | packing V /\ V SUBSET ball_annulus /\ CARD V = k}`))) (term_tac (set_tac "G"))); ((fun arg_tac -> arg_tac (Arg_term (`packing V /\ V SUBSET ball_annulus <=> V IN UNIONS (IMAGE G (0..43))`))) (term_tac (have_gen_tac ["V"](move ["in_eq"])))); (((((use_arg_then2 ("UNIONS_IMAGE", [UNIONS_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("G_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN ((THENL) (split_tac) [(case THEN ((move ["packV"]) THEN (move ["subV"]))); ((case THEN (move ["k"])) THEN (simp_tac))])); (((fun arg_tac -> arg_tac (Arg_term (`CARD V`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("subV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("packV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("card_packing_ball_annulus", [card_packing_ball_annulus]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("CONJ_ASSOC", [CONJ_ASSOC]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("in_eq", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("sup_in_unions", [sup_in_unions]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FINITE_IMAGE", [FINITE_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_NUMSEG", [FINITE_NUMSEG]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (split_tac)); (((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("UNIONS_IMAGE", [UNIONS_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("G_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (((fun arg_tac -> arg_tac (Arg_term (`{}`))) (term_tac exists_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`0`))) (term_tac exists_tac)))); ((THENL_FIRST) (split_tac) ((arith_tac) THEN (done_tac))); (((((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("packing_empty", [packing_empty]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EMPTY_SUBSET", [EMPTY_SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CARD_CLAUSES", [CARD_CLAUSES]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_NUMSEG", [IN_NUMSEG]))(thm_tac (new_rewrite [] []))))) THEN (move ["s"]) THEN (case THEN (move ["k"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (move ["k_ineq"])); (((fun arg_tac -> arg_tac (Arg_term (`G k = {}`))) (disch_eq_tac "Gk_n_empty" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((((fun arg_tac -> (use_arg_then2 ("type150_ineq", [type150_ineq])) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("k_ineq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["dim_ge"]))); ((fun arg_tac -> arg_tac (Arg_term (`{l | set_of_list l SUBSET ball_annulus /\ packing (set_of_list l) /\ LENGTH l = k /\ uniq l}`))) (term_tac (set_tac "S"))); ((THENL_FIRST) ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("set_of_listS", [set_of_listS])) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((THENL) (ANTS_TAC) [ALL_TAC; (move ["inS"])])) (((((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`G k = IMAGE set_of_list S`))) (term_tac (have_gen_tac [](move ["Gk_eq"])))); (((((use_arg_then2 ("G_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inS", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_FIRST) ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("max_onS", [max_onS])) (fun fst_arg -> (use_arg_then2 ("S", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)) (((((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); ((THENL_FIRST) (ANTS_TAC) (((((fun arg_tac -> (use_arg_then2 ("compactS", [compactS])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); ((THENL_FIRST) (ANTS_TAC) (((((fun arg_tac -> (use_arg_then2 ("IMAGE_EQ_EMPTY", [IMAGE_EQ_EMPTY])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`set_of_list`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Gk_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac))); ((((use_arg_then2 ("Gk_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (DISCH_THEN apply_tac) THEN ((((fun arg_tac -> (use_arg_then2 ("scriptL_continuous", [scriptL_continuous])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma FNJLBXS *) let FNJLBXS = Sections.section_proof ["V"] `packing V /\ V SUBSET ball_annulus ==> (?W phi. BIJ phi V W /\ packing W /\ W SUBSET ball_annulus /\ (!v. v IN V ==> norm(v) = norm(phi v)) /\ (!w. w IN W ==> (set_of_edge w W (ESTD W) = {}) \/ (surrounded_node (W,(ESTD W)) w)))` [ (BETA_TAC THEN (case THEN ((move ["packV"]) THEN (move ["subV"])))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("card_packing_ball_annulus", [card_packing_ball_annulus])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("type150_ineq", [type150_ineq])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (move ["dim_ge"])); ((fun arg_tac -> arg_tac (Arg_term (`CARD V`))) (term_tac (set_tac "k"))); ((fun arg_tac -> arg_tac (Arg_term (`{l | set_of_list l SUBSET ball_annulus /\ packing (set_of_list l) /\ LENGTH l = k /\ uniq l}`))) (term_tac (set_tac "S"))); ((fun arg_tac -> arg_tac (Arg_term (`{l | LENGTH l = k /\ (!i. i < k ==> norm (EL i l:real^3) = norm (EL i (list_of_set V)))}`))) (term_tac (set_tac "N"))); ((fun arg_tac -> arg_tac (Arg_term (`IMAGE (vector_of_list 3) S INTER IMAGE (vector_of_list 3) N:real^150->bool`))) (term_tac (set_tac "R"))); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["finV"]))); ((fun arg_tac -> arg_tac (Arg_term (`compact R`))) (term_tac (have_gen_tac [](move ["compactR"])))); ((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("INTER_COMM", [INTER_COMM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CLOSED_INTER_COMPACT", [CLOSED_INTER_COMPACT]))(thm_tac (new_rewrite [] []))))); ((((fun arg_tac -> (use_arg_then2 ("compactS", [compactS])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("closedNormS", [closedNormS])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`\i. norm (EL i (list_of_set V))`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("N_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(R = {})`))) (term_tac (have_gen_tac [](move ["R_n_empty"])))); ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((fun arg_tac -> arg_tac (Arg_term (`vector_of_list 3 (list_of_set V)`))) (term_tac exists_tac))); ((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INTER", [IN_INTER]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("N_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("FUN_IN_IMAGE", [FUN_IN_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LENGTH_LIST_OF_SET", [LENGTH_LIST_OF_SET]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); (((((use_arg_then2 ("SET_OF_LIST_OF_SET", [SET_OF_LIST_OF_SET]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("uniq_list_of_set", [uniq_list_of_set]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`\j. min_dist_k j o (list_of_vector 3 k:real^150 -> (real^3)list)`))) (term_tac (set_tac "f"))); ((fun arg_tac -> arg_tac (Arg_term (`\j x. min_k j (mkseq (\i. f i x) k)`))) (term_tac (set_tac "c"))); ((fun arg_tac -> arg_tac (Arg_term (`(lift o c j) continuous_on R`))) (term_tac (have_gen_tac ["j"](move ["c_cont"])))); (((((use_arg_then2 ("CONTINUOUS_ON_EQ_CONTINUOUS_WITHIN", [CONTINUOUS_ON_EQ_CONTINUOUS_WITHIN]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REAL_CONTINUOUS_CONTINUOUS1)))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["x"]) THEN (move ["xR"])); (((((use_arg_then2 ("c_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("min_k_continuous", [min_k_continuous]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_lt_k"])); (((((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL REAL_CONTINUOUS_CONTINUOUS1)))(thm_tac (new_rewrite [] []))))) THEN ((use_arg_then2 ("CONTINUOUS_WITHIN_SUBSET", [CONTINUOUS_WITHIN_SUBSET])) (thm_tac apply_tac))); (((fun arg_tac -> arg_tac (Arg_term (`IMAGE (vector_of_list 3) S`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("INTER_SUBSET", [INTER_SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("xR", [])) (disch_tac [])) THEN (clear_assumption "xR") THEN BETA_TAC) THEN (((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INTER", [IN_INTER]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN ((move ["xS"]) THEN (move ["_"]))))); ((((use_arg_then2 ("xS", [])) (disch_tac [])) THEN (clear_assumption "xS") THEN ((use_arg_then2 ("x", [])) (disch_tac [])) THEN (clear_assumption "x") THEN BETA_TAC) THEN (((use_arg_then2 ("CONTINUOUS_ON_EQ_CONTINUOUS_WITHIN", [CONTINUOUS_ON_EQ_CONTINUOUS_WITHIN]))(gsym_then (thm_tac (new_rewrite [] [])))))); (((((fun arg_tac -> (use_arg_then2 ("min_dist_k_continuous", [min_dist_k_continuous])) (fun fst_arg -> (use_arg_then2 ("dim_ge", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`\f s. {x:real^150 | x IN s /\ (!y. y IN s ==> f y <= f x)}`))) (term_tac (set_tac "sup_set"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`sup_set f s SUBSET s`))) (term_tac (have_gen_tac ["f"; "s"](move ["sup_sub"])))) (((((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`compact s /\ s SUBSET R ==> compact (sup_set (c j) s)`))) (term_tac (have_gen_tac ["j"; "s"](move ["sup_comp"])))); ((BETA_TAC THEN (case THEN ((move ["comp_s"]) THEN (move ["s_sub"])))) THEN ((((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac))); (((((use_arg_then2 ("COMPACT_SUP_SET", [COMPACT_SUP_SET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("comp_s", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("CONTINUOUS_ON_SUBSET", [CONTINUOUS_ON_SUBSET])) (fun fst_arg -> (use_arg_then2 ("R", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s_sub", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("ETA_AX", [ETA_AX]))(fun arg -> ONCE_REWRITE_TAC[get_arg_thm arg])))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`compact s /\ s SUBSET R /\ ~(s = {}) ==> ~(sup_set (c j) s = {})`))) (term_tac (have_gen_tac ["j"; "s"](move ["sup_n_empty"])))); (BETA_TAC THEN (case THEN (move ["comp_s"])) THEN (case THEN ((move ["s_sub"]) THEN (move ["s_n"])))); ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("CONTINUOUS_ATTAINS_SUP", [CONTINUOUS_ATTAINS_SUP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("s_n", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("comp_s", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((repeat_tactic 1 9 (((use_arg_then2 ("ETA_AX", [ETA_AX]))(fun arg -> ONCE_REWRITE_TAC[get_arg_thm arg])))) THEN (((fun arg_tac -> (use_arg_then2 ("CONTINUOUS_ON_SUBSET", [CONTINUOUS_ON_SUBSET])) (fun fst_arg -> (use_arg_then2 ("R", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`?C. C 0 = sup_set (c 0) R /\ !i. C (SUC i) = sup_set (c i) (C i)`))) (term_tac (have_gen_tac [](case THEN ((move ["C"]) THEN (case THEN ((move ["C0"]) THEN (move ["CS"])))))))); ((general_rec_exists_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`compact (C i) /\ C i SUBSET R /\ ~(C i = {})`))) (term_tac (have_gen_tac ["i"](move ["C_props"])))); (((THENL) (((use_arg_then2 ("i", [])) (disch_tac [])) THEN (clear_assumption "i") THEN elim) [ALL_TAC; ALL_TAC; ALL_TAC; ((move ["i"]) THEN (move ["IH"]))]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("C0", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("CS", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sup_sub", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("sup_comp", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))))); (((((use_arg_then2 ("sup_n_empty", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("sup_n_empty", []))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac))) THEN ((use_arg_then2 ("SUBSET_TRANS", [SUBSET_TRANS])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`C i`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("IH", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_sub", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`i <= j:num ==> C j SUBSET C i`))) (term_tac (have_gen_tac ["i"; "j"](move ["C_sub"])))); (((THENL) (((use_arg_then2 ("j", [])) (disch_tac [])) THEN (clear_assumption "j") THEN ((use_arg_then2 ("i", [])) (disch_tac [])) THEN (clear_assumption "i") THEN case) [ALL_TAC; (move ["i"])]) THEN ((THENL) elim [ALL_TAC; ((move ["j"]) THEN (move ["jH"]))]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (TRY ((arith_tac)))); ((BETA_TAC THEN (move ["_"])) THEN ((use_arg_then2 ("SUBSET_TRANS", [SUBSET_TRANS])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`C j`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("CS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("jH", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("leq0n", [leq0n]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_FIRST) (((((use_arg_then2 ("leqSS", [leqSS]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("leq_eqVlt", [leq_eqVlt]))(thm_tac (new_rewrite [] []))))) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (move ["i_lt_j"])])) ((((use_arg_then2 ("SUBSET_REFL", [SUBSET_REFL]))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); (((use_arg_then2 ("SUBSET_TRANS", [SUBSET_TRANS])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`C j`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("CS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_sub", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("jH", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("ltE", [ltE]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("C_props", [])) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["_"])) THEN (case THEN (move ["Ck_sub"])) THEN (case THEN (move ["w"])) THEN (move ["w_in"]))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Packing3.IN_TRANS", [Packing3.IN_TRANS])) (fun fst_arg -> (use_arg_then2 ("w_in", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("Ck_sub", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC); (((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INTER", [IN_INTER]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("N_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN ALL_TAC) THEN (case THEN (move ["wl"])) THEN (case THEN (move ["w_eq"])) THEN (move ["wl_props"]) THEN (case THEN (move ["wl'"])) THEN (case THEN (move ["w_eq'"])) THEN (move ["wl'_props"])); ((fun arg_tac -> arg_tac (Arg_term (`wl' = wl`))) (term_tac (have_gen_tac [](move ["eq"])))); ((((use_arg_then2 ("w_eq", [])) (disch_tac [])) THEN (clear_assumption "w_eq") THEN BETA_TAC) THEN ((((use_arg_then2 ("w_eq'", []))(thm_tac (new_rewrite [] [])))) THEN (DISCH_THEN (fun snd_th -> (fun arg_tac -> (use_arg_then2 ("f_equal", [f_equal])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`list_of_vector 3 k:real^150->(real^3)list`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac (match_mp_then snd_th MP_TAC)))))); (((((use_arg_then2 ("wl'_props", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("wl_props", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("wl'_props", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((in_tac ["wl'_props"] false (((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("w_eq'", [])) (disch_tac [])) THEN (clear_assumption "w_eq'") THEN ((use_arg_then2 ("eq", [])) (disch_tac [])) THEN (clear_assumption "eq") THEN BETA_TAC THEN (move ["_"]) THEN (move ["_"]))); ((((fun arg_tac -> arg_tac (Arg_term (`set_of_list wl`))) (term_tac exists_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`\x. EL (indexl x (list_of_set V)) wl`))) (term_tac exists_tac))) THEN (split_tac)); ((((fun arg_tac -> (use_arg_then2 ("SET_OF_LIST_OF_SET", [SET_OF_LIST_OF_SET])) (fun fst_arg -> (use_arg_then2 ("finV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [2] []))))) THEN (((use_arg_then2 ("BIJ_from_lists", [BIJ_from_lists]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("uniq_list_of_set", [uniq_list_of_set]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac))); (((((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("LENGTH_LIST_OF_SET", [LENGTH_LIST_OF_SET]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((repeat_tactic 1 9 (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] []))))) THEN ((THENL) (split_tac) [((move ["v"]) THEN (move ["vV"])); ((move ["y"]) THEN (move ["y_wl"]))])); ((simp_tac) THEN (((use_arg_then2 ("wl'_props", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("EL_index", [EL_index]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("MEM_LIST_OF_SET", [MEM_LIST_OF_SET]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((((use_arg_then2 ("k_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("LENGTH_LIST_OF_SET", [LENGTH_LIST_OF_SET]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("index_mem", [index_mem]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_LIST_OF_SET", [MEM_LIST_OF_SET]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`i <= k:num ==> w IN C i`))) (term_tac (have_gen_tac ["i"](move ["w_in_all"])))); ((BETA_TAC THEN (move ["i_le"])) THEN ((((fun arg_tac -> (use_arg_then2 ("Packing3.IN_TRANS", [Packing3.IN_TRANS])) (fun fst_arg -> (use_arg_then2 ("w_in", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("C_sub", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("negb_or", [negb_or]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN ((move ["not_iso"]) THEN (move ["not_surr"]))))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`?wl'. wl' IN N /\ wl' IN S /\ (?n. n < k:num /\ (!i. i < n ==> c i (vector_of_list 3 wl') = c i w) /\ c n w < c n (vector_of_list 3 wl'))`))) (term_tac (have_gen_tac []ALL_TAC)))); (((((use_arg_then2 ("implybF", [implybF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_EXISTS_THM", [NOT_EXISTS_THM]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NOT_EXISTS_THM", [NOT_EXISTS_THM]))(thm_tac (new_rewrite [] []))))) THEN (move ["wl'"])); ((((fun arg_tac -> arg_tac (Arg_term (`wl' IN N`))) (disch_eq_tac "w'N" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) THEN (((fun arg_tac -> arg_tac (Arg_term (`wl' IN S`))) (disch_eq_tac "w'S" [])) THEN case THEN (simp_tac) THEN (move ["n"]) THEN (process_fst_eq_tac))); ((((use_arg_then2 ("implybF", [implybF]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["n_lt"])) THEN (case THEN (move ["ci_eq"])) THEN (move ["cn_lt"])); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`i <= n:num ==> vector_of_list 3 wl' IN C i`))) (term_tac (have_gen_tac ["i"](move ["w'C"]))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`w IN C (SUC n)`))) (term_tac (have_gen_tac []ALL_TAC))) (((((fun arg_tac -> (use_arg_then2 ("Packing3.IN_TRANS", [Packing3.IN_TRANS])) (fun fst_arg -> (use_arg_then2 ("w_in", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("C_sub", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ltE", [ltE]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac))); ((((use_arg_then2 ("CS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] []))))); ((DISJ2_TAC) THEN ((fun arg_tac -> arg_tac (Arg_term (`vector_of_list 3 wl'`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("w'C", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("leqnn", [leqnn]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_ROT (-1)) ((((THENL) (((use_arg_then2 ("i", [])) (disch_tac [])) THEN (clear_assumption "i") THEN elim) [ALL_TAC; ((move ["i"]) THEN (move ["IH"]))]) THEN (move ["i_le"])) THEN ((((fun arg_tac ->(use_arg_then2 ("C0", []))(fun tmp_arg1 -> (use_arg_then2 ("CS", []))(fun tmp_arg2 -> arg_tac (Arg_theorem (CONJ (get_arg_thm tmp_arg1) (get_arg_thm tmp_arg2))))))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))))); ((THENL_FIRST) ((((use_arg_then2 ("IH", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))) ((((use_arg_then2 ("i_le", [])) (disch_tac [])) THEN (clear_assumption "i_le") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((THENL_FIRST) ((BETA_TAC THEN (move ["y"]) THEN (move ["y_in"])) THEN (((fun arg_tac -> (use_arg_then2 ("w_in_all", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`SUC i`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)) ((((use_arg_then2 ("n_lt", [])) (disch_tac [])) THEN (clear_assumption "n_lt") THEN ((use_arg_then2 ("i_le", [])) (disch_tac [])) THEN (clear_assumption "i_le") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); (((((use_arg_then2 ("CS", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["_"])) THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("y_in", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC))); (((((use_arg_then2 ("ci_eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("ltE", [ltE]))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((((use_arg_then2 ("R_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("IN_INTER", [IN_INTER]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("FUN_IN_IMAGE", [FUN_IN_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (repeat_tactic 1 9 (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))) THEN (move ["y"]) THEN (move ["yR"])); ((((fun arg_tac -> (use_arg_then2 ("w_in_all", [])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("leq0n", [leq0n])) (fun fst_arg -> (use_arg_then2 ("k", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("C0", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("sup_set_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["_"])) THEN ((fun arg_tac -> (conv_thm_tac DISCH_THEN) (fun fst_arg -> (use_arg_then2 ("yR", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (thm_tac MP_TAC)))); ((THENL_LAST) (((fun arg_tac -> arg_tac (Arg_term (`n = 0`))) (disch_eq_tac "n_eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) (((((use_arg_then2 ("ci_eq", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("lt0n", [lt0n]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((use_arg_then2 ("cn_lt", [])) (disch_tac [])) THEN (clear_assumption "cn_lt") THEN BETA_TAC) THEN (((use_arg_then2 ("n_eq", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("y_wl", [])) (disch_tac [])) THEN BETA_TAC) THEN (((((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["r"])) THEN (case THEN (move ["r_lt"])) THEN (move ["y_eq"]))); ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k r wl`))) (term_tac (set_tac "dy"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`sizel wl = k`))) (term_tac (have_gen_tac [](move ["size_eq"])))) (((((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`?e. &0 < e /\ (!i. i < k /\ ~(i = r) ==> dist (EL i wl, y) = dy \/ dy + e <= dist (EL i wl, y))`))) (term_tac (have_gen_tac [](case THEN ((move ["e"]) THEN (case THEN ((move ["e_gt0"]) THEN (move ["e_cond"])))))))); ((fun arg_tac -> arg_tac (Arg_term (`map (\v. dist (v, y)) wl`))) (term_tac (set_tac "dl"))); ((fun arg_tac -> arg_tac (Arg_term (`\x. x = &0 \/ x = dy`))) (term_tac (set_tac "a"))); ((fun arg_tac -> arg_tac (Arg_term (`if all a dl then &1 else min_k 0 (filter (predC a) dl) - dy`))) (term_tac (set_tac "e"))); ((use_arg_then2 ("e", [])) (term_tac exists_tac)); ((fun arg_tac -> arg_tac (Arg_term (`!i. i < k ==> dist (EL i wl, y) <- dl`))) (term_tac (have_gen_tac [](move ["in_dl"])))); ((BETA_TAC THEN (move ["i"]) THEN (move ["i_ineqs"])) THEN ((((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dl_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_map", [size_map]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] [])))))); (((use_arg_then2 ("i", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("EL_map", [EL_map]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`!i. i < k ==> (dist (EL i wl, y) = &0 <=> i = r)`))) (term_tac (have_gen_tac [](move ["dist_n0"])))); ((THENL_LAST) ((BETA_TAC THEN (move ["i"]) THEN (move ["i_lt"])) THEN ((THENL) (split_tac) [ALL_TAC; (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))])) (((((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((((use_arg_then2 ("DIST_EQ_0", [DIST_EQ_0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((fun arg_tac -> (use_arg_then2 ("EL_nth", [EL_nth])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`vec 0`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("nth_uniq", [nth_uniq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((use_arg_then2 ("e_def", [])) (disch_tac [])) THEN (clear_assumption "e_def") THEN ((fun arg_tac -> arg_tac (Arg_term (`all a dl`))) (disch_eq_tac "all_dl" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((BETA_TAC THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (move ["i_lt"])) THEN (DISJ1_TAC)); ((in_tac ["all_dl"] false ((((use_arg_then2 ("allP", [allP]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac))) THEN (((fun arg_tac -> (use_arg_then2 ("all_dl", [])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`dist (EL i wl, y)`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC)); (((((use_arg_then2 ("in_dl", []))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("dist_n0", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (in_tac ["all_dl"] false ((((use_arg_then2 ("has_predC", [has_predC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("has_count", [has_count]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("count_filter", [count_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))))); (((fun arg_tac -> arg_tac (Arg_term (`filter _1 _2`))) (term_tac (set_tac "dl2"))) THEN (BETA_TAC THEN (move ["e_eq"])) THEN (split_tac)); ((((fun arg_tac -> (use_arg_then2 ("mem_min_k", [mem_min_k])) (fun fst_arg -> (use_arg_then2 ("all_dl", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("dl2_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dl2_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("negb_or", [negb_or]))(thm_tac (new_rewrite [] [])))))); (((((use_arg_then2 ("dl_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("mapP", [mapP]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["neq"])) THEN (case THEN (move ["v"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["i"])) THEN (case THEN (move ["i_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN (move ["eq"])); ((((use_arg_then2 ("e_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_SUB_LT", [REAL_SUB_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_LE", [REAL_LT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [2] []))))) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("neq", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("dy_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("i_lt", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_n0", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((BETA_TAC THEN (move ["i"]) THEN (case THEN ((move ["i_lt"]) THEN (move ["n_ir"])))) THEN (((fun arg_tac -> arg_tac (Arg_term (`_1 = _2`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac))); ((fun arg_tac -> arg_tac (Arg_term (`dist (EL i wl, y) <- dl2`))) (term_tac (have_gen_tac []ALL_TAC))); (((((use_arg_then2 ("dl2_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("mem_filter", [mem_filter]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_dl", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("predC", [predC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("a_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("negb_or", [negb_or]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_n0", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("e_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_SUB_ADD2", [REAL_SUB_ADD2]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["j"])) THEN (case THEN (move ["j_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("min_k0_le_EL", [min_k0_le_EL]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`set_of_list wl`))) (term_tac (set_tac "W"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`y IN W`))) (term_tac (have_gen_tac [](move ["yW"])))) (((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((fun arg_tac -> (use_arg_then2 ("Ckqowsa.CKQOWSA", [Ckqowsa.CKQOWSA])) (fun fst_arg -> (use_arg_then2 ("W", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN ((THENL) (ANTS_TAC) [ALL_TAC; (move ["fanW"])])); ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`2 <= k`))) (term_tac (have_gen_tac [](move ["k_ge2"])))); ((((use_arg_then2 ("not_iso", [])) (disch_tac [])) THEN (clear_assumption "not_iso") THEN BETA_TAC) THEN ((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ESTD", [ESTD]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac))); (BETA_TAC THEN (case THEN (move ["u"])) THEN (case THEN (move ["v"])) THEN (case THEN ALL_TAC) THEN (case THEN ALL_TAC) THEN (case THEN (move ["u'"])) THEN (case THEN (move ["v'"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["u'W"])) THEN (case THEN (move ["v'W"])) THEN (case THEN (move ["neq_uv'"])) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"])); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`2 <= CARD W`))) (term_tac (have_gen_tac []ALL_TAC)))) (((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("card_set_of_list_uniq", [card_set_of_list_uniq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Hypermap.CARD_TWO_ELEMENTS", [Hypermap.CARD_TWO_ELEMENTS])) (fun fst_arg -> (use_arg_then2 ("v'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("u'", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("CARD_SUBSET", [CARD_SUBSET]))(thm_tac (new_rewrite [] []))))); ((((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [2] []))))) THEN (((use_arg_then2 ("FINITE_SET_OF_LIST", [FINITE_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["x"]) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((THENL_FIRST) (((fun arg_tac -> (use_arg_then2 ("packing_eq_min_dist", [packing_eq_min_dist])) (fun fst_arg -> (use_arg_then2 ("wl", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)) THEN (ANTS_TAC)) ((((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); (((((use_arg_then2 ("W_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN (move ["min_dist_ge"])); ((fun arg_tac -> arg_tac (Arg_term (`dy <= &2 * h0`))) (term_tac (have_gen_tac [](move ["dy_le"])))); ((((use_arg_then2 ("not_iso", [])) (disch_tac [])) THEN (clear_assumption "not_iso") THEN BETA_TAC) THEN ((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ESTD", [ESTD]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("dy_def", []))(gsym_then (thm_tac (new_rewrite [] []))))))); (BETA_TAC THEN (case THEN (move ["u"])) THEN (case THEN (move ["v"])) THEN (case THEN ALL_TAC) THEN (case THEN ALL_TAC) THEN (case THEN (move ["u'"])) THEN (case THEN (move ["v'"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["u'W"])) THEN (case THEN (move ["v'W"])) THEN (case THEN (move ["neq_uv'"])) THEN (move ["dist_le"])); ((((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL Geomdetail.PAIR_EQ_EXPAND)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))); (BETA_TAC THEN (move ["eq_cases"]) THEN (case THEN (move ["i"])) THEN (case THEN (move ["i_lt"])) THEN (move ["v_eq"]) THEN (move ["_"])); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "ir" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) ((((use_arg_then2 ("neq_uv'", [])) (disch_tac [])) THEN (clear_assumption "neq_uv'") THEN ((use_arg_then2 ("eq_cases", [])) (disch_tac [])) THEN (clear_assumption "eq_cases") THEN case THEN (move ["eq"])) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("v_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ir", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`dist (u',v')`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dist_le", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("eq_cases", [])) (disch_tac [])) THEN (clear_assumption "eq_cases") THEN case THEN (move ["eq"])) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("eq", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (use_arg_then2 ("y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("v_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("y_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`{w | w IN W /\ dist (w, y) = dy}`))) (term_tac (set_tac "X"))); (in_tac ["r_lt"] false (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))); ((fun arg_tac -> arg_tac (Arg_term (`w IN X ==> w IN set_of_edge y W (ESTD W)`))) (term_tac (have_gen_tac ["w"](move ["subX"])))); (((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ESTD", [ESTD]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN ALL_TAC THEN (case THEN (move ["v"])) THEN (case THEN ALL_TAC) THEN (case THEN (move ["vW"])) THEN (move ["dist_eq"]) THEN (move ["eq"])); (((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))); ((((use_arg_then2 ("y", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("v", [])) (term_tac exists_tac))) THEN ((((use_arg_then2 ("vW", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("yW", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dy_le", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("DIST_EQ_0", [DIST_EQ_0]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] [])))))); ((((fun arg_tac -> (use_arg_then2 ("min_dist_ge", [])) (fun fst_arg -> (use_arg_then2 ("r_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("dy_def", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`w IN X ==> dist (w, y) = dy /\ w IN W`))) (term_tac (have_gen_tac ["w"](move ["inX"])))) (((((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac))); ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("not_surrounded_imp_on_one_side_of_plane", [not_surrounded_imp_on_one_side_of_plane])) (fun fst_arg -> (use_arg_then2 ("fanW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("yW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("not_surr", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("not_iso", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)); (BETA_TAC THEN (case THEN (move ["b"])) THEN (case THEN (move ["b_n0"])) THEN (case THEN (move ["y_dot_b"])) THEN (move ["b_cond"])); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("perturbation_lemma", [perturbation_lemma])) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("b_n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("y_dot_b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("X", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)) THEN ((THENL) (ANTS_TAC) [((move ["w"]) THEN (move ["wX"])); ALL_TAC])); ((((use_arg_then2 ("b_cond", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("subX", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_gt", [real_gt]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Ckqowsa_3_points.dot_pos_lemma", [Ckqowsa_3_points.dot_pos_lemma]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("inX", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dy_le", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] []))))); ((in_tac ["wl_props"] false (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("wl_props", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("yW", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("inX", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((use_arg_then2 ("b_n0", [])) (disch_tac [])) THEN (clear_assumption "b_n0") THEN ((use_arg_then2 ("y_dot_b", [])) (disch_tac [])) THEN (clear_assumption "y_dot_b") THEN ((use_arg_then2 ("b_cond", [])) (disch_tac [])) THEN (clear_assumption "b_cond") THEN BETA_TAC THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"])); (BETA_TAC THEN (case THEN (move ["u"])) THEN (case THEN (move ["norm_u"])) THEN (case THEN (move ["dist_uX"])) THEN (move ["dist_yu"])); ((fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. if i = r then u else EL i wl) k`))) (term_tac (set_tac "ul"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`sizel ul = k`))) (term_tac (have_gen_tac [](move ["size_ul"])))) (((((use_arg_then2 ("ul_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`EL r ul = u /\ (!i. i < k /\ ~(i = r) ==> EL i ul = EL i wl)`))) (term_tac (have_gen_tac [](move ["el_ul"])))); ((((((use_arg_then2 ("ul_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac))) THEN (move ["i"]) THEN (move ["i_ineqs"])) THEN (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); (((use_arg_then2 ("sup_comp", [])) (disch_tac [])) THEN (clear_assumption "sup_comp") THEN ((use_arg_then2 ("sup_sub", [])) (disch_tac [])) THEN (clear_assumption "sup_sub") THEN ((use_arg_then2 ("sup_set_def", [])) (disch_tac [])) THEN (clear_assumption "sup_set_def") THEN ((use_arg_then2 ("R_n_empty", [])) (disch_tac [])) THEN (clear_assumption "R_n_empty") THEN ((use_arg_then2 ("compactR", [])) (disch_tac [])) THEN (clear_assumption "compactR") THEN ((use_arg_then2 ("R_def", [])) (disch_tac [])) THEN (clear_assumption "R_def") THEN ((use_arg_then2 ("subV", [])) (disch_tac [])) THEN (clear_assumption "subV") THEN ((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN BETA_TAC THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"])); (((use_arg_then2 ("ul", [])) (term_tac exists_tac)) THEN (split_tac)); (((((use_arg_then2 ("N_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["i"]) THEN (move ["i_lt"])); (((use_arg_then2 ("wl'_props", [])) (disch_tac [])) THEN (clear_assumption "wl'_props") THEN BETA_TAC THEN (case THEN (move ["_"])) THEN (((conv_thm_tac DISCH_THEN)(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "ir" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("ir", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("y_eq", []))(gsym_then (thm_tac (new_rewrite [] []))))))) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k r wl < min_dist_k r ul /\ (!i. i < k /\ ~(i = r) /\ min_dist_k i wl <= dy ==> min_dist_k i wl <= min_dist_k i ul) /\ (!i. i < k /\ ~(i = r) /\ dy < min_dist_k i wl ==> dy < min_dist_k i ul)`))) (term_tac (have_gen_tac []ALL_TAC)))); (BETA_TAC THEN (case THEN (move ["dist_r"])) THEN (case THEN (move ["dist_le"])) THEN (move ["dist_gt"])); ((THENL_ROT (-1)) (split_tac)); ((((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("c_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("min_k", [min_k]))(thm_tac (new_rewrite [] [])))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`k = sizel (mkseq (\i. f i w) k)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [1] []))))))) ((((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); ((((use_arg_then2 ("real_sorted_lt2", [real_sorted_lt2])) (disch_tac [])) THEN (clear_assumption "real_sorted_lt2") THEN (DISCH_THEN apply_tac)) THEN (((fun arg_tac -> arg_tac (Arg_term (`mkseq (\i. f i (vector_of_list 3 ul)) k`))) (term_tac exists_tac)) THEN ((use_arg_then2 ("r", [])) (term_tac exists_tac)))); ((repeat_tactic 1 9 (((use_arg_then2 ("real_merge_sort", [real_merge_sort]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("size_mkseq", [size_mkseq]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("r_lt", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac))); (((((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (repeat_tactic 1 9 (((use_arg_then2 ("o_THM", [o_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("w_eq", []))(thm_tac (new_rewrite [] []))))) THEN (split_tac)); (((((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("size_ul", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((fun arg_tac ->(use_arg_then2 ("size_ul", []))(fun tmp_arg1 -> (use_arg_then2 ("size_eq", []))(fun tmp_arg2 -> arg_tac (Arg_theorem (CONJ (get_arg_thm tmp_arg1) (get_arg_thm tmp_arg2))))))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((split_tac) THEN (move ["i"]) THEN (case THEN (move ["i_lt"]))) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("EL_mkseq", [EL_mkseq]))(thm_tac (new_rewrite [] []))))) THEN ((simp_tac THEN TRY done_tac)) THEN (((use_arg_then2 ("size_eq", []))(gsym_then (thm_tac (new_rewrite [1; 2; 3] []))))) THEN (((use_arg_then2 ("size_ul", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size", [size]))(thm_tac (new_rewrite [] []))))) THEN (((repeat_tactic 1 9 (((use_arg_then2 ("vector_of_list_left_inverse", [vector_of_list_left_inverse]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("DIMINDEX_3", [DIMINDEX_3]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (repeat_tactic 0 10 (((fun arg_tac ->(use_arg_then2 ("size_ul", []))(fun tmp_arg1 -> (use_arg_then2 ("size_eq", []))(fun tmp_arg2 -> arg_tac (Arg_theorem (CONJ (get_arg_thm tmp_arg1) (get_arg_thm tmp_arg2))))))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dy_def", []))(thm_tac (new_rewrite [] []))))) THEN (move ["h"]))); ((THENL_LAST) (((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) ((((use_arg_then2 ("dist_le", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_LAST) (((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) ((((use_arg_then2 ("dist_gt", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac))); (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dy_def", []))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((((use_arg_then2 ("S_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] []))))) THEN ((THENL) (split_tac) [(move ["v"]); ALL_TAC])); (((((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EXISTS_EL", [MEM_EXISTS_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["i"])) THEN (case THEN (move ["i_lt"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("wl_props", [])) (disch_tac [])) THEN (clear_assumption "wl_props") THEN BETA_TAC) THEN (((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["in_ba"])) THEN (move ["_"]))); ((THENL_LAST) (((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) (((repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_ba", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_u", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_ba", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`!i. i < sizel ul ==> &2 <= min_dist_k i ul`))) (term_tac (have_gen_tac [](move ["ge2"]))))); ((((((fun arg_tac -> (use_arg_then2 ("min_dist_imp_packing", [min_dist_imp_packing])) (fun fst_arg -> (use_arg_then2 ("ge2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("min_dist_imp_uniq", [min_dist_imp_uniq]))(thm_tac (new_rewrite [] []))))) THEN (move ["i"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("ge2", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] [])))) THEN (move ["i"]) THEN (move ["i_lt"])); (((fun arg_tac -> arg_tac (Arg_term (`i = r`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN ((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (thm_tac apply_tac)) THEN ((use_arg_then2 ("dy", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dy_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("min_dist_ge", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> arg_tac (Arg_term (`dy < min_dist_k i wl`))) (disch_eq_tac "neq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); (((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (thm_tac apply_tac)) THEN ((use_arg_then2 ("dy", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("dy_def", []))(gsym_then (thm_tac (new_rewrite [1] []))))) THEN (((use_arg_then2 ("min_dist_ge", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dist_gt", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k i wl`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("min_dist_ge", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dist_le", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((use_arg_then2 ("C0", [])) (disch_tac [])) THEN (clear_assumption "C0") THEN ((use_arg_then2 ("sup_n_empty", [])) (disch_tac [])) THEN (clear_assumption "sup_n_empty") THEN ((use_arg_then2 ("c_cont", [])) (disch_tac [])) THEN (clear_assumption "c_cont") THEN ((use_arg_then2 ("c_def", [])) (disch_tac [])) THEN (clear_assumption "c_def") THEN ((use_arg_then2 ("f_def", [])) (disch_tac [])) THEN (clear_assumption "f_def") THEN ((use_arg_then2 ("finV", [])) (disch_tac [])) THEN (clear_assumption "finV") THEN ((use_arg_then2 ("N_def", [])) (disch_tac [])) THEN (clear_assumption "N_def") THEN ((use_arg_then2 ("S_def", [])) (disch_tac [])) THEN (clear_assumption "S_def") THEN ((use_arg_then2 ("k_def", [])) (disch_tac [])) THEN (clear_assumption "k_def") THEN ((use_arg_then2 ("dim_ge", [])) (disch_tac [])) THEN (clear_assumption "dim_ge") THEN BETA_TAC THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"])); (((use_arg_then2 ("not_surr", [])) (disch_tac [])) THEN (clear_assumption "not_surr") THEN ((use_arg_then2 ("not_iso", [])) (disch_tac [])) THEN (clear_assumption "not_iso") THEN ((use_arg_then2 ("w_in_all", [])) (disch_tac [])) THEN (clear_assumption "w_in_all") THEN ((use_arg_then2 ("wl'_props", [])) (disch_tac [])) THEN (clear_assumption "wl'_props") THEN ((use_arg_then2 ("wl_props", [])) (disch_tac [])) THEN (clear_assumption "wl_props") THEN ((use_arg_then2 ("w_eq", [])) (disch_tac [])) THEN (clear_assumption "w_eq") THEN ((use_arg_then2 ("w_in", [])) (disch_tac [])) THEN (clear_assumption "w_in") THEN ((use_arg_then2 ("Ck_sub", [])) (disch_tac [])) THEN (clear_assumption "Ck_sub") THEN ((use_arg_then2 ("C_sub", [])) (disch_tac [])) THEN (clear_assumption "C_sub") THEN ((use_arg_then2 ("C_props", [])) (disch_tac [])) THEN (clear_assumption "C_props") THEN ((use_arg_then2 ("CS", [])) (disch_tac [])) THEN (clear_assumption "CS") THEN BETA_TAC THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"]) THEN (move ["_"])); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`2 <= sizel ul /\ 2 <= sizel wl`))) (term_tac (have_gen_tac [](case THEN ((move ["ul_ge2"]) THEN (move ["wl_ge2"])))))) ((ALL_TAC) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`m < k /\ ~(m = r) ==> dy < dist (EL m wl, u)`))) (term_tac (have_gen_tac ["m"](move ["dist_m_u"])))); (BETA_TAC THEN (case THEN ((move ["m_lt"]) THEN (move ["m_neq"])))); (((fun arg_tac -> arg_tac (Arg_term (`EL m wl IN X`))) (disch_eq_tac "el_inX" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LET_TRANS", [REAL_LET_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LET_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`dist (y, EL m wl)`))) (term_tac exists_tac))); (((((use_arg_then2 ("dist_uX", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inX", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`EL m wl`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("u", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("y", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("dist_yu", [])) (disch_tac [])) THEN (clear_assumption "dist_yu") THEN BETA_TAC) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] []))))); ((THENL_LAST) (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("e_cond", [])) (fun fst_arg -> (use_arg_then2 ("m_lt", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("m_neq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) ((arith_tac) THEN (done_tac))); ((((use_arg_then2 ("el_inX", [])) (disch_tac [])) THEN (clear_assumption "el_inX") THEN ((use_arg_then2 ("contraR", [contraR])) (disch_tac [])) THEN (clear_assumption "contraR") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN ((move ["dist_eq"]) THEN (move ["_"]))))); (((((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_SET_OF_LIST", [IN_SET_OF_LIST]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("MEM_EL", [MEM_EL]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("size", [size]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (split_tac); ((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("ul_ge2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("r", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["m_neq"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))); (((repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dy_def", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_m_u", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((THENL_ROT (-1)) (((split_tac) THEN (move ["i"]) THEN (case THEN (move ["i_lt"])) THEN (case THEN (move ["i_neq"])) THEN (move ["ineq"])) THEN (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("min_dist_exists", [min_dist_exists])) (fun fst_arg -> (use_arg_then2 ("ul_ge2", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("i", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("size_ul", []))(thm_tac (new_rewrite [] [])))) THEN ALL_TAC THEN (case THEN (move ["m"])) THEN (case THEN (move ["m_lt"])) THEN (case THEN (move ["m_neq"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((THENL_FIRST) (((fun arg_tac -> arg_tac (Arg_term (`m = r`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) (((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_m_u", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN ((use_arg_then2 ("REAL_LTE_TRANS", [REAL_LTE_TRANS])) (thm_tac apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`min_dist_k i wl`))) (term_tac exists_tac))); (((((use_arg_then2 ("ineq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> arg_tac (Arg_term (`m = r`))) (disch_eq_tac "mr" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); (((((use_arg_then2 ("mr", []))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] []))))) THEN ((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (thm_tac apply_tac)) THEN ((use_arg_then2 ("dy", [])) (term_tac exists_tac))); (((((use_arg_then2 ("ineq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("dist_m_u", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((repeat_tactic 1 9 (((use_arg_then2 ("el_ul", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("min_dist_min", [min_dist_min]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("size_eq", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ];; (* Finalization of the section FNJLBXS *) let sup_in_unions = Sections.finalize_theorem sup_in_unions;; let type150_ineq = Sections.finalize_theorem type150_ineq;; let scriptL_attains_max_in_ball_annulus = Sections.finalize_theorem scriptL_attains_max_in_ball_annulus;; let FNJLBXS = Sections.finalize_theorem FNJLBXS;; Sections.end_section "FNJLBXS";; (* Section FCDJDOT *) Sections.begin_section "FCDJDOT";; (* Lemma not_surrounded_ECTC *) let not_surrounded_ECTC = Sections.section_proof ["V";"v"] `packing V /\ V SUBSET ball_annulus /\ v IN V /\ ~(surrounded_node (V, ECTC V) v) ==> (?W f. BIJ f V W /\ packing W /\ W SUBSET ball_annulus /\ (!u. u IN V ==> norm u = norm (f u)) /\ set_of_edge (f v) W (ECTC W) = {})` [ (BETA_TAC THEN (case THEN (move ["packV"])) THEN (case THEN (move ["subV"])) THEN (case THEN (move ["vV"])) THEN (move ["n_surr"])); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["finV"]))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Tame_general.UBHDEUU2", [Tame_general.UBHDEUU2])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)) THEN ((THENL) (ANTS_TAC) [ALL_TAC; (move ["fanV"])])); ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN (done_tac)); (((fun arg_tac -> arg_tac (Arg_term (`set_of_edge v V (ECTC V) = {}`))) (disch_eq_tac "n_iso" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((((use_arg_then2 ("V", [])) (term_tac exists_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`I`))) (term_tac exists_tac))) THEN ((((use_arg_then2 ("Hypermap.I_BIJ", [Hypermap.I_BIJ]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("I_THM", [I_THM]))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("not_surrounded_imp_on_one_side_of_plane", [not_surrounded_imp_on_one_side_of_plane])) (fun fst_arg -> (use_arg_then2 ("fanV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n_iso", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n_surr", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["n"])) THEN (case THEN (move ["n_n0"])) THEN (case THEN (move ["v_dot_n"])) THEN (move ["w_dot_n"])); ((fun arg_tac -> arg_tac (Arg_term (`set_of_edge v V (ECTC V)`))) (term_tac (set_tac "X"))); ((fun arg_tac -> arg_tac (Arg_term (`(V DELETE v) DIFF X`))) (term_tac (set_tac "Y"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`FINITE Y`))) (term_tac (have_gen_tac [](move ["finY"])))) (((((use_arg_then2 ("Y_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("FINITE_DIFF", [FINITE_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FINITE_DELETE", [FINITE_DELETE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`y IN Y <=> y IN V /\ &2 < dist (y, v)`))) (term_tac (have_gen_tac ["y"](move ["inY"])))); ((THENL_ROT (-1)) (((((use_arg_then2 ("Y_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_set_of_edge_ECTC", [in_set_of_edge_ECTC]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] []))))) THEN (split_tac))); ((THENL_LAST) ((BETA_TAC THEN (case THEN ((move ["yV"]) THEN (move ["dist_gt"])))) THEN ((((use_arg_then2 ("yV", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (split_tac)) ((((use_arg_then2 ("dist_gt", [])) (disch_tac [])) THEN (clear_assumption "dist_gt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((((use_arg_then2 ("dist_gt", [])) (disch_tac [])) THEN (clear_assumption "dist_gt") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((BETA_TAC THEN (case THEN ALL_TAC) THEN (case THEN (move ["yV"])) THEN (move ["ynv"])) THEN (((((use_arg_then2 ("yV", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_LT_LE", [REAL_LT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq_sym", [eq_sym]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); ((in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN (DISCH_THEN apply_tac)) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`x IN X <=> x IN V /\ dist (x, v) = &2`))) (term_tac (have_gen_tac ["x"](move ["inX"])))); (((((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_set_of_edge_ECTC", [in_set_of_edge_ECTC]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`y IN V /\ ~(y = v) /\ ~(y IN Y) ==> y IN X`))) (term_tac (have_gen_tac ["y"](move ["not_inY"])))); ((((((use_arg_then2 ("Y_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_DIFF", [IN_DIFF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`if Y = {} then &1 else min (&1) (inf (IMAGE (\x. dist (x,v) - &2) Y))`))) (term_tac (set_tac "e"))); ((fun arg_tac -> arg_tac (Arg_term (`&0 < e`))) (term_tac (have_gen_tac [](move ["e_gt0"])))); ((THENL_FIRST) ((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> arg_tac (Arg_term (`Y = {}`))) (disch_eq_tac "Y0" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac))) (((use_arg_then2 ("REAL_LT_01", [REAL_LT_01])) (disch_tac [])) THEN (clear_assumption "REAL_LT_01") THEN (exact_tac))); ((((use_arg_then2 ("REAL_LT_MIN", [REAL_LT_MIN]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("REAL_LT_INF_FINITE", [REAL_LT_INF_FINITE]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_IMAGE", [FINITE_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("IMAGE_EQ_EMPTY", [IMAGE_EQ_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["x"]) THEN (case THEN (move ["y"])) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("inY", []))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`e <= &1`))) (term_tac (have_gen_tac [](move ["e_le1"])))) ((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("perturbation_lemma", [perturbation_lemma])) (fun fst_arg -> (use_arg_then2 ("X", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("e_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n_n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v_dot_n", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (ANTS_TAC)); ((BETA_TAC THEN (move ["w"]) THEN (move ["wX"])) THEN ((((use_arg_then2 ("w_dot_n", []))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("wX", [])) (disch_tac [])) THEN (clear_assumption "wX") THEN ((use_arg_then2 ("subV", [])) (disch_tac [])) THEN (clear_assumption "subV") THEN BETA_TAC) THEN (((((use_arg_then2 ("X_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_set_of_edge_ECTC", [in_set_of_edge_ECTC]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_gt", [real_gt]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (move ["subV"]) THEN (case THEN ((move ["wV"]) THEN (move ["dist_eq"]))))); ((((use_arg_then2 ("Ckqowsa_3_points.dot_pos_lemma", [Ckqowsa_3_points.dot_pos_lemma])) (disch_tac [])) THEN (clear_assumption "Ckqowsa_3_points.dot_pos_lemma") THEN (DISCH_THEN apply_tac)) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("subV", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_eq", []))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); (BETA_TAC THEN (case THEN (move ["u"])) THEN (case THEN (move ["norm_eq"])) THEN (case THEN (move ["dist_lt"])) THEN (move ["dist_vu"])); ((fun arg_tac -> arg_tac (Arg_term (`~(v = u)`))) (term_tac (have_gen_tac [](move ["n_vu"])))); ((((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (move ["v_eq_u"]))); ((((use_arg_then2 ("n_iso", [])) (disch_tac [])) THEN (clear_assumption "n_iso") THEN BETA_TAC) THEN ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["x"])) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("dist_lt", [])) (thm_tac (match_mp_then snd_th MP_TAC)))))); (((((use_arg_then2 ("v_eq_u", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_REFL", [REAL_LT_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(u IN V)`))) (term_tac (have_gen_tac [](move ["nuV"])))); ((((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] [])))) THEN (move ["uV"])) THEN (in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("e_le1", [])) (disch_tac [])) THEN (clear_assumption "e_le1") THEN ((use_arg_then2 ("dist_vu", [])) (disch_tac [])) THEN (clear_assumption "dist_vu") THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("packV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("uV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n_vu", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`u INSERT (V DELETE v)`))) (term_tac (set_tac "W"))); ((fun arg_tac -> arg_tac (Arg_term (`\x. if x = v then u else x`))) (term_tac (set_tac "f"))); ((((use_arg_then2 ("W", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("f", [])) (term_tac exists_tac))) THEN (split_tac)); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`~(CARD V = 0)`))) (term_tac (have_gen_tac [](move ["card_n0"])))) (((((use_arg_then2 ("CARD_EQ_0", [CARD_EQ_0]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN (done_tac))); ((((use_arg_then2 ("Hypermap_iso.finite_surj_eq_bij", [Hypermap_iso.finite_surj_eq_bij]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_INSERT", [FINITE_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("CARD_CLAUSES", [CARD_CLAUSES]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_DELETE", [FINITE_DELETE]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("finV", []))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("nuV", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("CARD_DELETE", [CARD_DELETE]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("vV", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (((use_arg_then2 ("card_n0", [])) (disch_tac [])) THEN (clear_assumption "card_n0") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("SURJ", [SURJ]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN ((THENL) (split_tac) [((move ["x"]) THEN (move ["xV"])); ALL_TAC])); ((((fun arg_tac -> arg_tac (Arg_term (`x = v`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) THEN ((((use_arg_then2 ("xV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andTb", [andTb]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((THENL) (BETA_TAC THEN (move ["x"]) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["xV"]) THEN (move ["xnv"])))])) [((use_arg_then2 ("v", [])) (term_tac exists_tac)); ((use_arg_then2 ("x", [])) (term_tac exists_tac))]) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`x IN V ==> norm x = norm (f x)`))) (term_tac (have_gen_tac ["x"](move ["norm_eqV"])))); ((BETA_TAC THEN (move ["xV"])) THEN ((((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac)) THEN (((fun arg_tac -> arg_tac (Arg_term (`x = v`))) (disch_eq_tac "eq" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)) THEN ((((use_arg_then2 ("eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_eq", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`!x. x IN V /\ ~(x = v) ==> &2 < dist (x, u)`))) (term_tac (have_gen_tac [](move ["dist_gt2"])))); ((BETA_TAC THEN (move ["x"]) THEN (case THEN ((move ["xV"]) THEN (move ["xnv"])))) THEN (in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))))); ((THENL_ROT (-1)) (((fun arg_tac -> arg_tac (Arg_term (`x IN Y`))) (disch_eq_tac "xY" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac))); (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("not_inY", [])) (fun fst_arg -> (use_arg_then2 ("xY", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("xV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("xnv", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("dist_lt", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC) THEN ((DISCH_THEN (fun snd_th -> (use_arg_then2 ("REAL_LET_TRANS", [REAL_LET_TRANS])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (DISCH_THEN apply_tac)) THEN (((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN (DISCH_THEN apply_tac)) THEN (done_tac)); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`~(Y = {})`))) (term_tac (have_gen_tac [](move ["Yn0"])))) ((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac)) THEN (done_tac))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("packV", [])) (fun fst_arg -> (use_arg_then2 ("xV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("xnv", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("dist_vu", [])) (disch_tac [])) THEN (clear_assumption "dist_vu") THEN ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("u", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`e <= dist (x, v) - &2`))) (term_tac (have_gen_tac []ALL_TAC)))) ((arith_tac) THEN (done_tac))); (((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Yn0", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("REAL_MIN_LE", [REAL_MIN_LE]))(thm_tac (new_rewrite [] []))))) THEN (DISJ2_TAC)); ((((use_arg_then2 ("REAL_INF_LE_FINITE", [REAL_INF_LE_FINITE]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_IMAGE", [FINITE_IMAGE]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("IMAGE_EQ_EMPTY", [IMAGE_EQ_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); (((fun arg_tac -> arg_tac (Arg_term (`dist (x, v) - &2`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac)) THEN (done_tac)); ((((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))) THEN ((THENL) (split_tac) [((move ["x"]) THEN (move ["y"])); ALL_TAC])); (((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))))) THEN (in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))))); ((THENL_LAST) (BETA_TAC THEN (case THEN ALL_TAC) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["xV"]) THEN (move ["xnv"])))]) THEN (case THEN ALL_TAC) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["yV"]) THEN (move ["ynv"])))]) THEN ((TRY done_tac)) THEN (move ["neq"])) ((((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN (DISCH_THEN apply_tac)) THEN (done_tac))); (((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_gt2", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("REAL_LT_IMP_LE", [REAL_LT_IMP_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist_gt2", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((in_tac ["subV"] true ((repeat_tactic 1 9 (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] []))))))) THEN ((THENL) (split_tac) [(move ["x"]); ALL_TAC])); ((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] []))))); (((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["xV"]) THEN (move ["xnv"])))]) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("norm_eq", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("subV", []))(thm_tac (new_rewrite [] [])))))) THEN (done_tac)); (((THENL) (split_tac) [((move ["x"]) THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("norm_eqV", [])) (thm_tac (match_mp_then snd_th MP_TAC))))); ALL_TAC]) THEN ((TRY done_tac))); (((((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (move ["x"])) THEN ((((use_arg_then2 ("in_set_of_edge_ECTC", [in_set_of_edge_ECTC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("f_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("dist_gt2", [])) (disch_tac [])) THEN (clear_assumption "dist_gt2") THEN ((use_arg_then2 ("contraTF", [contraTF])) (disch_tac [])) THEN (clear_assumption "contraTF") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))))); ((THENL_FIRST) (BETA_TAC THEN (case THEN ALL_TAC) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [1] [])))); (case THEN ((move ["xV"]) THEN (move ["xnv"]) THEN (move ["dist_eq2"])))])) ((((use_arg_then2 ("DIST_REFL", [DIST_REFL]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac))); (((use_arg_then2 ("x", [])) (term_tac exists_tac)) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac))))) THEN ((((use_arg_then2 ("dist_eq2", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_REFL", [REAL_LT_REFL]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma isolated_node_norm_ECTC *) let isolated_node_norm_ECTC = Sections.section_proof ["V";"v"] `packing V /\ V SUBSET ball_annulus /\ (!W. packing W /\ W SUBSET ball_annulus ==> scriptL W <= scriptL V) /\ v IN V /\ set_of_edge v V (ECTC V) = {} ==> norm v = &2` [ (BETA_TAC THEN (case THEN (move ["packV"])) THEN (case THEN (move ["subV"])) THEN (case THEN (move ["maxV"])) THEN (case THEN (move ["vV"])) THEN (move ["edges0"])); ((THENL) (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("REAL_LET_TOTAL", [REAL_LET_TOTAL])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`norm v`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&2`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN case) [ALL_TAC; (move ["norm_gt2"])]); ((in_tac ["subV"] false (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("finite_packing_ball_annulus", [finite_packing_ball_annulus])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["finV"]))); ((fun arg_tac -> arg_tac (Arg_term (`{dist (u, v) - &2 | u | u IN V /\ ~(u = v)}`))) (term_tac (set_tac "D"))); ((fun arg_tac -> arg_tac (Arg_term (`FINITE D`))) (term_tac (have_gen_tac [](move ["finD"])))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`D = IMAGE (\x. dist (x,v) - &2) (V DELETE v)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))))) (((((use_arg_then2 ("FINITE_IMAGE", [FINITE_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("FINITE_DELETE", [FINITE_DELETE]))(thm_tac (new_rewrite [] []))))) THEN (done_tac))); (((((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_IMAGE", [IN_IMAGE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("D_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"])); (((THENL) (split_tac) [((case THEN (move ["u"])) THEN (case THEN (move ["h"])) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((case THEN (move ["u"])) THEN (case THEN (move ["x_eq"])) THEN (move ["h"]))]) THEN ((use_arg_then2 ("u", [])) (term_tac exists_tac)) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(D = {})`))) (term_tac (have_gen_tac [](move ["D_n0"])))); (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`~(V DELETE v = {})`))) (term_tac (have_gen_tac []ALL_TAC)))); (((repeat_tactic 1 9 (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] []))))) THEN ALL_TAC THEN (case THEN (move ["u"])) THEN (case THEN ((move ["uV"]) THEN (move ["unv"])))); (((fun arg_tac -> arg_tac (Arg_term (`dist (u, v) - &2`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("D_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN ((use_arg_then2 ("u", [])) (term_tac exists_tac)) THEN (done_tac)); ((((use_arg_then2 ("maxV", [])) (disch_tac [])) THEN (clear_assumption "maxV") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac)) THEN (((((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] []))))) THEN (move ["inV"]))); ((fun arg_tac -> arg_tac (Arg_term (`(&2 / norm v) % v`))) (term_tac (set_tac "w"))); ((fun arg_tac -> arg_tac (Arg_term (`norm w = &2`))) (term_tac (have_gen_tac [](move ["norm_w"])))); ((((use_arg_then2 ("w_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_MUL", [REAL_ABS_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_INV", [REAL_ABS_INV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_NORM", [REAL_ABS_NORM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(w = --w:real^3)`))) (term_tac (have_gen_tac [](move ["neg_w"])))); ((((use_arg_then2 ("norm_w", [])) (disch_tac [])) THEN (clear_assumption "norm_w") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac)) THEN ((((use_arg_then2 ("vector_eq_neg", [vector_eq_neg]))(thm_tac (new_rewrite [] [])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NORM_0", [NORM_0]))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); (((fun arg_tac -> arg_tac (Arg_term (`{w:real^3, --w}`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> arg_tac (Arg_term (`V = {v}`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))); ((((((use_arg_then2 ("EXTENSION", [EXTENSION]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_SING", [IN_SING]))(thm_tac (new_rewrite [] []))))) THEN (move ["x"])) THEN ((THENL) (split_tac) [(move ["xV"]); ((((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))) THEN ((TRY done_tac)))])); ((((fun arg_tac -> (use_arg_then2 ("inV", [])) (fun fst_arg -> (use_arg_then2 ("x", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("xV", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (done_tac)); ((THENL_ROT (-1)) (split_tac)); ((repeat_tactic 1 9 (((use_arg_then2 ("Tame_defs.scriptL", [Tame_defs.scriptL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_SING", [SUM_SING]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUM_CLAUSES", [SUM_CLAUSES]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_SING", [FINITE_SING]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_SING", [SUM_SING]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_SING", [IN_SING]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("neg_w", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); ((((use_arg_then2 ("NORM_NEG", [NORM_NEG]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_w", []))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("Sphere.lmfun", [Sphere.lmfun])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&2 / &2`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))); ((in_tac ["subV"] false (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> (use_arg_then2 ("lmfun_in_ball_annulus", [lmfun_in_ball_annulus])) (fun fst_arg -> (fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); (((((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("NOT_IN_EMPTY", [NOT_IN_EMPTY]))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] []))))) THEN (split_tac)); ((BETA_TAC THEN (move ["x"]) THEN (move ["y"]) THEN (case THEN ALL_TAC) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (case THEN ALL_TAC) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN ((repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`--w:real^3`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))) THEN ((((fun arg_tac -> arg_tac (Arg_theorem (VECTOR_ARITH `w - --w = &2 % w:real^3`)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_w", []))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ((BETA_TAC THEN (move ["x"]) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))))) THEN ((repeat_tactic 0 10 (((use_arg_then2 ("NORM_NEG", [NORM_NEG]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("norm_w", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`min (inf D) (norm v - &2) / norm v`))) (term_tac (set_tac "e"))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`&0 < norm v`))) (term_tac (have_gen_tac [](move ["norm_gt0"])))) ((((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((fun arg_tac -> arg_tac (Arg_term (`&0 < inf D`))) (term_tac (have_gen_tac [](move ["inf_gt0"])))); (((((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("REAL_LT_INF_FINITE", [REAL_LT_INF_FINITE])) (fun fst_arg -> (use_arg_then2 ("finD", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("D_n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("D_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)) THEN (move ["x"]) THEN (case THEN (move ["u"])) THEN (case THEN (case THEN ((move ["uV"]) THEN (move ["nuv"])))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("edges0", [])) (disch_tac [])) THEN (clear_assumption "edges0") THEN ((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac)) THEN (((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_SUB_LT", [REAL_SUB_LT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LT", [REAL_NOT_LT]))(thm_tac (new_rewrite [] []))))) THEN (move ["dist_le"]))); (((use_arg_then2 ("u", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("ECTC", [ECTC]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("uV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("u", [])) (term_tac exists_tac))) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))); ((in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] []))))) THEN ((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LE_ANTISYM", [REAL_LE_ANTISYM]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("dist_le", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("packV", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`&0 < e`))) (term_tac (have_gen_tac [](move ["e_gt0"])))); ((((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LT_DIV", [REAL_LT_DIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_LT_MIN", [REAL_LT_MIN]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inf_gt0", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`e < &1`))) (term_tac (have_gen_tac [](move ["e_lt1"])))); (((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Arc_properties.REAL_LT_ONE_LDIV", [Arc_properties.REAL_LT_ONE_LDIV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MIN_LT", [REAL_MIN_LT]))(thm_tac (new_rewrite [] []))))) THEN (split_tac) THEN (((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`(&1 - e) % v`))) (term_tac (set_tac "w"))); ((fun arg_tac -> arg_tac (Arg_term (`norm w < norm v`))) (term_tac (have_gen_tac [](move ["norm_w_lt"])))); ((((use_arg_then2 ("w_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("REAL_MUL_LID", [REAL_MUL_LID])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`norm v`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [2] [])))))); (((((use_arg_then2 ("REAL_LT_RMUL", [REAL_LT_RMUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("norm_gt0", []))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("e_gt0", [])) (disch_tac [])) THEN (clear_assumption "e_gt0") THEN ((use_arg_then2 ("e_lt1", [])) (disch_tac [])) THEN (clear_assumption "e_lt1") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`&2 <= norm w`))) (term_tac (have_gen_tac [](move ["norm_w_ge2"])))); ((((use_arg_then2 ("w_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> (use_arg_then2 ("REAL_DIV_1", [REAL_DIV_1])) (fun fst_arg -> (fun arg_tac -> arg_tac (Arg_term (`&1`))) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL RAT_LEMMA3)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("norm_gt0", []))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("REAL_LT_01", [REAL_LT_01]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((((use_arg_then2 ("REAL_INV_1", [REAL_INV_1]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("REAL_MUL_LID", [REAL_MUL_LID]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_MUL", [REAL_ABS_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_INV", [REAL_ABS_INV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_NORM", [REAL_ABS_NORM]))(thm_tac (new_rewrite [] []))))); (((((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("REAL_POS_NZ", [REAL_POS_NZ])) (fun fst_arg -> (use_arg_then2 ("norm_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))) THEN (arith_tac) THEN (done_tac)); (in_tac ["subV"] false ((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> arg_tac (Arg_term (`dist (v, w) = min (inf D) (norm v - &2)`))) (term_tac (have_gen_tac [](move ["d_vw"])))); ((((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("w_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (VECTOR_ARITH `!v. v - (&1 - e) % v = e % v`)))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("e_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_MUL", [REAL_ABS_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_INV", [REAL_ABS_INV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_NORM", [REAL_ABS_NORM]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("REAL_MUL_ASSOC", [REAL_MUL_ASSOC]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_MUL_LINV", [REAL_MUL_LINV]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((fun arg_tac -> (use_arg_then2 ("REAL_POS_NZ", [REAL_POS_NZ])) (fun fst_arg -> (use_arg_then2 ("norm_gt0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac)) THEN (((use_arg_then2 ("REAL_MUL_RID", [REAL_MUL_RID]))(thm_tac (new_rewrite [] []))))); ((((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN ((use_arg_then2 ("inf_gt0", [])) (disch_tac [])) THEN (clear_assumption "inf_gt0") THEN ((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`~(w IN V DELETE v)`))) (term_tac (have_gen_tac [](move ["in_w"])))); (((((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("negb_and", [negb_and]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("negbK", [negbK]))(thm_tac (new_rewrite [] []))))) THEN (DISJ1_TAC)); ((((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (move ["wV"])) THEN ((((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN ((use_arg_then2 ("w", [])) (term_tac exists_tac))) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))); ((((use_arg_then2 ("norm_w_lt", [])) (disch_tac [])) THEN (clear_assumption "norm_w_lt") THEN ((use_arg_then2 ("contraL", [contraL])) (disch_tac [])) THEN (clear_assumption "contraL") THEN (DISCH_THEN apply_tac) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_LT_REFL", [REAL_LT_REFL]))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((((use_arg_then2 ("d_vw", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inf_gt0", [])) (disch_tac [])) THEN (clear_assumption "inf_gt0") THEN ((use_arg_then2 ("norm_gt2", [])) (disch_tac [])) THEN (clear_assumption "norm_gt2") THEN ((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ((fun arg_tac -> arg_tac (Arg_term (`w INSERT (V DELETE v)`))) (term_tac (set_tac "W"))); ((((use_arg_then2 ("maxV", [])) (disch_tac [])) THEN (clear_assumption "maxV") THEN ((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac) THEN (move ["_"])) THEN ((((use_arg_then2 ("NOT_FORALL_THM", [NOT_FORALL_THM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))))); ((THENL_ROT (-1)) (((use_arg_then2 ("W", [])) (term_tac exists_tac)) THEN (split_tac))); ((repeat_tactic 1 9 (((use_arg_then2 ("Tame_defs.scriptL", [Tame_defs.scriptL]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("SUM_CLAUSES", [SUM_CLAUSES]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("FINITE_DELETE", [FINITE_DELETE]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((((use_arg_then2 ("in_w", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac) THEN (((use_arg_then2 ("SUM_DELETE", [SUM_DELETE]))(thm_tac (new_rewrite [] [])))) THEN ((simp_tac THEN TRY done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`lmfun (norm v / &2) < lmfun (norm w / &2)`))) (term_tac (have_gen_tac []ALL_TAC)))) ((arith_tac) THEN (done_tac))); ((((use_arg_then2 ("norm_w_lt", [])) (disch_tac [])) THEN (clear_assumption "norm_w_lt") THEN ((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("Sphere.lmfun", [Sphere.lmfun]))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))) THEN (arith_tac) THEN (done_tac)); ((THENL_ROT (-1)) (((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] []))))) THEN ((THENL) (split_tac) [((move ["x"]) THEN (move ["y"])); (move ["x"])]))); ((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("in_ball_annulus", [in_ball_annulus]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Sphere.h0", [Sphere.h0]))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); ALL_TAC]) ((((fun arg_tac -> (use_arg_then2 ("subV", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN ((use_arg_then2 ("norm_w_lt", [])) (disch_tac [])) THEN (clear_assumption "norm_w_lt") THEN ((use_arg_then2 ("norm_w_ge2", [])) (disch_tac [])) THEN (clear_assumption "norm_w_ge2") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac))); ((BETA_TAC THEN (case THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("subV", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (case THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((((use_arg_then2 ("W_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("IN_DELETE", [IN_DELETE]))(thm_tac (new_rewrite [] [])))))) THEN (in_tac ["packV"] false (((use_arg_then2 ("packing", [packing]))(thm_tac (new_rewrite [] [])))))); ((fun arg_tac -> arg_tac (Arg_term (`z IN V /\ ~(z = v) ==> &2 <= dist (z, w)`))) (term_tac (have_gen_tac ["z"](move ["h"])))); ((THENL_ROT (-1)) ((BETA_TAC THEN (case THEN ((move ["zV"]) THEN (move ["znv"])))) THEN (((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`dist (z, v) - dist (v, w)`))) (term_tac exists_tac)) THEN (split_tac))); ((((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("DIST_TRIANGLE", [DIST_TRIANGLE])) (fun fst_arg -> (use_arg_then2 ("z", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("w", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("v", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (((fun arg_tac -> (use_arg_then2 ("DIST_SYM", [DIST_SYM])) (fun fst_arg -> (use_arg_then2 ("w", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (arith_tac) THEN (done_tac)); ((((use_arg_then2 ("REAL_LE_TRANS", [REAL_LE_TRANS])) (disch_tac [])) THEN (clear_assumption "REAL_LE_TRANS") THEN (DISCH_THEN apply_tac)) THEN ((fun arg_tac -> arg_tac (Arg_term (`dist (z, v) - inf D`))) (term_tac exists_tac))); ((THENL_LAST) ((((use_arg_then2 ("d_vw", []))(thm_tac (new_rewrite [] [])))) THEN (split_tac)) ((arith_tac) THEN (done_tac))); ((THENL_FIRST) (((THENL_ROT 1)) ((fun arg_tac -> arg_tac (Arg_term (`inf D <= dist (z,v) - &2`))) (term_tac (have_gen_tac []ALL_TAC)))) ((arith_tac) THEN (done_tac))); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("REAL_INF_LE_FINITE", [REAL_INF_LE_FINITE])) (fun fst_arg -> (use_arg_then2 ("finD", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("D_n0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))); (((fun arg_tac -> arg_tac (Arg_term (`dist (z,v) - &2`))) (term_tac exists_tac)) THEN ((((use_arg_then2 ("REAL_LE_REFL", [REAL_LE_REFL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("andbT", [andbT]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("D_def", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("IN_ELIM_THM", [IN_ELIM_THM]))(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); (((use_arg_then2 ("z", [])) (term_tac exists_tac)) THEN (done_tac)); ((THENL_LAST) (BETA_TAC THEN (case THEN ALL_TAC) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["xV"]) THEN (move ["xnv"])))]) THEN (case THEN ALL_TAC) THEN ((THENL) case [(((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] [])))); (case THEN ((move ["yV"]) THEN (move ["ynv"])))]) THEN ((TRY done_tac)) THEN (move ["neq"])) ((((use_arg_then2 ("packV", [])) (disch_tac [])) THEN (clear_assumption "packV") THEN (DISCH_THEN apply_tac)) THEN (done_tac))); (((((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ((((use_arg_then2 ("h", []))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ];; (* Lemma not_surrounded_node_norm_ECTC *) let not_surrounded_node_norm_ECTC = Sections.section_proof ["V";"v"] `packing V /\ V SUBSET ball_annulus /\ (!W. packing W /\ W SUBSET ball_annulus ==> scriptL W <= scriptL V) /\ v IN V /\ ~(surrounded_node (V, ECTC V) v) ==> norm v = &2` [ (BETA_TAC THEN (case THEN (move ["packV"])) THEN (case THEN (move ["subV"])) THEN (case THEN (move ["maxV"])) THEN (case THEN (move ["vV"])) THEN (move ["n_surr"])); ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("not_surrounded_ECTC", [not_surrounded_ECTC])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("n_surr", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (case THEN ((move ["W"]) THEN (case THEN (move ["f"])) THEN (case THEN (move ["bij_f"])) THEN (case THEN (move ["packW"])) THEN (case THEN (move ["subW"])) THEN (case THEN (move ["normW"])) THEN (move ["isoW"]))))); ((fun arg_tac -> arg_tac (Arg_term (`packing U /\ U SUBSET ball_annulus ==> scriptL U <= scriptL W`))) (term_tac (have_gen_tac ["U"](move ["maxW"])))); (((DISCH_THEN (fun snd_th -> (use_arg_then2 ("maxV", [])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN BETA_TAC) THEN (((fun arg_tac -> (use_arg_then2 ("bij_scriptL", [bij_scriptL])) (fun fst_arg -> (use_arg_then2 ("bij_f", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (done_tac)); ((THENL_LAST) (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("isolated_node_norm_ECTC", [isolated_node_norm_ECTC])) (fun fst_arg -> (use_arg_then2 ("packW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("maxW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("isoW", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)) THEN (ANTS_TAC)) ((((use_arg_then2 ("normW", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (done_tac))); ((((use_arg_then2 ("bij_f", [])) (disch_tac [])) THEN (clear_assumption "bij_f") THEN BETA_TAC) THEN (((((use_arg_then2 ("BIJ", [BIJ]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("INJ", [INJ]))(thm_tac (new_rewrite [] []))))) THEN (((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma radV_2 *) let radV_2 = Sections.section_proof ["a";"b"] `radV {a,b} = norm (b - a) / &2` [ ((((fun arg_tac -> (use_arg_then2 ("Rogers.OAPVION2", [Rogers.OAPVION2])) (fun fst_arg -> (use_arg_then2 ("b", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg)))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("AFFINE_INDEPENDENT_2", [AFFINE_INDEPENDENT_2]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 0 10 (((use_arg_then2 ("IN_INSERT", [IN_INSERT]))(thm_tac (new_rewrite [] []))))) THEN ((TRY done_tac))); ((((use_arg_then2 ("Rogers.CIRCUMCENTER_2", [Rogers.CIRCUMCENTER_2]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("midpoint", [midpoint]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("dist", [dist]))(thm_tac (new_rewrite [] []))))); ((THENL_FIRST) ((fun arg_tac -> arg_tac (Arg_term (`inv(&2) % (a + b) - b = inv (&2) % (a - b)`))) (term_tac (have_gen_tac [](((conv_thm_tac DISCH_THEN)(thm_tac (new_rewrite [] []))))))) ((VECTOR_ARITH_TAC) THEN (done_tac))); (((((use_arg_then2 ("NORM_MUL", [NORM_MUL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_INV", [REAL_ABS_INV]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_ABS_NUM", [REAL_ABS_NUM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NORM_SUB", [NORM_SUB]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_MUL_SYM", [REAL_MUL_SYM]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_div", [real_div]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma hl2 *) let hl2 = Sections.section_proof ["a";"b"] `hl [a;b] = norm (b - a) / &2` [ (((((use_arg_then2 ("Pack_defs.HL", [Pack_defs.HL]))(thm_tac (new_rewrite [] [])))) THEN (repeat_tactic 1 9 (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL set_of_list)))(thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("radV_2", [radV_2]))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma lmfun_ineq_center_scriptL *) let lmfun_ineq_center_scriptL = Sections.section_proof ["V"] `lmfun_ineq_center V <=> scriptL V <= &12` [ (((((use_arg_then2 ("Pack_defs.lmfun_ineq_center", [Pack_defs.lmfun_ineq_center]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("scriptL", [scriptL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("hl2", [hl2]))(thm_tac (new_rewrite [] [])))) THEN (((fun arg_tac -> arg_tac (Arg_theorem (GEN_ALL VECTOR_SUB_RZERO)))(thm_tac (new_rewrite [] []))))) THEN (done_tac)); ];; (* Lemma FCDJDOT *) let FCDJDOT = Sections.section_proof [] `pack_ineq_def_a ==> (?W. packing W /\ W SUBSET ball_annulus /\ scriptL W > &12) ==> (?V. contravening V)` [ (BETA_TAC THEN (move ["ineqs"]) THEN (case THEN (move ["W0"])) THEN (move ["W0_props"])); (((use_arg_then2 ("scriptL_attains_max_in_ball_annulus", [scriptL_attains_max_in_ball_annulus])) (disch_tac [])) THEN (clear_assumption "scriptL_attains_max_in_ball_annulus") THEN BETA_TAC THEN (case THEN (move ["W1"])) THEN (case THEN (move ["packW1"])) THEN (case THEN (move ["subW1"])) THEN (move ["W1max"])); ((fun arg_tac -> arg_tac (Arg_term (`scriptL W1 > &12`))) (term_tac (have_gen_tac [](move ["W1_gt12"])))); ((((fun arg_tac -> (use_arg_then2 ("W1max", [])) (fun fst_arg -> (use_arg_then2 ("W0", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("W0_props", []))(thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("real_gt", [real_gt]))(thm_tac (new_rewrite [] []))))) THEN ((DISCH_THEN (fun snd_th -> (use_arg_then2 ("REAL_LTE_TRANS", [REAL_LTE_TRANS])) (thm_tac (match_mp_then snd_th MP_TAC)))) THEN (DISCH_THEN apply_tac)) THEN (((use_arg_then2 ("real_gt", [real_gt]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (done_tac)); (((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("FNJLBXS", [FNJLBXS])) (fun fst_arg -> (use_arg_then2 ("packW1", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subW1", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC THEN (case THEN (move ["V"])) THEN (case THEN (move ["f"])) THEN (case THEN (move ["bij_f"])) THEN (case THEN (move ["packV"])) THEN (case THEN (move ["subV"])) THEN (case THEN (move ["norm_eq"])) THEN (move ["V_ESTD"])); ((fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("bij_scriptL", [bij_scriptL])) (fun fst_arg -> (use_arg_then2 ("bij_f", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("norm_eq", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN (move ["LV_eq"]))); (((use_arg_then2 ("V", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("contravening", [contravening]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("packV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("subV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LV_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("W1_gt12", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac))); (((split_tac) THEN ((TRY done_tac))) THEN (split_tac)); (((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Counting_spheres.DLWCHEM", [Counting_spheres.DLWCHEM])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("ineqs", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)); (((((use_arg_then2 ("lmfun_ineq_center_scriptL", [lmfun_ineq_center_scriptL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LV_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_gt", [real_gt]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN (done_tac)); ((THENL_ROT (-1)) ((split_tac) THEN (move ["v"]) THEN (move ["vV"]))); (((fun arg_tac -> arg_tac (Arg_term (`surrounded_node _1 v`))) (disch_eq_tac "h" [])) THEN case THEN (simp_tac) THEN (process_fst_eq_tac)); ((((fun arg_tac -> (use_arg_then2 ("not_surrounded_node_norm_ECTC", [not_surrounded_node_norm_ECTC])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (done_tac)); ((((fun arg_tac -> (use_arg_then2 ("V_ESTD", [])) (fun fst_arg -> (use_arg_then2 ("vV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN (case THEN ((TRY done_tac)) THEN (move ["set0"])) THEN (((use_arg_then2 ("contraT", [contraT])) (disch_tac [])) THEN (clear_assumption "contraT") THEN (DISCH_THEN apply_tac) THEN (move ["_"]))); ((fun arg_tac -> (fun arg_tac -> (fun arg_tac -> (use_arg_then2 ("Counting_spheres.XULJEPR", [Counting_spheres.XULJEPR])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("subV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun fst_arg -> (use_arg_then2 ("ineqs", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (fun arg -> thm_tac MP_TAC arg THEN ALL_TAC)); ((((use_arg_then2 ("implybF", [implybF]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("NOT_IMP", [NOT_IMP]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("lmfun_ineq_center_scriptL", [lmfun_ineq_center_scriptL]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("LV_eq", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("real_gt", [real_gt]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("W1_gt12", []))(thm_tac (new_rewrite [] [])))) THEN (simp_tac)); (((use_arg_then2 ("v", [])) (term_tac exists_tac)) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))); ((((fun arg_tac -> (use_arg_then2 ("isolated_node_norm_ECTC", [isolated_node_norm_ECTC])) (fun fst_arg -> (use_arg_then2 ("packV", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN (DISCH_THEN apply_tac)) THEN (repeat_tactic 1 9 (((split_tac) THEN ((TRY done_tac)))))); ((((use_arg_then2 ("set0", [])) (disch_tac [])) THEN (clear_assumption "set0") THEN ((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac)) THEN ((repeat_tactic 1 9 (((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] [])))))) THEN ALL_TAC THEN (case THEN (move ["x"])))); (((repeat_tactic 1 9 (((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] []))))) THEN (repeat_tactic 1 9 (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))))) THEN (((fun arg_tac -> (use_arg_then2 ("ECTC_sub_ESTD", [ECTC_sub_ESTD])) (fun fst_arg -> (use_arg_then2 ("V", [])) (fun snd_arg -> combine_args_then arg_tac fst_arg snd_arg))) (disch_tac [])) THEN BETA_TAC) THEN ((((use_arg_then2 ("SUBSET", [SUBSET]))(thm_tac (new_rewrite [] [])))) THEN (move ["subCS"]))); ((BETA_TAC THEN (case THEN (DISCH_THEN (fun snd_th -> (use_arg_then2 ("subCS", [])) (thm_tac (match_mp_then snd_th MP_TAC))))) THEN (move ["inS"]) THEN (move ["xV"])) THEN ((use_arg_then2 ("x", [])) (term_tac exists_tac)) THEN (done_tac)); ((BETA_TAC THEN (move ["u"]) THEN (case THEN (move ["uV"])) THEN (move ["nuv"])) THEN (((use_arg_then2 ("set0", [])) (disch_tac [])) THEN (clear_assumption "set0") THEN ((use_arg_then2 ("contraLR", [contraLR])) (disch_tac [])) THEN (clear_assumption "contraLR") THEN (DISCH_THEN apply_tac))); (((((use_arg_then2 ("MEMBER_NOT_EMPTY", [MEMBER_NOT_EMPTY]))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (((use_arg_then2 ("REAL_NOT_LE", [REAL_NOT_LE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Pack_defs.h0", [Pack_defs.h0]))(thm_tac (new_rewrite [] []))))) THEN (move ["dist_lt"])); (((use_arg_then2 ("u", [])) (term_tac exists_tac)) THEN ((((use_arg_then2 ("set_of_edge", [set_of_edge]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("inE", [inE]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("Tame_general.IN_ESTD", [Tame_general.IN_ESTD]))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("uV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("vV", []))(thm_tac (new_rewrite [] [])))) THEN (((use_arg_then2 ("nuv", []))(gsym_then (thm_tac (new_rewrite [] []))))) THEN (simp_tac) THEN (((use_arg_then2 ("DIST_SYM", [DIST_SYM]))(thm_tac (new_rewrite [] [])))))); ((((use_arg_then2 ("dist_lt", [])) (disch_tac [])) THEN (clear_assumption "dist_lt") THEN BETA_TAC) THEN (arith_tac) THEN (done_tac)); ];; (* Finalization of the section FCDJDOT *) let not_surrounded_ECTC = Sections.finalize_theorem not_surrounded_ECTC;; let isolated_node_norm_ECTC = Sections.finalize_theorem isolated_node_norm_ECTC;; let not_surrounded_node_norm_ECTC = Sections.finalize_theorem not_surrounded_node_norm_ECTC;; let radV_2 = Sections.finalize_theorem radV_2;; let hl2 = Sections.finalize_theorem hl2;; let lmfun_ineq_center_scriptL = Sections.finalize_theorem lmfun_ineq_center_scriptL;; let FCDJDOT = Sections.finalize_theorem FCDJDOT;; Sections.end_section "FCDJDOT";; (* Close the module *) end;;