diff -r e072cfc2f2ee -r 0a94fd47b792 thys2/ClosedFormsBounds.thy --- a/thys2/ClosedFormsBounds.thy Thu Mar 10 11:18:41 2022 +0000 +++ b/thys2/ClosedFormsBounds.thy Thu Mar 10 15:53:46 2022 +0000 @@ -89,14 +89,46 @@ sorry +lemma rdistinct_equality1: + shows "a \ ss \ rdistinct (a # rs) ss = a # rdistinct rs (insert a ss) " + by auto + +lemma larger_acc_smaller_distinct_res0: + shows " ss \ SS \ sum_list (map rsize (rdistinct rs SS)) \ sum_list (map rsize (rdistinct rs ss))" + apply(induct rs arbitrary: ss SS) + apply simp + apply(case_tac "a \ ss") + apply(subgoal_tac "a \ SS") + apply simp + apply blast + apply(case_tac "a \ SS") + apply simp + apply(subgoal_tac "insert a ss \ SS") + apply simp + apply (simp add: trans_le_add2) + apply blast + apply(simp) + apply(subgoal_tac "insert a ss \ insert a SS") + apply blast + by blast + + +lemma larger_acc_smaller_distinct_res: + shows " (sum_list (map rsize (rdistinct rs ss))) \ (sum_list (map rsize (rdistinct rs (insert a ss))))" + sorry + +lemma size_list_triangle1: + shows "sum_list (map rsize (a # (rdistinct as ss))) \ rsize a + sum_list (map rsize (rdistinct as (insert a ss)))" + by (simp add: larger_acc_smaller_distinct_res) + + lemma triangle_inequality_distinct: shows "sum_list (map rsize (rdistinct (a # rs) ss)) \ rsize a + (sum_list (map rsize (rdistinct rs ss)))" - apply(arbitrary: ss) - apply simp apply(case_tac "a \ ss") apply simp - - sorry + apply(subst rdistinct_equality1) + apply simp + using size_list_triangle1 by auto lemma same_regex_property_after_map: shows "\s. P (f r2 s) \ \r \ set (map (f r2) Ss). P r"