src/HOL/IMP/Abs_Int3.thy
changeset 67019 7a3724078363
parent 64267 b9a1486e79be
child 67399 eab6ce8368fa
equal deleted inserted replaced
67018:f6aa133f9b16 67019:7a3724078363
   185 and Pinv: "!!x. P x \<Longrightarrow> P(f x)" "!!x1 x2. P x1 \<Longrightarrow> P x2 \<Longrightarrow> P(x1 \<triangle> x2)"
   185 and Pinv: "!!x. P x \<Longrightarrow> P(f x)" "!!x1 x2. P x1 \<Longrightarrow> P x2 \<Longrightarrow> P(x1 \<triangle> x2)"
   186 and "P p0" and "f p0 \<le> p0" and "iter_narrow f p0 = Some p"
   186 and "P p0" and "f p0 \<le> p0" and "iter_narrow f p0 = Some p"
   187 shows "P p \<and> f p \<le> p"
   187 shows "P p \<and> f p \<le> p"
   188 proof-
   188 proof-
   189   let ?Q = "%p. P p \<and> f p \<le> p \<and> p \<le> p0"
   189   let ?Q = "%p. P p \<and> f p \<le> p \<and> p \<le> p0"
   190   { fix p assume "?Q p"
   190   have "?Q (p \<triangle> f p)" if Q: "?Q p" for p
   191     note P = conjunct1[OF this] and 12 = conjunct2[OF this]
   191   proof auto
       
   192     note P = conjunct1[OF Q] and 12 = conjunct2[OF Q]
   192     note 1 = conjunct1[OF 12] and 2 = conjunct2[OF 12]
   193     note 1 = conjunct1[OF 12] and 2 = conjunct2[OF 12]
   193     let ?p' = "p \<triangle> f p"
   194     let ?p' = "p \<triangle> f p"
   194     have "?Q ?p'"
   195     show "P ?p'" by (blast intro: P Pinv)
   195     proof auto
   196     have "f ?p' \<le> f p" by(rule mono[OF `P (p \<triangle> f p)`  P narrow2_acom[OF 1]])
   196       show "P ?p'" by (blast intro: P Pinv)
   197     also have "\<dots> \<le> ?p'" by(rule narrow1_acom[OF 1])
   197       have "f ?p' \<le> f p" by(rule mono[OF `P (p \<triangle> f p)`  P narrow2_acom[OF 1]])
   198     finally show "f ?p' \<le> ?p'" .
   198       also have "\<dots> \<le> ?p'" by(rule narrow1_acom[OF 1])
   199     have "?p' \<le> p" by (rule narrow2_acom[OF 1])
   199       finally show "f ?p' \<le> ?p'" .
   200     also have "p \<le> p0" by(rule 2)
   200       have "?p' \<le> p" by (rule narrow2_acom[OF 1])
   201     finally show "?p' \<le> p0" .
   201       also have "p \<le> p0" by(rule 2)
   202   qed
   202       finally show "?p' \<le> p0" .
       
   203     qed
       
   204   }
       
   205   thus ?thesis
   203   thus ?thesis
   206     using while_option_rule[where P = ?Q, OF _ assms(6)[simplified iter_narrow_def]]
   204     using while_option_rule[where P = ?Q, OF _ assms(6)[simplified iter_narrow_def]]
   207     by (blast intro: assms(4,5) le_refl)
   205     by (blast intro: assms(4,5) le_refl)
   208 qed
   206 qed
   209 
   207