src/HOL/Probability/Helly_Selection.thy
changeset 63040 eb4ddd18d635
parent 62397 5ae24f33d343
child 63329 6b26c378ab35
equal deleted inserted replaced
63039:1a20fd9cf281 63040:eb4ddd18d635
    41     ultimately have "\<exists>l s'. subseq s' \<and> ((\<lambda>k. f (s k) (r n)) \<circ> s') \<longlonglongrightarrow> l"
    41     ultimately have "\<exists>l s'. subseq s' \<and> ((\<lambda>k. f (s k) (r n)) \<circ> s') \<longlonglongrightarrow> l"
    42       using compact_Icc compact_imp_seq_compact seq_compactE by metis
    42       using compact_Icc compact_imp_seq_compact seq_compactE by metis
    43     thus "\<exists>s'. subseq s' \<and> (\<exists>l. (\<lambda>k. f (s (s' k)) (r n)) \<longlonglongrightarrow> l)"
    43     thus "\<exists>s'. subseq s' \<and> (\<exists>l. (\<lambda>k. f (s (s' k)) (r n)) \<longlonglongrightarrow> l)"
    44       by (auto simp: comp_def)
    44       by (auto simp: comp_def)
    45   qed
    45   qed
    46   def d \<equiv> "nat.diagseq"
    46   define d where "d = nat.diagseq"
    47   have subseq: "subseq d"
    47   have subseq: "subseq d"
    48     unfolding d_def using nat.subseq_diagseq by auto
    48     unfolding d_def using nat.subseq_diagseq by auto
    49   have rat_cnv: "?P n d" for n
    49   have rat_cnv: "?P n d" for n
    50   proof -
    50   proof -
    51     have Pn_seqseq: "?P n (nat.seqseq (Suc n))"
    51     have Pn_seqseq: "?P n (nat.seqseq (Suc n))"
    84   have r_unbdd: "\<exists>n. x < r n" for x
    84   have r_unbdd: "\<exists>n. x < r n" for x
    85     using dense_r[OF less_add_one, of x] by auto
    85     using dense_r[OF less_add_one, of x] by auto
    86   then have nonempty: "{lim (?f n) |n. x < r n} \<noteq> {}" for x
    86   then have nonempty: "{lim (?f n) |n. x < r n} \<noteq> {}" for x
    87     by auto
    87     by auto
    88 
    88 
    89   def F \<equiv> "\<lambda>x. Inf {lim (?f n) |n. x < r n}"
    89   define F where "F x = Inf {lim (?f n) |n. x < r n}" for x
    90   have F_eq: "ereal (F x) = (INF n:{n. x < r n}. ereal (lim (?f n)))" for x
    90   have F_eq: "ereal (F x) = (INF n:{n. x < r n}. ereal (lim (?f n)))" for x
    91     unfolding F_def by (subst ereal_Inf'[OF bdd_below nonempty]) (simp add: setcompr_eq_image)
    91     unfolding F_def by (subst ereal_Inf'[OF bdd_below nonempty]) (simp add: setcompr_eq_image)
    92   have mono_F: "mono F"
    92   have mono_F: "mono F"
    93     using nonempty by (auto intro!: cInf_superset_mono simp: F_def bdd_below mono_def)
    93     using nonempty by (auto intro!: cInf_superset_mono simp: F_def bdd_below mono_def)
    94   moreover have "\<And>x. continuous (at_right x) F"
    94   moreover have "\<And>x. continuous (at_right x) F"
   158 (* Can strengthen to equivalence. *)
   158 (* Can strengthen to equivalence. *)
   159 theorem tight_imp_convergent_subsubsequence:
   159 theorem tight_imp_convergent_subsubsequence:
   160   assumes \<mu>: "tight \<mu>" "subseq s"
   160   assumes \<mu>: "tight \<mu>" "subseq s"
   161   shows "\<exists>r M. subseq r \<and> real_distribution M \<and> weak_conv_m (\<mu> \<circ> s \<circ> r) M"
   161   shows "\<exists>r M. subseq r \<and> real_distribution M \<and> weak_conv_m (\<mu> \<circ> s \<circ> r) M"
   162 proof -
   162 proof -
   163   def f \<equiv> "\<lambda>k. cdf (\<mu> (s k))"
   163   define f where "f k = cdf (\<mu> (s k))" for k
   164   interpret \<mu>: real_distribution "\<mu> k" for k
   164   interpret \<mu>: real_distribution "\<mu> k" for k
   165     using \<mu> unfolding tight_def by auto
   165     using \<mu> unfolding tight_def by auto
   166 
   166 
   167   have rcont: "\<And>x. continuous (at_right x) (f k)"
   167   have rcont: "\<And>x. continuous (at_right x) (f k)"
   168     and mono: "mono (f k)"
   168     and mono: "mono (f k)"
   273   fixes \<mu> :: "nat \<Rightarrow> real measure" and M :: "real measure"
   273   fixes \<mu> :: "nat \<Rightarrow> real measure" and M :: "real measure"
   274   assumes "\<And>n. real_distribution (\<mu> n)" "real_distribution M" and tight: "tight \<mu>" and
   274   assumes "\<And>n. real_distribution (\<mu> n)" "real_distribution M" and tight: "tight \<mu>" and
   275     subseq: "\<And>s \<nu>. subseq s \<Longrightarrow> real_distribution \<nu> \<Longrightarrow> weak_conv_m (\<mu> \<circ> s) \<nu> \<Longrightarrow> weak_conv_m (\<mu> \<circ> s) M"
   275     subseq: "\<And>s \<nu>. subseq s \<Longrightarrow> real_distribution \<nu> \<Longrightarrow> weak_conv_m (\<mu> \<circ> s) \<nu> \<Longrightarrow> weak_conv_m (\<mu> \<circ> s) M"
   276   shows "weak_conv_m \<mu> M"
   276   shows "weak_conv_m \<mu> M"
   277 proof (rule ccontr)
   277 proof (rule ccontr)
   278   def f \<equiv> "\<lambda>n. cdf (\<mu> n)" and F \<equiv> "cdf M"
   278   define f where "f n = cdf (\<mu> n)" for n
       
   279   define F where "F = cdf M"
   279 
   280 
   280   assume "\<not> weak_conv_m \<mu> M"
   281   assume "\<not> weak_conv_m \<mu> M"
   281   then obtain x where x: "isCont F x" "\<not> (\<lambda>n. f n x) \<longlonglongrightarrow> F x"
   282   then obtain x where x: "isCont F x" "\<not> (\<lambda>n. f n x) \<longlonglongrightarrow> F x"
   282     by (auto simp: weak_conv_m_def weak_conv_def f_def F_def)
   283     by (auto simp: weak_conv_m_def weak_conv_def f_def F_def)
   283   then obtain \<epsilon> where "\<epsilon> > 0" and "infinite {n. \<not> dist (f n x) (F x) < \<epsilon>}"
   284   then obtain \<epsilon> where "\<epsilon> > 0" and "infinite {n. \<not> dist (f n x) (F x) < \<epsilon>}"