diff -r 0a94fd47b792 -r 7fb1e3dd5ae6 thys2/ClosedFormsBounds.thy --- a/thys2/ClosedFormsBounds.thy Thu Mar 10 15:53:46 2022 +0000 +++ b/thys2/ClosedFormsBounds.thy Fri Mar 11 21:25:08 2022 +0000 @@ -32,13 +32,25 @@ sorry +lemma star_lambda_ders: + shows " \s. rsize (rders_simp r0 s) \ N \ + \r\set (map (\s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) (star_updates s r0 [[c]])). + rsize r \ Suc (N + rsize (RSTAR r0))" + sorry + + lemma star_control_bounded: shows "\s. rsize (rders_simp r0 s) \ N \ (sum_list (map rsize (rdistinct (map (\s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) (star_updates s r0 [[c]]) ) {}) ) ) \ (card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * (Suc (N + rsize (RSTAR r0))) " - sorry + apply(subgoal_tac "\r \ set (map (\s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) + (star_updates s r0 [[c]]) ). (rsize r ) \ Suc (N + rsize (RSTAR r0))") + prefer 2 + using star_lambda_ders apply blast + using distinct_list_rexp_up_to_certain_size_bouded_by_set_enumerating_up_to_that_size by blast + lemma star_control_variant: assumes "\s. rsize (rders_simp r0 s) \ N" @@ -78,7 +90,49 @@ apply auto[1] using star_control_variant by blast +lemma alts_simp_ineq_unfold: + shows "rsize (rsimp (RALTS rs)) \ Suc (sum_list (map rsize (rdistinct (rflts (map rsimp rs)) {})))" + using rsimp_aalts_smaller by auto +lemma flts_has_no_zero: + shows "rdistinct (rflts rs) rset = rdistinct (rflts rs) (insert RZERO rset)" + sorry + +lemma flts_vs_nflts: + shows "\r \ noalts_set. \xs. r \ RALTS xs + \ (\a \ alts_set. \xs. a = RALTS xs \ set xs \ corr_set) +\ Suc (sum_list (map rsize (rdistinct ( rflts rs) (noalts_set \ corr_set) ))) + \ Suc (sum_list (map rsize (rdistinct rs (noalts_set \ alts_set) )))" + apply(induct rs arbitrary: noalts_set) + apply simp + + sorry + + +lemma without_flts_ineq: + shows " Suc (sum_list (map rsize (rdistinct (rflts rs) {}) )) \ + Suc (sum_list (map rsize (rdistinct ( rs ) {} )))" + by (metis empty_iff flts_vs_nflts sup_bot_left) + + +lemma distinct_simp_ineq: + shows "Suc (sum_list (map rsize (rdistinct (map rsimp rs) {}))) + \ Suc (sum_list (map rsize (rdistinct rs {})))" + sorry + + +lemma alts_simp_control: + shows "rsize (rsimp (RALTS rs)) \ Suc (sum_list (map rsize (rdistinct rs {})))" +proof - + have "rsize (rsimp (RALTS rs)) \ Suc (sum_list (map rsize (rdistinct (rflts (map rsimp rs)) {})))" + + using alts_simp_ineq_unfold by auto + then have "\ \ Suc (sum_list (map rsize (rdistinct (map rsimp rs) {})))" + using without_flts_ineq by blast + + show "rsize (rsimp (RALTS rs)) \ Suc (sum_list (map rsize (rdistinct rs {})))" + by (meson \Suc (sum_list (map rsize (rdistinct (rflts (map rsimp rs)) {}))) \ Suc (sum_list (map rsize (rdistinct (map rsimp rs) {})))\ \rsize (rsimp (RALTS rs)) \ Suc (sum_list (map rsize (rdistinct (rflts (map rsimp rs)) {})))\ distinct_simp_ineq order_trans) +qed @@ -86,8 +140,7 @@ lemma seq_list_estimate_control: shows " rsize (rsimp (RALTS (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)))) \ Suc (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {})))" - - sorry + by(metis alts_simp_control) lemma rdistinct_equality1: shows "a \ ss \ rdistinct (a # rs) ss = a # rdistinct rs (insert a ss) " @@ -115,7 +168,10 @@ lemma larger_acc_smaller_distinct_res: shows " (sum_list (map rsize (rdistinct rs ss))) \ (sum_list (map rsize (rdistinct rs (insert a ss))))" - sorry + apply(subgoal_tac "ss \ (insert a ss)") + apply(rule larger_acc_smaller_distinct_res0) + apply simp + by (simp add: subset_insertI) lemma size_list_triangle1: shows "sum_list (map rsize (a # (rdistinct as ss))) \ rsize a + sum_list (map rsize (rdistinct as (insert a ss)))"