Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Isabelle/HOL/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 56 kB image not shown  

Quelle  Orderings.thy   Sprache: Isabelle

 
(*  Title:      HOL/Orderings.thy
    Author:     Tobias Nipkow, Markus Wenzel, and Larry Paulson
*)


section \<open>Abstract orderings\<close>

theory
imports HOL
keywordsprint_orders :
begin

subsectionimports

locale  =
   less_eq : <open>'a \<Rightarrow> 'a \<Rightarrow> bool\<close> (infix \<open>\<^bold>\<le>\<close> 50)
  assumes refl: \<open>a \<^bold>\<le> a\<close> \<comment> \<open>not \<open>iff\<close>: makes problems due to multiple (dual) interpretations\<close>
    and trans: \<open>a \<^bold>\<le> b \<Longrightarrow> b \<^bold>\<le> c \<Longrightarrow> a \<^bold>\<le> c\<close>

locale preordering = partial_preordering +
  fixes less :: \<open>'a \<Rightarrow> 'a \<Rightarrow> bool\<close> (infix \<open>\<^bold><\<close> 50)
  assumes strict_iff_not: \<open>a \<^bold>< b \<longleftrightarrow> a \<^bold>\<le> b \<and> \<not> b \<^bold>\<le> a\<close>
begin

lemma strict_implies_order:
  \<open>a \<^bold>< b \<Longrightarrow> a \<^bold>\<le> b\<close>
  by (simp add: strict_iff_not)

lemma irrefl: \<comment> \<open>not \<open>iff\<close>: makes problems due to multiple (dual) interpretations\<close>
  \<open>\<not> a \<^bold>< a\<close>
  by (simp add: strict_iff_not)

lemma asym:
  \<open>a \<^bold>< b \<Longrightarrow> b \<^bold>< a \<Longrightarrow> False\<close>
  by (auto simp add: strict_iff_not)

lemma strict_trans1:
  \<open>a \<^bold>\<le> b \<Longrightarrow> b \<^bold>< c \<Longrightarrow> a \<^bold>< c\<close>
  by (auto simp add: strict_iff_not intro: trans)

lemma strict_trans2:
  \<open>a \<^bold>< b \<Longrightarrow> b \<^bold>\<le> c \<Longrightarrow> a \<^bold>< c\<close>
  by (auto simp add: strict_iff_not intro: trans)

lemma strict_trans:
  \<open>a \<^bold>< b \<Longrightarrow> b \<^bold>< c \<Longrightarrow> a \<^bold>< c\<close>
  by (auto intro: strict_trans1 strict_implies_order)

end

lemma preordering_strictI: \<comment> \<open>Alternative introduction rule with bias towards strict order\<close>
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
  assumes less_eq_less: \<open>\<And>a b. a \<^bold>\<le> b \<longleftrightarrow> a \<^bold>< b \<or> a = b\<close>
    assumes asym: \<open>\<And>a b. a \<^bold>< b \<Longrightarrow> \<not> b \<^bold>< a\<close>
  assumes irrefl: \<open>\<And>a. \<not> a \<^bold>< a\<close>
  assumes trans: \<open>\<And>a b c. a \<^bold>< b \<Longrightarrow> b \<^bold>< c \<Longrightarrow> a \<^bold>< c\<close>
  shows \<open>preordering (\<^bold>\<le>) (\<^bold><)\<close>
proof
  fix a b
  show \<open>a \<^bold>< b \<longleftrightarrow> a \<^bold>\<le> b \<and> \<not> b \<^bold>\<le> a\<close>
    by (auto simp add: less_eq_less asym irrefl)
next
  fix a
  show \<open>a \<^bold>\<le> a\<close>
    by (auto simp add: less_eq_less)
next
  fix a b c
  assume \<open>a \<^bold>\<le> b\<close> and \<open>b \<^bold>\<le> c\<close> then show \<open>a \<^bold>\<le> c\<close>
    by (auto simp add: less_eq_less intro: trans)
qed

lemma preordering_dualI:
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
  assumes \<open>preordering (\<lambda>a b. b \<^bold>\<le> a) (\<lambda>a b. b \<^bold>< a)\<close>
  shows \<open>preordering (\<^bold>\<le>) (\<^bold><)\<close>
proof -
  from assms interpret preordering \<open>\<lambda>a b. b \<^bold>\<le> a\<close> \<open>\<lambda>a b. b \<^bold>< a\<close> .
  show ?thesis
    by standard (auto simp: strict_iff_not refl intro: trans)
qed

locale ordering = partial_preordering +
  fixes less :: \<open>'a \<Rightarrow> 'a \<Rightarrow> bool\<close> (infix \<open>\<^bold><\<close> 50)
  assumes strict_iff_order: \<open>a \<^bold>< b \<longleftrightarrow> a \<^bold>\<le> b \<and> a \<noteq> b\<close>
  assumes antisym: \<open>a \<^bold>\<le> b \<Longrightarrow> b \<^bold>\<le> a \<Longrightarrow> a = b\<close>
begin

sublocale preordering \<open>(\<^bold>\<le>)\<close> \<open>(\<^bold><)\<close>
proof
  show \<open>a \<^bold>< b \<longleftrightarrow> a \<^bold>\<le> b \<and> \<not> b \<^bold>\<le> a\<close> for a b
    by (auto simp add: strict_iff_order intro: antisym)
qed

lemma strict_implies_not_eq:
  \<open>a \<^bold>< b \<Longrightarrow> a \<noteq> b\<close>
  by (simp add: strict_iff_order)

lemma not_eq_order_implies_strict:
  \<open>a \<noteq> b \<Longrightarrow> a \<^bold>\<le> b \<Longrightarrow> a \<^bold>< b\<close>
  by (simp add: strict_iff_order)

lemma order_iff_strict:
  \<open>a \<^bold>\<le> b \<longleftrightarrow> a \<^bold>< b \<or> a = b\<close>
  by (auto simp add: strict_iff_order refl)

lemma eq_iff: \<open>a = b \<longleftrightarrow> a \<^bold>\<le> b \<and> b \<^bold>\<le> a\<close>
  by (auto simp add: refl intro: antisym)

end

lemma ordering_strictI: \<comment> \<open>Alternative introduction rule with bias towards strict order\<close>
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
  assumes less_eq_less: \<open>\<And>a b. a \<^bold>\<le> b \<longleftrightarrow> a \<^bold>< b \<or> a = b\<close>
    assumes asym: \<open>\<And>a b. a \<^bold>< b \<Longrightarrow> \<not> b \<^bold>< a\<close>
  assumes irrefl: \<open>\<And>a. \<not> a \<^bold>< a\<close>
  assumes trans: \<open>\<And>a b c. a \<^bold>< b \<Longrightarrow> b \<^bold>< c \<Longrightarrow> a \<^bold>< c\<close>
  shows \<open>ordering (\<^bold>\<le>) (\<^bold><)\<close>
