121 case False with \<open>a \<noteq> 0\<close> show ?thesis |
121 case False with \<open>a \<noteq> 0\<close> show ?thesis |
122 by (simp add: sat_eq_iff nat_mult_min_left nat_mult_min_right mult.assoc min.assoc min.absorb2) |
122 by (simp add: sat_eq_iff nat_mult_min_left nat_mult_min_right mult.assoc min.assoc min.absorb2) |
123 qed |
123 qed |
124 qed |
124 qed |
125 show "1 * a = a" |
125 show "1 * a = a" |
126 apply (simp add: sat_eq_iff) |
126 by (simp add: sat_eq_iff min_def not_le not_less) |
127 apply (metis One_nat_def len_gt_0 less_Suc0 less_zeroE linorder_not_less min.absorb_iff1 min_nat_of_len_of nat_mult_1_right mult.commute) |
|
128 done |
|
129 show "(a + b) * c = a * c + b * c" |
127 show "(a + b) * c = a * c + b * c" |
130 proof(cases "c = 0") |
128 proof(cases "c = 0") |
131 case True thus ?thesis by (simp add: sat_eq_iff) |
129 case True thus ?thesis by (simp add: sat_eq_iff) |
132 next |
130 next |
133 case False thus ?thesis |
131 case False thus ?thesis |
205 end |
203 end |
206 |
204 |
207 instantiation sat :: (len) "{Inf, Sup}" |
205 instantiation sat :: (len) "{Inf, Sup}" |
208 begin |
206 begin |
209 |
207 |
210 definition "Inf = (semilattice_neutr_set.F min top :: 'a sat set \<Rightarrow> 'a sat)" |
208 global_interpretation Inf_sat: semilattice_neutr_set min \<open>top :: 'a sat\<close> |
211 definition "Sup = (semilattice_neutr_set.F max bot :: 'a sat set \<Rightarrow> 'a sat)" |
209 defines Inf_sat = Inf_sat.F |
|
210 by standard (simp add: min_def) |
|
211 |
|
212 global_interpretation Sup_sat: semilattice_neutr_set max \<open>bot :: 'a sat\<close> |
|
213 defines Sup_sat = Sup_sat.F |
|
214 by standard (simp add: max_def bot.extremum_unique) |
212 |
215 |
213 instance .. |
216 instance .. |
214 |
217 |
215 end |
218 end |
216 |
|
217 interpretation Inf_sat: semilattice_neutr_set min "top :: 'a::len sat" |
|
218 rewrites "semilattice_neutr_set.F min (top :: 'a sat) = Inf" |
|
219 proof - |
|
220 show "semilattice_neutr_set min (top :: 'a sat)" |
|
221 by standard (simp add: min_def) |
|
222 show "semilattice_neutr_set.F min (top :: 'a sat) = Inf" |
|
223 by (simp add: Inf_sat_def) |
|
224 qed |
|
225 |
|
226 interpretation Sup_sat: semilattice_neutr_set max "bot :: 'a::len sat" |
|
227 rewrites "semilattice_neutr_set.F max (bot :: 'a sat) = Sup" |
|
228 proof - |
|
229 show "semilattice_neutr_set max (bot :: 'a sat)" |
|
230 by standard (simp add: max_def bot.extremum_unique) |
|
231 show "semilattice_neutr_set.F max (bot :: 'a sat) = Sup" |
|
232 by (simp add: Sup_sat_def) |
|
233 qed |
|
234 |
219 |
235 instance sat :: (len) complete_lattice |
220 instance sat :: (len) complete_lattice |
236 proof |
221 proof |
237 fix x :: "'a sat" |
222 fix x :: "'a sat" |
238 fix A :: "'a sat set" |
223 fix A :: "'a sat set" |