Changeset 2670 for src/common/Measurable.ma
 Timestamp:
 Feb 15, 2013, 11:27:59 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/common/Measurable.ma
r2669 r2670 77 77 qed. 78 78 79 (* TODO: move*)80 lemma max_O_n : ∀n. max O n = n.81 * //82 qed.83 84 lemma max_n_O : ∀n. max n O = n.85 * //86 qed.87 88 lemma associative_max : associative nat max.89 #n #m #o normalize90 @(leb_elim n m)91 [ normalize @(leb_elim m o) normalize #H1 #H292 [ >(le_to_leb_true n o) /2/93  >(le_to_leb_true n m) //94 ]95  normalize @(leb_elim m o) normalize #H1 #H296 [ %97  >(not_le_to_leb_false … H2)98 >(not_le_to_leb_false n o) // @lt_to_not_le @(transitive_lt … m) /2/99 ]100 ] qed.101 102 79 103 80 lemma max_stack_steps : ∀C,trace,a,m. … … 116 93 ] qed. 117 94 118 (*119 lemma max_stack_step : ∀C,a,m,tr,s.120 m ≤ \snd (measure_stack_aux C 〈a,m〉 〈tr,s〉).121 #C #a #m #tr #s122 whd in match (measure_stack_aux ???);123 generalize in match (cs_stack C s); cases (cs_classify C s) normalize124 #f @(leb_elim m) normalize #H /2/125 qed.126 127 lemma max_stack_steps : ∀C. ∀am. ∀trace.128 \snd am ≤ \snd (foldl … (measure_stack_aux C) am trace).129 #C * #a #m #trace130 @foldl_inv131 [ * #a' #m' * #tr #s #H @(transitive_le … H) @max_stack_step132  //133 ] qed.134 135 lemma max_stack_step' : ∀C,a,m,a',m',tr,s.136 a ≤ a' → m ≤ m' →137 \snd (measure_stack_aux C 〈a,m〉 〈tr,s〉) ≤ \snd (measure_stack_aux C 〈a',m'〉 〈tr,s〉).138 #C #a #m #a' #m' #tr #s #H1 #H2139 whd in match (measure_stack_aux ???);whd in match (measure_stack_aux ???);140 generalize in match (cs_stack C s); cases (cs_classify C s) #f141 whd in ⊢ (?(??%)(??%));142 [ @to_max [ @(transitive_le … m') /2/  @(transitive_le … (a'f I)) /2/ ]143  2,4,5: @to_max /2 by max_r, max_l/144  @to_max [ @(transitive_le … m') /2/  @(transitive_le … (a'+f I)) /2/ ]145 ] qed.146 147 lemma max_stack_step'' : ∀C,a,m,a',m',tr,s.148 a ≤ a' →149 \fst (measure_stack_aux C 〈a,m〉 〈tr,s〉) ≤ \fst (measure_stack_aux C 〈a',m'〉 〈tr,s〉).150 #C #a #m #a' #m' #tr #s #H1151 whd in match (measure_stack_aux ???);whd in match (measure_stack_aux ???);152 generalize in match (cs_stack C s); cases (cs_classify C s) #f153 whd in ⊢ (?%%); /2/154 qed.155 156 lemma max_stack_steps' : ∀C. ∀trace,am,am'.157 \fst am ≤ \fst am' → \snd am ≤ \snd am' →158 \snd (foldl … (measure_stack_aux C) am trace) ≤ \snd (foldl … (measure_stack_aux C) am' trace).159 #C #trace elim trace160 [ * #a #m * #a' #m' #H1 #H2 @H2161  * #tr #s #tl #IH * #a #m * #a' #m' #H1 #H2 @IH [ @max_stack_step'' //  @max_stack_step' // ]162 ] qed.163 164 lemma max_stack_append_l : ∀C,ex1,ex2.165 max_stack C ex1 ≤ max_stack C (ex1@ex2).166 #C #ex1 #ex2 whd in ⊢ (??%);167 whd in match (measure_stack ? (ex1@ex2));168 >foldl_append169 @max_stack_steps170 qed.171 172 lemma max_stack_append_r : ∀C,ex1,ex2.173 max_stack C ex2 ≤ max_stack C (ex1@ex2).174 #C #ex1 #ex2 whd in ⊢ (??%);175 whd in match (measure_stack ? (ex1@ex2));176 >foldl_append177 @max_stack_steps' //178 qed.179 *)(*180 lemma max_stack_append : ∀C,ex1,ex2.181 max (max_stack C ex1) (max_stack C ex2) = max_stack C (ex1@ex2).182 #C #ex1 #ex2183 whd in match (max_stack ??); whd in match (max_stack ? (ex1@ex2));184 whd in match (measure_stack ??); whd in match (measure_stack ? (ex1@ex2));185 generalize in match 〈O,O〉; elim ex1186 [ * #a #m whd in ⊢ (??(?%?)%); >max_stack_steps187 188 elim ex1189 [ #ex2 >max_O_n %190  * #tr #s #tl #IH #ex2191 whd in match (max_stack ??); whd in match (measure_stack ??);192 lapply (refl ? (measure_stack_aux C 〈O,O〉 〈tr,s〉))193 cases (measure_stack_aux ???) in ⊢ (???% → %);194 #a #m #M195 196 #ex2197 @le_to_le_to_eq198 [ @to_max //199 200 whd in ⊢ (???%);201 202 whd in match (measure_stack ? (ex1@ex2));203 >foldl_append204 @max_stack_steps' //205 *)206 95 lemma max_stack_append : ∀C,c1,ex1,ex2. 207 96 max (max_stack C c1 ex1) (max_stack C (stack_after C c1 ex1) ex2) = max_stack C c1 (ex1@ex2).
Note: See TracChangeset
for help on using the changeset viewer.