src/HOL/Conditionally_Complete_Lattices.thy
changeset 67091 1393c2340eec
parent 65466 b0f89998c2a1
child 67458 e090941f9f42
equal deleted inserted replaced
67090:0ec94bb9cec4 67091:1393c2340eec
   428 
   428 
   429 lemma complete_interval:
   429 lemma complete_interval:
   430   assumes "a < b" and "P a" and "\<not> P b"
   430   assumes "a < b" and "P a" and "\<not> P b"
   431   shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and>
   431   shows "\<exists>c. a \<le> c \<and> c \<le> b \<and> (\<forall>x. a \<le> x \<and> x < c \<longrightarrow> P x) \<and>
   432              (\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)"
   432              (\<forall>d. (\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x) \<longrightarrow> d \<le> c)"
   433 proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x & x < d --> P x}"], auto)
   433 proof (rule exI [where x = "Sup {d. \<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x}"], auto)
   434   show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   434   show "a \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   435     by (rule cSup_upper, auto simp: bdd_above_def)
   435     by (rule cSup_upper, auto simp: bdd_above_def)
   436        (metis \<open>a < b\<close> \<open>\<not> P b\<close> linear less_le)
   436        (metis \<open>a < b\<close> \<open>\<not> P b\<close> linear less_le)
   437 next
   437 next
   438   show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b"
   438   show "Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c} \<le> b"
   439     apply (rule cSup_least)
   439     apply (rule cSup_least)
   440     apply auto
   440     apply auto
   441     apply (metis less_le_not_le)
   441     apply (metis less_le_not_le)
   442     apply (metis \<open>a<b\<close> \<open>~ P b\<close> linear less_le)
   442     apply (metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)
   443     done
   443     done
   444 next
   444 next
   445   fix x
   445   fix x
   446   assume x: "a \<le> x" and lt: "x < Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   446   assume x: "a \<le> x" and lt: "x < Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   447   show "P x"
   447   show "P x"
   452 next
   452 next
   453   fix d
   453   fix d
   454     assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"
   454     assume 0: "\<forall>x. a \<le> x \<and> x < d \<longrightarrow> P x"
   455     thus "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   455     thus "d \<le> Sup {d. \<forall>c. a \<le> c \<and> c < d \<longrightarrow> P c}"
   456       by (rule_tac cSup_upper, auto simp: bdd_above_def)
   456       by (rule_tac cSup_upper, auto simp: bdd_above_def)
   457          (metis \<open>a<b\<close> \<open>~ P b\<close> linear less_le)
   457          (metis \<open>a<b\<close> \<open>\<not> P b\<close> linear less_le)
   458 qed
   458 qed
   459 
   459 
   460 end
   460 end
   461 
   461 
   462 instance complete_linorder < conditionally_complete_linorder
   462 instance complete_linorder < conditionally_complete_linorder