src/HOL/Library/Preorder.thy
author wenzelm
Fri Oct 09 20:26:03 2015 +0200 (2015-10-09)
changeset 61378 3e04c9ca001a
parent 60500 903bb1495239
child 61384 9f5145281888
permissions -rw-r--r--
discontinued specific HTML syntax;
     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 ~~") and
    17   equiv ("(_/ ~~ _)" [51, 51] 50)
    18   
    19 notation (xsymbols)
    20   equiv ("op \<approx>") and
    21   equiv ("(_/ \<approx> _)"  [51, 51] 50)
    22 
    23 lemma refl [iff]:
    24   "x \<approx> x"
    25   unfolding equiv_def by simp
    26 
    27 lemma trans:
    28   "x \<approx> y \<Longrightarrow> y \<approx> z \<Longrightarrow> x \<approx> z"
    29   unfolding equiv_def by (auto intro: order_trans)
    30 
    31 lemma antisym:
    32   "x \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> x \<approx> y"
    33   unfolding equiv_def ..
    34 
    35 lemma less_le: "x < y \<longleftrightarrow> x \<le> y \<and> \<not> x \<approx> y"
    36   by (auto simp add: equiv_def less_le_not_le)
    37 
    38 lemma le_less: "x \<le> y \<longleftrightarrow> x < y \<or> x \<approx> y"
    39   by (auto simp add: equiv_def less_le)
    40 
    41 lemma le_imp_less_or_eq: "x \<le> y \<Longrightarrow> x < y \<or> x \<approx> y"
    42   by (simp add: less_le)
    43 
    44 lemma less_imp_not_eq: "x < y \<Longrightarrow> x \<approx> y \<longleftrightarrow> False"
    45   by (simp add: less_le)
    46 
    47 lemma less_imp_not_eq2: "x < y \<Longrightarrow> y \<approx> x \<longleftrightarrow> False"
    48   by (simp add: equiv_def less_le)
    49 
    50 lemma neq_le_trans: "\<not> a \<approx> b \<Longrightarrow> a \<le> b \<Longrightarrow> a < b"
    51   by (simp add: less_le)
    52 
    53 lemma le_neq_trans: "a \<le> b \<Longrightarrow> \<not> a \<approx> b \<Longrightarrow> a < b"
    54   by (simp add: less_le)
    55 
    56 lemma antisym_conv: "y \<le> x \<Longrightarrow> x \<le> y \<longleftrightarrow> x \<approx> y"
    57   by (simp add: equiv_def)
    58 
    59 end
    60 
    61 end