src/HOL/Set_Interval.thy
changeset 57447 87429bdecad5
parent 57418 6ab1c7cb0b8d
child 57448 159e45728ceb
equal deleted inserted replaced
57446:06e195515deb 57447:87429bdecad5
   454 lemma atLeastLessThan_eq_iff:
   454 lemma atLeastLessThan_eq_iff:
   455   fixes a b c d :: "'a::linorder"
   455   fixes a b c d :: "'a::linorder"
   456   assumes "a < b" "c < d"
   456   assumes "a < b" "c < d"
   457   shows "{a ..< b} = {c ..< d} \<longleftrightarrow> a = c \<and> b = d"
   457   shows "{a ..< b} = {c ..< d} \<longleftrightarrow> a = c \<and> b = d"
   458   using atLeastLessThan_inj assms by auto
   458   using atLeastLessThan_inj assms by auto
       
   459 
       
   460 lemma (in linorder) Ioc_inj: "{a <.. b} = {c <.. d} \<longleftrightarrow> (b \<le> a \<and> d \<le> c) \<or> a = c \<and> b = d"
       
   461   by (metis eq_iff greaterThanAtMost_empty_iff2 greaterThanAtMost_iff le_cases not_le)
       
   462 
       
   463 lemma (in order) Iio_Int_singleton: "{..<k} \<inter> {x} = (if x < k then {x} else {})"
       
   464   by auto
       
   465 
       
   466 lemma (in linorder) Ioc_subset_iff: "{a<..b} \<subseteq> {c<..d} \<longleftrightarrow> (b \<le> a \<or> c \<le> a \<and> b \<le> d)"
       
   467   by (auto simp: subset_eq Ball_def) (metis less_le not_less)
   459 
   468 
   460 lemma (in order_bot) atLeast_eq_UNIV_iff: "{x..} = UNIV \<longleftrightarrow> x = bot"
   469 lemma (in order_bot) atLeast_eq_UNIV_iff: "{x..} = UNIV \<longleftrightarrow> x = bot"
   461 by (auto simp: set_eq_iff intro: le_bot)
   470 by (auto simp: set_eq_iff intro: le_bot)
   462 
   471 
   463 lemma (in order_top) atMost_eq_UNIV_iff: "{..x} = UNIV \<longleftrightarrow> x = top"
   472 lemma (in order_top) atMost_eq_UNIV_iff: "{..x} = UNIV \<longleftrightarrow> x = top"
   585 lemma Int_greaterThanLessThan[simp]: "{a<..<b} Int {c<..<d} = {max a c <..< min b d}"
   594 lemma Int_greaterThanLessThan[simp]: "{a<..<b} Int {c<..<d} = {max a c <..< min b d}"
   586 by auto
   595 by auto
   587 
   596 
   588 lemma Int_atMost[simp]: "{..a} \<inter> {..b} = {.. min a b}"
   597 lemma Int_atMost[simp]: "{..a} \<inter> {..b} = {.. min a b}"
   589   by (auto simp: min_def)
   598   by (auto simp: min_def)
       
   599 
       
   600 lemma Ioc_disjoint: "{a<..b} \<inter> {c<..d} = {} \<longleftrightarrow> b \<le> a \<or> d \<le> c \<or> b \<le> c \<or> d \<le> a"
       
   601   using assms by auto
   590 
   602 
   591 end
   603 end
   592 
   604 
   593 context complete_lattice
   605 context complete_lattice
   594 begin
   606 begin