src/HOL/Presburger.thy
changeset 17589 58eeffd73be1
parent 17378 105519771c67
child 18202 46af82efd311
equal deleted inserted replaced
17588:f2bd501398ee 17589:58eeffd73be1
   242   by blast
   242   by blast
   243 
   243 
   244 text {* Theorems to be deleted from simpset when proving simplified formulaes. *}
   244 text {* Theorems to be deleted from simpset when proving simplified formulaes. *}
   245 
   245 
   246 lemma P_eqtrue: "(P=True) = P"
   246 lemma P_eqtrue: "(P=True) = P"
   247   by rules
   247   by iprover
   248 
   248 
   249 lemma P_eqfalse: "(P=False) = (~P)"
   249 lemma P_eqfalse: "(P=False) = (~P)"
   250   by rules
   250   by iprover
   251 
   251 
   252 text {*
   252 text {*
   253   \medskip Theorems for the generation of the bachwards direction of
   253   \medskip Theorems for the generation of the bachwards direction of
   254   Cooper's Theorem.
   254   Cooper's Theorem.
   255 
   255 
   829 
   829 
   830 lemma qe_exI2: "A = B ==> (EX (x::int). A(x)) = (EX (x::int). B(x))"
   830 lemma qe_exI2: "A = B ==> (EX (x::int). A(x)) = (EX (x::int). B(x))"
   831   by simp
   831   by simp
   832 
   832 
   833 lemma qe_exI: "(!!x::int. A x = B x) ==> (EX (x::int). A(x)) = (EX (x::int). B(x))"
   833 lemma qe_exI: "(!!x::int. A x = B x) ==> (EX (x::int). A(x)) = (EX (x::int). B(x))"
   834   by rules
   834   by iprover
   835 
   835 
   836 lemma qe_ALLI: "(!!x::int. A x = B x) ==> (ALL (x::int). A(x)) = (ALL (x::int). B(x))"
   836 lemma qe_ALLI: "(!!x::int. A x = B x) ==> (ALL (x::int). A(x)) = (ALL (x::int). B(x))"
   837   by rules
   837   by iprover
   838 
   838 
   839 lemma cp_expand: "(EX (x::int). P (x)) = (EX (j::int) : {1..d}. EX (b::int) : B. (P1 (j) | P(b+j)))
   839 lemma cp_expand: "(EX (x::int). P (x)) = (EX (j::int) : {1..d}. EX (b::int) : B. (P1 (j) | P(b+j)))
   840 ==>(EX (x::int). P (x)) = (EX (j::int) : {1..d}. EX (b::int) : B. (P1 (j) | P(b+j))) "
   840 ==>(EX (x::int). P (x)) = (EX (j::int) : {1..d}. EX (b::int) : B. (P1 (j) | P(b+j))) "
   841 by blast
   841 by blast
   842 
   842 
   950 
   950 
   951 theorem zdvd_int: "(x dvd y) = (int x dvd int y)"
   951 theorem zdvd_int: "(x dvd y) = (int x dvd int y)"
   952   apply (simp only: dvd_def ex_nat int_int_eq [symmetric] zmult_int [symmetric]
   952   apply (simp only: dvd_def ex_nat int_int_eq [symmetric] zmult_int [symmetric]
   953     nat_0_le cong add: conj_cong)
   953     nat_0_le cong add: conj_cong)
   954   apply (rule iffI)
   954   apply (rule iffI)
   955   apply rules
   955   apply iprover
   956   apply (erule exE)
   956   apply (erule exE)
   957   apply (case_tac "x=0")
   957   apply (case_tac "x=0")
   958   apply (rule_tac x=0 in exI)
   958   apply (rule_tac x=0 in exI)
   959   apply simp
   959   apply simp
   960   apply (case_tac "0 \<le> k")
   960   apply (case_tac "0 \<le> k")
   961   apply rules
   961   apply iprover
   962   apply (simp add: linorder_not_le)
   962   apply (simp add: linorder_not_le)
   963   apply (drule mult_strict_left_mono_neg [OF iffD2 [OF zero_less_int_conv]])
   963   apply (drule mult_strict_left_mono_neg [OF iffD2 [OF zero_less_int_conv]])
   964   apply assumption
   964   apply assumption
   965   apply (simp add: mult_ac)
   965   apply (simp add: mult_ac)
   966   done
   966   done