src/HOL/Library/Set_Algebras.thy
author Andreas Lochbihler
Wed Feb 27 10:33:30 2013 +0100 (2013-02-27)
changeset 51288 be7e9a675ec9
parent 47446 ed0795caec95
child 53596 d29d63460d84
permissions -rw-r--r--
add wellorder instance for Numeral_Type (suggested by Jesus Aransay)
haftmann@38622
     1
(*  Title:      HOL/Library/Set_Algebras.thy
haftmann@38622
     2
    Author:     Jeremy Avigad and Kevin Donnelly; Florian Haftmann, TUM
avigad@16908
     3
*)
avigad@16908
     4
haftmann@38622
     5
header {* Algebraic operations on sets *}
avigad@16908
     6
haftmann@38622
     7
theory Set_Algebras
haftmann@30738
     8
imports Main
avigad@16908
     9
begin
avigad@16908
    10
wenzelm@19736
    11
text {*
haftmann@38622
    12
  This library lifts operations like addition and muliplication to
haftmann@38622
    13
  sets.  It was designed to support asymptotic calculations. See the
haftmann@38622
    14
  comments at the top of theory @{text BigO}.
avigad@16908
    15
*}
avigad@16908
    16
krauss@47443
    17
instantiation set :: (plus) plus
krauss@47443
    18
begin
krauss@47443
    19
krauss@47443
    20
definition plus_set :: "'a::plus set \<Rightarrow> 'a set \<Rightarrow> 'a set" where
krauss@47443
    21
  set_plus_def: "A + B = {c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b}"
krauss@47443
    22
krauss@47443
    23
instance ..
krauss@47443
    24
krauss@47443
    25
end
krauss@47443
    26
krauss@47443
    27
instantiation set :: (times) times
krauss@47443
    28
begin
krauss@47443
    29
krauss@47443
    30
definition times_set :: "'a::times set \<Rightarrow> 'a set \<Rightarrow> 'a set" where
krauss@47443
    31
  set_times_def: "A * B = {c. \<exists>a\<in>A. \<exists>b\<in>B. c = a * b}"
krauss@47443
    32
krauss@47443
    33
instance ..
krauss@47443
    34
krauss@47443
    35
end
krauss@47443
    36
krauss@47443
    37
instantiation set :: (zero) zero
krauss@47443
    38
begin
krauss@47443
    39
krauss@47443
    40
definition
krauss@47443
    41
  set_zero[simp]: "0::('a::zero)set == {0}"
krauss@47443
    42
krauss@47443
    43
instance ..
krauss@47443
    44
krauss@47443
    45
end
krauss@47443
    46
 
krauss@47443
    47
instantiation set :: (one) one
krauss@47443
    48
begin
krauss@47443
    49
krauss@47443
    50
definition
krauss@47443
    51
  set_one[simp]: "1::('a::one)set == {1}"
krauss@47443
    52
krauss@47443
    53
instance ..
krauss@47443
    54
krauss@47443
    55
end
haftmann@25594
    56
haftmann@38622
    57
definition elt_set_plus :: "'a::plus \<Rightarrow> 'a set \<Rightarrow> 'a set"  (infixl "+o" 70) where
haftmann@38622
    58
  "a +o B = {c. \<exists>b\<in>B. c = a + b}"
avigad@16908
    59
haftmann@38622
    60
definition elt_set_times :: "'a::times \<Rightarrow> 'a set \<Rightarrow> 'a set"  (infixl "*o" 80) where
haftmann@38622
    61
  "a *o B = {c. \<exists>b\<in>B. c = a * b}"
haftmann@25594
    62
haftmann@38622
    63
abbreviation (input) elt_set_eq :: "'a \<Rightarrow> 'a set \<Rightarrow> bool"  (infix "=o" 50) where
haftmann@38622
    64
  "x =o A \<equiv> x \<in> A"
haftmann@25594
    65
krauss@47443
    66
instance set :: (semigroup_add) semigroup_add
krauss@47443
    67
by default (force simp add: set_plus_def add.assoc)
haftmann@25594
    68
krauss@47443
    69
instance set :: (ab_semigroup_add) ab_semigroup_add
krauss@47443
    70
by default (force simp add: set_plus_def add.commute)
haftmann@25594
    71
krauss@47443
    72
