95 notation |
95 notation |
96 less_eq ("op <=") and |
96 less_eq ("op <=") and |
97 less_eq ("(_/ <= _)" [51, 51] 50) and |
97 less_eq ("(_/ <= _)" [51, 51] 50) and |
98 less ("op <") and |
98 less ("op <") and |
99 less ("(_/ < _)" [51, 51] 50) |
99 less ("(_/ < _)" [51, 51] 50) |
100 |
100 |
101 notation (xsymbols) |
101 notation (xsymbols) |
102 less_eq ("op \<le>") and |
102 less_eq ("op \<le>") and |
103 less_eq ("(_/ \<le> _)" [51, 51] 50) |
103 less_eq ("(_/ \<le> _)" [51, 51] 50) |
104 |
104 |
105 abbreviation (input) |
105 abbreviation (input) |
147 |
147 |
148 |
148 |
149 text \<open>Transitivity.\<close> |
149 text \<open>Transitivity.\<close> |
150 |
150 |
151 lemma less_trans: "x < y \<Longrightarrow> y < z \<Longrightarrow> x < z" |
151 lemma less_trans: "x < y \<Longrightarrow> y < z \<Longrightarrow> x < z" |
152 by (auto simp add: less_le_not_le intro: order_trans) |
152 by (auto simp add: less_le_not_le intro: order_trans) |
153 |
153 |
154 lemma le_less_trans: "x \<le> y \<Longrightarrow> y < z \<Longrightarrow> x < z" |
154 lemma le_less_trans: "x \<le> y \<Longrightarrow> y < z \<Longrightarrow> x < z" |
155 by (auto simp add: less_le_not_le intro: order_trans) |
155 by (auto simp add: less_le_not_le intro: order_trans) |
156 |
156 |
157 lemma less_le_trans: "x < y \<Longrightarrow> y \<le> z \<Longrightarrow> x < z" |
157 lemma less_le_trans: "x < y \<Longrightarrow> y \<le> z \<Longrightarrow> x < z" |
158 by (auto simp add: less_le_not_le intro: order_trans) |
158 by (auto simp add: less_le_not_le intro: order_trans) |
159 |
159 |
160 |
160 |
161 text \<open>Useful for simplification, but too risky to include by default.\<close> |
161 text \<open>Useful for simplification, but too risky to include by default.\<close> |
162 |
162 |
163 lemma less_imp_not_less: "x < y \<Longrightarrow> (\<not> y < x) \<longleftrightarrow> True" |
163 lemma less_imp_not_less: "x < y \<Longrightarrow> (\<not> y < x) \<longleftrightarrow> True" |
514 |
513 |
515 (* The type constraint on @{term op =} below is necessary since the operation |
514 (* The type constraint on @{term op =} below is necessary since the operation |
516 is not a parameter of the locale. *) |
515 is not a parameter of the locale. *) |
517 |
516 |
518 declare less_irrefl [THEN notE, order add less_reflE: order "op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool" "op <=" "op <"] |
517 declare less_irrefl [THEN notE, order add less_reflE: order "op = :: 'a \<Rightarrow> 'a \<Rightarrow> bool" "op <=" "op <"] |
519 |
518 |
520 declare order_refl [order add le_refl: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
519 declare order_refl [order add le_refl: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
521 |
520 |
522 declare less_imp_le [order add less_imp_le: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
521 declare less_imp_le [order add less_imp_le: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
523 |
522 |
524 declare antisym [order add eqI: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
523 declare antisym [order add eqI: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
525 |
524 |
526 declare eq_refl [order add eqD1: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
525 declare eq_refl [order add eqD1: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
527 |
526 |
528 declare sym [THEN eq_refl, order add eqD2: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
527 declare sym [THEN eq_refl, order add eqD2: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
529 |
528 |
530 declare less_trans [order add less_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
529 declare less_trans [order add less_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
531 |
530 |
532 declare less_le_trans [order add less_le_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
531 declare less_le_trans [order add less_le_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
533 |
532 |
534 declare le_less_trans [order add le_less_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
533 declare le_less_trans [order add le_less_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
535 |
534 |
536 declare order_trans [order add le_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
535 declare order_trans [order add le_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
537 |
536 |
538 declare le_neq_trans [order add le_neq_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
537 declare le_neq_trans [order add le_neq_trans: order "op = :: 'a => 'a => bool" "op <=" "op <"] |
948 "(x::'a::order) >= y ==> y > z ==> x > z" |
947 "(x::'a::order) >= y ==> y > z ==> x > z" |
949 "(a::'a::order) > b ==> b > a ==> P" |
948 "(a::'a::order) > b ==> b > a ==> P" |
950 "(x::'a::order) > y ==> y > z ==> x > z" |
949 "(x::'a::order) > y ==> y > z ==> x > z" |
951 "(a::'a::order) >= b ==> a ~= b ==> a > b" |
950 "(a::'a::order) >= b ==> a ~= b ==> a > b" |
952 "(a::'a::order) ~= b ==> a >= b ==> a > b" |
951 "(a::'a::order) ~= b ==> a >= b ==> a > b" |
953 "a = f b ==> b > c ==> (!!x y. x > y ==> f x > f y) ==> a > f c" |
952 "a = f b ==> b > c ==> (!!x y. x > y ==> f x > f y) ==> a > f c" |
954 "a > b ==> f b = c ==> (!!x y. x > y ==> f x > f y) ==> f a > c" |
953 "a > b ==> f b = c ==> (!!x y. x > y ==> f x > f y) ==> f a > c" |
955 "a = f b ==> b >= c ==> (!!x y. x >= y ==> f x >= f y) ==> a >= f c" |
954 "a = f b ==> b >= c ==> (!!x y. x >= y ==> f x >= f y) ==> a >= f c" |
956 "a >= b ==> f b = c ==> (!! x y. x >= y ==> f x >= f y) ==> f a >= c" |
955 "a >= b ==> f b = c ==> (!! x y. x >= y ==> f x >= f y) ==> f a >= c" |
957 by auto |
956 by auto |
958 |
957 |
988 (!!x y. x > y ==> f x > f y) ==> f a > c" |
987 (!!x y. x > y ==> f x > f y) ==> f a > c" |
989 by (subgoal_tac "f a > f b", force, force) |
988 by (subgoal_tac "f a > f b", force, force) |
990 |
989 |
991 lemmas xtrans = xt1 xt2 xt3 xt4 xt5 xt6 xt7 xt8 xt9 |
990 lemmas xtrans = xt1 xt2 xt3 xt4 xt5 xt6 xt7 xt8 xt9 |
992 |
991 |
993 (* |
992 (* |
994 Since "a >= b" abbreviates "b <= a", the abbreviation "..." stands |
993 Since "a >= b" abbreviates "b <= a", the abbreviation "..." stands |
995 for the wrong thing in an Isar proof. |
994 for the wrong thing in an Isar proof. |
996 |
995 |
997 The extra transitivity rules can be used as follows: |
996 The extra transitivity rules can be used as follows: |
998 |
997 |
999 lemma "(a::'a::order) > z" |
998 lemma "(a::'a::order) > z" |
1000 proof - |
999 proof - |
1001 have "a >= b" (is "_ >= ?rhs") |
1000 have "a >= b" (is "_ >= ?rhs") |
1002 sorry |
1001 sorry |
1143 assume "\<not> x \<le> y" then have "y < x" by simp |
1142 assume "\<not> x \<le> y" then have "y < x" by simp |
1144 with assms strict_monoD have "f y < f x" by auto |
1143 with assms strict_monoD have "f y < f x" by auto |
1145 with \<open>f x \<le> f y\<close> show False by simp |
1144 with \<open>f x \<le> f y\<close> show False by simp |
1146 qed |
1145 qed |
1147 qed |
1146 qed |
1148 |
1147 |
1149 lemma strict_mono_less: |
1148 lemma strict_mono_less: |
1150 assumes "strict_mono f" |
1149 assumes "strict_mono f" |
1151 shows "f x < f y \<longleftrightarrow> x < y" |
1150 shows "f x < f y \<longleftrightarrow> x < y" |
1152 using assms |
1151 using assms |
1153 by (auto simp add: less_le Orderings.less_le strict_mono_eq strict_mono_less_eq) |
1152 by (auto simp add: less_le Orderings.less_le strict_mono_eq strict_mono_less_eq) |