src/HOL/Finite_Set.thy
changeset 19984 29bb4659f80a
parent 19931 fb32b43e7f80
child 21199 2d83f93c3580
equal deleted inserted replaced
19983:d649506f40c3 19984:29bb4659f80a
   500 lemmas (in ACIf) ACI = AC idem idem2
   500 lemmas (in ACIf) ACI = AC idem idem2
   501 
   501 
   502 text{* Interpretation of locales: *}
   502 text{* Interpretation of locales: *}
   503 
   503 
   504 interpretation AC_add: ACe ["op +" "0::'a::comm_monoid_add"]
   504 interpretation AC_add: ACe ["op +" "0::'a::comm_monoid_add"]
   505   by intro_locales (auto intro: add_assoc add_commute)
   505   by unfold_locales (auto intro: add_assoc add_commute)
   506 
   506 
   507 interpretation AC_mult: ACe ["op *" "1::'a::comm_monoid_mult"]
   507 interpretation AC_mult: ACe ["op *" "1::'a::comm_monoid_mult"]
   508   by intro_locales (auto intro: mult_assoc mult_commute)
   508   by unfold_locales (auto intro: mult_assoc mult_commute)
   509 
   509 
   510 subsubsection{*From @{term foldSet} to @{term fold}*}
   510 subsubsection{*From @{term foldSet} to @{term fold}*}
   511 
   511 
   512 lemma image_less_Suc: "h ` {i. i < Suc m} = insert (h m) (h ` {i. i < m})"
   512 lemma image_less_Suc: "h ` {i. i < Suc m} = insert (h m) (h ` {i. i < m})"
   513   by (auto simp add: less_Suc_eq) 
   513   by (auto simp add: less_Suc_eq) 
  2212 apply(erule subst)
  2212 apply(erule subst)
  2213 apply(rule inf_le2)
  2213 apply(rule inf_le2)
  2214 done
  2214 done
  2215 
  2215 
  2216 lemma (in Lattice) ACIfSL_sup: "ACIfSL sup (%x y. y \<sqsubseteq> x)"
  2216 lemma (in Lattice) ACIfSL_sup: "ACIfSL sup (%x y. y \<sqsubseteq> x)"
  2217 (* FIXME: insert ACf_sup and use intro_locales *)
  2217 (* FIXME: insert ACf_sup and use unfold_locales *)
  2218 apply(rule ACIfSL.intro)
  2218 apply(rule ACIfSL.intro)
  2219 apply(rule ACIf.intro)
  2219 apply(rule ACIf.intro)
  2220 apply(rule ACf_sup)
  2220 apply(rule ACf_sup)
  2221 apply(rule ACIf.axioms[OF ACIf_sup])
  2221 apply(rule ACIf.axioms[OF ACIf_sup])
  2222 apply(rule ACIfSL_axioms.intro)
  2222 apply(rule ACIfSL_axioms.intro)
  2368 apply(rule ACf.intro)
  2368 apply(rule ACf.intro)
  2369 apply(auto simp:min_def)
  2369 apply(auto simp:min_def)
  2370 done
  2370 done
  2371 
  2371 
  2372 interpretation min: ACIf ["min:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2372 interpretation min: ACIf ["min:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2373 apply intro_locales
  2373 apply unfold_locales
  2374 apply(auto simp:min_def)
  2374 apply(auto simp:min_def)
  2375 done
  2375 done
  2376 
  2376 
  2377 interpretation max: ACf ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2377 interpretation max: ACf ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2378 apply intro_locales
  2378 apply unfold_locales
  2379 apply(auto simp:max_def)
  2379 apply(auto simp:max_def)
  2380 done
  2380 done
  2381 
  2381 
  2382 interpretation max: ACIf ["max:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2382 interpretation max: ACIf ["max:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a"]
  2383 apply intro_locales
  2383 apply unfold_locales
  2384 apply(auto simp:max_def)
  2384 apply(auto simp:max_def)
  2385 done
  2385 done
  2386 
  2386 
  2387 interpretation min:
  2387 interpretation min:
  2388   ACIfSL ["min:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "op \<le>" "op <"]
  2388   ACIfSL ["min:: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "op \<le>" "op <"]
  2389 apply(simp add:order_less_le)
  2389 apply(simp add:order_less_le)
  2390 apply intro_locales
  2390 apply unfold_locales
  2391 apply(auto simp:min_def)
  2391 apply(auto simp:min_def)
  2392 done
  2392 done
  2393 
  2393 
  2394 interpretation min:
  2394 interpretation min:
  2395   ACIfSLlin ["min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "op \<le>" "op <"]
  2395   ACIfSLlin ["min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "op \<le>" "op <"]
  2396 apply intro_locales
  2396 apply unfold_locales
  2397 apply(auto simp:min_def)
  2397 apply(auto simp:min_def)
  2398 done
  2398 done
  2399 
  2399 
  2400 interpretation max:
  2400 interpretation max:
  2401   ACIfSL ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "%x y. y\<le>x" "%x y. y<x"]
  2401   ACIfSL ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "%x y. y\<le>x" "%x y. y<x"]
  2402 apply(simp add:order_less_le eq_sym_conv)
  2402 apply(simp add:order_less_le eq_sym_conv)
  2403 apply intro_locales
  2403 apply unfold_locales
  2404 apply(auto simp:max_def)
  2404 apply(auto simp:max_def)
  2405 done
  2405 done
  2406 
  2406 
  2407 interpretation max:
  2407 interpretation max:
  2408   ACIfSLlin ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "%x y. y\<le>x" "%x y. y<x"]
  2408   ACIfSLlin ["max :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "%x y. y\<le>x" "%x y. y<x"]
  2409 apply intro_locales
  2409 apply unfold_locales
  2410 apply(auto simp:max_def)
  2410 apply(auto simp:max_def)
  2411 done
  2411 done
  2412 
  2412 
  2413 interpretation min_max:
  2413 interpretation min_max:
  2414   Lattice ["op \<le>" "min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "max" "Min" "Max"]
  2414   Lattice ["op \<le>" "min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "max" "Min" "Max"]
  2415 apply -
  2415 apply -
  2416 apply(rule Min_def)
  2416 apply(rule Min_def)
  2417 apply(rule Max_def)
  2417 apply(rule Max_def)
  2418 apply intro_locales
  2418 apply unfold_locales
  2419 done
  2419 done
  2420 
  2420 
  2421 
  2421 
  2422 interpretation min_max:
  2422 interpretation min_max:
  2423   Distrib_Lattice ["op \<le>" "min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "max" "Min" "Max"]
  2423   Distrib_Lattice ["op \<le>" "min :: 'a::linorder \<Rightarrow> 'a \<Rightarrow> 'a" "max" "Min" "Max"]
  2424   by intro_locales
  2424   by unfold_locales
  2425 
  2425 
  2426 
  2426 
  2427 text{* Now we instantiate the recursion equations and declare them
  2427 text{* Now we instantiate the recursion equations and declare them
  2428 simplification rules: *}
  2428 simplification rules: *}
  2429 
  2429