instance set :: (monoid_add) monoid_add
krauss@47443
    73
by default (simp_all add: set_plus_def)
haftmann@25594
    74
krauss@47443
    75
instance set :: (comm_monoid_add) comm_monoid_add
krauss@47443
    76
by default (simp_all add: set_plus_def)
avigad@16908
    77
krauss@47443
    78
instance set :: (semigroup_mult) semigroup_mult
krauss@47443
    79
by default (force simp add: set_times_def mult.assoc)
avigad@16908
    80
krauss@47443
    81
instance set :: (ab_semigroup_mult) ab_semigroup_mult
krauss@47443
    82
by default (force simp add: set_times_def mult.commute)
avigad@16908
    83
krauss@47443
    84
instance set :: (monoid_mult) monoid_mult
krauss@47443
    85
by default (simp_all add: set_times_def)
avigad@16908
    86
krauss@47443
    87
instance set :: (comm_monoid_mult) comm_monoid_mult
krauss@47443
    88
by default (simp_all add: set_times_def)
avigad@16908
    89
krauss@47445
    90
lemma set_plus_intro [intro]: "a : C ==> b : D ==> a + b : C + D"
berghofe@26814
    91
  by (auto simp add: set_plus_def)
avigad@16908
    92
avigad@16908
    93
lemma set_plus_intro2 [intro]: "b : C ==> a + b : a +o C"
wenzelm@19736
    94
  by (auto simp add: elt_set_plus_def)
avigad@16908
    95
krauss@47445
    96
lemma set_plus_rearrange: "((a::'a::comm_monoid_add) +o C) +
krauss@47445
    97
    (b +o D) = (a + b) +o (C + D)"
berghofe@26814
    98
  apply (auto simp add: elt_set_plus_def set_plus_def add_ac)
wenzelm@19736
    99
   apply (rule_tac x = "ba + bb" in exI)
avigad@16908
   100
  apply (auto simp add: add_ac)
avigad@16908
   101
  apply (rule_tac x = "aa + a" in exI)
avigad@16908
   102
  apply (auto simp add: add_ac)
wenzelm@19736
   103
  done
avigad@16908
   104
wenzelm@19736
   105
lemma set_plus_rearrange2: "(a::'a::semigroup_add) +o (b +o C) =
wenzelm@19736
   106
    (a + b) +o C"
wenzelm@19736
   107
  by (auto simp add: elt_set_plus_def add_assoc)
avigad@16908
   108
krauss@47445
   109
lemma set_plus_rearrange3: "((a::'a::semigroup_add) +o B) + C =
krauss@47445
   110
    a +o (B + C)"
berghofe@26814
   111
  apply (auto simp add: elt_set_plus_def set_plus_def)
wenzelm@19736
   112
   apply (blast intro: add_ac)
avigad@16908
   113
  apply (rule_tac x = "a + aa" in exI)
avigad@16908
   114
  apply (rule conjI)
wenzelm@19736
   115
   apply (rule_tac x = "aa" in bexI)
wenzelm@19736
   116
    apply auto
avigad@16908
   117
  apply (rule_tac x = "ba" in bexI)
wenzelm@19736
   118
   apply (auto simp add: add_ac)
wenzelm@19736
   119
  done
avigad@16908
   120
krauss@47445
   121
theorem set_plus_rearrange4: "C + ((a::'a::comm_monoid_add) +o D) =
krauss@47445
   122
    a +o (C + D)"
huffman@44142
   123
  apply (auto simp add: elt_set_plus_def set_plus_def add_ac)
wenzelm@19736
   124
   apply (rule_tac x = "aa + ba" in exI)
wenzelm@19736
   125
   apply (auto simp add: add_ac)
wenzelm@19736
   126
  done
avigad@16908
   127
avigad@16908
   128
theorems set_plus_rearranges = set_plus_rearrange set_plus_rearrange2
avigad@16908
   129
  set_plus_rearrange3 set_plus_rearrange4
avigad@16908
   130
avigad@16908
   131
lemma set_plus_mono [intro!]: "C <= D ==> a +o C <= a +o D"
wenzelm@19736
   132
  by (auto simp add: elt_set_plus_def)
avigad@16908
   133
wenzelm@19736
   134