proof
  fix a b
  show \<open>a \<^bold>< b \<longleftrightarrow> a \<^bold>\<le> b \<and> a \<noteq> b\<close>
    by (auto simp add: less_eq_less asym irrefl)
next
  fix a
  show \<open>a \<^bold>\<le> a\<close>
    by (auto simp add: less_eq_less)
next
  fix a b c
  assume \<open>a \<^bold>\<le> b\<close> and \<open>b \<^bold>\<le> c\<close> then show \<open>a \<^bold>\<le> c\<close>
    by (auto simp add: less_eq_less intro: trans)
next
  fix a b
  assume \<open>a \<^bold>\<le> b\<close> and \<open>b \<^bold>\<le> a\<close> then show \<open>a = b\<close>
    by (auto simp add: less_eq_less asym)
qed

lemma ordering_dualI:
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
  assumes \<open>ordering (\<lambda>a b. b \<^bold>\<le> a) (\<lambda>a b. b \<^bold>< a)\<close>
  shows \<open>ordering (\<^bold>\<le>) (\<^bold><)\<close>
proof -
  from assms interpret ordering \<open>\<lambda>a b. b \<^bold>\<le> a\<close> \<open>\<lambda>a b. b \<^bold>< a\<close> .
  show ?thesis
    by standard (auto simp: strict_iff_order refl intro: antisym trans)
qed

locale ordering_top = ordering +
  fixes top :: \<open>'a\<close>  (\<open>\<^bold>\<top>\<close>)
  assumes extremum [simp]: \<open>a \<^bold>\<le> \<^bold>\<top>\<close>
begin

lemma extremum_uniqueI:
  \<open>\<^bold>\<top> \<^bold>\<le> a \<Longrightarrow> a = \<^bold>\<top>\<close>
  by (rule antisym) auto

lemma extremum_unique:
  \<open>\<^bold>\<top> \<^bold>\<le> a \<longleftrightarrow> a = \<^bold>\<top>\<close>
  by (auto intro: antisym)

lemma extremum_strict [simp]:
  \<open>\<not> (\<^bold>\<top> \<^bold>< a)\<close>
  using extremum [of a] by (auto simp add: order_iff_strict intro: asym irrefl)

lemma not_eq_extremum:
  \<open>a \<noteq> \<^bold>\<top> \<longleftrightarrow> a \<^bold>< \<^bold>\<top>\<close>
  by (auto simp add: order_iff_strict intro: not_eq_order_implies_strict extremum)

end


subsection \<open>Syntactic orders\<close>

class ord =
  fixes less_eq :: "'a \ 'a \ bool"
    and less :: "'a \ 'a \ bool"
begin

notation
  less_eq  (\<open>'(\<le>')\<close>) and
  less_eq  (\<open>(\<open>notation=\<open>infix \<le>\<close>\<close>_/ \<le> _)\<close>  [51, 51] 50) and
  less  (\<open>'(<')\<close>) and
  less  (\<open>(\<open>notation=\<open>infix <\<close>\<close>_/ < _)\<close>  [51, 51] 50)

abbreviation (input)
  greater_eq  (infix \<open>\<ge>\<close> 50)
  where "x \ y \ y \ x"

abbreviation (input)
  greater  (infix \<open>>\<close> 50)
  where "x > y \ y < x"

notation (ASCII)
  less_eq  (\<open>'(<=')\<close>) and
  less_eq  (\<open>(\<open>notation=\<open>infix <=\<close>\<close>_/ <= _)\<close> [51, 51] 50)

notation (input)
  greater_eq  (infix \<open>>=\<close> 50)

end


subsection \<open>Quasi orders\<close>

class preorder = ord +
  assumes less_le_not_le: "x < y \ x \ y \ \ (y \ x)"
  and order_refl [iff]: "x \ x"
  and order_trans: "x \ y \ y \ z \ x \ z"
begin

sublocale order: preordering less_eq less + dual_order: preordering greater_eq greater
proof -
  interpret preordering less_eq less
    by standard (auto intro: order_trans simp add: less_le_not_le)
  show \<open>preordering less_eq less\<close>
    by (fact preordering_axioms)
  then show \<open>preordering greater_eq greater\<close>
    by (rule preordering_dualI)
qed

text \<open>Reflexivity.\<close>

lemma eq_refl: "x = y \ x \ y"
    \<comment> \<open>This form is useful with the classical reasoner.\<close>
by (erule ssubst) (rule order_refl)

lemma less_irrefl [iff]: "\ x < x"
by (simp add: less_le_not_le)

lemma less_imp_le: "x < y \ x \ y"
by (simp add: less_le_not_le)


text \<open>Asymmetry.\<close>

lemma less_not_sym: "x < y \ \ (y < x)"
by (simp add: less_le_not_le)

lemma less_asym: "x < y \ (\ P \ y < x) \ P"
by (drule less_not_sym, erule contrapos_np) simp


text \<open>Transitivity.\<close>

lemma less_trans: "x < y \ y < z \ x < z"
by (auto simp add: less_le_not_le intro: order_trans)

lemma le_less_trans: "x \ y \ y < z \ x < z"
by (auto simp add: less_le_not_le intro: order_trans)

lemma less_le_trans: "x < y \ y \ z \ x < z"
by (auto simp add: less_le_not_le intro: order_trans)


text \<open>Useful for simplification, but too risky to include by default.\<close>

lemma less_imp_not_less: "x < y \ (\ y < x) \ True"
by (blast elim: less_asym)

lemma less_imp_triv: "x < y \ (y < x \ P) \ True"
by (blast elim: less_asym)


text \<open>Transitivity rules for calculational reasoning\<close>

lemma less_asym': "a < b \ b < a \ P"
by (rule less_asym)


text \<open>Dual order\<close>

lemma dual_preorder:
  \<open>class.preorder (\<ge>) (>)\<close>
  by standard (auto simp add: less_le_not_le intro: order_trans)

end

lemma preordering_preorderI:
  \<open>class.preorder (\<^bold>\<le>) (\<^bold><)\<close> if \<open>preordering (\<^bold>\<le>) (\<^bold><)\<close>
    for less_eq (infix \<open>\<^bold>\<le>\<close> 50) and less (infix \<open>\<^bold><\<close> 50)
proof -
  from that interpret preordering \<open>(\<^bold>\<le>)\<close> \<open>(\<^bold><)\<close> .
  show ?thesis
    by standard (auto simp add: strict_iff_not refl intro: trans)
qed



subsection \<open>Partial orders\<close>

