src/HOL/Library/Preorder.thy
 author wenzelm Mon Dec 28 17:43:30 2015 +0100 (2015-12-28) changeset 61952 546958347e05 parent 61384 9f5145281888 child 63465 d7610beb98bc permissions -rw-r--r--
prefer symbols for "Union", "Inter";
```     1 (* Author: Florian Haftmann, TU Muenchen *)
```
```     2
```
```     3 section \<open>Preorders with explicit equivalence relation\<close>
```
```     4
```
```     5 theory Preorder
```
```     6 imports Orderings
```
```     7 begin
```
```     8
```
```     9 class preorder_equiv = preorder
```
```    10 begin
```
```    11
```
```    12 definition equiv :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where
```
```    13   "equiv x y \<longleftrightarrow> x \<le> y \<and> y \<le> x"
```
```    14
```
```    15 notation
```
```    16   equiv ("op \<approx>") and
```
```    17   equiv ("(_/ \<approx> _)"  [51, 51] 50)
```
```    18
```
```    19 lemma refl [iff]:
```
```    20   "x \<approx> x"
```
```    21   unfolding equiv_def by simp
```
```    22
```
```    23 lemma trans:
```
```    24   "x \<approx> y \<Longrightarrow> y \<approx> z \<Longrightarrow> x \<approx> z"
```
```    25   unfolding equiv_def by (auto intro: order_trans)
```
```    26
```
```    27 lemma antisym:
```
```    28   "x \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> x \<approx> y"
```
```    29   unfolding equiv_def ..
```
```    30
```
```    31 lemma less_le: "x < y \<longleftrightarrow> x \<le> y \<and> \<not> x \<approx> y"
```
```    32   by (auto simp add: equiv_def less_le_not_le)
```
```    33
```
```    34 lemma le_less: "x \<le> y \<longleftrightarrow> x < y \<or> x \<approx> y"
```
```    35   by (auto simp add: equiv_def less_le)
```
```    36
```
```    37 lemma le_imp_less_or_eq: "x \<le> y \<Longrightarrow> x < y \<or> x \<approx> y"
```
```    38   by (simp add: less_le)
```
```    39
```
```    40 lemma less_imp_not_eq: "x < y \<Longrightarrow> x \<approx> y \<longleftrightarrow> False"
```
```    41   by (simp add: less_le)
```
```    42
```
```    43 lemma less_imp_not_eq2: "x < y \<Longrightarrow> y \<approx> x \<longleftrightarrow> False"
```
```    44   by (simp add: equiv_def less_le)
```
```    45
```
```    46 lemma neq_le_trans: "\<not> a \<approx> b \<Longrightarrow> a \<le> b \<Longrightarrow> a < b"
```
```    47   by (simp add: less_le)
```
```    48
```
```    49 lemma le_neq_trans: "a \<le> b \<Longrightarrow> \<not> a \<approx> b \<Longrightarrow> a < b"
```
```    50   by (simp add: less_le)
```
```    51
```
```    52 lemma antisym_conv: "y \<le> x \<Longrightarrow> x \<le> y \<longleftrightarrow> x \<approx> y"
```
```    53   by (simp add: equiv_def)
```
```    54
```
```    55 end
```
```    56
```
```    57 end
```