lemma set_plus_mono2 [intro]: "(C::('a::plus) set) <= D ==> E <= F ==>
krauss@47445
   135
    C + E <= D + F"
berghofe@26814
   136
  by (auto simp add: set_plus_def)
avigad@16908
   137
krauss@47445
   138
lemma set_plus_mono3 [intro]: "a : C ==> a +o D <= C + D"
berghofe@26814
   139
  by (auto simp add: elt_set_plus_def set_plus_def)
avigad@16908
   140
wenzelm@19736
   141
lemma set_plus_mono4 [intro]: "(a::'a::comm_monoid_add) : C ==>
krauss@47445
   142
    a +o D <= D + C"
berghofe@26814
   143
  by (auto simp add: elt_set_plus_def set_plus_def add_ac)
avigad@16908
   144
krauss@47445
   145
lemma set_plus_mono5: "a:C ==> B <= D ==> a +o B <= C + D"
avigad@16908
   146
  apply (subgoal_tac "a +o B <= a +o D")
wenzelm@19736
   147
   apply (erule order_trans)
wenzelm@19736
   148
   apply (erule set_plus_mono3)
avigad@16908
   149
  apply (erule set_plus_mono)
wenzelm@19736
   150
  done
avigad@16908
   151
wenzelm@19736
   152
lemma set_plus_mono_b: "C <= D ==> x : a +o C
avigad@16908
   153
    ==> x : a +o D"
avigad@16908
   154
  apply (frule set_plus_mono)
avigad@16908
   155
  apply auto
wenzelm@19736
   156
  done
avigad@16908
   157
krauss@47445
   158
lemma set_plus_mono2_b: "C <= D ==> E <= F ==> x : C + E ==>
krauss@47445
   159
    x : D + F"
avigad@16908
   160
  apply (frule set_plus_mono2)
wenzelm@19736
   161
   prefer 2
wenzelm@19736
   162
   apply force
avigad@16908
   163
  apply assumption
wenzelm@19736
   164
  done
avigad@16908
   165
krauss@47445
   166
lemma set_plus_mono3_b: "a : C ==> x : a +o D ==> x : C + D"
avigad@16908
   167
  apply (frule set_plus_mono3)
avigad@16908
   168
  apply auto
wenzelm@19736
   169
  done
avigad@16908
   170
wenzelm@19736
   171
lemma set_plus_mono4_b: "(a::'a::comm_monoid_add) : C ==>
krauss@47445
   172
    x : a +o D ==> x : D + C"
avigad@16908
   173
  apply (frule set_plus_mono4)
avigad@16908
   174
  apply auto
wenzelm@19736
   175
  done
avigad@16908
   176
avigad@16908
   177
lemma set_zero_plus [simp]: "(0::'a::comm_monoid_add) +o C = C"
wenzelm@19736
   178
  by (auto simp add: elt_set_plus_def)
avigad@16908
   179
krauss@47445
   180
lemma set_zero_plus2: "(0::'a::comm_monoid_add) : A ==> B <= A + B"
huffman@44142
   181
  apply (auto simp add: set_plus_def)
avigad@16908
   182
  apply (rule_tac x = 0 in bexI)
wenzelm@19736
   183
   apply (rule_tac x = x in bexI)
wenzelm@19736
   184
    apply (auto simp add: add_ac)
wenzelm@19736
   185
  done
avigad@16908
   186
avigad@16908
   187
lemma set_plus_imp_minus: "(a::'a::ab_group_add) : b +o C ==> (a - b) : C"
wenzelm@19736
   188
  by (auto simp add: elt_set_plus_def add_ac diff_minus)
avigad@16908
   189
avigad@16908
   190
lemma set_minus_imp_plus: "(a::'a::ab_group_add) - b : C ==> a : b +o C"
avigad@16908
   191
  apply (auto simp add: elt_set_plus_def add_ac diff_minus)
avigad@16908
   192
  apply (subgoal_tac "a = (a + - b) + b")
wenzelm@19736
   193
   apply (rule bexI, assumption, assumption)
avigad@16908
   194
  apply (auto simp add: add_ac)
wenzelm@19736
   195
  done
avigad@16908
   196
avigad@16908
   197
lemma set_minus_plus: "((a::'a::ab_group_add) - b : C) = (a : b +o C)"
wenzelm@19736
   198
  by (rule iffI, rule set_minus_imp_plus, assumption, rule set_plus_imp_minus,
avigad@16908
   199
    assumption)
