### cleaning proofs, use more real_asymp

parent 72edb20655d6
 ... ... @@ -221,13 +221,36 @@ proof - finally show ?thesis using A by auto qed definition "c = (\ia = 0.. 0" unfolding c_def by (rule prod_pos, auto) definition p :: "nat \ real poly" where "p s = (\i = 0.. k" shows "of_nat (k choose s) = poly (p s) (of_nat k)" unfolding binomial_altdef_of_nat[OF assms] p_def poly_prod proof (rule prod.cong[OF refl], clarsimp, goal_cases) case (1 i) with sk have "of_nat (k - i) = (of_nat k - of_nat i :: real)" by auto thus ?case using 1 by (auto simp: field_simps) qed lemma p_binom_complex: assumes sk: "s \ k" shows "of_nat (k choose s) = complex_of_real (poly (p s) (of_nat k))" unfolding p_binom[OF sk, symmetric] by simp lemma deg_p: "degree (p s) = s" unfolding p_def by (subst degree_prod_eq_sum_degree, auto) lemma lead_coeff_p: "lead_coeff (p s) = (\i = 0.. 0" unfolding lead_coeff_p by (rule prod_pos, auto) definition "c = lead_coeff (p (m - 1))" lemma c_gt_0: "c > 0" unfolding c_def by (rule lead_coeff_p_gt_0) lemma c0: "c \ 0" using c_gt_0 by auto lemma c_int_def: "c = (\ia = 0.. \" using c_int_def Ints_of_int by metis lemma c_ge_1: "c \ 1" using c_gt_0 unfolding c_int_def by presburger definition PP where "PP = (SOME PP. similar_mat_wit cA J (fst PP) (snd PP))" definition P where "P = fst PP" ... ... @@ -302,7 +325,7 @@ definition f where "f off k = D * k + (m-1) + off" lemma mono_f: "strict_mono (f off)" unfolding strict_mono_def f_def using D0 by auto definition C where "C off k = (c / real (f off k) ^ (m - 1))" definition C where "C off k = inverse (c * real (f off k) ^ (m - 1))" lemma limit_jordan_block: assumes kla: "(k, la) \ set n_as" and ij: "i < k" "j < k" ... ... @@ -326,14 +349,16 @@ proof - obtain ks small where decomp: "decompose_prod_root_unity (char_poly A) = (ks, small)" by force note pf = perron_frobenius_for_complexity_jnf[OF A n0 nonneg sr1 decomp] define ji where "ji = j - i" let ?f = "\ N. (c / (?r N)^(m-1))" have ji: "j - i = ji" unfolding ji_def by auto let ?f = "\ N. c * (?r N)^(m-1)" let ?jb = "\ N. (jordan_block k la ^\<^sub>m N) \$\$ (i,j)" let ?jbc = "\ N. (jordan_block k la ^\<^sub>m N) \$\$ (i,j) * ?f N" let ?jbc = "\ N. (jordan_block k la ^\<^sub>m N) \$\$ (i,j) / ?f N" define e where "e = (if i = 0 \ j = k - 1 \ cmod la = 1 \ k = m then la^off else 0)" let ?e1 = "\ N :: nat. (\ia = 0.. j" and la0: "la \ 0" { ... ... @@ -342,18 +367,28 @@ proof - with ij ij' have ji: "j - i \ N" and id: "N + i - j = N - ji" unfolding ji_def by auto have "?jb N = (?c (N choose (j - i)) * la ^ (N + i - j))" unfolding jordan_block_pow using ij ij' by auto also have "\ = ?e1 N" unfolding ji_def unfolding binomial_altdef_of_nat[OF ji] id ji_def proof (rule arg_cong[of _ _ "\ x. x * _"], rule prod.cong[OF refl], goal_cases) case (1 x) hence "x \ N" using \N \ k\ ij by auto thus ?case by (simp add: of_nat_diff) qed also have "\ = ?e1 N" by (subst p_binom_complex[OF ji], auto) finally have id: "?jb N = ?e1 N" . have "?jbc N = e2 N" unfolding id e2_def using c_gt_0 by (simp add: norm_mult norm_divide norm_power) unfolding id e2_def ji_def using c_gt_0 by (simp add: norm_mult norm_divide norm_power) } note jbc = this have e23: "?e2 N = ?e3 N" for N using c_gt_0 by auto { fix n assume n: "n \ ji" have "cmod (e2 n) = \poly (p ji) (?r n) / (c * ?r n ^ (m - 1))\ * cmod la ^ (n + i - j)" unfolding e2_def norm_mult norm_power norm_of_real by simp also have "\poly (p ji) (?r n) / (c * ?r n ^ (m - 1))\ = poly (p ji) (?r n) / (c * real n ^ (m - 1))" by (intro abs_of_nonneg divide_nonneg_nonneg mult_nonneg_nonneg, insert c_gt_0, auto simp: p_binom[OF n, symmetric]) finally have "cmod (e2 n) = e3 n" unfolding e3_def by auto } note cmod_e2 = this { assume e3: "e3 \ 0" have e2_e3: "\\<^sub>F x in sequentially. cmod (e2 x) = e3 x" by (rule eventually_sequentiallyI[of "Suc ji"], insert cmod_e2, auto) have "e2 \ 0" by (subst tendsto_norm_zero_iff[symmetric], subst tendsto_cong[OF e2_e3], rule e3) } note e2_via_e3 = this have "(e2 o f off) \ e" proof (cases "cmod la = 1 \ k = m \ i = 0 \ j = k - 1") case False ... ... @@ -364,68 +399,36 @@ proof - proof cases case 0 hence e0: "e = 0" unfolding e_def by auto show ?thesis unfolding e0 0 LIMSEQ_iff e2_def proof (intro exI[of _ "Suc ji"] impI allI, goal_cases) case (1 r n) thus ?case by (cases "n - ji", auto) show ?thesis unfolding e0 0 LIMSEQ_iff e2_def ji proof (intro exI[of _ "Suc j"] impI allI, goal_cases) case (1 r n) thus ?case by (cases "n + i - j", auto) qed next case small have e0: "e = 0 * (of_real (if m - 1 = 0 then c else 0))" using small unfolding e_def by auto show ?thesis unfolding e0 unfolding e23 e2_def proof (rule tendsto_mult[OF _ tendsto_of_real]) show "(\x. c / real x ^ (m - 1)) \ (if m - 1 = 0 then c else 0)" by (cases "m - 1"; real_asymp) let ?laji = "inverse (la^ji)" let ?f = "(\x. (\ia = 0..\<^sub>F x in sequentially. ?f x = ?g x" apply (rule eventually_sequentiallyI[of "Suc ji"]) unfolding prod_pow[symmetric] prod.distrib[symmetric] mult.assoc[symmetric] unfolding prod_pow mult.assoc by (rule arg_cong2[of _ _ _ _ "(*)"], rule prod.cong, auto simp: ring_distribs, insert small, subst power_diff, auto simp: divide_inverse) have 0: "0 = (\ia = 0.. 0" unfolding tendsto_cong[OF fg] proof (subst 0, rule tendsto_mult[OF tendsto_prod tendsto_mult[OF _ tendsto_const]], intro tendsto_intros inverse_of_nat_tendsto_zero) show "(\x. of_nat x ^ ji * la ^ x) \ 0" by (rule poly_times_exp_tendsto_zero, insert small, auto) qed auto define d where "d = cmod la" from small have d: "0 < d" "d < 1" unfolding d_def by auto have e0: "e = 0" using small unfolding e_def by auto show ?thesis unfolding e0 proof (intro e2_via_e3, unfold e3_def d_def[symmetric]) show "(\N. poly (p ji) (?r N) / (c * ?r N ^ (m - 1)) * d ^ (N + i - j)) \ 0" unfolding poly_altdef sum_divide_distrib sum_distrib_right by (intro tendsto_null_sum, insert d c0, real_asymp) qed next case medium with max_block[OF kla] have "k \ m" and 1: "\ x. cmod la ^ x = 1" by auto with ij medium have "ji < m - 1" unfolding ji_def by linarith then obtain d where m1: "m - 1 = Suc d + ji" using less_iff_Suc_add by auto with max_block[OF kla] have "k \ m" by auto with ij medium have ji: "ji < m - 1" unfolding ji_def by linarith have e0: "e = 0" using medium unfolding e_def by auto have 0: "0 = (\ia = 0..ia = 0..ia = 0..ia = 0..ia = 0.. = cmod ((\ia = 0..ia = 0..\<^sub>F x in sequentially. ?e i x = ?g x" by (rule eventually_sequentiallyI[of 1], auto) show "?e i \ (1 - ?c i * 0) / ?c (ji - i)" unfolding tendsto_cong[OF eq] using 1 by (intro tendsto_intros lim_1_over_n, auto) proof (intro e2_via_e3, unfold e3_def medium power_one mult_1_right) show "(\N. poly (p ji) (?r N) / (c * ?r N ^ (m - 1))) \ 0" unfolding poly_altdef sum_divide_distrib proof (intro tendsto_null_sum, goal_cases) case (1 deg) from deg_p ji have "degree (p ji) < m - 1" by auto with 1 have "deg < m - 1" by auto thus ?case using c0 by real_asymp qed qed qed show "(e2 o f off) \ e" ... ... @@ -433,47 +436,55 @@ proof - next case True hence large: "cmod la = 1" "k = m" "i = 0" "j = k - 1" by auto hence e: "e = la^off" unfolding e_def by auto hence e: "e = la^off" and ji: "ji = m - 1" unfolding e_def ji_def by auto from large k0 have m0: "m \ 1" by auto define m1 where "m1 = m - 1" have id: "(real (m - 1) - real ia) = ?r m - 1 - ?r ia" for ia using m0 unfolding m1_def by auto let ?e4 = "\ x. (\ia = 0.. 0" have "?e2 x = ((\ia = 0..ia = 0..i = 0..ia = 0..ia = 0.. x. ?e4 x * e) \ (\ia = 0..ia = 0.. x. ?e4 x * e) \ e" by auto from LIMSEQ_subseq_LIMSEQ[OF this mono_f] have e4: "(\ k. (?e4 o f off) k * e) \ e" (is "?A \ e") by (auto simp: o_def) { fix k :: nat assume k: "k \ 0" hence 0: "f off k \ 0" unfolding f_def using D0 by auto have "?e2 (f off k) = ?e4 (f off k) * la^(f off k - (m-1))" unfolding main[OF 0] .. also have "f off k - (m-1) = D * k + off" unfolding f_def by simp also have "la ^ \ = e" unfolding e power_add D power_mult 1 by auto finally have "e2 (f off k) = (?e4 o f off) k * e" unfolding o_def e2_def . } note main = this have id: "(?A \ e) = ((e2 o f off) \ e)" by (rule tendsto_cong, unfold eventually_at_top_linorder, rule exI[of _ 1], insert main, auto) from e4[unfolded id] show ?thesis . have "e2 x = ?e4a x + ?e4b x" unfolding e2_def pji poly_add poly_monom m1_def[symmetric] using c0 x by (simp add: field_simps) } note e2_e4 = this have e2_e4: "\\<^sub>F x in sequentially. (e2 o f off) x = (?e4a o f off) x + (?e4b o f off) x" unfolding o_def by (intro eventually_sequentiallyI[of "Suc 0"], rule e2_e4, insert D0, auto simp: f_def) have "(e2 o f off) \ 0 + e" unfolding tendsto_cong[OF e2_e4] proof (rule tendsto_add, rule LIMSEQ_subseq_LIMSEQ[OF _ mono_f]) show "?e4a \ 0" proof (subst tendsto_norm_zero_iff[symmetric], unfold norm_mult norm_power large power_one mult_1_right norm_divide norm_of_real tendsto_rabs_zero_iff) have deg_q: "degree q \ m1" unfolding q_def using deg_p[of m1] by (intro degree_diff_le degree_monom_le, auto) have coeff_q_m1: "coeff q m1 = 0" unfolding q_def c_def m1_def[symmetric] using deg_p[of m1] by simp from deg_q coeff_q_m1 have "degree q < m1 \ q = 0" by fastforce thus "(\n. poly q (?r n) / (c * ?r n ^ m1)) \ 0" proof assume "degree q < m1" thus ?thesis unfolding poly_altdef sum_divide_distrib proof (intro tendsto_null_sum, goal_cases) case (1 i) hence "i < m1" by auto thus ?case using c0 by real_asymp qed qed auto qed next have id: "D * x + (m - 1) + off + i - j = D * x + off" for x unfolding ji[symmetric] ji_def using ij' by auto from d[OF kla large(1)] have 1: "la ^ d la = 1" by auto from split_list[OF kla] obtain as bs where n_as: "n_as = as @ (k,la) # bs" by auto obtain C where D: "D = d la * C" unfolding D_def unfolding n_as using large by auto show "(?e4b o f off) \ e" unfolding e f_def o_def id unfolding power_add power_mult D 1 by auto qed thus ?thesis by simp qed also have "((e2 o f off) \ e) = ((?jbc o f off) \ e)" proof (rule tendsto_cong, unfold eventually_at_top_linorder, rule exI[of _ k], ... ... @@ -493,7 +504,7 @@ proof - have "(?jbc o f off) \ e" . } note part2 = this from part1 part2 have "(?jbc o f off) \ e" by linarith thus ?thesis unfolding e_def o_def C_def . thus ?thesis unfolding e_def o_def C_def by (simp add: field_simps) qed definition lambda where "lambda i = snd (n_as ! fst (j_to_jb_index n_as i))" ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!