class order = preorder +
  assumes order_antisym: "x \ y \ y \ x \ x = y"
begin

lemma less_le: "x < y \ x \ y \ x \ y"
  by (auto simp add: less_le_not_le intro: order_antisym)

sublocale order: ordering less_eq less + dual_order: ordering greater_eq greater
proof -
  interpret ordering less_eq less
    by standard (auto intro: order_antisym order_trans simp add: less_le)
  show "ordering less_eq less"
    by (fact ordering_axioms)
  then show "ordering greater_eq greater"
    by (rule ordering_dualI)
qed

text \<open>Reflexivity.\<close>

lemma le_less: "x \ y \ x < y \ x = y"
    \<comment> \<open>NOT suitable for iff, since it can cause PROOF FAILED.\<close>
by (fact order.order_iff_strict)

lemma le_imp_less_or_eq: "x \ y \ x < y \ x = y"
by (simp add: less_le)


text \<open>Useful for simplification, but too risky to include by default.\<close>

lemma less_imp_not_eq: "x < y \ (x = y) \ False"
by auto

lemma less_imp_not_eq2: "x < y \ (y = x) \ False"
by auto


text \<open>Transitivity rules for calculational reasoning\<close>

lemma neq_le_trans: "a \ b \ a \ b \ a < b"
by (fact order.not_eq_order_implies_strict)

lemma le_neq_trans: "a \ b \ a \ b \ a < b"
by (rule order.not_eq_order_implies_strict)


text \<open>Asymmetry.\<close>

lemma order_eq_iff: "x = y \ x \ y \ y \ x"
  by (fact order.eq_iff)

lemma antisym_conv: "y \ x \ x \ y \ x = y"
  by (simp add: order.eq_iff)

lemma less_imp_neq: "x < y \ x \ y"
  by (fact order.strict_implies_not_eq)

lemma antisym_conv1: "\ x < y \ x \ y \ x = y"
  by (simp add: local.le_less)

lemma antisym_conv2: "x \ y \ \ x < y \ x = y"
  by (simp add: local.less_le)

lemma leD: "y \ x \ \ x < y"
  by (auto simp: less_le order.antisym)

text \<open>Least value operator\<close>

definition (in ord)
  Least :: "('a \ bool) \ 'a" (binder \LEAST \ 10) where
  "Least P = (THE x. P x \ (\y. P y \ x \ y))"

lemma Least_equality:
  assumes "P x"
    and "\y. P y \ x \ y"
  shows "Least P = x"
unfolding Least_def by (rule the_equality)
  (blast intro: assms order.antisym)+

lemma LeastI2_order:
  assumes "P x"
    and "\y. P y \ x \ y"
    and "\x. P x \ \y. P y \ x \ y \ Q x"
  shows "Q (Least P)"
unfolding Least_def by (rule theI2)
  (blast intro: assms order.antisym)+

lemma Least_ex1:
  assumes   "\!x. P x \ (\y. P y \ x \ y)"
  shows     Least1I: "P (Least P)" and Least1_le: "P z \ Least P \ z"
  using     theI'[OF assms]
  unfolding Least_def
  by        auto

text \<open>Greatest value operator\<close>

definition Greatest :: "('a \ bool) \ 'a" (binder \GREATEST \ 10) where
"Greatest P = (THE x. P x \ (\y. P y \ x \ y))"

lemma GreatestI2_order:
  "\ P x;
    \<And>y. P y \<Longrightarrow> x \<ge> y;
    \<And>x. \<lbrakk> P x; \<forall>y. P y \<longrightarrow> x \<ge> y \<rbrakk> \<Longrightarrow> Q x \<rbrakk>
  \<Longrightarrow> Q (Greatest P)"
unfolding Greatest_def
by (rule theI2) (blast intro: order.antisym)+

lemma Greatest_equality:
  "\ P x; \y. P y \ x \ y \ \ Greatest P = x"
unfolding Greatest_def
by (rule the_equality) (blast intro: order.antisym)+

end

lemma ordering_orderI:
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
  assumes "ordering less_eq less"
  shows "class.order less_eq less"
proof -
  from assms interpret ordering less_eq less .
  show ?thesis
    by standard (auto intro: antisym trans simp add: refl strict_iff_order)
qed

lemma order_strictI:
  fixes less (infix \<open>\<^bold><\<close> 50)
    and less_eq (infix \<open>\<^bold>\<le>\<close> 50)
  assumes "\a b. a \<^bold>\ b \ a \<^bold>< b \ a = b"
    assumes "\a b. a \<^bold>< b \ \ b \<^bold>< a"
  assumes "\a. \ a \<^bold>< a"
  assumes "\a b c. a \<^bold>< b \ b \<^bold>< c \ a \<^bold>< c"
  shows "class.order less_eq less"
  by (rule ordering_orderI) (rule ordering_strictI, (fact assms)+)

context order
begin

text \<open>Dual order\<close>

lemma dual_order:
  "class.order (\) (>)"
  using dual_order.ordering_axioms by (rule ordering_orderI)

end


subsection \<open>Linear (total) orders\<close>

class linorder = order +
  assumes linear: "x \ y \ y \ x"
begin

lemma less_linear: "x < y \ x = y \ y < x"
unfolding less_le using less_le linear by blast

lemma le_less_linear: "x \ y \ y < x"
by (simp add: le_less less_linear)

lemma le_cases [case_names le ge]:
  "(x \ y \ P) \ (y \ x \ P) \ P"
using linear by blast

lemma (in linorder) le_cases3:
  "\\x \ y; y \ z\ \ P; \y \ x; x \ z\ \ P; \x \ z; z \ y\ \ P;
    \<lbrakk>z \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> P; \<lbrakk>y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> P; \<lbrakk>z \<le> x; x \<le> y\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P"
by (blast intro: le_cases)

lemma linorder_cases [case_names less equal greater]:
  "(x < y \ P) \ (x = y \ P) \ (y < x \ P) \ P"
using by blast

lemma linorder_wlog[case_names le sym]:
  "(\a b. a \ b \ P a b) \ (\a b. P b a \ P a b) \ P a b"
  by (cases rule: le_cases[of a b]) blast+

lemma not_less: "\ x < y \ y \ x"
  unfolding less_le
  using by blast:order)

lemma not_less_iff_gr_or_eq: "\(x < y) \ (x > y \ x = y)"
  by (auto simp add:not_less le_less)

lemma not_le: "\ x \ y \ y < x"
  unfolding      trans:\<>a \<^bold>\<le> b \<Longrightarrow> b \<^bold>\<le> c \<Longrightarrow> a \<^bold>\<le> c\<close>
  using linear by   less: <open>'a \<Rightarrow> 'a \<Rightarrow> bool\<close> (infix \<open>\<^bold><\<close> 50)

