src/HOL/OrderedGroup.thy
author paulson
Tue, 05 Oct 2004 15:30:50 +0200
changeset 15229 1eb23f805c06
parent 15197 19e735596e51
child 15234 ec91a90c604e
permissions -rw-r--r--
new simprules for abs and for things like a/b<1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14770
fe9504ba63d5 removed duplicate thms;
wenzelm
parents: 14754
diff changeset
     1
(*  Title:   HOL/OrderedGroup.thy
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     2
    ID:      $Id$
14770
fe9504ba63d5 removed duplicate thms;
wenzelm
parents: 14754
diff changeset
     3
    Author:  Gertrud Bauer, Steven Obua, Lawrence C Paulson, and Markus Wenzel
14738
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
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     6
header {* Ordered Groups *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
     7
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15093
diff changeset
     8
theory OrderedGroup
15140
322485b816ac import -> imports
nipkow
parents: 15131
diff changeset
     9
imports Inductive LOrder
15131
c69542757a4d New theory header syntax.
nipkow
parents: 15093
diff changeset
    10
files "../Provers/Arith/abel_cancel.ML"
c69542757a4d New theory header syntax.
nipkow
parents: 15093
diff changeset
    11
begin
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    12
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    13
text {*
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    14
  The theory of partially ordered groups is taken from the books:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    15
  \begin{itemize}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    16
  \item \emph{Lattice Theory} by Garret Birkhoff, American Mathematical Society 1979 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    17
  \item \emph{Partially Ordered Algebraic Systems}, Pergamon Press 1963
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    18
  \end{itemize}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    19
  Most of the used notions can also be looked up in 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    20
  \begin{itemize}
14770
fe9504ba63d5 removed duplicate thms;
wenzelm
parents: 14754
diff changeset
    21
  \item \url{http://www.mathworld.com} by Eric Weisstein et. al.
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    22
  \item \emph{Algebra I} by van der Waerden, Springer.
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    23
  \end{itemize}
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
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    26
subsection {* Semigroups, Groups *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    27
 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    28
axclass semigroup_add \<subseteq> plus
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    29
  add_assoc: "(a + b) + c = a + (b + c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    30
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    31
axclass ab_semigroup_add \<subseteq> semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    32
  add_commute: "a + b = b + a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    33
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    34
lemma add_left_commute: "a + (b + c) = b + (a + (c::'a::ab_semigroup_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    35
  by (rule mk_left_commute [of "op +", OF add_assoc add_commute])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    36
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    37
theorems add_ac = add_assoc add_commute add_left_commute
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    38
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    39
axclass semigroup_mult \<subseteq> times
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    40
  mult_assoc: "(a * b) * c = a * (b * c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    41
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    42
axclass ab_semigroup_mult \<subseteq> semigroup_mult
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    43
  mult_commute: "a * b = b * a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    44
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    45
lemma mult_left_commute: "a * (b * c) = b * (a * (c::'a::ab_semigroup_mult))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    46
  by (rule mk_left_commute [of "op *", OF mult_assoc mult_commute])
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
theorems mult_ac = mult_assoc mult_commute mult_left_commute
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    49
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    50
axclass comm_monoid_add \<subseteq> zero, ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    51
  add_0[simp]: "0 + a = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    52
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    53
axclass monoid_mult \<subseteq> one, semigroup_mult
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    54
  mult_1_left[simp]: "1 * a  = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    55
  mult_1_right[simp]: "a * 1 = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    56
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    57
axclass comm_monoid_mult \<subseteq> one, ab_semigroup_mult
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    58
  mult_1: "1 * a = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    59
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    60
instance comm_monoid_mult \<subseteq> monoid_mult
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    61
by (intro_classes, insert mult_1, simp_all add: mult_commute, auto)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    62
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    63
axclass cancel_semigroup_add \<subseteq> semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    64
  add_left_imp_eq: "a + b = a + c \<Longrightarrow> b = c"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    65
  add_right_imp_eq: "b + a = c + a \<Longrightarrow> b = c"
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
axclass cancel_ab_semigroup_add \<subseteq> ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    68
  add_imp_eq: "a + b = a + c \<Longrightarrow> b = c"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    69
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    70
instance cancel_ab_semigroup_add \<subseteq> cancel_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    71
proof
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
    fix a b c :: 'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    74
    assume "a + b = a + c"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    75
    thus "b = c" by (rule add_imp_eq)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    76
  }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    77
  note f = this
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    78
  fix a b c :: 'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    79
  assume "b + a = c + a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    80
  hence "a + b = a + c" by (simp only: add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    81
  thus "b = c" by (rule f)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    82
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    83
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    84
axclass ab_group_add \<subseteq> minus, comm_monoid_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    85
  left_minus[simp]: " - a + a = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    86
  diff_minus: "a - b = a + (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    87
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    88
instance ab_group_add \<subseteq> cancel_ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    89
proof 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    90
  fix a b c :: 'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    91
  assume "a + b = a + c"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    92
  hence "-a + a + b = -a + a + c" by (simp only: add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    93
  thus "b = c" by simp 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    94
qed
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 add_0_right [simp]: "a + 0 = (a::'a::comm_monoid_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    97
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    98
  have "a + 0 = 0 + a" by (simp only: add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
    99
  also have "... = a" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   100
  finally show ?thesis .
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   101
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   102
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   103
lemma add_left_cancel [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   104
     "(a + b = a + c) = (b = (c::'a::cancel_semigroup_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   105
by (blast dest: add_left_imp_eq) 
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 add_right_cancel [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   108
     "(b + a = c + a) = (b = (c::'a::cancel_semigroup_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   109
  by (blast dest: add_right_imp_eq)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   110
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   111
lemma right_minus [simp]: "a + -(a::'a::ab_group_add) = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   112
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   113
  have "a + -a = -a + a" by (simp add: add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   114
  also have "... = 0" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   115
  finally show ?thesis .
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   116
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   117
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   118
lemma right_minus_eq: "(a - b = 0) = (a = (b::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   119
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   120
  have "a = a - b + b" by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   121
  also assume "a - b = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   122
  finally show "a = b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   123
next
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   124
  assume "a = b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   125
  thus "a - b = 0" by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   126
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   127
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   128
lemma minus_minus [simp]: "- (- (a::'a::ab_group_add)) = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   129
proof (rule add_left_cancel [of "-a", THEN iffD1])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   130
  show "(-a + -(-a) = -a + a)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   131
  by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   132
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   133
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   134
lemma equals_zero_I: "a+b = 0 ==> -a = (b::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   135
apply (rule right_minus_eq [THEN iffD1, symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   136
apply (simp add: diff_minus add_commute) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   137
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   138
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   139
lemma minus_zero [simp]: "- 0 = (0::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   140
by (simp add: equals_zero_I)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   141
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   142
lemma diff_self [simp]: "a - (a::'a::ab_group_add) = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   143
  by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   144
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   145
lemma diff_0 [simp]: "(0::'a::ab_group_add) - a = -a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   146
by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   147
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   148
lemma diff_0_right [simp]: "a - (0::'a::ab_group_add) = a" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   149
by (simp add: diff_minus)
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
lemma diff_minus_eq_add [simp]: "a - - b = a + (b::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   152
by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   153
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   154
lemma neg_equal_iff_equal [simp]: "(-a = -b) = (a = (b::'a::ab_group_add))" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   155
proof 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   156
  assume "- a = - b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   157
  hence "- (- a) = - (- b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   158
    by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   159
  thus "a=b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   160
next
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   161
  assume "a=b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   162
  thus "-a = -b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   163
qed
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 neg_equal_0_iff_equal [simp]: "(-a = 0) = (a = (0::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   166
by (subst neg_equal_iff_equal [symmetric], simp)
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 neg_0_equal_iff_equal [simp]: "(0 = -a) = (0 = (a::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   169
by (subst neg_equal_iff_equal [symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   170
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   171
text{*The next two equations can make the simplifier loop!*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   172
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   173
lemma equation_minus_iff: "(a = - b) = (b = - (a::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   174
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   175
  have "(- (-a) = - b) = (- a = b)" by (rule neg_equal_iff_equal)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   176
  thus ?thesis by (simp add: eq_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   177
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   178
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   179
lemma minus_equation_iff: "(- a = b) = (- (b::'a::ab_group_add) = a)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   180
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   181
  have "(- a = - (-b)) = (a = -b)" by (rule neg_equal_iff_equal)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   182
  thus ?thesis by (simp add: eq_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   183
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   184
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   185
lemma minus_add_distrib [simp]: "- (a + b) = -a + -(b::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   186
apply (rule equals_zero_I)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   187
apply (simp add: add_ac) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   188
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   189
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   190
lemma minus_diff_eq [simp]: "- (a - b) = b - (a::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   191
by (simp add: diff_minus add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   192
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   193
subsection {* (Partially) Ordered Groups *} 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   194
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   195
axclass pordered_ab_semigroup_add \<subseteq> order, ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   196
  add_left_mono: "a \<le> b \<Longrightarrow> c + a \<le> c + b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   197
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   198
axclass pordered_cancel_ab_semigroup_add \<subseteq> pordered_ab_semigroup_add, cancel_ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   199
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   200
instance pordered_cancel_ab_semigroup_add \<subseteq> pordered_ab_semigroup_add ..
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   201
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   202
axclass pordered_ab_semigroup_add_imp_le \<subseteq> pordered_cancel_ab_semigroup_add
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   203
  add_le_imp_le_left: "c + a \<le> c + b \<Longrightarrow> a \<le> b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   204
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   205
axclass pordered_ab_group_add \<subseteq> ab_group_add, pordered_ab_semigroup_add
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
instance pordered_ab_group_add \<subseteq> pordered_ab_semigroup_add_imp_le
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   208
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   209
  fix a b c :: 'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   210
  assume "c + a \<le> c + b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   211
  hence "(-c) + (c + a) \<le> (-c) + (c + b)" by (rule add_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   212
  hence "((-c) + c) + a \<le> ((-c) + c) + b" by (simp only: add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   213
  thus "a \<le> b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   214
qed
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
axclass ordered_cancel_ab_semigroup_add \<subseteq> pordered_cancel_ab_semigroup_add, linorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   217
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   218
instance ordered_cancel_ab_semigroup_add \<subseteq> pordered_ab_semigroup_add_imp_le
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   219
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   220
  fix a b c :: 'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   221
  assume le: "c + a <= c + b"  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   222
  show "a <= b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   223
  proof (rule ccontr)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   224
    assume w: "~ a \<le> b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   225
    hence "b <= a" by (simp add: linorder_not_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   226
    hence le2: "c+b <= c+a" by (rule add_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   227
    have "a = b" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   228
      apply (insert le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   229
      apply (insert le2)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   230
      apply (drule order_antisym, simp_all)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   231
      done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   232
    with w  show False 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   233
      by (simp add: linorder_not_le [symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   234
  qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   235
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   236
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   237
lemma add_right_mono: "a \<le> (b::'a::pordered_ab_semigroup_add) ==> a + c \<le> b + c"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   238
by (simp add: add_commute[of _ c] add_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   239
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   240
text {* non-strict, in both arguments *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   241
lemma add_mono:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   242
     "[|a \<le> b;  c \<le> d|] ==> a + c \<le> b + (d::'a::pordered_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   243
  apply (erule add_right_mono [THEN order_trans])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   244
  apply (simp add: add_commute add_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   245
  done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   246
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   247
lemma add_strict_left_mono:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   248
     "a < b ==> c + a < c + (b::'a::pordered_cancel_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   249
 by (simp add: order_less_le add_left_mono) 
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 add_strict_right_mono:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   252
     "a < b ==> a + c < b + (c::'a::pordered_cancel_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   253
 by (simp add: add_commute [of _ c] add_strict_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   254
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   255
text{*Strict monotonicity in both arguments*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   256
lemma add_strict_mono: "[|a<b; c<d|] ==> a + c < b + (d::'a::pordered_cancel_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   257
apply (erule add_strict_right_mono [THEN order_less_trans])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   258
apply (erule add_strict_left_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   259
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   260
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   261
lemma add_less_le_mono:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   262
     "[| a<b; c\<le>d |] ==> a + c < b + (d::'a::pordered_cancel_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   263
apply (erule add_strict_right_mono [THEN order_less_le_trans])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   264
apply (erule add_left_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   265
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   266
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   267
lemma add_le_less_mono:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   268
     "[| a\<le>b; c<d |] ==> a + c < b + (d::'a::pordered_cancel_ab_semigroup_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   269
apply (erule add_right_mono [THEN order_le_less_trans])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   270
apply (erule add_strict_left_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   271
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   272
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   273
lemma add_less_imp_less_left:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   274
      assumes less: "c + a < c + b"  shows "a < (b::'a::pordered_ab_semigroup_add_imp_le)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   275
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   276
  from less have le: "c + a <= c + b" by (simp add: order_le_less)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   277
  have "a <= b" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   278
    apply (insert le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   279
    apply (drule add_le_imp_le_left)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   280
    by (insert le, drule add_le_imp_le_left, assumption)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   281
  moreover have "a \<noteq> b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   282
  proof (rule ccontr)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   283
    assume "~(a \<noteq> b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   284
    then have "a = b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   285
    then have "c + a = c + b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   286
    with less show "False"by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   287
  qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   288
  ultimately show "a < b" by (simp add: order_le_less)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   289
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   290
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   291
lemma add_less_imp_less_right:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   292
      "a + c < b + c ==> a < (b::'a::pordered_ab_semigroup_add_imp_le)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   293
apply (rule add_less_imp_less_left [of c])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   294
apply (simp add: add_commute)  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   295
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   296
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   297
lemma add_less_cancel_left [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   298
    "(c+a < c+b) = (a < (b::'a::pordered_ab_semigroup_add_imp_le))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   299
by (blast intro: add_less_imp_less_left add_strict_left_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   300
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   301
lemma add_less_cancel_right [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   302
    "(a+c < b+c) = (a < (b::'a::pordered_ab_semigroup_add_imp_le))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   303
by (blast intro: add_less_imp_less_right add_strict_right_mono)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   304
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   305
lemma add_le_cancel_left [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   306
    "(c+a \<le> c+b) = (a \<le> (b::'a::pordered_ab_semigroup_add_imp_le))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   307
by (auto, drule add_le_imp_le_left, simp_all add: add_left_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   308
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   309
lemma add_le_cancel_right [simp]:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   310
    "(a+c \<le> b+c) = (a \<le> (b::'a::pordered_ab_semigroup_add_imp_le))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   311
by (simp add: add_commute[of a c] add_commute[of b c])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   312
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   313
lemma add_le_imp_le_right:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   314
      "a + c \<le> b + c ==> a \<le> (b::'a::pordered_ab_semigroup_add_imp_le)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   315
by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   316
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   317
lemma add_increasing: "[|0\<le>a; b\<le>c|] ==> b \<le> a + (c::'a::{pordered_ab_semigroup_add_imp_le, comm_monoid_add})"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   318
by (insert add_mono [of 0 a b c], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   319
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   320
subsection {* Ordering Rules for Unary Minus *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   321
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   322
lemma le_imp_neg_le:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   323
      assumes "a \<le> (b::'a::{pordered_ab_semigroup_add_imp_le, ab_group_add})" shows "-b \<le> -a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   324
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   325
  have "-a+a \<le> -a+b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   326
    by (rule add_left_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   327
  hence "0 \<le> -a+b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   328
    by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   329
  hence "0 + (-b) \<le> (-a + b) + (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   330
    by (rule add_right_mono) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   331
  thus ?thesis
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   332
    by (simp add: add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   333
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   334
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   335
lemma neg_le_iff_le [simp]: "(-b \<le> -a) = (a \<le> (b::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   336
proof 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   337
  assume "- b \<le> - a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   338
  hence "- (- a) \<le> - (- b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   339
    by (rule le_imp_neg_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   340
  thus "a\<le>b" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   341
next
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   342
  assume "a\<le>b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   343
  thus "-b \<le> -a" by (rule le_imp_neg_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   344
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   345
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   346
lemma neg_le_0_iff_le [simp]: "(-a \<le> 0) = (0 \<le> (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   347
by (subst neg_le_iff_le [symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   348
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   349
lemma neg_0_le_iff_le [simp]: "(0 \<le> -a) = (a \<le> (0::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   350
by (subst neg_le_iff_le [symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   351
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   352
lemma neg_less_iff_less [simp]: "(-b < -a) = (a < (b::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   353
by (force simp add: order_less_le) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   354
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   355
lemma neg_less_0_iff_less [simp]: "(-a < 0) = (0 < (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   356
by (subst neg_less_iff_less [symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   357
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   358
lemma neg_0_less_iff_less [simp]: "(0 < -a) = (a < (0::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   359
by (subst neg_less_iff_less [symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   360
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   361
text{*The next several equations can make the simplifier loop!*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   362
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   363
lemma less_minus_iff: "(a < - b) = (b < - (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   364
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   365
  have "(- (-a) < - b) = (b < - a)" by (rule neg_less_iff_less)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   366
  thus ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   367
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   368
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   369
lemma minus_less_iff: "(- a < b) = (- b < (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   370
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   371
  have "(- a < - (-b)) = (- b < a)" by (rule neg_less_iff_less)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   372
  thus ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   373
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   374
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   375
lemma le_minus_iff: "(a \<le> - b) = (b \<le> - (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   376
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   377
  have mm: "!! a (b::'a). (-(-a)) < -b \<Longrightarrow> -(-b) < -a" by (simp only: minus_less_iff)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   378
  have "(- (- a) <= -b) = (b <= - a)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   379
    apply (auto simp only: order_le_less)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   380
    apply (drule mm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   381
    apply (simp_all)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   382
    apply (drule mm[simplified], assumption)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   383
    done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   384
  then show ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   385
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   386
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   387
lemma minus_le_iff: "(- a \<le> b) = (- b \<le> (a::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   388
by (auto simp add: order_le_less minus_less_iff)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   389
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   390
lemma add_diff_eq: "a + (b - c) = (a + b) - (c::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   391
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   392
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   393
lemma diff_add_eq: "(a - b) + c = (a + c) - (b::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   394
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   395
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   396
lemma diff_eq_eq: "(a-b = c) = (a = c + (b::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   397
by (auto simp add: diff_minus add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   398
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   399
lemma eq_diff_eq: "(a = c-b) = (a + (b::'a::ab_group_add) = c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   400
by (auto simp add: diff_minus add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   401
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   402
lemma diff_diff_eq: "(a - b) - c = a - (b + (c::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   403
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   404
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   405
lemma diff_diff_eq2: "a - (b - c) = (a + c) - (b::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   406
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   407
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   408
lemma diff_add_cancel: "a - b + b = (a::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   409
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   410
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   411
lemma add_diff_cancel: "a + b - b = (a::'a::ab_group_add)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   412
by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   413
14754
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   414
text{*Further subtraction laws*}
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   415
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   416
lemma less_iff_diff_less_0: "(a < b) = (a - b < (0::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   417
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   418
  have  "(a < b) = (a + (- b) < b + (-b))"  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   419
    by (simp only: add_less_cancel_right)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   420
  also have "... =  (a - b < 0)" by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   421
  finally show ?thesis .
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   422
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   423
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   424
lemma diff_less_eq: "(a-b < c) = (a < c + (b::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   425
apply (subst less_iff_diff_less_0)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   426
apply (rule less_iff_diff_less_0 [of _ c, THEN ssubst])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   427
apply (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   428
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   429
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   430
lemma less_diff_eq: "(a < c-b) = (a + (b::'a::pordered_ab_group_add) < c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   431
apply (subst less_iff_diff_less_0)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   432
apply (rule less_iff_diff_less_0 [of _ "c-b", THEN ssubst])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   433
apply (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   434
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   435
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   436
lemma diff_le_eq: "(a-b \<le> c) = (a \<le> c + (b::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   437
by (auto simp add: order_le_less diff_less_eq diff_add_cancel add_diff_cancel)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   438
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   439
lemma le_diff_eq: "(a \<le> c-b) = (a + (b::'a::pordered_ab_group_add) \<le> c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   440
by (auto simp add: order_le_less less_diff_eq diff_add_cancel add_diff_cancel)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   441
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   442
text{*This list of rewrites simplifies (in)equalities by bringing subtractions
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   443
  to the top and then moving negative terms to the other side.
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   444
  Use with @{text add_ac}*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   445
lemmas compare_rls =
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   446
       diff_minus [symmetric]
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   447
       add_diff_eq diff_add_eq diff_diff_eq diff_diff_eq2
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   448
       diff_less_eq less_diff_eq diff_le_eq le_diff_eq
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   449
       diff_eq_eq eq_diff_eq
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   450
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   451
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   452
subsection{*Lemmas for the @{text cancel_numerals} simproc*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   453
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   454
lemma eq_iff_diff_eq_0: "(a = b) = (a-b = (0::'a::ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   455
by (simp add: compare_rls)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   456
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   457
lemma le_iff_diff_le_0: "(a \<le> b) = (a-b \<le> (0::'a::pordered_ab_group_add))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   458
by (simp add: compare_rls)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   459
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   460
subsection {* Lattice Ordered (Abelian) Groups *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   461
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   462
axclass lordered_ab_group_meet < pordered_ab_group_add, meet_semilorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   463
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   464
axclass lordered_ab_group_join < pordered_ab_group_add, join_semilorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   465
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   466
lemma add_meet_distrib_left: "a + (meet b c) = meet (a + b) (a + (c::'a::{pordered_ab_group_add, meet_semilorder}))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   467
apply (rule order_antisym)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   468
apply (rule meet_imp_le, simp_all add: meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   469
apply (rule add_le_imp_le_left [of "-a"])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   470
apply (simp only: add_assoc[symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   471
apply (rule meet_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   472
apply (rule add_le_imp_le_left[of "a"], simp only: add_assoc[symmetric], simp add: meet_join_le)+
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   473
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   474
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   475
lemma add_join_distrib_left: "a + (join b c) = join (a + b) (a+ (c::'a::{pordered_ab_group_add, join_semilorder}))" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   476
apply (rule order_antisym)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   477
apply (rule add_le_imp_le_left [of "-a"])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   478
apply (simp only: add_assoc[symmetric], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   479
apply (rule join_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   480
apply (rule add_le_imp_le_left [of "a"], simp only: add_assoc[symmetric], simp add: meet_join_le)+
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   481
apply (rule join_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   482
apply (simp_all add: meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   483
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   484
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   485
lemma is_join_neg_meet: "is_join (% (a::'a::{pordered_ab_group_add, meet_semilorder}) b. - (meet (-a) (-b)))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   486
apply (auto simp add: is_join_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   487
apply (rule_tac c="meet (-a) (-b)" in add_le_imp_le_right, simp, simp add: add_meet_distrib_left meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   488
apply (rule_tac c="meet (-a) (-b)" in add_le_imp_le_right, simp, simp add: add_meet_distrib_left meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   489
apply (subst neg_le_iff_le[symmetric]) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   490
apply (simp add: meet_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   491
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   492
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   493
lemma is_meet_neg_join: "is_meet (% (a::'a::{pordered_ab_group_add, join_semilorder}) b. - (join (-a) (-b)))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   494
apply (auto simp add: is_meet_def)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   495
apply (rule_tac c="join (-a) (-b)" in add_le_imp_le_right, simp, simp add: add_join_distrib_left meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   496
apply (rule_tac c="join (-a) (-b)" in add_le_imp_le_right, simp, simp add: add_join_distrib_left meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   497
apply (subst neg_le_iff_le[symmetric]) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   498
apply (simp add: join_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   499
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   500
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   501
axclass lordered_ab_group \<subseteq> pordered_ab_group_add, lorder
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   502
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   503
instance lordered_ab_group_meet \<subseteq> lordered_ab_group
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   504
proof 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   505
  show "? j. is_join (j::'a\<Rightarrow>'a\<Rightarrow>('a::lordered_ab_group_meet))" by (blast intro: is_join_neg_meet)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   506
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   507
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   508
instance lordered_ab_group_join \<subseteq> lordered_ab_group
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   509
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   510
  show "? m. is_meet (m::'a\<Rightarrow>'a\<Rightarrow>('a::lordered_ab_group_join))" by (blast intro: is_meet_neg_join)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   511
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   512
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   513
lemma add_join_distrib_right: "(join a b) + (c::'a::lordered_ab_group) = join (a+c) (b+c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   514
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   515
  have "c + (join a b) = join (c+a) (c+b)" by (simp add: add_join_distrib_left)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   516
  thus ?thesis by (simp add: add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   517
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   518
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   519
lemma add_meet_distrib_right: "(meet a b) + (c::'a::lordered_ab_group) = meet (a+c) (b+c)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   520
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   521
  have "c + (meet a b) = meet (c+a) (c+b)" by (simp add: add_meet_distrib_left)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   522
  thus ?thesis by (simp add: add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   523
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   524
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   525
lemmas add_meet_join_distribs = add_meet_distrib_right add_meet_distrib_left add_join_distrib_right add_join_distrib_left
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   526
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   527
lemma join_eq_neg_meet: "join a (b::'a::lordered_ab_group) = - meet (-a) (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   528
by (simp add: is_join_unique[OF is_join_join is_join_neg_meet])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   529
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   530
lemma meet_eq_neg_join: "meet a (b::'a::lordered_ab_group) = - join (-a) (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   531
by (simp add: is_meet_unique[OF is_meet_meet is_meet_neg_join])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   532
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   533
lemma add_eq_meet_join: "a + b = (join a b) + (meet a (b::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   534
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   535
  have "0 = - meet 0 (a-b) + meet (a-b) 0" by (simp add: meet_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   536
  hence "0 = join 0 (b-a) + meet (a-b) 0" by (simp add: meet_eq_neg_join)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   537
  hence "0 = (-a + join a b) + (meet a b + (-b))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   538
    apply (simp add: add_join_distrib_left add_meet_distrib_right)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   539
    by (simp add: diff_minus add_commute)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   540
  thus ?thesis
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   541
    apply (simp add: compare_rls)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   542
    apply (subst add_left_cancel[symmetric, of "a+b" "join a b + meet a b" "-a"])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   543
    apply (simp only: add_assoc, simp add: add_assoc[symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   544
    done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   545
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   546
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   547
subsection {* Positive Part, Negative Part, Absolute Value *}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   548
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   549
constdefs
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   550
  pprt :: "'a \<Rightarrow> ('a::lordered_ab_group)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   551
  "pprt x == join x 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   552
  nprt :: "'a \<Rightarrow> ('a::lordered_ab_group)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   553
  "nprt x == meet x 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   554
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   555
lemma prts: "a = pprt a + nprt a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   556
by (simp add: pprt_def nprt_def add_eq_meet_join[symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   557
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   558
lemma zero_le_pprt[simp]: "0 \<le> pprt a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   559
by (simp add: pprt_def meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   560
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   561
lemma nprt_le_zero[simp]: "nprt a \<le> 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   562
by (simp add: nprt_def meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   563
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   564
lemma le_eq_neg: "(a \<le> -b) = (a + b \<le> (0::_::lordered_ab_group))" (is "?l = ?r")
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   565
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   566
  have a: "?l \<longrightarrow> ?r"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   567
    apply (auto)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   568
    apply (rule add_le_imp_le_right[of _ "-b" _])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   569
    apply (simp add: add_assoc)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   570
    done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   571
  have b: "?r \<longrightarrow> ?l"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   572
    apply (auto)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   573
    apply (rule add_le_imp_le_right[of _ "b" _])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   574
    apply (simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   575
    done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   576
  from a b show ?thesis by blast
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   577
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   578
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   579
lemma join_0_imp_0: "join a (-a) = 0 \<Longrightarrow> a = (0::'a::lordered_ab_group)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   580
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   581
  {
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   582
    fix a::'a
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   583
    assume hyp: "join a (-a) = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   584
    hence "join a (-a) + a = a" by (simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   585
    hence "join (a+a) 0 = a" by (simp add: add_join_distrib_right) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   586
    hence "join (a+a) 0 <= a" by (simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   587
    hence "0 <= a" by (blast intro: order_trans meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   588
  }
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   589
  note p = this
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   590
  assume hyp:"join a (-a) = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   591
  hence hyp2:"join (-a) (-(-a)) = 0" by (simp add: join_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   592
  from p[OF hyp] p[OF hyp2] show "a = 0" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   593
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   594
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   595
lemma meet_0_imp_0: "meet a (-a) = 0 \<Longrightarrow> a = (0::'a::lordered_ab_group)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   596
apply (simp add: meet_eq_neg_join)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   597
apply (simp add: join_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   598
apply (subst join_0_imp_0)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   599
by auto
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   600
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   601
lemma join_0_eq_0[simp]: "(join a (-a) = 0) = (a = (0::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   602
by (auto, erule join_0_imp_0)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   603
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   604
lemma meet_0_eq_0[simp]: "(meet a (-a) = 0) = (a = (0::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   605
by (auto, erule meet_0_imp_0)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   606
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   607
lemma zero_le_double_add_iff_zero_le_single_add[simp]: "(0 \<le> a + a) = (0 \<le> (a::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   608
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   609
  assume "0 <= a + a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   610
  hence a:"meet (a+a) 0 = 0" by (simp add: le_def_meet meet_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   611
  have "(meet a 0)+(meet a 0) = meet (meet (a+a) 0) a" (is "?l=_") by (simp add: add_meet_join_distribs meet_aci)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   612
  hence "?l = 0 + meet a 0" by (simp add: a, simp add: meet_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   613
  hence "meet a 0 = 0" by (simp only: add_right_cancel)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   614
  then show "0 <= a" by (simp add: le_def_meet meet_comm)    
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   615
next  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   616
  assume a: "0 <= a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   617
  show "0 <= a + a" by (simp add: add_mono[OF a a, simplified])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   618
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   619
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   620
lemma double_add_le_zero_iff_single_add_le_zero[simp]: "(a + a <= 0) = ((a::'a::lordered_ab_group) <= 0)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   621
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   622
  have "(a + a <= 0) = (0 <= -(a+a))" by (subst le_minus_iff, simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   623
  moreover have "\<dots> = (a <= 0)" by (simp add: zero_le_double_add_iff_zero_le_single_add)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   624
  ultimately show ?thesis by blast
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   625
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   626
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   627
lemma double_add_less_zero_iff_single_less_zero[simp]: "(a+a<0) = ((a::'a::{pordered_ab_group_add,linorder}) < 0)" (is ?s)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   628
proof cases
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   629
  assume a: "a < 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   630
  thus ?s by (simp add:  add_strict_mono[OF a a, simplified])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   631
next
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   632
  assume "~(a < 0)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   633
  hence a:"0 <= a" by (simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   634
  hence "0 <= a+a" by (simp add: add_mono[OF a a, simplified])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   635
  hence "~(a+a < 0)" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   636
  with a show ?thesis by simp 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   637
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   638
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   639
axclass lordered_ab_group_abs \<subseteq> lordered_ab_group
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   640
  abs_lattice: "abs x = join x (-x)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   641
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   642
lemma abs_zero[simp]: "abs 0 = (0::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   643
by (simp add: abs_lattice)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   644
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   645
lemma abs_eq_0[simp]: "(abs a = 0) = (a = (0::'a::lordered_ab_group_abs))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   646
by (simp add: abs_lattice)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   647
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   648
lemma abs_0_eq[simp]: "(0 = abs a) = (a = (0::'a::lordered_ab_group_abs))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   649
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   650
  have "(0 = abs a) = (abs a = 0)" by (simp only: eq_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   651
  thus ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   652
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   653
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   654
lemma neg_meet_eq_join[simp]: "- meet a (b::_::lordered_ab_group) = join (-a) (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   655
by (simp add: meet_eq_neg_join)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   656
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   657
lemma neg_join_eq_meet[simp]: "- join a (b::_::lordered_ab_group) = meet (-a) (-b)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   658
by (simp del: neg_meet_eq_join add: join_eq_neg_meet)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   659
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   660
lemma join_eq_if: "join a (-a) = (if a < 0 then -a else (a::'a::{lordered_ab_group, linorder}))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   661
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   662
  note b = add_le_cancel_right[of a a "-a",symmetric,simplified]
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   663
  have c: "a + a = 0 \<Longrightarrow> -a = a" by (rule add_right_imp_eq[of _ a], simp)
15197
19e735596e51 Added antisymmetry simproc
nipkow
parents: 15178
diff changeset
   664
  show ?thesis by (auto simp add: join_max max_def b linorder_not_less)
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   665
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   666
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   667
lemma abs_if_lattice: "\<bar>a\<bar> = (if a < 0 then -a else (a::'a::{lordered_ab_group_abs, linorder}))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   668
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   669
  show ?thesis by (simp add: abs_lattice join_eq_if)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   670
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   671
15229
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   672
lemma abs_eq [simp]:
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   673
  fixes a :: "'a::{lordered_ab_group_abs, linorder}"
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   674
  shows  "0 \<le> a ==> abs a = a"
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   675
by (simp add: abs_if_lattice linorder_not_less [symmetric]) 
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   676
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   677
lemma abs_minus_eq [simp]: 
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   678
  fixes a :: "'a::{lordered_ab_group_abs, linorder}"
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   679
  shows "a < 0 ==> abs a = -a"
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   680
by (simp add: abs_if_lattice linorder_not_less [symmetric])
1eb23f805c06 new simprules for abs and for things like a/b<1
paulson
parents: 15197
diff changeset
   681
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   682
lemma abs_ge_zero[simp]: "0 \<le> abs (a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   683
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   684
  have a:"a <= abs a" and b:"-a <= abs a" by (auto simp add: abs_lattice meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   685
  show ?thesis by (rule add_mono[OF a b, simplified])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   686
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   687
  
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   688
lemma abs_le_zero_iff [simp]: "(abs a \<le> (0::'a::lordered_ab_group_abs)) = (a = 0)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   689
proof
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   690
  assume "abs a <= 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   691
  hence "abs a = 0" by (auto dest: order_antisym)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   692
  thus "a = 0" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   693
next
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   694
  assume "a = 0"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   695
  thus "abs a <= 0" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   696
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   697
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   698
lemma zero_less_abs_iff [simp]: "(0 < abs a) = (a \<noteq> (0::'a::lordered_ab_group_abs))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   699
by (simp add: order_less_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   700
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   701
lemma abs_not_less_zero [simp]: "~ abs a < (0::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   702
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   703
  have a:"!! x (y::_::order). x <= y \<Longrightarrow> ~(y < x)" by auto
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   704
  show ?thesis by (simp add: a)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   705
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   706
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   707
lemma abs_ge_self: "a \<le> abs (a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   708
by (simp add: abs_lattice meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   709
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   710
lemma abs_ge_minus_self: "-a \<le> abs (a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   711
by (simp add: abs_lattice meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   712
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   713
lemma le_imp_join_eq: "a \<le> b \<Longrightarrow> join a b = b" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   714
by (simp add: le_def_join)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   715
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   716
lemma ge_imp_join_eq: "b \<le> a \<Longrightarrow> join a b = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   717
by (simp add: le_def_join join_aci)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   718
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   719
lemma le_imp_meet_eq: "a \<le> b \<Longrightarrow> meet a b = a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   720
by (simp add: le_def_meet)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   721
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   722
lemma ge_imp_meet_eq: "b \<le> a \<Longrightarrow> meet a b = b"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   723
by (simp add: le_def_meet meet_aci)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   724
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   725
lemma abs_prts: "abs (a::_::lordered_ab_group_abs) = pprt a - nprt a"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   726
apply (simp add: pprt_def nprt_def diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   727
apply (simp add: add_meet_join_distribs join_aci abs_lattice[symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   728
apply (subst le_imp_join_eq, auto)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   729
done
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   730
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   731
lemma abs_minus_cancel [simp]: "abs (-a) = abs(a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   732
by (simp add: abs_lattice join_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   733
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   734
lemma abs_idempotent [simp]: "abs (abs a) = abs (a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   735
apply (simp add: abs_lattice[of "abs a"])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   736
apply (subst ge_imp_join_eq)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   737
apply (rule order_trans[of _ 0])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   738
by auto
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   739
15093
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   740
lemma abs_minus_commute: 
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   741
  fixes a :: "'a::lordered_ab_group_abs"
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   742
  shows "abs (a-b) = abs(b-a)"
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   743
proof -
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   744
  have "abs (a-b) = abs (- (a-b))" by (simp only: abs_minus_cancel)
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   745
  also have "... = abs(b-a)" by simp
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   746
  finally show ?thesis .
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   747
qed
49ede01e9ee6 conversion of Integration and NSPrimes to Isar scripts
paulson
parents: 15010
diff changeset
   748
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   749
lemma zero_le_iff_zero_nprt: "(0 \<le> a) = (nprt a = 0)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   750
by (simp add: le_def_meet nprt_def meet_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   751
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   752
lemma le_zero_iff_zero_pprt: "(a \<le> 0) = (pprt a = 0)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   753
by (simp add: le_def_join pprt_def join_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   754
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   755
lemma le_zero_iff_pprt_id: "(0 \<le> a) = (pprt a = a)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   756
by (simp add: le_def_join pprt_def join_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   757
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   758
lemma zero_le_iff_nprt_id: "(a \<le> 0) = (nprt a = a)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   759
by (simp add: le_def_meet nprt_def meet_comm)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   760
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   761
lemma iff2imp: "(A=B) \<Longrightarrow> (A \<Longrightarrow> B)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   762
by (simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   763
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   764
lemma imp_abs_id: "0 \<le> a \<Longrightarrow> abs a = (a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   765
by (simp add: iff2imp[OF zero_le_iff_zero_nprt] iff2imp[OF le_zero_iff_pprt_id] abs_prts)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   766
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   767
lemma imp_abs_neg_id: "a \<le> 0 \<Longrightarrow> abs a = -(a::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   768
by (simp add: iff2imp[OF le_zero_iff_zero_pprt] iff2imp[OF zero_le_iff_nprt_id] abs_prts)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   769
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   770
lemma abs_leI: "[|a \<le> b; -a \<le> b|] ==> abs a \<le> (b::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   771
by (simp add: abs_lattice join_imp_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   772
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   773
lemma le_minus_self_iff: "(a \<le> -a) = (a \<le> (0::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   774
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   775
  from add_le_cancel_left[of "-a" "a+a" "0"] have "(a <= -a) = (a+a <= 0)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   776
    by (simp add: add_assoc[symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   777
  thus ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   778
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   779
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   780
lemma minus_le_self_iff: "(-a \<le> a) = (0 \<le> (a::'a::lordered_ab_group))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   781
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   782
  from add_le_cancel_left[of "-a" "0" "a+a"] have "(-a <= a) = (0 <= a+a)" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   783
    by (simp add: add_assoc[symmetric])
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   784
  thus ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   785
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   786
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   787
lemma abs_le_D1: "abs a \<le> b ==> a \<le> (b::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   788
by (insert abs_ge_self, blast intro: order_trans)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   789
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   790
lemma abs_le_D2: "abs a \<le> b ==> -a \<le> (b::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   791
by (insert abs_le_D1 [of "-a"], simp)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   792
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   793
lemma abs_le_iff: "(abs a \<le> b) = (a \<le> b & -a \<le> (b::'a::lordered_ab_group_abs))"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   794
by (blast intro: abs_leI dest: abs_le_D1 abs_le_D2)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   795
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   796
lemma abs_triangle_ineq: "abs (a+b) \<le> abs a + abs (b::'a::lordered_ab_group_abs)"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   797
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   798
  have g:"abs a + abs b = join (a+b) (join (-a-b) (join (-a+b) (a + (-b))))" (is "_=join ?m ?n")
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   799
    apply (simp add: abs_lattice add_meet_join_distribs join_aci)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   800
    by (simp only: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   801
  have a:"a+b <= join ?m ?n" by (simp add: meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   802
  have b:"-a-b <= ?n" by (simp add: meet_join_le) 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   803
  have c:"?n <= join ?m ?n" by (simp add: meet_join_le)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   804
  from b c have d: "-a-b <= join ?m ?n" by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   805
  have e:"-a-b = -(a+b)" by (simp add: diff_minus)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   806
  from a d e have "abs(a+b) <= join ?m ?n" 
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   807
    by (drule_tac abs_leI, auto)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   808
  with g[symmetric] show ?thesis by simp
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   809
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   810
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   811
lemma abs_diff_triangle_ineq:
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   812
     "\<bar>(a::'a::lordered_ab_group_abs) + b - (c+d)\<bar> \<le> \<bar>a-c\<bar> + \<bar>b-d\<bar>"
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   813
proof -
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   814
  have "\<bar>a + b - (c+d)\<bar> = \<bar>(a-c) + (b-d)\<bar>" by (simp add: diff_minus add_ac)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   815
  also have "... \<le> \<bar>a-c\<bar> + \<bar>b-d\<bar>" by (rule abs_triangle_ineq)
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   816
  finally show ?thesis .
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   817
qed
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   818
14754
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   819
text {* Needed for abelian cancellation simprocs: *}
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   820
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   821
lemma add_cancel_21: "((x::'a::ab_group_add) + (y + z) = y + u) = (x + z = u)"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   822
apply (subst add_left_commute)
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   823
apply (subst add_left_cancel)
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   824
apply simp
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   825
done
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   826
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   827
lemma add_cancel_end: "(x + (y + z) = y) = (x = - (z::'a::ab_group_add))"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   828
apply (subst add_cancel_21[of _ _ _ 0, simplified])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   829
apply (simp add: add_right_cancel[symmetric, of "x" "-z" "z", simplified])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   830
done
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   831
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   832
lemma less_eqI: "(x::'a::pordered_ab_group_add) - y = x' - y' \<Longrightarrow> (x < y) = (x' < y')"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   833
by (simp add: less_iff_diff_less_0[of x y] less_iff_diff_less_0[of x' y'])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   834
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   835
lemma le_eqI: "(x::'a::pordered_ab_group_add) - y = x' - y' \<Longrightarrow> (y <= x) = (y' <= x')"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   836
apply (simp add: le_iff_diff_le_0[of y x] le_iff_diff_le_0[of  y' x'])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   837
apply (simp add: neg_le_iff_le[symmetric, of "y-x" 0] neg_le_iff_le[symmetric, of "y'-x'" 0])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   838
done
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   839
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   840
lemma eq_eqI: "(x::'a::ab_group_add) - y = x' - y' \<Longrightarrow> (x = y) = (x' = y')"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   841
by (simp add: eq_iff_diff_eq_0[of x y] eq_iff_diff_eq_0[of x' y'])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   842
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   843
lemma diff_def: "(x::'a::ab_group_add) - y == x + (-y)"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   844
by (simp add: diff_minus)
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   845
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   846
lemma add_minus_cancel: "(a::'a::ab_group_add) + (-a + b) = b"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   847
by (simp add: add_assoc[symmetric])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   848
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   849
lemma minus_add_cancel: "-(a::'a::ab_group_add) + (a + b) = b"
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   850
by (simp add: add_assoc[symmetric])
a080eeeaec14 Modification / Installation of Provers/Arith/abel_cancel.ML for OrderedGroup.thy
obua
parents: 14738
diff changeset
   851
15178
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   852
lemma  le_add_right_mono: 
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   853
  assumes 
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   854
  "a <= b + (c::'a::pordered_ab_group_add)"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   855
  "c <= d"    
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   856
  shows "a <= b + d"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   857
  apply (rule_tac order_trans[where y = "b+c"])
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   858
  apply (simp_all add: prems)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   859
  done
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   860
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   861
lemmas group_eq_simps =
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   862
  mult_ac
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   863
  add_ac
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   864
  add_diff_eq diff_add_eq diff_diff_eq diff_diff_eq2
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   865
  diff_eq_eq eq_diff_eq
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   866
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   867
lemma estimate_by_abs:
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   868
"a + b <= (c::'a::lordered_ab_group_abs) \<Longrightarrow> a <= c + abs b" 
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   869
proof -
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   870
  assume 1: "a+b <= c"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   871
  have 2: "a <= c+(-b)"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   872
    apply (insert 1)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   873
    apply (drule_tac add_right_mono[where c="-b"])
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   874
    apply (simp add: group_eq_simps)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   875
    done
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   876
  have 3: "(-b) <= abs b" by (rule abs_ge_minus_self)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   877
  show ?thesis by (rule le_add_right_mono[OF 2 3])
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   878
qed
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   879
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   880
lemma abs_of_ge_0: "0 <= (y::'a::lordered_ab_group_abs) \<Longrightarrow> abs y = y"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   881
proof -
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   882
  assume 1:"0 <= y"
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   883
  have 2:"-y <= 0" by (simp add: 1)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   884
  from 1 2 have 3:"-y <= y" by (simp only:)
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   885
  show ?thesis by (simp add: abs_lattice ge_imp_join_eq[OF 3])
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   886
qed
5f621aa35c25 Matrix theory, linear programming
obua
parents: 15140
diff changeset
   887
14738
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   888
ML {*
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   889
val add_zero_left = thm"add_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   890
val add_zero_right = thm"add_0_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   891
*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   892
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   893
ML {*
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   894
val add_assoc = thm "add_assoc";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   895
val add_commute = thm "add_commute";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   896
val add_left_commute = thm "add_left_commute";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   897
val add_ac = thms "add_ac";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   898
val mult_assoc = thm "mult_assoc";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   899
val mult_commute = thm "mult_commute";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   900
val mult_left_commute = thm "mult_left_commute";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   901
val mult_ac = thms "mult_ac";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   902
val add_0 = thm "add_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   903
val mult_1_left = thm "mult_1_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   904
val mult_1_right = thm "mult_1_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   905
val mult_1 = thm "mult_1";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   906
val add_left_imp_eq = thm "add_left_imp_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   907
val add_right_imp_eq = thm "add_right_imp_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   908
val add_imp_eq = thm "add_imp_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   909
val left_minus = thm "left_minus";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   910
val diff_minus = thm "diff_minus";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   911
val add_0_right = thm "add_0_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   912
val add_left_cancel = thm "add_left_cancel";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   913
val add_right_cancel = thm "add_right_cancel";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   914
val right_minus = thm "right_minus";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   915
val right_minus_eq = thm "right_minus_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   916
val minus_minus = thm "minus_minus";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   917
val equals_zero_I = thm "equals_zero_I";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   918
val minus_zero = thm "minus_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   919
val diff_self = thm "diff_self";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   920
val diff_0 = thm "diff_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   921
val diff_0_right = thm "diff_0_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   922
val diff_minus_eq_add = thm "diff_minus_eq_add";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   923
val neg_equal_iff_equal = thm "neg_equal_iff_equal";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   924
val neg_equal_0_iff_equal = thm "neg_equal_0_iff_equal";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   925
val neg_0_equal_iff_equal = thm "neg_0_equal_iff_equal";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   926
val equation_minus_iff = thm "equation_minus_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   927
val minus_equation_iff = thm "minus_equation_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   928
val minus_add_distrib = thm "minus_add_distrib";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   929
val minus_diff_eq = thm "minus_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   930
val add_left_mono = thm "add_left_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   931
val add_le_imp_le_left = thm "add_le_imp_le_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   932
val add_right_mono = thm "add_right_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   933
val add_mono = thm "add_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   934
val add_strict_left_mono = thm "add_strict_left_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   935
val add_strict_right_mono = thm "add_strict_right_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   936
val add_strict_mono = thm "add_strict_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   937
val add_less_le_mono = thm "add_less_le_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   938
val add_le_less_mono = thm "add_le_less_mono";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   939
val add_less_imp_less_left = thm "add_less_imp_less_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   940
val add_less_imp_less_right = thm "add_less_imp_less_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   941
val add_less_cancel_left = thm "add_less_cancel_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   942
val add_less_cancel_right = thm "add_less_cancel_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   943
val add_le_cancel_left = thm "add_le_cancel_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   944
val add_le_cancel_right = thm "add_le_cancel_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   945
val add_le_imp_le_right = thm "add_le_imp_le_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   946
val add_increasing = thm "add_increasing";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   947
val le_imp_neg_le = thm "le_imp_neg_le";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   948
val neg_le_iff_le = thm "neg_le_iff_le";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   949
val neg_le_0_iff_le = thm "neg_le_0_iff_le";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   950
val neg_0_le_iff_le = thm "neg_0_le_iff_le";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   951
val neg_less_iff_less = thm "neg_less_iff_less";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   952
val neg_less_0_iff_less = thm "neg_less_0_iff_less";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   953
val neg_0_less_iff_less = thm "neg_0_less_iff_less";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   954
val less_minus_iff = thm "less_minus_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   955
val minus_less_iff = thm "minus_less_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   956
val le_minus_iff = thm "le_minus_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   957
val minus_le_iff = thm "minus_le_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   958
val add_diff_eq = thm "add_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   959
val diff_add_eq = thm "diff_add_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   960
val diff_eq_eq = thm "diff_eq_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   961
val eq_diff_eq = thm "eq_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   962
val diff_diff_eq = thm "diff_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   963
val diff_diff_eq2 = thm "diff_diff_eq2";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   964
val diff_add_cancel = thm "diff_add_cancel";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   965
val add_diff_cancel = thm "add_diff_cancel";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   966
val less_iff_diff_less_0 = thm "less_iff_diff_less_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   967
val diff_less_eq = thm "diff_less_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   968
val less_diff_eq = thm "less_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   969
val diff_le_eq = thm "diff_le_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   970
val le_diff_eq = thm "le_diff_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   971
val compare_rls = thms "compare_rls";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   972
val eq_iff_diff_eq_0 = thm "eq_iff_diff_eq_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   973
val le_iff_diff_le_0 = thm "le_iff_diff_le_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   974
val add_meet_distrib_left = thm "add_meet_distrib_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   975
val add_join_distrib_left = thm "add_join_distrib_left";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   976
val is_join_neg_meet = thm "is_join_neg_meet";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   977
val is_meet_neg_join = thm "is_meet_neg_join";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   978
val add_join_distrib_right = thm "add_join_distrib_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   979
val add_meet_distrib_right = thm "add_meet_distrib_right";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   980
val add_meet_join_distribs = thms "add_meet_join_distribs";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   981
val join_eq_neg_meet = thm "join_eq_neg_meet";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   982
val meet_eq_neg_join = thm "meet_eq_neg_join";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   983
val add_eq_meet_join = thm "add_eq_meet_join";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   984
val prts = thm "prts";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   985
val zero_le_pprt = thm "zero_le_pprt";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   986
val nprt_le_zero = thm "nprt_le_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   987
val le_eq_neg = thm "le_eq_neg";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   988
val join_0_imp_0 = thm "join_0_imp_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   989
val meet_0_imp_0 = thm "meet_0_imp_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   990
val join_0_eq_0 = thm "join_0_eq_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   991
val meet_0_eq_0 = thm "meet_0_eq_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   992
val zero_le_double_add_iff_zero_le_single_add = thm "zero_le_double_add_iff_zero_le_single_add";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   993
val double_add_le_zero_iff_single_add_le_zero = thm "double_add_le_zero_iff_single_add_le_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   994
val double_add_less_zero_iff_single_less_zero = thm "double_add_less_zero_iff_single_less_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   995
val abs_lattice = thm "abs_lattice";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   996
val abs_zero = thm "abs_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   997
val abs_eq_0 = thm "abs_eq_0";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   998
val abs_0_eq = thm "abs_0_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
   999
val neg_meet_eq_join = thm "neg_meet_eq_join";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1000
val neg_join_eq_meet = thm "neg_join_eq_meet";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1001
val join_eq_if = thm "join_eq_if";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1002
val abs_if_lattice = thm "abs_if_lattice";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1003
val abs_ge_zero = thm "abs_ge_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1004
val abs_le_zero_iff = thm "abs_le_zero_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1005
val zero_less_abs_iff = thm "zero_less_abs_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1006
val abs_not_less_zero = thm "abs_not_less_zero";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1007
val abs_ge_self = thm "abs_ge_self";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1008
val abs_ge_minus_self = thm "abs_ge_minus_self";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1009
val le_imp_join_eq = thm "le_imp_join_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1010
val ge_imp_join_eq = thm "ge_imp_join_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1011
val le_imp_meet_eq = thm "le_imp_meet_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1012
val ge_imp_meet_eq = thm "ge_imp_meet_eq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1013
val abs_prts = thm "abs_prts";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1014
val abs_minus_cancel = thm "abs_minus_cancel";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1015
val abs_idempotent = thm "abs_idempotent";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1016
val zero_le_iff_zero_nprt = thm "zero_le_iff_zero_nprt";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1017
val le_zero_iff_zero_pprt = thm "le_zero_iff_zero_pprt";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1018
val le_zero_iff_pprt_id = thm "le_zero_iff_pprt_id";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1019
val zero_le_iff_nprt_id = thm "zero_le_iff_nprt_id";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1020
val iff2imp = thm "iff2imp";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1021
val imp_abs_id = thm "imp_abs_id";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1022
val imp_abs_neg_id = thm "imp_abs_neg_id";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1023
val abs_leI = thm "abs_leI";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1024
val le_minus_self_iff = thm "le_minus_self_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1025
val minus_le_self_iff = thm "minus_le_self_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1026
val abs_le_D1 = thm "abs_le_D1";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1027
val abs_le_D2 = thm "abs_le_D2";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1028
val abs_le_iff = thm "abs_le_iff";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1029
val abs_triangle_ineq = thm "abs_triangle_ineq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1030
val abs_diff_triangle_ineq = thm "abs_diff_triangle_ineq";
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1031
*}
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1032
83f1a514dcb4 changes made due to new Ring_and_Field theory
obua
parents:
diff changeset
  1033
end