diff --git a/thys/Types_To_Sets_Extension/Examples/SML_Relativization/Simple_Orders/SML_Simple_Orders.thy b/thys/Types_To_Sets_Extension/Examples/SML_Relativization/Simple_Orders/SML_Simple_Orders.thy --- a/thys/Types_To_Sets_Extension/Examples/SML_Relativization/Simple_Orders/SML_Simple_Orders.thy +++ b/thys/Types_To_Sets_Extension/Examples/SML_Relativization/Simple_Orders/SML_Simple_Orders.thy @@ -1,1985 +1,1985 @@ (* Title: Examples/SML_Relativization/Simple_Orders/SML_Simple_Orders.thy Author: Mihails Milehins Copyright 2021 (C) Mihails Milehins *) section\Relativization of the results about orders\ theory SML_Simple_Orders imports "../../Introduction" "../Foundations/SML_Relations" Complex_Main begin subsection\Class \<^class>\ord\\ subsubsection\Definitions and common properties\ locale ord_ow = fixes U :: "'ao set" and le :: "['ao, 'ao] \ bool" (infix \\\<^sub>o\<^sub>w\ 50) and ls :: "['ao, 'ao] \ bool" (infix \<\<^sub>o\<^sub>w\ 50) begin notation le (\'(\\<^sub>o\<^sub>w')\) and le (infix \\\<^sub>o\<^sub>w\ 50) and ls (\'(<\<^sub>o\<^sub>w')\) and ls (infix \<\<^sub>o\<^sub>w\ 50) abbreviation (input) ge (infix \\\<^sub>o\<^sub>w\ 50) where "x \\<^sub>o\<^sub>w y \ y \\<^sub>o\<^sub>w x" abbreviation (input) gt (infix \>\<^sub>o\<^sub>w\ 50) where "x >\<^sub>o\<^sub>w y \ y <\<^sub>o\<^sub>w x" notation ge (\'(\\<^sub>o\<^sub>w')\) and ge (infix \\\<^sub>o\<^sub>w\ 50) and gt (\'(>\<^sub>o\<^sub>w')\) and gt (infix \>\<^sub>o\<^sub>w\ 50) tts_register_sbts \(\\<^sub>o\<^sub>w)\ | U proof- assume "Domainp AOA = (\x. x \ U)" "bi_unique AOA" "right_total AOA" from tts_AA_eq_transfer[OF this] show ?thesis by auto qed tts_register_sbts \(<\<^sub>o\<^sub>w)\ | U proof- assume "Domainp AOA = (\x. x \ U)" "bi_unique AOA" "right_total AOA" from tts_AA_eq_transfer[OF this] show ?thesis by auto qed end locale ord_pair_ow = ord\<^sub>1: ord_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: ord_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 begin notation le\<^sub>1 (\'(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1')\) and le\<^sub>1 (infix \\\<^sub>o\<^sub>w\<^sub>.\<^sub>1\ 50) and ls\<^sub>1 (\'(<\<^sub>o\<^sub>w\<^sub>.\<^sub>1')\) and ls\<^sub>1 (infix \<\<^sub>o\<^sub>w\<^sub>.\<^sub>1\ 50) and le\<^sub>2 (\'(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2')\) and le\<^sub>2 (infix \\\<^sub>o\<^sub>w\<^sub>.\<^sub>2\ 50) and ls\<^sub>2 (\'(<\<^sub>o\<^sub>w\<^sub>.\<^sub>2')\) and ls\<^sub>2 (infix \<\<^sub>o\<^sub>w\<^sub>.\<^sub>2\ 50) notation ord\<^sub>1.ge (\'(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1')\) and ord\<^sub>1.ge (infix \\\<^sub>o\<^sub>w\<^sub>.\<^sub>1\ 50) and ord\<^sub>1.gt (\'(>\<^sub>o\<^sub>w\<^sub>.\<^sub>1')\) and ord\<^sub>1.gt (infix \>\<^sub>o\<^sub>w\<^sub>.\<^sub>1\ 50) and ord\<^sub>2.ge (\'(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2')\) and ord\<^sub>2.ge (infix \\\<^sub>o\<^sub>w\<^sub>.\<^sub>2\ 50) and ord\<^sub>2.gt (\'(>\<^sub>o\<^sub>w\<^sub>.\<^sub>2')\) and ord\<^sub>2.gt (infix \>\<^sub>o\<^sub>w\<^sub>.\<^sub>2\ 50) end ud \ord.lessThan\ (\(with _ : ({..<_}))\ [1000] 10) ud lessThan' \lessThan\ ud \ord.atMost\ (\(with _ : ({.._}))\ [1000] 10) ud atMost' \atMost\ ud \ord.greaterThan\ (\(with _ : ({_<..}))\ [1000] 10) ud greaterThan' \greaterThan\ ud \ord.atLeast\ (\(with _ : ({_..}))\ [1000] 10) ud atLeast' \atLeast\ ud \ord.greaterThanLessThan\ (\(with _ : ({_<..<_}))\ [1000, 999, 1000] 10) ud greaterThanLessThan' \greaterThanLessThan\ ud \ord.atLeastLessThan\ (\(with _ _ : ({_..<_}))\ [1000, 999, 1000, 1000] 10) ud atLeastLessThan' \atLeastLessThan\ ud \ord.greaterThanAtMost\ (\(with _ _ : ({_<.._}))\ [1000, 999, 1000, 999] 10) ud greaterThanAtMost' \greaterThanAtMost\ ud \ord.atLeastAtMost\ (\(with _ : ({_.._}))\ [1000, 1000, 1000] 10) ud atLeastAtMost' \atLeastAtMost\ ud \ord.min\ (\(with _ : \min\ _ _)\ [1000, 1000, 999] 10) ud min' \min\ ud \ord.max\ (\(with _ : \max\ _ _)\ [1000, 1000, 999] 10) ud max' \max\ ctr relativization synthesis ctr_simps assumes [transfer_domain_rule, transfer_rule]: "Domainp A = (\x. x \ U)" and [transfer_rule]: "right_total A" trp (?'a A) in lessThan_ow: lessThan.with_def (\(on _ with _ : ({..<_}))\ [1000, 1000, 1000] 10) and atMost_ow: atMost.with_def (\(on _ with _ : ({.._}))\ [1000, 1000, 1000] 10) and greaterThan_ow: greaterThan.with_def (\(on _ with _: ({_<..}))\ [1000, 1000, 1000] 10) and atLeast_ow: atLeast.with_def (\(on _ with _ : ({_..}))\ [1000, 1000, 1000] 10) ctr relativization synthesis ctr_simps assumes [transfer_domain_rule, transfer_rule]: "Domainp A = (\x. x \ U)" and [transfer_rule]: "bi_unique A" "right_total A" trp (?'a A) in greaterThanLessThan_ow: greaterThanLessThan.with_def (\(on _ with _ : ({_<..<_}))\ [1000, 1000, 1000, 1000] 10) and atLeastLessThan_ow: atLeastLessThan.with_def (\(on _ with _ _ : ({_..<_}))\ [1000, 1000, 999, 1000, 1000] 10) and greaterThanAtMost_ow: greaterThanAtMost.with_def (\(on _ with _ _ : ({_<.._}))\ [1000, 1000, 999, 1000, 1000] 10) and atLeastAtMost_ow: atLeastAtMost.with_def (\(on _ with _ : ({_.._}))\ [1000, 1000, 1000, 1000] 10) ctr parametricity in min_ow: min.with_def and max_ow: max.with_def context ord_ow begin abbreviation lessThan :: "'ao \ 'ao set" ("(1{..<\<^sub>o\<^sub>w_})") where "{..<\<^sub>o\<^sub>w u} \ on U with (<\<^sub>o\<^sub>w) : {.. 'ao set" ("(1{..\<^sub>o\<^sub>w_})") where "{..\<^sub>o\<^sub>w u} \ on U with (\\<^sub>o\<^sub>w) : {..u}" abbreviation greaterThan :: "'ao \ 'ao set" ("(1{_<\<^sub>o\<^sub>w..})") where "{l<\<^sub>o\<^sub>w..} \ on U with (<\<^sub>o\<^sub>w) : {l<..}" abbreviation atLeast :: "'ao \ 'ao set" ("(1{_..\<^sub>o\<^sub>w})") where "atLeast l \ on U with (\\<^sub>o\<^sub>w) : {l..}" abbreviation greaterThanLessThan :: "'ao \ 'ao \ 'ao set" ("(1{_<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>w_})") where "{l<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wu} \ on U with (<\<^sub>o\<^sub>w) : {l<.. 'ao \ 'ao set" ("(1{_..<\<^sub>o\<^sub>w_})") where "{l..<\<^sub>o\<^sub>w u} \ on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l<..u}" abbreviation greaterThanAtMost :: "'ao \ 'ao \ 'ao set" ("(1{_<\<^sub>o\<^sub>w.._})") where "{l<\<^sub>o\<^sub>w..u} \ on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l<..u}" abbreviation atLeastAtMost :: "'ao \ 'ao \ 'ao set" ("(1{_..\<^sub>o\<^sub>w_})") where "{l..\<^sub>o\<^sub>wu} \ on U with (\\<^sub>o\<^sub>w) : {l..u}" abbreviation min :: "'ao \ 'ao \ 'ao" where "min \ min.with (\\<^sub>o\<^sub>w)" abbreviation max :: "'ao \ 'ao \ 'ao" where "max \ max.with (\\<^sub>o\<^sub>w)" end context ord_pair_ow begin notation ord\<^sub>1.lessThan ("(1{..<\<^sub>o\<^sub>w\<^sub>.\<^sub>1_})") notation ord\<^sub>1.atMost ("(1{..\<^sub>o\<^sub>w\<^sub>.\<^sub>1_})") notation ord\<^sub>1.greaterThan ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>1..})") notation ord\<^sub>1.atLeast ("(1{_..\<^sub>o\<^sub>w\<^sub>.\<^sub>1})") notation ord\<^sub>1.greaterThanLessThan ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>1..<\<^sub>o\<^sub>w\<^sub>.\<^sub>1_})") notation ord\<^sub>1.atLeastLessThan ("(1{_..<\<^sub>o\<^sub>w\<^sub>.\<^sub>1_})") notation ord\<^sub>1.greaterThanAtMost ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>1.._})") notation ord\<^sub>1.atLeastAtMost ("(1{_..\<^sub>o\<^sub>w\<^sub>.\<^sub>1_})") notation ord\<^sub>2.lessThan ("(1{..<\<^sub>o\<^sub>w\<^sub>.\<^sub>2_})") notation ord\<^sub>2.atMost ("(1{..\<^sub>o\<^sub>w\<^sub>.\<^sub>2_})") notation ord\<^sub>2.greaterThan ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>2..})") notation ord\<^sub>2.atLeast ("(1{_..\<^sub>o\<^sub>w\<^sub>.\<^sub>2})") notation ord\<^sub>2.greaterThanLessThan ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>2..<\<^sub>o\<^sub>w\<^sub>.\<^sub>2_})") notation ord\<^sub>2.atLeastLessThan ("(1{_..<\<^sub>o\<^sub>w\<^sub>.\<^sub>2_})") notation ord\<^sub>2.greaterThanAtMost ("(1{_<\<^sub>o\<^sub>w\<^sub>.\<^sub>2.._})") notation ord\<^sub>2.atLeastAtMost ("(1{_..\<^sub>o\<^sub>w\<^sub>.\<^sub>2_})") end subsection\Preorders\ subsubsection\Definitions and common properties\ locale partial_preordering_ow = fixes U :: "'ao set" and le :: "'ao \ 'ao \ bool" (infix "\<^bold>\\<^sub>o\<^sub>w" 50) assumes refl: "a \ U \ a \<^bold>\\<^sub>o\<^sub>w a" and trans: "\ a \ U; b \ U; c \ U; a \<^bold>\\<^sub>o\<^sub>w b; b \<^bold>\\<^sub>o\<^sub>w c \ \ a \<^bold>\\<^sub>o\<^sub>w c" begin notation le (infix "\<^bold>\\<^sub>o\<^sub>w" 50) end locale preordering_ow = partial_preordering_ow U le for U :: "'ao set" and le :: "'ao \ 'ao \ bool" (infix "\<^bold>\\<^sub>o\<^sub>w" 50) + fixes ls :: \'ao \ 'ao \ bool\ (infix "\<^bold><\<^sub>o\<^sub>w" 50) assumes strict_iff_not: "\ a \ U; b \ U \ \ a \<^bold><\<^sub>o\<^sub>w b \ a \<^bold>\\<^sub>o\<^sub>w b \ \ b \<^bold>\\<^sub>o\<^sub>w a" locale preorder_ow = ord_ow U le ls for U :: "'ao set" and le ls + assumes less_le_not_le: "\ x \ U; y \ U \ \ x <\<^sub>o\<^sub>w y \ x \\<^sub>o\<^sub>w y \ \ (y \\<^sub>o\<^sub>w x)" and order_refl[iff]: "x \ U \ x \\<^sub>o\<^sub>w x" and order_trans: "\ x \ U; y \ U; z \ U; x \\<^sub>o\<^sub>w y; y \\<^sub>o\<^sub>w z \ \ x \\<^sub>o\<^sub>w z" begin sublocale order: preordering_ow U \(\\<^sub>o\<^sub>w)\ \(<\<^sub>o\<^sub>w)\ + dual_order: preordering_ow U \(\\<^sub>o\<^sub>w)\ \(>\<^sub>o\<^sub>w)\ apply unfold_locales subgoal by auto subgoal by (meson order_trans) subgoal using less_le_not_le by simp subgoal by (meson order_trans) subgoal by (metis less_le_not_le) done end locale ord_preorder_ow = ord\<^sub>1: ord_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: preorder_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 begin sublocale ord_pair_ow . end locale preorder_pair_ow = ord\<^sub>1: preorder_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: preorder_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 and ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 and ls\<^sub>2 begin sublocale ord_preorder_ow .. end ud \preordering_bdd.bdd\ ud \preorder.bdd_above\ ud bdd_above' \bdd_above\ ud \preorder.bdd_below\ ud bdd_below' \bdd_below\ ctr relativization synthesis ctr_simps assumes [transfer_domain_rule, transfer_rule]: "Domainp A = (\x. x \ U)" - and [transfer_rule]: "right_total A" "bi_unique A" + and [transfer_rule]: "right_total A" trp (?'a A) in bdd_ow: bdd.with_def (\(on _ with _ : \bdd\ _)\ [1000, 1000, 1000] 10) and bdd_above_ow: bdd_above.with_def (\(on _ with _ : \bdd'_above\ _)\ [1000, 1000, 1000] 10) and bdd_below_ow: bdd_below.with_def (\(on _ with _ : \bdd'_below\ _)\ [1000, 1000, 1000] 10) declare bdd.with[ud_with del] context preorder_ow begin abbreviation bdd_above :: "'ao set \ bool" where "bdd_above \ bdd_above_ow U (\\<^sub>o\<^sub>w)" abbreviation bdd_below :: "'ao set \ bool" where "bdd_below \ bdd_below_ow U (\\<^sub>o\<^sub>w)" end subsubsection\Transfer rules\ context includes lifting_syntax begin lemma partial_preordering_transfer[transfer_rule]: assumes [transfer_rule]: "right_total A" shows "((A ===> A ===> (=)) ===> (=)) (partial_preordering_ow (Collect (Domainp A))) partial_preordering" unfolding partial_preordering_ow_def partial_preordering_def apply transfer_prover_start apply transfer_step+ by blast lemma preordering_transfer[transfer_rule]: assumes [transfer_rule]: "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (preordering_ow (Collect (Domainp A))) preordering" unfolding preordering_ow_def preordering_ow_axioms_def preordering_def preordering_axioms_def apply transfer_prover_start apply transfer_step+ by blast lemma preorder_transfer[transfer_rule]: assumes [transfer_rule]: "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (preorder_ow (Collect (Domainp A))) class.preorder" unfolding preorder_ow_def class.preorder_def apply transfer_prover_start apply transfer_step+ by blast end subsubsection\Relativization\ context preordering_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting preordering_ow_axioms eliminating through auto begin tts_lemma strict_implies_order: assumes "a \ U" and "b \ U" and "a \<^bold><\<^sub>o\<^sub>w b" shows "a \<^bold>\\<^sub>o\<^sub>w b" is preordering.strict_implies_order. tts_lemma irrefl: assumes "a \ U" shows "\a \<^bold><\<^sub>o\<^sub>w a" is preordering.irrefl. tts_lemma asym: assumes "a \ U" and "b \ U" and "a \<^bold><\<^sub>o\<^sub>w b" and "b \<^bold><\<^sub>o\<^sub>w a" shows False is preordering.asym. tts_lemma strict_trans1: assumes "a \ U" and "b \ U" and "c \ U" and "a \<^bold>\\<^sub>o\<^sub>w b" and "b \<^bold><\<^sub>o\<^sub>w c" shows "a \<^bold><\<^sub>o\<^sub>w c" is preordering.strict_trans1. tts_lemma strict_trans2: assumes "a \ U" and "b \ U" and "c \ U" and "a \<^bold><\<^sub>o\<^sub>w b" and "b \<^bold>\\<^sub>o\<^sub>w c" shows "a \<^bold><\<^sub>o\<^sub>w c" is preordering.strict_trans2. tts_lemma strict_trans: assumes "a \ U" and "b \ U" and "c \ U" and "a \<^bold><\<^sub>o\<^sub>w b" and "b \<^bold><\<^sub>o\<^sub>w c" shows "a \<^bold><\<^sub>o\<^sub>w c" is preordering.strict_trans. end end context preorder_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting preorder_ow_axioms eliminating through auto begin tts_lemma less_irrefl: assumes "x \ U" shows "\ x <\<^sub>o\<^sub>w x" is preorder_class.less_irrefl. tts_lemma bdd_below_Ioc: assumes "a \ U" and "b \ U" shows "bdd_below {a<\<^sub>o\<^sub>w..b}" is preorder_class.bdd_below_Ioc. tts_lemma bdd_above_Ioc: assumes "a \ U" and "b \ U" shows "bdd_above {a<\<^sub>o\<^sub>w..b}" is preorder_class.bdd_above_Ioc. tts_lemma bdd_above_Iic: assumes "b \ U" shows "bdd_above {..\<^sub>o\<^sub>wb}" is preorder_class.bdd_above_Iic. tts_lemma bdd_above_Iio: assumes "b \ U" shows "bdd_above {..<\<^sub>o\<^sub>wb}" is preorder_class.bdd_above_Iio. tts_lemma bdd_below_Ici: assumes "a \ U" shows "bdd_below {a..\<^sub>o\<^sub>w}" is preorder_class.bdd_below_Ici. tts_lemma bdd_below_Ioi: assumes "a \ U" shows "bdd_below {a<\<^sub>o\<^sub>w..}" is preorder_class.bdd_below_Ioi. tts_lemma bdd_above_Icc: assumes "a \ U" and "b \ U" shows "bdd_above {a..\<^sub>o\<^sub>wb}" is preorder_class.bdd_above_Icc. tts_lemma bdd_above_Ioo: assumes "a \ U" and "b \ U" shows "bdd_above {a<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wb}" is preorder_class.bdd_above_Ioo. tts_lemma bdd_below_Icc: assumes "a \ U" and "b \ U" shows "bdd_below {a..\<^sub>o\<^sub>wb}" is preorder_class.bdd_below_Icc. tts_lemma bdd_below_Ioo: assumes "a \ U" and "b \ U" shows "bdd_below {a<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wb}" is preorder_class.bdd_below_Ioo. tts_lemma bdd_above_Ico: assumes "a \ U" and "b \ U" shows "bdd_above (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a.. U" and "b \ U" shows "bdd_below (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a.. U" shows "{a<\<^sub>o\<^sub>w..} \ {a..\<^sub>o\<^sub>w}" is preorder_class.Ioi_le_Ico. tts_lemma eq_refl: assumes "y \ U" and "x = y" shows "x \\<^sub>o\<^sub>w y" is preorder_class.eq_refl. tts_lemma less_imp_le: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" shows "x \\<^sub>o\<^sub>w y" is preorder_class.less_imp_le. tts_lemma less_not_sym: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" shows "\ y <\<^sub>o\<^sub>w x" is preorder_class.less_not_sym. tts_lemma less_imp_not_less: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" shows "(\ y <\<^sub>o\<^sub>w x) = True" is preorder_class.less_imp_not_less. tts_lemma less_asym': assumes "a \ U" and "b \ U" and "a <\<^sub>o\<^sub>w b" and "b <\<^sub>o\<^sub>w a" shows P is preorder_class.less_asym'. tts_lemma less_imp_triv: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" shows "(y <\<^sub>o\<^sub>w x \ P) = True" is preorder_class.less_imp_triv. tts_lemma less_trans: assumes "x \ U" and "y \ U" and "z \ U" and "x <\<^sub>o\<^sub>w y" and "y <\<^sub>o\<^sub>w z" shows "x <\<^sub>o\<^sub>w z" is preorder_class.less_trans. tts_lemma less_le_trans: assumes "x \ U" and "y \ U" and "z \ U" and "x <\<^sub>o\<^sub>w y" and "y \\<^sub>o\<^sub>w z" shows "x <\<^sub>o\<^sub>w z" is preorder_class.less_le_trans. tts_lemma le_less_trans: assumes "x \ U" and "y \ U" and "z \ U" and "x \\<^sub>o\<^sub>w y" and "y <\<^sub>o\<^sub>w z" shows "x <\<^sub>o\<^sub>w z" is preorder_class.le_less_trans. tts_lemma bdd_aboveI: assumes "A \ U" and "M \ U" and "\x. \x \ U; x \ A\ \ x \\<^sub>o\<^sub>w M" shows "bdd_above A" is preorder_class.bdd_aboveI. tts_lemma bdd_belowI: assumes "A \ U" and "m \ U" and "\x. \x \ U; x \ A\ \ m \\<^sub>o\<^sub>w x" shows "bdd_below A" is preorder_class.bdd_belowI. tts_lemma less_asym: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" and "\ P \ y <\<^sub>o\<^sub>w x" shows P is preorder_class.less_asym. tts_lemma transp_less: "transp_on U (<\<^sub>o\<^sub>w)" is preorder_class.transp_less. tts_lemma transp_le: "transp_on U (\\<^sub>o\<^sub>w)" is preorder_class.transp_le. tts_lemma transp_gr: "transp_on U (\x y. y <\<^sub>o\<^sub>w x)" is preorder_class.transp_gr. tts_lemma transp_ge: "transp_on U (\x y. y \\<^sub>o\<^sub>w x)" is preorder_class.transp_ge. tts_lemma bdd_above_Int1: assumes "A \ U" and "B \ U" and "bdd_above A" shows "bdd_above (A \ B)" is preorder_class.bdd_above_Int1. tts_lemma bdd_above_Int2: assumes "B \ U" and "A \ U" and "bdd_above B" shows "bdd_above (A \ B)" is preorder_class.bdd_above_Int2. tts_lemma bdd_below_Int1: assumes "A \ U" and "B \ U" and "bdd_below A" shows "bdd_below (A \ B)" is preorder_class.bdd_below_Int1. tts_lemma bdd_below_Int2: assumes "B \ U" and "A \ U" and "bdd_below B" shows "bdd_below (A \ B)" is preorder_class.bdd_below_Int2. tts_lemma bdd_above_mono: assumes "B \ U" and "bdd_above B" and "A \ B" shows "bdd_above A" is preorder_class.bdd_above_mono. tts_lemma bdd_below_mono: assumes "B \ U" and "bdd_below B" and "A \ B" shows "bdd_below A" is preorder_class.bdd_below_mono. tts_lemma atLeastAtMost_subseteq_atLeastLessThan_iff: assumes "a \ U" and "b \ U" and "c \ U" and "d \ U" shows "({a..\<^sub>o\<^sub>wb} \ (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {c..\<^sub>o\<^sub>w b \ b <\<^sub>o\<^sub>w d \ c \\<^sub>o\<^sub>w a)" is preorder_class.atLeastAtMost_subseteq_atLeastLessThan_iff. tts_lemma atMost_subset_iff: assumes "x \ U" and "y \ U" shows "({..\<^sub>o\<^sub>wx} \ {..\<^sub>o\<^sub>wy}) = (x \\<^sub>o\<^sub>w y)" is Set_Interval.atMost_subset_iff. tts_lemma single_Diff_lessThan: assumes "k \ U" shows "{k} - {..<\<^sub>o\<^sub>wk} = {k}" is Set_Interval.single_Diff_lessThan. tts_lemma atLeast_subset_iff: assumes "x \ U" and "y \ U" shows "({x..\<^sub>o\<^sub>w} \ {y..\<^sub>o\<^sub>w}) = (y \\<^sub>o\<^sub>w x)" is Set_Interval.atLeast_subset_iff. tts_lemma atLeastatMost_psubset_iff: assumes "a \ U" and "b \ U" and "c \ U" and "d \ U" shows "({a..\<^sub>o\<^sub>wb} \ {c..\<^sub>o\<^sub>wd}) = (c \\<^sub>o\<^sub>w d \ (\ a \\<^sub>o\<^sub>w b \ c \\<^sub>o\<^sub>w a \ b \\<^sub>o\<^sub>w d \ (c <\<^sub>o\<^sub>w a \ b <\<^sub>o\<^sub>w d)))" is preorder_class.atLeastatMost_psubset_iff. tts_lemma not_empty_eq_Iic_eq_empty: assumes "h \ U" shows "{} \ {..\<^sub>o\<^sub>wh}" is preorder_class.not_empty_eq_Iic_eq_empty. tts_lemma atLeastatMost_subset_iff: assumes "a \ U" and "b \ U" and "c \ U" and "d \ U" shows "({a..\<^sub>o\<^sub>wb} \ {c..\<^sub>o\<^sub>wd}) = (\ a \\<^sub>o\<^sub>w b \ b \\<^sub>o\<^sub>w d \ c \\<^sub>o\<^sub>w a)" is preorder_class.atLeastatMost_subset_iff. tts_lemma Icc_subset_Ici_iff: assumes "l \ U" and "h \ U" and "l' \ U" shows "({l..\<^sub>o\<^sub>wh} \ {l'..\<^sub>o\<^sub>w}) = (\ l \\<^sub>o\<^sub>w h \ l' \\<^sub>o\<^sub>w l)" is preorder_class.Icc_subset_Ici_iff. tts_lemma Icc_subset_Iic_iff: assumes "l \ U" and "h \ U" and "h' \ U" shows "({l..\<^sub>o\<^sub>wh} \ {..\<^sub>o\<^sub>wh'}) = (\ l \\<^sub>o\<^sub>w h \ h \\<^sub>o\<^sub>w h')" is preorder_class.Icc_subset_Iic_iff. tts_lemma not_empty_eq_Ici_eq_empty: assumes "l \ U" shows "{} \ {l..\<^sub>o\<^sub>w}" is preorder_class.not_empty_eq_Ici_eq_empty. tts_lemma not_Ici_eq_empty: assumes "l \ U" shows "{l..\<^sub>o\<^sub>w} \ {}" is preorder_class.not_Ici_eq_empty. tts_lemma not_Iic_eq_empty: assumes "h \ U" shows "{..\<^sub>o\<^sub>wh} \ {}" is preorder_class.not_Iic_eq_empty. tts_lemma atLeastatMost_empty_iff2: assumes "a \ U" and "b \ U" shows "({} = {a..\<^sub>o\<^sub>wb}) = (\ a \\<^sub>o\<^sub>w b)" is preorder_class.atLeastatMost_empty_iff2. tts_lemma atLeastLessThan_empty_iff2: assumes "a \ U" and "b \ U" shows "({} = (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a.. a <\<^sub>o\<^sub>w b)" is preorder_class.atLeastLessThan_empty_iff2. tts_lemma greaterThanAtMost_empty_iff2: assumes "k \ U" and "l \ U" shows "({} = {k<\<^sub>o\<^sub>w..l}) = (\ k <\<^sub>o\<^sub>w l)" is preorder_class.greaterThanAtMost_empty_iff2. tts_lemma atLeastatMost_empty_iff: assumes "a \ U" and "b \ U" shows "({a..\<^sub>o\<^sub>wb} = {}) = (\ a \\<^sub>o\<^sub>w b)" is preorder_class.atLeastatMost_empty_iff. tts_lemma atLeastLessThan_empty_iff: assumes "a \ U" and "b \ U" shows "((on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a.. a <\<^sub>o\<^sub>w b)" is preorder_class.atLeastLessThan_empty_iff. tts_lemma greaterThanAtMost_empty_iff: assumes "k \ U" and "l \ U" shows "({k<\<^sub>o\<^sub>w..l} = {}) = (\ k <\<^sub>o\<^sub>w l)" is preorder_class.greaterThanAtMost_empty_iff. end tts_context tts: (?'a to U) substituting preorder_ow_axioms begin tts_lemma bdd_above_empty: assumes "U \ {}" shows "bdd_above {}" is preorder_class.bdd_above_empty. tts_lemma bdd_below_empty: assumes "U \ {}" shows "bdd_below {}" is preorder_class.bdd_below_empty. end tts_context tts: (?'a to U) and (?'b to \U\<^sub>2::'a set\) rewriting ctr_simps substituting preorder_ow_axioms eliminating through (auto intro: bdd_above_empty bdd_below_empty) begin tts_lemma bdd_belowI2: assumes "A \ U\<^sub>2" and "m \ U" and "\x\U\<^sub>2. f x \ U" and "\x. x \ A \ m \\<^sub>o\<^sub>w f x" shows "bdd_below (f ` A)" given preorder_class.bdd_belowI2 by blast tts_lemma bdd_aboveI2: assumes "A \ U\<^sub>2" and "\x\U\<^sub>2. f x \ U" and "M \ U" and "\x. x \ A \ f x \\<^sub>o\<^sub>w M" shows "bdd_above (f ` A)" given preorder_class.bdd_aboveI2 by blast end end subsection\Partial orders\ subsubsection\Definitions and common properties\ locale ordering_ow = partial_preordering_ow U le for U :: "'ao set" and le :: "'ao \ 'ao \ bool" (infix "\<^bold>\\<^sub>o\<^sub>w" 50) + fixes ls :: "'ao \ 'ao \ bool" (infix "\<^bold><\<^sub>o\<^sub>w" 50) assumes strict_iff_order: "\ a \ U; b \ U \ \ a \<^bold><\<^sub>o\<^sub>w b \ a \<^bold>\\<^sub>o\<^sub>w b \ a \ b" and antisym: "\ a \ U; b \ U; a \<^bold>\\<^sub>o\<^sub>w b; b \<^bold>\\<^sub>o\<^sub>w a \ \ a = b" begin notation le (infix "\<^bold>\\<^sub>o\<^sub>w" 50) and ls (infix "\<^bold><\<^sub>o\<^sub>w" 50) sublocale preordering_ow U \(\<^bold>\\<^sub>o\<^sub>w)\ \(\<^bold><\<^sub>o\<^sub>w)\ using local.antisym strict_iff_order by unfold_locales blast end locale order_ow = preorder_ow U le ls for U :: "'ao set" and le ls + assumes antisym: "\ x \ U; y \ U; x \\<^sub>o\<^sub>w y; y \\<^sub>o\<^sub>w x \ \ x = y" begin sublocale order: ordering_ow U \(\\<^sub>o\<^sub>w)\ \(<\<^sub>o\<^sub>w)\ + dual_order: ordering_ow U \(\\<^sub>o\<^sub>w)\ \(>\<^sub>o\<^sub>w)\ apply unfold_locales subgoal by (force simp: less_le_not_le antisym) subgoal by (simp add: antisym) subgoal by (force simp: less_le_not_le antisym) subgoal by (simp add: antisym) done no_notation le (infix "\<^bold>\\<^sub>o\<^sub>w" 50) and ls (infix "\<^bold><\<^sub>o\<^sub>w" 50) end locale ord_order_ow = ord\<^sub>1: ord_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: order_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 sublocale ord_order_ow \ ord_preorder_ow .. locale preorder_order_ow = ord\<^sub>1: preorder_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: order_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 sublocale preorder_order_ow \ preorder_pair_ow .. locale order_pair_ow = ord\<^sub>1: order_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: order_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 sublocale order_pair_ow \ preorder_order_ow .. ud \order.mono\ (\(with _ _ : \mono\ _)\ [1000, 999, 1000] 10) ud mono' \mono\ ud \order.strict_mono\ (\(with _ _ : \strict'_mono\ _)\ [1000, 999, 1000] 10) ud strict_mono' \strict_mono\ ud \order.antimono\ (\(with _ _ : \strict'_mono\ _)\ [1000, 999, 1000] 10) ud antimono' \antimono\ ud \monoseq\ (\(with _ : \monoseq\ _)\ [1000, 1000] 10) ctr relativization synthesis ctr_simps assumes [transfer_domain_rule, transfer_rule]: "Domainp (B::'c\'d\bool) = (\x. x \ U\<^sub>2)" and [transfer_rule]: "right_total B" trp (?'b \A::'a\'b\bool\) and (?'a B) in mono_ow: mono.with_def (\(on _ with _ _ : \mono\ _)\ [1000, 1000, 999, 1000] 10) and strict_mono_ow: strict_mono.with_def (\(on _ with _ _ : \strict'_mono\ _)\ [1000, 1000, 999, 1000] 10) and antimono_ow: antimono.with_def (\(on _ with _ _ : \antimono\ _)\ [1000, 1000, 999, 1000] 10) and monoseq_ow: monoseq.with_def subsubsection\Transfer rules\ context includes lifting_syntax begin lemma ordering_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (ordering_ow (Collect (Domainp A))) ordering" unfolding ordering_ow_def ordering_ow_axioms_def ordering_def ordering_axioms_def apply transfer_prover_start apply transfer_step+ unfolding Ball_Collect[symmetric] by (intro ext HOL.arg_cong2[where f="(\)"]) auto lemma order_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (order_ow (Collect (Domainp A))) class.order" unfolding order_ow_def class.order_def order_ow_axioms_def class.order_axioms_def apply transfer_prover_start apply transfer_step+ by simp end subsubsection\Relativization\ context ordering_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting ordering_ow_axioms eliminating through simp begin tts_lemma strict_implies_not_eq: assumes "a \ U" and "b \ U" and "a \<^bold><\<^sub>o\<^sub>w b" shows "a \ b" is ordering.strict_implies_not_eq. tts_lemma order_iff_strict: assumes "a \ U" and "b \ U" shows "(a \<^bold>\\<^sub>o\<^sub>w b) = (a \<^bold><\<^sub>o\<^sub>w b \ a = b)" is ordering.order_iff_strict. tts_lemma not_eq_order_implies_strict: assumes "a \ U" and "b \ U" and "a \ b" and "a \<^bold>\\<^sub>o\<^sub>w b" shows "a \<^bold><\<^sub>o\<^sub>w b" is ordering.not_eq_order_implies_strict. tts_lemma eq_iff: assumes "a \ U" and "b \ U" shows "(a = b) = (a \<^bold>\\<^sub>o\<^sub>w b \ b \<^bold>\\<^sub>o\<^sub>w a)" is ordering.eq_iff. end end context order_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting order_ow_axioms eliminating through clarsimp begin tts_lemma atLeastAtMost_singleton: assumes "a \ U" shows "{a..\<^sub>o\<^sub>wa} = {a}" is order_class.atLeastAtMost_singleton. tts_lemma less_imp_neq: assumes "y \ U" and "x <\<^sub>o\<^sub>w y" shows "x \ y" is order_class.less_imp_neq. tts_lemma atLeastatMost_empty: assumes "b \ U" and "a \ U" and "b <\<^sub>o\<^sub>w a" shows "{a..\<^sub>o\<^sub>wb} = {}" is order_class.atLeastatMost_empty. tts_lemma less_imp_not_eq: assumes "y \ U" and "x <\<^sub>o\<^sub>w y" shows "(x = y) = False" is order_class.less_imp_not_eq. tts_lemma less_imp_not_eq2: assumes "y \ U" and "x <\<^sub>o\<^sub>w y" shows "(y = x) = False" is order_class.less_imp_not_eq2. tts_lemma atLeastLessThan_empty: assumes "b \ U" and "a \ U" and "b \\<^sub>o\<^sub>w a" shows "(on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a.. U" and "k \ U" and "l \\<^sub>o\<^sub>w k" shows "{k<\<^sub>o\<^sub>w..l} = {}" is order_class.greaterThanAtMost_empty. tts_lemma antisym_conv1: assumes "x \ U" and "y \ U" and "\ x <\<^sub>o\<^sub>w y" shows "(x \\<^sub>o\<^sub>w y) = (x = y)" is order_class.antisym_conv1. tts_lemma antisym_conv2: assumes "x \ U" and "y \ U" and "x \\<^sub>o\<^sub>w y" shows "(\ x <\<^sub>o\<^sub>w y) = (x = y)" is order_class.antisym_conv2. tts_lemma greaterThanLessThan_empty: assumes "l \ U" and "k \ U" and "l \\<^sub>o\<^sub>w k" shows "{k<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wl} = {}" is order_class.greaterThanLessThan_empty. tts_lemma atLeastLessThan_eq_atLeastAtMost_diff: assumes "a \ U" and "b \ U" shows "(on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {a..o\<^sub>wb} - {b}" is order_class.atLeastLessThan_eq_atLeastAtMost_diff. tts_lemma greaterThanAtMost_eq_atLeastAtMost_diff: assumes "a \ U" and "b \ U" shows "{a<\<^sub>o\<^sub>w..b} = {a..\<^sub>o\<^sub>wb} - {a}" is order_class.greaterThanAtMost_eq_atLeastAtMost_diff. tts_lemma less_separate: assumes "x \ U" and "y \ U" and "x <\<^sub>o\<^sub>w y" shows "\x'\U. \y'\U. x \ {..<\<^sub>o\<^sub>wx'} \ y \ {y'<\<^sub>o\<^sub>w..} \ {..<\<^sub>o\<^sub>wx'} \ {y'<\<^sub>o\<^sub>w..} = {}" is order_class.less_separate. tts_lemma order_iff_strict: assumes "a \ U" and "b \ U" shows "(a \\<^sub>o\<^sub>w b) = (a <\<^sub>o\<^sub>w b \ a = b)" is order_class.order.order_iff_strict. tts_lemma le_less: assumes "x \ U" and "y \ U" shows "(x \\<^sub>o\<^sub>w y) = (x <\<^sub>o\<^sub>w y \ x = y)" is order_class.le_less. tts_lemma strict_iff_order: assumes "a \ U" and "b \ U" shows "(a <\<^sub>o\<^sub>w b) = (a \\<^sub>o\<^sub>w b \ a \ b)" is order_class.order.strict_iff_order. tts_lemma less_le: assumes "x \ U" and "y \ U" shows "(x <\<^sub>o\<^sub>w y) = (x \\<^sub>o\<^sub>w y \ x \ y)" is order_class.less_le. tts_lemma atLeastAtMost_singleton': assumes "b \ U" and "a = b" shows "{a..\<^sub>o\<^sub>wb} = {a}" is order_class.atLeastAtMost_singleton'. tts_lemma le_imp_less_or_eq: assumes "x \ U" and "y \ U" and "x \\<^sub>o\<^sub>w y" shows "x <\<^sub>o\<^sub>w y \ x = y" is order_class.le_imp_less_or_eq. tts_lemma antisym_conv: assumes "y \ U" and "x \ U" and "y \\<^sub>o\<^sub>w x" shows "(x \\<^sub>o\<^sub>w y) = (x = y)" is order_class.antisym_conv. tts_lemma le_neq_trans: assumes "a \ U" and "b \ U" and "a \\<^sub>o\<^sub>w b" and "a \ b" shows "a <\<^sub>o\<^sub>w b" is order_class.le_neq_trans. tts_lemma neq_le_trans: assumes "a \ U" and "b \ U" and "a \ b" and "a \\<^sub>o\<^sub>w b" shows "a <\<^sub>o\<^sub>w b" is order_class.neq_le_trans. tts_lemma Iio_Int_singleton: assumes "k \ U" and "x \ U" shows "{..<\<^sub>o\<^sub>wk} \ {x} = (if x <\<^sub>o\<^sub>w k then {x} else {})" is order_class.Iio_Int_singleton. tts_lemma atLeastAtMost_singleton_iff: assumes "a \ U" and "b \ U" and "c \ U" shows "({a..\<^sub>o\<^sub>wb} = {c}) = (a = b \ b = c)" is order_class.atLeastAtMost_singleton_iff. tts_lemma Icc_eq_Icc: assumes "l \ U" and "h \ U" and "l' \ U" and "h' \ U" shows "({l..\<^sub>o\<^sub>wh} = {l'..\<^sub>o\<^sub>wh'}) = (h = h' \ l = l' \ \ l' \\<^sub>o\<^sub>w h' \ \ l \\<^sub>o\<^sub>w h)" is order_class.Icc_eq_Icc. tts_lemma lift_Suc_mono_less_iff: assumes "range f \ U" and "\n. f n <\<^sub>o\<^sub>w f (Suc n)" shows "(f n <\<^sub>o\<^sub>w f m) = (n < m)" is order_class.lift_Suc_mono_less_iff. tts_lemma lift_Suc_mono_less: assumes "range f \ U" and "\n. f n <\<^sub>o\<^sub>w f (Suc n)" and "n < n'" shows "f n <\<^sub>o\<^sub>w f n'" is order_class.lift_Suc_mono_less. tts_lemma lift_Suc_mono_le: assumes "range f \ U" and "\n. f n \\<^sub>o\<^sub>w f (Suc n)" and "n \ n'" shows "f n \\<^sub>o\<^sub>w f n'" is order_class.lift_Suc_mono_le. tts_lemma lift_Suc_antimono_le: assumes "range f \ U" and "\n. f (Suc n) \\<^sub>o\<^sub>w f n" and "n \ n'" shows "f n' \\<^sub>o\<^sub>w f n" is order_class.lift_Suc_antimono_le. tts_lemma ivl_disj_int_two: assumes "l \ U" and "m \ U" and "u \ U" shows "{l<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wm} \ (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {m..o\<^sub>w..m} \ {m<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wu} = {}" "(on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l.. (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {m..o\<^sub>wm} \ {m<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wu} = {}" "{l<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wm} \ {m..\<^sub>o\<^sub>wu} = {}" "{l<\<^sub>o\<^sub>w..m} \ {m<\<^sub>o\<^sub>w..u} = {}" "(on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l.. {m..\<^sub>o\<^sub>wu} = {}" "{l..\<^sub>o\<^sub>wm} \ {m<\<^sub>o\<^sub>w..u} = {}" is Set_Interval.ivl_disj_int_two. tts_lemma ivl_disj_int_one: assumes "l \ U" and "u \ U" shows "{..\<^sub>o\<^sub>wl} \ {l<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wu} = {}" "{..<\<^sub>o\<^sub>wl} \ (on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l..o\<^sub>wl} \ {l<\<^sub>o\<^sub>w..u} = {}" "{..<\<^sub>o\<^sub>wl} \ {l..\<^sub>o\<^sub>wu} = {}" "{l<\<^sub>o\<^sub>w..u} \ {u<\<^sub>o\<^sub>w..} = {}" "{l<\<^sub>o\<^sub>w..<\<^sub>o\<^sub>wu} \ {u..\<^sub>o\<^sub>w} = {}" "{l..\<^sub>o\<^sub>wu} \ {u<\<^sub>o\<^sub>w..} = {}" "(on U with (\\<^sub>o\<^sub>w) (<\<^sub>o\<^sub>w) : {l.. {u..\<^sub>o\<^sub>w} = {}" is Set_Interval.ivl_disj_int_one. tts_lemma min_absorb2: assumes "y \ U" and "x \ U" and "y \\<^sub>o\<^sub>w x" shows "local.min x y = y" is Orderings.min_absorb2. tts_lemma max_absorb1: assumes "y \ U" and "x \ U" and "y \\<^sub>o\<^sub>w x" shows "local.max x y = x" is Orderings.max_absorb1. tts_lemma finite_mono_remains_stable_implies_strict_prefix: assumes "range f \ U" and "finite (range f)" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ f" and "\n. f n = f (Suc n) \ f (Suc n) = f (Suc (Suc n))" shows "\N. (\n\N. f N = f n) \ (\n\N. \m\N. m < n \ f m <\<^sub>o\<^sub>w f n)" is Hilbert_Choice.finite_mono_remains_stable_implies_strict_prefix. tts_lemma incseq_imp_monoseq: assumes "range X \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ X" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.incseq_imp_monoseq. tts_lemma decseq_imp_monoseq: assumes "range X \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ X" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.decseq_imp_monoseq. tts_lemma incseq_Suc_iff: assumes "range f \ U" shows "(on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ f) = (\x. f x \\<^sub>o\<^sub>w f (Suc x))" is Topological_Spaces.incseq_Suc_iff. tts_lemma decseq_Suc_iff: assumes "range f \ U" shows "(on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ f) = (\x. f (Suc x) \\<^sub>o\<^sub>w f x)" is Topological_Spaces.decseq_Suc_iff. tts_lemma incseq_const: assumes "k \ U" shows "on (UNIV::nat set) with (\\<^sub>o\<^sub>w) (\) : \mono\ (\x. k)" is Topological_Spaces.incseq_const. tts_lemma decseq_const: assumes "k \ U" shows "on (UNIV::nat set) with (\\<^sub>o\<^sub>w) (\) : \antimono\ (\x. k)" is Topological_Spaces.decseq_const. tts_lemma atMost_Int_atLeast: assumes "n \ U" shows "{..\<^sub>o\<^sub>wn} \ {n..\<^sub>o\<^sub>w} = {n}" is Set_Interval.atMost_Int_atLeast. tts_lemma monoseq_iff: assumes "range X \ U" shows "(with (\\<^sub>o\<^sub>w) : \monoseq\ X) = ( (on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ X) \ (on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ X) )" is Topological_Spaces.monoseq_iff. tts_lemma monoseq_Suc: assumes "range X \ U" shows "(with (\\<^sub>o\<^sub>w) : \monoseq\ X) = ((\x. X x \\<^sub>o\<^sub>w X (Suc x)) \ (\x. X (Suc x) \\<^sub>o\<^sub>w X x))" is Topological_Spaces.monoseq_Suc. tts_lemma incseq_SucI: assumes "range X \ U" and "\n. X n \\<^sub>o\<^sub>w X (Suc n)" shows "on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ X" is Topological_Spaces.incseq_SucI. tts_lemma incseq_SucD: assumes "range A \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ A" shows "A i \\<^sub>o\<^sub>w A (Suc i)" is Topological_Spaces.incseq_SucD. tts_lemma decseq_SucI: assumes "range X \ U" and "\n. X (Suc n) \\<^sub>o\<^sub>w X n" shows "on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ X" is Topological_Spaces.decseq_SucI. tts_lemma decseq_SucD: assumes "range A \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ A" shows "A (Suc i) \\<^sub>o\<^sub>w A i" is Topological_Spaces.decseq_SucD. tts_lemma mono_SucI2: assumes "range X \ U" and "\x. X (Suc x) \\<^sub>o\<^sub>w X x" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.mono_SucI2. tts_lemma mono_SucI1: assumes "range X \ U" and "\x. X x \\<^sub>o\<^sub>w X (Suc x)" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.mono_SucI1. tts_lemma incseqD: assumes "range f \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ f" and "(i::nat) \ j" shows "f i \\<^sub>o\<^sub>w f j" is Topological_Spaces.incseqD. tts_lemma decseqD: assumes "range f \ U" and "on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ f" and "(i::nat) \ j" shows "f j \\<^sub>o\<^sub>w f i" is Topological_Spaces.decseqD. tts_lemma monoI2: assumes "range X \ U" and "\x y. x \ y \ X y \\<^sub>o\<^sub>w X x" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.monoI2. tts_lemma monoI1: assumes "range X \ U" and "\x y. x \ y \ X x \\<^sub>o\<^sub>w X y" shows "with (\\<^sub>o\<^sub>w) : \monoseq\ X" is Topological_Spaces.monoI1. tts_lemma antimono_iff_le_Suc: assumes "range f \ U" shows "(on UNIV with (\\<^sub>o\<^sub>w) (\) : \antimono\ f) = (\x. f (Suc x) \\<^sub>o\<^sub>w f x)" is Nat.antimono_iff_le_Suc. tts_lemma mono_iff_le_Suc: assumes "range f \ U" shows "(on UNIV with (\\<^sub>o\<^sub>w) (\) : \mono\ f) = (\x. f x \\<^sub>o\<^sub>w f (Suc x))" is Nat.mono_iff_le_Suc. tts_lemma funpow_mono2: assumes "\x\U. f x \ U" and "x \ U" and "y \ U" and "on U with (\\<^sub>o\<^sub>w) (\\<^sub>o\<^sub>w) : \mono\ f" and "i \ j" and "x \\<^sub>o\<^sub>w y" and "x \\<^sub>o\<^sub>w f x" shows "(f ^^ i) x \\<^sub>o\<^sub>w (f ^^ j) y" is Nat.funpow_mono2. tts_lemma funpow_mono: assumes "\x\U. f x \ U" and "A \ U" and "B \ U" and "on U with (\\<^sub>o\<^sub>w) (\\<^sub>o\<^sub>w) : \mono\ f" and "A \\<^sub>o\<^sub>w B" shows "(f ^^ n) A \\<^sub>o\<^sub>w (f ^^ n) B" is Nat.funpow_mono. end tts_context tts: (?'a to U) rewriting ctr_simps substituting order_ow_axioms eliminating through clarsimp begin tts_lemma ex_min_if_finite: assumes "S \ U" and "finite S" and "S \ {}" shows "\x\S. \ (\y\S. y <\<^sub>o\<^sub>w x)" is Lattices_Big.ex_min_if_finite. end tts_context tts: (?'a to U) sbterms: (\(\)::['a::order, 'a::order] \ bool\ to \(\\<^sub>o\<^sub>w)\) and (\(<)::['a::order, 'a::order] \ bool\ to \(<\<^sub>o\<^sub>w)\) substituting order_ow_axioms eliminating through clarsimp begin tts_lemma xt1: shows "\a = b; c <\<^sub>o\<^sub>w b\ \ c <\<^sub>o\<^sub>w a" "\b <\<^sub>o\<^sub>w a; b = c\ \ c <\<^sub>o\<^sub>w a" "\a = b; c \\<^sub>o\<^sub>w b\ \ c \\<^sub>o\<^sub>w a" "\b \\<^sub>o\<^sub>w a; b = c\ \ c \\<^sub>o\<^sub>w a" "\y \ U; x \ U; y \\<^sub>o\<^sub>w x; x \\<^sub>o\<^sub>w y\ \ x = y" "\y \ U; x \ U; z \ U; y \\<^sub>o\<^sub>w x; z \\<^sub>o\<^sub>w y\ \ z \\<^sub>o\<^sub>w x" "\y \ U; x \ U; z \ U; y <\<^sub>o\<^sub>w x; z \\<^sub>o\<^sub>w y\ \ z <\<^sub>o\<^sub>w x" "\y \ U; x \ U; z \ U; y \\<^sub>o\<^sub>w x; z <\<^sub>o\<^sub>w y\ \ z <\<^sub>o\<^sub>w x" "\b \ U; a \ U; b <\<^sub>o\<^sub>w a; a <\<^sub>o\<^sub>w b\ \ P" "\y \ U; x \ U; z \ U; y <\<^sub>o\<^sub>w x; z <\<^sub>o\<^sub>w y\ \ z <\<^sub>o\<^sub>w x" "\b \ U; a \ U; b \\<^sub>o\<^sub>w a; a \ b\ \ b <\<^sub>o\<^sub>w a" "\a \ U; b \ U; a \ b; b \\<^sub>o\<^sub>w a\ \ b <\<^sub>o\<^sub>w a" "\ b \ U; c \ U; a = f b; c <\<^sub>o\<^sub>w b; \x y. \x \ U; y \ U; y <\<^sub>o\<^sub>w x\ \ f y <\<^sub>o\<^sub>w f x \ \ f c <\<^sub>o\<^sub>w a" "\ b \ U; a \ U; b <\<^sub>o\<^sub>w a; f b = c; \x y. \x \ U; y \ U; y <\<^sub>o\<^sub>w x\ \ f y <\<^sub>o\<^sub>w f x \ \ c <\<^sub>o\<^sub>w f a" "\ b \ U; c \ U; a = f b; c \\<^sub>o\<^sub>w b; \x y. \x \ U; y \ U; y \\<^sub>o\<^sub>w x\ \ f y \\<^sub>o\<^sub>w f x \ \ f c \\<^sub>o\<^sub>w a" "\ b \ U; a \ U; b \\<^sub>o\<^sub>w a; f b = c; \x y. \x \ U; y \ U; y \\<^sub>o\<^sub>w x\ \ f y \\<^sub>o\<^sub>w f x \ \ c \\<^sub>o\<^sub>w f a" is Orderings.xt1. end tts_context tts: (?'a to U) and (?'b to \U\<^sub>2::'b set\) rewriting ctr_simps substituting order_ow_axioms eliminating through (simp add: mono_ow_def) begin tts_lemma coinduct3_mono_lemma: assumes "\x\U. f x \ U\<^sub>2" and "X \ U\<^sub>2" and "B \ U\<^sub>2" and "on U with (\) (\\<^sub>o\<^sub>w) : \mono\ f" shows "on U with (\) (\\<^sub>o\<^sub>w) : \mono\ (\x. f x \ (X \ B))" is Inductive.coinduct3_mono_lemma. end end context ord_order_ow begin tts_context tts: (?'a to U\<^sub>2) and (?'b to U\<^sub>1) sbterms: (\(\)::[?'a::order, ?'a::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) and (\(<)::[?'a::order, ?'a::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) and (\(\)::[?'b::ord, ?'b::ord] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(<)::[?'b::ord, ?'b::ord] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) rewriting ctr_simps substituting ord\<^sub>2.order_ow_axioms eliminating through clarsimp begin tts_lemma xt2: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "b \ U\<^sub>1" and "a \ U\<^sub>2" and "c \ U\<^sub>1" and "f b \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 a" and "c \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "f c \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 a" is Orderings.xt2. tts_lemma xt6: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "b \ U\<^sub>1" and "a \ U\<^sub>2" and "c \ U\<^sub>1" and "f b \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 a" and "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "f c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 a" is Orderings.xt6. end end context order_pair_ow begin tts_context tts: (?'a to U\<^sub>1) and (?'b to U\<^sub>2) rewriting ctr_simps substituting ord\<^sub>1.order_ow_axioms and ord\<^sub>2.order_ow_axioms eliminating through ( unfold strict_mono_ow_def mono_ow_def antimono_ow_def bdd_above_ow_def bdd_below_ow_def bdd_ow_def, clarsimp ) begin tts_lemma antimonoD: assumes "x \ U\<^sub>1" and "y \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \antimono\ f" and "x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y" shows "f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" is Orderings.antimonoD. tts_lemma monoD: assumes "x \ U\<^sub>1" and "y \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" and "x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y" shows "f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" is Orderings.monoD. tts_lemma strict_monoD: assumes "x \ U\<^sub>1" and "y \ U\<^sub>1" and "on U\<^sub>1 with (<\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \strict_mono\ f" and "x <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y" shows "f x <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" is Orderings.strict_monoD. tts_lemma strict_monoI: assumes "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "on U\<^sub>1 with (<\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \strict_mono\ f" is Orderings.strict_monoI. tts_lemma antimonoI: assumes "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \antimono\ f" is Orderings.antimonoI. tts_lemma monoI: assumes "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" is Orderings.monoI. tts_lemma antimonoE: assumes "x \ U\<^sub>1" and "y \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \antimono\ f" and "x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y" and "f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x \ thesis" shows thesis is Orderings.antimonoE. tts_lemma monoE: assumes "x \ U\<^sub>1" and "y \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" and "x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y" and "f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y \ thesis" shows thesis is Orderings.monoE. tts_lemma strict_mono_mono: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "on U\<^sub>1 with (<\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \strict_mono\ f" shows "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" is Orderings.strict_mono_mono. tts_lemma bdd_below_image_antimono: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "A \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \antimono\ f" and "ord\<^sub>1.bdd_above A" shows "ord\<^sub>2.bdd_below (f ` A)" is Conditionally_Complete_Lattices.bdd_below_image_antimono. tts_lemma bdd_above_image_antimono: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "A \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \antimono\ f" and "ord\<^sub>1.bdd_below A" shows "ord\<^sub>2.bdd_above (f ` A)" is Conditionally_Complete_Lattices.bdd_above_image_antimono. tts_lemma bdd_below_image_mono: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "A \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" and "ord\<^sub>1.bdd_below A" shows "ord\<^sub>2.bdd_below (f ` A)" is Conditionally_Complete_Lattices.bdd_below_image_mono. tts_lemma bdd_above_image_mono: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "A \ U\<^sub>1" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" and "ord\<^sub>1.bdd_above A" shows "ord\<^sub>2.bdd_above (f ` A)" is Conditionally_Complete_Lattices.bdd_above_image_mono. tts_lemma strict_mono_leD: assumes "\x\U\<^sub>1. r x \ U\<^sub>2" and "m \ U\<^sub>1" and "n \ U\<^sub>1" and "on U\<^sub>1 with (<\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \strict_mono\ r" and "m \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 n" shows "r m \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 r n" is Topological_Spaces.strict_mono_leD. tts_lemma mono_image_least: assumes "\x\U\<^sub>1. f x \ U\<^sub>2" and "m \ U\<^sub>1" and "n \ U\<^sub>1" and "m' \ U\<^sub>2" and "n' \ U\<^sub>2" and "on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : \mono\ f" and "f ` (on U\<^sub>1 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>1) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>1) : {m..2 with (\\<^sub>o\<^sub>w\<^sub>.\<^sub>2) (<\<^sub>o\<^sub>w\<^sub>.\<^sub>2) : {m'..o\<^sub>w\<^sub>.\<^sub>1 n" shows "f m = m'" is Set_Interval.mono_image_least. end tts_context tts: (?'a to U\<^sub>1) and (?'b to U\<^sub>2) sbterms: (\(\)::[?'a::order, ?'a::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(<)::[?'a::order, ?'a::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(\)::[?'b::order, ?'b::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) and (\(<)::[?'b::order, ?'b::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) rewriting ctr_simps substituting ord\<^sub>1.order_ow_axioms and ord\<^sub>2.order_ow_axioms eliminating through clarsimp begin tts_lemma xt3: assumes "b \ U\<^sub>1" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "b \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "c \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f a" is Orderings.xt3. tts_lemma xt4: assumes "\x\U\<^sub>2. f x \ U\<^sub>1" and "b \ U\<^sub>2" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "f b <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 b" and "\x y. \x \ U\<^sub>2; y \ U\<^sub>2; y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 x\ \ f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f x" shows "f c <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" is Orderings.xt4. tts_lemma xt5: assumes "b \ U\<^sub>1" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "b <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f a" is Orderings.xt5. tts_lemma xt7: assumes "b \ U\<^sub>1" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "b \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f a" is Orderings.xt7. tts_lemma xt8: assumes "\x\U\<^sub>2. f x \ U\<^sub>1" and "b \ U\<^sub>2" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "f b <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 b" and "\x y. \x \ U\<^sub>2; y \ U\<^sub>2; y <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 x\ \ f y <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f x" shows "f c <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" is Orderings.xt8. tts_lemma xt9: assumes "b \ U\<^sub>1" and "a \ U\<^sub>1" and "c \ U\<^sub>2" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "b <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 a" and "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f b" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; y <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 x\ \ f y <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f x" shows "c <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f a" is Orderings.xt9. end tts_context tts: (?'a to U\<^sub>1) and (?'b to U\<^sub>2) sbterms: (\(\)::[?'a::order, ?'a::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(<)::[?'a::order, ?'a::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(\)::[?'b::order, ?'b::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) and (\(<)::[?'b::order, ?'b::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) rewriting ctr_simps substituting ord\<^sub>1.order_ow_axioms and ord\<^sub>2.order_ow_axioms eliminating through simp begin tts_lemma order_less_subst1: assumes "a \ U\<^sub>1" and "\x\U\<^sub>2. f x \ U\<^sub>1" and "b \ U\<^sub>2" and "c \ U\<^sub>2" and "a <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f b" and "b <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>2; y \ U\<^sub>2; x <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 y\ \ f x <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f y" shows "a <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f c" is Orderings.order_less_subst1. tts_lemma order_subst1: assumes "a \ U\<^sub>1" and "\x\U\<^sub>2. f x \ U\<^sub>1" and "b \ U\<^sub>2" and "c \ U\<^sub>2" and "a \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f b" and "b \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>2; y \ U\<^sub>2; x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 y\ \ f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f y" shows "a \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 f c" is Orderings.order_subst1. end tts_context tts: (?'a to U\<^sub>1) and (?'c to U\<^sub>2) sbterms: (\(\)::[?'a::order, ?'a::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(<)::[?'a::order, ?'a::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>1)\) and (\(\)::[?'c::order, ?'c::order] \ bool\ to \(\\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) and (\(<)::[?'c::order, ?'c::order] \ bool\ to \(<\<^sub>o\<^sub>w\<^sub>.\<^sub>2)\) rewriting ctr_simps substituting ord\<^sub>1.order_ow_axioms and ord\<^sub>2.order_ow_axioms eliminating through simp begin tts_lemma order_less_le_subst2: assumes "a \ U\<^sub>1" and "b \ U\<^sub>1" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "c \ U\<^sub>2" and "a <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "f b \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "f a <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" is Orderings.order_less_le_subst2. tts_lemma order_le_less_subst2: assumes "a \ U\<^sub>1" and "b \ U\<^sub>1" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "c \ U\<^sub>2" and "a \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "f b <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "f a <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" is Orderings.order_le_less_subst2. tts_lemma order_less_subst2: assumes "a \ U\<^sub>1" and "b \ U\<^sub>1" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "c \ U\<^sub>2" and "a <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "f b <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x <\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "f a <\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" is Orderings.order_less_subst2. tts_lemma order_subst2: assumes "a \ U\<^sub>1" and "b \ U\<^sub>1" and "\x\U\<^sub>1. f x \ U\<^sub>2" and "c \ U\<^sub>2" and "a \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 b" and "f b \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" and "\x y. \x \ U\<^sub>1; y \ U\<^sub>1; x \\<^sub>o\<^sub>w\<^sub>.\<^sub>1 y\ \ f x \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 f y" shows "f a \\<^sub>o\<^sub>w\<^sub>.\<^sub>2 c" is Orderings.order_subst2. end end subsection\Dense orders\ subsubsection\Definitions and common properties\ locale dense_order_ow = order_ow U le ls for U :: "'ao set" and le ls + assumes dense: "\ x \ U; y \ U; x <\<^sub>o\<^sub>w y \ \ (\z\U. x <\<^sub>o\<^sub>w z \ z <\<^sub>o\<^sub>w y)" subsubsection\Transfer rules\ context includes lifting_syntax begin lemma dense_order_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (dense_order_ow (Collect (Domainp A))) class.dense_order" unfolding dense_order_ow_def class.dense_order_def dense_order_ow_axioms_def class.dense_order_axioms_def apply transfer_prover_start apply transfer_step+ by simp end subsection\ Partial orders with the greatest element and partial orders with the least elements \ subsubsection\Definitions and common properties\ locale ordering_top_ow = ordering_ow U le ls for U :: "'ao set" and le ls + fixes top :: "'ao" ("\<^bold>\\<^sub>o\<^sub>w") assumes top_closed[simp]: "\<^bold>\\<^sub>o\<^sub>w \ U" assumes extremum[simp]: "a \ U \ a \<^bold>\\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w" begin notation top ("\<^bold>\\<^sub>o\<^sub>w") end locale bot_ow = fixes U :: "'ao set" and bot (\\\<^sub>o\<^sub>w\) assumes bot_closed[simp]: "\\<^sub>o\<^sub>w \ U" begin notation bot (\\\<^sub>o\<^sub>w\) end locale bot_pair_ow = ord\<^sub>1: bot_ow U\<^sub>1 bot\<^sub>1 + ord\<^sub>2: bot_ow U\<^sub>2 bot\<^sub>2 for U\<^sub>1 :: "'ao set" and bot\<^sub>1 and U\<^sub>2 :: "'bo set" and bot\<^sub>2 begin notation bot\<^sub>1 (\\\<^sub>o\<^sub>w\<^sub>.\<^sub>1\) notation bot\<^sub>2 (\\\<^sub>o\<^sub>w\<^sub>.\<^sub>2\) end locale order_bot_ow = order_ow U le ls + bot_ow U bot for U :: "'ao set" and bot le ls + assumes bot_least: "a \ U \ \\<^sub>o\<^sub>w \\<^sub>o\<^sub>w a" begin sublocale bot: ordering_top_ow U \(\\<^sub>o\<^sub>w)\ \(>\<^sub>o\<^sub>w)\ \\\<^sub>o\<^sub>w\ apply unfold_locales subgoal by simp subgoal by (simp add: bot_least) done no_notation le (infix "\<^bold>\\<^sub>o\<^sub>w" 50) and ls (infix "\<^bold><\<^sub>o\<^sub>w" 50) and top ("\<^bold>\\<^sub>o\<^sub>w") end locale order_bot_pair_ow = ord\<^sub>1: order_bot_ow U\<^sub>1 bot\<^sub>1 le\<^sub>1 ls\<^sub>1 + ord\<^sub>2: order_bot_ow U\<^sub>2 bot\<^sub>2 le\<^sub>2 ls\<^sub>2 for U\<^sub>1 :: "'ao set" and bot\<^sub>1 le\<^sub>1 ls\<^sub>1 and U\<^sub>2 :: "'bo set" and bot\<^sub>2 le\<^sub>2 ls\<^sub>2 begin sublocale bot_pair_ow .. sublocale order_pair_ow .. end locale top_ow = fixes U :: "'ao set" and top (\\\<^sub>o\<^sub>w\) assumes top_closed[simp]: "\\<^sub>o\<^sub>w \ U" begin notation top (\\\<^sub>o\<^sub>w\) end locale top_pair_ow = ord\<^sub>1: top_ow U\<^sub>1 top\<^sub>1 + ord\<^sub>2: top_ow U\<^sub>2 top\<^sub>2 for U\<^sub>1 :: "'ao set" and top\<^sub>1 and U\<^sub>2 :: "'bo set" and top\<^sub>2 begin notation top\<^sub>1 (\\\<^sub>o\<^sub>w\<^sub>.\<^sub>1\) notation top\<^sub>2 (\\\<^sub>o\<^sub>w\<^sub>.\<^sub>2\) end locale order_top_ow = order_ow U le ls + top_ow U top for U :: "'ao set" and le ls top + assumes top_greatest: "a \ U \ a \\<^sub>o\<^sub>w \\<^sub>o\<^sub>w" begin sublocale top: ordering_top_ow U \(\\<^sub>o\<^sub>w)\ \(<\<^sub>o\<^sub>w)\ \\\<^sub>o\<^sub>w\ apply unfold_locales subgoal by simp subgoal by (simp add: top_greatest) done no_notation le (infix "\<^bold>\\<^sub>o\<^sub>w" 50) and ls (infix "\<^bold><\<^sub>o\<^sub>w" 50) and top ("\<^bold>\\<^sub>o\<^sub>w") end locale order_top_pair_ow = ord\<^sub>1: order_top_ow U\<^sub>1 le\<^sub>1 ls\<^sub>1 top\<^sub>1 + ord\<^sub>2: order_top_ow U\<^sub>2 le\<^sub>2 ls\<^sub>2 top\<^sub>2 for U\<^sub>1 :: "'ao set" and le\<^sub>1 ls\<^sub>1 top\<^sub>1 and U\<^sub>2 :: "'bo set" and le\<^sub>2 ls\<^sub>2 top\<^sub>2 begin sublocale top_pair_ow .. sublocale order_pair_ow .. end subsubsection\Transfer rules\ context includes lifting_syntax begin lemma ordering_top_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> A ===> (=)) (ordering_top_ow (Collect (Domainp A))) ordering_top" proof- let ?P = "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> A ===> (=))" let ?ordering_top_ow = "ordering_top_ow (Collect (Domainp A))" have "?P ?ordering_top_ow (\le ls ext. ext \ UNIV \ ordering_top le ls ext)" unfolding ordering_top_ow_def ordering_top_def ordering_top_ow_axioms_def ordering_top_axioms_def apply transfer_prover_start apply transfer_step+ by blast thus ?thesis by simp qed lemma order_bot_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "(A ===> (A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=)) (order_bot_ow (Collect (Domainp A))) class.order_bot" proof- let ?P = "(A ===> (A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> (=))" let ?order_bot_ow = "order_bot_ow (Collect (Domainp A))" have "?P ?order_bot_ow (\bot le ls. bot \ UNIV \ class.order_bot bot le ls)" unfolding class.order_bot_def order_bot_ow_def class.order_bot_axioms_def order_bot_ow_axioms_def bot_ow_def apply transfer_prover_start apply transfer_step+ by blast thus ?thesis by simp qed lemma order_top_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" shows "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> A ===> (=)) (order_top_ow (Collect (Domainp A))) class.order_top" proof- let ?P = "((A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> A ===> (=))" let ?order_top_ow = "order_top_ow (Collect (Domainp A))" have "?P ?order_top_ow (\le ls top. top \ UNIV \ class.order_top le ls top)" unfolding class.order_top_def order_top_ow_def class.order_top_axioms_def order_top_ow_axioms_def top_ow_def apply transfer_prover_start apply transfer_step+ by blast thus ?thesis by simp qed end subsubsection\Relativization\ context ordering_top_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting ordering_top_ow_axioms eliminating through simp applying [OF top_closed] begin tts_lemma extremum_uniqueI: assumes "\<^bold>\\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w" shows "\<^bold>\\<^sub>o\<^sub>w = \<^bold>\\<^sub>o\<^sub>w" is ordering_top.extremum_uniqueI. tts_lemma extremum_unique: shows "(\<^bold>\\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w) = (\<^bold>\\<^sub>o\<^sub>w = \<^bold>\\<^sub>o\<^sub>w)" is ordering_top.extremum_unique. tts_lemma extremum_strict: shows "\ \<^bold>\\<^sub>o\<^sub>w \<^bold><\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w" is ordering_top.extremum_strict. tts_lemma not_eq_extremum: shows "(\<^bold>\\<^sub>o\<^sub>w \ \<^bold>\\<^sub>o\<^sub>w) = (\<^bold>\\<^sub>o\<^sub>w \<^bold><\<^sub>o\<^sub>w \<^bold>\\<^sub>o\<^sub>w)" is ordering_top.not_eq_extremum. end end context order_bot_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting order_bot_ow_axioms eliminating through simp begin tts_lemma bdd_above_bot: assumes "A \ U" shows "bdd_below A" is order_bot_class.bdd_below_bot. tts_lemma not_less_bot: assumes "a \ U" shows "\ a <\<^sub>o\<^sub>w \\<^sub>o\<^sub>w" is order_bot_class.not_less_bot. tts_lemma max_bot: assumes "x \ U" shows "max \\<^sub>o\<^sub>w x = x" is order_bot_class.max_bot. tts_lemma max_bot2: assumes "x \ U" shows "max x \\<^sub>o\<^sub>w = x" is order_bot_class.max_bot2. tts_lemma min_bot: assumes "x \ U" shows "min \\<^sub>o\<^sub>w x = \\<^sub>o\<^sub>w" is order_bot_class.min_bot. tts_lemma min_bot2: assumes "x \ U" shows "min x \\<^sub>o\<^sub>w = \\<^sub>o\<^sub>w" is order_bot_class.min_bot2. tts_lemma bot_unique: assumes "a \ U" shows "(a \\<^sub>o\<^sub>w \\<^sub>o\<^sub>w) = (a = \\<^sub>o\<^sub>w)" is order_bot_class.bot_unique. tts_lemma bot_less: assumes "a \ U" shows "(a \ \\<^sub>o\<^sub>w) = (\\<^sub>o\<^sub>w <\<^sub>o\<^sub>w a)" is order_bot_class.bot_less. tts_lemma atLeast_eq_UNIV_iff: assumes "x \ U" shows "({x..\<^sub>o\<^sub>w} = U) = (x = \\<^sub>o\<^sub>w)" is order_bot_class.atLeast_eq_UNIV_iff. tts_lemma le_bot: assumes "a \ U" and "a \\<^sub>o\<^sub>w \\<^sub>o\<^sub>w" shows "a = \\<^sub>o\<^sub>w" is order_bot_class.le_bot. end end context order_top_ow begin tts_context tts: (?'a to U) rewriting ctr_simps substituting order_top_ow_axioms eliminating through simp begin tts_lemma bdd_above_top: assumes "A \ U" shows "bdd_above A" is order_top_class.bdd_above_top. tts_lemma not_top_less: assumes "a \ U" shows "\ \\<^sub>o\<^sub>w <\<^sub>o\<^sub>w a" is order_top_class.not_top_less. tts_lemma max_top: assumes "x \ U" shows "max \\<^sub>o\<^sub>w x = \\<^sub>o\<^sub>w" is order_top_class.max_top. tts_lemma max_top2: assumes "x \ U" shows "max x \\<^sub>o\<^sub>w = \\<^sub>o\<^sub>w" is order_top_class.max_top2. tts_lemma min_top: assumes "x \ U" shows "min \\<^sub>o\<^sub>w x = x" is order_top_class.min_top. tts_lemma min_top2: assumes "x \ U" shows "min x \\<^sub>o\<^sub>w = x" is order_top_class.min_top2. tts_lemma top_unique: assumes "a \ U" shows "(\\<^sub>o\<^sub>w \\<^sub>o\<^sub>w a) = (a = \\<^sub>o\<^sub>w)" is order_top_class.top_unique. tts_lemma less_top: assumes "a \ U" shows "(a \ \\<^sub>o\<^sub>w) = (a <\<^sub>o\<^sub>w \\<^sub>o\<^sub>w)" is order_top_class.less_top. tts_lemma atMost_eq_UNIV_iff: assumes "x \ U" shows "({..\<^sub>o\<^sub>wx} = U) = (x = \\<^sub>o\<^sub>w)" is order_top_class.atMost_eq_UNIV_iff. tts_lemma top_le: assumes "a \ U" and "\\<^sub>o\<^sub>w \\<^sub>o\<^sub>w a" shows "a = \\<^sub>o\<^sub>w" is order_top_class.top_le. end end text\\newpage\ end \ No newline at end of file