1796 from yne c eq_divide_eq[of "y" "- ?Nt x s" "?N c"] have ?case |
1793 from yne c eq_divide_eq[of "y" "- ?Nt x s" "?N c"] have ?case |
1797 by (simp add: field_simps tmbound0_I[OF lin(3), of vs x bs y] sum_eq[symmetric]) } |
1794 by (simp add: field_simps tmbound0_I[OF lin(3), of vs x bs y] sum_eq[symmetric]) } |
1798 ultimately show ?case by blast |
1795 ultimately show ?case by blast |
1799 qed (auto simp add: tmbound0_I[where vs=vs and bs="bs" and b="y" and b'="x"] bound0_I[where vs=vs and bs="bs" and b="y" and b'="x"]) |
1796 qed (auto simp add: tmbound0_I[where vs=vs and bs="bs" and b="y" and b'="x"] bound0_I[where vs=vs and bs="bs" and b="y" and b'="x"]) |
1800 |
1797 |
1801 lemma one_plus_one_pos[simp]: "(1::'a::{linordered_field}) + 1 > 0" |
|
1802 proof- |
|
1803 have op: "(1::'a) > 0" by simp |
|
1804 from add_pos_pos[OF op op] show ?thesis . |
|
1805 qed |
|
1806 |
|
1807 lemma one_plus_one_nonzero[simp]: "(1::'a::{linordered_field}) + 1 \<noteq> 0" |
|
1808 using one_plus_one_pos[where ?'a = 'a] by (simp add: less_le) |
|
1809 |
|
1810 lemma half_sum_eq: "(u + u) / (1+1) = (u::'a::{linordered_field})" |
|
1811 proof- |
|
1812 have "(u + u) = (1 + 1) * u" by (simp add: field_simps) |
|
1813 hence "(u + u) / (1+1) = (1 + 1)*u / (1 + 1)" by simp |
|
1814 with nonzero_mult_divide_cancel_left[OF one_plus_one_nonzero, of u] show ?thesis by simp |
|
1815 qed |
|
1816 |
|
1817 lemma inf_uset: |
1798 lemma inf_uset: |
1818 assumes lp: "islin p" |
1799 assumes lp: "islin p" |
1819 and nmi: "\<not> (Ifm vs (x#bs) (minusinf p))" (is "\<not> (Ifm vs (x#bs) (?M p))") |
1800 and nmi: "\<not> (Ifm vs (x#bs) (minusinf p))" (is "\<not> (Ifm vs (x#bs) (?M p))") |
1820 and npi: "\<not> (Ifm vs (x#bs) (plusinf p))" (is "\<not> (Ifm vs (x#bs) (?P p))") |
1801 and npi: "\<not> (Ifm vs (x#bs) (plusinf p))" (is "\<not> (Ifm vs (x#bs) (?P p))") |
1821 and ex: "\<exists> x. Ifm vs (x#bs) p" (is "\<exists> x. ?I x p") |
1802 and ex: "\<exists> x. Ifm vs (x#bs) p" (is "\<exists> x. ?I x p") |
1822 shows "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). ?I ((- Itm vs (x#bs) t / Ipoly vs c + - Itm vs (x#bs) s / Ipoly vs d) / (1 + 1)) p" |
1803 shows "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). ?I ((- Itm vs (x#bs) t / Ipoly vs c + - Itm vs (x#bs) s / Ipoly vs d) / 2) p" |
1823 proof- |
1804 proof- |
1824 let ?Nt = "\<lambda> x t. Itm vs (x#bs) t" |
1805 let ?Nt = "\<lambda> x t. Itm vs (x#bs) t" |
1825 let ?N = "Ipoly vs" |
1806 let ?N = "Ipoly vs" |
1826 let ?U = "set (uset p)" |
1807 let ?U = "set (uset p)" |
1827 from ex obtain a where pa: "?I a p" by blast |
1808 from ex obtain a where pa: "?I a p" by blast |
1828 from bound0_I[OF minusinf_nb[OF lp], where bs="bs" and b="x" and b'="a"] nmi |
1809 from bound0_I[OF minusinf_nb[OF lp], where bs="bs" and b="x" and b'="a"] nmi |
1829 have nmi': "\<not> (?I a (?M p))" by simp |
1810 have nmi': "\<not> (?I a (?M p))" by simp |
1830 from bound0_I[OF plusinf_nb[OF lp], where bs="bs" and b="x" and b'="a"] npi |
1811 from bound0_I[OF plusinf_nb[OF lp], where bs="bs" and b="x" and b'="a"] npi |
1831 have npi': "\<not> (?I a (?P p))" by simp |
1812 have npi': "\<not> (?I a (?P p))" by simp |
1832 have "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). ?I ((- ?Nt a t/?N c + - ?Nt a s /?N d) / (1 + 1)) p" |
1813 have "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). ?I ((- ?Nt a t/?N c + - ?Nt a s /?N d) / 2) p" |
1833 proof- |
1814 proof- |
1834 let ?M = "(\<lambda> (c,t). - ?Nt a t / ?N c) ` ?U" |
1815 let ?M = "(\<lambda> (c,t). - ?Nt a t / ?N c) ` ?U" |
1835 have fM: "finite ?M" by auto |
1816 have fM: "finite ?M" by auto |
1836 from minusinf_uset[OF lp nmi pa] plusinf_uset[OF lp npi pa] |
1817 from minusinf_uset[OF lp nmi pa] plusinf_uset[OF lp npi pa] |
1837 have "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). a \<le> - ?Nt x t / ?N c \<and> a \<ge> - ?Nt x s / ?N d" by blast |
1818 have "\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). a \<le> - ?Nt x t / ?N c \<and> a \<ge> - ?Nt x s / ?N d" by blast |
1869 from t1M have "\<exists> (t1n,t1u) \<in> ?U. t1 = - ?Nt a t1u / ?N t1n" by auto |
1850 from t1M have "\<exists> (t1n,t1u) \<in> ?U. t1 = - ?Nt a t1u / ?N t1n" by auto |
1870 then obtain "t1u" "t1n" where t1uU: "(t1n,t1u) \<in> ?U" and t1u: "t1 = - ?Nt a t1u / ?N t1n" by blast |
1851 then obtain "t1u" "t1n" where t1uU: "(t1n,t1u) \<in> ?U" and t1u: "t1 = - ?Nt a t1u / ?N t1n" by blast |
1871 from t2M have "\<exists> (t2n,t2u) \<in> ?U. t2 = - ?Nt a t2u / ?N t2n" by auto |
1852 from t2M have "\<exists> (t2n,t2u) \<in> ?U. t2 = - ?Nt a t2u / ?N t2n" by auto |
1872 then obtain "t2u" "t2n" where t2uU: "(t2n,t2u) \<in> ?U" and t2u: "t2 = - ?Nt a t2u / ?N t2n" by blast |
1853 then obtain "t2u" "t2n" where t2uU: "(t2n,t2u) \<in> ?U" and t2u: "t2 = - ?Nt a t2u / ?N t2n" by blast |
1873 from t1x xt2 have t1t2: "t1 < t2" by simp |
1854 from t1x xt2 have t1t2: "t1 < t2" by simp |
1874 let ?u = "(t1 + t2) / (1 + 1)" |
1855 let ?u = "(t1 + t2) / 2" |
1875 from less_half_sum[OF t1t2] gt_half_sum[OF t1t2] have t1lu: "t1 < ?u" and ut2: "?u < t2" by auto |
1856 from less_half_sum[OF t1t2] gt_half_sum[OF t1t2] have t1lu: "t1 < ?u" and ut2: "?u < t2" by auto |
1876 from lin_dense[OF lp noM t1x xt2 px t1lu ut2] have "?I ?u p" . |
1857 from lin_dense[OF lp noM t1x xt2 px t1lu ut2] have "?I ?u p" . |
1877 with t1uU t2uU t1u t2u have ?thesis by blast} |
1858 with t1uU t2uU t1u t2u have ?thesis by blast} |
1878 ultimately show ?thesis by blast |
1859 ultimately show ?thesis by blast |
1879 qed |
1860 qed |
1880 then obtain "l" "n" "s" "m" where lnU: "(n,l) \<in> ?U" and smU:"(m,s) \<in> ?U" |
1861 then obtain "l" "n" "s" "m" where lnU: "(n,l) \<in> ?U" and smU:"(m,s) \<in> ?U" |
1881 and pu: "?I ((- ?Nt a l / ?N n + - ?Nt a s / ?N m) / (1 + 1)) p" by blast |
1862 and pu: "?I ((- ?Nt a l / ?N n + - ?Nt a s / ?N m) / 2) p" by blast |
1882 from lnU smU uset_l[OF lp] have nbl: "tmbound0 l" and nbs: "tmbound0 s" by auto |
1863 from lnU smU uset_l[OF lp] have nbl: "tmbound0 l" and nbs: "tmbound0 s" by auto |
1883 from tmbound0_I[OF nbl, where bs="bs" and b="a" and b'="x"] |
1864 from tmbound0_I[OF nbl, where bs="bs" and b="a" and b'="x"] |
1884 tmbound0_I[OF nbs, where bs="bs" and b="a" and b'="x"] pu |
1865 tmbound0_I[OF nbs, where bs="bs" and b="a" and b'="x"] pu |
1885 have "?I ((- ?Nt x l / ?N n + - ?Nt x s / ?N m) / (1 + 1)) p" by simp |
1866 have "?I ((- ?Nt x l / ?N n + - ?Nt x s / ?N m) / 2) p" by simp |
1886 with lnU smU |
1867 with lnU smU |
1887 show ?thesis by auto |
1868 show ?thesis by auto |
1888 qed |
1869 qed |
1889 |
1870 |
1890 (* The Ferrante - Rackoff Theorem *) |
1871 (* The Ferrante - Rackoff Theorem *) |
1891 |
1872 |
1892 theorem fr_eq: |
1873 theorem fr_eq: |
1893 assumes lp: "islin p" |
1874 assumes lp: "islin p" |
1894 shows "(\<exists> x. Ifm vs (x#bs) p) = ((Ifm vs (x#bs) (minusinf p)) \<or> (Ifm vs (x#bs) (plusinf p)) \<or> (\<exists> (n,t) \<in> set (uset p). \<exists> (m,s) \<in> set (uset p). Ifm vs (((- Itm vs (x#bs) t / Ipoly vs n + - Itm vs (x#bs) s / Ipoly vs m) /(1 + 1))#bs) p))" |
1875 shows "(\<exists> x. Ifm vs (x#bs) p) = ((Ifm vs (x#bs) (minusinf p)) \<or> (Ifm vs (x#bs) (plusinf p)) \<or> (\<exists> (n,t) \<in> set (uset p). \<exists> (m,s) \<in> set (uset p). Ifm vs (((- Itm vs (x#bs) t / Ipoly vs n + - Itm vs (x#bs) s / Ipoly vs m) / 2)#bs) p))" |
1895 (is "(\<exists> x. ?I x p) = (?M \<or> ?P \<or> ?F)" is "?E = ?D") |
1876 (is "(\<exists> x. ?I x p) = (?M \<or> ?P \<or> ?F)" is "?E = ?D") |
1896 proof |
1877 proof |
1897 assume px: "\<exists> x. ?I x p" |
1878 assume px: "\<exists> x. ?I x p" |
1898 have "?M \<or> ?P \<or> (\<not> ?M \<and> \<not> ?P)" by blast |
1879 have "?M \<or> ?P \<or> (\<not> ?M \<and> \<not> ?P)" by blast |
1899 moreover {assume "?M \<or> ?P" hence "?D" by blast} |
1880 moreover {assume "?M \<or> ?P" hence "?D" by blast} |
1944 moreover |
1925 moreover |
1945 {assume c: "?c = 0" and d: "?d=0" |
1926 {assume c: "?c = 0" and d: "?d=0" |
1946 hence ?thesis by (simp add: r[of 0] msubsteq_def Let_def evaldjf_ex)} |
1927 hence ?thesis by (simp add: r[of 0] msubsteq_def Let_def evaldjf_ex)} |
1947 moreover |
1928 moreover |
1948 {assume c: "?c = 0" and d: "?d\<noteq>0" |
1929 {assume c: "?c = 0" and d: "?d\<noteq>0" |
1949 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = -?s / ((1 + 1)*?d)" by simp |
1930 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = -?s / (2*?d)" by simp |
1950 have "?rhs = Ifm vs (-?s / ((1 + 1)*?d) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1931 have "?rhs = Ifm vs (-?s / (2*?d) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1951 also have "\<dots> \<longleftrightarrow> ?a * (-?s / ((1 + 1)*?d)) + ?r = 0" by (simp add: r[of "- (Itm vs (x # bs) s / ((1 + 1) * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"]) |
1932 also have "\<dots> \<longleftrightarrow> ?a * (-?s / (2*?d)) + ?r = 0" by (simp add: r[of "- (Itm vs (x # bs) s / (2 * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"]) |
1952 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a * (-?s / ((1 + 1)*?d)) + ?r) = 0" |
1933 also have "\<dots> \<longleftrightarrow> 2*?d * (?a * (-?s / (2*?d)) + ?r) = 0" |
1953 using d mult_cancel_left[of "(1 + 1)*?d" "(?a * (-?s / ((1 + 1)*?d)) + ?r)" 0] by simp |
1934 using d mult_cancel_left[of "2*?d" "(?a * (-?s / (2*?d)) + ?r)" 0] by simp |
1954 also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * ((1 + 1)*?d / ((1 + 1)*?d)) + (1 + 1)*?d*?r= 0" |
1935 also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * (2*?d / (2*?d)) + 2*?d*?r= 0" |
1955 by (simp add: field_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib) |
1936 by (simp add: field_simps right_distrib[of "2*?d"] del: right_distrib) |
1956 |
1937 |
1957 also have "\<dots> \<longleftrightarrow> - (?a * ?s) + (1 + 1)*?d*?r = 0" using d by simp |
1938 also have "\<dots> \<longleftrightarrow> - (?a * ?s) + 2*?d*?r = 0" using d by simp |
1958 finally have ?thesis using c d |
1939 finally have ?thesis using c d |
1959 apply (simp add: r[of "- (Itm vs (x # bs) s / ((1 + 1) * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"] msubsteq_def Let_def evaldjf_ex del: one_add_one_is_two) |
1940 by (simp add: r[of "- (Itm vs (x # bs) s / (2 * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"] msubsteq_def Let_def evaldjf_ex del: one_add_one_is_two) |
1960 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
1941 } |
1961 apply simp |
|
1962 done} |
|
1963 moreover |
1942 moreover |
1964 {assume c: "?c \<noteq> 0" and d: "?d=0" |
1943 {assume c: "?c \<noteq> 0" and d: "?d=0" |
1965 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = -?t / ((1 + 1)*?c)" by simp |
1944 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = -?t / (2*?c)" by simp |
1966 have "?rhs = Ifm vs (-?t / ((1 + 1)*?c) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1945 have "?rhs = Ifm vs (-?t / (2*?c) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1967 also have "\<dots> \<longleftrightarrow> ?a * (-?t / ((1 + 1)*?c)) + ?r = 0" by (simp add: r[of "- (?t/ ((1 + 1)* ?c))"]) |
1946 also have "\<dots> \<longleftrightarrow> ?a * (-?t / (2*?c)) + ?r = 0" by (simp add: r[of "- (?t/ (2 * ?c))"]) |
1968 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a * (-?t / ((1 + 1)*?c)) + ?r) = 0" |
1947 also have "\<dots> \<longleftrightarrow> 2*?c * (?a * (-?t / (2*?c)) + ?r) = 0" |
1969 using c mult_cancel_left[of "(1 + 1)*?c" "(?a * (-?t / ((1 + 1)*?c)) + ?r)" 0] by simp |
1948 using c mult_cancel_left[of "2*?c" "(?a * (-?t / (2*?c)) + ?r)" 0] by simp |
1970 also have "\<dots> \<longleftrightarrow> (?a * -?t)* ((1 + 1)*?c) / ((1 + 1)*?c) + (1 + 1)*?c*?r= 0" |
1949 also have "\<dots> \<longleftrightarrow> (?a * -?t)* (2*?c) / (2*?c) + 2*?c*?r= 0" |
1971 by (simp add: field_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib) |
1950 by (simp add: field_simps right_distrib[of "2*?c"] del: right_distrib) |
1972 also have "\<dots> \<longleftrightarrow> - (?a * ?t) + (1 + 1)*?c*?r = 0" using c by simp |
1951 also have "\<dots> \<longleftrightarrow> - (?a * ?t) + 2*?c*?r = 0" using c by simp |
1973 finally have ?thesis using c d |
1952 finally have ?thesis using c d |
1974 apply (simp add: r[of "- (?t/ ((1 + 1)*?c))"] msubsteq_def Let_def evaldjf_ex del: one_add_one_is_two) |
1953 by (simp add: r[of "- (?t/ (2*?c))"] msubsteq_def Let_def evaldjf_ex del: one_add_one_is_two) |
1975 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
1954 } |
1976 apply simp |
1955 moreover |
1977 done } |
1956 {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *2 \<noteq> 0" by simp |
1978 moreover |
|
1979 {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *(1 + 1) \<noteq> 0" by simp |
|
1980 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
1957 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
1981 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
1958 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
1982 by (simp add: field_simps) |
1959 by (simp add: field_simps) |
1983 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1960 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (Eq (CNP 0 a r))" by (simp only: th) |
1984 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r = 0" |
1961 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r = 0" |
1985 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
1962 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
1986 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) =0 " |
1963 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) =0 " |
1987 using c d mult_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp |
1964 using c d mult_cancel_left[of "2 * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r" 0] by simp |
1988 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r =0" |
1965 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + 2*?c*?d*?r =0" |
1989 using nonzero_mult_divide_cancel_left [OF dc] c d |
1966 using nonzero_mult_divide_cancel_left [OF dc] c d |
1990 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
1967 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
1991 finally have ?thesis using c d |
1968 finally have ?thesis using c d |
1992 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubsteq_def Let_def evaldjf_ex field_simps) |
1969 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubsteq_def Let_def evaldjf_ex field_simps) |
1993 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
1970 } |
1994 apply (simp add: field_simps) |
|
1995 done } |
|
1996 ultimately show ?thesis by blast |
1971 ultimately show ?thesis by blast |
1997 qed |
1972 qed |
1998 |
1973 |
1999 |
1974 |
2000 definition "msubstneq c t d s a r = |
1975 definition "msubstneq c t d s a r = |
2032 moreover |
2007 moreover |
2033 {assume c: "?c = 0" and d: "?d=0" |
2008 {assume c: "?c = 0" and d: "?d=0" |
2034 hence ?thesis by (simp add: r[of 0] msubstneq_def Let_def evaldjf_ex)} |
2009 hence ?thesis by (simp add: r[of 0] msubstneq_def Let_def evaldjf_ex)} |
2035 moreover |
2010 moreover |
2036 {assume c: "?c = 0" and d: "?d\<noteq>0" |
2011 {assume c: "?c = 0" and d: "?d\<noteq>0" |
2037 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = -?s / ((1 + 1)*?d)" by simp |
2012 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = -?s / (2*?d)" by simp |
2038 have "?rhs = Ifm vs (-?s / ((1 + 1)*?d) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2013 have "?rhs = Ifm vs (-?s / (2*?d) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2039 also have "\<dots> \<longleftrightarrow> ?a * (-?s / ((1 + 1)*?d)) + ?r \<noteq> 0" by (simp add: r[of "- (Itm vs (x # bs) s / ((1 + 1) * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"]) |
2014 also have "\<dots> \<longleftrightarrow> ?a * (-?s / (2*?d)) + ?r \<noteq> 0" by (simp add: r[of "- (Itm vs (x # bs) s / (2 * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"]) |
2040 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a * (-?s / ((1 + 1)*?d)) + ?r) \<noteq> 0" |
2015 also have "\<dots> \<longleftrightarrow> 2*?d * (?a * (-?s / (2*?d)) + ?r) \<noteq> 0" |
2041 using d mult_cancel_left[of "(1 + 1)*?d" "(?a * (-?s / ((1 + 1)*?d)) + ?r)" 0] by simp |
2016 using d mult_cancel_left[of "2*?d" "(?a * (-?s / (2*?d)) + ?r)" 0] by simp |
2042 also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * ((1 + 1)*?d / ((1 + 1)*?d)) + (1 + 1)*?d*?r\<noteq> 0" |
2017 also have "\<dots> \<longleftrightarrow> (- ?a * ?s) * (2*?d / (2*?d)) + 2*?d*?r\<noteq> 0" |
2043 by (simp add: field_simps right_distrib[of "(1 + 1)*?d"] del: right_distrib) |
2018 by (simp add: field_simps right_distrib[of "2*?d"] del: right_distrib) |
2044 |
2019 |
2045 also have "\<dots> \<longleftrightarrow> - (?a * ?s) + (1 + 1)*?d*?r \<noteq> 0" using d by simp |
2020 also have "\<dots> \<longleftrightarrow> - (?a * ?s) + 2*?d*?r \<noteq> 0" using d by simp |
2046 finally have ?thesis using c d |
2021 finally have ?thesis using c d |
2047 apply (simp add: r[of "- (Itm vs (x # bs) s / ((1 + 1) * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"] msubstneq_def Let_def evaldjf_ex del: one_add_one_is_two) |
2022 by (simp add: r[of "- (Itm vs (x # bs) s / (2 * \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>))"] msubstneq_def Let_def evaldjf_ex del: one_add_one_is_two) |
2048 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2023 } |
2049 apply simp |
|
2050 done} |
|
2051 moreover |
2024 moreover |
2052 {assume c: "?c \<noteq> 0" and d: "?d=0" |
2025 {assume c: "?c \<noteq> 0" and d: "?d=0" |
2053 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = -?t / ((1 + 1)*?c)" by simp |
2026 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = -?t / (2*?c)" by simp |
2054 have "?rhs = Ifm vs (-?t / ((1 + 1)*?c) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2027 have "?rhs = Ifm vs (-?t / (2*?c) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2055 also have "\<dots> \<longleftrightarrow> ?a * (-?t / ((1 + 1)*?c)) + ?r \<noteq> 0" by (simp add: r[of "- (?t/ ((1 + 1)* ?c))"]) |
2028 also have "\<dots> \<longleftrightarrow> ?a * (-?t / (2*?c)) + ?r \<noteq> 0" by (simp add: r[of "- (?t/ (2 * ?c))"]) |
2056 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a * (-?t / ((1 + 1)*?c)) + ?r) \<noteq> 0" |
2029 also have "\<dots> \<longleftrightarrow> 2*?c * (?a * (-?t / (2*?c)) + ?r) \<noteq> 0" |
2057 using c mult_cancel_left[of "(1 + 1)*?c" "(?a * (-?t / ((1 + 1)*?c)) + ?r)" 0] by simp |
2030 using c mult_cancel_left[of "2*?c" "(?a * (-?t / (2*?c)) + ?r)" 0] by simp |
2058 also have "\<dots> \<longleftrightarrow> (?a * -?t)* ((1 + 1)*?c) / ((1 + 1)*?c) + (1 + 1)*?c*?r \<noteq> 0" |
2031 also have "\<dots> \<longleftrightarrow> (?a * -?t)* (2*?c) / (2*?c) + 2*?c*?r \<noteq> 0" |
2059 by (simp add: field_simps right_distrib[of "(1 + 1)*?c"] del: right_distrib) |
2032 by (simp add: field_simps right_distrib[of "2*?c"] del: right_distrib) |
2060 also have "\<dots> \<longleftrightarrow> - (?a * ?t) + (1 + 1)*?c*?r \<noteq> 0" using c by simp |
2033 also have "\<dots> \<longleftrightarrow> - (?a * ?t) + 2*?c*?r \<noteq> 0" using c by simp |
2061 finally have ?thesis using c d |
2034 finally have ?thesis using c d |
2062 apply (simp add: r[of "- (?t/ ((1 + 1)*?c))"] msubstneq_def Let_def evaldjf_ex del: one_add_one_is_two) |
2035 by (simp add: r[of "- (?t/ (2*?c))"] msubstneq_def Let_def evaldjf_ex del: one_add_one_is_two) |
2063 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2036 } |
2064 apply simp |
2037 moreover |
2065 done } |
2038 {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *2 \<noteq> 0" by simp |
2066 moreover |
|
2067 {assume c: "?c \<noteq> 0" and d: "?d\<noteq>0" hence dc: "?c * ?d *(1 + 1) \<noteq> 0" by simp |
|
2068 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2039 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2069 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
2040 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
2070 by (simp add: field_simps) |
2041 by (simp add: field_simps) |
2071 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2042 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (NEq (CNP 0 a r))" by (simp only: th) |
2072 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r \<noteq> 0" |
2043 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r \<noteq> 0" |
2073 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
2044 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
2074 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) \<noteq> 0 " |
2045 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) \<noteq> 0 " |
2075 using c d mult_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp |
2046 using c d mult_cancel_left[of "2 * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r" 0] by simp |
2076 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r \<noteq> 0" |
2047 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + 2*?c*?d*?r \<noteq> 0" |
2077 using nonzero_mult_divide_cancel_left[OF dc] c d |
2048 using nonzero_mult_divide_cancel_left[OF dc] c d |
2078 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2049 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2079 finally have ?thesis using c d |
2050 finally have ?thesis using c d |
2080 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstneq_def Let_def evaldjf_ex field_simps) |
2051 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubstneq_def Let_def evaldjf_ex field_simps) |
2081 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2052 } |
2082 apply (simp add: field_simps) |
|
2083 done } |
|
2084 ultimately show ?thesis by blast |
2053 ultimately show ?thesis by blast |
2085 qed |
2054 qed |
2086 |
2055 |
2087 definition "msubstlt c t d s a r = |
2056 definition "msubstlt c t d s a r = |
2088 evaldjf (split conj) |
2057 evaldjf (split conj) |
2127 moreover |
2096 moreover |
2128 {assume c: "?c=0" and d: "?d=0" |
2097 {assume c: "?c=0" and d: "?d=0" |
2129 hence ?thesis using nc nd by (simp add: polyneg_norm lt r[of 0] msubstlt_def Let_def evaldjf_ex)} |
2098 hence ?thesis using nc nd by (simp add: polyneg_norm lt r[of 0] msubstlt_def Let_def evaldjf_ex)} |
2130 moreover |
2099 moreover |
2131 {assume dc: "?c*?d > 0" |
2100 {assume dc: "?c*?d > 0" |
2132 from mult_pos_pos[OF one_plus_one_pos dc] have dc': "(1 + 1)*?c *?d > 0" by simp |
2101 from dc have dc': "2*?c *?d > 0" by simp |
2133 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2102 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2134 from dc' have dc'': "\<not> (1 + 1)*?c *?d < 0" by simp |
2103 from dc' have dc'': "\<not> 2*?c *?d < 0" by simp |
2135 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2104 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2136 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
2105 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
2137 by (simp add: field_simps) |
2106 by (simp add: field_simps) |
2138 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2107 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2139 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r < 0" |
2108 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r < 0" |
2140 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
2109 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
2141 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) < 0" |
2110 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) < 0" |
2142 |
2111 |
2143 using dc' dc'' mult_less_cancel_left_disj[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp |
2112 using dc' dc'' mult_less_cancel_left_disj[of "2 * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r" 0] by simp |
2144 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r < 0" |
2113 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + 2*?c*?d*?r < 0" |
2145 using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d |
2114 using nonzero_mult_divide_cancel_left[of "2*?c*?d"] c d |
2146 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2115 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2147 finally have ?thesis using dc c d nc nd dc' |
2116 finally have ?thesis using dc c d nc nd dc' |
2148 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2117 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2149 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2118 } |
2150 by (simp add: field_simps order_less_not_sym[OF dc])} |
|
2151 moreover |
2119 moreover |
2152 {assume dc: "?c*?d < 0" |
2120 {assume dc: "?c*?d < 0" |
2153 |
2121 |
2154 from dc one_plus_one_pos[where ?'a='a] have dc': "(1 + 1)*?c *?d < 0" |
2122 from dc have dc': "2*?c *?d < 0" |
2155 by (simp add: mult_less_0_iff field_simps) |
2123 by (simp add: mult_less_0_iff field_simps) |
2156 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2124 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2157 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2125 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2158 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
2126 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
2159 by (simp add: field_simps) |
2127 by (simp add: field_simps) |
2160 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2128 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2161 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r < 0" |
2129 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r < 0" |
2162 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
2130 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
2163 |
2131 |
2164 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) > 0" |
2132 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) > 0" |
2165 |
2133 |
2166 using dc' order_less_not_sym[OF dc'] mult_less_cancel_left_disj[of "(1 + 1) * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r"] by simp |
2134 using dc' order_less_not_sym[OF dc'] mult_less_cancel_left_disj[of "2 * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r"] by simp |
2167 also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - (1 + 1)*?c*?d*?r < 0" |
2135 also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - 2*?c*?d*?r < 0" |
2168 using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d |
2136 using nonzero_mult_divide_cancel_left[of "2*?c*?d"] c d |
2169 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2137 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2170 finally have ?thesis using dc c d nc nd |
2138 finally have ?thesis using dc c d nc nd |
2171 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2139 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2172 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2140 } |
2173 by (simp add: field_simps order_less_not_sym[OF dc]) } |
|
2174 moreover |
2141 moreover |
2175 {assume c: "?c > 0" and d: "?d=0" |
2142 {assume c: "?c > 0" and d: "?d=0" |
2176 from c have c'': "(1 + 1)*?c > 0" by (simp add: zero_less_mult_iff) |
2143 from c have c'': "2*?c > 0" by (simp add: zero_less_mult_iff) |
2177 from c have c': "(1 + 1)*?c \<noteq> 0" by simp |
2144 from c have c': "2*?c \<noteq> 0" by simp |
2178 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)" by (simp add: field_simps) |
2145 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?t / (2*?c)" by (simp add: field_simps) |
2179 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2146 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / (2*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2180 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r < 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"]) |
2147 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / (2*?c))+ ?r < 0" by (simp add: r[of "- (?t / (2*?c))"]) |
2181 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) < 0" |
2148 also have "\<dots> \<longleftrightarrow> 2*?c * (?a* (- ?t / (2*?c))+ ?r) < 0" |
2182 using c mult_less_cancel_left_disj[of "(1 + 1) * ?c" "?a* (- ?t / ((1 + 1)*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp |
2149 using c mult_less_cancel_left_disj[of "2 * ?c" "?a* (- ?t / (2*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp |
2183 also have "\<dots> \<longleftrightarrow> - ?a*?t+ (1 + 1)*?c *?r < 0" |
2150 also have "\<dots> \<longleftrightarrow> - ?a*?t+ 2*?c *?r < 0" |
2184 using nonzero_mult_divide_cancel_left[OF c'] c |
2151 using nonzero_mult_divide_cancel_left[OF c'] c |
2185 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2152 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2186 finally have ?thesis using c d nc nd |
2153 finally have ?thesis using c d nc nd |
2187 apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2154 by(simp add: r[of "- (?t / (2*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2188 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2155 } |
2189 using c order_less_not_sym[OF c] less_imp_neq[OF c] |
2156 moreover |
2190 by (simp add: field_simps ) } |
2157 {assume c: "?c < 0" and d: "?d=0" hence c': "2*?c \<noteq> 0" by simp |
2191 moreover |
2158 from c have c'': "2*?c < 0" by (simp add: mult_less_0_iff) |
2192 {assume c: "?c < 0" and d: "?d=0" hence c': "(1 + 1)*?c \<noteq> 0" by simp |
2159 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?t / (2*?c)" by (simp add: field_simps) |
2193 from c have c'': "(1 + 1)*?c < 0" by (simp add: mult_less_0_iff) |
2160 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / (2*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2194 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)" by (simp add: field_simps) |
2161 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / (2*?c))+ ?r < 0" by (simp add: r[of "- (?t / (2*?c))"]) |
2195 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2162 also have "\<dots> \<longleftrightarrow> 2*?c * (?a* (- ?t / (2*?c))+ ?r) > 0" |
2196 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r < 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"]) |
2163 using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_less_cancel_left_disj[of "2 * ?c" 0 "?a* (- ?t / (2*?c))+ ?r"] by simp |
2197 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) > 0" |
2164 also have "\<dots> \<longleftrightarrow> ?a*?t - 2*?c *?r < 0" |
2198 using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_less_cancel_left_disj[of "(1 + 1) * ?c" 0 "?a* (- ?t / ((1 + 1)*?c))+ ?r"] by simp |
|
2199 also have "\<dots> \<longleftrightarrow> ?a*?t - (1 + 1)*?c *?r < 0" |
|
2200 using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' |
2165 using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' |
2201 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2166 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2202 finally have ?thesis using c d nc nd |
2167 finally have ?thesis using c d nc nd |
2203 apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2168 by(simp add: r[of "- (?t / (2*?c))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2204 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2169 } |
2205 using c order_less_not_sym[OF c] less_imp_neq[OF c] |
|
2206 by (simp add: field_simps ) } |
|
2207 moreover |
2170 moreover |
2208 moreover |
2171 moreover |
2209 {assume c: "?c = 0" and d: "?d>0" |
2172 {assume c: "?c = 0" and d: "?d>0" |
2210 from d have d'': "(1 + 1)*?d > 0" by (simp add: zero_less_mult_iff) |
2173 from d have d'': "2*?d > 0" by (simp add: zero_less_mult_iff) |
2211 from d have d': "(1 + 1)*?d \<noteq> 0" by simp |
2174 from d have d': "2*?d \<noteq> 0" by simp |
2212 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)" by (simp add: field_simps) |
2175 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?s / (2*?d)" by (simp add: field_simps) |
2213 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2176 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / (2*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2214 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r < 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"]) |
2177 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / (2*?d))+ ?r < 0" by (simp add: r[of "- (?s / (2*?d))"]) |
2215 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) < 0" |
2178 also have "\<dots> \<longleftrightarrow> 2*?d * (?a* (- ?s / (2*?d))+ ?r) < 0" |
2216 using d mult_less_cancel_left_disj[of "(1 + 1) * ?d" "?a* (- ?s / ((1 + 1)*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp |
2179 using d mult_less_cancel_left_disj[of "2 * ?d" "?a* (- ?s / (2*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp |
2217 also have "\<dots> \<longleftrightarrow> - ?a*?s+ (1 + 1)*?d *?r < 0" |
2180 also have "\<dots> \<longleftrightarrow> - ?a*?s+ 2*?d *?r < 0" |
2218 using nonzero_mult_divide_cancel_left[OF d'] d |
2181 using nonzero_mult_divide_cancel_left[OF d'] d |
2219 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2182 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2220 finally have ?thesis using c d nc nd |
2183 finally have ?thesis using c d nc nd |
2221 apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2184 by(simp add: r[of "- (?s / (2*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2222 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2185 } |
2223 using d order_less_not_sym[OF d] less_imp_neq[OF d] |
2186 moreover |
2224 by (simp add: field_simps) } |
2187 {assume c: "?c = 0" and d: "?d<0" hence d': "2*?d \<noteq> 0" by simp |
2225 moreover |
2188 from d have d'': "2*?d < 0" by (simp add: mult_less_0_iff) |
2226 {assume c: "?c = 0" and d: "?d<0" hence d': "(1 + 1)*?d \<noteq> 0" by simp |
2189 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?s / (2*?d)" by (simp add: field_simps) |
2227 from d have d'': "(1 + 1)*?d < 0" by (simp add: mult_less_0_iff) |
2190 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / (2*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2228 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)" by (simp add: field_simps) |
2191 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / (2*?d))+ ?r < 0" by (simp add: r[of "- (?s / (2*?d))"]) |
2229 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Lt (CNP 0 a r))" by (simp only: th) |
2192 also have "\<dots> \<longleftrightarrow> 2*?d * (?a* (- ?s / (2*?d))+ ?r) > 0" |
2230 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r < 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"]) |
2193 using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_less_cancel_left_disj[of "2 * ?d" 0 "?a* (- ?s / (2*?d))+ ?r"] by simp |
2231 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) > 0" |
2194 also have "\<dots> \<longleftrightarrow> ?a*?s - 2*?d *?r < 0" |
2232 using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_less_cancel_left_disj[of "(1 + 1) * ?d" 0 "?a* (- ?s / ((1 + 1)*?d))+ ?r"] by simp |
|
2233 also have "\<dots> \<longleftrightarrow> ?a*?s - (1 + 1)*?d *?r < 0" |
|
2234 using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' |
2195 using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' |
2235 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2196 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2236 finally have ?thesis using c d nc nd |
2197 finally have ?thesis using c d nc nd |
2237 apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2198 by(simp add: r[of "- (?s / (2*?d))"] msubstlt_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2238 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2199 } |
2239 using d order_less_not_sym[OF d] less_imp_neq[OF d] |
|
2240 by (simp add: field_simps ) } |
|
2241 ultimately show ?thesis by blast |
2200 ultimately show ?thesis by blast |
2242 qed |
2201 qed |
2243 |
2202 |
2244 definition "msubstle c t d s a r = |
2203 definition "msubstle c t d s a r = |
2245 evaldjf (split conj) |
2204 evaldjf (split conj) |
2283 moreover |
2242 moreover |
2284 {assume c: "?c=0" and d: "?d=0" |
2243 {assume c: "?c=0" and d: "?d=0" |
2285 hence ?thesis using nc nd by (simp add: polyneg_norm polymul_norm lt r[of 0] msubstle_def Let_def evaldjf_ex)} |
2244 hence ?thesis using nc nd by (simp add: polyneg_norm polymul_norm lt r[of 0] msubstle_def Let_def evaldjf_ex)} |
2286 moreover |
2245 moreover |
2287 {assume dc: "?c*?d > 0" |
2246 {assume dc: "?c*?d > 0" |
2288 from mult_pos_pos[OF one_plus_one_pos dc] have dc': "(1 + 1)*?c *?d > 0" by simp |
2247 from dc have dc': "2*?c *?d > 0" by simp |
2289 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2248 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2290 from dc' have dc'': "\<not> (1 + 1)*?c *?d < 0" by simp |
2249 from dc' have dc'': "\<not> 2*?c *?d < 0" by simp |
2291 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2250 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2292 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
2251 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
2293 by (simp add: field_simps) |
2252 by (simp add: field_simps) |
2294 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2253 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2295 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r <= 0" |
2254 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r <= 0" |
2296 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
2255 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
2297 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) <= 0" |
2256 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) <= 0" |
2298 |
2257 |
2299 using dc' dc'' mult_le_cancel_left[of "(1 + 1) * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r" 0] by simp |
2258 using dc' dc'' mult_le_cancel_left[of "2 * ?c * ?d" "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r" 0] by simp |
2300 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + (1 + 1)*?c*?d*?r <= 0" |
2259 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )) + 2*?c*?d*?r <= 0" |
2301 using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d |
2260 using nonzero_mult_divide_cancel_left[of "2*?c*?d"] c d |
2302 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2261 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2303 finally have ?thesis using dc c d nc nd dc' |
2262 finally have ?thesis using dc c d nc nd dc' |
2304 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2263 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2305 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2264 } |
2306 by (simp add: field_simps order_less_not_sym[OF dc])} |
|
2307 moreover |
2265 moreover |
2308 {assume dc: "?c*?d < 0" |
2266 {assume dc: "?c*?d < 0" |
2309 |
2267 |
2310 from dc one_plus_one_pos[where ?'a='a] have dc': "(1 + 1)*?c *?d < 0" |
2268 from dc have dc': "2*?c *?d < 0" |
2311 by (simp add: mult_less_0_iff field_simps add_neg_neg add_pos_pos) |
2269 by (simp add: mult_less_0_iff field_simps add_neg_neg add_pos_pos) |
2312 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2270 hence c:"?c \<noteq> 0" and d: "?d\<noteq> 0" by auto |
2313 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2271 from add_frac_eq[OF c d, of "- ?t" "- ?s"] |
2314 have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)" |
2272 have th: "(- ?t / ?c + - ?s / ?d)/2 = - (?d * ?t + ?c* ?s )/ (2*?c*?d)" |
2315 by (simp add: field_simps) |
2273 by (simp add: field_simps) |
2316 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2274 have "?rhs \<longleftrightarrow> Ifm vs (- (?d * ?t + ?c* ?s )/ (2*?c*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2317 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r <= 0" |
2275 also have "\<dots> \<longleftrightarrow> ?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r <= 0" |
2318 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"]) |
2276 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"]) |
2319 |
2277 |
2320 also have "\<dots> \<longleftrightarrow> ((1 + 1) * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ ((1 + 1)*?c*?d)) + ?r) >= 0" |
2278 also have "\<dots> \<longleftrightarrow> (2 * ?c * ?d) * (?a * (- (?d * ?t + ?c* ?s )/ (2*?c*?d)) + ?r) >= 0" |
2321 |
2279 |
2322 using dc' order_less_not_sym[OF dc'] mult_le_cancel_left[of "(1 + 1) * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ ((1 + 1)*?c*?d)) + ?r"] by simp |
2280 using dc' order_less_not_sym[OF dc'] mult_le_cancel_left[of "2 * ?c * ?d" 0 "?a * (- (?d * ?t + ?c* ?s)/ (2*?c*?d)) + ?r"] by simp |
2323 also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - (1 + 1)*?c*?d*?r <= 0" |
2281 also have "\<dots> \<longleftrightarrow> ?a * ((?d * ?t + ?c* ?s )) - 2*?c*?d*?r <= 0" |
2324 using nonzero_mult_divide_cancel_left[of "(1 + 1)*?c*?d"] c d |
2282 using nonzero_mult_divide_cancel_left[of "2*?c*?d"] c d |
2325 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2283 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2326 finally have ?thesis using dc c d nc nd |
2284 finally have ?thesis using dc c d nc nd |
2327 apply (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / ((1 + 1) * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2285 by (simp add: r[of "(- (?d * ?t) + - (?c *?s)) / (2 * ?c * ?d)"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2328 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2286 } |
2329 by (simp add: field_simps order_less_not_sym[OF dc]) } |
|
2330 moreover |
2287 moreover |
2331 {assume c: "?c > 0" and d: "?d=0" |
2288 {assume c: "?c > 0" and d: "?d=0" |
2332 from c have c'': "(1 + 1)*?c > 0" by (simp add: zero_less_mult_iff) |
2289 from c have c'': "2*?c > 0" by (simp add: zero_less_mult_iff) |
2333 from c have c': "(1 + 1)*?c \<noteq> 0" by simp |
2290 from c have c': "2*?c \<noteq> 0" by simp |
2334 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)" by (simp add: field_simps) |
2291 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?t / (2*?c)" by (simp add: field_simps) |
2335 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2292 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / (2*?c) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2336 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r <= 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"]) |
2293 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / (2*?c))+ ?r <= 0" by (simp add: r[of "- (?t / (2*?c))"]) |
2337 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) <= 0" |
2294 also have "\<dots> \<longleftrightarrow> 2*?c * (?a* (- ?t / (2*?c))+ ?r) <= 0" |
2338 using c mult_le_cancel_left[of "(1 + 1) * ?c" "?a* (- ?t / ((1 + 1)*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp |
2295 using c mult_le_cancel_left[of "2 * ?c" "?a* (- ?t / (2*?c))+ ?r" 0] c' c'' order_less_not_sym[OF c''] by simp |
2339 also have "\<dots> \<longleftrightarrow> - ?a*?t+ (1 + 1)*?c *?r <= 0" |
2296 also have "\<dots> \<longleftrightarrow> - ?a*?t+ 2*?c *?r <= 0" |
2340 using nonzero_mult_divide_cancel_left[OF c'] c |
2297 using nonzero_mult_divide_cancel_left[OF c'] c |
2341 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2298 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2342 finally have ?thesis using c d nc nd |
2299 finally have ?thesis using c d nc nd |
2343 apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2300 by(simp add: r[of "- (?t / (2*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2344 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2301 } |
2345 using c order_less_not_sym[OF c] less_imp_neq[OF c] |
2302 moreover |
2346 by (simp add: field_simps ) } |
2303 {assume c: "?c < 0" and d: "?d=0" hence c': "2*?c \<noteq> 0" by simp |
2347 moreover |
2304 from c have c'': "2*?c < 0" by (simp add: mult_less_0_iff) |
2348 {assume c: "?c < 0" and d: "?d=0" hence c': "(1 + 1)*?c \<noteq> 0" by simp |
2305 from d have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?t / (2*?c)" by (simp add: field_simps) |
2349 from c have c'': "(1 + 1)*?c < 0" by (simp add: mult_less_0_iff) |
2306 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / (2*?c) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2350 from d have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?t / ((1 + 1)*?c)" by (simp add: field_simps) |
2307 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / (2*?c))+ ?r <= 0" by (simp add: r[of "- (?t / (2*?c))"]) |
2351 have "?rhs \<longleftrightarrow> Ifm vs (- ?t / ((1 + 1)*?c) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2308 also have "\<dots> \<longleftrightarrow> 2*?c * (?a* (- ?t / (2*?c))+ ?r) >= 0" |
2352 also have "\<dots> \<longleftrightarrow> ?a* (- ?t / ((1 + 1)*?c))+ ?r <= 0" by (simp add: r[of "- (?t / ((1 + 1)*?c))"]) |
2309 using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_le_cancel_left[of "2 * ?c" 0 "?a* (- ?t / (2*?c))+ ?r"] by simp |
2353 also have "\<dots> \<longleftrightarrow> (1 + 1)*?c * (?a* (- ?t / ((1 + 1)*?c))+ ?r) >= 0" |
2310 also have "\<dots> \<longleftrightarrow> ?a*?t - 2*?c *?r <= 0" |
2354 using c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' mult_le_cancel_left[of "(1 + 1) * ?c" 0 "?a* (- ?t / ((1 + 1)*?c))+ ?r"] by simp |
|
2355 also have "\<dots> \<longleftrightarrow> ?a*?t - (1 + 1)*?c *?r <= 0" |
|
2356 using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' |
2311 using nonzero_mult_divide_cancel_left[OF c'] c order_less_not_sym[OF c''] less_imp_neq[OF c''] c'' |
2357 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2312 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2358 finally have ?thesis using c d nc nd |
2313 finally have ?thesis using c d nc nd |
2359 apply(simp add: r[of "- (?t / ((1 + 1)*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2314 by(simp add: r[of "- (?t / (2*?c))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2360 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2315 } |
2361 using c order_less_not_sym[OF c] less_imp_neq[OF c] |
|
2362 by (simp add: field_simps ) } |
|
2363 moreover |
2316 moreover |
2364 moreover |
2317 moreover |
2365 {assume c: "?c = 0" and d: "?d>0" |
2318 {assume c: "?c = 0" and d: "?d>0" |
2366 from d have d'': "(1 + 1)*?d > 0" by (simp add: zero_less_mult_iff) |
2319 from d have d'': "2*?d > 0" by (simp add: zero_less_mult_iff) |
2367 from d have d': "(1 + 1)*?d \<noteq> 0" by simp |
2320 from d have d': "2*?d \<noteq> 0" by simp |
2368 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)" by (simp add: field_simps) |
2321 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?s / (2*?d)" by (simp add: field_simps) |
2369 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2322 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / (2*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2370 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r <= 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"]) |
2323 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / (2*?d))+ ?r <= 0" by (simp add: r[of "- (?s / (2*?d))"]) |
2371 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) <= 0" |
2324 also have "\<dots> \<longleftrightarrow> 2*?d * (?a* (- ?s / (2*?d))+ ?r) <= 0" |
2372 using d mult_le_cancel_left[of "(1 + 1) * ?d" "?a* (- ?s / ((1 + 1)*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp |
2325 using d mult_le_cancel_left[of "2 * ?d" "?a* (- ?s / (2*?d))+ ?r" 0] d' d'' order_less_not_sym[OF d''] by simp |
2373 also have "\<dots> \<longleftrightarrow> - ?a*?s+ (1 + 1)*?d *?r <= 0" |
2326 also have "\<dots> \<longleftrightarrow> - ?a*?s+ 2*?d *?r <= 0" |
2374 using nonzero_mult_divide_cancel_left[OF d'] d |
2327 using nonzero_mult_divide_cancel_left[OF d'] d |
2375 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2328 by (simp add: algebra_simps diff_divide_distrib less_le del: left_distrib) |
2376 finally have ?thesis using c d nc nd |
2329 finally have ?thesis using c d nc nd |
2377 apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2330 by(simp add: r[of "- (?s / (2*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2378 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2331 } |
2379 using d order_less_not_sym[OF d] less_imp_neq[OF d] |
2332 moreover |
2380 by (simp add: field_simps ) } |
2333 {assume c: "?c = 0" and d: "?d<0" hence d': "2*?d \<noteq> 0" by simp |
2381 moreover |
2334 from d have d'': "2*?d < 0" by (simp add: mult_less_0_iff) |
2382 {assume c: "?c = 0" and d: "?d<0" hence d': "(1 + 1)*?d \<noteq> 0" by simp |
2335 from c have th: "(- ?t / ?c + - ?s / ?d)/2 = - ?s / (2*?d)" by (simp add: field_simps) |
2383 from d have d'': "(1 + 1)*?d < 0" by (simp add: mult_less_0_iff) |
2336 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / (2*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2384 from c have th: "(- ?t / ?c + - ?s / ?d)/(1 + 1) = - ?s / ((1 + 1)*?d)" by (simp add: field_simps) |
2337 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / (2*?d))+ ?r <= 0" by (simp add: r[of "- (?s / (2*?d))"]) |
2385 have "?rhs \<longleftrightarrow> Ifm vs (- ?s / ((1 + 1)*?d) # bs) (Le (CNP 0 a r))" by (simp only: th) |
2338 also have "\<dots> \<longleftrightarrow> 2*?d * (?a* (- ?s / (2*?d))+ ?r) >= 0" |
2386 also have "\<dots> \<longleftrightarrow> ?a* (- ?s / ((1 + 1)*?d))+ ?r <= 0" by (simp add: r[of "- (?s / ((1 + 1)*?d))"]) |
2339 using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_le_cancel_left[of "2 * ?d" 0 "?a* (- ?s / (2*?d))+ ?r"] by simp |
2387 also have "\<dots> \<longleftrightarrow> (1 + 1)*?d * (?a* (- ?s / ((1 + 1)*?d))+ ?r) >= 0" |
2340 also have "\<dots> \<longleftrightarrow> ?a*?s - 2*?d *?r <= 0" |
2388 using d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' mult_le_cancel_left[of "(1 + 1) * ?d" 0 "?a* (- ?s / ((1 + 1)*?d))+ ?r"] by simp |
|
2389 also have "\<dots> \<longleftrightarrow> ?a*?s - (1 + 1)*?d *?r <= 0" |
|
2390 using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' |
2341 using nonzero_mult_divide_cancel_left[OF d'] d order_less_not_sym[OF d''] less_imp_neq[OF d''] d'' |
2391 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2342 by (simp add: algebra_simps diff_divide_distrib del: left_distrib) |
2392 finally have ?thesis using c d nc nd |
2343 finally have ?thesis using c d nc nd |
2393 apply(simp add: r[of "- (?s / ((1 + 1)*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2344 by(simp add: r[of "- (?s / (2*?d))"] msubstle_def Let_def evaldjf_ex field_simps lt polyneg_norm polymul_norm) |
2394 apply (simp only: one_add_one_is_two[symmetric] of_int_add) |
2345 } |
2395 using d order_less_not_sym[OF d] less_imp_neq[OF d] |
|
2396 by (simp add: field_simps ) } |
|
2397 ultimately show ?thesis by blast |
2346 ultimately show ?thesis by blast |
2398 qed |
2347 qed |
2399 |
2348 |
2400 |
2349 |
2401 fun msubst :: "fm \<Rightarrow> (poly \<times> tm) \<times> (poly \<times> tm) \<Rightarrow> fm" where |
2350 fun msubst :: "fm \<Rightarrow> (poly \<times> tm) \<times> (poly \<times> tm) \<Rightarrow> fm" where |
2422 shows "(\<exists> x. Ifm vs (x#bs) p) = ((Ifm vs (x#bs) (minusinf p)) \<or> (Ifm vs (x#bs) (plusinf p)) \<or> (\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs (x#bs) (msubst p ((c,t),(d,s)))))" |
2371 shows "(\<exists> x. Ifm vs (x#bs) p) = ((Ifm vs (x#bs) (minusinf p)) \<or> (Ifm vs (x#bs) (plusinf p)) \<or> (\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs (x#bs) (msubst p ((c,t),(d,s)))))" |
2423 (is "(\<exists> x. ?I x p) = (?M \<or> ?P \<or> ?F)" is "?E = ?D") |
2372 (is "(\<exists> x. ?I x p) = (?M \<or> ?P \<or> ?F)" is "?E = ?D") |
2424 proof- |
2373 proof- |
2425 from uset_l[OF lp] have th: "\<forall>(c, s)\<in>set (uset p). isnpoly c \<and> tmbound0 s" by blast |
2374 from uset_l[OF lp] have th: "\<forall>(c, s)\<in>set (uset p). isnpoly c \<and> tmbound0 s" by blast |
2426 {fix c t d s assume ctU: "(c,t) \<in>set (uset p)" and dsU: "(d,s) \<in>set (uset p)" |
2375 {fix c t d s assume ctU: "(c,t) \<in>set (uset p)" and dsU: "(d,s) \<in>set (uset p)" |
2427 and pts: "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1+1) # bs) p" |
2376 and pts: "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p" |
2428 from th[rule_format, OF ctU] th[rule_format, OF dsU] have norm:"isnpoly c" "isnpoly d" by simp_all |
2377 from th[rule_format, OF ctU] th[rule_format, OF dsU] have norm:"isnpoly c" "isnpoly d" by simp_all |
2429 from msubst_I[OF lp norm, of vs x bs t s] pts |
2378 from msubst_I[OF lp norm, of vs x bs t s] pts |
2430 have "Ifm vs (x # bs) (msubst p ((c, t), d, s))" ..} |
2379 have "Ifm vs (x # bs) (msubst p ((c, t), d, s))" ..} |
2431 moreover |
2380 moreover |
2432 {fix c t d s assume ctU: "(c,t) \<in>set (uset p)" and dsU: "(d,s) \<in>set (uset p)" |
2381 {fix c t d s assume ctU: "(c,t) \<in>set (uset p)" and dsU: "(d,s) \<in>set (uset p)" |
2433 and pts: "Ifm vs (x # bs) (msubst p ((c, t), d, s))" |
2382 and pts: "Ifm vs (x # bs) (msubst p ((c, t), d, s))" |
2434 from th[rule_format, OF ctU] th[rule_format, OF dsU] have norm:"isnpoly c" "isnpoly d" by simp_all |
2383 from th[rule_format, OF ctU] th[rule_format, OF dsU] have norm:"isnpoly c" "isnpoly d" by simp_all |
2435 from msubst_I[OF lp norm, of vs x bs t s] pts |
2384 from msubst_I[OF lp norm, of vs x bs t s] pts |
2436 have "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1+1) # bs) p" ..} |
2385 have "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p" ..} |
2437 ultimately have th': "(\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1+1) # bs) p) \<longleftrightarrow> ?F" by blast |
2386 ultimately have th': "(\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p) \<longleftrightarrow> ?F" by blast |
2438 from fr_eq[OF lp, of vs bs x, simplified th'] show ?thesis . |
2387 from fr_eq[OF lp, of vs bs x, simplified th'] show ?thesis . |
2439 qed |
2388 qed |
2440 |
2389 |
2441 lemma simpfm_lin: assumes "SORT_CONSTRAINT('a::{field_char_0, field_inverse_zero})" |
2390 lemma simpfm_lin: assumes "SORT_CONSTRAINT('a::{field_char_0, field_inverse_zero})" |
2442 shows "qfree p \<Longrightarrow> islin (simpfm p)" |
2391 shows "qfree p \<Longrightarrow> islin (simpfm p)" |
2691 from uset_l[OF lp] have th: "\<forall>(c, s)\<in>set (uset p). isnpoly c \<and> tmbound0 s" by blast |
2632 from uset_l[OF lp] have th: "\<forall>(c, s)\<in>set (uset p). isnpoly c \<and> tmbound0 s" by blast |
2692 let ?I = "\<lambda>p. Ifm vs (x#bs) p" |
2633 let ?I = "\<lambda>p. Ifm vs (x#bs) p" |
2693 have n2: "isnpoly (C (-2,1))" by (simp add: isnpoly_def) |
2634 have n2: "isnpoly (C (-2,1))" by (simp add: isnpoly_def) |
2694 note eq0 = subst0[OF islin_qf[OF lp], of vs x bs "CP 0\<^sub>p", simplified] |
2635 note eq0 = subst0[OF islin_qf[OF lp], of vs x bs "CP 0\<^sub>p", simplified] |
2695 |
2636 |
2696 have eq1: "(\<exists>(n, t)\<in>set (uset p). ?I (msubst2 p (n *\<^sub>p (C (-2,1))) t)) \<longleftrightarrow> (\<exists>(n, t)\<in>set (uset p). \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * (1 + 1)) # bs) p)" |
2637 have eq1: "(\<exists>(n, t)\<in>set (uset p). ?I (msubst2 p (n *\<^sub>p (C (-2,1))) t)) \<longleftrightarrow> (\<exists>(n, t)\<in>set (uset p). \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * 2) # bs) p)" |
2697 proof- |
2638 proof- |
2698 {fix n t assume H: "(n, t)\<in>set (uset p)" "?I(msubst2 p (n *\<^sub>p C (-2, 1)) t)" |
2639 {fix n t assume H: "(n, t)\<in>set (uset p)" "?I(msubst2 p (n *\<^sub>p C (-2, 1)) t)" |
2699 from H(1) th have "isnpoly n" by blast |
2640 from H(1) th have "isnpoly n" by blast |
2700 hence nn: "isnpoly (n *\<^sub>p (C (-2,1)))" by (simp_all add: polymul_norm n2) |
2641 hence nn: "isnpoly (n *\<^sub>p (C (-2,1)))" by (simp_all add: polymul_norm n2) |
2701 have nn': "allpolys isnpoly (CP (~\<^sub>p (n *\<^sub>p C (-2, 1))))" |
2642 have nn': "allpolys isnpoly (CP (~\<^sub>p (n *\<^sub>p C (-2, 1))))" |
2702 by (simp add: polyneg_norm nn) |
2643 by (simp add: polyneg_norm nn) |
2703 hence nn2: "\<lparr>n *\<^sub>p(C (-2,1)) \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>n \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" using H(2) nn' nn |
2644 hence nn2: "\<lparr>n *\<^sub>p(C (-2,1)) \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>n \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" using H(2) nn' nn |
2704 by (auto simp add: msubst2_def lt zero_less_mult_iff mult_less_0_iff) |
2645 by (auto simp add: msubst2_def lt zero_less_mult_iff mult_less_0_iff) |
2705 from msubst2[OF lp nn nn2(1), of x bs t] |
2646 from msubst2[OF lp nn nn2(1), of x bs t] |
2706 have "\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * (1 + 1)) # bs) p" |
2647 have "\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * 2) # bs) p" |
2707 using H(2) nn2 by (simp add: of_int_minus2 del: minus_add_distrib)} |
2648 using H(2) nn2 by (simp add: mult_minus2_right)} |
2708 moreover |
2649 moreover |
2709 {fix n t assume H: "(n, t)\<in>set (uset p)" "\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * (1 + 1)) # bs) p" |
2650 {fix n t assume H: "(n, t)\<in>set (uset p)" "\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "Ifm vs (- Itm vs (x # bs) t / (\<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> * 2) # bs) p" |
2710 from H(1) th have "isnpoly n" by blast |
2651 from H(1) th have "isnpoly n" by blast |
2711 hence nn: "isnpoly (n *\<^sub>p (C (-2,1)))" "\<lparr>n *\<^sub>p(C (-2,1)) \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2652 hence nn: "isnpoly (n *\<^sub>p (C (-2,1)))" "\<lparr>n *\<^sub>p(C (-2,1)) \<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2712 using H(2) by (simp_all add: polymul_norm n2) |
2653 using H(2) by (simp_all add: polymul_norm n2) |
2713 from msubst2[OF lp nn, of x bs t] have "?I (msubst2 p (n *\<^sub>p (C (-2,1))) t)" using H(2,3) by (simp add: of_int_minus2 del: minus_add_distrib)} |
2654 from msubst2[OF lp nn, of x bs t] have "?I (msubst2 p (n *\<^sub>p (C (-2,1))) t)" using H(2,3) by (simp add: mult_minus2_right)} |
2714 ultimately show ?thesis by blast |
2655 ultimately show ?thesis by blast |
2715 qed |
2656 qed |
2716 have eq2: "(\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))) \<longleftrightarrow> (\<exists>(n, t)\<in>set (uset p). |
2657 have eq2: "(\<exists> (c,t) \<in> set (uset p). \<exists> (d,s) \<in> set (uset p). Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))) \<longleftrightarrow> (\<exists>(n, t)\<in>set (uset p). |
2717 \<exists>(m, s)\<in>set (uset p). \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> \<lparr>m\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs ((- Itm vs (x # bs) t / \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>m\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1 + 1) # bs) p)" |
2658 \<exists>(m, s)\<in>set (uset p). \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> \<lparr>m\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs ((- Itm vs (x # bs) t / \<lparr>n\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>m\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p)" |
2718 proof- |
2659 proof- |
2719 {fix c t d s assume H: "(c,t) \<in> set (uset p)" "(d,s) \<in> set (uset p)" |
2660 {fix c t d s assume H: "(c,t) \<in> set (uset p)" "(d,s) \<in> set (uset p)" |
2720 "Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))" |
2661 "Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))" |
2721 from H(1,2) th have "isnpoly c" "isnpoly d" by blast+ |
2662 from H(1,2) th have "isnpoly c" "isnpoly d" by blast+ |
2722 hence nn: "isnpoly (C (-2, 1) *\<^sub>p c*\<^sub>p d)" |
2663 hence nn: "isnpoly (C (-2, 1) *\<^sub>p c*\<^sub>p d)" |
2724 have stupid: "allpolys isnpoly (CP (~\<^sub>p (C (-2, 1) *\<^sub>p c *\<^sub>p d)))" "allpolys isnpoly (CP ((C (-2, 1) *\<^sub>p c *\<^sub>p d)))" |
2665 have stupid: "allpolys isnpoly (CP (~\<^sub>p (C (-2, 1) *\<^sub>p c *\<^sub>p d)))" "allpolys isnpoly (CP ((C (-2, 1) *\<^sub>p c *\<^sub>p d)))" |
2725 by (simp_all add: polyneg_norm nn) |
2666 by (simp_all add: polyneg_norm nn) |
2726 have nn': "\<lparr>(C (-2, 1) *\<^sub>p c*\<^sub>p d)\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2667 have nn': "\<lparr>(C (-2, 1) *\<^sub>p c*\<^sub>p d)\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2727 using H(3) by (auto simp add: msubst2_def lt[OF stupid(1)] lt[OF stupid(2)] zero_less_mult_iff mult_less_0_iff) |
2668 using H(3) by (auto simp add: msubst2_def lt[OF stupid(1)] lt[OF stupid(2)] zero_less_mult_iff mult_less_0_iff) |
2728 from msubst2[OF lp nn nn'(1), of x bs ] H(3) nn' |
2669 from msubst2[OF lp nn nn'(1), of x bs ] H(3) nn' |
2729 have "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1 + 1) # bs) p" |
2670 have "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0 \<and> Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p" |
2730 apply (simp add: add_divide_distrib of_int_minus2 del: minus_add_distrib) |
2671 apply (simp add: add_divide_distrib mult_minus2_left) |
2731 by (simp add: mult_commute)} |
2672 by (simp add: mult_commute)} |
2732 moreover |
2673 moreover |
2733 {fix c t d s assume H: "(c,t) \<in> set (uset p)" "(d,s) \<in> set (uset p)" |
2674 {fix c t d s assume H: "(c,t) \<in> set (uset p)" "(d,s) \<in> set (uset p)" |
2734 "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / (1 + 1) # bs) p" |
2675 "\<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "\<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" "Ifm vs ((- Itm vs (x # bs) t / \<lparr>c\<rparr>\<^sub>p\<^bsup>vs\<^esup> + - Itm vs (x # bs) s / \<lparr>d\<rparr>\<^sub>p\<^bsup>vs\<^esup>) / 2 # bs) p" |
2735 from H(1,2) th have "isnpoly c" "isnpoly d" by blast+ |
2676 from H(1,2) th have "isnpoly c" "isnpoly d" by blast+ |
2736 hence nn: "isnpoly (C (-2, 1) *\<^sub>p c*\<^sub>p d)" "\<lparr>(C (-2, 1) *\<^sub>p c*\<^sub>p d)\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2677 hence nn: "isnpoly (C (-2, 1) *\<^sub>p c*\<^sub>p d)" "\<lparr>(C (-2, 1) *\<^sub>p c*\<^sub>p d)\<rparr>\<^sub>p\<^bsup>vs\<^esup> \<noteq> 0" |
2737 using H(3,4) by (simp_all add: polymul_norm n2) |
2678 using H(3,4) by (simp_all add: polymul_norm n2) |
2738 from msubst2[OF lp nn, of x bs ] H(3,4,5) |
2679 from msubst2[OF lp nn, of x bs ] H(3,4,5) |
2739 have "Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))" apply (simp add: add_divide_distrib of_int_minus2 del: minus_add_distrib)by (simp add: mult_commute)} |
2680 have "Ifm vs (x#bs) (msubst2 p (C (-2, 1) *\<^sub>p c*\<^sub>p d) (Add (Mul d t) (Mul c s)))" apply (simp add: add_divide_distrib mult_minus2_left) by (simp add: mult_commute)} |
2740 ultimately show ?thesis by blast |
2681 ultimately show ?thesis by blast |
2741 qed |
2682 qed |
2742 from fr_eq2[OF lp, of vs bs x] show ?thesis |
2683 from fr_eq2[OF lp, of vs bs x] show ?thesis |
2743 unfolding eq0 eq1 eq2 by blast |
2684 unfolding eq0 eq1 eq2 by blast |
2744 qed |
2685 qed |