src/HOL/Decision_Procs/MIR.thy
changeset 56410 a14831ac3023
parent 56154 f0a927235162
child 56479 91958d4b30f7
equal deleted inserted replaced
56409:36489d77c484 56410:a14831ac3023
  2066   then have "c > 0" by simp
  2066   then have "c > 0" by simp
  2067   hence rcpos: "real c > 0" by simp
  2067   hence rcpos: "real c > 0" by simp
  2068   from 3 have nbe: "numbound0 e" by simp
  2068   from 3 have nbe: "numbound0 e" by simp
  2069   fix y
  2069   fix y
  2070   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Eq (CN 0 c e))) = ?I x (Eq (CN 0 c e))"
  2070   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Eq (CN 0 c e))) = ?I x (Eq (CN 0 c e))"
  2071   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2071   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2072     fix x :: int
  2072     fix x :: int
  2073     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2073     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2074     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2074     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2075     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2075     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2076       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2076       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2083   case (4 c e) 
  2083   case (4 c e) 
  2084   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2084   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2085   from 4 have nbe: "numbound0 e" by simp
  2085   from 4 have nbe: "numbound0 e" by simp
  2086   fix y
  2086   fix y
  2087   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (NEq (CN 0 c e))) = ?I x (NEq (CN 0 c e))"
  2087   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (NEq (CN 0 c e))) = ?I x (NEq (CN 0 c e))"
  2088   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2088   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2089     fix x :: int
  2089     fix x :: int
  2090     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2090     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2091     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2091     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2092     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2092     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2093       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2093       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2100   case (5 c e) 
  2100   case (5 c e) 
  2101   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2101   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2102   from 5 have nbe: "numbound0 e" by simp
  2102   from 5 have nbe: "numbound0 e" by simp
  2103   fix y
  2103   fix y
  2104   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Lt (CN 0 c e))) = ?I x (Lt (CN 0 c e))"
  2104   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Lt (CN 0 c e))) = ?I x (Lt (CN 0 c e))"
  2105   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2105   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2106     fix x :: int
  2106     fix x :: int
  2107     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2107     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2108     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2108     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2109     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2109     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2110       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2110       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2116   case (6 c e) 
  2116   case (6 c e) 
  2117   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2117   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2118   from 6 have nbe: "numbound0 e" by simp
  2118   from 6 have nbe: "numbound0 e" by simp
  2119   fix y
  2119   fix y
  2120   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Le (CN 0 c e))) = ?I x (Le (CN 0 c e))"
  2120   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Le (CN 0 c e))) = ?I x (Le (CN 0 c e))"
  2121   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2121   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2122     fix x :: int
  2122     fix x :: int
  2123     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2123     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2124     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2124     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2125     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2125     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2126       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2126       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2132   case (7 c e) 
  2132   case (7 c e) 
  2133   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2133   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2134   from 7 have nbe: "numbound0 e" by simp
  2134   from 7 have nbe: "numbound0 e" by simp
  2135   fix y
  2135   fix y
  2136   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Gt (CN 0 c e))) = ?I x (Gt (CN 0 c e))"
  2136   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Gt (CN 0 c e))) = ?I x (Gt (CN 0 c e))"
  2137   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2137   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2138     fix x :: int
  2138     fix x :: int
  2139     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2139     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2140     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2140     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2141     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2141     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2142       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2142       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2148   case (8 c e) 
  2148   case (8 c e) 
  2149   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2149   then have "c > 0" by simp hence rcpos: "real c > 0" by simp
  2150   from 8 have nbe: "numbound0 e" by simp
  2150   from 8 have nbe: "numbound0 e" by simp
  2151   fix y
  2151   fix y
  2152   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Ge (CN 0 c e))) = ?I x (Ge (CN 0 c e))"
  2152   have "\<forall> x < (floor (- (Inum (y#bs) e) / (real c))). ?I x (?M (Ge (CN 0 c e))) = ?I x (Ge (CN 0 c e))"
  2153   proof (simp add: less_floor_eq , rule allI, rule impI) 
  2153   proof (simp add: divide_minus_left less_floor_eq , rule allI, rule impI) 
  2154     fix x :: int
  2154     fix x :: int
  2155     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2155     assume A: "real x + 1 \<le> - (Inum (y # bs) e / real c)"
  2156     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2156     hence th1:"real x < - (Inum (y # bs) e / real c)" by simp
  2157     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2157     with rcpos  have "(real c)*(real  x) < (real c)*(- (Inum (y # bs) e / real c))"
  2158       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  2158       by (simp only: mult_strict_left_mono [OF th1 rcpos])
  4265   let ?e="Inum (a#bs) e"
  4265   let ?e="Inum (a#bs) e"
  4266   let ?z = "(- ?e) / real c"
  4266   let ?z = "(- ?e) / real c"
  4267   {fix x
  4267   {fix x
  4268     assume xz: "x > ?z"
  4268     assume xz: "x > ?z"
  4269     with mult_strict_right_mono [OF xz cp] cp
  4269     with mult_strict_right_mono [OF xz cp] cp
  4270     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4270     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4271     hence "real c * x + ?e > 0" by arith
  4271     hence "real c * x + ?e > 0" by arith
  4272     hence "real c * x + ?e \<noteq> 0" by simp
  4272     hence "real c * x + ?e \<noteq> 0" by simp
  4273     with xz have "?P ?z x (Eq (CN 0 c e))"
  4273     with xz have "?P ?z x (Eq (CN 0 c e))"
  4274       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4274       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4275   hence "\<forall> x > ?z. ?P ?z x (Eq (CN 0 c e))" by simp
  4275   hence "\<forall> x > ?z. ?P ?z x (Eq (CN 0 c e))" by simp
  4282   let ?e="Inum (a#bs) e"
  4282   let ?e="Inum (a#bs) e"
  4283   let ?z = "(- ?e) / real c"
  4283   let ?z = "(- ?e) / real c"
  4284   {fix x
  4284   {fix x
  4285     assume xz: "x > ?z"
  4285     assume xz: "x > ?z"
  4286     with mult_strict_right_mono [OF xz cp] cp
  4286     with mult_strict_right_mono [OF xz cp] cp
  4287     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4287     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4288     hence "real c * x + ?e > 0" by arith
  4288     hence "real c * x + ?e > 0" by arith
  4289     hence "real c * x + ?e \<noteq> 0" by simp
  4289     hence "real c * x + ?e \<noteq> 0" by simp
  4290     with xz have "?P ?z x (NEq (CN 0 c e))"
  4290     with xz have "?P ?z x (NEq (CN 0 c e))"
  4291       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4291       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4292   hence "\<forall> x > ?z. ?P ?z x (NEq (CN 0 c e))" by simp
  4292   hence "\<forall> x > ?z. ?P ?z x (NEq (CN 0 c e))" by simp
  4299   let ?e="Inum (a#bs) e"
  4299   let ?e="Inum (a#bs) e"
  4300   let ?z = "(- ?e) / real c"
  4300   let ?z = "(- ?e) / real c"
  4301   {fix x
  4301   {fix x
  4302     assume xz: "x > ?z"
  4302     assume xz: "x > ?z"
  4303     with mult_strict_right_mono [OF xz cp] cp
  4303     with mult_strict_right_mono [OF xz cp] cp
  4304     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4304     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4305     hence "real c * x + ?e > 0" by arith
  4305     hence "real c * x + ?e > 0" by arith
  4306     with xz have "?P ?z x (Lt (CN 0 c e))"
  4306     with xz have "?P ?z x (Lt (CN 0 c e))"
  4307       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4307       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4308   hence "\<forall> x > ?z. ?P ?z x (Lt (CN 0 c e))" by simp
  4308   hence "\<forall> x > ?z. ?P ?z x (Lt (CN 0 c e))" by simp
  4309   thus ?case by blast
  4309   thus ?case by blast
  4315   let ?e="Inum (a#bs) e"
  4315   let ?e="Inum (a#bs) e"
  4316   let ?z = "(- ?e) / real c"
  4316   let ?z = "(- ?e) / real c"
  4317   {fix x
  4317   {fix x
  4318     assume xz: "x > ?z"
  4318     assume xz: "x > ?z"
  4319     with mult_strict_right_mono [OF xz cp] cp
  4319     with mult_strict_right_mono [OF xz cp] cp
  4320     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4320     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4321     hence "real c * x + ?e > 0" by arith
  4321     hence "real c * x + ?e > 0" by arith
  4322     with xz have "?P ?z x (Le (CN 0 c e))"
  4322     with xz have "?P ?z x (Le (CN 0 c e))"
  4323       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4323       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4324   hence "\<forall> x > ?z. ?P ?z x (Le (CN 0 c e))" by simp
  4324   hence "\<forall> x > ?z. ?P ?z x (Le (CN 0 c e))" by simp
  4325   thus ?case by blast
  4325   thus ?case by blast
  4331   let ?e="Inum (a#bs) e"
  4331   let ?e="Inum (a#bs) e"
  4332   let ?z = "(- ?e) / real c"
  4332   let ?z = "(- ?e) / real c"
  4333   {fix x
  4333   {fix x
  4334     assume xz: "x > ?z"
  4334     assume xz: "x > ?z"
  4335     with mult_strict_right_mono [OF xz cp] cp
  4335     with mult_strict_right_mono [OF xz cp] cp
  4336     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4336     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4337     hence "real c * x + ?e > 0" by arith
  4337     hence "real c * x + ?e > 0" by arith
  4338     with xz have "?P ?z x (Gt (CN 0 c e))"
  4338     with xz have "?P ?z x (Gt (CN 0 c e))"
  4339       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4339       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"] by simp }
  4340   hence "\<forall> x > ?z. ?P ?z x (Gt (CN 0 c e))" by simp
  4340   hence "\<forall> x > ?z. ?P ?z x (Gt (CN 0 c e))" by simp
  4341   thus ?case by blast
  4341   thus ?case by blast
  4347   let ?e="Inum (a#bs) e"
  4347   let ?e="Inum (a#bs) e"
  4348   let ?z = "(- ?e) / real c"
  4348   let ?z = "(- ?e) / real c"
  4349   {fix x
  4349   {fix x
  4350     assume xz: "x > ?z"
  4350     assume xz: "x > ?z"
  4351     with mult_strict_right_mono [OF xz cp] cp
  4351     with mult_strict_right_mono [OF xz cp] cp
  4352     have "(real c * x > - ?e)" by (simp add: mult_ac)
  4352     have "(real c * x > - ?e)" by (simp add: divide_minus_left mult_ac)
  4353     hence "real c * x + ?e > 0" by arith
  4353     hence "real c * x + ?e > 0" by arith
  4354     with xz have "?P ?z x (Ge (CN 0 c e))"
  4354     with xz have "?P ?z x (Ge (CN 0 c e))"
  4355       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"]   by simp }
  4355       using numbound0_I[OF nb, where b="x" and bs="bs" and b'="a"]   by simp }
  4356   hence "\<forall> x > ?z. ?P ?z x (Ge (CN 0 c e))" by simp
  4356   hence "\<forall> x > ?z. ?P ?z x (Ge (CN 0 c e))" by simp
  4357   thus ?case by blast
  4357   thus ?case by blast