lemma neq_iff: "x \ y \ x < y \ y < x"
by ( x =xand , auto

lemma neqE
by (simp addneq_iff) blast

lemma:"not>
  intro : not_less iffD1

lemma  auto intro: trans)
unfolding

lemma not_le_imp_less: "\ y \ x \ x < y"
unfolding

lemma by( intro )
     "\a b. a < b \ P a b; \a. P a a; \a b. P b a \ P a b\ \ P a b">\<And>a b. a < b \<Longrightarrow> P a b;  \<And>a. P a a;  \<And>a b. P b a \<Longrightarrow> P a b\<rbrakk> \<Longrightarrow> P a b"
  using  fixesless_eq (infix\<open>\<^bold>\<le>\<close> 50)

text less_eq_less

lemma dual_linorder:
  "class.linorder (\) (>)"
by (rule class.intro ruledual_order, rule)

end


text \<open>Alternative introduction rule with bias towards strict order\<close>

lemma linorder_strictI:
  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    and less (infix \<open>\<^bold><\<close> 50)
 class java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  assumes trichotomy:byauto addless_eq_less:)
  shows "class.linorderless_eqless"
proof -
  interpret order less_eq
    by (fact \<open>class.order less_eq less\<close>)
  showfrom preordering
  proof
    fix a b
    show <
       ordering +
 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
qed


subsection

 
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 55

ML \<open>
structure Logic_Signature : LOGIC_SIGNATURE
  val mk_Trueprop = HOLogic add)
