src/HOL/Lattices.thy
changeset 36635 080b755377c0
parent 36352 f71978e47cd5
child 36673 6d25e8dab1e3
equal deleted inserted replaced
36634:f9b43d197d16 36635:080b755377c0
    65 begin
    65 begin
    66 
    66 
    67 text {* Dual lattice *}
    67 text {* Dual lattice *}
    68 
    68 
    69 lemma dual_semilattice:
    69 lemma dual_semilattice:
    70   "semilattice_inf (op \<ge>) (op >) sup"
    70   "class.semilattice_inf (op \<ge>) (op >) sup"
    71 by (rule semilattice_inf.intro, rule dual_order)
    71 by (rule class.semilattice_inf.intro, rule dual_order)
    72   (unfold_locales, simp_all add: sup_least)
    72   (unfold_locales, simp_all add: sup_least)
    73 
    73 
    74 end
    74 end
    75 
    75 
    76 class lattice = semilattice_inf + semilattice_sup
    76 class lattice = semilattice_inf + semilattice_sup
   233 
   233 
   234 context lattice
   234 context lattice
   235 begin
   235 begin
   236 
   236 
   237 lemma dual_lattice:
   237 lemma dual_lattice:
   238   "lattice (op \<ge>) (op >) sup inf"
   238   "class.lattice (op \<ge>) (op >) sup inf"
   239   by (rule lattice.intro, rule dual_semilattice, rule semilattice_sup.intro, rule dual_order)
   239   by (rule class.lattice.intro, rule dual_semilattice, rule class.semilattice_sup.intro, rule dual_order)
   240     (unfold_locales, auto)
   240     (unfold_locales, auto)
   241 
   241 
   242 lemma inf_sup_absorb: "x \<sqinter> (x \<squnion> y) = x"
   242 lemma inf_sup_absorb: "x \<sqinter> (x \<squnion> y) = x"
   243   by (blast intro: antisym inf_le1 inf_greatest sup_ge1)
   243   by (blast intro: antisym inf_le1 inf_greatest sup_ge1)
   244 
   244 
   345 lemma inf_sup_distrib2:
   345 lemma inf_sup_distrib2:
   346  "(y \<squnion> z) \<sqinter> x = (y \<sqinter> x) \<squnion> (z \<sqinter> x)"
   346  "(y \<squnion> z) \<sqinter> x = (y \<sqinter> x) \<squnion> (z \<sqinter> x)"
   347 by(simp add: inf_sup_aci inf_sup_distrib1)
   347 by(simp add: inf_sup_aci inf_sup_distrib1)
   348 
   348 
   349 lemma dual_distrib_lattice:
   349 lemma dual_distrib_lattice:
   350   "distrib_lattice (op \<ge>) (op >) sup inf"
   350   "class.distrib_lattice (op \<ge>) (op >) sup inf"
   351   by (rule distrib_lattice.intro, rule dual_lattice)
   351   by (rule class.distrib_lattice.intro, rule dual_lattice)
   352     (unfold_locales, fact inf_sup_distrib1)
   352     (unfold_locales, fact inf_sup_distrib1)
   353 
   353 
   354 lemmas sup_inf_distrib =
   354 lemmas sup_inf_distrib =
   355   sup_inf_distrib1 sup_inf_distrib2
   355   sup_inf_distrib1 sup_inf_distrib2
   356 
   356 
   417 
   417 
   418 class bounded_lattice = bounded_lattice_bot + bounded_lattice_top
   418 class bounded_lattice = bounded_lattice_bot + bounded_lattice_top
   419 begin
   419 begin
   420 
   420 
   421 lemma dual_bounded_lattice:
   421 lemma dual_bounded_lattice:
   422   "bounded_lattice (op \<ge>) (op >) (op \<squnion>) (op \<sqinter>) \<top> \<bottom>"
   422   "class.bounded_lattice (op \<ge>) (op >) (op \<squnion>) (op \<sqinter>) \<top> \<bottom>"
   423   by unfold_locales (auto simp add: less_le_not_le)
   423   by unfold_locales (auto simp add: less_le_not_le)
   424 
   424 
   425 end
   425 end
   426 
   426 
   427 class boolean_algebra = distrib_lattice + bounded_lattice + minus + uminus +
   427 class boolean_algebra = distrib_lattice + bounded_lattice + minus + uminus +
   429     and sup_compl_top: "x \<squnion> - x = \<top>"
   429     and sup_compl_top: "x \<squnion> - x = \<top>"
   430   assumes diff_eq: "x - y = x \<sqinter> - y"
   430   assumes diff_eq: "x - y = x \<sqinter> - y"
   431 begin
   431 begin
   432 
   432 
   433 lemma dual_boolean_algebra:
   433 lemma dual_boolean_algebra:
   434   "boolean_algebra (\<lambda>x y. x \<squnion> - y) uminus (op \<ge>) (op >) (op \<squnion>) (op \<sqinter>) \<top> \<bottom>"
   434   "class.boolean_algebra (\<lambda>x y. x \<squnion> - y) uminus (op \<ge>) (op >) (op \<squnion>) (op \<sqinter>) \<top> \<bottom>"
   435   by (rule boolean_algebra.intro, rule dual_bounded_lattice, rule dual_distrib_lattice)
   435   by (rule class.boolean_algebra.intro, rule dual_bounded_lattice, rule dual_distrib_lattice)
   436     (unfold_locales, auto simp add: inf_compl_bot sup_compl_top diff_eq)
   436     (unfold_locales, auto simp add: inf_compl_bot sup_compl_top diff_eq)
   437 
   437 
   438 lemma compl_inf_bot:
   438 lemma compl_inf_bot:
   439   "- x \<sqinter> x = \<bottom>"
   439   "- x \<sqinter> x = \<bottom>"
   440   by (simp add: inf_commute inf_compl_bot)
   440   by (simp add: inf_commute inf_compl_bot)