src/HOL/LOrder.thy
author haftmann
Mon, 13 Nov 2006 15:43:06 +0100
changeset 21329 7338206d75f1
parent 21312 1d39091a3208
child 21380 c4f79922bc81
permissions -rw-r--r--
introduces preorders
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     1
(*  Title:   HOL/LOrder.thy
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     2
    ID:      $Id$
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     3
    Author:  Steven Obua, TU Muenchen
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     4
*)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     5
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
     6
header "Lattice Orders"
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     7
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15010
diff changeset
     8
theory LOrder
21249
d594c58e24ed renamed Lattice_Locales to Lattices
haftmann
parents: 21213
diff changeset
     9
imports Lattices
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15010
diff changeset
    10
begin
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    11
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
    12
text {* The theory of lattices developed here is taken from
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
    13
\cite{Birkhoff79}.  *}
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    14
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    15
constdefs
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    16
  is_meet :: "(('a::order) \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> bool"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    17
  "is_meet m == ! a b x. m a b \<le> a \<and> m a b \<le> b \<and> (x \<le> a \<and> x \<le> b \<longrightarrow> x \<le> m a b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    18
  is_join :: "(('a::order) \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> bool"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    19
  "is_join j == ! a b x. a \<le> j a b \<and> b \<le> j a b \<and> (a \<le> x \<and> b \<le> x \<longrightarrow> j a b \<le> x)"  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    20
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    21
lemma is_meet_unique: 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    22
  assumes "is_meet u" "is_meet v" shows "u = v"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    23
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    24
  {
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    25
    fix a b :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    26
    assume a: "is_meet a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    27
    assume b: "is_meet b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    28
    {
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    29
      fix x y 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    30
      let ?za = "a x y"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    31
      let ?zb = "b x y"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    32
      from a have za_le: "?za <= x & ?za <= y" by (auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    33
      with b have "?za <= ?zb" by (auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    34
    }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    35
  }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    36
  note f_le = this
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    37
  show "u = v" by ((rule ext)+, simp_all add: order_antisym prems f_le) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    38
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    39
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    40
lemma is_join_unique: 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    41
  assumes "is_join u" "is_join v" shows "u = v"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    42
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    43
  {
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    44
    fix a b :: "'a \<Rightarrow> 'a \<Rightarrow> 'a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    45
    assume a: "is_join a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    46
    assume b: "is_join b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    47
    {
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    48
      fix x y 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    49
      let ?za = "a x y"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    50
      let ?zb = "b x y"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    51
      from a have za_le: "x <= ?za & y <= ?za" by (auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    52
      with b have "?zb <= ?za" by (auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    53
    }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    54
  }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    55
  note f_le = this
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    56
  show "u = v" by ((rule ext)+, simp_all add: order_antisym prems f_le) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    57
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    58
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    59
axclass join_semilorder < order
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    60
  join_exists: "? j. is_join j"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    61
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    62
axclass meet_semilorder < order
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    63
  meet_exists: "? m. is_meet m"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    64
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    65
axclass lorder < join_semilorder, meet_semilorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    66
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    67
constdefs
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    68
  meet :: "('a::meet_semilorder) \<Rightarrow> 'a \<Rightarrow> 'a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    69
  "meet == THE m. is_meet m"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    70
  join :: "('a::join_semilorder) \<Rightarrow> 'a \<Rightarrow> 'a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    71
  "join ==  THE j. is_join j"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    72
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    73
lemma is_meet_meet: "is_meet (meet::'a \<Rightarrow> 'a \<Rightarrow> ('a::meet_semilorder))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    74
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    75
  from meet_exists obtain k::"'a \<Rightarrow> 'a \<Rightarrow> 'a" where "is_meet k" ..
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    76
  with is_meet_unique[of _ k] show ?thesis
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    77
    by (simp add: meet_def theI[of is_meet])    
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    78
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    79
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    80
lemma meet_unique: "(is_meet m) = (m = meet)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    81
by (insert is_meet_meet, auto simp add: is_meet_unique)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    82
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    83
lemma is_join_join: "is_join (join::'a \<Rightarrow> 'a \<Rightarrow> ('a::join_semilorder))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    84
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    85
  from join_exists obtain k::"'a \<Rightarrow> 'a \<Rightarrow> 'a" where "is_join k" ..
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    86
  with is_join_unique[of _ k] show ?thesis
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    87
    by (simp add: join_def theI[of is_join])    
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    88
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    89
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    90
lemma join_unique: "(is_join j) = (j = join)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    91
by (insert is_join_join, auto simp add: is_join_unique)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    92
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    93
lemma meet_left_le: "meet a b \<le> (a::'a::meet_semilorder)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    94
by (insert is_meet_meet, auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    95
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    96
lemma meet_right_le: "meet a b \<le> (b::'a::meet_semilorder)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    97
by (insert is_meet_meet, auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    98
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
    99
(* intro! breaks a proof in Hyperreal/SEQ and NumberTheory/IntPrimes *)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   100
lemma le_meetI:
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   101
 "x \<le> a \<Longrightarrow> x \<le> b \<Longrightarrow> x \<le> meet a (b::'a::meet_semilorder)"
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   102
by (insert is_meet_meet, auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   103
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   104
lemma join_left_le: "a \<le> join a (b::'a::join_semilorder)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   105
by (insert is_join_join, auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   106
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   107
lemma join_right_le: "b \<le> join a (b::'a::join_semilorder)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   108
by (insert is_join_join, auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   109
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   110
lemma join_leI:
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   111
 "a \<le> x \<Longrightarrow> b \<le> x \<Longrightarrow> join a b \<le> (x::'a::join_semilorder)"
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   112
by (insert is_join_join, auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   113
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   114
lemmas meet_join_le[simp] = meet_left_le meet_right_le join_left_le join_right_le
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   115
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   116
lemma le_meet[simp]: "(x <= meet y z) = (x <= y & x <= z)" (is "?L = ?R")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   117
proof
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   118
  assume ?L
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   119
  moreover have "meet y z \<le> y" "meet y z <= z" by(simp_all)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   120
  ultimately show ?R by(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   121
next
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   122
  assume ?R thus ?L by (blast intro!:le_meetI)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   123
qed
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   124
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   125
lemma join_le[simp]: "(join x y <= z) = (x <= z & y <= z)" (is "?L = ?R")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   126
proof
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   127
  assume ?L
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   128
  moreover have "x \<le> join x y" "y \<le> join x y" by(simp_all)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   129
  ultimately show ?R by(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   130
next
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   131
  assume ?R thus ?L by (blast intro:join_leI)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   132
qed
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   133
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   134
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   135
lemma is_meet_min: "is_meet (min::'a \<Rightarrow> 'a \<Rightarrow> ('a::linorder))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   136
by (auto simp add: is_meet_def min_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   137
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   138
lemma is_join_max: "is_join (max::'a \<Rightarrow> 'a \<Rightarrow> ('a::linorder))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   139
by (auto simp add: is_join_def max_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   140
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   141
instance linorder \<subseteq> meet_semilorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   142
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   143
  from is_meet_min show "? (m::'a\<Rightarrow>'a\<Rightarrow>('a::linorder)). is_meet m" by auto
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   144
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   145
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   146
instance linorder \<subseteq> join_semilorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   147
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   148
  from is_join_max show "? (j::'a\<Rightarrow>'a\<Rightarrow>('a::linorder)). is_join j" by auto 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   149
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   150
    
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   151
instance linorder \<subseteq> lorder ..
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   152
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   153
lemma meet_min: "meet = (min :: 'a\<Rightarrow>'a\<Rightarrow>('a::linorder))" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   154
by (simp add: is_meet_meet is_meet_min is_meet_unique)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   155
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   156
lemma join_max: "join = (max :: 'a\<Rightarrow>'a\<Rightarrow>('a::linorder))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   157
by (simp add: is_join_join is_join_max is_join_unique)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   158
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   159
lemma meet_idempotent[simp]: "meet x x = x"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   160
by (rule order_antisym, simp_all add: le_meetI)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   161
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   162
lemma join_idempotent[simp]: "join x x = x"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   163
by (rule order_antisym, simp_all add: join_leI)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   164
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   165
lemma meet_comm: "meet x y = meet y x" 
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   166
by (rule order_antisym, (simp add: le_meetI)+)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   167
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   168
lemma join_comm: "join x y = join y x"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   169
by (rule order_antisym, (simp add: join_leI)+)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   170
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   171
lemma meet_leI1: "x \<le> z \<Longrightarrow> meet x y \<le> z"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   172
apply(subgoal_tac "meet x y <= x")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   173
 apply(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   174
apply simp
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   175
done
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   176
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   177
lemma meet_leI2: "y \<le> z \<Longrightarrow> meet x y \<le> z"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   178
apply(subgoal_tac "meet x y <= y")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   179
 apply(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   180
apply simp
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   181
done
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   182
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   183
lemma le_joinI1: "x \<le> y \<Longrightarrow> x \<le> join y z"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   184
apply(subgoal_tac "y <= join y z")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   185
 apply(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   186
apply simp
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   187
done
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   188
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   189
lemma le_joinI2: "x \<le> z \<Longrightarrow> x \<le> join y z"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   190
apply(subgoal_tac "z <= join y z")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   191
 apply(blast intro:order_trans)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   192
apply simp
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   193
done
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   194
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   195
lemma meet_assoc: "meet (meet x y) z = meet x (meet y z)"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   196
apply(rule order_antisym)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   197
apply (simp add:meet_leI1 meet_leI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   198
apply (simp add:meet_leI1 meet_leI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   199
done
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   200
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   201
lemma join_assoc: "join (join x y) z = join x (join y z)"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   202
apply(rule order_antisym)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   203
apply (simp add:le_joinI1 le_joinI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   204
apply (simp add:le_joinI1 le_joinI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   205
done
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   206
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   207
lemma meet_left_comm: "meet a (meet b c) = meet b (meet a c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   208
by (simp add: meet_assoc[symmetric, of a b c], simp add: meet_comm[of a b], simp add: meet_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   209
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   210
lemma meet_left_idempotent: "meet y (meet y x) = meet y x"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   211
by (simp add: meet_assoc meet_comm meet_left_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   212
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   213
lemma join_left_comm: "join a (join b c) = join b (join a c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   214
by (simp add: join_assoc[symmetric, of a b c], simp add: join_comm[of a b], simp add: join_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   215
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   216
lemma join_left_idempotent: "join y (join y x) = join y x"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   217
by (simp add: join_assoc join_comm join_left_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   218
    
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   219
lemmas meet_aci = meet_assoc meet_comm meet_left_comm meet_left_idempotent
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   220
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   221
lemmas join_aci = join_assoc join_comm join_left_comm join_left_idempotent
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   222
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   223
lemma le_def_meet: "(x <= y) = (meet x y = x)"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   224
apply rule
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   225
apply(simp add: order_antisym)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   226
apply(subgoal_tac "meet x y <= y")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   227
apply(simp)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   228
apply(simp (no_asm))
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   229
done
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   230
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   231
lemma le_def_join: "(x <= y) = (join x y = y)"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   232
apply rule
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   233
apply(simp add: order_antisym)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   234
apply(subgoal_tac "x <= join x y")
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   235
apply(simp)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   236
apply(simp (no_asm))
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   237
done
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   238
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   239
lemma join_absorp2: "a \<le> b \<Longrightarrow> join a b = b" 
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   240
by (simp add: le_def_join)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   241
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   242
lemma join_absorp1: "b \<le> a \<Longrightarrow> join a b = a"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   243
by (simp add: le_def_join join_aci)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   244
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   245
lemma meet_absorp1: "a \<le> b \<Longrightarrow> meet a b = a"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   246
by (simp add: le_def_meet)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   247
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   248
lemma meet_absorp2: "b \<le> a \<Longrightarrow> meet a b = b"
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   249
by (simp add: le_def_meet meet_aci)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   250
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   251
lemma meet_join_absorp: "meet x (join x y) = x"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   252
by(simp add:meet_absorp1)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   253
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   254
lemma join_meet_absorp: "join x (meet x y) = x"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   255
by(simp add:join_absorp1)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   256
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   257
lemma meet_mono: "y \<le> z \<Longrightarrow> meet x y \<le> meet x z"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   258
by(simp add:meet_leI2)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   259
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   260
lemma join_mono: "y \<le> z \<Longrightarrow> join x y \<le> join x z"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   261
by(simp add:le_joinI2)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   262
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   263
lemma distrib_join_le: "join x (meet y z) \<le> meet (join x y) (join x z)" (is "_ <= ?r")
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   264
proof -
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   265
  have a: "x <= ?r" by (simp_all add:le_meetI)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   266
  have b: "meet y z <= ?r" by (simp add:le_joinI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   267
  from a b show ?thesis by (simp add: join_leI)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   268
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   269
  
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   270
lemma distrib_meet_le: "join (meet x y) (meet x z) \<le> meet x (join y z)" (is "?l <= _")
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   271
proof -
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   272
  have a: "?l <= x" by (simp_all add: join_leI)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   273
  have b: "?l <= join y z" by (simp add:meet_leI2)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   274
  from a b show ?thesis by (simp add: le_meetI)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   275
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   276
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   277
lemma meet_join_eq_imp_le: "a = c \<or> a = d \<or> b = c \<or> b = d \<Longrightarrow> meet a b \<le> join c d"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   278
by (auto simp:meet_leI2 meet_leI1)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   279
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   280
lemma modular_le: "x \<le> z \<Longrightarrow> join x (meet y z) \<le> meet (join x y) z" (is "_ \<Longrightarrow> ?t <= _")
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   281
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   282
  assume a: "x <= z"
21312
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   283
  have b: "?t <= join x y" by (simp_all add: join_leI meet_join_eq_imp_le )
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   284
  have c: "?t <= z" by (simp_all add: a join_leI)
1d39091a3208 started reorgnization of lattice theories
nipkow
parents: 21249
diff changeset
   285
  from b c show ?thesis by (simp add: le_meetI)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   286
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   287
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15010
diff changeset
   288
end