src/HOL/Decision_Procs/Cooper.thy
changeset 64246 15d1ee6e847b
parent 62342 1cf129590be8
child 65024 3cb801391353
equal deleted inserted replaced
64245:3d00821444fc 64246:15d1ee6e847b
  1733   then have ldcp: "0 < l div c"
  1733   then have ldcp: "0 < l div c"
  1734     by (simp add: div_self[OF cnz])
  1734     by (simp add: div_self[OF cnz])
  1735   have "c * (l div c) = c * (l div c) + l mod c"
  1735   have "c * (l div c) = c * (l div c) + l mod c"
  1736     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1736     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1737   then have cl: "c * (l div c) =l"
  1737   then have cl: "c * (l div c) =l"
  1738     using zmod_zdiv_equality[where a="l" and b="c", symmetric] by simp
  1738     using mult_div_mod_eq [where a="l" and b="c"] by simp
  1739   then have "(l * x + (l div c) * Inum (x # bs) e < 0) \<longleftrightarrow>
  1739   then have "(l * x + (l div c) * Inum (x # bs) e < 0) \<longleftrightarrow>
  1740       ((c * (l div c)) * x + (l div c) * Inum (x # bs) e < 0)"
  1740       ((c * (l div c)) * x + (l div c) * Inum (x # bs) e < 0)"
  1741     by simp
  1741     by simp
  1742   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) < (l div c) * 0"
  1742   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) < (l div c) * 0"
  1743     by (simp add: algebra_simps)
  1743     by (simp add: algebra_simps)
  1760   then have ldcp:"0 < l div c"
  1760   then have ldcp:"0 < l div c"
  1761     by (simp add: div_self[OF cnz])
  1761     by (simp add: div_self[OF cnz])
  1762   have "c * (l div c) = c * (l div c) + l mod c"
  1762   have "c * (l div c) = c * (l div c) + l mod c"
  1763     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1763     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1764   then have cl: "c * (l div c) = l"
  1764   then have cl: "c * (l div c) = l"
  1765     using zmod_zdiv_equality[where a="l" and b="c", symmetric] by simp
  1765     using mult_div_mod_eq [where a="l" and b="c"] by simp
  1766   then have "l * x + (l div c) * Inum (x # bs) e \<le> 0 \<longleftrightarrow>
  1766   then have "l * x + (l div c) * Inum (x # bs) e \<le> 0 \<longleftrightarrow>
  1767       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<le> 0"
  1767       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<le> 0"
  1768     by simp
  1768     by simp
  1769   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<le> (l div c) * 0"
  1769   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<le> (l div c) * 0"
  1770     by (simp add: algebra_simps)
  1770     by (simp add: algebra_simps)
  1785   then have ldcp: "0 < l div c"
  1785   then have ldcp: "0 < l div c"
  1786     by (simp add: div_self[OF cnz])
  1786     by (simp add: div_self[OF cnz])
  1787   have "c * (l div c) = c * (l div c) + l mod c"
  1787   have "c * (l div c) = c * (l div c) + l mod c"
  1788     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1788     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1789   then have cl: "c * (l div c) = l"
  1789   then have cl: "c * (l div c) = l"
  1790     using zmod_zdiv_equality[where a="l" and b="c", symmetric] by simp
  1790     using mult_div_mod_eq [where a="l" and b="c"] by simp
  1791   then have "l * x + (l div c) * Inum (x # bs) e > 0 \<longleftrightarrow>
  1791   then have "l * x + (l div c) * Inum (x # bs) e > 0 \<longleftrightarrow>
  1792       (c * (l div c)) * x + (l div c) * Inum (x # bs) e > 0"
  1792       (c * (l div c)) * x + (l div c) * Inum (x # bs) e > 0"
  1793     by simp
  1793     by simp
  1794   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) > (l div c) * 0"
  1794   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) > (l div c) * 0"
  1795     by (simp add: algebra_simps)
  1795     by (simp add: algebra_simps)
  1812   then have ldcp: "0 < l div c"
  1812   then have ldcp: "0 < l div c"
  1813     by (simp add: div_self[OF cnz])
  1813     by (simp add: div_self[OF cnz])
  1814   have "c * (l div c) = c * (l div c) + l mod c"
  1814   have "c * (l div c) = c * (l div c) + l mod c"
  1815     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1815     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1816   then have cl: "c * (l div c) =l"
  1816   then have cl: "c * (l div c) =l"
  1817     using zmod_zdiv_equality[where a="l" and b="c", symmetric]
  1817     using mult_div_mod_eq [where a="l" and b="c"]
  1818     by simp
  1818     by simp
  1819   then have "l * x + (l div c) * Inum (x # bs) e \<ge> 0 \<longleftrightarrow>
  1819   then have "l * x + (l div c) * Inum (x # bs) e \<ge> 0 \<longleftrightarrow>
  1820       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<ge> 0"
  1820       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<ge> 0"
  1821     by simp
  1821     by simp
  1822   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<ge> (l div c) * 0"
  1822   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<ge> (l div c) * 0"
  1839     by (simp add: zdiv_mono1[OF clel cp])
  1839     by (simp add: zdiv_mono1[OF clel cp])
  1840   then have ldcp:"0 < l div c"
  1840   then have ldcp:"0 < l div c"
  1841     by (simp add: div_self[OF cnz])
  1841     by (simp add: div_self[OF cnz])
  1842   have "c * (l div c) = c * (l div c) + l mod c"
  1842   have "c * (l div c) = c * (l div c) + l mod c"
  1843     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1843     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1844   then have cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric]
  1844   then have cl:"c * (l div c) =l" using mult_div_mod_eq [where a="l" and b="c"]
  1845     by simp
  1845     by simp
  1846   then have "l * x + (l div c) * Inum (x # bs) e = 0 \<longleftrightarrow>
  1846   then have "l * x + (l div c) * Inum (x # bs) e = 0 \<longleftrightarrow>
  1847       (c * (l div c)) * x + (l div c) * Inum (x # bs) e = 0"
  1847       (c * (l div c)) * x + (l div c) * Inum (x # bs) e = 0"
  1848     by simp
  1848     by simp
  1849   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) = ((l div c)) * 0"
  1849   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) = ((l div c)) * 0"
  1867   then have ldcp:"0 < l div c"
  1867   then have ldcp:"0 < l div c"
  1868     by (simp add: div_self[OF cnz])
  1868     by (simp add: div_self[OF cnz])
  1869   have "c * (l div c) = c * (l div c) + l mod c"
  1869   have "c * (l div c) = c * (l div c) + l mod c"
  1870     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1870     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1871   then have cl: "c * (l div c) = l"
  1871   then have cl: "c * (l div c) = l"
  1872     using zmod_zdiv_equality[where a="l" and b="c", symmetric] by simp
  1872     using mult_div_mod_eq [where a="l" and b="c"] by simp
  1873   then have "l * x + (l div c) * Inum (x # bs) e \<noteq> 0 \<longleftrightarrow>
  1873   then have "l * x + (l div c) * Inum (x # bs) e \<noteq> 0 \<longleftrightarrow>
  1874       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<noteq> 0"
  1874       (c * (l div c)) * x + (l div c) * Inum (x # bs) e \<noteq> 0"
  1875     by simp
  1875     by simp
  1876   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<noteq> (l div c) * 0"
  1876   also have "\<dots> \<longleftrightarrow> (l div c) * (c * x + Inum (x # bs) e) \<noteq> (l div c) * 0"
  1877     by (simp add: algebra_simps)
  1877     by (simp add: algebra_simps)
  1893   then have ldcp:"0 < l div c"
  1893   then have ldcp:"0 < l div c"
  1894     by (simp add: div_self[OF cnz])
  1894     by (simp add: div_self[OF cnz])
  1895   have "c * (l div c) = c * (l div c) + l mod c"
  1895   have "c * (l div c) = c * (l div c) + l mod c"
  1896     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1896     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1897   then have cl: "c * (l div c) = l"
  1897   then have cl: "c * (l div c) = l"
  1898     using zmod_zdiv_equality[where a="l" and b="c", symmetric] by simp
  1898     using mult_div_mod_eq [where a="l" and b="c"] by simp
  1899   then have "(\<exists>k::int. l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) \<longleftrightarrow>
  1899   then have "(\<exists>k::int. l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) \<longleftrightarrow>
  1900       (\<exists>k::int. (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"
  1900       (\<exists>k::int. (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"
  1901     by simp
  1901     by simp
  1902   also have "\<dots> \<longleftrightarrow> (\<exists>k::int. (l div c) * (c * x + Inum (x # bs) e - j * k) = (l div c) * 0)"
  1902   also have "\<dots> \<longleftrightarrow> (\<exists>k::int. (l div c) * (c * x + Inum (x # bs) e - j * k) = (l div c) * 0)"
  1903     by (simp add: algebra_simps)
  1903     by (simp add: algebra_simps)
  1923   then have ldcp: "0 < l div c"
  1923   then have ldcp: "0 < l div c"
  1924     by (simp add: div_self[OF cnz])
  1924     by (simp add: div_self[OF cnz])
  1925   have "c * (l div c) = c* (l div c) + l mod c"
  1925   have "c * (l div c) = c* (l div c) + l mod c"
  1926     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1926     using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  1927   then have cl:"c * (l div c) =l"
  1927   then have cl:"c * (l div c) =l"
  1928     using zmod_zdiv_equality[where a="l" and b="c", symmetric]
  1928     using mult_div_mod_eq [where a="l" and b="c"]
  1929     by simp
  1929     by simp
  1930   then have "(\<exists>k::int. l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) \<longleftrightarrow>
  1930   then have "(\<exists>k::int. l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) \<longleftrightarrow>
  1931       (\<exists>k::int. (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"
  1931       (\<exists>k::int. (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"
  1932     by simp
  1932     by simp
  1933   also have "\<dots> \<longleftrightarrow> (\<exists>k::int. (l div c) * (c * x + Inum (x # bs) e - j * k) = (l div c) * 0)"
  1933   also have "\<dots> \<longleftrightarrow> (\<exists>k::int. (l div c) * (c * x + Inum (x # bs) e - j * k) = (l div c) * 0)"