thys2/ClosedFormsBounds.thy
author Chengsong
Thu, 10 Mar 2022 11:18:41 +0000
changeset 445 e072cfc2f2ee
parent 444 a7e98deebb5c
child 446 0a94fd47b792
permissions -rw-r--r--
closedforms
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     1
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     2
theory ClosedFormsBounds
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     3
  imports "GeneralRegexBound" "ClosedForms"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     4
begin
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     5
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     6
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     7
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     8
lemma alts_closed_form_bounded: shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
     9
"\<forall>r \<in> set rs. \<forall>s. rsize(rders_simp r s ) \<le> N \<Longrightarrow> 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    10
rsize (rders_simp (RALTS rs ) s) \<le> max (Suc ( N * (card (sizeNregex N)))) (rsize (RALTS rs) )"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    11
  apply(induct s)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    12
  apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    13
  apply(insert alts_closed_form_variant)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    14
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    15
  
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    16
  sorry
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    17
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    18
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    19
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    20
lemma star_closed_form_bounded_by_rdistinct_list_estimate:
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    21
  shows "rsize (rsimp ( RALTS ( (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) )
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    22
         (star_updates s r0 [[c]]) ) ))) \<le>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    23
        Suc (sum_list (map rsize (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) )
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    24
         (star_updates s r0 [[c]]) ) {})  ) )"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    25
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    26
  sorry
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    27
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    28
lemma distinct_list_rexp_up_to_certain_size_bouded_by_set_enumerating_up_to_that_size:
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    29
  shows "\<forall>r\<in> set rs. (rsize r ) \<le> N \<Longrightarrow> sum_list (map rsize (rdistinct rs {})) \<le>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    30
         (card (sizeNregex N))* N"
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    31
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    32
  sorry
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    33
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    34
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    35
lemma star_control_bounded:
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    36
  shows "\<forall>s. rsize (rders_simp r0 s) \<le> N \<Longrightarrow>        
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    37
      (sum_list (map rsize (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0))
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    38
         (star_updates s r0 [[c]]) ) {})  ) ) \<le> 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    39
(card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * (Suc (N + rsize (RSTAR r0)))
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    40
"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    41
  sorry
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    42
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    43
lemma star_control_variant:
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    44
  assumes "\<forall>s. rsize (rders_simp r0 s) \<le> N"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    45
  shows"Suc 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    46
      (sum_list (map rsize (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    47
          (star_updates list r0 [[a]])) {}))) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    48
\<le>  (Suc (card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * Suc (N + rsize (RSTAR r0))) "
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    49
  apply(subgoal_tac    "(sum_list (map rsize (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    50
          (star_updates list r0 [[a]])) {}))) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    51
\<le>  ( (card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * Suc (N + rsize (RSTAR r0))) ")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    52
  prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    53
  using assms star_control_bounded apply presburger
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    54
  by simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    55
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    56
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    57
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    58
lemma star_closed_form_bounded:
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    59
  shows "\<forall>s. rsize (rders_simp r0 s) \<le> N \<Longrightarrow>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    60
              rsize (rders_simp (RSTAR r0) s) \<le> 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    61
max (   (Suc (card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * (Suc (N + rsize (RSTAR r0)))))   (rsize (RSTAR r0))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    62
  apply(case_tac s)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    63
  apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    64
  apply(subgoal_tac " rsize (rders_simp (RSTAR r0) (a # list)) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    65
rsize (rsimp ( RALTS ( (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) ) (star_updates list r0 [[a]]) ) )))") 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    66
   prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    67
  using star_closed_form apply presburger
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    68
  apply(subgoal_tac "rsize (rsimp (
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    69
 RALTS ( (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) ) (star_updates list    r0 [[a]]) ) ))) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    70
\<le>         Suc (sum_list (map rsize (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0) )
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    71
         (star_updates list r0 [[a]]) ) {})  ) )")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    72
  prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    73
  using star_closed_form_bounded_by_rdistinct_list_estimate apply presburger
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    74
  apply(subgoal_tac "Suc (sum_list 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    75
                 (map rsize
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    76
                   (rdistinct (map (\<lambda>s1. RSEQ (rders_simp r0 s1) (RSTAR r0)) (star_updates list r0 [[a]])) {}))) 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    77
\<le>  (Suc (card (sizeNregex (Suc (N + rsize (RSTAR r0))))) * Suc (N + rsize (RSTAR r0)))  ")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    78
  apply auto[1]
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    79
  using star_control_variant by blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    80
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    81
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    82
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    83
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    84
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    85
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    86
lemma seq_list_estimate_control: shows 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    87
" rsize (rsimp (RALTS (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1))))
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    88
           \<le> Suc (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {})))"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    89
  
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    90
  sorry
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
    91
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    92
lemma triangle_inequality_distinct:
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    93
  shows "sum_list (map rsize (rdistinct (a # rs) ss)) \<le> rsize a + (sum_list (map rsize (rdistinct rs ss)))"
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    94
  apply(arbitrary: ss)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    95
   apply simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    96
  apply(case_tac "a \<in> ss")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    97
   apply simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    98
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
    99
  sorry
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   100
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   101
lemma same_regex_property_after_map:
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   102
  shows "\<forall>s. P (f r2 s) \<Longrightarrow> \<forall>r \<in> set  (map (f r2) Ss). P r"
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   103
  by auto
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   104
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   105
lemma same_property_after_distinct:
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   106
  shows " \<forall>r \<in> set  (map (f r2) Ss). P r \<Longrightarrow> \<forall>r \<in> set (rdistinct (map (f r2) Ss) xset). P r"
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   107
  apply(induct Ss arbitrary: xset)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   108
   apply simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   109
  by auto
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   110
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   111
lemma same_regex_property_after_distinct:
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   112
  shows "\<forall>s. P (f r2 s) \<Longrightarrow> \<forall>r \<in> set (rdistinct (map (f r2) Ss) xset). P r"
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   113
  apply(rule same_property_after_distinct)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   114
  apply(rule same_regex_property_after_map)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   115
  by simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   116
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   117
lemma map_ders_is_list_of_ders:
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   118
  shows  "\<forall>s. rsize (rders_simp r2 s) \<le> N2 \<Longrightarrow>
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   119
\<forall>r \<in> set (rdistinct (map (rders_simp r2) Ss) {}). rsize r \<le> N2"
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   120
  apply(rule same_regex_property_after_distinct)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   121
  by simp
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   122
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   123
lemma seq_estimate_bounded: 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   124
  assumes "\<forall>s. rsize (rders_simp r1 s) \<le> N1" and "\<forall>s. rsize (rders_simp r2 s) \<le> N2"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   125
  shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   126