avigad@16908
   200
krauss@47445
   201
lemma set_times_intro [intro]: "a : C ==> b : D ==> a * b : C * D"
berghofe@26814
   202
  by (auto simp add: set_times_def)
avigad@16908
   203
avigad@16908
   204
lemma set_times_intro2 [intro!]: "b : C ==> a * b : a *o C"
wenzelm@19736
   205
  by (auto simp add: elt_set_times_def)
avigad@16908
   206
krauss@47445
   207
lemma set_times_rearrange: "((a::'a::comm_monoid_mult) *o C) *
krauss@47445
   208
    (b *o D) = (a * b) *o (C * D)"
berghofe@26814
   209
  apply (auto simp add: elt_set_times_def set_times_def)
wenzelm@19736
   210
   apply (rule_tac x = "ba * bb" in exI)
wenzelm@19736
   211
   apply (auto simp add: mult_ac)
avigad@16908
   212
  apply (rule_tac x = "aa * a" in exI)
avigad@16908
   213
  apply (auto simp add: mult_ac)
wenzelm@19736
   214
  done
avigad@16908
   215
wenzelm@19736
   216
lemma set_times_rearrange2: "(a::'a::semigroup_mult) *o (b *o C) =
wenzelm@19736
   217
    (a * b) *o C"
wenzelm@19736
   218
  by (auto simp add: elt_set_times_def mult_assoc)
avigad@16908
   219
krauss@47445
   220
lemma set_times_rearrange3: "((a::'a::semigroup_mult) *o B) * C =
krauss@47445
   221
    a *o (B * C)"
berghofe@26814
   222
  apply (auto simp add: elt_set_times_def set_times_def)
wenzelm@19736
   223
   apply (blast intro: mult_ac)
avigad@16908
   224
  apply (rule_tac x = "a * aa" in exI)
avigad@16908
   225
  apply (rule conjI)
wenzelm@19736
   226
   apply (rule_tac x = "aa" in bexI)
wenzelm@19736
   227
    apply auto
avigad@16908
   228
  apply (rule_tac x = "ba" in bexI)
wenzelm@19736
   229
   apply (auto simp add: mult_ac)
wenzelm@19736
   230
  done
avigad@16908
   231
krauss@47445
   232
theorem set_times_rearrange4: "C * ((a::'a::comm_monoid_mult) *o D) =
krauss@47445
   233
    a *o (C * D)"
huffman@44142
   234
  apply (auto simp add: elt_set_times_def set_times_def
avigad@16908
   235
    mult_ac)
wenzelm@19736
   236
   apply (rule_tac x = "aa * ba" in exI)
wenzelm@19736
   237
   apply (auto simp add: mult_ac)
wenzelm@19736
   238
  done
avigad@16908
   239
avigad@16908
   240
theorems set_times_rearranges = set_times_rearrange set_times_rearrange2
avigad@16908
   241
  set_times_rearrange3 set_times_rearrange4
avigad@16908
   242
avigad@16908
   243
lemma set_times_mono [intro]: "C <= D ==> a *o C <= a *o D"
wenzelm@19736
   244
  by (auto simp add: elt_set_times_def)
avigad@16908
   245
wenzelm@19736
   246
lemma set_times_mono2 [intro]: "(C::('a::times) set) <= D ==> E <= F ==>
krauss@47445
   247
    C * E <= D * F"
berghofe@26814
   248
  by (auto simp add: set_times_def)
avigad@16908
   249
krauss@47445
   250
lemma set_times_mono3 [intro]: "a : C ==> a *o D <= C * D"
berghofe@26814
   251
  by (auto simp add: elt_set_times_def set_times_def)
avigad@16908
   252
wenzelm@19736
   253
lemma set_times_mono4 [intro]: "(a::'a::comm_monoid_mult) : C ==>
krauss@47445
   254
    a *o D <= D * C"
berghofe@26814
   255
  by (auto simp add: elt_set_times_def set_times_def mult_ac)
avigad@16908
   256
krauss@47445
   257
lemma set_times_mono5: "a:C ==> B <= D ==> a *o B <= C * D"
avigad@16908
   258
  apply (subgoal_tac "a *o B <= a *o D")
