src/HOL/Library/Product_Order.thy
author haftmann
Sat, 15 Mar 2014 08:31:33 +0100
changeset 56154 f0a927235162
parent 54776 db890d9fc5c2
child 56166 9a241bc276cd
permissions -rw-r--r--
more complete set of lemmas wrt. image and composition
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51115
7dbd6832a689 consolidation of library theories on product orders
haftmann
parents: 50573
diff changeset
     1
(*  Title:      HOL/Library/Product_Order.thy
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
     2
    Author:     Brian Huffman
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
     3
*)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
     4
51115
7dbd6832a689 consolidation of library theories on product orders
haftmann
parents: 50573
diff changeset
     5
header {* Pointwise order on product types *}
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
     6
51115
7dbd6832a689 consolidation of library theories on product orders
haftmann
parents: 50573
diff changeset
     7
theory Product_Order
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
     8
imports Product_plus Conditionally_Complete_Lattices
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
     9
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    10
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    11
subsection {* Pointwise ordering *}
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    12
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    13
instantiation prod :: (ord, ord) ord
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    14
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    15
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    16
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    17
  "x \<le> y \<longleftrightarrow> fst x \<le> fst y \<and> snd x \<le> snd y"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    18
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    19
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    20
  "(x::'a \<times> 'b) < y \<longleftrightarrow> x \<le> y \<and> \<not> y \<le> x"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    21
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    22
instance ..
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    23
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    24
end
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    25
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    26
lemma fst_mono: "x \<le> y \<Longrightarrow> fst x \<le> fst y"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    27
  unfolding less_eq_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    28
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    29
lemma snd_mono: "x \<le> y \<Longrightarrow> snd x \<le> snd y"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    30
  unfolding less_eq_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    31
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    32
lemma Pair_mono: "x \<le> x' \<Longrightarrow> y \<le> y' \<Longrightarrow> (x, y) \<le> (x', y')"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    33
  unfolding less_eq_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    34
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    35
lemma Pair_le [simp]: "(a, b) \<le> (c, d) \<longleftrightarrow> a \<le> c \<and> b \<le> d"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    36
  unfolding less_eq_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    37
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    38
instance prod :: (preorder, preorder) preorder
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    39
proof
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    40
  fix x y z :: "'a \<times> 'b"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    41
  show "x < y \<longleftrightarrow> x \<le> y \<and> \<not> y \<le> x"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    42
    by (rule less_prod_def)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    43
  show "x \<le> x"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    44
    unfolding less_eq_prod_def
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    45
    by fast
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    46
  assume "x \<le> y" and "y \<le> z" thus "x \<le> z"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    47
    unfolding less_eq_prod_def
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    48
    by (fast elim: order_trans)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    49
qed
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    50
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    51
instance prod :: (order, order) order
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    52
  by default auto
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    53
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    54
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    55
subsection {* Binary infimum and supremum *}
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    56
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    57
instantiation prod :: (inf, inf) inf
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    58
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    59
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    60
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    61
  "inf x y = (inf (fst x) (fst y), inf (snd x) (snd y))"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    62
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    63
lemma inf_Pair_Pair [simp]: "inf (a, b) (c, d) = (inf a c, inf b d)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    64
  unfolding inf_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    65
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    66
lemma fst_inf [simp]: "fst (inf x y) = inf (fst x) (fst y)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    67
  unfolding inf_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    68
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    69
lemma snd_inf [simp]: "snd (inf x y) = inf (snd x) (snd y)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    70
  unfolding inf_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    71
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    72
instance proof qed
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    73
end
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    74
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    75
instance prod :: (semilattice_inf, semilattice_inf) semilattice_inf
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    76
  by default auto
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    77
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    78
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    79
instantiation prod :: (sup, sup) sup
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    80
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    81
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    82
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    83
  "sup x y = (sup (fst x) (fst y), sup (snd x) (snd y))"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    84
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    85
lemma sup_Pair_Pair [simp]: "sup (a, b) (c, d) = (sup a c, sup b d)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    86
  unfolding sup_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    87
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    88
lemma fst_sup [simp]: "fst (sup x y) = sup (fst x) (fst y)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    89
  unfolding sup_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    90
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    91
lemma snd_sup [simp]: "snd (sup x y) = sup (snd x) (snd y)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    92
  unfolding sup_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    93
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    94
instance proof qed
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    95
end
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    96
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
    97
