src/HOL/Library/Preorder.thy
author haftmann
Sat, 19 Dec 2015 17:03:17 +0100
changeset 61891 76189756ff65
parent 61384 9f5145281888
child 63465 d7610beb98bc
permissions -rw-r--r--
documentation on last state of the art concerning interpretation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31060
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     1
(* Author: Florian Haftmann, TU Muenchen *)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     2
60500
903bb1495239 isabelle update_cartouches;
wenzelm
parents: 58881
diff changeset
     3
section \<open>Preorders with explicit equivalence relation\<close>
31060
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     4
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     5
theory Preorder
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     6
imports Orderings
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     7
begin
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
     8
31061
1d117af9f9f3 better to have distinguished class for preorders
haftmann
parents: 31060
diff changeset
     9
class preorder_equiv = preorder
31060
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    10
begin
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    11
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    12
definition equiv :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    13
  "equiv x y \<longleftrightarrow> x \<le> y \<and> y \<le> x"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    14
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    15
notation
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    16
  equiv ("op \<approx>") and
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    17
  equiv ("(_/ \<approx> _)"  [51, 51] 50)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    18
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    19
lemma refl [iff]:
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    20
  "x \<approx> x"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    21
  unfolding equiv_def by simp
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    22
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    23
lemma trans:
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    24
  "x \<approx> y \<Longrightarrow> y \<approx> z \<Longrightarrow> x \<approx> z"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    25
  unfolding equiv_def by (auto intro: order_trans)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    26
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    27
lemma antisym:
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    28
  "x \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> x \<approx> y"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    29
  unfolding equiv_def ..
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    30
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    31
lemma less_le: "x < y \<longleftrightarrow> x \<le> y \<and> \<not> x \<approx> y"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    32
  by (auto simp add: equiv_def less_le_not_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    33
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    34
lemma le_less: "x \<le> y \<longleftrightarrow> x < y \<or> x \<approx> y"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    35
  by (auto simp add: equiv_def less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    36
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    37
lemma le_imp_less_or_eq: "x \<le> y \<Longrightarrow> x < y \<or> x \<approx> y"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    38
  by (simp add: less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    39
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    40
lemma less_imp_not_eq: "x < y \<Longrightarrow> x \<approx> y \<longleftrightarrow> False"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    41
  by (simp add: less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    42
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    43
lemma less_imp_not_eq2: "x < y \<Longrightarrow> y \<approx> x \<longleftrightarrow> False"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    44
  by (simp add: equiv_def less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    45
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    46
lemma neq_le_trans: "\<not> a \<approx> b \<Longrightarrow> a \<le> b \<Longrightarrow> a < b"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    47
  by (simp add: less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    48
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    49
lemma le_neq_trans: "a \<le> b \<Longrightarrow> \<not> a \<approx> b \<Longrightarrow> a < b"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    50
  by (simp add: less_le)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    51
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    52
lemma antisym_conv: "y \<le> x \<Longrightarrow> x \<le> y \<longleftrightarrow> x \<approx> y"
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    53
  by (simp add: equiv_def)
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    54
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    55
end
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    56
75d7c7cc8bdb added theory for explicit equivalence relation in preorders
haftmann
parents:
diff changeset
    57
end