wenzelm@19736
   259
   apply (erule order_trans)
wenzelm@19736
   260
   apply (erule set_times_mono3)
avigad@16908
   261
  apply (erule set_times_mono)
wenzelm@19736
   262
  done
avigad@16908
   263
wenzelm@19736
   264
lemma set_times_mono_b: "C <= D ==> x : a *o C
avigad@16908
   265
    ==> x : a *o D"
avigad@16908
   266
  apply (frule set_times_mono)
avigad@16908
   267
  apply auto
wenzelm@19736
   268
  done
avigad@16908
   269
krauss@47445
   270
lemma set_times_mono2_b: "C <= D ==> E <= F ==> x : C * E ==>
krauss@47445
   271
    x : D * F"
avigad@16908
   272
  apply (frule set_times_mono2)
wenzelm@19736
   273
   prefer 2
wenzelm@19736
   274
   apply force
avigad@16908
   275
  apply assumption
wenzelm@19736
   276
  done
avigad@16908
   277
krauss@47445
   278
lemma set_times_mono3_b: "a : C ==> x : a *o D ==> x : C * D"
avigad@16908
   279
  apply (frule set_times_mono3)
avigad@16908
   280
  apply auto
wenzelm@19736
   281
  done
avigad@16908
   282
wenzelm@19736
   283
lemma set_times_mono4_b: "(a::'a::comm_monoid_mult) : C ==>
krauss@47445
   284
    x : a *o D ==> x : D * C"
avigad@16908
   285
  apply (frule set_times_mono4)
avigad@16908
   286
  apply auto
wenzelm@19736
   287
  done
avigad@16908
   288
avigad@16908
   289
lemma set_one_times [simp]: "(1::'a::comm_monoid_mult) *o C = C"
wenzelm@19736
   290
  by (auto simp add: elt_set_times_def)
avigad@16908
   291
wenzelm@19736
   292
lemma set_times_plus_distrib: "(a::'a::semiring) *o (b +o C)=
wenzelm@19736
   293
    (a * b) +o (a *o C)"
nipkow@23477
   294
  by (auto simp add: elt_set_plus_def elt_set_times_def ring_distribs)
avigad@16908
   295
krauss@47445
   296
lemma set_times_plus_distrib2: "(a::'a::semiring) *o (B + C) =
krauss@47445
   297
    (a *o B) + (a *o C)"
berghofe@26814
   298
  apply (auto simp add: set_plus_def elt_set_times_def ring_distribs)
wenzelm@19736
   299
   apply blast
avigad@16908
   300
  apply (rule_tac x = "b + bb" in exI)
nipkow@23477
   301
  apply (auto simp add: ring_distribs)
wenzelm@19736
   302
  done
avigad@16908
   303
krauss@47445
   304
lemma set_times_plus_distrib3: "((a::'a::semiring) +o C) * D <=
krauss@47445
   305
    a *o D + C * D"
huffman@44142
   306
  apply (auto simp add:
berghofe@26814
   307
    elt_set_plus_def elt_set_times_def set_times_def
berghofe@26814
   308
    set_plus_def ring_distribs)
avigad@16908
   309
  apply auto
wenzelm@19736
   310
  done
avigad@16908
   311
wenzelm@19380
   312
theorems set_times_plus_distribs =
wenzelm@19380
   313
  set_times_plus_distrib
avigad@16908
   314
  set_times_plus_distrib2
avigad@16908
   315
wenzelm@19736
   316
lemma set_neg_intro: "(a::'a::ring_1) : (- 1) *o C ==>
wenzelm@19736
   317
    - a : C"
wenzelm@19736
   318
  by (auto simp add: elt_set_times_def)
avigad@16908
   319
avigad@16908
   320
lemma set_neg_intro2: "(a::'a::ring_1) : C ==>
avigad@16908
   321
    - a : (- 1) *o C"
wenzelm@19736
   322
  by (auto simp add: elt_set_times_def)
wenzelm@19736
   323
hoelzl@40887
   324
lemma set_plus_image:
krauss@47445
   325
  fixes S T :: "'n::semigroup_add set" shows "S + T = (\<lambda>(x, y). x + y) ` (S \<times> T)"
nipkow@44890
   326
  unfolding set_plus_def by (fastforce simp: image_iff)
hoelzl@40887
   327
