src/HOL/Presburger.thy
changeset 29667 53103fc8ffa3
parent 28967 3bdb1eae352c
child 29707 01cae7ad8576
     1.1 --- a/src/HOL/Presburger.thy	Sun Jan 18 13:58:17 2009 +0100
     1.2 +++ b/src/HOL/Presburger.thy	Wed Jan 28 16:29:16 2009 +0100
     1.3 @@ -59,7 +59,7 @@
     1.4    "(d::'a::{comm_ring,Ring_and_Field.dvd}) dvd D \<Longrightarrow> \<forall>x k. (d dvd x + t) = (d dvd (x - k*D) + t)"
     1.5    "(d::'a::{comm_ring,Ring_and_Field.dvd}) dvd D \<Longrightarrow> \<forall>x k. (\<not>d dvd x + t) = (\<not>d dvd (x - k*D) + t)"
     1.6    "\<forall>x k. F = F"
     1.7 -apply (auto elim!: dvdE simp add: ring_simps)
     1.8 +apply (auto elim!: dvdE simp add: algebra_simps)
     1.9  unfolding mult_assoc [symmetric] left_distrib [symmetric] left_diff_distrib [symmetric]
    1.10  unfolding dvd_def mult_commute [of d] 
    1.11  by auto
    1.12 @@ -101,7 +101,7 @@
    1.13    {fix x assume nob: "\<forall>j\<in>{1 .. D}. \<forall>b\<in>B. x \<noteq> b + j" and g: "x > t" and ng: "\<not> (x - D) > t"
    1.14      hence "x -t \<le> D" and "1 \<le> x - t" by simp+
    1.15        hence "\<exists>j \<in> {1 .. D}. x - t = j" by auto
    1.16 -      hence "\<exists>j \<in> {1 .. D}. x = t + j" by (simp add: ring_simps)
    1.17 +      hence "\<exists>j \<in> {1 .. D}. x = t + j" by (simp add: algebra_simps)
    1.18        with nob tB have "False" by simp}
    1.19    thus "\<forall>x.(\<forall>j\<in>{1 .. D}. \<forall>b\<in>B. x \<noteq> b + j)\<longrightarrow> (x > t) \<longrightarrow> (x - D > t)" by blast
    1.20  next
    1.21 @@ -109,7 +109,7 @@
    1.22    {fix x assume nob: "\<forall>j\<in>{1 .. D}. \<forall>b\<in>B. x \<noteq> b + j" and g: "x \<ge> t" and ng: "\<not> (x - D) \<ge> t"
    1.23      hence "x - (t - 1) \<le> D" and "1 \<le> x - (t - 1)" by simp+
    1.24        hence "\<exists>j \<in> {1 .. D}. x - (t - 1) = j" by auto
    1.25 -      hence "\<exists>j \<in> {1 .. D}. x = (t - 1) + j" by (simp add: ring_simps)
    1.26 +      hence "\<exists>j \<in> {1 .. D}. x = (t - 1) + j" by (simp add: algebra_simps)
    1.27        with nob tB have "False" by simp}
    1.28    thus "\<forall>x.(\<forall>j\<in>{1 .. D}. \<forall>b\<in>B. x \<noteq> b + j)\<longrightarrow> (x \<ge> t) \<longrightarrow> (x - D \<ge> t)" by blast
    1.29  next
    1.30 @@ -119,7 +119,7 @@
    1.31  next
    1.32    assume d: "d dvd D"
    1.33    {fix x assume H: "\<not>(d dvd x + t)" with d have "\<not> d dvd (x - D) + t"
    1.34 -      by (clarsimp simp add: dvd_def,erule_tac x= "ka + k" in allE,simp add: ring_simps)}
    1.35 +      by (clarsimp simp add: dvd_def,erule_tac x= "ka + k" in allE,simp add: algebra_simps)}
    1.36    thus "\<forall>(x::int).(\<forall>j\<in>{1 .. D}. \<forall>b\<in>B. x \<noteq> b + j)\<longrightarrow> (\<not>d dvd x+t) \<longrightarrow> (\<not>d dvd (x - D) + t)" by auto
    1.37  qed blast
    1.38  
    1.39 @@ -158,26 +158,26 @@
    1.40    {fix x assume nob: "\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j" and g: "x < t" and ng: "\<not> (x + D) < t"
    1.41      hence "t - x \<le> D" and "1 \<le> t - x" by simp+
    1.42        hence "\<exists>j \<in> {1 .. D}. t - x = j" by auto
    1.43 -      hence "\<exists>j \<in> {1 .. D}. x = t - j" by (auto simp add: ring_simps) 
    1.44 +      hence "\<exists>j \<in> {1 .. D}. x = t - j" by (auto simp add: algebra_simps) 
    1.45        with nob tA have "False" by simp}
    1.46    thus "\<forall>x.(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (x < t) \<longrightarrow> (x + D < t)" by blast
    1.47  next
    1.48    assume dp: "D > 0" and tA:"t + 1\<in> A"
    1.49    {fix x assume nob: "\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j" and g: "x \<le> t" and ng: "\<not> (x + D) \<le> t"
    1.50 -    hence "(t + 1) - x \<le> D" and "1 \<le> (t + 1) - x" by (simp_all add: ring_simps)
    1.51 +    hence "(t + 1) - x \<le> D" and "1 \<le> (t + 1) - x" by (simp_all add: algebra_simps)
    1.52        hence "\<exists>j \<in> {1 .. D}. (t + 1) - x = j" by auto
    1.53 -      hence "\<exists>j \<in> {1 .. D}. x = (t + 1) - j" by (auto simp add: ring_simps)
    1.54 +      hence "\<exists>j \<in> {1 .. D}. x = (t + 1) - j" by (auto simp add: algebra_simps)
    1.55        with nob tA have "False" by simp}
    1.56    thus "\<forall>x.(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (x \<le> t) \<longrightarrow> (x + D \<le> t)" by blast
    1.57  next
    1.58    assume d: "d dvd D"
    1.59    {fix x assume H: "d dvd x + t" with d have "d dvd (x + D) + t"
    1.60 -      by (clarsimp simp add: dvd_def,rule_tac x= "ka + k" in exI,simp add: ring_simps)}
    1.61 +      by (clarsimp simp add: dvd_def,rule_tac x= "ka + k" in exI,simp add: algebra_simps)}
    1.62    thus "\<forall>(x::int).(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (d dvd x+t) \<longrightarrow> (d dvd (x + D) + t)" by simp
    1.63  next
    1.64    assume d: "d dvd D"
    1.65    {fix x assume H: "\<not>(d dvd x + t)" with d have "\<not>d dvd (x + D) + t"
    1.66 -      by (clarsimp simp add: dvd_def,erule_tac x= "ka - k" in allE,simp add: ring_simps)}
    1.67 +      by (clarsimp simp add: dvd_def,erule_tac x= "ka - k" in allE,simp add: algebra_simps)}
    1.68    thus "\<forall>(x::int).(\<forall>j\<in>{1 .. D}. \<forall>b\<in>A. x \<noteq> b - j)\<longrightarrow> (\<not>d dvd x+t) \<longrightarrow> (\<not>d dvd (x + D) + t)" by auto
    1.69  qed blast
    1.70  
    1.71 @@ -304,7 +304,7 @@
    1.72    from ePeqP1 obtain z where P1eqP: "\<forall>x>z. P x = P' x" ..
    1.73    let ?w' = "x + (abs(x-z)+1) * d"
    1.74    let ?w = "x - (-(abs(x-z) + 1))*d"
    1.75 -  have ww'[simp]: "?w = ?w'" by (simp add: ring_simps)
    1.76 +  have ww'[simp]: "?w = ?w'" by (simp add: algebra_simps)
    1.77    from dpos have w: "?w > z" by(simp only: ww' incr_lemma)
    1.78    hence "P' x = P' ?w" using P1eqP1 by blast
    1.79    also have "\<dots> = P(?w)" using w P1eqP by blast