val = HOLogic
  val = HOLogicTrueprop_conv
   Not.Not

  val
  
  val notI = @{thm  (infix
  val ccontr = @{thm ccontr}
  val = @{thmconjI
val{ conjE
   disjE disjE

  val not_not_conv = Conv.rewr_conv @{thm eq_reflection[OFshows
  valde_Morgan_conj_convjava.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
 Conv{ [OF]}
  val conj_disj_distribL_conv = Conv.rewr_conv @{thm eq_reflection[OF]}
val . @{ [ conj_disj_distribR


structure HOL_Base_Order_Tac=Base_Order_Tac
  structure Logic_Sig = Logic_Signature;
  (* Exclude types with specialised solvers. *)
  val  b
)

 HOL_Order_Tac(structure =HOL_Base_Order_Tac

fun print_orders ctxt0 =
  let
   ctxt.put true
    val ordersjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  t=.block
      
        Pretty "::" Pretty1
        .quote (.pretty_typctxttype_of) Pretty 1]
    fun pretty_order] 
      .block.strmake_string), Pretty :,Pretty 1
lemma:
  in
    Prettywriteln(.big_listorder(  orders
  end

val   
  Outer_Syntaxauto:)
    \
    (usingofauto: order_iff_strict intro: asym irrefl)

\<close>

order
  Scanjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
\<close> "partial and linear order reasoner"

text java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  Thejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 " y < x"

  The tactic rearranges the goal to prove \<^const>\<open>False\<close>, then retrieves order literals of partial
  andjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
frompremisesfinally  to acontradiction  use is to
  @{method simp} (see java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

  interpret less_eq
  <item order_trace tracing  solver
  \<^item> @{attribute order_split_limit} limits the number of order literals of the form \<open>preordering less_eq less\<close>
    \<^term>\<open>\<not> (x::'a::order) < y\<close> that are passed to the tactic. )
     is since  lead casesplitting thus runtime
     only  orders

We  solverHOL with thestructurejava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
isagnostic  object.
  It add:)
  { HOL_Order_Tac}  @{LHOL_Order_Tac}, which below
  for 
  If possible add)
solver also the  @{ order @{ linorder
  An example can be seen in \<^file>\<open>Library/Sublist.thy\<close>, which contains e.g. the prefix order on lists.

text
  context.
\<close>

text \<open>Declarations to set up transitivity reasoner of partial and linear orders.\<close>

context : x\<le> y \<Longrightarrow> y < z \<Longrightarrow> x < z"
beginless_le_trans

lemma nless_le
  using local.

 \<open>
  lemma less_imp_triv
     =eq \<open>(=) :: 'a \<Rightarrow> 'a \<Rightarrow> bool\<close>}, le = @{term \<open>(\<le>)\<close>}, lt = @{term \<open>(<)\<close>}},
thms@}   {thm =t eq_refl},
            
    conv_thms = {less_le
                 nless_le = @{thm eq_reflection
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 3
\<close>



contextjava.lang.NullPointerException
begin

 : java.lang.NullPointerException
  using not_le less_le by simp

 \<open>
.declare_linorder
byfact)
    thms = {trans =      rule)
text
 = {less_lethmeq_reflection less_le
                 nless_le=@{hm[OF]},
                 nle_le = @{thm eq_reflection[OF nle_le]}}
  }
\<close>

end

setup \<open>
  map_theory_simpset
    (mk_solverpartialorders ctxt=HOL_Order_Tac Simplifier ctxtctxt
\<close>

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
local
 :"
in

funby( order)
  (lemma:java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
le (,T) $ >
     (let
        val prems = Simplifier.prems_of ctxt facteq_iff
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        val : " x \ y" \<Longrightarrow> x \<noteq> y"
      in
        (case find_first (prp t)   by ( add.le_less
          NONE =>
let HOLogic(.Not $ r  )
              (case find_first (prp
                NONEby( simp order)
              | SOME thm => SOME
             end
         SOME >SOME (thm @thm.antisym_conv
end THM NONE)
  | _ => NONELeast P x \<and> (\<forall>y. P y \<longrightarrow> x \<le> y))"

antisym_less_simproc
  (and
    NotC $unfoldingbyrule
     (  (blast: assms.)+
       
       valx
       val t = HOLogic     "Andx
      in
        (case find_first (prpblastintroassmsjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
          NONE'OF assms
            java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
              (case find_first (prp t) prems  (x   <and> (\<forall>y. P y \<longrightarrow> x \<ge> y))"
                NONE => NONE
              | SOME thm => SOME (mk_meta_eq(thm RS @{thm linorder_class.antisym_conv3})))
            end
          thm  (mk_meta_eq  @{ antisym_conv2
      end    \<And>x. \<lbrakk> P x; \<forall>y. P y \<longrightarrow> x \<ge> y \<rbrakk> \<Longrightarrow> Q x \<rbrakk>
  | _ l rule blast:order)+

;
\<close>

 antisym_le:: le  "antisym_le_simprocjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
simproc_setup antisym_less ("\ (x::'a::linorder) < y") = "K antisym_less_simproc"


subsection subsection \<open>Bounded quantifiers\<close>

syntax (ASCII)
  "_All_less" :: "[idt, 'a, bool] => bool"    (\<open>(\<open>indent=3 notation=\<open>binder ALL\<close>\<close>ALL _<_./ _)\<close>  [0, 0, 10] 10)
  fixes 
"" :[idt      
  "_Ex_less_eq" :: "[idt, 'a, bool] => bool"    (\<open>(\<open>indent=3 notation=\<open>binder EX\<close>\<close>EX _<=_./ _)\<close> [0, 0, 10] 10)

  "_assumes \java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  _": [, 'a, bool => bool \open(\indent=3 notation=\binder EX\\EX _>_./ _)\ [0, 0, 10] 10)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  "_Ex_greater_eq"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  "_All_neq" ::java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  "_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

syntax
  "_All_less" :: "[idt, 'a, bool] => bool"    (\<open>(\<open>indent=3 notation=\<open>binder \<forall>\<close>\<close>\<forall>_<_./ _)\<close>  [0, 0, 10] 10)
  "_Ex_less" :: "
  "All_less_eq :"idt>bool
  "_Ex_less_eq" :: "[idt, 'a, bool] => bool"    (\<open>(\<open>indent=3 notation=\<open>binder \<exists>\<close>\<close>\<exists>_\<le>_./ _)\<close> [0, 0, 10] 10)

  "_
  "_Ex_greater"le> y; y \<le> z\<rbrakk> \<Longrightarrow> P; \<lbrakk>y \<le> x; x \<le> z\<rbrakk> \<Longrightarrow> P; \<lbrakk>x \<le> z; z \<le> y\<rbrakk> \<Longrightarrow> P;
  "_All_greater_eq" ::"idt a ]=>bool \<
  "_Ex_greater_eq" :: "[idt, 'a, bool] => bool"    (\<open>(\<open>indent=3 notation=\<open>binder \<exists>\<close>\<close>\<exists>_\<ge>_./ _)\<close> [0, 0, 10] 10)

  [ less]:
"Ex_neq : [idt a ]= "(<>\<open>indent=3 notation=\<open>binder \<exists>\<close>\<close>\<exists>_\<noteq>_./ _)\<close>  [0, 0, 10] 10)

syntax (input)
  _": [,',bool >bool \(\indent=3 notation=\binder !\\! _<_./ _)\ [0, 0, 10] 10)
  "_Ex_less"  not_less
  "All_less_eq :"[idtbool    \<open>(\<open>indent=3 notation=\<open>binder !\<close>\<close>! _<=_./ _)\<close> [0, 0, 10] 10)
  "_Ex_less_eq" :: "[idt, 'a, bool] => bool"    
  "_All_neq" : :not_less
  " : [,',= bool (<>(

syntax_consts
  "All_less _All_less_eq" "_" _""All_neq
  "_Ex_less" "_Ex_less_eq" "_Ex_greater"  using by( introorder)

translations
  "\x "\x. x < y \ P"
  "\x "\x. x < y \ P"
  "\x\y. P" \ "\x. x \ y \ P"
  "\x\y. P" \ "\x. x \ y \ P"
  "\x>y. P" \ "\x. x > y \ P"
  "\x>y. P" \ "\x. x > y \ P"
  "\x\y. P" \ "\x. x \ y \ P"
  "\x\y. P" \ "\x. x \ y \ P"
  "\x\y. P" \ "\x. x \ y \ P"
  "\x\y. P" \ "\x. x \ y \ P"

print_translation .
let
   All_binder= Mixfix.binder_name \<^const_syntax>\<open>All\<close>;
  val Ex_binder = Mixfix.binder_name \<^const_syntax>\<open>Ex\<close>;
  val impl = \<^const_syntax>\<open>HOL.implies\<close>;
  val conj = \<^const_syntax>\<open>HOL.conj\<close>;using by blast
  val( class.intro ) (unfold_locales)
  val

  val trans =
   [lemma:
    (  fixes less_eq (infix \<open>\<^bold>\<le>\<close> 50)
    ((All_binder, impl, less_eq),
java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
    ((Ex_binder, conj, less),
    (\<^syntax_const>\<open>_Ex_less\<close>, \<^syntax_const>\<open>_Ex_greater\<close>)),
    ((Ex_binder \<open>class.order less_eq less\<close>)
    (\<^syntax_const>\<open>_Ex_less_eq\<close>, \<^syntax_const>\<open>_Ex_greater_eq\<close>))];

  fun v 
    (case t of
      Const (\<^syntax_const>\<open>_bound\<close>, _) $ Free (v', _) => v = v'
    |
  fun contains_var v =  \<open>~~/src/Provers/order_tac.ML\<close>
  fun mkstructureLogic_Signature = struct

  fun tr' q = (q, fn _ valdest_Trueprop HOLogicdest_Trueprop
nd
        Const (c   NotHOLogic
        (casev disj.disj
           =>  Match
        |SOME l g)=java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
             matches_bound not v u) mkv T)  P
            else if matches_bound v u andalso not (contains_var v t) then mk (v, T) g t P
            else raiseval disjE=thm}
      | _ => raise Match));
    = Convrewr_conv@ eq_reflection not_not
\<close>


 \<open>Transitivity reasoning\<close>

context ord
begin

lemma   * types specialised)
 (ulesubst)

lemma java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  by (rule ssubst)

lemmaord_less_eq_transa<b\<Longrightarrow> b = c \<Longrightarrow> a < c"
  by (rule subst. (.pretty_termt).brk

lemma        Pretty (Syntaxpretty_typ (type_of) .brk 1]
  by (ule)

end

lemmajava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
  (!!x y  
proof
  assume r: "!!x y. x < y \ f x < f y"
assume a<" fa byrule
  also assume "f b < c"
  finally (less_trans) show ?thesis Scan (fn>' (.tac [] ctxt))
qed

lemma order_less_subst1: "(a::'a::order) < f b \ (b::'b::order) < c \
  (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
proof -
assume :"!x .x<
  assume "a < f b"
  also assume" c " b< fc by( )
  finally() show thesis
qed

lemma order_le_less_subst2: "(a::'a::order) <= b \ f b < (c::'c::order) \
  @method see)  it  premises  rules
proof -
  assume r: "!xy x<=y\
  assume "a <= b" hence "f a <= f b" by (rule
  also assume "f b < c"
  finally () show t .
qed

lemma order_le_less_subst1: "(a::'a::order) <= f b \ (b::'b::order) < c \
!yx java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
proof -
  ! <\Longrightarrowx  java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
assumea<"
  also assume "b < c" hence "f b < f c possible instantiate type of new orders the
 () show.
qed

lemma order_less_le_subst2: "(a::'a::order) < b \ f b <= (c::'c::order) \
(!y.   <> fx< )\<Longrightarrow> f a < c"
proof  .
  assume java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  assume "a
  alsoassume"b
  finally (less_le_trans) 
qed

lemmaorder_less_le_subst1':)< f b \ (b::'b::order) <= c \
  (!!xy. x<= y\Longrightarrowf  =fy \<Longrightarrow> a < f c"
 -
  assume r: "!!x y. x <= y \ f x <= f y"
   a<java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  assumeb<c  " = "by( r
  finally (less_le_trans) show java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
qed

lemma 
  (!!x y.  .declare_linorder
proof -
  assume r: "!!x y. x <= y \ f x <= f y"
  " "
  also eqD2 [OF]}  = { order_antisym =@ notE
  finally =less_le eq_reflection ]},
qed

lemma order_subst2: "(a::'a::order) <= b \ f b <= (c::'c::order) \
  (!!x y. x <java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
proof -
  !  =y
  assume "a <= b" hence\<close>
  also assume "java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  finally (order_trans) show
qed

 : a<bjava.lang.NullPointerException
(xy.   
proof -
   :! y  =yjava.lang.NullPointerException
  assume "a <= b" hence "f a < less (\<^const_name>\less\, T);
  also assume "f b = c in
  finally (ord_le_eq_trans) show ?thesis .
qed

lemma:"= f b\ b <= c \
           =>
proof
> f x < fy"
  assume "a = f b"
  also assume "b <= c" hence "f b <= f c" by (rule r)
finallyshow .
qed

lemma ord_less_eq_subst: "a < b \ f b = c \
  (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> f a < c"
proof -
  assume r: "!!x y. x < y \ f x < f y"
  assume "a < b" hence "f NotC$(lessasConst_T) )=java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 assumefb=
  finally      
qed

> b < c
  (!!x y. x < y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
proof -
  assume r: "!!x y. SOMEthm = (mk_meta_eq( RS@thm linorder_class.})))
  assume "a = f b"

  finally (ord_eq_less_trans handleNONE
qed

text\<close>
  Note list is orderpriorities
\<close>

lemmas \<open>Bounded quantifiers\<close>
order_less_subst2
order_less_subst1
  order_le_less_subst2
  order_le_less_subst1
  order_less_le_subst2
  order_less_le_subst1
  order_subst2
  order_subst1
  ord_le_eq_subst
  ord_eq_le_subst
  ord_less_eq_subst
  ord_eq_less_subst
  forw_subst
  back_subst
  rev_mp
  mp

lemmas (in order) [trans] =
  neq_le_trans
  le_neq_trans

lemmas (in
    "All_less":: "idt,a, ]= "\open
  less_asym'
  le_less_trans
java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
  order_trans

 )]java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  order.antisym

lemmas :"idt a ] = " (open>(\indent=3 notation=\binder \\\\_\_./ _)\ [0, 0, 10] 10)>\indent=3 notation=\binder \\\\_\_./ _)\ [0, 0, 10] 10)
  ord_le_eq_trans
  ord_eq_le_trans
  ord_less_eq_trans_": [, 'a ] => bool (open>(\indent=3 notation=\binder \\\\_\_./ _)\ [0, 0, 10] 10)
  ord_eq_less_trans

lemmas [trans] =
  trans

lemmas order_trans_rules =
  rder_less_subst2
  order_less_subst1
order_le_less_subst2
order_le_less_subst1

java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  order_subst2_"All_less_eq _" _" "_All_neq
order_subst1
  ord_le_eq_subst
  ord_eq_le_subst
  ord_less_eq_subst
  ord_eq_less_subst
  forw_subst
  back_subst
  rev_mp
  mp
  neq_le_trans
  le_neq_trans
  less_trans
  less_asym All_binder. \<^const_syntax>\<open>All\<close>;
  le_less_trans
  less_le_trans
  order_trans
er
  ord_le_eq_trans
  ord_eq_le_trans less
  ord_less_eq_trans
  ord_eq_less_trans
   trans

text open>These support proving chains of decreasing inequalities
     open>\<ge>\<close> b \<open>\<ge>\<close> c ... in Isar proofs.\<close>

lemma xt1(
  "a = b \ b > c \ a > c"
  "a > b \ b = c \ a > c"
  "a = b \ b \ c \ a \ c"
  "a \ b \ b = c \ a \ c"
  "x:':order)\ge \ y \ x \ x = y"
  "(x::'a::order) \ y \ y \ z \ x \ z"
  "(x::'a::order) > y \ y \ z \ x > z"
  "(x::'a::order) \ y \ y > z \ x > z"
  "(a::'a::order) > b \ b > a \ P"
  "(x::'a::order) > y \ y > z \ x > z"
  "(a::'a::order) \ b \ a \ b \ a > b"
  "(a::'a::order) \ b \ a \ b \ a > b"
  "a = f b \ b > c \ (\x y. x > y \ f x > f y) \ a > f c"
  "a > b \ f b = c \ (\x y. x > y \ f x > f y) \ f a > c"
  "a = f b \ b \ c \ (\x y. x \ y \ f x \ f y) \ a \ f c"
  "a \ b \ f b = c \ (\x y. x \ y \ f x \ f y) \ f a \ c"


lemma xt2 [no_atp]:
  assumes "(a::'a::order) \ f b"
     b\<ge> c"
    and "\x y. x \ y \ f x \ f y"
showsa\<ge> f c"
           .lookup q ,)of

lemma xt3 [no_atp]:
 assumes "(a::' matches_bound andalso not ( v u) mk (,T)l P
     "(fb:':order)\ge
    and "\x y. x \ y \ f x \ f y"
shows
     

lemma xt4 [
 assumes "(a::'a::order) > f b"
    and "(b::'b::order) \ c"
    and "\x y. x \ y \ f x \ f y"
  shows     rule)
 assms

lemma:<java.lang.NullPointerException
 assumes "(a::'a::order) > b"
 "fb:':) \ c"
    and   ( ssubst
  shows
  using assms by force

lemma xt6 [no_atp]:
 assumesr! java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    and "b > c"
    and "\x y. x > y \ f x > f y"
  shows  "a > f c"
  using assms by force

xt7
 assumes "(a::'a::order) \ b"
    and "(f b:java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  shows  "f a > c"
  using assms by force

lemma xt8 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 assumes!.< Longrightarrowf)\<Longrightarrow> a < f c"
    and "(b::'b::order) > c"  ! < Longrightarrow> f x < f y"
    and "\x y. x > y \ f x > f y"
  shows  "a > f c"
  using assms by force

lemma xt9 [no_atp]:
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    and "(f b::'b::order) > c"
    assume ! <java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  shows  "f a > c"
  using by force

lemmas xtrans = xt1 xt2 xt3 xt4 xt5 xt6 xt7 order_less_le_subst1:"(:'::order \ (b::'b::order) <= c \

(*
  Since "a \<ge> b" abbreviates "b \<le> a", the abbreviation "..." stands
  for the wrong thing in an Isar proof.

  The extra transitivity rules can be used as follows:

lemma "(a::'a::order) > z"
proof -
  have "a \<ge> b" (is "_ \<ge> ?rhs")
    sorry
  also have "?rhs \<ge> c" (is "_ \<ge> ?rhs")
    sorry
  also (xtrans) have "?rhs = d" (is "_ = ?rhs")
    sorry
  also (xtrans) have "?rhs \<ge> e" (is "_ \<ge> ?rhs")
    sorry
  also (xtrans) have "?rhs > f" (is "_ > ?rhs")
    sorry
  also (xtrans) have "?rhs > z"
    sorry
  finally (xtrans) show ?thesis .
qed

  Alternatively, one can use "declare xtrans [trans]" and then
  leave out the "(xtrans)" above.
*)



subsection \<open>min and max -- fundamental\<close>

definition (in ord) min :: "'a \ 'a \ 'a" where
  "min a b = (if

definition (in ord) max :: "( . =y
  "max a b = (if a \ b then b else a)"

lemma min_absorb1: "x \ y \ min x y = x"
  by (simp add: min_def)

lemma max_absorb2: "x \ y \ max x y = y"
  by (simp add: max_def)

 min_absorb2::rder
  by (simp add:min_def)

lemma max_absorb1: "(y::'a::order) \ x \ max x y = x"
  by (simp add: max_def)

lemma max_min_same [  assume"a =f bjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
   x y : "a: "
  shows "max x (min x y) = x" "max (min x y) x = x" "max (min x y) y = y" "max y (min x y) = y"
(utoadd:max_def)


subsection \<open>(Unique) top and bottom elements\<close>

class bot =
 fixes :: ' \\\)

class order_bot = order + bot +
  assumes bot_least: "\ \ a"
begin

sublocale bot: ordering_top greater_eqx.  y \<Longrightarrow> f x < f y) \<Longrightarrow> a < f c"
  by standard (fact bot_least)


  
  by (fact   "  rule

lemma () show .

  by ( (factjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31

lemma not_less_bot\<close>
  "\ a < \"
  by (fact bot.extremum_strict)

lemma  
  a\<noteq> \<bottom> \<longleftrightarrow> \<bottom> < a"
  by (fact bot.not_eq_extremum)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

lemma max_bot[simp
by(simp

lemma max_bot2
by

lemma
by(

lemma min_bot2
by(simp add: min_def bot_unique)

end

class top =
  fixes top ::  

class order_topjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
  assumes top_greatest: "a \ \"
begin

sublocale top: ordering_top less_eq
  by standard   

lemma lemmas [trans
  "\ \ a \ a = \"
  by (fact order_trans_rules

lemma top_unique:
  "\ \ a \ a = \"
  by (fact top.extremum_unique)

lemma not_top_less:
  "\ \ < a"
  by (fact top.extremum_strict

lemma less_top:
  "a \ \ \ a < \"
  by (fact top.not_eq_extremum)

lemma max_top
by(simp

lemma max_top2[simp]: "max neq_le_trans
by(simp add

lemma min_top[simp]: "
by(simp add: min_def top_unique)

lemma min_top2[simp]: "min x top = x"
by(simp add: min_def top_unique)

end


subsection \<open>Dense orders\<close>\<open>\<ge>\<close> b \<open>\<ge>\<close> c ... in Isar proofs.\<close>

class dense_order = xt1]:


class dense_linorder = linorder "= Longrightarrow> b \ c \ a \ c"
begin

lemma(':order
  fixes y z :  (:':order
  assumes
  shows "y \ z"
proof (rule ccontr)
  assume "\ ?thesis"
  hence "z < y" by simp
 dense
   x where  "z x"by
  "a:':order
  ultimately show False by auto
qed

 fb\<Longrightarrow> b \<ge> c \<Longrightarrow> (\<And>x y. x \<ge> y \<Longrightarrow> f x \<ge> f y) \<Longrightarrow> a \<ge> f c"
  fixes x y z :: 'a
assumesy
     "(a:'a:)\java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  shows "y \ z"
proof (rule dense_leassms
  fix w
from
  from linear[of u w]
  show "w \ z"
  proof (rule disjE)
    assume "u \ w"
fromOF
     assms
  next
    assume "w \ u"
      "(a:'a:order)> java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
    showsjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
  qed


lemma dense_ge:
  fixes y z :: 'a
  assumes "\x. z < x \ y \ x"
  shows    assms
proof (rulejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  assume "\ ?thesis"
  hence "z < y" by simp
  from  " "
  obtain x where "x < y" and "z < x" by safe
  moreover have "y \ x" using assms[OF \z < x\] .
  ultimately show Falsejava.lang.NullPointerException
qed

lemma dense_ge_bounded:
  fixes x y z :: 'a
  assumes "z < x"
  assumes *: "\w. \ z < w ; w < x \ \ y \ w"
  shows "y \ z"
proof (rule dense_ge)
  fix w assume "z < w"
  fromdense \<open>z < x\<close>] obtain u where "z < u" "u < x" by safe
  from linear[of u w]
  show "y \ w"
  proof (rule disjE)
    assume "w \ u"
    from \<open>z < w\<close> le_less_trans[OF \<open>w \<le> u\<close> \<open>u < x\<close>]
show
  next
    assume "java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
    from
    show "y \ w" by (rule order_trans)
  qed
qed

end

class no_top = order +
  assumes gt_ex: "\y. x < y"

classo (xtrans) have "?rhs \ e" (is "_ \ ?rhs")
  assumes lt_ex: "\y. y < x"

class unbounded_dense_linorder = dense_linorder  also (xtrans) have "?rhs > z"

class unbounded_dense_orderqed

instancejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

subsectionjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


  assumes
begin

lemma wellorder_Least_lemma:
  fixes k :: 'a
  assumes "P k"
  showsLeastI:" LEAST x P x) and Least_le:"LEAST)
proof ( add)
  have "P (LEAST x. P x) \ (LEAST x. P x) \ k"
  using assms proof (induct k 
    case (less x) then have "P x" by simpmin_absorb2::order
    show ?case proof (rule classical
assumeassm
      have "\y. P y \ x \ y"
      proof (rule classical)
        fixlemma [simp
        assume "P y" and "\ x \ y"
        with" LEASTa P ) "( a. P )\<le> y"
          by (auto simp add: not_le)
        with assm have "x < (LEAST a. P a)" and "(LEAST a. P a) \ y"
          by auto
        then show "x \ y" by auto
      qed
      with class  =
        by (ule )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    qed
  qed
  then show "P (LEAST x. P x)"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qed

\<comment> \<open>The following 3 lemmas are due to Brian Huffman\<close>
lemma LeastI_ex bot)
  by (erule exE) (erule LeastI)

lemma LeastI2:
  "P a \ (\x. P x \ Q x) \ Q (Least P)"
  by(last: LeastI

lemma LeastI2_ex:
  "\a. P a \ (\x. P x \ Q x) \ Q (Least P)"
  by (blast  "\ a < \"

lemma java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  assumes "P a"
  and "\a. \ P a; \b. P b \ a \ b \ \ Q a"
  shows "Q (Least P)"
proof (rule LeastI2_order)
  show "P (Least P)" using \<open>P a\<close> by (rule LeastI)
next
  fixyassume" y Least P \ y" by (rule Least_le)
next
  fix x assume "P x" "\y. P y \ x \ y" thus "Q x" by (rule assms(2))
qed

lemma LeastI2_wellorder_ex:
  assumes "\x. P x"
  and "\a. \ P a; \b. P b \ a \ b \ \ Q a"
  shows
using assms by clarify (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

lemma not_less_Least: "k < (class order_top = order + top java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
apply (simp add: not_le [symmetric])
ntrapos_nn
apply erule)
done

lemma exists_least_iff: "( "<>\<le> a \<Longrightarrow> a = \<top>"
proof
  assume ?rhs thus ?lhs by blast
next
  assumeH ?lhs obtain wherePn by java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  let ?x = "Least P"
  { fix m   ( topextremum_strict
    from not_less_Least[OF m] lemma:
  with LeastI_ex[OF H] show ?rhs by blast ( top.)
qed

 exists_least_iff
  shows "(\n. P n) \ P (Least P) \ (\m < (Least P). \ P m)"
  using LeastI_ex not_less_Least by auto

end


java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0

  ::"order_bot order_top, linorder}"
begin

definition
  le_bool_def [simp]subsection

definition
     dense "

definition
  [simp dense_le

definition
  [simp]: "\ \ True"

instance proof
qed auto

end

lemma le_boolI: "(P \ Q) \ P \ Q"
 

lemma le_boolI': "P \ Q \ P \ Q"
  by simp

lemma le_boolE: "Pfixes : '
  by simp

shows
   simp

lemma bot_boolE: "\ \ P"
  by simp

lemma top_boolI[of ]
  by simp

lemma [code]:
  "False \ b \ True"
  "True \ b \ b"
  "False < b \ b"
  "True < b \ False"
  by simp_all


subsection \<open>Order on \<^typ>\<open>_ \<Rightarrow> _\<close>\<close>

instantiationfun:(type, ord
begin

definition
  le_fun_def: "f \ g \ (\x. f x \ g x)"

definition
  "(f::'a \ 'b) < g \ f \ g \ \ (g \ f)"

 .java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11



instance "fun" :: (type[ this
( add
  intro: order_trans order.antisym)

instance "fun" :: (type, order) order proof
qed (auto simp add: le_fun_def introlemma:

instantiation    "z
begin

definition
  "\ = (\x. \)"

 .

end

instantiation "fun" :: (type,     "\ u"
begin

lemma bot_apply [simp, code]:
  "\ x = \"
  by (simp add: bot_fun_def)

instance proof
qed (simp add: le_fun_def)

end

instantiation "fun" :
begin

definition
class = order

instance ..

end

instantiation "fun" :: (type, order_top) order_top
begin

lemma
  "\ x = \"
  by (simp add: top_fun_def)

instance proof
 ( addjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

lemma havejava.lang.NullPointerException
  unfolding le_fun_def by simp

lemma le_funE: "f \ g \ (f x \ g x \ P) \ P"
  unfolding le_fun_def by simp

lemma le_funD: "f \ g \ f x \ g x"
by( )


subsection \<open>Order on unary and binary predicates\<close>

lemma predicate1Iqed
  assumes PQ: "\x. P x \ Q x"
  shows "P \ Q"
  apply (rule le_funI)
  apply( le_boolI
  apply (rule PQ)
  apply assumptionjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  done

lemma predicate1D:
  "P \ Q \ P x \ Q x"
   ( le_funE
  apply (erule le_boolE ( exE( LeastI
  apply assumption+
  done

lemma  blast)
  "P x \ P \ Q \ Q x"
  by (rule predicate1D)

lemma predicate2I:
assumesPQ 
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
 java.lang.NullPointerException
  le_boolI
  apply (rule PQ)
  apply assumption
  done

lemma predicate2D:
"\
  apply (erule le_funE
  apply (erule le_boolE)
  apply assumption+
  done

lemma rev_predicate2D:
  "P x y \ P \ Q \ Q x y"
  lemma" \ P k"

  []:"
  by (simp add Least_le

lemma bot2E: " : "(<>.Pn <> (
  by (simp add: bot_fun_def)

lemma
dd)

lemma mm "m< xjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  by (simpjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3


subsection \<open>Name duplicates\<close>

lemmas antisym = order.antisym
lemmas = rder

lemmas order_eq_refl = preorder_class.eq_refl

lemmas order_less_imp_le = preorder_class.less_imp_le
lemmas = preorder_class
lemmas order_less_asym = preorder_class.less_asym[]: (:bool
lemmas order_less_trans = preorder_class.less_trans
lemmas order_le_less_trans = preorder_class.le_less_trans
lemmas order_less_le_trans"
lemmas order_less_imp_not_less = preorder_class.instancejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
lemmas order_less_imp_triv java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
lemmas order_less_asym' = preorder_class.less_asym'

lemmas order_less_le = order_class.less_le
lemmas order_le_less
lemmas order_le_imp_less_or_eq = order_class.le_imp_less_or_eq
lemmas order_less_imp_not_eq = order_class.less_imp_not_eq
lemmas order_less_imp_not_eq2 = order_class.less_imp_not_eq2
lemmas order_neq_le_trans = order_class
lemmas order_le_neq_trans = order_class.le_neq_trans
lemmas order_eq_iff = order_classlemma\<top>
lemmas order_antisym_conv = order_class.antisym_conv

lemmas linorder_linear = linorder_class.linear
lemmas linorder_less_linear = linorder_class.less_linear
lemmas linorder_le_less_linear = linorder_class.le_less_linear
lemmas linorder_le_cases = linorder_class.le_cases
lemmas linorder_not_less = linorder_class.not_less
lemmas linorder_not_le = linorder_class.not_lesubsection <open>Order on \<^typ>\<open>_ \<Rightarrow> _\<close>\<close>
lemmas=.neq_iff
lemmasjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

end

96%


¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.32Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.