src/HOL/Hyperreal/SEQ.ML
changeset 10797 028d22926a41
parent 10784 27e4d90b35b5
child 10834 a7897aebbffc
equal deleted inserted replaced
10796:c0bcea781b3a 10797:028d22926a41
   139     simpset() addsimps [Compl_less_set]));
   139     simpset() addsimps [Compl_less_set]));
   140 qed "FreeUltrafilterNat_NSLIMSEQ";
   140 qed "FreeUltrafilterNat_NSLIMSEQ";
   141 
   141 
   142 (* thus, the sequence defines an infinite hypernatural! *)
   142 (* thus, the sequence defines an infinite hypernatural! *)
   143 Goal "ALL n. n <= f n \
   143 Goal "ALL n. n <= f n \
   144 \         ==> Abs_hypnat (hypnatrel ^^ {f}) : HNatInfinite";
   144 \         ==> Abs_hypnat (hypnatrel ``` {f}) : HNatInfinite";
   145 by (auto_tac (claset(),simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   145 by (auto_tac (claset(),simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   146 by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]);
   146 by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]);
   147 by (etac FreeUltrafilterNat_NSLIMSEQ 1);
   147 by (etac FreeUltrafilterNat_NSLIMSEQ 1);
   148 qed "HNatInfinite_NSLIMSEQ";
   148 qed "HNatInfinite_NSLIMSEQ";
   149 
   149 
   154 \     = {}";
   154 \     = {}";
   155 by Auto_tac;  
   155 by Auto_tac;  
   156 val lemmaLIM2 = result();
   156 val lemmaLIM2 = result();
   157 
   157 
   158 Goal "[| #0 < r; ALL n. r <= abs (X (f n) + - L); \
   158 Goal "[| #0 < r; ALL n. r <= abs (X (f n) + - L); \
   159 \          (*fNat* X) (Abs_hypnat (hypnatrel ^^ {f})) + \
   159 \          (*fNat* X) (Abs_hypnat (hypnatrel ``` {f})) + \
   160 \          - hypreal_of_real  L @= 0 |] ==> False";
   160 \          - hypreal_of_real  L @= 0 |] ==> False";
   161 by (auto_tac (claset(),simpset() addsimps [starfunNat,
   161 by (auto_tac (claset(),simpset() addsimps [starfunNat,
   162     mem_infmal_iff RS sym,hypreal_of_real_def,
   162     mem_infmal_iff RS sym,hypreal_of_real_def,
   163     hypreal_minus,hypreal_add,
   163     hypreal_minus,hypreal_add,
   164     Infinitesimal_FreeUltrafilterNat_iff]));
   164     Infinitesimal_FreeUltrafilterNat_iff]));
   176       "X ----NS> L ==> X ----> L";
   176       "X ----NS> L ==> X ----> L";
   177 by (rtac ccontr 1 THEN Asm_full_simp_tac 1);
   177 by (rtac ccontr 1 THEN Asm_full_simp_tac 1);
   178 by (Step_tac 1);
   178 by (Step_tac 1);
   179 (* skolemization step *)
   179 (* skolemization step *)
   180 by (dtac choice 1 THEN Step_tac 1);
   180 by (dtac choice 1 THEN Step_tac 1);
   181 by (dres_inst_tac [("x","Abs_hypnat(hypnatrel^^{f})")] bspec 1);
   181 by (dres_inst_tac [("x","Abs_hypnat(hypnatrel```{f})")] bspec 1);
   182 by (dtac (inf_close_minus_iff RS iffD1) 2);
   182 by (dtac (inf_close_minus_iff RS iffD1) 2);
   183 by (fold_tac [real_le_def]);
   183 by (fold_tac [real_le_def]);
   184 by (blast_tac (claset() addIs [HNatInfinite_NSLIMSEQ]) 1);
   184 by (blast_tac (claset() addIs [HNatInfinite_NSLIMSEQ]) 1);
   185 by (blast_tac (claset() addIs [rename_numerals lemmaLIM3]) 1);
   185 by (blast_tac (claset() addIs [rename_numerals lemmaLIM3]) 1);
   186 qed "NSLIMSEQ_LIMSEQ";
   186 qed "NSLIMSEQ_LIMSEQ";
   509 by (dtac choice 1);
   509 by (dtac choice 1);
   510 by (Blast_tac 1);
   510 by (Blast_tac 1);
   511 val lemmaNSBseq2 = result();
   511 val lemmaNSBseq2 = result();
   512 
   512 
   513 Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \
   513 Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \
   514 \         ==>  Abs_hypreal(hyprel^^{X o f}) : HInfinite";
   514 \         ==>  Abs_hypreal(hyprel```{X o f}) : HInfinite";
   515 by (auto_tac (claset(),
   515 by (auto_tac (claset(),
   516               simpset() addsimps [HInfinite_FreeUltrafilterNat_iff,o_def]));
   516               simpset() addsimps [HInfinite_FreeUltrafilterNat_iff,o_def]));
   517 by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]);
   517 by (EVERY[rtac bexI 1, rtac lemma_hyprel_refl 2, Step_tac 1]);
   518 by (cut_inst_tac [("u","u")] FreeUltrafilterNat_nat_gt_real 1);
   518 by (cut_inst_tac [("u","u")] FreeUltrafilterNat_nat_gt_real 1);
   519 by (dtac FreeUltrafilterNat_all 1);
   519 by (dtac FreeUltrafilterNat_all 1);
   540 by (auto_tac (claset() addIs [finite_real_of_nat_less_real], 
   540 by (auto_tac (claset() addIs [finite_real_of_nat_less_real], 
   541               simpset() addsimps [real_of_nat_Suc, real_less_diff_eq RS sym]));
   541               simpset() addsimps [real_of_nat_Suc, real_less_diff_eq RS sym]));
   542 val lemma_finite_NSBseq2 = result();
   542 val lemma_finite_NSBseq2 = result();
   543 
   543 
   544 Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \
   544 Goal "ALL N. real_of_nat(Suc N) < abs (X (f N)) \
   545 \     ==> Abs_hypnat(hypnatrel^^{f}) : HNatInfinite";
   545 \     ==> Abs_hypnat(hypnatrel```{f}) : HNatInfinite";
   546 by (auto_tac (claset(),
   546 by (auto_tac (claset(),
   547               simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   547               simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   548 by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]);
   548 by (EVERY[rtac bexI 1, rtac lemma_hypnatrel_refl 2, Step_tac 1]);
   549 by (rtac ccontr 1 THEN dtac FreeUltrafilterNat_Compl_mem 1);
   549 by (rtac ccontr 1 THEN dtac FreeUltrafilterNat_Compl_mem 1);
   550 by (asm_full_simp_tac (simpset() addsimps 
   550 by (asm_full_simp_tac (simpset() addsimps 
   793    Equivalence between NS and standard definitions of Cauchy seqs
   793    Equivalence between NS and standard definitions of Cauchy seqs
   794  ------------------------------------------------------------------*)
   794  ------------------------------------------------------------------*)
   795 (*-------------------------------
   795 (*-------------------------------
   796       Standard def => NS def
   796       Standard def => NS def
   797  -------------------------------*)
   797  -------------------------------*)
   798 Goal "Abs_hypnat (hypnatrel ^^ {x}) : HNatInfinite \
   798 Goal "Abs_hypnat (hypnatrel ``` {x}) : HNatInfinite \
   799 \         ==> {n. M <= x n} : FreeUltrafilterNat";
   799 \         ==> {n. M <= x n} : FreeUltrafilterNat";
   800 by (auto_tac (claset(),
   800 by (auto_tac (claset(),
   801               simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   801               simpset() addsimps [HNatInfinite_FreeUltrafilterNat_iff]));
   802 by (dres_inst_tac [("x","M")] spec 1);
   802 by (dres_inst_tac [("x","M")] spec 1);
   803 by (ultra_tac (claset(), simpset() addsimps [less_imp_le]) 1);
   803 by (ultra_tac (claset(), simpset() addsimps [less_imp_le]) 1);
   841     auto_tac (claset(), simpset() addsimps [all_conj_distrib]));
   841     auto_tac (claset(), simpset() addsimps [all_conj_distrib]));
   842 by (dtac choice 1 THEN 
   842 by (dtac choice 1 THEN 
   843     step_tac (claset() addSDs [all_conj_distrib RS iffD1]) 1);
   843     step_tac (claset() addSDs [all_conj_distrib RS iffD1]) 1);
   844 by (REPEAT(dtac HNatInfinite_NSLIMSEQ 1));
   844 by (REPEAT(dtac HNatInfinite_NSLIMSEQ 1));
   845 by (dtac bspec 1 THEN assume_tac 1);
   845 by (dtac bspec 1 THEN assume_tac 1);
   846 by (dres_inst_tac [("x","Abs_hypnat (hypnatrel ^^ {fa})")] bspec 1 
   846 by (dres_inst_tac [("x","Abs_hypnat (hypnatrel ``` {fa})")] bspec 1 
   847     THEN auto_tac (claset(), simpset() addsimps [starfunNat]));
   847     THEN auto_tac (claset(), simpset() addsimps [starfunNat]));
   848 by (dtac (inf_close_minus_iff RS iffD1) 1);
   848 by (dtac (inf_close_minus_iff RS iffD1) 1);
   849 by (dtac (mem_infmal_iff RS iffD2) 1);
   849 by (dtac (mem_infmal_iff RS iffD2) 1);
   850 by (auto_tac (claset(), simpset() addsimps [hypreal_minus,
   850 by (auto_tac (claset(), simpset() addsimps [hypreal_minus,
   851     hypreal_add,Infinitesimal_FreeUltrafilterNat_iff]));
   851     hypreal_add,Infinitesimal_FreeUltrafilterNat_iff]));
  1332 
  1332 
  1333 (***---------------------------------------------------------------
  1333 (***---------------------------------------------------------------
  1334                  Hyperreals and Sequences
  1334                  Hyperreals and Sequences
  1335  ---------------------------------------------------------------***)
  1335  ---------------------------------------------------------------***)
  1336 (*** A bounded sequence is a finite hyperreal ***)
  1336 (*** A bounded sequence is a finite hyperreal ***)
  1337 Goal "NSBseq X ==> Abs_hypreal(hyprel^^{X}) : HFinite";
  1337 Goal "NSBseq X ==> Abs_hypreal(hyprel```{X}) : HFinite";
  1338 by (auto_tac (claset() addSIs [bexI,lemma_hyprel_refl] addIs 
  1338 by (auto_tac (claset() addSIs [bexI,lemma_hyprel_refl] addIs 
  1339        [FreeUltrafilterNat_all RS FreeUltrafilterNat_subset],
  1339        [FreeUltrafilterNat_all RS FreeUltrafilterNat_subset],
  1340        simpset() addsimps [HFinite_FreeUltrafilterNat_iff,
  1340        simpset() addsimps [HFinite_FreeUltrafilterNat_iff,
  1341         Bseq_NSBseq_iff RS sym, Bseq_iff1a]));
  1341         Bseq_NSBseq_iff RS sym, Bseq_iff1a]));
  1342 qed "NSBseq_HFinite_hypreal";
  1342 qed "NSBseq_HFinite_hypreal";
  1343 
  1343 
  1344 (*** A sequence converging to zero defines an infinitesimal ***)
  1344 (*** A sequence converging to zero defines an infinitesimal ***)
  1345 Goalw [NSLIMSEQ_def] 
  1345 Goalw [NSLIMSEQ_def] 
  1346       "X ----NS> #0 ==> Abs_hypreal(hyprel^^{X}) : Infinitesimal";
  1346       "X ----NS> #0 ==> Abs_hypreal(hyprel```{X}) : Infinitesimal";
  1347 by (dres_inst_tac [("x","whn")] bspec 1);
  1347 by (dres_inst_tac [("x","whn")] bspec 1);
  1348 by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1);
  1348 by (simp_tac (simpset() addsimps [HNatInfinite_whn]) 1);
  1349 by (auto_tac (claset(),
  1349 by (auto_tac (claset(),
  1350               simpset() addsimps [hypnat_omega_def, mem_infmal_iff RS sym,
  1350               simpset() addsimps [hypnat_omega_def, mem_infmal_iff RS sym,
  1351                                   starfunNat,hypreal_of_real_zero]));
  1351                                   starfunNat,hypreal_of_real_zero]));