instance prod :: (semilattice_sup, semilattice_sup) semilattice_sup
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    98
  by default auto
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
    99
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   100
instance prod :: (lattice, lattice) lattice ..
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   101
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   102
instance prod :: (distrib_lattice, distrib_lattice) distrib_lattice
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   103
  by default (auto simp add: sup_inf_distrib1)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   104
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   105
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   106
subsection {* Top and bottom elements *}
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   107
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   108
instantiation prod :: (top, top) top
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   109
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   110
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   111
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   112
  "top = (top, top)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   113
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   114
instance ..
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   115
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   116
end
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   117
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   118
lemma fst_top [simp]: "fst top = top"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   119
  unfolding top_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   120
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   121
lemma snd_top [simp]: "snd top = top"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   122
  unfolding top_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   123
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   124
lemma Pair_top_top: "(top, top) = top"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   125
  unfolding top_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   126
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   127
instance prod :: (order_top, order_top) order_top
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   128
  by default (auto simp add: top_prod_def)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   129
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   130
instantiation prod :: (bot, bot) bot
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   131
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   132
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   133
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   134
  "bot = (bot, bot)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   135
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   136
instance ..
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   137
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   138
end
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   139
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   140
lemma fst_bot [simp]: "fst bot = bot"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   141
  unfolding bot_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   142
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   143
lemma snd_bot [simp]: "snd bot = bot"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   144
  unfolding bot_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   145
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   146
lemma Pair_bot_bot: "(bot, bot) = bot"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   147
  unfolding bot_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   148
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   149
instance prod :: (order_bot, order_bot) order_bot
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   150
  by default (auto simp add: bot_prod_def)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   151
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   152
instance prod :: (bounded_lattice, bounded_lattice) bounded_lattice ..
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   153
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   154
instance prod :: (boolean_algebra, boolean_algebra) boolean_algebra
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   155
  by default (auto simp add: prod_eqI inf_compl_bot sup_compl_top diff_eq)
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   156
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   157
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   158
subsection {* Complete lattice operations *}
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   159
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   160
instantiation prod :: (Inf, Inf) Inf
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   161
begin
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   162
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   163
definition
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   164
  "Inf A = (INF x:A. fst x, INF x:A. snd x)"
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   165
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   166
instance proof qed
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   167
end
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   168
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   169
instantiation prod :: (Sup, Sup) Sup
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   170
begin
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   171
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   172
definition
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   173
  "Sup A = (SUP x:A. fst x, SUP x:A. snd x)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   174
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   175
instance proof qed
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   176
end
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   177
54776
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   178
instance prod :: (conditionally_complete_lattice, conditionally_complete_lattice)
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   179
    conditionally_complete_lattice
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   180
  by default (force simp: less_eq_prod_def Inf_prod_def Sup_prod_def bdd_below_def bdd_above_def
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   181
    INF_def SUP_def intro!: cInf_lower cSup_upper cInf_greatest cSup_least)+
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   182
db890d9fc5c2 ordered_euclidean_space compatible with more standard pointwise ordering on products; conditionally complete lattice with product order
immler
parents: 52729
diff changeset
   183
