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