"Suc (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {}))) \<le>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   127
 Suc (Suc (N1 + (rsize r2)) + (N2 * card (sizeNregex N2)))"
445
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   128
  apply(subgoal_tac " (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {}))) \<le>
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   129
  (Suc (N1 + (rsize r2)) + (N2 * card (sizeNregex N2)))")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   130
   apply force
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   131
  apply(subgoal_tac " (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {}))) \<le>
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   132
                      (rsize (RSEQ (rders_simp r1 s) r2)) + (sum_list (map rsize (rdistinct (map (rders_simp r2) (vsuf s r1)) {})) )")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   133
  prefer 2
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   134
  using triangle_inequality_distinct apply blast
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   135
  apply(subgoal_tac " sum_list (map rsize (rdistinct (map (rders_simp r2) (vsuf s r1)) {})) \<le> N2 * card (sizeNregex N2) ")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   136
   apply(subgoal_tac "rsize (RSEQ (rders_simp r1 s) r2) \<le> Suc (N1 + rsize r2)")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   137
    apply linarith
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   138
   apply (simp add: assms(1))
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   139
  apply(subgoal_tac "\<forall>r \<in> set (rdistinct (map (rders_simp r2) (vsuf s r1)) {}). rsize r \<le> N2")
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   140
  apply (metis (no_types, opaque_lifting) assms(2) distinct_list_rexp_up_to_certain_size_bouded_by_set_enumerating_up_to_that_size ex_map_conv mult.commute)
e072cfc2f2ee closedforms
Chengsong
parents: 444
diff changeset
   141
  using assms(2) map_ders_is_list_of_ders by blast
444
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   142
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   143
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   144
lemma seq_closed_form_bounded: shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   145
"\<lbrakk>\<forall>s. rsize (rders_simp r1 s) \<le> N1 ; \<forall>s. rsize (rders_simp r2 s) \<le> N2\<rbrakk> \<Longrightarrow>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   146
rsize (rders_simp (RSEQ r1 r2) s) \<le> 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   147
max (Suc (Suc (N1 + (rsize r2)) + (N2 * card (sizeNregex N2)))) (rsize (RSEQ r1 r2)) "
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   148
  apply(case_tac s)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   149
  apply simp
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   150
  apply(subgoal_tac " (rders_simp (RSEQ r1 r2) s) = 
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   151
rsimp (RALTS ((RSEQ (rders_simp r1 s) r2) # (map (rders_simp r2) (vsuf s r1))))")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   152
  prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   153
  using seq_closed_form_variant apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   154
  apply(subgoal_tac "rsize (rsimp (RALTS (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1))))
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   155
                    \<le>
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   156
Suc (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {})))")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   157
  apply(subgoal_tac "Suc (sum_list (map rsize (rdistinct (RSEQ (rders_simp r1 s) r2 # map (rders_simp r2) (vsuf s r1)) {})))
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   158
\<le> Suc (Suc (N1 + (rsize r2)) + (N2 * card (sizeNregex N2)))")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   159
  prefer 2
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   160
  using seq_estimate_bounded apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   161
   apply(subgoal_tac "rsize (rders_simp (RSEQ r1 r2) s) \<le> Suc (Suc (N1 + rsize r2) + N2 * card (sizeNregex N2))")
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   162
  using le_max_iff_disj apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   163
   apply auto[1]
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   164
  using seq_list_estimate_control by presburger
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   165
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   166
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   167
lemma rders_simp_bounded: shows
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   168
"\<exists>N. \<forall>s. rsize (rders_simp r s) \<le> N"
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   169
  apply(induct r)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   170
       apply(rule_tac x = "Suc 0 " in exI)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   171
  using three_easy_cases0 apply force
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   172
  using three_easy_cases1 apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   173
  using three_easy_casesC apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   174
  using seq_closed_form_bounded apply blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   175
  apply (metis alts_closed_form_bounded size_list_estimation')
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   176
  using star_closed_form_bounded by blast
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   177
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   178
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   179
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   180
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   181
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   182
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   183
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   184
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   185
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   186
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   187
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   188
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   189
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   190
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   191
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   192
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   193
(*Obsolete materials*)
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   194
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   195
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   196
a7e98deebb5c restructured sizebound proof
Chengsong
parents:
diff changeset
   197
end