instance prod :: (complete_lattice, complete_lattice) complete_lattice
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   184
  by default (simp_all add: less_eq_prod_def Inf_prod_def Sup_prod_def
52729
412c9e0381a1 factored syntactic type classes for bot and top (by Alessandro Coglio)
haftmann
parents: 51542
diff changeset
   185
    INF_lower SUP_upper le_INF_iff SUP_le_iff bot_prod_def top_prod_def)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   186
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   187
lemma fst_Sup: "fst (Sup A) = (SUP x:A. fst x)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   188
  unfolding Sup_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   189
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   190
lemma snd_Sup: "snd (Sup A) = (SUP x:A. snd x)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   191
  unfolding Sup_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   192
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   193
lemma fst_Inf: "fst (Inf A) = (INF x:A. fst x)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   194
  unfolding Inf_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   195
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   196
lemma snd_Inf: "snd (Inf A) = (INF x:A. snd x)"
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   197
  unfolding Inf_prod_def by simp
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   198
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   199
lemma fst_SUP: "fst (SUP x:A. f x) = (SUP x:A. fst (f x))"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   200
  by (simp add: SUP_def fst_Sup image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   201
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   202
lemma snd_SUP: "snd (SUP x:A. f x) = (SUP x:A. snd (f x))"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   203
  by (simp add: SUP_def snd_Sup image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   204
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   205
lemma fst_INF: "fst (INF x:A. f x) = (INF x:A. fst (f x))"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   206
  by (simp add: INF_def fst_Inf image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   207
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   208
lemma snd_INF: "snd (INF x:A. f x) = (INF x:A. snd (f x))"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   209
  by (simp add: INF_def snd_Inf image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   210
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   211
lemma SUP_Pair: "(SUP x:A. (f x, g x)) = (SUP x:A. f x, SUP x:A. g x)"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   212
  by (simp add: SUP_def Sup_prod_def image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   213
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   214
lemma INF_Pair: "(INF x:A. (f x, g x)) = (INF x:A. f x, INF x:A. g x)"
44928
7ef6505bde7f renamed Complete_Lattices lemmas, removed legacy names
hoelzl
parents: 44006
diff changeset
   215
  by (simp add: INF_def Inf_prod_def image_image)
44006
b9839fad3bb6 new theory HOL/Library/Product_Lattice.thy
huffman
parents:
diff changeset
   216
50535
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   217
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   218
text {* Alternative formulations for set infima and suprema over the product
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   219
of two complete lattices: *}
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   220
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   221
lemma Inf_prod_alt_def: "Inf A = (Inf (fst ` A), Inf (snd ` A))"
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   222
by (auto simp: Inf_prod_def INF_def)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   223
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   224
lemma Sup_prod_alt_def: "Sup A = (Sup (fst ` A), Sup (snd ` A))"
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   225
by (auto simp: Sup_prod_def SUP_def)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   226
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   227
lemma INFI_prod_alt_def: "INFI A f = (INFI A (fst o f), INFI A (snd o f))"
56154
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 54776
diff changeset
   228
by (auto simp: INF_def Inf_prod_def image_comp)
50535
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   229
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   230
lemma SUPR_prod_alt_def: "SUPR A f = (SUPR A (fst o f), SUPR A (snd o f))"
56154
f0a927235162 more complete set of lemmas wrt. image and composition
haftmann
parents: 54776
diff changeset
   231
by (auto simp: SUP_def Sup_prod_def image_comp)
50535
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   232
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   233
lemma INF_prod_alt_def:
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   234
  "(INF x:A. f x) = (INF x:A. fst (f x), INF x:A. snd (f x))"
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   235
by (metis fst_INF snd_INF surjective_pairing)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   236
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   237
lemma SUP_prod_alt_def:
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   238
  "(SUP x:A. f x) = (SUP x:A. fst (f x), SUP x:A. snd (f x))"
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   239
by (metis fst_SUP snd_SUP surjective_pairing)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   240
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   241
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   242
subsection {* Complete distributive lattices *}
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   243
50573
765c22baa1c9 new contributor
nipkow
parents: 50535
diff changeset
   244
(* Contribution: Alessandro Coglio *)
50535
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   245
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   246
instance prod ::
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   247
  (complete_distrib_lattice, complete_distrib_lattice) complete_distrib_lattice
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   248
proof
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   249
  case goal1 thus ?case
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   250
    by (auto simp: sup_prod_def Inf_prod_def INF_prod_alt_def sup_Inf sup_INF)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   251
next
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   252
  case goal2 thus ?case
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   253
    by (auto simp: inf_prod_def Sup_prod_def SUP_prod_alt_def inf_Sup inf_SUP)
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   254
qed
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   255
51115
7dbd6832a689 consolidation of library theories on product orders
haftmann
parents: 50573
diff changeset
   256
end
50535
2464d77527c4 contribution by A. Colgio
nipkow
parents: 45007
diff changeset
   257