hoelzl@40887
   328
lemma set_setsum_alt:
hoelzl@40887
   329
  assumes fin: "finite I"
krauss@47444
   330
  shows "setsum S I = {setsum s I |s. \<forall>i\<in>I. s i \<in> S i}"
hoelzl@40887
   331
    (is "_ = ?setsum I")
hoelzl@40887
   332
using fin proof induct
hoelzl@40887
   333
  case (insert x F)
krauss@47445
   334
  have "setsum S (insert x F) = S x + ?setsum F"
hoelzl@40887
   335
    using insert.hyps by auto
hoelzl@40887
   336
  also have "...= {s x + setsum s F |s. \<forall> i\<in>insert x F. s i \<in> S i}"
hoelzl@40887
   337
    unfolding set_plus_def
hoelzl@40887
   338
  proof safe
hoelzl@40887
   339
    fix y s assume "y \<in> S x" "\<forall>i\<in>F. s i \<in> S i"
hoelzl@40887
   340
    then show "\<exists>s'. y + setsum s F = s' x + setsum s' F \<and> (\<forall>i\<in>insert x F. s' i \<in> S i)"
hoelzl@40887
   341
      using insert.hyps
hoelzl@40887
   342
      by (intro exI[of _ "\<lambda>i. if i \<in> F then s i else y"]) (auto simp add: set_plus_def)
hoelzl@40887
   343
  qed auto
hoelzl@40887
   344
  finally show ?case
hoelzl@40887
   345
    using insert.hyps by auto
hoelzl@40887
   346
qed auto
hoelzl@40887
   347
hoelzl@40887
   348
lemma setsum_set_cond_linear:
hoelzl@40887
   349
  fixes f :: "('a::comm_monoid_add) set \<Rightarrow> ('b::comm_monoid_add) set"
krauss@47445
   350
  assumes [intro!]: "\<And>A B. P A  \<Longrightarrow> P B  \<Longrightarrow> P (A + B)" "P {0}"
krauss@47445
   351
    and f: "\<And>A B. P A  \<Longrightarrow> P B \<Longrightarrow> f (A + B) = f A + f B" "f {0} = {0}"
hoelzl@40887
   352
  assumes all: "\<And>i. i \<in> I \<Longrightarrow> P (S i)"
krauss@47444
   353
  shows "f (setsum S I) = setsum (f \<circ> S) I"
hoelzl@40887
   354
proof cases
hoelzl@40887
   355
  assume "finite I" from this all show ?thesis
hoelzl@40887
   356
  proof induct
hoelzl@40887
   357
    case (insert x F)
krauss@47444
   358
    from `finite F` `\<And>i. i \<in> insert x F \<Longrightarrow> P (S i)` have "P (setsum S F)"
hoelzl@40887
   359
      by induct auto
hoelzl@40887
   360
    with insert show ?case
hoelzl@40887
   361
      by (simp, subst f) auto
hoelzl@40887
   362
  qed (auto intro!: f)
hoelzl@40887
   363
qed (auto intro!: f)
hoelzl@40887
   364
hoelzl@40887
   365
lemma setsum_set_linear:
hoelzl@40887
   366
  fixes f :: "('a::comm_monoid_add) set => ('b::comm_monoid_add) set"
krauss@47445
   367
  assumes "\<And>A B. f(A) + f(B) = f(A + B)" "f {0} = {0}"
krauss@47444
   368
  shows "f (setsum S I) = setsum (f \<circ> S) I"
hoelzl@40887
   369
  using setsum_set_cond_linear[of "\<lambda>x. True" f I S] assms by auto
hoelzl@40887
   370
krauss@47446
   371
lemma set_times_Un_distrib:
krauss@47446
   372
  "A * (B \<union> C) = A * B \<union> A * C"
krauss@47446
   373
  "(A \<union> B) * C = A * C \<union> B * C"
krauss@47446
   374
by (auto simp: set_times_def)
krauss@47446
   375
krauss@47446
   376
lemma set_times_UNION_distrib:
krauss@47446
   377
  "A * UNION I M = UNION I (%i. A * M i)"
krauss@47446
   378
  "UNION I M * A = UNION I (%i. M i * A)"
krauss@47446
   379
by (auto simp: set_times_def)
krauss@47446
   380
avigad@16908
   381
end